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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/shared.js +1 -1
  25. package/lib/commands/data/index.js +1 -1
  26. package/lib/commands/dataset/detail.js +1 -1
  27. package/lib/commands/dataset/index.js +1 -1
  28. package/lib/commands/dataset/list.js +1 -1
  29. package/lib/commands/dataset/sdk-doc.js +1 -1
  30. package/lib/commands/doctor.js +1 -1
  31. package/lib/commands/file/index.js +1 -1
  32. package/lib/commands/init.js +1 -1
  33. package/lib/commands/kb/index.js +1 -1
  34. package/lib/commands/logs/index.js +1 -1
  35. package/lib/commands/ocr/index.js +1 -1
  36. package/lib/commands/personal-bff/index.js +1 -1
  37. package/lib/commands/registry.js +1 -1
  38. package/lib/commands/schedule/index.js +1 -1
  39. package/lib/commands/schema.js +1 -1
  40. package/lib/commands/service/dynamic.js +1 -1
  41. package/lib/commands/service/function-name-adapter.js +1 -1
  42. package/lib/commands/service/index.js +1 -1
  43. package/lib/commands/service/registry.js +1 -1
  44. package/lib/commands/skill/commands/create.js +1 -1
  45. package/lib/commands/skill/commands/diagram.js +1 -1
  46. package/lib/commands/skill/commands/install.js +1 -1
  47. package/lib/commands/skill/commands/list.js +1 -1
  48. package/lib/commands/skill/commands/push.js +1 -1
  49. package/lib/commands/skill/commands/validate.js +1 -1
  50. package/lib/commands/skill/diagram.js +1 -1
  51. package/lib/commands/skill/flags.js +1 -1
  52. package/lib/commands/skill/index.js +1 -1
  53. package/lib/commands/skill/manifest-helpers.js +1 -1
  54. package/lib/commands/skill/push-execute.js +1 -1
  55. package/lib/commands/skill/push-flow-helpers.js +1 -1
  56. package/lib/commands/skill/push-retarget.js +1 -1
  57. package/lib/commands/skill/scopes.js +1 -1
  58. package/lib/commands/skill/summary.js +1 -1
  59. package/lib/commands/skill/templates.js +1 -1
  60. package/lib/commands/skill/validate.js +1 -1
  61. package/lib/commands/sql/detail.js +1 -1
  62. package/lib/commands/sql/exec.js +1 -1
  63. package/lib/commands/sql/index.js +1 -1
  64. package/lib/commands/update.js +1 -1
  65. package/lib/commands/workspace/index.js +1 -1
  66. package/lib/config/schema.js +1 -1
  67. package/lib/constant/app.js +1 -1
  68. package/lib/constant/auth-mode.js +1 -1
  69. package/lib/constant/cli.js +1 -1
  70. package/lib/constant/defaults.js +1 -1
  71. package/lib/constant/distribution.js +1 -1
  72. package/lib/constant/domain.js +1 -1
  73. package/lib/constant/env.js +1 -1
  74. package/lib/constant/output.js +1 -1
  75. package/lib/constant/product.js +1 -1
  76. package/lib/constant/risk.js +1 -1
  77. package/lib/constant/url.js +1 -1
  78. package/lib/context.js +1 -1
  79. package/lib/core/api-client.js +1 -1
  80. package/lib/core/db-resolver.js +1 -1
  81. package/lib/core/sdk-client.js +1 -1
  82. package/lib/errors.js +1 -1
  83. package/lib/framework/build-all-flags.js +1 -1
  84. package/lib/framework/dryrun.js +1 -1
  85. package/lib/framework/flags.js +1 -1
  86. package/lib/framework/help.js +1 -1
  87. package/lib/framework/index.js +1 -1
  88. package/lib/framework/output.js +1 -1
  89. package/lib/framework/preparse.js +1 -1
  90. package/lib/framework/rate-limit.js +1 -1
  91. package/lib/framework/raw-flags.js +1 -1
  92. package/lib/framework/response.js +1 -1
  93. package/lib/framework/runner-confirmation.js +1 -1
  94. package/lib/framework/runner-error.js +1 -1
  95. package/lib/framework/runner.js +1 -1
  96. package/lib/framework/schema-export.js +1 -1
  97. package/lib/framework/service-order.js +1 -1
  98. package/lib/framework/types.js +1 -1
  99. package/lib/generated/build-info.d.ts +4 -4
  100. package/lib/generated/build-info.js +1 -1
  101. package/lib/help.js +1 -1
  102. package/lib/postinstall.js +1 -1
  103. package/lib/runtime/confirmation.js +1 -1
  104. package/lib/runtime/event.js +1 -1
  105. package/lib/runtime/index.js +1 -1
  106. package/lib/runtime/queue.js +1 -1
  107. package/lib/runtime/resolve.js +1 -1
  108. package/lib/skills/builtin-skill.js +1 -1
  109. package/lib/skills/npx-skills-add.js +1 -1
  110. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  111. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  112. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  113. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  114. package/lib/skills/runtime-skill-sync/links.js +1 -1
  115. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  116. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  117. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  118. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  119. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  120. package/lib/skills/runtime-skill-sync/push.js +1 -1
  121. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  122. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  123. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  124. package/lib/skills/runtime-skill-sync.js +1 -1
  125. package/lib/skills/skill-presence.js +1 -1
  126. package/lib/utils/apply-jq-filter.js +1 -1
  127. package/lib/utils/logger.js +1 -1
  128. package/lib/utils/lossless-json.js +1 -1
  129. package/lib/utils/params.js +1 -1
  130. package/lib/utils/platform.js +1 -1
  131. package/lib/utils/update-notice.js +1 -1
  132. package/lib/utils/version.js +1 -1
  133. package/lib/utils/write-cli-side-channel.js +1 -1
  134. package/package.json +1 -1
  135. package/skills/lovrabet/SKILL.md +1 -1
  136. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- (function(_0x10509c,_0x4a9802){const _0x161134=a39_0x1804,_0x275c0e=_0x10509c();while(!![]){try{const _0x5c84c6=parseInt(_0x161134(0x171))/0x1+-parseInt(_0x161134(0x1b3))/0x2*(-parseInt(_0x161134(0x1b1))/0x3)+parseInt(_0x161134(0x1bf))/0x4*(-parseInt(_0x161134(0x1b5))/0x5)+parseInt(_0x161134(0x193))/0x6+parseInt(_0x161134(0x194))/0x7+-parseInt(_0x161134(0x17c))/0x8*(parseInt(_0x161134(0x1af))/0x9)+-parseInt(_0x161134(0x19b))/0xa;if(_0x5c84c6===_0x4a9802)break;else _0x275c0e['push'](_0x275c0e['shift']());}catch(_0x524144){_0x275c0e['push'](_0x275c0e['shift']());}}}(a39_0x2e6d,0x35410));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';function a39_0x2e6d(){const _0x420bd9=['Run\x20service\x20command\x20','envName','bffCode','operator','rawFlags','ctx.','filter','startsWith','service','2812576WMXOaj','\x20\x20\x20\x20datasetCode:\x20','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','\x20\x20\x20\x20sqlCode:\x20','bffId','string','app','Unsupported\x20service\x20target\x20kind:\x20','target','cliPath','datasetCode','boolean','`\x20to\x20inspect\x20the\x20manifest.','high-risk-write','将通过\x20Service\x20Tree\x20执行“','Use\x20`','number','length','\x20\x20\x20\x20kind:\x20\x20\x20\x20','kind','padEnd','params','enum','2002626CbPQIs','380604dYlRwC','context.','commands','\x20<command>\x20[flags]','tree','fromEntries','some','76560YaSuDu','risk','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','find','employeeId','bff','json','flatMap','datatable','code','\x20\x20\x20\x20','map','join','dbtableConfig','userName','validation','source','username','env','Service\x20command\x20','9NQNEGJ','mapTo','35136LRROAF','read','32rXyAVj','args','45605tqPKTN','\x20->\x20','slice','push','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','\x20requires\x20target.sqlCode.','const','tenantCode','now','\x20\x20[','124IkHGIR','trim','\x20\x20SERVICE\x20TREE\x20TARGET','\x22\x20in\x20service\x20command\x20','default','\x20service\x20detail\x20--service\x20','appcode','sqlCode','description','remainingArgs','data','entries','appCode','userId','name','scriptName','sql','required','\x20completed\x20in\x20','fullPath','command','该命令被清单标记为写入,可能修改业务数据或服务状态。','flags','Preview\x20dynamic\x20service\x20command:\x20','normalizedManifest','nickName','\x20\x20\x20\x20functionName:\x20','type','appRef','284572AbjYno','\x20requires\x20target.functionName.'];a39_0x2e6d=function(){return _0x420bd9;};return a39_0x2e6d();}import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x561bae,_0x7b3088){const _0x2e2d11=a39_0x1804,_0x3a0b3e=listLocalServiceTrees();let _0x434a60;for(const _0x479a24 of _0x3a0b3e){const _0x1b95fc=matchServiceTreeCommand(_0x479a24,_0x561bae);if(!_0x1b95fc)continue;(!_0x434a60||_0x1b95fc[_0x2e2d11(0x1d3)][_0x2e2d11(0x1d2)]['length']>_0x434a60[_0x2e2d11(0x1d3)]['fullPath']['length'])&&(_0x434a60={'tree':_0x479a24,'command':_0x1b95fc[_0x2e2d11(0x1d3)],'remainingArgs':_0x1b95fc[_0x2e2d11(0x1c8)]});}if(!_0x434a60)return undefined;const _0x1eb1d6={..._0x7b3088};return applyAppBinding(_0x434a60[_0x2e2d11(0x198)],_0x434a60[_0x2e2d11(0x1d3)],_0x1eb1d6),{'definition':buildDynamicCommandDefinition(_0x434a60[_0x2e2d11(0x198)],_0x434a60[_0x2e2d11(0x1d3)]),'args':_0x434a60[_0x2e2d11(0x1c8)],'flags':_0x1eb1d6,'tree':_0x434a60[_0x2e2d11(0x198)],'command':_0x434a60['command']};}export function generateDynamicServiceHelp(_0x18e7e6){const _0x3144ee=a39_0x1804,_0x2c33dd=listLocalServiceTrees()[_0x3144ee(0x19e)](_0x37dca7=>_0x37dca7['service']['code']===_0x18e7e6);if(!_0x2c33dd)return undefined;const _0x27f866=[CLI_BIN_NAME+'\x20'+_0x18e7e6+_0x3144ee(0x197),'',_0x2c33dd[_0x3144ee(0x17b)]['name']||_0x18e7e6,_0x2c33dd[_0x3144ee(0x17b)][_0x3144ee(0x1c7)]?'\x20\x20'+_0x2c33dd[_0x3144ee(0x17b)]['description']:'','','Commands:',..._0x2c33dd['commands'][_0x3144ee(0x1a6)](_0x1cc314=>{const _0x4ab2c2=_0x3144ee,_0x55ac5b=_0x1cc314['fullPath'][_0x4ab2c2(0x1b7)](0x1)[_0x4ab2c2(0x1a7)]('\x20'),_0x402798=_0x1cc314[_0x4ab2c2(0x19c)]==='read'?'':'\x20['+_0x1cc314['risk']+']';return'\x20\x20'+_0x55ac5b[_0x4ab2c2(0x190)](0x18)+'\x20'+(_0x1cc314[_0x4ab2c2(0x1c7)]||'')+_0x402798;}),'',_0x3144ee(0x18b)+CLI_BIN_NAME+_0x3144ee(0x1c4)+_0x18e7e6+_0x3144ee(0x188)][_0x3144ee(0x179)](Boolean);return _0x27f866[_0x3144ee(0x1a7)]('\x0a');}export function listDynamicServiceEntries(){const _0x261c11=a39_0x1804;return listLocalServices()[_0x261c11(0x1a6)](_0x1599d7=>{const _0x3c895f=_0x261c11,_0x16ac0a=_0x1599d7[_0x3c895f(0x1d7)];return{'service':_0x16ac0a[_0x3c895f(0x17b)][_0x3c895f(0x1a4)],'label':_0x16ac0a['service'][_0x3c895f(0x1cd)]||_0x16ac0a[_0x3c895f(0x17b)][_0x3c895f(0x1a4)],'commands':_0x16ac0a['commands'][_0x3c895f(0x1a6)](_0x51dbf6=>({'command':dynamicCommandName(_0x51dbf6),'description':_0x51dbf6[_0x3c895f(0x1c7)]||_0x3c895f(0x173)+_0x51dbf6[_0x3c895f(0x185)],'tag':riskTag(_0x51dbf6[_0x3c895f(0x19c)])}))};});}export function getDynamicServiceEntry(_0x10cfd3){return listDynamicServiceEntries()['find'](_0x466571=>_0x466571['service']===_0x10cfd3);}export function listDynamicServiceDefinitions(_0x2b8107){const _0x10bade=a39_0x1804;return listLocalServiceTrees()[_0x10bade(0x179)](_0x40b63d=>!_0x2b8107||_0x40b63d[_0x10bade(0x17b)]['code']===_0x2b8107)[_0x10bade(0x1a2)](_0x53bb7e=>_0x53bb7e[_0x10bade(0x196)][_0x10bade(0x1a6)](_0xf67b21=>buildDynamicCommandDefinition(_0x53bb7e,_0xf67b21)));}export function getDynamicServiceDefinitions(_0x533d9a){const _0x3ebae7=listDynamicServiceDefinitions(_0x533d9a);return _0x3ebae7['length']>0x0?_0x3ebae7:undefined;}export function findDynamicServiceDefinition(_0xaef93b,_0x206550){const _0x14b8b3=a39_0x1804;return listDynamicServiceDefinitions(_0xaef93b)[_0x14b8b3(0x19e)](_0x3f63f7=>_0x3f63f7[_0x14b8b3(0x1d3)]===_0x206550);}export function buildDynamicCommandDefinition(_0x3df362,_0x7de892){const _0x17bf2e=a39_0x1804;return{'service':_0x3df362[_0x17bf2e(0x17b)]['code'],'command':dynamicCommandName(_0x7de892),'description':_0x7de892['description']||_0x17bf2e(0x173)+_0x7de892[_0x17bf2e(0x185)],'risk':_0x7de892[_0x17bf2e(0x19c)],..._0x7de892[_0x17bf2e(0x19c)]===_0x17bf2e(0x1b2)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x7de892)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x7de892['args'][_0x17bf2e(0x1a6)](_0x10a349=>({'name':_0x10a349[_0x17bf2e(0x1cd)],'description':_0x10a349[_0x17bf2e(0x1c7)]||_0x10a349[_0x17bf2e(0x1cd)],'required':_0x10a349[_0x17bf2e(0x1d0)]})),'flags':_0x7de892[_0x17bf2e(0x1d5)][_0x17bf2e(0x1a6)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x7de892),async 'dryRun'(_0x3a29a3){const _0x4c4b38=_0x17bf2e,_0x2c4359=await compilePlan(_0x7de892,_0x3a29a3);return{'method':'SERVICE_TREE','url':_0x7de892[_0x4c4b38(0x185)],'body':{'target':targetPreview(_0x2c4359),'params':_0x2c4359[_0x4c4b38(0x191)]},'description':_0x4c4b38(0x1d6)+_0x7de892[_0x4c4b38(0x185)]};},async 'execute'(_0x1e3926){const _0x2b8d87=_0x17bf2e,_0x85c846=await compilePlan(_0x7de892,_0x1e3926),_0x1139b2=Date[_0x2b8d87(0x1bd)](),_0x24ac67=await executePlan(_0x85c846,_0x7de892,_0x1e3926),_0x16f870=Date[_0x2b8d87(0x1bd)]()-_0x1139b2;return{'ok':!![],'data':{'service':_0x3df362['service'],'command':_0x7de892[_0x2b8d87(0x185)],'target':targetPreview(_0x85c846),'result':_0x24ac67,'elapsed':_0x16f870},'message':_0x2b8d87(0x1ae)+_0x7de892[_0x2b8d87(0x185)]+_0x2b8d87(0x1d1)+_0x16f870+'ms'};}};}function buildDynamicConfirmationDescription(_0x3ed22a){const _0x27aaef=a39_0x1804,_0x5bb6fc=_0x3ed22a[_0x27aaef(0x1c7)]||_0x3ed22a['cliPath'],_0x44d1c1=_0x3ed22a[_0x27aaef(0x19c)]===_0x27aaef(0x189)?_0x27aaef(0x1b9):_0x27aaef(0x1d4);return _0x27aaef(0x18a)+_0x5bb6fc+'”。'+_0x44d1c1;}function dynamicCommandName(_0x2af0c0){const _0x340710=a39_0x1804;return _0x2af0c0['fullPath'][_0x340710(0x1b7)](0x1)[_0x340710(0x1a7)]('\x20');}function riskTag(_0x4a1ed0){const _0x49775c=a39_0x1804;return _0x4a1ed0===_0x49775c(0x1b2)?'':_0x49775c(0x1be)+_0x4a1ed0+']';}function flagToCommandFlag(_0x2583cc){const _0x2b084c=a39_0x1804;return{'name':_0x2583cc['cliName'],'type':_0x2583cc['type']===_0x2b084c(0x1a1)?'string':_0x2583cc[_0x2b084c(0x16f)],'description':_0x2583cc[_0x2b084c(0x1c7)]||_0x2583cc[_0x2b084c(0x1cd)],'required':_0x2583cc[_0x2b084c(0x1d0)],'default':isPrimitiveFlagDefault(_0x2583cc['default'])?_0x2583cc[_0x2b084c(0x1c3)]:undefined,'enum':_0x2583cc[_0x2b084c(0x192)]};}async function compilePlan(_0x56207d,_0xaf969e){const _0x155dc3=a39_0x1804;return compileServiceTreeCommand(_0x56207d,{'flags':_0xaf969e[_0x155dc3(0x177)],'args':_0xaf969e[_0x155dc3(0x1b4)],'context':await buildServiceContext(_0x56207d,_0xaf969e)});}async function buildServiceContext(_0x5d41fb,_0x3683b3){const _0x145d74=a39_0x1804,_0x437165={'appCode':_0x3683b3[_0x145d74(0x1cb)],'env':_0x3683b3[_0x145d74(0x174)],'envName':_0x3683b3[_0x145d74(0x174)]};if(!usesRuntimeContext(_0x5d41fb))return _0x437165;const _0x49d95b=await getLoginUserInfo(),_0xac9ff2=pickFirst(_0x49d95b[_0x145d74(0x1cc)],_0x49d95b['id']);return{..._0x437165,'user':_0x49d95b,'userId':_0xac9ff2,'id':_0x49d95b['id'],'username':pickFirst(_0x49d95b[_0x145d74(0x1ac)],_0x49d95b[_0x145d74(0x1a9)],_0x49d95b['loginName']),'userName':_0x49d95b[_0x145d74(0x1a9)],'nickname':pickFirst(_0x49d95b['nickname'],_0x49d95b[_0x145d74(0x1d8)]),'nickName':_0x49d95b[_0x145d74(0x1d8)],'tenantCode':_0x49d95b[_0x145d74(0x1bc)],'employeeId':_0x49d95b[_0x145d74(0x19f)]};}function usesRuntimeContext(_0x2e12d2){const _0x14ba52=a39_0x1804;return _0x2e12d2[_0x14ba52(0x1b0)][_0x14ba52(0x19a)](_0x420264=>typeof _0x420264[_0x14ba52(0x1ab)]===_0x14ba52(0x181)&&(_0x420264[_0x14ba52(0x1ab)][_0x14ba52(0x17a)](_0x14ba52(0x195))||_0x420264[_0x14ba52(0x1ab)][_0x14ba52(0x17a)](_0x14ba52(0x178))));}function pickFirst(..._0x4affd5){return _0x4affd5['find'](_0x76f244=>_0x76f244!==undefined&&_0x76f244!==null);}async function executePlan(_0x334676,_0x475c32,_0x437b0d){const _0x481a17=a39_0x1804;if(_0x334676[_0x481a17(0x18f)]===_0x481a17(0x1c9)){const _0x22db43=await resolveDatasetCode(_0x334676,_0x475c32,_0x437b0d);return executeData(_0x22db43,_0x334676['command'],_0x334676[_0x481a17(0x191)]);}if(_0x334676[_0x481a17(0x18f)]===_0x481a17(0x1cf)){if(!_0x334676[_0x481a17(0x1c6)])throw CliErrors[_0x481a17(0x1aa)]('Service\x20command\x20'+_0x475c32[_0x481a17(0x185)]+_0x481a17(0x1ba));return executeSdkSql(_0x334676[_0x481a17(0x1c6)],normalizeScalarParams(_0x334676[_0x481a17(0x191)]));}if(_0x334676[_0x481a17(0x18f)]===_0x481a17(0x1a0)){const _0x257299=_0x334676[_0x481a17(0x1ce)]||_0x334676[_0x481a17(0x175)]||(_0x334676[_0x481a17(0x180)]==null?'':String(_0x334676[_0x481a17(0x180)]));if(!_0x257299)throw CliErrors[_0x481a17(0x1aa)](_0x481a17(0x1ae)+_0x475c32['cliPath']+_0x481a17(0x172));return executeSdkBff(_0x257299,_0x334676['params']);}throw CliErrors[_0x481a17(0x1aa)](_0x481a17(0x183)+_0x334676[_0x481a17(0x18f)]);}async function resolveDatasetCode(_0x10b871,_0x18c967,_0x433dc8){const _0x2fdfd7=a39_0x1804;if(_0x10b871['datasetCode'])return _0x10b871['datasetCode'];if(!_0x10b871[_0x2fdfd7(0x1a3)])throw CliErrors[_0x2fdfd7(0x1aa)]('Service\x20command\x20'+_0x18c967[_0x2fdfd7(0x185)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x179452=await listDatasets(_0x433dc8[_0x2fdfd7(0x1cb)]),_0x1da465=_0x179452[_0x2fdfd7(0x19e)](_0x372398=>_0x372398[_0x2fdfd7(0x1a8)]?.['tableName']===_0x10b871['datatable']);if(!_0x1da465?.[_0x2fdfd7(0x1a4)])throw CliErrors[_0x2fdfd7(0x1aa)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x10b871[_0x2fdfd7(0x1a3)]+_0x2fdfd7(0x19d)+_0x433dc8[_0x2fdfd7(0x1cb)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x1da465[_0x2fdfd7(0x1a4)];}function applyAppBinding(_0x52624a,_0x205854,_0x40bc45){const _0x5249eb=a39_0x1804,_0x2d775e=_0x205854[_0x5249eb(0x184)][_0x5249eb(0x170)];if(!_0x2d775e)return;const _0x52b4ed=_0x52624a['appBindings'][_0x2d775e];if(!_0x52b4ed)throw CliErrors[_0x5249eb(0x1aa)]('Unknown\x20appRef\x20\x22'+_0x2d775e+_0x5249eb(0x1c2)+_0x205854['cliPath']+'.',_0x5249eb(0x17e));const _0x1b4d4b=_0x52b4ed[_0x5249eb(0x1c5)]||_0x52b4ed[_0x5249eb(0x1cb)];_0x1b4d4b&&!hasText(_0x40bc45['appcode'])&&(_0x40bc45[_0x5249eb(0x1c5)]=_0x1b4d4b),_0x52b4ed[_0x5249eb(0x182)]&&!hasText(_0x40bc45[_0x5249eb(0x182)])&&!hasText(_0x40bc45['appcode'])&&(_0x40bc45[_0x5249eb(0x182)]=_0x52b4ed['app']),_0x52b4ed[_0x5249eb(0x1ad)]&&!hasText(_0x40bc45[_0x5249eb(0x1ad)])&&(_0x40bc45[_0x5249eb(0x1ad)]=_0x52b4ed[_0x5249eb(0x1ad)]);}function renderDynamicCommandHelp(_0xb1fee5){const _0x43da7d=a39_0x1804,_0x310a4d=[_0x43da7d(0x1c1),_0x43da7d(0x18e)+_0xb1fee5[_0x43da7d(0x184)]['kind'],'\x20\x20\x20\x20command:\x20'+_0xb1fee5[_0x43da7d(0x184)][_0x43da7d(0x1d3)]];if(_0xb1fee5[_0x43da7d(0x184)][_0x43da7d(0x186)])_0x310a4d[_0x43da7d(0x1b8)](_0x43da7d(0x17d)+_0xb1fee5[_0x43da7d(0x184)]['datasetCode']);if(_0xb1fee5[_0x43da7d(0x184)]['datatable'])_0x310a4d[_0x43da7d(0x1b8)]('\x20\x20\x20\x20datatable:\x20'+_0xb1fee5[_0x43da7d(0x184)][_0x43da7d(0x1a3)]);if(_0xb1fee5[_0x43da7d(0x184)][_0x43da7d(0x1c6)])_0x310a4d['push'](_0x43da7d(0x17f)+_0xb1fee5['target']['sqlCode']);if(_0xb1fee5['target'][_0x43da7d(0x1ce)])_0x310a4d[_0x43da7d(0x1b8)](_0x43da7d(0x1d9)+_0xb1fee5['target']['scriptName']);if(_0xb1fee5['mapTo'][_0x43da7d(0x18d)]>0x0){_0x310a4d[_0x43da7d(0x1b8)]('','\x20\x20MAP\x20TO');for(const _0x2c6767 of _0xb1fee5['mapTo']){_0x310a4d[_0x43da7d(0x1b8)](_0x43da7d(0x1a5)+(_0x2c6767[_0x43da7d(0x1ab)]||_0x43da7d(0x1bb))+_0x43da7d(0x1b6)+_0x2c6767[_0x43da7d(0x184)]+(_0x2c6767['operator']?'.'+_0x2c6767[_0x43da7d(0x176)]:''));}}return _0x310a4d[_0x43da7d(0x1a7)]('\x0a');}function a39_0x1804(_0x2be57e,_0x28891d){_0x2be57e=_0x2be57e-0x16f;const _0x2e6d60=a39_0x2e6d();let _0x180456=_0x2e6d60[_0x2be57e];return _0x180456;}function targetPreview(_0x33ce16){const _0x3a8875=a39_0x1804;return{'kind':_0x33ce16['kind'],'command':_0x33ce16[_0x3a8875(0x1d3)],'appRef':_0x33ce16[_0x3a8875(0x170)],'datasetCode':_0x33ce16[_0x3a8875(0x186)],'datatable':_0x33ce16['datatable'],'sqlCode':_0x33ce16[_0x3a8875(0x1c6)],'bffCode':_0x33ce16[_0x3a8875(0x175)],'bffId':_0x33ce16[_0x3a8875(0x180)],'functionName':_0x33ce16['scriptName']};}function normalizeScalarParams(_0x4f0228){const _0x1cbe8d=a39_0x1804;return Object[_0x1cbe8d(0x199)](Object[_0x1cbe8d(0x1ca)](_0x4f0228)[_0x1cbe8d(0x179)](([,_0x154f6a])=>typeof _0x154f6a===_0x1cbe8d(0x181)||typeof _0x154f6a==='number'));}function hasText(_0x25d48b){const _0x51b05a=a39_0x1804;return typeof _0x25d48b==='string'&&_0x25d48b[_0x51b05a(0x1c0)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x2d74d5){const _0x694ef2=a39_0x1804;return _0x2d74d5===undefined||typeof _0x2d74d5===_0x694ef2(0x181)||typeof _0x2d74d5===_0x694ef2(0x18c)||typeof _0x2d74d5===_0x694ef2(0x187);}
1
+ (function(_0x362f9c,_0x372e4a){const _0x55124f=a39_0x283c,_0x27f1c7=_0x362f9c();while(!![]){try{const _0xaeccc9=-parseInt(_0x55124f(0xcf))/0x1+parseInt(_0x55124f(0xe3))/0x2+parseInt(_0x55124f(0xdc))/0x3*(-parseInt(_0x55124f(0x10b))/0x4)+-parseInt(_0x55124f(0x125))/0x5+-parseInt(_0x55124f(0x110))/0x6+parseInt(_0x55124f(0x11f))/0x7*(parseInt(_0x55124f(0xf4))/0x8)+-parseInt(_0x55124f(0xdf))/0x9*(-parseInt(_0x55124f(0x107))/0xa);if(_0xaeccc9===_0x372e4a)break;else _0x27f1c7['push'](_0x27f1c7['shift']());}catch(_0x5998eb){_0x27f1c7['push'](_0x27f1c7['shift']());}}}(a39_0xf9b2,0xef35e));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(_0x11d743,_0x17e56d){const _0x101b29=a39_0x283c,_0x3ec457=listLocalServiceTrees();let _0x302dc6;for(const _0x6d8c30 of _0x3ec457){const _0x4add3a=matchServiceTreeCommand(_0x6d8c30,_0x11d743);if(!_0x4add3a)continue;(!_0x302dc6||_0x4add3a[_0x101b29(0xf9)][_0x101b29(0x108)][_0x101b29(0xdd)]>_0x302dc6[_0x101b29(0xf9)][_0x101b29(0x108)][_0x101b29(0xdd)])&&(_0x302dc6={'tree':_0x6d8c30,'command':_0x4add3a[_0x101b29(0xf9)],'remainingArgs':_0x4add3a[_0x101b29(0xca)]});}if(!_0x302dc6)return undefined;const _0x4baee6={..._0x17e56d};return applyAppBinding(_0x302dc6['tree'],_0x302dc6[_0x101b29(0xf9)],_0x4baee6),{'definition':buildDynamicCommandDefinition(_0x302dc6[_0x101b29(0x10a)],_0x302dc6[_0x101b29(0xf9)]),'args':_0x302dc6['remainingArgs'],'flags':_0x4baee6,'tree':_0x302dc6['tree'],'command':_0x302dc6[_0x101b29(0xf9)]};}export function generateDynamicServiceHelp(_0x2bc1f9){const _0x334d2a=a39_0x283c,_0x4b7d07=listLocalServiceTrees()['find'](_0x511814=>_0x511814[_0x334d2a(0xce)]['code']===_0x2bc1f9);if(!_0x4b7d07)return undefined;const _0x1fa315=[CLI_BIN_NAME+'\x20'+_0x2bc1f9+_0x334d2a(0x12a),'',_0x4b7d07['service'][_0x334d2a(0xd2)]||_0x2bc1f9,_0x4b7d07[_0x334d2a(0xce)][_0x334d2a(0xc8)]?'\x20\x20'+_0x4b7d07[_0x334d2a(0xce)][_0x334d2a(0xc8)]:'','',_0x334d2a(0x113),..._0x4b7d07['commands'][_0x334d2a(0x119)](_0x253ffe=>{const _0x5d3578=_0x334d2a,_0x5d0278=_0x253ffe[_0x5d3578(0x108)][_0x5d3578(0x111)](0x1)[_0x5d3578(0xd0)]('\x20'),_0x1cb605=_0x253ffe[_0x5d3578(0xda)]===_0x5d3578(0xe6)?'':'\x20['+_0x253ffe[_0x5d3578(0xda)]+']';return'\x20\x20'+_0x5d0278[_0x5d3578(0xe1)](0x18)+'\x20'+(_0x253ffe['description']||'')+_0x1cb605;}),'',_0x334d2a(0xfe)+CLI_BIN_NAME+_0x334d2a(0x12e)+_0x2bc1f9+_0x334d2a(0xeb)][_0x334d2a(0xf3)](Boolean);return _0x1fa315[_0x334d2a(0xd0)]('\x0a');}export function listDynamicServiceEntries(){const _0x54fb25=a39_0x283c;return listLocalServices()[_0x54fb25(0x119)](_0x2c4598=>{const _0x2fc8f2=_0x54fb25,_0xa5d6f2=_0x2c4598[_0x2fc8f2(0x105)];return{'service':_0xa5d6f2['service'][_0x2fc8f2(0x116)],'label':_0xa5d6f2['service'][_0x2fc8f2(0xd2)]||_0xa5d6f2['service'][_0x2fc8f2(0x116)],'commands':_0xa5d6f2['commands'][_0x2fc8f2(0x119)](_0x5cd6c6=>({'command':dynamicCommandName(_0x5cd6c6),'description':_0x5cd6c6[_0x2fc8f2(0xc8)]||_0x2fc8f2(0xed)+_0x5cd6c6['cliPath'],'tag':riskTag(_0x5cd6c6['risk'])}))};});}export function getDynamicServiceEntry(_0xf32d84){const _0x348c3b=a39_0x283c;return listDynamicServiceEntries()['find'](_0x4928ee=>_0x4928ee[_0x348c3b(0xce)]===_0xf32d84);}function a39_0xf9b2(){const _0x2bf687=['operator','data','userName','tenantCode','\x20->\x20','filter','64MqFjRB','\x22\x20in\x20service\x20command\x20','required','appRef','Preview\x20dynamic\x20service\x20command:\x20','command','\x20\x20\x20\x20','\x20\x20\x20\x20command:\x20','cliPath','kind','Use\x20`','sqlCode','username','number','\x20\x20[','rawFlags','now','normalizedManifest','Unknown\x20appRef\x20\x22','3130uMlDtm','fullPath','employeeId','tree','20044lhFIGj','datasetCode','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','string','boolean','1965534fjHFdp','slice','push','Commands:','bffId','\x20\x20\x20\x20functionName:\x20','code','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20requires\x20target.sqlCode.','map','flatMap','nickname','dbtableConfig','\x20\x20SERVICE\x20TREE\x20TARGET','app','565075yPnZNG','envName','datatable','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','bff','\x20\x20\x20\x20datatable:\x20','9434490zwHgaI','\x20completed\x20in\x20','Unsupported\x20service\x20target\x20kind:\x20','SERVICE_TREE','type','\x20<command>\x20[flags]','\x20\x20MAP\x20TO','appcode','const','\x20service\x20detail\x20--service\x20','startsWith','appBindings','default','description','appCode','remainingArgs','nickName','params','mapTo','service','1953587UkKgUw','join','high-risk-write','name','args','Service\x20command\x20','cliName','target','tableName','sql','\x20\x20\x20\x20kind:\x20\x20\x20\x20','risk','source','171dvALpG','length','将通过\x20Service\x20Tree\x20执行“','122553zjkXro','validation','padEnd','bffCode','1051172FcDGbF','commands','\x20\x20\x20\x20sqlCode:\x20','read','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','env','scriptName','userId','`\x20to\x20inspect\x20the\x20manifest.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','Run\x20service\x20command\x20'];a39_0xf9b2=function(){return _0x2bf687;};return a39_0xf9b2();}export function listDynamicServiceDefinitions(_0x21d1ad){const _0x135141=a39_0x283c;return listLocalServiceTrees()['filter'](_0x173bd7=>!_0x21d1ad||_0x173bd7['service'][_0x135141(0x116)]===_0x21d1ad)[_0x135141(0x11a)](_0x23d26d=>_0x23d26d[_0x135141(0xe4)][_0x135141(0x119)](_0x20fc73=>buildDynamicCommandDefinition(_0x23d26d,_0x20fc73)));}export function getDynamicServiceDefinitions(_0x5c0849){const _0x325092=a39_0x283c,_0x291faa=listDynamicServiceDefinitions(_0x5c0849);return _0x291faa[_0x325092(0xdd)]>0x0?_0x291faa:undefined;}export function findDynamicServiceDefinition(_0x35d253,_0x52672b){return listDynamicServiceDefinitions(_0x35d253)['find'](_0x2304a4=>_0x2304a4['command']===_0x52672b);}export function buildDynamicCommandDefinition(_0x53dc31,_0x3aa060){const _0x5162db=a39_0x283c;return{'service':_0x53dc31[_0x5162db(0xce)][_0x5162db(0x116)],'command':dynamicCommandName(_0x3aa060),'description':_0x3aa060[_0x5162db(0xc8)]||'Run\x20service\x20command\x20'+_0x3aa060['cliPath'],'risk':_0x3aa060[_0x5162db(0xda)],..._0x3aa060['risk']===_0x5162db(0xe6)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x3aa060)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x3aa060[_0x5162db(0xd3)][_0x5162db(0x119)](_0x4941c1=>({'name':_0x4941c1[_0x5162db(0xd2)],'description':_0x4941c1['description']||_0x4941c1['name'],'required':_0x4941c1[_0x5162db(0xf6)]})),'flags':_0x3aa060['flags'][_0x5162db(0x119)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x3aa060),async 'dryRun'(_0x4987c4){const _0x3e9268=_0x5162db,_0x1f2e75=await compilePlan(_0x3aa060,_0x4987c4);return{'method':_0x3e9268(0x128),'url':_0x3aa060[_0x3e9268(0xfc)],'body':{'target':targetPreview(_0x1f2e75),'params':_0x1f2e75[_0x3e9268(0xcc)]},'description':_0x3e9268(0xf8)+_0x3aa060['cliPath']};},async 'execute'(_0x427086){const _0x5dbc58=_0x5162db,_0x21ac0f=await compilePlan(_0x3aa060,_0x427086),_0x42823e=Date[_0x5dbc58(0x104)](),_0x4414ca=await executePlan(_0x21ac0f,_0x3aa060,_0x427086),_0x5bc712=Date[_0x5dbc58(0x104)]()-_0x42823e;return{'ok':!![],'data':{'service':_0x53dc31[_0x5dbc58(0xce)],'command':_0x3aa060[_0x5dbc58(0xfc)],'target':targetPreview(_0x21ac0f),'result':_0x4414ca,'elapsed':_0x5bc712},'message':_0x5dbc58(0xd4)+_0x3aa060[_0x5dbc58(0xfc)]+_0x5dbc58(0x126)+_0x5bc712+'ms'};}};}function buildDynamicConfirmationDescription(_0x229ef6){const _0x4c1fd2=a39_0x283c,_0x5b6734=_0x229ef6[_0x4c1fd2(0xc8)]||_0x229ef6[_0x4c1fd2(0xfc)],_0x3460de=_0x229ef6['risk']===_0x4c1fd2(0xd1)?_0x4c1fd2(0xe7):'该命令被清单标记为写入,可能修改业务数据或服务状态。';return _0x4c1fd2(0xde)+_0x5b6734+'”。'+_0x3460de;}function dynamicCommandName(_0x5b088b){const _0x3b44f6=a39_0x283c;return _0x5b088b['fullPath']['slice'](0x1)[_0x3b44f6(0xd0)]('\x20');}function riskTag(_0x134f8){const _0x4d66ee=a39_0x283c;return _0x134f8===_0x4d66ee(0xe6)?'':_0x4d66ee(0x102)+_0x134f8+']';}function a39_0x283c(_0x44ffc4,_0xc69245){_0x44ffc4=_0x44ffc4-0xc8;const _0xf9b2ae=a39_0xf9b2();let _0x283cd7=_0xf9b2ae[_0x44ffc4];return _0x283cd7;}function flagToCommandFlag(_0x573020){const _0x496906=a39_0x283c;return{'name':_0x573020[_0x496906(0xd5)],'type':_0x573020[_0x496906(0x129)]==='json'?_0x496906(0x10e):_0x573020[_0x496906(0x129)],'description':_0x573020[_0x496906(0xc8)]||_0x573020[_0x496906(0xd2)],'required':_0x573020[_0x496906(0xf6)],'default':isPrimitiveFlagDefault(_0x573020['default'])?_0x573020[_0x496906(0x131)]:undefined,'enum':_0x573020['enum']};}async function compilePlan(_0x4751f8,_0x42848f){const _0x52c64c=a39_0x283c;return compileServiceTreeCommand(_0x4751f8,{'flags':_0x42848f[_0x52c64c(0x103)],'args':_0x42848f[_0x52c64c(0xd3)],'context':await buildServiceContext(_0x4751f8,_0x42848f)});}async function buildServiceContext(_0x41e41b,_0xda11c2){const _0x153fe6=a39_0x283c,_0xcd27ae={'appCode':_0xda11c2[_0x153fe6(0xc9)],'env':_0xda11c2['envName'],'envName':_0xda11c2[_0x153fe6(0x120)]};if(!usesRuntimeContext(_0x41e41b))return _0xcd27ae;const _0x58756d=await getLoginUserInfo(),_0x38507c=pickFirst(_0x58756d[_0x153fe6(0xea)],_0x58756d['id']);return{..._0xcd27ae,'user':_0x58756d,'userId':_0x38507c,'id':_0x58756d['id'],'username':pickFirst(_0x58756d[_0x153fe6(0x100)],_0x58756d[_0x153fe6(0xf0)],_0x58756d['loginName']),'userName':_0x58756d['userName'],'nickname':pickFirst(_0x58756d[_0x153fe6(0x11b)],_0x58756d[_0x153fe6(0xcb)]),'nickName':_0x58756d[_0x153fe6(0xcb)],'tenantCode':_0x58756d[_0x153fe6(0xf1)],'employeeId':_0x58756d[_0x153fe6(0x109)]};}function usesRuntimeContext(_0x5b0d9f){const _0x4aa7f0=a39_0x283c;return _0x5b0d9f[_0x4aa7f0(0xcd)]['some'](_0x345ad1=>typeof _0x345ad1[_0x4aa7f0(0xdb)]===_0x4aa7f0(0x10e)&&(_0x345ad1[_0x4aa7f0(0xdb)][_0x4aa7f0(0x12f)]('context.')||_0x345ad1['source'][_0x4aa7f0(0x12f)]('ctx.')));}function pickFirst(..._0x449ea2){return _0x449ea2['find'](_0x2b4e6d=>_0x2b4e6d!==undefined&&_0x2b4e6d!==null);}async function executePlan(_0xd83157,_0x129fc2,_0x44c6ed){const _0x37448d=a39_0x283c;if(_0xd83157['kind']===_0x37448d(0xef)){const _0x32bb78=await resolveDatasetCode(_0xd83157,_0x129fc2,_0x44c6ed);return executeData(_0x32bb78,_0xd83157[_0x37448d(0xf9)],_0xd83157[_0x37448d(0xcc)]);}if(_0xd83157[_0x37448d(0xfd)]===_0x37448d(0xd8)){if(!_0xd83157['sqlCode'])throw CliErrors['validation'](_0x37448d(0xd4)+_0x129fc2[_0x37448d(0xfc)]+_0x37448d(0x118));return executeSdkSql(_0xd83157['sqlCode'],normalizeScalarParams(_0xd83157[_0x37448d(0xcc)]));}if(_0xd83157[_0x37448d(0xfd)]===_0x37448d(0x123)){const _0x59dc44=_0xd83157['scriptName']||_0xd83157[_0x37448d(0xe2)]||(_0xd83157[_0x37448d(0x114)]==null?'':String(_0xd83157[_0x37448d(0x114)]));if(!_0x59dc44)throw CliErrors[_0x37448d(0xe0)](_0x37448d(0xd4)+_0x129fc2[_0x37448d(0xfc)]+'\x20requires\x20target.functionName.');return executeSdkBff(_0x59dc44,_0xd83157[_0x37448d(0xcc)]);}throw CliErrors['validation'](_0x37448d(0x127)+_0xd83157[_0x37448d(0xfd)]);}async function resolveDatasetCode(_0x55c0c3,_0x25c5d4,_0x5799e4){const _0x258041=a39_0x283c;if(_0x55c0c3['datasetCode'])return _0x55c0c3[_0x258041(0x10c)];if(!_0x55c0c3[_0x258041(0x121)])throw CliErrors[_0x258041(0xe0)](_0x258041(0xd4)+_0x25c5d4[_0x258041(0xfc)]+_0x258041(0x122));const _0x58c4dc=await listDatasets(_0x5799e4[_0x258041(0xc9)]),_0xa099b5=_0x58c4dc['find'](_0x12ed22=>_0x12ed22[_0x258041(0x11c)]?.[_0x258041(0xd7)]===_0x55c0c3[_0x258041(0x121)]);if(!_0xa099b5?.[_0x258041(0x116)])throw CliErrors[_0x258041(0xe0)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x55c0c3[_0x258041(0x121)]+_0x258041(0x117)+_0x5799e4[_0x258041(0xc9)]+'.',_0x258041(0xec));return _0xa099b5[_0x258041(0x116)];}function applyAppBinding(_0x2f9e3c,_0x2bf10d,_0x33a570){const _0x53a251=a39_0x283c,_0x4756e1=_0x2bf10d[_0x53a251(0xd6)]['appRef'];if(!_0x4756e1)return;const _0x33c7b2=_0x2f9e3c[_0x53a251(0x130)][_0x4756e1];if(!_0x33c7b2)throw CliErrors['validation'](_0x53a251(0x106)+_0x4756e1+_0x53a251(0xf5)+_0x2bf10d['cliPath']+'.',_0x53a251(0x10d));const _0x2841ce=_0x33c7b2[_0x53a251(0x12c)]||_0x33c7b2['appCode'];_0x2841ce&&!hasText(_0x33a570['appcode'])&&(_0x33a570[_0x53a251(0x12c)]=_0x2841ce),_0x33c7b2[_0x53a251(0x11e)]&&!hasText(_0x33a570[_0x53a251(0x11e)])&&!hasText(_0x33a570[_0x53a251(0x12c)])&&(_0x33a570[_0x53a251(0x11e)]=_0x33c7b2[_0x53a251(0x11e)]),_0x33c7b2[_0x53a251(0xe8)]&&!hasText(_0x33a570[_0x53a251(0xe8)])&&(_0x33a570[_0x53a251(0xe8)]=_0x33c7b2['env']);}function renderDynamicCommandHelp(_0x558126){const _0x33a26e=a39_0x283c,_0x140533=[_0x33a26e(0x11d),_0x33a26e(0xd9)+_0x558126[_0x33a26e(0xd6)][_0x33a26e(0xfd)],_0x33a26e(0xfb)+_0x558126[_0x33a26e(0xd6)][_0x33a26e(0xf9)]];if(_0x558126[_0x33a26e(0xd6)][_0x33a26e(0x10c)])_0x140533[_0x33a26e(0x112)]('\x20\x20\x20\x20datasetCode:\x20'+_0x558126[_0x33a26e(0xd6)][_0x33a26e(0x10c)]);if(_0x558126[_0x33a26e(0xd6)]['datatable'])_0x140533[_0x33a26e(0x112)](_0x33a26e(0x124)+_0x558126[_0x33a26e(0xd6)][_0x33a26e(0x121)]);if(_0x558126[_0x33a26e(0xd6)][_0x33a26e(0xff)])_0x140533[_0x33a26e(0x112)](_0x33a26e(0xe5)+_0x558126[_0x33a26e(0xd6)][_0x33a26e(0xff)]);if(_0x558126[_0x33a26e(0xd6)]['scriptName'])_0x140533[_0x33a26e(0x112)](_0x33a26e(0x115)+_0x558126[_0x33a26e(0xd6)][_0x33a26e(0xe9)]);if(_0x558126[_0x33a26e(0xcd)]['length']>0x0){_0x140533[_0x33a26e(0x112)]('',_0x33a26e(0x12b));for(const _0x2f01bf of _0x558126[_0x33a26e(0xcd)]){_0x140533[_0x33a26e(0x112)](_0x33a26e(0xfa)+(_0x2f01bf[_0x33a26e(0xdb)]||_0x33a26e(0x12d))+_0x33a26e(0xf2)+_0x2f01bf[_0x33a26e(0xd6)]+(_0x2f01bf[_0x33a26e(0xee)]?'.'+_0x2f01bf[_0x33a26e(0xee)]:''));}}return _0x140533['join']('\x0a');}function targetPreview(_0x26396b){const _0x2338f6=a39_0x283c;return{'kind':_0x26396b['kind'],'command':_0x26396b['command'],'appRef':_0x26396b[_0x2338f6(0xf7)],'datasetCode':_0x26396b[_0x2338f6(0x10c)],'datatable':_0x26396b[_0x2338f6(0x121)],'sqlCode':_0x26396b[_0x2338f6(0xff)],'bffCode':_0x26396b[_0x2338f6(0xe2)],'bffId':_0x26396b['bffId'],'functionName':_0x26396b[_0x2338f6(0xe9)]};}function normalizeScalarParams(_0x32afba){const _0xf8011d=a39_0x283c;return Object['fromEntries'](Object['entries'](_0x32afba)[_0xf8011d(0xf3)](([,_0x1571b5])=>typeof _0x1571b5===_0xf8011d(0x10e)||typeof _0x1571b5===_0xf8011d(0x101)));}function hasText(_0x24aacf){const _0x3e87f8=a39_0x283c;return typeof _0x24aacf===_0x3e87f8(0x10e)&&_0x24aacf['trim']()[_0x3e87f8(0xdd)]>0x0;}function isPrimitiveFlagDefault(_0xc51dbf){const _0x179665=a39_0x283c;return _0xc51dbf===undefined||typeof _0xc51dbf===_0x179665(0x10e)||typeof _0xc51dbf===_0x179665(0x101)||typeof _0xc51dbf===_0x179665(0x10f);}
@@ -1 +1 @@
1
- (function(_0x573827,_0x3c3a05){const _0x42a2ee=a40_0x5040,_0x5e1409=_0x573827();while(!![]){try{const _0x2fed8d=parseInt(_0x42a2ee(0x205))/0x1*(-parseInt(_0x42a2ee(0x1fc))/0x2)+-parseInt(_0x42a2ee(0x20c))/0x3+parseInt(_0x42a2ee(0x1ff))/0x4+parseInt(_0x42a2ee(0x1f6))/0x5*(-parseInt(_0x42a2ee(0x204))/0x6)+parseInt(_0x42a2ee(0x1f7))/0x7+parseInt(_0x42a2ee(0x214))/0x8+parseInt(_0x42a2ee(0x1fd))/0x9*(parseInt(_0x42a2ee(0x20e))/0xa);if(_0x2fed8d===_0x3c3a05)break;else _0x5e1409['push'](_0x5e1409['shift']());}catch(_0x3a7c80){_0x5e1409['push'](_0x5e1409['shift']());}}}(a40_0x24bb,0x86f05));export function adaptServiceTreeManifestForLegacyFramework(_0x3844fc){const _0x23a79a=a40_0x5040,_0x3bd2f0=cloneJsonValue(_0x3844fc),_0x81dc29=[];if(!isObjectRecord(_0x3bd2f0))return{'manifest':_0x3bd2f0,'errors':_0x81dc29};return Array[_0x23a79a(0x1f9)](_0x3bd2f0[_0x23a79a(0x20d)])&&_0x3bd2f0['commands'][_0x23a79a(0x213)]((_0x5ec9f8,_0x4979ac)=>{const _0x491838=_0x23a79a;if(!isObjectRecord(_0x5ec9f8))return;adaptBffTarget(_0x5ec9f8[_0x491838(0x211)],_0x491838(0x215)+_0x4979ac+_0x491838(0x1f4),_0x81dc29);}),adaptResources(_0x3bd2f0['resources'],_0x23a79a(0x202),_0x81dc29),{'manifest':_0x3bd2f0,'errors':_0x81dc29};}export function toPublicServiceTreeTarget(_0x4cf706){const _0x177552=a40_0x5040,{scriptName:_0x3f1145,..._0x5aa8fd}=_0x4cf706;return typeof _0x3f1145===_0x177552(0x208)&&_0x3f1145[_0x177552(0x1f5)]()&&(_0x5aa8fd[_0x177552(0x206)]=_0x3f1145),_0x5aa8fd;}export function toPublicNormalizedServiceTree(_0x3f831c){const _0x2ef50c=a40_0x5040;return{..._0x3f831c,'commands':_0x3f831c[_0x2ef50c(0x20d)]['map'](_0x4376c5=>({..._0x4376c5,'target':toPublicServiceTreeTarget(_0x4376c5[_0x2ef50c(0x211)])}))};}function a40_0x24bb(){const _0x46b462=['bff','12CBixWX','190241jnRtnH','functionName','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','string','.functionName','functionName\x20must\x20be\x20a\x20non-empty\x20string.','map','2125101OdgyKn','commands','552940txQWbC','bff.exec','fromEntries','target','push','forEach','3552280QKSHQx','$.commands[','hasOwnProperty','.scriptName','.actions.','].target','trim','1404035ZIizFx','6595925yXIrHd','action','isArray','.resources','scriptName','6zyItSg','144PYDDbg','kind','489596KuMcyA','actions','entries','$.resources'];a40_0x24bb=function(){return _0x46b462;};return a40_0x24bb();}function adaptResources(_0xe0d204,_0x3bf19c,_0x271219){const _0x333491=a40_0x5040;if(!isObjectRecord(_0xe0d204))return;for(const [_0x2236b1,_0x19279e]of Object[_0x333491(0x201)](_0xe0d204)){if(!isObjectRecord(_0x19279e))continue;const _0x162bf7=_0x3bf19c+'.'+_0x2236b1;if(isObjectRecord(_0x19279e[_0x333491(0x200)]))for(const [_0x12aa27,_0x4f001c]of Object[_0x333491(0x201)](_0x19279e[_0x333491(0x200)])){if(!isObjectRecord(_0x4f001c))continue;const _0x3d9875=_0x162bf7+_0x333491(0x1f3)+_0x12aa27,_0x1fa560=isObjectRecord(_0x4f001c['target'])&&_0x4f001c[_0x333491(0x211)][_0x333491(0x1fe)]==='bff';adaptBffTarget(_0x4f001c['target'],_0x3d9875+'.target',_0x271219),(_0x1fa560||isBffAction(_0x4f001c))&&adaptFunctionNameField(_0x4f001c,_0x3d9875,_0x271219);}adaptResources(_0x19279e['resources'],_0x162bf7+_0x333491(0x1fa),_0x271219);}}function adaptBffTarget(_0x18db11,_0x4b6853,_0x4d714d){const _0xd19b4c=a40_0x5040;if(!isObjectRecord(_0x18db11)||_0x18db11[_0xd19b4c(0x1fe)]!==_0xd19b4c(0x203))return;adaptFunctionNameField(_0x18db11,_0x4b6853,_0x4d714d);}function adaptFunctionNameField(_0x300d51,_0x195b5f,_0x2b7db1){const _0xcc37b3=a40_0x5040;Object['prototype'][_0xcc37b3(0x1f1)]['call'](_0x300d51,'scriptName')&&_0x2b7db1[_0xcc37b3(0x212)]({'level':'error','path':_0x195b5f+_0xcc37b3(0x1f2),'message':_0xcc37b3(0x207)});if(Object['prototype'][_0xcc37b3(0x1f1)]['call'](_0x300d51,_0xcc37b3(0x206))){if(typeof _0x300d51[_0xcc37b3(0x206)]!==_0xcc37b3(0x208)||!_0x300d51[_0xcc37b3(0x206)][_0xcc37b3(0x1f5)]()){_0x2b7db1[_0xcc37b3(0x212)]({'level':'error','path':_0x195b5f+_0xcc37b3(0x209),'message':_0xcc37b3(0x20a)}),delete _0x300d51['functionName'];return;}_0x300d51[_0xcc37b3(0x1fb)]=_0x300d51[_0xcc37b3(0x206)],delete _0x300d51['functionName'];}}function isBffAction(_0x307c63){const _0xb9be79=a40_0x5040;return _0x307c63[_0xb9be79(0x1fe)]===_0xb9be79(0x203)||_0x307c63[_0xb9be79(0x1f8)]===_0xb9be79(0x20f)||_0x307c63[_0xb9be79(0x211)]==='bff.exec';}function a40_0x5040(_0x36f860,_0x4d27b2){_0x36f860=_0x36f860-0x1f1;const _0x24bbd2=a40_0x24bb();let _0x5040f9=_0x24bbd2[_0x36f860];return _0x5040f9;}function cloneJsonValue(_0x2a74e2){const _0x48daf3=a40_0x5040;if(Array[_0x48daf3(0x1f9)](_0x2a74e2))return _0x2a74e2[_0x48daf3(0x20b)](_0x3effea=>cloneJsonValue(_0x3effea));if(isObjectRecord(_0x2a74e2))return Object[_0x48daf3(0x210)](Object['entries'](_0x2a74e2)[_0x48daf3(0x20b)](([_0x342002,_0x228c5e])=>[_0x342002,cloneJsonValue(_0x228c5e)]));return _0x2a74e2;}function isObjectRecord(_0x5784f1){const _0x38632e=a40_0x5040;return Boolean(_0x5784f1)&&typeof _0x5784f1==='object'&&!Array[_0x38632e(0x1f9)](_0x5784f1);}
1
+ (function(_0x4d447e,_0x20bed0){const _0x5484f3=a40_0x445b,_0x2e1cf1=_0x4d447e();while(!![]){try{const _0x2b1b5e=parseInt(_0x5484f3(0xe4))/0x1*(parseInt(_0x5484f3(0xdc))/0x2)+parseInt(_0x5484f3(0xd4))/0x3+-parseInt(_0x5484f3(0xe0))/0x4*(parseInt(_0x5484f3(0xef))/0x5)+parseInt(_0x5484f3(0xe2))/0x6+parseInt(_0x5484f3(0xd3))/0x7*(parseInt(_0x5484f3(0xdd))/0x8)+-parseInt(_0x5484f3(0xe9))/0x9+parseInt(_0x5484f3(0xf9))/0xa;if(_0x2b1b5e===_0x20bed0)break;else _0x2e1cf1['push'](_0x2e1cf1['shift']());}catch(_0x134081){_0x2e1cf1['push'](_0x2e1cf1['shift']());}}}(a40_0x6471,0x2933d));function a40_0x445b(_0x48e013,_0x4af187){_0x48e013=_0x48e013-0xd2;const _0x647182=a40_0x6471();let _0x445bae=_0x647182[_0x48e013];return _0x445bae;}export function adaptServiceTreeManifestForLegacyFramework(_0x10d47f){const _0x3a7a15=a40_0x445b,_0x469120=cloneJsonValue(_0x10d47f),_0xa046f=[];if(!isObjectRecord(_0x469120))return{'manifest':_0x469120,'errors':_0xa046f};return Array[_0x3a7a15(0xd7)](_0x469120['commands'])&&_0x469120['commands'][_0x3a7a15(0xda)]((_0x272e1f,_0x32883c)=>{const _0x2a6684=_0x3a7a15;if(!isObjectRecord(_0x272e1f))return;adaptBffTarget(_0x272e1f[_0x2a6684(0xd2)],'$.commands['+_0x32883c+'].target',_0xa046f);}),adaptResources(_0x469120[_0x3a7a15(0xdf)],_0x3a7a15(0xf5),_0xa046f),{'manifest':_0x469120,'errors':_0xa046f};}export function toPublicServiceTreeTarget(_0x585a62){const _0x141038=a40_0x445b,{scriptName:_0x4438e3,..._0x7d8259}=_0x585a62;return typeof _0x4438e3===_0x141038(0xd8)&&_0x4438e3[_0x141038(0xea)]()&&(_0x7d8259[_0x141038(0xf2)]=_0x4438e3),_0x7d8259;}export function toPublicNormalizedServiceTree(_0x352bed){const _0x19a3fd=a40_0x445b;return{..._0x352bed,'commands':_0x352bed[_0x19a3fd(0xf8)][_0x19a3fd(0xfa)](_0x233a57=>({..._0x233a57,'target':toPublicServiceTreeTarget(_0x233a57[_0x19a3fd(0xd2)])}))};}function adaptResources(_0x397b29,_0x4760dc,_0x4ef0f0){const _0x232473=a40_0x445b;if(!isObjectRecord(_0x397b29))return;for(const [_0x539fd1,_0x1bded7]of Object[_0x232473(0xf1)](_0x397b29)){if(!isObjectRecord(_0x1bded7))continue;const _0x606b40=_0x4760dc+'.'+_0x539fd1;if(isObjectRecord(_0x1bded7[_0x232473(0xdb)]))for(const [_0x11e342,_0x413ed8]of Object[_0x232473(0xf1)](_0x1bded7[_0x232473(0xdb)])){if(!isObjectRecord(_0x413ed8))continue;const _0x542e7f=_0x606b40+_0x232473(0xe3)+_0x11e342,_0x127c44=isObjectRecord(_0x413ed8['target'])&&_0x413ed8[_0x232473(0xd2)]['kind']==='bff';adaptBffTarget(_0x413ed8[_0x232473(0xd2)],_0x542e7f+_0x232473(0xf3),_0x4ef0f0),(_0x127c44||isBffAction(_0x413ed8))&&adaptFunctionNameField(_0x413ed8,_0x542e7f,_0x4ef0f0);}adaptResources(_0x1bded7[_0x232473(0xdf)],_0x606b40+_0x232473(0xe6),_0x4ef0f0);}}function adaptBffTarget(_0x233bcc,_0x3b1921,_0x5b1d76){const _0x220b91=a40_0x445b;if(!isObjectRecord(_0x233bcc)||_0x233bcc[_0x220b91(0xee)]!==_0x220b91(0xeb))return;adaptFunctionNameField(_0x233bcc,_0x3b1921,_0x5b1d76);}function adaptFunctionNameField(_0x5452c9,_0x7cd002,_0x147505){const _0x4039c3=a40_0x445b;Object[_0x4039c3(0xd6)][_0x4039c3(0xf0)][_0x4039c3(0xe1)](_0x5452c9,_0x4039c3(0xde))&&_0x147505[_0x4039c3(0xed)]({'level':_0x4039c3(0xe7),'path':_0x7cd002+_0x4039c3(0xe8),'message':_0x4039c3(0xd9)});if(Object[_0x4039c3(0xd6)][_0x4039c3(0xf0)]['call'](_0x5452c9,_0x4039c3(0xf2))){if(typeof _0x5452c9[_0x4039c3(0xf2)]!=='string'||!_0x5452c9['functionName'][_0x4039c3(0xea)]()){_0x147505[_0x4039c3(0xed)]({'level':_0x4039c3(0xe7),'path':_0x7cd002+_0x4039c3(0xf4),'message':_0x4039c3(0xec)}),delete _0x5452c9[_0x4039c3(0xf2)];return;}_0x5452c9['scriptName']=_0x5452c9['functionName'],delete _0x5452c9[_0x4039c3(0xf2)];}}function isBffAction(_0x1c3e59){const _0x154f68=a40_0x445b;return _0x1c3e59[_0x154f68(0xee)]==='bff'||_0x1c3e59[_0x154f68(0xe5)]===_0x154f68(0xd5)||_0x1c3e59['target']===_0x154f68(0xd5);}function cloneJsonValue(_0x19bd58){const _0x336d63=a40_0x445b;if(Array['isArray'](_0x19bd58))return _0x19bd58[_0x336d63(0xfa)](_0x10c64a=>cloneJsonValue(_0x10c64a));if(isObjectRecord(_0x19bd58))return Object[_0x336d63(0xf6)](Object[_0x336d63(0xf1)](_0x19bd58)[_0x336d63(0xfa)](([_0xf119c,_0x3688f3])=>[_0xf119c,cloneJsonValue(_0x3688f3)]));return _0x19bd58;}function a40_0x6471(){const _0x1b9529=['target','203714DncCdx','312171dGKGAX','bff.exec','prototype','isArray','string','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','forEach','actions','1122DGDhXg','8tyvwHE','scriptName','resources','36VBPYMH','call','237882yYFriN','.actions.','113IeFYaR','action','.resources','error','.scriptName','1078704JAmKUb','trim','bff','functionName\x20must\x20be\x20a\x20non-empty\x20string.','push','kind','57215CXDGRh','hasOwnProperty','entries','functionName','.target','.functionName','$.resources','fromEntries','object','commands','1554090gGHkEw','map'];a40_0x6471=function(){return _0x1b9529;};return a40_0x6471();}function isObjectRecord(_0x324dee){const _0x1c8d98=a40_0x445b;return Boolean(_0x324dee)&&typeof _0x324dee===_0x1c8d98(0xf7)&&!Array[_0x1c8d98(0xd7)](_0x324dee);}
@@ -1 +1 @@
1
- function a41_0x3f35(){const _0x172ba1=['normalizedManifest','reduce','list','cliPath','import','str','entry','registryPath','1525825SQfvxP','filePath','version','validate','2532vwDNsJ','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','serviceCount','errors','required','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','report','source','detail','manifests','type','string','hash','kind','registry','risk','target','lower\x20kebab-case\x20service\x20code','14646WyaBup','imported','从本地运行态注册表移除\x20Service\x20Tree\x20清单','service','updated','entries','serviceCode','WRITE','warnings','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','read','Local\x20service\x20not\x20found:\x20','map','6jFoTSJ','write','registryServiceCode','flags','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','\x20service\x20','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','file','Local\x20service\x20code,\x20for\x20example\x20crm','\x20service(s),\x20updated\x20','importedAt','replaced','length','160qDBWLQ','remove','132zZDAFo','20330nwqdxU','100OsEocp','Imported','description','manifest','846024HaQour','commands','10hZodMe','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','2587617avUXTV','295339BHkYfC','name'];a41_0x3f35=function(){return _0x172ba1;};return a41_0x3f35();}const a41_0x39b7ef=a41_0x54ab;(function(_0x44cf36,_0x14d6a9){const _0x7e30c3=a41_0x54ab,_0xd26a90=_0x44cf36();while(!![]){try{const _0x3aa1da=parseInt(_0x7e30c3(0xa6))/0x1+-parseInt(_0x7e30c3(0x8f))/0x2*(-parseInt(_0x7e30c3(0xba))/0x3)+parseInt(_0x7e30c3(0x8b))/0x4*(parseInt(_0x7e30c3(0x8e))/0x5)+parseInt(_0x7e30c3(0xc7))/0x6*(parseInt(_0x7e30c3(0xa2))/0x7)+parseInt(_0x7e30c3(0x93))/0x8+-parseInt(_0x7e30c3(0x97))/0x9*(parseInt(_0x7e30c3(0x95))/0xa)+-parseInt(_0x7e30c3(0x98))/0xb*(parseInt(_0x7e30c3(0x8d))/0xc);if(_0x3aa1da===_0x14d6a9)break;else _0xd26a90['push'](_0xd26a90['shift']());}catch(_0x4818de){_0xd26a90['push'](_0xd26a90['shift']());}}}(a41_0x3f35,0x24a84));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a41_0x39b7ef(0xce),'type':a41_0x39b7ef(0xb3),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a41_0x39b7ef(0xbd),'type':a41_0x39b7ef(0xb3),'required':!![],'description':a41_0x39b7ef(0xcf),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x39b7ef(0xb9)}};function a41_0x54ab(_0x318ee5,_0x281c14){_0x318ee5=_0x318ee5-0x87;const _0x3f3575=a41_0x3f35();let _0x54ab18=_0x3f3575[_0x318ee5];return _0x54ab18;}function summarizeService(_0x22dba9){const _0x40c16c=a41_0x39b7ef;return{'serviceCode':_0x22dba9[_0x40c16c(0xc0)],'name':_0x22dba9[_0x40c16c(0x9a)][_0x40c16c(0xbd)]['name'],'version':_0x22dba9[_0x40c16c(0xa4)],'importedAt':_0x22dba9[_0x40c16c(0x88)],'source':_0x22dba9[_0x40c16c(0xaf)],'commandCount':_0x22dba9[_0x40c16c(0x9a)][_0x40c16c(0x94)][_0x40c16c(0x8a)],'commands':_0x22dba9[_0x40c16c(0x9a)][_0x40c16c(0x94)][_0x40c16c(0xc6)](_0x17c3db=>({'path':_0x17c3db['cliPath'],'description':_0x17c3db[_0x40c16c(0x91)],'risk':_0x17c3db[_0x40c16c(0xb7)],'target':toPublicServiceTreeTarget(_0x17c3db[_0x40c16c(0xb8)]),'flags':_0x17c3db[_0x40c16c(0xca)][_0x40c16c(0xc6)](_0x29915a=>({'name':_0x29915a[_0x40c16c(0x99)],'cliName':_0x29915a['cliName'],'type':_0x29915a[_0x40c16c(0xb2)],'required':_0x29915a[_0x40c16c(0xaa)]===!![]}))}))};}function summarizeLoadedManifest(_0x5b76c0){const _0x389294=a41_0x39b7ef;return{'service':_0x5b76c0[_0x389294(0x9a)]?.['service'],'version':_0x5b76c0[_0x389294(0x9a)]?.[_0x389294(0xa4)],'commandCount':_0x5b76c0['normalizedManifest']?.[_0x389294(0x94)][_0x389294(0x8a)]??0x0,'commands':_0x5b76c0[_0x389294(0x9a)]?.[_0x389294(0x94)][_0x389294(0xc6)](_0x5af62f=>({'path':_0x5af62f[_0x389294(0x9d)],'risk':_0x5af62f['risk'],'target':toPublicServiceTreeTarget(_0x5af62f['target'])}))??[],'registryIndex':_0x5b76c0['registryIndex'],'registryServiceCode':_0x5b76c0[_0x389294(0xc9)],'errors':_0x5b76c0[_0x389294(0xae)][_0x389294(0xa9)],'warnings':_0x5b76c0[_0x389294(0xae)]['warnings']};}export const serviceDefinitions=[{'service':a41_0x39b7ef(0xbd),'command':a41_0x39b7ef(0xa5),'description':a41_0x39b7ef(0xac),'risk':a41_0x39b7ef(0xc4),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x10da2a){const _0xe92a7b=a41_0x39b7ef,_0x1bfc0c=loadServiceManifestFromFile(_0x10da2a['str'](_0xe92a7b(0xce)));if(!_0x1bfc0c[_0xe92a7b(0xae)]['ok'])return{'ok':![],'data':{'file':_0x1bfc0c['filePath'],'hash':_0x1bfc0c['hash'],'kind':_0x1bfc0c[_0xe92a7b(0xb5)],'serviceCount':_0x1bfc0c['manifests']['length'],'services':_0x1bfc0c[_0xe92a7b(0xb1)][_0xe92a7b(0xc6)](summarizeLoadedManifest),'errors':_0x1bfc0c['report'][_0xe92a7b(0xa9)],'warnings':_0x1bfc0c[_0xe92a7b(0xae)][_0xe92a7b(0xc2)]},'message':formatValidationFailure(_0x1bfc0c[_0xe92a7b(0xae)])};if(_0x1bfc0c['kind']===_0xe92a7b(0xb6)||_0x1bfc0c[_0xe92a7b(0xb1)][_0xe92a7b(0x8a)]!==0x1)return{'ok':!![],'data':{'file':_0x1bfc0c['filePath'],'hash':_0x1bfc0c['hash'],'kind':_0x1bfc0c['kind'],'serviceCount':_0x1bfc0c[_0xe92a7b(0xb1)]['length'],'commandCount':_0x1bfc0c['manifests'][_0xe92a7b(0x9b)]((_0x464eb4,_0x120e04)=>_0x464eb4+(_0x120e04[_0xe92a7b(0x9a)]?.[_0xe92a7b(0x94)]['length']??0x0),0x0),'services':_0x1bfc0c['manifests'][_0xe92a7b(0xc6)](summarizeLoadedManifest),'warnings':_0x1bfc0c[_0xe92a7b(0xae)][_0xe92a7b(0xc2)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x1bfc0c['filePath'],'hash':_0x1bfc0c[_0xe92a7b(0xb4)],'kind':_0x1bfc0c[_0xe92a7b(0xb5)],'service':_0x1bfc0c[_0xe92a7b(0x9a)]?.[_0xe92a7b(0xbd)],'version':_0x1bfc0c[_0xe92a7b(0x9a)]?.[_0xe92a7b(0xa4)],'commandCount':_0x1bfc0c['normalizedManifest']?.[_0xe92a7b(0x94)][_0xe92a7b(0x8a)]??0x0,'commands':_0x1bfc0c['normalizedManifest']?.[_0xe92a7b(0x94)]['map'](_0x370a2a=>({'path':_0x370a2a[_0xe92a7b(0x9d)],'risk':_0x370a2a['risk'],'target':toPublicServiceTreeTarget(_0x370a2a['target'])})),'warnings':_0x1bfc0c['report'][_0xe92a7b(0xc2)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':'service','command':a41_0x39b7ef(0x9e),'description':'将\x20Service\x20Tree\x20清单导入本地运行态注册表','risk':a41_0x39b7ef(0xc8),'confirmationDescription':a41_0x39b7ef(0x96),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x2d1946){const _0x53c216=a41_0x39b7ef,_0x17216e=loadServiceManifestFromFile(_0x2d1946['str']('file'));return{'method':_0x53c216(0xc1),'url':getServiceRegistryPath(),'body':{'file':_0x17216e[_0x53c216(0xa3)],'hash':_0x17216e[_0x53c216(0xb4)],'kind':_0x17216e[_0x53c216(0xb5)],'ok':_0x17216e[_0x53c216(0xae)]['ok'],'service':_0x17216e['normalizedManifest']?.[_0x53c216(0xbd)],'version':_0x17216e[_0x53c216(0x9a)]?.[_0x53c216(0xa4)],'serviceCount':_0x17216e[_0x53c216(0xb1)][_0x53c216(0x8a)],'services':_0x17216e[_0x53c216(0xb1)]['map'](_0x3ffea6=>({'service':_0x3ffea6[_0x53c216(0x9a)]?.['service'],'version':_0x3ffea6[_0x53c216(0x9a)]?.[_0x53c216(0xa4)],'commandCount':_0x3ffea6['normalizedManifest']?.['commands'][_0x53c216(0x8a)]??0x0,'errors':_0x3ffea6[_0x53c216(0xae)][_0x53c216(0xa9)]})),'errors':_0x17216e[_0x53c216(0xae)][_0x53c216(0xa9)],'commandCount':_0x17216e[_0x53c216(0x9a)]?.[_0x53c216(0x94)][_0x53c216(0x8a)]??0x0},'description':_0x53c216(0xad)};},async 'execute'(_0x2eb950){const _0xa0aa57=a41_0x39b7ef,_0x58e070=importServiceManifest(_0x2eb950[_0xa0aa57(0x9f)](_0xa0aa57(0xce)));if(_0x58e070['entries']['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x58e070[_0xa0aa57(0xa1)],'imported':_0x58e070[_0xa0aa57(0xbb)],'updated':_0x58e070[_0xa0aa57(0xbe)],'serviceCount':_0x58e070[_0xa0aa57(0xa8)],'services':_0x58e070[_0xa0aa57(0xbf)][_0xa0aa57(0xc6)](summarizeService)},'message':'Imported\x20'+_0x58e070[_0xa0aa57(0xbb)]+_0xa0aa57(0x87)+_0x58e070['updated']+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x58e070['registryPath'],'replaced':_0x58e070[_0xa0aa57(0x89)],'imported':_0x58e070[_0xa0aa57(0xbb)],'updated':_0x58e070['updated'],'serviceCount':_0x58e070[_0xa0aa57(0xa8)],'service':summarizeService(_0x58e070[_0xa0aa57(0xa0)])},'message':(_0x58e070['replaced']?'Updated':_0xa0aa57(0x90))+_0xa0aa57(0xcc)+_0x58e070[_0xa0aa57(0xa0)][_0xa0aa57(0xc0)]+'.'};}},{'service':a41_0x39b7ef(0xbd),'command':'export','description':a41_0x39b7ef(0xcb),'risk':a41_0x39b7ef(0xc8),'confirmationDescription':a41_0x39b7ef(0xc3),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x7c0b63){const _0x14f01f=a41_0x39b7ef,_0x28404c=getLocalServiceEntry(_0x7c0b63[_0x14f01f(0x9f)](_0x14f01f(0xbd)));return{'method':_0x14f01f(0xc1),'url':_0x7c0b63['str'](_0x14f01f(0xce)),'body':{'service':_0x7c0b63[_0x14f01f(0x9f)](_0x14f01f(0xbd)),'found':Boolean(_0x28404c),'version':_0x28404c?.[_0x14f01f(0xa4)],'source':_0x28404c?.[_0x14f01f(0xaf)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x54b5b3){const _0x8825d4=a41_0x39b7ef,_0x58ddee=exportServiceManifest(_0x54b5b3[_0x8825d4(0x9f)]('service'),_0x54b5b3[_0x8825d4(0x9f)]('file'));return{'ok':!![],'data':{'registryPath':_0x58ddee[_0x8825d4(0xa1)],'file':_0x58ddee['filePath'],'service':summarizeService(_0x58ddee[_0x8825d4(0xa0)])},'message':'Exported\x20service\x20'+_0x58ddee[_0x8825d4(0xa0)]['serviceCode']+'.'};}},{'service':a41_0x39b7ef(0xbd),'command':a41_0x39b7ef(0x9c),'description':a41_0x39b7ef(0xa7),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x46470c=a41_0x39b7ef,_0x1ef627=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x1ef627['length'],'services':_0x1ef627[_0x46470c(0xc6)](summarizeService)}};}},{'service':a41_0x39b7ef(0xbd),'command':a41_0x39b7ef(0x8c),'description':a41_0x39b7ef(0xbc),'risk':a41_0x39b7ef(0xc8),'confirmationDescription':a41_0x39b7ef(0xcd),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x470812){const _0xe7d735=a41_0x39b7ef,_0x10b4a8=getLocalServiceEntry(_0x470812['str'](_0xe7d735(0xbd)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x470812['str'](_0xe7d735(0xbd)),'found':Boolean(_0x10b4a8),'version':_0x10b4a8?.[_0xe7d735(0xa4)],'source':_0x10b4a8?.['source']},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x352b92){const _0x4ab1c4=a41_0x39b7ef,_0x5a65c2=removeServiceManifest(_0x352b92[_0x4ab1c4(0x9f)](_0x4ab1c4(0xbd)));return{'ok':!![],'data':{'registryPath':_0x5a65c2[_0x4ab1c4(0xa1)],'serviceCount':_0x5a65c2[_0x4ab1c4(0xa8)],'service':summarizeService(_0x5a65c2[_0x4ab1c4(0xa0)])},'message':'Removed\x20service\x20'+_0x5a65c2[_0x4ab1c4(0xa0)]['serviceCode']+'.'};}},{'service':a41_0x39b7ef(0xbd),'command':a41_0x39b7ef(0xb0),'description':a41_0x39b7ef(0xab),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x2a86ac){const _0x132adb=a41_0x39b7ef,_0x201c20=getLocalServiceEntry(_0x2a86ac[_0x132adb(0x9f)](_0x132adb(0xbd)));if(!_0x201c20)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x2a86ac[_0x132adb(0x9f)](_0x132adb(0xbd))},'message':_0x132adb(0xc5)+_0x2a86ac[_0x132adb(0x9f)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x201c20),'manifest':_0x201c20[_0x132adb(0x92)],'normalizedManifest':toPublicNormalizedServiceTree(_0x201c20[_0x132adb(0x9a)])}};}}];
1
+ const a41_0x27193f=a41_0x5b09;(function(_0x3b5943,_0xde61be){const _0x4308c3=a41_0x5b09,_0x110b41=_0x3b5943();while(!![]){try{const _0x4c4e8e=-parseInt(_0x4308c3(0xef))/0x1+-parseInt(_0x4308c3(0xcd))/0x2*(-parseInt(_0x4308c3(0xd7))/0x3)+-parseInt(_0x4308c3(0xd5))/0x4+-parseInt(_0x4308c3(0xff))/0x5+-parseInt(_0x4308c3(0xe5))/0x6*(parseInt(_0x4308c3(0xcb))/0x7)+parseInt(_0x4308c3(0x108))/0x8+parseInt(_0x4308c3(0xd3))/0x9;if(_0x4c4e8e===_0xde61be)break;else _0x110b41['push'](_0x110b41['shift']());}catch(_0x165179){_0x110b41['push'](_0x110b41['shift']());}}}(a41_0x57b8,0xbe8c2));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a41_0x5b09(_0x2f52e1,_0x5a4ad1){_0x2f52e1=_0x2f52e1-0xc8;const _0x57b867=a41_0x57b8();let _0x5b0913=_0x57b867[_0x2f52e1];return _0x5b0913;}function a41_0x57b8(){const _0x50ef61=['Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','4NxWpla','service','commands','serviceCode','Updated','read','21662037XxVXnR','flags','5356508ehVBHK','length','1628526eFvtTs','string','registryIndex','registry','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','replaced','将\x20Service\x20Tree\x20清单导入本地运行态注册表','source','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','manifest','Removed\x20service\x20','Imported\x20','Service\x20Tree\x20manifest\x20file\x20path','22020hlHjhN','filePath','map','file','errors','Exported\x20service\x20','cliPath','cliName','type','importedAt','627796yQQIkk','description','从本地运行态注册表移除\x20Service\x20Tree\x20清单','lower\x20kebab-case\x20service\x20code','version','\x20service(s).','updated','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','Service\x20manifest\x20validation\x20passed.','risk','normalizedManifest','imported','Imported','name','kind','warnings','1413310glqJvZ','entries','import','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','serviceCount','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','registryPath','detail','entry','1672800bHctFm','Local\x20service\x20code,\x20for\x20example\x20crm','export','required','\x20service(s),\x20updated\x20','hash','str','write','Service\x20registry\x20validation\x20passed.','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','manifests','report','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','WRITE','target','1281EjmrDf'];a41_0x57b8=function(){return _0x50ef61;};return a41_0x57b8();}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a41_0x27193f(0xe8),'type':a41_0x27193f(0xd8),'required':!![],'description':a41_0x27193f(0xe4)},SERVICE_FLAG={'name':a41_0x27193f(0xce),'type':a41_0x27193f(0xd8),'required':!![],'description':a41_0x27193f(0x109),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x27193f(0xf2)}};function summarizeService(_0x45c57e){const _0x552e99=a41_0x27193f;return{'serviceCode':_0x45c57e[_0x552e99(0xd0)],'name':_0x45c57e['normalizedManifest'][_0x552e99(0xce)][_0x552e99(0xfc)],'version':_0x45c57e['version'],'importedAt':_0x45c57e[_0x552e99(0xee)],'source':_0x45c57e[_0x552e99(0xdf)],'commandCount':_0x45c57e['normalizedManifest']['commands']['length'],'commands':_0x45c57e[_0x552e99(0xf9)][_0x552e99(0xcf)][_0x552e99(0xe7)](_0x4148c3=>({'path':_0x4148c3[_0x552e99(0xeb)],'description':_0x4148c3[_0x552e99(0xf0)],'risk':_0x4148c3[_0x552e99(0xf8)],'target':toPublicServiceTreeTarget(_0x4148c3[_0x552e99(0xca)]),'flags':_0x4148c3[_0x552e99(0xd4)][_0x552e99(0xe7)](_0x2382ce=>({'name':_0x2382ce[_0x552e99(0xfc)],'cliName':_0x2382ce[_0x552e99(0xec)],'type':_0x2382ce[_0x552e99(0xed)],'required':_0x2382ce[_0x552e99(0x10b)]===!![]}))}))};}function summarizeLoadedManifest(_0x27f326){const _0x33278b=a41_0x27193f;return{'service':_0x27f326['normalizedManifest']?.['service'],'version':_0x27f326[_0x33278b(0xf9)]?.[_0x33278b(0xf3)],'commandCount':_0x27f326[_0x33278b(0xf9)]?.['commands']['length']??0x0,'commands':_0x27f326[_0x33278b(0xf9)]?.['commands'][_0x33278b(0xe7)](_0x4cf065=>({'path':_0x4cf065[_0x33278b(0xeb)],'risk':_0x4cf065['risk'],'target':toPublicServiceTreeTarget(_0x4cf065[_0x33278b(0xca)])}))??[],'registryIndex':_0x27f326[_0x33278b(0xd9)],'registryServiceCode':_0x27f326['registryServiceCode'],'errors':_0x27f326[_0x33278b(0x113)][_0x33278b(0xe9)],'warnings':_0x27f326[_0x33278b(0x113)]['warnings']};}export const serviceDefinitions=[{'service':a41_0x27193f(0xce),'command':'validate','description':a41_0x27193f(0x102),'risk':a41_0x27193f(0xd2),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x265846){const _0x442a12=a41_0x27193f,_0x532170=loadServiceManifestFromFile(_0x265846[_0x442a12(0x10e)]('file'));if(!_0x532170[_0x442a12(0x113)]['ok'])return{'ok':![],'data':{'file':_0x532170['filePath'],'hash':_0x532170[_0x442a12(0x10d)],'kind':_0x532170[_0x442a12(0xfd)],'serviceCount':_0x532170[_0x442a12(0x112)]['length'],'services':_0x532170['manifests']['map'](summarizeLoadedManifest),'errors':_0x532170[_0x442a12(0x113)][_0x442a12(0xe9)],'warnings':_0x532170['report']['warnings']},'message':formatValidationFailure(_0x532170['report'])};if(_0x532170['kind']===_0x442a12(0xda)||_0x532170[_0x442a12(0x112)][_0x442a12(0xd6)]!==0x1)return{'ok':!![],'data':{'file':_0x532170[_0x442a12(0xe6)],'hash':_0x532170['hash'],'kind':_0x532170[_0x442a12(0xfd)],'serviceCount':_0x532170[_0x442a12(0x112)][_0x442a12(0xd6)],'commandCount':_0x532170[_0x442a12(0x112)]['reduce']((_0x474f68,_0x2e5c91)=>_0x474f68+(_0x2e5c91[_0x442a12(0xf9)]?.[_0x442a12(0xcf)][_0x442a12(0xd6)]??0x0),0x0),'services':_0x532170[_0x442a12(0x112)][_0x442a12(0xe7)](summarizeLoadedManifest),'warnings':_0x532170['report'][_0x442a12(0xfe)]},'message':_0x442a12(0x110)};return{'ok':!![],'data':{'file':_0x532170[_0x442a12(0xe6)],'hash':_0x532170['hash'],'kind':_0x532170[_0x442a12(0xfd)],'service':_0x532170[_0x442a12(0xf9)]?.[_0x442a12(0xce)],'version':_0x532170['normalizedManifest']?.[_0x442a12(0xf3)],'commandCount':_0x532170['normalizedManifest']?.[_0x442a12(0xcf)]['length']??0x0,'commands':_0x532170['normalizedManifest']?.[_0x442a12(0xcf)][_0x442a12(0xe7)](_0x14f940=>({'path':_0x14f940['cliPath'],'risk':_0x14f940[_0x442a12(0xf8)],'target':toPublicServiceTreeTarget(_0x14f940[_0x442a12(0xca)])})),'warnings':_0x532170[_0x442a12(0x113)][_0x442a12(0xfe)]},'message':_0x442a12(0xf7)};}},{'service':a41_0x27193f(0xce),'command':a41_0x27193f(0x101),'description':a41_0x27193f(0xde),'risk':a41_0x27193f(0x10f),'confirmationDescription':a41_0x27193f(0x104),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x4a76e2){const _0x2a75aa=a41_0x27193f,_0x2069e8=loadServiceManifestFromFile(_0x4a76e2[_0x2a75aa(0x10e)](_0x2a75aa(0xe8)));return{'method':_0x2a75aa(0xc9),'url':getServiceRegistryPath(),'body':{'file':_0x2069e8[_0x2a75aa(0xe6)],'hash':_0x2069e8['hash'],'kind':_0x2069e8[_0x2a75aa(0xfd)],'ok':_0x2069e8['report']['ok'],'service':_0x2069e8['normalizedManifest']?.[_0x2a75aa(0xce)],'version':_0x2069e8[_0x2a75aa(0xf9)]?.[_0x2a75aa(0xf3)],'serviceCount':_0x2069e8[_0x2a75aa(0x112)]['length'],'services':_0x2069e8[_0x2a75aa(0x112)][_0x2a75aa(0xe7)](_0x164caa=>({'service':_0x164caa[_0x2a75aa(0xf9)]?.[_0x2a75aa(0xce)],'version':_0x164caa[_0x2a75aa(0xf9)]?.[_0x2a75aa(0xf3)],'commandCount':_0x164caa[_0x2a75aa(0xf9)]?.[_0x2a75aa(0xcf)][_0x2a75aa(0xd6)]??0x0,'errors':_0x164caa['report'][_0x2a75aa(0xe9)]})),'errors':_0x2069e8[_0x2a75aa(0x113)][_0x2a75aa(0xe9)],'commandCount':_0x2069e8[_0x2a75aa(0xf9)]?.[_0x2a75aa(0xcf)][_0x2a75aa(0xd6)]??0x0},'description':_0x2a75aa(0xc8)};},async 'execute'(_0x21db22){const _0x32dbba=a41_0x27193f,_0x2c575e=importServiceManifest(_0x21db22[_0x32dbba(0x10e)]('file'));if(_0x2c575e[_0x32dbba(0x100)][_0x32dbba(0xd6)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x2c575e[_0x32dbba(0x105)],'imported':_0x2c575e[_0x32dbba(0xfa)],'updated':_0x2c575e[_0x32dbba(0xf5)],'serviceCount':_0x2c575e[_0x32dbba(0x103)],'services':_0x2c575e[_0x32dbba(0x100)][_0x32dbba(0xe7)](summarizeService)},'message':_0x32dbba(0xe3)+_0x2c575e[_0x32dbba(0xfa)]+_0x32dbba(0x10c)+_0x2c575e[_0x32dbba(0xf5)]+_0x32dbba(0xf4)};return{'ok':!![],'data':{'registryPath':_0x2c575e['registryPath'],'replaced':_0x2c575e[_0x32dbba(0xdd)],'imported':_0x2c575e[_0x32dbba(0xfa)],'updated':_0x2c575e[_0x32dbba(0xf5)],'serviceCount':_0x2c575e['serviceCount'],'service':summarizeService(_0x2c575e['entry'])},'message':(_0x2c575e[_0x32dbba(0xdd)]?_0x32dbba(0xd1):_0x32dbba(0xfb))+'\x20service\x20'+_0x2c575e['entry'][_0x32dbba(0xd0)]+'.'};}},{'service':a41_0x27193f(0xce),'command':a41_0x27193f(0x10a),'description':a41_0x27193f(0x111),'risk':a41_0x27193f(0x10f),'confirmationDescription':'将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x16afc7){const _0x540dcc=a41_0x27193f,_0x3220ef=getLocalServiceEntry(_0x16afc7[_0x540dcc(0x10e)](_0x540dcc(0xce)));return{'method':_0x540dcc(0xc9),'url':_0x16afc7[_0x540dcc(0x10e)](_0x540dcc(0xe8)),'body':{'service':_0x16afc7[_0x540dcc(0x10e)]('service'),'found':Boolean(_0x3220ef),'version':_0x3220ef?.[_0x540dcc(0xf3)],'source':_0x3220ef?.[_0x540dcc(0xdf)]},'description':_0x540dcc(0xdb)};},async 'execute'(_0x1bc2ca){const _0x55c44a=a41_0x27193f,_0x300cb7=exportServiceManifest(_0x1bc2ca[_0x55c44a(0x10e)](_0x55c44a(0xce)),_0x1bc2ca[_0x55c44a(0x10e)](_0x55c44a(0xe8)));return{'ok':!![],'data':{'registryPath':_0x300cb7[_0x55c44a(0x105)],'file':_0x300cb7[_0x55c44a(0xe6)],'service':summarizeService(_0x300cb7[_0x55c44a(0x107)])},'message':_0x55c44a(0xea)+_0x300cb7[_0x55c44a(0x107)][_0x55c44a(0xd0)]+'.'};}},{'service':a41_0x27193f(0xce),'command':'list','description':a41_0x27193f(0xf6),'risk':a41_0x27193f(0xd2),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x306c88=a41_0x27193f,_0x2b1eeb=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x2b1eeb[_0x306c88(0xd6)],'services':_0x2b1eeb[_0x306c88(0xe7)](summarizeService)}};}},{'service':a41_0x27193f(0xce),'command':'remove','description':a41_0x27193f(0xf1),'risk':a41_0x27193f(0x10f),'confirmationDescription':a41_0x27193f(0xdc),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x181a8d){const _0x1d0941=a41_0x27193f,_0xca403f=getLocalServiceEntry(_0x181a8d[_0x1d0941(0x10e)]('service'));return{'method':_0x1d0941(0xc9),'url':getServiceRegistryPath(),'body':{'service':_0x181a8d[_0x1d0941(0x10e)](_0x1d0941(0xce)),'found':Boolean(_0xca403f),'version':_0xca403f?.[_0x1d0941(0xf3)],'source':_0xca403f?.[_0x1d0941(0xdf)]},'description':_0x1d0941(0xe0)};},async 'execute'(_0x4769fe){const _0x32b2c0=a41_0x27193f,_0x283047=removeServiceManifest(_0x4769fe['str'](_0x32b2c0(0xce)));return{'ok':!![],'data':{'registryPath':_0x283047[_0x32b2c0(0x105)],'serviceCount':_0x283047['serviceCount'],'service':summarizeService(_0x283047[_0x32b2c0(0x107)])},'message':_0x32b2c0(0xe2)+_0x283047[_0x32b2c0(0x107)][_0x32b2c0(0xd0)]+'.'};}},{'service':a41_0x27193f(0xce),'command':a41_0x27193f(0x106),'description':a41_0x27193f(0xcc),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x1f4aa8){const _0x15d316=a41_0x27193f,_0x4608d2=getLocalServiceEntry(_0x1f4aa8['str']('service'));if(!_0x4608d2)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x1f4aa8[_0x15d316(0x10e)]('service')},'message':'Local\x20service\x20not\x20found:\x20'+_0x1f4aa8[_0x15d316(0x10e)](_0x15d316(0xce))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x4608d2),'manifest':_0x4608d2[_0x15d316(0xe1)],'normalizedManifest':toPublicNormalizedServiceTree(_0x4608d2[_0x15d316(0xf9)])}};}}];
@@ -1 +1 @@
1
- const a42_0x299eb5=a42_0x59f0;(function(_0x1367a2,_0x79f06){const _0x44a8ce=a42_0x59f0,_0xac910a=_0x1367a2();while(!![]){try{const _0x5c0fbd=parseInt(_0x44a8ce(0x18d))/0x1*(-parseInt(_0x44a8ce(0x190))/0x2)+parseInt(_0x44a8ce(0x193))/0x3*(parseInt(_0x44a8ce(0x182))/0x4)+-parseInt(_0x44a8ce(0x167))/0x5*(-parseInt(_0x44a8ce(0x176))/0x6)+-parseInt(_0x44a8ce(0x194))/0x7*(parseInt(_0x44a8ce(0x1a4))/0x8)+parseInt(_0x44a8ce(0x188))/0x9+parseInt(_0x44a8ce(0x1a2))/0xa+parseInt(_0x44a8ce(0x17e))/0xb*(parseInt(_0x44a8ce(0x16a))/0xc);if(_0x5c0fbd===_0x79f06)break;else _0xac910a['push'](_0xac910a['shift']());}catch(_0x14a5ec){_0xac910a['push'](_0xac910a['shift']());}}}(a42_0x4446,0xbe93f));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';function a42_0x4446(){const _0x287584=['flatMap','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','startsWith','warnings','registryIndex','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','registry','message','reduce','270wxPppq','importedAt','command','].manifest','now','Unsupported\x20schemaVersion:\x20','Cannot\x20write\x20service\x20registry:\x20','version','19162mULhYQ','update','stringify','manifests','76HbHqzZ','Service\x20manifest\x20validation\x20failed:\x0a','errors','name','normalizedManifest','object','3073437JnkmiN','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','splice','schemaVersion','commandCount','159894lZQHeG','Invalid\x20service\x20manifest\x20JSON:\x20','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','6eBRiNW','.tmp','report','64578mgfoYD','2604AaIBYW','invalid','hex','parse','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','sourceHash','localeCompare','commands','manifest','bff\x20target\x20requires\x20functionName.','digest','serviceCode','target','findIndex','6402100zTtVGu','code','31216ZPXTVx','Local\x20service\x20not\x20found:\x20','CliError','validation','trim','utf8','length','cliPath','updatedAt','isArray','path','$.services[','services','Unsupported\x20service\x20registry\x20schemaVersion:\x20','sort','map','service.json','push','Invalid\x20service\x20registry\x20JSON:\x20','file','string','service','].manifest.','services\x20must\x20be\x20an\x20array','86210gDKzOl','source','risk','3756KVrNyy','toISOString'];a42_0x4446=function(){return _0x287584;};return a42_0x4446();}import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a42_0x299eb5(0x15f);export function getServiceRegistryPath(_0x43cab9={}){return resolve(_0x43cab9['homeDir']??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x370650={}){const _0x1f3f16=a42_0x299eb5,_0x18ecbb=getServiceRegistryPath(_0x370650);if(!existsSync(_0x18ecbb))return emptyServiceRegistry();try{const _0x1e1c2e=readFileSync(_0x18ecbb,_0x1f3f16(0x154));if(!_0x1e1c2e['trim']())return emptyServiceRegistry();const _0x25b7b7=JSON[_0x1f3f16(0x197)](_0x1e1c2e);if(_0x25b7b7[_0x1f3f16(0x18b)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x1f3f16(0x15c)+String(_0x25b7b7[_0x1f3f16(0x18b)]),'Remove\x20or\x20migrate\x20'+_0x18ecbb+'.');if(!Array[_0x1f3f16(0x158)](_0x25b7b7[_0x1f3f16(0x15b)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x25b7b7['updatedAt'],'services':_0x25b7b7[_0x1f3f16(0x15b)]};}catch(_0x19e6f6){if(_0x19e6f6 instanceof Error&&_0x19e6f6[_0x1f3f16(0x185)]===_0x1f3f16(0x1a6))throw _0x19e6f6;throw CliErrors['validation'](_0x1f3f16(0x161)+_0x18ecbb,_0x1f3f16(0x16d));}}export function writeServiceRegistry(_0x3bb56f,_0x5bf0a9={}){const _0x1add90=a42_0x299eb5,_0xb8ff3=getServiceRegistryPath(_0x5bf0a9),_0x1c19d3=dirname(_0xb8ff3);!existsSync(_0x1c19d3)&&mkdirSync(_0x1c19d3,{'recursive':!![]});const _0x185ec8=_0xb8ff3+_0x1add90(0x191);try{writeFileSync(_0x185ec8,JSON['stringify'](_0x3bb56f,null,0x2)+'\x0a',{'encoding':_0x1add90(0x154),'mode':0x180}),renameSync(_0x185ec8,_0xb8ff3);}catch(_0x4122b5){try{unlinkSync(_0x185ec8);}catch{}if(_0x4122b5?.[_0x1add90(0x1a3)]==='ENOENT')throw CliErrors[_0x1add90(0x1a7)](_0x1add90(0x17c)+_0xb8ff3);throw _0x4122b5;}return _0xb8ff3;}export function loadServiceManifestFromFile(_0x56b699){const _0x3ada78=a42_0x299eb5,_0x3681e3=resolve(_0x56b699);if(!existsSync(_0x3681e3))throw CliErrors['validation']('Service\x20manifest\x20file\x20not\x20found:\x20'+_0x56b699);let _0x311c9d;const _0x48568b=readFileSync(_0x3681e3,_0x3ada78(0x154));try{_0x311c9d=JSON['parse'](_0x48568b);}catch{throw CliErrors[_0x3ada78(0x1a7)](_0x3ada78(0x18e)+_0x56b699,_0x3ada78(0x189));}const _0x3f65e9=sha256(_0x48568b),_0x34c87c=extractLoadedServiceManifests(_0x311c9d,_0x3f65e9),_0x5c59d6=aggregateValidationReports(_0x34c87c),_0x57192b=_0x34c87c[0x0];return{'filePath':_0x3681e3,'hash':_0x3f65e9,'kind':isServiceRegistryLike(_0x311c9d)?_0x3ada78(0x173):_0x3ada78(0x19c),'manifest':_0x57192b?.['manifest']??_0x311c9d,'report':_0x5c59d6,'normalizedManifest':_0x34c87c[_0x3ada78(0x155)]===0x1?_0x57192b?.['normalizedManifest']:undefined,'manifests':_0x34c87c};}export function importServiceManifest(_0x56443a,_0x2fba8f={}){const _0x5b57f3=a42_0x299eb5,_0x4b4a31=loadServiceManifestFromFile(_0x56443a);if(!_0x4b4a31[_0x5b57f3(0x192)]['ok'])throw CliErrors[_0x5b57f3(0x1a7)](formatValidationFailure(_0x4b4a31['report']),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x4b4a31[_0x5b57f3(0x181)][_0x5b57f3(0x155)]===0x0)throw CliErrors['validation'](_0x5b57f3(0x16e),_0x5b57f3(0x18f));const _0x2f82b1=readServiceRegistry(_0x2fba8f),_0xf01ecf=(_0x2fba8f[_0x5b57f3(0x17a)]??(()=>new Date()))()[_0x5b57f3(0x16b)](),_0x1c7a14=[];let _0x529027=0x0,_0x39b26e=0x0;for(const _0x462e8e of _0x4b4a31['manifests']){if(!_0x462e8e[_0x5b57f3(0x186)])continue;const _0x4fdb30=_0x462e8e['normalizedManifest'][_0x5b57f3(0x164)][_0x5b57f3(0x1a3)],_0x506e7a={'serviceCode':_0x4fdb30,'version':_0x462e8e[_0x5b57f3(0x186)][_0x5b57f3(0x17d)],'importedAt':_0xf01ecf,'source':{'type':_0x5b57f3(0x162),'path':_0x4b4a31['filePath'],'hash':_0x462e8e[_0x5b57f3(0x199)]},'manifest':_0x462e8e['manifest'],'normalizedManifest':_0x462e8e[_0x5b57f3(0x186)]},_0x31e787=_0x2f82b1['services'][_0x5b57f3(0x1a1)](_0x3010cd=>_0x3010cd['serviceCode']===_0x4fdb30);_0x31e787>=0x0?(_0x2f82b1[_0x5b57f3(0x15b)][_0x31e787]=_0x506e7a,_0x39b26e++):(_0x2f82b1[_0x5b57f3(0x15b)][_0x5b57f3(0x160)](_0x506e7a),_0x529027++),_0x1c7a14['push'](_0x506e7a);}_0x2f82b1[_0x5b57f3(0x15b)][_0x5b57f3(0x15d)]((_0x492959,_0x51b937)=>_0x492959[_0x5b57f3(0x19f)][_0x5b57f3(0x19a)](_0x51b937[_0x5b57f3(0x19f)])),_0x2f82b1['updatedAt']=_0xf01ecf;const _0x3a66d4=writeServiceRegistry(_0x2f82b1,_0x2fba8f);return{'registryPath':_0x3a66d4,'entry':_0x1c7a14[0x0],'replaced':_0x1c7a14[_0x5b57f3(0x155)]===0x1?_0x39b26e===0x1:_0x39b26e>0x0,'entries':_0x1c7a14,'imported':_0x529027,'updated':_0x39b26e,'serviceCount':_0x2f82b1[_0x5b57f3(0x15b)][_0x5b57f3(0x155)]};}export function exportServiceManifest(_0x3bac12,_0x35713a,_0x30e4a0={}){const _0x48fd28=a42_0x299eb5,_0x19baf5=getServiceRegistryPath(_0x30e4a0),_0x13d425=getLocalServiceEntry(_0x3bac12,_0x30e4a0);if(!_0x13d425)throw CliErrors['validation'](_0x48fd28(0x1a5)+_0x3bac12,_0x48fd28(0x198));const _0x46b267=resolve(_0x35713a),_0x19bedc=dirname(_0x46b267);return!existsSync(_0x19bedc)&&mkdirSync(_0x19bedc,{'recursive':!![]}),writeFileSync(_0x46b267,JSON[_0x48fd28(0x180)](_0x13d425[_0x48fd28(0x19c)],null,0x2)+'\x0a',{'encoding':_0x48fd28(0x154),'mode':0x180}),{'registryPath':_0x19baf5,'filePath':_0x46b267,'entry':_0x13d425};}export function removeServiceManifest(_0x247dfa,_0x2f6719={}){const _0x54524b=a42_0x299eb5,_0x197e91=readServiceRegistry(_0x2f6719),_0x4dc5be=_0x247dfa['trim'](),_0x2f5fc1=_0x197e91[_0x54524b(0x15b)][_0x54524b(0x1a1)](_0x550fa2=>_0x550fa2[_0x54524b(0x19f)]===_0x4dc5be);if(_0x2f5fc1<0x0)throw CliErrors[_0x54524b(0x1a7)](_0x54524b(0x1a5)+_0x4dc5be,_0x54524b(0x198));const [_0x579729]=_0x197e91['services'][_0x54524b(0x18a)](_0x2f5fc1,0x1),_0x30d101=(_0x2f6719[_0x54524b(0x17a)]??(()=>new Date()))()[_0x54524b(0x16b)]();_0x197e91['updatedAt']=_0x30d101;const _0x2382bd=writeServiceRegistry(_0x197e91,_0x2f6719);return{'registryPath':_0x2382bd,'entry':_0x579729,'serviceCount':_0x197e91[_0x54524b(0x15b)][_0x54524b(0x155)]};}export function listLocalServices(_0x53ca65={}){const _0x2eb668=a42_0x299eb5;return readServiceRegistry(_0x53ca65)[_0x2eb668(0x15b)];}export function getLocalServiceEntry(_0x9b5cec,_0x4867f9={}){const _0x3b3c27=a42_0x299eb5;return readServiceRegistry(_0x4867f9)[_0x3b3c27(0x15b)]['find'](_0x16ea79=>_0x16ea79[_0x3b3c27(0x19f)]===_0x9b5cec['trim']());}export function listLocalServiceTrees(_0x56b6b9={}){const _0xe72109=a42_0x299eb5;return readServiceRegistry(_0x56b6b9)[_0xe72109(0x15b)][_0xe72109(0x15e)](_0x2fede7=>_0x2fede7['normalizedManifest']);}export function inspectServiceRegistry(_0x2efc36={}){const _0x123e76=a42_0x299eb5,_0x253346=getServiceRegistryPath(_0x2efc36);if(!existsSync(_0x253346))return emptyServiceRegistryInspection(_0x253346,'missing',![]);try{const _0x161934=readFileSync(_0x253346,'utf8');if(!_0x161934[_0x123e76(0x1a8)]())return emptyServiceRegistryInspection(_0x253346,'empty',!![]);const _0x16c1a6=JSON[_0x123e76(0x197)](_0x161934);if(_0x16c1a6[_0x123e76(0x18b)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x253346,_0x123e76(0x195),!![]),'schemaVersion':_0x16c1a6[_0x123e76(0x18b)],'message':_0x123e76(0x17b)+String(_0x16c1a6[_0x123e76(0x18b)])};if(!Array[_0x123e76(0x158)](_0x16c1a6['services']))return{...emptyServiceRegistryInspection(_0x253346,_0x123e76(0x195),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x16c1a6[_0x123e76(0x157)],'message':_0x123e76(0x166)};const _0x5b5a8c=_0x16c1a6[_0x123e76(0x15b)][_0x123e76(0x15e)](summarizeLocalServiceEntry);return{'registryPath':_0x253346,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x16c1a6[_0x123e76(0x157)],'serviceCount':_0x5b5a8c[_0x123e76(0x155)],'commandCount':_0x5b5a8c[_0x123e76(0x175)]((_0x4ae019,_0x1cf8dc)=>_0x4ae019+_0x1cf8dc[_0x123e76(0x18c)],0x0),'services':_0x5b5a8c};}catch(_0x377ae2){return{...emptyServiceRegistryInspection(_0x253346,_0x123e76(0x195),!![]),'message':_0x377ae2 instanceof Error?_0x377ae2[_0x123e76(0x174)]:String(_0x377ae2)};}}export function formatValidationFailure(_0x4e4876){const _0x2f8e09=a42_0x299eb5,_0x3c6362=_0x4e4876['errors']['map'](_0x3522a9=>_0x3522a9[_0x2f8e09(0x159)]+':\x20'+_0x3522a9[_0x2f8e09(0x174)]);return _0x2f8e09(0x183)+_0x3c6362['join']('\x0a');}function extractLoadedServiceManifests(_0x41a1d0,_0x469b0e){if(!isServiceRegistryLike(_0x41a1d0)){const _0x368f2f=_0x41a1d0,{manifest:_0x5ab543,errors:_0x35e515}=adaptServiceTreeManifestForLegacyFramework(_0x368f2f),_0x10c051=validateServiceTreeManifest(_0x5ab543),_0x37b71c=mergeValidationErrors(_0x10c051,_0x35e515);return[{'manifest':_0x368f2f,'report':_0x37b71c,'normalizedManifest':_0x37b71c['ok']?normalizeServiceTreeManifest(_0x5ab543):undefined,'sourceHash':_0x469b0e}];}return _0x41a1d0['services']['map']((_0x12fb1f,_0x5c80c6)=>{const _0x4cdafa=a42_0x59f0,_0x560219=isObjectRecord(_0x12fb1f)?_0x12fb1f['manifest']:undefined,{manifest:_0xc1a605,errors:_0x1ef77f}=adaptServiceTreeManifestForLegacyFramework(_0x560219),_0x2bad22=validateServiceTreeManifest(_0xc1a605),_0x596e8d=mergeValidationErrors(_0x2bad22,_0x1ef77f),_0x39f4db=isObjectRecord(_0x12fb1f)&&typeof _0x12fb1f[_0x4cdafa(0x19f)]===_0x4cdafa(0x163)?_0x12fb1f[_0x4cdafa(0x19f)]:undefined;return{'manifest':_0x560219,'report':_0x596e8d,'normalizedManifest':_0x596e8d['ok']?normalizeServiceTreeManifest(_0xc1a605):undefined,'sourceHash':sha256(JSON['stringify'](_0x560219,null,0x2)+'\x0a'),'registryIndex':_0x5c80c6,'registryServiceCode':_0x39f4db};});}function a42_0x59f0(_0x1ee2b6,_0x587da9){_0x1ee2b6=_0x1ee2b6-0x154;const _0x444699=a42_0x4446();let _0x59f0b1=_0x444699[_0x1ee2b6];return _0x59f0b1;}function mergeValidationErrors(_0x1bdf13,_0x1f4736){const _0x13d1f1=a42_0x299eb5,_0x34ae55=_0x1bdf13[_0x13d1f1(0x184)][_0x13d1f1(0x15e)](_0x4ad5fc=>_0x4ad5fc[_0x13d1f1(0x174)]===_0x13d1f1(0x172)?{..._0x4ad5fc,'message':_0x13d1f1(0x19d)}:_0x4ad5fc),_0xfd382b=[..._0x1f4736,..._0x34ae55];return{'ok':_0xfd382b[_0x13d1f1(0x155)]===0x0,'errors':_0xfd382b,'warnings':_0x1bdf13['warnings']};}function aggregateValidationReports(_0x50cfe0){const _0x2fdd4a=a42_0x299eb5,_0xbffc86=_0x50cfe0['flatMap'](_0x547e0b=>_0x547e0b[_0x2fdd4a(0x171)]===undefined?_0x547e0b[_0x2fdd4a(0x192)][_0x2fdd4a(0x184)]:_0x547e0b[_0x2fdd4a(0x192)][_0x2fdd4a(0x184)]['map'](_0x435436=>({..._0x435436,'path':prefixRegistryIssuePath(_0x547e0b[_0x2fdd4a(0x171)],_0x435436['path'])}))),_0xcdebbe=_0x50cfe0[_0x2fdd4a(0x16c)](_0xc2c60f=>_0xc2c60f['registryIndex']===undefined?_0xc2c60f[_0x2fdd4a(0x192)][_0x2fdd4a(0x170)]:_0xc2c60f[_0x2fdd4a(0x192)]['warnings'][_0x2fdd4a(0x15e)](_0x1017c2=>({..._0x1017c2,'path':prefixRegistryIssuePath(_0xc2c60f[_0x2fdd4a(0x171)],_0x1017c2[_0x2fdd4a(0x159)])})));return{'ok':_0xbffc86[_0x2fdd4a(0x155)]===0x0,'errors':_0xbffc86,'warnings':_0xcdebbe};}function prefixRegistryIssuePath(_0x592e7b,_0x3f8928){const _0xe8b97c=a42_0x299eb5;if(_0x3f8928==='$')return'$.services['+_0x592e7b+'].manifest';if(_0x3f8928[_0xe8b97c(0x16f)]('$.'))return _0xe8b97c(0x15a)+_0x592e7b+'].manifest'+_0x3f8928['slice'](0x1);if(_0x3f8928['startsWith']('$['))return _0xe8b97c(0x15a)+_0x592e7b+_0xe8b97c(0x179)+_0x3f8928['slice'](0x1);return _0xe8b97c(0x15a)+_0x592e7b+_0xe8b97c(0x165)+_0x3f8928;}function isServiceRegistryLike(_0x39efa6){const _0x8740c1=a42_0x299eb5;return isObjectRecord(_0x39efa6)&&_0x39efa6[_0x8740c1(0x18b)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0x39efa6[_0x8740c1(0x15b)]);}function isObjectRecord(_0xd554b6){const _0xbb756b=a42_0x299eb5;return Boolean(_0xd554b6)&&typeof _0xd554b6===_0xbb756b(0x187)&&!Array[_0xbb756b(0x158)](_0xd554b6);}function emptyServiceRegistryInspection(_0x2102a2,_0x24aaed,_0x140d65){return{'registryPath':_0x2102a2,'exists':_0x140d65,'status':_0x24aaed,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0xb8492a){const _0x324475=a42_0x299eb5,_0x3f2293=_0xb8492a[_0x324475(0x186)],_0x4a1c5d=_0x3f2293[_0x324475(0x19b)]['map'](_0x297010=>({'path':_0x297010[_0x324475(0x156)],'description':_0x297010['description'],'risk':_0x297010[_0x324475(0x169)],'targetKind':_0x297010[_0x324475(0x1a0)]['kind'],'targetCommand':_0x297010[_0x324475(0x1a0)][_0x324475(0x178)]}));return{'serviceCode':_0xb8492a[_0x324475(0x19f)],'name':_0x3f2293['service'][_0x324475(0x185)],'description':_0x3f2293[_0x324475(0x164)]['description'],'version':_0xb8492a[_0x324475(0x17d)],'importedAt':_0xb8492a[_0x324475(0x177)],'source':_0xb8492a[_0x324475(0x168)],'commandCount':_0x4a1c5d[_0x324475(0x155)],'commands':_0x4a1c5d};}function sha256(_0x4cfee0){const _0x41011a=a42_0x299eb5;return createHash('sha256')[_0x41011a(0x17f)](_0x4cfee0)[_0x41011a(0x19e)](_0x41011a(0x196));}
1
+ const a42_0x2e02ac=a42_0x380c;(function(_0x9be9cd,_0x383a40){const _0x1829dd=a42_0x380c,_0x5e6e59=_0x9be9cd();while(!![]){try{const _0x41173b=-parseInt(_0x1829dd(0x1a9))/0x1*(-parseInt(_0x1829dd(0x1c7))/0x2)+-parseInt(_0x1829dd(0x1ce))/0x3*(-parseInt(_0x1829dd(0x197))/0x4)+parseInt(_0x1829dd(0x191))/0x5+parseInt(_0x1829dd(0x1d5))/0x6+-parseInt(_0x1829dd(0x1a6))/0x7+parseInt(_0x1829dd(0x1a8))/0x8*(parseInt(_0x1829dd(0x1b6))/0x9)+-parseInt(_0x1829dd(0x195))/0xa;if(_0x41173b===_0x383a40)break;else _0x5e6e59['push'](_0x5e6e59['shift']());}catch(_0x216385){_0x5e6e59['push'](_0x5e6e59['shift']());}}}(a42_0x4506,0x79101));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;function a42_0x4506(){const _0x1a2b0d=['validation','1734147ZLoreP','findIndex','risk','sourceHash','stringify','$.services[','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','trim','manifests','utf8','homeDir','Service\x20manifest\x20file\x20not\x20found:\x20','errors','bff\x20target\x20requires\x20functionName.','slice','push','startsWith','8820XfiEep','homeDirName','digest','parse','splice','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','map','45828hOzaHI','.tmp','normalizedManifest','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','Invalid\x20service\x20registry\x20JSON:\x20','].manifest','1799364mvgQYA','find','now','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','flatMap','version','name','2298375krcQOF','serviceCode','warnings','manifest','26426330cBLnEN','registryIndex','228QFNtZw','report','services','path','kind','registry','code','schemaVersion','target','commandCount','cliPath','file','Invalid\x20service\x20manifest\x20JSON:\x20','invalid','message','1412999KmOtcT','isArray','32Xuruzr','213sBnQHc','length','ENOENT','service','CliError','updatedAt','missing','source','empty','service.json','importedAt','reduce'];a42_0x4506=function(){return _0x1a2b0d;};return a42_0x4506();}export const SERVICE_REGISTRY_FILE_NAME=a42_0x2e02ac(0x1b2);export function getServiceRegistryPath(_0x4f7a11={}){const _0x2e9d95=a42_0x2e02ac;return resolve(_0x4f7a11[_0x2e9d95(0x1c0)]??homedir(),PRODUCT_CONFIG[_0x2e9d95(0x1c8)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x5a1415={}){const _0x170088=a42_0x2e02ac,_0x2d3595=getServiceRegistryPath(_0x5a1415);if(!existsSync(_0x2d3595))return emptyServiceRegistry();try{const _0x499f05=readFileSync(_0x2d3595,_0x170088(0x1bf));if(!_0x499f05['trim']())return emptyServiceRegistry();const _0x41526a=JSON['parse'](_0x499f05);if(_0x41526a['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x170088(0x1b5)]('Unsupported\x20service\x20registry\x20schemaVersion:\x20'+String(_0x41526a[_0x170088(0x19e)]),'Remove\x20or\x20migrate\x20'+_0x2d3595+'.');if(!Array['isArray'](_0x41526a[_0x170088(0x199)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x41526a[_0x170088(0x1ae)],'services':_0x41526a[_0x170088(0x199)]};}catch(_0x263fd3){if(_0x263fd3 instanceof Error&&_0x263fd3['name']===_0x170088(0x1ad))throw _0x263fd3;throw CliErrors[_0x170088(0x1b5)](_0x170088(0x1d3)+_0x2d3595,_0x170088(0x1cc));}}function a42_0x380c(_0x1f9dbb,_0x28fdd4){_0x1f9dbb=_0x1f9dbb-0x18c;const _0x450688=a42_0x4506();let _0x380cfd=_0x450688[_0x1f9dbb];return _0x380cfd;}export function writeServiceRegistry(_0x2edfe6,_0x541e78={}){const _0x285377=a42_0x2e02ac,_0x48de70=getServiceRegistryPath(_0x541e78),_0x5cf14c=dirname(_0x48de70);!existsSync(_0x5cf14c)&&mkdirSync(_0x5cf14c,{'recursive':!![]});const _0x27be7b=_0x48de70+_0x285377(0x1cf);try{writeFileSync(_0x27be7b,JSON[_0x285377(0x1ba)](_0x2edfe6,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x27be7b,_0x48de70);}catch(_0x363370){try{unlinkSync(_0x27be7b);}catch{}if(_0x363370?.[_0x285377(0x19d)]===_0x285377(0x1ab))throw CliErrors[_0x285377(0x1b5)]('Cannot\x20write\x20service\x20registry:\x20'+_0x48de70);throw _0x363370;}return _0x48de70;}export function loadServiceManifestFromFile(_0x2ce2e0){const _0x4ef886=a42_0x2e02ac,_0x3061e9=resolve(_0x2ce2e0);if(!existsSync(_0x3061e9))throw CliErrors[_0x4ef886(0x1b5)](_0x4ef886(0x1c1)+_0x2ce2e0);let _0x8ad2e0;const _0x1badf8=readFileSync(_0x3061e9,_0x4ef886(0x1bf));try{_0x8ad2e0=JSON[_0x4ef886(0x1ca)](_0x1badf8);}catch{throw CliErrors[_0x4ef886(0x1b5)](_0x4ef886(0x1a3)+_0x2ce2e0,_0x4ef886(0x18d));}const _0x104380=sha256(_0x1badf8),_0x605da=extractLoadedServiceManifests(_0x8ad2e0,_0x104380),_0x14c2e9=aggregateValidationReports(_0x605da),_0x14ee53=_0x605da[0x0];return{'filePath':_0x3061e9,'hash':_0x104380,'kind':isServiceRegistryLike(_0x8ad2e0)?_0x4ef886(0x19c):_0x4ef886(0x194),'manifest':_0x14ee53?.['manifest']??_0x8ad2e0,'report':_0x14c2e9,'normalizedManifest':_0x605da[_0x4ef886(0x1aa)]===0x1?_0x14ee53?.[_0x4ef886(0x1d0)]:undefined,'manifests':_0x605da};}export function importServiceManifest(_0x5e9954,_0x104543={}){const _0xcb4b25=a42_0x2e02ac,_0x2c65da=loadServiceManifestFromFile(_0x5e9954);if(!_0x2c65da[_0xcb4b25(0x198)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0x2c65da[_0xcb4b25(0x198)]),_0xcb4b25(0x1bc));if(_0x2c65da[_0xcb4b25(0x1be)]['length']===0x0)throw CliErrors[_0xcb4b25(0x1b5)](_0xcb4b25(0x1d2),'Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.');const _0x329c41=readServiceRegistry(_0x104543),_0x50c30b=(_0x104543[_0xcb4b25(0x18c)]??(()=>new Date()))()['toISOString'](),_0x30e30f=[];let _0x32e3aa=0x0,_0x6a1e94=0x0;for(const _0x326321 of _0x2c65da[_0xcb4b25(0x1be)]){if(!_0x326321[_0xcb4b25(0x1d0)])continue;const _0x515b77=_0x326321[_0xcb4b25(0x1d0)][_0xcb4b25(0x1ac)]['code'],_0x510b35={'serviceCode':_0x515b77,'version':_0x326321[_0xcb4b25(0x1d0)][_0xcb4b25(0x18f)],'importedAt':_0x50c30b,'source':{'type':_0xcb4b25(0x1a2),'path':_0x2c65da['filePath'],'hash':_0x326321[_0xcb4b25(0x1b9)]},'manifest':_0x326321[_0xcb4b25(0x194)],'normalizedManifest':_0x326321[_0xcb4b25(0x1d0)]},_0x1db50e=_0x329c41[_0xcb4b25(0x199)]['findIndex'](_0x36817d=>_0x36817d[_0xcb4b25(0x192)]===_0x515b77);_0x1db50e>=0x0?(_0x329c41[_0xcb4b25(0x199)][_0x1db50e]=_0x510b35,_0x6a1e94++):(_0x329c41[_0xcb4b25(0x199)][_0xcb4b25(0x1c5)](_0x510b35),_0x32e3aa++),_0x30e30f[_0xcb4b25(0x1c5)](_0x510b35);}_0x329c41[_0xcb4b25(0x199)]['sort']((_0x292eba,_0x540cde)=>_0x292eba[_0xcb4b25(0x192)]['localeCompare'](_0x540cde[_0xcb4b25(0x192)])),_0x329c41[_0xcb4b25(0x1ae)]=_0x50c30b;const _0x18c85e=writeServiceRegistry(_0x329c41,_0x104543);return{'registryPath':_0x18c85e,'entry':_0x30e30f[0x0],'replaced':_0x30e30f[_0xcb4b25(0x1aa)]===0x1?_0x6a1e94===0x1:_0x6a1e94>0x0,'entries':_0x30e30f,'imported':_0x32e3aa,'updated':_0x6a1e94,'serviceCount':_0x329c41[_0xcb4b25(0x199)]['length']};}export function exportServiceManifest(_0x17639a,_0x2865a4,_0x3217eb={}){const _0x4af334=a42_0x2e02ac,_0x2b7e90=getServiceRegistryPath(_0x3217eb),_0x37a701=getLocalServiceEntry(_0x17639a,_0x3217eb);if(!_0x37a701)throw CliErrors[_0x4af334(0x1b5)]('Local\x20service\x20not\x20found:\x20'+_0x17639a,_0x4af334(0x1d1));const _0x144671=resolve(_0x2865a4),_0x5c263e=dirname(_0x144671);return!existsSync(_0x5c263e)&&mkdirSync(_0x5c263e,{'recursive':!![]}),writeFileSync(_0x144671,JSON[_0x4af334(0x1ba)](_0x37a701[_0x4af334(0x194)],null,0x2)+'\x0a',{'encoding':_0x4af334(0x1bf),'mode':0x180}),{'registryPath':_0x2b7e90,'filePath':_0x144671,'entry':_0x37a701};}export function removeServiceManifest(_0x6847d7,_0x557f87={}){const _0x2d2804=a42_0x2e02ac,_0x3bb4b0=readServiceRegistry(_0x557f87),_0x3cf676=_0x6847d7[_0x2d2804(0x1bd)](),_0x1e78a6=_0x3bb4b0[_0x2d2804(0x199)][_0x2d2804(0x1b7)](_0x1fe6d1=>_0x1fe6d1[_0x2d2804(0x192)]===_0x3cf676);if(_0x1e78a6<0x0)throw CliErrors[_0x2d2804(0x1b5)]('Local\x20service\x20not\x20found:\x20'+_0x3cf676,_0x2d2804(0x1d1));const [_0x2c045b]=_0x3bb4b0['services'][_0x2d2804(0x1cb)](_0x1e78a6,0x1),_0x385d26=(_0x557f87['now']??(()=>new Date()))()['toISOString']();_0x3bb4b0['updatedAt']=_0x385d26;const _0x1d985e=writeServiceRegistry(_0x3bb4b0,_0x557f87);return{'registryPath':_0x1d985e,'entry':_0x2c045b,'serviceCount':_0x3bb4b0['services']['length']};}export function listLocalServices(_0x1e4d22={}){const _0x2a4312=a42_0x2e02ac;return readServiceRegistry(_0x1e4d22)[_0x2a4312(0x199)];}export function getLocalServiceEntry(_0x32f80f,_0x2489ed={}){const _0xc05cad=a42_0x2e02ac;return readServiceRegistry(_0x2489ed)['services'][_0xc05cad(0x1d6)](_0x479bca=>_0x479bca[_0xc05cad(0x192)]===_0x32f80f[_0xc05cad(0x1bd)]());}export function listLocalServiceTrees(_0x4824ee={}){const _0x460ae5=a42_0x2e02ac;return readServiceRegistry(_0x4824ee)[_0x460ae5(0x199)][_0x460ae5(0x1cd)](_0x337386=>_0x337386[_0x460ae5(0x1d0)]);}export function inspectServiceRegistry(_0x54703b={}){const _0x48c0dc=a42_0x2e02ac,_0x349a23=getServiceRegistryPath(_0x54703b);if(!existsSync(_0x349a23))return emptyServiceRegistryInspection(_0x349a23,_0x48c0dc(0x1af),![]);try{const _0x255a5f=readFileSync(_0x349a23,'utf8');if(!_0x255a5f[_0x48c0dc(0x1bd)]())return emptyServiceRegistryInspection(_0x349a23,_0x48c0dc(0x1b1),!![]);const _0x476695=JSON['parse'](_0x255a5f);if(_0x476695[_0x48c0dc(0x19e)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x349a23,_0x48c0dc(0x1a4),!![]),'schemaVersion':_0x476695[_0x48c0dc(0x19e)],'message':'Unsupported\x20schemaVersion:\x20'+String(_0x476695[_0x48c0dc(0x19e)])};if(!Array[_0x48c0dc(0x1a7)](_0x476695[_0x48c0dc(0x199)]))return{...emptyServiceRegistryInspection(_0x349a23,'invalid',!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x476695['updatedAt'],'message':'services\x20must\x20be\x20an\x20array'};const _0x119a14=_0x476695[_0x48c0dc(0x199)][_0x48c0dc(0x1cd)](summarizeLocalServiceEntry);return{'registryPath':_0x349a23,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x476695[_0x48c0dc(0x1ae)],'serviceCount':_0x119a14[_0x48c0dc(0x1aa)],'commandCount':_0x119a14[_0x48c0dc(0x1b4)]((_0x334a18,_0x177d77)=>_0x334a18+_0x177d77[_0x48c0dc(0x1a0)],0x0),'services':_0x119a14};}catch(_0x5203d0){return{...emptyServiceRegistryInspection(_0x349a23,_0x48c0dc(0x1a4),!![]),'message':_0x5203d0 instanceof Error?_0x5203d0[_0x48c0dc(0x1a5)]:String(_0x5203d0)};}}export function formatValidationFailure(_0x3bf0f0){const _0x34786e=a42_0x2e02ac,_0x1216d3=_0x3bf0f0[_0x34786e(0x1c2)][_0x34786e(0x1cd)](_0x50b990=>_0x50b990[_0x34786e(0x19a)]+':\x20'+_0x50b990[_0x34786e(0x1a5)]);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x1216d3['join']('\x0a');}function extractLoadedServiceManifests(_0x2a4d57,_0x1c91aa){const _0x53f1b9=a42_0x2e02ac;if(!isServiceRegistryLike(_0x2a4d57)){const _0x29ec15=_0x2a4d57,{manifest:_0x2c0c96,errors:_0x259722}=adaptServiceTreeManifestForLegacyFramework(_0x29ec15),_0x4f83b5=validateServiceTreeManifest(_0x2c0c96),_0x21d593=mergeValidationErrors(_0x4f83b5,_0x259722);return[{'manifest':_0x29ec15,'report':_0x21d593,'normalizedManifest':_0x21d593['ok']?normalizeServiceTreeManifest(_0x2c0c96):undefined,'sourceHash':_0x1c91aa}];}return _0x2a4d57[_0x53f1b9(0x199)][_0x53f1b9(0x1cd)]((_0x366098,_0x2a17ff)=>{const _0x2e0e34=_0x53f1b9,_0x589efa=isObjectRecord(_0x366098)?_0x366098[_0x2e0e34(0x194)]:undefined,{manifest:_0x5fad1c,errors:_0x16235c}=adaptServiceTreeManifestForLegacyFramework(_0x589efa),_0x11d149=validateServiceTreeManifest(_0x5fad1c),_0xc1effa=mergeValidationErrors(_0x11d149,_0x16235c),_0x383774=isObjectRecord(_0x366098)&&typeof _0x366098[_0x2e0e34(0x192)]==='string'?_0x366098[_0x2e0e34(0x192)]:undefined;return{'manifest':_0x589efa,'report':_0xc1effa,'normalizedManifest':_0xc1effa['ok']?normalizeServiceTreeManifest(_0x5fad1c):undefined,'sourceHash':sha256(JSON[_0x2e0e34(0x1ba)](_0x589efa,null,0x2)+'\x0a'),'registryIndex':_0x2a17ff,'registryServiceCode':_0x383774};});}function mergeValidationErrors(_0x3606db,_0x1527f7){const _0x42b4c2=a42_0x2e02ac,_0x1fa30c=_0x3606db[_0x42b4c2(0x1c2)]['map'](_0x1016cd=>_0x1016cd[_0x42b4c2(0x1a5)]==='bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.'?{..._0x1016cd,'message':_0x42b4c2(0x1c3)}:_0x1016cd),_0x513ddd=[..._0x1527f7,..._0x1fa30c];return{'ok':_0x513ddd[_0x42b4c2(0x1aa)]===0x0,'errors':_0x513ddd,'warnings':_0x3606db[_0x42b4c2(0x193)]};}function aggregateValidationReports(_0x5cfaa1){const _0x229011=a42_0x2e02ac,_0x18da32=_0x5cfaa1[_0x229011(0x18e)](_0x365216=>_0x365216[_0x229011(0x196)]===undefined?_0x365216[_0x229011(0x198)][_0x229011(0x1c2)]:_0x365216[_0x229011(0x198)][_0x229011(0x1c2)][_0x229011(0x1cd)](_0x10074a=>({..._0x10074a,'path':prefixRegistryIssuePath(_0x365216[_0x229011(0x196)],_0x10074a[_0x229011(0x19a)])}))),_0x17385f=_0x5cfaa1['flatMap'](_0x43e908=>_0x43e908[_0x229011(0x196)]===undefined?_0x43e908[_0x229011(0x198)][_0x229011(0x193)]:_0x43e908[_0x229011(0x198)][_0x229011(0x193)][_0x229011(0x1cd)](_0x127cf1=>({..._0x127cf1,'path':prefixRegistryIssuePath(_0x43e908[_0x229011(0x196)],_0x127cf1[_0x229011(0x19a)])})));return{'ok':_0x18da32[_0x229011(0x1aa)]===0x0,'errors':_0x18da32,'warnings':_0x17385f};}function prefixRegistryIssuePath(_0x2db357,_0x30fb5b){const _0x26f701=a42_0x2e02ac;if(_0x30fb5b==='$')return _0x26f701(0x1bb)+_0x2db357+_0x26f701(0x1d4);if(_0x30fb5b[_0x26f701(0x1c6)]('$.'))return _0x26f701(0x1bb)+_0x2db357+_0x26f701(0x1d4)+_0x30fb5b[_0x26f701(0x1c4)](0x1);if(_0x30fb5b[_0x26f701(0x1c6)]('$['))return'$.services['+_0x2db357+_0x26f701(0x1d4)+_0x30fb5b[_0x26f701(0x1c4)](0x1);return _0x26f701(0x1bb)+_0x2db357+'].manifest.'+_0x30fb5b;}function isServiceRegistryLike(_0xfbf828){const _0x314b77=a42_0x2e02ac;return isObjectRecord(_0xfbf828)&&_0xfbf828['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0xfbf828[_0x314b77(0x199)]);}function isObjectRecord(_0x10f8ca){const _0x355389=a42_0x2e02ac;return Boolean(_0x10f8ca)&&typeof _0x10f8ca==='object'&&!Array[_0x355389(0x1a7)](_0x10f8ca);}function emptyServiceRegistryInspection(_0x598029,_0x66d6ff,_0x3d49d6){return{'registryPath':_0x598029,'exists':_0x3d49d6,'status':_0x66d6ff,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x31d5e6){const _0xcfcc72=a42_0x2e02ac,_0x11a834=_0x31d5e6['normalizedManifest'],_0x1204ff=_0x11a834['commands'][_0xcfcc72(0x1cd)](_0x3aa67a=>({'path':_0x3aa67a[_0xcfcc72(0x1a1)],'description':_0x3aa67a['description'],'risk':_0x3aa67a[_0xcfcc72(0x1b8)],'targetKind':_0x3aa67a[_0xcfcc72(0x19f)][_0xcfcc72(0x19b)],'targetCommand':_0x3aa67a[_0xcfcc72(0x19f)]['command']}));return{'serviceCode':_0x31d5e6[_0xcfcc72(0x192)],'name':_0x11a834['service'][_0xcfcc72(0x190)],'description':_0x11a834[_0xcfcc72(0x1ac)]['description'],'version':_0x31d5e6['version'],'importedAt':_0x31d5e6[_0xcfcc72(0x1b3)],'source':_0x31d5e6[_0xcfcc72(0x1b0)],'commandCount':_0x1204ff[_0xcfcc72(0x1aa)],'commands':_0x1204ff};}function sha256(_0x4ad57e){const _0x2fff01=a42_0x2e02ac;return createHash('sha256')['update'](_0x4ad57e)[_0x2fff01(0x1c9)]('hex');}
@@ -1 +1 @@
1
- const a43_0x4104cf=a43_0x14f0;function a43_0x14d4(){const _0x13a94e=['content','str','1296546rGPPYg','isSymbolicLink','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','validation','force','type','2549580gxLuUS','42JWCJjI','trim','2501212AmvMtv','bool','utf8','274977lneyJn','48gTTriB','map','Refusing\x20to\x20overwrite\x20symlink:\x20','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','read','skillDir','path','skill','Skill\x20directory\x20already\x20exists:\x20','rendered','创建本地自包含的运行态\x20Skill\x20草稿','116850PJJiYs','isDirectory','target','127480TxzxGK','1103024VUDjGj','27PoWvhV','skillName','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','WRITE'];a43_0x14d4=function(){return _0x13a94e;};return a43_0x14d4();}(function(_0x41c872,_0x4b6337){const _0x4e3c79=a43_0x14f0,_0x4e99e5=_0x41c872();while(!![]){try{const _0x4de732=-parseInt(_0x4e3c79(0x6c))/0x1+parseInt(_0x4e3c79(0x7d))/0x2+parseInt(_0x4e3c79(0x80))/0x3*(-parseInt(_0x4e3c79(0x81))/0x4)+parseInt(_0x4e3c79(0x69))/0x5+-parseInt(_0x4e3c79(0x74))/0x6*(-parseInt(_0x4e3c79(0x7b))/0x7)+parseInt(_0x4e3c79(0x6d))/0x8*(-parseInt(_0x4e3c79(0x6e))/0x9)+-parseInt(_0x4e3c79(0x7a))/0xa;if(_0x4de732===_0x4b6337)break;else _0x4e99e5['push'](_0x4e99e5['shift']());}catch(_0x1cdee4){_0x4e99e5['push'](_0x4e99e5['shift']());}}}(a43_0x14d4,0xa4aee));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';function a43_0x14f0(_0x2c0526,_0x16c93d){_0x2c0526=_0x2c0526-0x69;const _0x14d498=a43_0x14d4();let _0x14f025=_0x14d498[_0x2c0526];return _0x14f025;}import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a43_0x4104cf(0x88),'command':'create','description':a43_0x4104cf(0x8b),'risk':a43_0x4104cf(0x85),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x437ef1){const _0x4e803f=a43_0x4104cf,_0x379d69=buildSkillCreatePlan(_0x437ef1[_0x4e803f(0x73)]('name'),_0x437ef1['str'](_0x4e803f(0x79)),_0x437ef1[_0x4e803f(0x73)](_0x4e803f(0x6b)));return{'method':_0x4e803f(0x71),'url':_0x379d69[_0x4e803f(0x86)],'body':{'skillName':_0x379d69['rendered'][_0x4e803f(0x6f)],'type':_0x379d69[_0x4e803f(0x8a)]['type'],'selfContained':!![],'files':_0x379d69[_0x4e803f(0x8a)]['files'][_0x4e803f(0x82)](_0x5f2ca4=>_0x5f2ca4[_0x4e803f(0x87)])},'description':_0x4e803f(0x84)};},async 'execute'(_0x5f5d53){const _0x51c1c6=a43_0x4104cf,_0x194a10=buildSkillCreatePlan(_0x5f5d53[_0x51c1c6(0x73)]('name'),_0x5f5d53[_0x51c1c6(0x73)](_0x51c1c6(0x79)),_0x5f5d53['str'](_0x51c1c6(0x6b)));return writeSkillDraft(_0x194a10,_0x5f5d53[_0x51c1c6(0x7e)](_0x51c1c6(0x78))),{'ok':!![],'data':{'skillName':_0x194a10['rendered'][_0x51c1c6(0x6f)],'type':_0x194a10['rendered'][_0x51c1c6(0x79)],'dir':_0x194a10[_0x51c1c6(0x86)],'files':_0x194a10[_0x51c1c6(0x8a)]['files'][_0x51c1c6(0x82)](_0x5c5817=>_0x5c5817[_0x51c1c6(0x87)])},'message':'Created\x20local\x20Skill\x20draft\x20'+_0x194a10[_0x51c1c6(0x8a)][_0x51c1c6(0x6f)]};}};function buildSkillCreatePlan(_0x1aae66,_0x42c0b6,_0x1464b1){const _0x32ae5b=a43_0x4104cf,_0x3bc2c5=_0x42c0b6[_0x32ae5b(0x7c)](),_0x55e80a=renderSkillTemplate({'skillName':_0x1aae66,'type':_0x3bc2c5});!_0x3bc2c5&&writeCliSideChannelLine(_0x32ae5b(0x70));const _0xbec67f=resolve(normalizeSkillTarget(_0x1464b1));return{'rendered':_0x55e80a,'targetRoot':_0xbec67f,'skillDir':resolve(_0xbec67f,_0x55e80a[_0x32ae5b(0x6f)])};}function normalizeSkillTarget(_0x1995c5){const _0x100380=a43_0x4104cf;return(_0x1995c5||DEFAULT_SKILL_TARGET)[_0x100380(0x7c)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x2f11f8,_0x55115d){const _0x3fe6aa=a43_0x4104cf;if(existsSync(_0x2f11f8[_0x3fe6aa(0x86)])){const _0x32db00=lstatSync(_0x2f11f8['skillDir']);if(!_0x32db00[_0x3fe6aa(0x6a)]()||_0x32db00[_0x3fe6aa(0x75)]())throw CliErrors[_0x3fe6aa(0x77)]('Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20'+_0x2f11f8[_0x3fe6aa(0x86)]);if(!_0x55115d)throw CliErrors[_0x3fe6aa(0x77)](_0x3fe6aa(0x89)+_0x2f11f8[_0x3fe6aa(0x86)],_0x3fe6aa(0x76));}for(const _0x1ce79e of _0x2f11f8[_0x3fe6aa(0x8a)]['files']){const _0x46cdc9=resolve(_0x2f11f8[_0x3fe6aa(0x86)],_0x1ce79e[_0x3fe6aa(0x87)]),_0x3c3091=dirname(_0x46cdc9);mkdirSync(_0x3c3091,{'recursive':!![]});if(existsSync(_0x46cdc9)&&lstatSync(_0x46cdc9)['isSymbolicLink']())throw CliErrors['validation'](_0x3fe6aa(0x83)+_0x46cdc9);writeFileSync(_0x46cdc9,_0x1ce79e[_0x3fe6aa(0x72)],_0x3fe6aa(0x7f));}}
1
+ const a43_0x116bb1=a43_0xa499;(function(_0x1737b4,_0xec081a){const _0x28faa5=a43_0xa499,_0x27149a=_0x1737b4();while(!![]){try{const _0x2cefb1=-parseInt(_0x28faa5(0x96))/0x1*(-parseInt(_0x28faa5(0x76))/0x2)+parseInt(_0x28faa5(0x7b))/0x3*(parseInt(_0x28faa5(0x91))/0x4)+-parseInt(_0x28faa5(0x95))/0x5*(parseInt(_0x28faa5(0x77))/0x6)+-parseInt(_0x28faa5(0x79))/0x7*(parseInt(_0x28faa5(0x8c))/0x8)+parseInt(_0x28faa5(0x74))/0x9+-parseInt(_0x28faa5(0x73))/0xa+parseInt(_0x28faa5(0x78))/0xb*(parseInt(_0x28faa5(0x90))/0xc);if(_0x2cefb1===_0xec081a)break;else _0x27149a['push'](_0x27149a['shift']());}catch(_0x1cfe86){_0x27149a['push'](_0x27149a['shift']());}}}(a43_0x1d0e,0x8e14a));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';function a43_0xa499(_0x173992,_0x3d3aad){_0x173992=_0x173992-0x73;const _0x1d0ee0=a43_0x1d0e();let _0xa499f4=_0x1d0ee0[_0x173992];return _0xa499f4;}function a43_0x1d0e(){const _0xa71cd3=['9211347cbFEaW','Created\x20local\x20Skill\x20draft\x20','510huSWRD','42aKOYYR','99AFSgZD','175WmRGlF','files','1000050ysyFUe','read','map','path','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','rendered','name','skill','content','create','Refusing\x20to\x20overwrite\x20symlink:\x20','target','skillName','type','skillDir','str','validation','339656WyjMLS','Skill\x20directory\x20already\x20exists:\x20','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','isSymbolicLink','1101444HXxcrp','4KpcdAt','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','trim','bool','210245fxNydq','13EsiqLd','2485010beiYqF'];a43_0x1d0e=function(){return _0xa71cd3;};return a43_0x1d0e();}export const createCommand={'service':a43_0x116bb1(0x82),'command':a43_0x116bb1(0x84),'description':'创建本地自包含的运行态\x20Skill\x20草稿','risk':a43_0x116bb1(0x7c),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0xd7865){const _0x1adce8=a43_0x116bb1,_0xad0c9d=buildSkillCreatePlan(_0xd7865[_0x1adce8(0x8a)](_0x1adce8(0x81)),_0xd7865[_0x1adce8(0x8a)](_0x1adce8(0x88)),_0xd7865['str'](_0x1adce8(0x86)));return{'method':'WRITE','url':_0xad0c9d[_0x1adce8(0x89)],'body':{'skillName':_0xad0c9d[_0x1adce8(0x80)][_0x1adce8(0x87)],'type':_0xad0c9d[_0x1adce8(0x80)][_0x1adce8(0x88)],'selfContained':!![],'files':_0xad0c9d[_0x1adce8(0x80)]['files'][_0x1adce8(0x7d)](_0x1c54b3=>_0x1c54b3[_0x1adce8(0x7e)])},'description':_0x1adce8(0x92)};},async 'execute'(_0x1effbd){const _0x4a9e5d=a43_0x116bb1,_0x1e8861=buildSkillCreatePlan(_0x1effbd[_0x4a9e5d(0x8a)](_0x4a9e5d(0x81)),_0x1effbd[_0x4a9e5d(0x8a)](_0x4a9e5d(0x88)),_0x1effbd[_0x4a9e5d(0x8a)](_0x4a9e5d(0x86)));return writeSkillDraft(_0x1e8861,_0x1effbd[_0x4a9e5d(0x94)]('force')),{'ok':!![],'data':{'skillName':_0x1e8861[_0x4a9e5d(0x80)][_0x4a9e5d(0x87)],'type':_0x1e8861[_0x4a9e5d(0x80)][_0x4a9e5d(0x88)],'dir':_0x1e8861['skillDir'],'files':_0x1e8861[_0x4a9e5d(0x80)][_0x4a9e5d(0x7a)][_0x4a9e5d(0x7d)](_0xf82cf5=>_0xf82cf5['path'])},'message':_0x4a9e5d(0x75)+_0x1e8861[_0x4a9e5d(0x80)][_0x4a9e5d(0x87)]};}};function buildSkillCreatePlan(_0x28c57c,_0x21854,_0x106da7){const _0x5ce367=a43_0x116bb1,_0x204346=_0x21854[_0x5ce367(0x93)](),_0x1d8ca5=renderSkillTemplate({'skillName':_0x28c57c,'type':_0x204346});!_0x204346&&writeCliSideChannelLine(_0x5ce367(0x7f));const _0x4310e7=resolve(normalizeSkillTarget(_0x106da7));return{'rendered':_0x1d8ca5,'targetRoot':_0x4310e7,'skillDir':resolve(_0x4310e7,_0x1d8ca5['skillName'])};}function normalizeSkillTarget(_0x54fd99){const _0x599e33=a43_0x116bb1;return(_0x54fd99||DEFAULT_SKILL_TARGET)[_0x599e33(0x93)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x44b451,_0x45b9dc){const _0x1349fc=a43_0x116bb1;if(existsSync(_0x44b451[_0x1349fc(0x89)])){const _0xe898da=lstatSync(_0x44b451[_0x1349fc(0x89)]);if(!_0xe898da['isDirectory']()||_0xe898da[_0x1349fc(0x8f)]())throw CliErrors[_0x1349fc(0x8b)]('Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20'+_0x44b451[_0x1349fc(0x89)]);if(!_0x45b9dc)throw CliErrors[_0x1349fc(0x8b)](_0x1349fc(0x8d)+_0x44b451[_0x1349fc(0x89)],_0x1349fc(0x8e));}for(const _0x16ff74 of _0x44b451[_0x1349fc(0x80)][_0x1349fc(0x7a)]){const _0x4d10ea=resolve(_0x44b451[_0x1349fc(0x89)],_0x16ff74['path']),_0x543932=dirname(_0x4d10ea);mkdirSync(_0x543932,{'recursive':!![]});if(existsSync(_0x4d10ea)&&lstatSync(_0x4d10ea)['isSymbolicLink']())throw CliErrors[_0x1349fc(0x8b)](_0x1349fc(0x85)+_0x4d10ea);writeFileSync(_0x4d10ea,_0x16ff74[_0x1349fc(0x83)],'utf8');}}
@@ -1 +1 @@
1
- const a44_0x5e6a5d=a44_0x26f3;(function(_0x3e0b15,_0xf2a2ad){const _0x559c66=a44_0x26f3,_0x22d1d2=_0x3e0b15();while(!![]){try{const _0xc69ea6=parseInt(_0x559c66(0xe0))/0x1+parseInt(_0x559c66(0xed))/0x2*(-parseInt(_0x559c66(0xdd))/0x3)+-parseInt(_0x559c66(0xde))/0x4*(parseInt(_0x559c66(0xf8))/0x5)+-parseInt(_0x559c66(0xec))/0x6+-parseInt(_0x559c66(0xe2))/0x7*(parseInt(_0x559c66(0xdc))/0x8)+-parseInt(_0x559c66(0xe9))/0x9*(parseInt(_0x559c66(0xeb))/0xa)+-parseInt(_0x559c66(0xe3))/0xb*(-parseInt(_0x559c66(0xf7))/0xc);if(_0xc69ea6===_0xf2a2ad)break;else _0x22d1d2['push'](_0x22d1d2['shift']());}catch(_0x53504e){_0x22d1d2['push'](_0x22d1d2['shift']());}}}(a44_0x4c97,0x86fed));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';function a44_0x26f3(_0x4750d7,_0x20e341){_0x4750d7=_0x4750d7-0xd4;const _0x4c97f4=a44_0x4c97();let _0x26f35e=_0x4c97f4[_0x4750d7];return _0x26f35e;}import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';function a44_0x4c97(){const _0x5936b1=['52145ynCKkT','\x20is\x20unchanged.','test','source-fingerprint','version','isInteger','found','scope','Found\x20Skill\x20diagram\x20for\x20','Updated','trim','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','str','action','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','write','expectedDiagramRevision','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','unchanged','136icQWzP','3xNGMwR','300VfzQen','validation','783328GwPvyv','expected-diagram-revision','25340gwqlUG','19621503XQZzFy','skill','num','Skill\x20diagram\x20validation\x20passed\x20for\x20',';\x20first\x20write\x20expects\x20revision\x20','appCode','820044vWeXqj','diagram-validate','90DSFACS','6196410UvQFqs','2202878zUbvmb','personal','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','created','read',';\x20next\x20write\x20expects\x20revision\x20','diagram-show','skillCode','Skill\x20diagram\x20for\x20','diagram-file','24lEIOwc'];a44_0x4c97=function(){return _0x5936b1;};return a44_0x4c97();}import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x957736){const _0x394956=a44_0x26f3,_0x485ea1=_0x957736[_0x394956(0xd5)]('skill-code')[_0x394956(0x102)](),_0x9f7bf9=_0x957736['str'](_0x394956(0xfc))[_0x394956(0x102)](),_0x5888ef=_0x957736[_0x394956(0xd5)]('scope');if(!_0x485ea1||!_0x9f7bf9||_0x5888ef!==_0x394956(0xee)&&_0x5888ef!=='company')throw CliErrors[_0x394956(0xdf)](_0x394956(0xda));return{'skillCode':_0x485ea1,'version':_0x9f7bf9,'scope':_0x5888ef};}async function readDiagramWriteInput(_0x56c49a){const _0x2ee744=a44_0x26f3,_0x406eda=_0x56c49a[_0x2ee744(0xe5)](_0x2ee744(0xe1)),_0x37080b=_0x56c49a[_0x2ee744(0xd5)](_0x2ee744(0xfb))['trim']();if(!Number[_0x2ee744(0xfd)](_0x406eda)||_0x406eda<0x0)throw CliErrors[_0x2ee744(0xdf)](_0x2ee744(0xd7));if(!/^sha256:[0-9a-f]{64}$/[_0x2ee744(0xfa)](_0x37080b))throw CliErrors[_0x2ee744(0xdf)]('--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.');return{'expectedDiagramRevision':_0x406eda,'sourceFingerprint':_0x37080b,'diagram':await readRequiredSkillDiagram(_0x56c49a['str'](_0x2ee744(0xf6)))};}export const diagramValidateCommand={'service':'skill','command':a44_0x5e6a5d(0xea),'description':a44_0x5e6a5d(0xef),'risk':'read','flags':WRITE_FLAGS,async 'execute'(_0x118101){const _0x34c856=a44_0x5e6a5d,_0x9be483=readDiagramTarget(_0x118101),_0xde0657=await validateRuntimeSkillVersionDiagram(_0x118101[_0x34c856(0xe8)],_0x9be483[_0x34c856(0xf4)],_0x9be483['version'],_0x9be483[_0x34c856(0xff)],await readDiagramWriteInput(_0x118101));return{'ok':!![],'data':_0xde0657,'message':_0x34c856(0xe6)+_0x9be483[_0x34c856(0xf4)]+'@'+_0x9be483[_0x34c856(0xfc)]+'.'};}};export const diagramPushCommand={'service':a44_0x5e6a5d(0xe4),'command':'diagram-push','description':'为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','risk':a44_0x5e6a5d(0xd8),'confirmationDescription':'将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','flags':WRITE_FLAGS,async 'execute'(_0x2bb340){const _0x4dee29=a44_0x5e6a5d,_0x45da7e=readDiagramTarget(_0x2bb340),_0xba686d=await putRuntimeSkillVersionDiagram(_0x2bb340[_0x4dee29(0xe8)],_0x45da7e['skillCode'],_0x45da7e[_0x4dee29(0xfc)],_0x45da7e['scope'],await readDiagramWriteInput(_0x2bb340));return{'ok':!![],'data':_0xba686d,'message':_0xba686d[_0x4dee29(0xd6)]===_0x4dee29(0xdb)?_0x4dee29(0xf5)+_0x45da7e[_0x4dee29(0xf4)]+'@'+_0x45da7e[_0x4dee29(0xfc)]+_0x4dee29(0xf9):(_0xba686d[_0x4dee29(0xd6)]===_0x4dee29(0xf0)?'Created':_0x4dee29(0x101))+'\x20Skill\x20diagram\x20for\x20'+_0x45da7e['skillCode']+'@'+_0x45da7e[_0x4dee29(0xfc)]+'.'};}};export const diagramShowCommand={'service':'skill','command':a44_0x5e6a5d(0xf3),'description':'Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','risk':a44_0x5e6a5d(0xf1),'flags':TARGET_FLAGS,async 'execute'(_0x53709d){const _0x1b8747=a44_0x5e6a5d,_0x392562=readDiagramTarget(_0x53709d),_0x1c5b1c=await getRuntimeSkillVersionDiagram(_0x53709d[_0x1b8747(0xe8)],_0x392562['skillCode'],_0x392562[_0x1b8747(0xfc)],_0x392562[_0x1b8747(0xff)]);return{'ok':!![],'data':_0x1c5b1c,'message':_0x1c5b1c[_0x1b8747(0xfe)]?_0x1b8747(0x100)+_0x392562[_0x1b8747(0xf4)]+'@'+_0x392562[_0x1b8747(0xfc)]+_0x1b8747(0xf2)+_0x1c5b1c[_0x1b8747(0xd9)]+'.':_0x1b8747(0xd4)+_0x392562[_0x1b8747(0xf4)]+'@'+_0x392562[_0x1b8747(0xfc)]+_0x1b8747(0xe7)+_0x1c5b1c[_0x1b8747(0xd9)]+'.'};}};
1
+ const a44_0x3bdfbd=a44_0x566d;(function(_0x1a769e,_0x1d1964){const _0x3666b7=a44_0x566d,_0x45205c=_0x1a769e();while(!![]){try{const _0x449460=-parseInt(_0x3666b7(0x1b7))/0x1+-parseInt(_0x3666b7(0x1b9))/0x2*(parseInt(_0x3666b7(0x1c0))/0x3)+-parseInt(_0x3666b7(0x1ca))/0x4+-parseInt(_0x3666b7(0x1c9))/0x5*(parseInt(_0x3666b7(0x1dc))/0x6)+-parseInt(_0x3666b7(0x1b3))/0x7*(-parseInt(_0x3666b7(0x1db))/0x8)+parseInt(_0x3666b7(0x1c8))/0x9+parseInt(_0x3666b7(0x1b2))/0xa;if(_0x449460===_0x1d1964)break;else _0x45205c['push'](_0x45205c['shift']());}catch(_0x42a1cc){_0x45205c['push'](_0x45205c['shift']());}}}(a44_0x118f,0x1c5c8));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x2fb83f){const _0x532d22=a44_0x566d,_0x5db867=_0x2fb83f[_0x532d22(0x1d2)](_0x532d22(0x1d6))[_0x532d22(0x1c2)](),_0x138499=_0x2fb83f[_0x532d22(0x1d2)](_0x532d22(0x1cf))[_0x532d22(0x1c2)](),_0x1cf01c=_0x2fb83f[_0x532d22(0x1d2)]('scope');if(!_0x5db867||!_0x138499||_0x1cf01c!==_0x532d22(0x1dd)&&_0x1cf01c!==_0x532d22(0x1be))throw CliErrors[_0x532d22(0x1ba)](_0x532d22(0x1cd));return{'skillCode':_0x5db867,'version':_0x138499,'scope':_0x1cf01c};}async function readDiagramWriteInput(_0x1ff4d8){const _0x4b9093=a44_0x566d,_0x16bcb8=_0x1ff4d8['num'](_0x4b9093(0x1b8)),_0x3a4bb6=_0x1ff4d8[_0x4b9093(0x1d2)](_0x4b9093(0x1c6))[_0x4b9093(0x1c2)]();if(!Number['isInteger'](_0x16bcb8)||_0x16bcb8<0x0)throw CliErrors[_0x4b9093(0x1ba)](_0x4b9093(0x1d0));if(!/^sha256:[0-9a-f]{64}$/['test'](_0x3a4bb6))throw CliErrors[_0x4b9093(0x1ba)](_0x4b9093(0x1d4));return{'expectedDiagramRevision':_0x16bcb8,'sourceFingerprint':_0x3a4bb6,'diagram':await readRequiredSkillDiagram(_0x1ff4d8[_0x4b9093(0x1d2)](_0x4b9093(0x1d7)))};}function a44_0x118f(){const _0x10b4b4=['Skill\x20diagram\x20for\x20','Updated','5817570iVllpF','644suVyWA','为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','diagram-validate','appCode','217199XlugCI','expected-diagram-revision','2odGxcV','validation','\x20is\x20unchanged.','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20',';\x20next\x20write\x20expects\x20revision\x20','company','created','517623vkonfD','scope','trim','unchanged','diagram-push','skill','source-fingerprint','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','437130mgiSps','100335IrSMmf','673448YPUeii','将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','\x20Skill\x20diagram\x20for\x20','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','skillCode','version','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','found','str','Created','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','skill-code','diagram-file',';\x20first\x20write\x20expects\x20revision\x20','diagram-show','read','9056TYnYKN','18IHCgIm','personal'];a44_0x118f=function(){return _0x10b4b4;};return a44_0x118f();}export const diagramValidateCommand={'service':a44_0x3bdfbd(0x1c5),'command':a44_0x3bdfbd(0x1b5),'description':a44_0x3bdfbd(0x1d5),'risk':'read','flags':WRITE_FLAGS,async 'execute'(_0x5e5a35){const _0x3782f2=a44_0x3bdfbd,_0x4e48be=readDiagramTarget(_0x5e5a35),_0x316cc0=await validateRuntimeSkillVersionDiagram(_0x5e5a35[_0x3782f2(0x1b6)],_0x4e48be[_0x3782f2(0x1ce)],_0x4e48be[_0x3782f2(0x1cf)],_0x4e48be[_0x3782f2(0x1c1)],await readDiagramWriteInput(_0x5e5a35));return{'ok':!![],'data':_0x316cc0,'message':'Skill\x20diagram\x20validation\x20passed\x20for\x20'+_0x4e48be['skillCode']+'@'+_0x4e48be[_0x3782f2(0x1cf)]+'.'};}};export const diagramPushCommand={'service':a44_0x3bdfbd(0x1c5),'command':a44_0x3bdfbd(0x1c4),'description':a44_0x3bdfbd(0x1b4),'risk':'write','confirmationDescription':a44_0x3bdfbd(0x1cb),'flags':WRITE_FLAGS,async 'execute'(_0x210cdf){const _0x3895d9=a44_0x3bdfbd,_0x57e760=readDiagramTarget(_0x210cdf),_0x557ae9=await putRuntimeSkillVersionDiagram(_0x210cdf[_0x3895d9(0x1b6)],_0x57e760[_0x3895d9(0x1ce)],_0x57e760[_0x3895d9(0x1cf)],_0x57e760[_0x3895d9(0x1c1)],await readDiagramWriteInput(_0x210cdf));return{'ok':!![],'data':_0x557ae9,'message':_0x557ae9['action']===_0x3895d9(0x1c3)?_0x3895d9(0x1b0)+_0x57e760[_0x3895d9(0x1ce)]+'@'+_0x57e760['version']+_0x3895d9(0x1bb):(_0x557ae9['action']===_0x3895d9(0x1bf)?_0x3895d9(0x1d3):_0x3895d9(0x1b1))+_0x3895d9(0x1cc)+_0x57e760[_0x3895d9(0x1ce)]+'@'+_0x57e760['version']+'.'};}};function a44_0x566d(_0xba8993,_0x305424){_0xba8993=_0xba8993-0x1b0;const _0x118f63=a44_0x118f();let _0x566d80=_0x118f63[_0xba8993];return _0x566d80;}export const diagramShowCommand={'service':a44_0x3bdfbd(0x1c5),'command':a44_0x3bdfbd(0x1d9),'description':a44_0x3bdfbd(0x1c7),'risk':a44_0x3bdfbd(0x1da),'flags':TARGET_FLAGS,async 'execute'(_0x42e637){const _0x5f05fb=a44_0x3bdfbd,_0xb92749=readDiagramTarget(_0x42e637),_0x5e3ffd=await getRuntimeSkillVersionDiagram(_0x42e637[_0x5f05fb(0x1b6)],_0xb92749[_0x5f05fb(0x1ce)],_0xb92749[_0x5f05fb(0x1cf)],_0xb92749[_0x5f05fb(0x1c1)]);return{'ok':!![],'data':_0x5e3ffd,'message':_0x5e3ffd[_0x5f05fb(0x1d1)]?'Found\x20Skill\x20diagram\x20for\x20'+_0xb92749['skillCode']+'@'+_0xb92749[_0x5f05fb(0x1cf)]+_0x5f05fb(0x1bd)+_0x5e3ffd['expectedDiagramRevision']+'.':_0x5f05fb(0x1bc)+_0xb92749[_0x5f05fb(0x1ce)]+'@'+_0xb92749['version']+_0x5f05fb(0x1d8)+_0x5e3ffd['expectedDiagramRevision']+'.'};}};
@@ -1 +1 @@
1
- const a45_0x4575a3=a45_0x4b9a;function a45_0x4b9a(_0x512804,_0x428401){_0x512804=_0x512804-0xc6;const _0xe4177b=a45_0xe417();let _0x4b9a2f=_0xe4177b[_0x512804];return _0x4b9a2f;}function a45_0xe417(){const _0x7110ec=['68958imkETY','length','version','trim','6TixFXJ','135620ZbHgvx','authRequired','../../../skills/runtime-skill-sync.js','reduce','flatMap','all','project','code','created','company','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','updated','6wIDSsT','removed','install','personal','scope','16XwfBhv','read','push','771399kGckKa','force','3097180SmftKn','production','skipped','str','filter','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','global','action','1827397phQAKa','includes','map','skillCode','1023176DwmroW','70zSNart','envName','80139gCWPvL','\x20company\x20Skill(s).','appCode','accessKey'];a45_0xe417=function(){return _0x7110ec;};return a45_0xe417();}(function(_0x1c1f70,_0x1af9d3){const _0x438e81=a45_0x4b9a,_0x4e7b40=_0x1c1f70();while(!![]){try{const _0x111bf7=parseInt(_0x438e81(0xec))/0x1+parseInt(_0x438e81(0xd3))/0x2*(-parseInt(_0x438e81(0xf0))/0x3)+-parseInt(_0x438e81(0xdd))/0x4+parseInt(_0x438e81(0xc7))/0x5*(-parseInt(_0x438e81(0xc6))/0x6)+-parseInt(_0x438e81(0xe9))/0x7+-parseInt(_0x438e81(0xd8))/0x8*(-parseInt(_0x438e81(0xdb))/0x9)+-parseInt(_0x438e81(0xea))/0xa*(-parseInt(_0x438e81(0xe5))/0xb);if(_0x111bf7===_0x1af9d3)break;else _0x4e7b40['push'](_0x4e7b40['shift']());}catch(_0x59d9cf){_0x4e7b40['push'](_0x4e7b40['shift']());}}}(a45_0xe417,0x61251));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':'skill','command':a45_0x4575a3(0xd5),'description':a45_0x4575a3(0xd1),'risk':a45_0x4575a3(0xd9),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x7487f9){return syncRuntimeSkills(_0x7487f9);}};async function syncRuntimeSkills(_0x1c7e63){const _0x3de14f=a45_0x4575a3,{downloadRuntimeSkillPackage:_0x5c7a46,listRuntimeSkills:_0x5c8a3c}=await import('../../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x1508a5,materializeRuntimeSkill:_0x3b03b5,pruneStaleRuntimeSkillCache:_0x4b16a1,pruneStaleRuntimeSkillLinks:_0xaa7c03,resolveRuntimeSkillInstallTarget:_0x48441}=await import(_0x3de14f(0xc9)),_0x2a518b=_0x1c7e63[_0x3de14f(0xe0)](_0x3de14f(0xce)),_0x4611f0=normalizeSyncScopes(_0x1c7e63[_0x3de14f(0xe0)](_0x3de14f(0xd7))),_0x46b938=_0x1c7e63[_0x3de14f(0xeb)]??_0x3de14f(0xde),_0x5d282f=_0x1c7e63[_0x3de14f(0xef)],_0x264885=_0x1c7e63['bool'](_0x3de14f(0xdc));if(!_0x5d282f)throw CliErrors[_0x3de14f(0xc8)](_0x3de14f(0xe2));const _0x1d2ae9=_0x48441(_0x1c7e63['appCode'],_0x1c7e63['bool'](_0x3de14f(0xcd))?'project':_0x3de14f(0xe3)),_0x60ccb1=_0x48441(_0x1c7e63[_0x3de14f(0xee)],_0x1d2ae9[_0x3de14f(0xd7)]==='project'?_0x3de14f(0xe3):'project'),_0x2095b0=await Promise[_0x3de14f(0xcc)](_0x4611f0[_0x3de14f(0xe7)](_0x166ecf=>_0x5c8a3c({'appCode':_0x1c7e63[_0x3de14f(0xee)],'scope':_0x166ecf,'code':_0x2a518b[_0x3de14f(0xf3)]()||undefined}))),_0x229670=_0x4611f0[_0x3de14f(0xe6)](_0x3de14f(0xd6))?_0x2095b0[_0x3de14f(0xcb)]((_0xb196c8,_0x5b88d8)=>_0x4611f0[_0x5b88d8]===_0x3de14f(0xd6)?_0xb196c8[_0x3de14f(0xd6)]:[]):[],_0x456f89=_0x4611f0[_0x3de14f(0xe6)](_0x3de14f(0xd0))?_0x2095b0[_0x3de14f(0xcb)]((_0x24291b,_0x4fbdd5)=>_0x4611f0[_0x4fbdd5]===_0x3de14f(0xd0)?_0x24291b[_0x3de14f(0xd0)]:[]):[],_0x5f5414=new Set([..._0x229670[_0x3de14f(0xe7)](_0x540aaa=>_0x540aaa['skillCode']?.[_0x3de14f(0xf3)]())[_0x3de14f(0xe1)](_0x50b26b=>Boolean(_0x50b26b)),..._0x456f89[_0x3de14f(0xe7)](_0x3324ee=>_0x3324ee[_0x3de14f(0xe8)]?.[_0x3de14f(0xf3)]())[_0x3de14f(0xe1)](_0x3ae501=>Boolean(_0x3ae501))]),_0x50bdc2=_0x2a518b[_0x3de14f(0xf3)]()?[_0x2a518b['trim']()]:undefined,_0x4830c6=_0x4611f0[_0x3de14f(0xf1)]===0x2&&_0x4611f0[_0x3de14f(0xe6)](_0x3de14f(0xd6))&&_0x4611f0[_0x3de14f(0xe6)](_0x3de14f(0xd0)),_0x4098c6=_0x4830c6?_0xaa7c03(_0x1d2ae9,_0x5f5414,_0x50bdc2):[],_0x5eab2b=_0x4b16a1({'env':_0x46b938,'accessKey':_0x5d282f,'appCode':_0x1c7e63['appCode'],'activeSkillCodes':_0x5f5414,'pruneSkillCodes':_0x50bdc2,'scopes':_0x4611f0,'protectedLinkRoots':_0x60ccb1['skillRoots']}),_0x3af06a=[];for(const _0x20b30a of _0x229670){_0x3af06a[_0x3de14f(0xda)](_0x3b03b5(_0x20b30a,_0x3de14f(0xd6),{'env':_0x46b938,'accessKey':_0x5d282f,'appCode':_0x1c7e63[_0x3de14f(0xee)],'force':_0x264885,'packageBytes':await downloadSkillPackage(_0x20b30a,_0x3de14f(0xd6),_0x1c7e63[_0x3de14f(0xee)],_0x5c7a46)}));}for(const _0x267752 of _0x456f89){_0x3af06a[_0x3de14f(0xda)](_0x3b03b5(_0x267752,_0x3de14f(0xd0),{'env':_0x46b938,'accessKey':_0x5d282f,'appCode':_0x1c7e63[_0x3de14f(0xee)],'force':_0x264885,'packageBytes':await downloadSkillPackage(_0x267752,_0x3de14f(0xd0),_0x1c7e63[_0x3de14f(0xee)],_0x5c7a46)}));}const _0x346f54=_0x1508a5(_0x3af06a,_0x1d2ae9),_0x7d941c=countLinkActions(_0x346f54);return{'ok':!![],'data':{'appCode':_0x1c7e63[_0x3de14f(0xee)],..._0x1d2ae9[_0x3de14f(0xd7)]===_0x3de14f(0xcd)?{'installTarget':{'scope':_0x1d2ae9[_0x3de14f(0xd7)],'skillRoots':[..._0x1d2ae9['skillRoots']]}}:{},'personal':_0x229670[_0x3de14f(0xf1)],'company':_0x456f89['length'],'materialized':_0x3af06a[_0x3de14f(0xf1)],'links':{'total':_0x346f54[_0x3de14f(0xf1)],'created':_0x7d941c[_0x3de14f(0xcf)]??0x0,'updated':_0x7d941c[_0x3de14f(0xd2)]??0x0,'unchanged':_0x7d941c['unchanged']??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x4098c6[_0x3de14f(0xe1)](_0x231f44=>_0x231f44['action']===_0x3de14f(0xd4))[_0x3de14f(0xf1)],'cacheDirs':_0x5eab2b['filter'](_0x3609ce=>_0x3609ce[_0x3de14f(0xe4)]==='removed')[_0x3de14f(0xf1)],'skipped':[..._0x4098c6,..._0x5eab2b][_0x3de14f(0xe1)](_0x1de408=>_0x1de408['action']===_0x3de14f(0xdf))[_0x3de14f(0xf1)]},'skills':{'personal':_0x229670[_0x3de14f(0xe7)](summarizeRuntimeSkill),'company':_0x456f89['map'](summarizeRuntimeSkill)}},'message':'Installed\x20'+_0x229670['length']+'\x20personal\x20and\x20'+_0x456f89[_0x3de14f(0xf1)]+_0x3de14f(0xed)};}async function downloadSkillPackage(_0x5ed52e,_0x31e49b,_0x456784,_0x1c73e9){const _0x13a400=a45_0x4575a3,_0x343282=_0x5ed52e[_0x13a400(0xf2)]?.[_0x13a400(0xf3)]();return _0x343282?_0x1c73e9(_0x31e49b,_0x5ed52e['skillCode'],_0x456784,_0x343282):_0x1c73e9(_0x31e49b,_0x5ed52e[_0x13a400(0xe8)],_0x456784);}function countLinkActions(_0x240a34){const _0x3b26b5=a45_0x4575a3;return _0x240a34[_0x3b26b5(0xca)]((_0x10dd21,_0x2b6a3f)=>{const _0x5d45af=_0x3b26b5;return _0x10dd21[_0x2b6a3f[_0x5d45af(0xe4)]]=(_0x10dd21[_0x2b6a3f[_0x5d45af(0xe4)]]??0x0)+0x1,_0x10dd21;},{});}
1
+ const a45_0x4d8df2=a45_0x2e84;(function(_0x4d9eef,_0x100299){const _0x531ecf=a45_0x2e84,_0x35e9f6=_0x4d9eef();while(!![]){try{const _0x21d52a=parseInt(_0x531ecf(0x105))/0x1*(parseInt(_0x531ecf(0x10c))/0x2)+-parseInt(_0x531ecf(0xed))/0x3+-parseInt(_0x531ecf(0x103))/0x4*(parseInt(_0x531ecf(0x10f))/0x5)+-parseInt(_0x531ecf(0xfc))/0x6+-parseInt(_0x531ecf(0xfa))/0x7+parseInt(_0x531ecf(0x101))/0x8*(parseInt(_0x531ecf(0xf9))/0x9)+parseInt(_0x531ecf(0xee))/0xa;if(_0x21d52a===_0x100299)break;else _0x35e9f6['push'](_0x35e9f6['shift']());}catch(_0x3dfb56){_0x35e9f6['push'](_0x35e9f6['shift']());}}}(a45_0x2f5c,0x19aed));import{CliErrors}from'../../../errors.js';function a45_0x2e84(_0x503f95,_0x33346b){_0x503f95=_0x503f95-0xe9;const _0x2f5c40=a45_0x2f5c();let _0x2e842e=_0x2f5c40[_0x503f95];return _0x2e842e;}import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':a45_0x4d8df2(0x10b),'command':a45_0x4d8df2(0xfb),'description':a45_0x4d8df2(0x107),'risk':a45_0x4d8df2(0x102),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x2d74f5){return syncRuntimeSkills(_0x2d74f5);}};async function syncRuntimeSkills(_0x33bb92){const _0x2caf01=a45_0x4d8df2,{downloadRuntimeSkillPackage:_0x40c6d5,listRuntimeSkills:_0x64699b}=await import('../../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x2666e0,materializeRuntimeSkill:_0x931557,pruneStaleRuntimeSkillCache:_0x3f9d0c,pruneStaleRuntimeSkillLinks:_0x559c55,resolveRuntimeSkillInstallTarget:_0x1af8eb}=await import(_0x2caf01(0xf5)),_0x22a02c=_0x33bb92[_0x2caf01(0xea)]('code'),_0x40359b=normalizeSyncScopes(_0x33bb92[_0x2caf01(0xea)](_0x2caf01(0xf7))),_0x5de488=_0x33bb92[_0x2caf01(0xf4)]??_0x2caf01(0x108),_0x51ef08=_0x33bb92[_0x2caf01(0xf6)],_0x14fecf=_0x33bb92[_0x2caf01(0xf1)]('force');if(!_0x51ef08)throw CliErrors[_0x2caf01(0xf8)]('Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.');const _0x3aea6b=_0x1af8eb(_0x33bb92[_0x2caf01(0xfd)],_0x33bb92[_0x2caf01(0xf1)](_0x2caf01(0x111))?_0x2caf01(0x111):_0x2caf01(0xfe)),_0x1cf2c2=_0x1af8eb(_0x33bb92[_0x2caf01(0xfd)],_0x3aea6b[_0x2caf01(0xf7)]===_0x2caf01(0x111)?_0x2caf01(0xfe):_0x2caf01(0x111)),_0x14e7fb=await Promise[_0x2caf01(0xf2)](_0x40359b['map'](_0xef2259=>_0x64699b({'appCode':_0x33bb92[_0x2caf01(0xfd)],'scope':_0xef2259,'code':_0x22a02c[_0x2caf01(0xeb)]()||undefined}))),_0x32d966=_0x40359b[_0x2caf01(0xe9)](_0x2caf01(0xec))?_0x14e7fb[_0x2caf01(0xf0)]((_0x4cb7e6,_0x2e41a1)=>_0x40359b[_0x2e41a1]===_0x2caf01(0xec)?_0x4cb7e6[_0x2caf01(0xec)]:[]):[],_0x5553b9=_0x40359b['includes']('company')?_0x14e7fb['flatMap']((_0x3097ae,_0x4c8e5a)=>_0x40359b[_0x4c8e5a]===_0x2caf01(0x100)?_0x3097ae[_0x2caf01(0x100)]:[]):[],_0x166194=new Set([..._0x32d966['map'](_0x216911=>_0x216911[_0x2caf01(0x106)]?.[_0x2caf01(0xeb)]())[_0x2caf01(0x10d)](_0xe88dcc=>Boolean(_0xe88dcc)),..._0x5553b9[_0x2caf01(0x104)](_0x37fe9d=>_0x37fe9d[_0x2caf01(0x106)]?.[_0x2caf01(0xeb)]())[_0x2caf01(0x10d)](_0x4e7c41=>Boolean(_0x4e7c41))]),_0x10bb1e=_0x22a02c[_0x2caf01(0xeb)]()?[_0x22a02c[_0x2caf01(0xeb)]()]:undefined,_0x40e393=_0x40359b[_0x2caf01(0x109)]===0x2&&_0x40359b[_0x2caf01(0xe9)](_0x2caf01(0xec))&&_0x40359b['includes']('company'),_0x23a317=_0x40e393?_0x559c55(_0x3aea6b,_0x166194,_0x10bb1e):[],_0x305944=_0x3f9d0c({'env':_0x5de488,'accessKey':_0x51ef08,'appCode':_0x33bb92['appCode'],'activeSkillCodes':_0x166194,'pruneSkillCodes':_0x10bb1e,'scopes':_0x40359b,'protectedLinkRoots':_0x1cf2c2[_0x2caf01(0x10e)]}),_0x330453=[];for(const _0x52f0f0 of _0x32d966){_0x330453['push'](_0x931557(_0x52f0f0,_0x2caf01(0xec),{'env':_0x5de488,'accessKey':_0x51ef08,'appCode':_0x33bb92[_0x2caf01(0xfd)],'force':_0x14fecf,'packageBytes':await downloadSkillPackage(_0x52f0f0,_0x2caf01(0xec),_0x33bb92[_0x2caf01(0xfd)],_0x40c6d5)}));}for(const _0x2815ba of _0x5553b9){_0x330453['push'](_0x931557(_0x2815ba,'company',{'env':_0x5de488,'accessKey':_0x51ef08,'appCode':_0x33bb92['appCode'],'force':_0x14fecf,'packageBytes':await downloadSkillPackage(_0x2815ba,_0x2caf01(0x100),_0x33bb92['appCode'],_0x40c6d5)}));}const _0x29839d=_0x2666e0(_0x330453,_0x3aea6b),_0x4469c9=countLinkActions(_0x29839d);return{'ok':!![],'data':{'appCode':_0x33bb92['appCode'],..._0x3aea6b[_0x2caf01(0xf7)]===_0x2caf01(0x111)?{'installTarget':{'scope':_0x3aea6b['scope'],'skillRoots':[..._0x3aea6b[_0x2caf01(0x10e)]]}}:{},'personal':_0x32d966[_0x2caf01(0x109)],'company':_0x5553b9[_0x2caf01(0x109)],'materialized':_0x330453[_0x2caf01(0x109)],'links':{'total':_0x29839d[_0x2caf01(0x109)],'created':_0x4469c9['created']??0x0,'updated':_0x4469c9['updated']??0x0,'unchanged':_0x4469c9[_0x2caf01(0x112)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x23a317[_0x2caf01(0x10d)](_0x246584=>_0x246584['action']===_0x2caf01(0x110))[_0x2caf01(0x109)],'cacheDirs':_0x305944[_0x2caf01(0x10d)](_0x4e1f92=>_0x4e1f92[_0x2caf01(0x10a)]===_0x2caf01(0x110))[_0x2caf01(0x109)],'skipped':[..._0x23a317,..._0x305944]['filter'](_0x2af2e3=>_0x2af2e3['action']==='skipped')[_0x2caf01(0x109)]},'skills':{'personal':_0x32d966[_0x2caf01(0x104)](summarizeRuntimeSkill),'company':_0x5553b9['map'](summarizeRuntimeSkill)}},'message':_0x2caf01(0xff)+_0x32d966[_0x2caf01(0x109)]+'\x20personal\x20and\x20'+_0x5553b9[_0x2caf01(0x109)]+'\x20company\x20Skill(s).'};}async function downloadSkillPackage(_0x2e28b3,_0x13f699,_0x521536,_0x30fb3d){const _0x2a6c9d=a45_0x4d8df2,_0x4c60ea=_0x2e28b3[_0x2a6c9d(0xf3)]?.[_0x2a6c9d(0xeb)]();return _0x4c60ea?_0x30fb3d(_0x13f699,_0x2e28b3[_0x2a6c9d(0x106)],_0x521536,_0x4c60ea):_0x30fb3d(_0x13f699,_0x2e28b3[_0x2a6c9d(0x106)],_0x521536);}function a45_0x2f5c(){const _0x3cb61a=['install','1177428OaGjYg','appCode','global','Installed\x20','company','896816YWTAXl','read','330464lHHbLo','map','4UmPqOb','skillCode','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','production','length','action','skill','47002AQqOPo','filter','skillRoots','10LRKrMn','removed','project','unchanged','includes','str','trim','personal','156930eoutjy','3173200qcFUFq','reduce','flatMap','bool','all','version','envName','../../../skills/runtime-skill-sync.js','accessKey','scope','authRequired','9qklGcf','31143tqdrVN'];a45_0x2f5c=function(){return _0x3cb61a;};return a45_0x2f5c();}function countLinkActions(_0x30dec7){const _0x20d624=a45_0x4d8df2;return _0x30dec7[_0x20d624(0xef)]((_0x4ab079,_0x4e4a55)=>{const _0x24ab57=_0x20d624;return _0x4ab079[_0x4e4a55[_0x24ab57(0x10a)]]=(_0x4ab079[_0x4e4a55[_0x24ab57(0x10a)]]??0x0)+0x1,_0x4ab079;},{});}
@@ -1 +1 @@
1
- const a46_0xc51b8=a46_0x5bfd;function a46_0x1ede(){const _0xd2a57c=['authRequired','skill','Listed\x20','\x20local\x20Skill(s).','../../../core/api-client.js','597605PjQUCR','567730uhOShN','envName','accessKey','81BiAoGn','270338IinoOD','company','bool','length','scope','filter','project','str','\x20remote\x20Skill(s).','30jARpdh','359093KWsBty','trim','remote','../../../skills/runtime-skill-sync.js','production','136tRPbvr','973863ervLYT','446552bNsafH','map','local','1592316VEjqRf','appCode','personal','4NisLdF'];a46_0x1ede=function(){return _0xd2a57c;};return a46_0x1ede();}(function(_0x316066,_0x503b81){const _0x43643a=a46_0x5bfd,_0x3c4fa5=_0x316066();while(!![]){try{const _0x231474=parseInt(_0x43643a(0xc8))/0x1+-parseInt(_0x43643a(0xd9))/0x2+parseInt(_0x43643a(0xd8))/0x3*(parseInt(_0x43643a(0xdf))/0x4)+parseInt(_0x43643a(0xc3))/0x5*(parseInt(_0x43643a(0xd1))/0x6)+-parseInt(_0x43643a(0xd2))/0x7*(parseInt(_0x43643a(0xd7))/0x8)+parseInt(_0x43643a(0xc7))/0x9*(parseInt(_0x43643a(0xc4))/0xa)+-parseInt(_0x43643a(0xdc))/0xb;if(_0x231474===_0x503b81)break;else _0x3c4fa5['push'](_0x3c4fa5['shift']());}catch(_0x41ad25){_0x3c4fa5['push'](_0x3c4fa5['shift']());}}}(a46_0x1ede,0x7122e));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a46_0xc51b8(0xbf),'command':'list','description':'List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','risk':'read','flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x10730d){const _0x92e46b=a46_0xc51b8,_0x24f07c=_0x10730d[_0x92e46b(0xcf)]('code'),_0x5bdf56=normalizeListScope(_0x10730d[_0x92e46b(0xcf)]('scope'));if(_0x10730d['bool'](_0x92e46b(0xdb))){const _0x1737a4=_0x10730d[_0x92e46b(0xc6)];if(!_0x1737a4)throw CliErrors[_0x92e46b(0xe0)]();const {listLocalRuntimeSkills:_0x243fe5,resolveRuntimeSkillInstallTarget:_0x251524}=await import(_0x92e46b(0xd5)),_0x5e3830=_0x251524(_0x10730d[_0x92e46b(0xdd)],_0x10730d[_0x92e46b(0xca)](_0x92e46b(0xce))?_0x92e46b(0xce):'global'),_0x627bb=_0x243fe5({'env':_0x10730d[_0x92e46b(0xc5)]??_0x92e46b(0xd6),'accessKey':_0x1737a4,'appCode':_0x10730d[_0x92e46b(0xdd)],'scopes':listScopeToRuntimeScopes(_0x5bdf56),'code':_0x24f07c[_0x92e46b(0xd3)]()||undefined},_0x5e3830),_0x5bef23=groupLocalRuntimeSkills(_0x627bb);return{'ok':!![],'data':{'appCode':_0x10730d[_0x92e46b(0xdd)],'source':_0x92e46b(0xdb),..._0x5e3830[_0x92e46b(0xcc)]===_0x92e46b(0xce)?{'installScope':_0x5e3830['scope']}:{},'scope':_0x5bdf56,'total':_0x627bb[_0x92e46b(0xcb)],'personal':_0x5bef23[_0x92e46b(0xde)][_0x92e46b(0xcb)],'company':_0x5bef23['company'][_0x92e46b(0xcb)],'items':_0x627bb[_0x92e46b(0xda)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x5bef23[_0x92e46b(0xde)]['map'](summarizeLocalRuntimeSkill),'company':_0x5bef23[_0x92e46b(0xc9)][_0x92e46b(0xda)](summarizeLocalRuntimeSkill)}},'message':'Listed\x20'+_0x627bb[_0x92e46b(0xcb)]+_0x92e46b(0xc1)};}const {listRuntimeSkills:_0xa19af4}=await import(_0x92e46b(0xc2)),_0x4137cf=await _0xa19af4({'appCode':_0x10730d['appCode'],'scope':listScopeToRemoteScope(_0x5bdf56),'code':_0x24f07c[_0x92e46b(0xd3)]()||undefined}),_0x2004bb=shouldListScope(_0x5bdf56,_0x92e46b(0xde))?_0x4137cf[_0x92e46b(0xde)]??[]:[],_0x28f454=shouldListScope(_0x5bdf56,_0x92e46b(0xc9))?_0x4137cf['company']??[]:[],_0x18bceb=[..._0x2004bb,..._0x28f454];return{'ok':!![],'data':{'appCode':_0x10730d[_0x92e46b(0xdd)],'source':_0x92e46b(0xd4),'scope':_0x5bdf56,'total':_0x18bceb[_0x92e46b(0xcb)],'personal':_0x2004bb[_0x92e46b(0xcb)],'company':_0x28f454[_0x92e46b(0xcb)],'items':_0x18bceb[_0x92e46b(0xda)](summarizeRuntimeSkill),'skills':{'personal':_0x2004bb[_0x92e46b(0xda)](summarizeRuntimeSkill),'company':_0x28f454[_0x92e46b(0xda)](summarizeRuntimeSkill)}},'message':_0x92e46b(0xc0)+_0x18bceb[_0x92e46b(0xcb)]+_0x92e46b(0xd0)};}};function a46_0x5bfd(_0x529c4d,_0x3352ed){_0x529c4d=_0x529c4d-0xbf;const _0x1edee2=a46_0x1ede();let _0x5bfdac=_0x1edee2[_0x529c4d];return _0x5bfdac;}function groupLocalRuntimeSkills(_0x30242c){const _0xbd6617=a46_0xc51b8;return{'personal':_0x30242c[_0xbd6617(0xcd)](_0x273be5=>_0x273be5[_0xbd6617(0xcc)]===_0xbd6617(0xde)),'company':_0x30242c['filter'](_0x12bcb0=>_0x12bcb0[_0xbd6617(0xcc)]===_0xbd6617(0xc9)),'builtin':_0x30242c['filter'](_0x13461d=>_0x13461d[_0xbd6617(0xcc)]==='builtin')};}
1
+ const a46_0x27fefd=a46_0x287f;(function(_0x1308a2,_0x38b79b){const _0x237810=a46_0x287f,_0x422df2=_0x1308a2();while(!![]){try{const _0xa5e69f=-parseInt(_0x237810(0xe8))/0x1*(parseInt(_0x237810(0xce))/0x2)+-parseInt(_0x237810(0xea))/0x3*(-parseInt(_0x237810(0xef))/0x4)+-parseInt(_0x237810(0xe6))/0x5*(-parseInt(_0x237810(0xd6))/0x6)+parseInt(_0x237810(0xcf))/0x7+-parseInt(_0x237810(0xeb))/0x8+parseInt(_0x237810(0xdb))/0x9*(parseInt(_0x237810(0xcd))/0xa)+-parseInt(_0x237810(0xd9))/0xb;if(_0xa5e69f===_0x38b79b)break;else _0x422df2['push'](_0x422df2['shift']());}catch(_0x249cc4){_0x422df2['push'](_0x422df2['shift']());}}}(a46_0x293d,0xa4a4a));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';function a46_0x293d(){const _0x360a9c=['length','8uExegC','list','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','157850PYxMVB','138cxnlRS','1576750pdIQVU','appCode','local','authRequired','accessKey','../../../skills/runtime-skill-sync.js','personal','42isOHwu','project','production','17428752nrffMp','str','639HHcSUP','code','\x20local\x20Skill(s).','company','filter','bool','scope','../../../core/api-client.js','envName','remote','trim','772895IRpWul','map','739YZHjwK','builtin','1747194eAHwMD','10264264WyKbdd','Listed\x20','global'];a46_0x293d=function(){return _0x360a9c;};return a46_0x293d();}import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':'skill','command':a46_0x27fefd(0xf0),'description':a46_0x27fefd(0xcc),'risk':'read','flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x25285b){const _0x5973ae=a46_0x27fefd,_0x134ccb=_0x25285b['str'](_0x5973ae(0xdc)),_0x2a3a2d=normalizeListScope(_0x25285b[_0x5973ae(0xda)](_0x5973ae(0xe1)));if(_0x25285b[_0x5973ae(0xe0)]('local')){const _0x217c70=_0x25285b[_0x5973ae(0xd3)];if(!_0x217c70)throw CliErrors[_0x5973ae(0xd2)]();const {listLocalRuntimeSkills:_0x56accc,resolveRuntimeSkillInstallTarget:_0x558b22}=await import(_0x5973ae(0xd4)),_0x591a54=_0x558b22(_0x25285b[_0x5973ae(0xd0)],_0x25285b['bool'](_0x5973ae(0xd7))?_0x5973ae(0xd7):_0x5973ae(0xed)),_0x3639af=_0x56accc({'env':_0x25285b[_0x5973ae(0xe3)]??_0x5973ae(0xd8),'accessKey':_0x217c70,'appCode':_0x25285b[_0x5973ae(0xd0)],'scopes':listScopeToRuntimeScopes(_0x2a3a2d),'code':_0x134ccb['trim']()||undefined},_0x591a54),_0x14fd53=groupLocalRuntimeSkills(_0x3639af);return{'ok':!![],'data':{'appCode':_0x25285b[_0x5973ae(0xd0)],'source':_0x5973ae(0xd1),..._0x591a54[_0x5973ae(0xe1)]===_0x5973ae(0xd7)?{'installScope':_0x591a54[_0x5973ae(0xe1)]}:{},'scope':_0x2a3a2d,'total':_0x3639af[_0x5973ae(0xee)],'personal':_0x14fd53[_0x5973ae(0xd5)]['length'],'company':_0x14fd53[_0x5973ae(0xde)][_0x5973ae(0xee)],'items':_0x3639af[_0x5973ae(0xe7)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x14fd53[_0x5973ae(0xd5)]['map'](summarizeLocalRuntimeSkill),'company':_0x14fd53['company'][_0x5973ae(0xe7)](summarizeLocalRuntimeSkill)}},'message':_0x5973ae(0xec)+_0x3639af['length']+_0x5973ae(0xdd)};}const {listRuntimeSkills:_0xf2bb17}=await import(_0x5973ae(0xe2)),_0x14025b=await _0xf2bb17({'appCode':_0x25285b[_0x5973ae(0xd0)],'scope':listScopeToRemoteScope(_0x2a3a2d),'code':_0x134ccb[_0x5973ae(0xe5)]()||undefined}),_0x4d9731=shouldListScope(_0x2a3a2d,_0x5973ae(0xd5))?_0x14025b[_0x5973ae(0xd5)]??[]:[],_0x462b89=shouldListScope(_0x2a3a2d,'company')?_0x14025b[_0x5973ae(0xde)]??[]:[],_0x49a7d2=[..._0x4d9731,..._0x462b89];return{'ok':!![],'data':{'appCode':_0x25285b[_0x5973ae(0xd0)],'source':_0x5973ae(0xe4),'scope':_0x2a3a2d,'total':_0x49a7d2[_0x5973ae(0xee)],'personal':_0x4d9731[_0x5973ae(0xee)],'company':_0x462b89['length'],'items':_0x49a7d2[_0x5973ae(0xe7)](summarizeRuntimeSkill),'skills':{'personal':_0x4d9731['map'](summarizeRuntimeSkill),'company':_0x462b89[_0x5973ae(0xe7)](summarizeRuntimeSkill)}},'message':_0x5973ae(0xec)+_0x49a7d2[_0x5973ae(0xee)]+'\x20remote\x20Skill(s).'};}};function a46_0x287f(_0x3025fa,_0x1b8c8e){_0x3025fa=_0x3025fa-0xcc;const _0x293d39=a46_0x293d();let _0x287ffc=_0x293d39[_0x3025fa];return _0x287ffc;}function groupLocalRuntimeSkills(_0x30a9ab){const _0x10da6a=a46_0x27fefd;return{'personal':_0x30a9ab[_0x10da6a(0xdf)](_0x207ddc=>_0x207ddc['scope']===_0x10da6a(0xd5)),'company':_0x30a9ab[_0x10da6a(0xdf)](_0x2adaa1=>_0x2adaa1['scope']==='company'),'builtin':_0x30a9ab[_0x10da6a(0xdf)](_0x575651=>_0x575651[_0x10da6a(0xe1)]===_0x10da6a(0xe9))};}
@@ -1 +1 @@
1
- const a47_0x2db9d2=a47_0x2918;function a47_0x1ee0(){const _0x462912=['push','24CVIimp','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','368091XEARaK','401232hsNNXy','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','748020PwJtrD','76662UjQBQV','745717afsxlS','160FyuHoI','skill','225797sLNLoB','9866745eYbbve'];a47_0x1ee0=function(){return _0x462912;};return a47_0x1ee0();}(function(_0x145aca,_0x391892){const _0x234fd7=a47_0x2918,_0x397c4f=_0x145aca();while(!![]){try{const _0x578e01=parseInt(_0x234fd7(0x17c))/0x1+-parseInt(_0x234fd7(0x184))/0x2+parseInt(_0x234fd7(0x181))/0x3+-parseInt(_0x234fd7(0x182))/0x4+-parseInt(_0x234fd7(0x187))/0x5*(parseInt(_0x234fd7(0x185))/0x6)+parseInt(_0x234fd7(0x186))/0x7*(-parseInt(_0x234fd7(0x17f))/0x8)+parseInt(_0x234fd7(0x17d))/0x9;if(_0x578e01===_0x391892)break;else _0x397c4f['push'](_0x397c4f['shift']());}catch(_0x3288f1){_0x397c4f['push'](_0x397c4f['shift']());}}}(a47_0x1ee0,0x3b168));import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';function a47_0x2918(_0x2ceed6,_0x34315a){_0x2ceed6=_0x2ceed6-0x17c;const _0x1ee025=a47_0x1ee0();let _0x2918af=_0x1ee025[_0x2ceed6];return _0x2918af;}export const pushCommand={'service':a47_0x2db9d2(0x188),'command':a47_0x2db9d2(0x17e),'description':a47_0x2db9d2(0x183),'risk':'write','confirmationDescription':a47_0x2db9d2(0x180),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
1
+ const a47_0x1055d9=a47_0x265e;function a47_0x265e(_0x25f1ee,_0x3c7f59){_0x25f1ee=_0x25f1ee-0x1ce;const _0x4cb71d=a47_0x4cb7();let _0x265e06=_0x4cb71d[_0x25f1ee];return _0x265e06;}(function(_0x92e43f,_0x8e5731){const _0x491b2f=a47_0x265e,_0x5cd08c=_0x92e43f();while(!![]){try{const _0x38fc45=parseInt(_0x491b2f(0x1d9))/0x1*(-parseInt(_0x491b2f(0x1da))/0x2)+parseInt(_0x491b2f(0x1d7))/0x3*(parseInt(_0x491b2f(0x1d6))/0x4)+parseInt(_0x491b2f(0x1d8))/0x5+parseInt(_0x491b2f(0x1cf))/0x6+-parseInt(_0x491b2f(0x1d1))/0x7*(parseInt(_0x491b2f(0x1d4))/0x8)+parseInt(_0x491b2f(0x1ce))/0x9+-parseInt(_0x491b2f(0x1d0))/0xa;if(_0x38fc45===_0x8e5731)break;else _0x5cd08c['push'](_0x5cd08c['shift']());}catch(_0x372508){_0x5cd08c['push'](_0x5cd08c['shift']());}}}(a47_0x4cb7,0x8762b));function a47_0x4cb7(){const _0x3e80d6=['323067pALaGu','2sXSWOk','9894690WjMJNV','2453892HwYkty','4203410bPHtdg','161eLgtnG','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','write','219160IXzeDV','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','8qqPbIP','233559VjPpdV','1319670BSsdkC'];a47_0x4cb7=function(){return _0x3e80d6;};return a47_0x4cb7();}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':'skill','command':'push','description':a47_0x1055d9(0x1d5),'risk':a47_0x1055d9(0x1d3),'confirmationDescription':a47_0x1055d9(0x1d2),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
@@ -1 +1 @@
1
- const a48_0x54c89d=a48_0x48ad;function a48_0x48ad(_0x4e8598,_0x327684){_0x4e8598=_0x4e8598-0xf7;const _0x422aac=a48_0x422a();let _0x48ad7f=_0x422aac[_0x4e8598];return _0x48ad7f;}(function(_0x1a6d50,_0x4a9371){const _0x210eb0=a48_0x48ad,_0x1796c8=_0x1a6d50();while(!![]){try{const _0xa46c4b=parseInt(_0x210eb0(0xf9))/0x1+-parseInt(_0x210eb0(0xf8))/0x2+parseInt(_0x210eb0(0xff))/0x3*(-parseInt(_0x210eb0(0xfc))/0x4)+parseInt(_0x210eb0(0x100))/0x5+parseInt(_0x210eb0(0x10a))/0x6+-parseInt(_0x210eb0(0x102))/0x7+-parseInt(_0x210eb0(0x108))/0x8*(-parseInt(_0x210eb0(0x106))/0x9);if(_0xa46c4b===_0x4a9371)break;else _0x1796c8['push'](_0x1796c8['shift']());}catch(_0x47aaa5){_0x1796c8['push'](_0x1796c8['shift']());}}}(a48_0x422a,0x407de));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':a48_0x54c89d(0x103),'command':a48_0x54c89d(0x101),'description':a48_0x54c89d(0xfb),'risk':a48_0x54c89d(0x107),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x244948){const _0x2f8129=a48_0x54c89d,_0x301332=_0x244948[_0x2f8129(0xfa)](_0x2f8129(0xf7)),_0x53e4f2=validateSkillDirectory(_0x244948[_0x2f8129(0x105)](_0x2f8129(0x104)),{'strict':_0x301332});return throwIfSkillValidationFailed(_0x53e4f2,_0x301332),{'ok':!![],'data':{'dir':_0x53e4f2[_0x2f8129(0x104)],'type':_0x53e4f2[_0x2f8129(0xfd)],'errors':_0x53e4f2['errors'],'warnings':_0x53e4f2[_0x2f8129(0xfe)]},'message':_0x2f8129(0x109)};}};function a48_0x422a(){const _0x435dfa=['dir','str','9LueJiI','read','7817624kVUnBY','Skill\x20validation\x20passed.','217302JLFBxA','strict','1011724oFTFtU','487215wWcpLx','bool','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','16DvBcIw','type','warnings','392790yIrNsp','872230cdIAyP','validate','2669387cCyZSJ','skill'];a48_0x422a=function(){return _0x435dfa;};return a48_0x422a();}
1
+ const a48_0x20351e=a48_0x496b;function a48_0x496b(_0x1f7fd6,_0x54d8ce){_0x1f7fd6=_0x1f7fd6-0x182;const _0xb7338b=a48_0xb733();let _0x496bda=_0xb7338b[_0x1f7fd6];return _0x496bda;}(function(_0x4f17ee,_0x2d3987){const _0x268d1a=a48_0x496b,_0xf9f39f=_0x4f17ee();while(!![]){try{const _0x78a31c=parseInt(_0x268d1a(0x18a))/0x1+parseInt(_0x268d1a(0x187))/0x2*(parseInt(_0x268d1a(0x185))/0x3)+-parseInt(_0x268d1a(0x194))/0x4*(-parseInt(_0x268d1a(0x188))/0x5)+parseInt(_0x268d1a(0x183))/0x6*(parseInt(_0x268d1a(0x184))/0x7)+-parseInt(_0x268d1a(0x193))/0x8*(parseInt(_0x268d1a(0x18c))/0x9)+-parseInt(_0x268d1a(0x18b))/0xa+-parseInt(_0x268d1a(0x190))/0xb;if(_0x78a31c===_0x2d3987)break;else _0xf9f39f['push'](_0xf9f39f['shift']());}catch(_0x4fbac5){_0xf9f39f['push'](_0xf9f39f['shift']());}}}(a48_0xb733,0x454b0));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';function a48_0xb733(){const _0x4ec622=['1654980KqqRhq','18DeSgug','validate','str','warnings','1335620lGBTzX','skill','dir','668680nTGKhq','41188NcHxbm','errors','bool','292602snEacd','7lgJbez','1761xXOvpP','strict','556zPaFXl','30XnNftQ','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','464177RWNIFY'];a48_0xb733=function(){return _0x4ec622;};return a48_0xb733();}export const validateCommand={'service':a48_0x20351e(0x191),'command':a48_0x20351e(0x18d),'description':a48_0x20351e(0x189),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0xbd6f8c){const _0x195f93=a48_0x20351e,_0x8273b7=_0xbd6f8c[_0x195f93(0x182)](_0x195f93(0x186)),_0x334230=validateSkillDirectory(_0xbd6f8c[_0x195f93(0x18e)](_0x195f93(0x192)),{'strict':_0x8273b7});return throwIfSkillValidationFailed(_0x334230,_0x8273b7),{'ok':!![],'data':{'dir':_0x334230[_0x195f93(0x192)],'type':_0x334230['type'],'errors':_0x334230[_0x195f93(0x195)],'warnings':_0x334230[_0x195f93(0x18f)]},'message':'Skill\x20validation\x20passed.'};}};
@@ -1 +1 @@
1
- (function(_0x1d6ee3,_0x1917db){const _0x4a7bb1=a49_0xd97f,_0x183f46=_0x1d6ee3();while(!![]){try{const _0x1b681e=parseInt(_0x4a7bb1(0xd4))/0x1+-parseInt(_0x4a7bb1(0xd5))/0x2+parseInt(_0x4a7bb1(0xd1))/0x3+-parseInt(_0x4a7bb1(0xcc))/0x4+parseInt(_0x4a7bb1(0xca))/0x5*(-parseInt(_0x4a7bb1(0xd8))/0x6)+parseInt(_0x4a7bb1(0xda))/0x7+parseInt(_0x4a7bb1(0xdb))/0x8*(parseInt(_0x4a7bb1(0xc6))/0x9);if(_0x1b681e===_0x1917db)break;else _0x183f46['push'](_0x183f46['shift']());}catch(_0x3fe8fb){_0x183f46['push'](_0x183f46['shift']());}}}(a49_0x10b7,0x74d92));function a49_0xd97f(_0x4962c5,_0x4e850e){_0x4962c5=_0x4962c5-0xc5;const _0x10b750=a49_0x10b7();let _0xd97f9a=_0x10b750[_0x4962c5];return _0xd97f9a;}import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x3ba145){const _0x2f352e=a49_0xd97f;return(await readRequiredSkillDiagramInput(_0x3ba145))[_0x2f352e(0xc9)];}function a49_0x10b7(){const _0x20d19b=['Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','684459YmECSx','utf8','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','715532KQOMus','579898hCUfxZ','window','validation','5343810GwVwJa','replace','4467750UTdMHC','32BuUUqC','Mermaid\x20syntax\x20validation\x20failed.','document','1155348aGibpL','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','trim','diagram','5ERlcjF','isFile','1744916fTQKBu','parse','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.','mermaid'];a49_0x10b7=function(){return _0x20d19b;};return a49_0x10b7();}export async function readRequiredSkillDiagramInput(_0x53b69b){const _0xcd52e1=a49_0xd97f,_0x4070a4=_0x53b69b[_0xcd52e1(0xc8)]();if(!_0x4070a4)throw CliErrors[_0xcd52e1(0xd7)]('--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.',_0xcd52e1(0xc7));let _0x396581,_0x4aed54;if(_0x4070a4==='-')try{_0x396581=readFileSync(0x0,_0xcd52e1(0xd2));}catch{throw CliErrors['validation'](_0xcd52e1(0xd0));}else{const _0x552df2=resolve(_0x4070a4);if(!existsSync(_0x552df2))throw CliErrors['validation'](_0xcd52e1(0xd3)+_0x552df2);if(!statSync(_0x552df2)[_0xcd52e1(0xcb)]())throw CliErrors[_0xcd52e1(0xd7)]('Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x552df2);_0x4aed54=realpathSync(_0x552df2),_0x396581=readFileSync(_0x4aed54,_0xcd52e1(0xd2));}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x396581)},'sourceFilePath':_0x4aed54};}export async function validateAndCanonicalizeMermaid(_0x4c8745){const _0x472033=a49_0xd97f,_0x527428=_0x4c8745[_0x472033(0xd9)](/\r\n/g,'\x0a')[_0x472033(0xd9)](/\r/g,'\x0a')[_0x472033(0xd9)](/\n+$/,'')+'\x0a';try{const _0x577fc7=await loadMermaidApi();await _0x577fc7[_0x472033(0xcd)](_0x527428);}catch{throw diagramValidationError();}return _0x527428;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x4f0e60=a49_0xd97f;if(!(_0x4f0e60(0xd6)in globalThis)||!(_0x4f0e60(0xc5)in globalThis)){const _0x4b216e=new JSDOM('');Object['defineProperties'](globalThis,{'window':{'configurable':!![],'value':_0x4b216e['window']},'document':{'configurable':!![],'value':_0x4b216e[_0x4f0e60(0xd6)][_0x4f0e60(0xc5)]}});}return(await import(_0x4f0e60(0xcf)))['default'];})()),mermaidApiPromise;}function diagramValidationError(){const _0x1984bd=a49_0xd97f;return CliErrors[_0x1984bd(0xd7)](_0x1984bd(0xdc),_0x1984bd(0xce));}
1
+ (function(_0x18dbc2,_0x37a3ec){const _0x4dbdbe=a49_0x365f,_0x4d246c=_0x18dbc2();while(!![]){try{const _0xe6a84b=-parseInt(_0x4dbdbe(0x202))/0x1+parseInt(_0x4dbdbe(0x209))/0x2*(-parseInt(_0x4dbdbe(0x20a))/0x3)+parseInt(_0x4dbdbe(0x1f2))/0x4+parseInt(_0x4dbdbe(0x1f9))/0x5*(-parseInt(_0x4dbdbe(0x20b))/0x6)+-parseInt(_0x4dbdbe(0x1fa))/0x7+-parseInt(_0x4dbdbe(0x1f8))/0x8+-parseInt(_0x4dbdbe(0x208))/0x9*(-parseInt(_0x4dbdbe(0x206))/0xa);if(_0xe6a84b===_0x37a3ec)break;else _0x4d246c['push'](_0x4d246c['shift']());}catch(_0x3a3cfc){_0x4d246c['push'](_0x4d246c['shift']());}}}(a49_0x3738,0xa3a72));import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';function a49_0x3738(){const _0x465a5e=['63Vumaob','505888OkRexL','15ETHNPD','1663302RfHWck','4019884BnOYzd','parse','replace','Mermaid\x20syntax\x20validation\x20failed.','diagram','isFile','6317232bquTEI','15TJAJNO','3764726LlxiKG','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.','document','utf8','window','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','validation','314955MXqryy','default','mermaid','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','4863070aXxEbP','defineProperties'];a49_0x3738=function(){return _0x465a5e;};return a49_0x3738();}let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x594fc5){const _0x42b045=a49_0x365f;return(await readRequiredSkillDiagramInput(_0x594fc5))[_0x42b045(0x1f6)];}export async function readRequiredSkillDiagramInput(_0x596d83){const _0x312248=a49_0x365f,_0x3a0241=_0x596d83['trim']();if(!_0x3a0241)throw CliErrors[_0x312248(0x201)](_0x312248(0x1fc),_0x312248(0x200));let _0x2b5965,_0x8980d8;if(_0x3a0241==='-')try{_0x2b5965=readFileSync(0x0,_0x312248(0x1fe));}catch{throw CliErrors[_0x312248(0x201)](_0x312248(0x1fb));}else{const _0x138ba6=resolve(_0x3a0241);if(!existsSync(_0x138ba6))throw CliErrors[_0x312248(0x201)](_0x312248(0x205)+_0x138ba6);if(!statSync(_0x138ba6)[_0x312248(0x1f7)]())throw CliErrors[_0x312248(0x201)]('Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x138ba6);_0x8980d8=realpathSync(_0x138ba6),_0x2b5965=readFileSync(_0x8980d8,'utf8');}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x2b5965)},'sourceFilePath':_0x8980d8};}export async function validateAndCanonicalizeMermaid(_0x1f5d9f){const _0x3f293f=a49_0x365f,_0x8016e4=_0x1f5d9f['replace'](/\r\n/g,'\x0a')[_0x3f293f(0x1f4)](/\r/g,'\x0a')['replace'](/\n+$/,'')+'\x0a';try{const _0x4b1866=await loadMermaidApi();await _0x4b1866[_0x3f293f(0x1f3)](_0x8016e4);}catch{throw diagramValidationError();}return _0x8016e4;}function a49_0x365f(_0x14b178,_0x3639cf){_0x14b178=_0x14b178-0x1f2;const _0x373874=a49_0x3738();let _0x365fb0=_0x373874[_0x14b178];return _0x365fb0;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x401ec4=a49_0x365f;if(!(_0x401ec4(0x1ff)in globalThis)||!(_0x401ec4(0x1fd)in globalThis)){const _0x573db5=new JSDOM('');Object[_0x401ec4(0x207)](globalThis,{'window':{'configurable':!![],'value':_0x573db5[_0x401ec4(0x1ff)]},'document':{'configurable':!![],'value':_0x573db5[_0x401ec4(0x1ff)]['document']}});}return(await import(_0x401ec4(0x204)))[_0x401ec4(0x203)];})()),mermaidApiPromise;}function diagramValidationError(){const _0x536ddd=a49_0x365f;return CliErrors[_0x536ddd(0x201)](_0x536ddd(0x1f5),'Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.');}