@lovrabet/lovrabet-cli 2.1.23-beta.4 → 2.1.23

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 (132) 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/runtime/confirmation.js +1 -1
  103. package/lib/runtime/event.js +1 -1
  104. package/lib/runtime/index.js +1 -1
  105. package/lib/runtime/queue.js +1 -1
  106. package/lib/runtime/resolve.js +1 -1
  107. package/lib/skills/npx-skills-add.js +1 -1
  108. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  109. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  110. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  111. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  112. package/lib/skills/runtime-skill-sync/links.js +1 -1
  113. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  114. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  115. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  116. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  117. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  118. package/lib/skills/runtime-skill-sync/push.js +1 -1
  119. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  120. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  121. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  122. package/lib/skills/runtime-skill-sync.js +1 -1
  123. package/lib/skills/skill-presence.js +1 -1
  124. package/lib/utils/apply-jq-filter.js +1 -1
  125. package/lib/utils/logger.js +1 -1
  126. package/lib/utils/lossless-json.js +1 -1
  127. package/lib/utils/params.js +1 -1
  128. package/lib/utils/platform.js +1 -1
  129. package/lib/utils/update-notice.js +1 -1
  130. package/lib/utils/version.js +1 -1
  131. package/lib/utils/write-cli-side-channel.js +1 -1
  132. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x1a7551,_0x572f66){const _0x1e28d8=a39_0x8bbe,_0x32de88=_0x1a7551();while(!![]){try{const _0x37cb9d=-parseInt(_0x1e28d8(0xda))/0x1+-parseInt(_0x1e28d8(0xe3))/0x2*(parseInt(_0x1e28d8(0xc4))/0x3)+-parseInt(_0x1e28d8(0xd7))/0x4*(-parseInt(_0x1e28d8(0xd6))/0x5)+-parseInt(_0x1e28d8(0xcc))/0x6*(-parseInt(_0x1e28d8(0xf4))/0x7)+parseInt(_0x1e28d8(0xb9))/0x8+parseInt(_0x1e28d8(0xf0))/0x9*(parseInt(_0x1e28d8(0xec))/0xa)+-parseInt(_0x1e28d8(0xc1))/0xb;if(_0x37cb9d===_0x572f66)break;else _0x32de88['push'](_0x32de88['shift']());}catch(_0x17297a){_0x32de88['push'](_0x32de88['shift']());}}}(a39_0x2ec4,0x63cac));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';function a39_0x8bbe(_0x3f2705,_0x18fa91){_0x3f2705=_0x3f2705-0x8e;const _0x2ec4e1=a39_0x2ec4();let _0x8bbe89=_0x2ec4e1[_0x3f2705];return _0x8bbe89;}import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x25d339,_0x22d074){const _0x8317ea=a39_0x8bbe,_0x70d381=listLocalServiceTrees();let _0x434dd9;for(const _0x14a203 of _0x70d381){const _0x124ab1=matchServiceTreeCommand(_0x14a203,_0x25d339);if(!_0x124ab1)continue;(!_0x434dd9||_0x124ab1[_0x8317ea(0xaa)][_0x8317ea(0xa7)][_0x8317ea(0x98)]>_0x434dd9['command'][_0x8317ea(0xa7)][_0x8317ea(0x98)])&&(_0x434dd9={'tree':_0x14a203,'command':_0x124ab1[_0x8317ea(0xaa)],'remainingArgs':_0x124ab1[_0x8317ea(0xac)]});}if(!_0x434dd9)return undefined;const _0x1d009={..._0x22d074};return applyAppBinding(_0x434dd9[_0x8317ea(0x9a)],_0x434dd9[_0x8317ea(0xaa)],_0x1d009),{'definition':buildDynamicCommandDefinition(_0x434dd9[_0x8317ea(0x9a)],_0x434dd9[_0x8317ea(0xaa)]),'args':_0x434dd9[_0x8317ea(0xac)],'flags':_0x1d009,'tree':_0x434dd9[_0x8317ea(0x9a)],'command':_0x434dd9[_0x8317ea(0xaa)]};}export function generateDynamicServiceHelp(_0x363103){const _0x20e7be=a39_0x8bbe,_0x411f4d=listLocalServiceTrees()[_0x20e7be(0xf5)](_0x214d55=>_0x214d55['service'][_0x20e7be(0x95)]===_0x363103);if(!_0x411f4d)return undefined;const _0x319fa6=[CLI_BIN_NAME+'\x20'+_0x363103+_0x20e7be(0xd0),'',_0x411f4d[_0x20e7be(0xc7)][_0x20e7be(0xf7)]||_0x363103,_0x411f4d['service'][_0x20e7be(0xe5)]?'\x20\x20'+_0x411f4d[_0x20e7be(0xc7)][_0x20e7be(0xe5)]:'','','Commands:',..._0x411f4d['commands'][_0x20e7be(0xf3)](_0x1694b5=>{const _0x117fd4=_0x20e7be,_0x1fb0b0=_0x1694b5[_0x117fd4(0xa7)]['slice'](0x1)[_0x117fd4(0xc8)]('\x20'),_0x17a8b8=_0x1694b5[_0x117fd4(0xf2)]==='read'?'':'\x20['+_0x1694b5[_0x117fd4(0xf2)]+']';return'\x20\x20'+_0x1fb0b0[_0x117fd4(0xbb)](0x18)+'\x20'+(_0x1694b5['description']||'')+_0x17a8b8;}),'','Use\x20`'+CLI_BIN_NAME+_0x20e7be(0x97)+_0x363103+_0x20e7be(0xa2)][_0x20e7be(0xa8)](Boolean);return _0x319fa6[_0x20e7be(0xc8)]('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0xf54fc0=>{const _0x292eb9=a39_0x8bbe,_0x2eff23=_0xf54fc0[_0x292eb9(0xc3)];return{'service':_0x2eff23[_0x292eb9(0xc7)][_0x292eb9(0x95)],'label':_0x2eff23['service'][_0x292eb9(0xf7)]||_0x2eff23[_0x292eb9(0xc7)][_0x292eb9(0x95)],'commands':_0x2eff23[_0x292eb9(0xe4)][_0x292eb9(0xf3)](_0x20b7b8=>({'command':dynamicCommandName(_0x20b7b8),'description':_0x20b7b8[_0x292eb9(0xe5)]||_0x292eb9(0xe0)+_0x20b7b8[_0x292eb9(0xb7)],'tag':riskTag(_0x20b7b8[_0x292eb9(0xf2)])}))};});}export function getDynamicServiceEntry(_0x20e25b){const _0x4b6943=a39_0x8bbe;return listDynamicServiceEntries()['find'](_0x3db5ac=>_0x3db5ac[_0x4b6943(0xc7)]===_0x20e25b);}export function listDynamicServiceDefinitions(_0x26a007){const _0x1bdf02=a39_0x8bbe;return listLocalServiceTrees()[_0x1bdf02(0xa8)](_0x1699e5=>!_0x26a007||_0x1699e5[_0x1bdf02(0xc7)][_0x1bdf02(0x95)]===_0x26a007)[_0x1bdf02(0xc0)](_0x425f9b=>_0x425f9b['commands'][_0x1bdf02(0xf3)](_0x45122b=>buildDynamicCommandDefinition(_0x425f9b,_0x45122b)));}export function getDynamicServiceDefinitions(_0x1f958d){const _0x42fb90=listDynamicServiceDefinitions(_0x1f958d);return _0x42fb90['length']>0x0?_0x42fb90:undefined;}export function findDynamicServiceDefinition(_0x1e3372,_0x28561a){const _0x109afd=a39_0x8bbe;return listDynamicServiceDefinitions(_0x1e3372)['find'](_0x196b60=>_0x196b60[_0x109afd(0xaa)]===_0x28561a);}export function buildDynamicCommandDefinition(_0x30e590,_0xf6ff44){const _0x50ddad=a39_0x8bbe;return{'service':_0x30e590['service'][_0x50ddad(0x95)],'command':dynamicCommandName(_0xf6ff44),'description':_0xf6ff44[_0x50ddad(0xe5)]||_0x50ddad(0xe0)+_0xf6ff44[_0x50ddad(0xb7)],'risk':_0xf6ff44[_0x50ddad(0xf2)],..._0xf6ff44[_0x50ddad(0xf2)]===_0x50ddad(0xfa)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0xf6ff44)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0xf6ff44[_0x50ddad(0x9f)][_0x50ddad(0xf3)](_0x4734cc=>({'name':_0x4734cc['name'],'description':_0x4734cc['description']||_0x4734cc[_0x50ddad(0xf7)],'required':_0x4734cc[_0x50ddad(0x9b)]})),'flags':_0xf6ff44[_0x50ddad(0xd2)][_0x50ddad(0xf3)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0xf6ff44),async 'dryRun'(_0xe1a15f){const _0x83c75b=_0x50ddad,_0x7539f=await compilePlan(_0xf6ff44,_0xe1a15f);return{'method':_0x83c75b(0xc2),'url':_0xf6ff44['cliPath'],'body':{'target':targetPreview(_0x7539f),'params':_0x7539f[_0x83c75b(0xc9)]},'description':_0x83c75b(0xca)+_0xf6ff44[_0x83c75b(0xb7)]};},async 'execute'(_0x461cdb){const _0x3269e5=_0x50ddad,_0x13a07b=await compilePlan(_0xf6ff44,_0x461cdb),_0x4e6667=Date[_0x3269e5(0xb3)](),_0x1a49c1=await executePlan(_0x13a07b,_0xf6ff44,_0x461cdb),_0x26dd97=Date['now']()-_0x4e6667;return{'ok':!![],'data':{'service':_0x30e590[_0x3269e5(0xc7)],'command':_0xf6ff44['cliPath'],'target':targetPreview(_0x13a07b),'result':_0x1a49c1,'elapsed':_0x26dd97},'message':_0x3269e5(0xba)+_0xf6ff44[_0x3269e5(0xb7)]+_0x3269e5(0xeb)+_0x26dd97+'ms'};}};}function buildDynamicConfirmationDescription(_0x1673a8){const _0x27df2b=a39_0x8bbe,_0x3058a9=_0x1673a8[_0x27df2b(0xe5)]||_0x1673a8[_0x27df2b(0xb7)],_0x294ad1=_0x1673a8[_0x27df2b(0xf2)]===_0x27df2b(0x8f)?'该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。':_0x27df2b(0xdc);return _0x27df2b(0xce)+_0x3058a9+'”。'+_0x294ad1;}function dynamicCommandName(_0x345362){const _0x1cad5b=a39_0x8bbe;return _0x345362[_0x1cad5b(0xa7)][_0x1cad5b(0xa3)](0x1)[_0x1cad5b(0xc8)]('\x20');}function riskTag(_0xda5f37){const _0x313dfc=a39_0x8bbe;return _0xda5f37===_0x313dfc(0xfa)?'':_0x313dfc(0xe9)+_0xda5f37+']';}function flagToCommandFlag(_0x4b5de5){const _0x307925=a39_0x8bbe;return{'name':_0x4b5de5[_0x307925(0xa4)],'type':_0x4b5de5[_0x307925(0xde)]===_0x307925(0x93)?_0x307925(0x9c):_0x4b5de5[_0x307925(0xde)],'description':_0x4b5de5[_0x307925(0xe5)]||_0x4b5de5[_0x307925(0xf7)],'required':_0x4b5de5[_0x307925(0x9b)],'default':isPrimitiveFlagDefault(_0x4b5de5[_0x307925(0xb2)])?_0x4b5de5[_0x307925(0xb2)]:undefined,'enum':_0x4b5de5[_0x307925(0xdd)]};}async function compilePlan(_0x18ceba,_0x52963c){const _0x21ef5f=a39_0x8bbe;return compileServiceTreeCommand(_0x18ceba,{'flags':_0x52963c[_0x21ef5f(0xa1)],'args':_0x52963c[_0x21ef5f(0x9f)],'context':await buildServiceContext(_0x18ceba,_0x52963c)});}function a39_0x2ec4(){const _0xfc1330=['name','\x20\x20\x20\x20datasetCode:\x20','\x20\x20\x20\x20kind:\x20\x20\x20\x20','read','source','datatable','high-risk-write','\x20\x20MAP\x20TO','nickName','Unsupported\x20service\x20target\x20kind:\x20','json','dbtableConfig','code','Unknown\x20appRef\x20\x22','\x20service\x20detail\x20--service\x20','length','appcode','tree','required','string','sql','\x20->\x20','args','\x20requires\x20target.sqlCode.','rawFlags','`\x20to\x20inspect\x20the\x20manifest.','slice','cliName','\x20\x20\x20\x20sqlCode:\x20','envName','fullPath','filter','\x22\x20in\x20service\x20command\x20','command','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','remainingArgs','push','\x20\x20\x20\x20command:\x20','username','some','scriptName','default','now','datasetCode','\x20requires\x20target.functionName.','userId','cliPath','number','409496zJVagw','Service\x20command\x20','padEnd','appBindings','ctx.','data','\x20\x20\x20\x20','flatMap','6667760cGrQVo','SERVICE_TREE','normalizedManifest','2022JLvfaC','appRef','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','service','join','params','Preview\x20dynamic\x20service\x20command:\x20','employeeId','61062nMWUeD','bffCode','将通过\x20Service\x20Tree\x20执行“','env','\x20<command>\x20[flags]','entries','flags','userName','mapTo','nickname','2618890NmkZFA','4RiXUpS','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','operator','133867xjncmh','trim','该命令被清单标记为写入,可能修改业务数据或服务状态。','enum','type','\x20\x20\x20\x20functionName:\x20','Run\x20service\x20command\x20','validation','loginName','1866MmKZHV','commands','description','app','\x20\x20SERVICE\x20TREE\x20TARGET','target','\x20\x20[','bffId','\x20completed\x20in\x20','1210wEldod','kind','appCode','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','31167xVodCS','sqlCode','risk','map','539VkkrFy','find','startsWith'];a39_0x2ec4=function(){return _0xfc1330;};return a39_0x2ec4();}async function buildServiceContext(_0x3a44af,_0x456322){const _0x336cda=a39_0x8bbe,_0x31dc1b={'appCode':_0x456322[_0x336cda(0xee)],'env':_0x456322[_0x336cda(0xa6)],'envName':_0x456322[_0x336cda(0xa6)]};if(!usesRuntimeContext(_0x3a44af))return _0x31dc1b;const _0x5c363e=await getLoginUserInfo(),_0x2b6efb=pickFirst(_0x5c363e[_0x336cda(0xb6)],_0x5c363e['id']);return{..._0x31dc1b,'user':_0x5c363e,'userId':_0x2b6efb,'id':_0x5c363e['id'],'username':pickFirst(_0x5c363e[_0x336cda(0xaf)],_0x5c363e[_0x336cda(0xd3)],_0x5c363e[_0x336cda(0xe2)]),'userName':_0x5c363e['userName'],'nickname':pickFirst(_0x5c363e[_0x336cda(0xd5)],_0x5c363e[_0x336cda(0x91)]),'nickName':_0x5c363e[_0x336cda(0x91)],'tenantCode':_0x5c363e['tenantCode'],'employeeId':_0x5c363e[_0x336cda(0xcb)]};}function usesRuntimeContext(_0x4cba60){const _0x3592fe=a39_0x8bbe;return _0x4cba60['mapTo'][_0x3592fe(0xb0)](_0x40aa96=>typeof _0x40aa96[_0x3592fe(0xfb)]===_0x3592fe(0x9c)&&(_0x40aa96[_0x3592fe(0xfb)][_0x3592fe(0xf6)]('context.')||_0x40aa96[_0x3592fe(0xfb)][_0x3592fe(0xf6)](_0x3592fe(0xbd))));}function pickFirst(..._0x5a1695){const _0x5dadf1=a39_0x8bbe;return _0x5a1695[_0x5dadf1(0xf5)](_0x218bcd=>_0x218bcd!==undefined&&_0x218bcd!==null);}async function executePlan(_0x3f1843,_0x21c80a,_0xe51457){const _0x3ba810=a39_0x8bbe;if(_0x3f1843['kind']===_0x3ba810(0xbe)){const _0xc172ba=await resolveDatasetCode(_0x3f1843,_0x21c80a,_0xe51457);return executeData(_0xc172ba,_0x3f1843['command'],_0x3f1843['params']);}if(_0x3f1843[_0x3ba810(0xed)]===_0x3ba810(0x9d)){if(!_0x3f1843['sqlCode'])throw CliErrors[_0x3ba810(0xe1)](_0x3ba810(0xba)+_0x21c80a[_0x3ba810(0xb7)]+_0x3ba810(0xa0));return executeSdkSql(_0x3f1843[_0x3ba810(0xf1)],normalizeScalarParams(_0x3f1843[_0x3ba810(0xc9)]));}if(_0x3f1843['kind']==='bff'){const _0x3110dc=_0x3f1843[_0x3ba810(0xb1)]||_0x3f1843[_0x3ba810(0xcd)]||(_0x3f1843[_0x3ba810(0xea)]==null?'':String(_0x3f1843[_0x3ba810(0xea)]));if(!_0x3110dc)throw CliErrors[_0x3ba810(0xe1)](_0x3ba810(0xba)+_0x21c80a['cliPath']+_0x3ba810(0xb5));return executeSdkBff(_0x3110dc,_0x3f1843[_0x3ba810(0xc9)]);}throw CliErrors[_0x3ba810(0xe1)](_0x3ba810(0x92)+_0x3f1843[_0x3ba810(0xed)]);}async function resolveDatasetCode(_0x48548c,_0x5bbc1c,_0x24c27c){const _0x3e9fb4=a39_0x8bbe;if(_0x48548c[_0x3e9fb4(0xb4)])return _0x48548c['datasetCode'];if(!_0x48548c[_0x3e9fb4(0x8e)])throw CliErrors[_0x3e9fb4(0xe1)](_0x3e9fb4(0xba)+_0x5bbc1c['cliPath']+_0x3e9fb4(0xab));const _0x26d2b1=await listDatasets(_0x24c27c['appCode']),_0x31f383=_0x26d2b1[_0x3e9fb4(0xf5)](_0x4e6a5c=>_0x4e6a5c[_0x3e9fb4(0x94)]?.['tableName']===_0x48548c[_0x3e9fb4(0x8e)]);if(!_0x31f383?.[_0x3e9fb4(0x95)])throw CliErrors[_0x3e9fb4(0xe1)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x48548c[_0x3e9fb4(0x8e)]+_0x3e9fb4(0xd8)+_0x24c27c[_0x3e9fb4(0xee)]+'.',_0x3e9fb4(0xc6));return _0x31f383[_0x3e9fb4(0x95)];}function applyAppBinding(_0x4575d6,_0x3174fa,_0x2d8fa4){const _0x119458=a39_0x8bbe,_0x420a45=_0x3174fa[_0x119458(0xe8)][_0x119458(0xc5)];if(!_0x420a45)return;const _0x134bb5=_0x4575d6[_0x119458(0xbc)][_0x420a45];if(!_0x134bb5)throw CliErrors[_0x119458(0xe1)](_0x119458(0x96)+_0x420a45+_0x119458(0xa9)+_0x3174fa['cliPath']+'.',_0x119458(0xef));const _0x4a19b2=_0x134bb5['appcode']||_0x134bb5[_0x119458(0xee)];_0x4a19b2&&!hasText(_0x2d8fa4[_0x119458(0x99)])&&(_0x2d8fa4[_0x119458(0x99)]=_0x4a19b2),_0x134bb5[_0x119458(0xe6)]&&!hasText(_0x2d8fa4['app'])&&!hasText(_0x2d8fa4['appcode'])&&(_0x2d8fa4[_0x119458(0xe6)]=_0x134bb5[_0x119458(0xe6)]),_0x134bb5['env']&&!hasText(_0x2d8fa4[_0x119458(0xcf)])&&(_0x2d8fa4['env']=_0x134bb5[_0x119458(0xcf)]);}function renderDynamicCommandHelp(_0x41d72f){const _0x1b5474=a39_0x8bbe,_0x44545c=[_0x1b5474(0xe7),_0x1b5474(0xf9)+_0x41d72f['target'][_0x1b5474(0xed)],_0x1b5474(0xae)+_0x41d72f['target'][_0x1b5474(0xaa)]];if(_0x41d72f[_0x1b5474(0xe8)][_0x1b5474(0xb4)])_0x44545c['push'](_0x1b5474(0xf8)+_0x41d72f[_0x1b5474(0xe8)]['datasetCode']);if(_0x41d72f[_0x1b5474(0xe8)]['datatable'])_0x44545c['push']('\x20\x20\x20\x20datatable:\x20'+_0x41d72f[_0x1b5474(0xe8)][_0x1b5474(0x8e)]);if(_0x41d72f[_0x1b5474(0xe8)][_0x1b5474(0xf1)])_0x44545c[_0x1b5474(0xad)](_0x1b5474(0xa5)+_0x41d72f[_0x1b5474(0xe8)]['sqlCode']);if(_0x41d72f[_0x1b5474(0xe8)][_0x1b5474(0xb1)])_0x44545c[_0x1b5474(0xad)](_0x1b5474(0xdf)+_0x41d72f[_0x1b5474(0xe8)][_0x1b5474(0xb1)]);if(_0x41d72f['mapTo'][_0x1b5474(0x98)]>0x0){_0x44545c[_0x1b5474(0xad)]('',_0x1b5474(0x90));for(const _0x52c3da of _0x41d72f[_0x1b5474(0xd4)]){_0x44545c[_0x1b5474(0xad)](_0x1b5474(0xbf)+(_0x52c3da['source']||'const')+_0x1b5474(0x9e)+_0x52c3da[_0x1b5474(0xe8)]+(_0x52c3da['operator']?'.'+_0x52c3da[_0x1b5474(0xd9)]:''));}}return _0x44545c[_0x1b5474(0xc8)]('\x0a');}function targetPreview(_0x418c33){const _0x3af3ff=a39_0x8bbe;return{'kind':_0x418c33[_0x3af3ff(0xed)],'command':_0x418c33[_0x3af3ff(0xaa)],'appRef':_0x418c33['appRef'],'datasetCode':_0x418c33['datasetCode'],'datatable':_0x418c33[_0x3af3ff(0x8e)],'sqlCode':_0x418c33[_0x3af3ff(0xf1)],'bffCode':_0x418c33['bffCode'],'bffId':_0x418c33[_0x3af3ff(0xea)],'functionName':_0x418c33[_0x3af3ff(0xb1)]};}function normalizeScalarParams(_0x24b393){const _0x16e5e1=a39_0x8bbe;return Object['fromEntries'](Object[_0x16e5e1(0xd1)](_0x24b393)[_0x16e5e1(0xa8)](([,_0x60854b])=>typeof _0x60854b==='string'||typeof _0x60854b===_0x16e5e1(0xb8)));}function hasText(_0x3984da){const _0x1c3ba9=a39_0x8bbe;return typeof _0x3984da===_0x1c3ba9(0x9c)&&_0x3984da[_0x1c3ba9(0xdb)]()[_0x1c3ba9(0x98)]>0x0;}function isPrimitiveFlagDefault(_0x2620dd){const _0x586211=a39_0x8bbe;return _0x2620dd===undefined||typeof _0x2620dd==='string'||typeof _0x2620dd===_0x586211(0xb8)||typeof _0x2620dd==='boolean';}
1
+ (function(_0x2a7b6a,_0x1edad7){const _0x9417e8=a39_0x2190,_0x247fa5=_0x2a7b6a();while(!![]){try{const _0x17915e=parseInt(_0x9417e8(0x182))/0x1*(parseInt(_0x9417e8(0x14b))/0x2)+parseInt(_0x9417e8(0x17e))/0x3*(parseInt(_0x9417e8(0x14e))/0x4)+-parseInt(_0x9417e8(0x14c))/0x5+parseInt(_0x9417e8(0x14d))/0x6+parseInt(_0x9417e8(0x18f))/0x7+-parseInt(_0x9417e8(0x153))/0x8+-parseInt(_0x9417e8(0x1a4))/0x9;if(_0x17915e===_0x1edad7)break;else _0x247fa5['push'](_0x247fa5['shift']());}catch(_0x53501a){_0x247fa5['push'](_0x247fa5['shift']());}}}(a39_0x29f5,0x38e68));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(_0x2e0420,_0x55af71){const _0x47b3c4=a39_0x2190,_0x36ad50=listLocalServiceTrees();let _0x247753;for(const _0x3231cd of _0x36ad50){const _0xb2d06b=matchServiceTreeCommand(_0x3231cd,_0x2e0420);if(!_0xb2d06b)continue;(!_0x247753||_0xb2d06b[_0x47b3c4(0x15e)][_0x47b3c4(0x19b)]['length']>_0x247753[_0x47b3c4(0x15e)][_0x47b3c4(0x19b)][_0x47b3c4(0x1a2)])&&(_0x247753={'tree':_0x3231cd,'command':_0xb2d06b[_0x47b3c4(0x15e)],'remainingArgs':_0xb2d06b['remainingArgs']});}if(!_0x247753)return undefined;const _0x40390c={..._0x55af71};return applyAppBinding(_0x247753[_0x47b3c4(0x187)],_0x247753[_0x47b3c4(0x15e)],_0x40390c),{'definition':buildDynamicCommandDefinition(_0x247753[_0x47b3c4(0x187)],_0x247753[_0x47b3c4(0x15e)]),'args':_0x247753[_0x47b3c4(0x164)],'flags':_0x40390c,'tree':_0x247753[_0x47b3c4(0x187)],'command':_0x247753[_0x47b3c4(0x15e)]};}export function generateDynamicServiceHelp(_0x4759a4){const _0x19af62=a39_0x2190,_0xf3db1=listLocalServiceTrees()[_0x19af62(0x18b)](_0x3904c8=>_0x3904c8['service'][_0x19af62(0x19f)]===_0x4759a4);if(!_0xf3db1)return undefined;const _0x572408=[CLI_BIN_NAME+'\x20'+_0x4759a4+_0x19af62(0x157),'',_0xf3db1[_0x19af62(0x172)][_0x19af62(0x162)]||_0x4759a4,_0xf3db1['service'][_0x19af62(0x1ad)]?'\x20\x20'+_0xf3db1[_0x19af62(0x172)][_0x19af62(0x1ad)]:'','',_0x19af62(0x18e),..._0xf3db1[_0x19af62(0x1a8)]['map'](_0x352e77=>{const _0x40cf1a=_0x19af62,_0x2990e8=_0x352e77[_0x40cf1a(0x19b)][_0x40cf1a(0x19a)](0x1)[_0x40cf1a(0x18c)]('\x20'),_0x4a6e76=_0x352e77[_0x40cf1a(0x173)]===_0x40cf1a(0x170)?'':'\x20['+_0x352e77[_0x40cf1a(0x173)]+']';return'\x20\x20'+_0x2990e8[_0x40cf1a(0x14f)](0x18)+'\x20'+(_0x352e77[_0x40cf1a(0x1ad)]||'')+_0x4a6e76;}),'',_0x19af62(0x181)+CLI_BIN_NAME+_0x19af62(0x1a6)+_0x4759a4+_0x19af62(0x1a7)][_0x19af62(0x179)](Boolean);return _0x572408['join']('\x0a');}export function listDynamicServiceEntries(){const _0x3fd618=a39_0x2190;return listLocalServices()[_0x3fd618(0x18d)](_0x28626b=>{const _0x4a12fc=_0x3fd618,_0x245427=_0x28626b['normalizedManifest'];return{'service':_0x245427[_0x4a12fc(0x172)]['code'],'label':_0x245427[_0x4a12fc(0x172)][_0x4a12fc(0x162)]||_0x245427[_0x4a12fc(0x172)]['code'],'commands':_0x245427[_0x4a12fc(0x1a8)][_0x4a12fc(0x18d)](_0x4df866=>({'command':dynamicCommandName(_0x4df866),'description':_0x4df866['description']||_0x4a12fc(0x148)+_0x4df866[_0x4a12fc(0x195)],'tag':riskTag(_0x4df866['risk'])}))};});}export function getDynamicServiceEntry(_0x33f68f){const _0x25037a=a39_0x2190;return listDynamicServiceEntries()['find'](_0x3b364a=>_0x3b364a[_0x25037a(0x172)]===_0x33f68f);}export function listDynamicServiceDefinitions(_0x4bb146){const _0x52da2a=a39_0x2190;return listLocalServiceTrees()[_0x52da2a(0x179)](_0x138436=>!_0x4bb146||_0x138436[_0x52da2a(0x172)][_0x52da2a(0x19f)]===_0x4bb146)['flatMap'](_0x450b60=>_0x450b60[_0x52da2a(0x1a8)]['map'](_0x3a7ed9=>buildDynamicCommandDefinition(_0x450b60,_0x3a7ed9)));}export function getDynamicServiceDefinitions(_0x393cab){const _0x431e8b=a39_0x2190,_0x738b3d=listDynamicServiceDefinitions(_0x393cab);return _0x738b3d[_0x431e8b(0x1a2)]>0x0?_0x738b3d:undefined;}export function findDynamicServiceDefinition(_0x1164de,_0x5edbb4){const _0x2b4d4f=a39_0x2190;return listDynamicServiceDefinitions(_0x1164de)[_0x2b4d4f(0x18b)](_0x2dfd54=>_0x2dfd54['command']===_0x5edbb4);}export function buildDynamicCommandDefinition(_0x1ad484,_0x127bf7){const _0x4c0d59=a39_0x2190;return{'service':_0x1ad484[_0x4c0d59(0x172)]['code'],'command':dynamicCommandName(_0x127bf7),'description':_0x127bf7[_0x4c0d59(0x1ad)]||'Run\x20service\x20command\x20'+_0x127bf7[_0x4c0d59(0x195)],'risk':_0x127bf7[_0x4c0d59(0x173)],..._0x127bf7['risk']===_0x4c0d59(0x170)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x127bf7)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x127bf7['args']['map'](_0x2d74bf=>({'name':_0x2d74bf[_0x4c0d59(0x162)],'description':_0x2d74bf['description']||_0x2d74bf[_0x4c0d59(0x162)],'required':_0x2d74bf[_0x4c0d59(0x165)]})),'flags':_0x127bf7[_0x4c0d59(0x184)][_0x4c0d59(0x18d)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x127bf7),async 'dryRun'(_0x5122f4){const _0x41bcfa=_0x4c0d59,_0x381e7d=await compilePlan(_0x127bf7,_0x5122f4);return{'method':'SERVICE_TREE','url':_0x127bf7[_0x41bcfa(0x195)],'body':{'target':targetPreview(_0x381e7d),'params':_0x381e7d[_0x41bcfa(0x190)]},'description':_0x41bcfa(0x199)+_0x127bf7[_0x41bcfa(0x195)]};},async 'execute'(_0x174b99){const _0x5ac65d=_0x4c0d59,_0x1f7862=await compilePlan(_0x127bf7,_0x174b99),_0x29bb70=Date[_0x5ac65d(0x193)](),_0x545102=await executePlan(_0x1f7862,_0x127bf7,_0x174b99),_0xbf26c8=Date[_0x5ac65d(0x193)]()-_0x29bb70;return{'ok':!![],'data':{'service':_0x1ad484[_0x5ac65d(0x172)],'command':_0x127bf7[_0x5ac65d(0x195)],'target':targetPreview(_0x1f7862),'result':_0x545102,'elapsed':_0xbf26c8},'message':'Service\x20command\x20'+_0x127bf7['cliPath']+_0x5ac65d(0x176)+_0xbf26c8+'ms'};}};}function buildDynamicConfirmationDescription(_0x134e4c){const _0x30c84b=a39_0x2190,_0x358065=_0x134e4c[_0x30c84b(0x1ad)]||_0x134e4c[_0x30c84b(0x195)],_0xc3bc02=_0x134e4c[_0x30c84b(0x173)]==='high-risk-write'?_0x30c84b(0x1ac):_0x30c84b(0x152);return _0x30c84b(0x161)+_0x358065+'”。'+_0xc3bc02;}function dynamicCommandName(_0x29ab24){const _0x27fab9=a39_0x2190;return _0x29ab24[_0x27fab9(0x19b)][_0x27fab9(0x19a)](0x1)[_0x27fab9(0x18c)]('\x20');}function a39_0x2190(_0x1fbd29,_0x379c31){_0x1fbd29=_0x1fbd29-0x147;const _0x29f5ac=a39_0x29f5();let _0x2190c7=_0x29f5ac[_0x1fbd29];return _0x2190c7;}function riskTag(_0x484932){const _0x1601c2=a39_0x2190;return _0x484932===_0x1601c2(0x170)?'':_0x1601c2(0x159)+_0x484932+']';}function flagToCommandFlag(_0x4d6df2){const _0x18093b=a39_0x2190;return{'name':_0x4d6df2[_0x18093b(0x15f)],'type':_0x4d6df2[_0x18093b(0x1aa)]===_0x18093b(0x16d)?'string':_0x4d6df2[_0x18093b(0x1aa)],'description':_0x4d6df2[_0x18093b(0x1ad)]||_0x4d6df2['name'],'required':_0x4d6df2[_0x18093b(0x165)],'default':isPrimitiveFlagDefault(_0x4d6df2[_0x18093b(0x15c)])?_0x4d6df2['default']:undefined,'enum':_0x4d6df2[_0x18093b(0x186)]};}async function compilePlan(_0x2fb7b6,_0x524c72){const _0x58279d=a39_0x2190;return compileServiceTreeCommand(_0x2fb7b6,{'flags':_0x524c72[_0x58279d(0x1a1)],'args':_0x524c72[_0x58279d(0x147)],'context':await buildServiceContext(_0x2fb7b6,_0x524c72)});}async function buildServiceContext(_0x28fbba,_0x32e64e){const _0x451723=a39_0x2190,_0x86c90d={'appCode':_0x32e64e['appCode'],'env':_0x32e64e[_0x451723(0x166)],'envName':_0x32e64e['envName']};if(!usesRuntimeContext(_0x28fbba))return _0x86c90d;const _0x14c2c6=await getLoginUserInfo(),_0x396d93=pickFirst(_0x14c2c6['userId'],_0x14c2c6['id']);return{..._0x86c90d,'user':_0x14c2c6,'userId':_0x396d93,'id':_0x14c2c6['id'],'username':pickFirst(_0x14c2c6[_0x451723(0x15d)],_0x14c2c6[_0x451723(0x178)],_0x14c2c6['loginName']),'userName':_0x14c2c6[_0x451723(0x178)],'nickname':pickFirst(_0x14c2c6[_0x451723(0x17b)],_0x14c2c6[_0x451723(0x16e)]),'nickName':_0x14c2c6[_0x451723(0x16e)],'tenantCode':_0x14c2c6[_0x451723(0x17d)],'employeeId':_0x14c2c6['employeeId']};}function a39_0x29f5(){const _0x473311=['\x20requires\x20target.functionName.','\x20->\x20','Use\x20`','3088kLLNdT','fromEntries','flags','mapTo','enum','tree','\x20\x20\x20\x20command:\x20','push','bffCode','find','join','map','Commands:','2806209QVPuAx','params','some','Cannot\x20resolve\x20datatable\x20\x22','now','sqlCode','cliPath','scriptName','target','bffId','Preview\x20dynamic\x20service\x20command:\x20','slice','fullPath','sql','number','env','code','Service\x20command\x20','rawFlags','length','Unsupported\x20service\x20target\x20kind:\x20','6789663KmwPFd','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','\x20service\x20detail\x20--service\x20','`\x20to\x20inspect\x20the\x20manifest.','commands','context.','type','source','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','description','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','\x20\x20SERVICE\x20TREE\x20TARGET','startsWith','args','Run\x20service\x20command\x20','datasetCode','Unknown\x20appRef\x20\x22','146iWiZma','708710zGzTpF','1486518PoAWVK','13796xtjORt','padEnd','string','kind','该命令被清单标记为写入,可能修改业务数据或服务状态。','745600LTCeSc','\x20\x20\x20\x20kind:\x20\x20\x20\x20','datatable','dbtableConfig','\x20<command>\x20[flags]','appBindings','\x20\x20[','appCode','validation','default','username','command','cliName','const','将通过\x20Service\x20Tree\x20执行“','name','\x20\x20\x20\x20datatable:\x20','remainingArgs','required','envName','tableName','\x20\x20\x20\x20functionName:\x20','appRef','app','boolean','trim','json','nickName','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','read','appcode','service','risk','bff','operator','\x20completed\x20in\x20','ctx.','userName','filter','data','nickname','\x20\x20MAP\x20TO','tenantCode','303OrGllF'];a39_0x29f5=function(){return _0x473311;};return a39_0x29f5();}function usesRuntimeContext(_0x1b1d3e){const _0x383c93=a39_0x2190;return _0x1b1d3e[_0x383c93(0x185)][_0x383c93(0x191)](_0x51454a=>typeof _0x51454a[_0x383c93(0x1ab)]===_0x383c93(0x150)&&(_0x51454a[_0x383c93(0x1ab)][_0x383c93(0x1b0)](_0x383c93(0x1a9))||_0x51454a[_0x383c93(0x1ab)][_0x383c93(0x1b0)](_0x383c93(0x177))));}function pickFirst(..._0x7e2e7c){return _0x7e2e7c['find'](_0x4e0a18=>_0x4e0a18!==undefined&&_0x4e0a18!==null);}async function executePlan(_0x474723,_0x1dfc75,_0x1d2a53){const _0x3a6bd7=a39_0x2190;if(_0x474723['kind']===_0x3a6bd7(0x17a)){const _0x4816f3=await resolveDatasetCode(_0x474723,_0x1dfc75,_0x1d2a53);return executeData(_0x4816f3,_0x474723[_0x3a6bd7(0x15e)],_0x474723[_0x3a6bd7(0x190)]);}if(_0x474723[_0x3a6bd7(0x151)]===_0x3a6bd7(0x19c)){if(!_0x474723['sqlCode'])throw CliErrors[_0x3a6bd7(0x15b)]('Service\x20command\x20'+_0x1dfc75['cliPath']+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x474723[_0x3a6bd7(0x194)],normalizeScalarParams(_0x474723['params']));}if(_0x474723['kind']===_0x3a6bd7(0x174)){const _0x1e6e35=_0x474723[_0x3a6bd7(0x196)]||_0x474723[_0x3a6bd7(0x18a)]||(_0x474723[_0x3a6bd7(0x198)]==null?'':String(_0x474723[_0x3a6bd7(0x198)]));if(!_0x1e6e35)throw CliErrors[_0x3a6bd7(0x15b)](_0x3a6bd7(0x1a0)+_0x1dfc75[_0x3a6bd7(0x195)]+_0x3a6bd7(0x17f));return executeSdkBff(_0x1e6e35,_0x474723[_0x3a6bd7(0x190)]);}throw CliErrors['validation'](_0x3a6bd7(0x1a3)+_0x474723[_0x3a6bd7(0x151)]);}async function resolveDatasetCode(_0x2b904a,_0x119e23,_0x4f559b){const _0x3909b8=a39_0x2190;if(_0x2b904a['datasetCode'])return _0x2b904a['datasetCode'];if(!_0x2b904a['datatable'])throw CliErrors[_0x3909b8(0x15b)](_0x3909b8(0x1a0)+_0x119e23[_0x3909b8(0x195)]+_0x3909b8(0x1ae));const _0x62302=await listDatasets(_0x4f559b['appCode']),_0x4467aa=_0x62302[_0x3909b8(0x18b)](_0x492cc1=>_0x492cc1[_0x3909b8(0x156)]?.[_0x3909b8(0x167)]===_0x2b904a[_0x3909b8(0x155)]);if(!_0x4467aa?.[_0x3909b8(0x19f)])throw CliErrors['validation'](_0x3909b8(0x192)+_0x2b904a[_0x3909b8(0x155)]+_0x3909b8(0x16f)+_0x4f559b[_0x3909b8(0x15a)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x4467aa[_0x3909b8(0x19f)];}function applyAppBinding(_0x49a2d6,_0x3ddb85,_0x34d690){const _0x3c88b4=a39_0x2190,_0x1f69af=_0x3ddb85[_0x3c88b4(0x197)][_0x3c88b4(0x169)];if(!_0x1f69af)return;const _0x45b23b=_0x49a2d6[_0x3c88b4(0x158)][_0x1f69af];if(!_0x45b23b)throw CliErrors[_0x3c88b4(0x15b)](_0x3c88b4(0x14a)+_0x1f69af+'\x22\x20in\x20service\x20command\x20'+_0x3ddb85[_0x3c88b4(0x195)]+'.',_0x3c88b4(0x1a5));const _0x47d1ab=_0x45b23b[_0x3c88b4(0x171)]||_0x45b23b[_0x3c88b4(0x15a)];_0x47d1ab&&!hasText(_0x34d690['appcode'])&&(_0x34d690[_0x3c88b4(0x171)]=_0x47d1ab),_0x45b23b[_0x3c88b4(0x16a)]&&!hasText(_0x34d690[_0x3c88b4(0x16a)])&&!hasText(_0x34d690['appcode'])&&(_0x34d690[_0x3c88b4(0x16a)]=_0x45b23b[_0x3c88b4(0x16a)]),_0x45b23b['env']&&!hasText(_0x34d690[_0x3c88b4(0x19e)])&&(_0x34d690['env']=_0x45b23b[_0x3c88b4(0x19e)]);}function renderDynamicCommandHelp(_0x19a86b){const _0x3c5de8=a39_0x2190,_0x2bf22c=[_0x3c5de8(0x1af),_0x3c5de8(0x154)+_0x19a86b[_0x3c5de8(0x197)][_0x3c5de8(0x151)],_0x3c5de8(0x188)+_0x19a86b['target'][_0x3c5de8(0x15e)]];if(_0x19a86b['target'][_0x3c5de8(0x149)])_0x2bf22c[_0x3c5de8(0x189)]('\x20\x20\x20\x20datasetCode:\x20'+_0x19a86b[_0x3c5de8(0x197)][_0x3c5de8(0x149)]);if(_0x19a86b['target'][_0x3c5de8(0x155)])_0x2bf22c[_0x3c5de8(0x189)](_0x3c5de8(0x163)+_0x19a86b[_0x3c5de8(0x197)][_0x3c5de8(0x155)]);if(_0x19a86b[_0x3c5de8(0x197)]['sqlCode'])_0x2bf22c[_0x3c5de8(0x189)]('\x20\x20\x20\x20sqlCode:\x20'+_0x19a86b[_0x3c5de8(0x197)][_0x3c5de8(0x194)]);if(_0x19a86b[_0x3c5de8(0x197)]['scriptName'])_0x2bf22c['push'](_0x3c5de8(0x168)+_0x19a86b[_0x3c5de8(0x197)][_0x3c5de8(0x196)]);if(_0x19a86b[_0x3c5de8(0x185)][_0x3c5de8(0x1a2)]>0x0){_0x2bf22c['push']('',_0x3c5de8(0x17c));for(const _0x4a3836 of _0x19a86b[_0x3c5de8(0x185)]){_0x2bf22c['push']('\x20\x20\x20\x20'+(_0x4a3836['source']||_0x3c5de8(0x160))+_0x3c5de8(0x180)+_0x4a3836[_0x3c5de8(0x197)]+(_0x4a3836[_0x3c5de8(0x175)]?'.'+_0x4a3836[_0x3c5de8(0x175)]:''));}}return _0x2bf22c[_0x3c5de8(0x18c)]('\x0a');}function targetPreview(_0x330077){const _0x15bf50=a39_0x2190;return{'kind':_0x330077[_0x15bf50(0x151)],'command':_0x330077[_0x15bf50(0x15e)],'appRef':_0x330077[_0x15bf50(0x169)],'datasetCode':_0x330077[_0x15bf50(0x149)],'datatable':_0x330077['datatable'],'sqlCode':_0x330077[_0x15bf50(0x194)],'bffCode':_0x330077['bffCode'],'bffId':_0x330077['bffId'],'functionName':_0x330077[_0x15bf50(0x196)]};}function normalizeScalarParams(_0xbc3ac9){const _0x46ea46=a39_0x2190;return Object[_0x46ea46(0x183)](Object['entries'](_0xbc3ac9)[_0x46ea46(0x179)](([,_0x33f968])=>typeof _0x33f968===_0x46ea46(0x150)||typeof _0x33f968===_0x46ea46(0x19d)));}function hasText(_0x2d947d){const _0x1d2c8b=a39_0x2190;return typeof _0x2d947d===_0x1d2c8b(0x150)&&_0x2d947d[_0x1d2c8b(0x16c)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x46d586){const _0x1e77c5=a39_0x2190;return _0x46d586===undefined||typeof _0x46d586===_0x1e77c5(0x150)||typeof _0x46d586===_0x1e77c5(0x19d)||typeof _0x46d586===_0x1e77c5(0x16b);}
@@ -1 +1 @@
1
- (function(_0x4c3011,_0x5aef32){const _0x180e65=a40_0x491d,_0x3edc85=_0x4c3011();while(!![]){try{const _0x56f233=-parseInt(_0x180e65(0x14f))/0x1+parseInt(_0x180e65(0x13d))/0x2+parseInt(_0x180e65(0x150))/0x3*(parseInt(_0x180e65(0x13b))/0x4)+-parseInt(_0x180e65(0x151))/0x5+-parseInt(_0x180e65(0x144))/0x6*(-parseInt(_0x180e65(0x131))/0x7)+-parseInt(_0x180e65(0x145))/0x8*(-parseInt(_0x180e65(0x138))/0x9)+parseInt(_0x180e65(0x14b))/0xa*(-parseInt(_0x180e65(0x147))/0xb);if(_0x56f233===_0x5aef32)break;else _0x3edc85['push'](_0x3edc85['shift']());}catch(_0x5d2da7){_0x3edc85['push'](_0x3edc85['shift']());}}}(a40_0x43b1,0x8fb11));export function adaptServiceTreeManifestForLegacyFramework(_0x53efbc){const _0x2ef3d0=a40_0x491d,_0x35758d=cloneJsonValue(_0x53efbc),_0x177e69=[];if(!isObjectRecord(_0x35758d))return{'manifest':_0x35758d,'errors':_0x177e69};return Array[_0x2ef3d0(0x153)](_0x35758d['commands'])&&_0x35758d[_0x2ef3d0(0x12e)][_0x2ef3d0(0x152)]((_0x395e33,_0x3f276e)=>{const _0x45add7=_0x2ef3d0;if(!isObjectRecord(_0x395e33))return;adaptBffTarget(_0x395e33[_0x45add7(0x141)],_0x45add7(0x137)+_0x3f276e+_0x45add7(0x13c),_0x177e69);}),adaptResources(_0x35758d[_0x2ef3d0(0x14e)],'$.resources',_0x177e69),{'manifest':_0x35758d,'errors':_0x177e69};}export function toPublicServiceTreeTarget(_0x16ba31){const _0x52d5f7=a40_0x491d,{scriptName:_0x264b31,..._0x4e8998}=_0x16ba31;return typeof _0x264b31===_0x52d5f7(0x130)&&_0x264b31[_0x52d5f7(0x148)]()&&(_0x4e8998[_0x52d5f7(0x13f)]=_0x264b31),_0x4e8998;}function a40_0x491d(_0x2f0171,_0x386619){_0x2f0171=_0x2f0171-0x12e;const _0x43b12e=a40_0x43b1();let _0x491dd4=_0x43b12e[_0x2f0171];return _0x491dd4;}export function toPublicNormalizedServiceTree(_0x548b82){const _0x2c0b30=a40_0x491d;return{..._0x548b82,'commands':_0x548b82['commands']['map'](_0x3f870f=>({..._0x3f870f,'target':toPublicServiceTreeTarget(_0x3f870f[_0x2c0b30(0x141)])}))};}function adaptResources(_0x439a06,_0x15a7a3,_0x553b08){const _0x3b80c1=a40_0x491d;if(!isObjectRecord(_0x439a06))return;for(const [_0xa5c898,_0x288601]of Object[_0x3b80c1(0x154)](_0x439a06)){if(!isObjectRecord(_0x288601))continue;const _0x3bf360=_0x15a7a3+'.'+_0xa5c898;if(isObjectRecord(_0x288601[_0x3b80c1(0x139)]))for(const [_0x4ac197,_0x32170a]of Object['entries'](_0x288601[_0x3b80c1(0x139)])){if(!isObjectRecord(_0x32170a))continue;const _0x22320b=_0x3bf360+'.actions.'+_0x4ac197,_0x523a11=isObjectRecord(_0x32170a['target'])&&_0x32170a[_0x3b80c1(0x141)][_0x3b80c1(0x136)]===_0x3b80c1(0x143);adaptBffTarget(_0x32170a['target'],_0x22320b+'.target',_0x553b08),(_0x523a11||isBffAction(_0x32170a))&&adaptFunctionNameField(_0x32170a,_0x22320b,_0x553b08);}adaptResources(_0x288601['resources'],_0x3bf360+_0x3b80c1(0x142),_0x553b08);}}function adaptBffTarget(_0x36ac1b,_0x461097,_0x38fd67){const _0x56548c=a40_0x491d;if(!isObjectRecord(_0x36ac1b)||_0x36ac1b[_0x56548c(0x136)]!==_0x56548c(0x143))return;adaptFunctionNameField(_0x36ac1b,_0x461097,_0x38fd67);}function adaptFunctionNameField(_0x11ca32,_0x57815f,_0x14a111){const _0x568869=a40_0x491d;Object['prototype'][_0x568869(0x134)][_0x568869(0x12f)](_0x11ca32,'scriptName')&&_0x14a111[_0x568869(0x13e)]({'level':_0x568869(0x146),'path':_0x57815f+'.scriptName','message':_0x568869(0x140)});if(Object[_0x568869(0x14a)][_0x568869(0x134)]['call'](_0x11ca32,_0x568869(0x13f))){if(typeof _0x11ca32[_0x568869(0x13f)]!==_0x568869(0x130)||!_0x11ca32['functionName']['trim']()){_0x14a111['push']({'level':'error','path':_0x57815f+_0x568869(0x133),'message':_0x568869(0x132)}),delete _0x11ca32[_0x568869(0x13f)];return;}_0x11ca32[_0x568869(0x149)]=_0x11ca32['functionName'],delete _0x11ca32[_0x568869(0x13f)];}}function a40_0x43b1(){const _0x4c4c32=['246296KDiKxT','error','517KiyVQf','trim','scriptName','prototype','194630uTXjhl','action','bff.exec','resources','887726qJjlqR','3qCmqoL','1781375wAHnup','forEach','isArray','entries','commands','call','string','7bDclUf','functionName\x20must\x20be\x20a\x20non-empty\x20string.','.functionName','hasOwnProperty','map','kind','$.commands[','63FYDyfQ','actions','fromEntries','2246416czFwoh','].target','1775414KMNSvo','push','functionName','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','target','.resources','bff','6495018galpgf'];a40_0x43b1=function(){return _0x4c4c32;};return a40_0x43b1();}function isBffAction(_0x599ddf){const _0xfdc6ec=a40_0x491d;return _0x599ddf[_0xfdc6ec(0x136)]===_0xfdc6ec(0x143)||_0x599ddf[_0xfdc6ec(0x14c)]===_0xfdc6ec(0x14d)||_0x599ddf['target']===_0xfdc6ec(0x14d);}function cloneJsonValue(_0x5d7071){const _0x51c81e=a40_0x491d;if(Array[_0x51c81e(0x153)](_0x5d7071))return _0x5d7071[_0x51c81e(0x135)](_0x28820f=>cloneJsonValue(_0x28820f));if(isObjectRecord(_0x5d7071))return Object[_0x51c81e(0x13a)](Object[_0x51c81e(0x154)](_0x5d7071)[_0x51c81e(0x135)](([_0x28764e,_0x4af849])=>[_0x28764e,cloneJsonValue(_0x4af849)]));return _0x5d7071;}function isObjectRecord(_0x28fa44){const _0x4f00d6=a40_0x491d;return Boolean(_0x28fa44)&&typeof _0x28fa44==='object'&&!Array[_0x4f00d6(0x153)](_0x28fa44);}
1
+ (function(_0x168b9f,_0x13f83b){const _0x56bf32=a40_0x5aa2,_0x458c17=_0x168b9f();while(!![]){try{const _0x284a7d=parseInt(_0x56bf32(0x82))/0x1+parseInt(_0x56bf32(0x6f))/0x2+parseInt(_0x56bf32(0x80))/0x3*(parseInt(_0x56bf32(0x78))/0x4)+-parseInt(_0x56bf32(0x7a))/0x5+-parseInt(_0x56bf32(0x88))/0x6+parseInt(_0x56bf32(0x74))/0x7+-parseInt(_0x56bf32(0x8b))/0x8;if(_0x284a7d===_0x13f83b)break;else _0x458c17['push'](_0x458c17['shift']());}catch(_0x26789e){_0x458c17['push'](_0x458c17['shift']());}}}(a40_0x2d4b,0xb581d));export function adaptServiceTreeManifestForLegacyFramework(_0x5b6beb){const _0x2d77a1=a40_0x5aa2,_0x10b343=cloneJsonValue(_0x5b6beb),_0x28833a=[];if(!isObjectRecord(_0x10b343))return{'manifest':_0x10b343,'errors':_0x28833a};return Array[_0x2d77a1(0x84)](_0x10b343[_0x2d77a1(0x81)])&&_0x10b343['commands'][_0x2d77a1(0x73)]((_0xad64f4,_0x24084d)=>{const _0x5db6e4=_0x2d77a1;if(!isObjectRecord(_0xad64f4))return;adaptBffTarget(_0xad64f4[_0x5db6e4(0x8f)],_0x5db6e4(0x92)+_0x24084d+_0x5db6e4(0x8c),_0x28833a);}),adaptResources(_0x10b343[_0x2d77a1(0x8d)],_0x2d77a1(0x7d),_0x28833a),{'manifest':_0x10b343,'errors':_0x28833a};}export function toPublicServiceTreeTarget(_0x5dd03b){const _0x318086=a40_0x5aa2,{scriptName:_0x413987,..._0x497e51}=_0x5dd03b;return typeof _0x413987===_0x318086(0x83)&&_0x413987[_0x318086(0x85)]()&&(_0x497e51[_0x318086(0x7c)]=_0x413987),_0x497e51;}export function toPublicNormalizedServiceTree(_0x19e883){const _0x52e33f=a40_0x5aa2;return{..._0x19e883,'commands':_0x19e883[_0x52e33f(0x81)][_0x52e33f(0x89)](_0x59e779=>({..._0x59e779,'target':toPublicServiceTreeTarget(_0x59e779[_0x52e33f(0x8f)])}))};}function adaptResources(_0x5814ae,_0xf64dba,_0x30cb5f){const _0x376c0b=a40_0x5aa2;if(!isObjectRecord(_0x5814ae))return;for(const [_0x2be88c,_0x2240f9]of Object['entries'](_0x5814ae)){if(!isObjectRecord(_0x2240f9))continue;const _0x5d86a2=_0xf64dba+'.'+_0x2be88c;if(isObjectRecord(_0x2240f9['actions']))for(const [_0x25358a,_0x15ac45]of Object['entries'](_0x2240f9[_0x376c0b(0x6e)])){if(!isObjectRecord(_0x15ac45))continue;const _0x1edd10=_0x5d86a2+_0x376c0b(0x91)+_0x25358a,_0x1230f4=isObjectRecord(_0x15ac45['target'])&&_0x15ac45[_0x376c0b(0x8f)][_0x376c0b(0x8a)]===_0x376c0b(0x70);adaptBffTarget(_0x15ac45[_0x376c0b(0x8f)],_0x1edd10+_0x376c0b(0x77),_0x30cb5f),(_0x1230f4||isBffAction(_0x15ac45))&&adaptFunctionNameField(_0x15ac45,_0x1edd10,_0x30cb5f);}adaptResources(_0x2240f9['resources'],_0x5d86a2+_0x376c0b(0x7f),_0x30cb5f);}}function adaptBffTarget(_0x56dc47,_0x5e0b25,_0x132cc9){const _0x10a7dc=a40_0x5aa2;if(!isObjectRecord(_0x56dc47)||_0x56dc47[_0x10a7dc(0x8a)]!==_0x10a7dc(0x70))return;adaptFunctionNameField(_0x56dc47,_0x5e0b25,_0x132cc9);}function a40_0x5aa2(_0x1ce88b,_0x13769a){_0x1ce88b=_0x1ce88b-0x6e;const _0x2d4b55=a40_0x2d4b();let _0x5aa266=_0x2d4b55[_0x1ce88b];return _0x5aa266;}function a40_0x2d4b(){const _0x2fa555=['map','kind','3620440DCqmDN','].target','resources','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','target','push','.actions.','$.commands[','actions','297106BlHmDD','bff','call','.scriptName','forEach','2066589TwgOLk','scriptName','action','.target','60ZEaOaB','bff.exec','595990kxDvUk','entries','functionName','$.resources','functionName\x20must\x20be\x20a\x20non-empty\x20string.','.resources','251001mMEexw','commands','169527JlAUjq','string','isArray','trim','error','prototype','3318636StmkRI'];a40_0x2d4b=function(){return _0x2fa555;};return a40_0x2d4b();}function adaptFunctionNameField(_0x21d09b,_0x5b6716,_0x525a8f){const _0x1ee6a3=a40_0x5aa2;Object[_0x1ee6a3(0x87)]['hasOwnProperty'][_0x1ee6a3(0x71)](_0x21d09b,_0x1ee6a3(0x75))&&_0x525a8f[_0x1ee6a3(0x90)]({'level':_0x1ee6a3(0x86),'path':_0x5b6716+_0x1ee6a3(0x72),'message':_0x1ee6a3(0x8e)});if(Object['prototype']['hasOwnProperty']['call'](_0x21d09b,_0x1ee6a3(0x7c))){if(typeof _0x21d09b['functionName']!==_0x1ee6a3(0x83)||!_0x21d09b[_0x1ee6a3(0x7c)][_0x1ee6a3(0x85)]()){_0x525a8f[_0x1ee6a3(0x90)]({'level':'error','path':_0x5b6716+'.functionName','message':_0x1ee6a3(0x7e)}),delete _0x21d09b['functionName'];return;}_0x21d09b[_0x1ee6a3(0x75)]=_0x21d09b[_0x1ee6a3(0x7c)],delete _0x21d09b[_0x1ee6a3(0x7c)];}}function isBffAction(_0x102549){const _0x5af158=a40_0x5aa2;return _0x102549['kind']==='bff'||_0x102549[_0x5af158(0x76)]===_0x5af158(0x79)||_0x102549[_0x5af158(0x8f)]===_0x5af158(0x79);}function cloneJsonValue(_0x29ad12){const _0x388dec=a40_0x5aa2;if(Array['isArray'](_0x29ad12))return _0x29ad12[_0x388dec(0x89)](_0x146eb2=>cloneJsonValue(_0x146eb2));if(isObjectRecord(_0x29ad12))return Object['fromEntries'](Object[_0x388dec(0x7b)](_0x29ad12)[_0x388dec(0x89)](([_0x224dd3,_0x1eb487])=>[_0x224dd3,cloneJsonValue(_0x1eb487)]));return _0x29ad12;}function isObjectRecord(_0x136887){return Boolean(_0x136887)&&typeof _0x136887==='object'&&!Array['isArray'](_0x136887);}
@@ -1 +1 @@
1
- function a41_0x5ae8(_0x510e66,_0x28c91b){_0x510e66=_0x510e66-0xe6;const _0x328dea=a41_0x328d();let _0x5ae809=_0x328dea[_0x510e66];return _0x5ae809;}const a41_0x40692f=a41_0x5ae8;(function(_0x45cae6,_0x54c7be){const _0x78c968=a41_0x5ae8,_0x5e1626=_0x45cae6();while(!![]){try{const _0xf9d760=parseInt(_0x78c968(0x117))/0x1+parseInt(_0x78c968(0x11e))/0x2+-parseInt(_0x78c968(0x12c))/0x3*(-parseInt(_0x78c968(0x10d))/0x4)+-parseInt(_0x78c968(0xf7))/0x5+parseInt(_0x78c968(0x10c))/0x6+parseInt(_0x78c968(0x11a))/0x7+-parseInt(_0x78c968(0xe7))/0x8*(parseInt(_0x78c968(0x11c))/0x9);if(_0xf9d760===_0x54c7be)break;else _0x5e1626['push'](_0x5e1626['shift']());}catch(_0x2c1e8a){_0x5e1626['push'](_0x5e1626['shift']());}}}(a41_0x328d,0xf08b3));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a41_0x328d(){const _0x1549ae=['risk','registryPath','9128915SnTgCx','entry','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','import','hash','commands','Service\x20manifest\x20validation\x20passed.','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','name','write','cliName','flags','Imported','list','target','str','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','filePath','Service\x20registry\x20validation\x20passed.','validate','\x20service(s).','10954512eMSsuO','844108QWrAAh','Imported\x20','remove','Service\x20Tree\x20manifest\x20file\x20path','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','Local\x20service\x20not\x20found:\x20','cliPath','updated','manifests','1461410GQJbIc','Exported\x20service\x20','\x20service\x20','8494654ExNNjN','serviceCount','4333482qrbEne','report','1976654Zguyyr','Updated','registry','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','registryServiceCode','entries','source','normalizedManifest','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','type','WRITE','importedAt','read','将\x20Service\x20Tree\x20清单导入本地运行态注册表','3VnTjgM','kind','description','map','export','length','warnings','detail','errors','48WbrBdO','string','serviceCode','reduce','lower\x20kebab-case\x20service\x20code','version','\x20service(s),\x20updated\x20','replaced','manifest','service','file','imported','从本地运行态注册表移除\x20Service\x20Tree\x20清单','registryIndex'];a41_0x328d=function(){return _0x1549ae;};return a41_0x328d();}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a41_0x40692f(0xf1),'type':a41_0x40692f(0xe8),'required':!![],'description':a41_0x40692f(0x110)},SERVICE_FLAG={'name':a41_0x40692f(0xf0),'type':'string','required':!![],'description':'Local\x20service\x20code,\x20for\x20example\x20crm','pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x40692f(0xeb)}};function summarizeService(_0x1171e7){const _0x26e121=a41_0x40692f;return{'serviceCode':_0x1171e7['serviceCode'],'name':_0x1171e7[_0x26e121(0x125)][_0x26e121(0xf0)][_0x26e121(0xff)],'version':_0x1171e7['version'],'importedAt':_0x1171e7[_0x26e121(0x129)],'source':_0x1171e7['source'],'commandCount':_0x1171e7[_0x26e121(0x125)][_0x26e121(0xfc)][_0x26e121(0x131)],'commands':_0x1171e7['normalizedManifest'][_0x26e121(0xfc)]['map'](_0x33b798=>({'path':_0x33b798[_0x26e121(0x114)],'description':_0x33b798[_0x26e121(0x12e)],'risk':_0x33b798[_0x26e121(0xf5)],'target':toPublicServiceTreeTarget(_0x33b798[_0x26e121(0x105)]),'flags':_0x33b798[_0x26e121(0x102)][_0x26e121(0x12f)](_0x699d72=>({'name':_0x699d72['name'],'cliName':_0x699d72[_0x26e121(0x101)],'type':_0x699d72[_0x26e121(0x127)],'required':_0x699d72['required']===!![]}))}))};}function summarizeLoadedManifest(_0x5f336f){const _0x4ea216=a41_0x40692f;return{'service':_0x5f336f[_0x4ea216(0x125)]?.[_0x4ea216(0xf0)],'version':_0x5f336f[_0x4ea216(0x125)]?.[_0x4ea216(0xec)],'commandCount':_0x5f336f[_0x4ea216(0x125)]?.['commands'][_0x4ea216(0x131)]??0x0,'commands':_0x5f336f[_0x4ea216(0x125)]?.[_0x4ea216(0xfc)][_0x4ea216(0x12f)](_0xcf2598=>({'path':_0xcf2598[_0x4ea216(0x114)],'risk':_0xcf2598[_0x4ea216(0xf5)],'target':toPublicServiceTreeTarget(_0xcf2598[_0x4ea216(0x105)])}))??[],'registryIndex':_0x5f336f[_0x4ea216(0xf4)],'registryServiceCode':_0x5f336f[_0x4ea216(0x122)],'errors':_0x5f336f['report'][_0x4ea216(0xe6)],'warnings':_0x5f336f[_0x4ea216(0x11d)][_0x4ea216(0x132)]};}export const serviceDefinitions=[{'service':a41_0x40692f(0xf0),'command':a41_0x40692f(0x10a),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a41_0x40692f(0x12a),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x18de77){const _0x23e37a=a41_0x40692f,_0x56e070=loadServiceManifestFromFile(_0x18de77['str'](_0x23e37a(0xf1)));if(!_0x56e070[_0x23e37a(0x11d)]['ok'])return{'ok':![],'data':{'file':_0x56e070[_0x23e37a(0x108)],'hash':_0x56e070[_0x23e37a(0xfb)],'kind':_0x56e070[_0x23e37a(0x12d)],'serviceCount':_0x56e070[_0x23e37a(0x116)]['length'],'services':_0x56e070[_0x23e37a(0x116)][_0x23e37a(0x12f)](summarizeLoadedManifest),'errors':_0x56e070[_0x23e37a(0x11d)]['errors'],'warnings':_0x56e070['report']['warnings']},'message':formatValidationFailure(_0x56e070[_0x23e37a(0x11d)])};if(_0x56e070[_0x23e37a(0x12d)]===_0x23e37a(0x120)||_0x56e070[_0x23e37a(0x116)]['length']!==0x1)return{'ok':!![],'data':{'file':_0x56e070[_0x23e37a(0x108)],'hash':_0x56e070[_0x23e37a(0xfb)],'kind':_0x56e070[_0x23e37a(0x12d)],'serviceCount':_0x56e070['manifests'][_0x23e37a(0x131)],'commandCount':_0x56e070['manifests'][_0x23e37a(0xea)]((_0x5f9c56,_0x28798a)=>_0x5f9c56+(_0x28798a[_0x23e37a(0x125)]?.['commands']['length']??0x0),0x0),'services':_0x56e070[_0x23e37a(0x116)][_0x23e37a(0x12f)](summarizeLoadedManifest),'warnings':_0x56e070[_0x23e37a(0x11d)][_0x23e37a(0x132)]},'message':_0x23e37a(0x109)};return{'ok':!![],'data':{'file':_0x56e070[_0x23e37a(0x108)],'hash':_0x56e070[_0x23e37a(0xfb)],'kind':_0x56e070[_0x23e37a(0x12d)],'service':_0x56e070[_0x23e37a(0x125)]?.[_0x23e37a(0xf0)],'version':_0x56e070[_0x23e37a(0x125)]?.['version'],'commandCount':_0x56e070[_0x23e37a(0x125)]?.[_0x23e37a(0xfc)]['length']??0x0,'commands':_0x56e070['normalizedManifest']?.[_0x23e37a(0xfc)][_0x23e37a(0x12f)](_0x10d789=>({'path':_0x10d789['cliPath'],'risk':_0x10d789['risk'],'target':toPublicServiceTreeTarget(_0x10d789['target'])})),'warnings':_0x56e070['report']['warnings']},'message':_0x23e37a(0xfd)};}},{'service':'service','command':a41_0x40692f(0xfa),'description':a41_0x40692f(0x12b),'risk':a41_0x40692f(0x100),'confirmationDescription':'将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x266c79){const _0x10b227=a41_0x40692f,_0x263b44=loadServiceManifestFromFile(_0x266c79[_0x10b227(0x106)](_0x10b227(0xf1)));return{'method':_0x10b227(0x128),'url':getServiceRegistryPath(),'body':{'file':_0x263b44[_0x10b227(0x108)],'hash':_0x263b44[_0x10b227(0xfb)],'kind':_0x263b44[_0x10b227(0x12d)],'ok':_0x263b44[_0x10b227(0x11d)]['ok'],'service':_0x263b44['normalizedManifest']?.[_0x10b227(0xf0)],'version':_0x263b44[_0x10b227(0x125)]?.['version'],'serviceCount':_0x263b44[_0x10b227(0x116)]['length'],'services':_0x263b44[_0x10b227(0x116)][_0x10b227(0x12f)](_0x265bff=>({'service':_0x265bff['normalizedManifest']?.[_0x10b227(0xf0)],'version':_0x265bff[_0x10b227(0x125)]?.['version'],'commandCount':_0x265bff[_0x10b227(0x125)]?.[_0x10b227(0xfc)]['length']??0x0,'errors':_0x265bff[_0x10b227(0x11d)][_0x10b227(0xe6)]})),'errors':_0x263b44[_0x10b227(0x11d)][_0x10b227(0xe6)],'commandCount':_0x263b44[_0x10b227(0x125)]?.['commands'][_0x10b227(0x131)]??0x0},'description':_0x10b227(0x107)};},async 'execute'(_0x304b55){const _0x5c9ed1=a41_0x40692f,_0x4f2e17=importServiceManifest(_0x304b55[_0x5c9ed1(0x106)](_0x5c9ed1(0xf1)));if(_0x4f2e17[_0x5c9ed1(0x123)][_0x5c9ed1(0x131)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x4f2e17[_0x5c9ed1(0xf6)],'imported':_0x4f2e17[_0x5c9ed1(0xf2)],'updated':_0x4f2e17['updated'],'serviceCount':_0x4f2e17[_0x5c9ed1(0x11b)],'services':_0x4f2e17[_0x5c9ed1(0x123)]['map'](summarizeService)},'message':_0x5c9ed1(0x10e)+_0x4f2e17[_0x5c9ed1(0xf2)]+_0x5c9ed1(0xed)+_0x4f2e17['updated']+_0x5c9ed1(0x10b)};return{'ok':!![],'data':{'registryPath':_0x4f2e17[_0x5c9ed1(0xf6)],'replaced':_0x4f2e17[_0x5c9ed1(0xee)],'imported':_0x4f2e17[_0x5c9ed1(0xf2)],'updated':_0x4f2e17[_0x5c9ed1(0x115)],'serviceCount':_0x4f2e17[_0x5c9ed1(0x11b)],'service':summarizeService(_0x4f2e17['entry'])},'message':(_0x4f2e17[_0x5c9ed1(0xee)]?_0x5c9ed1(0x11f):_0x5c9ed1(0x103))+_0x5c9ed1(0x119)+_0x4f2e17['entry'][_0x5c9ed1(0xe9)]+'.'};}},{'service':'service','command':a41_0x40692f(0x130),'description':a41_0x40692f(0x111),'risk':a41_0x40692f(0x100),'confirmationDescription':a41_0x40692f(0xf9),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x35a971){const _0x46e318=a41_0x40692f,_0x29a920=getLocalServiceEntry(_0x35a971[_0x46e318(0x106)](_0x46e318(0xf0)));return{'method':_0x46e318(0x128),'url':_0x35a971[_0x46e318(0x106)]('file'),'body':{'service':_0x35a971[_0x46e318(0x106)](_0x46e318(0xf0)),'found':Boolean(_0x29a920),'version':_0x29a920?.[_0x46e318(0xec)],'source':_0x29a920?.[_0x46e318(0x124)]},'description':_0x46e318(0xfe)};},async 'execute'(_0x3ece1c){const _0x3f76af=a41_0x40692f,_0x5bbee5=exportServiceManifest(_0x3ece1c[_0x3f76af(0x106)]('service'),_0x3ece1c[_0x3f76af(0x106)]('file'));return{'ok':!![],'data':{'registryPath':_0x5bbee5['registryPath'],'file':_0x5bbee5[_0x3f76af(0x108)],'service':summarizeService(_0x5bbee5['entry'])},'message':_0x3f76af(0x118)+_0x5bbee5[_0x3f76af(0xf8)][_0x3f76af(0xe9)]+'.'};}},{'service':'service','command':a41_0x40692f(0x104),'description':a41_0x40692f(0x112),'risk':a41_0x40692f(0x12a),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x226dbe=a41_0x40692f,_0x3aaa57=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x3aaa57[_0x226dbe(0x131)],'services':_0x3aaa57[_0x226dbe(0x12f)](summarizeService)}};}},{'service':'service','command':a41_0x40692f(0x10f),'description':a41_0x40692f(0xf3),'risk':'write','confirmationDescription':'将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x3a4695){const _0xfafe71=a41_0x40692f,_0x194644=getLocalServiceEntry(_0x3a4695[_0xfafe71(0x106)](_0xfafe71(0xf0)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x3a4695[_0xfafe71(0x106)]('service'),'found':Boolean(_0x194644),'version':_0x194644?.[_0xfafe71(0xec)],'source':_0x194644?.[_0xfafe71(0x124)]},'description':_0xfafe71(0x121)};},async 'execute'(_0x3be13f){const _0x48eeaf=a41_0x40692f,_0x156cd9=removeServiceManifest(_0x3be13f['str'](_0x48eeaf(0xf0)));return{'ok':!![],'data':{'registryPath':_0x156cd9[_0x48eeaf(0xf6)],'serviceCount':_0x156cd9[_0x48eeaf(0x11b)],'service':summarizeService(_0x156cd9[_0x48eeaf(0xf8)])},'message':'Removed\x20service\x20'+_0x156cd9[_0x48eeaf(0xf8)][_0x48eeaf(0xe9)]+'.'};}},{'service':'service','command':a41_0x40692f(0x133),'description':a41_0x40692f(0x126),'risk':a41_0x40692f(0x12a),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x186cac){const _0x1395a7=a41_0x40692f,_0x25d816=getLocalServiceEntry(_0x186cac[_0x1395a7(0x106)](_0x1395a7(0xf0)));if(!_0x25d816)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x186cac[_0x1395a7(0x106)](_0x1395a7(0xf0))},'message':_0x1395a7(0x113)+_0x186cac[_0x1395a7(0x106)](_0x1395a7(0xf0))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x25d816),'manifest':_0x25d816[_0x1395a7(0xef)],'normalizedManifest':toPublicNormalizedServiceTree(_0x25d816['normalizedManifest'])}};}}];
1
+ const a41_0x3f2c2e=a41_0x3931;(function(_0x589659,_0x32bd6c){const _0x521eee=a41_0x3931,_0x4ed8be=_0x589659();while(!![]){try{const _0x2ec08a=parseInt(_0x521eee(0x7d))/0x1+-parseInt(_0x521eee(0xb4))/0x2*(parseInt(_0x521eee(0x9b))/0x3)+-parseInt(_0x521eee(0x98))/0x4+parseInt(_0x521eee(0xaa))/0x5+-parseInt(_0x521eee(0xb2))/0x6+parseInt(_0x521eee(0x76))/0x7+-parseInt(_0x521eee(0x89))/0x8;if(_0x2ec08a===_0x32bd6c)break;else _0x4ed8be['push'](_0x4ed8be['shift']());}catch(_0x4be5ef){_0x4ed8be['push'](_0x4ed8be['shift']());}}}(a41_0x494e,0xe408c));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a41_0x494e(){const _0x434cc8=['\x20service\x20','452700jHcYBQ','registryServiceCode','4RugxqS','entries','serviceCode','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','str','errors','registryIndex','write','service','cliPath','2206589WEfHrB','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','map','imported','filePath','serviceCount','commands','246731aeTiek','source','read','reduce','kind','manifest','report','validate','required','description','WRITE','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','2115704tkacNs','从本地运行态注册表移除\x20Service\x20Tree\x20清单','cliName','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','detail','target','entry','type','replaced','manifests','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','updated','export','version','将\x20Service\x20Tree\x20清单导入本地运行态注册表','12572oxfecq','Service\x20manifest\x20validation\x20passed.','importedAt','1528971LbuYnw','registryPath','Removed\x20service\x20','risk','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','list','string','Exported\x20service\x20','import','Local\x20service\x20not\x20found:\x20','warnings','registry','flags','hash','Imported\x20','8672200aYSrHt','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','file','normalizedManifest','Updated','length'];a41_0x494e=function(){return _0x434cc8;};return a41_0x494e();}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a41_0x3f2c2e(0xad),'type':a41_0x3f2c2e(0xa1),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a41_0x3f2c2e(0x74),'type':a41_0x3f2c2e(0xa1),'required':!![],'description':'Local\x20service\x20code,\x20for\x20example\x20crm','pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function summarizeService(_0x1816d3){const _0x355527=a41_0x3f2c2e;return{'serviceCode':_0x1816d3[_0x355527(0xb6)],'name':_0x1816d3[_0x355527(0xae)][_0x355527(0x74)]['name'],'version':_0x1816d3[_0x355527(0x96)],'importedAt':_0x1816d3[_0x355527(0x9a)],'source':_0x1816d3[_0x355527(0x7e)],'commandCount':_0x1816d3[_0x355527(0xae)][_0x355527(0x7c)][_0x355527(0xb0)],'commands':_0x1816d3[_0x355527(0xae)][_0x355527(0x7c)][_0x355527(0x78)](_0x4a06ff=>({'path':_0x4a06ff[_0x355527(0x75)],'description':_0x4a06ff[_0x355527(0x86)],'risk':_0x4a06ff[_0x355527(0x9e)],'target':toPublicServiceTreeTarget(_0x4a06ff[_0x355527(0x8e)]),'flags':_0x4a06ff[_0x355527(0xa7)]['map'](_0x16dcb7=>({'name':_0x16dcb7['name'],'cliName':_0x16dcb7[_0x355527(0x8b)],'type':_0x16dcb7[_0x355527(0x90)],'required':_0x16dcb7[_0x355527(0x85)]===!![]}))}))};}function summarizeLoadedManifest(_0x2c829d){const _0x2da0c5=a41_0x3f2c2e;return{'service':_0x2c829d[_0x2da0c5(0xae)]?.[_0x2da0c5(0x74)],'version':_0x2c829d['normalizedManifest']?.[_0x2da0c5(0x96)],'commandCount':_0x2c829d[_0x2da0c5(0xae)]?.[_0x2da0c5(0x7c)][_0x2da0c5(0xb0)]??0x0,'commands':_0x2c829d[_0x2da0c5(0xae)]?.['commands'][_0x2da0c5(0x78)](_0x394d92=>({'path':_0x394d92[_0x2da0c5(0x75)],'risk':_0x394d92[_0x2da0c5(0x9e)],'target':toPublicServiceTreeTarget(_0x394d92['target'])}))??[],'registryIndex':_0x2c829d[_0x2da0c5(0xbb)],'registryServiceCode':_0x2c829d[_0x2da0c5(0xb3)],'errors':_0x2c829d['report']['errors'],'warnings':_0x2c829d[_0x2da0c5(0x83)][_0x2da0c5(0xa5)]};}function a41_0x3931(_0x4b745d,_0x2a4d34){_0x4b745d=_0x4b745d-0x73;const _0x494e3a=a41_0x494e();let _0x393120=_0x494e3a[_0x4b745d];return _0x393120;}export const serviceDefinitions=[{'service':a41_0x3f2c2e(0x74),'command':a41_0x3f2c2e(0x84),'description':a41_0x3f2c2e(0x9f),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x620fb5){const _0x59b7f0=a41_0x3f2c2e,_0x8822bb=loadServiceManifestFromFile(_0x620fb5['str'](_0x59b7f0(0xad)));if(!_0x8822bb[_0x59b7f0(0x83)]['ok'])return{'ok':![],'data':{'file':_0x8822bb['filePath'],'hash':_0x8822bb[_0x59b7f0(0xa8)],'kind':_0x8822bb['kind'],'serviceCount':_0x8822bb[_0x59b7f0(0x92)][_0x59b7f0(0xb0)],'services':_0x8822bb[_0x59b7f0(0x92)][_0x59b7f0(0x78)](summarizeLoadedManifest),'errors':_0x8822bb[_0x59b7f0(0x83)][_0x59b7f0(0xba)],'warnings':_0x8822bb[_0x59b7f0(0x83)][_0x59b7f0(0xa5)]},'message':formatValidationFailure(_0x8822bb['report'])};if(_0x8822bb[_0x59b7f0(0x81)]===_0x59b7f0(0xa6)||_0x8822bb[_0x59b7f0(0x92)]['length']!==0x1)return{'ok':!![],'data':{'file':_0x8822bb[_0x59b7f0(0x7a)],'hash':_0x8822bb['hash'],'kind':_0x8822bb['kind'],'serviceCount':_0x8822bb[_0x59b7f0(0x92)][_0x59b7f0(0xb0)],'commandCount':_0x8822bb[_0x59b7f0(0x92)][_0x59b7f0(0x80)]((_0x4dcd83,_0x306d9d)=>_0x4dcd83+(_0x306d9d[_0x59b7f0(0xae)]?.[_0x59b7f0(0x7c)][_0x59b7f0(0xb0)]??0x0),0x0),'services':_0x8822bb[_0x59b7f0(0x92)][_0x59b7f0(0x78)](summarizeLoadedManifest),'warnings':_0x8822bb[_0x59b7f0(0x83)][_0x59b7f0(0xa5)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x8822bb[_0x59b7f0(0x7a)],'hash':_0x8822bb[_0x59b7f0(0xa8)],'kind':_0x8822bb[_0x59b7f0(0x81)],'service':_0x8822bb[_0x59b7f0(0xae)]?.['service'],'version':_0x8822bb[_0x59b7f0(0xae)]?.[_0x59b7f0(0x96)],'commandCount':_0x8822bb[_0x59b7f0(0xae)]?.[_0x59b7f0(0x7c)][_0x59b7f0(0xb0)]??0x0,'commands':_0x8822bb[_0x59b7f0(0xae)]?.[_0x59b7f0(0x7c)][_0x59b7f0(0x78)](_0x28ec82=>({'path':_0x28ec82[_0x59b7f0(0x75)],'risk':_0x28ec82['risk'],'target':toPublicServiceTreeTarget(_0x28ec82[_0x59b7f0(0x8e)])})),'warnings':_0x8822bb[_0x59b7f0(0x83)]['warnings']},'message':_0x59b7f0(0x99)};}},{'service':a41_0x3f2c2e(0x74),'command':a41_0x3f2c2e(0xa3),'description':a41_0x3f2c2e(0x97),'risk':a41_0x3f2c2e(0x73),'confirmationDescription':a41_0x3f2c2e(0x8c),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0xc9b5d9){const _0x22a742=a41_0x3f2c2e,_0x43e90f=loadServiceManifestFromFile(_0xc9b5d9[_0x22a742(0xb9)](_0x22a742(0xad)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x43e90f[_0x22a742(0x7a)],'hash':_0x43e90f[_0x22a742(0xa8)],'kind':_0x43e90f[_0x22a742(0x81)],'ok':_0x43e90f[_0x22a742(0x83)]['ok'],'service':_0x43e90f[_0x22a742(0xae)]?.[_0x22a742(0x74)],'version':_0x43e90f[_0x22a742(0xae)]?.[_0x22a742(0x96)],'serviceCount':_0x43e90f[_0x22a742(0x92)][_0x22a742(0xb0)],'services':_0x43e90f['manifests'][_0x22a742(0x78)](_0x4e4aba=>({'service':_0x4e4aba[_0x22a742(0xae)]?.[_0x22a742(0x74)],'version':_0x4e4aba[_0x22a742(0xae)]?.[_0x22a742(0x96)],'commandCount':_0x4e4aba[_0x22a742(0xae)]?.[_0x22a742(0x7c)][_0x22a742(0xb0)]??0x0,'errors':_0x4e4aba[_0x22a742(0x83)][_0x22a742(0xba)]})),'errors':_0x43e90f['report']['errors'],'commandCount':_0x43e90f[_0x22a742(0xae)]?.[_0x22a742(0x7c)]['length']??0x0},'description':_0x22a742(0x93)};},async 'execute'(_0x19e281){const _0x32557c=a41_0x3f2c2e,_0x1bf6d9=importServiceManifest(_0x19e281[_0x32557c(0xb9)](_0x32557c(0xad)));if(_0x1bf6d9['entries'][_0x32557c(0xb0)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x1bf6d9[_0x32557c(0x9c)],'imported':_0x1bf6d9[_0x32557c(0x79)],'updated':_0x1bf6d9[_0x32557c(0x94)],'serviceCount':_0x1bf6d9[_0x32557c(0x7b)],'services':_0x1bf6d9[_0x32557c(0xb5)][_0x32557c(0x78)](summarizeService)},'message':_0x32557c(0xa9)+_0x1bf6d9[_0x32557c(0x79)]+'\x20service(s),\x20updated\x20'+_0x1bf6d9['updated']+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x1bf6d9['registryPath'],'replaced':_0x1bf6d9[_0x32557c(0x91)],'imported':_0x1bf6d9['imported'],'updated':_0x1bf6d9['updated'],'serviceCount':_0x1bf6d9['serviceCount'],'service':summarizeService(_0x1bf6d9[_0x32557c(0x8f)])},'message':(_0x1bf6d9[_0x32557c(0x91)]?_0x32557c(0xaf):'Imported')+_0x32557c(0xb1)+_0x1bf6d9[_0x32557c(0x8f)][_0x32557c(0xb6)]+'.'};}},{'service':'service','command':a41_0x3f2c2e(0x95),'description':a41_0x3f2c2e(0xb7),'risk':'write','confirmationDescription':'将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0xf2831d){const _0x5a7413=a41_0x3f2c2e,_0x44c9bd=getLocalServiceEntry(_0xf2831d[_0x5a7413(0xb9)](_0x5a7413(0x74)));return{'method':_0x5a7413(0x87),'url':_0xf2831d[_0x5a7413(0xb9)](_0x5a7413(0xad)),'body':{'service':_0xf2831d[_0x5a7413(0xb9)]('service'),'found':Boolean(_0x44c9bd),'version':_0x44c9bd?.[_0x5a7413(0x96)],'source':_0x44c9bd?.[_0x5a7413(0x7e)]},'description':_0x5a7413(0xb8)};},async 'execute'(_0x56b561){const _0xa7b085=a41_0x3f2c2e,_0x363160=exportServiceManifest(_0x56b561['str'](_0xa7b085(0x74)),_0x56b561['str'](_0xa7b085(0xad)));return{'ok':!![],'data':{'registryPath':_0x363160[_0xa7b085(0x9c)],'file':_0x363160[_0xa7b085(0x7a)],'service':summarizeService(_0x363160['entry'])},'message':_0xa7b085(0xa2)+_0x363160[_0xa7b085(0x8f)][_0xa7b085(0xb6)]+'.'};}},{'service':a41_0x3f2c2e(0x74),'command':a41_0x3f2c2e(0xa0),'description':a41_0x3f2c2e(0xab),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x570c4e=a41_0x3f2c2e,_0x2952c2=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x2952c2[_0x570c4e(0xb0)],'services':_0x2952c2['map'](summarizeService)}};}},{'service':a41_0x3f2c2e(0x74),'command':'remove','description':a41_0x3f2c2e(0x8a),'risk':'write','confirmationDescription':a41_0x3f2c2e(0x77),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x4ac7fb){const _0x485d1f=a41_0x3f2c2e,_0x446b5d=getLocalServiceEntry(_0x4ac7fb[_0x485d1f(0xb9)]('service'));return{'method':_0x485d1f(0x87),'url':getServiceRegistryPath(),'body':{'service':_0x4ac7fb['str'](_0x485d1f(0x74)),'found':Boolean(_0x446b5d),'version':_0x446b5d?.['version'],'source':_0x446b5d?.['source']},'description':_0x485d1f(0xac)};},async 'execute'(_0x4c7f88){const _0x4f09f4=a41_0x3f2c2e,_0x537c0c=removeServiceManifest(_0x4c7f88[_0x4f09f4(0xb9)](_0x4f09f4(0x74)));return{'ok':!![],'data':{'registryPath':_0x537c0c[_0x4f09f4(0x9c)],'serviceCount':_0x537c0c[_0x4f09f4(0x7b)],'service':summarizeService(_0x537c0c[_0x4f09f4(0x8f)])},'message':_0x4f09f4(0x9d)+_0x537c0c[_0x4f09f4(0x8f)][_0x4f09f4(0xb6)]+'.'};}},{'service':a41_0x3f2c2e(0x74),'command':a41_0x3f2c2e(0x8d),'description':a41_0x3f2c2e(0x88),'risk':a41_0x3f2c2e(0x7f),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x149f19){const _0x5a1cfc=a41_0x3f2c2e,_0xd672b3=getLocalServiceEntry(_0x149f19['str'](_0x5a1cfc(0x74)));if(!_0xd672b3)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x149f19[_0x5a1cfc(0xb9)](_0x5a1cfc(0x74))},'message':_0x5a1cfc(0xa4)+_0x149f19[_0x5a1cfc(0xb9)](_0x5a1cfc(0x74))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0xd672b3),'manifest':_0xd672b3[_0x5a1cfc(0x82)],'normalizedManifest':toPublicNormalizedServiceTree(_0xd672b3['normalizedManifest'])}};}}];
@@ -1 +1 @@
1
- const a42_0x207e09=a42_0x44cd;(function(_0x4fdd01,_0x4b6ff8){const _0x170239=a42_0x44cd,_0x525ad5=_0x4fdd01();while(!![]){try{const _0x12a353=-parseInt(_0x170239(0x1f4))/0x1+-parseInt(_0x170239(0x1f9))/0x2+-parseInt(_0x170239(0x1eb))/0x3*(parseInt(_0x170239(0x1fa))/0x4)+parseInt(_0x170239(0x1c6))/0x5*(-parseInt(_0x170239(0x1b5))/0x6)+parseInt(_0x170239(0x1da))/0x7+parseInt(_0x170239(0x1df))/0x8*(-parseInt(_0x170239(0x1f6))/0x9)+parseInt(_0x170239(0x1dd))/0xa*(parseInt(_0x170239(0x1ed))/0xb);if(_0x12a353===_0x4b6ff8)break;else _0x525ad5['push'](_0x525ad5['shift']());}catch(_0x1712cd){_0x525ad5['push'](_0x525ad5['shift']());}}}(a42_0x4592,0x72e10));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_0x207e09(0x1fb);export function getServiceRegistryPath(_0x3409a2={}){const _0x4966f4=a42_0x207e09;return resolve(_0x3409a2['homeDir']??homedir(),PRODUCT_CONFIG[_0x4966f4(0x1e4)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x556846={}){const _0x160d48=a42_0x207e09,_0x4ecb0f=getServiceRegistryPath(_0x556846);if(!existsSync(_0x4ecb0f))return emptyServiceRegistry();try{const _0x321a82=readFileSync(_0x4ecb0f,_0x160d48(0x1f3));if(!_0x321a82[_0x160d48(0x1f1)]())return emptyServiceRegistry();const _0x5d58b5=JSON[_0x160d48(0x1ca)](_0x321a82);if(_0x5d58b5[_0x160d48(0x1ec)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x160d48(0x1cc)](_0x160d48(0x1d2)+String(_0x5d58b5[_0x160d48(0x1ec)]),_0x160d48(0x1d1)+_0x4ecb0f+'.');if(!Array['isArray'](_0x5d58b5[_0x160d48(0x1dc)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5d58b5[_0x160d48(0x1b2)],'services':_0x5d58b5[_0x160d48(0x1dc)]};}catch(_0x17a3d0){if(_0x17a3d0 instanceof Error&&_0x17a3d0['name']===_0x160d48(0x1f8))throw _0x17a3d0;throw CliErrors[_0x160d48(0x1cc)](_0x160d48(0x1d7)+_0x4ecb0f,_0x160d48(0x1e9));}}export function writeServiceRegistry(_0x535288,_0x573245={}){const _0x1e3be3=a42_0x207e09,_0x15ce75=getServiceRegistryPath(_0x573245),_0x15f85b=dirname(_0x15ce75);!existsSync(_0x15f85b)&&mkdirSync(_0x15f85b,{'recursive':!![]});const _0x228bf9=_0x15ce75+'.tmp';try{writeFileSync(_0x228bf9,JSON[_0x1e3be3(0x1bd)](_0x535288,null,0x2)+'\x0a',{'encoding':_0x1e3be3(0x1f3),'mode':0x180}),renameSync(_0x228bf9,_0x15ce75);}catch(_0x2c28ea){try{unlinkSync(_0x228bf9);}catch{}if(_0x2c28ea?.['code']===_0x1e3be3(0x1d0))throw CliErrors[_0x1e3be3(0x1cc)](_0x1e3be3(0x1c4)+_0x15ce75);throw _0x2c28ea;}return _0x15ce75;}export function loadServiceManifestFromFile(_0x120a65){const _0x52a667=a42_0x207e09,_0x14f374=resolve(_0x120a65);if(!existsSync(_0x14f374))throw CliErrors[_0x52a667(0x1cc)](_0x52a667(0x1ee)+_0x120a65);let _0x317169;const _0x1b6a41=readFileSync(_0x14f374,_0x52a667(0x1f3));try{_0x317169=JSON['parse'](_0x1b6a41);}catch{throw CliErrors['validation'](_0x52a667(0x1b8)+_0x120a65,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x14c6a4=sha256(_0x1b6a41),_0x5de6e8=extractLoadedServiceManifests(_0x317169,_0x14c6a4),_0x3a22e1=aggregateValidationReports(_0x5de6e8),_0x5818b5=_0x5de6e8[0x0];return{'filePath':_0x14f374,'hash':_0x14c6a4,'kind':isServiceRegistryLike(_0x317169)?_0x52a667(0x1b6):_0x52a667(0x1bf),'manifest':_0x5818b5?.[_0x52a667(0x1bf)]??_0x317169,'report':_0x3a22e1,'normalizedManifest':_0x5de6e8['length']===0x1?_0x5818b5?.[_0x52a667(0x1ea)]:undefined,'manifests':_0x5de6e8};}export function importServiceManifest(_0x1f151f,_0x36eba9={}){const _0x23d2a1=a42_0x207e09,_0x2f1efe=loadServiceManifestFromFile(_0x1f151f);if(!_0x2f1efe[_0x23d2a1(0x1cf)]['ok'])throw CliErrors[_0x23d2a1(0x1cc)](formatValidationFailure(_0x2f1efe[_0x23d2a1(0x1cf)]),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x2f1efe[_0x23d2a1(0x1d4)][_0x23d2a1(0x1e8)]===0x0)throw CliErrors[_0x23d2a1(0x1cc)]('Service\x20registry\x20has\x20no\x20services\x20to\x20import.',_0x23d2a1(0x1c8));const _0x319595=readServiceRegistry(_0x36eba9),_0x1ea20a=(_0x36eba9[_0x23d2a1(0x1fd)]??(()=>new Date()))()[_0x23d2a1(0x1e7)](),_0x27dbf0=[];let _0x2887ed=0x0,_0x8d5169=0x0;for(const _0x4ac90e of _0x2f1efe[_0x23d2a1(0x1d4)]){if(!_0x4ac90e['normalizedManifest'])continue;const _0x3fbbb5=_0x4ac90e[_0x23d2a1(0x1ea)]['service']['code'],_0x2501bf={'serviceCode':_0x3fbbb5,'version':_0x4ac90e['normalizedManifest'][_0x23d2a1(0x1d5)],'importedAt':_0x1ea20a,'source':{'type':_0x23d2a1(0x1b1),'path':_0x2f1efe['filePath'],'hash':_0x4ac90e[_0x23d2a1(0x1f0)]},'manifest':_0x4ac90e[_0x23d2a1(0x1bf)],'normalizedManifest':_0x4ac90e[_0x23d2a1(0x1ea)]},_0x2d15e8=_0x319595[_0x23d2a1(0x1dc)][_0x23d2a1(0x1ff)](_0x216851=>_0x216851['serviceCode']===_0x3fbbb5);_0x2d15e8>=0x0?(_0x319595[_0x23d2a1(0x1dc)][_0x2d15e8]=_0x2501bf,_0x8d5169++):(_0x319595[_0x23d2a1(0x1dc)][_0x23d2a1(0x1f2)](_0x2501bf),_0x2887ed++),_0x27dbf0[_0x23d2a1(0x1f2)](_0x2501bf);}_0x319595[_0x23d2a1(0x1dc)][_0x23d2a1(0x1ac)]((_0x803430,_0x2f6999)=>_0x803430[_0x23d2a1(0x1ba)][_0x23d2a1(0x1ef)](_0x2f6999[_0x23d2a1(0x1ba)])),_0x319595[_0x23d2a1(0x1b2)]=_0x1ea20a;const _0xe11dab=writeServiceRegistry(_0x319595,_0x36eba9);return{'registryPath':_0xe11dab,'entry':_0x27dbf0[0x0],'replaced':_0x27dbf0['length']===0x1?_0x8d5169===0x1:_0x8d5169>0x0,'entries':_0x27dbf0,'imported':_0x2887ed,'updated':_0x8d5169,'serviceCount':_0x319595[_0x23d2a1(0x1dc)]['length']};}export function exportServiceManifest(_0x17f43f,_0x75f4c2,_0x537efd={}){const _0x3afb3d=a42_0x207e09,_0x2c9e36=getServiceRegistryPath(_0x537efd),_0x33a2cc=getLocalServiceEntry(_0x17f43f,_0x537efd);if(!_0x33a2cc)throw CliErrors[_0x3afb3d(0x1cc)](_0x3afb3d(0x1d9)+_0x17f43f,_0x3afb3d(0x202));const _0x32c64a=resolve(_0x75f4c2),_0x533df9=dirname(_0x32c64a);return!existsSync(_0x533df9)&&mkdirSync(_0x533df9,{'recursive':!![]}),writeFileSync(_0x32c64a,JSON['stringify'](_0x33a2cc[_0x3afb3d(0x1bf)],null,0x2)+'\x0a',{'encoding':_0x3afb3d(0x1f3),'mode':0x180}),{'registryPath':_0x2c9e36,'filePath':_0x32c64a,'entry':_0x33a2cc};}export function removeServiceManifest(_0x43a529,_0x4366f5={}){const _0xe67592=a42_0x207e09,_0x5733e1=readServiceRegistry(_0x4366f5),_0x2bf726=_0x43a529[_0xe67592(0x1f1)](),_0x716536=_0x5733e1['services'][_0xe67592(0x1ff)](_0x5439d1=>_0x5439d1[_0xe67592(0x1ba)]===_0x2bf726);if(_0x716536<0x0)throw CliErrors[_0xe67592(0x1cc)](_0xe67592(0x1d9)+_0x2bf726,_0xe67592(0x202));const [_0x7f8424]=_0x5733e1[_0xe67592(0x1dc)][_0xe67592(0x1be)](_0x716536,0x1),_0x165b06=(_0x4366f5[_0xe67592(0x1fd)]??(()=>new Date()))()['toISOString']();_0x5733e1[_0xe67592(0x1b2)]=_0x165b06;const _0x53782f=writeServiceRegistry(_0x5733e1,_0x4366f5);return{'registryPath':_0x53782f,'entry':_0x7f8424,'serviceCount':_0x5733e1[_0xe67592(0x1dc)][_0xe67592(0x1e8)]};}export function listLocalServices(_0xbe1730={}){const _0x34f0fd=a42_0x207e09;return readServiceRegistry(_0xbe1730)[_0x34f0fd(0x1dc)];}export function getLocalServiceEntry(_0x365058,_0x4c30fb={}){const _0x1e86c0=a42_0x207e09;return readServiceRegistry(_0x4c30fb)[_0x1e86c0(0x1dc)][_0x1e86c0(0x1db)](_0x1e524b=>_0x1e524b[_0x1e86c0(0x1ba)]===_0x365058['trim']());}export function listLocalServiceTrees(_0x3985b2={}){const _0x349f27=a42_0x207e09;return readServiceRegistry(_0x3985b2)[_0x349f27(0x1dc)]['map'](_0x5119e1=>_0x5119e1['normalizedManifest']);}export function inspectServiceRegistry(_0x16dd7a={}){const _0x2d4e28=a42_0x207e09,_0x306430=getServiceRegistryPath(_0x16dd7a);if(!existsSync(_0x306430))return emptyServiceRegistryInspection(_0x306430,'missing',![]);try{const _0x26dc92=readFileSync(_0x306430,_0x2d4e28(0x1f3));if(!_0x26dc92[_0x2d4e28(0x1f1)]())return emptyServiceRegistryInspection(_0x306430,'empty',!![]);const _0x159e58=JSON['parse'](_0x26dc92);if(_0x159e58['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x306430,_0x2d4e28(0x1ae),!![]),'schemaVersion':_0x159e58['schemaVersion'],'message':_0x2d4e28(0x1cd)+String(_0x159e58[_0x2d4e28(0x1ec)])};if(!Array[_0x2d4e28(0x1ad)](_0x159e58[_0x2d4e28(0x1dc)]))return{...emptyServiceRegistryInspection(_0x306430,_0x2d4e28(0x1ae),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x159e58[_0x2d4e28(0x1b2)],'message':_0x2d4e28(0x1f5)};const _0x35317f=_0x159e58[_0x2d4e28(0x1dc)][_0x2d4e28(0x1b4)](summarizeLocalServiceEntry);return{'registryPath':_0x306430,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x159e58[_0x2d4e28(0x1b2)],'serviceCount':_0x35317f[_0x2d4e28(0x1e8)],'commandCount':_0x35317f[_0x2d4e28(0x1ce)]((_0x2cbe75,_0x5121a2)=>_0x2cbe75+_0x5121a2[_0x2d4e28(0x1b0)],0x0),'services':_0x35317f};}catch(_0x409929){return{...emptyServiceRegistryInspection(_0x306430,_0x2d4e28(0x1ae),!![]),'message':_0x409929 instanceof Error?_0x409929[_0x2d4e28(0x1fe)]:String(_0x409929)};}}export function formatValidationFailure(_0x2d24ad){const _0x3a40e9=a42_0x207e09,_0x4659ea=_0x2d24ad[_0x3a40e9(0x1af)][_0x3a40e9(0x1b4)](_0xefa655=>_0xefa655[_0x3a40e9(0x1c2)]+':\x20'+_0xefa655[_0x3a40e9(0x1fe)]);return _0x3a40e9(0x201)+_0x4659ea[_0x3a40e9(0x1e0)]('\x0a');}function extractLoadedServiceManifests(_0xcf1e7a,_0x3bc4fe){const _0x35a95f=a42_0x207e09;if(!isServiceRegistryLike(_0xcf1e7a)){const _0x3db1de=_0xcf1e7a,{manifest:_0xd05778,errors:_0x1eb572}=adaptServiceTreeManifestForLegacyFramework(_0x3db1de),_0x32b797=validateServiceTreeManifest(_0xd05778),_0x22e58c=mergeValidationErrors(_0x32b797,_0x1eb572);return[{'manifest':_0x3db1de,'report':_0x22e58c,'normalizedManifest':_0x22e58c['ok']?normalizeServiceTreeManifest(_0xd05778):undefined,'sourceHash':_0x3bc4fe}];}return _0xcf1e7a[_0x35a95f(0x1dc)][_0x35a95f(0x1b4)]((_0x49b856,_0x24a3e9)=>{const _0x349f3d=_0x35a95f,_0x228df6=isObjectRecord(_0x49b856)?_0x49b856[_0x349f3d(0x1bf)]:undefined,{manifest:_0x10a396,errors:_0x9044d3}=adaptServiceTreeManifestForLegacyFramework(_0x228df6),_0x300d2d=validateServiceTreeManifest(_0x10a396),_0x5dca37=mergeValidationErrors(_0x300d2d,_0x9044d3),_0x1910c0=isObjectRecord(_0x49b856)&&typeof _0x49b856[_0x349f3d(0x1ba)]==='string'?_0x49b856[_0x349f3d(0x1ba)]:undefined;return{'manifest':_0x228df6,'report':_0x5dca37,'normalizedManifest':_0x5dca37['ok']?normalizeServiceTreeManifest(_0x10a396):undefined,'sourceHash':sha256(JSON[_0x349f3d(0x1bd)](_0x228df6,null,0x2)+'\x0a'),'registryIndex':_0x24a3e9,'registryServiceCode':_0x1910c0};});}function a42_0x44cd(_0x3c5b6d,_0x35deee){_0x3c5b6d=_0x3c5b6d-0x1ac;const _0x45929d=a42_0x4592();let _0x44cdc7=_0x45929d[_0x3c5b6d];return _0x44cdc7;}function mergeValidationErrors(_0x2476ff,_0x454d9e){const _0x2c475d=a42_0x207e09,_0x498a25=_0x2476ff[_0x2c475d(0x1af)][_0x2c475d(0x1b4)](_0x1efe23=>_0x1efe23[_0x2c475d(0x1fe)]===_0x2c475d(0x1de)?{..._0x1efe23,'message':'bff\x20target\x20requires\x20functionName.'}:_0x1efe23),_0x5456a7=[..._0x454d9e,..._0x498a25];return{'ok':_0x5456a7[_0x2c475d(0x1e8)]===0x0,'errors':_0x5456a7,'warnings':_0x2476ff[_0x2c475d(0x200)]};}function a42_0x4592(){const _0x2705e8=['8gNDJvj','service.json','].manifest.','now','message','findIndex','warnings','Service\x20manifest\x20validation\x20failed:\x0a','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','sort','isArray','invalid','errors','commandCount','file','updatedAt','hex','map','342rcrthb','registry','kind','Invalid\x20service\x20manifest\x20JSON:\x20','].manifest','serviceCode','digest','registryIndex','stringify','splice','manifest','commands','importedAt','path','service','Cannot\x20write\x20service\x20registry:\x20','update','29835FmfNzX','target','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','flatMap','parse','description','validation','Unsupported\x20schemaVersion:\x20','reduce','report','ENOENT','Remove\x20or\x20migrate\x20','Unsupported\x20service\x20registry\x20schemaVersion:\x20','command','manifests','version','name','Invalid\x20service\x20registry\x20JSON:\x20','cliPath','Local\x20service\x20not\x20found:\x20','267519ExipbE','find','services','2990fMcbEc','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','3758008GBIsbN','join','sha256','risk','$.services[','homeDirName','slice','startsWith','toISOString','length','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','normalizedManifest','403617JWNVSx','schemaVersion','112651EjwlVB','Service\x20manifest\x20file\x20not\x20found:\x20','localeCompare','sourceHash','trim','push','utf8','725830LTsBsM','services\x20must\x20be\x20an\x20array','9RdcJCF','source','CliError','1649908juKKVW'];a42_0x4592=function(){return _0x2705e8;};return a42_0x4592();}function aggregateValidationReports(_0x37026a){const _0x503aef=a42_0x207e09,_0x27cc8e=_0x37026a[_0x503aef(0x1c9)](_0x3445c4=>_0x3445c4[_0x503aef(0x1bc)]===undefined?_0x3445c4[_0x503aef(0x1cf)][_0x503aef(0x1af)]:_0x3445c4[_0x503aef(0x1cf)][_0x503aef(0x1af)][_0x503aef(0x1b4)](_0x37ad26=>({..._0x37ad26,'path':prefixRegistryIssuePath(_0x3445c4[_0x503aef(0x1bc)],_0x37ad26[_0x503aef(0x1c2)])}))),_0x40b9a8=_0x37026a[_0x503aef(0x1c9)](_0x58a81e=>_0x58a81e[_0x503aef(0x1bc)]===undefined?_0x58a81e[_0x503aef(0x1cf)][_0x503aef(0x200)]:_0x58a81e[_0x503aef(0x1cf)][_0x503aef(0x200)][_0x503aef(0x1b4)](_0x1861d4=>({..._0x1861d4,'path':prefixRegistryIssuePath(_0x58a81e[_0x503aef(0x1bc)],_0x1861d4['path'])})));return{'ok':_0x27cc8e[_0x503aef(0x1e8)]===0x0,'errors':_0x27cc8e,'warnings':_0x40b9a8};}function prefixRegistryIssuePath(_0x374a2e,_0x154899){const _0x52a275=a42_0x207e09;if(_0x154899==='$')return _0x52a275(0x1e3)+_0x374a2e+'].manifest';if(_0x154899[_0x52a275(0x1e6)]('$.'))return _0x52a275(0x1e3)+_0x374a2e+'].manifest'+_0x154899[_0x52a275(0x1e5)](0x1);if(_0x154899[_0x52a275(0x1e6)]('$['))return _0x52a275(0x1e3)+_0x374a2e+_0x52a275(0x1b9)+_0x154899['slice'](0x1);return _0x52a275(0x1e3)+_0x374a2e+_0x52a275(0x1fc)+_0x154899;}function isServiceRegistryLike(_0x408970){const _0x5d9bdd=a42_0x207e09;return isObjectRecord(_0x408970)&&_0x408970[_0x5d9bdd(0x1ec)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x5d9bdd(0x1ad)](_0x408970[_0x5d9bdd(0x1dc)]);}function isObjectRecord(_0x362038){const _0xbad60f=a42_0x207e09;return Boolean(_0x362038)&&typeof _0x362038==='object'&&!Array[_0xbad60f(0x1ad)](_0x362038);}function emptyServiceRegistryInspection(_0x5db121,_0x339f3b,_0x100e3f){return{'registryPath':_0x5db121,'exists':_0x100e3f,'status':_0x339f3b,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x4512d4){const _0x446b08=a42_0x207e09,_0x1cfe44=_0x4512d4[_0x446b08(0x1ea)],_0xfef81a=_0x1cfe44[_0x446b08(0x1c0)][_0x446b08(0x1b4)](_0x484f6c=>({'path':_0x484f6c[_0x446b08(0x1d8)],'description':_0x484f6c[_0x446b08(0x1cb)],'risk':_0x484f6c[_0x446b08(0x1e2)],'targetKind':_0x484f6c[_0x446b08(0x1c7)][_0x446b08(0x1b7)],'targetCommand':_0x484f6c['target'][_0x446b08(0x1d3)]}));return{'serviceCode':_0x4512d4[_0x446b08(0x1ba)],'name':_0x1cfe44[_0x446b08(0x1c3)][_0x446b08(0x1d6)],'description':_0x1cfe44[_0x446b08(0x1c3)][_0x446b08(0x1cb)],'version':_0x4512d4['version'],'importedAt':_0x4512d4[_0x446b08(0x1c1)],'source':_0x4512d4[_0x446b08(0x1f7)],'commandCount':_0xfef81a[_0x446b08(0x1e8)],'commands':_0xfef81a};}function sha256(_0xb9fcdb){const _0x4a2ea5=a42_0x207e09;return createHash(_0x4a2ea5(0x1e1))[_0x4a2ea5(0x1c5)](_0xb9fcdb)[_0x4a2ea5(0x1bb)](_0x4a2ea5(0x1b3));}
1
+ const a42_0x355a1f=a42_0x41c9;(function(_0x497f4a,_0x4b0bf5){const _0x1bea82=a42_0x41c9,_0x234643=_0x497f4a();while(!![]){try{const _0x391c3a=parseInt(_0x1bea82(0xc1))/0x1*(-parseInt(_0x1bea82(0xae))/0x2)+-parseInt(_0x1bea82(0x89))/0x3*(-parseInt(_0x1bea82(0xd7))/0x4)+parseInt(_0x1bea82(0xa2))/0x5*(-parseInt(_0x1bea82(0xb4))/0x6)+-parseInt(_0x1bea82(0xcc))/0x7*(-parseInt(_0x1bea82(0xd2))/0x8)+-parseInt(_0x1bea82(0xc0))/0x9*(-parseInt(_0x1bea82(0xa6))/0xa)+parseInt(_0x1bea82(0x92))/0xb+-parseInt(_0x1bea82(0xbc))/0xc;if(_0x391c3a===_0x4b0bf5)break;else _0x234643['push'](_0x234643['shift']());}catch(_0x27cf2a){_0x234643['push'](_0x234643['shift']());}}}(a42_0x3104,0x1f960));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';function a42_0x41c9(_0x164305,_0x1650e4){_0x164305=_0x164305-0x81;const _0x3104c0=a42_0x3104();let _0x41c976=_0x3104c0[_0x164305];return _0x41c976;}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_0x355a1f(0xa9);export function getServiceRegistryPath(_0x210ae6={}){const _0x544475=a42_0x355a1f;return resolve(_0x210ae6[_0x544475(0x90)]??homedir(),PRODUCT_CONFIG[_0x544475(0x84)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x274337={}){const _0x1d8f5b=a42_0x355a1f,_0x31b6f1=getServiceRegistryPath(_0x274337);if(!existsSync(_0x31b6f1))return emptyServiceRegistry();try{const _0x213a73=readFileSync(_0x31b6f1,_0x1d8f5b(0xa3));if(!_0x213a73[_0x1d8f5b(0xd8)]())return emptyServiceRegistry();const _0x473f94=JSON[_0x1d8f5b(0x8c)](_0x213a73);if(_0x473f94[_0x1d8f5b(0xcf)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x1d8f5b(0xc6)]('Unsupported\x20service\x20registry\x20schemaVersion:\x20'+String(_0x473f94[_0x1d8f5b(0xcf)]),_0x1d8f5b(0xaf)+_0x31b6f1+'.');if(!Array[_0x1d8f5b(0xc7)](_0x473f94['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x473f94[_0x1d8f5b(0x86)],'services':_0x473f94['services']};}catch(_0x322616){if(_0x322616 instanceof Error&&_0x322616['name']===_0x1d8f5b(0xc4))throw _0x322616;throw CliErrors[_0x1d8f5b(0xc6)]('Invalid\x20service\x20registry\x20JSON:\x20'+_0x31b6f1,_0x1d8f5b(0xa8));}}export function writeServiceRegistry(_0x1bb565,_0x50def1={}){const _0x2df7f2=a42_0x355a1f,_0x557f31=getServiceRegistryPath(_0x50def1),_0x4153a6=dirname(_0x557f31);!existsSync(_0x4153a6)&&mkdirSync(_0x4153a6,{'recursive':!![]});const _0x2b4325=_0x557f31+_0x2df7f2(0x97);try{writeFileSync(_0x2b4325,JSON[_0x2df7f2(0xc8)](_0x1bb565,null,0x2)+'\x0a',{'encoding':_0x2df7f2(0xa3),'mode':0x180}),renameSync(_0x2b4325,_0x557f31);}catch(_0x49fbf2){try{unlinkSync(_0x2b4325);}catch{}if(_0x49fbf2?.[_0x2df7f2(0x9d)]===_0x2df7f2(0xc2))throw CliErrors[_0x2df7f2(0xc6)](_0x2df7f2(0x98)+_0x557f31);throw _0x49fbf2;}return _0x557f31;}export function loadServiceManifestFromFile(_0x9d8779){const _0x1d9f6d=a42_0x355a1f,_0x5989d7=resolve(_0x9d8779);if(!existsSync(_0x5989d7))throw CliErrors['validation'](_0x1d9f6d(0x9e)+_0x9d8779);let _0x853b85;const _0x11a191=readFileSync(_0x5989d7,_0x1d9f6d(0xa3));try{_0x853b85=JSON[_0x1d9f6d(0x8c)](_0x11a191);}catch{throw CliErrors[_0x1d9f6d(0xc6)]('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x9d8779,_0x1d9f6d(0x8a));}const _0x4a1148=sha256(_0x11a191),_0x399928=extractLoadedServiceManifests(_0x853b85,_0x4a1148),_0x287fcd=aggregateValidationReports(_0x399928),_0xbbb4d5=_0x399928[0x0];return{'filePath':_0x5989d7,'hash':_0x4a1148,'kind':isServiceRegistryLike(_0x853b85)?_0x1d9f6d(0x88):'manifest','manifest':_0xbbb4d5?.[_0x1d9f6d(0xa4)]??_0x853b85,'report':_0x287fcd,'normalizedManifest':_0x399928['length']===0x1?_0xbbb4d5?.['normalizedManifest']:undefined,'manifests':_0x399928};}export function importServiceManifest(_0x5aa3a9,_0x1a123b={}){const _0x36b6ef=a42_0x355a1f,_0x5bb0f1=loadServiceManifestFromFile(_0x5aa3a9);if(!_0x5bb0f1[_0x36b6ef(0xb0)]['ok'])throw CliErrors[_0x36b6ef(0xc6)](formatValidationFailure(_0x5bb0f1[_0x36b6ef(0xb0)]),_0x36b6ef(0xb6));if(_0x5bb0f1[_0x36b6ef(0x96)][_0x36b6ef(0x93)]===0x0)throw CliErrors[_0x36b6ef(0xc6)](_0x36b6ef(0xce),_0x36b6ef(0x95));const _0x4c2c75=readServiceRegistry(_0x1a123b),_0x3d490c=(_0x1a123b[_0x36b6ef(0x81)]??(()=>new Date()))()[_0x36b6ef(0xc5)](),_0x27a4bc=[];let _0x4a25f5=0x0,_0x1a5991=0x0;for(const _0x3d74f5 of _0x5bb0f1['manifests']){if(!_0x3d74f5['normalizedManifest'])continue;const _0x111b59=_0x3d74f5[_0x36b6ef(0xc3)][_0x36b6ef(0x82)][_0x36b6ef(0x9d)],_0x5a9ceb={'serviceCode':_0x111b59,'version':_0x3d74f5[_0x36b6ef(0xc3)][_0x36b6ef(0xc9)],'importedAt':_0x3d490c,'source':{'type':_0x36b6ef(0xca),'path':_0x5bb0f1[_0x36b6ef(0xb9)],'hash':_0x3d74f5[_0x36b6ef(0xab)]},'manifest':_0x3d74f5[_0x36b6ef(0xa4)],'normalizedManifest':_0x3d74f5[_0x36b6ef(0xc3)]},_0x7c0e3=_0x4c2c75[_0x36b6ef(0xbf)][_0x36b6ef(0xcb)](_0x51edec=>_0x51edec[_0x36b6ef(0x99)]===_0x111b59);_0x7c0e3>=0x0?(_0x4c2c75[_0x36b6ef(0xbf)][_0x7c0e3]=_0x5a9ceb,_0x1a5991++):(_0x4c2c75[_0x36b6ef(0xbf)][_0x36b6ef(0xbe)](_0x5a9ceb),_0x4a25f5++),_0x27a4bc[_0x36b6ef(0xbe)](_0x5a9ceb);}_0x4c2c75[_0x36b6ef(0xbf)][_0x36b6ef(0xbb)]((_0x1a185c,_0x1bce02)=>_0x1a185c[_0x36b6ef(0x99)][_0x36b6ef(0x8b)](_0x1bce02[_0x36b6ef(0x99)])),_0x4c2c75[_0x36b6ef(0x86)]=_0x3d490c;const _0x511619=writeServiceRegistry(_0x4c2c75,_0x1a123b);return{'registryPath':_0x511619,'entry':_0x27a4bc[0x0],'replaced':_0x27a4bc[_0x36b6ef(0x93)]===0x1?_0x1a5991===0x1:_0x1a5991>0x0,'entries':_0x27a4bc,'imported':_0x4a25f5,'updated':_0x1a5991,'serviceCount':_0x4c2c75['services']['length']};}export function exportServiceManifest(_0x37acb5,_0xe4641d,_0x714bb6={}){const _0x568e5d=a42_0x355a1f,_0x5cda3b=getServiceRegistryPath(_0x714bb6),_0x3fad18=getLocalServiceEntry(_0x37acb5,_0x714bb6);if(!_0x3fad18)throw CliErrors[_0x568e5d(0xc6)](_0x568e5d(0x83)+_0x37acb5,_0x568e5d(0xa5));const _0x56eb80=resolve(_0xe4641d),_0x349b85=dirname(_0x56eb80);return!existsSync(_0x349b85)&&mkdirSync(_0x349b85,{'recursive':!![]}),writeFileSync(_0x56eb80,JSON[_0x568e5d(0xc8)](_0x3fad18['manifest'],null,0x2)+'\x0a',{'encoding':_0x568e5d(0xa3),'mode':0x180}),{'registryPath':_0x5cda3b,'filePath':_0x56eb80,'entry':_0x3fad18};}export function removeServiceManifest(_0x38c411,_0x46d927={}){const _0x1948a9=a42_0x355a1f,_0x5d31a0=readServiceRegistry(_0x46d927),_0x540c7b=_0x38c411[_0x1948a9(0xd8)](),_0x52fbb0=_0x5d31a0[_0x1948a9(0xbf)][_0x1948a9(0xcb)](_0x56da72=>_0x56da72[_0x1948a9(0x99)]===_0x540c7b);if(_0x52fbb0<0x0)throw CliErrors[_0x1948a9(0xc6)]('Local\x20service\x20not\x20found:\x20'+_0x540c7b,_0x1948a9(0xa5));const [_0x4b10e1]=_0x5d31a0[_0x1948a9(0xbf)]['splice'](_0x52fbb0,0x1),_0x1300c1=(_0x46d927['now']??(()=>new Date()))()[_0x1948a9(0xc5)]();_0x5d31a0['updatedAt']=_0x1300c1;const _0xa565f0=writeServiceRegistry(_0x5d31a0,_0x46d927);return{'registryPath':_0xa565f0,'entry':_0x4b10e1,'serviceCount':_0x5d31a0[_0x1948a9(0xbf)]['length']};}export function listLocalServices(_0x1e6bc3={}){const _0x187771=a42_0x355a1f;return readServiceRegistry(_0x1e6bc3)[_0x187771(0xbf)];}export function getLocalServiceEntry(_0xfce9e9,_0x178440={}){const _0x3be18f=a42_0x355a1f;return readServiceRegistry(_0x178440)[_0x3be18f(0xbf)][_0x3be18f(0xa0)](_0x24710e=>_0x24710e[_0x3be18f(0x99)]===_0xfce9e9[_0x3be18f(0xd8)]());}export function listLocalServiceTrees(_0x20a46b={}){const _0x313ba8=a42_0x355a1f;return readServiceRegistry(_0x20a46b)[_0x313ba8(0xbf)][_0x313ba8(0x85)](_0x17c8f7=>_0x17c8f7[_0x313ba8(0xc3)]);}export function inspectServiceRegistry(_0x574fe1={}){const _0x5019ad=a42_0x355a1f,_0x23f30e=getServiceRegistryPath(_0x574fe1);if(!existsSync(_0x23f30e))return emptyServiceRegistryInspection(_0x23f30e,'missing',![]);try{const _0x490433=readFileSync(_0x23f30e,_0x5019ad(0xa3));if(!_0x490433[_0x5019ad(0xd8)]())return emptyServiceRegistryInspection(_0x23f30e,_0x5019ad(0xd4),!![]);const _0x176d8b=JSON['parse'](_0x490433);if(_0x176d8b[_0x5019ad(0xcf)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x23f30e,'invalid',!![]),'schemaVersion':_0x176d8b[_0x5019ad(0xcf)],'message':_0x5019ad(0xbd)+String(_0x176d8b[_0x5019ad(0xcf)])};if(!Array[_0x5019ad(0xc7)](_0x176d8b['services']))return{...emptyServiceRegistryInspection(_0x23f30e,_0x5019ad(0xb8),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x176d8b['updatedAt'],'message':'services\x20must\x20be\x20an\x20array'};const _0x10b162=_0x176d8b[_0x5019ad(0xbf)][_0x5019ad(0x85)](summarizeLocalServiceEntry);return{'registryPath':_0x23f30e,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x176d8b[_0x5019ad(0x86)],'serviceCount':_0x10b162[_0x5019ad(0x93)],'commandCount':_0x10b162[_0x5019ad(0x8e)]((_0x2f1222,_0x11fefa)=>_0x2f1222+_0x11fefa[_0x5019ad(0xb7)],0x0),'services':_0x10b162};}catch(_0x5a2ba8){return{...emptyServiceRegistryInspection(_0x23f30e,'invalid',!![]),'message':_0x5a2ba8 instanceof Error?_0x5a2ba8['message']:String(_0x5a2ba8)};}}export function formatValidationFailure(_0x200ee0){const _0x2a7b94=a42_0x355a1f,_0x5d4faf=_0x200ee0[_0x2a7b94(0x8d)][_0x2a7b94(0x85)](_0x6c0b8d=>_0x6c0b8d[_0x2a7b94(0xba)]+':\x20'+_0x6c0b8d[_0x2a7b94(0xcd)]);return _0x2a7b94(0xd1)+_0x5d4faf[_0x2a7b94(0x9f)]('\x0a');}function extractLoadedServiceManifests(_0x494826,_0x1e0f24){const _0x43eb49=a42_0x355a1f;if(!isServiceRegistryLike(_0x494826)){const _0x5a495e=_0x494826,{manifest:_0x4c91b5,errors:_0x1cc2b6}=adaptServiceTreeManifestForLegacyFramework(_0x5a495e),_0x3b5b63=validateServiceTreeManifest(_0x4c91b5),_0x23d897=mergeValidationErrors(_0x3b5b63,_0x1cc2b6);return[{'manifest':_0x5a495e,'report':_0x23d897,'normalizedManifest':_0x23d897['ok']?normalizeServiceTreeManifest(_0x4c91b5):undefined,'sourceHash':_0x1e0f24}];}return _0x494826[_0x43eb49(0xbf)][_0x43eb49(0x85)]((_0x5da62d,_0x1d1dad)=>{const _0x250936=_0x43eb49,_0x2146af=isObjectRecord(_0x5da62d)?_0x5da62d[_0x250936(0xa4)]:undefined,{manifest:_0x18cfa4,errors:_0x46c773}=adaptServiceTreeManifestForLegacyFramework(_0x2146af),_0x438c5e=validateServiceTreeManifest(_0x18cfa4),_0x1d3c16=mergeValidationErrors(_0x438c5e,_0x46c773),_0x32899e=isObjectRecord(_0x5da62d)&&typeof _0x5da62d[_0x250936(0x99)]==='string'?_0x5da62d[_0x250936(0x99)]:undefined;return{'manifest':_0x2146af,'report':_0x1d3c16,'normalizedManifest':_0x1d3c16['ok']?normalizeServiceTreeManifest(_0x18cfa4):undefined,'sourceHash':sha256(JSON['stringify'](_0x2146af,null,0x2)+'\x0a'),'registryIndex':_0x1d1dad,'registryServiceCode':_0x32899e};});}function mergeValidationErrors(_0x2133e3,_0x70e39d){const _0x32f42b=a42_0x355a1f,_0x5df8f3=_0x2133e3[_0x32f42b(0x8d)][_0x32f42b(0x85)](_0xaf5299=>_0xaf5299[_0x32f42b(0xcd)]===_0x32f42b(0xaa)?{..._0xaf5299,'message':_0x32f42b(0xb3)}:_0xaf5299),_0x6a53c7=[..._0x70e39d,..._0x5df8f3];return{'ok':_0x6a53c7['length']===0x0,'errors':_0x6a53c7,'warnings':_0x2133e3[_0x32f42b(0xd5)]};}function aggregateValidationReports(_0x37d680){const _0x5d2c7c=a42_0x355a1f,_0xdfb329=_0x37d680[_0x5d2c7c(0x87)](_0x2ea3a4=>_0x2ea3a4[_0x5d2c7c(0x9c)]===undefined?_0x2ea3a4[_0x5d2c7c(0xb0)][_0x5d2c7c(0x8d)]:_0x2ea3a4[_0x5d2c7c(0xb0)][_0x5d2c7c(0x8d)][_0x5d2c7c(0x85)](_0x3fad86=>({..._0x3fad86,'path':prefixRegistryIssuePath(_0x2ea3a4[_0x5d2c7c(0x9c)],_0x3fad86[_0x5d2c7c(0xba)])}))),_0x7ee28=_0x37d680['flatMap'](_0x5fe6df=>_0x5fe6df[_0x5d2c7c(0x9c)]===undefined?_0x5fe6df[_0x5d2c7c(0xb0)]['warnings']:_0x5fe6df['report'][_0x5d2c7c(0xd5)][_0x5d2c7c(0x85)](_0x26b144=>({..._0x26b144,'path':prefixRegistryIssuePath(_0x5fe6df[_0x5d2c7c(0x9c)],_0x26b144[_0x5d2c7c(0xba)])})));return{'ok':_0xdfb329['length']===0x0,'errors':_0xdfb329,'warnings':_0x7ee28};}function a42_0x3104(){const _0x36a26d=['startsWith','homeDir','importedAt','1449525WRHyVK','length','risk','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','manifests','.tmp','Cannot\x20write\x20service\x20registry:\x20','serviceCode','command','].manifest.','registryIndex','code','Service\x20manifest\x20file\x20not\x20found:\x20','join','find','target','1113935KlqUZW','utf8','manifest','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','1280NOeRHK','description','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','service.json','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','sourceHash','].manifest','update','9202aPGiDr','Remove\x20or\x20migrate\x20','report','$.services[','object','bff\x20target\x20requires\x20functionName.','6hDYDgt','sha256','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','commandCount','invalid','filePath','path','sort','2106168uSxjQw','Unsupported\x20schemaVersion:\x20','push','services','16641tUHyBV','49iAeihp','ENOENT','normalizedManifest','CliError','toISOString','validation','isArray','stringify','version','file','findIndex','154vcTAIl','message','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','schemaVersion','digest','Service\x20manifest\x20validation\x20failed:\x0a','56096bgzzfB','slice','empty','warnings','name','20DKCvli','trim','now','service','Local\x20service\x20not\x20found:\x20','homeDirName','map','updatedAt','flatMap','registry','138249JFjJGS','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','localeCompare','parse','errors','reduce'];a42_0x3104=function(){return _0x36a26d;};return a42_0x3104();}function prefixRegistryIssuePath(_0x21e786,_0x2f05c4){const _0x2d987c=a42_0x355a1f;if(_0x2f05c4==='$')return'$.services['+_0x21e786+_0x2d987c(0xac);if(_0x2f05c4[_0x2d987c(0x8f)]('$.'))return'$.services['+_0x21e786+_0x2d987c(0xac)+_0x2f05c4['slice'](0x1);if(_0x2f05c4[_0x2d987c(0x8f)]('$['))return _0x2d987c(0xb1)+_0x21e786+_0x2d987c(0xac)+_0x2f05c4[_0x2d987c(0xd3)](0x1);return _0x2d987c(0xb1)+_0x21e786+_0x2d987c(0x9b)+_0x2f05c4;}function isServiceRegistryLike(_0x33724b){const _0x29c2e3=a42_0x355a1f;return isObjectRecord(_0x33724b)&&_0x33724b['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x29c2e3(0xc7)](_0x33724b[_0x29c2e3(0xbf)]);}function isObjectRecord(_0x38be87){const _0x393784=a42_0x355a1f;return Boolean(_0x38be87)&&typeof _0x38be87===_0x393784(0xb2)&&!Array[_0x393784(0xc7)](_0x38be87);}function emptyServiceRegistryInspection(_0x3780f8,_0x507af5,_0x5b7103){return{'registryPath':_0x3780f8,'exists':_0x5b7103,'status':_0x507af5,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x23d25a){const _0x5b3e8f=a42_0x355a1f,_0x204432=_0x23d25a[_0x5b3e8f(0xc3)],_0x1c196a=_0x204432['commands'][_0x5b3e8f(0x85)](_0x30d155=>({'path':_0x30d155['cliPath'],'description':_0x30d155[_0x5b3e8f(0xa7)],'risk':_0x30d155[_0x5b3e8f(0x94)],'targetKind':_0x30d155[_0x5b3e8f(0xa1)]['kind'],'targetCommand':_0x30d155['target'][_0x5b3e8f(0x9a)]}));return{'serviceCode':_0x23d25a[_0x5b3e8f(0x99)],'name':_0x204432[_0x5b3e8f(0x82)][_0x5b3e8f(0xd6)],'description':_0x204432[_0x5b3e8f(0x82)][_0x5b3e8f(0xa7)],'version':_0x23d25a[_0x5b3e8f(0xc9)],'importedAt':_0x23d25a[_0x5b3e8f(0x91)],'source':_0x23d25a['source'],'commandCount':_0x1c196a[_0x5b3e8f(0x93)],'commands':_0x1c196a};}function sha256(_0xa38ed5){const _0x25c478=a42_0x355a1f;return createHash(_0x25c478(0xb5))[_0x25c478(0xad)](_0xa38ed5)[_0x25c478(0xd0)]('hex');}
@@ -1 +1 @@
1
- const a43_0xe7c030=a43_0x3a1e;(function(_0x5eb530,_0x4b298b){const _0x511ecb=a43_0x3a1e,_0x2181a9=_0x5eb530();while(!![]){try{const _0x1fb534=-parseInt(_0x511ecb(0x15c))/0x1+parseInt(_0x511ecb(0x16a))/0x2+-parseInt(_0x511ecb(0x156))/0x3+parseInt(_0x511ecb(0x165))/0x4+parseInt(_0x511ecb(0x153))/0x5*(-parseInt(_0x511ecb(0x151))/0x6)+parseInt(_0x511ecb(0x168))/0x7*(parseInt(_0x511ecb(0x158))/0x8)+-parseInt(_0x511ecb(0x15e))/0x9*(-parseInt(_0x511ecb(0x162))/0xa);if(_0x1fb534===_0x4b298b)break;else _0x2181a9['push'](_0x2181a9['shift']());}catch(_0x45ed29){_0x2181a9['push'](_0x2181a9['shift']());}}}(a43_0xc466,0xdc5e8));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';function a43_0x3a1e(_0x108489,_0x1f358b){_0x108489=_0x108489-0x146;const _0xc466ef=a43_0xc466();let _0x3a1ed4=_0xc466ef[_0x108489];return _0x3a1ed4;}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':a43_0xe7c030(0x154),'command':'create','description':a43_0xe7c030(0x150),'risk':a43_0xe7c030(0x14c),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0xb4fff7){const _0x336c3d=a43_0xe7c030,_0x6e6a90=buildSkillCreatePlan(_0xb4fff7['str'](_0x336c3d(0x15d)),_0xb4fff7[_0x336c3d(0x149)](_0x336c3d(0x163)),_0xb4fff7['str'](_0x336c3d(0x146)));return{'method':_0x336c3d(0x166),'url':_0x6e6a90[_0x336c3d(0x164)],'body':{'skillName':_0x6e6a90[_0x336c3d(0x167)][_0x336c3d(0x169)],'type':_0x6e6a90[_0x336c3d(0x167)]['type'],'selfContained':!![],'files':_0x6e6a90[_0x336c3d(0x167)][_0x336c3d(0x15f)][_0x336c3d(0x161)](_0x570638=>_0x570638['path'])},'description':_0x336c3d(0x14a)};},async 'execute'(_0x57092c){const _0xc59d80=a43_0xe7c030,_0x3d6295=buildSkillCreatePlan(_0x57092c['str'](_0xc59d80(0x15d)),_0x57092c[_0xc59d80(0x149)](_0xc59d80(0x163)),_0x57092c[_0xc59d80(0x149)]('target'));return writeSkillDraft(_0x3d6295,_0x57092c[_0xc59d80(0x14d)](_0xc59d80(0x15b))),{'ok':!![],'data':{'skillName':_0x3d6295[_0xc59d80(0x167)][_0xc59d80(0x169)],'type':_0x3d6295[_0xc59d80(0x167)]['type'],'dir':_0x3d6295[_0xc59d80(0x164)],'files':_0x3d6295[_0xc59d80(0x167)][_0xc59d80(0x15f)][_0xc59d80(0x161)](_0x4f39b5=>_0x4f39b5[_0xc59d80(0x157)])},'message':_0xc59d80(0x159)+_0x3d6295[_0xc59d80(0x167)][_0xc59d80(0x169)]};}};function buildSkillCreatePlan(_0xbf21f6,_0x5605e7,_0x397c00){const _0x27e6a5=a43_0xe7c030,_0x58e0d6=_0x5605e7[_0x27e6a5(0x147)](),_0x3c4f91=renderSkillTemplate({'skillName':_0xbf21f6,'type':_0x58e0d6});!_0x58e0d6&&writeCliSideChannelLine('Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.');const _0xe99e53=resolve(normalizeSkillTarget(_0x397c00));return{'rendered':_0x3c4f91,'targetRoot':_0xe99e53,'skillDir':resolve(_0xe99e53,_0x3c4f91[_0x27e6a5(0x169)])};}function normalizeSkillTarget(_0x37f730){const _0x4d64ad=a43_0xe7c030;return(_0x37f730||DEFAULT_SKILL_TARGET)[_0x4d64ad(0x147)]()||DEFAULT_SKILL_TARGET;}function a43_0xc466(){const _0x1615b2=['创建本地自包含的运行态\x20Skill\x20草稿','42vPbuDZ','Refusing\x20to\x20overwrite\x20symlink:\x20','57560nhDROg','skill','isDirectory','1687017nuaUwX','path','1005048DDmjkZ','Created\x20local\x20Skill\x20draft\x20','Skill\x20directory\x20already\x20exists:\x20','force','1361002zIqcdZ','name','90THHOqJ','files','content','map','2450130IgpEDB','type','skillDir','106148DfAcWP','WRITE','rendered','21nkxLCz','skillName','105994zvzxWF','target','trim','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','str','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','read','bool','utf8','isSymbolicLink'];a43_0xc466=function(){return _0x1615b2;};return a43_0xc466();}function writeSkillDraft(_0x555366,_0x1722f6){const _0x5b5839=a43_0xe7c030;if(existsSync(_0x555366[_0x5b5839(0x164)])){const _0x5cbbab=lstatSync(_0x555366[_0x5b5839(0x164)]);if(!_0x5cbbab[_0x5b5839(0x155)]()||_0x5cbbab[_0x5b5839(0x14f)]())throw CliErrors['validation'](_0x5b5839(0x14b)+_0x555366[_0x5b5839(0x164)]);if(!_0x1722f6)throw CliErrors['validation'](_0x5b5839(0x15a)+_0x555366[_0x5b5839(0x164)],_0x5b5839(0x148));}for(const _0x1bec0e of _0x555366[_0x5b5839(0x167)]['files']){const _0x28e107=resolve(_0x555366[_0x5b5839(0x164)],_0x1bec0e[_0x5b5839(0x157)]),_0x20e1a2=dirname(_0x28e107);mkdirSync(_0x20e1a2,{'recursive':!![]});if(existsSync(_0x28e107)&&lstatSync(_0x28e107)[_0x5b5839(0x14f)]())throw CliErrors['validation'](_0x5b5839(0x152)+_0x28e107);writeFileSync(_0x28e107,_0x1bec0e[_0x5b5839(0x160)],_0x5b5839(0x14e));}}
1
+ const a43_0x5745f2=a43_0x23c6;function a43_0x1d7b(){const _0x29ab75=['path','Created\x20local\x20Skill\x20draft\x20','Refusing\x20to\x20overwrite\x20symlink:\x20','skill','skillName','skillDir','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','48501AWDSmK','target','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','2045193FaLtsj','validation','创建本地自包含的运行态\x20Skill\x20草稿','read','4017461trmWeI','files','2420RPlOhd','2020SNDfJi','force','trim','type','2226FZRQLM','3354140MPxxfc','199574fWzeqJ','WRITE','str','isSymbolicLink','bool','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','name','rendered','15IGqPgN','map','836752WKkrNu','create'];a43_0x1d7b=function(){return _0x29ab75;};return a43_0x1d7b();}(function(_0x452871,_0x4f8799){const _0x579b03=a43_0x23c6,_0x386a1b=_0x452871();while(!![]){try{const _0x4df172=-parseInt(_0x579b03(0x172))/0x1*(-parseInt(_0x579b03(0x16a))/0x2)+-parseInt(_0x579b03(0x15d))/0x3+-parseInt(_0x579b03(0x169))/0x4+parseInt(_0x579b03(0x163))/0x5*(parseInt(_0x579b03(0x168))/0x6)+-parseInt(_0x579b03(0x161))/0x7+parseInt(_0x579b03(0x174))/0x8+-parseInt(_0x579b03(0x15a))/0x9*(-parseInt(_0x579b03(0x164))/0xa);if(_0x4df172===_0x4f8799)break;else _0x386a1b['push'](_0x386a1b['shift']());}catch(_0x362a88){_0x386a1b['push'](_0x386a1b['shift']());}}}(a43_0x1d7b,0xbd4b8));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';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a43_0x5745f2(0x179),'command':a43_0x5745f2(0x175),'description':a43_0x5745f2(0x15f),'risk':a43_0x5745f2(0x160),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x4f2df4){const _0xac97e3=a43_0x5745f2,_0x33cbc5=buildSkillCreatePlan(_0x4f2df4['str']('name'),_0x4f2df4['str'](_0xac97e3(0x167)),_0x4f2df4['str'](_0xac97e3(0x15b)));return{'method':_0xac97e3(0x16b),'url':_0x33cbc5[_0xac97e3(0x158)],'body':{'skillName':_0x33cbc5[_0xac97e3(0x171)][_0xac97e3(0x157)],'type':_0x33cbc5[_0xac97e3(0x171)]['type'],'selfContained':!![],'files':_0x33cbc5[_0xac97e3(0x171)][_0xac97e3(0x162)][_0xac97e3(0x173)](_0x5220dd=>_0x5220dd[_0xac97e3(0x176)])},'description':_0xac97e3(0x15c)};},async 'execute'(_0x223f3e){const _0x1f5008=a43_0x5745f2,_0x24264e=buildSkillCreatePlan(_0x223f3e['str'](_0x1f5008(0x170)),_0x223f3e[_0x1f5008(0x16c)](_0x1f5008(0x167)),_0x223f3e[_0x1f5008(0x16c)](_0x1f5008(0x15b)));return writeSkillDraft(_0x24264e,_0x223f3e[_0x1f5008(0x16e)](_0x1f5008(0x165))),{'ok':!![],'data':{'skillName':_0x24264e[_0x1f5008(0x171)][_0x1f5008(0x157)],'type':_0x24264e[_0x1f5008(0x171)]['type'],'dir':_0x24264e[_0x1f5008(0x158)],'files':_0x24264e[_0x1f5008(0x171)][_0x1f5008(0x162)][_0x1f5008(0x173)](_0x47c02a=>_0x47c02a[_0x1f5008(0x176)])},'message':_0x1f5008(0x177)+_0x24264e[_0x1f5008(0x171)]['skillName']};}};function buildSkillCreatePlan(_0xe259c3,_0x3038db,_0x26515b){const _0x4656a3=a43_0x5745f2,_0x5309eb=_0x3038db[_0x4656a3(0x166)](),_0x30b3de=renderSkillTemplate({'skillName':_0xe259c3,'type':_0x5309eb});!_0x5309eb&&writeCliSideChannelLine(_0x4656a3(0x159));const _0x3e7cbf=resolve(normalizeSkillTarget(_0x26515b));return{'rendered':_0x30b3de,'targetRoot':_0x3e7cbf,'skillDir':resolve(_0x3e7cbf,_0x30b3de[_0x4656a3(0x157)])};}function a43_0x23c6(_0x1a5137,_0x5d4712){_0x1a5137=_0x1a5137-0x157;const _0x1d7b4d=a43_0x1d7b();let _0x23c648=_0x1d7b4d[_0x1a5137];return _0x23c648;}function normalizeSkillTarget(_0x1ff972){const _0x38c01a=a43_0x5745f2;return(_0x1ff972||DEFAULT_SKILL_TARGET)[_0x38c01a(0x166)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x37e359,_0x4b6b02){const _0x42e30e=a43_0x5745f2;if(existsSync(_0x37e359[_0x42e30e(0x158)])){const _0x244b02=lstatSync(_0x37e359['skillDir']);if(!_0x244b02['isDirectory']()||_0x244b02[_0x42e30e(0x16d)]())throw CliErrors[_0x42e30e(0x15e)]('Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20'+_0x37e359[_0x42e30e(0x158)]);if(!_0x4b6b02)throw CliErrors[_0x42e30e(0x15e)]('Skill\x20directory\x20already\x20exists:\x20'+_0x37e359['skillDir'],_0x42e30e(0x16f));}for(const _0x304368 of _0x37e359[_0x42e30e(0x171)][_0x42e30e(0x162)]){const _0x1adca3=resolve(_0x37e359['skillDir'],_0x304368[_0x42e30e(0x176)]),_0x4b88b9=dirname(_0x1adca3);mkdirSync(_0x4b88b9,{'recursive':!![]});if(existsSync(_0x1adca3)&&lstatSync(_0x1adca3)['isSymbolicLink']())throw CliErrors[_0x42e30e(0x15e)](_0x42e30e(0x178)+_0x1adca3);writeFileSync(_0x1adca3,_0x304368['content'],'utf8');}}
@@ -1 +1 @@
1
- const a44_0x4f9905=a44_0x3b4e;(function(_0x44ccc2,_0x1c47fa){const _0x2bd6c5=a44_0x3b4e,_0x468147=_0x44ccc2();while(!![]){try{const _0x25477f=parseInt(_0x2bd6c5(0xfb))/0x1*(-parseInt(_0x2bd6c5(0x105))/0x2)+-parseInt(_0x2bd6c5(0x104))/0x3+-parseInt(_0x2bd6c5(0xee))/0x4*(parseInt(_0x2bd6c5(0xe8))/0x5)+parseInt(_0x2bd6c5(0xf3))/0x6+-parseInt(_0x2bd6c5(0x109))/0x7+parseInt(_0x2bd6c5(0x103))/0x8+parseInt(_0x2bd6c5(0x113))/0x9*(parseInt(_0x2bd6c5(0xfe))/0xa);if(_0x25477f===_0x1c47fa)break;else _0x468147['push'](_0x468147['shift']());}catch(_0x45bf22){_0x468147['push'](_0x468147['shift']());}}}(a44_0x3546,0xeeef0));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';function a44_0x3b4e(_0x5d30f9,_0x180bfe){_0x5d30f9=_0x5d30f9-0xe3;const _0x35462f=a44_0x3546();let _0x3b4ee2=_0x35462f[_0x5d30f9];return _0x3b4ee2;}function a44_0x3546(){const _0x14c1b7=['source-fingerprint','skill','isInteger','diagram-validate','64795LJLACu','Skill\x20diagram\x20validation\x20passed\x20for\x20','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','read','write','test','140YfKMON','diagram-file','str','Updated',';\x20next\x20write\x20expects\x20revision\x20','6281820odIftC','trim','diagram-push','validation',';\x20first\x20write\x20expects\x20revision\x20','company','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','scope','112659XswKPG','skill-code','version','460lEbkJK','为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','\x20Skill\x20diagram\x20for\x20','将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','expectedDiagramRevision','7725200ibWEGp','3357513xfSWSy','34CeizSk','created','action','Created','1627507DRiOcE','\x20is\x20unchanged.','Found\x20Skill\x20diagram\x20for\x20','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','found','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','personal','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','Skill\x20diagram\x20for\x20','525618ZuzuPb','skillCode','appCode'];a44_0x3546=function(){return _0x14c1b7;};return a44_0x3546();}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(_0x2c9f07){const _0x5377c3=a44_0x3b4e,_0x2188a7=_0x2c9f07['str'](_0x5377c3(0xfc))['trim'](),_0x3e7f5d=_0x2c9f07['str'](_0x5377c3(0xfd))[_0x5377c3(0xf4)](),_0x1a82dc=_0x2c9f07[_0x5377c3(0xf0)]('scope');if(!_0x2188a7||!_0x3e7f5d||_0x1a82dc!==_0x5377c3(0x10f)&&_0x1a82dc!==_0x5377c3(0xf8))throw CliErrors[_0x5377c3(0xf6)](_0x5377c3(0xf9));return{'skillCode':_0x2188a7,'version':_0x3e7f5d,'scope':_0x1a82dc};}async function readDiagramWriteInput(_0x12fd2c){const _0x39bf7d=a44_0x3b4e,_0x4e2939=_0x12fd2c['num']('expected-diagram-revision'),_0x59f47a=_0x12fd2c[_0x39bf7d(0xf0)](_0x39bf7d(0xe4))[_0x39bf7d(0xf4)]();if(!Number[_0x39bf7d(0xe6)](_0x4e2939)||_0x4e2939<0x0)throw CliErrors[_0x39bf7d(0xf6)](_0x39bf7d(0xea));if(!/^sha256:[0-9a-f]{64}$/[_0x39bf7d(0xed)](_0x59f47a))throw CliErrors[_0x39bf7d(0xf6)](_0x39bf7d(0x10c));return{'expectedDiagramRevision':_0x4e2939,'sourceFingerprint':_0x59f47a,'diagram':await readRequiredSkillDiagram(_0x12fd2c[_0x39bf7d(0xf0)](_0x39bf7d(0xef)))};}export const diagramValidateCommand={'service':'skill','command':a44_0x4f9905(0xe7),'description':a44_0x4f9905(0x10e),'risk':a44_0x4f9905(0xeb),'flags':WRITE_FLAGS,async 'execute'(_0x43c330){const _0x376b5f=a44_0x4f9905,_0x3f0550=readDiagramTarget(_0x43c330),_0x360b97=await validateRuntimeSkillVersionDiagram(_0x43c330['appCode'],_0x3f0550[_0x376b5f(0x114)],_0x3f0550[_0x376b5f(0xfd)],_0x3f0550[_0x376b5f(0xfa)],await readDiagramWriteInput(_0x43c330));return{'ok':!![],'data':_0x360b97,'message':_0x376b5f(0xe9)+_0x3f0550[_0x376b5f(0x114)]+'@'+_0x3f0550['version']+'.'};}};export const diagramPushCommand={'service':a44_0x4f9905(0xe5),'command':a44_0x4f9905(0xf5),'description':a44_0x4f9905(0xff),'risk':a44_0x4f9905(0xec),'confirmationDescription':a44_0x4f9905(0x101),'flags':WRITE_FLAGS,async 'execute'(_0x53a3a6){const _0x5a1eac=a44_0x4f9905,_0x3ad76a=readDiagramTarget(_0x53a3a6),_0x290bce=await putRuntimeSkillVersionDiagram(_0x53a3a6[_0x5a1eac(0xe3)],_0x3ad76a['skillCode'],_0x3ad76a[_0x5a1eac(0xfd)],_0x3ad76a['scope'],await readDiagramWriteInput(_0x53a3a6));return{'ok':!![],'data':_0x290bce,'message':_0x290bce['action']==='unchanged'?_0x5a1eac(0x112)+_0x3ad76a[_0x5a1eac(0x114)]+'@'+_0x3ad76a[_0x5a1eac(0xfd)]+_0x5a1eac(0x10a):(_0x290bce[_0x5a1eac(0x107)]===_0x5a1eac(0x106)?_0x5a1eac(0x108):_0x5a1eac(0xf1))+_0x5a1eac(0x100)+_0x3ad76a[_0x5a1eac(0x114)]+'@'+_0x3ad76a['version']+'.'};}};export const diagramShowCommand={'service':a44_0x4f9905(0xe5),'command':'diagram-show','description':a44_0x4f9905(0x111),'risk':a44_0x4f9905(0xeb),'flags':TARGET_FLAGS,async 'execute'(_0x467961){const _0x1b29ce=a44_0x4f9905,_0x8bdb26=readDiagramTarget(_0x467961),_0xce6a98=await getRuntimeSkillVersionDiagram(_0x467961[_0x1b29ce(0xe3)],_0x8bdb26[_0x1b29ce(0x114)],_0x8bdb26[_0x1b29ce(0xfd)],_0x8bdb26[_0x1b29ce(0xfa)]);return{'ok':!![],'data':_0xce6a98,'message':_0xce6a98[_0x1b29ce(0x10d)]?_0x1b29ce(0x10b)+_0x8bdb26[_0x1b29ce(0x114)]+'@'+_0x8bdb26[_0x1b29ce(0xfd)]+_0x1b29ce(0xf2)+_0xce6a98['expectedDiagramRevision']+'.':_0x1b29ce(0x110)+_0x8bdb26['skillCode']+'@'+_0x8bdb26['version']+_0x1b29ce(0xf7)+_0xce6a98[_0x1b29ce(0x102)]+'.'};}};
1
+ const a44_0x25fd45=a44_0x49b5;(function(_0x2ae274,_0x260c6b){const _0x990c0f=a44_0x49b5,_0x4cd81d=_0x2ae274();while(!![]){try{const _0x40f220=parseInt(_0x990c0f(0x13b))/0x1*(parseInt(_0x990c0f(0x113))/0x2)+parseInt(_0x990c0f(0x11f))/0x3*(-parseInt(_0x990c0f(0x134))/0x4)+-parseInt(_0x990c0f(0x10a))/0x5*(-parseInt(_0x990c0f(0x121))/0x6)+-parseInt(_0x990c0f(0x12a))/0x7+parseInt(_0x990c0f(0x114))/0x8*(parseInt(_0x990c0f(0x11e))/0x9)+parseInt(_0x990c0f(0x119))/0xa*(-parseInt(_0x990c0f(0x120))/0xb)+parseInt(_0x990c0f(0x10e))/0xc*(parseInt(_0x990c0f(0x11d))/0xd);if(_0x40f220===_0x260c6b)break;else _0x4cd81d['push'](_0x4cd81d['shift']());}catch(_0x1b3458){_0x4cd81d['push'](_0x4cd81d['shift']());}}}(a44_0x2c8f,0xb7d0f));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';function a44_0x49b5(_0x3422cf,_0x56e29d){_0x3422cf=_0x3422cf-0x108;const _0x2c8f9a=a44_0x2c8f();let _0x49b5b3=_0x2c8f9a[_0x3422cf];return _0x49b5b3;}function a44_0x2c8f(){const _0x3ca72b=['appCode','38839nPGaTu','created','read','30wGdEtO','diagram-file','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','skill','1356FXbkfu','str','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','company','skillCode','10ABsTky','4756408lGezqw','source-fingerprint','为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','version','diagram-push','36070OuzlLA','expectedDiagramRevision','found','personal','204971CTgFVi','9xvUkpA','1131690QfpNaF','1089vejxga','1101036ihPQWc','unchanged','Created','\x20is\x20unchanged.','expected-diagram-revision','isInteger','scope','skill-code','将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','10008313hPQruo','action','Updated','validation',';\x20next\x20write\x20expects\x20revision\x20','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','write','\x20Skill\x20diagram\x20for\x20','trim',';\x20first\x20write\x20expects\x20revision\x20','12AhmpVS','diagram-validate','Skill\x20diagram\x20for\x20','Skill\x20diagram\x20validation\x20passed\x20for\x20','Found\x20Skill\x20diagram\x20for\x20','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.'];a44_0x2c8f=function(){return _0x3ca72b;};return a44_0x2c8f();}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(_0x37cac8){const _0x3923bf=a44_0x49b5,_0x42b0d1=_0x37cac8[_0x3923bf(0x10f)](_0x3923bf(0x128))[_0x3923bf(0x132)](),_0x28f153=_0x37cac8[_0x3923bf(0x10f)]('version')[_0x3923bf(0x132)](),_0x4f6692=_0x37cac8[_0x3923bf(0x10f)](_0x3923bf(0x127));if(!_0x42b0d1||!_0x28f153||_0x4f6692!==_0x3923bf(0x11c)&&_0x4f6692!==_0x3923bf(0x111))throw CliErrors[_0x3923bf(0x12d)]('--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.');return{'skillCode':_0x42b0d1,'version':_0x28f153,'scope':_0x4f6692};}async function readDiagramWriteInput(_0x49acc5){const _0x21dae5=a44_0x49b5,_0x333a6d=_0x49acc5['num'](_0x21dae5(0x125)),_0x4d2841=_0x49acc5['str'](_0x21dae5(0x115))[_0x21dae5(0x132)]();if(!Number[_0x21dae5(0x126)](_0x333a6d)||_0x333a6d<0x0)throw CliErrors['validation']('--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.');if(!/^sha256:[0-9a-f]{64}$/['test'](_0x4d2841))throw CliErrors[_0x21dae5(0x12d)](_0x21dae5(0x139));return{'expectedDiagramRevision':_0x333a6d,'sourceFingerprint':_0x4d2841,'diagram':await readRequiredSkillDiagram(_0x49acc5[_0x21dae5(0x10f)](_0x21dae5(0x10b)))};}export const diagramValidateCommand={'service':a44_0x25fd45(0x10d),'command':a44_0x25fd45(0x135),'description':a44_0x25fd45(0x110),'risk':a44_0x25fd45(0x109),'flags':WRITE_FLAGS,async 'execute'(_0x2fbdbe){const _0x1343af=a44_0x25fd45,_0x5770f9=readDiagramTarget(_0x2fbdbe),_0x44edf7=await validateRuntimeSkillVersionDiagram(_0x2fbdbe[_0x1343af(0x13a)],_0x5770f9[_0x1343af(0x112)],_0x5770f9['version'],_0x5770f9['scope'],await readDiagramWriteInput(_0x2fbdbe));return{'ok':!![],'data':_0x44edf7,'message':_0x1343af(0x137)+_0x5770f9[_0x1343af(0x112)]+'@'+_0x5770f9[_0x1343af(0x117)]+'.'};}};export const diagramPushCommand={'service':a44_0x25fd45(0x10d),'command':a44_0x25fd45(0x118),'description':a44_0x25fd45(0x116),'risk':a44_0x25fd45(0x130),'confirmationDescription':a44_0x25fd45(0x129),'flags':WRITE_FLAGS,async 'execute'(_0x46d391){const _0x17e117=a44_0x25fd45,_0x499a46=readDiagramTarget(_0x46d391),_0x35e75c=await putRuntimeSkillVersionDiagram(_0x46d391['appCode'],_0x499a46[_0x17e117(0x112)],_0x499a46['version'],_0x499a46[_0x17e117(0x127)],await readDiagramWriteInput(_0x46d391));return{'ok':!![],'data':_0x35e75c,'message':_0x35e75c[_0x17e117(0x12b)]===_0x17e117(0x122)?_0x17e117(0x136)+_0x499a46[_0x17e117(0x112)]+'@'+_0x499a46['version']+_0x17e117(0x124):(_0x35e75c[_0x17e117(0x12b)]===_0x17e117(0x108)?_0x17e117(0x123):_0x17e117(0x12c))+_0x17e117(0x131)+_0x499a46[_0x17e117(0x112)]+'@'+_0x499a46[_0x17e117(0x117)]+'.'};}};export const diagramShowCommand={'service':'skill','command':'diagram-show','description':a44_0x25fd45(0x12f),'risk':a44_0x25fd45(0x109),'flags':TARGET_FLAGS,async 'execute'(_0x674027){const _0x419dfc=a44_0x25fd45,_0x311b09=readDiagramTarget(_0x674027),_0x1b1e45=await getRuntimeSkillVersionDiagram(_0x674027[_0x419dfc(0x13a)],_0x311b09[_0x419dfc(0x112)],_0x311b09[_0x419dfc(0x117)],_0x311b09[_0x419dfc(0x127)]);return{'ok':!![],'data':_0x1b1e45,'message':_0x1b1e45[_0x419dfc(0x11b)]?_0x419dfc(0x138)+_0x311b09[_0x419dfc(0x112)]+'@'+_0x311b09[_0x419dfc(0x117)]+_0x419dfc(0x12e)+_0x1b1e45['expectedDiagramRevision']+'.':_0x419dfc(0x10c)+_0x311b09[_0x419dfc(0x112)]+'@'+_0x311b09[_0x419dfc(0x117)]+_0x419dfc(0x133)+_0x1b1e45[_0x419dfc(0x11a)]+'.'};}};
@@ -1 +1 @@
1
- const a45_0x21cc27=a45_0xa6ec;(function(_0x3e5028,_0x14209b){const _0x32afcd=a45_0xa6ec,_0x1308bc=_0x3e5028();while(!![]){try{const _0x549309=-parseInt(_0x32afcd(0x16f))/0x1*(parseInt(_0x32afcd(0x172))/0x2)+parseInt(_0x32afcd(0x16b))/0x3*(-parseInt(_0x32afcd(0x176))/0x4)+parseInt(_0x32afcd(0x164))/0x5*(-parseInt(_0x32afcd(0x179))/0x6)+parseInt(_0x32afcd(0x166))/0x7*(parseInt(_0x32afcd(0x180))/0x8)+parseInt(_0x32afcd(0x163))/0x9+-parseInt(_0x32afcd(0x18c))/0xa+parseInt(_0x32afcd(0x17a))/0xb*(parseInt(_0x32afcd(0x161))/0xc);if(_0x549309===_0x14209b)break;else _0x1308bc['push'](_0x1308bc['shift']());}catch(_0x5484df){_0x1308bc['push'](_0x1308bc['shift']());}}}(a45_0x1e24,0x3ffd8));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_0xa6ec(_0x533a72,_0x4ddd7f){_0x533a72=_0x533a72-0x160;const _0x1e244b=a45_0x1e24();let _0xa6ec6f=_0x1e244b[_0x533a72];return _0xa6ec6f;}function a45_0x1e24(){const _0x38d19f=['removed','authRequired','1230792AzaeZS','personal','3768174kVLkiZ','5HozfXr','scope','49ttkiNJ','skillCode','read','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','filter','148020TtvEMq','production','flatMap','appCode','39356KPyxxV','../../../core/api-client.js','includes','2MloAXA','version','envName','project','40FNgYwx','\x20company\x20Skill(s).','created','1621770DxEJYm','66xGUJxd','push','length','\x20personal\x20and\x20','action','bool','189424DzHdGn','global','all','map','str','skill','company','updated','trim','skillRoots','skipped','code','1346730zVZIVM'];a45_0x1e24=function(){return _0x38d19f;};return a45_0x1e24();}export const installCommand={'service':a45_0x21cc27(0x185),'command':'install','description':a45_0x21cc27(0x169),'risk':a45_0x21cc27(0x168),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x2049db){return syncRuntimeSkills(_0x2049db);}};async function syncRuntimeSkills(_0x4a6746){const _0x1d6dde=a45_0x21cc27,{downloadRuntimeSkillPackage:_0x310e5e,listRuntimeSkills:_0x385e04}=await import(_0x1d6dde(0x170)),{linkEffectiveRuntimeSkills:_0x2934a0,materializeRuntimeSkill:_0x395cc9,pruneStaleRuntimeSkillCache:_0xd6557d,pruneStaleRuntimeSkillLinks:_0x105f81,resolveRuntimeSkillInstallTarget:_0x3421a8}=await import('../../../skills/runtime-skill-sync.js'),_0x2f54b6=_0x4a6746[_0x1d6dde(0x184)](_0x1d6dde(0x18b)),_0x3e3e78=normalizeSyncScopes(_0x4a6746[_0x1d6dde(0x184)](_0x1d6dde(0x165))),_0x42b0ad=_0x4a6746[_0x1d6dde(0x174)]??_0x1d6dde(0x16c),_0xf3c7e=_0x4a6746['accessKey'],_0x275a32=_0x4a6746[_0x1d6dde(0x17f)]('force');if(!_0xf3c7e)throw CliErrors[_0x1d6dde(0x160)]('Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.');const _0x30cca5=_0x3421a8(_0x4a6746[_0x1d6dde(0x16e)],_0x4a6746[_0x1d6dde(0x17f)](_0x1d6dde(0x175))?_0x1d6dde(0x175):_0x1d6dde(0x181)),_0x597631=_0x3421a8(_0x4a6746[_0x1d6dde(0x16e)],_0x30cca5[_0x1d6dde(0x165)]===_0x1d6dde(0x175)?_0x1d6dde(0x181):'project'),_0x44e8c0=await Promise[_0x1d6dde(0x182)](_0x3e3e78['map'](_0x5be989=>_0x385e04({'appCode':_0x4a6746[_0x1d6dde(0x16e)],'scope':_0x5be989,'code':_0x2f54b6[_0x1d6dde(0x188)]()||undefined}))),_0x5accab=_0x3e3e78[_0x1d6dde(0x171)](_0x1d6dde(0x162))?_0x44e8c0[_0x1d6dde(0x16d)]((_0x35f9e8,_0x228471)=>_0x3e3e78[_0x228471]===_0x1d6dde(0x162)?_0x35f9e8[_0x1d6dde(0x162)]:[]):[],_0x5f52cc=_0x3e3e78[_0x1d6dde(0x171)](_0x1d6dde(0x186))?_0x44e8c0[_0x1d6dde(0x16d)]((_0x4f298a,_0x170cd9)=>_0x3e3e78[_0x170cd9]===_0x1d6dde(0x186)?_0x4f298a['company']:[]):[],_0xc02d6f=new Set([..._0x5accab[_0x1d6dde(0x183)](_0x13b720=>_0x13b720['skillCode']?.['trim']())[_0x1d6dde(0x16a)](_0x143df2=>Boolean(_0x143df2)),..._0x5f52cc[_0x1d6dde(0x183)](_0x9d310a=>_0x9d310a['skillCode']?.[_0x1d6dde(0x188)]())[_0x1d6dde(0x16a)](_0x4e456d=>Boolean(_0x4e456d))]),_0x1b9bc1=_0x2f54b6['trim']()?[_0x2f54b6['trim']()]:undefined,_0x4ed34a=_0x3e3e78['length']===0x2&&_0x3e3e78[_0x1d6dde(0x171)](_0x1d6dde(0x162))&&_0x3e3e78[_0x1d6dde(0x171)](_0x1d6dde(0x186)),_0x17da9a=_0x4ed34a?_0x105f81(_0x30cca5,_0xc02d6f,_0x1b9bc1):[],_0x18cfd2=_0xd6557d({'env':_0x42b0ad,'accessKey':_0xf3c7e,'appCode':_0x4a6746[_0x1d6dde(0x16e)],'activeSkillCodes':_0xc02d6f,'pruneSkillCodes':_0x1b9bc1,'scopes':_0x3e3e78,'protectedLinkRoots':_0x597631[_0x1d6dde(0x189)]}),_0x57365b=[];for(const _0x2faf69 of _0x5accab){_0x57365b[_0x1d6dde(0x17b)](_0x395cc9(_0x2faf69,'personal',{'env':_0x42b0ad,'accessKey':_0xf3c7e,'appCode':_0x4a6746[_0x1d6dde(0x16e)],'force':_0x275a32,'packageBytes':await downloadSkillPackage(_0x2faf69,_0x1d6dde(0x162),_0x4a6746[_0x1d6dde(0x16e)],_0x310e5e)}));}for(const _0x276653 of _0x5f52cc){_0x57365b[_0x1d6dde(0x17b)](_0x395cc9(_0x276653,_0x1d6dde(0x186),{'env':_0x42b0ad,'accessKey':_0xf3c7e,'appCode':_0x4a6746[_0x1d6dde(0x16e)],'force':_0x275a32,'packageBytes':await downloadSkillPackage(_0x276653,'company',_0x4a6746[_0x1d6dde(0x16e)],_0x310e5e)}));}const _0x3a432d=_0x2934a0(_0x57365b,_0x30cca5),_0x327919=countLinkActions(_0x3a432d);return{'ok':!![],'data':{'appCode':_0x4a6746[_0x1d6dde(0x16e)],..._0x30cca5['scope']==='project'?{'installTarget':{'scope':_0x30cca5[_0x1d6dde(0x165)],'skillRoots':[..._0x30cca5[_0x1d6dde(0x189)]]}}:{},'personal':_0x5accab['length'],'company':_0x5f52cc[_0x1d6dde(0x17c)],'materialized':_0x57365b[_0x1d6dde(0x17c)],'links':{'total':_0x3a432d[_0x1d6dde(0x17c)],'created':_0x327919[_0x1d6dde(0x178)]??0x0,'updated':_0x327919[_0x1d6dde(0x187)]??0x0,'unchanged':_0x327919['unchanged']??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x17da9a[_0x1d6dde(0x16a)](_0x32aa8a=>_0x32aa8a[_0x1d6dde(0x17e)]===_0x1d6dde(0x18d))[_0x1d6dde(0x17c)],'cacheDirs':_0x18cfd2[_0x1d6dde(0x16a)](_0x328a0a=>_0x328a0a[_0x1d6dde(0x17e)]==='removed')['length'],'skipped':[..._0x17da9a,..._0x18cfd2]['filter'](_0x271081=>_0x271081[_0x1d6dde(0x17e)]===_0x1d6dde(0x18a))[_0x1d6dde(0x17c)]},'skills':{'personal':_0x5accab['map'](summarizeRuntimeSkill),'company':_0x5f52cc['map'](summarizeRuntimeSkill)}},'message':'Installed\x20'+_0x5accab[_0x1d6dde(0x17c)]+_0x1d6dde(0x17d)+_0x5f52cc[_0x1d6dde(0x17c)]+_0x1d6dde(0x177)};}async function downloadSkillPackage(_0x4016d5,_0x25066c,_0x134145,_0x386d7b){const _0x4735ba=a45_0x21cc27,_0x2aa0a1=_0x4016d5[_0x4735ba(0x173)]?.[_0x4735ba(0x188)]();return _0x2aa0a1?_0x386d7b(_0x25066c,_0x4016d5['skillCode'],_0x134145,_0x2aa0a1):_0x386d7b(_0x25066c,_0x4016d5[_0x4735ba(0x167)],_0x134145);}function countLinkActions(_0x55f892){return _0x55f892['reduce']((_0x8de794,_0x1f2c83)=>{const _0x11af45=a45_0xa6ec;return _0x8de794[_0x1f2c83[_0x11af45(0x17e)]]=(_0x8de794[_0x1f2c83[_0x11af45(0x17e)]]??0x0)+0x1,_0x8de794;},{});}
1
+ const a45_0x2a64b8=a45_0x31b4;(function(_0x13e566,_0x57cf25){const _0x8694cd=a45_0x31b4,_0x51b92a=_0x13e566();while(!![]){try{const _0x5b8533=parseInt(_0x8694cd(0x8d))/0x1*(parseInt(_0x8694cd(0x7c))/0x2)+-parseInt(_0x8694cd(0x68))/0x3*(-parseInt(_0x8694cd(0x81))/0x4)+parseInt(_0x8694cd(0x8f))/0x5+parseInt(_0x8694cd(0x80))/0x6+-parseInt(_0x8694cd(0x65))/0x7+-parseInt(_0x8694cd(0x7d))/0x8+parseInt(_0x8694cd(0x69))/0x9*(parseInt(_0x8694cd(0x79))/0xa);if(_0x5b8533===_0x57cf25)break;else _0x51b92a['push'](_0x51b92a['shift']());}catch(_0x2684ab){_0x51b92a['push'](_0x51b92a['shift']());}}}(a45_0x1a5f,0xbb876));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';function a45_0x1a5f(){const _0x2dfd46=['Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','company','\x20personal\x20and\x20','skillCode','scope','unchanged','trim','version','read','push','62910ZoEVin','\x20company\x20Skill(s).','606180dXrgAP','all','reduce','code','../../../skills/runtime-skill-sync.js','10378970eslYsw','project','action','1791szIpiP','1864170OEnvBS','length','accessKey','created','updated','skillRoots','bool','includes','install','flatMap','map','str','personal','envName','global','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','50fzwHvC','filter','appCode','10HDmmYR','9253112ItZIwZ','force','Installed\x20','2929836JUYpaO','9700apvtPt','skipped'];a45_0x1a5f=function(){return _0x2dfd46;};return a45_0x1a5f();}function a45_0x31b4(_0xaf786,_0x9db806){_0xaf786=_0xaf786-0x65;const _0x1a5f90=a45_0x1a5f();let _0x31b424=_0x1a5f90[_0xaf786];return _0x31b424;}import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':'skill','command':a45_0x2a64b8(0x71),'description':a45_0x2a64b8(0x78),'risk':a45_0x2a64b8(0x8b),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x16a3b2){return syncRuntimeSkills(_0x16a3b2);}};async function syncRuntimeSkills(_0x70a832){const _0x3c8ee2=a45_0x2a64b8,{downloadRuntimeSkillPackage:_0x4efe49,listRuntimeSkills:_0x16e34e}=await import('../../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0xf9cffa,materializeRuntimeSkill:_0x34cca7,pruneStaleRuntimeSkillCache:_0xfed17f,pruneStaleRuntimeSkillLinks:_0x5c4c25,resolveRuntimeSkillInstallTarget:_0x303e70}=await import(_0x3c8ee2(0x93)),_0x3c5d38=_0x70a832[_0x3c8ee2(0x74)](_0x3c8ee2(0x92)),_0x25540c=normalizeSyncScopes(_0x70a832[_0x3c8ee2(0x74)]('scope')),_0x55dd9f=_0x70a832[_0x3c8ee2(0x76)]??'production',_0x5050fa=_0x70a832[_0x3c8ee2(0x6b)],_0x131af3=_0x70a832[_0x3c8ee2(0x6f)](_0x3c8ee2(0x7e));if(!_0x5050fa)throw CliErrors['authRequired'](_0x3c8ee2(0x83));const _0x2f08e0=_0x303e70(_0x70a832['appCode'],_0x70a832[_0x3c8ee2(0x6f)](_0x3c8ee2(0x66))?_0x3c8ee2(0x66):_0x3c8ee2(0x77)),_0xc065af=_0x303e70(_0x70a832[_0x3c8ee2(0x7b)],_0x2f08e0[_0x3c8ee2(0x87)]===_0x3c8ee2(0x66)?_0x3c8ee2(0x77):'project'),_0x4b6b58=await Promise[_0x3c8ee2(0x90)](_0x25540c[_0x3c8ee2(0x73)](_0x597218=>_0x16e34e({'appCode':_0x70a832[_0x3c8ee2(0x7b)],'scope':_0x597218,'code':_0x3c5d38[_0x3c8ee2(0x89)]()||undefined}))),_0x286183=_0x25540c[_0x3c8ee2(0x70)](_0x3c8ee2(0x75))?_0x4b6b58['flatMap']((_0x2d16bb,_0x94419e)=>_0x25540c[_0x94419e]===_0x3c8ee2(0x75)?_0x2d16bb['personal']:[]):[],_0x3ae431=_0x25540c[_0x3c8ee2(0x70)](_0x3c8ee2(0x84))?_0x4b6b58[_0x3c8ee2(0x72)]((_0x38d9c0,_0x4e213c)=>_0x25540c[_0x4e213c]==='company'?_0x38d9c0[_0x3c8ee2(0x84)]:[]):[],_0xc81d11=new Set([..._0x286183[_0x3c8ee2(0x73)](_0xfcee8c=>_0xfcee8c[_0x3c8ee2(0x86)]?.['trim']())[_0x3c8ee2(0x7a)](_0x5867fd=>Boolean(_0x5867fd)),..._0x3ae431[_0x3c8ee2(0x73)](_0xee3840=>_0xee3840[_0x3c8ee2(0x86)]?.[_0x3c8ee2(0x89)]())[_0x3c8ee2(0x7a)](_0x49e7e3=>Boolean(_0x49e7e3))]),_0x292b4c=_0x3c5d38['trim']()?[_0x3c5d38['trim']()]:undefined,_0xc2ee0a=_0x25540c[_0x3c8ee2(0x6a)]===0x2&&_0x25540c[_0x3c8ee2(0x70)](_0x3c8ee2(0x75))&&_0x25540c[_0x3c8ee2(0x70)]('company'),_0x4c58c7=_0xc2ee0a?_0x5c4c25(_0x2f08e0,_0xc81d11,_0x292b4c):[],_0x56f727=_0xfed17f({'env':_0x55dd9f,'accessKey':_0x5050fa,'appCode':_0x70a832[_0x3c8ee2(0x7b)],'activeSkillCodes':_0xc81d11,'pruneSkillCodes':_0x292b4c,'scopes':_0x25540c,'protectedLinkRoots':_0xc065af['skillRoots']}),_0x5ca198=[];for(const _0x23afbd of _0x286183){_0x5ca198[_0x3c8ee2(0x8c)](_0x34cca7(_0x23afbd,'personal',{'env':_0x55dd9f,'accessKey':_0x5050fa,'appCode':_0x70a832[_0x3c8ee2(0x7b)],'force':_0x131af3,'packageBytes':await downloadSkillPackage(_0x23afbd,_0x3c8ee2(0x75),_0x70a832[_0x3c8ee2(0x7b)],_0x4efe49)}));}for(const _0x3d760c of _0x3ae431){_0x5ca198[_0x3c8ee2(0x8c)](_0x34cca7(_0x3d760c,_0x3c8ee2(0x84),{'env':_0x55dd9f,'accessKey':_0x5050fa,'appCode':_0x70a832['appCode'],'force':_0x131af3,'packageBytes':await downloadSkillPackage(_0x3d760c,'company',_0x70a832[_0x3c8ee2(0x7b)],_0x4efe49)}));}const _0x4bbf1f=_0xf9cffa(_0x5ca198,_0x2f08e0),_0x2bc5d1=countLinkActions(_0x4bbf1f);return{'ok':!![],'data':{'appCode':_0x70a832[_0x3c8ee2(0x7b)],..._0x2f08e0[_0x3c8ee2(0x87)]===_0x3c8ee2(0x66)?{'installTarget':{'scope':_0x2f08e0[_0x3c8ee2(0x87)],'skillRoots':[..._0x2f08e0[_0x3c8ee2(0x6e)]]}}:{},'personal':_0x286183[_0x3c8ee2(0x6a)],'company':_0x3ae431['length'],'materialized':_0x5ca198[_0x3c8ee2(0x6a)],'links':{'total':_0x4bbf1f[_0x3c8ee2(0x6a)],'created':_0x2bc5d1[_0x3c8ee2(0x6c)]??0x0,'updated':_0x2bc5d1[_0x3c8ee2(0x6d)]??0x0,'unchanged':_0x2bc5d1[_0x3c8ee2(0x88)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x4c58c7[_0x3c8ee2(0x7a)](_0x12442b=>_0x12442b[_0x3c8ee2(0x67)]==='removed')[_0x3c8ee2(0x6a)],'cacheDirs':_0x56f727[_0x3c8ee2(0x7a)](_0x4c8c38=>_0x4c8c38[_0x3c8ee2(0x67)]==='removed')[_0x3c8ee2(0x6a)],'skipped':[..._0x4c58c7,..._0x56f727][_0x3c8ee2(0x7a)](_0x5cbdd5=>_0x5cbdd5[_0x3c8ee2(0x67)]===_0x3c8ee2(0x82))['length']},'skills':{'personal':_0x286183['map'](summarizeRuntimeSkill),'company':_0x3ae431['map'](summarizeRuntimeSkill)}},'message':_0x3c8ee2(0x7f)+_0x286183['length']+_0x3c8ee2(0x85)+_0x3ae431[_0x3c8ee2(0x6a)]+_0x3c8ee2(0x8e)};}async function downloadSkillPackage(_0x175da6,_0x2b6387,_0x5f3fb9,_0x4c0c43){const _0x4c705c=a45_0x2a64b8,_0xc07b0b=_0x175da6[_0x4c705c(0x8a)]?.[_0x4c705c(0x89)]();return _0xc07b0b?_0x4c0c43(_0x2b6387,_0x175da6['skillCode'],_0x5f3fb9,_0xc07b0b):_0x4c0c43(_0x2b6387,_0x175da6['skillCode'],_0x5f3fb9);}function countLinkActions(_0x1170df){const _0x1f675f=a45_0x2a64b8;return _0x1170df[_0x1f675f(0x91)]((_0x12f99c,_0x40d4ef)=>{const _0x11dd1e=_0x1f675f;return _0x12f99c[_0x40d4ef[_0x11dd1e(0x67)]]=(_0x12f99c[_0x40d4ef[_0x11dd1e(0x67)]]??0x0)+0x1,_0x12f99c;},{});}
@@ -1 +1 @@
1
- const a46_0x28a4bd=a46_0x2e13;(function(_0x4127b4,_0x1f932b){const _0x4d816c=a46_0x2e13,_0x2e5078=_0x4127b4();while(!![]){try{const _0xf91ffa=-parseInt(_0x4d816c(0x1ea))/0x1+-parseInt(_0x4d816c(0x1f1))/0x2*(-parseInt(_0x4d816c(0x1e7))/0x3)+parseInt(_0x4d816c(0x1ef))/0x4+parseInt(_0x4d816c(0x1ed))/0x5+parseInt(_0x4d816c(0x1f8))/0x6*(-parseInt(_0x4d816c(0x1e6))/0x7)+parseInt(_0x4d816c(0x1e5))/0x8*(-parseInt(_0x4d816c(0x1d6))/0x9)+-parseInt(_0x4d816c(0x1f6))/0xa*(parseInt(_0x4d816c(0x1e2))/0xb);if(_0xf91ffa===_0x1f932b)break;else _0x2e5078['push'](_0x2e5078['shift']());}catch(_0x19d133){_0x2e5078['push'](_0x2e5078['shift']());}}}(a46_0x5716,0x72cbc));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';function a46_0x5716(){const _0x5c84be=['10fGxYAg','production','6vIHznN','7956kMVDtZ','read','local','personal','bool','\x20local\x20Skill(s).','filter','project','global','code','skill','remote','4991767fQNtdH','company','Listed\x20','2008BmkyYY','1402317HBVuPk','2331cyQpEF','../../../core/api-client.js','../../../skills/runtime-skill-sync.js','154075qkVgHx','scope','\x20remote\x20Skill(s).','2544380lacUEd','list','2352608jdRGZF','length','1038EbEZZm','map','builtin','accessKey','appCode'];a46_0x5716=function(){return _0x5c84be;};return a46_0x5716();}import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a46_0x28a4bd(0x1e0),'command':a46_0x28a4bd(0x1ee),'description':'List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','risk':a46_0x28a4bd(0x1d7),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x11ddcb){const _0x45092f=a46_0x28a4bd,_0xf43eb4=_0x11ddcb['str'](_0x45092f(0x1df)),_0x44e827=normalizeListScope(_0x11ddcb['str'](_0x45092f(0x1eb)));if(_0x11ddcb[_0x45092f(0x1da)](_0x45092f(0x1d8))){const _0x289bf1=_0x11ddcb[_0x45092f(0x1f4)];if(!_0x289bf1)throw CliErrors['authRequired']();const {listLocalRuntimeSkills:_0x12efe6,resolveRuntimeSkillInstallTarget:_0x3d6fbf}=await import(_0x45092f(0x1e9)),_0x6e3ae0=_0x3d6fbf(_0x11ddcb[_0x45092f(0x1f5)],_0x11ddcb[_0x45092f(0x1da)]('project')?_0x45092f(0x1dd):_0x45092f(0x1de)),_0x135438=_0x12efe6({'env':_0x11ddcb['envName']??_0x45092f(0x1f7),'accessKey':_0x289bf1,'appCode':_0x11ddcb[_0x45092f(0x1f5)],'scopes':listScopeToRuntimeScopes(_0x44e827),'code':_0xf43eb4['trim']()||undefined},_0x6e3ae0),_0x506e32=groupLocalRuntimeSkills(_0x135438);return{'ok':!![],'data':{'appCode':_0x11ddcb[_0x45092f(0x1f5)],'source':'local',..._0x6e3ae0[_0x45092f(0x1eb)]===_0x45092f(0x1dd)?{'installScope':_0x6e3ae0[_0x45092f(0x1eb)]}:{},'scope':_0x44e827,'total':_0x135438[_0x45092f(0x1f0)],'personal':_0x506e32[_0x45092f(0x1d9)]['length'],'company':_0x506e32[_0x45092f(0x1e3)][_0x45092f(0x1f0)],'items':_0x135438[_0x45092f(0x1f2)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x506e32['personal'][_0x45092f(0x1f2)](summarizeLocalRuntimeSkill),'company':_0x506e32[_0x45092f(0x1e3)]['map'](summarizeLocalRuntimeSkill)}},'message':_0x45092f(0x1e4)+_0x135438['length']+_0x45092f(0x1db)};}const {listRuntimeSkills:_0x3d2838}=await import(_0x45092f(0x1e8)),_0x28e005=await _0x3d2838({'appCode':_0x11ddcb[_0x45092f(0x1f5)],'scope':listScopeToRemoteScope(_0x44e827),'code':_0xf43eb4['trim']()||undefined}),_0x8da2e5=shouldListScope(_0x44e827,_0x45092f(0x1d9))?_0x28e005[_0x45092f(0x1d9)]??[]:[],_0x64d060=shouldListScope(_0x44e827,_0x45092f(0x1e3))?_0x28e005[_0x45092f(0x1e3)]??[]:[],_0x578b0c=[..._0x8da2e5,..._0x64d060];return{'ok':!![],'data':{'appCode':_0x11ddcb[_0x45092f(0x1f5)],'source':_0x45092f(0x1e1),'scope':_0x44e827,'total':_0x578b0c[_0x45092f(0x1f0)],'personal':_0x8da2e5['length'],'company':_0x64d060['length'],'items':_0x578b0c[_0x45092f(0x1f2)](summarizeRuntimeSkill),'skills':{'personal':_0x8da2e5['map'](summarizeRuntimeSkill),'company':_0x64d060[_0x45092f(0x1f2)](summarizeRuntimeSkill)}},'message':'Listed\x20'+_0x578b0c[_0x45092f(0x1f0)]+_0x45092f(0x1ec)};}};function a46_0x2e13(_0x5de993,_0x202a4c){_0x5de993=_0x5de993-0x1d6;const _0x57169d=a46_0x5716();let _0x2e135d=_0x57169d[_0x5de993];return _0x2e135d;}function groupLocalRuntimeSkills(_0x17b5b4){const _0x51cb23=a46_0x28a4bd;return{'personal':_0x17b5b4[_0x51cb23(0x1dc)](_0x2871d7=>_0x2871d7['scope']===_0x51cb23(0x1d9)),'company':_0x17b5b4[_0x51cb23(0x1dc)](_0x35367a=>_0x35367a[_0x51cb23(0x1eb)]===_0x51cb23(0x1e3)),'builtin':_0x17b5b4[_0x51cb23(0x1dc)](_0x50a75b=>_0x50a75b[_0x51cb23(0x1eb)]===_0x51cb23(0x1f3))};}
1
+ const a46_0x5c9907=a46_0x2780;(function(_0x406ba7,_0x239c31){const _0x13babb=a46_0x2780,_0x550f04=_0x406ba7();while(!![]){try{const _0x2ce7ba=-parseInt(_0x13babb(0xb3))/0x1*(-parseInt(_0x13babb(0x9f))/0x2)+-parseInt(_0x13babb(0xab))/0x3*(-parseInt(_0x13babb(0xb4))/0x4)+parseInt(_0x13babb(0x99))/0x5+parseInt(_0x13babb(0xb0))/0x6+-parseInt(_0x13babb(0x96))/0x7*(parseInt(_0x13babb(0xa1))/0x8)+-parseInt(_0x13babb(0xb2))/0x9+parseInt(_0x13babb(0x98))/0xa*(-parseInt(_0x13babb(0xae))/0xb);if(_0x2ce7ba===_0x239c31)break;else _0x550f04['push'](_0x550f04['shift']());}catch(_0x435f3a){_0x550f04['push'](_0x550f04['shift']());}}}(a46_0x25d1,0x5e0e9));import{CliErrors}from'../../../errors.js';function a46_0x25d1(){const _0x54c092=['trim','scope','personal','global','list','6OvaIys','\x20remote\x20Skill(s).','company','2529769HUAmGL','Listed\x20','3152232HVJuXA','../../../core/api-client.js','5533470eXFnZj','4188HFHSym','207520nEtPQZ','code','../../../skills/runtime-skill-sync.js','length','7kNbKhT','appCode','10ICYFYH','3124900BcHnog','project','skill','str','remote','authRequired','276iEqkuu','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','4815920niCdiZ','\x20local\x20Skill(s).','map','builtin','filter'];a46_0x25d1=function(){return _0x54c092;};return a46_0x25d1();}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_0x5c9907(0x9b),'command':a46_0x5c9907(0xaa),'description':a46_0x5c9907(0xa0),'risk':'read','flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x5207a0){const _0x17cea7=a46_0x5c9907,_0x2ecaf8=_0x5207a0[_0x17cea7(0x9c)](_0x17cea7(0xb5)),_0x3eb38b=normalizeListScope(_0x5207a0[_0x17cea7(0x9c)](_0x17cea7(0xa7)));if(_0x5207a0['bool']('local')){const _0x2aad54=_0x5207a0['accessKey'];if(!_0x2aad54)throw CliErrors[_0x17cea7(0x9e)]();const {listLocalRuntimeSkills:_0x40b3c3,resolveRuntimeSkillInstallTarget:_0x253fac}=await import(_0x17cea7(0x94)),_0x1f863c=_0x253fac(_0x5207a0[_0x17cea7(0x97)],_0x5207a0['bool'](_0x17cea7(0x9a))?_0x17cea7(0x9a):_0x17cea7(0xa9)),_0x500b8b=_0x40b3c3({'env':_0x5207a0['envName']??'production','accessKey':_0x2aad54,'appCode':_0x5207a0[_0x17cea7(0x97)],'scopes':listScopeToRuntimeScopes(_0x3eb38b),'code':_0x2ecaf8[_0x17cea7(0xa6)]()||undefined},_0x1f863c),_0x4197f8=groupLocalRuntimeSkills(_0x500b8b);return{'ok':!![],'data':{'appCode':_0x5207a0[_0x17cea7(0x97)],'source':'local',..._0x1f863c[_0x17cea7(0xa7)]===_0x17cea7(0x9a)?{'installScope':_0x1f863c['scope']}:{},'scope':_0x3eb38b,'total':_0x500b8b[_0x17cea7(0x95)],'personal':_0x4197f8['personal'][_0x17cea7(0x95)],'company':_0x4197f8[_0x17cea7(0xad)]['length'],'items':_0x500b8b[_0x17cea7(0xa3)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x4197f8[_0x17cea7(0xa8)][_0x17cea7(0xa3)](summarizeLocalRuntimeSkill),'company':_0x4197f8[_0x17cea7(0xad)]['map'](summarizeLocalRuntimeSkill)}},'message':_0x17cea7(0xaf)+_0x500b8b[_0x17cea7(0x95)]+_0x17cea7(0xa2)};}const {listRuntimeSkills:_0x2eab3e}=await import(_0x17cea7(0xb1)),_0x287ac9=await _0x2eab3e({'appCode':_0x5207a0[_0x17cea7(0x97)],'scope':listScopeToRemoteScope(_0x3eb38b),'code':_0x2ecaf8[_0x17cea7(0xa6)]()||undefined}),_0x11dfa7=shouldListScope(_0x3eb38b,_0x17cea7(0xa8))?_0x287ac9[_0x17cea7(0xa8)]??[]:[],_0x32b543=shouldListScope(_0x3eb38b,_0x17cea7(0xad))?_0x287ac9[_0x17cea7(0xad)]??[]:[],_0x1f8755=[..._0x11dfa7,..._0x32b543];return{'ok':!![],'data':{'appCode':_0x5207a0[_0x17cea7(0x97)],'source':_0x17cea7(0x9d),'scope':_0x3eb38b,'total':_0x1f8755[_0x17cea7(0x95)],'personal':_0x11dfa7[_0x17cea7(0x95)],'company':_0x32b543[_0x17cea7(0x95)],'items':_0x1f8755[_0x17cea7(0xa3)](summarizeRuntimeSkill),'skills':{'personal':_0x11dfa7[_0x17cea7(0xa3)](summarizeRuntimeSkill),'company':_0x32b543[_0x17cea7(0xa3)](summarizeRuntimeSkill)}},'message':_0x17cea7(0xaf)+_0x1f8755[_0x17cea7(0x95)]+_0x17cea7(0xac)};}};function a46_0x2780(_0x123dae,_0x3052dc){_0x123dae=_0x123dae-0x94;const _0x25d1ea=a46_0x25d1();let _0x2780=_0x25d1ea[_0x123dae];return _0x2780;}function groupLocalRuntimeSkills(_0x517afc){const _0x3c51fe=a46_0x5c9907;return{'personal':_0x517afc[_0x3c51fe(0xa5)](_0x5ecb17=>_0x5ecb17['scope']==='personal'),'company':_0x517afc[_0x3c51fe(0xa5)](_0x55bd7c=>_0x55bd7c['scope']===_0x3c51fe(0xad)),'builtin':_0x517afc['filter'](_0x227d40=>_0x227d40['scope']===_0x3c51fe(0xa4))};}
@@ -1 +1 @@
1
- function a47_0x2745(){const _0x83fe9e=['将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','381736JpsQrv','1822377VhzCfO','18JMOwGg','2809308bUaTtj','10sdZgtv','skill','7501241oCQmsO','4KRRPFx','91TfZEkS','6468345sBGlpm','5322gKmYnG','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','294565BBjntk'];a47_0x2745=function(){return _0x83fe9e;};return a47_0x2745();}const a47_0x3b7acf=a47_0x7a48;(function(_0x1e8ef0,_0x154e4f){const _0x25ffe0=a47_0x7a48,_0x341977=_0x1e8ef0();while(!![]){try{const _0x4a83e4=parseInt(_0x25ffe0(0x1f7))/0x1*(-parseInt(_0x25ffe0(0x1fa))/0x2)+parseInt(_0x25ffe0(0x1ff))/0x3+-parseInt(_0x25ffe0(0x201))/0x4+parseInt(_0x25ffe0(0x1fc))/0x5*(-parseInt(_0x25ffe0(0x200))/0x6)+parseInt(_0x25ffe0(0x1f8))/0x7*(parseInt(_0x25ffe0(0x1fe))/0x8)+parseInt(_0x25ffe0(0x1f9))/0x9+-parseInt(_0x25ffe0(0x1f4))/0xa*(parseInt(_0x25ffe0(0x1f6))/0xb);if(_0x4a83e4===_0x154e4f)break;else _0x341977['push'](_0x341977['shift']());}catch(_0x18165b){_0x341977['push'](_0x341977['shift']());}}}(a47_0x2745,0x5b83c));import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';function a47_0x7a48(_0x3d9e45,_0x154f0e){_0x3d9e45=_0x3d9e45-0x1f4;const _0x274548=a47_0x2745();let _0x7a48a7=_0x274548[_0x3d9e45];return _0x7a48a7;}export const pushCommand={'service':a47_0x3b7acf(0x1f5),'command':'push','description':a47_0x3b7acf(0x1fb),'risk':'write','confirmationDescription':a47_0x3b7acf(0x1fd),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
1
+ const a47_0x1e8aa8=a47_0x4f18;(function(_0x56408e,_0x1ce18a){const _0x9371e7=a47_0x4f18,_0x18a6cb=_0x56408e();while(!![]){try{const _0x1145eb=parseInt(_0x9371e7(0x13a))/0x1+-parseInt(_0x9371e7(0x139))/0x2*(parseInt(_0x9371e7(0x130))/0x3)+parseInt(_0x9371e7(0x134))/0x4+-parseInt(_0x9371e7(0x136))/0x5+-parseInt(_0x9371e7(0x13c))/0x6*(-parseInt(_0x9371e7(0x137))/0x7)+-parseInt(_0x9371e7(0x133))/0x8+parseInt(_0x9371e7(0x138))/0x9*(parseInt(_0x9371e7(0x132))/0xa);if(_0x1145eb===_0x1ce18a)break;else _0x18a6cb['push'](_0x18a6cb['shift']());}catch(_0x35e30b){_0x18a6cb['push'](_0x18a6cb['shift']());}}}(a47_0x1a04,0xd3bdb));function a47_0x4f18(_0x2532a2,_0x3ed351){_0x2532a2=_0x2532a2-0x130;const _0x1a04fd=a47_0x1a04();let _0x4f18c9=_0x1a04fd[_0x2532a2];return _0x4f18c9;}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_0x1e8aa8(0x135),'command':a47_0x1e8aa8(0x131),'description':'将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','risk':a47_0x1e8aa8(0x13b),'confirmationDescription':'将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};function a47_0x1a04(){const _0x117f8c=['132iUzyiN','741669qRQcIM','push','935210jsKhQh','4095504IjYTFf','1230908jaxFGY','skill','5756680GxVxqu','411523neXXht','36vANvKS','2HkWamE','802619vAPgII','write'];a47_0x1a04=function(){return _0x117f8c;};return a47_0x1a04();}
@@ -1 +1 @@
1
- const a48_0x2a46f1=a48_0x4c7e;(function(_0x42d9a9,_0x4e4aad){const _0x5b942e=a48_0x4c7e,_0x1d6895=_0x42d9a9();while(!![]){try{const _0x2b4650=parseInt(_0x5b942e(0x9c))/0x1+parseInt(_0x5b942e(0x9e))/0x2+-parseInt(_0x5b942e(0x9f))/0x3*(parseInt(_0x5b942e(0x8f))/0x4)+-parseInt(_0x5b942e(0x97))/0x5*(parseInt(_0x5b942e(0x98))/0x6)+parseInt(_0x5b942e(0x99))/0x7+parseInt(_0x5b942e(0x9d))/0x8+-parseInt(_0x5b942e(0x92))/0x9;if(_0x2b4650===_0x4e4aad)break;else _0x1d6895['push'](_0x1d6895['shift']());}catch(_0xed7dd7){_0x1d6895['push'](_0x1d6895['shift']());}}}(a48_0x314a,0x66058));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';function a48_0x4c7e(_0x191f99,_0xc655fc){_0x191f99=_0x191f99-0x8f;const _0x314a41=a48_0x314a();let _0x4c7eb2=_0x314a41[_0x191f99];return _0x4c7eb2;}function a48_0x314a(){const _0x4c892d=['5431881ueskKw','strict','type','687629dBtRzA','4639096ZneilB','233582GIgRgM','66GrNZfz','skill','bool','26716crbEbW','str','dir','8681535FTOjIq','read','validate','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','Skill\x20validation\x20passed.','5lTvLPi','3785142PFnYAm'];a48_0x314a=function(){return _0x4c892d;};return a48_0x314a();}import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':a48_0x2a46f1(0xa0),'command':a48_0x2a46f1(0x94),'description':a48_0x2a46f1(0x95),'risk':a48_0x2a46f1(0x93),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x4c03ba){const _0x480735=a48_0x2a46f1,_0x30cb12=_0x4c03ba[_0x480735(0xa1)](_0x480735(0x9a)),_0x400b65=validateSkillDirectory(_0x4c03ba[_0x480735(0x90)]('dir'),{'strict':_0x30cb12});return throwIfSkillValidationFailed(_0x400b65,_0x30cb12),{'ok':!![],'data':{'dir':_0x400b65[_0x480735(0x91)],'type':_0x400b65[_0x480735(0x9b)],'errors':_0x400b65['errors'],'warnings':_0x400b65['warnings']},'message':_0x480735(0x96)};}};
1
+ function a48_0x58b8(){const _0x3308b3=['9441800pioTlw','46345MeVhdg','1053717TovOOl','752013NJAoKH','366KxGGrd','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','Skill\x20validation\x20passed.','str','40tPvEfL','28691916Mkcctb','3RRLaIY','17324wagvlO','strict','36ZueYDF','dir','630732hPjwhc','skill','read','warnings','bool'];a48_0x58b8=function(){return _0x3308b3;};return a48_0x58b8();}function a48_0x2274(_0x8a1453,_0x2ceb2a){_0x8a1453=_0x8a1453-0xe7;const _0x58b8d5=a48_0x58b8();let _0x227475=_0x58b8d5[_0x8a1453];return _0x227475;}const a48_0x32ef66=a48_0x2274;(function(_0x5ed76b,_0x192d96){const _0x1eef1c=a48_0x2274,_0x39155b=_0x5ed76b();while(!![]){try{const _0x21bee2=-parseInt(_0x1eef1c(0xed))/0x1*(-parseInt(_0x1eef1c(0xef))/0x2)+parseInt(_0x1eef1c(0xec))/0x3*(-parseInt(_0x1eef1c(0xf1))/0x4)+parseInt(_0x1eef1c(0xf7))/0x5*(-parseInt(_0x1eef1c(0xfa))/0x6)+-parseInt(_0x1eef1c(0xf8))/0x7+-parseInt(_0x1eef1c(0xea))/0x8*(parseInt(_0x1eef1c(0xf9))/0x9)+-parseInt(_0x1eef1c(0xf6))/0xa+parseInt(_0x1eef1c(0xeb))/0xb;if(_0x21bee2===_0x192d96)break;else _0x39155b['push'](_0x39155b['shift']());}catch(_0x56355e){_0x39155b['push'](_0x39155b['shift']());}}}(a48_0x58b8,0xa7238));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':a48_0x32ef66(0xf2),'command':'validate','description':a48_0x32ef66(0xe7),'risk':a48_0x32ef66(0xf3),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x39dfd5){const _0x2aae7e=a48_0x32ef66,_0x539f78=_0x39dfd5[_0x2aae7e(0xf5)](_0x2aae7e(0xee)),_0x415e1c=validateSkillDirectory(_0x39dfd5[_0x2aae7e(0xe9)]('dir'),{'strict':_0x539f78});return throwIfSkillValidationFailed(_0x415e1c,_0x539f78),{'ok':!![],'data':{'dir':_0x415e1c[_0x2aae7e(0xf0)],'type':_0x415e1c['type'],'errors':_0x415e1c['errors'],'warnings':_0x415e1c[_0x2aae7e(0xf4)]},'message':_0x2aae7e(0xe8)};}};
@@ -1 +1 @@
1
- (function(_0x305040,_0x2c32a9){const _0x301e53=a49_0x10b1,_0x31dcf8=_0x305040();while(!![]){try{const _0x39055a=parseInt(_0x301e53(0xd0))/0x1+-parseInt(_0x301e53(0xd3))/0x2+parseInt(_0x301e53(0xe0))/0x3*(parseInt(_0x301e53(0xd8))/0x4)+parseInt(_0x301e53(0xd6))/0x5*(parseInt(_0x301e53(0xe3))/0x6)+parseInt(_0x301e53(0xe2))/0x7*(parseInt(_0x301e53(0xe4))/0x8)+-parseInt(_0x301e53(0xd9))/0x9*(-parseInt(_0x301e53(0xe1))/0xa)+parseInt(_0x301e53(0xdc))/0xb*(-parseInt(_0x301e53(0xdb))/0xc);if(_0x39055a===_0x2c32a9)break;else _0x31dcf8['push'](_0x31dcf8['shift']());}catch(_0x11e24d){_0x31dcf8['push'](_0x31dcf8['shift']());}}}(a49_0x278e,0x67553));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(_0x4560bf){const _0x3adde5=a49_0x10b1;return(await readRequiredSkillDiagramInput(_0x4560bf))[_0x3adde5(0xe5)];}function a49_0x278e(){const _0x1e6f2d=['default','isFile','126QdbBIq','498790jicMov','7vMOEEN','229404yMgLxR','568680UapibN','diagram','validation','window','321713xWYprt','--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','476038IGepZi','Mermaid\x20syntax\x20validation\x20failed.','replace','100iPgrNk','defineProperties','13528QNrRyR','36fiYtQt','document','5026608asqoYn','22KHOaWS','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.'];a49_0x278e=function(){return _0x1e6f2d;};return a49_0x278e();}function a49_0x10b1(_0x208e82,_0x464933){_0x208e82=_0x208e82-0xce;const _0x278e9e=a49_0x278e();let _0x10b145=_0x278e9e[_0x208e82];return _0x10b145;}export async function readRequiredSkillDiagramInput(_0x2bec22){const _0x4b5b57=a49_0x10b1,_0x33cecd=_0x2bec22['trim']();if(!_0x33cecd)throw CliErrors['validation'](_0x4b5b57(0xd1),'Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.');let _0x1a3ca9,_0x4a9e0a;if(_0x33cecd==='-')try{_0x1a3ca9=readFileSync(0x0,'utf8');}catch{throw CliErrors[_0x4b5b57(0xce)](_0x4b5b57(0xdd));}else{const _0x5a149f=resolve(_0x33cecd);if(!existsSync(_0x5a149f))throw CliErrors['validation'](_0x4b5b57(0xd2)+_0x5a149f);if(!statSync(_0x5a149f)[_0x4b5b57(0xdf)]())throw CliErrors['validation']('Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x5a149f);_0x4a9e0a=realpathSync(_0x5a149f),_0x1a3ca9=readFileSync(_0x4a9e0a,'utf8');}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x1a3ca9)},'sourceFilePath':_0x4a9e0a};}export async function validateAndCanonicalizeMermaid(_0x5107ab){const _0x44a251=a49_0x10b1,_0x2a6ffd=_0x5107ab['replace'](/\r\n/g,'\x0a')[_0x44a251(0xd5)](/\r/g,'\x0a')[_0x44a251(0xd5)](/\n+$/,'')+'\x0a';try{const _0x3e79df=await loadMermaidApi();await _0x3e79df['parse'](_0x2a6ffd);}catch{throw diagramValidationError();}return _0x2a6ffd;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x176d95=a49_0x10b1;if(!(_0x176d95(0xcf)in globalThis)||!('document'in globalThis)){const _0x40c48f=new JSDOM('');Object[_0x176d95(0xd7)](globalThis,{'window':{'configurable':!![],'value':_0x40c48f[_0x176d95(0xcf)]},'document':{'configurable':!![],'value':_0x40c48f[_0x176d95(0xcf)][_0x176d95(0xda)]}});}return(await import('mermaid'))[_0x176d95(0xde)];})()),mermaidApiPromise;}function diagramValidationError(){const _0x13c845=a49_0x10b1;return CliErrors[_0x13c845(0xce)](_0x13c845(0xd4),'Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.');}
1
+ (function(_0x10c147,_0x31db12){const _0x33deda=a49_0x2c0b,_0x7a1bd7=_0x10c147();while(!![]){try{const _0x4bd54a=parseInt(_0x33deda(0x7a))/0x1*(parseInt(_0x33deda(0x6d))/0x2)+-parseInt(_0x33deda(0x70))/0x3+parseInt(_0x33deda(0x72))/0x4*(-parseInt(_0x33deda(0x73))/0x5)+parseInt(_0x33deda(0x84))/0x6+parseInt(_0x33deda(0x7e))/0x7+parseInt(_0x33deda(0x71))/0x8*(parseInt(_0x33deda(0x83))/0x9)+-parseInt(_0x33deda(0x6f))/0xa*(parseInt(_0x33deda(0x6c))/0xb);if(_0x4bd54a===_0x31db12)break;else _0x7a1bd7['push'](_0x7a1bd7['shift']());}catch(_0x108a73){_0x7a1bd7['push'](_0x7a1bd7['shift']());}}}(a49_0x38ee,0xe2396));import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';import{resolve}from'node:path';function a49_0x38ee(){const _0x1b3520=['3887055TQxyGx','7302870TjRgxt','isFile','Mermaid\x20syntax\x20validation\x20failed.','2167HySnTm','2ZnVrBg','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','76930qHRHRn','1444242mqSZCE','8BBiFky','1256LxEQtE','6790BHUKvQ','mermaid','parse','validation','replace','trim','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','127647LnOvMg','utf8','window','default','11012918XOIwqZ','diagram','document','Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','defineProperties'];a49_0x38ee=function(){return _0x1b3520;};return a49_0x38ee();}import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x261981){const _0x2e0f94=a49_0x2c0b;return(await readRequiredSkillDiagramInput(_0x261981))[_0x2e0f94(0x7f)];}export async function readRequiredSkillDiagramInput(_0x1a72cf){const _0x11ae2c=a49_0x2c0b,_0x2115e8=_0x1a72cf[_0x11ae2c(0x78)]();if(!_0x2115e8)throw CliErrors[_0x11ae2c(0x76)]('--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.',_0x11ae2c(0x79));let _0x496f37,_0x396000;if(_0x2115e8==='-')try{_0x496f37=readFileSync(0x0,_0x11ae2c(0x7b));}catch{throw CliErrors['validation']('Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.');}else{const _0x33a0f4=resolve(_0x2115e8);if(!existsSync(_0x33a0f4))throw CliErrors[_0x11ae2c(0x76)](_0x11ae2c(0x6e)+_0x33a0f4);if(!statSync(_0x33a0f4)[_0x11ae2c(0x6a)]())throw CliErrors[_0x11ae2c(0x76)](_0x11ae2c(0x81)+_0x33a0f4);_0x396000=realpathSync(_0x33a0f4),_0x496f37=readFileSync(_0x396000,_0x11ae2c(0x7b));}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x496f37)},'sourceFilePath':_0x396000};}export async function validateAndCanonicalizeMermaid(_0x2b19e5){const _0x45ad74=a49_0x2c0b,_0x9f674a=_0x2b19e5[_0x45ad74(0x77)](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a')[_0x45ad74(0x77)](/\n+$/,'')+'\x0a';try{const _0x33d376=await loadMermaidApi();await _0x33d376[_0x45ad74(0x75)](_0x9f674a);}catch{throw diagramValidationError();}return _0x9f674a;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x36b538=a49_0x2c0b;if(!(_0x36b538(0x7c)in globalThis)||!(_0x36b538(0x80)in globalThis)){const _0x234f09=new JSDOM('');Object[_0x36b538(0x82)](globalThis,{'window':{'configurable':!![],'value':_0x234f09[_0x36b538(0x7c)]},'document':{'configurable':!![],'value':_0x234f09['window'][_0x36b538(0x80)]}});}return(await import(_0x36b538(0x74)))[_0x36b538(0x7d)];})()),mermaidApiPromise;}function a49_0x2c0b(_0x22eb8b,_0x521104){_0x22eb8b=_0x22eb8b-0x6a;const _0x38ee77=a49_0x38ee();let _0x2c0b7b=_0x38ee77[_0x22eb8b];return _0x2c0b7b;}function diagramValidationError(){const _0x33bcd9=a49_0x2c0b;return CliErrors[_0x33bcd9(0x76)](_0x33bcd9(0x6b),'Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.');}