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

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 (139) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/shared.js +1 -1
  25. package/lib/commands/data/index.js +1 -1
  26. package/lib/commands/dataset/detail.js +1 -1
  27. package/lib/commands/dataset/index.js +1 -1
  28. package/lib/commands/dataset/list.js +1 -1
  29. package/lib/commands/dataset/sdk-doc.js +1 -1
  30. package/lib/commands/doctor.js +1 -1
  31. package/lib/commands/file/index.js +1 -1
  32. package/lib/commands/init.js +1 -1
  33. package/lib/commands/kb/index.js +1 -1
  34. package/lib/commands/logs/index.d.ts +2 -8
  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.d.ts +6 -0
  52. package/lib/commands/skill/diagram.js +1 -1
  53. package/lib/commands/skill/flags.js +1 -1
  54. package/lib/commands/skill/index.js +1 -1
  55. package/lib/commands/skill/manifest-helpers.js +1 -1
  56. package/lib/commands/skill/push-execute.js +1 -1
  57. package/lib/commands/skill/push-flow-helpers.js +1 -1
  58. package/lib/commands/skill/push-retarget.js +1 -1
  59. package/lib/commands/skill/scopes.js +1 -1
  60. package/lib/commands/skill/summary.js +1 -1
  61. package/lib/commands/skill/templates.js +1 -1
  62. package/lib/commands/skill/validate.js +1 -1
  63. package/lib/commands/sql/detail.js +1 -1
  64. package/lib/commands/sql/exec.js +1 -1
  65. package/lib/commands/sql/index.js +1 -1
  66. package/lib/commands/update.js +1 -1
  67. package/lib/commands/workspace/index.js +1 -1
  68. package/lib/config/schema.js +1 -1
  69. package/lib/constant/app.js +1 -1
  70. package/lib/constant/auth-mode.js +1 -1
  71. package/lib/constant/cli.js +1 -1
  72. package/lib/constant/defaults.js +1 -1
  73. package/lib/constant/distribution.js +1 -1
  74. package/lib/constant/domain.js +1 -1
  75. package/lib/constant/env.js +1 -1
  76. package/lib/constant/output.js +1 -1
  77. package/lib/constant/product.d.ts +14 -0
  78. package/lib/constant/product.js +1 -1
  79. package/lib/constant/risk.js +1 -1
  80. package/lib/constant/url.js +1 -1
  81. package/lib/context.js +1 -1
  82. package/lib/core/api-client.js +1 -1
  83. package/lib/core/db-resolver.js +1 -1
  84. package/lib/core/sdk-client.js +1 -1
  85. package/lib/errors.js +1 -1
  86. package/lib/framework/build-all-flags.js +1 -1
  87. package/lib/framework/dryrun.js +1 -1
  88. package/lib/framework/flags.js +1 -1
  89. package/lib/framework/help.js +1 -1
  90. package/lib/framework/index.js +1 -1
  91. package/lib/framework/output.js +1 -1
  92. package/lib/framework/preparse.js +1 -1
  93. package/lib/framework/rate-limit.js +1 -1
  94. package/lib/framework/raw-flags.js +1 -1
  95. package/lib/framework/response.js +1 -1
  96. package/lib/framework/runner-confirmation.js +1 -1
  97. package/lib/framework/runner-error.js +1 -1
  98. package/lib/framework/runner.js +1 -1
  99. package/lib/framework/schema-export.js +1 -1
  100. package/lib/framework/service-order.js +1 -1
  101. package/lib/framework/types.js +1 -1
  102. package/lib/generated/build-info.d.ts +4 -4
  103. package/lib/generated/build-info.js +1 -1
  104. package/lib/help.js +1 -1
  105. package/lib/runtime/confirmation.js +1 -1
  106. package/lib/runtime/event.js +1 -1
  107. package/lib/runtime/index.js +1 -1
  108. package/lib/runtime/queue.js +1 -1
  109. package/lib/runtime/resolve.js +1 -1
  110. package/lib/skills/npx-skills-add.d.ts +30 -0
  111. package/lib/skills/npx-skills-add.js +1 -1
  112. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  113. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  114. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  115. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  116. package/lib/skills/runtime-skill-sync/links.js +1 -1
  117. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  118. package/lib/skills/runtime-skill-sync/local-files.d.ts +4 -1
  119. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  120. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  121. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  122. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  123. package/lib/skills/runtime-skill-sync/push.d.ts +1 -0
  124. package/lib/skills/runtime-skill-sync/push.js +1 -1
  125. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  126. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  127. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  128. package/lib/skills/runtime-skill-sync.js +1 -1
  129. package/lib/skills/skill-presence.d.ts +48 -0
  130. package/lib/skills/skill-presence.js +1 -0
  131. package/lib/utils/apply-jq-filter.js +1 -1
  132. package/lib/utils/logger.js +1 -1
  133. package/lib/utils/lossless-json.js +1 -1
  134. package/lib/utils/params.js +1 -1
  135. package/lib/utils/platform.js +1 -1
  136. package/lib/utils/update-notice.js +1 -1
  137. package/lib/utils/version.js +1 -1
  138. package/lib/utils/write-cli-side-channel.js +1 -1
  139. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x8df488,_0x3b141f){const _0x105b46=a39_0x414e,_0x5bb71e=_0x8df488();while(!![]){try{const _0x507db7=parseInt(_0x105b46(0x1b0))/0x1+parseInt(_0x105b46(0x1eb))/0x2+-parseInt(_0x105b46(0x1ed))/0x3*(parseInt(_0x105b46(0x1e7))/0x4)+-parseInt(_0x105b46(0x1cf))/0x5+parseInt(_0x105b46(0x207))/0x6*(-parseInt(_0x105b46(0x1e5))/0x7)+-parseInt(_0x105b46(0x1f5))/0x8+parseInt(_0x105b46(0x1e0))/0x9*(parseInt(_0x105b46(0x1ce))/0xa);if(_0x507db7===_0x3b141f)break;else _0x5bb71e['push'](_0x5bb71e['shift']());}catch(_0x3a9282){_0x5bb71e['push'](_0x5bb71e['shift']());}}}(a39_0x3d0e,0x6a7c3));function a39_0x414e(_0xdcec69,_0x446358){_0xdcec69=_0xdcec69-0x1aa;const _0x3d0e3e=a39_0x3d0e();let _0x414e72=_0x3d0e3e[_0xdcec69];return _0x414e72;}import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';function a39_0x3d0e(){const _0x139d50=['filter','tenantCode','find','userName','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','padEnd','bffCode','env','180SzHGye','2171030ZcrxsQ','entries','sql','scriptName','high-risk-write','command','description','data','SERVICE_TREE','const','join','username','sqlCode','bffId','source','fromEntries','length','946395wvZINB','bff','envName','flags','json','1099hnaDMB','default','444LfZxgJ','commands','Preview\x20dynamic\x20service\x20command:\x20','service','1067614nEbhVF','string','16521qJJqQP','map','Service\x20command\x20','该命令被清单标记为写入,可能修改业务数据或服务状态。','`\x20to\x20inspect\x20the\x20manifest.','nickName','\x20\x20\x20\x20datasetCode:\x20','\x20->\x20','5121216lXwOUY','risk','normalizedManifest','mapTo','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','tree','userId','datatable','now','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','target','rawFlags','boolean','type','number','appRef','push','context.','12006DwiwgL','kind','appCode','nickname','slice','Use\x20`','\x20\x20\x20\x20sqlCode:\x20','name','\x20\x20MAP\x20TO','args','params','9358nrKqdB','\x20\x20\x20\x20','Run\x20service\x20command\x20','validation','\x20\x20\x20\x20functionName:\x20','read','app','some','appcode','flatMap','fullPath','\x20\x20\x20\x20command:\x20','\x20\x20\x20\x20kind:\x20\x20\x20\x20','datasetCode','cliPath','code','startsWith','remainingArgs','operator','cliName','\x20\x20SERVICE\x20TREE\x20TARGET'];a39_0x3d0e=function(){return _0x139d50;};return a39_0x3d0e();}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(_0x327f1c,_0x355364){const _0x3ac9ed=a39_0x414e,_0x3556cc=listLocalServiceTrees();let _0x542754;for(const _0x200412 of _0x3556cc){const _0x482bb2=matchServiceTreeCommand(_0x200412,_0x327f1c);if(!_0x482bb2)continue;(!_0x542754||_0x482bb2[_0x3ac9ed(0x1d4)]['fullPath'][_0x3ac9ed(0x1df)]>_0x542754[_0x3ac9ed(0x1d4)][_0x3ac9ed(0x1ba)]['length'])&&(_0x542754={'tree':_0x200412,'command':_0x482bb2[_0x3ac9ed(0x1d4)],'remainingArgs':_0x482bb2[_0x3ac9ed(0x1c1)]});}if(!_0x542754)return undefined;const _0x50f74e={..._0x355364};return applyAppBinding(_0x542754['tree'],_0x542754[_0x3ac9ed(0x1d4)],_0x50f74e),{'definition':buildDynamicCommandDefinition(_0x542754[_0x3ac9ed(0x1fa)],_0x542754[_0x3ac9ed(0x1d4)]),'args':_0x542754[_0x3ac9ed(0x1c1)],'flags':_0x50f74e,'tree':_0x542754['tree'],'command':_0x542754[_0x3ac9ed(0x1d4)]};}export function generateDynamicServiceHelp(_0x1c45d7){const _0xbb6dab=a39_0x414e,_0x2fa1f6=listLocalServiceTrees()['find'](_0x35a714=>_0x35a714[_0xbb6dab(0x1ea)][_0xbb6dab(0x1bf)]===_0x1c45d7);if(!_0x2fa1f6)return undefined;const _0x2cb6ba=[CLI_BIN_NAME+'\x20'+_0x1c45d7+'\x20<command>\x20[flags]','',_0x2fa1f6['service'][_0xbb6dab(0x1ac)]||_0x1c45d7,_0x2fa1f6['service'][_0xbb6dab(0x1d5)]?'\x20\x20'+_0x2fa1f6['service']['description']:'','','Commands:',..._0x2fa1f6[_0xbb6dab(0x1e8)]['map'](_0x1b66b8=>{const _0x128ae7=_0xbb6dab,_0x410900=_0x1b66b8[_0x128ae7(0x1ba)][_0x128ae7(0x20b)](0x1)[_0x128ae7(0x1d9)]('\x20'),_0x544ac0=_0x1b66b8['risk']===_0x128ae7(0x1b5)?'':'\x20['+_0x1b66b8[_0x128ae7(0x1f6)]+']';return'\x20\x20'+_0x410900[_0x128ae7(0x1cb)](0x18)+'\x20'+(_0x1b66b8[_0x128ae7(0x1d5)]||'')+_0x544ac0;}),'',_0xbb6dab(0x1aa)+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x1c45d7+_0xbb6dab(0x1f1)][_0xbb6dab(0x1c5)](Boolean);return _0x2cb6ba[_0xbb6dab(0x1d9)]('\x0a');}export function listDynamicServiceEntries(){const _0x13c577=a39_0x414e;return listLocalServices()[_0x13c577(0x1ee)](_0xebe951=>{const _0x263840=_0x13c577,_0x5920fa=_0xebe951[_0x263840(0x1f7)];return{'service':_0x5920fa[_0x263840(0x1ea)][_0x263840(0x1bf)],'label':_0x5920fa['service'][_0x263840(0x1ac)]||_0x5920fa[_0x263840(0x1ea)][_0x263840(0x1bf)],'commands':_0x5920fa['commands'][_0x263840(0x1ee)](_0x1bcabd=>({'command':dynamicCommandName(_0x1bcabd),'description':_0x1bcabd['description']||'Run\x20service\x20command\x20'+_0x1bcabd[_0x263840(0x1be)],'tag':riskTag(_0x1bcabd[_0x263840(0x1f6)])}))};});}export function getDynamicServiceEntry(_0x42cfb3){const _0x18c7c2=a39_0x414e;return listDynamicServiceEntries()[_0x18c7c2(0x1c7)](_0xe0a25d=>_0xe0a25d[_0x18c7c2(0x1ea)]===_0x42cfb3);}export function listDynamicServiceDefinitions(_0x3d07b8){const _0x30c22f=a39_0x414e;return listLocalServiceTrees()['filter'](_0x5b83b9=>!_0x3d07b8||_0x5b83b9[_0x30c22f(0x1ea)]['code']===_0x3d07b8)[_0x30c22f(0x1b9)](_0xb8768d=>_0xb8768d['commands']['map'](_0x4f076e=>buildDynamicCommandDefinition(_0xb8768d,_0x4f076e)));}export function getDynamicServiceDefinitions(_0x350e4c){const _0x30863c=a39_0x414e,_0x42c8b2=listDynamicServiceDefinitions(_0x350e4c);return _0x42c8b2[_0x30863c(0x1df)]>0x0?_0x42c8b2:undefined;}export function findDynamicServiceDefinition(_0x1e2201,_0x3eecbb){const _0x4a0a7c=a39_0x414e;return listDynamicServiceDefinitions(_0x1e2201)['find'](_0x5145eb=>_0x5145eb[_0x4a0a7c(0x1d4)]===_0x3eecbb);}export function buildDynamicCommandDefinition(_0x552810,_0x37db4d){const _0x361401=a39_0x414e;return{'service':_0x552810[_0x361401(0x1ea)][_0x361401(0x1bf)],'command':dynamicCommandName(_0x37db4d),'description':_0x37db4d[_0x361401(0x1d5)]||_0x361401(0x1b2)+_0x37db4d[_0x361401(0x1be)],'risk':_0x37db4d['risk'],..._0x37db4d[_0x361401(0x1f6)]===_0x361401(0x1b5)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x37db4d)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x37db4d[_0x361401(0x1ae)][_0x361401(0x1ee)](_0x304be5=>({'name':_0x304be5[_0x361401(0x1ac)],'description':_0x304be5[_0x361401(0x1d5)]||_0x304be5['name'],'required':_0x304be5['required']})),'flags':_0x37db4d[_0x361401(0x1e3)][_0x361401(0x1ee)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x37db4d),async 'dryRun'(_0x35c2a3){const _0x5352f7=_0x361401,_0x22d9a2=await compilePlan(_0x37db4d,_0x35c2a3);return{'method':_0x5352f7(0x1d7),'url':_0x37db4d[_0x5352f7(0x1be)],'body':{'target':targetPreview(_0x22d9a2),'params':_0x22d9a2[_0x5352f7(0x1af)]},'description':_0x5352f7(0x1e9)+_0x37db4d[_0x5352f7(0x1be)]};},async 'execute'(_0x2c8e71){const _0x272ac0=_0x361401,_0x22194b=await compilePlan(_0x37db4d,_0x2c8e71),_0x214439=Date[_0x272ac0(0x1fd)](),_0x2d3eb5=await executePlan(_0x22194b,_0x37db4d,_0x2c8e71),_0x299c99=Date[_0x272ac0(0x1fd)]()-_0x214439;return{'ok':!![],'data':{'service':_0x552810[_0x272ac0(0x1ea)],'command':_0x37db4d[_0x272ac0(0x1be)],'target':targetPreview(_0x22194b),'result':_0x2d3eb5,'elapsed':_0x299c99},'message':_0x272ac0(0x1ef)+_0x37db4d[_0x272ac0(0x1be)]+'\x20completed\x20in\x20'+_0x299c99+'ms'};}};}function buildDynamicConfirmationDescription(_0x2d13b8){const _0x2af84c=a39_0x414e,_0xec9508=_0x2d13b8[_0x2af84c(0x1d5)]||_0x2d13b8[_0x2af84c(0x1be)],_0x14b1f0=_0x2d13b8[_0x2af84c(0x1f6)]===_0x2af84c(0x1d3)?_0x2af84c(0x1fe):_0x2af84c(0x1f0);return'将通过\x20Service\x20Tree\x20执行“'+_0xec9508+'”。'+_0x14b1f0;}function dynamicCommandName(_0x10840a){const _0x4e80ec=a39_0x414e;return _0x10840a[_0x4e80ec(0x1ba)][_0x4e80ec(0x20b)](0x1)['join']('\x20');}function riskTag(_0x3c7281){const _0x457dd5=a39_0x414e;return _0x3c7281===_0x457dd5(0x1b5)?'':'\x20\x20['+_0x3c7281+']';}function flagToCommandFlag(_0x2451c0){const _0x716039=a39_0x414e;return{'name':_0x2451c0[_0x716039(0x1c3)],'type':_0x2451c0[_0x716039(0x202)]===_0x716039(0x1e4)?_0x716039(0x1ec):_0x2451c0[_0x716039(0x202)],'description':_0x2451c0[_0x716039(0x1d5)]||_0x2451c0[_0x716039(0x1ac)],'required':_0x2451c0['required'],'default':isPrimitiveFlagDefault(_0x2451c0[_0x716039(0x1e6)])?_0x2451c0['default']:undefined,'enum':_0x2451c0['enum']};}async function compilePlan(_0x52c26c,_0x48f691){const _0x5ce31d=a39_0x414e;return compileServiceTreeCommand(_0x52c26c,{'flags':_0x48f691[_0x5ce31d(0x200)],'args':_0x48f691['args'],'context':await buildServiceContext(_0x52c26c,_0x48f691)});}async function buildServiceContext(_0x14fcdd,_0x4973bd){const _0x54008e=a39_0x414e,_0xed3c6={'appCode':_0x4973bd['appCode'],'env':_0x4973bd[_0x54008e(0x1e2)],'envName':_0x4973bd['envName']};if(!usesRuntimeContext(_0x14fcdd))return _0xed3c6;const _0x6fca98=await getLoginUserInfo(),_0x24843c=pickFirst(_0x6fca98[_0x54008e(0x1fb)],_0x6fca98['id']);return{..._0xed3c6,'user':_0x6fca98,'userId':_0x24843c,'id':_0x6fca98['id'],'username':pickFirst(_0x6fca98[_0x54008e(0x1da)],_0x6fca98[_0x54008e(0x1c8)],_0x6fca98['loginName']),'userName':_0x6fca98[_0x54008e(0x1c8)],'nickname':pickFirst(_0x6fca98[_0x54008e(0x20a)],_0x6fca98['nickName']),'nickName':_0x6fca98[_0x54008e(0x1f2)],'tenantCode':_0x6fca98[_0x54008e(0x1c6)],'employeeId':_0x6fca98['employeeId']};}function usesRuntimeContext(_0x167e02){const _0x2f17c3=a39_0x414e;return _0x167e02[_0x2f17c3(0x1f8)][_0x2f17c3(0x1b7)](_0x3acac9=>typeof _0x3acac9['source']==='string'&&(_0x3acac9[_0x2f17c3(0x1dd)][_0x2f17c3(0x1c0)](_0x2f17c3(0x206))||_0x3acac9[_0x2f17c3(0x1dd)][_0x2f17c3(0x1c0)]('ctx.')));}function pickFirst(..._0x381266){return _0x381266['find'](_0x5bb5ac=>_0x5bb5ac!==undefined&&_0x5bb5ac!==null);}async function executePlan(_0x9c5276,_0xe95598,_0x41a23b){const _0x17d2cc=a39_0x414e;if(_0x9c5276['kind']===_0x17d2cc(0x1d6)){const _0xcd6f5d=await resolveDatasetCode(_0x9c5276,_0xe95598,_0x41a23b);return executeData(_0xcd6f5d,_0x9c5276['command'],_0x9c5276['params']);}if(_0x9c5276[_0x17d2cc(0x208)]===_0x17d2cc(0x1d1)){if(!_0x9c5276[_0x17d2cc(0x1db)])throw CliErrors[_0x17d2cc(0x1b3)]('Service\x20command\x20'+_0xe95598[_0x17d2cc(0x1be)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x9c5276[_0x17d2cc(0x1db)],normalizeScalarParams(_0x9c5276['params']));}if(_0x9c5276[_0x17d2cc(0x208)]===_0x17d2cc(0x1e1)){const _0x1c0751=_0x9c5276['scriptName']||_0x9c5276[_0x17d2cc(0x1cc)]||(_0x9c5276[_0x17d2cc(0x1dc)]==null?'':String(_0x9c5276['bffId']));if(!_0x1c0751)throw CliErrors[_0x17d2cc(0x1b3)](_0x17d2cc(0x1ef)+_0xe95598['cliPath']+'\x20requires\x20target.functionName.');return executeSdkBff(_0x1c0751,_0x9c5276[_0x17d2cc(0x1af)]);}throw CliErrors[_0x17d2cc(0x1b3)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x9c5276[_0x17d2cc(0x208)]);}async function resolveDatasetCode(_0x5372ba,_0x285718,_0x19515a){const _0x3a76bc=a39_0x414e;if(_0x5372ba['datasetCode'])return _0x5372ba['datasetCode'];if(!_0x5372ba[_0x3a76bc(0x1fc)])throw CliErrors[_0x3a76bc(0x1b3)](_0x3a76bc(0x1ef)+_0x285718[_0x3a76bc(0x1be)]+_0x3a76bc(0x1c9));const _0x36d632=await listDatasets(_0x19515a[_0x3a76bc(0x209)]),_0x167718=_0x36d632[_0x3a76bc(0x1c7)](_0x14361d=>_0x14361d['dbtableConfig']?.['tableName']===_0x5372ba[_0x3a76bc(0x1fc)]);if(!_0x167718?.[_0x3a76bc(0x1bf)])throw CliErrors[_0x3a76bc(0x1b3)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x5372ba[_0x3a76bc(0x1fc)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x19515a[_0x3a76bc(0x209)]+'.',_0x3a76bc(0x1f9));return _0x167718['code'];}function applyAppBinding(_0x6f1db3,_0x4fecae,_0x4f6ec3){const _0x46826c=a39_0x414e,_0x39381c=_0x4fecae['target'][_0x46826c(0x204)];if(!_0x39381c)return;const _0x27a074=_0x6f1db3['appBindings'][_0x39381c];if(!_0x27a074)throw CliErrors[_0x46826c(0x1b3)]('Unknown\x20appRef\x20\x22'+_0x39381c+'\x22\x20in\x20service\x20command\x20'+_0x4fecae[_0x46826c(0x1be)]+'.',_0x46826c(0x1ca));const _0xcdd628=_0x27a074[_0x46826c(0x1b8)]||_0x27a074[_0x46826c(0x209)];_0xcdd628&&!hasText(_0x4f6ec3[_0x46826c(0x1b8)])&&(_0x4f6ec3[_0x46826c(0x1b8)]=_0xcdd628),_0x27a074[_0x46826c(0x1b6)]&&!hasText(_0x4f6ec3[_0x46826c(0x1b6)])&&!hasText(_0x4f6ec3['appcode'])&&(_0x4f6ec3['app']=_0x27a074[_0x46826c(0x1b6)]),_0x27a074[_0x46826c(0x1cd)]&&!hasText(_0x4f6ec3['env'])&&(_0x4f6ec3['env']=_0x27a074[_0x46826c(0x1cd)]);}function renderDynamicCommandHelp(_0x2d51bd){const _0x4ea79f=a39_0x414e,_0x7d8a3d=[_0x4ea79f(0x1c4),_0x4ea79f(0x1bc)+_0x2d51bd[_0x4ea79f(0x1ff)][_0x4ea79f(0x208)],_0x4ea79f(0x1bb)+_0x2d51bd[_0x4ea79f(0x1ff)][_0x4ea79f(0x1d4)]];if(_0x2d51bd[_0x4ea79f(0x1ff)][_0x4ea79f(0x1bd)])_0x7d8a3d[_0x4ea79f(0x205)](_0x4ea79f(0x1f3)+_0x2d51bd[_0x4ea79f(0x1ff)][_0x4ea79f(0x1bd)]);if(_0x2d51bd[_0x4ea79f(0x1ff)][_0x4ea79f(0x1fc)])_0x7d8a3d[_0x4ea79f(0x205)]('\x20\x20\x20\x20datatable:\x20'+_0x2d51bd[_0x4ea79f(0x1ff)][_0x4ea79f(0x1fc)]);if(_0x2d51bd['target'][_0x4ea79f(0x1db)])_0x7d8a3d[_0x4ea79f(0x205)](_0x4ea79f(0x1ab)+_0x2d51bd[_0x4ea79f(0x1ff)][_0x4ea79f(0x1db)]);if(_0x2d51bd[_0x4ea79f(0x1ff)][_0x4ea79f(0x1d2)])_0x7d8a3d[_0x4ea79f(0x205)](_0x4ea79f(0x1b4)+_0x2d51bd[_0x4ea79f(0x1ff)]['scriptName']);if(_0x2d51bd[_0x4ea79f(0x1f8)][_0x4ea79f(0x1df)]>0x0){_0x7d8a3d[_0x4ea79f(0x205)]('',_0x4ea79f(0x1ad));for(const _0x27a14c of _0x2d51bd[_0x4ea79f(0x1f8)]){_0x7d8a3d['push'](_0x4ea79f(0x1b1)+(_0x27a14c[_0x4ea79f(0x1dd)]||_0x4ea79f(0x1d8))+_0x4ea79f(0x1f4)+_0x27a14c[_0x4ea79f(0x1ff)]+(_0x27a14c[_0x4ea79f(0x1c2)]?'.'+_0x27a14c[_0x4ea79f(0x1c2)]:''));}}return _0x7d8a3d[_0x4ea79f(0x1d9)]('\x0a');}function targetPreview(_0x174faf){const _0x22da90=a39_0x414e;return{'kind':_0x174faf[_0x22da90(0x208)],'command':_0x174faf[_0x22da90(0x1d4)],'appRef':_0x174faf[_0x22da90(0x204)],'datasetCode':_0x174faf['datasetCode'],'datatable':_0x174faf[_0x22da90(0x1fc)],'sqlCode':_0x174faf['sqlCode'],'bffCode':_0x174faf[_0x22da90(0x1cc)],'bffId':_0x174faf[_0x22da90(0x1dc)],'functionName':_0x174faf[_0x22da90(0x1d2)]};}function normalizeScalarParams(_0x2b1031){const _0x5ccb55=a39_0x414e;return Object[_0x5ccb55(0x1de)](Object[_0x5ccb55(0x1d0)](_0x2b1031)[_0x5ccb55(0x1c5)](([,_0x41661e])=>typeof _0x41661e===_0x5ccb55(0x1ec)||typeof _0x41661e===_0x5ccb55(0x203)));}function hasText(_0x25de85){const _0x2660f6=a39_0x414e;return typeof _0x25de85===_0x2660f6(0x1ec)&&_0x25de85['trim']()[_0x2660f6(0x1df)]>0x0;}function isPrimitiveFlagDefault(_0x20f34e){const _0x32fe9b=a39_0x414e;return _0x20f34e===undefined||typeof _0x20f34e==='string'||typeof _0x20f34e===_0x32fe9b(0x203)||typeof _0x20f34e===_0x32fe9b(0x201);}
1
+ (function(_0x1a7551,_0x572f66){const _0x1e28d8=a39_0x8bbe,_0x32de88=_0x1a7551();while(!![]){try{const _0x37cb9d=-parseInt(_0x1e28d8(0xda))/0x1+-parseInt(_0x1e28d8(0xe3))/0x2*(parseInt(_0x1e28d8(0xc4))/0x3)+-parseInt(_0x1e28d8(0xd7))/0x4*(-parseInt(_0x1e28d8(0xd6))/0x5)+-parseInt(_0x1e28d8(0xcc))/0x6*(-parseInt(_0x1e28d8(0xf4))/0x7)+parseInt(_0x1e28d8(0xb9))/0x8+parseInt(_0x1e28d8(0xf0))/0x9*(parseInt(_0x1e28d8(0xec))/0xa)+-parseInt(_0x1e28d8(0xc1))/0xb;if(_0x37cb9d===_0x572f66)break;else _0x32de88['push'](_0x32de88['shift']());}catch(_0x17297a){_0x32de88['push'](_0x32de88['shift']());}}}(a39_0x2ec4,0x63cac));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';function a39_0x8bbe(_0x3f2705,_0x18fa91){_0x3f2705=_0x3f2705-0x8e;const _0x2ec4e1=a39_0x2ec4();let _0x8bbe89=_0x2ec4e1[_0x3f2705];return _0x8bbe89;}import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x25d339,_0x22d074){const _0x8317ea=a39_0x8bbe,_0x70d381=listLocalServiceTrees();let _0x434dd9;for(const _0x14a203 of _0x70d381){const _0x124ab1=matchServiceTreeCommand(_0x14a203,_0x25d339);if(!_0x124ab1)continue;(!_0x434dd9||_0x124ab1[_0x8317ea(0xaa)][_0x8317ea(0xa7)][_0x8317ea(0x98)]>_0x434dd9['command'][_0x8317ea(0xa7)][_0x8317ea(0x98)])&&(_0x434dd9={'tree':_0x14a203,'command':_0x124ab1[_0x8317ea(0xaa)],'remainingArgs':_0x124ab1[_0x8317ea(0xac)]});}if(!_0x434dd9)return undefined;const _0x1d009={..._0x22d074};return applyAppBinding(_0x434dd9[_0x8317ea(0x9a)],_0x434dd9[_0x8317ea(0xaa)],_0x1d009),{'definition':buildDynamicCommandDefinition(_0x434dd9[_0x8317ea(0x9a)],_0x434dd9[_0x8317ea(0xaa)]),'args':_0x434dd9[_0x8317ea(0xac)],'flags':_0x1d009,'tree':_0x434dd9[_0x8317ea(0x9a)],'command':_0x434dd9[_0x8317ea(0xaa)]};}export function generateDynamicServiceHelp(_0x363103){const _0x20e7be=a39_0x8bbe,_0x411f4d=listLocalServiceTrees()[_0x20e7be(0xf5)](_0x214d55=>_0x214d55['service'][_0x20e7be(0x95)]===_0x363103);if(!_0x411f4d)return undefined;const _0x319fa6=[CLI_BIN_NAME+'\x20'+_0x363103+_0x20e7be(0xd0),'',_0x411f4d[_0x20e7be(0xc7)][_0x20e7be(0xf7)]||_0x363103,_0x411f4d['service'][_0x20e7be(0xe5)]?'\x20\x20'+_0x411f4d[_0x20e7be(0xc7)][_0x20e7be(0xe5)]:'','','Commands:',..._0x411f4d['commands'][_0x20e7be(0xf3)](_0x1694b5=>{const _0x117fd4=_0x20e7be,_0x1fb0b0=_0x1694b5[_0x117fd4(0xa7)]['slice'](0x1)[_0x117fd4(0xc8)]('\x20'),_0x17a8b8=_0x1694b5[_0x117fd4(0xf2)]==='read'?'':'\x20['+_0x1694b5[_0x117fd4(0xf2)]+']';return'\x20\x20'+_0x1fb0b0[_0x117fd4(0xbb)](0x18)+'\x20'+(_0x1694b5['description']||'')+_0x17a8b8;}),'','Use\x20`'+CLI_BIN_NAME+_0x20e7be(0x97)+_0x363103+_0x20e7be(0xa2)][_0x20e7be(0xa8)](Boolean);return _0x319fa6[_0x20e7be(0xc8)]('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0xf54fc0=>{const _0x292eb9=a39_0x8bbe,_0x2eff23=_0xf54fc0[_0x292eb9(0xc3)];return{'service':_0x2eff23[_0x292eb9(0xc7)][_0x292eb9(0x95)],'label':_0x2eff23['service'][_0x292eb9(0xf7)]||_0x2eff23[_0x292eb9(0xc7)][_0x292eb9(0x95)],'commands':_0x2eff23[_0x292eb9(0xe4)][_0x292eb9(0xf3)](_0x20b7b8=>({'command':dynamicCommandName(_0x20b7b8),'description':_0x20b7b8[_0x292eb9(0xe5)]||_0x292eb9(0xe0)+_0x20b7b8[_0x292eb9(0xb7)],'tag':riskTag(_0x20b7b8[_0x292eb9(0xf2)])}))};});}export function getDynamicServiceEntry(_0x20e25b){const _0x4b6943=a39_0x8bbe;return listDynamicServiceEntries()['find'](_0x3db5ac=>_0x3db5ac[_0x4b6943(0xc7)]===_0x20e25b);}export function listDynamicServiceDefinitions(_0x26a007){const _0x1bdf02=a39_0x8bbe;return listLocalServiceTrees()[_0x1bdf02(0xa8)](_0x1699e5=>!_0x26a007||_0x1699e5[_0x1bdf02(0xc7)][_0x1bdf02(0x95)]===_0x26a007)[_0x1bdf02(0xc0)](_0x425f9b=>_0x425f9b['commands'][_0x1bdf02(0xf3)](_0x45122b=>buildDynamicCommandDefinition(_0x425f9b,_0x45122b)));}export function getDynamicServiceDefinitions(_0x1f958d){const _0x42fb90=listDynamicServiceDefinitions(_0x1f958d);return _0x42fb90['length']>0x0?_0x42fb90:undefined;}export function findDynamicServiceDefinition(_0x1e3372,_0x28561a){const _0x109afd=a39_0x8bbe;return listDynamicServiceDefinitions(_0x1e3372)['find'](_0x196b60=>_0x196b60[_0x109afd(0xaa)]===_0x28561a);}export function buildDynamicCommandDefinition(_0x30e590,_0xf6ff44){const _0x50ddad=a39_0x8bbe;return{'service':_0x30e590['service'][_0x50ddad(0x95)],'command':dynamicCommandName(_0xf6ff44),'description':_0xf6ff44[_0x50ddad(0xe5)]||_0x50ddad(0xe0)+_0xf6ff44[_0x50ddad(0xb7)],'risk':_0xf6ff44[_0x50ddad(0xf2)],..._0xf6ff44[_0x50ddad(0xf2)]===_0x50ddad(0xfa)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0xf6ff44)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0xf6ff44[_0x50ddad(0x9f)][_0x50ddad(0xf3)](_0x4734cc=>({'name':_0x4734cc['name'],'description':_0x4734cc['description']||_0x4734cc[_0x50ddad(0xf7)],'required':_0x4734cc[_0x50ddad(0x9b)]})),'flags':_0xf6ff44[_0x50ddad(0xd2)][_0x50ddad(0xf3)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0xf6ff44),async 'dryRun'(_0xe1a15f){const _0x83c75b=_0x50ddad,_0x7539f=await compilePlan(_0xf6ff44,_0xe1a15f);return{'method':_0x83c75b(0xc2),'url':_0xf6ff44['cliPath'],'body':{'target':targetPreview(_0x7539f),'params':_0x7539f[_0x83c75b(0xc9)]},'description':_0x83c75b(0xca)+_0xf6ff44[_0x83c75b(0xb7)]};},async 'execute'(_0x461cdb){const _0x3269e5=_0x50ddad,_0x13a07b=await compilePlan(_0xf6ff44,_0x461cdb),_0x4e6667=Date[_0x3269e5(0xb3)](),_0x1a49c1=await executePlan(_0x13a07b,_0xf6ff44,_0x461cdb),_0x26dd97=Date['now']()-_0x4e6667;return{'ok':!![],'data':{'service':_0x30e590[_0x3269e5(0xc7)],'command':_0xf6ff44['cliPath'],'target':targetPreview(_0x13a07b),'result':_0x1a49c1,'elapsed':_0x26dd97},'message':_0x3269e5(0xba)+_0xf6ff44[_0x3269e5(0xb7)]+_0x3269e5(0xeb)+_0x26dd97+'ms'};}};}function buildDynamicConfirmationDescription(_0x1673a8){const _0x27df2b=a39_0x8bbe,_0x3058a9=_0x1673a8[_0x27df2b(0xe5)]||_0x1673a8[_0x27df2b(0xb7)],_0x294ad1=_0x1673a8[_0x27df2b(0xf2)]===_0x27df2b(0x8f)?'该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。':_0x27df2b(0xdc);return _0x27df2b(0xce)+_0x3058a9+'”。'+_0x294ad1;}function dynamicCommandName(_0x345362){const _0x1cad5b=a39_0x8bbe;return _0x345362[_0x1cad5b(0xa7)][_0x1cad5b(0xa3)](0x1)[_0x1cad5b(0xc8)]('\x20');}function riskTag(_0xda5f37){const _0x313dfc=a39_0x8bbe;return _0xda5f37===_0x313dfc(0xfa)?'':_0x313dfc(0xe9)+_0xda5f37+']';}function flagToCommandFlag(_0x4b5de5){const _0x307925=a39_0x8bbe;return{'name':_0x4b5de5[_0x307925(0xa4)],'type':_0x4b5de5[_0x307925(0xde)]===_0x307925(0x93)?_0x307925(0x9c):_0x4b5de5[_0x307925(0xde)],'description':_0x4b5de5[_0x307925(0xe5)]||_0x4b5de5[_0x307925(0xf7)],'required':_0x4b5de5[_0x307925(0x9b)],'default':isPrimitiveFlagDefault(_0x4b5de5[_0x307925(0xb2)])?_0x4b5de5[_0x307925(0xb2)]:undefined,'enum':_0x4b5de5[_0x307925(0xdd)]};}async function compilePlan(_0x18ceba,_0x52963c){const _0x21ef5f=a39_0x8bbe;return compileServiceTreeCommand(_0x18ceba,{'flags':_0x52963c[_0x21ef5f(0xa1)],'args':_0x52963c[_0x21ef5f(0x9f)],'context':await buildServiceContext(_0x18ceba,_0x52963c)});}function a39_0x2ec4(){const _0xfc1330=['name','\x20\x20\x20\x20datasetCode:\x20','\x20\x20\x20\x20kind:\x20\x20\x20\x20','read','source','datatable','high-risk-write','\x20\x20MAP\x20TO','nickName','Unsupported\x20service\x20target\x20kind:\x20','json','dbtableConfig','code','Unknown\x20appRef\x20\x22','\x20service\x20detail\x20--service\x20','length','appcode','tree','required','string','sql','\x20->\x20','args','\x20requires\x20target.sqlCode.','rawFlags','`\x20to\x20inspect\x20the\x20manifest.','slice','cliName','\x20\x20\x20\x20sqlCode:\x20','envName','fullPath','filter','\x22\x20in\x20service\x20command\x20','command','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','remainingArgs','push','\x20\x20\x20\x20command:\x20','username','some','scriptName','default','now','datasetCode','\x20requires\x20target.functionName.','userId','cliPath','number','409496zJVagw','Service\x20command\x20','padEnd','appBindings','ctx.','data','\x20\x20\x20\x20','flatMap','6667760cGrQVo','SERVICE_TREE','normalizedManifest','2022JLvfaC','appRef','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','service','join','params','Preview\x20dynamic\x20service\x20command:\x20','employeeId','61062nMWUeD','bffCode','将通过\x20Service\x20Tree\x20执行“','env','\x20<command>\x20[flags]','entries','flags','userName','mapTo','nickname','2618890NmkZFA','4RiXUpS','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','operator','133867xjncmh','trim','该命令被清单标记为写入,可能修改业务数据或服务状态。','enum','type','\x20\x20\x20\x20functionName:\x20','Run\x20service\x20command\x20','validation','loginName','1866MmKZHV','commands','description','app','\x20\x20SERVICE\x20TREE\x20TARGET','target','\x20\x20[','bffId','\x20completed\x20in\x20','1210wEldod','kind','appCode','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','31167xVodCS','sqlCode','risk','map','539VkkrFy','find','startsWith'];a39_0x2ec4=function(){return _0xfc1330;};return a39_0x2ec4();}async function buildServiceContext(_0x3a44af,_0x456322){const _0x336cda=a39_0x8bbe,_0x31dc1b={'appCode':_0x456322[_0x336cda(0xee)],'env':_0x456322[_0x336cda(0xa6)],'envName':_0x456322[_0x336cda(0xa6)]};if(!usesRuntimeContext(_0x3a44af))return _0x31dc1b;const _0x5c363e=await getLoginUserInfo(),_0x2b6efb=pickFirst(_0x5c363e[_0x336cda(0xb6)],_0x5c363e['id']);return{..._0x31dc1b,'user':_0x5c363e,'userId':_0x2b6efb,'id':_0x5c363e['id'],'username':pickFirst(_0x5c363e[_0x336cda(0xaf)],_0x5c363e[_0x336cda(0xd3)],_0x5c363e[_0x336cda(0xe2)]),'userName':_0x5c363e['userName'],'nickname':pickFirst(_0x5c363e[_0x336cda(0xd5)],_0x5c363e[_0x336cda(0x91)]),'nickName':_0x5c363e[_0x336cda(0x91)],'tenantCode':_0x5c363e['tenantCode'],'employeeId':_0x5c363e[_0x336cda(0xcb)]};}function usesRuntimeContext(_0x4cba60){const _0x3592fe=a39_0x8bbe;return _0x4cba60['mapTo'][_0x3592fe(0xb0)](_0x40aa96=>typeof _0x40aa96[_0x3592fe(0xfb)]===_0x3592fe(0x9c)&&(_0x40aa96[_0x3592fe(0xfb)][_0x3592fe(0xf6)]('context.')||_0x40aa96[_0x3592fe(0xfb)][_0x3592fe(0xf6)](_0x3592fe(0xbd))));}function pickFirst(..._0x5a1695){const _0x5dadf1=a39_0x8bbe;return _0x5a1695[_0x5dadf1(0xf5)](_0x218bcd=>_0x218bcd!==undefined&&_0x218bcd!==null);}async function executePlan(_0x3f1843,_0x21c80a,_0xe51457){const _0x3ba810=a39_0x8bbe;if(_0x3f1843['kind']===_0x3ba810(0xbe)){const _0xc172ba=await resolveDatasetCode(_0x3f1843,_0x21c80a,_0xe51457);return executeData(_0xc172ba,_0x3f1843['command'],_0x3f1843['params']);}if(_0x3f1843[_0x3ba810(0xed)]===_0x3ba810(0x9d)){if(!_0x3f1843['sqlCode'])throw CliErrors[_0x3ba810(0xe1)](_0x3ba810(0xba)+_0x21c80a[_0x3ba810(0xb7)]+_0x3ba810(0xa0));return executeSdkSql(_0x3f1843[_0x3ba810(0xf1)],normalizeScalarParams(_0x3f1843[_0x3ba810(0xc9)]));}if(_0x3f1843['kind']==='bff'){const _0x3110dc=_0x3f1843[_0x3ba810(0xb1)]||_0x3f1843[_0x3ba810(0xcd)]||(_0x3f1843[_0x3ba810(0xea)]==null?'':String(_0x3f1843[_0x3ba810(0xea)]));if(!_0x3110dc)throw CliErrors[_0x3ba810(0xe1)](_0x3ba810(0xba)+_0x21c80a['cliPath']+_0x3ba810(0xb5));return executeSdkBff(_0x3110dc,_0x3f1843[_0x3ba810(0xc9)]);}throw CliErrors[_0x3ba810(0xe1)](_0x3ba810(0x92)+_0x3f1843[_0x3ba810(0xed)]);}async function resolveDatasetCode(_0x48548c,_0x5bbc1c,_0x24c27c){const _0x3e9fb4=a39_0x8bbe;if(_0x48548c[_0x3e9fb4(0xb4)])return _0x48548c['datasetCode'];if(!_0x48548c[_0x3e9fb4(0x8e)])throw CliErrors[_0x3e9fb4(0xe1)](_0x3e9fb4(0xba)+_0x5bbc1c['cliPath']+_0x3e9fb4(0xab));const _0x26d2b1=await listDatasets(_0x24c27c['appCode']),_0x31f383=_0x26d2b1[_0x3e9fb4(0xf5)](_0x4e6a5c=>_0x4e6a5c[_0x3e9fb4(0x94)]?.['tableName']===_0x48548c[_0x3e9fb4(0x8e)]);if(!_0x31f383?.[_0x3e9fb4(0x95)])throw CliErrors[_0x3e9fb4(0xe1)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x48548c[_0x3e9fb4(0x8e)]+_0x3e9fb4(0xd8)+_0x24c27c[_0x3e9fb4(0xee)]+'.',_0x3e9fb4(0xc6));return _0x31f383[_0x3e9fb4(0x95)];}function applyAppBinding(_0x4575d6,_0x3174fa,_0x2d8fa4){const _0x119458=a39_0x8bbe,_0x420a45=_0x3174fa[_0x119458(0xe8)][_0x119458(0xc5)];if(!_0x420a45)return;const _0x134bb5=_0x4575d6[_0x119458(0xbc)][_0x420a45];if(!_0x134bb5)throw CliErrors[_0x119458(0xe1)](_0x119458(0x96)+_0x420a45+_0x119458(0xa9)+_0x3174fa['cliPath']+'.',_0x119458(0xef));const _0x4a19b2=_0x134bb5['appcode']||_0x134bb5[_0x119458(0xee)];_0x4a19b2&&!hasText(_0x2d8fa4[_0x119458(0x99)])&&(_0x2d8fa4[_0x119458(0x99)]=_0x4a19b2),_0x134bb5[_0x119458(0xe6)]&&!hasText(_0x2d8fa4['app'])&&!hasText(_0x2d8fa4['appcode'])&&(_0x2d8fa4[_0x119458(0xe6)]=_0x134bb5[_0x119458(0xe6)]),_0x134bb5['env']&&!hasText(_0x2d8fa4[_0x119458(0xcf)])&&(_0x2d8fa4['env']=_0x134bb5[_0x119458(0xcf)]);}function renderDynamicCommandHelp(_0x41d72f){const _0x1b5474=a39_0x8bbe,_0x44545c=[_0x1b5474(0xe7),_0x1b5474(0xf9)+_0x41d72f['target'][_0x1b5474(0xed)],_0x1b5474(0xae)+_0x41d72f['target'][_0x1b5474(0xaa)]];if(_0x41d72f[_0x1b5474(0xe8)][_0x1b5474(0xb4)])_0x44545c['push'](_0x1b5474(0xf8)+_0x41d72f[_0x1b5474(0xe8)]['datasetCode']);if(_0x41d72f[_0x1b5474(0xe8)]['datatable'])_0x44545c['push']('\x20\x20\x20\x20datatable:\x20'+_0x41d72f[_0x1b5474(0xe8)][_0x1b5474(0x8e)]);if(_0x41d72f[_0x1b5474(0xe8)][_0x1b5474(0xf1)])_0x44545c[_0x1b5474(0xad)](_0x1b5474(0xa5)+_0x41d72f[_0x1b5474(0xe8)]['sqlCode']);if(_0x41d72f[_0x1b5474(0xe8)][_0x1b5474(0xb1)])_0x44545c[_0x1b5474(0xad)](_0x1b5474(0xdf)+_0x41d72f[_0x1b5474(0xe8)][_0x1b5474(0xb1)]);if(_0x41d72f['mapTo'][_0x1b5474(0x98)]>0x0){_0x44545c[_0x1b5474(0xad)]('',_0x1b5474(0x90));for(const _0x52c3da of _0x41d72f[_0x1b5474(0xd4)]){_0x44545c[_0x1b5474(0xad)](_0x1b5474(0xbf)+(_0x52c3da['source']||'const')+_0x1b5474(0x9e)+_0x52c3da[_0x1b5474(0xe8)]+(_0x52c3da['operator']?'.'+_0x52c3da[_0x1b5474(0xd9)]:''));}}return _0x44545c[_0x1b5474(0xc8)]('\x0a');}function targetPreview(_0x418c33){const _0x3af3ff=a39_0x8bbe;return{'kind':_0x418c33[_0x3af3ff(0xed)],'command':_0x418c33[_0x3af3ff(0xaa)],'appRef':_0x418c33['appRef'],'datasetCode':_0x418c33['datasetCode'],'datatable':_0x418c33[_0x3af3ff(0x8e)],'sqlCode':_0x418c33[_0x3af3ff(0xf1)],'bffCode':_0x418c33['bffCode'],'bffId':_0x418c33[_0x3af3ff(0xea)],'functionName':_0x418c33[_0x3af3ff(0xb1)]};}function normalizeScalarParams(_0x24b393){const _0x16e5e1=a39_0x8bbe;return Object['fromEntries'](Object[_0x16e5e1(0xd1)](_0x24b393)[_0x16e5e1(0xa8)](([,_0x60854b])=>typeof _0x60854b==='string'||typeof _0x60854b===_0x16e5e1(0xb8)));}function hasText(_0x3984da){const _0x1c3ba9=a39_0x8bbe;return typeof _0x3984da===_0x1c3ba9(0x9c)&&_0x3984da[_0x1c3ba9(0xdb)]()[_0x1c3ba9(0x98)]>0x0;}function isPrimitiveFlagDefault(_0x2620dd){const _0x586211=a39_0x8bbe;return _0x2620dd===undefined||typeof _0x2620dd==='string'||typeof _0x2620dd===_0x586211(0xb8)||typeof _0x2620dd==='boolean';}
@@ -1 +1 @@
1
- (function(_0x5ce8ef,_0x453937){const _0x5e97c1=a40_0x4b55,_0x15bfe0=_0x5ce8ef();while(!![]){try{const _0x29607c=-parseInt(_0x5e97c1(0xea))/0x1*(parseInt(_0x5e97c1(0xf5))/0x2)+-parseInt(_0x5e97c1(0xff))/0x3+parseInt(_0x5e97c1(0xe6))/0x4*(-parseInt(_0x5e97c1(0xeb))/0x5)+-parseInt(_0x5e97c1(0x100))/0x6+parseInt(_0x5e97c1(0xed))/0x7+-parseInt(_0x5e97c1(0xfc))/0x8*(parseInt(_0x5e97c1(0xf9))/0x9)+parseInt(_0x5e97c1(0xe8))/0xa*(parseInt(_0x5e97c1(0xde))/0xb);if(_0x29607c===_0x453937)break;else _0x15bfe0['push'](_0x15bfe0['shift']());}catch(_0xadc7b9){_0x15bfe0['push'](_0x15bfe0['shift']());}}}(a40_0x6b17,0x99d70));function a40_0x6b17(){const _0x4d0d94=['83209eGkYQZ','25xvyzOv','fromEntries','6022471TGAEXx','forEach','.actions.','.functionName','bff.exec','prototype','actions','map','6hdrYLC','.resources','trim','action','15291yFUowO','entries','$.commands[','1824pSIWAP','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','target','2141166HeShWH','2517498IMPvQT','isArray','object','].target','scriptName','1728298VfDqSU','error','string','resources','push','commands','functionName','bff','401964POpECr','kind','130ZjrESN','call'];a40_0x6b17=function(){return _0x4d0d94;};return a40_0x6b17();}export function adaptServiceTreeManifestForLegacyFramework(_0x2fcad4){const _0x3a7117=a40_0x4b55,_0x4a0ead=cloneJsonValue(_0x2fcad4),_0xe0fee5=[];if(!isObjectRecord(_0x4a0ead))return{'manifest':_0x4a0ead,'errors':_0xe0fee5};return Array[_0x3a7117(0x101)](_0x4a0ead[_0x3a7117(0xe3)])&&_0x4a0ead[_0x3a7117(0xe3)][_0x3a7117(0xee)]((_0x8dbad6,_0x5bcf63)=>{const _0x52c656=_0x3a7117;if(!isObjectRecord(_0x8dbad6))return;adaptBffTarget(_0x8dbad6[_0x52c656(0xfe)],_0x52c656(0xfb)+_0x5bcf63+_0x52c656(0xdc),_0xe0fee5);}),adaptResources(_0x4a0ead[_0x3a7117(0xe1)],'$.resources',_0xe0fee5),{'manifest':_0x4a0ead,'errors':_0xe0fee5};}export function toPublicServiceTreeTarget(_0x1a79c6){const _0x8b48c8=a40_0x4b55,{scriptName:_0x1dec2a,..._0x2acc22}=_0x1a79c6;return typeof _0x1dec2a===_0x8b48c8(0xe0)&&_0x1dec2a[_0x8b48c8(0xf7)]()&&(_0x2acc22['functionName']=_0x1dec2a),_0x2acc22;}export function toPublicNormalizedServiceTree(_0x59602f){const _0x4ac9d4=a40_0x4b55;return{..._0x59602f,'commands':_0x59602f[_0x4ac9d4(0xe3)][_0x4ac9d4(0xf4)](_0x464d51=>({..._0x464d51,'target':toPublicServiceTreeTarget(_0x464d51[_0x4ac9d4(0xfe)])}))};}function adaptResources(_0x3eacfd,_0xbf612f,_0x523521){const _0x2258aa=a40_0x4b55;if(!isObjectRecord(_0x3eacfd))return;for(const [_0xa44409,_0x14c7c2]of Object[_0x2258aa(0xfa)](_0x3eacfd)){if(!isObjectRecord(_0x14c7c2))continue;const _0x4b6bcc=_0xbf612f+'.'+_0xa44409;if(isObjectRecord(_0x14c7c2[_0x2258aa(0xf3)]))for(const [_0x3aab4d,_0x43ade5]of Object[_0x2258aa(0xfa)](_0x14c7c2['actions'])){if(!isObjectRecord(_0x43ade5))continue;const _0x301aca=_0x4b6bcc+_0x2258aa(0xef)+_0x3aab4d,_0x9bd567=isObjectRecord(_0x43ade5[_0x2258aa(0xfe)])&&_0x43ade5[_0x2258aa(0xfe)][_0x2258aa(0xe7)]===_0x2258aa(0xe5);adaptBffTarget(_0x43ade5[_0x2258aa(0xfe)],_0x301aca+'.target',_0x523521),(_0x9bd567||isBffAction(_0x43ade5))&&adaptFunctionNameField(_0x43ade5,_0x301aca,_0x523521);}adaptResources(_0x14c7c2['resources'],_0x4b6bcc+_0x2258aa(0xf6),_0x523521);}}function adaptBffTarget(_0x46d152,_0x1d5cd0,_0x4c9af9){const _0x5ddafb=a40_0x4b55;if(!isObjectRecord(_0x46d152)||_0x46d152[_0x5ddafb(0xe7)]!==_0x5ddafb(0xe5))return;adaptFunctionNameField(_0x46d152,_0x1d5cd0,_0x4c9af9);}function adaptFunctionNameField(_0x5725f5,_0x10ad31,_0x552f8b){const _0x37456e=a40_0x4b55;Object[_0x37456e(0xf2)]['hasOwnProperty']['call'](_0x5725f5,'scriptName')&&_0x552f8b['push']({'level':_0x37456e(0xdf),'path':_0x10ad31+'.scriptName','message':_0x37456e(0xfd)});if(Object[_0x37456e(0xf2)]['hasOwnProperty'][_0x37456e(0xe9)](_0x5725f5,_0x37456e(0xe4))){if(typeof _0x5725f5[_0x37456e(0xe4)]!==_0x37456e(0xe0)||!_0x5725f5['functionName'][_0x37456e(0xf7)]()){_0x552f8b[_0x37456e(0xe2)]({'level':_0x37456e(0xdf),'path':_0x10ad31+_0x37456e(0xf0),'message':'functionName\x20must\x20be\x20a\x20non-empty\x20string.'}),delete _0x5725f5[_0x37456e(0xe4)];return;}_0x5725f5[_0x37456e(0xdd)]=_0x5725f5['functionName'],delete _0x5725f5[_0x37456e(0xe4)];}}function isBffAction(_0x5c306a){const _0xe1ef63=a40_0x4b55;return _0x5c306a[_0xe1ef63(0xe7)]==='bff'||_0x5c306a[_0xe1ef63(0xf8)]===_0xe1ef63(0xf1)||_0x5c306a['target']===_0xe1ef63(0xf1);}function cloneJsonValue(_0x260c0e){const _0x502ca2=a40_0x4b55;if(Array[_0x502ca2(0x101)](_0x260c0e))return _0x260c0e[_0x502ca2(0xf4)](_0x59d6b6=>cloneJsonValue(_0x59d6b6));if(isObjectRecord(_0x260c0e))return Object[_0x502ca2(0xec)](Object[_0x502ca2(0xfa)](_0x260c0e)[_0x502ca2(0xf4)](([_0x1d2413,_0x4a04f8])=>[_0x1d2413,cloneJsonValue(_0x4a04f8)]));return _0x260c0e;}function a40_0x4b55(_0x2e7e26,_0x2bfb25){_0x2e7e26=_0x2e7e26-0xdb;const _0x6b178a=a40_0x6b17();let _0x4b55f3=_0x6b178a[_0x2e7e26];return _0x4b55f3;}function isObjectRecord(_0x437695){const _0x248b8e=a40_0x4b55;return Boolean(_0x437695)&&typeof _0x437695===_0x248b8e(0xdb)&&!Array[_0x248b8e(0x101)](_0x437695);}
1
+ (function(_0x4c3011,_0x5aef32){const _0x180e65=a40_0x491d,_0x3edc85=_0x4c3011();while(!![]){try{const _0x56f233=-parseInt(_0x180e65(0x14f))/0x1+parseInt(_0x180e65(0x13d))/0x2+parseInt(_0x180e65(0x150))/0x3*(parseInt(_0x180e65(0x13b))/0x4)+-parseInt(_0x180e65(0x151))/0x5+-parseInt(_0x180e65(0x144))/0x6*(-parseInt(_0x180e65(0x131))/0x7)+-parseInt(_0x180e65(0x145))/0x8*(-parseInt(_0x180e65(0x138))/0x9)+parseInt(_0x180e65(0x14b))/0xa*(-parseInt(_0x180e65(0x147))/0xb);if(_0x56f233===_0x5aef32)break;else _0x3edc85['push'](_0x3edc85['shift']());}catch(_0x5d2da7){_0x3edc85['push'](_0x3edc85['shift']());}}}(a40_0x43b1,0x8fb11));export function adaptServiceTreeManifestForLegacyFramework(_0x53efbc){const _0x2ef3d0=a40_0x491d,_0x35758d=cloneJsonValue(_0x53efbc),_0x177e69=[];if(!isObjectRecord(_0x35758d))return{'manifest':_0x35758d,'errors':_0x177e69};return Array[_0x2ef3d0(0x153)](_0x35758d['commands'])&&_0x35758d[_0x2ef3d0(0x12e)][_0x2ef3d0(0x152)]((_0x395e33,_0x3f276e)=>{const _0x45add7=_0x2ef3d0;if(!isObjectRecord(_0x395e33))return;adaptBffTarget(_0x395e33[_0x45add7(0x141)],_0x45add7(0x137)+_0x3f276e+_0x45add7(0x13c),_0x177e69);}),adaptResources(_0x35758d[_0x2ef3d0(0x14e)],'$.resources',_0x177e69),{'manifest':_0x35758d,'errors':_0x177e69};}export function toPublicServiceTreeTarget(_0x16ba31){const _0x52d5f7=a40_0x491d,{scriptName:_0x264b31,..._0x4e8998}=_0x16ba31;return typeof _0x264b31===_0x52d5f7(0x130)&&_0x264b31[_0x52d5f7(0x148)]()&&(_0x4e8998[_0x52d5f7(0x13f)]=_0x264b31),_0x4e8998;}function a40_0x491d(_0x2f0171,_0x386619){_0x2f0171=_0x2f0171-0x12e;const _0x43b12e=a40_0x43b1();let _0x491dd4=_0x43b12e[_0x2f0171];return _0x491dd4;}export function toPublicNormalizedServiceTree(_0x548b82){const _0x2c0b30=a40_0x491d;return{..._0x548b82,'commands':_0x548b82['commands']['map'](_0x3f870f=>({..._0x3f870f,'target':toPublicServiceTreeTarget(_0x3f870f[_0x2c0b30(0x141)])}))};}function adaptResources(_0x439a06,_0x15a7a3,_0x553b08){const _0x3b80c1=a40_0x491d;if(!isObjectRecord(_0x439a06))return;for(const [_0xa5c898,_0x288601]of Object[_0x3b80c1(0x154)](_0x439a06)){if(!isObjectRecord(_0x288601))continue;const _0x3bf360=_0x15a7a3+'.'+_0xa5c898;if(isObjectRecord(_0x288601[_0x3b80c1(0x139)]))for(const [_0x4ac197,_0x32170a]of Object['entries'](_0x288601[_0x3b80c1(0x139)])){if(!isObjectRecord(_0x32170a))continue;const _0x22320b=_0x3bf360+'.actions.'+_0x4ac197,_0x523a11=isObjectRecord(_0x32170a['target'])&&_0x32170a[_0x3b80c1(0x141)][_0x3b80c1(0x136)]===_0x3b80c1(0x143);adaptBffTarget(_0x32170a['target'],_0x22320b+'.target',_0x553b08),(_0x523a11||isBffAction(_0x32170a))&&adaptFunctionNameField(_0x32170a,_0x22320b,_0x553b08);}adaptResources(_0x288601['resources'],_0x3bf360+_0x3b80c1(0x142),_0x553b08);}}function adaptBffTarget(_0x36ac1b,_0x461097,_0x38fd67){const _0x56548c=a40_0x491d;if(!isObjectRecord(_0x36ac1b)||_0x36ac1b[_0x56548c(0x136)]!==_0x56548c(0x143))return;adaptFunctionNameField(_0x36ac1b,_0x461097,_0x38fd67);}function adaptFunctionNameField(_0x11ca32,_0x57815f,_0x14a111){const _0x568869=a40_0x491d;Object['prototype'][_0x568869(0x134)][_0x568869(0x12f)](_0x11ca32,'scriptName')&&_0x14a111[_0x568869(0x13e)]({'level':_0x568869(0x146),'path':_0x57815f+'.scriptName','message':_0x568869(0x140)});if(Object[_0x568869(0x14a)][_0x568869(0x134)]['call'](_0x11ca32,_0x568869(0x13f))){if(typeof _0x11ca32[_0x568869(0x13f)]!==_0x568869(0x130)||!_0x11ca32['functionName']['trim']()){_0x14a111['push']({'level':'error','path':_0x57815f+_0x568869(0x133),'message':_0x568869(0x132)}),delete _0x11ca32[_0x568869(0x13f)];return;}_0x11ca32[_0x568869(0x149)]=_0x11ca32['functionName'],delete _0x11ca32[_0x568869(0x13f)];}}function a40_0x43b1(){const _0x4c4c32=['246296KDiKxT','error','517KiyVQf','trim','scriptName','prototype','194630uTXjhl','action','bff.exec','resources','887726qJjlqR','3qCmqoL','1781375wAHnup','forEach','isArray','entries','commands','call','string','7bDclUf','functionName\x20must\x20be\x20a\x20non-empty\x20string.','.functionName','hasOwnProperty','map','kind','$.commands[','63FYDyfQ','actions','fromEntries','2246416czFwoh','].target','1775414KMNSvo','push','functionName','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','target','.resources','bff','6495018galpgf'];a40_0x43b1=function(){return _0x4c4c32;};return a40_0x43b1();}function isBffAction(_0x599ddf){const _0xfdc6ec=a40_0x491d;return _0x599ddf[_0xfdc6ec(0x136)]===_0xfdc6ec(0x143)||_0x599ddf[_0xfdc6ec(0x14c)]===_0xfdc6ec(0x14d)||_0x599ddf['target']===_0xfdc6ec(0x14d);}function cloneJsonValue(_0x5d7071){const _0x51c81e=a40_0x491d;if(Array[_0x51c81e(0x153)](_0x5d7071))return _0x5d7071[_0x51c81e(0x135)](_0x28820f=>cloneJsonValue(_0x28820f));if(isObjectRecord(_0x5d7071))return Object[_0x51c81e(0x13a)](Object[_0x51c81e(0x154)](_0x5d7071)[_0x51c81e(0x135)](([_0x28764e,_0x4af849])=>[_0x28764e,cloneJsonValue(_0x4af849)]));return _0x5d7071;}function isObjectRecord(_0x28fa44){const _0x4f00d6=a40_0x491d;return Boolean(_0x28fa44)&&typeof _0x28fa44==='object'&&!Array[_0x4f00d6(0x153)](_0x28fa44);}
@@ -1 +1 @@
1
- const a41_0x42c04e=a41_0x5270;(function(_0x44ab3f,_0x3c312e){const _0x445e7d=a41_0x5270,_0x4974e8=_0x44ab3f();while(!![]){try{const _0x5a8912=parseInt(_0x445e7d(0x1c6))/0x1*(parseInt(_0x445e7d(0x1de))/0x2)+parseInt(_0x445e7d(0x1af))/0x3*(-parseInt(_0x445e7d(0x1b5))/0x4)+parseInt(_0x445e7d(0x1a3))/0x5+-parseInt(_0x445e7d(0x1ca))/0x6+-parseInt(_0x445e7d(0x1e8))/0x7*(parseInt(_0x445e7d(0x1d0))/0x8)+parseInt(_0x445e7d(0x1ad))/0x9*(-parseInt(_0x445e7d(0x1d4))/0xa)+parseInt(_0x445e7d(0x1ac))/0xb*(parseInt(_0x445e7d(0x1d7))/0xc);if(_0x5a8912===_0x3c312e)break;else _0x4974e8['push'](_0x4974e8['shift']());}catch(_0x3fe5c8){_0x4974e8['push'](_0x4974e8['shift']());}}}(a41_0x3b82,0x6e1b0));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';function a41_0x5270(_0x7506f5,_0x1bd1c1){_0x7506f5=_0x7506f5-0x19e;const _0x3b82d1=a41_0x3b82();let _0x52707f=_0x3b82d1[_0x7506f5];return _0x52707f;}const FILE_FLAG={'name':a41_0x42c04e(0x1e7),'type':a41_0x42c04e(0x1b8),'required':!![],'description':a41_0x42c04e(0x1d3)},SERVICE_FLAG={'name':a41_0x42c04e(0x1cf),'type':a41_0x42c04e(0x1b8),'required':!![],'description':a41_0x42c04e(0x1b3),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function summarizeService(_0x5d820f){const _0x3617d6=a41_0x42c04e;return{'serviceCode':_0x5d820f[_0x3617d6(0x1c8)],'name':_0x5d820f[_0x3617d6(0x1a4)][_0x3617d6(0x1cf)]['name'],'version':_0x5d820f[_0x3617d6(0x1a9)],'importedAt':_0x5d820f[_0x3617d6(0x1a1)],'source':_0x5d820f[_0x3617d6(0x1bc)],'commandCount':_0x5d820f['normalizedManifest'][_0x3617d6(0x1b1)][_0x3617d6(0x1da)],'commands':_0x5d820f[_0x3617d6(0x1a4)]['commands']['map'](_0x172852=>({'path':_0x172852['cliPath'],'description':_0x172852['description'],'risk':_0x172852[_0x3617d6(0x1b9)],'target':toPublicServiceTreeTarget(_0x172852[_0x3617d6(0x1dd)]),'flags':_0x172852[_0x3617d6(0x1a5)][_0x3617d6(0x1c0)](_0x244e75=>({'name':_0x244e75['name'],'cliName':_0x244e75[_0x3617d6(0x1d5)],'type':_0x244e75[_0x3617d6(0x1d2)],'required':_0x244e75['required']===!![]}))}))};}function a41_0x3b82(){const _0x4d3060=['detail','12pardHO','replaced','kind','length','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','warnings','target','459686IZjlJB','entry','validate','read','errors','export','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','\x20service\x20','\x20service(s),\x20updated\x20','file','126lPfbul','registryServiceCode','filePath','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','Service\x20manifest\x20validation\x20passed.','importedAt','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','4032240uArmJF','normalizedManifest','flags','Imported','str','WRITE','version','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','Imported\x20','5450478koylvw','63iYPHNi','registryPath','222918vcYUCY','hash','commands','updated','Local\x20service\x20code,\x20for\x20example\x20crm','Exported\x20service\x20','8jxQVyO','reduce','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','string','risk','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','manifests','source','report','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','manifest','map','remove','serviceCount','imported','将\x20Service\x20Tree\x20清单导入本地运行态注册表','Local\x20service\x20not\x20found:\x20','3FziIAb','registry','serviceCode','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','3947706ojKiGq','从本地运行态注册表移除\x20Service\x20Tree\x20清单','Service\x20registry\x20validation\x20passed.','write','entries','service','277224vzhyyz','import','type','Service\x20Tree\x20manifest\x20file\x20path','157380eHTSdL','cliName'];a41_0x3b82=function(){return _0x4d3060;};return a41_0x3b82();}function summarizeLoadedManifest(_0x20e29c){const _0x26d8b7=a41_0x42c04e;return{'service':_0x20e29c[_0x26d8b7(0x1a4)]?.[_0x26d8b7(0x1cf)],'version':_0x20e29c[_0x26d8b7(0x1a4)]?.[_0x26d8b7(0x1a9)],'commandCount':_0x20e29c['normalizedManifest']?.['commands']['length']??0x0,'commands':_0x20e29c[_0x26d8b7(0x1a4)]?.['commands'][_0x26d8b7(0x1c0)](_0x22aded=>({'path':_0x22aded['cliPath'],'risk':_0x22aded[_0x26d8b7(0x1b9)],'target':toPublicServiceTreeTarget(_0x22aded['target'])}))??[],'registryIndex':_0x20e29c['registryIndex'],'registryServiceCode':_0x20e29c[_0x26d8b7(0x1e9)],'errors':_0x20e29c[_0x26d8b7(0x1bd)][_0x26d8b7(0x1e2)],'warnings':_0x20e29c[_0x26d8b7(0x1bd)][_0x26d8b7(0x1dc)]};}export const serviceDefinitions=[{'service':a41_0x42c04e(0x1cf),'command':a41_0x42c04e(0x1e0),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a41_0x42c04e(0x1e1),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x4a8d10){const _0x315571=a41_0x42c04e,_0x22db9c=loadServiceManifestFromFile(_0x4a8d10[_0x315571(0x1a7)](_0x315571(0x1e7)));if(!_0x22db9c[_0x315571(0x1bd)]['ok'])return{'ok':![],'data':{'file':_0x22db9c[_0x315571(0x19e)],'hash':_0x22db9c['hash'],'kind':_0x22db9c[_0x315571(0x1d9)],'serviceCount':_0x22db9c['manifests'][_0x315571(0x1da)],'services':_0x22db9c['manifests'][_0x315571(0x1c0)](summarizeLoadedManifest),'errors':_0x22db9c[_0x315571(0x1bd)][_0x315571(0x1e2)],'warnings':_0x22db9c['report'][_0x315571(0x1dc)]},'message':formatValidationFailure(_0x22db9c[_0x315571(0x1bd)])};if(_0x22db9c[_0x315571(0x1d9)]===_0x315571(0x1c7)||_0x22db9c['manifests'][_0x315571(0x1da)]!==0x1)return{'ok':!![],'data':{'file':_0x22db9c[_0x315571(0x19e)],'hash':_0x22db9c[_0x315571(0x1b0)],'kind':_0x22db9c[_0x315571(0x1d9)],'serviceCount':_0x22db9c[_0x315571(0x1bb)][_0x315571(0x1da)],'commandCount':_0x22db9c[_0x315571(0x1bb)][_0x315571(0x1b6)]((_0x356474,_0x11c0b0)=>_0x356474+(_0x11c0b0[_0x315571(0x1a4)]?.['commands'][_0x315571(0x1da)]??0x0),0x0),'services':_0x22db9c['manifests'][_0x315571(0x1c0)](summarizeLoadedManifest),'warnings':_0x22db9c[_0x315571(0x1bd)][_0x315571(0x1dc)]},'message':_0x315571(0x1cc)};return{'ok':!![],'data':{'file':_0x22db9c['filePath'],'hash':_0x22db9c['hash'],'kind':_0x22db9c[_0x315571(0x1d9)],'service':_0x22db9c[_0x315571(0x1a4)]?.[_0x315571(0x1cf)],'version':_0x22db9c['normalizedManifest']?.['version'],'commandCount':_0x22db9c[_0x315571(0x1a4)]?.[_0x315571(0x1b1)][_0x315571(0x1da)]??0x0,'commands':_0x22db9c[_0x315571(0x1a4)]?.[_0x315571(0x1b1)][_0x315571(0x1c0)](_0x178e89=>({'path':_0x178e89['cliPath'],'risk':_0x178e89['risk'],'target':toPublicServiceTreeTarget(_0x178e89[_0x315571(0x1dd)])})),'warnings':_0x22db9c[_0x315571(0x1bd)]['warnings']},'message':_0x315571(0x1a0)};}},{'service':a41_0x42c04e(0x1cf),'command':a41_0x42c04e(0x1d1),'description':a41_0x42c04e(0x1c4),'risk':a41_0x42c04e(0x1cd),'confirmationDescription':a41_0x42c04e(0x1b7),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0xbbeb07){const _0x2d6f55=a41_0x42c04e,_0x1ba5d0=loadServiceManifestFromFile(_0xbbeb07[_0x2d6f55(0x1a7)](_0x2d6f55(0x1e7)));return{'method':_0x2d6f55(0x1a8),'url':getServiceRegistryPath(),'body':{'file':_0x1ba5d0[_0x2d6f55(0x19e)],'hash':_0x1ba5d0[_0x2d6f55(0x1b0)],'kind':_0x1ba5d0['kind'],'ok':_0x1ba5d0['report']['ok'],'service':_0x1ba5d0[_0x2d6f55(0x1a4)]?.['service'],'version':_0x1ba5d0[_0x2d6f55(0x1a4)]?.[_0x2d6f55(0x1a9)],'serviceCount':_0x1ba5d0['manifests'][_0x2d6f55(0x1da)],'services':_0x1ba5d0[_0x2d6f55(0x1bb)][_0x2d6f55(0x1c0)](_0x2e4afc=>({'service':_0x2e4afc[_0x2d6f55(0x1a4)]?.[_0x2d6f55(0x1cf)],'version':_0x2e4afc[_0x2d6f55(0x1a4)]?.['version'],'commandCount':_0x2e4afc[_0x2d6f55(0x1a4)]?.[_0x2d6f55(0x1b1)][_0x2d6f55(0x1da)]??0x0,'errors':_0x2e4afc[_0x2d6f55(0x1bd)][_0x2d6f55(0x1e2)]})),'errors':_0x1ba5d0[_0x2d6f55(0x1bd)][_0x2d6f55(0x1e2)],'commandCount':_0x1ba5d0[_0x2d6f55(0x1a4)]?.['commands']['length']??0x0},'description':_0x2d6f55(0x1db)};},async 'execute'(_0x52e0b3){const _0x3ba75a=a41_0x42c04e,_0x2fc96a=importServiceManifest(_0x52e0b3['str'](_0x3ba75a(0x1e7)));if(_0x2fc96a[_0x3ba75a(0x1ce)][_0x3ba75a(0x1da)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x2fc96a[_0x3ba75a(0x1ae)],'imported':_0x2fc96a[_0x3ba75a(0x1c3)],'updated':_0x2fc96a['updated'],'serviceCount':_0x2fc96a[_0x3ba75a(0x1c2)],'services':_0x2fc96a['entries'][_0x3ba75a(0x1c0)](summarizeService)},'message':_0x3ba75a(0x1ab)+_0x2fc96a[_0x3ba75a(0x1c3)]+_0x3ba75a(0x1e6)+_0x2fc96a[_0x3ba75a(0x1b2)]+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x2fc96a[_0x3ba75a(0x1ae)],'replaced':_0x2fc96a[_0x3ba75a(0x1d8)],'imported':_0x2fc96a[_0x3ba75a(0x1c3)],'updated':_0x2fc96a[_0x3ba75a(0x1b2)],'serviceCount':_0x2fc96a['serviceCount'],'service':summarizeService(_0x2fc96a[_0x3ba75a(0x1df)])},'message':(_0x2fc96a[_0x3ba75a(0x1d8)]?'Updated':_0x3ba75a(0x1a6))+_0x3ba75a(0x1e5)+_0x2fc96a[_0x3ba75a(0x1df)]['serviceCode']+'.'};}},{'service':'service','command':a41_0x42c04e(0x1e3),'description':a41_0x42c04e(0x1c9),'risk':a41_0x42c04e(0x1cd),'confirmationDescription':a41_0x42c04e(0x19f),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x48a0d1){const _0x2dbf38=a41_0x42c04e,_0x35f36d=getLocalServiceEntry(_0x48a0d1[_0x2dbf38(0x1a7)]('service'));return{'method':_0x2dbf38(0x1a8),'url':_0x48a0d1[_0x2dbf38(0x1a7)]('file'),'body':{'service':_0x48a0d1['str']('service'),'found':Boolean(_0x35f36d),'version':_0x35f36d?.[_0x2dbf38(0x1a9)],'source':_0x35f36d?.[_0x2dbf38(0x1bc)]},'description':_0x2dbf38(0x1aa)};},async 'execute'(_0x41cca8){const _0x19e58e=a41_0x42c04e,_0x2d8814=exportServiceManifest(_0x41cca8[_0x19e58e(0x1a7)](_0x19e58e(0x1cf)),_0x41cca8[_0x19e58e(0x1a7)](_0x19e58e(0x1e7)));return{'ok':!![],'data':{'registryPath':_0x2d8814[_0x19e58e(0x1ae)],'file':_0x2d8814[_0x19e58e(0x19e)],'service':summarizeService(_0x2d8814[_0x19e58e(0x1df)])},'message':_0x19e58e(0x1b4)+_0x2d8814[_0x19e58e(0x1df)]['serviceCode']+'.'};}},{'service':a41_0x42c04e(0x1cf),'command':'list','description':a41_0x42c04e(0x1be),'risk':a41_0x42c04e(0x1e1),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x998c09=a41_0x42c04e,_0x386d35=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x386d35[_0x998c09(0x1da)],'services':_0x386d35[_0x998c09(0x1c0)](summarizeService)}};}},{'service':a41_0x42c04e(0x1cf),'command':a41_0x42c04e(0x1c1),'description':a41_0x42c04e(0x1cb),'risk':'write','confirmationDescription':a41_0x42c04e(0x1a2),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x25ba84){const _0x5cacbf=a41_0x42c04e,_0x166c5f=getLocalServiceEntry(_0x25ba84[_0x5cacbf(0x1a7)](_0x5cacbf(0x1cf)));return{'method':_0x5cacbf(0x1a8),'url':getServiceRegistryPath(),'body':{'service':_0x25ba84[_0x5cacbf(0x1a7)](_0x5cacbf(0x1cf)),'found':Boolean(_0x166c5f),'version':_0x166c5f?.[_0x5cacbf(0x1a9)],'source':_0x166c5f?.['source']},'description':_0x5cacbf(0x1e4)};},async 'execute'(_0x49ecf8){const _0x135b39=a41_0x42c04e,_0x41d0a1=removeServiceManifest(_0x49ecf8[_0x135b39(0x1a7)](_0x135b39(0x1cf)));return{'ok':!![],'data':{'registryPath':_0x41d0a1[_0x135b39(0x1ae)],'serviceCount':_0x41d0a1[_0x135b39(0x1c2)],'service':summarizeService(_0x41d0a1[_0x135b39(0x1df)])},'message':'Removed\x20service\x20'+_0x41d0a1['entry'][_0x135b39(0x1c8)]+'.'};}},{'service':a41_0x42c04e(0x1cf),'command':a41_0x42c04e(0x1d6),'description':a41_0x42c04e(0x1ba),'risk':a41_0x42c04e(0x1e1),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x1293ce){const _0x2eaae1=a41_0x42c04e,_0x3ad793=getLocalServiceEntry(_0x1293ce['str'](_0x2eaae1(0x1cf)));if(!_0x3ad793)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x1293ce['str'](_0x2eaae1(0x1cf))},'message':_0x2eaae1(0x1c5)+_0x1293ce[_0x2eaae1(0x1a7)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x3ad793),'manifest':_0x3ad793[_0x2eaae1(0x1bf)],'normalizedManifest':toPublicNormalizedServiceTree(_0x3ad793['normalizedManifest'])}};}}];
1
+ function a41_0x5ae8(_0x510e66,_0x28c91b){_0x510e66=_0x510e66-0xe6;const _0x328dea=a41_0x328d();let _0x5ae809=_0x328dea[_0x510e66];return _0x5ae809;}const a41_0x40692f=a41_0x5ae8;(function(_0x45cae6,_0x54c7be){const _0x78c968=a41_0x5ae8,_0x5e1626=_0x45cae6();while(!![]){try{const _0xf9d760=parseInt(_0x78c968(0x117))/0x1+parseInt(_0x78c968(0x11e))/0x2+-parseInt(_0x78c968(0x12c))/0x3*(-parseInt(_0x78c968(0x10d))/0x4)+-parseInt(_0x78c968(0xf7))/0x5+parseInt(_0x78c968(0x10c))/0x6+parseInt(_0x78c968(0x11a))/0x7+-parseInt(_0x78c968(0xe7))/0x8*(parseInt(_0x78c968(0x11c))/0x9);if(_0xf9d760===_0x54c7be)break;else _0x5e1626['push'](_0x5e1626['shift']());}catch(_0x2c1e8a){_0x5e1626['push'](_0x5e1626['shift']());}}}(a41_0x328d,0xf08b3));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a41_0x328d(){const _0x1549ae=['risk','registryPath','9128915SnTgCx','entry','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','import','hash','commands','Service\x20manifest\x20validation\x20passed.','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','name','write','cliName','flags','Imported','list','target','str','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','filePath','Service\x20registry\x20validation\x20passed.','validate','\x20service(s).','10954512eMSsuO','844108QWrAAh','Imported\x20','remove','Service\x20Tree\x20manifest\x20file\x20path','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','Local\x20service\x20not\x20found:\x20','cliPath','updated','manifests','1461410GQJbIc','Exported\x20service\x20','\x20service\x20','8494654ExNNjN','serviceCount','4333482qrbEne','report','1976654Zguyyr','Updated','registry','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','registryServiceCode','entries','source','normalizedManifest','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','type','WRITE','importedAt','read','将\x20Service\x20Tree\x20清单导入本地运行态注册表','3VnTjgM','kind','description','map','export','length','warnings','detail','errors','48WbrBdO','string','serviceCode','reduce','lower\x20kebab-case\x20service\x20code','version','\x20service(s),\x20updated\x20','replaced','manifest','service','file','imported','从本地运行态注册表移除\x20Service\x20Tree\x20清单','registryIndex'];a41_0x328d=function(){return _0x1549ae;};return a41_0x328d();}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a41_0x40692f(0xf1),'type':a41_0x40692f(0xe8),'required':!![],'description':a41_0x40692f(0x110)},SERVICE_FLAG={'name':a41_0x40692f(0xf0),'type':'string','required':!![],'description':'Local\x20service\x20code,\x20for\x20example\x20crm','pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x40692f(0xeb)}};function summarizeService(_0x1171e7){const _0x26e121=a41_0x40692f;return{'serviceCode':_0x1171e7['serviceCode'],'name':_0x1171e7[_0x26e121(0x125)][_0x26e121(0xf0)][_0x26e121(0xff)],'version':_0x1171e7['version'],'importedAt':_0x1171e7[_0x26e121(0x129)],'source':_0x1171e7['source'],'commandCount':_0x1171e7[_0x26e121(0x125)][_0x26e121(0xfc)][_0x26e121(0x131)],'commands':_0x1171e7['normalizedManifest'][_0x26e121(0xfc)]['map'](_0x33b798=>({'path':_0x33b798[_0x26e121(0x114)],'description':_0x33b798[_0x26e121(0x12e)],'risk':_0x33b798[_0x26e121(0xf5)],'target':toPublicServiceTreeTarget(_0x33b798[_0x26e121(0x105)]),'flags':_0x33b798[_0x26e121(0x102)][_0x26e121(0x12f)](_0x699d72=>({'name':_0x699d72['name'],'cliName':_0x699d72[_0x26e121(0x101)],'type':_0x699d72[_0x26e121(0x127)],'required':_0x699d72['required']===!![]}))}))};}function summarizeLoadedManifest(_0x5f336f){const _0x4ea216=a41_0x40692f;return{'service':_0x5f336f[_0x4ea216(0x125)]?.[_0x4ea216(0xf0)],'version':_0x5f336f[_0x4ea216(0x125)]?.[_0x4ea216(0xec)],'commandCount':_0x5f336f[_0x4ea216(0x125)]?.['commands'][_0x4ea216(0x131)]??0x0,'commands':_0x5f336f[_0x4ea216(0x125)]?.[_0x4ea216(0xfc)][_0x4ea216(0x12f)](_0xcf2598=>({'path':_0xcf2598[_0x4ea216(0x114)],'risk':_0xcf2598[_0x4ea216(0xf5)],'target':toPublicServiceTreeTarget(_0xcf2598[_0x4ea216(0x105)])}))??[],'registryIndex':_0x5f336f[_0x4ea216(0xf4)],'registryServiceCode':_0x5f336f[_0x4ea216(0x122)],'errors':_0x5f336f['report'][_0x4ea216(0xe6)],'warnings':_0x5f336f[_0x4ea216(0x11d)][_0x4ea216(0x132)]};}export const serviceDefinitions=[{'service':a41_0x40692f(0xf0),'command':a41_0x40692f(0x10a),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a41_0x40692f(0x12a),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x18de77){const _0x23e37a=a41_0x40692f,_0x56e070=loadServiceManifestFromFile(_0x18de77['str'](_0x23e37a(0xf1)));if(!_0x56e070[_0x23e37a(0x11d)]['ok'])return{'ok':![],'data':{'file':_0x56e070[_0x23e37a(0x108)],'hash':_0x56e070[_0x23e37a(0xfb)],'kind':_0x56e070[_0x23e37a(0x12d)],'serviceCount':_0x56e070[_0x23e37a(0x116)]['length'],'services':_0x56e070[_0x23e37a(0x116)][_0x23e37a(0x12f)](summarizeLoadedManifest),'errors':_0x56e070[_0x23e37a(0x11d)]['errors'],'warnings':_0x56e070['report']['warnings']},'message':formatValidationFailure(_0x56e070[_0x23e37a(0x11d)])};if(_0x56e070[_0x23e37a(0x12d)]===_0x23e37a(0x120)||_0x56e070[_0x23e37a(0x116)]['length']!==0x1)return{'ok':!![],'data':{'file':_0x56e070[_0x23e37a(0x108)],'hash':_0x56e070[_0x23e37a(0xfb)],'kind':_0x56e070[_0x23e37a(0x12d)],'serviceCount':_0x56e070['manifests'][_0x23e37a(0x131)],'commandCount':_0x56e070['manifests'][_0x23e37a(0xea)]((_0x5f9c56,_0x28798a)=>_0x5f9c56+(_0x28798a[_0x23e37a(0x125)]?.['commands']['length']??0x0),0x0),'services':_0x56e070[_0x23e37a(0x116)][_0x23e37a(0x12f)](summarizeLoadedManifest),'warnings':_0x56e070[_0x23e37a(0x11d)][_0x23e37a(0x132)]},'message':_0x23e37a(0x109)};return{'ok':!![],'data':{'file':_0x56e070[_0x23e37a(0x108)],'hash':_0x56e070[_0x23e37a(0xfb)],'kind':_0x56e070[_0x23e37a(0x12d)],'service':_0x56e070[_0x23e37a(0x125)]?.[_0x23e37a(0xf0)],'version':_0x56e070[_0x23e37a(0x125)]?.['version'],'commandCount':_0x56e070[_0x23e37a(0x125)]?.[_0x23e37a(0xfc)]['length']??0x0,'commands':_0x56e070['normalizedManifest']?.[_0x23e37a(0xfc)][_0x23e37a(0x12f)](_0x10d789=>({'path':_0x10d789['cliPath'],'risk':_0x10d789['risk'],'target':toPublicServiceTreeTarget(_0x10d789['target'])})),'warnings':_0x56e070['report']['warnings']},'message':_0x23e37a(0xfd)};}},{'service':'service','command':a41_0x40692f(0xfa),'description':a41_0x40692f(0x12b),'risk':a41_0x40692f(0x100),'confirmationDescription':'将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x266c79){const _0x10b227=a41_0x40692f,_0x263b44=loadServiceManifestFromFile(_0x266c79[_0x10b227(0x106)](_0x10b227(0xf1)));return{'method':_0x10b227(0x128),'url':getServiceRegistryPath(),'body':{'file':_0x263b44[_0x10b227(0x108)],'hash':_0x263b44[_0x10b227(0xfb)],'kind':_0x263b44[_0x10b227(0x12d)],'ok':_0x263b44[_0x10b227(0x11d)]['ok'],'service':_0x263b44['normalizedManifest']?.[_0x10b227(0xf0)],'version':_0x263b44[_0x10b227(0x125)]?.['version'],'serviceCount':_0x263b44[_0x10b227(0x116)]['length'],'services':_0x263b44[_0x10b227(0x116)][_0x10b227(0x12f)](_0x265bff=>({'service':_0x265bff['normalizedManifest']?.[_0x10b227(0xf0)],'version':_0x265bff[_0x10b227(0x125)]?.['version'],'commandCount':_0x265bff[_0x10b227(0x125)]?.[_0x10b227(0xfc)]['length']??0x0,'errors':_0x265bff[_0x10b227(0x11d)][_0x10b227(0xe6)]})),'errors':_0x263b44[_0x10b227(0x11d)][_0x10b227(0xe6)],'commandCount':_0x263b44[_0x10b227(0x125)]?.['commands'][_0x10b227(0x131)]??0x0},'description':_0x10b227(0x107)};},async 'execute'(_0x304b55){const _0x5c9ed1=a41_0x40692f,_0x4f2e17=importServiceManifest(_0x304b55[_0x5c9ed1(0x106)](_0x5c9ed1(0xf1)));if(_0x4f2e17[_0x5c9ed1(0x123)][_0x5c9ed1(0x131)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x4f2e17[_0x5c9ed1(0xf6)],'imported':_0x4f2e17[_0x5c9ed1(0xf2)],'updated':_0x4f2e17['updated'],'serviceCount':_0x4f2e17[_0x5c9ed1(0x11b)],'services':_0x4f2e17[_0x5c9ed1(0x123)]['map'](summarizeService)},'message':_0x5c9ed1(0x10e)+_0x4f2e17[_0x5c9ed1(0xf2)]+_0x5c9ed1(0xed)+_0x4f2e17['updated']+_0x5c9ed1(0x10b)};return{'ok':!![],'data':{'registryPath':_0x4f2e17[_0x5c9ed1(0xf6)],'replaced':_0x4f2e17[_0x5c9ed1(0xee)],'imported':_0x4f2e17[_0x5c9ed1(0xf2)],'updated':_0x4f2e17[_0x5c9ed1(0x115)],'serviceCount':_0x4f2e17[_0x5c9ed1(0x11b)],'service':summarizeService(_0x4f2e17['entry'])},'message':(_0x4f2e17[_0x5c9ed1(0xee)]?_0x5c9ed1(0x11f):_0x5c9ed1(0x103))+_0x5c9ed1(0x119)+_0x4f2e17['entry'][_0x5c9ed1(0xe9)]+'.'};}},{'service':'service','command':a41_0x40692f(0x130),'description':a41_0x40692f(0x111),'risk':a41_0x40692f(0x100),'confirmationDescription':a41_0x40692f(0xf9),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x35a971){const _0x46e318=a41_0x40692f,_0x29a920=getLocalServiceEntry(_0x35a971[_0x46e318(0x106)](_0x46e318(0xf0)));return{'method':_0x46e318(0x128),'url':_0x35a971[_0x46e318(0x106)]('file'),'body':{'service':_0x35a971[_0x46e318(0x106)](_0x46e318(0xf0)),'found':Boolean(_0x29a920),'version':_0x29a920?.[_0x46e318(0xec)],'source':_0x29a920?.[_0x46e318(0x124)]},'description':_0x46e318(0xfe)};},async 'execute'(_0x3ece1c){const _0x3f76af=a41_0x40692f,_0x5bbee5=exportServiceManifest(_0x3ece1c[_0x3f76af(0x106)]('service'),_0x3ece1c[_0x3f76af(0x106)]('file'));return{'ok':!![],'data':{'registryPath':_0x5bbee5['registryPath'],'file':_0x5bbee5[_0x3f76af(0x108)],'service':summarizeService(_0x5bbee5['entry'])},'message':_0x3f76af(0x118)+_0x5bbee5[_0x3f76af(0xf8)][_0x3f76af(0xe9)]+'.'};}},{'service':'service','command':a41_0x40692f(0x104),'description':a41_0x40692f(0x112),'risk':a41_0x40692f(0x12a),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x226dbe=a41_0x40692f,_0x3aaa57=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x3aaa57[_0x226dbe(0x131)],'services':_0x3aaa57[_0x226dbe(0x12f)](summarizeService)}};}},{'service':'service','command':a41_0x40692f(0x10f),'description':a41_0x40692f(0xf3),'risk':'write','confirmationDescription':'将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x3a4695){const _0xfafe71=a41_0x40692f,_0x194644=getLocalServiceEntry(_0x3a4695[_0xfafe71(0x106)](_0xfafe71(0xf0)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x3a4695[_0xfafe71(0x106)]('service'),'found':Boolean(_0x194644),'version':_0x194644?.[_0xfafe71(0xec)],'source':_0x194644?.[_0xfafe71(0x124)]},'description':_0xfafe71(0x121)};},async 'execute'(_0x3be13f){const _0x48eeaf=a41_0x40692f,_0x156cd9=removeServiceManifest(_0x3be13f['str'](_0x48eeaf(0xf0)));return{'ok':!![],'data':{'registryPath':_0x156cd9[_0x48eeaf(0xf6)],'serviceCount':_0x156cd9[_0x48eeaf(0x11b)],'service':summarizeService(_0x156cd9[_0x48eeaf(0xf8)])},'message':'Removed\x20service\x20'+_0x156cd9[_0x48eeaf(0xf8)][_0x48eeaf(0xe9)]+'.'};}},{'service':'service','command':a41_0x40692f(0x133),'description':a41_0x40692f(0x126),'risk':a41_0x40692f(0x12a),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x186cac){const _0x1395a7=a41_0x40692f,_0x25d816=getLocalServiceEntry(_0x186cac[_0x1395a7(0x106)](_0x1395a7(0xf0)));if(!_0x25d816)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x186cac[_0x1395a7(0x106)](_0x1395a7(0xf0))},'message':_0x1395a7(0x113)+_0x186cac[_0x1395a7(0x106)](_0x1395a7(0xf0))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x25d816),'manifest':_0x25d816[_0x1395a7(0xef)],'normalizedManifest':toPublicNormalizedServiceTree(_0x25d816['normalizedManifest'])}};}}];
@@ -1 +1 @@
1
- const a42_0x30ec34=a42_0x28a4;function a42_0x2382(){const _0xb859c7=['Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','Invalid\x20service\x20registry\x20JSON:\x20','updatedAt','Service\x20manifest\x20validation\x20failed:\x0a','$.services[','].manifest','command','145EMtzFe','string','homeDirName','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','slice','length','10298080QBdyiA','invalid','isArray','986USYEan','join','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','target','source','manifests','schemaVersion','warnings','service','services\x20must\x20be\x20an\x20array','map','parse','startsWith','risk','Local\x20service\x20not\x20found:\x20','flatMap','registryIndex','digest','553216QaMKio','errors','file','empty','homeDir','40932TfdtBh','object','description','64Mdpaci','3042486ORvblW','cliPath','Invalid\x20service\x20manifest\x20JSON:\x20','registry','commandCount','missing','toISOString','CliError','reduce','push','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','4337494ipJWBv','validation','normalizedManifest','trim','message','localeCompare','find','splice','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','15rrqmOJ','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','bff\x20target\x20requires\x20functionName.','Remove\x20or\x20migrate\x20','Cannot\x20write\x20service\x20registry:\x20','now','manifest','Service\x20manifest\x20file\x20not\x20found:\x20','filePath','code','report','stringify','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','utf8','path','commands','215328DPHvhc','kind','services','service.json','version','hex','serviceCode'];a42_0x2382=function(){return _0xb859c7;};return a42_0x2382();}(function(_0x9b503d,_0x4776a8){const _0x5cc45f=a42_0x28a4,_0x34f7f2=_0x9b503d();while(!![]){try{const _0x547dce=-parseInt(_0x5cc45f(0x1fb))/0x1*(parseInt(_0x5cc45f(0x204))/0x2)+parseInt(_0x5cc45f(0x1ed))/0x3+-parseInt(_0x5cc45f(0x216))/0x4*(-parseInt(_0x5cc45f(0x1dd))/0x5)+-parseInt(_0x5cc45f(0x21f))/0x6+-parseInt(_0x5cc45f(0x1d4))/0x7+parseInt(_0x5cc45f(0x21e))/0x8*(parseInt(_0x5cc45f(0x21b))/0x9)+parseInt(_0x5cc45f(0x201))/0xa;if(_0x547dce===_0x4776a8)break;else _0x34f7f2['push'](_0x34f7f2['shift']());}catch(_0x324a7a){_0x34f7f2['push'](_0x34f7f2['shift']());}}}(a42_0x2382,0x56970));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a42_0x30ec34(0x1f0);export function getServiceRegistryPath(_0x2a65d0={}){const _0x101fa3=a42_0x30ec34;return resolve(_0x2a65d0[_0x101fa3(0x21a)]??homedir(),PRODUCT_CONFIG[_0x101fa3(0x1fd)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x4b15f6={}){const _0x4222b5=a42_0x30ec34,_0x9433eb=getServiceRegistryPath(_0x4b15f6);if(!existsSync(_0x9433eb))return emptyServiceRegistry();try{const _0x422921=readFileSync(_0x9433eb,_0x4222b5(0x1ea));if(!_0x422921[_0x4222b5(0x1d7)]())return emptyServiceRegistry();const _0xb45b32=JSON[_0x4222b5(0x20f)](_0x422921);if(_0xb45b32['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x4222b5(0x1d5)]('Unsupported\x20service\x20registry\x20schemaVersion:\x20'+String(_0xb45b32[_0x4222b5(0x20a)]),_0x4222b5(0x1e0)+_0x9433eb+'.');if(!Array[_0x4222b5(0x203)](_0xb45b32['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0xb45b32[_0x4222b5(0x1f6)],'services':_0xb45b32[_0x4222b5(0x1ef)]};}catch(_0xa081a7){if(_0xa081a7 instanceof Error&&_0xa081a7['name']===_0x4222b5(0x226))throw _0xa081a7;throw CliErrors['validation'](_0x4222b5(0x1f5)+_0x9433eb,_0x4222b5(0x1de));}}export function writeServiceRegistry(_0x2de49e,_0x1b6e87={}){const _0x3866e3=a42_0x30ec34,_0x171746=getServiceRegistryPath(_0x1b6e87),_0x2a0ca4=dirname(_0x171746);!existsSync(_0x2a0ca4)&&mkdirSync(_0x2a0ca4,{'recursive':!![]});const _0x414075=_0x171746+'.tmp';try{writeFileSync(_0x414075,JSON['stringify'](_0x2de49e,null,0x2)+'\x0a',{'encoding':_0x3866e3(0x1ea),'mode':0x180}),renameSync(_0x414075,_0x171746);}catch(_0x24a31e){try{unlinkSync(_0x414075);}catch{}if(_0x24a31e?.[_0x3866e3(0x1e6)]==='ENOENT')throw CliErrors[_0x3866e3(0x1d5)](_0x3866e3(0x1e1)+_0x171746);throw _0x24a31e;}return _0x171746;}export function loadServiceManifestFromFile(_0xca5301){const _0x3ec13d=a42_0x30ec34,_0x16cfd9=resolve(_0xca5301);if(!existsSync(_0x16cfd9))throw CliErrors[_0x3ec13d(0x1d5)](_0x3ec13d(0x1e4)+_0xca5301);let _0x4aa70d;const _0xdce742=readFileSync(_0x16cfd9,_0x3ec13d(0x1ea));try{_0x4aa70d=JSON[_0x3ec13d(0x20f)](_0xdce742);}catch{throw CliErrors['validation'](_0x3ec13d(0x221)+_0xca5301,_0x3ec13d(0x1fe));}const _0x2848e5=sha256(_0xdce742),_0x3bcc83=extractLoadedServiceManifests(_0x4aa70d,_0x2848e5),_0x35c2fe=aggregateValidationReports(_0x3bcc83),_0x35d684=_0x3bcc83[0x0];return{'filePath':_0x16cfd9,'hash':_0x2848e5,'kind':isServiceRegistryLike(_0x4aa70d)?_0x3ec13d(0x222):'manifest','manifest':_0x35d684?.[_0x3ec13d(0x1e3)]??_0x4aa70d,'report':_0x35c2fe,'normalizedManifest':_0x3bcc83[_0x3ec13d(0x200)]===0x1?_0x35d684?.['normalizedManifest']:undefined,'manifests':_0x3bcc83};}export function importServiceManifest(_0x489182,_0x221cbd={}){const _0x18f7ce=a42_0x30ec34,_0x4fd937=loadServiceManifestFromFile(_0x489182);if(!_0x4fd937['report']['ok'])throw CliErrors['validation'](formatValidationFailure(_0x4fd937[_0x18f7ce(0x1e7)]),_0x18f7ce(0x1f4));if(_0x4fd937[_0x18f7ce(0x209)][_0x18f7ce(0x200)]===0x0)throw CliErrors[_0x18f7ce(0x1d5)](_0x18f7ce(0x1d3),_0x18f7ce(0x206));const _0x40b9b2=readServiceRegistry(_0x221cbd),_0x3b47e7=(_0x221cbd[_0x18f7ce(0x1e2)]??(()=>new Date()))()[_0x18f7ce(0x225)](),_0x4f141b=[];let _0xc2e64=0x0,_0x5c282e=0x0;for(const _0x433f57 of _0x4fd937['manifests']){if(!_0x433f57['normalizedManifest'])continue;const _0x564852=_0x433f57[_0x18f7ce(0x1d6)][_0x18f7ce(0x20c)][_0x18f7ce(0x1e6)],_0x3bc0a7={'serviceCode':_0x564852,'version':_0x433f57[_0x18f7ce(0x1d6)][_0x18f7ce(0x1f1)],'importedAt':_0x3b47e7,'source':{'type':_0x18f7ce(0x218),'path':_0x4fd937[_0x18f7ce(0x1e5)],'hash':_0x433f57['sourceHash']},'manifest':_0x433f57[_0x18f7ce(0x1e3)],'normalizedManifest':_0x433f57[_0x18f7ce(0x1d6)]},_0x2a32fe=_0x40b9b2['services']['findIndex'](_0x3fc37a=>_0x3fc37a[_0x18f7ce(0x1f3)]===_0x564852);_0x2a32fe>=0x0?(_0x40b9b2[_0x18f7ce(0x1ef)][_0x2a32fe]=_0x3bc0a7,_0x5c282e++):(_0x40b9b2[_0x18f7ce(0x1ef)][_0x18f7ce(0x228)](_0x3bc0a7),_0xc2e64++),_0x4f141b['push'](_0x3bc0a7);}_0x40b9b2['services']['sort']((_0x4d215d,_0x470ca5)=>_0x4d215d[_0x18f7ce(0x1f3)][_0x18f7ce(0x1d9)](_0x470ca5['serviceCode'])),_0x40b9b2[_0x18f7ce(0x1f6)]=_0x3b47e7;const _0x42c58e=writeServiceRegistry(_0x40b9b2,_0x221cbd);return{'registryPath':_0x42c58e,'entry':_0x4f141b[0x0],'replaced':_0x4f141b[_0x18f7ce(0x200)]===0x1?_0x5c282e===0x1:_0x5c282e>0x0,'entries':_0x4f141b,'imported':_0xc2e64,'updated':_0x5c282e,'serviceCount':_0x40b9b2['services'][_0x18f7ce(0x200)]};}function a42_0x28a4(_0x57c20b,_0x4c6771){_0x57c20b=_0x57c20b-0x1d3;const _0x2382ee=a42_0x2382();let _0x28a4ad=_0x2382ee[_0x57c20b];return _0x28a4ad;}export function exportServiceManifest(_0x31dcee,_0x8e10d3,_0x1d692c={}){const _0x2d6641=a42_0x30ec34,_0x36402e=getServiceRegistryPath(_0x1d692c),_0x200b50=getLocalServiceEntry(_0x31dcee,_0x1d692c);if(!_0x200b50)throw CliErrors[_0x2d6641(0x1d5)](_0x2d6641(0x212)+_0x31dcee,_0x2d6641(0x1dc));const _0x348a3c=resolve(_0x8e10d3),_0x39af43=dirname(_0x348a3c);return!existsSync(_0x39af43)&&mkdirSync(_0x39af43,{'recursive':!![]}),writeFileSync(_0x348a3c,JSON[_0x2d6641(0x1e8)](_0x200b50['manifest'],null,0x2)+'\x0a',{'encoding':_0x2d6641(0x1ea),'mode':0x180}),{'registryPath':_0x36402e,'filePath':_0x348a3c,'entry':_0x200b50};}export function removeServiceManifest(_0x112785,_0x4b2ac3={}){const _0x37641e=a42_0x30ec34,_0x2f7539=readServiceRegistry(_0x4b2ac3),_0x286539=_0x112785[_0x37641e(0x1d7)](),_0x12ce62=_0x2f7539[_0x37641e(0x1ef)]['findIndex'](_0x50e63d=>_0x50e63d[_0x37641e(0x1f3)]===_0x286539);if(_0x12ce62<0x0)throw CliErrors[_0x37641e(0x1d5)](_0x37641e(0x212)+_0x286539,_0x37641e(0x1dc));const [_0x5bd4e4]=_0x2f7539['services'][_0x37641e(0x1db)](_0x12ce62,0x1),_0x10c808=(_0x4b2ac3[_0x37641e(0x1e2)]??(()=>new Date()))()[_0x37641e(0x225)]();_0x2f7539['updatedAt']=_0x10c808;const _0x695136=writeServiceRegistry(_0x2f7539,_0x4b2ac3);return{'registryPath':_0x695136,'entry':_0x5bd4e4,'serviceCount':_0x2f7539[_0x37641e(0x1ef)][_0x37641e(0x200)]};}export function listLocalServices(_0x343803={}){const _0x4652ab=a42_0x30ec34;return readServiceRegistry(_0x343803)[_0x4652ab(0x1ef)];}export function getLocalServiceEntry(_0x4c127b,_0x5c8433={}){const _0x502647=a42_0x30ec34;return readServiceRegistry(_0x5c8433)['services'][_0x502647(0x1da)](_0xad4d56=>_0xad4d56['serviceCode']===_0x4c127b[_0x502647(0x1d7)]());}export function listLocalServiceTrees(_0xe92af1={}){const _0x2c1138=a42_0x30ec34;return readServiceRegistry(_0xe92af1)[_0x2c1138(0x1ef)]['map'](_0x3763ee=>_0x3763ee[_0x2c1138(0x1d6)]);}export function inspectServiceRegistry(_0x4e3884={}){const _0x167f54=a42_0x30ec34,_0x1e6f94=getServiceRegistryPath(_0x4e3884);if(!existsSync(_0x1e6f94))return emptyServiceRegistryInspection(_0x1e6f94,_0x167f54(0x224),![]);try{const _0x536aaa=readFileSync(_0x1e6f94,_0x167f54(0x1ea));if(!_0x536aaa[_0x167f54(0x1d7)]())return emptyServiceRegistryInspection(_0x1e6f94,_0x167f54(0x219),!![]);const _0x1b084c=JSON['parse'](_0x536aaa);if(_0x1b084c[_0x167f54(0x20a)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x1e6f94,_0x167f54(0x202),!![]),'schemaVersion':_0x1b084c[_0x167f54(0x20a)],'message':'Unsupported\x20schemaVersion:\x20'+String(_0x1b084c[_0x167f54(0x20a)])};if(!Array[_0x167f54(0x203)](_0x1b084c[_0x167f54(0x1ef)]))return{...emptyServiceRegistryInspection(_0x1e6f94,_0x167f54(0x202),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1b084c[_0x167f54(0x1f6)],'message':_0x167f54(0x20d)};const _0x5f5943=_0x1b084c[_0x167f54(0x1ef)][_0x167f54(0x20e)](summarizeLocalServiceEntry);return{'registryPath':_0x1e6f94,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1b084c[_0x167f54(0x1f6)],'serviceCount':_0x5f5943[_0x167f54(0x200)],'commandCount':_0x5f5943[_0x167f54(0x227)]((_0x377857,_0x254030)=>_0x377857+_0x254030[_0x167f54(0x223)],0x0),'services':_0x5f5943};}catch(_0x3a2c6c){return{...emptyServiceRegistryInspection(_0x1e6f94,_0x167f54(0x202),!![]),'message':_0x3a2c6c instanceof Error?_0x3a2c6c[_0x167f54(0x1d8)]:String(_0x3a2c6c)};}}export function formatValidationFailure(_0x3357df){const _0x1920de=a42_0x30ec34,_0x2271fc=_0x3357df[_0x1920de(0x217)][_0x1920de(0x20e)](_0x5680fc=>_0x5680fc[_0x1920de(0x1eb)]+':\x20'+_0x5680fc[_0x1920de(0x1d8)]);return _0x1920de(0x1f7)+_0x2271fc[_0x1920de(0x205)]('\x0a');}function extractLoadedServiceManifests(_0x2e49a0,_0x4f2e01){const _0x13f878=a42_0x30ec34;if(!isServiceRegistryLike(_0x2e49a0)){const _0x11d196=_0x2e49a0,{manifest:_0x4a37b8,errors:_0x590449}=adaptServiceTreeManifestForLegacyFramework(_0x11d196),_0x1a0bed=validateServiceTreeManifest(_0x4a37b8),_0x2695ee=mergeValidationErrors(_0x1a0bed,_0x590449);return[{'manifest':_0x11d196,'report':_0x2695ee,'normalizedManifest':_0x2695ee['ok']?normalizeServiceTreeManifest(_0x4a37b8):undefined,'sourceHash':_0x4f2e01}];}return _0x2e49a0[_0x13f878(0x1ef)]['map']((_0x3c52d1,_0x1b5344)=>{const _0x1ea4b9=_0x13f878,_0x1d506e=isObjectRecord(_0x3c52d1)?_0x3c52d1[_0x1ea4b9(0x1e3)]:undefined,{manifest:_0x62cb04,errors:_0x450378}=adaptServiceTreeManifestForLegacyFramework(_0x1d506e),_0x1c50a8=validateServiceTreeManifest(_0x62cb04),_0x589a6c=mergeValidationErrors(_0x1c50a8,_0x450378),_0x2828fe=isObjectRecord(_0x3c52d1)&&typeof _0x3c52d1['serviceCode']===_0x1ea4b9(0x1fc)?_0x3c52d1[_0x1ea4b9(0x1f3)]:undefined;return{'manifest':_0x1d506e,'report':_0x589a6c,'normalizedManifest':_0x589a6c['ok']?normalizeServiceTreeManifest(_0x62cb04):undefined,'sourceHash':sha256(JSON[_0x1ea4b9(0x1e8)](_0x1d506e,null,0x2)+'\x0a'),'registryIndex':_0x1b5344,'registryServiceCode':_0x2828fe};});}function mergeValidationErrors(_0x5109c3,_0xff91fa){const _0x28b25a=a42_0x30ec34,_0x3dd6b7=_0x5109c3[_0x28b25a(0x217)]['map'](_0x586641=>_0x586641[_0x28b25a(0x1d8)]===_0x28b25a(0x1e9)?{..._0x586641,'message':_0x28b25a(0x1df)}:_0x586641),_0x12a70b=[..._0xff91fa,..._0x3dd6b7];return{'ok':_0x12a70b[_0x28b25a(0x200)]===0x0,'errors':_0x12a70b,'warnings':_0x5109c3[_0x28b25a(0x20b)]};}function aggregateValidationReports(_0x1cc79f){const _0x4f293b=a42_0x30ec34,_0x40667f=_0x1cc79f[_0x4f293b(0x213)](_0x3ce43c=>_0x3ce43c[_0x4f293b(0x214)]===undefined?_0x3ce43c[_0x4f293b(0x1e7)][_0x4f293b(0x217)]:_0x3ce43c[_0x4f293b(0x1e7)]['errors'][_0x4f293b(0x20e)](_0xca913a=>({..._0xca913a,'path':prefixRegistryIssuePath(_0x3ce43c[_0x4f293b(0x214)],_0xca913a['path'])}))),_0x1fb67a=_0x1cc79f[_0x4f293b(0x213)](_0x50ef88=>_0x50ef88[_0x4f293b(0x214)]===undefined?_0x50ef88[_0x4f293b(0x1e7)][_0x4f293b(0x20b)]:_0x50ef88['report'][_0x4f293b(0x20b)][_0x4f293b(0x20e)](_0x3c510b=>({..._0x3c510b,'path':prefixRegistryIssuePath(_0x50ef88['registryIndex'],_0x3c510b[_0x4f293b(0x1eb)])})));return{'ok':_0x40667f['length']===0x0,'errors':_0x40667f,'warnings':_0x1fb67a};}function prefixRegistryIssuePath(_0x263f62,_0x3e272e){const _0x560be6=a42_0x30ec34;if(_0x3e272e==='$')return _0x560be6(0x1f8)+_0x263f62+_0x560be6(0x1f9);if(_0x3e272e[_0x560be6(0x210)]('$.'))return _0x560be6(0x1f8)+_0x263f62+_0x560be6(0x1f9)+_0x3e272e[_0x560be6(0x1ff)](0x1);if(_0x3e272e[_0x560be6(0x210)]('$['))return _0x560be6(0x1f8)+_0x263f62+_0x560be6(0x1f9)+_0x3e272e[_0x560be6(0x1ff)](0x1);return _0x560be6(0x1f8)+_0x263f62+'].manifest.'+_0x3e272e;}function isServiceRegistryLike(_0x476b91){const _0x1cf82b=a42_0x30ec34;return isObjectRecord(_0x476b91)&&_0x476b91[_0x1cf82b(0x20a)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0x476b91[_0x1cf82b(0x1ef)]);}function isObjectRecord(_0x5adb4f){const _0x139d66=a42_0x30ec34;return Boolean(_0x5adb4f)&&typeof _0x5adb4f===_0x139d66(0x21c)&&!Array[_0x139d66(0x203)](_0x5adb4f);}function emptyServiceRegistryInspection(_0x4a1f05,_0xc7e236,_0x296b3a){return{'registryPath':_0x4a1f05,'exists':_0x296b3a,'status':_0xc7e236,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x499061){const _0x51492f=a42_0x30ec34,_0x5b29cb=_0x499061[_0x51492f(0x1d6)],_0x15cb0d=_0x5b29cb[_0x51492f(0x1ec)]['map'](_0x4de657=>({'path':_0x4de657[_0x51492f(0x220)],'description':_0x4de657['description'],'risk':_0x4de657[_0x51492f(0x211)],'targetKind':_0x4de657[_0x51492f(0x207)][_0x51492f(0x1ee)],'targetCommand':_0x4de657[_0x51492f(0x207)][_0x51492f(0x1fa)]}));return{'serviceCode':_0x499061[_0x51492f(0x1f3)],'name':_0x5b29cb['service']['name'],'description':_0x5b29cb[_0x51492f(0x20c)][_0x51492f(0x21d)],'version':_0x499061[_0x51492f(0x1f1)],'importedAt':_0x499061['importedAt'],'source':_0x499061[_0x51492f(0x208)],'commandCount':_0x15cb0d[_0x51492f(0x200)],'commands':_0x15cb0d};}function sha256(_0x549cd9){const _0x457bdf=a42_0x30ec34;return createHash('sha256')['update'](_0x549cd9)[_0x457bdf(0x215)](_0x457bdf(0x1f2));}
1
+ const a42_0x207e09=a42_0x44cd;(function(_0x4fdd01,_0x4b6ff8){const _0x170239=a42_0x44cd,_0x525ad5=_0x4fdd01();while(!![]){try{const _0x12a353=-parseInt(_0x170239(0x1f4))/0x1+-parseInt(_0x170239(0x1f9))/0x2+-parseInt(_0x170239(0x1eb))/0x3*(parseInt(_0x170239(0x1fa))/0x4)+parseInt(_0x170239(0x1c6))/0x5*(-parseInt(_0x170239(0x1b5))/0x6)+parseInt(_0x170239(0x1da))/0x7+parseInt(_0x170239(0x1df))/0x8*(-parseInt(_0x170239(0x1f6))/0x9)+parseInt(_0x170239(0x1dd))/0xa*(parseInt(_0x170239(0x1ed))/0xb);if(_0x12a353===_0x4b6ff8)break;else _0x525ad5['push'](_0x525ad5['shift']());}catch(_0x1712cd){_0x525ad5['push'](_0x525ad5['shift']());}}}(a42_0x4592,0x72e10));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a42_0x207e09(0x1fb);export function getServiceRegistryPath(_0x3409a2={}){const _0x4966f4=a42_0x207e09;return resolve(_0x3409a2['homeDir']??homedir(),PRODUCT_CONFIG[_0x4966f4(0x1e4)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x556846={}){const _0x160d48=a42_0x207e09,_0x4ecb0f=getServiceRegistryPath(_0x556846);if(!existsSync(_0x4ecb0f))return emptyServiceRegistry();try{const _0x321a82=readFileSync(_0x4ecb0f,_0x160d48(0x1f3));if(!_0x321a82[_0x160d48(0x1f1)]())return emptyServiceRegistry();const _0x5d58b5=JSON[_0x160d48(0x1ca)](_0x321a82);if(_0x5d58b5[_0x160d48(0x1ec)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x160d48(0x1cc)](_0x160d48(0x1d2)+String(_0x5d58b5[_0x160d48(0x1ec)]),_0x160d48(0x1d1)+_0x4ecb0f+'.');if(!Array['isArray'](_0x5d58b5[_0x160d48(0x1dc)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5d58b5[_0x160d48(0x1b2)],'services':_0x5d58b5[_0x160d48(0x1dc)]};}catch(_0x17a3d0){if(_0x17a3d0 instanceof Error&&_0x17a3d0['name']===_0x160d48(0x1f8))throw _0x17a3d0;throw CliErrors[_0x160d48(0x1cc)](_0x160d48(0x1d7)+_0x4ecb0f,_0x160d48(0x1e9));}}export function writeServiceRegistry(_0x535288,_0x573245={}){const _0x1e3be3=a42_0x207e09,_0x15ce75=getServiceRegistryPath(_0x573245),_0x15f85b=dirname(_0x15ce75);!existsSync(_0x15f85b)&&mkdirSync(_0x15f85b,{'recursive':!![]});const _0x228bf9=_0x15ce75+'.tmp';try{writeFileSync(_0x228bf9,JSON[_0x1e3be3(0x1bd)](_0x535288,null,0x2)+'\x0a',{'encoding':_0x1e3be3(0x1f3),'mode':0x180}),renameSync(_0x228bf9,_0x15ce75);}catch(_0x2c28ea){try{unlinkSync(_0x228bf9);}catch{}if(_0x2c28ea?.['code']===_0x1e3be3(0x1d0))throw CliErrors[_0x1e3be3(0x1cc)](_0x1e3be3(0x1c4)+_0x15ce75);throw _0x2c28ea;}return _0x15ce75;}export function loadServiceManifestFromFile(_0x120a65){const _0x52a667=a42_0x207e09,_0x14f374=resolve(_0x120a65);if(!existsSync(_0x14f374))throw CliErrors[_0x52a667(0x1cc)](_0x52a667(0x1ee)+_0x120a65);let _0x317169;const _0x1b6a41=readFileSync(_0x14f374,_0x52a667(0x1f3));try{_0x317169=JSON['parse'](_0x1b6a41);}catch{throw CliErrors['validation'](_0x52a667(0x1b8)+_0x120a65,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x14c6a4=sha256(_0x1b6a41),_0x5de6e8=extractLoadedServiceManifests(_0x317169,_0x14c6a4),_0x3a22e1=aggregateValidationReports(_0x5de6e8),_0x5818b5=_0x5de6e8[0x0];return{'filePath':_0x14f374,'hash':_0x14c6a4,'kind':isServiceRegistryLike(_0x317169)?_0x52a667(0x1b6):_0x52a667(0x1bf),'manifest':_0x5818b5?.[_0x52a667(0x1bf)]??_0x317169,'report':_0x3a22e1,'normalizedManifest':_0x5de6e8['length']===0x1?_0x5818b5?.[_0x52a667(0x1ea)]:undefined,'manifests':_0x5de6e8};}export function importServiceManifest(_0x1f151f,_0x36eba9={}){const _0x23d2a1=a42_0x207e09,_0x2f1efe=loadServiceManifestFromFile(_0x1f151f);if(!_0x2f1efe[_0x23d2a1(0x1cf)]['ok'])throw CliErrors[_0x23d2a1(0x1cc)](formatValidationFailure(_0x2f1efe[_0x23d2a1(0x1cf)]),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x2f1efe[_0x23d2a1(0x1d4)][_0x23d2a1(0x1e8)]===0x0)throw CliErrors[_0x23d2a1(0x1cc)]('Service\x20registry\x20has\x20no\x20services\x20to\x20import.',_0x23d2a1(0x1c8));const _0x319595=readServiceRegistry(_0x36eba9),_0x1ea20a=(_0x36eba9[_0x23d2a1(0x1fd)]??(()=>new Date()))()[_0x23d2a1(0x1e7)](),_0x27dbf0=[];let _0x2887ed=0x0,_0x8d5169=0x0;for(const _0x4ac90e of _0x2f1efe[_0x23d2a1(0x1d4)]){if(!_0x4ac90e['normalizedManifest'])continue;const _0x3fbbb5=_0x4ac90e[_0x23d2a1(0x1ea)]['service']['code'],_0x2501bf={'serviceCode':_0x3fbbb5,'version':_0x4ac90e['normalizedManifest'][_0x23d2a1(0x1d5)],'importedAt':_0x1ea20a,'source':{'type':_0x23d2a1(0x1b1),'path':_0x2f1efe['filePath'],'hash':_0x4ac90e[_0x23d2a1(0x1f0)]},'manifest':_0x4ac90e[_0x23d2a1(0x1bf)],'normalizedManifest':_0x4ac90e[_0x23d2a1(0x1ea)]},_0x2d15e8=_0x319595[_0x23d2a1(0x1dc)][_0x23d2a1(0x1ff)](_0x216851=>_0x216851['serviceCode']===_0x3fbbb5);_0x2d15e8>=0x0?(_0x319595[_0x23d2a1(0x1dc)][_0x2d15e8]=_0x2501bf,_0x8d5169++):(_0x319595[_0x23d2a1(0x1dc)][_0x23d2a1(0x1f2)](_0x2501bf),_0x2887ed++),_0x27dbf0[_0x23d2a1(0x1f2)](_0x2501bf);}_0x319595[_0x23d2a1(0x1dc)][_0x23d2a1(0x1ac)]((_0x803430,_0x2f6999)=>_0x803430[_0x23d2a1(0x1ba)][_0x23d2a1(0x1ef)](_0x2f6999[_0x23d2a1(0x1ba)])),_0x319595[_0x23d2a1(0x1b2)]=_0x1ea20a;const _0xe11dab=writeServiceRegistry(_0x319595,_0x36eba9);return{'registryPath':_0xe11dab,'entry':_0x27dbf0[0x0],'replaced':_0x27dbf0['length']===0x1?_0x8d5169===0x1:_0x8d5169>0x0,'entries':_0x27dbf0,'imported':_0x2887ed,'updated':_0x8d5169,'serviceCount':_0x319595[_0x23d2a1(0x1dc)]['length']};}export function exportServiceManifest(_0x17f43f,_0x75f4c2,_0x537efd={}){const _0x3afb3d=a42_0x207e09,_0x2c9e36=getServiceRegistryPath(_0x537efd),_0x33a2cc=getLocalServiceEntry(_0x17f43f,_0x537efd);if(!_0x33a2cc)throw CliErrors[_0x3afb3d(0x1cc)](_0x3afb3d(0x1d9)+_0x17f43f,_0x3afb3d(0x202));const _0x32c64a=resolve(_0x75f4c2),_0x533df9=dirname(_0x32c64a);return!existsSync(_0x533df9)&&mkdirSync(_0x533df9,{'recursive':!![]}),writeFileSync(_0x32c64a,JSON['stringify'](_0x33a2cc[_0x3afb3d(0x1bf)],null,0x2)+'\x0a',{'encoding':_0x3afb3d(0x1f3),'mode':0x180}),{'registryPath':_0x2c9e36,'filePath':_0x32c64a,'entry':_0x33a2cc};}export function removeServiceManifest(_0x43a529,_0x4366f5={}){const _0xe67592=a42_0x207e09,_0x5733e1=readServiceRegistry(_0x4366f5),_0x2bf726=_0x43a529[_0xe67592(0x1f1)](),_0x716536=_0x5733e1['services'][_0xe67592(0x1ff)](_0x5439d1=>_0x5439d1[_0xe67592(0x1ba)]===_0x2bf726);if(_0x716536<0x0)throw CliErrors[_0xe67592(0x1cc)](_0xe67592(0x1d9)+_0x2bf726,_0xe67592(0x202));const [_0x7f8424]=_0x5733e1[_0xe67592(0x1dc)][_0xe67592(0x1be)](_0x716536,0x1),_0x165b06=(_0x4366f5[_0xe67592(0x1fd)]??(()=>new Date()))()['toISOString']();_0x5733e1[_0xe67592(0x1b2)]=_0x165b06;const _0x53782f=writeServiceRegistry(_0x5733e1,_0x4366f5);return{'registryPath':_0x53782f,'entry':_0x7f8424,'serviceCount':_0x5733e1[_0xe67592(0x1dc)][_0xe67592(0x1e8)]};}export function listLocalServices(_0xbe1730={}){const _0x34f0fd=a42_0x207e09;return readServiceRegistry(_0xbe1730)[_0x34f0fd(0x1dc)];}export function getLocalServiceEntry(_0x365058,_0x4c30fb={}){const _0x1e86c0=a42_0x207e09;return readServiceRegistry(_0x4c30fb)[_0x1e86c0(0x1dc)][_0x1e86c0(0x1db)](_0x1e524b=>_0x1e524b[_0x1e86c0(0x1ba)]===_0x365058['trim']());}export function listLocalServiceTrees(_0x3985b2={}){const _0x349f27=a42_0x207e09;return readServiceRegistry(_0x3985b2)[_0x349f27(0x1dc)]['map'](_0x5119e1=>_0x5119e1['normalizedManifest']);}export function inspectServiceRegistry(_0x16dd7a={}){const _0x2d4e28=a42_0x207e09,_0x306430=getServiceRegistryPath(_0x16dd7a);if(!existsSync(_0x306430))return emptyServiceRegistryInspection(_0x306430,'missing',![]);try{const _0x26dc92=readFileSync(_0x306430,_0x2d4e28(0x1f3));if(!_0x26dc92[_0x2d4e28(0x1f1)]())return emptyServiceRegistryInspection(_0x306430,'empty',!![]);const _0x159e58=JSON['parse'](_0x26dc92);if(_0x159e58['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x306430,_0x2d4e28(0x1ae),!![]),'schemaVersion':_0x159e58['schemaVersion'],'message':_0x2d4e28(0x1cd)+String(_0x159e58[_0x2d4e28(0x1ec)])};if(!Array[_0x2d4e28(0x1ad)](_0x159e58[_0x2d4e28(0x1dc)]))return{...emptyServiceRegistryInspection(_0x306430,_0x2d4e28(0x1ae),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x159e58[_0x2d4e28(0x1b2)],'message':_0x2d4e28(0x1f5)};const _0x35317f=_0x159e58[_0x2d4e28(0x1dc)][_0x2d4e28(0x1b4)](summarizeLocalServiceEntry);return{'registryPath':_0x306430,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x159e58[_0x2d4e28(0x1b2)],'serviceCount':_0x35317f[_0x2d4e28(0x1e8)],'commandCount':_0x35317f[_0x2d4e28(0x1ce)]((_0x2cbe75,_0x5121a2)=>_0x2cbe75+_0x5121a2[_0x2d4e28(0x1b0)],0x0),'services':_0x35317f};}catch(_0x409929){return{...emptyServiceRegistryInspection(_0x306430,_0x2d4e28(0x1ae),!![]),'message':_0x409929 instanceof Error?_0x409929[_0x2d4e28(0x1fe)]:String(_0x409929)};}}export function formatValidationFailure(_0x2d24ad){const _0x3a40e9=a42_0x207e09,_0x4659ea=_0x2d24ad[_0x3a40e9(0x1af)][_0x3a40e9(0x1b4)](_0xefa655=>_0xefa655[_0x3a40e9(0x1c2)]+':\x20'+_0xefa655[_0x3a40e9(0x1fe)]);return _0x3a40e9(0x201)+_0x4659ea[_0x3a40e9(0x1e0)]('\x0a');}function extractLoadedServiceManifests(_0xcf1e7a,_0x3bc4fe){const _0x35a95f=a42_0x207e09;if(!isServiceRegistryLike(_0xcf1e7a)){const _0x3db1de=_0xcf1e7a,{manifest:_0xd05778,errors:_0x1eb572}=adaptServiceTreeManifestForLegacyFramework(_0x3db1de),_0x32b797=validateServiceTreeManifest(_0xd05778),_0x22e58c=mergeValidationErrors(_0x32b797,_0x1eb572);return[{'manifest':_0x3db1de,'report':_0x22e58c,'normalizedManifest':_0x22e58c['ok']?normalizeServiceTreeManifest(_0xd05778):undefined,'sourceHash':_0x3bc4fe}];}return _0xcf1e7a[_0x35a95f(0x1dc)][_0x35a95f(0x1b4)]((_0x49b856,_0x24a3e9)=>{const _0x349f3d=_0x35a95f,_0x228df6=isObjectRecord(_0x49b856)?_0x49b856[_0x349f3d(0x1bf)]:undefined,{manifest:_0x10a396,errors:_0x9044d3}=adaptServiceTreeManifestForLegacyFramework(_0x228df6),_0x300d2d=validateServiceTreeManifest(_0x10a396),_0x5dca37=mergeValidationErrors(_0x300d2d,_0x9044d3),_0x1910c0=isObjectRecord(_0x49b856)&&typeof _0x49b856[_0x349f3d(0x1ba)]==='string'?_0x49b856[_0x349f3d(0x1ba)]:undefined;return{'manifest':_0x228df6,'report':_0x5dca37,'normalizedManifest':_0x5dca37['ok']?normalizeServiceTreeManifest(_0x10a396):undefined,'sourceHash':sha256(JSON[_0x349f3d(0x1bd)](_0x228df6,null,0x2)+'\x0a'),'registryIndex':_0x24a3e9,'registryServiceCode':_0x1910c0};});}function a42_0x44cd(_0x3c5b6d,_0x35deee){_0x3c5b6d=_0x3c5b6d-0x1ac;const _0x45929d=a42_0x4592();let _0x44cdc7=_0x45929d[_0x3c5b6d];return _0x44cdc7;}function mergeValidationErrors(_0x2476ff,_0x454d9e){const _0x2c475d=a42_0x207e09,_0x498a25=_0x2476ff[_0x2c475d(0x1af)][_0x2c475d(0x1b4)](_0x1efe23=>_0x1efe23[_0x2c475d(0x1fe)]===_0x2c475d(0x1de)?{..._0x1efe23,'message':'bff\x20target\x20requires\x20functionName.'}:_0x1efe23),_0x5456a7=[..._0x454d9e,..._0x498a25];return{'ok':_0x5456a7[_0x2c475d(0x1e8)]===0x0,'errors':_0x5456a7,'warnings':_0x2476ff[_0x2c475d(0x200)]};}function a42_0x4592(){const _0x2705e8=['8gNDJvj','service.json','].manifest.','now','message','findIndex','warnings','Service\x20manifest\x20validation\x20failed:\x0a','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','sort','isArray','invalid','errors','commandCount','file','updatedAt','hex','map','342rcrthb','registry','kind','Invalid\x20service\x20manifest\x20JSON:\x20','].manifest','serviceCode','digest','registryIndex','stringify','splice','manifest','commands','importedAt','path','service','Cannot\x20write\x20service\x20registry:\x20','update','29835FmfNzX','target','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','flatMap','parse','description','validation','Unsupported\x20schemaVersion:\x20','reduce','report','ENOENT','Remove\x20or\x20migrate\x20','Unsupported\x20service\x20registry\x20schemaVersion:\x20','command','manifests','version','name','Invalid\x20service\x20registry\x20JSON:\x20','cliPath','Local\x20service\x20not\x20found:\x20','267519ExipbE','find','services','2990fMcbEc','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','3758008GBIsbN','join','sha256','risk','$.services[','homeDirName','slice','startsWith','toISOString','length','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','normalizedManifest','403617JWNVSx','schemaVersion','112651EjwlVB','Service\x20manifest\x20file\x20not\x20found:\x20','localeCompare','sourceHash','trim','push','utf8','725830LTsBsM','services\x20must\x20be\x20an\x20array','9RdcJCF','source','CliError','1649908juKKVW'];a42_0x4592=function(){return _0x2705e8;};return a42_0x4592();}function aggregateValidationReports(_0x37026a){const _0x503aef=a42_0x207e09,_0x27cc8e=_0x37026a[_0x503aef(0x1c9)](_0x3445c4=>_0x3445c4[_0x503aef(0x1bc)]===undefined?_0x3445c4[_0x503aef(0x1cf)][_0x503aef(0x1af)]:_0x3445c4[_0x503aef(0x1cf)][_0x503aef(0x1af)][_0x503aef(0x1b4)](_0x37ad26=>({..._0x37ad26,'path':prefixRegistryIssuePath(_0x3445c4[_0x503aef(0x1bc)],_0x37ad26[_0x503aef(0x1c2)])}))),_0x40b9a8=_0x37026a[_0x503aef(0x1c9)](_0x58a81e=>_0x58a81e[_0x503aef(0x1bc)]===undefined?_0x58a81e[_0x503aef(0x1cf)][_0x503aef(0x200)]:_0x58a81e[_0x503aef(0x1cf)][_0x503aef(0x200)][_0x503aef(0x1b4)](_0x1861d4=>({..._0x1861d4,'path':prefixRegistryIssuePath(_0x58a81e[_0x503aef(0x1bc)],_0x1861d4['path'])})));return{'ok':_0x27cc8e[_0x503aef(0x1e8)]===0x0,'errors':_0x27cc8e,'warnings':_0x40b9a8};}function prefixRegistryIssuePath(_0x374a2e,_0x154899){const _0x52a275=a42_0x207e09;if(_0x154899==='$')return _0x52a275(0x1e3)+_0x374a2e+'].manifest';if(_0x154899[_0x52a275(0x1e6)]('$.'))return _0x52a275(0x1e3)+_0x374a2e+'].manifest'+_0x154899[_0x52a275(0x1e5)](0x1);if(_0x154899[_0x52a275(0x1e6)]('$['))return _0x52a275(0x1e3)+_0x374a2e+_0x52a275(0x1b9)+_0x154899['slice'](0x1);return _0x52a275(0x1e3)+_0x374a2e+_0x52a275(0x1fc)+_0x154899;}function isServiceRegistryLike(_0x408970){const _0x5d9bdd=a42_0x207e09;return isObjectRecord(_0x408970)&&_0x408970[_0x5d9bdd(0x1ec)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x5d9bdd(0x1ad)](_0x408970[_0x5d9bdd(0x1dc)]);}function isObjectRecord(_0x362038){const _0xbad60f=a42_0x207e09;return Boolean(_0x362038)&&typeof _0x362038==='object'&&!Array[_0xbad60f(0x1ad)](_0x362038);}function emptyServiceRegistryInspection(_0x5db121,_0x339f3b,_0x100e3f){return{'registryPath':_0x5db121,'exists':_0x100e3f,'status':_0x339f3b,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x4512d4){const _0x446b08=a42_0x207e09,_0x1cfe44=_0x4512d4[_0x446b08(0x1ea)],_0xfef81a=_0x1cfe44[_0x446b08(0x1c0)][_0x446b08(0x1b4)](_0x484f6c=>({'path':_0x484f6c[_0x446b08(0x1d8)],'description':_0x484f6c[_0x446b08(0x1cb)],'risk':_0x484f6c[_0x446b08(0x1e2)],'targetKind':_0x484f6c[_0x446b08(0x1c7)][_0x446b08(0x1b7)],'targetCommand':_0x484f6c['target'][_0x446b08(0x1d3)]}));return{'serviceCode':_0x4512d4[_0x446b08(0x1ba)],'name':_0x1cfe44[_0x446b08(0x1c3)][_0x446b08(0x1d6)],'description':_0x1cfe44[_0x446b08(0x1c3)][_0x446b08(0x1cb)],'version':_0x4512d4['version'],'importedAt':_0x4512d4[_0x446b08(0x1c1)],'source':_0x4512d4[_0x446b08(0x1f7)],'commandCount':_0xfef81a[_0x446b08(0x1e8)],'commands':_0xfef81a};}function sha256(_0xb9fcdb){const _0x4a2ea5=a42_0x207e09;return createHash(_0x4a2ea5(0x1e1))[_0x4a2ea5(0x1c5)](_0xb9fcdb)[_0x4a2ea5(0x1bb)](_0x4a2ea5(0x1b3));}
@@ -1 +1 @@
1
- const a43_0x2a2004=a43_0x332f;function a43_0x5339(){const _0x2e16bb=['Created\x20local\x20Skill\x20draft\x20','path','create','map','1197942WFhSOg','type','Refusing\x20to\x20overwrite\x20symlink:\x20','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','name','validation','force','6702372dQUvaP','content','target','32935oAAisH','556UxWIVz','608560qdHxqT','rendered','files','str','Skill\x20directory\x20already\x20exists:\x20','414857QnLwch','isDirectory','skillDir','7135345hmriUN','trim','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','write','bool','891660nOXgyU','2lMlLmM','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','创建本地自包含的运行态\x20Skill\x20草稿','将在本地生成一个自包含的\x20Skill\x20草稿目录;使用\x20--force\x20时会覆盖目录中同名的模板文件。确认界面不会展示本地路径。','skillName','isSymbolicLink','WRITE'];a43_0x5339=function(){return _0x2e16bb;};return a43_0x5339();}(function(_0x38eea1,_0x7ff744){const _0x1e24a5=a43_0x332f,_0x26340e=_0x38eea1();while(!![]){try{const _0x5c1647=-parseInt(_0x1e24a5(0x1d6))/0x1+parseInt(_0x1e24a5(0x1ba))/0x2*(parseInt(_0x1e24a5(0x1c5))/0x3)+parseInt(_0x1e24a5(0x1d0))/0x4*(parseInt(_0x1e24a5(0x1cf))/0x5)+parseInt(_0x1e24a5(0x1b9))/0x6+-parseInt(_0x1e24a5(0x1d9))/0x7+-parseInt(_0x1e24a5(0x1d1))/0x8+parseInt(_0x1e24a5(0x1cc))/0x9;if(_0x5c1647===_0x7ff744)break;else _0x26340e['push'](_0x26340e['shift']());}catch(_0x252f9e){_0x26340e['push'](_0x26340e['shift']());}}}(a43_0x5339,0xaa66b));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_0x332f(_0x4e4525,_0x1b06ab){_0x4e4525=_0x4e4525-0x1b8;const _0x53391c=a43_0x5339();let _0x332f67=_0x53391c[_0x4e4525];return _0x332f67;}import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':'skill','command':a43_0x2a2004(0x1c3),'description':a43_0x2a2004(0x1bc),'risk':a43_0x2a2004(0x1dc),'confirmationDescription':a43_0x2a2004(0x1bd),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x3808af){const _0x41cc61=a43_0x2a2004,_0x1fd77b=buildSkillCreatePlan(_0x3808af[_0x41cc61(0x1d4)](_0x41cc61(0x1c9)),_0x3808af[_0x41cc61(0x1d4)]('type'),_0x3808af['str'](_0x41cc61(0x1ce)));return{'method':_0x41cc61(0x1c0),'url':_0x1fd77b[_0x41cc61(0x1d8)],'body':{'skillName':_0x1fd77b[_0x41cc61(0x1d2)][_0x41cc61(0x1be)],'type':_0x1fd77b[_0x41cc61(0x1d2)]['type'],'selfContained':!![],'files':_0x1fd77b[_0x41cc61(0x1d2)][_0x41cc61(0x1d3)][_0x41cc61(0x1c4)](_0x2087d9=>_0x2087d9[_0x41cc61(0x1c2)])},'description':_0x41cc61(0x1bb)};},async 'execute'(_0x6ddd26){const _0x100eda=a43_0x2a2004,_0x58149c=buildSkillCreatePlan(_0x6ddd26[_0x100eda(0x1d4)]('name'),_0x6ddd26['str'](_0x100eda(0x1c6)),_0x6ddd26[_0x100eda(0x1d4)](_0x100eda(0x1ce)));return writeSkillDraft(_0x58149c,_0x6ddd26[_0x100eda(0x1b8)](_0x100eda(0x1cb))),{'ok':!![],'data':{'skillName':_0x58149c[_0x100eda(0x1d2)][_0x100eda(0x1be)],'type':_0x58149c[_0x100eda(0x1d2)][_0x100eda(0x1c6)],'dir':_0x58149c[_0x100eda(0x1d8)],'files':_0x58149c[_0x100eda(0x1d2)][_0x100eda(0x1d3)]['map'](_0x42e147=>_0x42e147['path'])},'message':_0x100eda(0x1c1)+_0x58149c['rendered'][_0x100eda(0x1be)]};}};function buildSkillCreatePlan(_0x4d0e67,_0x7f31ec,_0x111b25){const _0x4c1f45=a43_0x2a2004,_0x4cd2d3=_0x7f31ec[_0x4c1f45(0x1da)](),_0x1565d8=renderSkillTemplate({'skillName':_0x4d0e67,'type':_0x4cd2d3});!_0x4cd2d3&&writeCliSideChannelLine(_0x4c1f45(0x1db));const _0x2aa4ff=resolve(normalizeSkillTarget(_0x111b25));return{'rendered':_0x1565d8,'targetRoot':_0x2aa4ff,'skillDir':resolve(_0x2aa4ff,_0x1565d8[_0x4c1f45(0x1be)])};}function normalizeSkillTarget(_0x354d11){const _0x35ff0a=a43_0x2a2004;return(_0x354d11||DEFAULT_SKILL_TARGET)[_0x35ff0a(0x1da)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x157f99,_0x336e83){const _0x6ba652=a43_0x2a2004;if(existsSync(_0x157f99[_0x6ba652(0x1d8)])){const _0x2bb63c=lstatSync(_0x157f99['skillDir']);if(!_0x2bb63c[_0x6ba652(0x1d7)]()||_0x2bb63c[_0x6ba652(0x1bf)]())throw CliErrors[_0x6ba652(0x1ca)](_0x6ba652(0x1c8)+_0x157f99[_0x6ba652(0x1d8)]);if(!_0x336e83)throw CliErrors[_0x6ba652(0x1ca)](_0x6ba652(0x1d5)+_0x157f99[_0x6ba652(0x1d8)],'Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.');}for(const _0x284d5a of _0x157f99[_0x6ba652(0x1d2)][_0x6ba652(0x1d3)]){const _0x14fe2f=resolve(_0x157f99[_0x6ba652(0x1d8)],_0x284d5a['path']),_0x1038f5=dirname(_0x14fe2f);mkdirSync(_0x1038f5,{'recursive':!![]});if(existsSync(_0x14fe2f)&&lstatSync(_0x14fe2f)[_0x6ba652(0x1bf)]())throw CliErrors[_0x6ba652(0x1ca)](_0x6ba652(0x1c7)+_0x14fe2f);writeFileSync(_0x14fe2f,_0x284d5a[_0x6ba652(0x1cd)],'utf8');}}
1
+ const a43_0xe7c030=a43_0x3a1e;(function(_0x5eb530,_0x4b298b){const _0x511ecb=a43_0x3a1e,_0x2181a9=_0x5eb530();while(!![]){try{const _0x1fb534=-parseInt(_0x511ecb(0x15c))/0x1+parseInt(_0x511ecb(0x16a))/0x2+-parseInt(_0x511ecb(0x156))/0x3+parseInt(_0x511ecb(0x165))/0x4+parseInt(_0x511ecb(0x153))/0x5*(-parseInt(_0x511ecb(0x151))/0x6)+parseInt(_0x511ecb(0x168))/0x7*(parseInt(_0x511ecb(0x158))/0x8)+-parseInt(_0x511ecb(0x15e))/0x9*(-parseInt(_0x511ecb(0x162))/0xa);if(_0x1fb534===_0x4b298b)break;else _0x2181a9['push'](_0x2181a9['shift']());}catch(_0x45ed29){_0x2181a9['push'](_0x2181a9['shift']());}}}(a43_0xc466,0xdc5e8));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';function a43_0x3a1e(_0x108489,_0x1f358b){_0x108489=_0x108489-0x146;const _0xc466ef=a43_0xc466();let _0x3a1ed4=_0xc466ef[_0x108489];return _0x3a1ed4;}import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a43_0xe7c030(0x154),'command':'create','description':a43_0xe7c030(0x150),'risk':a43_0xe7c030(0x14c),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0xb4fff7){const _0x336c3d=a43_0xe7c030,_0x6e6a90=buildSkillCreatePlan(_0xb4fff7['str'](_0x336c3d(0x15d)),_0xb4fff7[_0x336c3d(0x149)](_0x336c3d(0x163)),_0xb4fff7['str'](_0x336c3d(0x146)));return{'method':_0x336c3d(0x166),'url':_0x6e6a90[_0x336c3d(0x164)],'body':{'skillName':_0x6e6a90[_0x336c3d(0x167)][_0x336c3d(0x169)],'type':_0x6e6a90[_0x336c3d(0x167)]['type'],'selfContained':!![],'files':_0x6e6a90[_0x336c3d(0x167)][_0x336c3d(0x15f)][_0x336c3d(0x161)](_0x570638=>_0x570638['path'])},'description':_0x336c3d(0x14a)};},async 'execute'(_0x57092c){const _0xc59d80=a43_0xe7c030,_0x3d6295=buildSkillCreatePlan(_0x57092c['str'](_0xc59d80(0x15d)),_0x57092c[_0xc59d80(0x149)](_0xc59d80(0x163)),_0x57092c[_0xc59d80(0x149)]('target'));return writeSkillDraft(_0x3d6295,_0x57092c[_0xc59d80(0x14d)](_0xc59d80(0x15b))),{'ok':!![],'data':{'skillName':_0x3d6295[_0xc59d80(0x167)][_0xc59d80(0x169)],'type':_0x3d6295[_0xc59d80(0x167)]['type'],'dir':_0x3d6295[_0xc59d80(0x164)],'files':_0x3d6295[_0xc59d80(0x167)][_0xc59d80(0x15f)][_0xc59d80(0x161)](_0x4f39b5=>_0x4f39b5[_0xc59d80(0x157)])},'message':_0xc59d80(0x159)+_0x3d6295[_0xc59d80(0x167)][_0xc59d80(0x169)]};}};function buildSkillCreatePlan(_0xbf21f6,_0x5605e7,_0x397c00){const _0x27e6a5=a43_0xe7c030,_0x58e0d6=_0x5605e7[_0x27e6a5(0x147)](),_0x3c4f91=renderSkillTemplate({'skillName':_0xbf21f6,'type':_0x58e0d6});!_0x58e0d6&&writeCliSideChannelLine('Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.');const _0xe99e53=resolve(normalizeSkillTarget(_0x397c00));return{'rendered':_0x3c4f91,'targetRoot':_0xe99e53,'skillDir':resolve(_0xe99e53,_0x3c4f91[_0x27e6a5(0x169)])};}function normalizeSkillTarget(_0x37f730){const _0x4d64ad=a43_0xe7c030;return(_0x37f730||DEFAULT_SKILL_TARGET)[_0x4d64ad(0x147)]()||DEFAULT_SKILL_TARGET;}function a43_0xc466(){const _0x1615b2=['创建本地自包含的运行态\x20Skill\x20草稿','42vPbuDZ','Refusing\x20to\x20overwrite\x20symlink:\x20','57560nhDROg','skill','isDirectory','1687017nuaUwX','path','1005048DDmjkZ','Created\x20local\x20Skill\x20draft\x20','Skill\x20directory\x20already\x20exists:\x20','force','1361002zIqcdZ','name','90THHOqJ','files','content','map','2450130IgpEDB','type','skillDir','106148DfAcWP','WRITE','rendered','21nkxLCz','skillName','105994zvzxWF','target','trim','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','str','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','read','bool','utf8','isSymbolicLink'];a43_0xc466=function(){return _0x1615b2;};return a43_0xc466();}function writeSkillDraft(_0x555366,_0x1722f6){const _0x5b5839=a43_0xe7c030;if(existsSync(_0x555366[_0x5b5839(0x164)])){const _0x5cbbab=lstatSync(_0x555366[_0x5b5839(0x164)]);if(!_0x5cbbab[_0x5b5839(0x155)]()||_0x5cbbab[_0x5b5839(0x14f)]())throw CliErrors['validation'](_0x5b5839(0x14b)+_0x555366[_0x5b5839(0x164)]);if(!_0x1722f6)throw CliErrors['validation'](_0x5b5839(0x15a)+_0x555366[_0x5b5839(0x164)],_0x5b5839(0x148));}for(const _0x1bec0e of _0x555366[_0x5b5839(0x167)]['files']){const _0x28e107=resolve(_0x555366[_0x5b5839(0x164)],_0x1bec0e[_0x5b5839(0x157)]),_0x20e1a2=dirname(_0x28e107);mkdirSync(_0x20e1a2,{'recursive':!![]});if(existsSync(_0x28e107)&&lstatSync(_0x28e107)[_0x5b5839(0x14f)]())throw CliErrors['validation'](_0x5b5839(0x152)+_0x28e107);writeFileSync(_0x28e107,_0x1bec0e[_0x5b5839(0x160)],_0x5b5839(0x14e));}}
@@ -1 +1 @@
1
- const a44_0x12fdce=a44_0xf3d9;(function(_0x1292fd,_0x20fa2c){const _0x42c85f=a44_0xf3d9,_0x2783c8=_0x1292fd();while(!![]){try{const _0x45846e=-parseInt(_0x42c85f(0x13b))/0x1*(parseInt(_0x42c85f(0x12c))/0x2)+parseInt(_0x42c85f(0x140))/0x3*(parseInt(_0x42c85f(0x12f))/0x4)+parseInt(_0x42c85f(0x122))/0x5*(-parseInt(_0x42c85f(0x127))/0x6)+parseInt(_0x42c85f(0x11f))/0x7+-parseInt(_0x42c85f(0x13f))/0x8*(-parseInt(_0x42c85f(0x14f))/0x9)+-parseInt(_0x42c85f(0x13c))/0xa*(parseInt(_0x42c85f(0x132))/0xb)+parseInt(_0x42c85f(0x11e))/0xc;if(_0x45846e===_0x20fa2c)break;else _0x2783c8['push'](_0x2783c8['shift']());}catch(_0x5f3cff){_0x2783c8['push'](_0x2783c8['shift']());}}}(a44_0x2e17,0xf24c6));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';function a44_0xf3d9(_0x393bf3,_0x30f0d1){_0x393bf3=_0x393bf3-0x11e;const _0x2e17ec=a44_0x2e17();let _0xf3d97d=_0x2e17ec[_0x393bf3];return _0xf3d97d;}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(_0x5038ef){const _0x5d7c0a=a44_0xf3d9,_0x473700=_0x5038ef[_0x5d7c0a(0x135)](_0x5d7c0a(0x144))[_0x5d7c0a(0x138)](),_0xc15788=_0x5038ef['str'](_0x5d7c0a(0x136))['trim'](),_0x490f1c=_0x5038ef[_0x5d7c0a(0x135)](_0x5d7c0a(0x13d));if(!_0x473700||!_0xc15788||_0x490f1c!==_0x5d7c0a(0x14c)&&_0x490f1c!==_0x5d7c0a(0x12b))throw CliErrors[_0x5d7c0a(0x134)](_0x5d7c0a(0x121));return{'skillCode':_0x473700,'version':_0xc15788,'scope':_0x490f1c};}async function readDiagramWriteInput(_0x55af92){const _0x164d9c=a44_0xf3d9,_0x9fa93e=_0x55af92[_0x164d9c(0x12a)](_0x164d9c(0x14a)),_0x4ec78f=_0x55af92[_0x164d9c(0x135)](_0x164d9c(0x124))['trim']();if(!Number[_0x164d9c(0x14b)](_0x9fa93e)||_0x9fa93e<0x0)throw CliErrors['validation']('--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.');if(!/^sha256:[0-9a-f]{64}$/[_0x164d9c(0x131)](_0x4ec78f))throw CliErrors[_0x164d9c(0x134)](_0x164d9c(0x139));return{'expectedDiagramRevision':_0x9fa93e,'sourceFingerprint':_0x4ec78f,'diagram':await readRequiredSkillDiagram(_0x55af92[_0x164d9c(0x135)](_0x164d9c(0x137)))};}export const diagramValidateCommand={'service':a44_0x12fdce(0x130),'command':'diagram-validate','description':a44_0x12fdce(0x128),'risk':'read','flags':WRITE_FLAGS,async 'execute'(_0xb6eaa4){const _0x163f46=a44_0x12fdce,_0x245545=readDiagramTarget(_0xb6eaa4),_0x5e90f=await validateRuntimeSkillVersionDiagram(_0xb6eaa4[_0x163f46(0x14d)],_0x245545[_0x163f46(0x13a)],_0x245545[_0x163f46(0x136)],_0x245545[_0x163f46(0x13d)],await readDiagramWriteInput(_0xb6eaa4));return{'ok':!![],'data':_0x5e90f,'message':_0x163f46(0x146)+_0x245545[_0x163f46(0x13a)]+'@'+_0x245545['version']+'.'};}};export const diagramPushCommand={'service':a44_0x12fdce(0x130),'command':a44_0x12fdce(0x12e),'description':a44_0x12fdce(0x125),'risk':a44_0x12fdce(0x12d),'confirmationDescription':a44_0x12fdce(0x120),'flags':WRITE_FLAGS,async 'execute'(_0x56c507){const _0x37eb83=a44_0x12fdce,_0x125237=readDiagramTarget(_0x56c507),_0x1a9e61=await putRuntimeSkillVersionDiagram(_0x56c507[_0x37eb83(0x14d)],_0x125237[_0x37eb83(0x13a)],_0x125237['version'],_0x125237['scope'],await readDiagramWriteInput(_0x56c507));return{'ok':!![],'data':_0x1a9e61,'message':_0x1a9e61[_0x37eb83(0x147)]==='unchanged'?_0x37eb83(0x14e)+_0x125237['skillCode']+'@'+_0x125237[_0x37eb83(0x136)]+_0x37eb83(0x145):(_0x1a9e61[_0x37eb83(0x147)]===_0x37eb83(0x133)?_0x37eb83(0x129):_0x37eb83(0x141))+_0x37eb83(0x142)+_0x125237[_0x37eb83(0x13a)]+'@'+_0x125237[_0x37eb83(0x136)]+'.'};}};export const diagramShowCommand={'service':a44_0x12fdce(0x130),'command':a44_0x12fdce(0x149),'description':'Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','risk':a44_0x12fdce(0x148),'flags':TARGET_FLAGS,async 'execute'(_0x3131cd){const _0x3681d8=a44_0x12fdce,_0x27d726=readDiagramTarget(_0x3131cd),_0x45d2c5=await getRuntimeSkillVersionDiagram(_0x3131cd[_0x3681d8(0x14d)],_0x27d726[_0x3681d8(0x13a)],_0x27d726[_0x3681d8(0x136)],_0x27d726['scope']);return{'ok':!![],'data':_0x45d2c5,'message':_0x45d2c5[_0x3681d8(0x126)]?_0x3681d8(0x143)+_0x27d726['skillCode']+'@'+_0x27d726[_0x3681d8(0x136)]+_0x3681d8(0x150)+_0x45d2c5[_0x3681d8(0x123)]+'.':_0x3681d8(0x13e)+_0x27d726['skillCode']+'@'+_0x27d726[_0x3681d8(0x136)]+';\x20first\x20write\x20expects\x20revision\x20'+_0x45d2c5[_0x3681d8(0x123)]+'.'};}};function a44_0x2e17(){const _0x40aa90=['found','6hmeahh','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','Created','num','company','2582eVEXdQ','write','diagram-push','4ZKQjOZ','skill','test','11OUHWnp','created','validation','str','version','diagram-file','trim','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','skillCode','361ZdoLsJ','10479370AgDapt','scope','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','18264CaoAfQ','2159187IyHZkd','Updated','\x20Skill\x20diagram\x20for\x20','Found\x20Skill\x20diagram\x20for\x20','skill-code','\x20is\x20unchanged.','Skill\x20diagram\x20validation\x20passed\x20for\x20','action','read','diagram-show','expected-diagram-revision','isInteger','personal','appCode','Skill\x20diagram\x20for\x20','747ZNzhMb',';\x20next\x20write\x20expects\x20revision\x20','19055376rNRlaK','6582065yuEhCQ','将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','4655095BWycCC','expectedDiagramRevision','source-fingerprint','为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图'];a44_0x2e17=function(){return _0x40aa90;};return a44_0x2e17();}
1
+ const a44_0x4f9905=a44_0x3b4e;(function(_0x44ccc2,_0x1c47fa){const _0x2bd6c5=a44_0x3b4e,_0x468147=_0x44ccc2();while(!![]){try{const _0x25477f=parseInt(_0x2bd6c5(0xfb))/0x1*(-parseInt(_0x2bd6c5(0x105))/0x2)+-parseInt(_0x2bd6c5(0x104))/0x3+-parseInt(_0x2bd6c5(0xee))/0x4*(parseInt(_0x2bd6c5(0xe8))/0x5)+parseInt(_0x2bd6c5(0xf3))/0x6+-parseInt(_0x2bd6c5(0x109))/0x7+parseInt(_0x2bd6c5(0x103))/0x8+parseInt(_0x2bd6c5(0x113))/0x9*(parseInt(_0x2bd6c5(0xfe))/0xa);if(_0x25477f===_0x1c47fa)break;else _0x468147['push'](_0x468147['shift']());}catch(_0x45bf22){_0x468147['push'](_0x468147['shift']());}}}(a44_0x3546,0xeeef0));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';function a44_0x3b4e(_0x5d30f9,_0x180bfe){_0x5d30f9=_0x5d30f9-0xe3;const _0x35462f=a44_0x3546();let _0x3b4ee2=_0x35462f[_0x5d30f9];return _0x3b4ee2;}function a44_0x3546(){const _0x14c1b7=['source-fingerprint','skill','isInteger','diagram-validate','64795LJLACu','Skill\x20diagram\x20validation\x20passed\x20for\x20','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','read','write','test','140YfKMON','diagram-file','str','Updated',';\x20next\x20write\x20expects\x20revision\x20','6281820odIftC','trim','diagram-push','validation',';\x20first\x20write\x20expects\x20revision\x20','company','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','scope','112659XswKPG','skill-code','version','460lEbkJK','为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','\x20Skill\x20diagram\x20for\x20','将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','expectedDiagramRevision','7725200ibWEGp','3357513xfSWSy','34CeizSk','created','action','Created','1627507DRiOcE','\x20is\x20unchanged.','Found\x20Skill\x20diagram\x20for\x20','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','found','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','personal','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','Skill\x20diagram\x20for\x20','525618ZuzuPb','skillCode','appCode'];a44_0x3546=function(){return _0x14c1b7;};return a44_0x3546();}import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x2c9f07){const _0x5377c3=a44_0x3b4e,_0x2188a7=_0x2c9f07['str'](_0x5377c3(0xfc))['trim'](),_0x3e7f5d=_0x2c9f07['str'](_0x5377c3(0xfd))[_0x5377c3(0xf4)](),_0x1a82dc=_0x2c9f07[_0x5377c3(0xf0)]('scope');if(!_0x2188a7||!_0x3e7f5d||_0x1a82dc!==_0x5377c3(0x10f)&&_0x1a82dc!==_0x5377c3(0xf8))throw CliErrors[_0x5377c3(0xf6)](_0x5377c3(0xf9));return{'skillCode':_0x2188a7,'version':_0x3e7f5d,'scope':_0x1a82dc};}async function readDiagramWriteInput(_0x12fd2c){const _0x39bf7d=a44_0x3b4e,_0x4e2939=_0x12fd2c['num']('expected-diagram-revision'),_0x59f47a=_0x12fd2c[_0x39bf7d(0xf0)](_0x39bf7d(0xe4))[_0x39bf7d(0xf4)]();if(!Number[_0x39bf7d(0xe6)](_0x4e2939)||_0x4e2939<0x0)throw CliErrors[_0x39bf7d(0xf6)](_0x39bf7d(0xea));if(!/^sha256:[0-9a-f]{64}$/[_0x39bf7d(0xed)](_0x59f47a))throw CliErrors[_0x39bf7d(0xf6)](_0x39bf7d(0x10c));return{'expectedDiagramRevision':_0x4e2939,'sourceFingerprint':_0x59f47a,'diagram':await readRequiredSkillDiagram(_0x12fd2c[_0x39bf7d(0xf0)](_0x39bf7d(0xef)))};}export const diagramValidateCommand={'service':'skill','command':a44_0x4f9905(0xe7),'description':a44_0x4f9905(0x10e),'risk':a44_0x4f9905(0xeb),'flags':WRITE_FLAGS,async 'execute'(_0x43c330){const _0x376b5f=a44_0x4f9905,_0x3f0550=readDiagramTarget(_0x43c330),_0x360b97=await validateRuntimeSkillVersionDiagram(_0x43c330['appCode'],_0x3f0550[_0x376b5f(0x114)],_0x3f0550[_0x376b5f(0xfd)],_0x3f0550[_0x376b5f(0xfa)],await readDiagramWriteInput(_0x43c330));return{'ok':!![],'data':_0x360b97,'message':_0x376b5f(0xe9)+_0x3f0550[_0x376b5f(0x114)]+'@'+_0x3f0550['version']+'.'};}};export const diagramPushCommand={'service':a44_0x4f9905(0xe5),'command':a44_0x4f9905(0xf5),'description':a44_0x4f9905(0xff),'risk':a44_0x4f9905(0xec),'confirmationDescription':a44_0x4f9905(0x101),'flags':WRITE_FLAGS,async 'execute'(_0x53a3a6){const _0x5a1eac=a44_0x4f9905,_0x3ad76a=readDiagramTarget(_0x53a3a6),_0x290bce=await putRuntimeSkillVersionDiagram(_0x53a3a6[_0x5a1eac(0xe3)],_0x3ad76a['skillCode'],_0x3ad76a[_0x5a1eac(0xfd)],_0x3ad76a['scope'],await readDiagramWriteInput(_0x53a3a6));return{'ok':!![],'data':_0x290bce,'message':_0x290bce['action']==='unchanged'?_0x5a1eac(0x112)+_0x3ad76a[_0x5a1eac(0x114)]+'@'+_0x3ad76a[_0x5a1eac(0xfd)]+_0x5a1eac(0x10a):(_0x290bce[_0x5a1eac(0x107)]===_0x5a1eac(0x106)?_0x5a1eac(0x108):_0x5a1eac(0xf1))+_0x5a1eac(0x100)+_0x3ad76a[_0x5a1eac(0x114)]+'@'+_0x3ad76a['version']+'.'};}};export const diagramShowCommand={'service':a44_0x4f9905(0xe5),'command':'diagram-show','description':a44_0x4f9905(0x111),'risk':a44_0x4f9905(0xeb),'flags':TARGET_FLAGS,async 'execute'(_0x467961){const _0x1b29ce=a44_0x4f9905,_0x8bdb26=readDiagramTarget(_0x467961),_0xce6a98=await getRuntimeSkillVersionDiagram(_0x467961[_0x1b29ce(0xe3)],_0x8bdb26[_0x1b29ce(0x114)],_0x8bdb26[_0x1b29ce(0xfd)],_0x8bdb26[_0x1b29ce(0xfa)]);return{'ok':!![],'data':_0xce6a98,'message':_0xce6a98[_0x1b29ce(0x10d)]?_0x1b29ce(0x10b)+_0x8bdb26[_0x1b29ce(0x114)]+'@'+_0x8bdb26[_0x1b29ce(0xfd)]+_0x1b29ce(0xf2)+_0xce6a98['expectedDiagramRevision']+'.':_0x1b29ce(0x110)+_0x8bdb26['skillCode']+'@'+_0x8bdb26['version']+_0x1b29ce(0xf7)+_0xce6a98[_0x1b29ce(0x102)]+'.'};}};
@@ -1 +1 @@
1
- function a45_0x1ba9(){const _0xce6389=['1059738epIylf','filter','flatMap','action','code','read','install','removed','6hJnSnc','force','trim','includes','unchanged','7879752zMRnbE','86261zYejTX','skillCode','envName','5rxSAbc','all','company','\x20company\x20Skill(s).','bool','2497OXHlIn','personal','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','../../../core/api-client.js','appCode','created','length','project','8710fdUMLi','../../../skills/runtime-skill-sync.js','22341LlePDp','global','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','push','scope','updated','map','1045071zqVxJi','4eoQkIF','authRequired','362241YHSsaH','skill','120nroDVl'];a45_0x1ba9=function(){return _0xce6389;};return a45_0x1ba9();}const a45_0x307601=a45_0x3f8a;(function(_0x3a074e,_0x470f6d){const _0x288330=a45_0x3f8a,_0x579d00=_0x3a074e();while(!![]){try{const _0x5913d6=parseInt(_0x288330(0x102))/0x1*(-parseInt(_0x288330(0x117))/0x2)+-parseInt(_0x288330(0x109))/0x3*(parseInt(_0x288330(0x10a))/0x4)+-parseInt(_0x288330(0x120))/0x5*(parseInt(_0x288330(0x10f))/0x6)+parseInt(_0x288330(0x11d))/0x7*(parseInt(_0x288330(0x10e))/0x8)+-parseInt(_0x288330(0x10c))/0x9+parseInt(_0x288330(0x100))/0xa*(parseInt(_0x288330(0x125))/0xb)+parseInt(_0x288330(0x11c))/0xc;if(_0x5913d6===_0x470f6d)break;else _0x579d00['push'](_0x579d00['shift']());}catch(_0x3ff08b){_0x579d00['push'](_0x579d00['shift']());}}}(a45_0x1ba9,0x635ac));import{CliErrors}from'../../../errors.js';function a45_0x3f8a(_0x155a19,_0x385587){_0x155a19=_0x155a19-0xf9;const _0x1ba92a=a45_0x1ba9();let _0x3f8a54=_0x1ba92a[_0x155a19];return _0x3f8a54;}import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':a45_0x307601(0x10d),'command':a45_0x307601(0x115),'description':a45_0x307601(0x104),'risk':a45_0x307601(0x114),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x4ae050){return syncRuntimeSkills(_0x4ae050);}};async function syncRuntimeSkills(_0x377abb){const _0x7c0134=a45_0x307601,{downloadRuntimeSkillPackage:_0x161358,listRuntimeSkills:_0x2d580a}=await import(_0x7c0134(0xfb)),{linkEffectiveRuntimeSkills:_0x438c9a,materializeRuntimeSkill:_0x5e3591,pruneStaleRuntimeSkillCache:_0x26cb0b,pruneStaleRuntimeSkillLinks:_0x588061,resolveRuntimeSkillInstallTarget:_0x483523}=await import(_0x7c0134(0x101)),_0x3a29ae=_0x377abb['str'](_0x7c0134(0x113)),_0x3f6d97=normalizeSyncScopes(_0x377abb['str'](_0x7c0134(0x106))),_0x4844ca=_0x377abb[_0x7c0134(0x11f)]??'production',_0x2a2dd7=_0x377abb['accessKey'],_0x13cc28=_0x377abb[_0x7c0134(0x124)](_0x7c0134(0x118));if(!_0x2a2dd7)throw CliErrors[_0x7c0134(0x10b)](_0x7c0134(0xfa));const _0x25508d=_0x483523(_0x377abb[_0x7c0134(0xfc)],_0x377abb[_0x7c0134(0x124)](_0x7c0134(0xff))?'project':_0x7c0134(0x103)),_0x42af44=_0x483523(_0x377abb['appCode'],_0x25508d[_0x7c0134(0x106)]===_0x7c0134(0xff)?_0x7c0134(0x103):_0x7c0134(0xff)),_0x411300=await Promise[_0x7c0134(0x121)](_0x3f6d97['map'](_0x2e5a83=>_0x2d580a({'appCode':_0x377abb[_0x7c0134(0xfc)],'scope':_0x2e5a83,'code':_0x3a29ae[_0x7c0134(0x119)]()||undefined}))),_0x594774=_0x3f6d97[_0x7c0134(0x11a)](_0x7c0134(0xf9))?_0x411300[_0x7c0134(0x111)]((_0xb3a09,_0x108381)=>_0x3f6d97[_0x108381]==='personal'?_0xb3a09['personal']:[]):[],_0x4a41ed=_0x3f6d97['includes']('company')?_0x411300[_0x7c0134(0x111)]((_0x28dca8,_0x16e04c)=>_0x3f6d97[_0x16e04c]===_0x7c0134(0x122)?_0x28dca8[_0x7c0134(0x122)]:[]):[],_0x403815=new Set([..._0x594774[_0x7c0134(0x108)](_0xd63e8b=>_0xd63e8b['skillCode']?.['trim']())[_0x7c0134(0x110)](_0x27552f=>Boolean(_0x27552f)),..._0x4a41ed[_0x7c0134(0x108)](_0x36dcf2=>_0x36dcf2[_0x7c0134(0x11e)]?.[_0x7c0134(0x119)]())['filter'](_0x1b6956=>Boolean(_0x1b6956))]),_0x17e367=_0x3a29ae['trim']()?[_0x3a29ae[_0x7c0134(0x119)]()]:undefined,_0x1e7021=_0x3f6d97[_0x7c0134(0xfe)]===0x2&&_0x3f6d97[_0x7c0134(0x11a)]('personal')&&_0x3f6d97[_0x7c0134(0x11a)](_0x7c0134(0x122)),_0x3c1755=_0x1e7021?_0x588061(_0x25508d,_0x403815,_0x17e367):[],_0x3e2be3=_0x26cb0b({'env':_0x4844ca,'accessKey':_0x2a2dd7,'appCode':_0x377abb[_0x7c0134(0xfc)],'activeSkillCodes':_0x403815,'pruneSkillCodes':_0x17e367,'scopes':_0x3f6d97,'protectedLinkRoots':_0x42af44['skillRoots']}),_0x384ee5=[];for(const _0x3179a5 of _0x594774){_0x384ee5[_0x7c0134(0x105)](_0x5e3591(_0x3179a5,_0x7c0134(0xf9),{'env':_0x4844ca,'accessKey':_0x2a2dd7,'appCode':_0x377abb[_0x7c0134(0xfc)],'force':_0x13cc28,'packageBytes':await downloadSkillPackage(_0x3179a5,_0x7c0134(0xf9),_0x377abb[_0x7c0134(0xfc)],_0x161358)}));}for(const _0x568baa of _0x4a41ed){_0x384ee5[_0x7c0134(0x105)](_0x5e3591(_0x568baa,_0x7c0134(0x122),{'env':_0x4844ca,'accessKey':_0x2a2dd7,'appCode':_0x377abb['appCode'],'force':_0x13cc28,'packageBytes':await downloadSkillPackage(_0x568baa,_0x7c0134(0x122),_0x377abb[_0x7c0134(0xfc)],_0x161358)}));}const _0x2c1731=_0x438c9a(_0x384ee5,_0x25508d),_0x2aa538=countLinkActions(_0x2c1731);return{'ok':!![],'data':{'appCode':_0x377abb[_0x7c0134(0xfc)],..._0x25508d['scope']===_0x7c0134(0xff)?{'installTarget':{'scope':_0x25508d[_0x7c0134(0x106)],'skillRoots':[..._0x25508d['skillRoots']]}}:{},'personal':_0x594774[_0x7c0134(0xfe)],'company':_0x4a41ed[_0x7c0134(0xfe)],'materialized':_0x384ee5[_0x7c0134(0xfe)],'links':{'total':_0x2c1731[_0x7c0134(0xfe)],'created':_0x2aa538[_0x7c0134(0xfd)]??0x0,'updated':_0x2aa538[_0x7c0134(0x107)]??0x0,'unchanged':_0x2aa538[_0x7c0134(0x11b)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x3c1755[_0x7c0134(0x110)](_0x340f0f=>_0x340f0f[_0x7c0134(0x112)]===_0x7c0134(0x116))[_0x7c0134(0xfe)],'cacheDirs':_0x3e2be3[_0x7c0134(0x110)](_0x3c9e9b=>_0x3c9e9b[_0x7c0134(0x112)]===_0x7c0134(0x116))[_0x7c0134(0xfe)],'skipped':[..._0x3c1755,..._0x3e2be3][_0x7c0134(0x110)](_0x53588f=>_0x53588f[_0x7c0134(0x112)]==='skipped')[_0x7c0134(0xfe)]},'skills':{'personal':_0x594774['map'](summarizeRuntimeSkill),'company':_0x4a41ed[_0x7c0134(0x108)](summarizeRuntimeSkill)}},'message':'Installed\x20'+_0x594774[_0x7c0134(0xfe)]+'\x20personal\x20and\x20'+_0x4a41ed['length']+_0x7c0134(0x123)};}async function downloadSkillPackage(_0x3b9b6e,_0x163dce,_0x10ee24,_0xe845d){const _0x1f2392=_0x3b9b6e['version']?.['trim']();return _0x1f2392?_0xe845d(_0x163dce,_0x3b9b6e['skillCode'],_0x10ee24,_0x1f2392):_0xe845d(_0x163dce,_0x3b9b6e['skillCode'],_0x10ee24);}function countLinkActions(_0x5d5692){return _0x5d5692['reduce']((_0x1bb2e7,_0x805753)=>{const _0x130a2d=a45_0x3f8a;return _0x1bb2e7[_0x805753['action']]=(_0x1bb2e7[_0x805753[_0x130a2d(0x112)]]??0x0)+0x1,_0x1bb2e7;},{});}
1
+ const a45_0x21cc27=a45_0xa6ec;(function(_0x3e5028,_0x14209b){const _0x32afcd=a45_0xa6ec,_0x1308bc=_0x3e5028();while(!![]){try{const _0x549309=-parseInt(_0x32afcd(0x16f))/0x1*(parseInt(_0x32afcd(0x172))/0x2)+parseInt(_0x32afcd(0x16b))/0x3*(-parseInt(_0x32afcd(0x176))/0x4)+parseInt(_0x32afcd(0x164))/0x5*(-parseInt(_0x32afcd(0x179))/0x6)+parseInt(_0x32afcd(0x166))/0x7*(parseInt(_0x32afcd(0x180))/0x8)+parseInt(_0x32afcd(0x163))/0x9+-parseInt(_0x32afcd(0x18c))/0xa+parseInt(_0x32afcd(0x17a))/0xb*(parseInt(_0x32afcd(0x161))/0xc);if(_0x549309===_0x14209b)break;else _0x1308bc['push'](_0x1308bc['shift']());}catch(_0x5484df){_0x1308bc['push'](_0x1308bc['shift']());}}}(a45_0x1e24,0x3ffd8));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';function a45_0xa6ec(_0x533a72,_0x4ddd7f){_0x533a72=_0x533a72-0x160;const _0x1e244b=a45_0x1e24();let _0xa6ec6f=_0x1e244b[_0x533a72];return _0xa6ec6f;}function a45_0x1e24(){const _0x38d19f=['removed','authRequired','1230792AzaeZS','personal','3768174kVLkiZ','5HozfXr','scope','49ttkiNJ','skillCode','read','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','filter','148020TtvEMq','production','flatMap','appCode','39356KPyxxV','../../../core/api-client.js','includes','2MloAXA','version','envName','project','40FNgYwx','\x20company\x20Skill(s).','created','1621770DxEJYm','66xGUJxd','push','length','\x20personal\x20and\x20','action','bool','189424DzHdGn','global','all','map','str','skill','company','updated','trim','skillRoots','skipped','code','1346730zVZIVM'];a45_0x1e24=function(){return _0x38d19f;};return a45_0x1e24();}export const installCommand={'service':a45_0x21cc27(0x185),'command':'install','description':a45_0x21cc27(0x169),'risk':a45_0x21cc27(0x168),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x2049db){return syncRuntimeSkills(_0x2049db);}};async function syncRuntimeSkills(_0x4a6746){const _0x1d6dde=a45_0x21cc27,{downloadRuntimeSkillPackage:_0x310e5e,listRuntimeSkills:_0x385e04}=await import(_0x1d6dde(0x170)),{linkEffectiveRuntimeSkills:_0x2934a0,materializeRuntimeSkill:_0x395cc9,pruneStaleRuntimeSkillCache:_0xd6557d,pruneStaleRuntimeSkillLinks:_0x105f81,resolveRuntimeSkillInstallTarget:_0x3421a8}=await import('../../../skills/runtime-skill-sync.js'),_0x2f54b6=_0x4a6746[_0x1d6dde(0x184)](_0x1d6dde(0x18b)),_0x3e3e78=normalizeSyncScopes(_0x4a6746[_0x1d6dde(0x184)](_0x1d6dde(0x165))),_0x42b0ad=_0x4a6746[_0x1d6dde(0x174)]??_0x1d6dde(0x16c),_0xf3c7e=_0x4a6746['accessKey'],_0x275a32=_0x4a6746[_0x1d6dde(0x17f)]('force');if(!_0xf3c7e)throw CliErrors[_0x1d6dde(0x160)]('Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.');const _0x30cca5=_0x3421a8(_0x4a6746[_0x1d6dde(0x16e)],_0x4a6746[_0x1d6dde(0x17f)](_0x1d6dde(0x175))?_0x1d6dde(0x175):_0x1d6dde(0x181)),_0x597631=_0x3421a8(_0x4a6746[_0x1d6dde(0x16e)],_0x30cca5[_0x1d6dde(0x165)]===_0x1d6dde(0x175)?_0x1d6dde(0x181):'project'),_0x44e8c0=await Promise[_0x1d6dde(0x182)](_0x3e3e78['map'](_0x5be989=>_0x385e04({'appCode':_0x4a6746[_0x1d6dde(0x16e)],'scope':_0x5be989,'code':_0x2f54b6[_0x1d6dde(0x188)]()||undefined}))),_0x5accab=_0x3e3e78[_0x1d6dde(0x171)](_0x1d6dde(0x162))?_0x44e8c0[_0x1d6dde(0x16d)]((_0x35f9e8,_0x228471)=>_0x3e3e78[_0x228471]===_0x1d6dde(0x162)?_0x35f9e8[_0x1d6dde(0x162)]:[]):[],_0x5f52cc=_0x3e3e78[_0x1d6dde(0x171)](_0x1d6dde(0x186))?_0x44e8c0[_0x1d6dde(0x16d)]((_0x4f298a,_0x170cd9)=>_0x3e3e78[_0x170cd9]===_0x1d6dde(0x186)?_0x4f298a['company']:[]):[],_0xc02d6f=new Set([..._0x5accab[_0x1d6dde(0x183)](_0x13b720=>_0x13b720['skillCode']?.['trim']())[_0x1d6dde(0x16a)](_0x143df2=>Boolean(_0x143df2)),..._0x5f52cc[_0x1d6dde(0x183)](_0x9d310a=>_0x9d310a['skillCode']?.[_0x1d6dde(0x188)]())[_0x1d6dde(0x16a)](_0x4e456d=>Boolean(_0x4e456d))]),_0x1b9bc1=_0x2f54b6['trim']()?[_0x2f54b6['trim']()]:undefined,_0x4ed34a=_0x3e3e78['length']===0x2&&_0x3e3e78[_0x1d6dde(0x171)](_0x1d6dde(0x162))&&_0x3e3e78[_0x1d6dde(0x171)](_0x1d6dde(0x186)),_0x17da9a=_0x4ed34a?_0x105f81(_0x30cca5,_0xc02d6f,_0x1b9bc1):[],_0x18cfd2=_0xd6557d({'env':_0x42b0ad,'accessKey':_0xf3c7e,'appCode':_0x4a6746[_0x1d6dde(0x16e)],'activeSkillCodes':_0xc02d6f,'pruneSkillCodes':_0x1b9bc1,'scopes':_0x3e3e78,'protectedLinkRoots':_0x597631[_0x1d6dde(0x189)]}),_0x57365b=[];for(const _0x2faf69 of _0x5accab){_0x57365b[_0x1d6dde(0x17b)](_0x395cc9(_0x2faf69,'personal',{'env':_0x42b0ad,'accessKey':_0xf3c7e,'appCode':_0x4a6746[_0x1d6dde(0x16e)],'force':_0x275a32,'packageBytes':await downloadSkillPackage(_0x2faf69,_0x1d6dde(0x162),_0x4a6746[_0x1d6dde(0x16e)],_0x310e5e)}));}for(const _0x276653 of _0x5f52cc){_0x57365b[_0x1d6dde(0x17b)](_0x395cc9(_0x276653,_0x1d6dde(0x186),{'env':_0x42b0ad,'accessKey':_0xf3c7e,'appCode':_0x4a6746[_0x1d6dde(0x16e)],'force':_0x275a32,'packageBytes':await downloadSkillPackage(_0x276653,'company',_0x4a6746[_0x1d6dde(0x16e)],_0x310e5e)}));}const _0x3a432d=_0x2934a0(_0x57365b,_0x30cca5),_0x327919=countLinkActions(_0x3a432d);return{'ok':!![],'data':{'appCode':_0x4a6746[_0x1d6dde(0x16e)],..._0x30cca5['scope']==='project'?{'installTarget':{'scope':_0x30cca5[_0x1d6dde(0x165)],'skillRoots':[..._0x30cca5[_0x1d6dde(0x189)]]}}:{},'personal':_0x5accab['length'],'company':_0x5f52cc[_0x1d6dde(0x17c)],'materialized':_0x57365b[_0x1d6dde(0x17c)],'links':{'total':_0x3a432d[_0x1d6dde(0x17c)],'created':_0x327919[_0x1d6dde(0x178)]??0x0,'updated':_0x327919[_0x1d6dde(0x187)]??0x0,'unchanged':_0x327919['unchanged']??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x17da9a[_0x1d6dde(0x16a)](_0x32aa8a=>_0x32aa8a[_0x1d6dde(0x17e)]===_0x1d6dde(0x18d))[_0x1d6dde(0x17c)],'cacheDirs':_0x18cfd2[_0x1d6dde(0x16a)](_0x328a0a=>_0x328a0a[_0x1d6dde(0x17e)]==='removed')['length'],'skipped':[..._0x17da9a,..._0x18cfd2]['filter'](_0x271081=>_0x271081[_0x1d6dde(0x17e)]===_0x1d6dde(0x18a))[_0x1d6dde(0x17c)]},'skills':{'personal':_0x5accab['map'](summarizeRuntimeSkill),'company':_0x5f52cc['map'](summarizeRuntimeSkill)}},'message':'Installed\x20'+_0x5accab[_0x1d6dde(0x17c)]+_0x1d6dde(0x17d)+_0x5f52cc[_0x1d6dde(0x17c)]+_0x1d6dde(0x177)};}async function downloadSkillPackage(_0x4016d5,_0x25066c,_0x134145,_0x386d7b){const _0x4735ba=a45_0x21cc27,_0x2aa0a1=_0x4016d5[_0x4735ba(0x173)]?.[_0x4735ba(0x188)]();return _0x2aa0a1?_0x386d7b(_0x25066c,_0x4016d5['skillCode'],_0x134145,_0x2aa0a1):_0x386d7b(_0x25066c,_0x4016d5[_0x4735ba(0x167)],_0x134145);}function countLinkActions(_0x55f892){return _0x55f892['reduce']((_0x8de794,_0x1f2c83)=>{const _0x11af45=a45_0xa6ec;return _0x8de794[_0x1f2c83[_0x11af45(0x17e)]]=(_0x8de794[_0x1f2c83[_0x11af45(0x17e)]]??0x0)+0x1,_0x8de794;},{});}
@@ -1 +1 @@
1
- const a46_0x2ee495=a46_0x5d71;(function(_0x190094,_0x3e6da3){const _0x59cce3=a46_0x5d71,_0x511cb0=_0x190094();while(!![]){try{const _0x5ef5c2=-parseInt(_0x59cce3(0x183))/0x1*(-parseInt(_0x59cce3(0x168))/0x2)+-parseInt(_0x59cce3(0x16b))/0x3*(parseInt(_0x59cce3(0x173))/0x4)+-parseInt(_0x59cce3(0x17b))/0x5*(-parseInt(_0x59cce3(0x162))/0x6)+parseInt(_0x59cce3(0x172))/0x7+parseInt(_0x59cce3(0x182))/0x8*(-parseInt(_0x59cce3(0x17d))/0x9)+-parseInt(_0x59cce3(0x17a))/0xa*(-parseInt(_0x59cce3(0x16e))/0xb)+parseInt(_0x59cce3(0x187))/0xc*(-parseInt(_0x59cce3(0x180))/0xd);if(_0x5ef5c2===_0x3e6da3)break;else _0x511cb0['push'](_0x511cb0['shift']());}catch(_0x3e0f0d){_0x511cb0['push'](_0x511cb0['shift']());}}}(a46_0x20f3,0xbd01a));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';function a46_0x5d71(_0x1abef2,_0x393ee0){_0x1abef2=_0x1abef2-0x162;const _0x20f33c=a46_0x20f3();let _0x5d719f=_0x20f33c[_0x1abef2];return _0x5d719f;}function a46_0x20f3(){const _0x1d9d5e=['List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','5628RCXmfa','18078beuPEA','list','../../../core/api-client.js','appCode','trim','length','419194qKUAkV','\x20local\x20Skill(s).','bool','3UUUiiq','read','map','73348LGVmtn','project','remote','builtin','2843260zCJhps','2576524zWivgJ','authRequired','personal','code','scope','\x20remote\x20Skill(s).','local','750GHjANe','585xyBuIw','company','9KqSIXj','accessKey','filter','16861JCytwb','envName','5595088UgXaql','7lWMMtt','str','skill'];a46_0x20f3=function(){return _0x1d9d5e;};return a46_0x20f3();}import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a46_0x2ee495(0x185),'command':a46_0x2ee495(0x163),'description':a46_0x2ee495(0x186),'risk':a46_0x2ee495(0x16c),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x1e952c){const _0x1e5dac=a46_0x2ee495,_0x59f591=_0x1e952c['str'](_0x1e5dac(0x176)),_0x72548=normalizeListScope(_0x1e952c[_0x1e5dac(0x184)](_0x1e5dac(0x177)));if(_0x1e952c[_0x1e5dac(0x16a)](_0x1e5dac(0x179))){const _0x11bba6=_0x1e952c[_0x1e5dac(0x17e)];if(!_0x11bba6)throw CliErrors[_0x1e5dac(0x174)]();const {listLocalRuntimeSkills:_0x2b816e,resolveRuntimeSkillInstallTarget:_0x2b1a99}=await import('../../../skills/runtime-skill-sync.js'),_0x1d08ff=_0x2b1a99(_0x1e952c[_0x1e5dac(0x165)],_0x1e952c[_0x1e5dac(0x16a)](_0x1e5dac(0x16f))?_0x1e5dac(0x16f):'global'),_0x5f1f60=_0x2b816e({'env':_0x1e952c[_0x1e5dac(0x181)]??'production','accessKey':_0x11bba6,'appCode':_0x1e952c[_0x1e5dac(0x165)],'scopes':listScopeToRuntimeScopes(_0x72548),'code':_0x59f591[_0x1e5dac(0x166)]()||undefined},_0x1d08ff),_0xeb1693=groupLocalRuntimeSkills(_0x5f1f60);return{'ok':!![],'data':{'appCode':_0x1e952c['appCode'],'source':_0x1e5dac(0x179),..._0x1d08ff['scope']===_0x1e5dac(0x16f)?{'installScope':_0x1d08ff[_0x1e5dac(0x177)]}:{},'scope':_0x72548,'total':_0x5f1f60['length'],'personal':_0xeb1693[_0x1e5dac(0x175)]['length'],'company':_0xeb1693[_0x1e5dac(0x17c)]['length'],'items':_0x5f1f60[_0x1e5dac(0x16d)](summarizeLocalRuntimeSkill),'skills':{'personal':_0xeb1693[_0x1e5dac(0x175)][_0x1e5dac(0x16d)](summarizeLocalRuntimeSkill),'company':_0xeb1693[_0x1e5dac(0x17c)]['map'](summarizeLocalRuntimeSkill)}},'message':'Listed\x20'+_0x5f1f60[_0x1e5dac(0x167)]+_0x1e5dac(0x169)};}const {listRuntimeSkills:_0x8ab8a9}=await import(_0x1e5dac(0x164)),_0x35f98b=await _0x8ab8a9({'appCode':_0x1e952c[_0x1e5dac(0x165)],'scope':listScopeToRemoteScope(_0x72548),'code':_0x59f591[_0x1e5dac(0x166)]()||undefined}),_0x499d77=shouldListScope(_0x72548,_0x1e5dac(0x175))?_0x35f98b[_0x1e5dac(0x175)]??[]:[],_0x491ffe=shouldListScope(_0x72548,_0x1e5dac(0x17c))?_0x35f98b[_0x1e5dac(0x17c)]??[]:[],_0x3335bd=[..._0x499d77,..._0x491ffe];return{'ok':!![],'data':{'appCode':_0x1e952c[_0x1e5dac(0x165)],'source':_0x1e5dac(0x170),'scope':_0x72548,'total':_0x3335bd[_0x1e5dac(0x167)],'personal':_0x499d77[_0x1e5dac(0x167)],'company':_0x491ffe[_0x1e5dac(0x167)],'items':_0x3335bd[_0x1e5dac(0x16d)](summarizeRuntimeSkill),'skills':{'personal':_0x499d77[_0x1e5dac(0x16d)](summarizeRuntimeSkill),'company':_0x491ffe[_0x1e5dac(0x16d)](summarizeRuntimeSkill)}},'message':'Listed\x20'+_0x3335bd['length']+_0x1e5dac(0x178)};}};function groupLocalRuntimeSkills(_0x176747){const _0x14dfd5=a46_0x2ee495;return{'personal':_0x176747[_0x14dfd5(0x17f)](_0x1a6f54=>_0x1a6f54['scope']===_0x14dfd5(0x175)),'company':_0x176747[_0x14dfd5(0x17f)](_0x32857e=>_0x32857e[_0x14dfd5(0x177)]===_0x14dfd5(0x17c)),'builtin':_0x176747['filter'](_0xfdb175=>_0xfdb175[_0x14dfd5(0x177)]===_0x14dfd5(0x171))};}
1
+ const a46_0x28a4bd=a46_0x2e13;(function(_0x4127b4,_0x1f932b){const _0x4d816c=a46_0x2e13,_0x2e5078=_0x4127b4();while(!![]){try{const _0xf91ffa=-parseInt(_0x4d816c(0x1ea))/0x1+-parseInt(_0x4d816c(0x1f1))/0x2*(-parseInt(_0x4d816c(0x1e7))/0x3)+parseInt(_0x4d816c(0x1ef))/0x4+parseInt(_0x4d816c(0x1ed))/0x5+parseInt(_0x4d816c(0x1f8))/0x6*(-parseInt(_0x4d816c(0x1e6))/0x7)+parseInt(_0x4d816c(0x1e5))/0x8*(-parseInt(_0x4d816c(0x1d6))/0x9)+-parseInt(_0x4d816c(0x1f6))/0xa*(parseInt(_0x4d816c(0x1e2))/0xb);if(_0xf91ffa===_0x1f932b)break;else _0x2e5078['push'](_0x2e5078['shift']());}catch(_0x19d133){_0x2e5078['push'](_0x2e5078['shift']());}}}(a46_0x5716,0x72cbc));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';function a46_0x5716(){const _0x5c84be=['10fGxYAg','production','6vIHznN','7956kMVDtZ','read','local','personal','bool','\x20local\x20Skill(s).','filter','project','global','code','skill','remote','4991767fQNtdH','company','Listed\x20','2008BmkyYY','1402317HBVuPk','2331cyQpEF','../../../core/api-client.js','../../../skills/runtime-skill-sync.js','154075qkVgHx','scope','\x20remote\x20Skill(s).','2544380lacUEd','list','2352608jdRGZF','length','1038EbEZZm','map','builtin','accessKey','appCode'];a46_0x5716=function(){return _0x5c84be;};return a46_0x5716();}import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a46_0x28a4bd(0x1e0),'command':a46_0x28a4bd(0x1ee),'description':'List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','risk':a46_0x28a4bd(0x1d7),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x11ddcb){const _0x45092f=a46_0x28a4bd,_0xf43eb4=_0x11ddcb['str'](_0x45092f(0x1df)),_0x44e827=normalizeListScope(_0x11ddcb['str'](_0x45092f(0x1eb)));if(_0x11ddcb[_0x45092f(0x1da)](_0x45092f(0x1d8))){const _0x289bf1=_0x11ddcb[_0x45092f(0x1f4)];if(!_0x289bf1)throw CliErrors['authRequired']();const {listLocalRuntimeSkills:_0x12efe6,resolveRuntimeSkillInstallTarget:_0x3d6fbf}=await import(_0x45092f(0x1e9)),_0x6e3ae0=_0x3d6fbf(_0x11ddcb[_0x45092f(0x1f5)],_0x11ddcb[_0x45092f(0x1da)]('project')?_0x45092f(0x1dd):_0x45092f(0x1de)),_0x135438=_0x12efe6({'env':_0x11ddcb['envName']??_0x45092f(0x1f7),'accessKey':_0x289bf1,'appCode':_0x11ddcb[_0x45092f(0x1f5)],'scopes':listScopeToRuntimeScopes(_0x44e827),'code':_0xf43eb4['trim']()||undefined},_0x6e3ae0),_0x506e32=groupLocalRuntimeSkills(_0x135438);return{'ok':!![],'data':{'appCode':_0x11ddcb[_0x45092f(0x1f5)],'source':'local',..._0x6e3ae0[_0x45092f(0x1eb)]===_0x45092f(0x1dd)?{'installScope':_0x6e3ae0[_0x45092f(0x1eb)]}:{},'scope':_0x44e827,'total':_0x135438[_0x45092f(0x1f0)],'personal':_0x506e32[_0x45092f(0x1d9)]['length'],'company':_0x506e32[_0x45092f(0x1e3)][_0x45092f(0x1f0)],'items':_0x135438[_0x45092f(0x1f2)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x506e32['personal'][_0x45092f(0x1f2)](summarizeLocalRuntimeSkill),'company':_0x506e32[_0x45092f(0x1e3)]['map'](summarizeLocalRuntimeSkill)}},'message':_0x45092f(0x1e4)+_0x135438['length']+_0x45092f(0x1db)};}const {listRuntimeSkills:_0x3d2838}=await import(_0x45092f(0x1e8)),_0x28e005=await _0x3d2838({'appCode':_0x11ddcb[_0x45092f(0x1f5)],'scope':listScopeToRemoteScope(_0x44e827),'code':_0xf43eb4['trim']()||undefined}),_0x8da2e5=shouldListScope(_0x44e827,_0x45092f(0x1d9))?_0x28e005[_0x45092f(0x1d9)]??[]:[],_0x64d060=shouldListScope(_0x44e827,_0x45092f(0x1e3))?_0x28e005[_0x45092f(0x1e3)]??[]:[],_0x578b0c=[..._0x8da2e5,..._0x64d060];return{'ok':!![],'data':{'appCode':_0x11ddcb[_0x45092f(0x1f5)],'source':_0x45092f(0x1e1),'scope':_0x44e827,'total':_0x578b0c[_0x45092f(0x1f0)],'personal':_0x8da2e5['length'],'company':_0x64d060['length'],'items':_0x578b0c[_0x45092f(0x1f2)](summarizeRuntimeSkill),'skills':{'personal':_0x8da2e5['map'](summarizeRuntimeSkill),'company':_0x64d060[_0x45092f(0x1f2)](summarizeRuntimeSkill)}},'message':'Listed\x20'+_0x578b0c[_0x45092f(0x1f0)]+_0x45092f(0x1ec)};}};function a46_0x2e13(_0x5de993,_0x202a4c){_0x5de993=_0x5de993-0x1d6;const _0x57169d=a46_0x5716();let _0x2e135d=_0x57169d[_0x5de993];return _0x2e135d;}function groupLocalRuntimeSkills(_0x17b5b4){const _0x51cb23=a46_0x28a4bd;return{'personal':_0x17b5b4[_0x51cb23(0x1dc)](_0x2871d7=>_0x2871d7['scope']===_0x51cb23(0x1d9)),'company':_0x17b5b4[_0x51cb23(0x1dc)](_0x35367a=>_0x35367a[_0x51cb23(0x1eb)]===_0x51cb23(0x1e3)),'builtin':_0x17b5b4[_0x51cb23(0x1dc)](_0x50a75b=>_0x50a75b[_0x51cb23(0x1eb)]===_0x51cb23(0x1f3))};}
@@ -1 +1 @@
1
- const a47_0x3be54f=a47_0x3a7c;function a47_0x3a7c(_0x7b3902,_0x408cef){_0x7b3902=_0x7b3902-0x183;const _0x590ad8=a47_0x590a();let _0x3a7cf4=_0x590ad8[_0x7b3902];return _0x3a7cf4;}(function(_0x3ac356,_0x3e9e61){const _0x3cb687=a47_0x3a7c,_0x15f5f4=_0x3ac356();while(!![]){try{const _0x5f0451=parseInt(_0x3cb687(0x183))/0x1+parseInt(_0x3cb687(0x184))/0x2+-parseInt(_0x3cb687(0x18f))/0x3*(parseInt(_0x3cb687(0x186))/0x4)+parseInt(_0x3cb687(0x187))/0x5+-parseInt(_0x3cb687(0x190))/0x6*(-parseInt(_0x3cb687(0x18d))/0x7)+parseInt(_0x3cb687(0x188))/0x8+-parseInt(_0x3cb687(0x18c))/0x9;if(_0x5f0451===_0x3e9e61)break;else _0x15f5f4['push'](_0x15f5f4['shift']());}catch(_0x2e31d9){_0x15f5f4['push'](_0x15f5f4['shift']());}}}(a47_0x590a,0x7c079));import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';export const pushCommand={'service':a47_0x3be54f(0x18b),'command':a47_0x3be54f(0x18a),'description':a47_0x3be54f(0x185),'risk':a47_0x3be54f(0x189),'confirmationDescription':a47_0x3be54f(0x18e),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};function a47_0x590a(){const _0x21c4c4=['1195749nGLFvn','7nvbOqE','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','21pPzOVP','95406xbbOUi','149558hsbbCc','137150HdQvbo','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','123468sQvBXe','2768865ExrQky','553184GCIeJp','write','push','skill'];a47_0x590a=function(){return _0x21c4c4;};return a47_0x590a();}
1
+ function a47_0x2745(){const _0x83fe9e=['将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','381736JpsQrv','1822377VhzCfO','18JMOwGg','2809308bUaTtj','10sdZgtv','skill','7501241oCQmsO','4KRRPFx','91TfZEkS','6468345sBGlpm','5322gKmYnG','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','294565BBjntk'];a47_0x2745=function(){return _0x83fe9e;};return a47_0x2745();}const a47_0x3b7acf=a47_0x7a48;(function(_0x1e8ef0,_0x154e4f){const _0x25ffe0=a47_0x7a48,_0x341977=_0x1e8ef0();while(!![]){try{const _0x4a83e4=parseInt(_0x25ffe0(0x1f7))/0x1*(-parseInt(_0x25ffe0(0x1fa))/0x2)+parseInt(_0x25ffe0(0x1ff))/0x3+-parseInt(_0x25ffe0(0x201))/0x4+parseInt(_0x25ffe0(0x1fc))/0x5*(-parseInt(_0x25ffe0(0x200))/0x6)+parseInt(_0x25ffe0(0x1f8))/0x7*(parseInt(_0x25ffe0(0x1fe))/0x8)+parseInt(_0x25ffe0(0x1f9))/0x9+-parseInt(_0x25ffe0(0x1f4))/0xa*(parseInt(_0x25ffe0(0x1f6))/0xb);if(_0x4a83e4===_0x154e4f)break;else _0x341977['push'](_0x341977['shift']());}catch(_0x18165b){_0x341977['push'](_0x341977['shift']());}}}(a47_0x2745,0x5b83c));import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';function a47_0x7a48(_0x3d9e45,_0x154f0e){_0x3d9e45=_0x3d9e45-0x1f4;const _0x274548=a47_0x2745();let _0x7a48a7=_0x274548[_0x3d9e45];return _0x7a48a7;}export const pushCommand={'service':a47_0x3b7acf(0x1f5),'command':'push','description':a47_0x3b7acf(0x1fb),'risk':'write','confirmationDescription':a47_0x3b7acf(0x1fd),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
@@ -1 +1 @@
1
- const a48_0x925cb3=a48_0x2ab1;(function(_0x3f095d,_0x5371b7){const _0x1d75c7=a48_0x2ab1,_0xf0b433=_0x3f095d();while(!![]){try{const _0x89da7a=parseInt(_0x1d75c7(0x127))/0x1*(-parseInt(_0x1d75c7(0x12d))/0x2)+-parseInt(_0x1d75c7(0x11f))/0x3*(parseInt(_0x1d75c7(0x124))/0x4)+-parseInt(_0x1d75c7(0x11e))/0x5*(-parseInt(_0x1d75c7(0x11d))/0x6)+parseInt(_0x1d75c7(0x125))/0x7+parseInt(_0x1d75c7(0x12c))/0x8*(-parseInt(_0x1d75c7(0x123))/0x9)+parseInt(_0x1d75c7(0x122))/0xa+-parseInt(_0x1d75c7(0x128))/0xb;if(_0x89da7a===_0x5371b7)break;else _0xf0b433['push'](_0xf0b433['shift']());}catch(_0x16e3d9){_0xf0b433['push'](_0xf0b433['shift']());}}}(a48_0x311c,0x90bb1));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';function a48_0x2ab1(_0x1da981,_0x3ce630){_0x1da981=_0x1da981-0x11c;const _0x311c70=a48_0x311c();let _0x2ab123=_0x311c70[_0x1da981];return _0x2ab123;}function a48_0x311c(){const _0x5a3702=['132PdRNkm','errors','skill','validate','type','90nLYqRP','26205xuNaNg','4449vRUxAY','dir','read','10996020ZRNSPq','9vwxLRI','524qDkseq','7085533xrqcHm','warnings','4097tjGChR','2341031tkaOiY','strict','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','Skill\x20validation\x20passed.','7360984AmDWXU'];a48_0x311c=function(){return _0x5a3702;};return a48_0x311c();}import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':a48_0x925cb3(0x12f),'command':a48_0x925cb3(0x130),'description':a48_0x925cb3(0x12a),'risk':a48_0x925cb3(0x121),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x4355aa){const _0x19d771=a48_0x925cb3,_0x3b34bd=_0x4355aa['bool'](_0x19d771(0x129)),_0x722232=validateSkillDirectory(_0x4355aa['str'](_0x19d771(0x120)),{'strict':_0x3b34bd});return throwIfSkillValidationFailed(_0x722232,_0x3b34bd),{'ok':!![],'data':{'dir':_0x722232[_0x19d771(0x120)],'type':_0x722232[_0x19d771(0x11c)],'errors':_0x722232[_0x19d771(0x12e)],'warnings':_0x722232[_0x19d771(0x126)]},'message':_0x19d771(0x12b)};}};
1
+ const a48_0x2a46f1=a48_0x4c7e;(function(_0x42d9a9,_0x4e4aad){const _0x5b942e=a48_0x4c7e,_0x1d6895=_0x42d9a9();while(!![]){try{const _0x2b4650=parseInt(_0x5b942e(0x9c))/0x1+parseInt(_0x5b942e(0x9e))/0x2+-parseInt(_0x5b942e(0x9f))/0x3*(parseInt(_0x5b942e(0x8f))/0x4)+-parseInt(_0x5b942e(0x97))/0x5*(parseInt(_0x5b942e(0x98))/0x6)+parseInt(_0x5b942e(0x99))/0x7+parseInt(_0x5b942e(0x9d))/0x8+-parseInt(_0x5b942e(0x92))/0x9;if(_0x2b4650===_0x4e4aad)break;else _0x1d6895['push'](_0x1d6895['shift']());}catch(_0xed7dd7){_0x1d6895['push'](_0x1d6895['shift']());}}}(a48_0x314a,0x66058));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';function a48_0x4c7e(_0x191f99,_0xc655fc){_0x191f99=_0x191f99-0x8f;const _0x314a41=a48_0x314a();let _0x4c7eb2=_0x314a41[_0x191f99];return _0x4c7eb2;}function a48_0x314a(){const _0x4c892d=['5431881ueskKw','strict','type','687629dBtRzA','4639096ZneilB','233582GIgRgM','66GrNZfz','skill','bool','26716crbEbW','str','dir','8681535FTOjIq','read','validate','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','Skill\x20validation\x20passed.','5lTvLPi','3785142PFnYAm'];a48_0x314a=function(){return _0x4c892d;};return a48_0x314a();}import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':a48_0x2a46f1(0xa0),'command':a48_0x2a46f1(0x94),'description':a48_0x2a46f1(0x95),'risk':a48_0x2a46f1(0x93),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x4c03ba){const _0x480735=a48_0x2a46f1,_0x30cb12=_0x4c03ba[_0x480735(0xa1)](_0x480735(0x9a)),_0x400b65=validateSkillDirectory(_0x4c03ba[_0x480735(0x90)]('dir'),{'strict':_0x30cb12});return throwIfSkillValidationFailed(_0x400b65,_0x30cb12),{'ok':!![],'data':{'dir':_0x400b65[_0x480735(0x91)],'type':_0x400b65[_0x480735(0x9b)],'errors':_0x400b65['errors'],'warnings':_0x400b65['warnings']},'message':_0x480735(0x96)};}};
@@ -1,5 +1,11 @@
1
1
  import type { RuntimeSkillDiagramSubmission } from "../../core/api-client.js";
2
+ export interface RequiredSkillDiagramInput {
3
+ diagram: RuntimeSkillDiagramSubmission;
4
+ sourceFilePath?: string;
5
+ }
2
6
  /** Reads and validates the direct Mermaid payload required by Skill publication. */
3
7
  export declare function readRequiredSkillDiagram(path: string): Promise<RuntimeSkillDiagramSubmission>;
8
+ /** Reads a diagram plus its canonical file path for exact package-scan exclusion. */
9
+ export declare function readRequiredSkillDiagramInput(path: string): Promise<RequiredSkillDiagramInput>;
4
10
  /** Canonicalizes line endings and validates the source with Mermaid's official parser. */
5
11
  export declare function validateAndCanonicalizeMermaid(source: string): Promise<string>;
@@ -1 +1 @@
1
- (function(_0x56a597,_0x11fa67){const _0x333ec9=a49_0x3e41,_0x511f6f=_0x56a597();while(!![]){try{const _0xa26e75=-parseInt(_0x333ec9(0xd5))/0x1*(-parseInt(_0x333ec9(0xde))/0x2)+-parseInt(_0x333ec9(0xe3))/0x3+-parseInt(_0x333ec9(0xe6))/0x4*(parseInt(_0x333ec9(0xe4))/0x5)+-parseInt(_0x333ec9(0xd4))/0x6+parseInt(_0x333ec9(0xd6))/0x7+-parseInt(_0x333ec9(0xe7))/0x8*(-parseInt(_0x333ec9(0xdf))/0x9)+-parseInt(_0x333ec9(0xdc))/0xa*(parseInt(_0x333ec9(0xe2))/0xb);if(_0xa26e75===_0x11fa67)break;else _0x511f6f['push'](_0x511f6f['shift']());}catch(_0x3b95d4){_0x511f6f['push'](_0x511f6f['shift']());}}}(a49_0xfd74,0x5d59b));import{existsSync,readFileSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';function a49_0x3e41(_0x337433,_0x37c313){_0x337433=_0x337433-0xd0;const _0xfd7464=a49_0xfd74();let _0x3e4176=_0xfd7464[_0x337433];return _0x3e4176;}function a49_0xfd74(){const _0x21ca2c=['39080uoRgfY','--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.','6574ffMjkj','4689jGTxnY','window','defineProperties','3014JbBYNL','457542WlLiwt','10MJsQDL','replace','374704FitnVg','8576liaZkV','default','Mermaid\x20syntax\x20validation\x20failed.','document','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.','326814mUmEQz','205jyTwYc','4306001trRMMK','trim','validation','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','mermaid'];a49_0xfd74=function(){return _0x21ca2c;};return a49_0xfd74();}import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x40c054){const _0x36cf2f=a49_0x3e41,_0xd589d6=_0x40c054[_0x36cf2f(0xd7)]();if(!_0xd589d6)throw CliErrors[_0x36cf2f(0xd8)](_0x36cf2f(0xdd),_0x36cf2f(0xd9));let _0x309a31;if(_0xd589d6==='-')try{_0x309a31=readFileSync(0x0,'utf8');}catch{throw CliErrors[_0x36cf2f(0xd8)](_0x36cf2f(0xd2));}else{const _0x116335=resolve(_0xd589d6);if(!existsSync(_0x116335))throw CliErrors['validation'](_0x36cf2f(0xd1)+_0x116335);if(!statSync(_0x116335)['isFile']())throw CliErrors['validation'](_0x36cf2f(0xda)+_0x116335);_0x309a31=readFileSync(_0x116335,'utf8');}return{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x309a31)};}export async function validateAndCanonicalizeMermaid(_0xd34dc5){const _0x1d61b9=a49_0x3e41,_0x372d0d=_0xd34dc5[_0x1d61b9(0xe5)](/\r\n/g,'\x0a')[_0x1d61b9(0xe5)](/\r/g,'\x0a')[_0x1d61b9(0xe5)](/\n+$/,'')+'\x0a';try{const _0x3c76e0=await loadMermaidApi();await _0x3c76e0['parse'](_0x372d0d);}catch{throw diagramValidationError();}return _0x372d0d;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x53c429=a49_0x3e41;if(!(_0x53c429(0xe0)in globalThis)||!(_0x53c429(0xd0)in globalThis)){const _0x39b97d=new JSDOM('');Object[_0x53c429(0xe1)](globalThis,{'window':{'configurable':!![],'value':_0x39b97d[_0x53c429(0xe0)]},'document':{'configurable':!![],'value':_0x39b97d[_0x53c429(0xe0)][_0x53c429(0xd0)]}});}return(await import(_0x53c429(0xdb)))[_0x53c429(0xe8)];})()),mermaidApiPromise;}function diagramValidationError(){const _0x54e937=a49_0x3e41;return CliErrors[_0x54e937(0xd8)](_0x54e937(0xe9),_0x54e937(0xd3));}
1
+ (function(_0x305040,_0x2c32a9){const _0x301e53=a49_0x10b1,_0x31dcf8=_0x305040();while(!![]){try{const _0x39055a=parseInt(_0x301e53(0xd0))/0x1+-parseInt(_0x301e53(0xd3))/0x2+parseInt(_0x301e53(0xe0))/0x3*(parseInt(_0x301e53(0xd8))/0x4)+parseInt(_0x301e53(0xd6))/0x5*(parseInt(_0x301e53(0xe3))/0x6)+parseInt(_0x301e53(0xe2))/0x7*(parseInt(_0x301e53(0xe4))/0x8)+-parseInt(_0x301e53(0xd9))/0x9*(-parseInt(_0x301e53(0xe1))/0xa)+parseInt(_0x301e53(0xdc))/0xb*(-parseInt(_0x301e53(0xdb))/0xc);if(_0x39055a===_0x2c32a9)break;else _0x31dcf8['push'](_0x31dcf8['shift']());}catch(_0x11e24d){_0x31dcf8['push'](_0x31dcf8['shift']());}}}(a49_0x278e,0x67553));import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x4560bf){const _0x3adde5=a49_0x10b1;return(await readRequiredSkillDiagramInput(_0x4560bf))[_0x3adde5(0xe5)];}function a49_0x278e(){const _0x1e6f2d=['default','isFile','126QdbBIq','498790jicMov','7vMOEEN','229404yMgLxR','568680UapibN','diagram','validation','window','321713xWYprt','--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','476038IGepZi','Mermaid\x20syntax\x20validation\x20failed.','replace','100iPgrNk','defineProperties','13528QNrRyR','36fiYtQt','document','5026608asqoYn','22KHOaWS','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.'];a49_0x278e=function(){return _0x1e6f2d;};return a49_0x278e();}function a49_0x10b1(_0x208e82,_0x464933){_0x208e82=_0x208e82-0xce;const _0x278e9e=a49_0x278e();let _0x10b145=_0x278e9e[_0x208e82];return _0x10b145;}export async function readRequiredSkillDiagramInput(_0x2bec22){const _0x4b5b57=a49_0x10b1,_0x33cecd=_0x2bec22['trim']();if(!_0x33cecd)throw CliErrors['validation'](_0x4b5b57(0xd1),'Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.');let _0x1a3ca9,_0x4a9e0a;if(_0x33cecd==='-')try{_0x1a3ca9=readFileSync(0x0,'utf8');}catch{throw CliErrors[_0x4b5b57(0xce)](_0x4b5b57(0xdd));}else{const _0x5a149f=resolve(_0x33cecd);if(!existsSync(_0x5a149f))throw CliErrors['validation'](_0x4b5b57(0xd2)+_0x5a149f);if(!statSync(_0x5a149f)[_0x4b5b57(0xdf)]())throw CliErrors['validation']('Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x5a149f);_0x4a9e0a=realpathSync(_0x5a149f),_0x1a3ca9=readFileSync(_0x4a9e0a,'utf8');}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x1a3ca9)},'sourceFilePath':_0x4a9e0a};}export async function validateAndCanonicalizeMermaid(_0x5107ab){const _0x44a251=a49_0x10b1,_0x2a6ffd=_0x5107ab['replace'](/\r\n/g,'\x0a')[_0x44a251(0xd5)](/\r/g,'\x0a')[_0x44a251(0xd5)](/\n+$/,'')+'\x0a';try{const _0x3e79df=await loadMermaidApi();await _0x3e79df['parse'](_0x2a6ffd);}catch{throw diagramValidationError();}return _0x2a6ffd;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x176d95=a49_0x10b1;if(!(_0x176d95(0xcf)in globalThis)||!('document'in globalThis)){const _0x40c48f=new JSDOM('');Object[_0x176d95(0xd7)](globalThis,{'window':{'configurable':!![],'value':_0x40c48f[_0x176d95(0xcf)]},'document':{'configurable':!![],'value':_0x40c48f[_0x176d95(0xcf)][_0x176d95(0xda)]}});}return(await import('mermaid'))[_0x176d95(0xde)];})()),mermaidApiPromise;}function diagramValidationError(){const _0x13c845=a49_0x10b1;return CliErrors[_0x13c845(0xce)](_0x13c845(0xd4),'Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.');}