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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +3 -0
  2. package/lib/cli.js +1 -1
  3. package/lib/commands/api-doc/index.js +1 -1
  4. package/lib/commands/app/cache.js +1 -1
  5. package/lib/commands/app/definitions.js +1 -1
  6. package/lib/commands/app/eligibility.js +1 -1
  7. package/lib/commands/app/mock-loader.js +1 -1
  8. package/lib/commands/app/remote-source.js +1 -1
  9. package/lib/commands/app/shared.js +1 -1
  10. package/lib/commands/app-config/get.js +1 -1
  11. package/lib/commands/app-config/index.js +1 -1
  12. package/lib/commands/artifact/index.js +1 -1
  13. package/lib/commands/auth/device.js +1 -1
  14. package/lib/commands/auth/index.js +1 -1
  15. package/lib/commands/auth/prompt.js +1 -1
  16. package/lib/commands/bff/detail.js +1 -1
  17. package/lib/commands/bff/exec.js +1 -1
  18. package/lib/commands/bff/index.js +1 -1
  19. package/lib/commands/cli-skill/index.js +1 -1
  20. package/lib/commands/common/config-policy.js +1 -1
  21. package/lib/commands/common/constraints.js +1 -1
  22. package/lib/commands/common/flags.js +1 -1
  23. package/lib/commands/common/local-file.js +1 -1
  24. package/lib/commands/config/definitions.js +1 -1
  25. package/lib/commands/config/shared.js +1 -1
  26. package/lib/commands/data/index.js +1 -1
  27. package/lib/commands/dataset/detail.js +1 -1
  28. package/lib/commands/dataset/index.js +1 -1
  29. package/lib/commands/dataset/list.js +1 -1
  30. package/lib/commands/dataset/sdk-doc.js +1 -1
  31. package/lib/commands/doctor.js +1 -1
  32. package/lib/commands/file/index.js +1 -1
  33. package/lib/commands/init.js +1 -1
  34. package/lib/commands/kb/index.js +1 -1
  35. package/lib/commands/logs/index.js +1 -1
  36. package/lib/commands/ocr/index.js +1 -1
  37. package/lib/commands/personal-bff/index.js +1 -1
  38. package/lib/commands/registry.js +1 -1
  39. package/lib/commands/schedule/index.js +1 -1
  40. package/lib/commands/schema.js +1 -1
  41. package/lib/commands/service/dynamic.js +1 -1
  42. package/lib/commands/service/function-name-adapter.js +1 -1
  43. package/lib/commands/service/index.js +1 -1
  44. package/lib/commands/service/registry.js +1 -1
  45. package/lib/commands/skill/commands/create.js +1 -1
  46. package/lib/commands/skill/commands/diagram.js +1 -1
  47. package/lib/commands/skill/commands/install.js +1 -1
  48. package/lib/commands/skill/commands/list.js +1 -1
  49. package/lib/commands/skill/commands/push.js +1 -1
  50. package/lib/commands/skill/commands/validate.js +1 -1
  51. package/lib/commands/skill/diagram.js +1 -1
  52. package/lib/commands/skill/flags.js +1 -1
  53. package/lib/commands/skill/index.js +1 -1
  54. package/lib/commands/skill/manifest-helpers.js +1 -1
  55. package/lib/commands/skill/push-execute.js +1 -1
  56. package/lib/commands/skill/push-flow-helpers.js +1 -1
  57. package/lib/commands/skill/push-retarget.js +1 -1
  58. package/lib/commands/skill/scopes.js +1 -1
  59. package/lib/commands/skill/summary.js +1 -1
  60. package/lib/commands/skill/templates.js +1 -1
  61. package/lib/commands/skill/validate.js +1 -1
  62. package/lib/commands/sql/detail.js +1 -1
  63. package/lib/commands/sql/exec.js +1 -1
  64. package/lib/commands/sql/index.js +1 -1
  65. package/lib/commands/update.js +1 -1
  66. package/lib/commands/user-account/bind.d.ts +2 -0
  67. package/lib/commands/user-account/bind.js +1 -0
  68. package/lib/commands/user-account/index.d.ts +2 -0
  69. package/lib/commands/user-account/index.js +1 -0
  70. package/lib/commands/workspace/index.js +1 -1
  71. package/lib/config/schema.js +1 -1
  72. package/lib/constant/app.js +1 -1
  73. package/lib/constant/auth-mode.js +1 -1
  74. package/lib/constant/cli.js +1 -1
  75. package/lib/constant/defaults.js +1 -1
  76. package/lib/constant/distribution.js +1 -1
  77. package/lib/constant/domain.js +1 -1
  78. package/lib/constant/env.js +1 -1
  79. package/lib/constant/output.js +1 -1
  80. package/lib/constant/product.js +1 -1
  81. package/lib/constant/risk.js +1 -1
  82. package/lib/constant/url.js +1 -1
  83. package/lib/context.js +1 -1
  84. package/lib/core/api-client.d.ts +2 -0
  85. package/lib/core/api-client.js +1 -1
  86. package/lib/core/db-resolver.js +1 -1
  87. package/lib/core/sdk-client.js +1 -1
  88. package/lib/errors.js +1 -1
  89. package/lib/framework/build-all-flags.js +1 -1
  90. package/lib/framework/dryrun.js +1 -1
  91. package/lib/framework/flags.js +1 -1
  92. package/lib/framework/help.js +1 -1
  93. package/lib/framework/index.js +1 -1
  94. package/lib/framework/output.js +1 -1
  95. package/lib/framework/preparse.js +1 -1
  96. package/lib/framework/rate-limit.js +1 -1
  97. package/lib/framework/raw-flags.js +1 -1
  98. package/lib/framework/response.js +1 -1
  99. package/lib/framework/runner-confirmation.js +1 -1
  100. package/lib/framework/runner-error.js +1 -1
  101. package/lib/framework/runner.js +1 -1
  102. package/lib/framework/schema-export.js +1 -1
  103. package/lib/framework/service-order.js +1 -1
  104. package/lib/framework/types.js +1 -1
  105. package/lib/generated/build-info.d.ts +4 -4
  106. package/lib/generated/build-info.js +1 -1
  107. package/lib/help.js +1 -1
  108. package/lib/postinstall.js +1 -1
  109. package/lib/runtime/confirmation.js +1 -1
  110. package/lib/runtime/event.js +1 -1
  111. package/lib/runtime/index.js +1 -1
  112. package/lib/runtime/queue.js +1 -1
  113. package/lib/runtime/resolve.js +1 -1
  114. package/lib/skills/builtin-skill.js +1 -1
  115. package/lib/skills/npx-skills-add.js +1 -1
  116. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  117. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  118. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  119. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  120. package/lib/skills/runtime-skill-sync/links.js +1 -1
  121. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  122. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  123. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  124. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  125. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  126. package/lib/skills/runtime-skill-sync/push.js +1 -1
  127. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  128. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  129. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  130. package/lib/skills/runtime-skill-sync.js +1 -1
  131. package/lib/skills/skill-presence.js +1 -1
  132. package/lib/utils/apply-jq-filter.js +1 -1
  133. package/lib/utils/logger.js +1 -1
  134. package/lib/utils/lossless-json.js +1 -1
  135. package/lib/utils/params.js +1 -1
  136. package/lib/utils/platform.js +1 -1
  137. package/lib/utils/update-notice.js +1 -1
  138. package/lib/utils/version.js +1 -1
  139. package/lib/utils/write-cli-side-channel.js +1 -1
  140. package/package.json +1 -1
  141. package/skills/lovrabet/SKILL.md +7 -3
  142. package/skills/lovrabet/guides/sql-and-bff-workflow.md +5 -0
  143. package/skills/lovrabet/references/lovrabet-personal-bff-workflow.md +1 -1
  144. package/skills/lovrabet/references/lovrabet-service-tree.md +2 -0
  145. package/skills/lovrabet/references/lovrabet-sql-workflow.md +4 -1
  146. package/skills/lovrabet/references/lovrabet-user-account.md +46 -0
  147. package/skills/lovrabet.manifest.json +4 -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(_0x1ba12d,_0x53282b){const _0xa401b3=a39_0x5f2c,_0x45c9e=_0x1ba12d();while(!![]){try{const _0x384efe=-parseInt(_0xa401b3(0x157))/0x1*(-parseInt(_0xa401b3(0x177))/0x2)+-parseInt(_0xa401b3(0x15e))/0x3+-parseInt(_0xa401b3(0x136))/0x4+parseInt(_0xa401b3(0x156))/0x5*(parseInt(_0xa401b3(0x186))/0x6)+-parseInt(_0xa401b3(0x12c))/0x7*(parseInt(_0xa401b3(0x16f))/0x8)+parseInt(_0xa401b3(0x17b))/0x9*(-parseInt(_0xa401b3(0x171))/0xa)+parseInt(_0xa401b3(0x150))/0xb;if(_0x384efe===_0x53282b)break;else _0x45c9e['push'](_0x45c9e['shift']());}catch(_0x52e15e){_0x45c9e['push'](_0x45c9e['shift']());}}}(a39_0x14ef,0xd0392));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(_0x6b4fe6,_0x6271a1){const _0x4a98ef=a39_0x5f2c,_0x4c345b=listLocalServiceTrees();let _0x288833;for(const _0x3c4e3c of _0x4c345b){const _0x459913=matchServiceTreeCommand(_0x3c4e3c,_0x6b4fe6);if(!_0x459913)continue;(!_0x288833||_0x459913['command'][_0x4a98ef(0x13d)]['length']>_0x288833[_0x4a98ef(0x123)][_0x4a98ef(0x13d)][_0x4a98ef(0x152)])&&(_0x288833={'tree':_0x3c4e3c,'command':_0x459913[_0x4a98ef(0x123)],'remainingArgs':_0x459913[_0x4a98ef(0x12a)]});}if(!_0x288833)return undefined;const _0x1b2b04={..._0x6271a1};return applyAppBinding(_0x288833[_0x4a98ef(0x170)],_0x288833['command'],_0x1b2b04),{'definition':buildDynamicCommandDefinition(_0x288833[_0x4a98ef(0x170)],_0x288833[_0x4a98ef(0x123)]),'args':_0x288833[_0x4a98ef(0x12a)],'flags':_0x1b2b04,'tree':_0x288833[_0x4a98ef(0x170)],'command':_0x288833[_0x4a98ef(0x123)]};}export function generateDynamicServiceHelp(_0x43daaf){const _0x37e038=a39_0x5f2c,_0x28c1cb=listLocalServiceTrees()['find'](_0x1451a9=>_0x1451a9[_0x37e038(0x14c)][_0x37e038(0x16b)]===_0x43daaf);if(!_0x28c1cb)return undefined;const _0x990d87=[CLI_BIN_NAME+'\x20'+_0x43daaf+_0x37e038(0x125),'',_0x28c1cb[_0x37e038(0x14c)][_0x37e038(0x153)]||_0x43daaf,_0x28c1cb[_0x37e038(0x14c)]['description']?'\x20\x20'+_0x28c1cb[_0x37e038(0x14c)][_0x37e038(0x175)]:'','',_0x37e038(0x16d),..._0x28c1cb[_0x37e038(0x174)][_0x37e038(0x126)](_0x1d1da1=>{const _0x26a3ff=_0x37e038,_0x45019c=_0x1d1da1[_0x26a3ff(0x13d)][_0x26a3ff(0x189)](0x1)['join']('\x20'),_0xb08eb8=_0x1d1da1[_0x26a3ff(0x16e)]===_0x26a3ff(0x160)?'':'\x20['+_0x1d1da1[_0x26a3ff(0x16e)]+']';return'\x20\x20'+_0x45019c[_0x26a3ff(0x13b)](0x18)+'\x20'+(_0x1d1da1['description']||'')+_0xb08eb8;}),'',_0x37e038(0x179)+CLI_BIN_NAME+_0x37e038(0x17e)+_0x43daaf+_0x37e038(0x163)][_0x37e038(0x149)](Boolean);return _0x990d87[_0x37e038(0x13c)]('\x0a');}export function listDynamicServiceEntries(){const _0x5ecb91=a39_0x5f2c;return listLocalServices()[_0x5ecb91(0x126)](_0x2f3dbb=>{const _0x3c9361=_0x5ecb91,_0xaeced4=_0x2f3dbb[_0x3c9361(0x142)];return{'service':_0xaeced4['service'][_0x3c9361(0x16b)],'label':_0xaeced4[_0x3c9361(0x14c)]['name']||_0xaeced4[_0x3c9361(0x14c)][_0x3c9361(0x16b)],'commands':_0xaeced4[_0x3c9361(0x174)]['map'](_0x1aa5c1=>({'command':dynamicCommandName(_0x1aa5c1),'description':_0x1aa5c1[_0x3c9361(0x175)]||_0x3c9361(0x188)+_0x1aa5c1[_0x3c9361(0x137)],'tag':riskTag(_0x1aa5c1[_0x3c9361(0x16e)])}))};});}export function getDynamicServiceEntry(_0x4ab8a0){const _0x54b3f3=a39_0x5f2c;return listDynamicServiceEntries()[_0x54b3f3(0x172)](_0x341e96=>_0x341e96[_0x54b3f3(0x14c)]===_0x4ab8a0);}export function listDynamicServiceDefinitions(_0x3dd1e1){const _0x5d835f=a39_0x5f2c;return listLocalServiceTrees()[_0x5d835f(0x149)](_0x49aea4=>!_0x3dd1e1||_0x49aea4[_0x5d835f(0x14c)][_0x5d835f(0x16b)]===_0x3dd1e1)['flatMap'](_0x28cd4c=>_0x28cd4c[_0x5d835f(0x174)][_0x5d835f(0x126)](_0x30ed6d=>buildDynamicCommandDefinition(_0x28cd4c,_0x30ed6d)));}export function getDynamicServiceDefinitions(_0x1ff00a){const _0x3b52d6=listDynamicServiceDefinitions(_0x1ff00a);return _0x3b52d6['length']>0x0?_0x3b52d6:undefined;}export function findDynamicServiceDefinition(_0x3493c5,_0x244858){const _0x47c9fc=a39_0x5f2c;return listDynamicServiceDefinitions(_0x3493c5)[_0x47c9fc(0x172)](_0x3f3b9e=>_0x3f3b9e['command']===_0x244858);}export function buildDynamicCommandDefinition(_0x23332f,_0x46a1fc){const _0x36b4ef=a39_0x5f2c;return{'service':_0x23332f['service']['code'],'command':dynamicCommandName(_0x46a1fc),'description':_0x46a1fc[_0x36b4ef(0x175)]||_0x36b4ef(0x188)+_0x46a1fc['cliPath'],'risk':_0x46a1fc[_0x36b4ef(0x16e)],..._0x46a1fc[_0x36b4ef(0x16e)]===_0x36b4ef(0x160)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x46a1fc)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x46a1fc['args'][_0x36b4ef(0x126)](_0x5492dc=>({'name':_0x5492dc[_0x36b4ef(0x153)],'description':_0x5492dc[_0x36b4ef(0x175)]||_0x5492dc['name'],'required':_0x5492dc[_0x36b4ef(0x17f)]})),'flags':_0x46a1fc[_0x36b4ef(0x162)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x46a1fc),async 'dryRun'(_0xb1fa96){const _0x1d97b6=_0x36b4ef,_0x36b670=await compilePlan(_0x46a1fc,_0xb1fa96);return{'method':_0x1d97b6(0x129),'url':_0x46a1fc['cliPath'],'body':{'target':targetPreview(_0x36b670),'params':_0x36b670['params']},'description':_0x1d97b6(0x168)+_0x46a1fc[_0x1d97b6(0x137)]};},async 'execute'(_0x86f1f5){const _0x55fe6c=_0x36b4ef,_0x3c66d0=await compilePlan(_0x46a1fc,_0x86f1f5),_0x48b711=Date[_0x55fe6c(0x130)](),_0x2318e1=await executePlan(_0x3c66d0,_0x46a1fc,_0x86f1f5),_0x50f8af=Date['now']()-_0x48b711;return{'ok':!![],'data':{'service':_0x23332f[_0x55fe6c(0x14c)],'command':_0x46a1fc['cliPath'],'target':targetPreview(_0x3c66d0),'result':_0x2318e1,'elapsed':_0x50f8af},'message':_0x55fe6c(0x164)+_0x46a1fc['cliPath']+_0x55fe6c(0x182)+_0x50f8af+'ms'};}};}function buildDynamicConfirmationDescription(_0x4696f0){const _0x42f127=a39_0x5f2c,_0x4473c8=_0x4696f0[_0x42f127(0x175)]||_0x4696f0[_0x42f127(0x137)],_0x3cf968=_0x4696f0['risk']===_0x42f127(0x151)?_0x42f127(0x169):'该命令被清单标记为写入,可能修改业务数据或服务状态。';return _0x42f127(0x178)+_0x4473c8+'”。'+_0x3cf968;}function dynamicCommandName(_0x24e64b){const _0x24439e=a39_0x5f2c;return _0x24e64b[_0x24439e(0x13d)][_0x24439e(0x189)](0x1)['join']('\x20');}function riskTag(_0x13e3f6){return _0x13e3f6==='read'?'':'\x20\x20['+_0x13e3f6+']';}function flagToCommandFlag(_0x1c5122){const _0x12bcf4=a39_0x5f2c;return{'name':_0x1c5122[_0x12bcf4(0x17c)],'type':_0x1c5122[_0x12bcf4(0x158)]===_0x12bcf4(0x16c)?_0x12bcf4(0x144):_0x1c5122[_0x12bcf4(0x158)],'description':_0x1c5122[_0x12bcf4(0x175)]||_0x1c5122[_0x12bcf4(0x153)],'required':_0x1c5122[_0x12bcf4(0x17f)],'default':isPrimitiveFlagDefault(_0x1c5122[_0x12bcf4(0x146)])?_0x1c5122[_0x12bcf4(0x146)]:undefined,'enum':_0x1c5122['enum']};}async function compilePlan(_0x3c755f,_0x336d03){const _0x4754f4=a39_0x5f2c;return compileServiceTreeCommand(_0x3c755f,{'flags':_0x336d03[_0x4754f4(0x15f)],'args':_0x336d03[_0x4754f4(0x14b)],'context':await buildServiceContext(_0x3c755f,_0x336d03)});}async function buildServiceContext(_0x2f56b9,_0x272e41){const _0x7ce558=a39_0x5f2c,_0xffd8f3={'appCode':_0x272e41['appCode'],'env':_0x272e41['envName'],'envName':_0x272e41[_0x7ce558(0x122)]};if(!usesRuntimeContext(_0x2f56b9))return _0xffd8f3;const _0x454560=await getLoginUserInfo(),_0x4c0505=pickFirst(_0x454560[_0x7ce558(0x135)],_0x454560['id']);return{..._0xffd8f3,'user':_0x454560,'userId':_0x4c0505,'id':_0x454560['id'],'username':pickFirst(_0x454560[_0x7ce558(0x147)],_0x454560[_0x7ce558(0x12e)],_0x454560[_0x7ce558(0x131)]),'userName':_0x454560['userName'],'nickname':pickFirst(_0x454560['nickname'],_0x454560[_0x7ce558(0x15c)]),'nickName':_0x454560[_0x7ce558(0x15c)],'tenantCode':_0x454560[_0x7ce558(0x180)],'employeeId':_0x454560[_0x7ce558(0x183)]};}function usesRuntimeContext(_0x48365d){const _0x50e5e6=a39_0x5f2c;return _0x48365d[_0x50e5e6(0x13e)]['some'](_0x28cb90=>typeof _0x28cb90[_0x50e5e6(0x121)]===_0x50e5e6(0x144)&&(_0x28cb90[_0x50e5e6(0x121)][_0x50e5e6(0x145)](_0x50e5e6(0x127))||_0x28cb90[_0x50e5e6(0x121)][_0x50e5e6(0x145)](_0x50e5e6(0x16a))));}function pickFirst(..._0x12830a){const _0x14e981=a39_0x5f2c;return _0x12830a[_0x14e981(0x172)](_0x19b997=>_0x19b997!==undefined&&_0x19b997!==null);}async function executePlan(_0x1fb642,_0x4ef8fc,_0x1fdba6){const _0x3c99f0=a39_0x5f2c;if(_0x1fb642[_0x3c99f0(0x173)]==='data'){const _0xe901d1=await resolveDatasetCode(_0x1fb642,_0x4ef8fc,_0x1fdba6);return executeData(_0xe901d1,_0x1fb642[_0x3c99f0(0x123)],_0x1fb642[_0x3c99f0(0x134)]);}if(_0x1fb642[_0x3c99f0(0x173)]===_0x3c99f0(0x140)){if(!_0x1fb642[_0x3c99f0(0x13f)])throw CliErrors[_0x3c99f0(0x132)](_0x3c99f0(0x164)+_0x4ef8fc[_0x3c99f0(0x137)]+_0x3c99f0(0x128));return executeSdkSql(_0x1fb642[_0x3c99f0(0x13f)],normalizeScalarParams(_0x1fb642[_0x3c99f0(0x134)]));}if(_0x1fb642[_0x3c99f0(0x173)]==='bff'){const _0x533562=_0x1fb642[_0x3c99f0(0x155)]||_0x1fb642[_0x3c99f0(0x14e)]||(_0x1fb642['bffId']==null?'':String(_0x1fb642[_0x3c99f0(0x124)]));if(!_0x533562)throw CliErrors[_0x3c99f0(0x132)](_0x3c99f0(0x164)+_0x4ef8fc[_0x3c99f0(0x137)]+'\x20requires\x20target.functionName.');return executeSdkBff(_0x533562,_0x1fb642[_0x3c99f0(0x134)]);}throw CliErrors['validation'](_0x3c99f0(0x185)+_0x1fb642[_0x3c99f0(0x173)]);}async function resolveDatasetCode(_0x22b24e,_0x3a92af,_0x1c2b86){const _0x1f3d8b=a39_0x5f2c;if(_0x22b24e['datasetCode'])return _0x22b24e[_0x1f3d8b(0x166)];if(!_0x22b24e[_0x1f3d8b(0x148)])throw CliErrors['validation'](_0x1f3d8b(0x164)+_0x3a92af[_0x1f3d8b(0x137)]+_0x1f3d8b(0x154));const _0x248f06=await listDatasets(_0x1c2b86['appCode']),_0x2a4efd=_0x248f06['find'](_0xd9783e=>_0xd9783e[_0x1f3d8b(0x181)]?.[_0x1f3d8b(0x12f)]===_0x22b24e[_0x1f3d8b(0x148)]);if(!_0x2a4efd?.['code'])throw CliErrors['validation'](_0x1f3d8b(0x14f)+_0x22b24e[_0x1f3d8b(0x148)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x1c2b86[_0x1f3d8b(0x176)]+'.',_0x1f3d8b(0x15b));return _0x2a4efd[_0x1f3d8b(0x16b)];}function applyAppBinding(_0x426d93,_0x404e0d,_0xbe68c1){const _0x536782=a39_0x5f2c,_0x3e4ccd=_0x404e0d['target'][_0x536782(0x18b)];if(!_0x3e4ccd)return;const _0x3ce0d3=_0x426d93[_0x536782(0x141)][_0x3e4ccd];if(!_0x3ce0d3)throw CliErrors['validation'](_0x536782(0x12d)+_0x3e4ccd+_0x536782(0x133)+_0x404e0d[_0x536782(0x137)]+'.',_0x536782(0x18d));const _0x37b29f=_0x3ce0d3['appcode']||_0x3ce0d3['appCode'];_0x37b29f&&!hasText(_0xbe68c1[_0x536782(0x17a)])&&(_0xbe68c1['appcode']=_0x37b29f),_0x3ce0d3['app']&&!hasText(_0xbe68c1['app'])&&!hasText(_0xbe68c1[_0x536782(0x17a)])&&(_0xbe68c1[_0x536782(0x15a)]=_0x3ce0d3[_0x536782(0x15a)]),_0x3ce0d3[_0x536782(0x165)]&&!hasText(_0xbe68c1['env'])&&(_0xbe68c1[_0x536782(0x165)]=_0x3ce0d3[_0x536782(0x165)]);}function renderDynamicCommandHelp(_0x2d3e12){const _0x450f96=a39_0x5f2c,_0x389a1a=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x450f96(0x139)+_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x173)],'\x20\x20\x20\x20command:\x20'+_0x2d3e12['target'][_0x450f96(0x123)]];if(_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x166)])_0x389a1a[_0x450f96(0x159)](_0x450f96(0x161)+_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x166)]);if(_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x148)])_0x389a1a['push']('\x20\x20\x20\x20datatable:\x20'+_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x148)]);if(_0x2d3e12[_0x450f96(0x15d)]['sqlCode'])_0x389a1a[_0x450f96(0x159)](_0x450f96(0x18a)+_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x13f)]);if(_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x155)])_0x389a1a[_0x450f96(0x159)](_0x450f96(0x13a)+_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x155)]);if(_0x2d3e12['mapTo'][_0x450f96(0x152)]>0x0){_0x389a1a[_0x450f96(0x159)]('',_0x450f96(0x143));for(const _0x123a41 of _0x2d3e12[_0x450f96(0x13e)]){_0x389a1a[_0x450f96(0x159)](_0x450f96(0x184)+(_0x123a41[_0x450f96(0x121)]||_0x450f96(0x17d))+_0x450f96(0x187)+_0x123a41[_0x450f96(0x15d)]+(_0x123a41[_0x450f96(0x14a)]?'.'+_0x123a41[_0x450f96(0x14a)]:''));}}return _0x389a1a['join']('\x0a');}function targetPreview(_0x3b10d8){const _0x22ec57=a39_0x5f2c;return{'kind':_0x3b10d8[_0x22ec57(0x173)],'command':_0x3b10d8[_0x22ec57(0x123)],'appRef':_0x3b10d8['appRef'],'datasetCode':_0x3b10d8[_0x22ec57(0x166)],'datatable':_0x3b10d8[_0x22ec57(0x148)],'sqlCode':_0x3b10d8['sqlCode'],'bffCode':_0x3b10d8[_0x22ec57(0x14e)],'bffId':_0x3b10d8['bffId'],'functionName':_0x3b10d8['scriptName']};}function normalizeScalarParams(_0x51924d){const _0x1ad57f=a39_0x5f2c;return Object[_0x1ad57f(0x14d)](Object[_0x1ad57f(0x18c)](_0x51924d)[_0x1ad57f(0x149)](([,_0x1e46f])=>typeof _0x1e46f==='string'||typeof _0x1e46f===_0x1ad57f(0x167)));}function a39_0x14ef(){const _0x1c87f8=['userId','5587292WfOwYK','cliPath','boolean','\x20\x20\x20\x20kind:\x20\x20\x20\x20','\x20\x20\x20\x20functionName:\x20','padEnd','join','fullPath','mapTo','sqlCode','sql','appBindings','normalizedManifest','\x20\x20MAP\x20TO','string','startsWith','default','username','datatable','filter','operator','args','service','fromEntries','bffCode','Cannot\x20resolve\x20datatable\x20\x22','22970035vcFpeo','high-risk-write','length','name','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','scriptName','5uPtLGf','145147RpIumF','type','push','app','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','nickName','target','1545177tbiaxu','rawFlags','read','\x20\x20\x20\x20datasetCode:\x20','flags','`\x20to\x20inspect\x20the\x20manifest.','Service\x20command\x20','env','datasetCode','number','Preview\x20dynamic\x20service\x20command:\x20','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','ctx.','code','json','Commands:','risk','473848mbMgNu','tree','21470cbGPlc','find','kind','commands','description','appCode','22jgoori','将通过\x20Service\x20Tree\x20执行“','Use\x20`','appcode','3015QHTQHb','cliName','const','\x20service\x20detail\x20--service\x20','required','tenantCode','dbtableConfig','\x20completed\x20in\x20','employeeId','\x20\x20\x20\x20','Unsupported\x20service\x20target\x20kind:\x20','572172MgUMhH','\x20->\x20','Run\x20service\x20command\x20','slice','\x20\x20\x20\x20sqlCode:\x20','appRef','entries','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','source','envName','command','bffId','\x20<command>\x20[flags]','map','context.','\x20requires\x20target.sqlCode.','SERVICE_TREE','remainingArgs','trim','35XEOgHc','Unknown\x20appRef\x20\x22','userName','tableName','now','loginName','validation','\x22\x20in\x20service\x20command\x20','params'];a39_0x14ef=function(){return _0x1c87f8;};return a39_0x14ef();}function a39_0x5f2c(_0x125647,_0x5e3497){_0x125647=_0x125647-0x121;const _0x14ef30=a39_0x14ef();let _0x5f2c7a=_0x14ef30[_0x125647];return _0x5f2c7a;}function hasText(_0x47ae55){const _0x186983=a39_0x5f2c;return typeof _0x47ae55===_0x186983(0x144)&&_0x47ae55[_0x186983(0x12b)]()[_0x186983(0x152)]>0x0;}function isPrimitiveFlagDefault(_0x3693a9){const _0x139d86=a39_0x5f2c;return _0x3693a9===undefined||typeof _0x3693a9===_0x139d86(0x144)||typeof _0x3693a9==='number'||typeof _0x3693a9===_0x139d86(0x138);}
@@ -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(_0x31e025,_0x4438c7){const _0x305bba=a40_0x3a0f,_0x3962ba=_0x31e025();while(!![]){try{const _0x2cf375=-parseInt(_0x305bba(0x1f0))/0x1+-parseInt(_0x305bba(0x1d7))/0x2+-parseInt(_0x305bba(0x1db))/0x3*(-parseInt(_0x305bba(0x1dc))/0x4)+parseInt(_0x305bba(0x1eb))/0x5+parseInt(_0x305bba(0x1f6))/0x6+parseInt(_0x305bba(0x1ef))/0x7*(-parseInt(_0x305bba(0x1f4))/0x8)+parseInt(_0x305bba(0x1e5))/0x9;if(_0x2cf375===_0x4438c7)break;else _0x3962ba['push'](_0x3962ba['shift']());}catch(_0x32b03d){_0x3962ba['push'](_0x3962ba['shift']());}}}(a40_0x5e80,0xeb36f));export function adaptServiceTreeManifestForLegacyFramework(_0x3db387){const _0x30be08=a40_0x3a0f,_0x138a2a=cloneJsonValue(_0x3db387),_0x1d2832=[];if(!isObjectRecord(_0x138a2a))return{'manifest':_0x138a2a,'errors':_0x1d2832};return Array[_0x30be08(0x1e3)](_0x138a2a[_0x30be08(0x1e0)])&&_0x138a2a['commands'][_0x30be08(0x1ec)]((_0x396d88,_0xee361d)=>{const _0x13105c=_0x30be08;if(!isObjectRecord(_0x396d88))return;adaptBffTarget(_0x396d88[_0x13105c(0x1d8)],_0x13105c(0x1e6)+_0xee361d+_0x13105c(0x1df),_0x1d2832);}),adaptResources(_0x138a2a[_0x30be08(0x1ed)],_0x30be08(0x1f2),_0x1d2832),{'manifest':_0x138a2a,'errors':_0x1d2832};}export function toPublicServiceTreeTarget(_0x5c5b25){const _0x45d9b2=a40_0x3a0f,{scriptName:_0x16b6b7,..._0x440ac2}=_0x5c5b25;return typeof _0x16b6b7===_0x45d9b2(0x1ee)&&_0x16b6b7['trim']()&&(_0x440ac2[_0x45d9b2(0x1d6)]=_0x16b6b7),_0x440ac2;}export function toPublicNormalizedServiceTree(_0x2e94e8){const _0xc26c5c=a40_0x3a0f;return{..._0x2e94e8,'commands':_0x2e94e8[_0xc26c5c(0x1e0)][_0xc26c5c(0x1f7)](_0x1a8a5a=>({..._0x1a8a5a,'target':toPublicServiceTreeTarget(_0x1a8a5a[_0xc26c5c(0x1d8)])}))};}function adaptResources(_0x4f75ba,_0xc20c49,_0x2f4fdc){const _0x2f032e=a40_0x3a0f;if(!isObjectRecord(_0x4f75ba))return;for(const [_0x1b48bb,_0xb4f49]of Object[_0x2f032e(0x1f3)](_0x4f75ba)){if(!isObjectRecord(_0xb4f49))continue;const _0x3bb26e=_0xc20c49+'.'+_0x1b48bb;if(isObjectRecord(_0xb4f49['actions']))for(const [_0x2affc4,_0x51f032]of Object[_0x2f032e(0x1f3)](_0xb4f49[_0x2f032e(0x1e2)])){if(!isObjectRecord(_0x51f032))continue;const _0x205ff3=_0x3bb26e+'.actions.'+_0x2affc4,_0x5a7739=isObjectRecord(_0x51f032['target'])&&_0x51f032[_0x2f032e(0x1d8)][_0x2f032e(0x1f1)]===_0x2f032e(0x1de);adaptBffTarget(_0x51f032['target'],_0x205ff3+_0x2f032e(0x1d5),_0x2f4fdc),(_0x5a7739||isBffAction(_0x51f032))&&adaptFunctionNameField(_0x51f032,_0x205ff3,_0x2f4fdc);}adaptResources(_0xb4f49[_0x2f032e(0x1ed)],_0x3bb26e+'.resources',_0x2f4fdc);}}function a40_0x5e80(){const _0x28c1d9=['target','bff.exec','trim','1073505ERgDWz','4fjrBBO','object','bff','].target','commands','action','actions','isArray','error','14696271RprgQv','$.commands[','push','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','call','prototype','3844865KxQKsi','forEach','resources','string','1415785DzwHXs','1575596yAcULK','kind','$.resources','entries','24WbVZPl','functionName\x20must\x20be\x20a\x20non-empty\x20string.','5094540kkVzmO','map','hasOwnProperty','scriptName','.target','functionName','926034owItMz'];a40_0x5e80=function(){return _0x28c1d9;};return a40_0x5e80();}function a40_0x3a0f(_0x2fbc73,_0x35a109){_0x2fbc73=_0x2fbc73-0x1d5;const _0x5e800d=a40_0x5e80();let _0x3a0f3f=_0x5e800d[_0x2fbc73];return _0x3a0f3f;}function adaptBffTarget(_0xa561c9,_0xb1ebf0,_0x38f0df){const _0x3835a4=a40_0x3a0f;if(!isObjectRecord(_0xa561c9)||_0xa561c9[_0x3835a4(0x1f1)]!==_0x3835a4(0x1de))return;adaptFunctionNameField(_0xa561c9,_0xb1ebf0,_0x38f0df);}function adaptFunctionNameField(_0x3769c9,_0x38dce5,_0x625cdf){const _0x435ca6=a40_0x3a0f;Object['prototype'][_0x435ca6(0x1f8)][_0x435ca6(0x1e9)](_0x3769c9,_0x435ca6(0x1f9))&&_0x625cdf[_0x435ca6(0x1e7)]({'level':_0x435ca6(0x1e4),'path':_0x38dce5+'.scriptName','message':_0x435ca6(0x1e8)});if(Object[_0x435ca6(0x1ea)][_0x435ca6(0x1f8)][_0x435ca6(0x1e9)](_0x3769c9,'functionName')){if(typeof _0x3769c9[_0x435ca6(0x1d6)]!==_0x435ca6(0x1ee)||!_0x3769c9[_0x435ca6(0x1d6)][_0x435ca6(0x1da)]()){_0x625cdf[_0x435ca6(0x1e7)]({'level':_0x435ca6(0x1e4),'path':_0x38dce5+'.functionName','message':_0x435ca6(0x1f5)}),delete _0x3769c9[_0x435ca6(0x1d6)];return;}_0x3769c9[_0x435ca6(0x1f9)]=_0x3769c9[_0x435ca6(0x1d6)],delete _0x3769c9[_0x435ca6(0x1d6)];}}function isBffAction(_0xe550a4){const _0x24e88a=a40_0x3a0f;return _0xe550a4[_0x24e88a(0x1f1)]===_0x24e88a(0x1de)||_0xe550a4[_0x24e88a(0x1e1)]===_0x24e88a(0x1d9)||_0xe550a4[_0x24e88a(0x1d8)]==='bff.exec';}function cloneJsonValue(_0x45ce83){const _0x1fc786=a40_0x3a0f;if(Array[_0x1fc786(0x1e3)](_0x45ce83))return _0x45ce83[_0x1fc786(0x1f7)](_0x3db5a0=>cloneJsonValue(_0x3db5a0));if(isObjectRecord(_0x45ce83))return Object['fromEntries'](Object[_0x1fc786(0x1f3)](_0x45ce83)[_0x1fc786(0x1f7)](([_0x558f77,_0x12ea43])=>[_0x558f77,cloneJsonValue(_0x12ea43)]));return _0x45ce83;}function isObjectRecord(_0x2e54af){const _0x233ea1=a40_0x3a0f;return Boolean(_0x2e54af)&&typeof _0x2e54af===_0x233ea1(0x1dd)&&!Array[_0x233ea1(0x1e3)](_0x2e54af);}
@@ -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_0x336e73=a41_0x2531;(function(_0x1a79fd,_0x1e6e79){const _0x236bf5=a41_0x2531,_0x3a0110=_0x1a79fd();while(!![]){try{const _0x8a1893=parseInt(_0x236bf5(0xe9))/0x1*(-parseInt(_0x236bf5(0xed))/0x2)+parseInt(_0x236bf5(0xe6))/0x3+-parseInt(_0x236bf5(0xf4))/0x4+parseInt(_0x236bf5(0x122))/0x5+-parseInt(_0x236bf5(0xfe))/0x6*(-parseInt(_0x236bf5(0x113))/0x7)+-parseInt(_0x236bf5(0x105))/0x8*(parseInt(_0x236bf5(0xfd))/0x9)+parseInt(_0x236bf5(0x109))/0xa*(parseInt(_0x236bf5(0x10f))/0xb);if(_0x8a1893===_0x1e6e79)break;else _0x3a0110['push'](_0x3a0110['shift']());}catch(_0x4ab444){_0x3a0110['push'](_0x3a0110['shift']());}}}(a41_0x3ced,0x7ab2b));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_0x336e73(0x106),'type':a41_0x336e73(0x11d),'required':!![],'description':a41_0x336e73(0xf0)},SERVICE_FLAG={'name':'service','type':a41_0x336e73(0x11d),'required':!![],'description':a41_0x336e73(0xea),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x336e73(0x10c)}};function summarizeService(_0xfea7af){const _0x22d023=a41_0x336e73;return{'serviceCode':_0xfea7af[_0x22d023(0xec)],'name':_0xfea7af[_0x22d023(0x104)][_0x22d023(0x10d)][_0x22d023(0x10e)],'version':_0xfea7af[_0x22d023(0x123)],'importedAt':_0xfea7af['importedAt'],'source':_0xfea7af[_0x22d023(0x128)],'commandCount':_0xfea7af[_0x22d023(0x104)][_0x22d023(0x11b)][_0x22d023(0xef)],'commands':_0xfea7af[_0x22d023(0x104)][_0x22d023(0x11b)][_0x22d023(0xfa)](_0x4e0d4c=>({'path':_0x4e0d4c[_0x22d023(0xf6)],'description':_0x4e0d4c['description'],'risk':_0x4e0d4c[_0x22d023(0x11a)],'target':toPublicServiceTreeTarget(_0x4e0d4c['target']),'flags':_0x4e0d4c[_0x22d023(0xf5)]['map'](_0x4503e5=>({'name':_0x4503e5[_0x22d023(0x10e)],'cliName':_0x4503e5['cliName'],'type':_0x4503e5[_0x22d023(0xe1)],'required':_0x4503e5[_0x22d023(0x112)]===!![]}))}))};}function summarizeLoadedManifest(_0x3caf01){const _0x467024=a41_0x336e73;return{'service':_0x3caf01['normalizedManifest']?.[_0x467024(0x10d)],'version':_0x3caf01[_0x467024(0x104)]?.[_0x467024(0x123)],'commandCount':_0x3caf01[_0x467024(0x104)]?.[_0x467024(0x11b)]['length']??0x0,'commands':_0x3caf01[_0x467024(0x104)]?.[_0x467024(0x11b)]['map'](_0x31d069=>({'path':_0x31d069[_0x467024(0xf6)],'risk':_0x31d069[_0x467024(0x11a)],'target':toPublicServiceTreeTarget(_0x31d069[_0x467024(0xe7)])}))??[],'registryIndex':_0x3caf01['registryIndex'],'registryServiceCode':_0x3caf01[_0x467024(0xe2)],'errors':_0x3caf01['report'][_0x467024(0x10b)],'warnings':_0x3caf01[_0x467024(0x127)][_0x467024(0x116)]};}export const serviceDefinitions=[{'service':a41_0x336e73(0x10d),'command':a41_0x336e73(0xff),'description':a41_0x336e73(0x100),'risk':a41_0x336e73(0x125),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x12169e){const _0x2bb91f=a41_0x336e73,_0x25734c=loadServiceManifestFromFile(_0x12169e['str'](_0x2bb91f(0x106)));if(!_0x25734c[_0x2bb91f(0x127)]['ok'])return{'ok':![],'data':{'file':_0x25734c[_0x2bb91f(0xf3)],'hash':_0x25734c[_0x2bb91f(0xf1)],'kind':_0x25734c[_0x2bb91f(0x11f)],'serviceCount':_0x25734c[_0x2bb91f(0x124)][_0x2bb91f(0xef)],'services':_0x25734c['manifests'][_0x2bb91f(0xfa)](summarizeLoadedManifest),'errors':_0x25734c[_0x2bb91f(0x127)][_0x2bb91f(0x10b)],'warnings':_0x25734c[_0x2bb91f(0x127)][_0x2bb91f(0x116)]},'message':formatValidationFailure(_0x25734c[_0x2bb91f(0x127)])};if(_0x25734c[_0x2bb91f(0x11f)]==='registry'||_0x25734c['manifests']['length']!==0x1)return{'ok':!![],'data':{'file':_0x25734c['filePath'],'hash':_0x25734c[_0x2bb91f(0xf1)],'kind':_0x25734c[_0x2bb91f(0x11f)],'serviceCount':_0x25734c[_0x2bb91f(0x124)][_0x2bb91f(0xef)],'commandCount':_0x25734c[_0x2bb91f(0x124)][_0x2bb91f(0xe4)]((_0xdb4a00,_0x4645c6)=>_0xdb4a00+(_0x4645c6[_0x2bb91f(0x104)]?.[_0x2bb91f(0x11b)][_0x2bb91f(0xef)]??0x0),0x0),'services':_0x25734c[_0x2bb91f(0x124)]['map'](summarizeLoadedManifest),'warnings':_0x25734c['report'][_0x2bb91f(0x116)]},'message':_0x2bb91f(0xf8)};return{'ok':!![],'data':{'file':_0x25734c[_0x2bb91f(0xf3)],'hash':_0x25734c['hash'],'kind':_0x25734c['kind'],'service':_0x25734c[_0x2bb91f(0x104)]?.['service'],'version':_0x25734c['normalizedManifest']?.[_0x2bb91f(0x123)],'commandCount':_0x25734c['normalizedManifest']?.[_0x2bb91f(0x11b)][_0x2bb91f(0xef)]??0x0,'commands':_0x25734c[_0x2bb91f(0x104)]?.['commands'][_0x2bb91f(0xfa)](_0x3ad0f0=>({'path':_0x3ad0f0['cliPath'],'risk':_0x3ad0f0[_0x2bb91f(0x11a)],'target':toPublicServiceTreeTarget(_0x3ad0f0[_0x2bb91f(0xe7)])})),'warnings':_0x25734c['report'][_0x2bb91f(0x116)]},'message':_0x2bb91f(0xf2)};}},{'service':a41_0x336e73(0x10d),'command':a41_0x336e73(0x102),'description':a41_0x336e73(0x117),'risk':'write','confirmationDescription':a41_0x336e73(0x10a),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x37445e){const _0x2d851b=a41_0x336e73,_0x48c167=loadServiceManifestFromFile(_0x37445e[_0x2d851b(0x11e)]('file'));return{'method':_0x2d851b(0xe3),'url':getServiceRegistryPath(),'body':{'file':_0x48c167[_0x2d851b(0xf3)],'hash':_0x48c167[_0x2d851b(0xf1)],'kind':_0x48c167[_0x2d851b(0x11f)],'ok':_0x48c167[_0x2d851b(0x127)]['ok'],'service':_0x48c167['normalizedManifest']?.[_0x2d851b(0x10d)],'version':_0x48c167[_0x2d851b(0x104)]?.['version'],'serviceCount':_0x48c167[_0x2d851b(0x124)][_0x2d851b(0xef)],'services':_0x48c167[_0x2d851b(0x124)][_0x2d851b(0xfa)](_0x18e65b=>({'service':_0x18e65b[_0x2d851b(0x104)]?.['service'],'version':_0x18e65b[_0x2d851b(0x104)]?.[_0x2d851b(0x123)],'commandCount':_0x18e65b['normalizedManifest']?.[_0x2d851b(0x11b)][_0x2d851b(0xef)]??0x0,'errors':_0x18e65b[_0x2d851b(0x127)]['errors']})),'errors':_0x48c167[_0x2d851b(0x127)][_0x2d851b(0x10b)],'commandCount':_0x48c167['normalizedManifest']?.[_0x2d851b(0x11b)][_0x2d851b(0xef)]??0x0},'description':_0x2d851b(0xeb)};},async 'execute'(_0x5c0a9c){const _0x58b3d1=a41_0x336e73,_0x511e4a=importServiceManifest(_0x5c0a9c['str'](_0x58b3d1(0x106)));if(_0x511e4a[_0x58b3d1(0x108)][_0x58b3d1(0xef)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x511e4a['registryPath'],'imported':_0x511e4a[_0x58b3d1(0xe8)],'updated':_0x511e4a[_0x58b3d1(0x110)],'serviceCount':_0x511e4a[_0x58b3d1(0x11c)],'services':_0x511e4a[_0x58b3d1(0x108)][_0x58b3d1(0xfa)](summarizeService)},'message':'Imported\x20'+_0x511e4a[_0x58b3d1(0xe8)]+'\x20service(s),\x20updated\x20'+_0x511e4a[_0x58b3d1(0x110)]+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x511e4a[_0x58b3d1(0xf7)],'replaced':_0x511e4a[_0x58b3d1(0xe5)],'imported':_0x511e4a[_0x58b3d1(0xe8)],'updated':_0x511e4a[_0x58b3d1(0x110)],'serviceCount':_0x511e4a[_0x58b3d1(0x11c)],'service':summarizeService(_0x511e4a[_0x58b3d1(0xfc)])},'message':(_0x511e4a[_0x58b3d1(0xe5)]?_0x58b3d1(0x107):'Imported')+_0x58b3d1(0x120)+_0x511e4a['entry']['serviceCode']+'.'};}},{'service':a41_0x336e73(0x10d),'command':a41_0x336e73(0x103),'description':'将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','risk':a41_0x336e73(0x126),'confirmationDescription':a41_0x336e73(0x121),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x27d062){const _0x313185=a41_0x336e73,_0x5f1bd7=getLocalServiceEntry(_0x27d062[_0x313185(0x11e)](_0x313185(0x10d)));return{'method':'WRITE','url':_0x27d062[_0x313185(0x11e)](_0x313185(0x106)),'body':{'service':_0x27d062['str'](_0x313185(0x10d)),'found':Boolean(_0x5f1bd7),'version':_0x5f1bd7?.[_0x313185(0x123)],'source':_0x5f1bd7?.[_0x313185(0x128)]},'description':_0x313185(0xfb)};},async 'execute'(_0x59658c){const _0x4db5fb=a41_0x336e73,_0x4ffe3f=exportServiceManifest(_0x59658c[_0x4db5fb(0x11e)](_0x4db5fb(0x10d)),_0x59658c[_0x4db5fb(0x11e)](_0x4db5fb(0x106)));return{'ok':!![],'data':{'registryPath':_0x4ffe3f[_0x4db5fb(0xf7)],'file':_0x4ffe3f[_0x4db5fb(0xf3)],'service':summarizeService(_0x4ffe3f[_0x4db5fb(0xfc)])},'message':'Exported\x20service\x20'+_0x4ffe3f[_0x4db5fb(0xfc)][_0x4db5fb(0xec)]+'.'};}},{'service':a41_0x336e73(0x10d),'command':a41_0x336e73(0x119),'description':a41_0x336e73(0xee),'risk':a41_0x336e73(0x125),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x5743f6=a41_0x336e73,_0x4e0a1c=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x4e0a1c[_0x5743f6(0xef)],'services':_0x4e0a1c['map'](summarizeService)}};}},{'service':a41_0x336e73(0x10d),'command':a41_0x336e73(0xf9),'description':a41_0x336e73(0x111),'risk':a41_0x336e73(0x126),'confirmationDescription':a41_0x336e73(0x101),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x4ef1ea){const _0x7d6d7e=a41_0x336e73,_0x15a043=getLocalServiceEntry(_0x4ef1ea[_0x7d6d7e(0x11e)](_0x7d6d7e(0x10d)));return{'method':_0x7d6d7e(0xe3),'url':getServiceRegistryPath(),'body':{'service':_0x4ef1ea[_0x7d6d7e(0x11e)](_0x7d6d7e(0x10d)),'found':Boolean(_0x15a043),'version':_0x15a043?.[_0x7d6d7e(0x123)],'source':_0x15a043?.['source']},'description':_0x7d6d7e(0xe0)};},async 'execute'(_0x5bab0b){const _0x1f0b9f=a41_0x336e73,_0x257f69=removeServiceManifest(_0x5bab0b[_0x1f0b9f(0x11e)](_0x1f0b9f(0x10d)));return{'ok':!![],'data':{'registryPath':_0x257f69[_0x1f0b9f(0xf7)],'serviceCount':_0x257f69[_0x1f0b9f(0x11c)],'service':summarizeService(_0x257f69[_0x1f0b9f(0xfc)])},'message':'Removed\x20service\x20'+_0x257f69['entry'][_0x1f0b9f(0xec)]+'.'};}},{'service':a41_0x336e73(0x10d),'command':'detail','description':a41_0x336e73(0x114),'risk':a41_0x336e73(0x125),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0xb9c5a5){const _0x55b5e0=a41_0x336e73,_0x1fb37f=getLocalServiceEntry(_0xb9c5a5[_0x55b5e0(0x11e)](_0x55b5e0(0x10d)));if(!_0x1fb37f)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0xb9c5a5[_0x55b5e0(0x11e)]('service')},'message':_0x55b5e0(0x115)+_0xb9c5a5[_0x55b5e0(0x11e)](_0x55b5e0(0x10d))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x1fb37f),'manifest':_0x1fb37f[_0x55b5e0(0x118)],'normalizedManifest':toPublicNormalizedServiceTree(_0x1fb37f[_0x55b5e0(0x104)])}};}}];function a41_0x2531(_0x16458f,_0x352fdc){_0x16458f=_0x16458f-0xe0;const _0x3ceda5=a41_0x3ced();let _0x253194=_0x3ceda5[_0x16458f];return _0x253194;}function a41_0x3ced(){const _0x45d5e0=['将\x20Service\x20Tree\x20清单导入本地运行态注册表','manifest','list','risk','commands','serviceCount','string','str','kind','\x20service\x20','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','647475VAAZQW','version','manifests','read','write','report','source','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','type','registryServiceCode','WRITE','reduce','replaced','454251udnpfT','target','imported','22zhUfaN','Local\x20service\x20code,\x20for\x20example\x20crm','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','serviceCode','12092tgayYZ','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','length','Service\x20Tree\x20manifest\x20file\x20path','hash','Service\x20manifest\x20validation\x20passed.','filePath','3290220iQpzCi','flags','cliPath','registryPath','Service\x20registry\x20validation\x20passed.','remove','map','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','entry','9wQuDdA','6XLWuhX','validate','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','import','export','normalizedManifest','1373096nSnKSt','file','Updated','entries','150ThPvbU','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','errors','lower\x20kebab-case\x20service\x20code','service','name','368269pXDLKg','updated','从本地运行态注册表移除\x20Service\x20Tree\x20清单','required','5926746tnfeNE','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Local\x20service\x20not\x20found:\x20','warnings'];a41_0x3ced=function(){return _0x45d5e0;};return a41_0x3ced();}
@@ -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
+ (function(_0x1e9f7a,_0x2a9b81){const _0x4aebb9=a42_0x1d44,_0x1cbc8f=_0x1e9f7a();while(!![]){try{const _0x4cfcb4=-parseInt(_0x4aebb9(0xe4))/0x1+parseInt(_0x4aebb9(0xca))/0x2*(-parseInt(_0x4aebb9(0xdc))/0x3)+parseInt(_0x4aebb9(0xe8))/0x4+-parseInt(_0x4aebb9(0xe3))/0x5+-parseInt(_0x4aebb9(0x9d))/0x6*(-parseInt(_0x4aebb9(0x9e))/0x7)+-parseInt(_0x4aebb9(0xa7))/0x8+parseInt(_0x4aebb9(0xa2))/0x9;if(_0x4cfcb4===_0x2a9b81)break;else _0x1cbc8f['push'](_0x1cbc8f['shift']());}catch(_0x3f4c1c){_0x1cbc8f['push'](_0x1cbc8f['shift']());}}}(a42_0xabaa,0x406bf));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME='service.json';export function getServiceRegistryPath(_0x308314={}){const _0x691d91=a42_0x1d44;return resolve(_0x308314[_0x691d91(0xe0)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x24d7fc={}){const _0x486d40=a42_0x1d44,_0x14beb4=getServiceRegistryPath(_0x24d7fc);if(!existsSync(_0x14beb4))return emptyServiceRegistry();try{const _0x5d4987=readFileSync(_0x14beb4,_0x486d40(0xdd));if(!_0x5d4987[_0x486d40(0xc8)]())return emptyServiceRegistry();const _0x1f2876=JSON[_0x486d40(0xb9)](_0x5d4987);if(_0x1f2876['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation']('Unsupported\x20service\x20registry\x20schemaVersion:\x20'+String(_0x1f2876['schemaVersion']),'Remove\x20or\x20migrate\x20'+_0x14beb4+'.');if(!Array['isArray'](_0x1f2876[_0x486d40(0xc3)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1f2876[_0x486d40(0xb4)],'services':_0x1f2876[_0x486d40(0xc3)]};}catch(_0x505a61){if(_0x505a61 instanceof Error&&_0x505a61[_0x486d40(0xd6)]===_0x486d40(0xb2))throw _0x505a61;throw CliErrors[_0x486d40(0xa5)](_0x486d40(0xb3)+_0x14beb4,_0x486d40(0xc6));}}export function writeServiceRegistry(_0x13715b,_0x41a9da={}){const _0x15008=a42_0x1d44,_0x48abbe=getServiceRegistryPath(_0x41a9da),_0x1cc0fa=dirname(_0x48abbe);!existsSync(_0x1cc0fa)&&mkdirSync(_0x1cc0fa,{'recursive':!![]});const _0xb43917=_0x48abbe+'.tmp';try{writeFileSync(_0xb43917,JSON[_0x15008(0xe2)](_0x13715b,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0xb43917,_0x48abbe);}catch(_0x3ce0f2){try{unlinkSync(_0xb43917);}catch{}if(_0x3ce0f2?.[_0x15008(0xc2)]===_0x15008(0xeb))throw CliErrors[_0x15008(0xa5)]('Cannot\x20write\x20service\x20registry:\x20'+_0x48abbe);throw _0x3ce0f2;}return _0x48abbe;}export function loadServiceManifestFromFile(_0x572d0b){const _0x4e9fcf=a42_0x1d44,_0x5ba2e4=resolve(_0x572d0b);if(!existsSync(_0x5ba2e4))throw CliErrors[_0x4e9fcf(0xa5)]('Service\x20manifest\x20file\x20not\x20found:\x20'+_0x572d0b);let _0x5528a2;const _0x517765=readFileSync(_0x5ba2e4,'utf8');try{_0x5528a2=JSON[_0x4e9fcf(0xb9)](_0x517765);}catch{throw CliErrors[_0x4e9fcf(0xa5)](_0x4e9fcf(0xde)+_0x572d0b,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x4d4585=sha256(_0x517765),_0x5db4e6=extractLoadedServiceManifests(_0x5528a2,_0x4d4585),_0x1952d7=aggregateValidationReports(_0x5db4e6),_0x356e7e=_0x5db4e6[0x0];return{'filePath':_0x5ba2e4,'hash':_0x4d4585,'kind':isServiceRegistryLike(_0x5528a2)?'registry':_0x4e9fcf(0xb6),'manifest':_0x356e7e?.[_0x4e9fcf(0xb6)]??_0x5528a2,'report':_0x1952d7,'normalizedManifest':_0x5db4e6[_0x4e9fcf(0xe7)]===0x1?_0x356e7e?.[_0x4e9fcf(0xd2)]:undefined,'manifests':_0x5db4e6};}function a42_0x1d44(_0xb5a944,_0x1552ba){_0xb5a944=_0xb5a944-0x99;const _0xabaa28=a42_0xabaa();let _0x1d447e=_0xabaa28[_0xb5a944];return _0x1d447e;}export function importServiceManifest(_0x48eeb9,_0x2f26e9={}){const _0x4a28fa=a42_0x1d44,_0x300e0e=loadServiceManifestFromFile(_0x48eeb9);if(!_0x300e0e[_0x4a28fa(0xc0)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0x300e0e[_0x4a28fa(0xc0)]),_0x4a28fa(0xd4));if(_0x300e0e[_0x4a28fa(0xa8)][_0x4a28fa(0xe7)]===0x0)throw CliErrors[_0x4a28fa(0xa5)](_0x4a28fa(0xda),'Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.');const _0x33eed4=readServiceRegistry(_0x2f26e9),_0xf4c6e0=(_0x2f26e9['now']??(()=>new Date()))()[_0x4a28fa(0xa3)](),_0x226766=[];let _0x83bcf6=0x0,_0x444ec5=0x0;for(const _0x234afc of _0x300e0e[_0x4a28fa(0xa8)]){if(!_0x234afc[_0x4a28fa(0xd2)])continue;const _0xba05c6=_0x234afc[_0x4a28fa(0xd2)][_0x4a28fa(0x9c)][_0x4a28fa(0xc2)],_0x124681={'serviceCode':_0xba05c6,'version':_0x234afc[_0x4a28fa(0xd2)][_0x4a28fa(0xdf)],'importedAt':_0xf4c6e0,'source':{'type':'file','path':_0x300e0e[_0x4a28fa(0xd1)],'hash':_0x234afc[_0x4a28fa(0xe5)]},'manifest':_0x234afc[_0x4a28fa(0xb6)],'normalizedManifest':_0x234afc[_0x4a28fa(0xd2)]},_0x6889f1=_0x33eed4[_0x4a28fa(0xc3)][_0x4a28fa(0xb5)](_0x4a276b=>_0x4a276b[_0x4a28fa(0xd9)]===_0xba05c6);_0x6889f1>=0x0?(_0x33eed4['services'][_0x6889f1]=_0x124681,_0x444ec5++):(_0x33eed4[_0x4a28fa(0xc3)][_0x4a28fa(0xbe)](_0x124681),_0x83bcf6++),_0x226766[_0x4a28fa(0xbe)](_0x124681);}_0x33eed4[_0x4a28fa(0xc3)][_0x4a28fa(0x99)]((_0xa03eda,_0x32365a)=>_0xa03eda[_0x4a28fa(0xd9)][_0x4a28fa(0xa4)](_0x32365a[_0x4a28fa(0xd9)])),_0x33eed4[_0x4a28fa(0xb4)]=_0xf4c6e0;const _0x29c283=writeServiceRegistry(_0x33eed4,_0x2f26e9);return{'registryPath':_0x29c283,'entry':_0x226766[0x0],'replaced':_0x226766[_0x4a28fa(0xe7)]===0x1?_0x444ec5===0x1:_0x444ec5>0x0,'entries':_0x226766,'imported':_0x83bcf6,'updated':_0x444ec5,'serviceCount':_0x33eed4[_0x4a28fa(0xc3)][_0x4a28fa(0xe7)]};}export function exportServiceManifest(_0x2788a7,_0x34fbd4,_0x4f29e0={}){const _0x62d72d=a42_0x1d44,_0x1f03b9=getServiceRegistryPath(_0x4f29e0),_0x1f58c0=getLocalServiceEntry(_0x2788a7,_0x4f29e0);if(!_0x1f58c0)throw CliErrors[_0x62d72d(0xa5)](_0x62d72d(0xa0)+_0x2788a7,_0x62d72d(0xcb));const _0x47e0af=resolve(_0x34fbd4),_0x38f095=dirname(_0x47e0af);return!existsSync(_0x38f095)&&mkdirSync(_0x38f095,{'recursive':!![]}),writeFileSync(_0x47e0af,JSON['stringify'](_0x1f58c0[_0x62d72d(0xb6)],null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),{'registryPath':_0x1f03b9,'filePath':_0x47e0af,'entry':_0x1f58c0};}export function removeServiceManifest(_0x5981f2,_0x44764a={}){const _0x4255e2=a42_0x1d44,_0x2d2c54=readServiceRegistry(_0x44764a),_0x892440=_0x5981f2[_0x4255e2(0xc8)](),_0x10098e=_0x2d2c54[_0x4255e2(0xc3)][_0x4255e2(0xb5)](_0x4f0597=>_0x4f0597[_0x4255e2(0xd9)]===_0x892440);if(_0x10098e<0x0)throw CliErrors[_0x4255e2(0xa5)](_0x4255e2(0xa0)+_0x892440,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x3bbf15]=_0x2d2c54[_0x4255e2(0xc3)][_0x4255e2(0xd3)](_0x10098e,0x1),_0x363cb1=(_0x44764a['now']??(()=>new Date()))()['toISOString']();_0x2d2c54[_0x4255e2(0xb4)]=_0x363cb1;const _0x2a9f3f=writeServiceRegistry(_0x2d2c54,_0x44764a);return{'registryPath':_0x2a9f3f,'entry':_0x3bbf15,'serviceCount':_0x2d2c54[_0x4255e2(0xc3)]['length']};}export function listLocalServices(_0x12d56d={}){const _0xd8506e=a42_0x1d44;return readServiceRegistry(_0x12d56d)[_0xd8506e(0xc3)];}export function getLocalServiceEntry(_0x2c698c,_0x3f621f={}){const _0x31436d=a42_0x1d44;return readServiceRegistry(_0x3f621f)[_0x31436d(0xc3)][_0x31436d(0xc1)](_0x14afac=>_0x14afac[_0x31436d(0xd9)]===_0x2c698c[_0x31436d(0xc8)]());}export function listLocalServiceTrees(_0xb8edfc={}){const _0x343c84=a42_0x1d44;return readServiceRegistry(_0xb8edfc)[_0x343c84(0xc3)]['map'](_0x212330=>_0x212330[_0x343c84(0xd2)]);}export function inspectServiceRegistry(_0x23b90c={}){const _0xb052d6=a42_0x1d44,_0x1e22d2=getServiceRegistryPath(_0x23b90c);if(!existsSync(_0x1e22d2))return emptyServiceRegistryInspection(_0x1e22d2,_0xb052d6(0xd0),![]);try{const _0x114a6f=readFileSync(_0x1e22d2,_0xb052d6(0xdd));if(!_0x114a6f[_0xb052d6(0xc8)]())return emptyServiceRegistryInspection(_0x1e22d2,_0xb052d6(0xc9),!![]);const _0x576d09=JSON[_0xb052d6(0xb9)](_0x114a6f);if(_0x576d09[_0xb052d6(0xc7)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x1e22d2,_0xb052d6(0xb1),!![]),'schemaVersion':_0x576d09[_0xb052d6(0xc7)],'message':_0xb052d6(0xc4)+String(_0x576d09['schemaVersion'])};if(!Array[_0xb052d6(0xba)](_0x576d09[_0xb052d6(0xc3)]))return{...emptyServiceRegistryInspection(_0x1e22d2,_0xb052d6(0xb1),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x576d09['updatedAt'],'message':_0xb052d6(0xbd)};const _0x2010de=_0x576d09[_0xb052d6(0xc3)][_0xb052d6(0xd8)](summarizeLocalServiceEntry);return{'registryPath':_0x1e22d2,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x576d09[_0xb052d6(0xb4)],'serviceCount':_0x2010de[_0xb052d6(0xe7)],'commandCount':_0x2010de[_0xb052d6(0xe6)]((_0x1a0c7f,_0x159326)=>_0x1a0c7f+_0x159326[_0xb052d6(0xcc)],0x0),'services':_0x2010de};}catch(_0x261770){return{...emptyServiceRegistryInspection(_0x1e22d2,_0xb052d6(0xb1),!![]),'message':_0x261770 instanceof Error?_0x261770[_0xb052d6(0xb0)]:String(_0x261770)};}}export function formatValidationFailure(_0x44fb58){const _0x217047=a42_0x1d44,_0x41207d=_0x44fb58[_0x217047(0x9f)]['map'](_0x2672e0=>_0x2672e0[_0x217047(0xc5)]+':\x20'+_0x2672e0[_0x217047(0xb0)]);return _0x217047(0xea)+_0x41207d[_0x217047(0xe9)]('\x0a');}function extractLoadedServiceManifests(_0x2b7262,_0x11c8fa){const _0x340192=a42_0x1d44;if(!isServiceRegistryLike(_0x2b7262)){const _0x2c66c3=_0x2b7262,{manifest:_0x194d08,errors:_0x4a8e10}=adaptServiceTreeManifestForLegacyFramework(_0x2c66c3),_0x3e6035=validateServiceTreeManifest(_0x194d08),_0x5269a3=mergeValidationErrors(_0x3e6035,_0x4a8e10);return[{'manifest':_0x2c66c3,'report':_0x5269a3,'normalizedManifest':_0x5269a3['ok']?normalizeServiceTreeManifest(_0x194d08):undefined,'sourceHash':_0x11c8fa}];}return _0x2b7262[_0x340192(0xc3)][_0x340192(0xd8)]((_0x2313b5,_0x1037a1)=>{const _0x3be4b2=_0x340192,_0x37c9d3=isObjectRecord(_0x2313b5)?_0x2313b5[_0x3be4b2(0xb6)]:undefined,{manifest:_0x40b752,errors:_0x3a5456}=adaptServiceTreeManifestForLegacyFramework(_0x37c9d3),_0x2b746b=validateServiceTreeManifest(_0x40b752),_0x3f22e9=mergeValidationErrors(_0x2b746b,_0x3a5456),_0x469d57=isObjectRecord(_0x2313b5)&&typeof _0x2313b5[_0x3be4b2(0xd9)]===_0x3be4b2(0xaf)?_0x2313b5[_0x3be4b2(0xd9)]:undefined;return{'manifest':_0x37c9d3,'report':_0x3f22e9,'normalizedManifest':_0x3f22e9['ok']?normalizeServiceTreeManifest(_0x40b752):undefined,'sourceHash':sha256(JSON[_0x3be4b2(0xe2)](_0x37c9d3,null,0x2)+'\x0a'),'registryIndex':_0x1037a1,'registryServiceCode':_0x469d57};});}function mergeValidationErrors(_0x1e06f0,_0x4ab970){const _0xd04a3e=a42_0x1d44,_0x5ee298=_0x1e06f0['errors'][_0xd04a3e(0xd8)](_0x17f9aa=>_0x17f9aa[_0xd04a3e(0xb0)]===_0xd04a3e(0xb7)?{..._0x17f9aa,'message':_0xd04a3e(0xaa)}:_0x17f9aa),_0x5a2c38=[..._0x4ab970,..._0x5ee298];return{'ok':_0x5a2c38[_0xd04a3e(0xe7)]===0x0,'errors':_0x5a2c38,'warnings':_0x1e06f0[_0xd04a3e(0xcf)]};}function aggregateValidationReports(_0x377321){const _0x17cc33=a42_0x1d44,_0x4809b9=_0x377321[_0x17cc33(0xbf)](_0x12c666=>_0x12c666['registryIndex']===undefined?_0x12c666[_0x17cc33(0xc0)][_0x17cc33(0x9f)]:_0x12c666[_0x17cc33(0xc0)][_0x17cc33(0x9f)][_0x17cc33(0xd8)](_0x26ab6f=>({..._0x26ab6f,'path':prefixRegistryIssuePath(_0x12c666[_0x17cc33(0xb8)],_0x26ab6f['path'])}))),_0x555f2e=_0x377321[_0x17cc33(0xbf)](_0x24f121=>_0x24f121['registryIndex']===undefined?_0x24f121[_0x17cc33(0xc0)][_0x17cc33(0xcf)]:_0x24f121[_0x17cc33(0xc0)]['warnings']['map'](_0x453f83=>({..._0x453f83,'path':prefixRegistryIssuePath(_0x24f121[_0x17cc33(0xb8)],_0x453f83[_0x17cc33(0xc5)])})));return{'ok':_0x4809b9[_0x17cc33(0xe7)]===0x0,'errors':_0x4809b9,'warnings':_0x555f2e};}function prefixRegistryIssuePath(_0x37d6d0,_0x42b847){const _0x373b48=a42_0x1d44;if(_0x42b847==='$')return _0x373b48(0xa6)+_0x37d6d0+_0x373b48(0xd7);if(_0x42b847[_0x373b48(0xbb)]('$.'))return _0x373b48(0xa6)+_0x37d6d0+'].manifest'+_0x42b847['slice'](0x1);if(_0x42b847['startsWith']('$['))return _0x373b48(0xa6)+_0x37d6d0+_0x373b48(0xd7)+_0x42b847[_0x373b48(0xa9)](0x1);return _0x373b48(0xa6)+_0x37d6d0+_0x373b48(0xd5)+_0x42b847;}function isServiceRegistryLike(_0x175528){const _0x34f97a=a42_0x1d44;return isObjectRecord(_0x175528)&&_0x175528[_0x34f97a(0xc7)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x34f97a(0xba)](_0x175528['services']);}function isObjectRecord(_0x485b4c){const _0x3c2baa=a42_0x1d44;return Boolean(_0x485b4c)&&typeof _0x485b4c===_0x3c2baa(0xab)&&!Array[_0x3c2baa(0xba)](_0x485b4c);}function emptyServiceRegistryInspection(_0x25313b,_0x512137,_0x138065){return{'registryPath':_0x25313b,'exists':_0x138065,'status':_0x512137,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x76fd29){const _0x1a2780=a42_0x1d44,_0xca4f37=_0x76fd29[_0x1a2780(0xd2)],_0x3887f7=_0xca4f37[_0x1a2780(0xad)][_0x1a2780(0xd8)](_0x3767a4=>({'path':_0x3767a4[_0x1a2780(0x9a)],'description':_0x3767a4[_0x1a2780(0xe1)],'risk':_0x3767a4['risk'],'targetKind':_0x3767a4[_0x1a2780(0xcd)][_0x1a2780(0xac)],'targetCommand':_0x3767a4['target'][_0x1a2780(0xbc)]}));return{'serviceCode':_0x76fd29[_0x1a2780(0xd9)],'name':_0xca4f37[_0x1a2780(0x9c)]['name'],'description':_0xca4f37['service'][_0x1a2780(0xe1)],'version':_0x76fd29[_0x1a2780(0xdf)],'importedAt':_0x76fd29[_0x1a2780(0xa1)],'source':_0x76fd29[_0x1a2780(0xce)],'commandCount':_0x3887f7[_0x1a2780(0xe7)],'commands':_0x3887f7};}function sha256(_0x17e06f){const _0x44a0b1=a42_0x1d44;return createHash('sha256')[_0x44a0b1(0x9b)](_0x17e06f)[_0x44a0b1(0xae)](_0x44a0b1(0xdb));}function a42_0xabaa(){const _0x1724a4=['target','source','warnings','missing','filePath','normalizedManifest','splice','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','].manifest.','name','].manifest','map','serviceCode','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','hex','132OWHCQv','utf8','Invalid\x20service\x20manifest\x20JSON:\x20','version','homeDir','description','stringify','842115NgpZSP','175970Zuzrwn','sourceHash','reduce','length','1856996qKncZS','join','Service\x20manifest\x20validation\x20failed:\x0a','ENOENT','sort','cliPath','update','service','10722SJuqJg','1148iDGHBT','errors','Local\x20service\x20not\x20found:\x20','importedAt','1336554vIfLgg','toISOString','localeCompare','validation','$.services[','1817272HWhajG','manifests','slice','bff\x20target\x20requires\x20functionName.','object','kind','commands','digest','string','message','invalid','CliError','Invalid\x20service\x20registry\x20JSON:\x20','updatedAt','findIndex','manifest','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','registryIndex','parse','isArray','startsWith','command','services\x20must\x20be\x20an\x20array','push','flatMap','report','find','code','services','Unsupported\x20schemaVersion:\x20','path','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','schemaVersion','trim','empty','3200hcHxMx','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','commandCount'];a42_0xabaa=function(){return _0x1724a4;};return a42_0xabaa();}
@@ -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_0x5f172d=a43_0x17dd;(function(_0xfae50c,_0x2de6f8){const _0x11e298=a43_0x17dd,_0x6c05f7=_0xfae50c();while(!![]){try{const _0x17dc20=parseInt(_0x11e298(0x1be))/0x1+parseInt(_0x11e298(0x1d1))/0x2*(parseInt(_0x11e298(0x1b7))/0x3)+-parseInt(_0x11e298(0x1c3))/0x4*(parseInt(_0x11e298(0x1bf))/0x5)+parseInt(_0x11e298(0x1cb))/0x6+parseInt(_0x11e298(0x1b9))/0x7+-parseInt(_0x11e298(0x1cf))/0x8*(parseInt(_0x11e298(0x1d8))/0x9)+-parseInt(_0x11e298(0x1c4))/0xa;if(_0x17dc20===_0x2de6f8)break;else _0x6c05f7['push'](_0x6c05f7['shift']());}catch(_0x390940){_0x6c05f7['push'](_0x6c05f7['shift']());}}}(a43_0x2651,0x794de));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';function a43_0x17dd(_0x2f665b,_0x1bdd79){_0x2f665b=_0x2f665b-0x1b7;const _0x2651ac=a43_0x2651();let _0x17ddbf=_0x2651ac[_0x2f665b];return _0x17ddbf;}import{dirname,resolve}from'node:path';function a43_0x2651(){const _0x210f75=['path','1651779kXvpeT','create','str','name','45fdfQQf','type','5777947zZqPzg','skillDir','isDirectory','target','Created\x20local\x20Skill\x20draft\x20','860748glYiHl','45MLxSAz','read','Skill\x20directory\x20already\x20exists:\x20','skill','263744hHkHiV','4483060SLrJaT','Refusing\x20to\x20overwrite\x20symlink:\x20','创建本地自包含的运行态\x20Skill\x20草稿','bool','rendered','trim','isSymbolicLink','1938612DIdKIf','map','force','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','32gwcTRX','skillName','35126ceynTX','utf8','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','validation','files','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.'];a43_0x2651=function(){return _0x210f75;};return a43_0x2651();}import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a43_0x5f172d(0x1c2),'command':a43_0x5f172d(0x1d9),'description':a43_0x5f172d(0x1c6),'risk':a43_0x5f172d(0x1c0),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x52ccc1){const _0x34d740=a43_0x5f172d,_0x4f27b2=buildSkillCreatePlan(_0x52ccc1[_0x34d740(0x1da)]('name'),_0x52ccc1['str']('type'),_0x52ccc1['str']('target'));return{'method':'WRITE','url':_0x4f27b2['skillDir'],'body':{'skillName':_0x4f27b2[_0x34d740(0x1c8)][_0x34d740(0x1d0)],'type':_0x4f27b2[_0x34d740(0x1c8)][_0x34d740(0x1b8)],'selfContained':!![],'files':_0x4f27b2[_0x34d740(0x1c8)][_0x34d740(0x1d5)][_0x34d740(0x1cc)](_0x2895ff=>_0x2895ff[_0x34d740(0x1d7)])},'description':_0x34d740(0x1d3)};},async 'execute'(_0x3b6b2e){const _0x5719a2=a43_0x5f172d,_0x4b9755=buildSkillCreatePlan(_0x3b6b2e[_0x5719a2(0x1da)](_0x5719a2(0x1db)),_0x3b6b2e[_0x5719a2(0x1da)]('type'),_0x3b6b2e[_0x5719a2(0x1da)](_0x5719a2(0x1bc)));return writeSkillDraft(_0x4b9755,_0x3b6b2e[_0x5719a2(0x1c7)](_0x5719a2(0x1cd))),{'ok':!![],'data':{'skillName':_0x4b9755[_0x5719a2(0x1c8)][_0x5719a2(0x1d0)],'type':_0x4b9755[_0x5719a2(0x1c8)][_0x5719a2(0x1b8)],'dir':_0x4b9755[_0x5719a2(0x1ba)],'files':_0x4b9755[_0x5719a2(0x1c8)][_0x5719a2(0x1d5)]['map'](_0x176739=>_0x176739[_0x5719a2(0x1d7)])},'message':_0x5719a2(0x1bd)+_0x4b9755[_0x5719a2(0x1c8)][_0x5719a2(0x1d0)]};}};function buildSkillCreatePlan(_0x593936,_0x536927,_0xa09dd1){const _0x8b066d=a43_0x5f172d,_0x23be84=_0x536927['trim'](),_0x575ecc=renderSkillTemplate({'skillName':_0x593936,'type':_0x23be84});!_0x23be84&&writeCliSideChannelLine('Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.');const _0x4ebd66=resolve(normalizeSkillTarget(_0xa09dd1));return{'rendered':_0x575ecc,'targetRoot':_0x4ebd66,'skillDir':resolve(_0x4ebd66,_0x575ecc[_0x8b066d(0x1d0)])};}function normalizeSkillTarget(_0x3dba3b){const _0x5c50ff=a43_0x5f172d;return(_0x3dba3b||DEFAULT_SKILL_TARGET)[_0x5c50ff(0x1c9)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x336ea2,_0x343c70){const _0x21cd88=a43_0x5f172d;if(existsSync(_0x336ea2[_0x21cd88(0x1ba)])){const _0x645570=lstatSync(_0x336ea2[_0x21cd88(0x1ba)]);if(!_0x645570[_0x21cd88(0x1bb)]()||_0x645570[_0x21cd88(0x1ca)]())throw CliErrors[_0x21cd88(0x1d4)](_0x21cd88(0x1ce)+_0x336ea2['skillDir']);if(!_0x343c70)throw CliErrors['validation'](_0x21cd88(0x1c1)+_0x336ea2[_0x21cd88(0x1ba)],_0x21cd88(0x1d6));}for(const _0x407df4 of _0x336ea2[_0x21cd88(0x1c8)][_0x21cd88(0x1d5)]){const _0x1554e0=resolve(_0x336ea2['skillDir'],_0x407df4['path']),_0x4ff73a=dirname(_0x1554e0);mkdirSync(_0x4ff73a,{'recursive':!![]});if(existsSync(_0x1554e0)&&lstatSync(_0x1554e0)[_0x21cd88(0x1ca)]())throw CliErrors[_0x21cd88(0x1d4)](_0x21cd88(0x1c5)+_0x1554e0);writeFileSync(_0x1554e0,_0x407df4['content'],_0x21cd88(0x1d2));}}
@@ -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
+ function a44_0x3366(){const _0x3f4563=['为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','Updated','\x20is\x20unchanged.','42FQWMaq','trim','\x20Skill\x20diagram\x20for\x20','2hKOKdP','diagram-file','1042506JfClbF','880410FRpXta','action','company','Skill\x20diagram\x20validation\x20passed\x20for\x20','Found\x20Skill\x20diagram\x20for\x20','14660734liGrYm','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','num','read','source-fingerprint','1525660VPeyaD','3861zKZqke','diagram-validate','1843290MWizQV',';\x20first\x20write\x20expects\x20revision\x20','1820OucubS','skillCode','diagram-push','scope','appCode','skill-code','16plrrrw','found','expectedDiagramRevision','Skill\x20diagram\x20for\x20','14889032MovFGE','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','created','validation','diagram-show','expected-diagram-revision','str','skill','unchanged','version','write'];a44_0x3366=function(){return _0x3f4563;};return a44_0x3366();}function a44_0x11a7(_0x4f6283,_0x29ec6b){_0x4f6283=_0x4f6283-0x1d2;const _0x336601=a44_0x3366();let _0x11a737=_0x336601[_0x4f6283];return _0x11a737;}const a44_0x406b7e=a44_0x11a7;(function(_0x33deea,_0x11d7ef){const _0x5ba7f2=a44_0x11a7,_0x4b15bd=_0x33deea();while(!![]){try{const _0x16c4b8=parseInt(_0x5ba7f2(0x1dd))/0x1*(-parseInt(_0x5ba7f2(0x1ea))/0x2)+-parseInt(_0x5ba7f2(0x1df))/0x3*(-parseInt(_0x5ba7f2(0x1f5))/0x4)+-parseInt(_0x5ba7f2(0x1e0))/0x5+-parseInt(_0x5ba7f2(0x1ed))/0x6*(parseInt(_0x5ba7f2(0x1da))/0x7)+parseInt(_0x5ba7f2(0x1f9))/0x8+-parseInt(_0x5ba7f2(0x1eb))/0x9*(parseInt(_0x5ba7f2(0x1ef))/0xa)+parseInt(_0x5ba7f2(0x1e5))/0xb;if(_0x16c4b8===_0x11d7ef)break;else _0x4b15bd['push'](_0x4b15bd['shift']());}catch(_0x315cee){_0x4b15bd['push'](_0x4b15bd['shift']());}}}(a44_0x3366,0xea935));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(_0x144db3){const _0x1c039e=a44_0x11a7,_0x1c671d=_0x144db3[_0x1c039e(0x1d2)](_0x1c039e(0x1f4))[_0x1c039e(0x1db)](),_0x490799=_0x144db3[_0x1c039e(0x1d2)](_0x1c039e(0x1d5))['trim'](),_0x296ffe=_0x144db3[_0x1c039e(0x1d2)](_0x1c039e(0x1f2));if(!_0x1c671d||!_0x490799||_0x296ffe!=='personal'&&_0x296ffe!==_0x1c039e(0x1e2))throw CliErrors[_0x1c039e(0x1fc)]('--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.');return{'skillCode':_0x1c671d,'version':_0x490799,'scope':_0x296ffe};}async function readDiagramWriteInput(_0x56fc05){const _0x50c186=a44_0x11a7,_0x418345=_0x56fc05[_0x50c186(0x1e7)](_0x50c186(0x1fe)),_0x422463=_0x56fc05[_0x50c186(0x1d2)](_0x50c186(0x1e9))['trim']();if(!Number['isInteger'](_0x418345)||_0x418345<0x0)throw CliErrors[_0x50c186(0x1fc)](_0x50c186(0x1fa));if(!/^sha256:[0-9a-f]{64}$/['test'](_0x422463))throw CliErrors[_0x50c186(0x1fc)]('--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.');return{'expectedDiagramRevision':_0x418345,'sourceFingerprint':_0x422463,'diagram':await readRequiredSkillDiagram(_0x56fc05[_0x50c186(0x1d2)](_0x50c186(0x1de)))};}export const diagramValidateCommand={'service':a44_0x406b7e(0x1d3),'command':a44_0x406b7e(0x1ec),'description':'Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','risk':a44_0x406b7e(0x1e8),'flags':WRITE_FLAGS,async 'execute'(_0x323d03){const _0x5eae97=a44_0x406b7e,_0x99cd0d=readDiagramTarget(_0x323d03),_0x52c600=await validateRuntimeSkillVersionDiagram(_0x323d03[_0x5eae97(0x1f3)],_0x99cd0d[_0x5eae97(0x1f0)],_0x99cd0d[_0x5eae97(0x1d5)],_0x99cd0d['scope'],await readDiagramWriteInput(_0x323d03));return{'ok':!![],'data':_0x52c600,'message':_0x5eae97(0x1e3)+_0x99cd0d[_0x5eae97(0x1f0)]+'@'+_0x99cd0d[_0x5eae97(0x1d5)]+'.'};}};export const diagramPushCommand={'service':a44_0x406b7e(0x1d3),'command':a44_0x406b7e(0x1f1),'description':a44_0x406b7e(0x1d7),'risk':a44_0x406b7e(0x1d6),'confirmationDescription':'将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','flags':WRITE_FLAGS,async 'execute'(_0x1c1a56){const _0x30c7bb=a44_0x406b7e,_0x4f1bc1=readDiagramTarget(_0x1c1a56),_0x206946=await putRuntimeSkillVersionDiagram(_0x1c1a56[_0x30c7bb(0x1f3)],_0x4f1bc1[_0x30c7bb(0x1f0)],_0x4f1bc1[_0x30c7bb(0x1d5)],_0x4f1bc1['scope'],await readDiagramWriteInput(_0x1c1a56));return{'ok':!![],'data':_0x206946,'message':_0x206946[_0x30c7bb(0x1e1)]===_0x30c7bb(0x1d4)?_0x30c7bb(0x1f8)+_0x4f1bc1[_0x30c7bb(0x1f0)]+'@'+_0x4f1bc1[_0x30c7bb(0x1d5)]+_0x30c7bb(0x1d9):(_0x206946['action']===_0x30c7bb(0x1fb)?'Created':_0x30c7bb(0x1d8))+_0x30c7bb(0x1dc)+_0x4f1bc1[_0x30c7bb(0x1f0)]+'@'+_0x4f1bc1[_0x30c7bb(0x1d5)]+'.'};}};export const diagramShowCommand={'service':a44_0x406b7e(0x1d3),'command':a44_0x406b7e(0x1fd),'description':'Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','risk':a44_0x406b7e(0x1e8),'flags':TARGET_FLAGS,async 'execute'(_0x9556f1){const _0x3c3f8b=a44_0x406b7e,_0x5f0a3f=readDiagramTarget(_0x9556f1),_0x25dba7=await getRuntimeSkillVersionDiagram(_0x9556f1['appCode'],_0x5f0a3f[_0x3c3f8b(0x1f0)],_0x5f0a3f[_0x3c3f8b(0x1d5)],_0x5f0a3f[_0x3c3f8b(0x1f2)]);return{'ok':!![],'data':_0x25dba7,'message':_0x25dba7[_0x3c3f8b(0x1f6)]?_0x3c3f8b(0x1e4)+_0x5f0a3f[_0x3c3f8b(0x1f0)]+'@'+_0x5f0a3f[_0x3c3f8b(0x1d5)]+';\x20next\x20write\x20expects\x20revision\x20'+_0x25dba7['expectedDiagramRevision']+'.':_0x3c3f8b(0x1e6)+_0x5f0a3f[_0x3c3f8b(0x1f0)]+'@'+_0x5f0a3f['version']+_0x3c3f8b(0x1ee)+_0x25dba7[_0x3c3f8b(0x1f7)]+'.'};}};
@@ -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_0x51d0aa=a45_0x1120;(function(_0x568d0c,_0x4e1dc9){const _0x53599b=a45_0x1120,_0x48aa43=_0x568d0c();while(!![]){try{const _0x176516=parseInt(_0x53599b(0x12b))/0x1*(-parseInt(_0x53599b(0x122))/0x2)+parseInt(_0x53599b(0x139))/0x3+parseInt(_0x53599b(0x137))/0x4*(-parseInt(_0x53599b(0x141))/0x5)+-parseInt(_0x53599b(0x153))/0x6+-parseInt(_0x53599b(0x140))/0x7*(parseInt(_0x53599b(0x13f))/0x8)+-parseInt(_0x53599b(0x131))/0x9+-parseInt(_0x53599b(0x12e))/0xa*(-parseInt(_0x53599b(0x150))/0xb);if(_0x176516===_0x4e1dc9)break;else _0x48aa43['push'](_0x48aa43['shift']());}catch(_0xd34ee3){_0x48aa43['push'](_0x48aa43['shift']());}}}(a45_0x4714,0x51268));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';function a45_0x1120(_0x10eab8,_0x3b60b5){_0x10eab8=_0x10eab8-0x122;const _0x471412=a45_0x4714();let _0x112053=_0x471412[_0x10eab8];return _0x112053;}import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':a45_0x51d0aa(0x128),'command':a45_0x51d0aa(0x147),'description':a45_0x51d0aa(0x125),'risk':a45_0x51d0aa(0x13c),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x5e5df4){return syncRuntimeSkills(_0x5e5df4);}};async function syncRuntimeSkills(_0x4f4fc7){const _0x44df6e=a45_0x51d0aa,{downloadRuntimeSkillPackage:_0x178da7,listRuntimeSkills:_0x53483e}=await import(_0x44df6e(0x14b)),{linkEffectiveRuntimeSkills:_0x177c66,materializeRuntimeSkill:_0x4f8441,pruneStaleRuntimeSkillCache:_0x3b6298,pruneStaleRuntimeSkillLinks:_0x498439,resolveRuntimeSkillInstallTarget:_0x468749}=await import(_0x44df6e(0x144)),_0x5d1b81=_0x4f4fc7['str'](_0x44df6e(0x13e)),_0x598f90=normalizeSyncScopes(_0x4f4fc7[_0x44df6e(0x14a)](_0x44df6e(0x14c))),_0x124c41=_0x4f4fc7[_0x44df6e(0x14e)]??_0x44df6e(0x138),_0x5e5e04=_0x4f4fc7[_0x44df6e(0x133)],_0x771d83=_0x4f4fc7['bool']('force');if(!_0x5e5e04)throw CliErrors[_0x44df6e(0x152)](_0x44df6e(0x13d));const _0x55d50f=_0x468749(_0x4f4fc7[_0x44df6e(0x130)],_0x4f4fc7['bool'](_0x44df6e(0x12f))?_0x44df6e(0x12f):_0x44df6e(0x12d)),_0x17b477=_0x468749(_0x4f4fc7[_0x44df6e(0x130)],_0x55d50f[_0x44df6e(0x14c)]===_0x44df6e(0x12f)?_0x44df6e(0x12d):'project'),_0x32d89d=await Promise[_0x44df6e(0x129)](_0x598f90[_0x44df6e(0x134)](_0x481ffc=>_0x53483e({'appCode':_0x4f4fc7[_0x44df6e(0x130)],'scope':_0x481ffc,'code':_0x5d1b81[_0x44df6e(0x14f)]()||undefined}))),_0x340699=_0x598f90[_0x44df6e(0x135)]('personal')?_0x32d89d[_0x44df6e(0x145)]((_0x3e25fe,_0x76606f)=>_0x598f90[_0x76606f]===_0x44df6e(0x12a)?_0x3e25fe[_0x44df6e(0x12a)]:[]):[],_0x59ed98=_0x598f90[_0x44df6e(0x135)](_0x44df6e(0x127))?_0x32d89d['flatMap']((_0x57c9a8,_0x291e5e)=>_0x598f90[_0x291e5e]===_0x44df6e(0x127)?_0x57c9a8[_0x44df6e(0x127)]:[]):[],_0x37f931=new Set([..._0x340699['map'](_0x1f2c16=>_0x1f2c16['skillCode']?.[_0x44df6e(0x14f)]())[_0x44df6e(0x143)](_0x4bddb0=>Boolean(_0x4bddb0)),..._0x59ed98[_0x44df6e(0x134)](_0x3a5a27=>_0x3a5a27[_0x44df6e(0x12c)]?.[_0x44df6e(0x14f)]())[_0x44df6e(0x143)](_0x42bc59=>Boolean(_0x42bc59))]),_0x54a722=_0x5d1b81[_0x44df6e(0x14f)]()?[_0x5d1b81['trim']()]:undefined,_0x4b2a72=_0x598f90[_0x44df6e(0x13b)]===0x2&&_0x598f90['includes'](_0x44df6e(0x12a))&&_0x598f90[_0x44df6e(0x135)]('company'),_0x5ce58c=_0x4b2a72?_0x498439(_0x55d50f,_0x37f931,_0x54a722):[],_0x55d21b=_0x3b6298({'env':_0x124c41,'accessKey':_0x5e5e04,'appCode':_0x4f4fc7[_0x44df6e(0x130)],'activeSkillCodes':_0x37f931,'pruneSkillCodes':_0x54a722,'scopes':_0x598f90,'protectedLinkRoots':_0x17b477['skillRoots']}),_0x5a444f=[];for(const _0x3d28c7 of _0x340699){_0x5a444f[_0x44df6e(0x123)](_0x4f8441(_0x3d28c7,_0x44df6e(0x12a),{'env':_0x124c41,'accessKey':_0x5e5e04,'appCode':_0x4f4fc7[_0x44df6e(0x130)],'force':_0x771d83,'packageBytes':await downloadSkillPackage(_0x3d28c7,'personal',_0x4f4fc7['appCode'],_0x178da7)}));}for(const _0x603eeb of _0x59ed98){_0x5a444f[_0x44df6e(0x123)](_0x4f8441(_0x603eeb,_0x44df6e(0x127),{'env':_0x124c41,'accessKey':_0x5e5e04,'appCode':_0x4f4fc7[_0x44df6e(0x130)],'force':_0x771d83,'packageBytes':await downloadSkillPackage(_0x603eeb,_0x44df6e(0x127),_0x4f4fc7[_0x44df6e(0x130)],_0x178da7)}));}const _0x111eea=_0x177c66(_0x5a444f,_0x55d50f),_0x2ab02b=countLinkActions(_0x111eea);return{'ok':!![],'data':{'appCode':_0x4f4fc7[_0x44df6e(0x130)],..._0x55d50f[_0x44df6e(0x14c)]==='project'?{'installTarget':{'scope':_0x55d50f['scope'],'skillRoots':[..._0x55d50f[_0x44df6e(0x142)]]}}:{},'personal':_0x340699[_0x44df6e(0x13b)],'company':_0x59ed98[_0x44df6e(0x13b)],'materialized':_0x5a444f[_0x44df6e(0x13b)],'links':{'total':_0x111eea[_0x44df6e(0x13b)],'created':_0x2ab02b[_0x44df6e(0x151)]??0x0,'updated':_0x2ab02b[_0x44df6e(0x14d)]??0x0,'unchanged':_0x2ab02b[_0x44df6e(0x124)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x5ce58c['filter'](_0x34ccba=>_0x34ccba[_0x44df6e(0x13a)]===_0x44df6e(0x149))[_0x44df6e(0x13b)],'cacheDirs':_0x55d21b[_0x44df6e(0x143)](_0x2afd05=>_0x2afd05['action']===_0x44df6e(0x149))['length'],'skipped':[..._0x5ce58c,..._0x55d21b][_0x44df6e(0x143)](_0x73ec12=>_0x73ec12[_0x44df6e(0x13a)]===_0x44df6e(0x148))['length']},'skills':{'personal':_0x340699[_0x44df6e(0x134)](summarizeRuntimeSkill),'company':_0x59ed98[_0x44df6e(0x134)](summarizeRuntimeSkill)}},'message':_0x44df6e(0x136)+_0x340699['length']+'\x20personal\x20and\x20'+_0x59ed98['length']+_0x44df6e(0x132)};}async function downloadSkillPackage(_0x293741,_0x28a710,_0x2a3488,_0x3d2c32){const _0x323622=a45_0x51d0aa,_0x36a79c=_0x293741[_0x323622(0x146)]?.[_0x323622(0x14f)]();return _0x36a79c?_0x3d2c32(_0x28a710,_0x293741[_0x323622(0x12c)],_0x2a3488,_0x36a79c):_0x3d2c32(_0x28a710,_0x293741[_0x323622(0x12c)],_0x2a3488);}function countLinkActions(_0x5aba43){const _0x2df834=a45_0x51d0aa;return _0x5aba43[_0x2df834(0x126)]((_0x23e1c0,_0x370998)=>{const _0x7376fe=_0x2df834;return _0x23e1c0[_0x370998['action']]=(_0x23e1c0[_0x370998[_0x7376fe(0x13a)]]??0x0)+0x1,_0x23e1c0;},{});}function a45_0x4714(){const _0x534e75=['version','install','skipped','removed','str','../../../core/api-client.js','scope','updated','envName','trim','6334845cQmgKJ','created','authRequired','682884EiQHwL','1880MHruGY','push','unchanged','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','reduce','company','skill','all','personal','530nwLkAX','skillCode','global','20EXxCOK','project','appCode','1278153ABpjxk','\x20company\x20Skill(s).','accessKey','map','includes','Installed\x20','268RSuzOx','production','1544346tRtytq','action','length','read','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','code','14648THNpww','84EKidzs','41655GbESYc','skillRoots','filter','../../../skills/runtime-skill-sync.js','flatMap'];a45_0x4714=function(){return _0x534e75;};return a45_0x4714();}
@@ -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_0x2b609e=a46_0x1327;(function(_0x3b5bb7,_0x4d656e){const _0x4fc15c=a46_0x1327,_0x5518e4=_0x3b5bb7();while(!![]){try{const _0x17ae49=parseInt(_0x4fc15c(0x15e))/0x1+-parseInt(_0x4fc15c(0x158))/0x2*(-parseInt(_0x4fc15c(0x164))/0x3)+-parseInt(_0x4fc15c(0x15b))/0x4*(parseInt(_0x4fc15c(0x157))/0x5)+parseInt(_0x4fc15c(0x172))/0x6*(parseInt(_0x4fc15c(0x15a))/0x7)+parseInt(_0x4fc15c(0x167))/0x8+parseInt(_0x4fc15c(0x159))/0x9+-parseInt(_0x4fc15c(0x15f))/0xa*(parseInt(_0x4fc15c(0x16a))/0xb);if(_0x17ae49===_0x4d656e)break;else _0x5518e4['push'](_0x5518e4['shift']());}catch(_0x4bfe2d){_0x5518e4['push'](_0x5518e4['shift']());}}}(a46_0x480b,0x7f172));import{CliErrors}from'../../../errors.js';function a46_0x1327(_0x3c40bc,_0x1acb73){_0x3c40bc=_0x3c40bc-0x153;const _0x480b9e=a46_0x480b();let _0x132707=_0x480b9e[_0x3c40bc];return _0x132707;}import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';function a46_0x480b(){const _0x2b5997=['builtin','company','personal','18GPaVAO','trim','local','code','scope','accessKey','appCode','5JPqHgq','2PNYuvI','3992985jpFYNV','210350BdIKLr','1806884rJSjri','bool','str','209421KzTglr','3842440klZvGU','read','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','Listed\x20','skill','1614930cSrpzV','length','global','6747752flGjMP','map','remote','33FZGtuG','filter','\x20local\x20Skill(s).','../../../core/api-client.js','project'];a46_0x480b=function(){return _0x2b5997;};return a46_0x480b();}import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a46_0x2b609e(0x163),'command':'list','description':a46_0x2b609e(0x161),'risk':a46_0x2b609e(0x160),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x17795a){const _0x47958d=a46_0x2b609e,_0x175e66=_0x17795a['str'](_0x47958d(0x153)),_0x4f275a=normalizeListScope(_0x17795a[_0x47958d(0x15d)](_0x47958d(0x154)));if(_0x17795a[_0x47958d(0x15c)]('local')){const _0x6e29b9=_0x17795a[_0x47958d(0x155)];if(!_0x6e29b9)throw CliErrors['authRequired']();const {listLocalRuntimeSkills:_0x4eed45,resolveRuntimeSkillInstallTarget:_0x1a588b}=await import('../../../skills/runtime-skill-sync.js'),_0x5e46d0=_0x1a588b(_0x17795a['appCode'],_0x17795a[_0x47958d(0x15c)](_0x47958d(0x16e))?_0x47958d(0x16e):_0x47958d(0x166)),_0x7c829a=_0x4eed45({'env':_0x17795a['envName']??'production','accessKey':_0x6e29b9,'appCode':_0x17795a['appCode'],'scopes':listScopeToRuntimeScopes(_0x4f275a),'code':_0x175e66[_0x47958d(0x173)]()||undefined},_0x5e46d0),_0x1fe567=groupLocalRuntimeSkills(_0x7c829a);return{'ok':!![],'data':{'appCode':_0x17795a[_0x47958d(0x156)],'source':_0x47958d(0x174),..._0x5e46d0['scope']===_0x47958d(0x16e)?{'installScope':_0x5e46d0['scope']}:{},'scope':_0x4f275a,'total':_0x7c829a[_0x47958d(0x165)],'personal':_0x1fe567[_0x47958d(0x171)][_0x47958d(0x165)],'company':_0x1fe567[_0x47958d(0x170)][_0x47958d(0x165)],'items':_0x7c829a[_0x47958d(0x168)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x1fe567[_0x47958d(0x171)][_0x47958d(0x168)](summarizeLocalRuntimeSkill),'company':_0x1fe567[_0x47958d(0x170)]['map'](summarizeLocalRuntimeSkill)}},'message':_0x47958d(0x162)+_0x7c829a[_0x47958d(0x165)]+_0x47958d(0x16c)};}const {listRuntimeSkills:_0x58a456}=await import(_0x47958d(0x16d)),_0x40e373=await _0x58a456({'appCode':_0x17795a[_0x47958d(0x156)],'scope':listScopeToRemoteScope(_0x4f275a),'code':_0x175e66[_0x47958d(0x173)]()||undefined}),_0x220fc1=shouldListScope(_0x4f275a,_0x47958d(0x171))?_0x40e373[_0x47958d(0x171)]??[]:[],_0x2e2daf=shouldListScope(_0x4f275a,'company')?_0x40e373[_0x47958d(0x170)]??[]:[],_0x4f2a1e=[..._0x220fc1,..._0x2e2daf];return{'ok':!![],'data':{'appCode':_0x17795a[_0x47958d(0x156)],'source':_0x47958d(0x169),'scope':_0x4f275a,'total':_0x4f2a1e['length'],'personal':_0x220fc1[_0x47958d(0x165)],'company':_0x2e2daf[_0x47958d(0x165)],'items':_0x4f2a1e[_0x47958d(0x168)](summarizeRuntimeSkill),'skills':{'personal':_0x220fc1[_0x47958d(0x168)](summarizeRuntimeSkill),'company':_0x2e2daf[_0x47958d(0x168)](summarizeRuntimeSkill)}},'message':_0x47958d(0x162)+_0x4f2a1e[_0x47958d(0x165)]+'\x20remote\x20Skill(s).'};}};function groupLocalRuntimeSkills(_0x38d621){const _0xf648cd=a46_0x2b609e;return{'personal':_0x38d621[_0xf648cd(0x16b)](_0x3dcb56=>_0x3dcb56[_0xf648cd(0x154)]===_0xf648cd(0x171)),'company':_0x38d621[_0xf648cd(0x16b)](_0x4fa982=>_0x4fa982[_0xf648cd(0x154)]===_0xf648cd(0x170)),'builtin':_0x38d621['filter'](_0x756b5=>_0x756b5[_0xf648cd(0x154)]===_0xf648cd(0x16f))};}
@@ -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
+ function a47_0xd66f(_0x3bc96a,_0x451489){_0x3bc96a=_0x3bc96a-0x197;const _0x59654f=a47_0x5965();let _0xd66f3d=_0x59654f[_0x3bc96a];return _0xd66f3d;}const a47_0x3bc5c3=a47_0xd66f;(function(_0x16650d,_0x5ecc4e){const _0x182bd8=a47_0xd66f,_0x5e66fa=_0x16650d();while(!![]){try{const _0x481bab=parseInt(_0x182bd8(0x198))/0x1+-parseInt(_0x182bd8(0x19d))/0x2+parseInt(_0x182bd8(0x1a2))/0x3*(parseInt(_0x182bd8(0x19f))/0x4)+-parseInt(_0x182bd8(0x19c))/0x5+-parseInt(_0x182bd8(0x1a1))/0x6+-parseInt(_0x182bd8(0x197))/0x7*(parseInt(_0x182bd8(0x1a0))/0x8)+parseInt(_0x182bd8(0x19a))/0x9;if(_0x481bab===_0x5ecc4e)break;else _0x5e66fa['push'](_0x5e66fa['shift']());}catch(_0x493220){_0x5e66fa['push'](_0x5e66fa['shift']());}}}(a47_0x5965,0xed0a6));function a47_0x5965(){const _0x17528b=['273fnAqFV','184278BClejA','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','32504643IeLSKi','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','2741930uIoOBy','1814268tzZdRW','push','2442632XKbdIg','310984cCreeB','10112364smgOXd','9qIuMpp'];a47_0x5965=function(){return _0x17528b;};return a47_0x5965();}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':a47_0x3bc5c3(0x19e),'description':a47_0x3bc5c3(0x199),'risk':'write','confirmationDescription':a47_0x3bc5c3(0x19b),'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
+ function a48_0x3fcf(){const _0x2ea185=['2010618yMFdiE','skill','495548YhFXCI','validate','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','read','errors','bool','403194rdGYSJ','warnings','str','strict','dir','387164aWAYUk','type','153440AacfJM','8WAfRlJ','1365301aBqhYv','6mTRdRD','1260480VCvQAc','15MJtOdk'];a48_0x3fcf=function(){return _0x2ea185;};return a48_0x3fcf();}const a48_0x5e1cd0=a48_0xc150;(function(_0x41476d,_0x37ba4c){const _0x3a51fb=a48_0xc150,_0x4a2cfd=_0x41476d();while(!![]){try{const _0x1fa5e1=parseInt(_0x3a51fb(0xc1))/0x1+parseInt(_0x3a51fb(0xbf))/0x2+-parseInt(_0x3a51fb(0xc4))/0x3*(parseInt(_0x3a51fb(0xc9))/0x4)+-parseInt(_0x3a51fb(0xc6))/0x5*(-parseInt(_0x3a51fb(0xba))/0x6)+parseInt(_0x3a51fb(0xc3))/0x7*(-parseInt(_0x3a51fb(0xc2))/0x8)+parseInt(_0x3a51fb(0xc7))/0x9+-parseInt(_0x3a51fb(0xc5))/0xa;if(_0x1fa5e1===_0x37ba4c)break;else _0x4a2cfd['push'](_0x4a2cfd['shift']());}catch(_0x473f27){_0x4a2cfd['push'](_0x4a2cfd['shift']());}}}(a48_0x3fcf,0x31994));function a48_0xc150(_0x11b6fc,_0x30ec39){_0x11b6fc=_0x11b6fc-0xb5;const _0x3fcff0=a48_0x3fcf();let _0xc150fe=_0x3fcff0[_0x11b6fc];return _0xc150fe;}import{DIR_FLAG,STRICT_FLAG}from'../flags.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':a48_0x5e1cd0(0xc8),'command':a48_0x5e1cd0(0xb5),'description':a48_0x5e1cd0(0xb6),'risk':a48_0x5e1cd0(0xb7),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x5cc1c0){const _0x49dba0=a48_0x5e1cd0,_0x5b9ed8=_0x5cc1c0[_0x49dba0(0xb9)](_0x49dba0(0xbd)),_0x3fb567=validateSkillDirectory(_0x5cc1c0[_0x49dba0(0xbc)](_0x49dba0(0xbe)),{'strict':_0x5b9ed8});return throwIfSkillValidationFailed(_0x3fb567,_0x5b9ed8),{'ok':!![],'data':{'dir':_0x3fb567[_0x49dba0(0xbe)],'type':_0x3fb567[_0x49dba0(0xc0)],'errors':_0x3fb567[_0x49dba0(0xb8)],'warnings':_0x3fb567[_0x49dba0(0xbb)]},'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 a49_0x2398(){const _0x23985a=['17603604XIOiTv','2268618CxkUQJ','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','default','parse','window','isFile','10abnUAx','1IrspmB','utf8','Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','3549805jqfivF','trim','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','Mermaid\x20syntax\x20validation\x20failed.','replace','6436170XnRlke','diagram','mermaid','122162fRZdVz','document','validation','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','247280mokwdF','9894536uzRqEo'];a49_0x2398=function(){return _0x23985a;};return a49_0x2398();}(function(_0x4552ed,_0x58c0d2){const _0x83c7f5=a49_0x1da6,_0x21be07=_0x4552ed();while(!![]){try{const _0x1710d8=-parseInt(_0x83c7f5(0x1cf))/0x1*(parseInt(_0x83c7f5(0x1da))/0x2)+parseInt(_0x83c7f5(0x1c8))/0x3+parseInt(_0x83c7f5(0x1de))/0x4*(-parseInt(_0x83c7f5(0x1ce))/0x5)+-parseInt(_0x83c7f5(0x1d7))/0x6+parseInt(_0x83c7f5(0x1d2))/0x7+-parseInt(_0x83c7f5(0x1df))/0x8+parseInt(_0x83c7f5(0x1c7))/0x9;if(_0x1710d8===_0x58c0d2)break;else _0x21be07['push'](_0x21be07['shift']());}catch(_0x18bd68){_0x21be07['push'](_0x21be07['shift']());}}}(a49_0x2398,0xb1034));import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';function a49_0x1da6(_0x2e541a,_0x4bd13b){_0x2e541a=_0x2e541a-0x1c7;const _0x2398b3=a49_0x2398();let _0x1da691=_0x2398b3[_0x2e541a];return _0x1da691;}import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x28e952){const _0x1b1300=a49_0x1da6;return(await readRequiredSkillDiagramInput(_0x28e952))[_0x1b1300(0x1d8)];}export async function readRequiredSkillDiagramInput(_0xbee3e6){const _0x21f881=a49_0x1da6,_0x5b75e1=_0xbee3e6[_0x21f881(0x1d3)]();if(!_0x5b75e1)throw CliErrors[_0x21f881(0x1dc)]('--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.',_0x21f881(0x1dd));let _0x5c828b,_0x4fb453;if(_0x5b75e1==='-')try{_0x5c828b=readFileSync(0x0,_0x21f881(0x1d0));}catch{throw CliErrors[_0x21f881(0x1dc)](_0x21f881(0x1d4));}else{const _0x238212=resolve(_0x5b75e1);if(!existsSync(_0x238212))throw CliErrors[_0x21f881(0x1dc)](_0x21f881(0x1c9)+_0x238212);if(!statSync(_0x238212)[_0x21f881(0x1cd)]())throw CliErrors['validation'](_0x21f881(0x1d1)+_0x238212);_0x4fb453=realpathSync(_0x238212),_0x5c828b=readFileSync(_0x4fb453,_0x21f881(0x1d0));}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x5c828b)},'sourceFilePath':_0x4fb453};}export async function validateAndCanonicalizeMermaid(_0x2f9d04){const _0x54e091=a49_0x1da6,_0x3173d6=_0x2f9d04['replace'](/\r\n/g,'\x0a')[_0x54e091(0x1d6)](/\r/g,'\x0a')['replace'](/\n+$/,'')+'\x0a';try{const _0x52e26d=await loadMermaidApi();await _0x52e26d[_0x54e091(0x1cb)](_0x3173d6);}catch{throw diagramValidationError();}return _0x3173d6;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x89bfc5=a49_0x1da6;if(!(_0x89bfc5(0x1cc)in globalThis)||!('document'in globalThis)){const _0x492077=new JSDOM('');Object['defineProperties'](globalThis,{'window':{'configurable':!![],'value':_0x492077[_0x89bfc5(0x1cc)]},'document':{'configurable':!![],'value':_0x492077['window'][_0x89bfc5(0x1db)]}});}return(await import(_0x89bfc5(0x1d9)))[_0x89bfc5(0x1ca)];})()),mermaidApiPromise;}function diagramValidationError(){const _0x1f7e41=a49_0x1da6;return CliErrors['validation'](_0x1f7e41(0x1d5),'Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.');}