@lovrabet/lovrabet-cli 2.2.1-beta.1 → 2.2.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -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/schedule/index.js +1 -1
  39. package/lib/commands/schema.js +1 -1
  40. package/lib/commands/service/dynamic.js +1 -1
  41. package/lib/commands/service/function-name-adapter.js +1 -1
  42. package/lib/commands/service/index.js +1 -1
  43. package/lib/commands/service/registry.js +1 -1
  44. package/lib/commands/skill/commands/create.js +1 -1
  45. package/lib/commands/skill/commands/diagram.js +1 -1
  46. package/lib/commands/skill/commands/install.js +1 -1
  47. package/lib/commands/skill/commands/list.js +1 -1
  48. package/lib/commands/skill/commands/push.js +1 -1
  49. package/lib/commands/skill/commands/validate.js +1 -1
  50. package/lib/commands/skill/diagram.js +1 -1
  51. package/lib/commands/skill/flags.js +1 -1
  52. package/lib/commands/skill/index.js +1 -1
  53. package/lib/commands/skill/manifest-helpers.js +1 -1
  54. package/lib/commands/skill/push-execute.js +1 -1
  55. package/lib/commands/skill/push-flow-helpers.js +1 -1
  56. package/lib/commands/skill/push-retarget.js +1 -1
  57. package/lib/commands/skill/scopes.js +1 -1
  58. package/lib/commands/skill/summary.js +1 -1
  59. package/lib/commands/skill/templates.js +1 -1
  60. package/lib/commands/skill/validate.js +1 -1
  61. package/lib/commands/sql/detail.js +1 -1
  62. package/lib/commands/sql/exec.js +1 -1
  63. package/lib/commands/sql/index.js +1 -1
  64. package/lib/commands/update.js +1 -1
  65. package/lib/commands/workspace/index.js +1 -1
  66. package/lib/config/schema.js +1 -1
  67. package/lib/constant/app.js +1 -1
  68. package/lib/constant/auth-mode.js +1 -1
  69. package/lib/constant/cli.js +1 -1
  70. package/lib/constant/defaults.js +1 -1
  71. package/lib/constant/distribution.js +1 -1
  72. package/lib/constant/domain.js +1 -1
  73. package/lib/constant/env.js +1 -1
  74. package/lib/constant/output.js +1 -1
  75. package/lib/constant/product.js +1 -1
  76. package/lib/constant/risk.js +1 -1
  77. package/lib/constant/url.js +1 -1
  78. package/lib/context.js +1 -1
  79. package/lib/core/api-client.js +1 -1
  80. package/lib/core/db-resolver.js +1 -1
  81. package/lib/core/sdk-client.js +1 -1
  82. package/lib/errors.js +1 -1
  83. package/lib/framework/build-all-flags.js +1 -1
  84. package/lib/framework/dryrun.js +1 -1
  85. package/lib/framework/flags.js +1 -1
  86. package/lib/framework/help.js +1 -1
  87. package/lib/framework/index.js +1 -1
  88. package/lib/framework/output.js +1 -1
  89. package/lib/framework/preparse.js +1 -1
  90. package/lib/framework/rate-limit.js +1 -1
  91. package/lib/framework/raw-flags.js +1 -1
  92. package/lib/framework/response.js +1 -1
  93. package/lib/framework/runner-confirmation.js +1 -1
  94. package/lib/framework/runner-error.js +1 -1
  95. package/lib/framework/runner.js +1 -1
  96. package/lib/framework/schema-export.js +1 -1
  97. package/lib/framework/service-order.js +1 -1
  98. package/lib/framework/types.js +1 -1
  99. package/lib/generated/build-info.d.ts +4 -4
  100. package/lib/generated/build-info.js +1 -1
  101. package/lib/help.js +1 -1
  102. package/lib/postinstall.js +1 -1
  103. package/lib/runtime/confirmation.js +1 -1
  104. package/lib/runtime/event.js +1 -1
  105. package/lib/runtime/index.js +1 -1
  106. package/lib/runtime/queue.js +1 -1
  107. package/lib/runtime/resolve.js +1 -1
  108. package/lib/skills/builtin-skill.js +1 -1
  109. package/lib/skills/npx-skills-add.js +1 -1
  110. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  111. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  112. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  113. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  114. package/lib/skills/runtime-skill-sync/links.js +1 -1
  115. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  116. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  117. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  118. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  119. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  120. package/lib/skills/runtime-skill-sync/push.js +1 -1
  121. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  122. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  123. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  124. package/lib/skills/runtime-skill-sync.js +1 -1
  125. package/lib/skills/skill-presence.js +1 -1
  126. package/lib/utils/apply-jq-filter.js +1 -1
  127. package/lib/utils/logger.js +1 -1
  128. package/lib/utils/lossless-json.js +1 -1
  129. package/lib/utils/params.js +1 -1
  130. package/lib/utils/platform.js +1 -1
  131. package/lib/utils/update-notice.js +1 -1
  132. package/lib/utils/version.js +1 -1
  133. package/lib/utils/write-cli-side-channel.js +1 -1
  134. package/package.json +2 -1
  135. package/skills/lovrabet/SKILL.md +1 -1
  136. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- (function(_0x46938d,_0x52b6b9){const _0xc71d55=a39_0x1016,_0x310224=_0x46938d();while(!![]){try{const _0x494b17=parseInt(_0xc71d55(0xdd))/0x1*(-parseInt(_0xc71d55(0xe1))/0x2)+-parseInt(_0xc71d55(0x141))/0x3+parseInt(_0xc71d55(0x122))/0x4*(parseInt(_0xc71d55(0xee))/0x5)+parseInt(_0xc71d55(0x10b))/0x6*(parseInt(_0xc71d55(0x13c))/0x7)+-parseInt(_0xc71d55(0x13f))/0x8+-parseInt(_0xc71d55(0xfe))/0x9+parseInt(_0xc71d55(0x104))/0xa*(parseInt(_0xc71d55(0x116))/0xb);if(_0x494b17===_0x52b6b9)break;else _0x310224['push'](_0x310224['shift']());}catch(_0x57cd7e){_0x310224['push'](_0x310224['shift']());}}}(a39_0x4f93,0x4e3e8));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(_0x354352,_0x56fb86){const _0x506db6=a39_0x1016,_0x49ecfa=listLocalServiceTrees();let _0x5ac959;for(const _0x406513 of _0x49ecfa){const _0x3a5e35=matchServiceTreeCommand(_0x406513,_0x354352);if(!_0x3a5e35)continue;(!_0x5ac959||_0x3a5e35['command'][_0x506db6(0xe9)]['length']>_0x5ac959[_0x506db6(0x10d)][_0x506db6(0xe9)][_0x506db6(0x106)])&&(_0x5ac959={'tree':_0x406513,'command':_0x3a5e35[_0x506db6(0x10d)],'remainingArgs':_0x3a5e35[_0x506db6(0xfa)]});}if(!_0x5ac959)return undefined;const _0x355069={..._0x56fb86};return applyAppBinding(_0x5ac959[_0x506db6(0x136)],_0x5ac959['command'],_0x355069),{'definition':buildDynamicCommandDefinition(_0x5ac959['tree'],_0x5ac959[_0x506db6(0x10d)]),'args':_0x5ac959[_0x506db6(0xfa)],'flags':_0x355069,'tree':_0x5ac959['tree'],'command':_0x5ac959[_0x506db6(0x10d)]};}export function generateDynamicServiceHelp(_0x56f4fe){const _0x400d59=a39_0x1016,_0x22b4b2=listLocalServiceTrees()[_0x400d59(0x135)](_0x28e58a=>_0x28e58a[_0x400d59(0xf0)]['code']===_0x56f4fe);if(!_0x22b4b2)return undefined;const _0x26ca3f=[CLI_BIN_NAME+'\x20'+_0x56f4fe+'\x20<command>\x20[flags]','',_0x22b4b2[_0x400d59(0xf0)]['name']||_0x56f4fe,_0x22b4b2['service'][_0x400d59(0x13b)]?'\x20\x20'+_0x22b4b2[_0x400d59(0xf0)][_0x400d59(0x13b)]:'','','Commands:',..._0x22b4b2['commands'][_0x400d59(0xdb)](_0x509829=>{const _0x3a49ac=_0x400d59,_0x4c9ca6=_0x509829[_0x3a49ac(0xe9)][_0x3a49ac(0xe8)](0x1)[_0x3a49ac(0x12e)]('\x20'),_0x82cd35=_0x509829['risk']===_0x3a49ac(0x119)?'':'\x20['+_0x509829[_0x3a49ac(0xe2)]+']';return'\x20\x20'+_0x4c9ca6[_0x3a49ac(0x11f)](0x18)+'\x20'+(_0x509829[_0x3a49ac(0x13b)]||'')+_0x82cd35;}),'','Use\x20`'+CLI_BIN_NAME+_0x400d59(0x127)+_0x56f4fe+_0x400d59(0xe3)][_0x400d59(0xf6)](Boolean);return _0x26ca3f['join']('\x0a');}export function listDynamicServiceEntries(){const _0x3b8f44=a39_0x1016;return listLocalServices()[_0x3b8f44(0xdb)](_0x5c1d1d=>{const _0x5792d7=_0x3b8f44,_0x12bef9=_0x5c1d1d[_0x5792d7(0x117)];return{'service':_0x12bef9['service'][_0x5792d7(0x120)],'label':_0x12bef9[_0x5792d7(0xf0)][_0x5792d7(0xf1)]||_0x12bef9[_0x5792d7(0xf0)][_0x5792d7(0x120)],'commands':_0x12bef9[_0x5792d7(0x139)][_0x5792d7(0xdb)](_0x28870a=>({'command':dynamicCommandName(_0x28870a),'description':_0x28870a[_0x5792d7(0x13b)]||_0x5792d7(0xfb)+_0x28870a['cliPath'],'tag':riskTag(_0x28870a[_0x5792d7(0xe2)])}))};});}export function getDynamicServiceEntry(_0x4097bd){const _0x4cf4ac=a39_0x1016;return listDynamicServiceEntries()[_0x4cf4ac(0x135)](_0x21dbe3=>_0x21dbe3['service']===_0x4097bd);}export function listDynamicServiceDefinitions(_0x25d5b9){const _0x477a4c=a39_0x1016;return listLocalServiceTrees()[_0x477a4c(0xf6)](_0x14b5f0=>!_0x25d5b9||_0x14b5f0[_0x477a4c(0xf0)]['code']===_0x25d5b9)[_0x477a4c(0xf3)](_0x21767b=>_0x21767b[_0x477a4c(0x139)][_0x477a4c(0xdb)](_0x344881=>buildDynamicCommandDefinition(_0x21767b,_0x344881)));}export function getDynamicServiceDefinitions(_0x362362){const _0x4b4cca=a39_0x1016,_0x3f458d=listDynamicServiceDefinitions(_0x362362);return _0x3f458d[_0x4b4cca(0x106)]>0x0?_0x3f458d:undefined;}export function findDynamicServiceDefinition(_0x1fba3b,_0x5a6210){const _0x58bb96=a39_0x1016;return listDynamicServiceDefinitions(_0x1fba3b)[_0x58bb96(0x135)](_0x1b47e4=>_0x1b47e4[_0x58bb96(0x10d)]===_0x5a6210);}export function buildDynamicCommandDefinition(_0x1c0aa2,_0xd3f715){const _0x50e43c=a39_0x1016;return{'service':_0x1c0aa2[_0x50e43c(0xf0)][_0x50e43c(0x120)],'command':dynamicCommandName(_0xd3f715),'description':_0xd3f715['description']||_0x50e43c(0xfb)+_0xd3f715['cliPath'],'risk':_0xd3f715[_0x50e43c(0xe2)],..._0xd3f715[_0x50e43c(0xe2)]===_0x50e43c(0x119)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0xd3f715)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0xd3f715[_0x50e43c(0x109)][_0x50e43c(0xdb)](_0xeafe0e=>({'name':_0xeafe0e[_0x50e43c(0xf1)],'description':_0xeafe0e[_0x50e43c(0x13b)]||_0xeafe0e[_0x50e43c(0xf1)],'required':_0xeafe0e['required']})),'flags':_0xd3f715[_0x50e43c(0x124)][_0x50e43c(0xdb)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0xd3f715),async 'dryRun'(_0xcdb85e){const _0x1d8bc0=_0x50e43c,_0x1d478e=await compilePlan(_0xd3f715,_0xcdb85e);return{'method':'SERVICE_TREE','url':_0xd3f715[_0x1d8bc0(0x103)],'body':{'target':targetPreview(_0x1d478e),'params':_0x1d478e[_0x1d8bc0(0x123)]},'description':_0x1d8bc0(0x12a)+_0xd3f715[_0x1d8bc0(0x103)]};},async 'execute'(_0x56f6f8){const _0x22c0ae=_0x50e43c,_0xbdc88c=await compilePlan(_0xd3f715,_0x56f6f8),_0x1f1873=Date[_0x22c0ae(0xe0)](),_0x58aeab=await executePlan(_0xbdc88c,_0xd3f715,_0x56f6f8),_0x50c792=Date[_0x22c0ae(0xe0)]()-_0x1f1873;return{'ok':!![],'data':{'service':_0x1c0aa2[_0x22c0ae(0xf0)],'command':_0xd3f715[_0x22c0ae(0x103)],'target':targetPreview(_0xbdc88c),'result':_0x58aeab,'elapsed':_0x50c792},'message':_0x22c0ae(0x131)+_0xd3f715['cliPath']+_0x22c0ae(0x12c)+_0x50c792+'ms'};}};}function buildDynamicConfirmationDescription(_0x3f7f6e){const _0x3b1178=a39_0x1016,_0x4691fa=_0x3f7f6e[_0x3b1178(0x13b)]||_0x3f7f6e[_0x3b1178(0x103)],_0x1bcf8e=_0x3f7f6e[_0x3b1178(0xe2)]===_0x3b1178(0x145)?_0x3b1178(0xda):_0x3b1178(0xf5);return _0x3b1178(0x134)+_0x4691fa+'”。'+_0x1bcf8e;}function dynamicCommandName(_0x1adde1){const _0x277610=a39_0x1016;return _0x1adde1[_0x277610(0xe9)]['slice'](0x1)[_0x277610(0x12e)]('\x20');}function riskTag(_0x548c51){const _0x5310cd=a39_0x1016;return _0x548c51===_0x5310cd(0x119)?'':_0x5310cd(0x115)+_0x548c51+']';}function flagToCommandFlag(_0x362ee5){const _0x31dbc3=a39_0x1016;return{'name':_0x362ee5['cliName'],'type':_0x362ee5[_0x31dbc3(0x144)]===_0x31dbc3(0x143)?_0x31dbc3(0xef):_0x362ee5[_0x31dbc3(0x144)],'description':_0x362ee5[_0x31dbc3(0x13b)]||_0x362ee5[_0x31dbc3(0xf1)],'required':_0x362ee5[_0x31dbc3(0x10c)],'default':isPrimitiveFlagDefault(_0x362ee5[_0x31dbc3(0x10a)])?_0x362ee5['default']:undefined,'enum':_0x362ee5[_0x31dbc3(0xec)]};}function a39_0x4f93(){const _0x3f45bc=['Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','cliPath','210nLnfMY','data','length','operator','\x20\x20\x20\x20datasetCode:\x20','args','default','36olhmaf','required','command','bffId','Unknown\x20appRef\x20\x22','\x20\x20\x20\x20sqlCode:\x20','\x20->\x20','\x22\x20in\x20service\x20command\x20','kind','push','\x20\x20[','105688yUYmWx','normalizedManifest','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','read','mapTo','employeeId','\x20\x20\x20\x20functionName:\x20','\x20\x20\x20\x20','userId','padEnd','code','\x20requires\x20target.functionName.','676524OxFKio','params','flags','sqlCode','tableName','\x20service\x20detail\x20--service\x20','userName','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','Preview\x20dynamic\x20service\x20command:\x20','appBindings','\x20completed\x20in\x20','startsWith','join','username','bffCode','Service\x20command\x20','validation','number','将通过\x20Service\x20Tree\x20执行“','find','tree','appcode','dbtableConfig','commands','\x20\x20MAP\x20TO','description','312781GndXLU','fromEntries','entries','895728DXzRps','appCode','479226nNksxu','app','json','type','high-risk-write','source','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','map','\x20\x20\x20\x20command:\x20','167887KNjGIn','boolean','target','now','2LYMXub','risk','`\x20to\x20inspect\x20the\x20manifest.','ctx.','sql','datasetCode','nickName','slice','fullPath','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','datatable','enum','\x20\x20\x20\x20kind:\x20\x20\x20\x20','10MJcpyU','string','service','name','appRef','flatMap','tenantCode','该命令被清单标记为写入,可能修改业务数据或服务状态。','filter','bff','envName','env','remainingArgs','Run\x20service\x20command\x20','scriptName','rawFlags','432405Wrqgfn','\x20requires\x20target.sqlCode.','trim','Cannot\x20resolve\x20datatable\x20\x22'];a39_0x4f93=function(){return _0x3f45bc;};return a39_0x4f93();}async function compilePlan(_0x2ef3b2,_0xa690a2){const _0x278801=a39_0x1016;return compileServiceTreeCommand(_0x2ef3b2,{'flags':_0xa690a2[_0x278801(0xfd)],'args':_0xa690a2[_0x278801(0x109)],'context':await buildServiceContext(_0x2ef3b2,_0xa690a2)});}async function buildServiceContext(_0x451d21,_0xedc8dc){const _0x307f55=a39_0x1016,_0x3d0d0a={'appCode':_0xedc8dc[_0x307f55(0x140)],'env':_0xedc8dc[_0x307f55(0xf8)],'envName':_0xedc8dc[_0x307f55(0xf8)]};if(!usesRuntimeContext(_0x451d21))return _0x3d0d0a;const _0x5f3ff4=await getLoginUserInfo(),_0x4dc76b=pickFirst(_0x5f3ff4[_0x307f55(0x11e)],_0x5f3ff4['id']);return{..._0x3d0d0a,'user':_0x5f3ff4,'userId':_0x4dc76b,'id':_0x5f3ff4['id'],'username':pickFirst(_0x5f3ff4[_0x307f55(0x12f)],_0x5f3ff4[_0x307f55(0x128)],_0x5f3ff4['loginName']),'userName':_0x5f3ff4['userName'],'nickname':pickFirst(_0x5f3ff4['nickname'],_0x5f3ff4[_0x307f55(0xe7)]),'nickName':_0x5f3ff4['nickName'],'tenantCode':_0x5f3ff4[_0x307f55(0xf4)],'employeeId':_0x5f3ff4[_0x307f55(0x11b)]};}function usesRuntimeContext(_0x412bb4){const _0x32a6b2=a39_0x1016;return _0x412bb4[_0x32a6b2(0x11a)]['some'](_0x841ab0=>typeof _0x841ab0[_0x32a6b2(0x146)]===_0x32a6b2(0xef)&&(_0x841ab0[_0x32a6b2(0x146)][_0x32a6b2(0x12d)]('context.')||_0x841ab0[_0x32a6b2(0x146)][_0x32a6b2(0x12d)](_0x32a6b2(0xe4))));}function pickFirst(..._0xae17ec){const _0x4f2fac=a39_0x1016;return _0xae17ec[_0x4f2fac(0x135)](_0xfb2967=>_0xfb2967!==undefined&&_0xfb2967!==null);}async function executePlan(_0x288c87,_0x22a203,_0x16f007){const _0x3c2a6d=a39_0x1016;if(_0x288c87[_0x3c2a6d(0x113)]===_0x3c2a6d(0x105)){const _0x50f583=await resolveDatasetCode(_0x288c87,_0x22a203,_0x16f007);return executeData(_0x50f583,_0x288c87[_0x3c2a6d(0x10d)],_0x288c87['params']);}if(_0x288c87[_0x3c2a6d(0x113)]===_0x3c2a6d(0xe5)){if(!_0x288c87[_0x3c2a6d(0x125)])throw CliErrors[_0x3c2a6d(0x132)]('Service\x20command\x20'+_0x22a203[_0x3c2a6d(0x103)]+_0x3c2a6d(0xff));return executeSdkSql(_0x288c87[_0x3c2a6d(0x125)],normalizeScalarParams(_0x288c87['params']));}if(_0x288c87[_0x3c2a6d(0x113)]===_0x3c2a6d(0xf7)){const _0x47216e=_0x288c87[_0x3c2a6d(0xfc)]||_0x288c87[_0x3c2a6d(0x130)]||(_0x288c87[_0x3c2a6d(0x10e)]==null?'':String(_0x288c87[_0x3c2a6d(0x10e)]));if(!_0x47216e)throw CliErrors[_0x3c2a6d(0x132)]('Service\x20command\x20'+_0x22a203[_0x3c2a6d(0x103)]+_0x3c2a6d(0x121));return executeSdkBff(_0x47216e,_0x288c87[_0x3c2a6d(0x123)]);}throw CliErrors['validation']('Unsupported\x20service\x20target\x20kind:\x20'+_0x288c87[_0x3c2a6d(0x113)]);}async function resolveDatasetCode(_0xc62d41,_0x52978f,_0x4809ad){const _0x39eb0b=a39_0x1016;if(_0xc62d41['datasetCode'])return _0xc62d41[_0x39eb0b(0xe6)];if(!_0xc62d41[_0x39eb0b(0xeb)])throw CliErrors[_0x39eb0b(0x132)](_0x39eb0b(0x131)+_0x52978f[_0x39eb0b(0x103)]+_0x39eb0b(0x129));const _0x463bb9=await listDatasets(_0x4809ad['appCode']),_0x404696=_0x463bb9[_0x39eb0b(0x135)](_0x18f5c0=>_0x18f5c0[_0x39eb0b(0x138)]?.[_0x39eb0b(0x126)]===_0xc62d41['datatable']);if(!_0x404696?.['code'])throw CliErrors[_0x39eb0b(0x132)](_0x39eb0b(0x101)+_0xc62d41['datatable']+_0x39eb0b(0xea)+_0x4809ad[_0x39eb0b(0x140)]+'.',_0x39eb0b(0x102));return _0x404696['code'];}function applyAppBinding(_0x3fa58d,_0x50164f,_0x3343bd){const _0x13b52d=a39_0x1016,_0xfb76e=_0x50164f[_0x13b52d(0xdf)][_0x13b52d(0xf2)];if(!_0xfb76e)return;const _0x293469=_0x3fa58d[_0x13b52d(0x12b)][_0xfb76e];if(!_0x293469)throw CliErrors[_0x13b52d(0x132)](_0x13b52d(0x10f)+_0xfb76e+_0x13b52d(0x112)+_0x50164f[_0x13b52d(0x103)]+'.',_0x13b52d(0x118));const _0x16c270=_0x293469[_0x13b52d(0x137)]||_0x293469[_0x13b52d(0x140)];_0x16c270&&!hasText(_0x3343bd['appcode'])&&(_0x3343bd[_0x13b52d(0x137)]=_0x16c270),_0x293469[_0x13b52d(0x142)]&&!hasText(_0x3343bd[_0x13b52d(0x142)])&&!hasText(_0x3343bd[_0x13b52d(0x137)])&&(_0x3343bd[_0x13b52d(0x142)]=_0x293469['app']),_0x293469[_0x13b52d(0xf9)]&&!hasText(_0x3343bd['env'])&&(_0x3343bd[_0x13b52d(0xf9)]=_0x293469[_0x13b52d(0xf9)]);}function a39_0x1016(_0x25845f,_0x2c9f46){_0x25845f=_0x25845f-0xda;const _0x4f93aa=a39_0x4f93();let _0x1016b8=_0x4f93aa[_0x25845f];return _0x1016b8;}function renderDynamicCommandHelp(_0xe00eed){const _0x10def2=a39_0x1016,_0x107385=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x10def2(0xed)+_0xe00eed[_0x10def2(0xdf)]['kind'],_0x10def2(0xdc)+_0xe00eed['target'][_0x10def2(0x10d)]];if(_0xe00eed[_0x10def2(0xdf)][_0x10def2(0xe6)])_0x107385[_0x10def2(0x114)](_0x10def2(0x108)+_0xe00eed[_0x10def2(0xdf)][_0x10def2(0xe6)]);if(_0xe00eed[_0x10def2(0xdf)][_0x10def2(0xeb)])_0x107385[_0x10def2(0x114)]('\x20\x20\x20\x20datatable:\x20'+_0xe00eed[_0x10def2(0xdf)][_0x10def2(0xeb)]);if(_0xe00eed['target']['sqlCode'])_0x107385['push'](_0x10def2(0x110)+_0xe00eed[_0x10def2(0xdf)][_0x10def2(0x125)]);if(_0xe00eed[_0x10def2(0xdf)][_0x10def2(0xfc)])_0x107385[_0x10def2(0x114)](_0x10def2(0x11c)+_0xe00eed[_0x10def2(0xdf)][_0x10def2(0xfc)]);if(_0xe00eed[_0x10def2(0x11a)][_0x10def2(0x106)]>0x0){_0x107385[_0x10def2(0x114)]('',_0x10def2(0x13a));for(const _0x5c8049 of _0xe00eed['mapTo']){_0x107385['push'](_0x10def2(0x11d)+(_0x5c8049[_0x10def2(0x146)]||'const')+_0x10def2(0x111)+_0x5c8049['target']+(_0x5c8049[_0x10def2(0x107)]?'.'+_0x5c8049[_0x10def2(0x107)]:''));}}return _0x107385['join']('\x0a');}function targetPreview(_0x1dfe26){const _0x4b45b0=a39_0x1016;return{'kind':_0x1dfe26[_0x4b45b0(0x113)],'command':_0x1dfe26['command'],'appRef':_0x1dfe26[_0x4b45b0(0xf2)],'datasetCode':_0x1dfe26['datasetCode'],'datatable':_0x1dfe26[_0x4b45b0(0xeb)],'sqlCode':_0x1dfe26[_0x4b45b0(0x125)],'bffCode':_0x1dfe26[_0x4b45b0(0x130)],'bffId':_0x1dfe26[_0x4b45b0(0x10e)],'functionName':_0x1dfe26[_0x4b45b0(0xfc)]};}function normalizeScalarParams(_0xdcdd63){const _0x4a09b4=a39_0x1016;return Object[_0x4a09b4(0x13d)](Object[_0x4a09b4(0x13e)](_0xdcdd63)[_0x4a09b4(0xf6)](([,_0x198cea])=>typeof _0x198cea===_0x4a09b4(0xef)||typeof _0x198cea===_0x4a09b4(0x133)));}function hasText(_0x1ef646){const _0x1bca89=a39_0x1016;return typeof _0x1ef646===_0x1bca89(0xef)&&_0x1ef646[_0x1bca89(0x100)]()[_0x1bca89(0x106)]>0x0;}function isPrimitiveFlagDefault(_0xe3162f){const _0x375a22=a39_0x1016;return _0xe3162f===undefined||typeof _0xe3162f===_0x375a22(0xef)||typeof _0xe3162f===_0x375a22(0x133)||typeof _0xe3162f===_0x375a22(0xde);}
1
+ (function(_0x10509c,_0x4a9802){const _0x161134=a39_0x1804,_0x275c0e=_0x10509c();while(!![]){try{const _0x5c84c6=parseInt(_0x161134(0x171))/0x1+-parseInt(_0x161134(0x1b3))/0x2*(-parseInt(_0x161134(0x1b1))/0x3)+parseInt(_0x161134(0x1bf))/0x4*(-parseInt(_0x161134(0x1b5))/0x5)+parseInt(_0x161134(0x193))/0x6+parseInt(_0x161134(0x194))/0x7+-parseInt(_0x161134(0x17c))/0x8*(parseInt(_0x161134(0x1af))/0x9)+-parseInt(_0x161134(0x19b))/0xa;if(_0x5c84c6===_0x4a9802)break;else _0x275c0e['push'](_0x275c0e['shift']());}catch(_0x524144){_0x275c0e['push'](_0x275c0e['shift']());}}}(a39_0x2e6d,0x35410));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';function a39_0x2e6d(){const _0x420bd9=['Run\x20service\x20command\x20','envName','bffCode','operator','rawFlags','ctx.','filter','startsWith','service','2812576WMXOaj','\x20\x20\x20\x20datasetCode:\x20','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','\x20\x20\x20\x20sqlCode:\x20','bffId','string','app','Unsupported\x20service\x20target\x20kind:\x20','target','cliPath','datasetCode','boolean','`\x20to\x20inspect\x20the\x20manifest.','high-risk-write','将通过\x20Service\x20Tree\x20执行“','Use\x20`','number','length','\x20\x20\x20\x20kind:\x20\x20\x20\x20','kind','padEnd','params','enum','2002626CbPQIs','380604dYlRwC','context.','commands','\x20<command>\x20[flags]','tree','fromEntries','some','76560YaSuDu','risk','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','find','employeeId','bff','json','flatMap','datatable','code','\x20\x20\x20\x20','map','join','dbtableConfig','userName','validation','source','username','env','Service\x20command\x20','9NQNEGJ','mapTo','35136LRROAF','read','32rXyAVj','args','45605tqPKTN','\x20->\x20','slice','push','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','\x20requires\x20target.sqlCode.','const','tenantCode','now','\x20\x20[','124IkHGIR','trim','\x20\x20SERVICE\x20TREE\x20TARGET','\x22\x20in\x20service\x20command\x20','default','\x20service\x20detail\x20--service\x20','appcode','sqlCode','description','remainingArgs','data','entries','appCode','userId','name','scriptName','sql','required','\x20completed\x20in\x20','fullPath','command','该命令被清单标记为写入,可能修改业务数据或服务状态。','flags','Preview\x20dynamic\x20service\x20command:\x20','normalizedManifest','nickName','\x20\x20\x20\x20functionName:\x20','type','appRef','284572AbjYno','\x20requires\x20target.functionName.'];a39_0x2e6d=function(){return _0x420bd9;};return a39_0x2e6d();}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(_0x561bae,_0x7b3088){const _0x2e2d11=a39_0x1804,_0x3a0b3e=listLocalServiceTrees();let _0x434a60;for(const _0x479a24 of _0x3a0b3e){const _0x1b95fc=matchServiceTreeCommand(_0x479a24,_0x561bae);if(!_0x1b95fc)continue;(!_0x434a60||_0x1b95fc[_0x2e2d11(0x1d3)][_0x2e2d11(0x1d2)]['length']>_0x434a60[_0x2e2d11(0x1d3)]['fullPath']['length'])&&(_0x434a60={'tree':_0x479a24,'command':_0x1b95fc[_0x2e2d11(0x1d3)],'remainingArgs':_0x1b95fc[_0x2e2d11(0x1c8)]});}if(!_0x434a60)return undefined;const _0x1eb1d6={..._0x7b3088};return applyAppBinding(_0x434a60[_0x2e2d11(0x198)],_0x434a60[_0x2e2d11(0x1d3)],_0x1eb1d6),{'definition':buildDynamicCommandDefinition(_0x434a60[_0x2e2d11(0x198)],_0x434a60[_0x2e2d11(0x1d3)]),'args':_0x434a60[_0x2e2d11(0x1c8)],'flags':_0x1eb1d6,'tree':_0x434a60[_0x2e2d11(0x198)],'command':_0x434a60['command']};}export function generateDynamicServiceHelp(_0x18e7e6){const _0x3144ee=a39_0x1804,_0x2c33dd=listLocalServiceTrees()[_0x3144ee(0x19e)](_0x37dca7=>_0x37dca7['service']['code']===_0x18e7e6);if(!_0x2c33dd)return undefined;const _0x27f866=[CLI_BIN_NAME+'\x20'+_0x18e7e6+_0x3144ee(0x197),'',_0x2c33dd[_0x3144ee(0x17b)]['name']||_0x18e7e6,_0x2c33dd[_0x3144ee(0x17b)][_0x3144ee(0x1c7)]?'\x20\x20'+_0x2c33dd[_0x3144ee(0x17b)]['description']:'','','Commands:',..._0x2c33dd['commands'][_0x3144ee(0x1a6)](_0x1cc314=>{const _0x4ab2c2=_0x3144ee,_0x55ac5b=_0x1cc314['fullPath'][_0x4ab2c2(0x1b7)](0x1)[_0x4ab2c2(0x1a7)]('\x20'),_0x402798=_0x1cc314[_0x4ab2c2(0x19c)]==='read'?'':'\x20['+_0x1cc314['risk']+']';return'\x20\x20'+_0x55ac5b[_0x4ab2c2(0x190)](0x18)+'\x20'+(_0x1cc314[_0x4ab2c2(0x1c7)]||'')+_0x402798;}),'',_0x3144ee(0x18b)+CLI_BIN_NAME+_0x3144ee(0x1c4)+_0x18e7e6+_0x3144ee(0x188)][_0x3144ee(0x179)](Boolean);return _0x27f866[_0x3144ee(0x1a7)]('\x0a');}export function listDynamicServiceEntries(){const _0x261c11=a39_0x1804;return listLocalServices()[_0x261c11(0x1a6)](_0x1599d7=>{const _0x3c895f=_0x261c11,_0x16ac0a=_0x1599d7[_0x3c895f(0x1d7)];return{'service':_0x16ac0a[_0x3c895f(0x17b)][_0x3c895f(0x1a4)],'label':_0x16ac0a['service'][_0x3c895f(0x1cd)]||_0x16ac0a[_0x3c895f(0x17b)][_0x3c895f(0x1a4)],'commands':_0x16ac0a['commands'][_0x3c895f(0x1a6)](_0x51dbf6=>({'command':dynamicCommandName(_0x51dbf6),'description':_0x51dbf6[_0x3c895f(0x1c7)]||_0x3c895f(0x173)+_0x51dbf6[_0x3c895f(0x185)],'tag':riskTag(_0x51dbf6[_0x3c895f(0x19c)])}))};});}export function getDynamicServiceEntry(_0x10cfd3){return listDynamicServiceEntries()['find'](_0x466571=>_0x466571['service']===_0x10cfd3);}export function listDynamicServiceDefinitions(_0x2b8107){const _0x10bade=a39_0x1804;return listLocalServiceTrees()[_0x10bade(0x179)](_0x40b63d=>!_0x2b8107||_0x40b63d[_0x10bade(0x17b)]['code']===_0x2b8107)[_0x10bade(0x1a2)](_0x53bb7e=>_0x53bb7e[_0x10bade(0x196)][_0x10bade(0x1a6)](_0xf67b21=>buildDynamicCommandDefinition(_0x53bb7e,_0xf67b21)));}export function getDynamicServiceDefinitions(_0x533d9a){const _0x3ebae7=listDynamicServiceDefinitions(_0x533d9a);return _0x3ebae7['length']>0x0?_0x3ebae7:undefined;}export function findDynamicServiceDefinition(_0xaef93b,_0x206550){const _0x14b8b3=a39_0x1804;return listDynamicServiceDefinitions(_0xaef93b)[_0x14b8b3(0x19e)](_0x3f63f7=>_0x3f63f7[_0x14b8b3(0x1d3)]===_0x206550);}export function buildDynamicCommandDefinition(_0x3df362,_0x7de892){const _0x17bf2e=a39_0x1804;return{'service':_0x3df362[_0x17bf2e(0x17b)]['code'],'command':dynamicCommandName(_0x7de892),'description':_0x7de892['description']||_0x17bf2e(0x173)+_0x7de892[_0x17bf2e(0x185)],'risk':_0x7de892[_0x17bf2e(0x19c)],..._0x7de892[_0x17bf2e(0x19c)]===_0x17bf2e(0x1b2)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x7de892)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x7de892['args'][_0x17bf2e(0x1a6)](_0x10a349=>({'name':_0x10a349[_0x17bf2e(0x1cd)],'description':_0x10a349[_0x17bf2e(0x1c7)]||_0x10a349[_0x17bf2e(0x1cd)],'required':_0x10a349[_0x17bf2e(0x1d0)]})),'flags':_0x7de892[_0x17bf2e(0x1d5)][_0x17bf2e(0x1a6)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x7de892),async 'dryRun'(_0x3a29a3){const _0x4c4b38=_0x17bf2e,_0x2c4359=await compilePlan(_0x7de892,_0x3a29a3);return{'method':'SERVICE_TREE','url':_0x7de892[_0x4c4b38(0x185)],'body':{'target':targetPreview(_0x2c4359),'params':_0x2c4359[_0x4c4b38(0x191)]},'description':_0x4c4b38(0x1d6)+_0x7de892[_0x4c4b38(0x185)]};},async 'execute'(_0x1e3926){const _0x2b8d87=_0x17bf2e,_0x85c846=await compilePlan(_0x7de892,_0x1e3926),_0x1139b2=Date[_0x2b8d87(0x1bd)](),_0x24ac67=await executePlan(_0x85c846,_0x7de892,_0x1e3926),_0x16f870=Date[_0x2b8d87(0x1bd)]()-_0x1139b2;return{'ok':!![],'data':{'service':_0x3df362['service'],'command':_0x7de892[_0x2b8d87(0x185)],'target':targetPreview(_0x85c846),'result':_0x24ac67,'elapsed':_0x16f870},'message':_0x2b8d87(0x1ae)+_0x7de892[_0x2b8d87(0x185)]+_0x2b8d87(0x1d1)+_0x16f870+'ms'};}};}function buildDynamicConfirmationDescription(_0x3ed22a){const _0x27aaef=a39_0x1804,_0x5bb6fc=_0x3ed22a[_0x27aaef(0x1c7)]||_0x3ed22a['cliPath'],_0x44d1c1=_0x3ed22a[_0x27aaef(0x19c)]===_0x27aaef(0x189)?_0x27aaef(0x1b9):_0x27aaef(0x1d4);return _0x27aaef(0x18a)+_0x5bb6fc+'”。'+_0x44d1c1;}function dynamicCommandName(_0x2af0c0){const _0x340710=a39_0x1804;return _0x2af0c0['fullPath'][_0x340710(0x1b7)](0x1)[_0x340710(0x1a7)]('\x20');}function riskTag(_0x4a1ed0){const _0x49775c=a39_0x1804;return _0x4a1ed0===_0x49775c(0x1b2)?'':_0x49775c(0x1be)+_0x4a1ed0+']';}function flagToCommandFlag(_0x2583cc){const _0x2b084c=a39_0x1804;return{'name':_0x2583cc['cliName'],'type':_0x2583cc['type']===_0x2b084c(0x1a1)?'string':_0x2583cc[_0x2b084c(0x16f)],'description':_0x2583cc[_0x2b084c(0x1c7)]||_0x2583cc[_0x2b084c(0x1cd)],'required':_0x2583cc[_0x2b084c(0x1d0)],'default':isPrimitiveFlagDefault(_0x2583cc['default'])?_0x2583cc[_0x2b084c(0x1c3)]:undefined,'enum':_0x2583cc[_0x2b084c(0x192)]};}async function compilePlan(_0x56207d,_0xaf969e){const _0x155dc3=a39_0x1804;return compileServiceTreeCommand(_0x56207d,{'flags':_0xaf969e[_0x155dc3(0x177)],'args':_0xaf969e[_0x155dc3(0x1b4)],'context':await buildServiceContext(_0x56207d,_0xaf969e)});}async function buildServiceContext(_0x5d41fb,_0x3683b3){const _0x145d74=a39_0x1804,_0x437165={'appCode':_0x3683b3[_0x145d74(0x1cb)],'env':_0x3683b3[_0x145d74(0x174)],'envName':_0x3683b3[_0x145d74(0x174)]};if(!usesRuntimeContext(_0x5d41fb))return _0x437165;const _0x49d95b=await getLoginUserInfo(),_0xac9ff2=pickFirst(_0x49d95b[_0x145d74(0x1cc)],_0x49d95b['id']);return{..._0x437165,'user':_0x49d95b,'userId':_0xac9ff2,'id':_0x49d95b['id'],'username':pickFirst(_0x49d95b[_0x145d74(0x1ac)],_0x49d95b[_0x145d74(0x1a9)],_0x49d95b['loginName']),'userName':_0x49d95b[_0x145d74(0x1a9)],'nickname':pickFirst(_0x49d95b['nickname'],_0x49d95b[_0x145d74(0x1d8)]),'nickName':_0x49d95b[_0x145d74(0x1d8)],'tenantCode':_0x49d95b[_0x145d74(0x1bc)],'employeeId':_0x49d95b[_0x145d74(0x19f)]};}function usesRuntimeContext(_0x2e12d2){const _0x14ba52=a39_0x1804;return _0x2e12d2[_0x14ba52(0x1b0)][_0x14ba52(0x19a)](_0x420264=>typeof _0x420264[_0x14ba52(0x1ab)]===_0x14ba52(0x181)&&(_0x420264[_0x14ba52(0x1ab)][_0x14ba52(0x17a)](_0x14ba52(0x195))||_0x420264[_0x14ba52(0x1ab)][_0x14ba52(0x17a)](_0x14ba52(0x178))));}function pickFirst(..._0x4affd5){return _0x4affd5['find'](_0x76f244=>_0x76f244!==undefined&&_0x76f244!==null);}async function executePlan(_0x334676,_0x475c32,_0x437b0d){const _0x481a17=a39_0x1804;if(_0x334676[_0x481a17(0x18f)]===_0x481a17(0x1c9)){const _0x22db43=await resolveDatasetCode(_0x334676,_0x475c32,_0x437b0d);return executeData(_0x22db43,_0x334676['command'],_0x334676[_0x481a17(0x191)]);}if(_0x334676[_0x481a17(0x18f)]===_0x481a17(0x1cf)){if(!_0x334676[_0x481a17(0x1c6)])throw CliErrors[_0x481a17(0x1aa)]('Service\x20command\x20'+_0x475c32[_0x481a17(0x185)]+_0x481a17(0x1ba));return executeSdkSql(_0x334676[_0x481a17(0x1c6)],normalizeScalarParams(_0x334676[_0x481a17(0x191)]));}if(_0x334676[_0x481a17(0x18f)]===_0x481a17(0x1a0)){const _0x257299=_0x334676[_0x481a17(0x1ce)]||_0x334676[_0x481a17(0x175)]||(_0x334676[_0x481a17(0x180)]==null?'':String(_0x334676[_0x481a17(0x180)]));if(!_0x257299)throw CliErrors[_0x481a17(0x1aa)](_0x481a17(0x1ae)+_0x475c32['cliPath']+_0x481a17(0x172));return executeSdkBff(_0x257299,_0x334676['params']);}throw CliErrors[_0x481a17(0x1aa)](_0x481a17(0x183)+_0x334676[_0x481a17(0x18f)]);}async function resolveDatasetCode(_0x10b871,_0x18c967,_0x433dc8){const _0x2fdfd7=a39_0x1804;if(_0x10b871['datasetCode'])return _0x10b871['datasetCode'];if(!_0x10b871[_0x2fdfd7(0x1a3)])throw CliErrors[_0x2fdfd7(0x1aa)]('Service\x20command\x20'+_0x18c967[_0x2fdfd7(0x185)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x179452=await listDatasets(_0x433dc8[_0x2fdfd7(0x1cb)]),_0x1da465=_0x179452[_0x2fdfd7(0x19e)](_0x372398=>_0x372398[_0x2fdfd7(0x1a8)]?.['tableName']===_0x10b871['datatable']);if(!_0x1da465?.[_0x2fdfd7(0x1a4)])throw CliErrors[_0x2fdfd7(0x1aa)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x10b871[_0x2fdfd7(0x1a3)]+_0x2fdfd7(0x19d)+_0x433dc8[_0x2fdfd7(0x1cb)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x1da465[_0x2fdfd7(0x1a4)];}function applyAppBinding(_0x52624a,_0x205854,_0x40bc45){const _0x5249eb=a39_0x1804,_0x2d775e=_0x205854[_0x5249eb(0x184)][_0x5249eb(0x170)];if(!_0x2d775e)return;const _0x52b4ed=_0x52624a['appBindings'][_0x2d775e];if(!_0x52b4ed)throw CliErrors[_0x5249eb(0x1aa)]('Unknown\x20appRef\x20\x22'+_0x2d775e+_0x5249eb(0x1c2)+_0x205854['cliPath']+'.',_0x5249eb(0x17e));const _0x1b4d4b=_0x52b4ed[_0x5249eb(0x1c5)]||_0x52b4ed[_0x5249eb(0x1cb)];_0x1b4d4b&&!hasText(_0x40bc45['appcode'])&&(_0x40bc45[_0x5249eb(0x1c5)]=_0x1b4d4b),_0x52b4ed[_0x5249eb(0x182)]&&!hasText(_0x40bc45[_0x5249eb(0x182)])&&!hasText(_0x40bc45['appcode'])&&(_0x40bc45[_0x5249eb(0x182)]=_0x52b4ed['app']),_0x52b4ed[_0x5249eb(0x1ad)]&&!hasText(_0x40bc45[_0x5249eb(0x1ad)])&&(_0x40bc45[_0x5249eb(0x1ad)]=_0x52b4ed[_0x5249eb(0x1ad)]);}function renderDynamicCommandHelp(_0xb1fee5){const _0x43da7d=a39_0x1804,_0x310a4d=[_0x43da7d(0x1c1),_0x43da7d(0x18e)+_0xb1fee5[_0x43da7d(0x184)]['kind'],'\x20\x20\x20\x20command:\x20'+_0xb1fee5[_0x43da7d(0x184)][_0x43da7d(0x1d3)]];if(_0xb1fee5[_0x43da7d(0x184)][_0x43da7d(0x186)])_0x310a4d[_0x43da7d(0x1b8)](_0x43da7d(0x17d)+_0xb1fee5[_0x43da7d(0x184)]['datasetCode']);if(_0xb1fee5[_0x43da7d(0x184)]['datatable'])_0x310a4d[_0x43da7d(0x1b8)]('\x20\x20\x20\x20datatable:\x20'+_0xb1fee5[_0x43da7d(0x184)][_0x43da7d(0x1a3)]);if(_0xb1fee5[_0x43da7d(0x184)][_0x43da7d(0x1c6)])_0x310a4d['push'](_0x43da7d(0x17f)+_0xb1fee5['target']['sqlCode']);if(_0xb1fee5['target'][_0x43da7d(0x1ce)])_0x310a4d[_0x43da7d(0x1b8)](_0x43da7d(0x1d9)+_0xb1fee5['target']['scriptName']);if(_0xb1fee5['mapTo'][_0x43da7d(0x18d)]>0x0){_0x310a4d[_0x43da7d(0x1b8)]('','\x20\x20MAP\x20TO');for(const _0x2c6767 of _0xb1fee5['mapTo']){_0x310a4d[_0x43da7d(0x1b8)](_0x43da7d(0x1a5)+(_0x2c6767[_0x43da7d(0x1ab)]||_0x43da7d(0x1bb))+_0x43da7d(0x1b6)+_0x2c6767[_0x43da7d(0x184)]+(_0x2c6767['operator']?'.'+_0x2c6767[_0x43da7d(0x176)]:''));}}return _0x310a4d[_0x43da7d(0x1a7)]('\x0a');}function a39_0x1804(_0x2be57e,_0x28891d){_0x2be57e=_0x2be57e-0x16f;const _0x2e6d60=a39_0x2e6d();let _0x180456=_0x2e6d60[_0x2be57e];return _0x180456;}function targetPreview(_0x33ce16){const _0x3a8875=a39_0x1804;return{'kind':_0x33ce16['kind'],'command':_0x33ce16[_0x3a8875(0x1d3)],'appRef':_0x33ce16[_0x3a8875(0x170)],'datasetCode':_0x33ce16[_0x3a8875(0x186)],'datatable':_0x33ce16['datatable'],'sqlCode':_0x33ce16[_0x3a8875(0x1c6)],'bffCode':_0x33ce16[_0x3a8875(0x175)],'bffId':_0x33ce16[_0x3a8875(0x180)],'functionName':_0x33ce16['scriptName']};}function normalizeScalarParams(_0x4f0228){const _0x1cbe8d=a39_0x1804;return Object[_0x1cbe8d(0x199)](Object[_0x1cbe8d(0x1ca)](_0x4f0228)[_0x1cbe8d(0x179)](([,_0x154f6a])=>typeof _0x154f6a===_0x1cbe8d(0x181)||typeof _0x154f6a==='number'));}function hasText(_0x25d48b){const _0x51b05a=a39_0x1804;return typeof _0x25d48b==='string'&&_0x25d48b[_0x51b05a(0x1c0)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x2d74d5){const _0x694ef2=a39_0x1804;return _0x2d74d5===undefined||typeof _0x2d74d5===_0x694ef2(0x181)||typeof _0x2d74d5===_0x694ef2(0x18c)||typeof _0x2d74d5===_0x694ef2(0x187);}
@@ -1 +1 @@
1
- (function(_0x435519,_0x2b20d6){const _0x44ba5f=a40_0x414f,_0x53dde0=_0x435519();while(!![]){try{const _0x327981=parseInt(_0x44ba5f(0xd1))/0x1*(parseInt(_0x44ba5f(0xc8))/0x2)+-parseInt(_0x44ba5f(0xcf))/0x3+parseInt(_0x44ba5f(0xe5))/0x4*(parseInt(_0x44ba5f(0xcb))/0x5)+-parseInt(_0x44ba5f(0xe7))/0x6*(-parseInt(_0x44ba5f(0xde))/0x7)+parseInt(_0x44ba5f(0xda))/0x8+parseInt(_0x44ba5f(0xc5))/0x9+parseInt(_0x44ba5f(0xe8))/0xa*(-parseInt(_0x44ba5f(0xdd))/0xb);if(_0x327981===_0x2b20d6)break;else _0x53dde0['push'](_0x53dde0['shift']());}catch(_0x42e0ff){_0x53dde0['push'](_0x53dde0['shift']());}}}(a40_0x3728,0x48311));export function adaptServiceTreeManifestForLegacyFramework(_0x142e8b){const _0xcc168d=a40_0x414f,_0x3e7c28=cloneJsonValue(_0x142e8b),_0x49b2af=[];if(!isObjectRecord(_0x3e7c28))return{'manifest':_0x3e7c28,'errors':_0x49b2af};return Array[_0xcc168d(0xd8)](_0x3e7c28['commands'])&&_0x3e7c28[_0xcc168d(0xd7)]['forEach']((_0x368d7b,_0x2bbac0)=>{const _0x1e1095=_0xcc168d;if(!isObjectRecord(_0x368d7b))return;adaptBffTarget(_0x368d7b['target'],_0x1e1095(0xe1)+_0x2bbac0+_0x1e1095(0xd5),_0x49b2af);}),adaptResources(_0x3e7c28[_0xcc168d(0xc7)],'$.resources',_0x49b2af),{'manifest':_0x3e7c28,'errors':_0x49b2af};}export function toPublicServiceTreeTarget(_0x10df86){const _0x56a4a9=a40_0x414f,{scriptName:_0x2bd314,..._0x2707ff}=_0x10df86;return typeof _0x2bd314===_0x56a4a9(0xd6)&&_0x2bd314['trim']()&&(_0x2707ff[_0x56a4a9(0xe4)]=_0x2bd314),_0x2707ff;}export function toPublicNormalizedServiceTree(_0x4acbb8){const _0x4b2de1=a40_0x414f;return{..._0x4acbb8,'commands':_0x4acbb8[_0x4b2de1(0xd7)]['map'](_0x2553c2=>({..._0x2553c2,'target':toPublicServiceTreeTarget(_0x2553c2['target'])}))};}function adaptResources(_0x172caf,_0x368788,_0x28ec4b){const _0x1d6945=a40_0x414f;if(!isObjectRecord(_0x172caf))return;for(const [_0x1e35ea,_0x4b75c4]of Object['entries'](_0x172caf)){if(!isObjectRecord(_0x4b75c4))continue;const _0x2cc685=_0x368788+'.'+_0x1e35ea;if(isObjectRecord(_0x4b75c4[_0x1d6945(0xe3)]))for(const [_0x2d0e8b,_0x4db0ed]of Object['entries'](_0x4b75c4[_0x1d6945(0xe3)])){if(!isObjectRecord(_0x4db0ed))continue;const _0xd14291=_0x2cc685+_0x1d6945(0xd0)+_0x2d0e8b,_0x5059c1=isObjectRecord(_0x4db0ed[_0x1d6945(0xd2)])&&_0x4db0ed[_0x1d6945(0xd2)][_0x1d6945(0xe0)]===_0x1d6945(0xe9);adaptBffTarget(_0x4db0ed[_0x1d6945(0xd2)],_0xd14291+_0x1d6945(0xcc),_0x28ec4b),(_0x5059c1||isBffAction(_0x4db0ed))&&adaptFunctionNameField(_0x4db0ed,_0xd14291,_0x28ec4b);}adaptResources(_0x4b75c4['resources'],_0x2cc685+'.resources',_0x28ec4b);}}function adaptBffTarget(_0x58b194,_0x576622,_0x5b533){const _0x10f20d=a40_0x414f;if(!isObjectRecord(_0x58b194)||_0x58b194[_0x10f20d(0xe0)]!=='bff')return;adaptFunctionNameField(_0x58b194,_0x576622,_0x5b533);}function adaptFunctionNameField(_0x42c354,_0x1486ae,_0x705c6b){const _0x133802=a40_0x414f;Object[_0x133802(0xdb)][_0x133802(0xc9)][_0x133802(0xe6)](_0x42c354,_0x133802(0xdc))&&_0x705c6b[_0x133802(0xca)]({'level':_0x133802(0xd4),'path':_0x1486ae+_0x133802(0xc6),'message':'Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.'});if(Object[_0x133802(0xdb)][_0x133802(0xc9)]['call'](_0x42c354,_0x133802(0xe4))){if(typeof _0x42c354[_0x133802(0xe4)]!==_0x133802(0xd6)||!_0x42c354[_0x133802(0xe4)]['trim']()){_0x705c6b[_0x133802(0xca)]({'level':_0x133802(0xd4),'path':_0x1486ae+_0x133802(0xcd),'message':_0x133802(0xdf)}),delete _0x42c354[_0x133802(0xe4)];return;}_0x42c354[_0x133802(0xdc)]=_0x42c354[_0x133802(0xe4)],delete _0x42c354[_0x133802(0xe4)];}}function isBffAction(_0x2b09d4){const _0x2bc636=a40_0x414f;return _0x2b09d4['kind']===_0x2bc636(0xe9)||_0x2b09d4[_0x2bc636(0xd3)]===_0x2bc636(0xea)||_0x2b09d4[_0x2bc636(0xd2)]==='bff.exec';}function a40_0x3728(){const _0x3bb778=['$.commands[','map','actions','functionName','739156AyuVRC','call','1292466waUNlg','270NFMLdj','bff','bff.exec','object','1518561viszig','.scriptName','resources','782XBKPIE','hasOwnProperty','push','10SIDkUs','.target','.functionName','fromEntries','78825CFTIMB','.actions.','1246ANRdYG','target','action','error','].target','string','commands','isArray','entries','2408072tWQJnI','prototype','scriptName','497013URJFWm','7FWvmNS','functionName\x20must\x20be\x20a\x20non-empty\x20string.','kind'];a40_0x3728=function(){return _0x3bb778;};return a40_0x3728();}function a40_0x414f(_0x39c9b7,_0x35be44){_0x39c9b7=_0x39c9b7-0xc5;const _0x372875=a40_0x3728();let _0x414fe1=_0x372875[_0x39c9b7];return _0x414fe1;}function cloneJsonValue(_0x2ea436){const _0x5a1a57=a40_0x414f;if(Array[_0x5a1a57(0xd8)](_0x2ea436))return _0x2ea436[_0x5a1a57(0xe2)](_0x3e22a2=>cloneJsonValue(_0x3e22a2));if(isObjectRecord(_0x2ea436))return Object[_0x5a1a57(0xce)](Object[_0x5a1a57(0xd9)](_0x2ea436)['map'](([_0x3721f6,_0x2fb72e])=>[_0x3721f6,cloneJsonValue(_0x2fb72e)]));return _0x2ea436;}function isObjectRecord(_0x5c0dd6){const _0xe0917=a40_0x414f;return Boolean(_0x5c0dd6)&&typeof _0x5c0dd6===_0xe0917(0xeb)&&!Array[_0xe0917(0xd8)](_0x5c0dd6);}
1
+ (function(_0x573827,_0x3c3a05){const _0x42a2ee=a40_0x5040,_0x5e1409=_0x573827();while(!![]){try{const _0x2fed8d=parseInt(_0x42a2ee(0x205))/0x1*(-parseInt(_0x42a2ee(0x1fc))/0x2)+-parseInt(_0x42a2ee(0x20c))/0x3+parseInt(_0x42a2ee(0x1ff))/0x4+parseInt(_0x42a2ee(0x1f6))/0x5*(-parseInt(_0x42a2ee(0x204))/0x6)+parseInt(_0x42a2ee(0x1f7))/0x7+parseInt(_0x42a2ee(0x214))/0x8+parseInt(_0x42a2ee(0x1fd))/0x9*(parseInt(_0x42a2ee(0x20e))/0xa);if(_0x2fed8d===_0x3c3a05)break;else _0x5e1409['push'](_0x5e1409['shift']());}catch(_0x3a7c80){_0x5e1409['push'](_0x5e1409['shift']());}}}(a40_0x24bb,0x86f05));export function adaptServiceTreeManifestForLegacyFramework(_0x3844fc){const _0x23a79a=a40_0x5040,_0x3bd2f0=cloneJsonValue(_0x3844fc),_0x81dc29=[];if(!isObjectRecord(_0x3bd2f0))return{'manifest':_0x3bd2f0,'errors':_0x81dc29};return Array[_0x23a79a(0x1f9)](_0x3bd2f0[_0x23a79a(0x20d)])&&_0x3bd2f0['commands'][_0x23a79a(0x213)]((_0x5ec9f8,_0x4979ac)=>{const _0x491838=_0x23a79a;if(!isObjectRecord(_0x5ec9f8))return;adaptBffTarget(_0x5ec9f8[_0x491838(0x211)],_0x491838(0x215)+_0x4979ac+_0x491838(0x1f4),_0x81dc29);}),adaptResources(_0x3bd2f0['resources'],_0x23a79a(0x202),_0x81dc29),{'manifest':_0x3bd2f0,'errors':_0x81dc29};}export function toPublicServiceTreeTarget(_0x4cf706){const _0x177552=a40_0x5040,{scriptName:_0x3f1145,..._0x5aa8fd}=_0x4cf706;return typeof _0x3f1145===_0x177552(0x208)&&_0x3f1145[_0x177552(0x1f5)]()&&(_0x5aa8fd[_0x177552(0x206)]=_0x3f1145),_0x5aa8fd;}export function toPublicNormalizedServiceTree(_0x3f831c){const _0x2ef50c=a40_0x5040;return{..._0x3f831c,'commands':_0x3f831c[_0x2ef50c(0x20d)]['map'](_0x4376c5=>({..._0x4376c5,'target':toPublicServiceTreeTarget(_0x4376c5[_0x2ef50c(0x211)])}))};}function a40_0x24bb(){const _0x46b462=['bff','12CBixWX','190241jnRtnH','functionName','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','string','.functionName','functionName\x20must\x20be\x20a\x20non-empty\x20string.','map','2125101OdgyKn','commands','552940txQWbC','bff.exec','fromEntries','target','push','forEach','3552280QKSHQx','$.commands[','hasOwnProperty','.scriptName','.actions.','].target','trim','1404035ZIizFx','6595925yXIrHd','action','isArray','.resources','scriptName','6zyItSg','144PYDDbg','kind','489596KuMcyA','actions','entries','$.resources'];a40_0x24bb=function(){return _0x46b462;};return a40_0x24bb();}function adaptResources(_0xe0d204,_0x3bf19c,_0x271219){const _0x333491=a40_0x5040;if(!isObjectRecord(_0xe0d204))return;for(const [_0x2236b1,_0x19279e]of Object[_0x333491(0x201)](_0xe0d204)){if(!isObjectRecord(_0x19279e))continue;const _0x162bf7=_0x3bf19c+'.'+_0x2236b1;if(isObjectRecord(_0x19279e[_0x333491(0x200)]))for(const [_0x12aa27,_0x4f001c]of Object[_0x333491(0x201)](_0x19279e[_0x333491(0x200)])){if(!isObjectRecord(_0x4f001c))continue;const _0x3d9875=_0x162bf7+_0x333491(0x1f3)+_0x12aa27,_0x1fa560=isObjectRecord(_0x4f001c['target'])&&_0x4f001c[_0x333491(0x211)][_0x333491(0x1fe)]==='bff';adaptBffTarget(_0x4f001c['target'],_0x3d9875+'.target',_0x271219),(_0x1fa560||isBffAction(_0x4f001c))&&adaptFunctionNameField(_0x4f001c,_0x3d9875,_0x271219);}adaptResources(_0x19279e['resources'],_0x162bf7+_0x333491(0x1fa),_0x271219);}}function adaptBffTarget(_0x18db11,_0x4b6853,_0x4d714d){const _0xd19b4c=a40_0x5040;if(!isObjectRecord(_0x18db11)||_0x18db11[_0xd19b4c(0x1fe)]!==_0xd19b4c(0x203))return;adaptFunctionNameField(_0x18db11,_0x4b6853,_0x4d714d);}function adaptFunctionNameField(_0x300d51,_0x195b5f,_0x2b7db1){const _0xcc37b3=a40_0x5040;Object['prototype'][_0xcc37b3(0x1f1)]['call'](_0x300d51,'scriptName')&&_0x2b7db1[_0xcc37b3(0x212)]({'level':'error','path':_0x195b5f+_0xcc37b3(0x1f2),'message':_0xcc37b3(0x207)});if(Object['prototype'][_0xcc37b3(0x1f1)]['call'](_0x300d51,_0xcc37b3(0x206))){if(typeof _0x300d51[_0xcc37b3(0x206)]!==_0xcc37b3(0x208)||!_0x300d51[_0xcc37b3(0x206)][_0xcc37b3(0x1f5)]()){_0x2b7db1[_0xcc37b3(0x212)]({'level':'error','path':_0x195b5f+_0xcc37b3(0x209),'message':_0xcc37b3(0x20a)}),delete _0x300d51['functionName'];return;}_0x300d51[_0xcc37b3(0x1fb)]=_0x300d51[_0xcc37b3(0x206)],delete _0x300d51['functionName'];}}function isBffAction(_0x307c63){const _0xb9be79=a40_0x5040;return _0x307c63[_0xb9be79(0x1fe)]===_0xb9be79(0x203)||_0x307c63[_0xb9be79(0x1f8)]===_0xb9be79(0x20f)||_0x307c63[_0xb9be79(0x211)]==='bff.exec';}function a40_0x5040(_0x36f860,_0x4d27b2){_0x36f860=_0x36f860-0x1f1;const _0x24bbd2=a40_0x24bb();let _0x5040f9=_0x24bbd2[_0x36f860];return _0x5040f9;}function cloneJsonValue(_0x2a74e2){const _0x48daf3=a40_0x5040;if(Array[_0x48daf3(0x1f9)](_0x2a74e2))return _0x2a74e2[_0x48daf3(0x20b)](_0x3effea=>cloneJsonValue(_0x3effea));if(isObjectRecord(_0x2a74e2))return Object[_0x48daf3(0x210)](Object['entries'](_0x2a74e2)[_0x48daf3(0x20b)](([_0x342002,_0x228c5e])=>[_0x342002,cloneJsonValue(_0x228c5e)]));return _0x2a74e2;}function isObjectRecord(_0x5784f1){const _0x38632e=a40_0x5040;return Boolean(_0x5784f1)&&typeof _0x5784f1==='object'&&!Array[_0x38632e(0x1f9)](_0x5784f1);}
@@ -1 +1 @@
1
- function a41_0x5e9f(_0x44957b,_0x15f79a){_0x44957b=_0x44957b-0xd4;const _0x6dd54f=a41_0x6dd5();let _0x5e9f10=_0x6dd54f[_0x44957b];return _0x5e9f10;}const a41_0x24a22f=a41_0x5e9f;(function(_0x1c5857,_0xf8ad19){const _0x6ee16=a41_0x5e9f,_0xbe76ea=_0x1c5857();while(!![]){try{const _0x5de52a=parseInt(_0x6ee16(0xfa))/0x1*(-parseInt(_0x6ee16(0x108))/0x2)+-parseInt(_0x6ee16(0xdb))/0x3+-parseInt(_0x6ee16(0x102))/0x4+parseInt(_0x6ee16(0x107))/0x5+parseInt(_0x6ee16(0xf4))/0x6*(parseInt(_0x6ee16(0xeb))/0x7)+-parseInt(_0x6ee16(0xf9))/0x8+parseInt(_0x6ee16(0xd8))/0x9;if(_0x5de52a===_0xf8ad19)break;else _0xbe76ea['push'](_0xbe76ea['shift']());}catch(_0x59b120){_0xbe76ea['push'](_0xbe76ea['shift']());}}}(a41_0x6dd5,0x23d97));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':'file','type':a41_0x24a22f(0x115),'required':!![],'description':a41_0x24a22f(0xee)},SERVICE_FLAG={'name':a41_0x24a22f(0xf7),'type':a41_0x24a22f(0x115),'required':!![],'description':a41_0x24a22f(0x10a),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x24a22f(0x112)}};function a41_0x6dd5(){const _0x502127=['547925ZyNZpA','34piXygm','target','Local\x20service\x20code,\x20for\x20example\x20crm','report','registry','kind','reduce','read','type','registryServiceCode','lower\x20kebab-case\x20service\x20code','\x20service\x20','filePath','string','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','cliPath','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','version','updated','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','registryPath','validate','1950822RFJEEh','description','export','598191NJSBbs','从本地运行态注册表移除\x20Service\x20Tree\x20清单','serviceCode','\x20service(s),\x20updated\x20','WRITE','Updated','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','cliName','serviceCount','manifests','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','commands','warnings','hash','imported','length','138446IRcmvn','Imported\x20','replaced','Service\x20Tree\x20manifest\x20file\x20path','entries','manifest','errors','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','name','30QfNRjL','str','flags','service','Exported\x20service\x20','107208lxflfi','1318wJPvIp','write','file','map','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','import','entry','normalizedManifest','172760kkJAfO','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','source','\x20service(s).','detail'];a41_0x6dd5=function(){return _0x502127;};return a41_0x6dd5();}function summarizeService(_0x441c1f){const _0x211dee=a41_0x24a22f;return{'serviceCode':_0x441c1f[_0x211dee(0xdd)],'name':_0x441c1f[_0x211dee(0x101)][_0x211dee(0xf7)][_0x211dee(0xf3)],'version':_0x441c1f[_0x211dee(0x11a)],'importedAt':_0x441c1f['importedAt'],'source':_0x441c1f['source'],'commandCount':_0x441c1f['normalizedManifest'][_0x211dee(0xe6)][_0x211dee(0xea)],'commands':_0x441c1f['normalizedManifest']['commands'][_0x211dee(0xfd)](_0x29813a=>({'path':_0x29813a['cliPath'],'description':_0x29813a[_0x211dee(0xd9)],'risk':_0x29813a['risk'],'target':toPublicServiceTreeTarget(_0x29813a[_0x211dee(0x109)]),'flags':_0x29813a[_0x211dee(0xf6)][_0x211dee(0xfd)](_0x12d032=>({'name':_0x12d032[_0x211dee(0xf3)],'cliName':_0x12d032[_0x211dee(0xe2)],'type':_0x12d032[_0x211dee(0x110)],'required':_0x12d032['required']===!![]}))}))};}function summarizeLoadedManifest(_0x35b433){const _0x56a77d=a41_0x24a22f;return{'service':_0x35b433[_0x56a77d(0x101)]?.[_0x56a77d(0xf7)],'version':_0x35b433[_0x56a77d(0x101)]?.['version'],'commandCount':_0x35b433[_0x56a77d(0x101)]?.['commands'][_0x56a77d(0xea)]??0x0,'commands':_0x35b433[_0x56a77d(0x101)]?.[_0x56a77d(0xe6)][_0x56a77d(0xfd)](_0x258f18=>({'path':_0x258f18['cliPath'],'risk':_0x258f18['risk'],'target':toPublicServiceTreeTarget(_0x258f18[_0x56a77d(0x109)])}))??[],'registryIndex':_0x35b433['registryIndex'],'registryServiceCode':_0x35b433[_0x56a77d(0x111)],'errors':_0x35b433[_0x56a77d(0x10b)]['errors'],'warnings':_0x35b433[_0x56a77d(0x10b)][_0x56a77d(0xe7)]};}export const serviceDefinitions=[{'service':'service','command':a41_0x24a22f(0xd7),'description':a41_0x24a22f(0x116),'risk':a41_0x24a22f(0x10f),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x22c085){const _0x2d8c29=a41_0x24a22f,_0x320272=loadServiceManifestFromFile(_0x22c085[_0x2d8c29(0xf5)](_0x2d8c29(0xfc)));if(!_0x320272[_0x2d8c29(0x10b)]['ok'])return{'ok':![],'data':{'file':_0x320272[_0x2d8c29(0x114)],'hash':_0x320272[_0x2d8c29(0xe8)],'kind':_0x320272[_0x2d8c29(0x10d)],'serviceCount':_0x320272[_0x2d8c29(0xe4)][_0x2d8c29(0xea)],'services':_0x320272['manifests'][_0x2d8c29(0xfd)](summarizeLoadedManifest),'errors':_0x320272[_0x2d8c29(0x10b)][_0x2d8c29(0xf1)],'warnings':_0x320272[_0x2d8c29(0x10b)][_0x2d8c29(0xe7)]},'message':formatValidationFailure(_0x320272[_0x2d8c29(0x10b)])};if(_0x320272['kind']===_0x2d8c29(0x10c)||_0x320272['manifests']['length']!==0x1)return{'ok':!![],'data':{'file':_0x320272[_0x2d8c29(0x114)],'hash':_0x320272['hash'],'kind':_0x320272['kind'],'serviceCount':_0x320272[_0x2d8c29(0xe4)][_0x2d8c29(0xea)],'commandCount':_0x320272[_0x2d8c29(0xe4)][_0x2d8c29(0x10e)]((_0x37718e,_0x43945a)=>_0x37718e+(_0x43945a['normalizedManifest']?.[_0x2d8c29(0xe6)][_0x2d8c29(0xea)]??0x0),0x0),'services':_0x320272['manifests'][_0x2d8c29(0xfd)](summarizeLoadedManifest),'warnings':_0x320272['report'][_0x2d8c29(0xe7)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x320272[_0x2d8c29(0x114)],'hash':_0x320272[_0x2d8c29(0xe8)],'kind':_0x320272['kind'],'service':_0x320272['normalizedManifest']?.[_0x2d8c29(0xf7)],'version':_0x320272[_0x2d8c29(0x101)]?.['version'],'commandCount':_0x320272[_0x2d8c29(0x101)]?.[_0x2d8c29(0xe6)][_0x2d8c29(0xea)]??0x0,'commands':_0x320272[_0x2d8c29(0x101)]?.[_0x2d8c29(0xe6)][_0x2d8c29(0xfd)](_0x11fe69=>({'path':_0x11fe69[_0x2d8c29(0x117)],'risk':_0x11fe69['risk'],'target':toPublicServiceTreeTarget(_0x11fe69[_0x2d8c29(0x109)])})),'warnings':_0x320272[_0x2d8c29(0x10b)][_0x2d8c29(0xe7)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':a41_0x24a22f(0xf7),'command':a41_0x24a22f(0xff),'description':'将\x20Service\x20Tree\x20清单导入本地运行态注册表','risk':a41_0x24a22f(0xfb),'confirmationDescription':a41_0x24a22f(0x103),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x1aaaf6){const _0x395094=a41_0x24a22f,_0xd194ce=loadServiceManifestFromFile(_0x1aaaf6[_0x395094(0xf5)]('file'));return{'method':_0x395094(0xdf),'url':getServiceRegistryPath(),'body':{'file':_0xd194ce[_0x395094(0x114)],'hash':_0xd194ce[_0x395094(0xe8)],'kind':_0xd194ce[_0x395094(0x10d)],'ok':_0xd194ce['report']['ok'],'service':_0xd194ce[_0x395094(0x101)]?.[_0x395094(0xf7)],'version':_0xd194ce['normalizedManifest']?.[_0x395094(0x11a)],'serviceCount':_0xd194ce[_0x395094(0xe4)]['length'],'services':_0xd194ce[_0x395094(0xe4)][_0x395094(0xfd)](_0x5983cf=>({'service':_0x5983cf[_0x395094(0x101)]?.['service'],'version':_0x5983cf[_0x395094(0x101)]?.[_0x395094(0x11a)],'commandCount':_0x5983cf[_0x395094(0x101)]?.['commands'][_0x395094(0xea)]??0x0,'errors':_0x5983cf[_0x395094(0x10b)][_0x395094(0xf1)]})),'errors':_0xd194ce[_0x395094(0x10b)]['errors'],'commandCount':_0xd194ce[_0x395094(0x101)]?.[_0x395094(0xe6)][_0x395094(0xea)]??0x0},'description':_0x395094(0xe1)};},async 'execute'(_0x44203d){const _0x59ca2e=a41_0x24a22f,_0x55692c=importServiceManifest(_0x44203d[_0x59ca2e(0xf5)](_0x59ca2e(0xfc)));if(_0x55692c[_0x59ca2e(0xef)][_0x59ca2e(0xea)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x55692c[_0x59ca2e(0xd6)],'imported':_0x55692c[_0x59ca2e(0xe9)],'updated':_0x55692c[_0x59ca2e(0xd4)],'serviceCount':_0x55692c[_0x59ca2e(0xe3)],'services':_0x55692c['entries'][_0x59ca2e(0xfd)](summarizeService)},'message':_0x59ca2e(0xec)+_0x55692c[_0x59ca2e(0xe9)]+_0x59ca2e(0xde)+_0x55692c[_0x59ca2e(0xd4)]+_0x59ca2e(0x105)};return{'ok':!![],'data':{'registryPath':_0x55692c[_0x59ca2e(0xd6)],'replaced':_0x55692c[_0x59ca2e(0xed)],'imported':_0x55692c[_0x59ca2e(0xe9)],'updated':_0x55692c['updated'],'serviceCount':_0x55692c['serviceCount'],'service':summarizeService(_0x55692c[_0x59ca2e(0x100)])},'message':(_0x55692c['replaced']?_0x59ca2e(0xe0):'Imported')+_0x59ca2e(0x113)+_0x55692c['entry'][_0x59ca2e(0xdd)]+'.'};}},{'service':a41_0x24a22f(0xf7),'command':a41_0x24a22f(0xda),'description':a41_0x24a22f(0xf2),'risk':a41_0x24a22f(0xfb),'confirmationDescription':a41_0x24a22f(0x118),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x19936f){const _0x233f3c=a41_0x24a22f,_0x2648b4=getLocalServiceEntry(_0x19936f[_0x233f3c(0xf5)]('service'));return{'method':_0x233f3c(0xdf),'url':_0x19936f['str']('file'),'body':{'service':_0x19936f[_0x233f3c(0xf5)](_0x233f3c(0xf7)),'found':Boolean(_0x2648b4),'version':_0x2648b4?.['version'],'source':_0x2648b4?.[_0x233f3c(0x104)]},'description':_0x233f3c(0xfe)};},async 'execute'(_0x16ad04){const _0xbef7e1=a41_0x24a22f,_0x31017b=exportServiceManifest(_0x16ad04['str'](_0xbef7e1(0xf7)),_0x16ad04['str'](_0xbef7e1(0xfc)));return{'ok':!![],'data':{'registryPath':_0x31017b[_0xbef7e1(0xd6)],'file':_0x31017b[_0xbef7e1(0x114)],'service':summarizeService(_0x31017b[_0xbef7e1(0x100)])},'message':_0xbef7e1(0xf8)+_0x31017b['entry']['serviceCode']+'.'};}},{'service':a41_0x24a22f(0xf7),'command':'list','description':a41_0x24a22f(0xe5),'risk':a41_0x24a22f(0x10f),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x1ed6de=a41_0x24a22f,_0x52b9e7=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x52b9e7['length'],'services':_0x52b9e7[_0x1ed6de(0xfd)](summarizeService)}};}},{'service':a41_0x24a22f(0xf7),'command':'remove','description':a41_0x24a22f(0xdc),'risk':'write','confirmationDescription':a41_0x24a22f(0xd5),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x472a33){const _0x2f593a=a41_0x24a22f,_0x5aee54=getLocalServiceEntry(_0x472a33[_0x2f593a(0xf5)](_0x2f593a(0xf7)));return{'method':_0x2f593a(0xdf),'url':getServiceRegistryPath(),'body':{'service':_0x472a33[_0x2f593a(0xf5)](_0x2f593a(0xf7)),'found':Boolean(_0x5aee54),'version':_0x5aee54?.['version'],'source':_0x5aee54?.[_0x2f593a(0x104)]},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x415f5e){const _0x5d3c17=a41_0x24a22f,_0x550cd7=removeServiceManifest(_0x415f5e['str']('service'));return{'ok':!![],'data':{'registryPath':_0x550cd7[_0x5d3c17(0xd6)],'serviceCount':_0x550cd7['serviceCount'],'service':summarizeService(_0x550cd7[_0x5d3c17(0x100)])},'message':'Removed\x20service\x20'+_0x550cd7[_0x5d3c17(0x100)][_0x5d3c17(0xdd)]+'.'};}},{'service':a41_0x24a22f(0xf7),'command':a41_0x24a22f(0x106),'description':a41_0x24a22f(0x119),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x1bdec1){const _0x3498d2=a41_0x24a22f,_0x5630c2=getLocalServiceEntry(_0x1bdec1[_0x3498d2(0xf5)](_0x3498d2(0xf7)));if(!_0x5630c2)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x1bdec1[_0x3498d2(0xf5)](_0x3498d2(0xf7))},'message':'Local\x20service\x20not\x20found:\x20'+_0x1bdec1[_0x3498d2(0xf5)](_0x3498d2(0xf7))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x5630c2),'manifest':_0x5630c2[_0x3498d2(0xf0)],'normalizedManifest':toPublicNormalizedServiceTree(_0x5630c2[_0x3498d2(0x101)])}};}}];
1
+ function a41_0x3f35(){const _0x172ba1=['normalizedManifest','reduce','list','cliPath','import','str','entry','registryPath','1525825SQfvxP','filePath','version','validate','2532vwDNsJ','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','serviceCount','errors','required','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','report','source','detail','manifests','type','string','hash','kind','registry','risk','target','lower\x20kebab-case\x20service\x20code','14646WyaBup','imported','从本地运行态注册表移除\x20Service\x20Tree\x20清单','service','updated','entries','serviceCode','WRITE','warnings','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','read','Local\x20service\x20not\x20found:\x20','map','6jFoTSJ','write','registryServiceCode','flags','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','\x20service\x20','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','file','Local\x20service\x20code,\x20for\x20example\x20crm','\x20service(s),\x20updated\x20','importedAt','replaced','length','160qDBWLQ','remove','132zZDAFo','20330nwqdxU','100OsEocp','Imported','description','manifest','846024HaQour','commands','10hZodMe','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','2587617avUXTV','295339BHkYfC','name'];a41_0x3f35=function(){return _0x172ba1;};return a41_0x3f35();}const a41_0x39b7ef=a41_0x54ab;(function(_0x44cf36,_0x14d6a9){const _0x7e30c3=a41_0x54ab,_0xd26a90=_0x44cf36();while(!![]){try{const _0x3aa1da=parseInt(_0x7e30c3(0xa6))/0x1+-parseInt(_0x7e30c3(0x8f))/0x2*(-parseInt(_0x7e30c3(0xba))/0x3)+parseInt(_0x7e30c3(0x8b))/0x4*(parseInt(_0x7e30c3(0x8e))/0x5)+parseInt(_0x7e30c3(0xc7))/0x6*(parseInt(_0x7e30c3(0xa2))/0x7)+parseInt(_0x7e30c3(0x93))/0x8+-parseInt(_0x7e30c3(0x97))/0x9*(parseInt(_0x7e30c3(0x95))/0xa)+-parseInt(_0x7e30c3(0x98))/0xb*(parseInt(_0x7e30c3(0x8d))/0xc);if(_0x3aa1da===_0x14d6a9)break;else _0xd26a90['push'](_0xd26a90['shift']());}catch(_0x4818de){_0xd26a90['push'](_0xd26a90['shift']());}}}(a41_0x3f35,0x24a84));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a41_0x39b7ef(0xce),'type':a41_0x39b7ef(0xb3),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a41_0x39b7ef(0xbd),'type':a41_0x39b7ef(0xb3),'required':!![],'description':a41_0x39b7ef(0xcf),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x39b7ef(0xb9)}};function a41_0x54ab(_0x318ee5,_0x281c14){_0x318ee5=_0x318ee5-0x87;const _0x3f3575=a41_0x3f35();let _0x54ab18=_0x3f3575[_0x318ee5];return _0x54ab18;}function summarizeService(_0x22dba9){const _0x40c16c=a41_0x39b7ef;return{'serviceCode':_0x22dba9[_0x40c16c(0xc0)],'name':_0x22dba9[_0x40c16c(0x9a)][_0x40c16c(0xbd)]['name'],'version':_0x22dba9[_0x40c16c(0xa4)],'importedAt':_0x22dba9[_0x40c16c(0x88)],'source':_0x22dba9[_0x40c16c(0xaf)],'commandCount':_0x22dba9[_0x40c16c(0x9a)][_0x40c16c(0x94)][_0x40c16c(0x8a)],'commands':_0x22dba9[_0x40c16c(0x9a)][_0x40c16c(0x94)][_0x40c16c(0xc6)](_0x17c3db=>({'path':_0x17c3db['cliPath'],'description':_0x17c3db[_0x40c16c(0x91)],'risk':_0x17c3db[_0x40c16c(0xb7)],'target':toPublicServiceTreeTarget(_0x17c3db[_0x40c16c(0xb8)]),'flags':_0x17c3db[_0x40c16c(0xca)][_0x40c16c(0xc6)](_0x29915a=>({'name':_0x29915a[_0x40c16c(0x99)],'cliName':_0x29915a['cliName'],'type':_0x29915a[_0x40c16c(0xb2)],'required':_0x29915a[_0x40c16c(0xaa)]===!![]}))}))};}function summarizeLoadedManifest(_0x5b76c0){const _0x389294=a41_0x39b7ef;return{'service':_0x5b76c0[_0x389294(0x9a)]?.['service'],'version':_0x5b76c0[_0x389294(0x9a)]?.[_0x389294(0xa4)],'commandCount':_0x5b76c0['normalizedManifest']?.[_0x389294(0x94)][_0x389294(0x8a)]??0x0,'commands':_0x5b76c0[_0x389294(0x9a)]?.[_0x389294(0x94)][_0x389294(0xc6)](_0x5af62f=>({'path':_0x5af62f[_0x389294(0x9d)],'risk':_0x5af62f['risk'],'target':toPublicServiceTreeTarget(_0x5af62f['target'])}))??[],'registryIndex':_0x5b76c0['registryIndex'],'registryServiceCode':_0x5b76c0[_0x389294(0xc9)],'errors':_0x5b76c0[_0x389294(0xae)][_0x389294(0xa9)],'warnings':_0x5b76c0[_0x389294(0xae)]['warnings']};}export const serviceDefinitions=[{'service':a41_0x39b7ef(0xbd),'command':a41_0x39b7ef(0xa5),'description':a41_0x39b7ef(0xac),'risk':a41_0x39b7ef(0xc4),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x10da2a){const _0xe92a7b=a41_0x39b7ef,_0x1bfc0c=loadServiceManifestFromFile(_0x10da2a['str'](_0xe92a7b(0xce)));if(!_0x1bfc0c[_0xe92a7b(0xae)]['ok'])return{'ok':![],'data':{'file':_0x1bfc0c['filePath'],'hash':_0x1bfc0c['hash'],'kind':_0x1bfc0c[_0xe92a7b(0xb5)],'serviceCount':_0x1bfc0c['manifests']['length'],'services':_0x1bfc0c[_0xe92a7b(0xb1)][_0xe92a7b(0xc6)](summarizeLoadedManifest),'errors':_0x1bfc0c['report'][_0xe92a7b(0xa9)],'warnings':_0x1bfc0c[_0xe92a7b(0xae)][_0xe92a7b(0xc2)]},'message':formatValidationFailure(_0x1bfc0c[_0xe92a7b(0xae)])};if(_0x1bfc0c['kind']===_0xe92a7b(0xb6)||_0x1bfc0c[_0xe92a7b(0xb1)][_0xe92a7b(0x8a)]!==0x1)return{'ok':!![],'data':{'file':_0x1bfc0c['filePath'],'hash':_0x1bfc0c['hash'],'kind':_0x1bfc0c['kind'],'serviceCount':_0x1bfc0c[_0xe92a7b(0xb1)]['length'],'commandCount':_0x1bfc0c['manifests'][_0xe92a7b(0x9b)]((_0x464eb4,_0x120e04)=>_0x464eb4+(_0x120e04[_0xe92a7b(0x9a)]?.[_0xe92a7b(0x94)]['length']??0x0),0x0),'services':_0x1bfc0c['manifests'][_0xe92a7b(0xc6)](summarizeLoadedManifest),'warnings':_0x1bfc0c[_0xe92a7b(0xae)][_0xe92a7b(0xc2)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x1bfc0c['filePath'],'hash':_0x1bfc0c[_0xe92a7b(0xb4)],'kind':_0x1bfc0c[_0xe92a7b(0xb5)],'service':_0x1bfc0c[_0xe92a7b(0x9a)]?.[_0xe92a7b(0xbd)],'version':_0x1bfc0c[_0xe92a7b(0x9a)]?.[_0xe92a7b(0xa4)],'commandCount':_0x1bfc0c['normalizedManifest']?.[_0xe92a7b(0x94)][_0xe92a7b(0x8a)]??0x0,'commands':_0x1bfc0c['normalizedManifest']?.[_0xe92a7b(0x94)]['map'](_0x370a2a=>({'path':_0x370a2a[_0xe92a7b(0x9d)],'risk':_0x370a2a['risk'],'target':toPublicServiceTreeTarget(_0x370a2a['target'])})),'warnings':_0x1bfc0c['report'][_0xe92a7b(0xc2)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':'service','command':a41_0x39b7ef(0x9e),'description':'将\x20Service\x20Tree\x20清单导入本地运行态注册表','risk':a41_0x39b7ef(0xc8),'confirmationDescription':a41_0x39b7ef(0x96),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x2d1946){const _0x53c216=a41_0x39b7ef,_0x17216e=loadServiceManifestFromFile(_0x2d1946['str']('file'));return{'method':_0x53c216(0xc1),'url':getServiceRegistryPath(),'body':{'file':_0x17216e[_0x53c216(0xa3)],'hash':_0x17216e[_0x53c216(0xb4)],'kind':_0x17216e[_0x53c216(0xb5)],'ok':_0x17216e[_0x53c216(0xae)]['ok'],'service':_0x17216e['normalizedManifest']?.[_0x53c216(0xbd)],'version':_0x17216e[_0x53c216(0x9a)]?.[_0x53c216(0xa4)],'serviceCount':_0x17216e[_0x53c216(0xb1)][_0x53c216(0x8a)],'services':_0x17216e[_0x53c216(0xb1)]['map'](_0x3ffea6=>({'service':_0x3ffea6[_0x53c216(0x9a)]?.['service'],'version':_0x3ffea6[_0x53c216(0x9a)]?.[_0x53c216(0xa4)],'commandCount':_0x3ffea6['normalizedManifest']?.['commands'][_0x53c216(0x8a)]??0x0,'errors':_0x3ffea6[_0x53c216(0xae)][_0x53c216(0xa9)]})),'errors':_0x17216e[_0x53c216(0xae)][_0x53c216(0xa9)],'commandCount':_0x17216e[_0x53c216(0x9a)]?.[_0x53c216(0x94)][_0x53c216(0x8a)]??0x0},'description':_0x53c216(0xad)};},async 'execute'(_0x2eb950){const _0xa0aa57=a41_0x39b7ef,_0x58e070=importServiceManifest(_0x2eb950[_0xa0aa57(0x9f)](_0xa0aa57(0xce)));if(_0x58e070['entries']['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x58e070[_0xa0aa57(0xa1)],'imported':_0x58e070[_0xa0aa57(0xbb)],'updated':_0x58e070[_0xa0aa57(0xbe)],'serviceCount':_0x58e070[_0xa0aa57(0xa8)],'services':_0x58e070[_0xa0aa57(0xbf)][_0xa0aa57(0xc6)](summarizeService)},'message':'Imported\x20'+_0x58e070[_0xa0aa57(0xbb)]+_0xa0aa57(0x87)+_0x58e070['updated']+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x58e070['registryPath'],'replaced':_0x58e070[_0xa0aa57(0x89)],'imported':_0x58e070[_0xa0aa57(0xbb)],'updated':_0x58e070['updated'],'serviceCount':_0x58e070[_0xa0aa57(0xa8)],'service':summarizeService(_0x58e070[_0xa0aa57(0xa0)])},'message':(_0x58e070['replaced']?'Updated':_0xa0aa57(0x90))+_0xa0aa57(0xcc)+_0x58e070[_0xa0aa57(0xa0)][_0xa0aa57(0xc0)]+'.'};}},{'service':a41_0x39b7ef(0xbd),'command':'export','description':a41_0x39b7ef(0xcb),'risk':a41_0x39b7ef(0xc8),'confirmationDescription':a41_0x39b7ef(0xc3),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x7c0b63){const _0x14f01f=a41_0x39b7ef,_0x28404c=getLocalServiceEntry(_0x7c0b63[_0x14f01f(0x9f)](_0x14f01f(0xbd)));return{'method':_0x14f01f(0xc1),'url':_0x7c0b63['str'](_0x14f01f(0xce)),'body':{'service':_0x7c0b63[_0x14f01f(0x9f)](_0x14f01f(0xbd)),'found':Boolean(_0x28404c),'version':_0x28404c?.[_0x14f01f(0xa4)],'source':_0x28404c?.[_0x14f01f(0xaf)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x54b5b3){const _0x8825d4=a41_0x39b7ef,_0x58ddee=exportServiceManifest(_0x54b5b3[_0x8825d4(0x9f)]('service'),_0x54b5b3[_0x8825d4(0x9f)]('file'));return{'ok':!![],'data':{'registryPath':_0x58ddee[_0x8825d4(0xa1)],'file':_0x58ddee['filePath'],'service':summarizeService(_0x58ddee[_0x8825d4(0xa0)])},'message':'Exported\x20service\x20'+_0x58ddee[_0x8825d4(0xa0)]['serviceCode']+'.'};}},{'service':a41_0x39b7ef(0xbd),'command':a41_0x39b7ef(0x9c),'description':a41_0x39b7ef(0xa7),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x46470c=a41_0x39b7ef,_0x1ef627=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x1ef627['length'],'services':_0x1ef627[_0x46470c(0xc6)](summarizeService)}};}},{'service':a41_0x39b7ef(0xbd),'command':a41_0x39b7ef(0x8c),'description':a41_0x39b7ef(0xbc),'risk':a41_0x39b7ef(0xc8),'confirmationDescription':a41_0x39b7ef(0xcd),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x470812){const _0xe7d735=a41_0x39b7ef,_0x10b4a8=getLocalServiceEntry(_0x470812['str'](_0xe7d735(0xbd)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x470812['str'](_0xe7d735(0xbd)),'found':Boolean(_0x10b4a8),'version':_0x10b4a8?.[_0xe7d735(0xa4)],'source':_0x10b4a8?.['source']},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x352b92){const _0x4ab1c4=a41_0x39b7ef,_0x5a65c2=removeServiceManifest(_0x352b92[_0x4ab1c4(0x9f)](_0x4ab1c4(0xbd)));return{'ok':!![],'data':{'registryPath':_0x5a65c2[_0x4ab1c4(0xa1)],'serviceCount':_0x5a65c2[_0x4ab1c4(0xa8)],'service':summarizeService(_0x5a65c2[_0x4ab1c4(0xa0)])},'message':'Removed\x20service\x20'+_0x5a65c2[_0x4ab1c4(0xa0)]['serviceCode']+'.'};}},{'service':a41_0x39b7ef(0xbd),'command':a41_0x39b7ef(0xb0),'description':a41_0x39b7ef(0xab),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x2a86ac){const _0x132adb=a41_0x39b7ef,_0x201c20=getLocalServiceEntry(_0x2a86ac[_0x132adb(0x9f)](_0x132adb(0xbd)));if(!_0x201c20)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x2a86ac[_0x132adb(0x9f)](_0x132adb(0xbd))},'message':_0x132adb(0xc5)+_0x2a86ac[_0x132adb(0x9f)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x201c20),'manifest':_0x201c20[_0x132adb(0x92)],'normalizedManifest':toPublicNormalizedServiceTree(_0x201c20[_0x132adb(0x9a)])}};}}];
@@ -1 +1 @@
1
- const a42_0x4d4d36=a42_0x34b2;(function(_0x3f1224,_0x1b0420){const _0x5bb14f=a42_0x34b2,_0x112571=_0x3f1224();while(!![]){try{const _0x52224f=parseInt(_0x5bb14f(0x1ad))/0x1+parseInt(_0x5bb14f(0x1b1))/0x2*(parseInt(_0x5bb14f(0x1d5))/0x3)+parseInt(_0x5bb14f(0x1e4))/0x4+parseInt(_0x5bb14f(0x1b9))/0x5+parseInt(_0x5bb14f(0x1d1))/0x6+-parseInt(_0x5bb14f(0x1a9))/0x7*(parseInt(_0x5bb14f(0x1d9))/0x8)+-parseInt(_0x5bb14f(0x1e5))/0x9;if(_0x52224f===_0x1b0420)break;else _0x112571['push'](_0x112571['shift']());}catch(_0x405f9f){_0x112571['push'](_0x112571['shift']());}}}(a42_0x2e63,0x379b0));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a42_0x4d4d36(0x1c1);export function getServiceRegistryPath(_0x3794fa={}){return resolve(_0x3794fa['homeDir']??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x5a9fa6={}){const _0x1eb970=a42_0x4d4d36,_0x357acd=getServiceRegistryPath(_0x5a9fa6);if(!existsSync(_0x357acd))return emptyServiceRegistry();try{const _0x575a0a=readFileSync(_0x357acd,_0x1eb970(0x1be));if(!_0x575a0a['trim']())return emptyServiceRegistry();const _0x495576=JSON[_0x1eb970(0x1d0)](_0x575a0a);if(_0x495576[_0x1eb970(0x1c7)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x1eb970(0x1ec)+String(_0x495576[_0x1eb970(0x1c7)]),_0x1eb970(0x1da)+_0x357acd+'.');if(!Array['isArray'](_0x495576['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x495576[_0x1eb970(0x1d8)],'services':_0x495576['services']};}catch(_0x5695e9){if(_0x5695e9 instanceof Error&&_0x5695e9['name']===_0x1eb970(0x1b0))throw _0x5695e9;throw CliErrors['validation'](_0x1eb970(0x1f6)+_0x357acd,_0x1eb970(0x1b3));}}export function writeServiceRegistry(_0x25e2d8,_0x437b25={}){const _0x2758f6=a42_0x4d4d36,_0xae99e5=getServiceRegistryPath(_0x437b25),_0x1b64f7=dirname(_0xae99e5);!existsSync(_0x1b64f7)&&mkdirSync(_0x1b64f7,{'recursive':!![]});const _0x2128dc=_0xae99e5+_0x2758f6(0x1f2);try{writeFileSync(_0x2128dc,JSON[_0x2758f6(0x1c3)](_0x25e2d8,null,0x2)+'\x0a',{'encoding':_0x2758f6(0x1be),'mode':0x180}),renameSync(_0x2128dc,_0xae99e5);}catch(_0x2125ae){try{unlinkSync(_0x2128dc);}catch{}if(_0x2125ae?.[_0x2758f6(0x1c5)]===_0x2758f6(0x1de))throw CliErrors[_0x2758f6(0x1b4)](_0x2758f6(0x1ee)+_0xae99e5);throw _0x2125ae;}return _0xae99e5;}export function loadServiceManifestFromFile(_0x46a771){const _0x28880f=a42_0x4d4d36,_0x195a6a=resolve(_0x46a771);if(!existsSync(_0x195a6a))throw CliErrors[_0x28880f(0x1b4)](_0x28880f(0x1f0)+_0x46a771);let _0x2810f5;const _0x2824a8=readFileSync(_0x195a6a,'utf8');try{_0x2810f5=JSON[_0x28880f(0x1d0)](_0x2824a8);}catch{throw CliErrors[_0x28880f(0x1b4)]('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x46a771,_0x28880f(0x1f7));}const _0x2f1f5b=sha256(_0x2824a8),_0x1fcd5c=extractLoadedServiceManifests(_0x2810f5,_0x2f1f5b),_0x4bf12f=aggregateValidationReports(_0x1fcd5c),_0x5d3d17=_0x1fcd5c[0x0];return{'filePath':_0x195a6a,'hash':_0x2f1f5b,'kind':isServiceRegistryLike(_0x2810f5)?_0x28880f(0x1ac):_0x28880f(0x1f4),'manifest':_0x5d3d17?.['manifest']??_0x2810f5,'report':_0x4bf12f,'normalizedManifest':_0x1fcd5c[_0x28880f(0x1ce)]===0x1?_0x5d3d17?.[_0x28880f(0x1ef)]:undefined,'manifests':_0x1fcd5c};}export function importServiceManifest(_0x19478d,_0xff56d5={}){const _0x2a672c=a42_0x4d4d36,_0x4c274b=loadServiceManifestFromFile(_0x19478d);if(!_0x4c274b['report']['ok'])throw CliErrors[_0x2a672c(0x1b4)](formatValidationFailure(_0x4c274b[_0x2a672c(0x1d7)]),_0x2a672c(0x1d2));if(_0x4c274b[_0x2a672c(0x1e3)]['length']===0x0)throw CliErrors[_0x2a672c(0x1b4)](_0x2a672c(0x1eb),_0x2a672c(0x1ab));const _0x5c27fa=readServiceRegistry(_0xff56d5),_0xe3c41a=(_0xff56d5[_0x2a672c(0x1c8)]??(()=>new Date()))()[_0x2a672c(0x1ed)](),_0x39b404=[];let _0x243092=0x0,_0x209932=0x0;for(const _0x2d7a80 of _0x4c274b[_0x2a672c(0x1e3)]){if(!_0x2d7a80[_0x2a672c(0x1ef)])continue;const _0x74daf=_0x2d7a80[_0x2a672c(0x1ef)][_0x2a672c(0x1d3)]['code'],_0x1f0549={'serviceCode':_0x74daf,'version':_0x2d7a80['normalizedManifest'][_0x2a672c(0x1ae)],'importedAt':_0xe3c41a,'source':{'type':_0x2a672c(0x1e2),'path':_0x4c274b['filePath'],'hash':_0x2d7a80[_0x2a672c(0x1bb)]},'manifest':_0x2d7a80[_0x2a672c(0x1f4)],'normalizedManifest':_0x2d7a80['normalizedManifest']},_0x3e0fbb=_0x5c27fa[_0x2a672c(0x1cb)][_0x2a672c(0x1f8)](_0x46b823=>_0x46b823[_0x2a672c(0x1b7)]===_0x74daf);_0x3e0fbb>=0x0?(_0x5c27fa['services'][_0x3e0fbb]=_0x1f0549,_0x209932++):(_0x5c27fa[_0x2a672c(0x1cb)][_0x2a672c(0x1db)](_0x1f0549),_0x243092++),_0x39b404[_0x2a672c(0x1db)](_0x1f0549);}_0x5c27fa['services']['sort']((_0x12270,_0x1d6f8f)=>_0x12270[_0x2a672c(0x1b7)][_0x2a672c(0x1af)](_0x1d6f8f[_0x2a672c(0x1b7)])),_0x5c27fa[_0x2a672c(0x1d8)]=_0xe3c41a;const _0x164d38=writeServiceRegistry(_0x5c27fa,_0xff56d5);return{'registryPath':_0x164d38,'entry':_0x39b404[0x0],'replaced':_0x39b404[_0x2a672c(0x1ce)]===0x1?_0x209932===0x1:_0x209932>0x0,'entries':_0x39b404,'imported':_0x243092,'updated':_0x209932,'serviceCount':_0x5c27fa[_0x2a672c(0x1cb)][_0x2a672c(0x1ce)]};}export function exportServiceManifest(_0x5ab2e9,_0x3b0833,_0x3e9e12={}){const _0xa96cdd=a42_0x4d4d36,_0x1c254f=getServiceRegistryPath(_0x3e9e12),_0x51d094=getLocalServiceEntry(_0x5ab2e9,_0x3e9e12);if(!_0x51d094)throw CliErrors['validation']('Local\x20service\x20not\x20found:\x20'+_0x5ab2e9,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const _0x4d4eb8=resolve(_0x3b0833),_0x313cb4=dirname(_0x4d4eb8);return!existsSync(_0x313cb4)&&mkdirSync(_0x313cb4,{'recursive':!![]}),writeFileSync(_0x4d4eb8,JSON[_0xa96cdd(0x1c3)](_0x51d094['manifest'],null,0x2)+'\x0a',{'encoding':_0xa96cdd(0x1be),'mode':0x180}),{'registryPath':_0x1c254f,'filePath':_0x4d4eb8,'entry':_0x51d094};}export function removeServiceManifest(_0x2898a5,_0x30e096={}){const _0x38516c=a42_0x4d4d36,_0x29f1ad=readServiceRegistry(_0x30e096),_0x10b317=_0x2898a5[_0x38516c(0x1e8)](),_0x181f40=_0x29f1ad[_0x38516c(0x1cb)][_0x38516c(0x1f8)](_0x3d0253=>_0x3d0253[_0x38516c(0x1b7)]===_0x10b317);if(_0x181f40<0x0)throw CliErrors[_0x38516c(0x1b4)]('Local\x20service\x20not\x20found:\x20'+_0x10b317,_0x38516c(0x1c2));const [_0x1e6073]=_0x29f1ad[_0x38516c(0x1cb)][_0x38516c(0x1e1)](_0x181f40,0x1),_0x170f3b=(_0x30e096[_0x38516c(0x1c8)]??(()=>new Date()))()[_0x38516c(0x1ed)]();_0x29f1ad[_0x38516c(0x1d8)]=_0x170f3b;const _0x4a9c1f=writeServiceRegistry(_0x29f1ad,_0x30e096);return{'registryPath':_0x4a9c1f,'entry':_0x1e6073,'serviceCount':_0x29f1ad[_0x38516c(0x1cb)]['length']};}export function listLocalServices(_0x67a4b2={}){const _0x485e88=a42_0x4d4d36;return readServiceRegistry(_0x67a4b2)[_0x485e88(0x1cb)];}export function getLocalServiceEntry(_0x353882,_0x1d96be={}){const _0x403ab4=a42_0x4d4d36;return readServiceRegistry(_0x1d96be)[_0x403ab4(0x1cb)][_0x403ab4(0x1ba)](_0x59d145=>_0x59d145['serviceCode']===_0x353882['trim']());}export function listLocalServiceTrees(_0x1e89af={}){const _0xc1d491=a42_0x4d4d36;return readServiceRegistry(_0x1e89af)[_0xc1d491(0x1cb)][_0xc1d491(0x1cf)](_0xf95d11=>_0xf95d11[_0xc1d491(0x1ef)]);}export function inspectServiceRegistry(_0x599b0d={}){const _0xd0b367=a42_0x4d4d36,_0x4f7fd3=getServiceRegistryPath(_0x599b0d);if(!existsSync(_0x4f7fd3))return emptyServiceRegistryInspection(_0x4f7fd3,'missing',![]);try{const _0x433755=readFileSync(_0x4f7fd3,'utf8');if(!_0x433755[_0xd0b367(0x1e8)]())return emptyServiceRegistryInspection(_0x4f7fd3,_0xd0b367(0x1f1),!![]);const _0x1c1fb8=JSON[_0xd0b367(0x1d0)](_0x433755);if(_0x1c1fb8[_0xd0b367(0x1c7)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x4f7fd3,'invalid',!![]),'schemaVersion':_0x1c1fb8[_0xd0b367(0x1c7)],'message':_0xd0b367(0x1c6)+String(_0x1c1fb8[_0xd0b367(0x1c7)])};if(!Array[_0xd0b367(0x1ca)](_0x1c1fb8['services']))return{...emptyServiceRegistryInspection(_0x4f7fd3,_0xd0b367(0x1c0),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1c1fb8[_0xd0b367(0x1d8)],'message':_0xd0b367(0x1bd)};const _0x2974b1=_0x1c1fb8[_0xd0b367(0x1cb)]['map'](summarizeLocalServiceEntry);return{'registryPath':_0x4f7fd3,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1c1fb8['updatedAt'],'serviceCount':_0x2974b1[_0xd0b367(0x1ce)],'commandCount':_0x2974b1['reduce']((_0x637cd6,_0x40984c)=>_0x637cd6+_0x40984c[_0xd0b367(0x1c9)],0x0),'services':_0x2974b1};}catch(_0x10abe0){return{...emptyServiceRegistryInspection(_0x4f7fd3,_0xd0b367(0x1c0),!![]),'message':_0x10abe0 instanceof Error?_0x10abe0[_0xd0b367(0x1b5)]:String(_0x10abe0)};}}export function formatValidationFailure(_0x5f4daa){const _0x2e257b=a42_0x4d4d36,_0x4fc38f=_0x5f4daa[_0x2e257b(0x1e0)][_0x2e257b(0x1cf)](_0x2f4b09=>_0x2f4b09['path']+':\x20'+_0x2f4b09[_0x2e257b(0x1b5)]);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x4fc38f[_0x2e257b(0x1aa)]('\x0a');}function a42_0x34b2(_0x5edc55,_0x3f04a7){_0x5edc55=_0x5edc55-0x1a9;const _0x2e636c=a42_0x2e63();let _0x34b2d4=_0x2e636c[_0x5edc55];return _0x34b2d4;}function extractLoadedServiceManifests(_0x168f72,_0x2be0be){const _0x19e958=a42_0x4d4d36;if(!isServiceRegistryLike(_0x168f72)){const _0xf9b6d8=_0x168f72,{manifest:_0x23d67b,errors:_0x32935d}=adaptServiceTreeManifestForLegacyFramework(_0xf9b6d8),_0x3ac93e=validateServiceTreeManifest(_0x23d67b),_0x432208=mergeValidationErrors(_0x3ac93e,_0x32935d);return[{'manifest':_0xf9b6d8,'report':_0x432208,'normalizedManifest':_0x432208['ok']?normalizeServiceTreeManifest(_0x23d67b):undefined,'sourceHash':_0x2be0be}];}return _0x168f72[_0x19e958(0x1cb)][_0x19e958(0x1cf)]((_0x5786eb,_0x5974d9)=>{const _0x296cb9=_0x19e958,_0x456504=isObjectRecord(_0x5786eb)?_0x5786eb[_0x296cb9(0x1f4)]:undefined,{manifest:_0x5577a5,errors:_0x1ac7b7}=adaptServiceTreeManifestForLegacyFramework(_0x456504),_0x5e51b2=validateServiceTreeManifest(_0x5577a5),_0x1511ed=mergeValidationErrors(_0x5e51b2,_0x1ac7b7),_0x309637=isObjectRecord(_0x5786eb)&&typeof _0x5786eb['serviceCode']===_0x296cb9(0x1cc)?_0x5786eb[_0x296cb9(0x1b7)]:undefined;return{'manifest':_0x456504,'report':_0x1511ed,'normalizedManifest':_0x1511ed['ok']?normalizeServiceTreeManifest(_0x5577a5):undefined,'sourceHash':sha256(JSON['stringify'](_0x456504,null,0x2)+'\x0a'),'registryIndex':_0x5974d9,'registryServiceCode':_0x309637};});}function mergeValidationErrors(_0x1e3ad0,_0x258a5f){const _0x43a67b=a42_0x4d4d36,_0x139bc5=_0x1e3ad0[_0x43a67b(0x1e0)]['map'](_0x575681=>_0x575681[_0x43a67b(0x1b5)]===_0x43a67b(0x1cd)?{..._0x575681,'message':'bff\x20target\x20requires\x20functionName.'}:_0x575681),_0x1bb7a2=[..._0x258a5f,..._0x139bc5];return{'ok':_0x1bb7a2[_0x43a67b(0x1ce)]===0x0,'errors':_0x1bb7a2,'warnings':_0x1e3ad0['warnings']};}function aggregateValidationReports(_0x106f44){const _0x5f0c3e=a42_0x4d4d36,_0x2bcd53=_0x106f44[_0x5f0c3e(0x1d6)](_0x148a48=>_0x148a48[_0x5f0c3e(0x1d4)]===undefined?_0x148a48[_0x5f0c3e(0x1d7)][_0x5f0c3e(0x1e0)]:_0x148a48[_0x5f0c3e(0x1d7)][_0x5f0c3e(0x1e0)]['map'](_0x25e12f=>({..._0x25e12f,'path':prefixRegistryIssuePath(_0x148a48['registryIndex'],_0x25e12f[_0x5f0c3e(0x1bc)])}))),_0x10b432=_0x106f44[_0x5f0c3e(0x1d6)](_0x4450a1=>_0x4450a1['registryIndex']===undefined?_0x4450a1[_0x5f0c3e(0x1d7)][_0x5f0c3e(0x1c4)]:_0x4450a1[_0x5f0c3e(0x1d7)][_0x5f0c3e(0x1c4)][_0x5f0c3e(0x1cf)](_0x43e621=>({..._0x43e621,'path':prefixRegistryIssuePath(_0x4450a1[_0x5f0c3e(0x1d4)],_0x43e621[_0x5f0c3e(0x1bc)])})));return{'ok':_0x2bcd53[_0x5f0c3e(0x1ce)]===0x0,'errors':_0x2bcd53,'warnings':_0x10b432};}function prefixRegistryIssuePath(_0x3114be,_0x1e1b4f){const _0x1c283e=a42_0x4d4d36;if(_0x1e1b4f==='$')return'$.services['+_0x3114be+_0x1c283e(0x1ea);if(_0x1e1b4f[_0x1c283e(0x1f3)]('$.'))return _0x1c283e(0x1dc)+_0x3114be+'].manifest'+_0x1e1b4f[_0x1c283e(0x1f5)](0x1);if(_0x1e1b4f[_0x1c283e(0x1f3)]('$['))return _0x1c283e(0x1dc)+_0x3114be+_0x1c283e(0x1ea)+_0x1e1b4f[_0x1c283e(0x1f5)](0x1);return'$.services['+_0x3114be+_0x1c283e(0x1b8)+_0x1e1b4f;}function a42_0x2e63(){const _0xe202c1=['schemaVersion','now','commandCount','isArray','services','string','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','length','map','parse','886926zuvluk','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','service','registryIndex','33KlkbJG','flatMap','report','updatedAt','1144DDjsdY','Remove\x20or\x20migrate\x20','push','$.services[','cliPath','ENOENT','target','errors','splice','file','manifests','960848mnLpoP','9347832MmXnej','command','sha256','trim','commands','].manifest','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','Unsupported\x20service\x20registry\x20schemaVersion:\x20','toISOString','Cannot\x20write\x20service\x20registry:\x20','normalizedManifest','Service\x20manifest\x20file\x20not\x20found:\x20','empty','.tmp','startsWith','manifest','slice','Invalid\x20service\x20registry\x20JSON:\x20','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','findIndex','2093ZklrwF','join','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','registry','347592RVDzYa','version','localeCompare','CliError','43166vSURxw','kind','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','validation','message','digest','serviceCode','].manifest.','1680635FZhrCS','find','sourceHash','path','services\x20must\x20be\x20an\x20array','utf8','source','invalid','service.json','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','stringify','warnings','code','Unsupported\x20schemaVersion:\x20'];a42_0x2e63=function(){return _0xe202c1;};return a42_0x2e63();}function isServiceRegistryLike(_0x4eeeb0){const _0x4933ab=a42_0x4d4d36;return isObjectRecord(_0x4eeeb0)&&_0x4eeeb0[_0x4933ab(0x1c7)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x4933ab(0x1ca)](_0x4eeeb0[_0x4933ab(0x1cb)]);}function isObjectRecord(_0x4bf9af){const _0x2277ef=a42_0x4d4d36;return Boolean(_0x4bf9af)&&typeof _0x4bf9af==='object'&&!Array[_0x2277ef(0x1ca)](_0x4bf9af);}function emptyServiceRegistryInspection(_0x112ef2,_0x4d67ef,_0x514820){return{'registryPath':_0x112ef2,'exists':_0x514820,'status':_0x4d67ef,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x9aaa23){const _0x1c99ca=a42_0x4d4d36,_0x12bfdc=_0x9aaa23[_0x1c99ca(0x1ef)],_0x26064a=_0x12bfdc[_0x1c99ca(0x1e9)]['map'](_0x104d6b=>({'path':_0x104d6b[_0x1c99ca(0x1dd)],'description':_0x104d6b['description'],'risk':_0x104d6b['risk'],'targetKind':_0x104d6b[_0x1c99ca(0x1df)][_0x1c99ca(0x1b2)],'targetCommand':_0x104d6b[_0x1c99ca(0x1df)][_0x1c99ca(0x1e6)]}));return{'serviceCode':_0x9aaa23['serviceCode'],'name':_0x12bfdc['service']['name'],'description':_0x12bfdc[_0x1c99ca(0x1d3)]['description'],'version':_0x9aaa23['version'],'importedAt':_0x9aaa23['importedAt'],'source':_0x9aaa23[_0x1c99ca(0x1bf)],'commandCount':_0x26064a[_0x1c99ca(0x1ce)],'commands':_0x26064a};}function sha256(_0x366e32){const _0x15e5a5=a42_0x4d4d36;return createHash(_0x15e5a5(0x1e7))['update'](_0x366e32)[_0x15e5a5(0x1b6)]('hex');}
1
+ const a42_0x299eb5=a42_0x59f0;(function(_0x1367a2,_0x79f06){const _0x44a8ce=a42_0x59f0,_0xac910a=_0x1367a2();while(!![]){try{const _0x5c0fbd=parseInt(_0x44a8ce(0x18d))/0x1*(-parseInt(_0x44a8ce(0x190))/0x2)+parseInt(_0x44a8ce(0x193))/0x3*(parseInt(_0x44a8ce(0x182))/0x4)+-parseInt(_0x44a8ce(0x167))/0x5*(-parseInt(_0x44a8ce(0x176))/0x6)+-parseInt(_0x44a8ce(0x194))/0x7*(parseInt(_0x44a8ce(0x1a4))/0x8)+parseInt(_0x44a8ce(0x188))/0x9+parseInt(_0x44a8ce(0x1a2))/0xa+parseInt(_0x44a8ce(0x17e))/0xb*(parseInt(_0x44a8ce(0x16a))/0xc);if(_0x5c0fbd===_0x79f06)break;else _0xac910a['push'](_0xac910a['shift']());}catch(_0x14a5ec){_0xac910a['push'](_0xac910a['shift']());}}}(a42_0x4446,0xbe93f));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';function a42_0x4446(){const _0x287584=['flatMap','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','startsWith','warnings','registryIndex','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','registry','message','reduce','270wxPppq','importedAt','command','].manifest','now','Unsupported\x20schemaVersion:\x20','Cannot\x20write\x20service\x20registry:\x20','version','19162mULhYQ','update','stringify','manifests','76HbHqzZ','Service\x20manifest\x20validation\x20failed:\x0a','errors','name','normalizedManifest','object','3073437JnkmiN','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','splice','schemaVersion','commandCount','159894lZQHeG','Invalid\x20service\x20manifest\x20JSON:\x20','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','6eBRiNW','.tmp','report','64578mgfoYD','2604AaIBYW','invalid','hex','parse','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','sourceHash','localeCompare','commands','manifest','bff\x20target\x20requires\x20functionName.','digest','serviceCode','target','findIndex','6402100zTtVGu','code','31216ZPXTVx','Local\x20service\x20not\x20found:\x20','CliError','validation','trim','utf8','length','cliPath','updatedAt','isArray','path','$.services[','services','Unsupported\x20service\x20registry\x20schemaVersion:\x20','sort','map','service.json','push','Invalid\x20service\x20registry\x20JSON:\x20','file','string','service','].manifest.','services\x20must\x20be\x20an\x20array','86210gDKzOl','source','risk','3756KVrNyy','toISOString'];a42_0x4446=function(){return _0x287584;};return a42_0x4446();}import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a42_0x299eb5(0x15f);export function getServiceRegistryPath(_0x43cab9={}){return resolve(_0x43cab9['homeDir']??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x370650={}){const _0x1f3f16=a42_0x299eb5,_0x18ecbb=getServiceRegistryPath(_0x370650);if(!existsSync(_0x18ecbb))return emptyServiceRegistry();try{const _0x1e1c2e=readFileSync(_0x18ecbb,_0x1f3f16(0x154));if(!_0x1e1c2e['trim']())return emptyServiceRegistry();const _0x25b7b7=JSON[_0x1f3f16(0x197)](_0x1e1c2e);if(_0x25b7b7[_0x1f3f16(0x18b)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x1f3f16(0x15c)+String(_0x25b7b7[_0x1f3f16(0x18b)]),'Remove\x20or\x20migrate\x20'+_0x18ecbb+'.');if(!Array[_0x1f3f16(0x158)](_0x25b7b7[_0x1f3f16(0x15b)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x25b7b7['updatedAt'],'services':_0x25b7b7[_0x1f3f16(0x15b)]};}catch(_0x19e6f6){if(_0x19e6f6 instanceof Error&&_0x19e6f6[_0x1f3f16(0x185)]===_0x1f3f16(0x1a6))throw _0x19e6f6;throw CliErrors['validation'](_0x1f3f16(0x161)+_0x18ecbb,_0x1f3f16(0x16d));}}export function writeServiceRegistry(_0x3bb56f,_0x5bf0a9={}){const _0x1add90=a42_0x299eb5,_0xb8ff3=getServiceRegistryPath(_0x5bf0a9),_0x1c19d3=dirname(_0xb8ff3);!existsSync(_0x1c19d3)&&mkdirSync(_0x1c19d3,{'recursive':!![]});const _0x185ec8=_0xb8ff3+_0x1add90(0x191);try{writeFileSync(_0x185ec8,JSON['stringify'](_0x3bb56f,null,0x2)+'\x0a',{'encoding':_0x1add90(0x154),'mode':0x180}),renameSync(_0x185ec8,_0xb8ff3);}catch(_0x4122b5){try{unlinkSync(_0x185ec8);}catch{}if(_0x4122b5?.[_0x1add90(0x1a3)]==='ENOENT')throw CliErrors[_0x1add90(0x1a7)](_0x1add90(0x17c)+_0xb8ff3);throw _0x4122b5;}return _0xb8ff3;}export function loadServiceManifestFromFile(_0x56b699){const _0x3ada78=a42_0x299eb5,_0x3681e3=resolve(_0x56b699);if(!existsSync(_0x3681e3))throw CliErrors['validation']('Service\x20manifest\x20file\x20not\x20found:\x20'+_0x56b699);let _0x311c9d;const _0x48568b=readFileSync(_0x3681e3,_0x3ada78(0x154));try{_0x311c9d=JSON['parse'](_0x48568b);}catch{throw CliErrors[_0x3ada78(0x1a7)](_0x3ada78(0x18e)+_0x56b699,_0x3ada78(0x189));}const _0x3f65e9=sha256(_0x48568b),_0x34c87c=extractLoadedServiceManifests(_0x311c9d,_0x3f65e9),_0x5c59d6=aggregateValidationReports(_0x34c87c),_0x57192b=_0x34c87c[0x0];return{'filePath':_0x3681e3,'hash':_0x3f65e9,'kind':isServiceRegistryLike(_0x311c9d)?_0x3ada78(0x173):_0x3ada78(0x19c),'manifest':_0x57192b?.['manifest']??_0x311c9d,'report':_0x5c59d6,'normalizedManifest':_0x34c87c[_0x3ada78(0x155)]===0x1?_0x57192b?.['normalizedManifest']:undefined,'manifests':_0x34c87c};}export function importServiceManifest(_0x56443a,_0x2fba8f={}){const _0x5b57f3=a42_0x299eb5,_0x4b4a31=loadServiceManifestFromFile(_0x56443a);if(!_0x4b4a31[_0x5b57f3(0x192)]['ok'])throw CliErrors[_0x5b57f3(0x1a7)](formatValidationFailure(_0x4b4a31['report']),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x4b4a31[_0x5b57f3(0x181)][_0x5b57f3(0x155)]===0x0)throw CliErrors['validation'](_0x5b57f3(0x16e),_0x5b57f3(0x18f));const _0x2f82b1=readServiceRegistry(_0x2fba8f),_0xf01ecf=(_0x2fba8f[_0x5b57f3(0x17a)]??(()=>new Date()))()[_0x5b57f3(0x16b)](),_0x1c7a14=[];let _0x529027=0x0,_0x39b26e=0x0;for(const _0x462e8e of _0x4b4a31['manifests']){if(!_0x462e8e[_0x5b57f3(0x186)])continue;const _0x4fdb30=_0x462e8e['normalizedManifest'][_0x5b57f3(0x164)][_0x5b57f3(0x1a3)],_0x506e7a={'serviceCode':_0x4fdb30,'version':_0x462e8e[_0x5b57f3(0x186)][_0x5b57f3(0x17d)],'importedAt':_0xf01ecf,'source':{'type':_0x5b57f3(0x162),'path':_0x4b4a31['filePath'],'hash':_0x462e8e[_0x5b57f3(0x199)]},'manifest':_0x462e8e['manifest'],'normalizedManifest':_0x462e8e[_0x5b57f3(0x186)]},_0x31e787=_0x2f82b1['services'][_0x5b57f3(0x1a1)](_0x3010cd=>_0x3010cd['serviceCode']===_0x4fdb30);_0x31e787>=0x0?(_0x2f82b1[_0x5b57f3(0x15b)][_0x31e787]=_0x506e7a,_0x39b26e++):(_0x2f82b1[_0x5b57f3(0x15b)][_0x5b57f3(0x160)](_0x506e7a),_0x529027++),_0x1c7a14['push'](_0x506e7a);}_0x2f82b1[_0x5b57f3(0x15b)][_0x5b57f3(0x15d)]((_0x492959,_0x51b937)=>_0x492959[_0x5b57f3(0x19f)][_0x5b57f3(0x19a)](_0x51b937[_0x5b57f3(0x19f)])),_0x2f82b1['updatedAt']=_0xf01ecf;const _0x3a66d4=writeServiceRegistry(_0x2f82b1,_0x2fba8f);return{'registryPath':_0x3a66d4,'entry':_0x1c7a14[0x0],'replaced':_0x1c7a14[_0x5b57f3(0x155)]===0x1?_0x39b26e===0x1:_0x39b26e>0x0,'entries':_0x1c7a14,'imported':_0x529027,'updated':_0x39b26e,'serviceCount':_0x2f82b1[_0x5b57f3(0x15b)][_0x5b57f3(0x155)]};}export function exportServiceManifest(_0x3bac12,_0x35713a,_0x30e4a0={}){const _0x48fd28=a42_0x299eb5,_0x19baf5=getServiceRegistryPath(_0x30e4a0),_0x13d425=getLocalServiceEntry(_0x3bac12,_0x30e4a0);if(!_0x13d425)throw CliErrors['validation'](_0x48fd28(0x1a5)+_0x3bac12,_0x48fd28(0x198));const _0x46b267=resolve(_0x35713a),_0x19bedc=dirname(_0x46b267);return!existsSync(_0x19bedc)&&mkdirSync(_0x19bedc,{'recursive':!![]}),writeFileSync(_0x46b267,JSON[_0x48fd28(0x180)](_0x13d425[_0x48fd28(0x19c)],null,0x2)+'\x0a',{'encoding':_0x48fd28(0x154),'mode':0x180}),{'registryPath':_0x19baf5,'filePath':_0x46b267,'entry':_0x13d425};}export function removeServiceManifest(_0x247dfa,_0x2f6719={}){const _0x54524b=a42_0x299eb5,_0x197e91=readServiceRegistry(_0x2f6719),_0x4dc5be=_0x247dfa['trim'](),_0x2f5fc1=_0x197e91[_0x54524b(0x15b)][_0x54524b(0x1a1)](_0x550fa2=>_0x550fa2[_0x54524b(0x19f)]===_0x4dc5be);if(_0x2f5fc1<0x0)throw CliErrors[_0x54524b(0x1a7)](_0x54524b(0x1a5)+_0x4dc5be,_0x54524b(0x198));const [_0x579729]=_0x197e91['services'][_0x54524b(0x18a)](_0x2f5fc1,0x1),_0x30d101=(_0x2f6719[_0x54524b(0x17a)]??(()=>new Date()))()[_0x54524b(0x16b)]();_0x197e91['updatedAt']=_0x30d101;const _0x2382bd=writeServiceRegistry(_0x197e91,_0x2f6719);return{'registryPath':_0x2382bd,'entry':_0x579729,'serviceCount':_0x197e91[_0x54524b(0x15b)][_0x54524b(0x155)]};}export function listLocalServices(_0x53ca65={}){const _0x2eb668=a42_0x299eb5;return readServiceRegistry(_0x53ca65)[_0x2eb668(0x15b)];}export function getLocalServiceEntry(_0x9b5cec,_0x4867f9={}){const _0x3b3c27=a42_0x299eb5;return readServiceRegistry(_0x4867f9)[_0x3b3c27(0x15b)]['find'](_0x16ea79=>_0x16ea79[_0x3b3c27(0x19f)]===_0x9b5cec['trim']());}export function listLocalServiceTrees(_0x56b6b9={}){const _0xe72109=a42_0x299eb5;return readServiceRegistry(_0x56b6b9)[_0xe72109(0x15b)][_0xe72109(0x15e)](_0x2fede7=>_0x2fede7['normalizedManifest']);}export function inspectServiceRegistry(_0x2efc36={}){const _0x123e76=a42_0x299eb5,_0x253346=getServiceRegistryPath(_0x2efc36);if(!existsSync(_0x253346))return emptyServiceRegistryInspection(_0x253346,'missing',![]);try{const _0x161934=readFileSync(_0x253346,'utf8');if(!_0x161934[_0x123e76(0x1a8)]())return emptyServiceRegistryInspection(_0x253346,'empty',!![]);const _0x16c1a6=JSON[_0x123e76(0x197)](_0x161934);if(_0x16c1a6[_0x123e76(0x18b)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x253346,_0x123e76(0x195),!![]),'schemaVersion':_0x16c1a6[_0x123e76(0x18b)],'message':_0x123e76(0x17b)+String(_0x16c1a6[_0x123e76(0x18b)])};if(!Array[_0x123e76(0x158)](_0x16c1a6['services']))return{...emptyServiceRegistryInspection(_0x253346,_0x123e76(0x195),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x16c1a6[_0x123e76(0x157)],'message':_0x123e76(0x166)};const _0x5b5a8c=_0x16c1a6[_0x123e76(0x15b)][_0x123e76(0x15e)](summarizeLocalServiceEntry);return{'registryPath':_0x253346,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x16c1a6[_0x123e76(0x157)],'serviceCount':_0x5b5a8c[_0x123e76(0x155)],'commandCount':_0x5b5a8c[_0x123e76(0x175)]((_0x4ae019,_0x1cf8dc)=>_0x4ae019+_0x1cf8dc[_0x123e76(0x18c)],0x0),'services':_0x5b5a8c};}catch(_0x377ae2){return{...emptyServiceRegistryInspection(_0x253346,_0x123e76(0x195),!![]),'message':_0x377ae2 instanceof Error?_0x377ae2[_0x123e76(0x174)]:String(_0x377ae2)};}}export function formatValidationFailure(_0x4e4876){const _0x2f8e09=a42_0x299eb5,_0x3c6362=_0x4e4876['errors']['map'](_0x3522a9=>_0x3522a9[_0x2f8e09(0x159)]+':\x20'+_0x3522a9[_0x2f8e09(0x174)]);return _0x2f8e09(0x183)+_0x3c6362['join']('\x0a');}function extractLoadedServiceManifests(_0x41a1d0,_0x469b0e){if(!isServiceRegistryLike(_0x41a1d0)){const _0x368f2f=_0x41a1d0,{manifest:_0x5ab543,errors:_0x35e515}=adaptServiceTreeManifestForLegacyFramework(_0x368f2f),_0x10c051=validateServiceTreeManifest(_0x5ab543),_0x37b71c=mergeValidationErrors(_0x10c051,_0x35e515);return[{'manifest':_0x368f2f,'report':_0x37b71c,'normalizedManifest':_0x37b71c['ok']?normalizeServiceTreeManifest(_0x5ab543):undefined,'sourceHash':_0x469b0e}];}return _0x41a1d0['services']['map']((_0x12fb1f,_0x5c80c6)=>{const _0x4cdafa=a42_0x59f0,_0x560219=isObjectRecord(_0x12fb1f)?_0x12fb1f['manifest']:undefined,{manifest:_0xc1a605,errors:_0x1ef77f}=adaptServiceTreeManifestForLegacyFramework(_0x560219),_0x2bad22=validateServiceTreeManifest(_0xc1a605),_0x596e8d=mergeValidationErrors(_0x2bad22,_0x1ef77f),_0x39f4db=isObjectRecord(_0x12fb1f)&&typeof _0x12fb1f[_0x4cdafa(0x19f)]===_0x4cdafa(0x163)?_0x12fb1f[_0x4cdafa(0x19f)]:undefined;return{'manifest':_0x560219,'report':_0x596e8d,'normalizedManifest':_0x596e8d['ok']?normalizeServiceTreeManifest(_0xc1a605):undefined,'sourceHash':sha256(JSON['stringify'](_0x560219,null,0x2)+'\x0a'),'registryIndex':_0x5c80c6,'registryServiceCode':_0x39f4db};});}function a42_0x59f0(_0x1ee2b6,_0x587da9){_0x1ee2b6=_0x1ee2b6-0x154;const _0x444699=a42_0x4446();let _0x59f0b1=_0x444699[_0x1ee2b6];return _0x59f0b1;}function mergeValidationErrors(_0x1bdf13,_0x1f4736){const _0x13d1f1=a42_0x299eb5,_0x34ae55=_0x1bdf13[_0x13d1f1(0x184)][_0x13d1f1(0x15e)](_0x4ad5fc=>_0x4ad5fc[_0x13d1f1(0x174)]===_0x13d1f1(0x172)?{..._0x4ad5fc,'message':_0x13d1f1(0x19d)}:_0x4ad5fc),_0xfd382b=[..._0x1f4736,..._0x34ae55];return{'ok':_0xfd382b[_0x13d1f1(0x155)]===0x0,'errors':_0xfd382b,'warnings':_0x1bdf13['warnings']};}function aggregateValidationReports(_0x50cfe0){const _0x2fdd4a=a42_0x299eb5,_0xbffc86=_0x50cfe0['flatMap'](_0x547e0b=>_0x547e0b[_0x2fdd4a(0x171)]===undefined?_0x547e0b[_0x2fdd4a(0x192)][_0x2fdd4a(0x184)]:_0x547e0b[_0x2fdd4a(0x192)][_0x2fdd4a(0x184)]['map'](_0x435436=>({..._0x435436,'path':prefixRegistryIssuePath(_0x547e0b[_0x2fdd4a(0x171)],_0x435436['path'])}))),_0xcdebbe=_0x50cfe0[_0x2fdd4a(0x16c)](_0xc2c60f=>_0xc2c60f['registryIndex']===undefined?_0xc2c60f[_0x2fdd4a(0x192)][_0x2fdd4a(0x170)]:_0xc2c60f[_0x2fdd4a(0x192)]['warnings'][_0x2fdd4a(0x15e)](_0x1017c2=>({..._0x1017c2,'path':prefixRegistryIssuePath(_0xc2c60f[_0x2fdd4a(0x171)],_0x1017c2[_0x2fdd4a(0x159)])})));return{'ok':_0xbffc86[_0x2fdd4a(0x155)]===0x0,'errors':_0xbffc86,'warnings':_0xcdebbe};}function prefixRegistryIssuePath(_0x592e7b,_0x3f8928){const _0xe8b97c=a42_0x299eb5;if(_0x3f8928==='$')return'$.services['+_0x592e7b+'].manifest';if(_0x3f8928[_0xe8b97c(0x16f)]('$.'))return _0xe8b97c(0x15a)+_0x592e7b+'].manifest'+_0x3f8928['slice'](0x1);if(_0x3f8928['startsWith']('$['))return _0xe8b97c(0x15a)+_0x592e7b+_0xe8b97c(0x179)+_0x3f8928['slice'](0x1);return _0xe8b97c(0x15a)+_0x592e7b+_0xe8b97c(0x165)+_0x3f8928;}function isServiceRegistryLike(_0x39efa6){const _0x8740c1=a42_0x299eb5;return isObjectRecord(_0x39efa6)&&_0x39efa6[_0x8740c1(0x18b)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0x39efa6[_0x8740c1(0x15b)]);}function isObjectRecord(_0xd554b6){const _0xbb756b=a42_0x299eb5;return Boolean(_0xd554b6)&&typeof _0xd554b6===_0xbb756b(0x187)&&!Array[_0xbb756b(0x158)](_0xd554b6);}function emptyServiceRegistryInspection(_0x2102a2,_0x24aaed,_0x140d65){return{'registryPath':_0x2102a2,'exists':_0x140d65,'status':_0x24aaed,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0xb8492a){const _0x324475=a42_0x299eb5,_0x3f2293=_0xb8492a[_0x324475(0x186)],_0x4a1c5d=_0x3f2293[_0x324475(0x19b)]['map'](_0x297010=>({'path':_0x297010[_0x324475(0x156)],'description':_0x297010['description'],'risk':_0x297010[_0x324475(0x169)],'targetKind':_0x297010[_0x324475(0x1a0)]['kind'],'targetCommand':_0x297010[_0x324475(0x1a0)][_0x324475(0x178)]}));return{'serviceCode':_0xb8492a[_0x324475(0x19f)],'name':_0x3f2293['service'][_0x324475(0x185)],'description':_0x3f2293[_0x324475(0x164)]['description'],'version':_0xb8492a[_0x324475(0x17d)],'importedAt':_0xb8492a[_0x324475(0x177)],'source':_0xb8492a[_0x324475(0x168)],'commandCount':_0x4a1c5d[_0x324475(0x155)],'commands':_0x4a1c5d};}function sha256(_0x4cfee0){const _0x41011a=a42_0x299eb5;return createHash('sha256')[_0x41011a(0x17f)](_0x4cfee0)[_0x41011a(0x19e)](_0x41011a(0x196));}
@@ -1 +1 @@
1
- const a43_0x3d27a2=a43_0x19e4;function a43_0xf52f(){const _0x7ce505=['bool','files','isDirectory','name','path','content','554558MPkQcw','419784fgHlgX','force','validation','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','Skill\x20directory\x20already\x20exists:\x20','48CdnwDb','skillDir','WRITE','str','type','utf8','trim','Created\x20local\x20Skill\x20draft\x20','isSymbolicLink','105444HdxidB','rendered','202447AAUxfO','create','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','8807248VIPWUO','map','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','skillName','read','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','target','创建本地自包含的运行态\x20Skill\x20草稿','1162310yfJMgT','Refusing\x20to\x20overwrite\x20symlink:\x20','478484JtxBsY'];a43_0xf52f=function(){return _0x7ce505;};return a43_0xf52f();}(function(_0x17c9f6,_0x4b0bd9){const _0x204774=a43_0x19e4,_0x3bfeb5=_0x17c9f6();while(!![]){try{const _0x53134a=-parseInt(_0x204774(0xe8))/0x1+parseInt(_0x204774(0xe9))/0x2+parseInt(_0x204774(0xf7))/0x3+parseInt(_0x204774(0x106))/0x4+-parseInt(_0x204774(0x104))/0x5+parseInt(_0x204774(0xee))/0x6*(-parseInt(_0x204774(0xf9))/0x7)+parseInt(_0x204774(0xfc))/0x8;if(_0x53134a===_0x4b0bd9)break;else _0x3bfeb5['push'](_0x3bfeb5['shift']());}catch(_0x59834b){_0x3bfeb5['push'](_0x3bfeb5['shift']());}}}(a43_0xf52f,0x6d2cb));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';function a43_0x19e4(_0x239936,_0x3b2472){_0x239936=_0x239936-0xe5;const _0xf52fa4=a43_0xf52f();let _0x19e4b8=_0xf52fa4[_0x239936];return _0x19e4b8;}import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':'skill','command':a43_0x3d27a2(0xfa),'description':a43_0x3d27a2(0x103),'risk':a43_0x3d27a2(0x100),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x192a4e){const _0x5b63c6=a43_0x3d27a2,_0x32c544=buildSkillCreatePlan(_0x192a4e[_0x5b63c6(0xf1)]('name'),_0x192a4e[_0x5b63c6(0xf1)](_0x5b63c6(0xf2)),_0x192a4e['str'](_0x5b63c6(0x102)));return{'method':_0x5b63c6(0xf0),'url':_0x32c544[_0x5b63c6(0xef)],'body':{'skillName':_0x32c544[_0x5b63c6(0xf8)][_0x5b63c6(0xff)],'type':_0x32c544['rendered']['type'],'selfContained':!![],'files':_0x32c544[_0x5b63c6(0xf8)][_0x5b63c6(0x108)][_0x5b63c6(0xfd)](_0x496e31=>_0x496e31[_0x5b63c6(0xe6)])},'description':_0x5b63c6(0xfb)};},async 'execute'(_0xd05dad){const _0x1ca5d9=a43_0x3d27a2,_0x158229=buildSkillCreatePlan(_0xd05dad[_0x1ca5d9(0xf1)](_0x1ca5d9(0xe5)),_0xd05dad[_0x1ca5d9(0xf1)](_0x1ca5d9(0xf2)),_0xd05dad['str'](_0x1ca5d9(0x102)));return writeSkillDraft(_0x158229,_0xd05dad[_0x1ca5d9(0x107)](_0x1ca5d9(0xea))),{'ok':!![],'data':{'skillName':_0x158229[_0x1ca5d9(0xf8)][_0x1ca5d9(0xff)],'type':_0x158229['rendered'][_0x1ca5d9(0xf2)],'dir':_0x158229[_0x1ca5d9(0xef)],'files':_0x158229[_0x1ca5d9(0xf8)][_0x1ca5d9(0x108)]['map'](_0x14684e=>_0x14684e[_0x1ca5d9(0xe6)])},'message':_0x1ca5d9(0xf5)+_0x158229[_0x1ca5d9(0xf8)]['skillName']};}};function buildSkillCreatePlan(_0x409122,_0x972258,_0x597ed1){const _0x4e93d8=a43_0x3d27a2,_0x49b6c6=_0x972258[_0x4e93d8(0xf4)](),_0x3aaca6=renderSkillTemplate({'skillName':_0x409122,'type':_0x49b6c6});!_0x49b6c6&&writeCliSideChannelLine(_0x4e93d8(0xfe));const _0x8e7810=resolve(normalizeSkillTarget(_0x597ed1));return{'rendered':_0x3aaca6,'targetRoot':_0x8e7810,'skillDir':resolve(_0x8e7810,_0x3aaca6[_0x4e93d8(0xff)])};}function normalizeSkillTarget(_0x206cdd){const _0x37f9fc=a43_0x3d27a2;return(_0x206cdd||DEFAULT_SKILL_TARGET)[_0x37f9fc(0xf4)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x4f7af8,_0x3ed1a1){const _0xe45f97=a43_0x3d27a2;if(existsSync(_0x4f7af8['skillDir'])){const _0x24009d=lstatSync(_0x4f7af8[_0xe45f97(0xef)]);if(!_0x24009d[_0xe45f97(0x109)]()||_0x24009d[_0xe45f97(0xf6)]())throw CliErrors['validation'](_0xe45f97(0xec)+_0x4f7af8[_0xe45f97(0xef)]);if(!_0x3ed1a1)throw CliErrors[_0xe45f97(0xeb)](_0xe45f97(0xed)+_0x4f7af8[_0xe45f97(0xef)],_0xe45f97(0x101));}for(const _0x4b6434 of _0x4f7af8['rendered']['files']){const _0x384323=resolve(_0x4f7af8[_0xe45f97(0xef)],_0x4b6434['path']),_0x3ef6a0=dirname(_0x384323);mkdirSync(_0x3ef6a0,{'recursive':!![]});if(existsSync(_0x384323)&&lstatSync(_0x384323)[_0xe45f97(0xf6)]())throw CliErrors[_0xe45f97(0xeb)](_0xe45f97(0x105)+_0x384323);writeFileSync(_0x384323,_0x4b6434[_0xe45f97(0xe7)],_0xe45f97(0xf3));}}
1
+ const a43_0x4104cf=a43_0x14f0;function a43_0x14d4(){const _0x13a94e=['content','str','1296546rGPPYg','isSymbolicLink','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','validation','force','type','2549580gxLuUS','42JWCJjI','trim','2501212AmvMtv','bool','utf8','274977lneyJn','48gTTriB','map','Refusing\x20to\x20overwrite\x20symlink:\x20','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','read','skillDir','path','skill','Skill\x20directory\x20already\x20exists:\x20','rendered','创建本地自包含的运行态\x20Skill\x20草稿','116850PJJiYs','isDirectory','target','127480TxzxGK','1103024VUDjGj','27PoWvhV','skillName','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','WRITE'];a43_0x14d4=function(){return _0x13a94e;};return a43_0x14d4();}(function(_0x41c872,_0x4b6337){const _0x4e3c79=a43_0x14f0,_0x4e99e5=_0x41c872();while(!![]){try{const _0x4de732=-parseInt(_0x4e3c79(0x6c))/0x1+parseInt(_0x4e3c79(0x7d))/0x2+parseInt(_0x4e3c79(0x80))/0x3*(-parseInt(_0x4e3c79(0x81))/0x4)+parseInt(_0x4e3c79(0x69))/0x5+-parseInt(_0x4e3c79(0x74))/0x6*(-parseInt(_0x4e3c79(0x7b))/0x7)+parseInt(_0x4e3c79(0x6d))/0x8*(-parseInt(_0x4e3c79(0x6e))/0x9)+-parseInt(_0x4e3c79(0x7a))/0xa;if(_0x4de732===_0x4b6337)break;else _0x4e99e5['push'](_0x4e99e5['shift']());}catch(_0x1cdee4){_0x4e99e5['push'](_0x4e99e5['shift']());}}}(a43_0x14d4,0xa4aee));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';function a43_0x14f0(_0x2c0526,_0x16c93d){_0x2c0526=_0x2c0526-0x69;const _0x14d498=a43_0x14d4();let _0x14f025=_0x14d498[_0x2c0526];return _0x14f025;}import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a43_0x4104cf(0x88),'command':'create','description':a43_0x4104cf(0x8b),'risk':a43_0x4104cf(0x85),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x437ef1){const _0x4e803f=a43_0x4104cf,_0x379d69=buildSkillCreatePlan(_0x437ef1[_0x4e803f(0x73)]('name'),_0x437ef1['str'](_0x4e803f(0x79)),_0x437ef1[_0x4e803f(0x73)](_0x4e803f(0x6b)));return{'method':_0x4e803f(0x71),'url':_0x379d69[_0x4e803f(0x86)],'body':{'skillName':_0x379d69['rendered'][_0x4e803f(0x6f)],'type':_0x379d69[_0x4e803f(0x8a)]['type'],'selfContained':!![],'files':_0x379d69[_0x4e803f(0x8a)]['files'][_0x4e803f(0x82)](_0x5f2ca4=>_0x5f2ca4[_0x4e803f(0x87)])},'description':_0x4e803f(0x84)};},async 'execute'(_0x5f5d53){const _0x51c1c6=a43_0x4104cf,_0x194a10=buildSkillCreatePlan(_0x5f5d53[_0x51c1c6(0x73)]('name'),_0x5f5d53[_0x51c1c6(0x73)](_0x51c1c6(0x79)),_0x5f5d53['str'](_0x51c1c6(0x6b)));return writeSkillDraft(_0x194a10,_0x5f5d53[_0x51c1c6(0x7e)](_0x51c1c6(0x78))),{'ok':!![],'data':{'skillName':_0x194a10['rendered'][_0x51c1c6(0x6f)],'type':_0x194a10['rendered'][_0x51c1c6(0x79)],'dir':_0x194a10[_0x51c1c6(0x86)],'files':_0x194a10[_0x51c1c6(0x8a)]['files'][_0x51c1c6(0x82)](_0x5c5817=>_0x5c5817[_0x51c1c6(0x87)])},'message':'Created\x20local\x20Skill\x20draft\x20'+_0x194a10[_0x51c1c6(0x8a)][_0x51c1c6(0x6f)]};}};function buildSkillCreatePlan(_0x1aae66,_0x42c0b6,_0x1464b1){const _0x32ae5b=a43_0x4104cf,_0x3bc2c5=_0x42c0b6[_0x32ae5b(0x7c)](),_0x55e80a=renderSkillTemplate({'skillName':_0x1aae66,'type':_0x3bc2c5});!_0x3bc2c5&&writeCliSideChannelLine(_0x32ae5b(0x70));const _0xbec67f=resolve(normalizeSkillTarget(_0x1464b1));return{'rendered':_0x55e80a,'targetRoot':_0xbec67f,'skillDir':resolve(_0xbec67f,_0x55e80a[_0x32ae5b(0x6f)])};}function normalizeSkillTarget(_0x1995c5){const _0x100380=a43_0x4104cf;return(_0x1995c5||DEFAULT_SKILL_TARGET)[_0x100380(0x7c)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x2f11f8,_0x55115d){const _0x3fe6aa=a43_0x4104cf;if(existsSync(_0x2f11f8[_0x3fe6aa(0x86)])){const _0x32db00=lstatSync(_0x2f11f8['skillDir']);if(!_0x32db00[_0x3fe6aa(0x6a)]()||_0x32db00[_0x3fe6aa(0x75)]())throw CliErrors[_0x3fe6aa(0x77)]('Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20'+_0x2f11f8[_0x3fe6aa(0x86)]);if(!_0x55115d)throw CliErrors[_0x3fe6aa(0x77)](_0x3fe6aa(0x89)+_0x2f11f8[_0x3fe6aa(0x86)],_0x3fe6aa(0x76));}for(const _0x1ce79e of _0x2f11f8[_0x3fe6aa(0x8a)]['files']){const _0x46cdc9=resolve(_0x2f11f8[_0x3fe6aa(0x86)],_0x1ce79e[_0x3fe6aa(0x87)]),_0x3c3091=dirname(_0x46cdc9);mkdirSync(_0x3c3091,{'recursive':!![]});if(existsSync(_0x46cdc9)&&lstatSync(_0x46cdc9)['isSymbolicLink']())throw CliErrors['validation'](_0x3fe6aa(0x83)+_0x46cdc9);writeFileSync(_0x46cdc9,_0x1ce79e[_0x3fe6aa(0x72)],_0x3fe6aa(0x7f));}}
@@ -1 +1 @@
1
- function a44_0x3700(_0x37cae9,_0x2f8830){_0x37cae9=_0x37cae9-0xa1;const _0x1bec6b=a44_0x1bec();let _0x37006e=_0x1bec6b[_0x37cae9];return _0x37006e;}const a44_0xe83be5=a44_0x3700;(function(_0x4f7230,_0x2e9b2d){const _0x48172d=a44_0x3700,_0x4c8998=_0x4f7230();while(!![]){try{const _0x38a4bd=parseInt(_0x48172d(0xc7))/0x1*(parseInt(_0x48172d(0xa1))/0x2)+parseInt(_0x48172d(0xc3))/0x3*(-parseInt(_0x48172d(0xc2))/0x4)+-parseInt(_0x48172d(0xcb))/0x5+parseInt(_0x48172d(0xa9))/0x6+-parseInt(_0x48172d(0xca))/0x7+-parseInt(_0x48172d(0xba))/0x8+-parseInt(_0x48172d(0xa7))/0x9*(-parseInt(_0x48172d(0xb3))/0xa);if(_0x38a4bd===_0x2e9b2d)break;else _0x4c8998['push'](_0x4c8998['shift']());}catch(_0x2fc358){_0x4c8998['push'](_0x4c8998['shift']());}}}(a44_0x1bec,0x7114d));function a44_0x1bec(){const _0x5866db=['42xVtJKc','write','created','str','127npMKjZ','scope','read','5797617BDVNng','3419440lFyORq','found','expected-diagram-revision','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','8726vdQXwk','skill-code','appCode','validation','trim','\x20Skill\x20diagram\x20for\x20','5742846okHrmO','action','4742118xiJMlA','personal','Updated','将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。',';\x20next\x20write\x20expects\x20revision\x20','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','version','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','num','source-fingerprint','20BUOQkA','\x20is\x20unchanged.','isInteger','expectedDiagramRevision','diagram-file','Created','company','2574528FPHwtH','skillCode','skill','diagram-validate','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','Found\x20Skill\x20diagram\x20for\x20','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','diagram-push','92436mzrnFB'];a44_0x1bec=function(){return _0x5866db;};return a44_0x1bec();}import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x21b541){const _0x3a325e=a44_0x3700,_0x538b52=_0x21b541['str'](_0x3a325e(0xa2))[_0x3a325e(0xa5)](),_0x109d69=_0x21b541['str'](_0x3a325e(0xaf))[_0x3a325e(0xa5)](),_0x213a55=_0x21b541[_0x3a325e(0xc6)](_0x3a325e(0xc8));if(!_0x538b52||!_0x109d69||_0x213a55!==_0x3a325e(0xaa)&&_0x213a55!==_0x3a325e(0xb9))throw CliErrors['validation'](_0x3a325e(0xbe));return{'skillCode':_0x538b52,'version':_0x109d69,'scope':_0x213a55};}async function readDiagramWriteInput(_0x44a060){const _0x4c35e4=a44_0x3700,_0x455295=_0x44a060[_0x4c35e4(0xb1)](_0x4c35e4(0xcd)),_0x39b3ce=_0x44a060['str'](_0x4c35e4(0xb2))['trim']();if(!Number[_0x4c35e4(0xb5)](_0x455295)||_0x455295<0x0)throw CliErrors['validation'](_0x4c35e4(0xae));if(!/^sha256:[0-9a-f]{64}$/['test'](_0x39b3ce))throw CliErrors[_0x4c35e4(0xa4)](_0x4c35e4(0xc0));return{'expectedDiagramRevision':_0x455295,'sourceFingerprint':_0x39b3ce,'diagram':await readRequiredSkillDiagram(_0x44a060[_0x4c35e4(0xc6)](_0x4c35e4(0xb7)))};}export const diagramValidateCommand={'service':'skill','command':a44_0xe83be5(0xbd),'description':'Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','risk':'read','flags':WRITE_FLAGS,async 'execute'(_0x536fcd){const _0x16632e=a44_0xe83be5,_0x359ce4=readDiagramTarget(_0x536fcd),_0x21228c=await validateRuntimeSkillVersionDiagram(_0x536fcd[_0x16632e(0xa3)],_0x359ce4[_0x16632e(0xbb)],_0x359ce4['version'],_0x359ce4['scope'],await readDiagramWriteInput(_0x536fcd));return{'ok':!![],'data':_0x21228c,'message':'Skill\x20diagram\x20validation\x20passed\x20for\x20'+_0x359ce4[_0x16632e(0xbb)]+'@'+_0x359ce4['version']+'.'};}};export const diagramPushCommand={'service':a44_0xe83be5(0xbc),'command':a44_0xe83be5(0xc1),'description':'为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','risk':a44_0xe83be5(0xc4),'confirmationDescription':a44_0xe83be5(0xac),'flags':WRITE_FLAGS,async 'execute'(_0x5144bd){const _0x204181=a44_0xe83be5,_0x411cec=readDiagramTarget(_0x5144bd),_0x7ade8d=await putRuntimeSkillVersionDiagram(_0x5144bd[_0x204181(0xa3)],_0x411cec[_0x204181(0xbb)],_0x411cec[_0x204181(0xaf)],_0x411cec[_0x204181(0xc8)],await readDiagramWriteInput(_0x5144bd));return{'ok':!![],'data':_0x7ade8d,'message':_0x7ade8d[_0x204181(0xa8)]==='unchanged'?'Skill\x20diagram\x20for\x20'+_0x411cec['skillCode']+'@'+_0x411cec[_0x204181(0xaf)]+_0x204181(0xb4):(_0x7ade8d[_0x204181(0xa8)]===_0x204181(0xc5)?_0x204181(0xb8):_0x204181(0xab))+_0x204181(0xa6)+_0x411cec[_0x204181(0xbb)]+'@'+_0x411cec[_0x204181(0xaf)]+'.'};}};export const diagramShowCommand={'service':a44_0xe83be5(0xbc),'command':'diagram-show','description':a44_0xe83be5(0xb0),'risk':a44_0xe83be5(0xc9),'flags':TARGET_FLAGS,async 'execute'(_0x1d57f8){const _0x1cf7e3=a44_0xe83be5,_0x175fec=readDiagramTarget(_0x1d57f8),_0x1efb86=await getRuntimeSkillVersionDiagram(_0x1d57f8[_0x1cf7e3(0xa3)],_0x175fec[_0x1cf7e3(0xbb)],_0x175fec[_0x1cf7e3(0xaf)],_0x175fec[_0x1cf7e3(0xc8)]);return{'ok':!![],'data':_0x1efb86,'message':_0x1efb86[_0x1cf7e3(0xcc)]?_0x1cf7e3(0xbf)+_0x175fec[_0x1cf7e3(0xbb)]+'@'+_0x175fec[_0x1cf7e3(0xaf)]+_0x1cf7e3(0xad)+_0x1efb86[_0x1cf7e3(0xb6)]+'.':_0x1cf7e3(0xce)+_0x175fec['skillCode']+'@'+_0x175fec[_0x1cf7e3(0xaf)]+';\x20first\x20write\x20expects\x20revision\x20'+_0x1efb86[_0x1cf7e3(0xb6)]+'.'};}};
1
+ const a44_0x5e6a5d=a44_0x26f3;(function(_0x3e0b15,_0xf2a2ad){const _0x559c66=a44_0x26f3,_0x22d1d2=_0x3e0b15();while(!![]){try{const _0xc69ea6=parseInt(_0x559c66(0xe0))/0x1+parseInt(_0x559c66(0xed))/0x2*(-parseInt(_0x559c66(0xdd))/0x3)+-parseInt(_0x559c66(0xde))/0x4*(parseInt(_0x559c66(0xf8))/0x5)+-parseInt(_0x559c66(0xec))/0x6+-parseInt(_0x559c66(0xe2))/0x7*(parseInt(_0x559c66(0xdc))/0x8)+-parseInt(_0x559c66(0xe9))/0x9*(parseInt(_0x559c66(0xeb))/0xa)+-parseInt(_0x559c66(0xe3))/0xb*(-parseInt(_0x559c66(0xf7))/0xc);if(_0xc69ea6===_0xf2a2ad)break;else _0x22d1d2['push'](_0x22d1d2['shift']());}catch(_0x53504e){_0x22d1d2['push'](_0x22d1d2['shift']());}}}(a44_0x4c97,0x86fed));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';function a44_0x26f3(_0x4750d7,_0x20e341){_0x4750d7=_0x4750d7-0xd4;const _0x4c97f4=a44_0x4c97();let _0x26f35e=_0x4c97f4[_0x4750d7];return _0x26f35e;}import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';function a44_0x4c97(){const _0x5936b1=['52145ynCKkT','\x20is\x20unchanged.','test','source-fingerprint','version','isInteger','found','scope','Found\x20Skill\x20diagram\x20for\x20','Updated','trim','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','str','action','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','write','expectedDiagramRevision','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','unchanged','136icQWzP','3xNGMwR','300VfzQen','validation','783328GwPvyv','expected-diagram-revision','25340gwqlUG','19621503XQZzFy','skill','num','Skill\x20diagram\x20validation\x20passed\x20for\x20',';\x20first\x20write\x20expects\x20revision\x20','appCode','820044vWeXqj','diagram-validate','90DSFACS','6196410UvQFqs','2202878zUbvmb','personal','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','created','read',';\x20next\x20write\x20expects\x20revision\x20','diagram-show','skillCode','Skill\x20diagram\x20for\x20','diagram-file','24lEIOwc'];a44_0x4c97=function(){return _0x5936b1;};return a44_0x4c97();}import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x957736){const _0x394956=a44_0x26f3,_0x485ea1=_0x957736[_0x394956(0xd5)]('skill-code')[_0x394956(0x102)](),_0x9f7bf9=_0x957736['str'](_0x394956(0xfc))[_0x394956(0x102)](),_0x5888ef=_0x957736[_0x394956(0xd5)]('scope');if(!_0x485ea1||!_0x9f7bf9||_0x5888ef!==_0x394956(0xee)&&_0x5888ef!=='company')throw CliErrors[_0x394956(0xdf)](_0x394956(0xda));return{'skillCode':_0x485ea1,'version':_0x9f7bf9,'scope':_0x5888ef};}async function readDiagramWriteInput(_0x56c49a){const _0x2ee744=a44_0x26f3,_0x406eda=_0x56c49a[_0x2ee744(0xe5)](_0x2ee744(0xe1)),_0x37080b=_0x56c49a[_0x2ee744(0xd5)](_0x2ee744(0xfb))['trim']();if(!Number[_0x2ee744(0xfd)](_0x406eda)||_0x406eda<0x0)throw CliErrors[_0x2ee744(0xdf)](_0x2ee744(0xd7));if(!/^sha256:[0-9a-f]{64}$/[_0x2ee744(0xfa)](_0x37080b))throw CliErrors[_0x2ee744(0xdf)]('--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.');return{'expectedDiagramRevision':_0x406eda,'sourceFingerprint':_0x37080b,'diagram':await readRequiredSkillDiagram(_0x56c49a['str'](_0x2ee744(0xf6)))};}export const diagramValidateCommand={'service':'skill','command':a44_0x5e6a5d(0xea),'description':a44_0x5e6a5d(0xef),'risk':'read','flags':WRITE_FLAGS,async 'execute'(_0x118101){const _0x34c856=a44_0x5e6a5d,_0x9be483=readDiagramTarget(_0x118101),_0xde0657=await validateRuntimeSkillVersionDiagram(_0x118101[_0x34c856(0xe8)],_0x9be483[_0x34c856(0xf4)],_0x9be483['version'],_0x9be483[_0x34c856(0xff)],await readDiagramWriteInput(_0x118101));return{'ok':!![],'data':_0xde0657,'message':_0x34c856(0xe6)+_0x9be483[_0x34c856(0xf4)]+'@'+_0x9be483[_0x34c856(0xfc)]+'.'};}};export const diagramPushCommand={'service':a44_0x5e6a5d(0xe4),'command':'diagram-push','description':'为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','risk':a44_0x5e6a5d(0xd8),'confirmationDescription':'将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','flags':WRITE_FLAGS,async 'execute'(_0x2bb340){const _0x4dee29=a44_0x5e6a5d,_0x45da7e=readDiagramTarget(_0x2bb340),_0xba686d=await putRuntimeSkillVersionDiagram(_0x2bb340[_0x4dee29(0xe8)],_0x45da7e['skillCode'],_0x45da7e[_0x4dee29(0xfc)],_0x45da7e['scope'],await readDiagramWriteInput(_0x2bb340));return{'ok':!![],'data':_0xba686d,'message':_0xba686d[_0x4dee29(0xd6)]===_0x4dee29(0xdb)?_0x4dee29(0xf5)+_0x45da7e[_0x4dee29(0xf4)]+'@'+_0x45da7e[_0x4dee29(0xfc)]+_0x4dee29(0xf9):(_0xba686d[_0x4dee29(0xd6)]===_0x4dee29(0xf0)?'Created':_0x4dee29(0x101))+'\x20Skill\x20diagram\x20for\x20'+_0x45da7e['skillCode']+'@'+_0x45da7e[_0x4dee29(0xfc)]+'.'};}};export const diagramShowCommand={'service':'skill','command':a44_0x5e6a5d(0xf3),'description':'Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','risk':a44_0x5e6a5d(0xf1),'flags':TARGET_FLAGS,async 'execute'(_0x53709d){const _0x1b8747=a44_0x5e6a5d,_0x392562=readDiagramTarget(_0x53709d),_0x1c5b1c=await getRuntimeSkillVersionDiagram(_0x53709d[_0x1b8747(0xe8)],_0x392562['skillCode'],_0x392562[_0x1b8747(0xfc)],_0x392562[_0x1b8747(0xff)]);return{'ok':!![],'data':_0x1c5b1c,'message':_0x1c5b1c[_0x1b8747(0xfe)]?_0x1b8747(0x100)+_0x392562[_0x1b8747(0xf4)]+'@'+_0x392562[_0x1b8747(0xfc)]+_0x1b8747(0xf2)+_0x1c5b1c[_0x1b8747(0xd9)]+'.':_0x1b8747(0xd4)+_0x392562[_0x1b8747(0xf4)]+'@'+_0x392562[_0x1b8747(0xfc)]+_0x1b8747(0xe7)+_0x1c5b1c[_0x1b8747(0xd9)]+'.'};}};
@@ -1 +1 @@
1
- const a45_0x2314e4=a45_0x5478;(function(_0xfd4c8f,_0x26e82d){const _0x3740b8=a45_0x5478,_0x120fe=_0xfd4c8f();while(!![]){try{const _0x21847a=-parseInt(_0x3740b8(0x137))/0x1*(parseInt(_0x3740b8(0x15f))/0x2)+-parseInt(_0x3740b8(0x15b))/0x3*(parseInt(_0x3740b8(0x145))/0x4)+-parseInt(_0x3740b8(0x15a))/0x5+parseInt(_0x3740b8(0x158))/0x6+-parseInt(_0x3740b8(0x147))/0x7+parseInt(_0x3740b8(0x154))/0x8*(-parseInt(_0x3740b8(0x15e))/0x9)+parseInt(_0x3740b8(0x139))/0xa;if(_0x21847a===_0x26e82d)break;else _0x120fe['push'](_0x120fe['shift']());}catch(_0x30fa79){_0x120fe['push'](_0x120fe['shift']());}}}(a45_0x2c5d,0x5136c));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';function a45_0x5478(_0x522ed0,_0x56d24f){_0x522ed0=_0x522ed0-0x136;const _0x2c5d96=a45_0x2c5d();let _0x547869=_0x2c5d96[_0x522ed0];return _0x547869;}export const installCommand={'service':a45_0x2314e4(0x138),'command':a45_0x2314e4(0x13d),'description':a45_0x2314e4(0x156),'risk':a45_0x2314e4(0x14d),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0xf9a62b){return syncRuntimeSkills(_0xf9a62b);}};async function syncRuntimeSkills(_0x599d27){const _0x3dc6c6=a45_0x2314e4,{downloadRuntimeSkillPackage:_0x4e5a49,listRuntimeSkills:_0x3a60d9}=await import('../../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x5005e5,materializeRuntimeSkill:_0x28d70b,pruneStaleRuntimeSkillCache:_0x4ee27d,pruneStaleRuntimeSkillLinks:_0x4c19de,resolveRuntimeSkillInstallTarget:_0x3aaf56}=await import('../../../skills/runtime-skill-sync.js'),_0x605752=_0x599d27[_0x3dc6c6(0x14e)](_0x3dc6c6(0x157)),_0x3d4f18=normalizeSyncScopes(_0x599d27[_0x3dc6c6(0x14e)](_0x3dc6c6(0x144))),_0x35317a=_0x599d27[_0x3dc6c6(0x155)]??_0x3dc6c6(0x14b),_0x39450a=_0x599d27[_0x3dc6c6(0x14c)],_0x538e04=_0x599d27[_0x3dc6c6(0x150)]('force');if(!_0x39450a)throw CliErrors[_0x3dc6c6(0x143)](_0x3dc6c6(0x13e));const _0x135579=_0x3aaf56(_0x599d27[_0x3dc6c6(0x146)],_0x599d27[_0x3dc6c6(0x150)](_0x3dc6c6(0x148))?_0x3dc6c6(0x148):_0x3dc6c6(0x15c)),_0x111118=_0x3aaf56(_0x599d27['appCode'],_0x135579[_0x3dc6c6(0x144)]===_0x3dc6c6(0x148)?_0x3dc6c6(0x15c):_0x3dc6c6(0x148)),_0x2a34ef=await Promise['all'](_0x3d4f18[_0x3dc6c6(0x13b)](_0x300ee7=>_0x3a60d9({'appCode':_0x599d27[_0x3dc6c6(0x146)],'scope':_0x300ee7,'code':_0x605752[_0x3dc6c6(0x159)]()||undefined}))),_0xf0ec97=_0x3d4f18[_0x3dc6c6(0x142)]('personal')?_0x2a34ef[_0x3dc6c6(0x140)]((_0x2b97e6,_0x4c3347)=>_0x3d4f18[_0x4c3347]===_0x3dc6c6(0x151)?_0x2b97e6[_0x3dc6c6(0x151)]:[]):[],_0x3657ac=_0x3d4f18[_0x3dc6c6(0x142)](_0x3dc6c6(0x13a))?_0x2a34ef[_0x3dc6c6(0x140)]((_0x6ed4d8,_0x5a300f)=>_0x3d4f18[_0x5a300f]===_0x3dc6c6(0x13a)?_0x6ed4d8[_0x3dc6c6(0x13a)]:[]):[],_0xc6f4cd=new Set([..._0xf0ec97[_0x3dc6c6(0x13b)](_0x52f50e=>_0x52f50e[_0x3dc6c6(0x13f)]?.['trim']())[_0x3dc6c6(0x163)](_0x444b65=>Boolean(_0x444b65)),..._0x3657ac[_0x3dc6c6(0x13b)](_0x183653=>_0x183653['skillCode']?.[_0x3dc6c6(0x159)]())[_0x3dc6c6(0x163)](_0x565597=>Boolean(_0x565597))]),_0x5be3fc=_0x605752[_0x3dc6c6(0x159)]()?[_0x605752[_0x3dc6c6(0x159)]()]:undefined,_0x5b81b6=_0x3d4f18['length']===0x2&&_0x3d4f18['includes'](_0x3dc6c6(0x151))&&_0x3d4f18[_0x3dc6c6(0x142)](_0x3dc6c6(0x13a)),_0xb569=_0x5b81b6?_0x4c19de(_0x135579,_0xc6f4cd,_0x5be3fc):[],_0x301a07=_0x4ee27d({'env':_0x35317a,'accessKey':_0x39450a,'appCode':_0x599d27[_0x3dc6c6(0x146)],'activeSkillCodes':_0xc6f4cd,'pruneSkillCodes':_0x5be3fc,'scopes':_0x3d4f18,'protectedLinkRoots':_0x111118[_0x3dc6c6(0x13c)]}),_0x32e501=[];for(const _0x54523c of _0xf0ec97){_0x32e501[_0x3dc6c6(0x136)](_0x28d70b(_0x54523c,_0x3dc6c6(0x151),{'env':_0x35317a,'accessKey':_0x39450a,'appCode':_0x599d27[_0x3dc6c6(0x146)],'force':_0x538e04,'packageBytes':await downloadSkillPackage(_0x54523c,_0x3dc6c6(0x151),_0x599d27[_0x3dc6c6(0x146)],_0x4e5a49)}));}for(const _0x5d5d82 of _0x3657ac){_0x32e501['push'](_0x28d70b(_0x5d5d82,_0x3dc6c6(0x13a),{'env':_0x35317a,'accessKey':_0x39450a,'appCode':_0x599d27['appCode'],'force':_0x538e04,'packageBytes':await downloadSkillPackage(_0x5d5d82,'company',_0x599d27['appCode'],_0x4e5a49)}));}const _0x2c36e5=_0x5005e5(_0x32e501,_0x135579),_0x2eeb4c=countLinkActions(_0x2c36e5);return{'ok':!![],'data':{'appCode':_0x599d27['appCode'],..._0x135579[_0x3dc6c6(0x144)]===_0x3dc6c6(0x148)?{'installTarget':{'scope':_0x135579[_0x3dc6c6(0x144)],'skillRoots':[..._0x135579[_0x3dc6c6(0x13c)]]}}:{},'personal':_0xf0ec97[_0x3dc6c6(0x153)],'company':_0x3657ac[_0x3dc6c6(0x153)],'materialized':_0x32e501['length'],'links':{'total':_0x2c36e5[_0x3dc6c6(0x153)],'created':_0x2eeb4c[_0x3dc6c6(0x160)]??0x0,'updated':_0x2eeb4c[_0x3dc6c6(0x152)]??0x0,'unchanged':_0x2eeb4c[_0x3dc6c6(0x14f)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0xb569['filter'](_0x40229e=>_0x40229e[_0x3dc6c6(0x15d)]===_0x3dc6c6(0x149))[_0x3dc6c6(0x153)],'cacheDirs':_0x301a07[_0x3dc6c6(0x163)](_0x3ce476=>_0x3ce476[_0x3dc6c6(0x15d)]===_0x3dc6c6(0x149))[_0x3dc6c6(0x153)],'skipped':[..._0xb569,..._0x301a07][_0x3dc6c6(0x163)](_0x482c78=>_0x482c78[_0x3dc6c6(0x15d)]==='skipped')[_0x3dc6c6(0x153)]},'skills':{'personal':_0xf0ec97[_0x3dc6c6(0x13b)](summarizeRuntimeSkill),'company':_0x3657ac[_0x3dc6c6(0x13b)](summarizeRuntimeSkill)}},'message':_0x3dc6c6(0x14a)+_0xf0ec97[_0x3dc6c6(0x153)]+_0x3dc6c6(0x161)+_0x3657ac['length']+_0x3dc6c6(0x162)};}async function downloadSkillPackage(_0x1697b1,_0x453f46,_0x310430,_0x529164){const _0x4ea268=a45_0x2314e4,_0x55d304=_0x1697b1[_0x4ea268(0x164)]?.['trim']();return _0x55d304?_0x529164(_0x453f46,_0x1697b1[_0x4ea268(0x13f)],_0x310430,_0x55d304):_0x529164(_0x453f46,_0x1697b1[_0x4ea268(0x13f)],_0x310430);}function countLinkActions(_0x1b725e){const _0x4b5ea1=a45_0x2314e4;return _0x1b725e[_0x4b5ea1(0x141)]((_0x4fd746,_0x2ae7b8)=>{const _0x4b94d5=_0x4b5ea1;return _0x4fd746[_0x2ae7b8[_0x4b94d5(0x15d)]]=(_0x4fd746[_0x2ae7b8[_0x4b94d5(0x15d)]]??0x0)+0x1,_0x4fd746;},{});}function a45_0x2c5d(){const _0x52396f=['462bLgNop','created','\x20personal\x20and\x20','\x20company\x20Skill(s).','filter','version','push','2611uQrDcM','skill','16933860KlRcBa','company','map','skillRoots','install','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','skillCode','flatMap','reduce','includes','authRequired','scope','1824412VKsOVX','appCode','1897294LnGokv','project','removed','Installed\x20','production','accessKey','read','str','unchanged','bool','personal','updated','length','4188776MhCteW','envName','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','code','3389076UOJnDb','trim','358485OpdOhg','3rObOrT','global','action','9qyqVes'];a45_0x2c5d=function(){return _0x52396f;};return a45_0x2c5d();}
1
+ const a45_0x4575a3=a45_0x4b9a;function a45_0x4b9a(_0x512804,_0x428401){_0x512804=_0x512804-0xc6;const _0xe4177b=a45_0xe417();let _0x4b9a2f=_0xe4177b[_0x512804];return _0x4b9a2f;}function a45_0xe417(){const _0x7110ec=['68958imkETY','length','version','trim','6TixFXJ','135620ZbHgvx','authRequired','../../../skills/runtime-skill-sync.js','reduce','flatMap','all','project','code','created','company','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','updated','6wIDSsT','removed','install','personal','scope','16XwfBhv','read','push','771399kGckKa','force','3097180SmftKn','production','skipped','str','filter','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','global','action','1827397phQAKa','includes','map','skillCode','1023176DwmroW','70zSNart','envName','80139gCWPvL','\x20company\x20Skill(s).','appCode','accessKey'];a45_0xe417=function(){return _0x7110ec;};return a45_0xe417();}(function(_0x1c1f70,_0x1af9d3){const _0x438e81=a45_0x4b9a,_0x4e7b40=_0x1c1f70();while(!![]){try{const _0x111bf7=parseInt(_0x438e81(0xec))/0x1+parseInt(_0x438e81(0xd3))/0x2*(-parseInt(_0x438e81(0xf0))/0x3)+-parseInt(_0x438e81(0xdd))/0x4+parseInt(_0x438e81(0xc7))/0x5*(-parseInt(_0x438e81(0xc6))/0x6)+-parseInt(_0x438e81(0xe9))/0x7+-parseInt(_0x438e81(0xd8))/0x8*(-parseInt(_0x438e81(0xdb))/0x9)+-parseInt(_0x438e81(0xea))/0xa*(-parseInt(_0x438e81(0xe5))/0xb);if(_0x111bf7===_0x1af9d3)break;else _0x4e7b40['push'](_0x4e7b40['shift']());}catch(_0x59d9cf){_0x4e7b40['push'](_0x4e7b40['shift']());}}}(a45_0xe417,0x61251));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':'skill','command':a45_0x4575a3(0xd5),'description':a45_0x4575a3(0xd1),'risk':a45_0x4575a3(0xd9),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x7487f9){return syncRuntimeSkills(_0x7487f9);}};async function syncRuntimeSkills(_0x1c7e63){const _0x3de14f=a45_0x4575a3,{downloadRuntimeSkillPackage:_0x5c7a46,listRuntimeSkills:_0x5c8a3c}=await import('../../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x1508a5,materializeRuntimeSkill:_0x3b03b5,pruneStaleRuntimeSkillCache:_0x4b16a1,pruneStaleRuntimeSkillLinks:_0xaa7c03,resolveRuntimeSkillInstallTarget:_0x48441}=await import(_0x3de14f(0xc9)),_0x2a518b=_0x1c7e63[_0x3de14f(0xe0)](_0x3de14f(0xce)),_0x4611f0=normalizeSyncScopes(_0x1c7e63[_0x3de14f(0xe0)](_0x3de14f(0xd7))),_0x46b938=_0x1c7e63[_0x3de14f(0xeb)]??_0x3de14f(0xde),_0x5d282f=_0x1c7e63[_0x3de14f(0xef)],_0x264885=_0x1c7e63['bool'](_0x3de14f(0xdc));if(!_0x5d282f)throw CliErrors[_0x3de14f(0xc8)](_0x3de14f(0xe2));const _0x1d2ae9=_0x48441(_0x1c7e63['appCode'],_0x1c7e63['bool'](_0x3de14f(0xcd))?'project':_0x3de14f(0xe3)),_0x60ccb1=_0x48441(_0x1c7e63[_0x3de14f(0xee)],_0x1d2ae9[_0x3de14f(0xd7)]==='project'?_0x3de14f(0xe3):'project'),_0x2095b0=await Promise[_0x3de14f(0xcc)](_0x4611f0[_0x3de14f(0xe7)](_0x166ecf=>_0x5c8a3c({'appCode':_0x1c7e63[_0x3de14f(0xee)],'scope':_0x166ecf,'code':_0x2a518b[_0x3de14f(0xf3)]()||undefined}))),_0x229670=_0x4611f0[_0x3de14f(0xe6)](_0x3de14f(0xd6))?_0x2095b0[_0x3de14f(0xcb)]((_0xb196c8,_0x5b88d8)=>_0x4611f0[_0x5b88d8]===_0x3de14f(0xd6)?_0xb196c8[_0x3de14f(0xd6)]:[]):[],_0x456f89=_0x4611f0[_0x3de14f(0xe6)](_0x3de14f(0xd0))?_0x2095b0[_0x3de14f(0xcb)]((_0x24291b,_0x4fbdd5)=>_0x4611f0[_0x4fbdd5]===_0x3de14f(0xd0)?_0x24291b[_0x3de14f(0xd0)]:[]):[],_0x5f5414=new Set([..._0x229670[_0x3de14f(0xe7)](_0x540aaa=>_0x540aaa['skillCode']?.[_0x3de14f(0xf3)]())[_0x3de14f(0xe1)](_0x50b26b=>Boolean(_0x50b26b)),..._0x456f89[_0x3de14f(0xe7)](_0x3324ee=>_0x3324ee[_0x3de14f(0xe8)]?.[_0x3de14f(0xf3)]())[_0x3de14f(0xe1)](_0x3ae501=>Boolean(_0x3ae501))]),_0x50bdc2=_0x2a518b[_0x3de14f(0xf3)]()?[_0x2a518b['trim']()]:undefined,_0x4830c6=_0x4611f0[_0x3de14f(0xf1)]===0x2&&_0x4611f0[_0x3de14f(0xe6)](_0x3de14f(0xd6))&&_0x4611f0[_0x3de14f(0xe6)](_0x3de14f(0xd0)),_0x4098c6=_0x4830c6?_0xaa7c03(_0x1d2ae9,_0x5f5414,_0x50bdc2):[],_0x5eab2b=_0x4b16a1({'env':_0x46b938,'accessKey':_0x5d282f,'appCode':_0x1c7e63['appCode'],'activeSkillCodes':_0x5f5414,'pruneSkillCodes':_0x50bdc2,'scopes':_0x4611f0,'protectedLinkRoots':_0x60ccb1['skillRoots']}),_0x3af06a=[];for(const _0x20b30a of _0x229670){_0x3af06a[_0x3de14f(0xda)](_0x3b03b5(_0x20b30a,_0x3de14f(0xd6),{'env':_0x46b938,'accessKey':_0x5d282f,'appCode':_0x1c7e63[_0x3de14f(0xee)],'force':_0x264885,'packageBytes':await downloadSkillPackage(_0x20b30a,_0x3de14f(0xd6),_0x1c7e63[_0x3de14f(0xee)],_0x5c7a46)}));}for(const _0x267752 of _0x456f89){_0x3af06a[_0x3de14f(0xda)](_0x3b03b5(_0x267752,_0x3de14f(0xd0),{'env':_0x46b938,'accessKey':_0x5d282f,'appCode':_0x1c7e63[_0x3de14f(0xee)],'force':_0x264885,'packageBytes':await downloadSkillPackage(_0x267752,_0x3de14f(0xd0),_0x1c7e63[_0x3de14f(0xee)],_0x5c7a46)}));}const _0x346f54=_0x1508a5(_0x3af06a,_0x1d2ae9),_0x7d941c=countLinkActions(_0x346f54);return{'ok':!![],'data':{'appCode':_0x1c7e63[_0x3de14f(0xee)],..._0x1d2ae9[_0x3de14f(0xd7)]===_0x3de14f(0xcd)?{'installTarget':{'scope':_0x1d2ae9[_0x3de14f(0xd7)],'skillRoots':[..._0x1d2ae9['skillRoots']]}}:{},'personal':_0x229670[_0x3de14f(0xf1)],'company':_0x456f89['length'],'materialized':_0x3af06a[_0x3de14f(0xf1)],'links':{'total':_0x346f54[_0x3de14f(0xf1)],'created':_0x7d941c[_0x3de14f(0xcf)]??0x0,'updated':_0x7d941c[_0x3de14f(0xd2)]??0x0,'unchanged':_0x7d941c['unchanged']??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x4098c6[_0x3de14f(0xe1)](_0x231f44=>_0x231f44['action']===_0x3de14f(0xd4))[_0x3de14f(0xf1)],'cacheDirs':_0x5eab2b['filter'](_0x3609ce=>_0x3609ce[_0x3de14f(0xe4)]==='removed')[_0x3de14f(0xf1)],'skipped':[..._0x4098c6,..._0x5eab2b][_0x3de14f(0xe1)](_0x1de408=>_0x1de408['action']===_0x3de14f(0xdf))[_0x3de14f(0xf1)]},'skills':{'personal':_0x229670[_0x3de14f(0xe7)](summarizeRuntimeSkill),'company':_0x456f89['map'](summarizeRuntimeSkill)}},'message':'Installed\x20'+_0x229670['length']+'\x20personal\x20and\x20'+_0x456f89[_0x3de14f(0xf1)]+_0x3de14f(0xed)};}async function downloadSkillPackage(_0x5ed52e,_0x31e49b,_0x456784,_0x1c73e9){const _0x13a400=a45_0x4575a3,_0x343282=_0x5ed52e[_0x13a400(0xf2)]?.[_0x13a400(0xf3)]();return _0x343282?_0x1c73e9(_0x31e49b,_0x5ed52e['skillCode'],_0x456784,_0x343282):_0x1c73e9(_0x31e49b,_0x5ed52e[_0x13a400(0xe8)],_0x456784);}function countLinkActions(_0x240a34){const _0x3b26b5=a45_0x4575a3;return _0x240a34[_0x3b26b5(0xca)]((_0x10dd21,_0x2b6a3f)=>{const _0x5d45af=_0x3b26b5;return _0x10dd21[_0x2b6a3f[_0x5d45af(0xe4)]]=(_0x10dd21[_0x2b6a3f[_0x5d45af(0xe4)]]??0x0)+0x1,_0x10dd21;},{});}
@@ -1 +1 @@
1
- const a46_0x2443ae=a46_0x1744;(function(_0x39cacf,_0xa52c54){const _0x7be8ca=a46_0x1744,_0x12c60b=_0x39cacf();while(!![]){try{const _0x156a76=-parseInt(_0x7be8ca(0x1fe))/0x1*(-parseInt(_0x7be8ca(0x1f7))/0x2)+-parseInt(_0x7be8ca(0x203))/0x3*(-parseInt(_0x7be8ca(0x1eb))/0x4)+-parseInt(_0x7be8ca(0x207))/0x5*(-parseInt(_0x7be8ca(0x209))/0x6)+parseInt(_0x7be8ca(0x200))/0x7+parseInt(_0x7be8ca(0x20a))/0x8+parseInt(_0x7be8ca(0x20e))/0x9+parseInt(_0x7be8ca(0x1fd))/0xa*(-parseInt(_0x7be8ca(0x20b))/0xb);if(_0x156a76===_0xa52c54)break;else _0x12c60b['push'](_0x12c60b['shift']());}catch(_0x51665c){_0x12c60b['push'](_0x12c60b['shift']());}}}(a46_0x4189,0x33699));function a46_0x1744(_0x15c933,_0x2bf0e2){_0x15c933=_0x15c933-0x1eb;const _0x4189f7=a46_0x4189();let _0x174436=_0x4189f7[_0x15c933];return _0x174436;}import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a46_0x2443ae(0x1ef),'command':a46_0x2443ae(0x1f8),'description':a46_0x2443ae(0x1f6),'risk':a46_0x2443ae(0x1f4),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0xf04b1e){const _0x17fe8e=a46_0x2443ae,_0x2f7cf0=_0xf04b1e[_0x17fe8e(0x20f)](_0x17fe8e(0x208)),_0x238df4=normalizeListScope(_0xf04b1e['str'](_0x17fe8e(0x1f3)));if(_0xf04b1e[_0x17fe8e(0x20d)](_0x17fe8e(0x1f9))){const _0x58648a=_0xf04b1e['accessKey'];if(!_0x58648a)throw CliErrors[_0x17fe8e(0x201)]();const {listLocalRuntimeSkills:_0x1cd7c,resolveRuntimeSkillInstallTarget:_0x23a937}=await import(_0x17fe8e(0x1ed)),_0x56b658=_0x23a937(_0xf04b1e[_0x17fe8e(0x1f1)],_0xf04b1e[_0x17fe8e(0x20d)]('project')?_0x17fe8e(0x1f2):_0x17fe8e(0x1ee)),_0x1a35a0=_0x1cd7c({'env':_0xf04b1e[_0x17fe8e(0x1f5)]??_0x17fe8e(0x1ff),'accessKey':_0x58648a,'appCode':_0xf04b1e[_0x17fe8e(0x1f1)],'scopes':listScopeToRuntimeScopes(_0x238df4),'code':_0x2f7cf0[_0x17fe8e(0x1fb)]()||undefined},_0x56b658),_0x5837f1=groupLocalRuntimeSkills(_0x1a35a0);return{'ok':!![],'data':{'appCode':_0xf04b1e['appCode'],'source':_0x17fe8e(0x1f9),..._0x56b658[_0x17fe8e(0x1f3)]===_0x17fe8e(0x1f2)?{'installScope':_0x56b658[_0x17fe8e(0x1f3)]}:{},'scope':_0x238df4,'total':_0x1a35a0[_0x17fe8e(0x20c)],'personal':_0x5837f1[_0x17fe8e(0x206)][_0x17fe8e(0x20c)],'company':_0x5837f1[_0x17fe8e(0x202)][_0x17fe8e(0x20c)],'items':_0x1a35a0[_0x17fe8e(0x1fc)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x5837f1['personal'][_0x17fe8e(0x1fc)](summarizeLocalRuntimeSkill),'company':_0x5837f1[_0x17fe8e(0x202)][_0x17fe8e(0x1fc)](summarizeLocalRuntimeSkill)}},'message':_0x17fe8e(0x1ec)+_0x1a35a0[_0x17fe8e(0x20c)]+_0x17fe8e(0x1f0)};}const {listRuntimeSkills:_0x50ab39}=await import('../../../core/api-client.js'),_0x4f591d=await _0x50ab39({'appCode':_0xf04b1e[_0x17fe8e(0x1f1)],'scope':listScopeToRemoteScope(_0x238df4),'code':_0x2f7cf0[_0x17fe8e(0x1fb)]()||undefined}),_0x23ac36=shouldListScope(_0x238df4,_0x17fe8e(0x206))?_0x4f591d[_0x17fe8e(0x206)]??[]:[],_0x38435b=shouldListScope(_0x238df4,_0x17fe8e(0x202))?_0x4f591d[_0x17fe8e(0x202)]??[]:[],_0x357b36=[..._0x23ac36,..._0x38435b];return{'ok':!![],'data':{'appCode':_0xf04b1e[_0x17fe8e(0x1f1)],'source':_0x17fe8e(0x1fa),'scope':_0x238df4,'total':_0x357b36[_0x17fe8e(0x20c)],'personal':_0x23ac36[_0x17fe8e(0x20c)],'company':_0x38435b[_0x17fe8e(0x20c)],'items':_0x357b36[_0x17fe8e(0x1fc)](summarizeRuntimeSkill),'skills':{'personal':_0x23ac36[_0x17fe8e(0x1fc)](summarizeRuntimeSkill),'company':_0x38435b['map'](summarizeRuntimeSkill)}},'message':'Listed\x20'+_0x357b36['length']+_0x17fe8e(0x205)};}};function a46_0x4189(){const _0x441d88=['list','local','remote','trim','map','410Pjybml','94hpnBfR','production','2373721lzioDe','authRequired','company','145650zNSrjQ','filter','\x20remote\x20Skill(s).','personal','5eERfgM','code','2174292DavhqQ','1191632QgRyLD','368599VuNKNf','length','bool','2550843bhoDFH','str','4yVLKqa','Listed\x20','../../../skills/runtime-skill-sync.js','global','skill','\x20local\x20Skill(s).','appCode','project','scope','read','envName','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','8554EnFJke'];a46_0x4189=function(){return _0x441d88;};return a46_0x4189();}function groupLocalRuntimeSkills(_0xa05c9a){const _0x224c56=a46_0x2443ae;return{'personal':_0xa05c9a['filter'](_0x313216=>_0x313216[_0x224c56(0x1f3)]===_0x224c56(0x206)),'company':_0xa05c9a['filter'](_0x1c96da=>_0x1c96da[_0x224c56(0x1f3)]===_0x224c56(0x202)),'builtin':_0xa05c9a[_0x224c56(0x204)](_0x121e69=>_0x121e69[_0x224c56(0x1f3)]==='builtin')};}
1
+ const a46_0xc51b8=a46_0x5bfd;function a46_0x1ede(){const _0xd2a57c=['authRequired','skill','Listed\x20','\x20local\x20Skill(s).','../../../core/api-client.js','597605PjQUCR','567730uhOShN','envName','accessKey','81BiAoGn','270338IinoOD','company','bool','length','scope','filter','project','str','\x20remote\x20Skill(s).','30jARpdh','359093KWsBty','trim','remote','../../../skills/runtime-skill-sync.js','production','136tRPbvr','973863ervLYT','446552bNsafH','map','local','1592316VEjqRf','appCode','personal','4NisLdF'];a46_0x1ede=function(){return _0xd2a57c;};return a46_0x1ede();}(function(_0x316066,_0x503b81){const _0x43643a=a46_0x5bfd,_0x3c4fa5=_0x316066();while(!![]){try{const _0x231474=parseInt(_0x43643a(0xc8))/0x1+-parseInt(_0x43643a(0xd9))/0x2+parseInt(_0x43643a(0xd8))/0x3*(parseInt(_0x43643a(0xdf))/0x4)+parseInt(_0x43643a(0xc3))/0x5*(parseInt(_0x43643a(0xd1))/0x6)+-parseInt(_0x43643a(0xd2))/0x7*(parseInt(_0x43643a(0xd7))/0x8)+parseInt(_0x43643a(0xc7))/0x9*(parseInt(_0x43643a(0xc4))/0xa)+-parseInt(_0x43643a(0xdc))/0xb;if(_0x231474===_0x503b81)break;else _0x3c4fa5['push'](_0x3c4fa5['shift']());}catch(_0x41ad25){_0x3c4fa5['push'](_0x3c4fa5['shift']());}}}(a46_0x1ede,0x7122e));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a46_0xc51b8(0xbf),'command':'list','description':'List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','risk':'read','flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x10730d){const _0x92e46b=a46_0xc51b8,_0x24f07c=_0x10730d[_0x92e46b(0xcf)]('code'),_0x5bdf56=normalizeListScope(_0x10730d[_0x92e46b(0xcf)]('scope'));if(_0x10730d['bool'](_0x92e46b(0xdb))){const _0x1737a4=_0x10730d[_0x92e46b(0xc6)];if(!_0x1737a4)throw CliErrors[_0x92e46b(0xe0)]();const {listLocalRuntimeSkills:_0x243fe5,resolveRuntimeSkillInstallTarget:_0x251524}=await import(_0x92e46b(0xd5)),_0x5e3830=_0x251524(_0x10730d[_0x92e46b(0xdd)],_0x10730d[_0x92e46b(0xca)](_0x92e46b(0xce))?_0x92e46b(0xce):'global'),_0x627bb=_0x243fe5({'env':_0x10730d[_0x92e46b(0xc5)]??_0x92e46b(0xd6),'accessKey':_0x1737a4,'appCode':_0x10730d[_0x92e46b(0xdd)],'scopes':listScopeToRuntimeScopes(_0x5bdf56),'code':_0x24f07c[_0x92e46b(0xd3)]()||undefined},_0x5e3830),_0x5bef23=groupLocalRuntimeSkills(_0x627bb);return{'ok':!![],'data':{'appCode':_0x10730d[_0x92e46b(0xdd)],'source':_0x92e46b(0xdb),..._0x5e3830[_0x92e46b(0xcc)]===_0x92e46b(0xce)?{'installScope':_0x5e3830['scope']}:{},'scope':_0x5bdf56,'total':_0x627bb[_0x92e46b(0xcb)],'personal':_0x5bef23[_0x92e46b(0xde)][_0x92e46b(0xcb)],'company':_0x5bef23['company'][_0x92e46b(0xcb)],'items':_0x627bb[_0x92e46b(0xda)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x5bef23[_0x92e46b(0xde)]['map'](summarizeLocalRuntimeSkill),'company':_0x5bef23[_0x92e46b(0xc9)][_0x92e46b(0xda)](summarizeLocalRuntimeSkill)}},'message':'Listed\x20'+_0x627bb[_0x92e46b(0xcb)]+_0x92e46b(0xc1)};}const {listRuntimeSkills:_0xa19af4}=await import(_0x92e46b(0xc2)),_0x4137cf=await _0xa19af4({'appCode':_0x10730d['appCode'],'scope':listScopeToRemoteScope(_0x5bdf56),'code':_0x24f07c[_0x92e46b(0xd3)]()||undefined}),_0x2004bb=shouldListScope(_0x5bdf56,_0x92e46b(0xde))?_0x4137cf[_0x92e46b(0xde)]??[]:[],_0x28f454=shouldListScope(_0x5bdf56,_0x92e46b(0xc9))?_0x4137cf['company']??[]:[],_0x18bceb=[..._0x2004bb,..._0x28f454];return{'ok':!![],'data':{'appCode':_0x10730d[_0x92e46b(0xdd)],'source':_0x92e46b(0xd4),'scope':_0x5bdf56,'total':_0x18bceb[_0x92e46b(0xcb)],'personal':_0x2004bb[_0x92e46b(0xcb)],'company':_0x28f454[_0x92e46b(0xcb)],'items':_0x18bceb[_0x92e46b(0xda)](summarizeRuntimeSkill),'skills':{'personal':_0x2004bb[_0x92e46b(0xda)](summarizeRuntimeSkill),'company':_0x28f454[_0x92e46b(0xda)](summarizeRuntimeSkill)}},'message':_0x92e46b(0xc0)+_0x18bceb[_0x92e46b(0xcb)]+_0x92e46b(0xd0)};}};function a46_0x5bfd(_0x529c4d,_0x3352ed){_0x529c4d=_0x529c4d-0xbf;const _0x1edee2=a46_0x1ede();let _0x5bfdac=_0x1edee2[_0x529c4d];return _0x5bfdac;}function groupLocalRuntimeSkills(_0x30242c){const _0xbd6617=a46_0xc51b8;return{'personal':_0x30242c[_0xbd6617(0xcd)](_0x273be5=>_0x273be5[_0xbd6617(0xcc)]===_0xbd6617(0xde)),'company':_0x30242c['filter'](_0x12bcb0=>_0x12bcb0[_0xbd6617(0xcc)]===_0xbd6617(0xc9)),'builtin':_0x30242c['filter'](_0x13461d=>_0x13461d[_0xbd6617(0xcc)]==='builtin')};}
@@ -1 +1 @@
1
- const a47_0x3b855b=a47_0x5e79;(function(_0x12fcff,_0x2cd5ce){const _0x239f65=a47_0x5e79,_0x17ac18=_0x12fcff();while(!![]){try{const _0xf900e3=parseInt(_0x239f65(0x66))/0x1+parseInt(_0x239f65(0x67))/0x2+parseInt(_0x239f65(0x68))/0x3+-parseInt(_0x239f65(0x6f))/0x4+-parseInt(_0x239f65(0x64))/0x5+parseInt(_0x239f65(0x65))/0x6+-parseInt(_0x239f65(0x6b))/0x7;if(_0xf900e3===_0x2cd5ce)break;else _0x17ac18['push'](_0x17ac18['shift']());}catch(_0x5ac957){_0x17ac18['push'](_0x17ac18['shift']());}}}(a47_0x2891,0x622fb));function a47_0x5e79(_0x5b1c5f,_0x2520be){_0x5b1c5f=_0x5b1c5f-0x64;const _0x28914d=a47_0x2891();let _0x5e7901=_0x28914d[_0x5b1c5f];return _0x5e7901;}function a47_0x2891(){const _0x5e2e4d=['1450518XvBdni','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','skill','7289485aWiehF','write','push','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','322732MjnzCP','1601940FuuCXz','3291552griBea','543690NgSpHH','537618qxJilA'];a47_0x2891=function(){return _0x5e2e4d;};return a47_0x2891();}import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';export const pushCommand={'service':a47_0x3b855b(0x6a),'command':a47_0x3b855b(0x6d),'description':a47_0x3b855b(0x6e),'risk':a47_0x3b855b(0x6c),'confirmationDescription':a47_0x3b855b(0x69),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
1
+ const a47_0x2db9d2=a47_0x2918;function a47_0x1ee0(){const _0x462912=['push','24CVIimp','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','368091XEARaK','401232hsNNXy','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','748020PwJtrD','76662UjQBQV','745717afsxlS','160FyuHoI','skill','225797sLNLoB','9866745eYbbve'];a47_0x1ee0=function(){return _0x462912;};return a47_0x1ee0();}(function(_0x145aca,_0x391892){const _0x234fd7=a47_0x2918,_0x397c4f=_0x145aca();while(!![]){try{const _0x578e01=parseInt(_0x234fd7(0x17c))/0x1+-parseInt(_0x234fd7(0x184))/0x2+parseInt(_0x234fd7(0x181))/0x3+-parseInt(_0x234fd7(0x182))/0x4+-parseInt(_0x234fd7(0x187))/0x5*(parseInt(_0x234fd7(0x185))/0x6)+parseInt(_0x234fd7(0x186))/0x7*(-parseInt(_0x234fd7(0x17f))/0x8)+parseInt(_0x234fd7(0x17d))/0x9;if(_0x578e01===_0x391892)break;else _0x397c4f['push'](_0x397c4f['shift']());}catch(_0x3288f1){_0x397c4f['push'](_0x397c4f['shift']());}}}(a47_0x1ee0,0x3b168));import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';function a47_0x2918(_0x2ceed6,_0x34315a){_0x2ceed6=_0x2ceed6-0x17c;const _0x1ee025=a47_0x1ee0();let _0x2918af=_0x1ee025[_0x2ceed6];return _0x2918af;}export const pushCommand={'service':a47_0x2db9d2(0x188),'command':a47_0x2db9d2(0x17e),'description':a47_0x2db9d2(0x183),'risk':'write','confirmationDescription':a47_0x2db9d2(0x180),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
@@ -1 +1 @@
1
- const a48_0x68ca1=a48_0x5870;(function(_0x4201af,_0x9c68cd){const _0x2552c6=a48_0x5870,_0x1c0f21=_0x4201af();while(!![]){try{const _0x598aaf=parseInt(_0x2552c6(0x19b))/0x1*(parseInt(_0x2552c6(0x192))/0x2)+-parseInt(_0x2552c6(0x198))/0x3*(-parseInt(_0x2552c6(0x191))/0x4)+-parseInt(_0x2552c6(0x190))/0x5+-parseInt(_0x2552c6(0x19d))/0x6*(-parseInt(_0x2552c6(0x195))/0x7)+parseInt(_0x2552c6(0x19c))/0x8*(parseInt(_0x2552c6(0x1a1))/0x9)+parseInt(_0x2552c6(0x193))/0xa+-parseInt(_0x2552c6(0x19e))/0xb;if(_0x598aaf===_0x9c68cd)break;else _0x1c0f21['push'](_0x1c0f21['shift']());}catch(_0x4176d2){_0x1c0f21['push'](_0x1c0f21['shift']());}}}(a48_0x3e1d,0x1a6d8));function a48_0x3e1d(){const _0x15abf7=['1652470NSecUo','validate','21anyRIM','skill','str','123ZQWKeA','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','type','1585XAiJob','1251448iZtgwb','248478UjrOsr','4186303tpnepZ','strict','errors','9fMKcCF','dir','952240fsGkVs','19828PJRuHC','38NQkEuh'];a48_0x3e1d=function(){return _0x15abf7;};return a48_0x3e1d();}import{DIR_FLAG,STRICT_FLAG}from'../flags.js';function a48_0x5870(_0x282b81,_0x525bb4){_0x282b81=_0x282b81-0x18f;const _0x3e1d96=a48_0x3e1d();let _0x587092=_0x3e1d96[_0x282b81];return _0x587092;}import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':a48_0x68ca1(0x196),'command':a48_0x68ca1(0x194),'description':a48_0x68ca1(0x199),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x4884be){const _0x25fcb7=a48_0x68ca1,_0x31154e=_0x4884be['bool'](_0x25fcb7(0x19f)),_0x3d7e93=validateSkillDirectory(_0x4884be[_0x25fcb7(0x197)]('dir'),{'strict':_0x31154e});return throwIfSkillValidationFailed(_0x3d7e93,_0x31154e),{'ok':!![],'data':{'dir':_0x3d7e93[_0x25fcb7(0x18f)],'type':_0x3d7e93[_0x25fcb7(0x19a)],'errors':_0x3d7e93[_0x25fcb7(0x1a0)],'warnings':_0x3d7e93['warnings']},'message':'Skill\x20validation\x20passed.'};}};
1
+ const a48_0x54c89d=a48_0x48ad;function a48_0x48ad(_0x4e8598,_0x327684){_0x4e8598=_0x4e8598-0xf7;const _0x422aac=a48_0x422a();let _0x48ad7f=_0x422aac[_0x4e8598];return _0x48ad7f;}(function(_0x1a6d50,_0x4a9371){const _0x210eb0=a48_0x48ad,_0x1796c8=_0x1a6d50();while(!![]){try{const _0xa46c4b=parseInt(_0x210eb0(0xf9))/0x1+-parseInt(_0x210eb0(0xf8))/0x2+parseInt(_0x210eb0(0xff))/0x3*(-parseInt(_0x210eb0(0xfc))/0x4)+parseInt(_0x210eb0(0x100))/0x5+parseInt(_0x210eb0(0x10a))/0x6+-parseInt(_0x210eb0(0x102))/0x7+-parseInt(_0x210eb0(0x108))/0x8*(-parseInt(_0x210eb0(0x106))/0x9);if(_0xa46c4b===_0x4a9371)break;else _0x1796c8['push'](_0x1796c8['shift']());}catch(_0x47aaa5){_0x1796c8['push'](_0x1796c8['shift']());}}}(a48_0x422a,0x407de));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':a48_0x54c89d(0x103),'command':a48_0x54c89d(0x101),'description':a48_0x54c89d(0xfb),'risk':a48_0x54c89d(0x107),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x244948){const _0x2f8129=a48_0x54c89d,_0x301332=_0x244948[_0x2f8129(0xfa)](_0x2f8129(0xf7)),_0x53e4f2=validateSkillDirectory(_0x244948[_0x2f8129(0x105)](_0x2f8129(0x104)),{'strict':_0x301332});return throwIfSkillValidationFailed(_0x53e4f2,_0x301332),{'ok':!![],'data':{'dir':_0x53e4f2[_0x2f8129(0x104)],'type':_0x53e4f2[_0x2f8129(0xfd)],'errors':_0x53e4f2['errors'],'warnings':_0x53e4f2[_0x2f8129(0xfe)]},'message':_0x2f8129(0x109)};}};function a48_0x422a(){const _0x435dfa=['dir','str','9LueJiI','read','7817624kVUnBY','Skill\x20validation\x20passed.','217302JLFBxA','strict','1011724oFTFtU','487215wWcpLx','bool','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','16DvBcIw','type','warnings','392790yIrNsp','872230cdIAyP','validate','2669387cCyZSJ','skill'];a48_0x422a=function(){return _0x435dfa;};return a48_0x422a();}
@@ -1 +1 @@
1
- (function(_0x2b389b,_0x2d3404){const _0x425c0a=a49_0x564b,_0x1ec513=_0x2b389b();while(!![]){try{const _0x2813b5=-parseInt(_0x425c0a(0xff))/0x1+parseInt(_0x425c0a(0x100))/0x2*(-parseInt(_0x425c0a(0x103))/0x3)+-parseInt(_0x425c0a(0xf2))/0x4*(-parseInt(_0x425c0a(0xea))/0x5)+-parseInt(_0x425c0a(0xf1))/0x6*(parseInt(_0x425c0a(0xf3))/0x7)+-parseInt(_0x425c0a(0x107))/0x8+parseInt(_0x425c0a(0xfc))/0x9*(-parseInt(_0x425c0a(0xee))/0xa)+-parseInt(_0x425c0a(0xf6))/0xb*(-parseInt(_0x425c0a(0xed))/0xc);if(_0x2813b5===_0x2d3404)break;else _0x1ec513['push'](_0x1ec513['shift']());}catch(_0x27e24f){_0x1ec513['push'](_0x1ec513['shift']());}}}(a49_0x1cea,0x1e4b2));import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';function a49_0x564b(_0x223988,_0x1694d4){_0x223988=_0x223988-0xea;const _0x1cea8b=a49_0x1cea();let _0x564bab=_0x1cea8b[_0x223988];return _0x564bab;}import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x45fb76){const _0x3bc30e=a49_0x564b;return(await readRequiredSkillDiagramInput(_0x45fb76))[_0x3bc30e(0xf7)];}export async function readRequiredSkillDiagramInput(_0x1212a2){const _0xa7e6f4=a49_0x564b,_0x5080fc=_0x1212a2[_0xa7e6f4(0x104)]();if(!_0x5080fc)throw CliErrors[_0xa7e6f4(0xec)](_0xa7e6f4(0x106),_0xa7e6f4(0xf8));let _0x33b7c3,_0x298dbf;if(_0x5080fc==='-')try{_0x33b7c3=readFileSync(0x0,_0xa7e6f4(0xfa));}catch{throw CliErrors['validation'](_0xa7e6f4(0xfb));}else{const _0x4a3635=resolve(_0x5080fc);if(!existsSync(_0x4a3635))throw CliErrors[_0xa7e6f4(0xec)](_0xa7e6f4(0xef)+_0x4a3635);if(!statSync(_0x4a3635)[_0xa7e6f4(0xf0)]())throw CliErrors['validation'](_0xa7e6f4(0xf9)+_0x4a3635);_0x298dbf=realpathSync(_0x4a3635),_0x33b7c3=readFileSync(_0x298dbf,_0xa7e6f4(0xfa));}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x33b7c3)},'sourceFilePath':_0x298dbf};}export async function validateAndCanonicalizeMermaid(_0xb97fba){const _0x195776=a49_0x564b,_0x18f0de=_0xb97fba[_0x195776(0xfd)](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a')[_0x195776(0xfd)](/\n+$/,'')+'\x0a';try{const _0x4ccf2b=await loadMermaidApi();await _0x4ccf2b[_0x195776(0x101)](_0x18f0de);}catch{throw diagramValidationError();}return _0x18f0de;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x327a11=a49_0x564b;if(!(_0x327a11(0x102)in globalThis)||!('document'in globalThis)){const _0xcec2d4=new JSDOM('');Object[_0x327a11(0xf4)](globalThis,{'window':{'configurable':!![],'value':_0xcec2d4[_0x327a11(0x102)]},'document':{'configurable':!![],'value':_0xcec2d4[_0x327a11(0x102)][_0x327a11(0x105)]}});}return(await import(_0x327a11(0xfe)))['default'];})()),mermaidApiPromise;}function diagramValidationError(){const _0x1524ab=a49_0x564b;return CliErrors[_0x1524ab(0xec)](_0x1524ab(0xeb),_0x1524ab(0xf5));}function a49_0x1cea(){const _0x3e29a0=['4pyqftx','11417QreOsW','defineProperties','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.','6865342lTgbCN','diagram','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','utf8','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','18eTKEnQ','replace','mermaid','118698DAAneG','1660NfnwNm','parse','window','579cYFmmN','trim','document','--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.','9168aCcTQt','891265WRJypu','Mermaid\x20syntax\x20validation\x20failed.','validation','12GPkXvo','1037160rDcBvh','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','isFile','702bSNjiV'];a49_0x1cea=function(){return _0x3e29a0;};return a49_0x1cea();}
1
+ (function(_0x1d6ee3,_0x1917db){const _0x4a7bb1=a49_0xd97f,_0x183f46=_0x1d6ee3();while(!![]){try{const _0x1b681e=parseInt(_0x4a7bb1(0xd4))/0x1+-parseInt(_0x4a7bb1(0xd5))/0x2+parseInt(_0x4a7bb1(0xd1))/0x3+-parseInt(_0x4a7bb1(0xcc))/0x4+parseInt(_0x4a7bb1(0xca))/0x5*(-parseInt(_0x4a7bb1(0xd8))/0x6)+parseInt(_0x4a7bb1(0xda))/0x7+parseInt(_0x4a7bb1(0xdb))/0x8*(parseInt(_0x4a7bb1(0xc6))/0x9);if(_0x1b681e===_0x1917db)break;else _0x183f46['push'](_0x183f46['shift']());}catch(_0x3fe8fb){_0x183f46['push'](_0x183f46['shift']());}}}(a49_0x10b7,0x74d92));function a49_0xd97f(_0x4962c5,_0x4e850e){_0x4962c5=_0x4962c5-0xc5;const _0x10b750=a49_0x10b7();let _0xd97f9a=_0x10b750[_0x4962c5];return _0xd97f9a;}import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x3ba145){const _0x2f352e=a49_0xd97f;return(await readRequiredSkillDiagramInput(_0x3ba145))[_0x2f352e(0xc9)];}function a49_0x10b7(){const _0x20d19b=['Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','684459YmECSx','utf8','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','715532KQOMus','579898hCUfxZ','window','validation','5343810GwVwJa','replace','4467750UTdMHC','32BuUUqC','Mermaid\x20syntax\x20validation\x20failed.','document','1155348aGibpL','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','trim','diagram','5ERlcjF','isFile','1744916fTQKBu','parse','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.','mermaid'];a49_0x10b7=function(){return _0x20d19b;};return a49_0x10b7();}export async function readRequiredSkillDiagramInput(_0x53b69b){const _0xcd52e1=a49_0xd97f,_0x4070a4=_0x53b69b[_0xcd52e1(0xc8)]();if(!_0x4070a4)throw CliErrors[_0xcd52e1(0xd7)]('--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.',_0xcd52e1(0xc7));let _0x396581,_0x4aed54;if(_0x4070a4==='-')try{_0x396581=readFileSync(0x0,_0xcd52e1(0xd2));}catch{throw CliErrors['validation'](_0xcd52e1(0xd0));}else{const _0x552df2=resolve(_0x4070a4);if(!existsSync(_0x552df2))throw CliErrors['validation'](_0xcd52e1(0xd3)+_0x552df2);if(!statSync(_0x552df2)[_0xcd52e1(0xcb)]())throw CliErrors[_0xcd52e1(0xd7)]('Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x552df2);_0x4aed54=realpathSync(_0x552df2),_0x396581=readFileSync(_0x4aed54,_0xcd52e1(0xd2));}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x396581)},'sourceFilePath':_0x4aed54};}export async function validateAndCanonicalizeMermaid(_0x4c8745){const _0x472033=a49_0xd97f,_0x527428=_0x4c8745[_0x472033(0xd9)](/\r\n/g,'\x0a')[_0x472033(0xd9)](/\r/g,'\x0a')[_0x472033(0xd9)](/\n+$/,'')+'\x0a';try{const _0x577fc7=await loadMermaidApi();await _0x577fc7[_0x472033(0xcd)](_0x527428);}catch{throw diagramValidationError();}return _0x527428;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x4f0e60=a49_0xd97f;if(!(_0x4f0e60(0xd6)in globalThis)||!(_0x4f0e60(0xc5)in globalThis)){const _0x4b216e=new JSDOM('');Object['defineProperties'](globalThis,{'window':{'configurable':!![],'value':_0x4b216e['window']},'document':{'configurable':!![],'value':_0x4b216e[_0x4f0e60(0xd6)][_0x4f0e60(0xc5)]}});}return(await import(_0x4f0e60(0xcf)))['default'];})()),mermaidApiPromise;}function diagramValidationError(){const _0x1984bd=a49_0xd97f;return CliErrors[_0x1984bd(0xd7)](_0x1984bd(0xdc),_0x1984bd(0xce));}