@lovrabet/lovrabet-cli 2.2.4-beta.1 → 2.2.4-beta.3

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 (162) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/shared.js +1 -1
  25. package/lib/commands/data/index.js +1 -1
  26. package/lib/commands/dataset/detail.js +1 -1
  27. package/lib/commands/dataset/index.js +1 -1
  28. package/lib/commands/dataset/list.js +1 -1
  29. package/lib/commands/dataset/sdk-doc.js +1 -1
  30. package/lib/commands/doctor.js +1 -1
  31. package/lib/commands/file/index.js +1 -1
  32. package/lib/commands/init.js +1 -1
  33. package/lib/commands/kb/index.js +1 -1
  34. package/lib/commands/logs/index.js +1 -1
  35. package/lib/commands/notification/config-list.js +1 -1
  36. package/lib/commands/notification/index.js +1 -1
  37. package/lib/commands/notification/shared.js +1 -1
  38. package/lib/commands/ocr/index.js +1 -1
  39. package/lib/commands/permit/dataset-get.js +1 -1
  40. package/lib/commands/permit/dataset-set.js +1 -1
  41. package/lib/commands/permit/index.js +1 -1
  42. package/lib/commands/permit/page-get.js +1 -1
  43. package/lib/commands/permit/page-set.js +1 -1
  44. package/lib/commands/permit/role-menus-set.js +1 -1
  45. package/lib/commands/permit/role-menus.js +1 -1
  46. package/lib/commands/permit/shared.js +1 -1
  47. package/lib/commands/personal-bff/index.js +1 -1
  48. package/lib/commands/registry.js +1 -1
  49. package/lib/commands/role/create.js +1 -1
  50. package/lib/commands/role/delete.js +1 -1
  51. package/lib/commands/role/detail.js +1 -1
  52. package/lib/commands/role/index.js +1 -1
  53. package/lib/commands/role/list.js +1 -1
  54. package/lib/commands/role/shared.js +1 -1
  55. package/lib/commands/role/update.js +1 -1
  56. package/lib/commands/role/user-add.js +1 -1
  57. package/lib/commands/role/user-remove.js +1 -1
  58. package/lib/commands/schedule/index.js +1 -1
  59. package/lib/commands/schema.js +1 -1
  60. package/lib/commands/service/dynamic.js +1 -1
  61. package/lib/commands/service/function-name-adapter.js +1 -1
  62. package/lib/commands/service/index.js +1 -1
  63. package/lib/commands/service/registry.js +1 -1
  64. package/lib/commands/skill/commands/create.js +1 -1
  65. package/lib/commands/skill/commands/diagram.js +1 -1
  66. package/lib/commands/skill/commands/install.js +1 -1
  67. package/lib/commands/skill/commands/list.js +1 -1
  68. package/lib/commands/skill/commands/push.js +1 -1
  69. package/lib/commands/skill/commands/validate.js +1 -1
  70. package/lib/commands/skill/diagram.js +1 -1
  71. package/lib/commands/skill/flags.js +1 -1
  72. package/lib/commands/skill/index.js +1 -1
  73. package/lib/commands/skill/manifest-helpers.js +1 -1
  74. package/lib/commands/skill/push-execute.js +1 -1
  75. package/lib/commands/skill/push-flow-helpers.js +1 -1
  76. package/lib/commands/skill/push-retarget.js +1 -1
  77. package/lib/commands/skill/scopes.js +1 -1
  78. package/lib/commands/skill/summary.js +1 -1
  79. package/lib/commands/skill/templates.js +1 -1
  80. package/lib/commands/skill/validate.js +1 -1
  81. package/lib/commands/sql/detail.js +1 -1
  82. package/lib/commands/sql/exec.js +1 -1
  83. package/lib/commands/sql/index.js +1 -1
  84. package/lib/commands/update.d.ts +19 -0
  85. package/lib/commands/update.js +1 -1
  86. package/lib/commands/user-account/bind.js +1 -1
  87. package/lib/commands/user-account/index.js +1 -1
  88. package/lib/commands/workspace/index.js +1 -1
  89. package/lib/config/schema.js +1 -1
  90. package/lib/constant/app.js +1 -1
  91. package/lib/constant/auth-mode.js +1 -1
  92. package/lib/constant/cli.js +1 -1
  93. package/lib/constant/defaults.js +1 -1
  94. package/lib/constant/distribution.js +1 -1
  95. package/lib/constant/domain.js +1 -1
  96. package/lib/constant/env.js +1 -1
  97. package/lib/constant/output.js +1 -1
  98. package/lib/constant/product.js +1 -1
  99. package/lib/constant/risk.js +1 -1
  100. package/lib/constant/url.js +1 -1
  101. package/lib/context.js +1 -1
  102. package/lib/core/api-client.js +1 -1
  103. package/lib/core/db-resolver.js +1 -1
  104. package/lib/core/sdk-client.js +1 -1
  105. package/lib/errors.js +1 -1
  106. package/lib/framework/build-all-flags.js +1 -1
  107. package/lib/framework/dryrun.js +1 -1
  108. package/lib/framework/flags.js +1 -1
  109. package/lib/framework/help.js +1 -1
  110. package/lib/framework/index.js +1 -1
  111. package/lib/framework/output.js +1 -1
  112. package/lib/framework/preparse.js +1 -1
  113. package/lib/framework/rate-limit.js +1 -1
  114. package/lib/framework/raw-flags.js +1 -1
  115. package/lib/framework/response.js +1 -1
  116. package/lib/framework/runner-confirmation.js +1 -1
  117. package/lib/framework/runner-error.js +1 -1
  118. package/lib/framework/runner.js +1 -1
  119. package/lib/framework/schema-export.js +1 -1
  120. package/lib/framework/service-order.js +1 -1
  121. package/lib/framework/types.js +1 -1
  122. package/lib/generated/build-info.d.ts +4 -4
  123. package/lib/generated/build-info.js +1 -1
  124. package/lib/help.js +1 -1
  125. package/lib/postinstall.js +1 -1
  126. package/lib/runtime/confirmation.js +1 -1
  127. package/lib/runtime/event.js +1 -1
  128. package/lib/runtime/index.js +1 -1
  129. package/lib/runtime/queue.js +1 -1
  130. package/lib/runtime/resolve.js +1 -1
  131. package/lib/skills/builtin-skill.js +1 -1
  132. package/lib/skills/npx-skills-add.js +1 -1
  133. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  134. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  135. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  136. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  137. package/lib/skills/runtime-skill-sync/links.js +1 -1
  138. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  139. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  140. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  141. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  142. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  143. package/lib/skills/runtime-skill-sync/push.js +1 -1
  144. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  145. package/lib/skills/runtime-skill-sync/types.d.ts +1 -0
  146. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  147. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  148. package/lib/skills/runtime-skill-sync.js +1 -1
  149. package/lib/skills/skill-presence.js +1 -1
  150. package/lib/utils/apply-jq-filter.js +1 -1
  151. package/lib/utils/logger.js +1 -1
  152. package/lib/utils/lossless-json.js +1 -1
  153. package/lib/utils/params.js +1 -1
  154. package/lib/utils/platform.js +1 -1
  155. package/lib/utils/update-notice.js +1 -1
  156. package/lib/utils/version.js +1 -1
  157. package/lib/utils/write-cli-side-channel.js +1 -1
  158. package/package.json +1 -1
  159. package/skills/lovrabet/SKILL.md +5 -5
  160. package/skills/lovrabet/references/lovrabet-ocr-workflow.md +17 -2
  161. package/skills/lovrabet/references/lovrabet-skill-authoring.md +5 -4
  162. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- const a57_0x5a117c=a57_0x47ab;(function(_0x476a31,_0x1d27de){const _0x36ac37=a57_0x47ab,_0x31a688=_0x476a31();while(!![]){try{const _0x5a99ee=parseInt(_0x36ac37(0x1e3))/0x1+-parseInt(_0x36ac37(0x1e2))/0x2+-parseInt(_0x36ac37(0x1bd))/0x3*(-parseInt(_0x36ac37(0x1cc))/0x4)+parseInt(_0x36ac37(0x1e5))/0x5+-parseInt(_0x36ac37(0x1ad))/0x6+-parseInt(_0x36ac37(0x1ef))/0x7*(-parseInt(_0x36ac37(0x1ea))/0x8)+parseInt(_0x36ac37(0x1d9))/0x9*(parseInt(_0x36ac37(0x1b8))/0xa);if(_0x5a99ee===_0x1d27de)break;else _0x31a688['push'](_0x31a688['shift']());}catch(_0x5cdce2){_0x31a688['push'](_0x31a688['shift']());}}}(a57_0xa78e,0x6496e));function a57_0x47ab(_0x39b948,_0x3cb060){_0x39b948=_0x39b948-0x1a7;const _0xa78ed6=a57_0xa78e();let _0x47abb8=_0xa78ed6[_0x39b948];return _0x47abb8;}import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':a57_0x5a117c(0x1c6),'type':a57_0x5a117c(0x1c3),'required':!![],'enum':[a57_0x5a117c(0x1c9),a57_0x5a117c(0x1ba)],'description':a57_0x5a117c(0x1af)},CRON_FLAG={'name':a57_0x5a117c(0x1d6),'type':'string','description':a57_0x5a117c(0x1a8)},SCHEDULED_AT_FLAG={'name':a57_0x5a117c(0x1ce),'type':a57_0x5a117c(0x1c3),'description':a57_0x5a117c(0x1d7)},TITLE_FLAG={'name':a57_0x5a117c(0x1dc),'type':a57_0x5a117c(0x1c3),'required':!![],'description':a57_0x5a117c(0x1db)},PROMPT_FLAG={'name':a57_0x5a117c(0x1b7),'type':a57_0x5a117c(0x1c3),'required':!![],'description':'Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs'},CHANNEL_FLAG={'name':a57_0x5a117c(0x1b5),'type':a57_0x5a117c(0x1c3),'enum':[a57_0x5a117c(0x1c0),a57_0x5a117c(0x1bb)],'default':a57_0x5a117c(0x1bb),'description':a57_0x5a117c(0x1cd)},SCHEDULE_ID_FLAG={'name':a57_0x5a117c(0x1cf),'type':a57_0x5a117c(0x1c3),'required':!![],'description':a57_0x5a117c(0x1c4),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a57_0x5a117c(0x1df)}},LIMIT_FLAG={'name':a57_0x5a117c(0x1dd),'type':a57_0x5a117c(0x1e7),'default':0x14,'description':'Page\x20size\x20from\x201\x20to\x20100'},CURSOR_FLAG={'name':a57_0x5a117c(0x1d1),'type':a57_0x5a117c(0x1c3),'description':a57_0x5a117c(0x1da)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x34f2b5){const _0x45004e=a57_0x5a117c,_0x5f5d52=_0x34f2b5[_0x45004e(0x1bc)]('kind'),_0x4be68a=_0x34f2b5['str'](_0x45004e(0x1dc))[_0x45004e(0x1b4)](),_0xd40ab2=_0x34f2b5[_0x45004e(0x1bc)](_0x45004e(0x1b7))['trim'](),_0x325e7a=_0x34f2b5['str'](_0x45004e(0x1b5)),_0x3ea79a=_0x34f2b5[_0x45004e(0x1bc)]('cron'),_0x2a3924=_0x34f2b5[_0x45004e(0x1bc)](_0x45004e(0x1ce));if(!_0x4be68a)throw CliErrors[_0x45004e(0x1d3)]('--title\x20must\x20not\x20be\x20blank.');if(!_0xd40ab2)throw CliErrors[_0x45004e(0x1d3)]('--prompt\x20must\x20not\x20be\x20blank.');if(_0x5f5d52==='CRON'){if(!_0x3ea79a||_0x2a3924)throw CliErrors[_0x45004e(0x1d3)](_0x45004e(0x1c1));return{'kind':_0x5f5d52,'timezone':'UTC','cron':_0x3ea79a,'title':_0x4be68a,'prompt':_0xd40ab2,'channel':_0x325e7a};}if(_0x5f5d52===_0x45004e(0x1ba)){if(!_0x2a3924||_0x3ea79a)throw CliErrors[_0x45004e(0x1d3)](_0x45004e(0x1b2));return{'kind':_0x5f5d52,'timezone':_0x45004e(0x1d2),'scheduledAt':_0x2a3924,'title':_0x4be68a,'prompt':_0xd40ab2,'channel':_0x325e7a};}throw CliErrors['validation'](_0x45004e(0x1ab));}function scheduleCollectionPath(_0x33de5e){const _0x69feea=a57_0x5a117c;return'/api/harness/apps/'+encodeURIComponent(_0x33de5e)+_0x69feea(0x1ed);}function a57_0xa78e(){const _0x3bdfb4=['POST','body','427192ZPRkNn','Task\x20channel:\x20auto\x20or\x20premium','scheduled-at','schedule-id','Created\x20','cursor','UTC','validation','read','validate','cron','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','description','3474gVUdwF','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','Schedule\x20title','title','limit','创建周期性或单次执行的\x20Agent\x20定时任务','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','Preview:\x20delete\x20schedule\x20','run','1152594vgLfZq','10879OhBQoy','scheduleId','1848585pWjUuH','detail','number','Preview:\x20create\x20an\x20Agent\x20schedule','delete','1336SUcrMc','isSafeInteger','schedule','/schedules','立即运行一次定时任务并创建\x20Task','21476yXEXnL','Deleted\x20schedule\x20','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','/run','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','build','4288554YqeTMp','Schedule\x20input\x20is\x20valid','Schedule\x20kind:\x20CRON\x20or\x20ONCE','create','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','trim','channel','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','prompt','1620oFJWFZ','list','ONCE','premium','str','21iVwtGd','length','num','auto','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','\x20schedule\x20','string','Schedule\x20UUID','appCode','kind','Queued\x20Task\x20','high-risk-write','CRON'];a57_0xa78e=function(){return _0x3bdfb4;};return a57_0xa78e();}function scheduleItemPath(_0x41d88b,_0x341961){return scheduleCollectionPath(_0x41d88b)+'/'+encodeURIComponent(_0x341961);}const scheduleValidate={'service':'schedule','command':a57_0x5a117c(0x1d5),'description':a57_0x5a117c(0x1b3),'risk':a57_0x5a117c(0x1d4),'flags':INPUT_FLAGS,async 'validate'(_0x225966){readScheduleInput(_0x225966);},async 'execute'(_0x7c6870){const _0x1c8e99=a57_0x5a117c,_0x2aaf3d=readScheduleInput(_0x7c6870),_0x5994ee=await validateRuntimeSchedule(_0x7c6870[_0x1c8e99(0x1c5)],_0x2aaf3d);return{'ok':!![],'data':_0x5994ee,'message':_0x1c8e99(0x1ae)};}},scheduleCreate={'service':a57_0x5a117c(0x1ec),'command':a57_0x5a117c(0x1b0),'description':a57_0x5a117c(0x1de),'risk':'high-risk-write','confirmationDescription':'将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','flags':INPUT_FLAGS,async 'validate'(_0x2df432){readScheduleInput(_0x2df432);},async 'execute'(_0x459907){const _0x4473d2=a57_0x5a117c,_0xccd1b3=readScheduleInput(_0x459907),_0x24540c=await validateRuntimeSchedule(_0x459907[_0x4473d2(0x1c5)],_0xccd1b3),_0x55d81f=await createRuntimeSchedule(_0x459907['appCode'],_0x24540c);return{'ok':!![],'data':_0x55d81f,'message':_0x4473d2(0x1d0)+_0x55d81f[_0x4473d2(0x1c6)]+_0x4473d2(0x1c2)+_0x55d81f[_0x4473d2(0x1e4)]};},async 'dryRun'(_0xfa9404){const _0x180d47=a57_0x5a117c,_0x2969bb=readScheduleInput(_0xfa9404);return dryRun('POST',scheduleCollectionPath(_0xfa9404[_0x180d47(0x1c5)]))[_0x180d47(0x1cb)](_0x2969bb)[_0x180d47(0x1d8)](_0x180d47(0x1e8))[_0x180d47(0x1ac)]();}},scheduleList={'service':'schedule','command':a57_0x5a117c(0x1b9),'description':a57_0x5a117c(0x1a9),'risk':'read','flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x114e54){const _0x269ec5=a57_0x5a117c,_0x4b76f4=_0x114e54[_0x269ec5(0x1bf)]('limit');if(!Number[_0x269ec5(0x1eb)](_0x4b76f4)||_0x4b76f4<0x1||_0x4b76f4>0x64)throw CliErrors[_0x269ec5(0x1d3)](_0x269ec5(0x1b1));const _0x3c3bf5=_0x114e54[_0x269ec5(0x1bc)](_0x269ec5(0x1d1));if(_0x3c3bf5&&(_0x3c3bf5[_0x269ec5(0x1be)]>0x400||_0x3c3bf5[_0x269ec5(0x1b4)]()!==_0x3c3bf5))throw CliErrors[_0x269ec5(0x1d3)](_0x269ec5(0x1b6));},async 'execute'(_0x7522a7){const _0x202d8c=a57_0x5a117c,_0x133709=_0x7522a7[_0x202d8c(0x1bc)](_0x202d8c(0x1d1)),_0x5f3ec5=await listRuntimeSchedules(_0x7522a7['appCode'],{'kind':_0x7522a7[_0x202d8c(0x1bc)](_0x202d8c(0x1c6)),'limit':_0x7522a7[_0x202d8c(0x1bf)](_0x202d8c(0x1dd)),..._0x133709?{'cursor':_0x133709}:{}});return{'ok':!![],'data':_0x5f3ec5};}},scheduleDetail={'service':a57_0x5a117c(0x1ec),'command':a57_0x5a117c(0x1e6),'description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x1b6ccb){const _0xc54890=a57_0x5a117c,_0x104c32=await getRuntimeSchedule(_0x1b6ccb[_0xc54890(0x1c5)],_0x1b6ccb[_0xc54890(0x1bc)](_0xc54890(0x1cf)));return{'ok':!![],'data':_0x104c32};}},scheduleRun={'service':a57_0x5a117c(0x1ec),'command':a57_0x5a117c(0x1e1),'description':a57_0x5a117c(0x1ee),'risk':a57_0x5a117c(0x1c8),'confirmationDescription':'将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x120553){const _0x58eb2d=a57_0x5a117c,_0x44c1e2=_0x120553[_0x58eb2d(0x1bc)]('schedule-id'),_0x40f88b=await runRuntimeSchedule(_0x120553[_0x58eb2d(0x1c5)],_0x44c1e2);return{'ok':!![],'data':_0x40f88b,'message':_0x58eb2d(0x1c7)+_0x40f88b['taskId']+'\x20from\x20schedule\x20'+_0x44c1e2};},async 'dryRun'(_0x1b53a4){const _0x38b8dc=a57_0x5a117c,_0x3a50ab=_0x1b53a4[_0x38b8dc(0x1bc)](_0x38b8dc(0x1cf));return dryRun(_0x38b8dc(0x1ca),scheduleItemPath(_0x1b53a4[_0x38b8dc(0x1c5)],_0x3a50ab)+_0x38b8dc(0x1aa))[_0x38b8dc(0x1d8)]('Preview:\x20run\x20schedule\x20'+_0x3a50ab+'\x20immediately')[_0x38b8dc(0x1ac)]();}},scheduleDelete={'service':a57_0x5a117c(0x1ec),'command':a57_0x5a117c(0x1e9),'description':'删除定时任务并停止其后续触发','risk':'high-risk-write','confirmationDescription':'将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x4551e1){const _0x2bd1e2=a57_0x5a117c,_0x33ffa5=_0x4551e1[_0x2bd1e2(0x1bc)](_0x2bd1e2(0x1cf)),_0x939d89=await deleteRuntimeSchedule(_0x4551e1[_0x2bd1e2(0x1c5)],_0x33ffa5);return{'ok':!![],'data':_0x939d89,'message':_0x2bd1e2(0x1a7)+_0x33ffa5};},async 'dryRun'(_0x3ec084){const _0x451e82=a57_0x5a117c,_0x21af27=_0x3ec084['str'](_0x451e82(0x1cf));return dryRun('DELETE',scheduleItemPath(_0x3ec084['appCode'],_0x21af27))[_0x451e82(0x1d8)](_0x451e82(0x1e0)+_0x21af27)[_0x451e82(0x1ac)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
1
+ const a57_0x1fded2=a57_0x5799;(function(_0x36bb3e,_0x25cd03){const _0x4f3e96=a57_0x5799,_0x5efad1=_0x36bb3e();while(!![]){try{const _0x1917c8=-parseInt(_0x4f3e96(0x1d7))/0x1+parseInt(_0x4f3e96(0x1fb))/0x2*(-parseInt(_0x4f3e96(0x1f2))/0x3)+-parseInt(_0x4f3e96(0x1e6))/0x4*(-parseInt(_0x4f3e96(0x1cd))/0x5)+-parseInt(_0x4f3e96(0x1f4))/0x6+-parseInt(_0x4f3e96(0x1f9))/0x7*(parseInt(_0x4f3e96(0x1dd))/0x8)+parseInt(_0x4f3e96(0x1e0))/0x9+-parseInt(_0x4f3e96(0x1e5))/0xa;if(_0x1917c8===_0x25cd03)break;else _0x5efad1['push'](_0x5efad1['shift']());}catch(_0x698dae){_0x5efad1['push'](_0x5efad1['shift']());}}}(a57_0x3046,0xa1ab2));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':'kind','type':a57_0x1fded2(0x201),'required':!![],'enum':[a57_0x1fded2(0x1f1),a57_0x1fded2(0x1c9)],'description':a57_0x1fded2(0x1d4)},CRON_FLAG={'name':a57_0x1fded2(0x1ca),'type':a57_0x1fded2(0x201),'description':a57_0x1fded2(0x1d6)},SCHEDULED_AT_FLAG={'name':a57_0x1fded2(0x1d8),'type':a57_0x1fded2(0x201),'description':'Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules'},TITLE_FLAG={'name':a57_0x1fded2(0x1f5),'type':a57_0x1fded2(0x201),'required':!![],'description':a57_0x1fded2(0x1d1)},PROMPT_FLAG={'name':a57_0x1fded2(0x1df),'type':a57_0x1fded2(0x201),'required':!![],'description':a57_0x1fded2(0x1e3)},CHANNEL_FLAG={'name':a57_0x1fded2(0x1fe),'type':a57_0x1fded2(0x201),'enum':['auto',a57_0x1fded2(0x1e2)],'default':a57_0x1fded2(0x1e2),'description':a57_0x1fded2(0x1e8)},SCHEDULE_ID_FLAG={'name':a57_0x1fded2(0x1de),'type':a57_0x1fded2(0x201),'required':!![],'description':'Schedule\x20UUID','pattern':{'regex':SCHEDULE_ID_PATTERN,'description':'a\x20UUID\x20returned\x20by\x20schedule\x20create/list'}},LIMIT_FLAG={'name':'limit','type':a57_0x1fded2(0x1f7),'default':0x14,'description':a57_0x1fded2(0x1bf)},CURSOR_FLAG={'name':a57_0x1fded2(0x1e1),'type':'string','description':'Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call'},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0xb78f59){const _0x4e08ca=a57_0x1fded2,_0x403f4d=_0xb78f59[_0x4e08ca(0x1c1)](_0x4e08ca(0x1d3)),_0x1c077=_0xb78f59[_0x4e08ca(0x1c1)](_0x4e08ca(0x1f5))[_0x4e08ca(0x1fa)](),_0x476afa=_0xb78f59['str'](_0x4e08ca(0x1df))[_0x4e08ca(0x1fa)](),_0x372290=_0xb78f59[_0x4e08ca(0x1c1)]('channel'),_0x8dcb6e=_0xb78f59['str']('cron'),_0x2dbd0b=_0xb78f59['str'](_0x4e08ca(0x1d8));if(!_0x1c077)throw CliErrors['validation'](_0x4e08ca(0x1d0));if(!_0x476afa)throw CliErrors[_0x4e08ca(0x203)]('--prompt\x20must\x20not\x20be\x20blank.');if(_0x403f4d==='CRON'){if(!_0x8dcb6e||_0x2dbd0b)throw CliErrors[_0x4e08ca(0x203)]('CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.');return{'kind':_0x403f4d,'timezone':_0x4e08ca(0x1da),'cron':_0x8dcb6e,'title':_0x1c077,'prompt':_0x476afa,'channel':_0x372290};}if(_0x403f4d===_0x4e08ca(0x1c9)){if(!_0x2dbd0b||_0x8dcb6e)throw CliErrors[_0x4e08ca(0x203)]('ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.');return{'kind':_0x403f4d,'timezone':_0x4e08ca(0x1da),'scheduledAt':_0x2dbd0b,'title':_0x1c077,'prompt':_0x476afa,'channel':_0x372290};}throw CliErrors[_0x4e08ca(0x203)](_0x4e08ca(0x1d2));}function a57_0x5799(_0x27c806,_0x3e3ac5){_0x27c806=_0x27c806-0x1bd;const _0x3046c7=a57_0x3046();let _0x5799b3=_0x3046c7[_0x27c806];return _0x5799b3;}function scheduleCollectionPath(_0x2e180d){const _0x1a1002=a57_0x1fded2;return _0x1a1002(0x1eb)+encodeURIComponent(_0x2e180d)+_0x1a1002(0x1ea);}function scheduleItemPath(_0x25032a,_0x315adc){return scheduleCollectionPath(_0x25032a)+'/'+encodeURIComponent(_0x315adc);}const scheduleValidate={'service':a57_0x1fded2(0x1ee),'command':a57_0x1fded2(0x1d5),'description':a57_0x1fded2(0x1e7),'risk':a57_0x1fded2(0x1c4),'flags':INPUT_FLAGS,async 'validate'(_0x494a39){readScheduleInput(_0x494a39);},async 'execute'(_0x249f69){const _0x5d0e2b=a57_0x1fded2,_0x29d378=readScheduleInput(_0x249f69),_0x355eb9=await validateRuntimeSchedule(_0x249f69[_0x5d0e2b(0x1c5)],_0x29d378);return{'ok':!![],'data':_0x355eb9,'message':'Schedule\x20input\x20is\x20valid'};}},scheduleCreate={'service':a57_0x1fded2(0x1ee),'command':a57_0x1fded2(0x1fc),'description':a57_0x1fded2(0x1f3),'risk':a57_0x1fded2(0x1ce),'confirmationDescription':a57_0x1fded2(0x1e9),'flags':INPUT_FLAGS,async 'validate'(_0x4bdba4){readScheduleInput(_0x4bdba4);},async 'execute'(_0x8c6960){const _0x2b4392=a57_0x1fded2,_0x527190=readScheduleInput(_0x8c6960),_0x27de15=await validateRuntimeSchedule(_0x8c6960[_0x2b4392(0x1c5)],_0x527190),_0x58d014=await createRuntimeSchedule(_0x8c6960[_0x2b4392(0x1c5)],_0x27de15);return{'ok':!![],'data':_0x58d014,'message':'Created\x20'+_0x58d014[_0x2b4392(0x1d3)]+_0x2b4392(0x1f8)+_0x58d014['scheduleId']};},async 'dryRun'(_0x10d51a){const _0x435946=a57_0x1fded2,_0x509f65=readScheduleInput(_0x10d51a);return dryRun(_0x435946(0x1ec),scheduleCollectionPath(_0x10d51a[_0x435946(0x1c5)]))[_0x435946(0x1c3)](_0x509f65)[_0x435946(0x1bd)](_0x435946(0x202))[_0x435946(0x1be)]();}},scheduleList={'service':a57_0x1fded2(0x1ee),'command':'list','description':a57_0x1fded2(0x1e4),'risk':'read','flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x18170e){const _0x5a3881=a57_0x1fded2,_0x2d739c=_0x18170e[_0x5a3881(0x1dc)](_0x5a3881(0x200));if(!Number[_0x5a3881(0x1ff)](_0x2d739c)||_0x2d739c<0x1||_0x2d739c>0x64)throw CliErrors[_0x5a3881(0x203)](_0x5a3881(0x1c2));const _0x261f7c=_0x18170e[_0x5a3881(0x1c1)](_0x5a3881(0x1e1));if(_0x261f7c&&(_0x261f7c['length']>0x400||_0x261f7c[_0x5a3881(0x1fa)]()!==_0x261f7c))throw CliErrors[_0x5a3881(0x203)](_0x5a3881(0x1ef));},async 'execute'(_0x19d719){const _0x38dab0=a57_0x1fded2,_0x4d1c10=_0x19d719[_0x38dab0(0x1c1)](_0x38dab0(0x1e1)),_0x2467ba=await listRuntimeSchedules(_0x19d719[_0x38dab0(0x1c5)],{'kind':_0x19d719[_0x38dab0(0x1c1)](_0x38dab0(0x1d3)),'limit':_0x19d719[_0x38dab0(0x1dc)](_0x38dab0(0x200)),..._0x4d1c10?{'cursor':_0x4d1c10}:{}});return{'ok':!![],'data':_0x2467ba};}},scheduleDetail={'service':a57_0x1fded2(0x1ee),'command':'detail','description':a57_0x1fded2(0x1d9),'risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x51a343){const _0x3c2800=a57_0x1fded2,_0x4d1e71=await getRuntimeSchedule(_0x51a343['appCode'],_0x51a343[_0x3c2800(0x1c1)](_0x3c2800(0x1de)));return{'ok':!![],'data':_0x4d1e71};}},scheduleRun={'service':a57_0x1fded2(0x1ee),'command':'run','description':a57_0x1fded2(0x1f0),'risk':'high-risk-write','confirmationDescription':a57_0x1fded2(0x1fd),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x519583){const _0x8dc8f0=a57_0x1fded2,_0x5a38bd=_0x519583[_0x8dc8f0(0x1c1)](_0x8dc8f0(0x1de)),_0x4fa5aa=await runRuntimeSchedule(_0x519583[_0x8dc8f0(0x1c5)],_0x5a38bd);return{'ok':!![],'data':_0x4fa5aa,'message':_0x8dc8f0(0x1cc)+_0x4fa5aa['taskId']+_0x8dc8f0(0x1cb)+_0x5a38bd};},async 'dryRun'(_0xf7e3f2){const _0x369a6d=a57_0x1fded2,_0x4e80ba=_0xf7e3f2['str'](_0x369a6d(0x1de));return dryRun('POST',scheduleItemPath(_0xf7e3f2['appCode'],_0x4e80ba)+'/run')[_0x369a6d(0x1bd)](_0x369a6d(0x1cf)+_0x4e80ba+_0x369a6d(0x1f6))[_0x369a6d(0x1be)]();}},scheduleDelete={'service':'schedule','command':a57_0x1fded2(0x1c6),'description':a57_0x1fded2(0x1db),'risk':a57_0x1fded2(0x1ce),'confirmationDescription':a57_0x1fded2(0x1ed),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x348a7b){const _0x46f450=a57_0x1fded2,_0x332f5c=_0x348a7b[_0x46f450(0x1c1)](_0x46f450(0x1de)),_0x2b1cae=await deleteRuntimeSchedule(_0x348a7b[_0x46f450(0x1c5)],_0x332f5c);return{'ok':!![],'data':_0x2b1cae,'message':_0x46f450(0x1c8)+_0x332f5c};},async 'dryRun'(_0x4b1bb9){const _0x46763d=a57_0x1fded2,_0x2f8481=_0x4b1bb9[_0x46763d(0x1c1)](_0x46763d(0x1de));return dryRun(_0x46763d(0x1c0),scheduleItemPath(_0x4b1bb9['appCode'],_0x2f8481))[_0x46763d(0x1bd)](_0x46763d(0x1c7)+_0x2f8481)[_0x46763d(0x1be)]();}};function a57_0x3046(){const _0x4d222f=['31886ToeNnU','create','将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','channel','isSafeInteger','limit','string','Preview:\x20create\x20an\x20Agent\x20schedule','validation','description','build','Page\x20size\x20from\x201\x20to\x20100','DELETE','str','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','body','read','appCode','delete','Preview:\x20delete\x20schedule\x20','Deleted\x20schedule\x20','ONCE','cron','\x20from\x20schedule\x20','Queued\x20Task\x20','7430tmwSVz','high-risk-write','Preview:\x20run\x20schedule\x20','--title\x20must\x20not\x20be\x20blank.','Schedule\x20title','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','kind','Schedule\x20kind:\x20CRON\x20or\x20ONCE','validate','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','142329iAQTqG','scheduled-at','Show\x20one\x20schedule\x20by\x20schedule\x20ID','UTC','删除定时任务并停止其后续触发','num','2071912QtUuQn','schedule-id','prompt','3210705RvwaYl','cursor','premium','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','911900DcidZt','3188AjkvGl','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','Task\x20channel:\x20auto\x20or\x20premium','将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','/schedules','/api/harness/apps/','POST','将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','schedule','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','立即运行一次定时任务并创建\x20Task','CRON','15SYcbBt','创建周期性或单次执行的\x20Agent\x20定时任务','1840020XajZSk','title','\x20immediately','number','\x20schedule\x20','7vcOOmz','trim'];a57_0x3046=function(){return _0x4d222f;};return a57_0x3046();}export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
@@ -1 +1 @@
1
- const a58_0x373c5c=a58_0x2cfa;function a58_0x393b(){const _0x13a4c4=['read','schema','77605fLZyNR','248NpzHNg','2087991ZXyRMS','4248839OOmxuN','4891176XeSCmx','1LVHLSw','5880876rtckHm','2001549IBzcPA','466292epHlsB'];a58_0x393b=function(){return _0x13a4c4;};return a58_0x393b();}(function(_0x29fabc,_0x330296){const _0x55f653=a58_0x2cfa,_0x534cbe=_0x29fabc();while(!![]){try{const _0x4ccc61=-parseInt(_0x55f653(0x16e))/0x1*(parseInt(_0x55f653(0x171))/0x2)+parseInt(_0x55f653(0x170))/0x3+-parseInt(_0x55f653(0x175))/0x4*(parseInt(_0x55f653(0x174))/0x5)+parseInt(_0x55f653(0x16f))/0x6+parseInt(_0x55f653(0x16c))/0x7+-parseInt(_0x55f653(0x16d))/0x8+parseInt(_0x55f653(0x176))/0x9;if(_0x4ccc61===_0x330296)break;else _0x534cbe['push'](_0x534cbe['shift']());}catch(_0x1ba0ca){_0x534cbe['push'](_0x534cbe['shift']());}}}(a58_0x393b,0xa5e24));function a58_0x2cfa(_0x4d50f0,_0x86f699){_0x4d50f0=_0x4d50f0-0x16c;const _0x393b39=a58_0x393b();let _0x2cfacc=_0x393b39[_0x4d50f0];return _0x2cfacc;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x36cfd5){const _0x1270a6=await buildSchemaPayload();return{'ok':!![],'data':_0x1270a6};}export const schemaDefinition={'service':a58_0x373c5c(0x173),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a58_0x373c5c(0x172),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
1
+ const a58_0x390437=a58_0x5513;(function(_0x45f143,_0xe1992b){const _0x9815c0=a58_0x5513,_0x8c7bc=_0x45f143();while(!![]){try{const _0x6c82fd=-parseInt(_0x9815c0(0x190))/0x1*(-parseInt(_0x9815c0(0x186))/0x2)+-parseInt(_0x9815c0(0x187))/0x3*(-parseInt(_0x9815c0(0x18e))/0x4)+-parseInt(_0x9815c0(0x18f))/0x5*(-parseInt(_0x9815c0(0x189))/0x6)+-parseInt(_0x9815c0(0x18b))/0x7*(-parseInt(_0x9815c0(0x18d))/0x8)+-parseInt(_0x9815c0(0x191))/0x9+-parseInt(_0x9815c0(0x18c))/0xa+-parseInt(_0x9815c0(0x185))/0xb*(parseInt(_0x9815c0(0x18a))/0xc);if(_0x6c82fd===_0xe1992b)break;else _0x8c7bc['push'](_0x8c7bc['shift']());}catch(_0x20eae1){_0x8c7bc['push'](_0x8c7bc['shift']());}}}(a58_0x5312,0x89280));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x37c808){const _0x2571df=await buildSchemaPayload();return{'ok':!![],'data':_0x2571df};}function a58_0x5513(_0x2c5481,_0x36e648){_0x2c5481=_0x2c5481-0x185;const _0x531231=a58_0x5312();let _0x551309=_0x531231[_0x2c5481];return _0x551309;}function a58_0x5312(){const _0x467206=['6291972cjhWOP','Export\x20machine-readable\x20command\x20schema\x20(JSON)','read','schema','55pOiWCu','42Ftwbfj','9aumaad','export','3850698XmFguo','3099048LEyubG','105AdujIr','8271400Akoovz','475680EzBCjX','1386812ztKplE','5aJWIbU','38358lAnObH'];a58_0x5312=function(){return _0x467206;};return a58_0x5312();}export const schemaDefinition={'service':a58_0x390437(0x194),'command':a58_0x390437(0x188),'description':a58_0x390437(0x192),'risk':a58_0x390437(0x193),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- (function(_0x52e61f,_0x3304c0){const _0x296458=a59_0x21f5,_0xf6c0dc=_0x52e61f();while(!![]){try{const _0x182f9d=parseInt(_0x296458(0xf2))/0x1+-parseInt(_0x296458(0x128))/0x2+-parseInt(_0x296458(0x118))/0x3+-parseInt(_0x296458(0xf1))/0x4+parseInt(_0x296458(0x12c))/0x5+-parseInt(_0x296458(0xdc))/0x6+parseInt(_0x296458(0xe2))/0x7*(parseInt(_0x296458(0x103))/0x8);if(_0x182f9d===_0x3304c0)break;else _0xf6c0dc['push'](_0xf6c0dc['shift']());}catch(_0x4ef77f){_0xf6c0dc['push'](_0xf6c0dc['shift']());}}}(a59_0xcf23,0xbdc78));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x5d9561,_0x30b9f8){const _0x37898c=a59_0x21f5,_0x105e2b=listLocalServiceTrees();let _0x4951b6;for(const _0x218f2f of _0x105e2b){const _0xb581eb=matchServiceTreeCommand(_0x218f2f,_0x5d9561);if(!_0xb581eb)continue;(!_0x4951b6||_0xb581eb[_0x37898c(0xe8)][_0x37898c(0xde)]['length']>_0x4951b6['command'][_0x37898c(0xde)][_0x37898c(0x119)])&&(_0x4951b6={'tree':_0x218f2f,'command':_0xb581eb[_0x37898c(0xe8)],'remainingArgs':_0xb581eb[_0x37898c(0x120)]});}if(!_0x4951b6)return undefined;const _0x54e395={..._0x30b9f8};return applyAppBinding(_0x4951b6['tree'],_0x4951b6[_0x37898c(0xe8)],_0x54e395),{'definition':buildDynamicCommandDefinition(_0x4951b6[_0x37898c(0xff)],_0x4951b6['command']),'args':_0x4951b6['remainingArgs'],'flags':_0x54e395,'tree':_0x4951b6[_0x37898c(0xff)],'command':_0x4951b6[_0x37898c(0xe8)]};}export function generateDynamicServiceHelp(_0x3e5efa){const _0x150a6d=a59_0x21f5,_0xc06939=listLocalServiceTrees()[_0x150a6d(0x124)](_0x273e00=>_0x273e00[_0x150a6d(0x10d)][_0x150a6d(0xed)]===_0x3e5efa);if(!_0xc06939)return undefined;const _0x44f26a=[CLI_BIN_NAME+'\x20'+_0x3e5efa+_0x150a6d(0xf4),'',_0xc06939[_0x150a6d(0x10d)][_0x150a6d(0x10f)]||_0x3e5efa,_0xc06939[_0x150a6d(0x10d)][_0x150a6d(0xfa)]?'\x20\x20'+_0xc06939[_0x150a6d(0x10d)]['description']:'','',_0x150a6d(0x13c),..._0xc06939['commands']['map'](_0x163462=>{const _0x1ac387=_0x150a6d,_0x265109=_0x163462[_0x1ac387(0xde)][_0x1ac387(0x106)](0x1)[_0x1ac387(0x137)]('\x20'),_0x17f6f4=_0x163462[_0x1ac387(0xfb)]===_0x1ac387(0xf0)?'':'\x20['+_0x163462['risk']+']';return'\x20\x20'+_0x265109[_0x1ac387(0xe9)](0x18)+'\x20'+(_0x163462['description']||'')+_0x17f6f4;}),'',_0x150a6d(0x121)+CLI_BIN_NAME+_0x150a6d(0xe7)+_0x3e5efa+_0x150a6d(0x127)][_0x150a6d(0x135)](Boolean);return _0x44f26a[_0x150a6d(0x137)]('\x0a');}export function listDynamicServiceEntries(){const _0x43f906=a59_0x21f5;return listLocalServices()[_0x43f906(0x102)](_0x1bc266=>{const _0x17e127=_0x43f906,_0x414730=_0x1bc266[_0x17e127(0x134)];return{'service':_0x414730[_0x17e127(0x10d)]['code'],'label':_0x414730[_0x17e127(0x10d)]['name']||_0x414730['service'][_0x17e127(0xed)],'commands':_0x414730[_0x17e127(0xf3)][_0x17e127(0x102)](_0x5ea1c1=>({'command':dynamicCommandName(_0x5ea1c1),'description':_0x5ea1c1['description']||'Run\x20service\x20command\x20'+_0x5ea1c1[_0x17e127(0xdd)],'tag':riskTag(_0x5ea1c1['risk'])}))};});}export function getDynamicServiceEntry(_0x87ebd9){const _0x28e7bc=a59_0x21f5;return listDynamicServiceEntries()['find'](_0x2fbaa9=>_0x2fbaa9[_0x28e7bc(0x10d)]===_0x87ebd9);}export function listDynamicServiceDefinitions(_0x3e4c4e){const _0x3f0c38=a59_0x21f5;return listLocalServiceTrees()[_0x3f0c38(0x135)](_0x4319ee=>!_0x3e4c4e||_0x4319ee['service'][_0x3f0c38(0xed)]===_0x3e4c4e)[_0x3f0c38(0x12e)](_0x1ea903=>_0x1ea903[_0x3f0c38(0xf3)][_0x3f0c38(0x102)](_0x5df139=>buildDynamicCommandDefinition(_0x1ea903,_0x5df139)));}export function getDynamicServiceDefinitions(_0xe5d631){const _0x1ef23d=a59_0x21f5,_0x52ce99=listDynamicServiceDefinitions(_0xe5d631);return _0x52ce99[_0x1ef23d(0x119)]>0x0?_0x52ce99:undefined;}export function findDynamicServiceDefinition(_0x11f52a,_0x5ceb53){const _0xb5c878=a59_0x21f5;return listDynamicServiceDefinitions(_0x11f52a)[_0xb5c878(0x124)](_0x16546b=>_0x16546b['command']===_0x5ceb53);}export function buildDynamicCommandDefinition(_0x2e539e,_0x541670){const _0x26fc0a=a59_0x21f5;return{'service':_0x2e539e['service'][_0x26fc0a(0xed)],'command':dynamicCommandName(_0x541670),'description':_0x541670[_0x26fc0a(0xfa)]||_0x26fc0a(0xee)+_0x541670[_0x26fc0a(0xdd)],'risk':_0x541670['risk'],..._0x541670['risk']==='read'?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x541670)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x541670[_0x26fc0a(0x115)][_0x26fc0a(0x102)](_0x10e751=>({'name':_0x10e751[_0x26fc0a(0x10f)],'description':_0x10e751['description']||_0x10e751['name'],'required':_0x10e751[_0x26fc0a(0x104)]})),'flags':_0x541670[_0x26fc0a(0x112)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x541670),async 'dryRun'(_0x31b708){const _0x453b46=_0x26fc0a,_0x4d1040=await compilePlan(_0x541670,_0x31b708);return{'method':'SERVICE_TREE','url':_0x541670[_0x453b46(0xdd)],'body':{'target':targetPreview(_0x4d1040),'params':_0x4d1040[_0x453b46(0x114)]},'description':_0x453b46(0x131)+_0x541670[_0x453b46(0xdd)]};},async 'execute'(_0x70dcb7){const _0x4d7c0e=_0x26fc0a,_0x5ea731=await compilePlan(_0x541670,_0x70dcb7),_0x4e9fbe=Date[_0x4d7c0e(0xd7)](),_0x161713=await executePlan(_0x5ea731,_0x541670,_0x70dcb7),_0x5a8e5b=Date['now']()-_0x4e9fbe;return{'ok':!![],'data':{'service':_0x2e539e[_0x4d7c0e(0x10d)],'command':_0x541670[_0x4d7c0e(0xdd)],'target':targetPreview(_0x5ea731),'result':_0x161713,'elapsed':_0x5a8e5b},'message':_0x4d7c0e(0x130)+_0x541670['cliPath']+_0x4d7c0e(0xdb)+_0x5a8e5b+'ms'};}};}function buildDynamicConfirmationDescription(_0x442119){const _0x8007be=a59_0x21f5,_0x1a8ef9=_0x442119['description']||_0x442119[_0x8007be(0xdd)],_0x59123b=_0x442119[_0x8007be(0xfb)]===_0x8007be(0xea)?_0x8007be(0x12f):_0x8007be(0x13b);return _0x8007be(0x136)+_0x1a8ef9+'”。'+_0x59123b;}function dynamicCommandName(_0x181305){const _0x456761=a59_0x21f5;return _0x181305['fullPath'][_0x456761(0x106)](0x1)[_0x456761(0x137)]('\x20');}function a59_0x21f5(_0x2e4199,_0x381a60){_0x2e4199=_0x2e4199-0xd2;const _0xcf2322=a59_0xcf23();let _0x21f59a=_0xcf2322[_0x2e4199];return _0x21f59a;}function riskTag(_0x2325c3){const _0x53ed17=a59_0x21f5;return _0x2325c3===_0x53ed17(0xf0)?'':_0x53ed17(0xeb)+_0x2325c3+']';}function flagToCommandFlag(_0x246ec9){const _0x2b2618=a59_0x21f5;return{'name':_0x246ec9[_0x2b2618(0x10a)],'type':_0x246ec9[_0x2b2618(0xd8)]==='json'?_0x2b2618(0x10b):_0x246ec9[_0x2b2618(0xd8)],'description':_0x246ec9[_0x2b2618(0xfa)]||_0x246ec9[_0x2b2618(0x10f)],'required':_0x246ec9[_0x2b2618(0x104)],'default':isPrimitiveFlagDefault(_0x246ec9['default'])?_0x246ec9[_0x2b2618(0x105)]:undefined,'enum':_0x246ec9[_0x2b2618(0x126)]};}async function compilePlan(_0x45d759,_0x8f302b){const _0x5a80b7=a59_0x21f5;return compileServiceTreeCommand(_0x45d759,{'flags':_0x8f302b[_0x5a80b7(0xd3)],'args':_0x8f302b[_0x5a80b7(0x115)],'context':await buildServiceContext(_0x45d759,_0x8f302b)});}async function buildServiceContext(_0x3dc57b,_0x228ce2){const _0x3ec258=a59_0x21f5,_0x4bdabf={'appCode':_0x228ce2[_0x3ec258(0x12b)],'env':_0x228ce2['envName'],'envName':_0x228ce2['envName']};if(!usesRuntimeContext(_0x3dc57b))return _0x4bdabf;const _0x50fa4b=await getLoginUserInfo(),_0x47f7dd=pickFirst(_0x50fa4b['userId'],_0x50fa4b['id']);return{..._0x4bdabf,'user':_0x50fa4b,'userId':_0x47f7dd,'id':_0x50fa4b['id'],'username':pickFirst(_0x50fa4b[_0x3ec258(0x10e)],_0x50fa4b[_0x3ec258(0xf8)],_0x50fa4b[_0x3ec258(0xd5)]),'userName':_0x50fa4b[_0x3ec258(0xf8)],'nickname':pickFirst(_0x50fa4b['nickname'],_0x50fa4b[_0x3ec258(0x10c)]),'nickName':_0x50fa4b[_0x3ec258(0x10c)],'tenantCode':_0x50fa4b[_0x3ec258(0xe3)],'employeeId':_0x50fa4b[_0x3ec258(0x11b)]};}function a59_0xcf23(){const _0xb24b2c=['tableName','employeeId','\x20requires\x20target.sqlCode.','scriptName','startsWith','sqlCode','remainingArgs','Use\x20`','target','\x20\x20\x20\x20sqlCode:\x20','find','context.','enum','`\x20to\x20inspect\x20the\x20manifest.','2672570EsRFmJ','Unknown\x20appRef\x20\x22','appRef','appCode','3426420gCauqv','boolean','flatMap','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','Service\x20command\x20','Preview\x20dynamic\x20service\x20command:\x20','mapTo','appBindings','normalizedManifest','filter','将通过\x20Service\x20Tree\x20执行“','join','\x20\x20\x20\x20functionName:\x20','bff','dbtableConfig','该命令被清单标记为写入,可能修改业务数据或服务状态。','Commands:','ctx.','rawFlags','\x20requires\x20target.functionName.','loginName','source','now','type','operator','datasetCode','\x20completed\x20in\x20','7667688toBdmB','cliPath','fullPath','env','validation','\x20\x20\x20\x20kind:\x20\x20\x20\x20','7snCPmi','tenantCode','kind','\x20\x20\x20\x20','app','\x20service\x20detail\x20--service\x20','command','padEnd','high-risk-write','\x20\x20[','Cannot\x20resolve\x20datatable\x20\x22','code','Run\x20service\x20command\x20','\x20\x20\x20\x20command:\x20','read','1778644UgIaiQ','425582fwtIfA','commands','\x20<command>\x20[flags]','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','fromEntries','bffId','userName','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','description','risk','\x20\x20\x20\x20datasetCode:\x20','datatable','push','tree','Unsupported\x20service\x20target\x20kind:\x20','bffCode','map','23093912tlpegi','required','default','slice','\x20\x20MAP\x20TO','appcode','const','cliName','string','nickName','service','username','name','trim','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','flags','\x20->\x20','params','args','\x20\x20SERVICE\x20TREE\x20TARGET','sql','484125cBYtOB','length'];a59_0xcf23=function(){return _0xb24b2c;};return a59_0xcf23();}function usesRuntimeContext(_0x489090){const _0x1bcee3=a59_0x21f5;return _0x489090[_0x1bcee3(0x132)]['some'](_0x2cb9a6=>typeof _0x2cb9a6[_0x1bcee3(0xd6)]===_0x1bcee3(0x10b)&&(_0x2cb9a6['source'][_0x1bcee3(0x11e)](_0x1bcee3(0x125))||_0x2cb9a6[_0x1bcee3(0xd6)][_0x1bcee3(0x11e)](_0x1bcee3(0xd2))));}function pickFirst(..._0x21fd2d){const _0x1e84d6=a59_0x21f5;return _0x21fd2d[_0x1e84d6(0x124)](_0x53fb1a=>_0x53fb1a!==undefined&&_0x53fb1a!==null);}async function executePlan(_0x41044c,_0x321790,_0x1557c5){const _0x1285e0=a59_0x21f5;if(_0x41044c['kind']==='data'){const _0x29be3a=await resolveDatasetCode(_0x41044c,_0x321790,_0x1557c5);return executeData(_0x29be3a,_0x41044c[_0x1285e0(0xe8)],_0x41044c[_0x1285e0(0x114)]);}if(_0x41044c[_0x1285e0(0xe4)]===_0x1285e0(0x117)){if(!_0x41044c['sqlCode'])throw CliErrors[_0x1285e0(0xe0)]('Service\x20command\x20'+_0x321790[_0x1285e0(0xdd)]+_0x1285e0(0x11c));return executeSdkSql(_0x41044c[_0x1285e0(0x11f)],normalizeScalarParams(_0x41044c[_0x1285e0(0x114)]));}if(_0x41044c[_0x1285e0(0xe4)]===_0x1285e0(0x139)){const _0x5aef51=_0x41044c[_0x1285e0(0x11d)]||_0x41044c[_0x1285e0(0x101)]||(_0x41044c['bffId']==null?'':String(_0x41044c[_0x1285e0(0xf7)]));if(!_0x5aef51)throw CliErrors[_0x1285e0(0xe0)](_0x1285e0(0x130)+_0x321790['cliPath']+_0x1285e0(0xd4));return executeSdkBff(_0x5aef51,_0x41044c[_0x1285e0(0x114)]);}throw CliErrors['validation'](_0x1285e0(0x100)+_0x41044c[_0x1285e0(0xe4)]);}async function resolveDatasetCode(_0x3dadcc,_0xfa36ca,_0x41cdb5){const _0x3f1b70=a59_0x21f5;if(_0x3dadcc['datasetCode'])return _0x3dadcc['datasetCode'];if(!_0x3dadcc[_0x3f1b70(0xfd)])throw CliErrors[_0x3f1b70(0xe0)](_0x3f1b70(0x130)+_0xfa36ca['cliPath']+_0x3f1b70(0xf9));const _0x305375=await listDatasets(_0x41cdb5[_0x3f1b70(0x12b)]),_0x54b0b1=_0x305375[_0x3f1b70(0x124)](_0x314583=>_0x314583[_0x3f1b70(0x13a)]?.[_0x3f1b70(0x11a)]===_0x3dadcc[_0x3f1b70(0xfd)]);if(!_0x54b0b1?.[_0x3f1b70(0xed)])throw CliErrors[_0x3f1b70(0xe0)](_0x3f1b70(0xec)+_0x3dadcc[_0x3f1b70(0xfd)]+_0x3f1b70(0x111)+_0x41cdb5['appCode']+'.',_0x3f1b70(0xf5));return _0x54b0b1[_0x3f1b70(0xed)];}function applyAppBinding(_0x42afed,_0x273a67,_0x524f9a){const _0xb2e1a2=a59_0x21f5,_0x215c9f=_0x273a67[_0xb2e1a2(0x122)][_0xb2e1a2(0x12a)];if(!_0x215c9f)return;const _0x2a2811=_0x42afed[_0xb2e1a2(0x133)][_0x215c9f];if(!_0x2a2811)throw CliErrors['validation'](_0xb2e1a2(0x129)+_0x215c9f+'\x22\x20in\x20service\x20command\x20'+_0x273a67[_0xb2e1a2(0xdd)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0xcb28d0=_0x2a2811[_0xb2e1a2(0x108)]||_0x2a2811[_0xb2e1a2(0x12b)];_0xcb28d0&&!hasText(_0x524f9a['appcode'])&&(_0x524f9a['appcode']=_0xcb28d0),_0x2a2811[_0xb2e1a2(0xe6)]&&!hasText(_0x524f9a[_0xb2e1a2(0xe6)])&&!hasText(_0x524f9a[_0xb2e1a2(0x108)])&&(_0x524f9a[_0xb2e1a2(0xe6)]=_0x2a2811[_0xb2e1a2(0xe6)]),_0x2a2811[_0xb2e1a2(0xdf)]&&!hasText(_0x524f9a[_0xb2e1a2(0xdf)])&&(_0x524f9a[_0xb2e1a2(0xdf)]=_0x2a2811['env']);}function renderDynamicCommandHelp(_0x199a25){const _0x2ce2c7=a59_0x21f5,_0x5db1cc=[_0x2ce2c7(0x116),_0x2ce2c7(0xe1)+_0x199a25[_0x2ce2c7(0x122)][_0x2ce2c7(0xe4)],_0x2ce2c7(0xef)+_0x199a25[_0x2ce2c7(0x122)]['command']];if(_0x199a25['target'][_0x2ce2c7(0xda)])_0x5db1cc['push'](_0x2ce2c7(0xfc)+_0x199a25['target']['datasetCode']);if(_0x199a25[_0x2ce2c7(0x122)][_0x2ce2c7(0xfd)])_0x5db1cc[_0x2ce2c7(0xfe)]('\x20\x20\x20\x20datatable:\x20'+_0x199a25[_0x2ce2c7(0x122)]['datatable']);if(_0x199a25[_0x2ce2c7(0x122)][_0x2ce2c7(0x11f)])_0x5db1cc[_0x2ce2c7(0xfe)](_0x2ce2c7(0x123)+_0x199a25[_0x2ce2c7(0x122)][_0x2ce2c7(0x11f)]);if(_0x199a25['target'][_0x2ce2c7(0x11d)])_0x5db1cc['push'](_0x2ce2c7(0x138)+_0x199a25[_0x2ce2c7(0x122)][_0x2ce2c7(0x11d)]);if(_0x199a25[_0x2ce2c7(0x132)]['length']>0x0){_0x5db1cc[_0x2ce2c7(0xfe)]('',_0x2ce2c7(0x107));for(const _0x4ee534 of _0x199a25[_0x2ce2c7(0x132)]){_0x5db1cc[_0x2ce2c7(0xfe)](_0x2ce2c7(0xe5)+(_0x4ee534[_0x2ce2c7(0xd6)]||_0x2ce2c7(0x109))+_0x2ce2c7(0x113)+_0x4ee534[_0x2ce2c7(0x122)]+(_0x4ee534[_0x2ce2c7(0xd9)]?'.'+_0x4ee534[_0x2ce2c7(0xd9)]:''));}}return _0x5db1cc['join']('\x0a');}function targetPreview(_0x475a21){const _0xeadc65=a59_0x21f5;return{'kind':_0x475a21[_0xeadc65(0xe4)],'command':_0x475a21[_0xeadc65(0xe8)],'appRef':_0x475a21[_0xeadc65(0x12a)],'datasetCode':_0x475a21['datasetCode'],'datatable':_0x475a21[_0xeadc65(0xfd)],'sqlCode':_0x475a21[_0xeadc65(0x11f)],'bffCode':_0x475a21[_0xeadc65(0x101)],'bffId':_0x475a21[_0xeadc65(0xf7)],'functionName':_0x475a21[_0xeadc65(0x11d)]};}function normalizeScalarParams(_0x444a74){const _0x4d1515=a59_0x21f5;return Object[_0x4d1515(0xf6)](Object['entries'](_0x444a74)['filter'](([,_0xe83ba])=>typeof _0xe83ba===_0x4d1515(0x10b)||typeof _0xe83ba==='number'));}function hasText(_0x26dc5b){const _0x5818b6=a59_0x21f5;return typeof _0x26dc5b===_0x5818b6(0x10b)&&_0x26dc5b[_0x5818b6(0x110)]()[_0x5818b6(0x119)]>0x0;}function isPrimitiveFlagDefault(_0x4665a4){const _0x1ea6e0=a59_0x21f5;return _0x4665a4===undefined||typeof _0x4665a4===_0x1ea6e0(0x10b)||typeof _0x4665a4==='number'||typeof _0x4665a4===_0x1ea6e0(0x12d);}
1
+ (function(_0x138ee0,_0x1ac021){const _0x1fdc31=a59_0x315f,_0x21073c=_0x138ee0();while(!![]){try{const _0x190129=-parseInt(_0x1fdc31(0x15d))/0x1+parseInt(_0x1fdc31(0x135))/0x2*(-parseInt(_0x1fdc31(0x140))/0x3)+parseInt(_0x1fdc31(0x16d))/0x4+parseInt(_0x1fdc31(0x149))/0x5*(parseInt(_0x1fdc31(0x16f))/0x6)+-parseInt(_0x1fdc31(0x13b))/0x7*(-parseInt(_0x1fdc31(0x111))/0x8)+-parseInt(_0x1fdc31(0x14f))/0x9*(-parseInt(_0x1fdc31(0x10f))/0xa)+-parseInt(_0x1fdc31(0x14b))/0xb;if(_0x190129===_0x1ac021)break;else _0x21073c['push'](_0x21073c['shift']());}catch(_0x588f56){_0x21073c['push'](_0x21073c['shift']());}}}(a59_0x2480,0xaedca));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x1da283,_0x3b49f4){const _0x4b698f=a59_0x315f,_0x4ce969=listLocalServiceTrees();let _0x1c8c47;for(const _0xa084d0 of _0x4ce969){const _0x4aa4c7=matchServiceTreeCommand(_0xa084d0,_0x1da283);if(!_0x4aa4c7)continue;(!_0x1c8c47||_0x4aa4c7[_0x4b698f(0x138)][_0x4b698f(0x10e)]['length']>_0x1c8c47[_0x4b698f(0x138)][_0x4b698f(0x10e)][_0x4b698f(0x154)])&&(_0x1c8c47={'tree':_0xa084d0,'command':_0x4aa4c7['command'],'remainingArgs':_0x4aa4c7[_0x4b698f(0x11a)]});}if(!_0x1c8c47)return undefined;const _0x12df95={..._0x3b49f4};return applyAppBinding(_0x1c8c47['tree'],_0x1c8c47[_0x4b698f(0x138)],_0x12df95),{'definition':buildDynamicCommandDefinition(_0x1c8c47[_0x4b698f(0x121)],_0x1c8c47[_0x4b698f(0x138)]),'args':_0x1c8c47[_0x4b698f(0x11a)],'flags':_0x12df95,'tree':_0x1c8c47[_0x4b698f(0x121)],'command':_0x1c8c47[_0x4b698f(0x138)]};}export function generateDynamicServiceHelp(_0x621b21){const _0x353375=a59_0x315f,_0xf521a8=listLocalServiceTrees()['find'](_0x5c8f66=>_0x5c8f66[_0x353375(0x150)][_0x353375(0x110)]===_0x621b21);if(!_0xf521a8)return undefined;const _0x2f8e52=[CLI_BIN_NAME+'\x20'+_0x621b21+'\x20<command>\x20[flags]','',_0xf521a8['service'][_0x353375(0x137)]||_0x621b21,_0xf521a8[_0x353375(0x150)][_0x353375(0x125)]?'\x20\x20'+_0xf521a8[_0x353375(0x150)]['description']:'','',_0x353375(0x109),..._0xf521a8['commands']['map'](_0x1938c8=>{const _0x3b66ef=_0x353375,_0x28c247=_0x1938c8[_0x3b66ef(0x10e)][_0x3b66ef(0x10c)](0x1)[_0x3b66ef(0x168)]('\x20'),_0x129b11=_0x1938c8[_0x3b66ef(0x164)]===_0x3b66ef(0x141)?'':'\x20['+_0x1938c8[_0x3b66ef(0x164)]+']';return'\x20\x20'+_0x28c247['padEnd'](0x18)+'\x20'+(_0x1938c8[_0x3b66ef(0x125)]||'')+_0x129b11;}),'',_0x353375(0x119)+CLI_BIN_NAME+_0x353375(0x126)+_0x621b21+_0x353375(0x15e)]['filter'](Boolean);return _0x2f8e52['join']('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x136678=>{const _0x3e1f59=a59_0x315f,_0x1e6728=_0x136678['normalizedManifest'];return{'service':_0x1e6728[_0x3e1f59(0x150)][_0x3e1f59(0x110)],'label':_0x1e6728[_0x3e1f59(0x150)][_0x3e1f59(0x137)]||_0x1e6728[_0x3e1f59(0x150)][_0x3e1f59(0x110)],'commands':_0x1e6728[_0x3e1f59(0x118)]['map'](_0x15100f=>({'command':dynamicCommandName(_0x15100f),'description':_0x15100f['description']||_0x3e1f59(0x11b)+_0x15100f[_0x3e1f59(0x148)],'tag':riskTag(_0x15100f[_0x3e1f59(0x164)])}))};});}export function getDynamicServiceEntry(_0x54e182){const _0x5817ad=a59_0x315f;return listDynamicServiceEntries()[_0x5817ad(0x108)](_0x4196f1=>_0x4196f1['service']===_0x54e182);}export function listDynamicServiceDefinitions(_0x53cf28){const _0x406a6b=a59_0x315f;return listLocalServiceTrees()[_0x406a6b(0x124)](_0x4fa0a0=>!_0x53cf28||_0x4fa0a0[_0x406a6b(0x150)][_0x406a6b(0x110)]===_0x53cf28)[_0x406a6b(0x147)](_0x34e5b6=>_0x34e5b6[_0x406a6b(0x118)][_0x406a6b(0x12c)](_0x5aaa9b=>buildDynamicCommandDefinition(_0x34e5b6,_0x5aaa9b)));}export function getDynamicServiceDefinitions(_0x295883){const _0x46689a=a59_0x315f,_0x3f5855=listDynamicServiceDefinitions(_0x295883);return _0x3f5855[_0x46689a(0x154)]>0x0?_0x3f5855:undefined;}function a59_0x2480(){const _0x55622d=['6FAgafa','startsWith','string','find','Commands:','Service\x20command\x20','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','slice','\x20completed\x20in\x20','fullPath','24770ZHACjE','code','2674664cqraNK','kind','type','required','\x20\x20\x20\x20sqlCode:\x20','entries','loginName','commands','Use\x20`','remainingArgs','Run\x20service\x20command\x20','source','sql','operator','cliName','app','tree','nickName','username','filter','description','\x20service\x20detail\x20--service\x20','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','datatable','args','Unsupported\x20service\x20target\x20kind:\x20','now','map','tenantCode','bffCode','params','bffId','scriptName','Unknown\x20appRef\x20\x22','trim','datasetCode','6qcVHUS','json','name','command','mapTo','default','21zlhzYL','env','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','\x20\x20[','SERVICE_TREE','64797yVNMha','read','\x20requires\x20target.sqlCode.','validation','\x20\x20MAP\x20TO','\x20\x20\x20\x20functionName:\x20','flags','flatMap','cliPath','1989125RvcAng','\x20\x20SERVICE\x20TREE\x20TARGET','24124562BfjzPE','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','employeeId','\x20\x20\x20\x20','2934GrxJEF','service','number','appcode','dbtableConfig','length','context.','appRef','\x20\x20\x20\x20datatable:\x20','userId','\x20\x20\x20\x20kind:\x20\x20\x20\x20','userName','target','envName','628236aSUOeA','`\x20to\x20inspect\x20the\x20manifest.','push','将通过\x20Service\x20Tree\x20执行“','high-risk-write','enum','sqlCode','risk','\x20\x20\x20\x20command:\x20','\x22\x20in\x20service\x20command\x20','Cannot\x20resolve\x20datatable\x20\x22','join','tableName','appCode','rawFlags','boolean','5576332ZeSwXZ','some'];a59_0x2480=function(){return _0x55622d;};return a59_0x2480();}export function findDynamicServiceDefinition(_0x519479,_0x1e9e3f){const _0x149513=a59_0x315f;return listDynamicServiceDefinitions(_0x519479)['find'](_0x55debc=>_0x55debc[_0x149513(0x138)]===_0x1e9e3f);}export function buildDynamicCommandDefinition(_0x3474c6,_0x2d87c8){const _0x313f1f=a59_0x315f;return{'service':_0x3474c6['service'][_0x313f1f(0x110)],'command':dynamicCommandName(_0x2d87c8),'description':_0x2d87c8[_0x313f1f(0x125)]||_0x313f1f(0x11b)+_0x2d87c8[_0x313f1f(0x148)],'risk':_0x2d87c8[_0x313f1f(0x164)],..._0x2d87c8['risk']==='read'?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x2d87c8)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x2d87c8[_0x313f1f(0x129)][_0x313f1f(0x12c)](_0x382430=>({'name':_0x382430[_0x313f1f(0x137)],'description':_0x382430[_0x313f1f(0x125)]||_0x382430[_0x313f1f(0x137)],'required':_0x382430[_0x313f1f(0x114)]})),'flags':_0x2d87c8[_0x313f1f(0x146)][_0x313f1f(0x12c)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x2d87c8),async 'dryRun'(_0x1f48d5){const _0x123b99=_0x313f1f,_0x2be8a9=await compilePlan(_0x2d87c8,_0x1f48d5);return{'method':_0x123b99(0x13f),'url':_0x2d87c8[_0x123b99(0x148)],'body':{'target':targetPreview(_0x2be8a9),'params':_0x2be8a9['params']},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x2d87c8[_0x123b99(0x148)]};},async 'execute'(_0x461a92){const _0x3eb446=_0x313f1f,_0x5f01ba=await compilePlan(_0x2d87c8,_0x461a92),_0x3fd13c=Date[_0x3eb446(0x12b)](),_0x18c931=await executePlan(_0x5f01ba,_0x2d87c8,_0x461a92),_0xa1ee5d=Date[_0x3eb446(0x12b)]()-_0x3fd13c;return{'ok':!![],'data':{'service':_0x3474c6[_0x3eb446(0x150)],'command':_0x2d87c8['cliPath'],'target':targetPreview(_0x5f01ba),'result':_0x18c931,'elapsed':_0xa1ee5d},'message':_0x3eb446(0x10a)+_0x2d87c8[_0x3eb446(0x148)]+_0x3eb446(0x10d)+_0xa1ee5d+'ms'};}};}function buildDynamicConfirmationDescription(_0x5366fc){const _0x4c3ede=a59_0x315f,_0x5608e5=_0x5366fc[_0x4c3ede(0x125)]||_0x5366fc[_0x4c3ede(0x148)],_0x930f09=_0x5366fc[_0x4c3ede(0x164)]===_0x4c3ede(0x161)?_0x4c3ede(0x10b):'该命令被清单标记为写入,可能修改业务数据或服务状态。';return _0x4c3ede(0x160)+_0x5608e5+'”。'+_0x930f09;}function dynamicCommandName(_0x184348){const _0x4372e5=a59_0x315f;return _0x184348['fullPath'][_0x4372e5(0x10c)](0x1)[_0x4372e5(0x168)]('\x20');}function riskTag(_0x4dbd2c){const _0x5055cb=a59_0x315f;return _0x4dbd2c==='read'?'':_0x5055cb(0x13e)+_0x4dbd2c+']';}function flagToCommandFlag(_0x53f98c){const _0x450d47=a59_0x315f;return{'name':_0x53f98c[_0x450d47(0x11f)],'type':_0x53f98c[_0x450d47(0x113)]===_0x450d47(0x136)?_0x450d47(0x107):_0x53f98c['type'],'description':_0x53f98c[_0x450d47(0x125)]||_0x53f98c[_0x450d47(0x137)],'required':_0x53f98c[_0x450d47(0x114)],'default':isPrimitiveFlagDefault(_0x53f98c[_0x450d47(0x13a)])?_0x53f98c[_0x450d47(0x13a)]:undefined,'enum':_0x53f98c[_0x450d47(0x162)]};}async function compilePlan(_0x2b666d,_0x4c8b2b){const _0x573e45=a59_0x315f;return compileServiceTreeCommand(_0x2b666d,{'flags':_0x4c8b2b[_0x573e45(0x16b)],'args':_0x4c8b2b[_0x573e45(0x129)],'context':await buildServiceContext(_0x2b666d,_0x4c8b2b)});}async function buildServiceContext(_0x224aa4,_0x3bda20){const _0xedd9f7=a59_0x315f,_0x398935={'appCode':_0x3bda20['appCode'],'env':_0x3bda20[_0xedd9f7(0x15c)],'envName':_0x3bda20[_0xedd9f7(0x15c)]};if(!usesRuntimeContext(_0x224aa4))return _0x398935;const _0x55aac5=await getLoginUserInfo(),_0x4ccaeb=pickFirst(_0x55aac5[_0xedd9f7(0x158)],_0x55aac5['id']);return{..._0x398935,'user':_0x55aac5,'userId':_0x4ccaeb,'id':_0x55aac5['id'],'username':pickFirst(_0x55aac5[_0xedd9f7(0x123)],_0x55aac5[_0xedd9f7(0x15a)],_0x55aac5[_0xedd9f7(0x117)]),'userName':_0x55aac5[_0xedd9f7(0x15a)],'nickname':pickFirst(_0x55aac5['nickname'],_0x55aac5[_0xedd9f7(0x122)]),'nickName':_0x55aac5[_0xedd9f7(0x122)],'tenantCode':_0x55aac5[_0xedd9f7(0x12d)],'employeeId':_0x55aac5[_0xedd9f7(0x14d)]};}function usesRuntimeContext(_0x1c8c62){const _0x7ea457=a59_0x315f;return _0x1c8c62[_0x7ea457(0x139)][_0x7ea457(0x16e)](_0x30fa3f=>typeof _0x30fa3f['source']===_0x7ea457(0x107)&&(_0x30fa3f[_0x7ea457(0x11c)][_0x7ea457(0x170)](_0x7ea457(0x155))||_0x30fa3f[_0x7ea457(0x11c)][_0x7ea457(0x170)]('ctx.')));}function a59_0x315f(_0x58d483,_0x5b439e){_0x58d483=_0x58d483-0x107;const _0x2480ee=a59_0x2480();let _0x315ff4=_0x2480ee[_0x58d483];return _0x315ff4;}function pickFirst(..._0xb20bec){const _0x4af329=a59_0x315f;return _0xb20bec[_0x4af329(0x108)](_0x2686fc=>_0x2686fc!==undefined&&_0x2686fc!==null);}async function executePlan(_0x351dd1,_0x4df865,_0x362e96){const _0x218822=a59_0x315f;if(_0x351dd1[_0x218822(0x112)]==='data'){const _0x41ea68=await resolveDatasetCode(_0x351dd1,_0x4df865,_0x362e96);return executeData(_0x41ea68,_0x351dd1['command'],_0x351dd1['params']);}if(_0x351dd1[_0x218822(0x112)]===_0x218822(0x11d)){if(!_0x351dd1[_0x218822(0x163)])throw CliErrors[_0x218822(0x143)](_0x218822(0x10a)+_0x4df865['cliPath']+_0x218822(0x142));return executeSdkSql(_0x351dd1['sqlCode'],normalizeScalarParams(_0x351dd1[_0x218822(0x12f)]));}if(_0x351dd1['kind']==='bff'){const _0x864c4f=_0x351dd1[_0x218822(0x131)]||_0x351dd1[_0x218822(0x12e)]||(_0x351dd1[_0x218822(0x130)]==null?'':String(_0x351dd1[_0x218822(0x130)]));if(!_0x864c4f)throw CliErrors[_0x218822(0x143)](_0x218822(0x10a)+_0x4df865[_0x218822(0x148)]+'\x20requires\x20target.functionName.');return executeSdkBff(_0x864c4f,_0x351dd1[_0x218822(0x12f)]);}throw CliErrors[_0x218822(0x143)](_0x218822(0x12a)+_0x351dd1[_0x218822(0x112)]);}async function resolveDatasetCode(_0x454872,_0xbadda0,_0x270a75){const _0x1a1300=a59_0x315f;if(_0x454872['datasetCode'])return _0x454872['datasetCode'];if(!_0x454872['datatable'])throw CliErrors[_0x1a1300(0x143)](_0x1a1300(0x10a)+_0xbadda0[_0x1a1300(0x148)]+_0x1a1300(0x14c));const _0x10fe90=await listDatasets(_0x270a75['appCode']),_0x570807=_0x10fe90[_0x1a1300(0x108)](_0x48e8b9=>_0x48e8b9[_0x1a1300(0x153)]?.[_0x1a1300(0x169)]===_0x454872[_0x1a1300(0x128)]);if(!_0x570807?.['code'])throw CliErrors[_0x1a1300(0x143)](_0x1a1300(0x167)+_0x454872[_0x1a1300(0x128)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x270a75[_0x1a1300(0x16a)]+'.',_0x1a1300(0x13d));return _0x570807[_0x1a1300(0x110)];}function applyAppBinding(_0x2dbc5e,_0xf991a,_0x232007){const _0x418200=a59_0x315f,_0x2f37f2=_0xf991a[_0x418200(0x15b)][_0x418200(0x156)];if(!_0x2f37f2)return;const _0x5c89a9=_0x2dbc5e['appBindings'][_0x2f37f2];if(!_0x5c89a9)throw CliErrors['validation'](_0x418200(0x132)+_0x2f37f2+_0x418200(0x166)+_0xf991a[_0x418200(0x148)]+'.',_0x418200(0x127));const _0x1d3df9=_0x5c89a9['appcode']||_0x5c89a9[_0x418200(0x16a)];_0x1d3df9&&!hasText(_0x232007['appcode'])&&(_0x232007[_0x418200(0x152)]=_0x1d3df9),_0x5c89a9[_0x418200(0x120)]&&!hasText(_0x232007[_0x418200(0x120)])&&!hasText(_0x232007['appcode'])&&(_0x232007['app']=_0x5c89a9[_0x418200(0x120)]),_0x5c89a9[_0x418200(0x13c)]&&!hasText(_0x232007[_0x418200(0x13c)])&&(_0x232007[_0x418200(0x13c)]=_0x5c89a9[_0x418200(0x13c)]);}function renderDynamicCommandHelp(_0x2d4cec){const _0x2abe3c=a59_0x315f,_0xf8ec12=[_0x2abe3c(0x14a),_0x2abe3c(0x159)+_0x2d4cec[_0x2abe3c(0x15b)][_0x2abe3c(0x112)],_0x2abe3c(0x165)+_0x2d4cec['target']['command']];if(_0x2d4cec[_0x2abe3c(0x15b)][_0x2abe3c(0x134)])_0xf8ec12[_0x2abe3c(0x15f)]('\x20\x20\x20\x20datasetCode:\x20'+_0x2d4cec['target']['datasetCode']);if(_0x2d4cec[_0x2abe3c(0x15b)][_0x2abe3c(0x128)])_0xf8ec12['push'](_0x2abe3c(0x157)+_0x2d4cec[_0x2abe3c(0x15b)]['datatable']);if(_0x2d4cec[_0x2abe3c(0x15b)][_0x2abe3c(0x163)])_0xf8ec12[_0x2abe3c(0x15f)](_0x2abe3c(0x115)+_0x2d4cec[_0x2abe3c(0x15b)][_0x2abe3c(0x163)]);if(_0x2d4cec['target'][_0x2abe3c(0x131)])_0xf8ec12[_0x2abe3c(0x15f)](_0x2abe3c(0x145)+_0x2d4cec[_0x2abe3c(0x15b)][_0x2abe3c(0x131)]);if(_0x2d4cec[_0x2abe3c(0x139)][_0x2abe3c(0x154)]>0x0){_0xf8ec12[_0x2abe3c(0x15f)]('',_0x2abe3c(0x144));for(const _0x19a487 of _0x2d4cec['mapTo']){_0xf8ec12['push'](_0x2abe3c(0x14e)+(_0x19a487['source']||'const')+'\x20->\x20'+_0x19a487[_0x2abe3c(0x15b)]+(_0x19a487['operator']?'.'+_0x19a487[_0x2abe3c(0x11e)]:''));}}return _0xf8ec12[_0x2abe3c(0x168)]('\x0a');}function targetPreview(_0x1377d7){const _0x206cae=a59_0x315f;return{'kind':_0x1377d7[_0x206cae(0x112)],'command':_0x1377d7[_0x206cae(0x138)],'appRef':_0x1377d7['appRef'],'datasetCode':_0x1377d7['datasetCode'],'datatable':_0x1377d7[_0x206cae(0x128)],'sqlCode':_0x1377d7[_0x206cae(0x163)],'bffCode':_0x1377d7[_0x206cae(0x12e)],'bffId':_0x1377d7[_0x206cae(0x130)],'functionName':_0x1377d7[_0x206cae(0x131)]};}function normalizeScalarParams(_0x5655fc){const _0x5070e7=a59_0x315f;return Object['fromEntries'](Object[_0x5070e7(0x116)](_0x5655fc)[_0x5070e7(0x124)](([,_0x236eff])=>typeof _0x236eff===_0x5070e7(0x107)||typeof _0x236eff===_0x5070e7(0x151)));}function hasText(_0x32d3c2){const _0x5949c8=a59_0x315f;return typeof _0x32d3c2==='string'&&_0x32d3c2[_0x5949c8(0x133)]()[_0x5949c8(0x154)]>0x0;}function isPrimitiveFlagDefault(_0x4d61d4){const _0x3907b6=a59_0x315f;return _0x4d61d4===undefined||typeof _0x4d61d4===_0x3907b6(0x107)||typeof _0x4d61d4==='number'||typeof _0x4d61d4===_0x3907b6(0x16c);}
@@ -1 +1 @@
1
- (function(_0x35bd96,_0x1e98b4){const _0x2f2f72=a60_0x4b53,_0x5c54e5=_0x35bd96();while(!![]){try{const _0x54f3d8=parseInt(_0x2f2f72(0x1cd))/0x1+-parseInt(_0x2f2f72(0x1cb))/0x2*(-parseInt(_0x2f2f72(0x1d1))/0x3)+parseInt(_0x2f2f72(0x1c9))/0x4*(-parseInt(_0x2f2f72(0x1c3))/0x5)+-parseInt(_0x2f2f72(0x1d0))/0x6*(parseInt(_0x2f2f72(0x1e0))/0x7)+-parseInt(_0x2f2f72(0x1da))/0x8+parseInt(_0x2f2f72(0x1dc))/0x9+parseInt(_0x2f2f72(0x1c5))/0xa;if(_0x54f3d8===_0x1e98b4)break;else _0x5c54e5['push'](_0x5c54e5['shift']());}catch(_0x4a16b1){_0x5c54e5['push'](_0x5c54e5['shift']());}}}(a60_0x39cc,0xd0317));export function adaptServiceTreeManifestForLegacyFramework(_0x3c8db5){const _0x202b5b=a60_0x4b53,_0x2fd530=cloneJsonValue(_0x3c8db5),_0x1d698f=[];if(!isObjectRecord(_0x2fd530))return{'manifest':_0x2fd530,'errors':_0x1d698f};return Array[_0x202b5b(0x1e2)](_0x2fd530[_0x202b5b(0x1d5)])&&_0x2fd530[_0x202b5b(0x1d5)]['forEach']((_0x3bab2a,_0x5e1b33)=>{const _0x46174d=_0x202b5b;if(!isObjectRecord(_0x3bab2a))return;adaptBffTarget(_0x3bab2a[_0x46174d(0x1c0)],_0x46174d(0x1d9)+_0x5e1b33+'].target',_0x1d698f);}),adaptResources(_0x2fd530['resources'],_0x202b5b(0x1ce),_0x1d698f),{'manifest':_0x2fd530,'errors':_0x1d698f};}export function toPublicServiceTreeTarget(_0x4863fd){const _0x3a2709=a60_0x4b53,{scriptName:_0x554436,..._0x35b78b}=_0x4863fd;return typeof _0x554436===_0x3a2709(0x1d8)&&_0x554436[_0x3a2709(0x1c8)]()&&(_0x35b78b[_0x3a2709(0x1dd)]=_0x554436),_0x35b78b;}export function toPublicNormalizedServiceTree(_0x9a2b99){const _0x53504d=a60_0x4b53;return{..._0x9a2b99,'commands':_0x9a2b99[_0x53504d(0x1d5)][_0x53504d(0x1c2)](_0x5736f8=>({..._0x5736f8,'target':toPublicServiceTreeTarget(_0x5736f8['target'])}))};}function adaptResources(_0x28030c,_0x4dd19e,_0x3bceda){const _0x5be3f7=a60_0x4b53;if(!isObjectRecord(_0x28030c))return;for(const [_0x5eb6e7,_0x19cd56]of Object[_0x5be3f7(0x1d3)](_0x28030c)){if(!isObjectRecord(_0x19cd56))continue;const _0x3f39c7=_0x4dd19e+'.'+_0x5eb6e7;if(isObjectRecord(_0x19cd56['actions']))for(const [_0x2dca57,_0x36a2c1]of Object[_0x5be3f7(0x1d3)](_0x19cd56[_0x5be3f7(0x1db)])){if(!isObjectRecord(_0x36a2c1))continue;const _0x298e23=_0x3f39c7+_0x5be3f7(0x1e1)+_0x2dca57,_0x45b013=isObjectRecord(_0x36a2c1[_0x5be3f7(0x1c0)])&&_0x36a2c1[_0x5be3f7(0x1c0)][_0x5be3f7(0x1ca)]===_0x5be3f7(0x1be);adaptBffTarget(_0x36a2c1['target'],_0x298e23+_0x5be3f7(0x1cc),_0x3bceda),(_0x45b013||isBffAction(_0x36a2c1))&&adaptFunctionNameField(_0x36a2c1,_0x298e23,_0x3bceda);}adaptResources(_0x19cd56['resources'],_0x3f39c7+_0x5be3f7(0x1bf),_0x3bceda);}}function adaptBffTarget(_0x3c9348,_0x39942d,_0x3aea17){const _0x7dfa75=a60_0x4b53;if(!isObjectRecord(_0x3c9348)||_0x3c9348[_0x7dfa75(0x1ca)]!=='bff')return;adaptFunctionNameField(_0x3c9348,_0x39942d,_0x3aea17);}function a60_0x39cc(){const _0x14dc24=['isArray','bff','.resources','target','call','map','710SqsjOV','.scriptName','30770920XhkziS','bff.exec','object','trim','47516flHfhj','kind','3364IgRmZe','.target','633542hCfsWv','$.resources','prototype','248580qxGIbE','1356xwjrdu','hasOwnProperty','entries','scriptName','commands','push','error','string','$.commands[','10969512jbmOpA','actions','551862QDyNLb','functionName','fromEntries','action','105VwzWet','.actions.'];a60_0x39cc=function(){return _0x14dc24;};return a60_0x39cc();}function a60_0x4b53(_0x17b6b9,_0x5571e8){_0x17b6b9=_0x17b6b9-0x1be;const _0x39ccc0=a60_0x39cc();let _0x4b5317=_0x39ccc0[_0x17b6b9];return _0x4b5317;}function adaptFunctionNameField(_0x183e77,_0x5d0b4f,_0x13db7b){const _0xe60468=a60_0x4b53;Object['prototype'][_0xe60468(0x1d2)][_0xe60468(0x1c1)](_0x183e77,_0xe60468(0x1d4))&&_0x13db7b[_0xe60468(0x1d6)]({'level':_0xe60468(0x1d7),'path':_0x5d0b4f+_0xe60468(0x1c4),'message':'Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.'});if(Object[_0xe60468(0x1cf)][_0xe60468(0x1d2)]['call'](_0x183e77,_0xe60468(0x1dd))){if(typeof _0x183e77['functionName']!=='string'||!_0x183e77[_0xe60468(0x1dd)][_0xe60468(0x1c8)]()){_0x13db7b[_0xe60468(0x1d6)]({'level':_0xe60468(0x1d7),'path':_0x5d0b4f+'.functionName','message':'functionName\x20must\x20be\x20a\x20non-empty\x20string.'}),delete _0x183e77[_0xe60468(0x1dd)];return;}_0x183e77['scriptName']=_0x183e77[_0xe60468(0x1dd)],delete _0x183e77[_0xe60468(0x1dd)];}}function isBffAction(_0x2a4187){const _0x11dbe5=a60_0x4b53;return _0x2a4187[_0x11dbe5(0x1ca)]===_0x11dbe5(0x1be)||_0x2a4187[_0x11dbe5(0x1df)]===_0x11dbe5(0x1c6)||_0x2a4187[_0x11dbe5(0x1c0)]===_0x11dbe5(0x1c6);}function cloneJsonValue(_0x58301c){const _0x4d04e3=a60_0x4b53;if(Array[_0x4d04e3(0x1e2)](_0x58301c))return _0x58301c[_0x4d04e3(0x1c2)](_0x23a859=>cloneJsonValue(_0x23a859));if(isObjectRecord(_0x58301c))return Object[_0x4d04e3(0x1de)](Object['entries'](_0x58301c)[_0x4d04e3(0x1c2)](([_0x3c1441,_0x173832])=>[_0x3c1441,cloneJsonValue(_0x173832)]));return _0x58301c;}function isObjectRecord(_0x2ec829){const _0x5ec64a=a60_0x4b53;return Boolean(_0x2ec829)&&typeof _0x2ec829===_0x5ec64a(0x1c7)&&!Array[_0x5ec64a(0x1e2)](_0x2ec829);}
1
+ (function(_0x11a988,_0x5aaba4){const _0x1d70ce=a60_0x45d1,_0x52f556=_0x11a988();while(!![]){try{const _0x1546e3=parseInt(_0x1d70ce(0xbf))/0x1+-parseInt(_0x1d70ce(0xa9))/0x2*(parseInt(_0x1d70ce(0xa3))/0x3)+parseInt(_0x1d70ce(0xa1))/0x4+parseInt(_0x1d70ce(0xb1))/0x5*(parseInt(_0x1d70ce(0xbd))/0x6)+parseInt(_0x1d70ce(0xa4))/0x7+-parseInt(_0x1d70ce(0xaa))/0x8+parseInt(_0x1d70ce(0xc6))/0x9*(-parseInt(_0x1d70ce(0xb9))/0xa);if(_0x1546e3===_0x5aaba4)break;else _0x52f556['push'](_0x52f556['shift']());}catch(_0x2cf747){_0x52f556['push'](_0x52f556['shift']());}}}(a60_0x5c5c,0x9e0d9));export function adaptServiceTreeManifestForLegacyFramework(_0x4a1168){const _0x225db3=a60_0x45d1,_0x273890=cloneJsonValue(_0x4a1168),_0x1f38b3=[];if(!isObjectRecord(_0x273890))return{'manifest':_0x273890,'errors':_0x1f38b3};return Array[_0x225db3(0xc1)](_0x273890['commands'])&&_0x273890[_0x225db3(0xbc)][_0x225db3(0xab)]((_0x2b29db,_0x49261e)=>{const _0x5996d2=_0x225db3;if(!isObjectRecord(_0x2b29db))return;adaptBffTarget(_0x2b29db[_0x5996d2(0xb8)],'$.commands['+_0x49261e+_0x5996d2(0xa2),_0x1f38b3);}),adaptResources(_0x273890[_0x225db3(0xb4)],_0x225db3(0xae),_0x1f38b3),{'manifest':_0x273890,'errors':_0x1f38b3};}export function toPublicServiceTreeTarget(_0x45a635){const _0x2b78a7=a60_0x45d1,{scriptName:_0x295384,..._0x5bc363}=_0x45a635;return typeof _0x295384===_0x2b78a7(0xaf)&&_0x295384['trim']()&&(_0x5bc363[_0x2b78a7(0xb6)]=_0x295384),_0x5bc363;}export function toPublicNormalizedServiceTree(_0x5ef15a){const _0x441668=a60_0x45d1;return{..._0x5ef15a,'commands':_0x5ef15a[_0x441668(0xbc)][_0x441668(0xa5)](_0x332ef0=>({..._0x332ef0,'target':toPublicServiceTreeTarget(_0x332ef0[_0x441668(0xb8)])}))};}function a60_0x45d1(_0x32349f,_0x2be2ec){_0x32349f=_0x32349f-0xa1;const _0x5c5c5c=a60_0x5c5c();let _0x45d127=_0x5c5c5c[_0x32349f];return _0x45d127;}function adaptResources(_0x46cc60,_0x2a9aa3,_0x3460f4){const _0xfd32dd=a60_0x45d1;if(!isObjectRecord(_0x46cc60))return;for(const [_0x412196,_0x13cb45]of Object[_0xfd32dd(0xba)](_0x46cc60)){if(!isObjectRecord(_0x13cb45))continue;const _0xb6d3ff=_0x2a9aa3+'.'+_0x412196;if(isObjectRecord(_0x13cb45['actions']))for(const [_0x3b6a64,_0x364b4f]of Object[_0xfd32dd(0xba)](_0x13cb45[_0xfd32dd(0xc4)])){if(!isObjectRecord(_0x364b4f))continue;const _0x298336=_0xb6d3ff+_0xfd32dd(0xc5)+_0x3b6a64,_0xdd19ef=isObjectRecord(_0x364b4f['target'])&&_0x364b4f[_0xfd32dd(0xb8)][_0xfd32dd(0xb7)]===_0xfd32dd(0xc7);adaptBffTarget(_0x364b4f[_0xfd32dd(0xb8)],_0x298336+'.target',_0x3460f4),(_0xdd19ef||isBffAction(_0x364b4f))&&adaptFunctionNameField(_0x364b4f,_0x298336,_0x3460f4);}adaptResources(_0x13cb45['resources'],_0xb6d3ff+_0xfd32dd(0xbb),_0x3460f4);}}function a60_0x5c5c(){const _0xa3f927=['isArray','.functionName','hasOwnProperty','actions','.actions.','14475897XrHfJj','bff','4463416JPPBWW','].target','39XqQjTD','2104088NXfIeN','map','prototype','push','call','550TjRLnF','407544QmfRkL','forEach','object','error','$.resources','string','trim','45xylDIK','action','.scriptName','resources','bff.exec','functionName','kind','target','10IpGoDg','entries','.resources','commands','393726VPXCRq','scriptName','303309UZssfJ','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.'];a60_0x5c5c=function(){return _0xa3f927;};return a60_0x5c5c();}function adaptBffTarget(_0x1f9b43,_0x35fbb7,_0x2d7a3a){const _0x4ffa80=a60_0x45d1;if(!isObjectRecord(_0x1f9b43)||_0x1f9b43[_0x4ffa80(0xb7)]!==_0x4ffa80(0xc7))return;adaptFunctionNameField(_0x1f9b43,_0x35fbb7,_0x2d7a3a);}function adaptFunctionNameField(_0x46cc08,_0x14a237,_0x489860){const _0x103b0a=a60_0x45d1;Object[_0x103b0a(0xa6)]['hasOwnProperty'][_0x103b0a(0xa8)](_0x46cc08,_0x103b0a(0xbe))&&_0x489860[_0x103b0a(0xa7)]({'level':_0x103b0a(0xad),'path':_0x14a237+_0x103b0a(0xb3),'message':_0x103b0a(0xc0)});if(Object['prototype'][_0x103b0a(0xc3)]['call'](_0x46cc08,'functionName')){if(typeof _0x46cc08[_0x103b0a(0xb6)]!=='string'||!_0x46cc08[_0x103b0a(0xb6)][_0x103b0a(0xb0)]()){_0x489860[_0x103b0a(0xa7)]({'level':_0x103b0a(0xad),'path':_0x14a237+_0x103b0a(0xc2),'message':'functionName\x20must\x20be\x20a\x20non-empty\x20string.'}),delete _0x46cc08[_0x103b0a(0xb6)];return;}_0x46cc08['scriptName']=_0x46cc08[_0x103b0a(0xb6)],delete _0x46cc08['functionName'];}}function isBffAction(_0x24470c){const _0x3f6b2f=a60_0x45d1;return _0x24470c[_0x3f6b2f(0xb7)]===_0x3f6b2f(0xc7)||_0x24470c[_0x3f6b2f(0xb2)]===_0x3f6b2f(0xb5)||_0x24470c['target']===_0x3f6b2f(0xb5);}function cloneJsonValue(_0x3dca53){const _0x99d7dd=a60_0x45d1;if(Array[_0x99d7dd(0xc1)](_0x3dca53))return _0x3dca53[_0x99d7dd(0xa5)](_0x33c5e5=>cloneJsonValue(_0x33c5e5));if(isObjectRecord(_0x3dca53))return Object['fromEntries'](Object[_0x99d7dd(0xba)](_0x3dca53)[_0x99d7dd(0xa5)](([_0x386147,_0x36754d])=>[_0x386147,cloneJsonValue(_0x36754d)]));return _0x3dca53;}function isObjectRecord(_0x1cc517){const _0x38dbc1=a60_0x45d1;return Boolean(_0x1cc517)&&typeof _0x1cc517===_0x38dbc1(0xac)&&!Array[_0x38dbc1(0xc1)](_0x1cc517);}
@@ -1 +1 @@
1
- const a61_0x32084e=a61_0x3add;function a61_0x11d7(){const _0x3d1288=['7rxXguY','WRITE','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','detail','cliPath','commands','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','2aLtmor','warnings','Imported\x20','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','Removed\x20service\x20','Service\x20Tree\x20manifest\x20file\x20path','serviceCount','registryServiceCode','5MzACjw','required','Imported','validate','errors','export','从本地运行态注册表移除\x20Service\x20Tree\x20清单','8dkzqjC','serviceCode','length','Service\x20registry\x20validation\x20passed.','list','Service\x20manifest\x20validation\x20passed.','13205070bCSJgv','write','kind','read','14713722GTOhJG','\x20service(s).','manifests','\x20service\x20','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','risk','imported','9938247otTEnk','version','entry','updated','7213566nNvLHg','remove','entries','122068vcnJJj','description','\x20service(s),\x20updated\x20','replaced','2905236QQrfDm','3634182YJwRbH','target','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','file','filePath','registryPath','normalizedManifest','name','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','source','manifest','Local\x20service\x20code,\x20for\x20example\x20crm','Local\x20service\x20not\x20found:\x20','cliName','将\x20Service\x20Tree\x20清单导入本地运行态注册表','hash','map','report','Exported\x20service\x20','str','service'];a61_0x11d7=function(){return _0x3d1288;};return a61_0x11d7();}(function(_0x15d629,_0x22acfb){const _0x4005cf=a61_0x3add,_0x923838=_0x15d629();while(!![]){try{const _0x480b42=parseInt(_0x4005cf(0x1e0))/0x1*(parseInt(_0x4005cf(0x1b9))/0x2)+-parseInt(_0x4005cf(0x1e5))/0x3+-parseInt(_0x4005cf(0x1e4))/0x4*(parseInt(_0x4005cf(0x1c1))/0x5)+parseInt(_0x4005cf(0x1dd))/0x6*(-parseInt(_0x4005cf(0x1b1))/0x7)+parseInt(_0x4005cf(0x1c8))/0x8*(parseInt(_0x4005cf(0x1d2))/0x9)+parseInt(_0x4005cf(0x1ce))/0xa+parseInt(_0x4005cf(0x1d9))/0xb;if(_0x480b42===_0x22acfb)break;else _0x923838['push'](_0x923838['shift']());}catch(_0x15e832){_0x923838['push'](_0x923838['shift']());}}}(a61_0x11d7,0xcd4f2));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a61_0x3add(_0x1d612f,_0x222fb0){_0x1d612f=_0x1d612f-0x1ad;const _0x11d73a=a61_0x11d7();let _0x3addc4=_0x11d73a[_0x1d612f];return _0x3addc4;}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a61_0x32084e(0x1e8),'type':'string','required':!![],'description':a61_0x32084e(0x1be)},SERVICE_FLAG={'name':'service','type':'string','required':!![],'description':a61_0x32084e(0x1f1),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function summarizeService(_0x17688e){const _0x463997=a61_0x32084e;return{'serviceCode':_0x17688e[_0x463997(0x1c9)],'name':_0x17688e[_0x463997(0x1eb)][_0x463997(0x1b0)][_0x463997(0x1ec)],'version':_0x17688e[_0x463997(0x1da)],'importedAt':_0x17688e['importedAt'],'source':_0x17688e[_0x463997(0x1ef)],'commandCount':_0x17688e['normalizedManifest']['commands'][_0x463997(0x1ca)],'commands':_0x17688e['normalizedManifest'][_0x463997(0x1b6)][_0x463997(0x1f6)](_0x5b9cdf=>({'path':_0x5b9cdf[_0x463997(0x1b5)],'description':_0x5b9cdf[_0x463997(0x1e1)],'risk':_0x5b9cdf['risk'],'target':toPublicServiceTreeTarget(_0x5b9cdf[_0x463997(0x1e6)]),'flags':_0x5b9cdf['flags'][_0x463997(0x1f6)](_0x72f659=>({'name':_0x72f659[_0x463997(0x1ec)],'cliName':_0x72f659[_0x463997(0x1f3)],'type':_0x72f659['type'],'required':_0x72f659[_0x463997(0x1c2)]===!![]}))}))};}function summarizeLoadedManifest(_0x31aba3){const _0x3883e9=a61_0x32084e;return{'service':_0x31aba3[_0x3883e9(0x1eb)]?.[_0x3883e9(0x1b0)],'version':_0x31aba3['normalizedManifest']?.[_0x3883e9(0x1da)],'commandCount':_0x31aba3[_0x3883e9(0x1eb)]?.['commands'][_0x3883e9(0x1ca)]??0x0,'commands':_0x31aba3['normalizedManifest']?.[_0x3883e9(0x1b6)]['map'](_0x1908d4=>({'path':_0x1908d4['cliPath'],'risk':_0x1908d4['risk'],'target':toPublicServiceTreeTarget(_0x1908d4[_0x3883e9(0x1e6)])}))??[],'registryIndex':_0x31aba3['registryIndex'],'registryServiceCode':_0x31aba3[_0x3883e9(0x1c0)],'errors':_0x31aba3[_0x3883e9(0x1ad)]['errors'],'warnings':_0x31aba3[_0x3883e9(0x1ad)]['warnings']};}export const serviceDefinitions=[{'service':a61_0x32084e(0x1b0),'command':a61_0x32084e(0x1c4),'description':a61_0x32084e(0x1ed),'risk':a61_0x32084e(0x1d1),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x3d9d4c){const _0x37a302=a61_0x32084e,_0x194e17=loadServiceManifestFromFile(_0x3d9d4c[_0x37a302(0x1af)]('file'));if(!_0x194e17['report']['ok'])return{'ok':![],'data':{'file':_0x194e17['filePath'],'hash':_0x194e17[_0x37a302(0x1f5)],'kind':_0x194e17[_0x37a302(0x1d0)],'serviceCount':_0x194e17['manifests'][_0x37a302(0x1ca)],'services':_0x194e17['manifests']['map'](summarizeLoadedManifest),'errors':_0x194e17[_0x37a302(0x1ad)][_0x37a302(0x1c5)],'warnings':_0x194e17[_0x37a302(0x1ad)][_0x37a302(0x1ba)]},'message':formatValidationFailure(_0x194e17[_0x37a302(0x1ad)])};if(_0x194e17[_0x37a302(0x1d0)]==='registry'||_0x194e17[_0x37a302(0x1d4)][_0x37a302(0x1ca)]!==0x1)return{'ok':!![],'data':{'file':_0x194e17['filePath'],'hash':_0x194e17[_0x37a302(0x1f5)],'kind':_0x194e17['kind'],'serviceCount':_0x194e17[_0x37a302(0x1d4)][_0x37a302(0x1ca)],'commandCount':_0x194e17[_0x37a302(0x1d4)]['reduce']((_0x39a34e,_0x4d2a10)=>_0x39a34e+(_0x4d2a10[_0x37a302(0x1eb)]?.[_0x37a302(0x1b6)][_0x37a302(0x1ca)]??0x0),0x0),'services':_0x194e17[_0x37a302(0x1d4)][_0x37a302(0x1f6)](summarizeLoadedManifest),'warnings':_0x194e17[_0x37a302(0x1ad)]['warnings']},'message':_0x37a302(0x1cb)};return{'ok':!![],'data':{'file':_0x194e17['filePath'],'hash':_0x194e17['hash'],'kind':_0x194e17[_0x37a302(0x1d0)],'service':_0x194e17[_0x37a302(0x1eb)]?.[_0x37a302(0x1b0)],'version':_0x194e17[_0x37a302(0x1eb)]?.[_0x37a302(0x1da)],'commandCount':_0x194e17[_0x37a302(0x1eb)]?.[_0x37a302(0x1b6)]['length']??0x0,'commands':_0x194e17[_0x37a302(0x1eb)]?.[_0x37a302(0x1b6)]['map'](_0x55c491=>({'path':_0x55c491[_0x37a302(0x1b5)],'risk':_0x55c491[_0x37a302(0x1d7)],'target':toPublicServiceTreeTarget(_0x55c491[_0x37a302(0x1e6)])})),'warnings':_0x194e17[_0x37a302(0x1ad)][_0x37a302(0x1ba)]},'message':_0x37a302(0x1cd)};}},{'service':'service','command':'import','description':a61_0x32084e(0x1f4),'risk':'write','confirmationDescription':a61_0x32084e(0x1d6),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x2bbd16){const _0x56ec16=a61_0x32084e,_0x5f47de=loadServiceManifestFromFile(_0x2bbd16['str'](_0x56ec16(0x1e8)));return{'method':_0x56ec16(0x1b2),'url':getServiceRegistryPath(),'body':{'file':_0x5f47de[_0x56ec16(0x1e9)],'hash':_0x5f47de['hash'],'kind':_0x5f47de['kind'],'ok':_0x5f47de[_0x56ec16(0x1ad)]['ok'],'service':_0x5f47de[_0x56ec16(0x1eb)]?.[_0x56ec16(0x1b0)],'version':_0x5f47de[_0x56ec16(0x1eb)]?.[_0x56ec16(0x1da)],'serviceCount':_0x5f47de[_0x56ec16(0x1d4)][_0x56ec16(0x1ca)],'services':_0x5f47de[_0x56ec16(0x1d4)][_0x56ec16(0x1f6)](_0x4072e4=>({'service':_0x4072e4['normalizedManifest']?.[_0x56ec16(0x1b0)],'version':_0x4072e4[_0x56ec16(0x1eb)]?.[_0x56ec16(0x1da)],'commandCount':_0x4072e4[_0x56ec16(0x1eb)]?.[_0x56ec16(0x1b6)][_0x56ec16(0x1ca)]??0x0,'errors':_0x4072e4[_0x56ec16(0x1ad)][_0x56ec16(0x1c5)]})),'errors':_0x5f47de[_0x56ec16(0x1ad)][_0x56ec16(0x1c5)],'commandCount':_0x5f47de[_0x56ec16(0x1eb)]?.[_0x56ec16(0x1b6)]['length']??0x0},'description':_0x56ec16(0x1e7)};},async 'execute'(_0x5ac284){const _0x132f11=a61_0x32084e,_0xac3064=importServiceManifest(_0x5ac284[_0x132f11(0x1af)](_0x132f11(0x1e8)));if(_0xac3064['entries'][_0x132f11(0x1ca)]!==0x1)return{'ok':!![],'data':{'registryPath':_0xac3064[_0x132f11(0x1ea)],'imported':_0xac3064[_0x132f11(0x1d8)],'updated':_0xac3064[_0x132f11(0x1dc)],'serviceCount':_0xac3064[_0x132f11(0x1bf)],'services':_0xac3064[_0x132f11(0x1df)][_0x132f11(0x1f6)](summarizeService)},'message':_0x132f11(0x1bb)+_0xac3064[_0x132f11(0x1d8)]+_0x132f11(0x1e2)+_0xac3064[_0x132f11(0x1dc)]+_0x132f11(0x1d3)};return{'ok':!![],'data':{'registryPath':_0xac3064[_0x132f11(0x1ea)],'replaced':_0xac3064['replaced'],'imported':_0xac3064[_0x132f11(0x1d8)],'updated':_0xac3064[_0x132f11(0x1dc)],'serviceCount':_0xac3064[_0x132f11(0x1bf)],'service':summarizeService(_0xac3064[_0x132f11(0x1db)])},'message':(_0xac3064[_0x132f11(0x1e3)]?'Updated':_0x132f11(0x1c3))+_0x132f11(0x1d5)+_0xac3064['entry'][_0x132f11(0x1c9)]+'.'};}},{'service':a61_0x32084e(0x1b0),'command':a61_0x32084e(0x1c6),'description':'将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','risk':a61_0x32084e(0x1cf),'confirmationDescription':a61_0x32084e(0x1bc),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x42197a){const _0x1f5d52=a61_0x32084e,_0x27b1bb=getLocalServiceEntry(_0x42197a[_0x1f5d52(0x1af)](_0x1f5d52(0x1b0)));return{'method':_0x1f5d52(0x1b2),'url':_0x42197a[_0x1f5d52(0x1af)]('file'),'body':{'service':_0x42197a[_0x1f5d52(0x1af)](_0x1f5d52(0x1b0)),'found':Boolean(_0x27b1bb),'version':_0x27b1bb?.[_0x1f5d52(0x1da)],'source':_0x27b1bb?.['source']},'description':_0x1f5d52(0x1ee)};},async 'execute'(_0x30accd){const _0x533f56=a61_0x32084e,_0x281fc0=exportServiceManifest(_0x30accd[_0x533f56(0x1af)](_0x533f56(0x1b0)),_0x30accd['str'](_0x533f56(0x1e8)));return{'ok':!![],'data':{'registryPath':_0x281fc0[_0x533f56(0x1ea)],'file':_0x281fc0['filePath'],'service':summarizeService(_0x281fc0[_0x533f56(0x1db)])},'message':_0x533f56(0x1ae)+_0x281fc0['entry'][_0x533f56(0x1c9)]+'.'};}},{'service':a61_0x32084e(0x1b0),'command':a61_0x32084e(0x1cc),'description':a61_0x32084e(0x1b3),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x29a257=a61_0x32084e,_0x5d6f13=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x5d6f13[_0x29a257(0x1ca)],'services':_0x5d6f13['map'](summarizeService)}};}},{'service':a61_0x32084e(0x1b0),'command':a61_0x32084e(0x1de),'description':a61_0x32084e(0x1c7),'risk':a61_0x32084e(0x1cf),'confirmationDescription':a61_0x32084e(0x1b7),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x51f872){const _0x3454a5=a61_0x32084e,_0x82c9c0=getLocalServiceEntry(_0x51f872[_0x3454a5(0x1af)](_0x3454a5(0x1b0)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x51f872[_0x3454a5(0x1af)](_0x3454a5(0x1b0)),'found':Boolean(_0x82c9c0),'version':_0x82c9c0?.[_0x3454a5(0x1da)],'source':_0x82c9c0?.[_0x3454a5(0x1ef)]},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x1eb630){const _0x59c160=a61_0x32084e,_0x3f3d20=removeServiceManifest(_0x1eb630[_0x59c160(0x1af)](_0x59c160(0x1b0)));return{'ok':!![],'data':{'registryPath':_0x3f3d20[_0x59c160(0x1ea)],'serviceCount':_0x3f3d20[_0x59c160(0x1bf)],'service':summarizeService(_0x3f3d20[_0x59c160(0x1db)])},'message':_0x59c160(0x1bd)+_0x3f3d20[_0x59c160(0x1db)]['serviceCode']+'.'};}},{'service':'service','command':a61_0x32084e(0x1b4),'description':a61_0x32084e(0x1b8),'risk':a61_0x32084e(0x1d1),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x413fa1){const _0x55b1ec=a61_0x32084e,_0x594c79=getLocalServiceEntry(_0x413fa1[_0x55b1ec(0x1af)]('service'));if(!_0x594c79)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x413fa1[_0x55b1ec(0x1af)](_0x55b1ec(0x1b0))},'message':_0x55b1ec(0x1f2)+_0x413fa1[_0x55b1ec(0x1af)](_0x55b1ec(0x1b0))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x594c79),'manifest':_0x594c79[_0x55b1ec(0x1f0)],'normalizedManifest':toPublicNormalizedServiceTree(_0x594c79[_0x55b1ec(0x1eb)])}};}}];
1
+ const a61_0x46c72b=a61_0x512a;(function(_0x3222c5,_0x373571){const _0x9a5e54=a61_0x512a,_0x55646c=_0x3222c5();while(!![]){try{const _0x2703f5=-parseInt(_0x9a5e54(0xa0))/0x1+-parseInt(_0x9a5e54(0x71))/0x2+-parseInt(_0x9a5e54(0x90))/0x3+parseInt(_0x9a5e54(0xaa))/0x4+parseInt(_0x9a5e54(0xa1))/0x5+-parseInt(_0x9a5e54(0x7b))/0x6+parseInt(_0x9a5e54(0x73))/0x7*(parseInt(_0x9a5e54(0x7d))/0x8);if(_0x2703f5===_0x373571)break;else _0x55646c['push'](_0x55646c['shift']());}catch(_0x5c0294){_0x55646c['push'](_0x55646c['shift']());}}}(a61_0xafbc,0x6bf99));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 a61_0x512a(_0xefb9f5,_0x2f3520){_0xefb9f5=_0xefb9f5-0x6c;const _0xafbc9a=a61_0xafbc();let _0x512a45=_0xafbc9a[_0xefb9f5];return _0x512a45;}function a61_0xafbc(){const _0x10e4f5=['warnings','serviceCount','registryPath','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','1405275dRomeE','updated','imported','Service\x20manifest\x20validation\x20passed.','source','manifest','service','commands','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','\x20service(s).','target','string','map','hash','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','Service\x20Tree\x20manifest\x20file\x20path','457744JfgLps','800445vcuICJ','manifests','WRITE','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','type','serviceCode','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','registryServiceCode','从本地运行态注册表移除\x20Service\x20Tree\x20清单','2146808ZlRdBn','import','length','将\x20Service\x20Tree\x20清单导入本地运行态注册表','errors','Imported\x20','importedAt','lower\x20kebab-case\x20service\x20code','flags','Local\x20service\x20not\x20found:\x20','normalizedManifest','detail','Imported','entries','reduce','kind','cliPath','version','Updated','\x20service\x20','512026BRzRjP','\x20service(s),\x20updated\x20','203KFLtbb','replaced','risk','required','write','name','registry','read','2226132sONRtX','cliName','358256KgjBdV','export','filePath','entry','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','validate','registryIndex','remove','Removed\x20service\x20','Exported\x20service\x20','report','Service\x20registry\x20validation\x20passed.','str','list','file'];a61_0xafbc=function(){return _0x10e4f5;};return a61_0xafbc();}const FILE_FLAG={'name':a61_0x46c72b(0x8b),'type':a61_0x46c72b(0x9b),'required':!![],'description':a61_0x46c72b(0x9f)},SERVICE_FLAG={'name':'service','type':a61_0x46c72b(0x9b),'required':!![],'description':'Local\x20service\x20code,\x20for\x20example\x20crm','pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a61_0x46c72b(0xb1)}};function summarizeService(_0x31421c){const _0x3ed32d=a61_0x46c72b;return{'serviceCode':_0x31421c[_0x3ed32d(0xa6)],'name':_0x31421c[_0x3ed32d(0xb4)][_0x3ed32d(0x96)][_0x3ed32d(0x78)],'version':_0x31421c[_0x3ed32d(0x6e)],'importedAt':_0x31421c[_0x3ed32d(0xb0)],'source':_0x31421c['source'],'commandCount':_0x31421c['normalizedManifest']['commands'][_0x3ed32d(0xac)],'commands':_0x31421c[_0x3ed32d(0xb4)]['commands']['map'](_0x22c963=>({'path':_0x22c963[_0x3ed32d(0x6d)],'description':_0x22c963['description'],'risk':_0x22c963[_0x3ed32d(0x75)],'target':toPublicServiceTreeTarget(_0x22c963['target']),'flags':_0x22c963[_0x3ed32d(0xb2)]['map'](_0x7fbcea=>({'name':_0x7fbcea[_0x3ed32d(0x78)],'cliName':_0x7fbcea[_0x3ed32d(0x7c)],'type':_0x7fbcea[_0x3ed32d(0xa5)],'required':_0x7fbcea[_0x3ed32d(0x76)]===!![]}))}))};}function summarizeLoadedManifest(_0x20841a){const _0x575833=a61_0x46c72b;return{'service':_0x20841a[_0x575833(0xb4)]?.[_0x575833(0x96)],'version':_0x20841a['normalizedManifest']?.[_0x575833(0x6e)],'commandCount':_0x20841a[_0x575833(0xb4)]?.[_0x575833(0x97)][_0x575833(0xac)]??0x0,'commands':_0x20841a[_0x575833(0xb4)]?.['commands'][_0x575833(0x9c)](_0x325386=>({'path':_0x325386[_0x575833(0x6d)],'risk':_0x325386[_0x575833(0x75)],'target':toPublicServiceTreeTarget(_0x325386[_0x575833(0x9a)])}))??[],'registryIndex':_0x20841a[_0x575833(0x83)],'registryServiceCode':_0x20841a[_0x575833(0xa8)],'errors':_0x20841a[_0x575833(0x87)][_0x575833(0xae)],'warnings':_0x20841a['report'][_0x575833(0x8c)]};}export const serviceDefinitions=[{'service':'service','command':a61_0x46c72b(0x82),'description':a61_0x46c72b(0x81),'risk':a61_0x46c72b(0x7a),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x5be662){const _0x36569e=a61_0x46c72b,_0x4ae879=loadServiceManifestFromFile(_0x5be662[_0x36569e(0x89)]('file'));if(!_0x4ae879['report']['ok'])return{'ok':![],'data':{'file':_0x4ae879['filePath'],'hash':_0x4ae879[_0x36569e(0x9d)],'kind':_0x4ae879['kind'],'serviceCount':_0x4ae879['manifests']['length'],'services':_0x4ae879[_0x36569e(0xa2)][_0x36569e(0x9c)](summarizeLoadedManifest),'errors':_0x4ae879[_0x36569e(0x87)][_0x36569e(0xae)],'warnings':_0x4ae879['report'][_0x36569e(0x8c)]},'message':formatValidationFailure(_0x4ae879[_0x36569e(0x87)])};if(_0x4ae879['kind']===_0x36569e(0x79)||_0x4ae879[_0x36569e(0xa2)][_0x36569e(0xac)]!==0x1)return{'ok':!![],'data':{'file':_0x4ae879[_0x36569e(0x7f)],'hash':_0x4ae879[_0x36569e(0x9d)],'kind':_0x4ae879[_0x36569e(0x6c)],'serviceCount':_0x4ae879['manifests'][_0x36569e(0xac)],'commandCount':_0x4ae879[_0x36569e(0xa2)][_0x36569e(0xb8)]((_0x2a28b7,_0x452a03)=>_0x2a28b7+(_0x452a03['normalizedManifest']?.[_0x36569e(0x97)][_0x36569e(0xac)]??0x0),0x0),'services':_0x4ae879['manifests'][_0x36569e(0x9c)](summarizeLoadedManifest),'warnings':_0x4ae879['report'][_0x36569e(0x8c)]},'message':_0x36569e(0x88)};return{'ok':!![],'data':{'file':_0x4ae879['filePath'],'hash':_0x4ae879['hash'],'kind':_0x4ae879['kind'],'service':_0x4ae879[_0x36569e(0xb4)]?.[_0x36569e(0x96)],'version':_0x4ae879[_0x36569e(0xb4)]?.[_0x36569e(0x6e)],'commandCount':_0x4ae879['normalizedManifest']?.[_0x36569e(0x97)]['length']??0x0,'commands':_0x4ae879['normalizedManifest']?.['commands'][_0x36569e(0x9c)](_0x173784=>({'path':_0x173784[_0x36569e(0x6d)],'risk':_0x173784[_0x36569e(0x75)],'target':toPublicServiceTreeTarget(_0x173784[_0x36569e(0x9a)])})),'warnings':_0x4ae879['report'][_0x36569e(0x8c)]},'message':_0x36569e(0x93)};}},{'service':a61_0x46c72b(0x96),'command':a61_0x46c72b(0xab),'description':a61_0x46c72b(0xad),'risk':a61_0x46c72b(0x77),'confirmationDescription':a61_0x46c72b(0xa4),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x2aad4d){const _0x38ce8a=a61_0x46c72b,_0x3afc90=loadServiceManifestFromFile(_0x2aad4d['str'](_0x38ce8a(0x8b)));return{'method':_0x38ce8a(0xa3),'url':getServiceRegistryPath(),'body':{'file':_0x3afc90[_0x38ce8a(0x7f)],'hash':_0x3afc90[_0x38ce8a(0x9d)],'kind':_0x3afc90[_0x38ce8a(0x6c)],'ok':_0x3afc90[_0x38ce8a(0x87)]['ok'],'service':_0x3afc90[_0x38ce8a(0xb4)]?.[_0x38ce8a(0x96)],'version':_0x3afc90[_0x38ce8a(0xb4)]?.[_0x38ce8a(0x6e)],'serviceCount':_0x3afc90[_0x38ce8a(0xa2)][_0x38ce8a(0xac)],'services':_0x3afc90[_0x38ce8a(0xa2)][_0x38ce8a(0x9c)](_0x4e7359=>({'service':_0x4e7359[_0x38ce8a(0xb4)]?.[_0x38ce8a(0x96)],'version':_0x4e7359[_0x38ce8a(0xb4)]?.[_0x38ce8a(0x6e)],'commandCount':_0x4e7359['normalizedManifest']?.[_0x38ce8a(0x97)][_0x38ce8a(0xac)]??0x0,'errors':_0x4e7359[_0x38ce8a(0x87)][_0x38ce8a(0xae)]})),'errors':_0x3afc90[_0x38ce8a(0x87)][_0x38ce8a(0xae)],'commandCount':_0x3afc90[_0x38ce8a(0xb4)]?.[_0x38ce8a(0x97)][_0x38ce8a(0xac)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x4d4f41){const _0x4402ed=a61_0x46c72b,_0x2891b6=importServiceManifest(_0x4d4f41[_0x4402ed(0x89)](_0x4402ed(0x8b)));if(_0x2891b6['entries'][_0x4402ed(0xac)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x2891b6[_0x4402ed(0x8e)],'imported':_0x2891b6[_0x4402ed(0x92)],'updated':_0x2891b6[_0x4402ed(0x91)],'serviceCount':_0x2891b6['serviceCount'],'services':_0x2891b6[_0x4402ed(0xb7)][_0x4402ed(0x9c)](summarizeService)},'message':_0x4402ed(0xaf)+_0x2891b6[_0x4402ed(0x92)]+_0x4402ed(0x72)+_0x2891b6[_0x4402ed(0x91)]+_0x4402ed(0x99)};return{'ok':!![],'data':{'registryPath':_0x2891b6[_0x4402ed(0x8e)],'replaced':_0x2891b6[_0x4402ed(0x74)],'imported':_0x2891b6['imported'],'updated':_0x2891b6[_0x4402ed(0x91)],'serviceCount':_0x2891b6[_0x4402ed(0x8d)],'service':summarizeService(_0x2891b6[_0x4402ed(0x80)])},'message':(_0x2891b6[_0x4402ed(0x74)]?_0x4402ed(0x6f):_0x4402ed(0xb6))+_0x4402ed(0x70)+_0x2891b6['entry'][_0x4402ed(0xa6)]+'.'};}},{'service':a61_0x46c72b(0x96),'command':a61_0x46c72b(0x7e),'description':a61_0x46c72b(0x9e),'risk':'write','confirmationDescription':a61_0x46c72b(0x8f),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x35b733){const _0x5673ca=a61_0x46c72b,_0x214141=getLocalServiceEntry(_0x35b733['str']('service'));return{'method':'WRITE','url':_0x35b733[_0x5673ca(0x89)]('file'),'body':{'service':_0x35b733['str'](_0x5673ca(0x96)),'found':Boolean(_0x214141),'version':_0x214141?.['version'],'source':_0x214141?.[_0x5673ca(0x94)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x2e92c4){const _0x24d85d=a61_0x46c72b,_0x32f671=exportServiceManifest(_0x2e92c4[_0x24d85d(0x89)]('service'),_0x2e92c4['str'](_0x24d85d(0x8b)));return{'ok':!![],'data':{'registryPath':_0x32f671[_0x24d85d(0x8e)],'file':_0x32f671[_0x24d85d(0x7f)],'service':summarizeService(_0x32f671[_0x24d85d(0x80)])},'message':_0x24d85d(0x86)+_0x32f671['entry']['serviceCode']+'.'};}},{'service':a61_0x46c72b(0x96),'command':a61_0x46c72b(0x8a),'description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':a61_0x46c72b(0x7a),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x5d21e8=a61_0x46c72b,_0xe1de29=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0xe1de29[_0x5d21e8(0xac)],'services':_0xe1de29[_0x5d21e8(0x9c)](summarizeService)}};}},{'service':a61_0x46c72b(0x96),'command':a61_0x46c72b(0x84),'description':a61_0x46c72b(0xa9),'risk':a61_0x46c72b(0x77),'confirmationDescription':'将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x411223){const _0x50dc05=a61_0x46c72b,_0x437863=getLocalServiceEntry(_0x411223[_0x50dc05(0x89)](_0x50dc05(0x96)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x411223[_0x50dc05(0x89)](_0x50dc05(0x96)),'found':Boolean(_0x437863),'version':_0x437863?.['version'],'source':_0x437863?.[_0x50dc05(0x94)]},'description':_0x50dc05(0xa7)};},async 'execute'(_0x19c13a){const _0x20c255=a61_0x46c72b,_0xd10bb1=removeServiceManifest(_0x19c13a[_0x20c255(0x89)](_0x20c255(0x96)));return{'ok':!![],'data':{'registryPath':_0xd10bb1[_0x20c255(0x8e)],'serviceCount':_0xd10bb1[_0x20c255(0x8d)],'service':summarizeService(_0xd10bb1['entry'])},'message':_0x20c255(0x85)+_0xd10bb1[_0x20c255(0x80)][_0x20c255(0xa6)]+'.'};}},{'service':a61_0x46c72b(0x96),'command':a61_0x46c72b(0xb5),'description':a61_0x46c72b(0x98),'risk':a61_0x46c72b(0x7a),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x376cc3){const _0x547edb=a61_0x46c72b,_0x201e54=getLocalServiceEntry(_0x376cc3['str'](_0x547edb(0x96)));if(!_0x201e54)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x376cc3[_0x547edb(0x89)]('service')},'message':_0x547edb(0xb3)+_0x376cc3[_0x547edb(0x89)](_0x547edb(0x96))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x201e54),'manifest':_0x201e54[_0x547edb(0x95)],'normalizedManifest':toPublicNormalizedServiceTree(_0x201e54['normalizedManifest'])}};}}];
@@ -1 +1 @@
1
- const a62_0x4371ec=a62_0xb9ba;(function(_0x3b954e,_0x429ee3){const _0x413261=a62_0xb9ba,_0x47a972=_0x3b954e();while(!![]){try{const _0x18a8f0=parseInt(_0x413261(0x1b9))/0x1+-parseInt(_0x413261(0x1be))/0x2+parseInt(_0x413261(0x1ea))/0x3*(-parseInt(_0x413261(0x1b5))/0x4)+parseInt(_0x413261(0x1e7))/0x5+-parseInt(_0x413261(0x1c2))/0x6*(parseInt(_0x413261(0x1c1))/0x7)+-parseInt(_0x413261(0x1b4))/0x8+-parseInt(_0x413261(0x1f2))/0x9*(-parseInt(_0x413261(0x1eb))/0xa);if(_0x18a8f0===_0x429ee3)break;else _0x47a972['push'](_0x47a972['shift']());}catch(_0xf2e932){_0x47a972['push'](_0x47a972['shift']());}}}(a62_0x2f75,0xe1d2d));function a62_0x2f75(){const _0x57fc25=['validation','report','version','length','flatMap','toISOString','117sDyOgs','$.services[','Invalid\x20service\x20registry\x20JSON:\x20','].manifest','message','Service\x20manifest\x20file\x20not\x20found:\x20','splice','services','parse','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','manifests','map','service','command','find','Unsupported\x20service\x20registry\x20schemaVersion:\x20','Cannot\x20write\x20service\x20registry:\x20','homeDirName','11507368HhivSL','28232LelMoL','slice','description','updatedAt','459974lLiDzf','commandCount','ENOENT','name','warnings','1052304LQEJkk','push','trim','7pPKGAT','1435578GItySL','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','startsWith','Service\x20manifest\x20validation\x20failed:\x0a','sha256','.tmp','utf8','manifest','invalid','errors','now','serviceCode','Local\x20service\x20not\x20found:\x20','code','schemaVersion','path','].manifest.','Remove\x20or\x20migrate\x20','sort','hex','digest','registryIndex','missing','importedAt','bff\x20target\x20requires\x20functionName.','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','service.json','localeCompare','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','object','string','empty','stringify','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','normalizedManifest','reduce','isArray','2423480qGXnku','filePath','homeDir','222bBKzkm','2081870CybMBD'];a62_0x2f75=function(){return _0x57fc25;};return a62_0x2f75();}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=a62_0x4371ec(0x1dc);export function getServiceRegistryPath(_0x193461={}){const _0x214265=a62_0x4371ec;return resolve(_0x193461[_0x214265(0x1e9)]??homedir(),PRODUCT_CONFIG[_0x214265(0x1b3)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x5c184a={}){const _0x32c37f=a62_0x4371ec,_0x5654ef=getServiceRegistryPath(_0x5c184a);if(!existsSync(_0x5654ef))return emptyServiceRegistry();try{const _0x2fbf10=readFileSync(_0x5654ef,_0x32c37f(0x1c8));if(!_0x2fbf10[_0x32c37f(0x1c0)]())return emptyServiceRegistry();const _0x14b177=JSON[_0x32c37f(0x1aa)](_0x2fbf10);if(_0x14b177[_0x32c37f(0x1d0)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x32c37f(0x1ec)](_0x32c37f(0x1b1)+String(_0x14b177[_0x32c37f(0x1d0)]),_0x32c37f(0x1d3)+_0x5654ef+'.');if(!Array[_0x32c37f(0x1e6)](_0x14b177[_0x32c37f(0x1a9)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x14b177[_0x32c37f(0x1b8)],'services':_0x14b177['services']};}catch(_0x77542){if(_0x77542 instanceof Error&&_0x77542[_0x32c37f(0x1bc)]==='CliError')throw _0x77542;throw CliErrors['validation'](_0x32c37f(0x1a4)+_0x5654ef,_0x32c37f(0x1de));}}export function writeServiceRegistry(_0x48709d,_0x421ff4={}){const _0x2ac495=a62_0x4371ec,_0x47ca80=getServiceRegistryPath(_0x421ff4),_0xf6c20=dirname(_0x47ca80);!existsSync(_0xf6c20)&&mkdirSync(_0xf6c20,{'recursive':!![]});const _0x15c9f4=_0x47ca80+_0x2ac495(0x1c7);try{writeFileSync(_0x15c9f4,JSON[_0x2ac495(0x1e2)](_0x48709d,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x15c9f4,_0x47ca80);}catch(_0x3b4719){try{unlinkSync(_0x15c9f4);}catch{}if(_0x3b4719?.[_0x2ac495(0x1cf)]===_0x2ac495(0x1bb))throw CliErrors['validation'](_0x2ac495(0x1b2)+_0x47ca80);throw _0x3b4719;}return _0x47ca80;}export function loadServiceManifestFromFile(_0x1f64cd){const _0x267a2f=a62_0x4371ec,_0x41d248=resolve(_0x1f64cd);if(!existsSync(_0x41d248))throw CliErrors[_0x267a2f(0x1ec)](_0x267a2f(0x1a7)+_0x1f64cd);let _0x19c208;const _0x4fcb7d=readFileSync(_0x41d248,_0x267a2f(0x1c8));try{_0x19c208=JSON[_0x267a2f(0x1aa)](_0x4fcb7d);}catch{throw CliErrors[_0x267a2f(0x1ec)]('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x1f64cd,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x133c74=sha256(_0x4fcb7d),_0x3d828f=extractLoadedServiceManifests(_0x19c208,_0x133c74),_0x3591a0=aggregateValidationReports(_0x3d828f),_0x2d95b5=_0x3d828f[0x0];return{'filePath':_0x41d248,'hash':_0x133c74,'kind':isServiceRegistryLike(_0x19c208)?'registry':_0x267a2f(0x1c9),'manifest':_0x2d95b5?.[_0x267a2f(0x1c9)]??_0x19c208,'report':_0x3591a0,'normalizedManifest':_0x3d828f[_0x267a2f(0x1ef)]===0x1?_0x2d95b5?.['normalizedManifest']:undefined,'manifests':_0x3d828f};}export function importServiceManifest(_0x1e94a8,_0x51c6a7={}){const _0x7c4cc9=a62_0x4371ec,_0x10b352=loadServiceManifestFromFile(_0x1e94a8);if(!_0x10b352[_0x7c4cc9(0x1ed)]['ok'])throw CliErrors[_0x7c4cc9(0x1ec)](formatValidationFailure(_0x10b352[_0x7c4cc9(0x1ed)]),_0x7c4cc9(0x1c3));if(_0x10b352[_0x7c4cc9(0x1ac)][_0x7c4cc9(0x1ef)]===0x0)throw CliErrors[_0x7c4cc9(0x1ec)](_0x7c4cc9(0x1ab),_0x7c4cc9(0x1db));const _0x34e126=readServiceRegistry(_0x51c6a7),_0x333a0c=(_0x51c6a7[_0x7c4cc9(0x1cc)]??(()=>new Date()))()[_0x7c4cc9(0x1f1)](),_0x4e3fb1=[];let _0x4d559d=0x0,_0x18d59b=0x0;for(const _0x39239e of _0x10b352[_0x7c4cc9(0x1ac)]){if(!_0x39239e[_0x7c4cc9(0x1e4)])continue;const _0x395c42=_0x39239e[_0x7c4cc9(0x1e4)][_0x7c4cc9(0x1ae)][_0x7c4cc9(0x1cf)],_0x3e043d={'serviceCode':_0x395c42,'version':_0x39239e[_0x7c4cc9(0x1e4)][_0x7c4cc9(0x1ee)],'importedAt':_0x333a0c,'source':{'type':'file','path':_0x10b352[_0x7c4cc9(0x1e8)],'hash':_0x39239e['sourceHash']},'manifest':_0x39239e['manifest'],'normalizedManifest':_0x39239e[_0x7c4cc9(0x1e4)]},_0x47a2ee=_0x34e126[_0x7c4cc9(0x1a9)]['findIndex'](_0x3169f8=>_0x3169f8['serviceCode']===_0x395c42);_0x47a2ee>=0x0?(_0x34e126[_0x7c4cc9(0x1a9)][_0x47a2ee]=_0x3e043d,_0x18d59b++):(_0x34e126['services'][_0x7c4cc9(0x1bf)](_0x3e043d),_0x4d559d++),_0x4e3fb1[_0x7c4cc9(0x1bf)](_0x3e043d);}_0x34e126[_0x7c4cc9(0x1a9)][_0x7c4cc9(0x1d4)]((_0x1cba94,_0x5013ca)=>_0x1cba94[_0x7c4cc9(0x1cd)][_0x7c4cc9(0x1dd)](_0x5013ca[_0x7c4cc9(0x1cd)])),_0x34e126[_0x7c4cc9(0x1b8)]=_0x333a0c;const _0x385766=writeServiceRegistry(_0x34e126,_0x51c6a7);return{'registryPath':_0x385766,'entry':_0x4e3fb1[0x0],'replaced':_0x4e3fb1[_0x7c4cc9(0x1ef)]===0x1?_0x18d59b===0x1:_0x18d59b>0x0,'entries':_0x4e3fb1,'imported':_0x4d559d,'updated':_0x18d59b,'serviceCount':_0x34e126['services'][_0x7c4cc9(0x1ef)]};}export function exportServiceManifest(_0x1a7df0,_0x4bf072,_0x3f5621={}){const _0x27c614=a62_0x4371ec,_0x533ae0=getServiceRegistryPath(_0x3f5621),_0x4c81d8=getLocalServiceEntry(_0x1a7df0,_0x3f5621);if(!_0x4c81d8)throw CliErrors[_0x27c614(0x1ec)]('Local\x20service\x20not\x20found:\x20'+_0x1a7df0,_0x27c614(0x1e3));const _0x14df6d=resolve(_0x4bf072),_0x167fde=dirname(_0x14df6d);return!existsSync(_0x167fde)&&mkdirSync(_0x167fde,{'recursive':!![]}),writeFileSync(_0x14df6d,JSON[_0x27c614(0x1e2)](_0x4c81d8[_0x27c614(0x1c9)],null,0x2)+'\x0a',{'encoding':_0x27c614(0x1c8),'mode':0x180}),{'registryPath':_0x533ae0,'filePath':_0x14df6d,'entry':_0x4c81d8};}export function removeServiceManifest(_0x21c274,_0x1e5bf8={}){const _0x5c5191=a62_0x4371ec,_0x37dda6=readServiceRegistry(_0x1e5bf8),_0x59d86d=_0x21c274['trim'](),_0x29d8a4=_0x37dda6[_0x5c5191(0x1a9)]['findIndex'](_0x5c8902=>_0x5c8902['serviceCode']===_0x59d86d);if(_0x29d8a4<0x0)throw CliErrors[_0x5c5191(0x1ec)](_0x5c5191(0x1ce)+_0x59d86d,_0x5c5191(0x1e3));const [_0x7d93b4]=_0x37dda6[_0x5c5191(0x1a9)][_0x5c5191(0x1a8)](_0x29d8a4,0x1),_0x3e7577=(_0x1e5bf8[_0x5c5191(0x1cc)]??(()=>new Date()))()[_0x5c5191(0x1f1)]();_0x37dda6['updatedAt']=_0x3e7577;const _0x5ac822=writeServiceRegistry(_0x37dda6,_0x1e5bf8);return{'registryPath':_0x5ac822,'entry':_0x7d93b4,'serviceCount':_0x37dda6[_0x5c5191(0x1a9)][_0x5c5191(0x1ef)]};}export function listLocalServices(_0x209b58={}){const _0x5517cb=a62_0x4371ec;return readServiceRegistry(_0x209b58)[_0x5517cb(0x1a9)];}export function getLocalServiceEntry(_0x56f2ad,_0x2df5f2={}){const _0x44b726=a62_0x4371ec;return readServiceRegistry(_0x2df5f2)[_0x44b726(0x1a9)][_0x44b726(0x1b0)](_0x457d52=>_0x457d52[_0x44b726(0x1cd)]===_0x56f2ad[_0x44b726(0x1c0)]());}export function listLocalServiceTrees(_0x17e0c8={}){const _0xa3edc9=a62_0x4371ec;return readServiceRegistry(_0x17e0c8)[_0xa3edc9(0x1a9)][_0xa3edc9(0x1ad)](_0x25625f=>_0x25625f[_0xa3edc9(0x1e4)]);}export function inspectServiceRegistry(_0x3310b5={}){const _0x1981c5=a62_0x4371ec,_0x157f9f=getServiceRegistryPath(_0x3310b5);if(!existsSync(_0x157f9f))return emptyServiceRegistryInspection(_0x157f9f,_0x1981c5(0x1d8),![]);try{const _0x138a84=readFileSync(_0x157f9f,'utf8');if(!_0x138a84[_0x1981c5(0x1c0)]())return emptyServiceRegistryInspection(_0x157f9f,_0x1981c5(0x1e1),!![]);const _0x109870=JSON[_0x1981c5(0x1aa)](_0x138a84);if(_0x109870['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x157f9f,_0x1981c5(0x1ca),!![]),'schemaVersion':_0x109870[_0x1981c5(0x1d0)],'message':'Unsupported\x20schemaVersion:\x20'+String(_0x109870[_0x1981c5(0x1d0)])};if(!Array['isArray'](_0x109870[_0x1981c5(0x1a9)]))return{...emptyServiceRegistryInspection(_0x157f9f,_0x1981c5(0x1ca),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x109870[_0x1981c5(0x1b8)],'message':'services\x20must\x20be\x20an\x20array'};const _0x58dd45=_0x109870['services'][_0x1981c5(0x1ad)](summarizeLocalServiceEntry);return{'registryPath':_0x157f9f,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x109870[_0x1981c5(0x1b8)],'serviceCount':_0x58dd45['length'],'commandCount':_0x58dd45[_0x1981c5(0x1e5)]((_0x338f9a,_0x465af4)=>_0x338f9a+_0x465af4[_0x1981c5(0x1ba)],0x0),'services':_0x58dd45};}catch(_0x3be9cb){return{...emptyServiceRegistryInspection(_0x157f9f,_0x1981c5(0x1ca),!![]),'message':_0x3be9cb instanceof Error?_0x3be9cb[_0x1981c5(0x1a6)]:String(_0x3be9cb)};}}export function formatValidationFailure(_0x1fa23b){const _0xb87149=a62_0x4371ec,_0x1988cf=_0x1fa23b[_0xb87149(0x1cb)][_0xb87149(0x1ad)](_0x24374a=>_0x24374a[_0xb87149(0x1d1)]+':\x20'+_0x24374a[_0xb87149(0x1a6)]);return _0xb87149(0x1c5)+_0x1988cf['join']('\x0a');}function a62_0xb9ba(_0x2dcea3,_0x5d9d37){_0x2dcea3=_0x2dcea3-0x1a4;const _0x2f751c=a62_0x2f75();let _0xb9bab2=_0x2f751c[_0x2dcea3];return _0xb9bab2;}function extractLoadedServiceManifests(_0x32de52,_0x231e2b){const _0x242b0b=a62_0x4371ec;if(!isServiceRegistryLike(_0x32de52)){const _0x32a6d6=_0x32de52,{manifest:_0x1e3c02,errors:_0x46e5c8}=adaptServiceTreeManifestForLegacyFramework(_0x32a6d6),_0x5e7e31=validateServiceTreeManifest(_0x1e3c02),_0x2259c6=mergeValidationErrors(_0x5e7e31,_0x46e5c8);return[{'manifest':_0x32a6d6,'report':_0x2259c6,'normalizedManifest':_0x2259c6['ok']?normalizeServiceTreeManifest(_0x1e3c02):undefined,'sourceHash':_0x231e2b}];}return _0x32de52['services'][_0x242b0b(0x1ad)]((_0x3ccb4e,_0x4d2745)=>{const _0x1e08f9=_0x242b0b,_0x36386d=isObjectRecord(_0x3ccb4e)?_0x3ccb4e[_0x1e08f9(0x1c9)]:undefined,{manifest:_0x558ed5,errors:_0x16b539}=adaptServiceTreeManifestForLegacyFramework(_0x36386d),_0x312b52=validateServiceTreeManifest(_0x558ed5),_0x2c669f=mergeValidationErrors(_0x312b52,_0x16b539),_0x3b1445=isObjectRecord(_0x3ccb4e)&&typeof _0x3ccb4e['serviceCode']===_0x1e08f9(0x1e0)?_0x3ccb4e[_0x1e08f9(0x1cd)]:undefined;return{'manifest':_0x36386d,'report':_0x2c669f,'normalizedManifest':_0x2c669f['ok']?normalizeServiceTreeManifest(_0x558ed5):undefined,'sourceHash':sha256(JSON[_0x1e08f9(0x1e2)](_0x36386d,null,0x2)+'\x0a'),'registryIndex':_0x4d2745,'registryServiceCode':_0x3b1445};});}function mergeValidationErrors(_0x22d42e,_0x5b765c){const _0xd8bc3b=a62_0x4371ec,_0x1cf8c2=_0x22d42e[_0xd8bc3b(0x1cb)][_0xd8bc3b(0x1ad)](_0xc8d8a6=>_0xc8d8a6[_0xd8bc3b(0x1a6)]==='bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.'?{..._0xc8d8a6,'message':_0xd8bc3b(0x1da)}:_0xc8d8a6),_0x45cedf=[..._0x5b765c,..._0x1cf8c2];return{'ok':_0x45cedf[_0xd8bc3b(0x1ef)]===0x0,'errors':_0x45cedf,'warnings':_0x22d42e['warnings']};}function aggregateValidationReports(_0x10ab4a){const _0x4dcdcc=a62_0x4371ec,_0xb42a0f=_0x10ab4a[_0x4dcdcc(0x1f0)](_0x70c4f2=>_0x70c4f2['registryIndex']===undefined?_0x70c4f2['report'][_0x4dcdcc(0x1cb)]:_0x70c4f2[_0x4dcdcc(0x1ed)][_0x4dcdcc(0x1cb)][_0x4dcdcc(0x1ad)](_0x5909e8=>({..._0x5909e8,'path':prefixRegistryIssuePath(_0x70c4f2[_0x4dcdcc(0x1d7)],_0x5909e8[_0x4dcdcc(0x1d1)])}))),_0x8168ba=_0x10ab4a['flatMap'](_0xb5664=>_0xb5664[_0x4dcdcc(0x1d7)]===undefined?_0xb5664[_0x4dcdcc(0x1ed)][_0x4dcdcc(0x1bd)]:_0xb5664[_0x4dcdcc(0x1ed)][_0x4dcdcc(0x1bd)]['map'](_0x1752d5=>({..._0x1752d5,'path':prefixRegistryIssuePath(_0xb5664[_0x4dcdcc(0x1d7)],_0x1752d5[_0x4dcdcc(0x1d1)])})));return{'ok':_0xb42a0f[_0x4dcdcc(0x1ef)]===0x0,'errors':_0xb42a0f,'warnings':_0x8168ba};}function prefixRegistryIssuePath(_0x54a458,_0x4f7873){const _0x47d5d2=a62_0x4371ec;if(_0x4f7873==='$')return _0x47d5d2(0x1f3)+_0x54a458+_0x47d5d2(0x1a5);if(_0x4f7873[_0x47d5d2(0x1c4)]('$.'))return _0x47d5d2(0x1f3)+_0x54a458+_0x47d5d2(0x1a5)+_0x4f7873[_0x47d5d2(0x1b6)](0x1);if(_0x4f7873['startsWith']('$['))return _0x47d5d2(0x1f3)+_0x54a458+_0x47d5d2(0x1a5)+_0x4f7873[_0x47d5d2(0x1b6)](0x1);return _0x47d5d2(0x1f3)+_0x54a458+_0x47d5d2(0x1d2)+_0x4f7873;}function isServiceRegistryLike(_0x1fce58){const _0xe36dfd=a62_0x4371ec;return isObjectRecord(_0x1fce58)&&_0x1fce58['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0xe36dfd(0x1e6)](_0x1fce58['services']);}function isObjectRecord(_0x26bf18){const _0x57567a=a62_0x4371ec;return Boolean(_0x26bf18)&&typeof _0x26bf18===_0x57567a(0x1df)&&!Array['isArray'](_0x26bf18);}function emptyServiceRegistryInspection(_0x46020b,_0x2fd962,_0xdb8521){return{'registryPath':_0x46020b,'exists':_0xdb8521,'status':_0x2fd962,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x4b1b59){const _0x45460c=a62_0x4371ec,_0x402c5e=_0x4b1b59[_0x45460c(0x1e4)],_0x315e0c=_0x402c5e['commands'][_0x45460c(0x1ad)](_0x1699a9=>({'path':_0x1699a9['cliPath'],'description':_0x1699a9[_0x45460c(0x1b7)],'risk':_0x1699a9['risk'],'targetKind':_0x1699a9['target']['kind'],'targetCommand':_0x1699a9['target'][_0x45460c(0x1af)]}));return{'serviceCode':_0x4b1b59['serviceCode'],'name':_0x402c5e[_0x45460c(0x1ae)][_0x45460c(0x1bc)],'description':_0x402c5e[_0x45460c(0x1ae)][_0x45460c(0x1b7)],'version':_0x4b1b59[_0x45460c(0x1ee)],'importedAt':_0x4b1b59[_0x45460c(0x1d9)],'source':_0x4b1b59['source'],'commandCount':_0x315e0c[_0x45460c(0x1ef)],'commands':_0x315e0c};}function sha256(_0x2a8a88){const _0x4fe1dc=a62_0x4371ec;return createHash(_0x4fe1dc(0x1c6))['update'](_0x2a8a88)[_0x4fe1dc(0x1d6)](_0x4fe1dc(0x1d5));}
1
+ (function(_0x19d1b1,_0x55f7fe){const _0x3a1ce0=a62_0x2643,_0x288d13=_0x19d1b1();while(!![]){try{const _0x2d699d=parseInt(_0x3a1ce0(0x1fb))/0x1+-parseInt(_0x3a1ce0(0x1eb))/0x2+parseInt(_0x3a1ce0(0x1e6))/0x3*(-parseInt(_0x3a1ce0(0x1cf))/0x4)+parseInt(_0x3a1ce0(0x1ce))/0x5*(parseInt(_0x3a1ce0(0x1c8))/0x6)+parseInt(_0x3a1ce0(0x206))/0x7*(parseInt(_0x3a1ce0(0x1e9))/0x8)+parseInt(_0x3a1ce0(0x1d9))/0x9*(-parseInt(_0x3a1ce0(0x1dc))/0xa)+parseInt(_0x3a1ce0(0x1c6))/0xb*(parseInt(_0x3a1ce0(0x1bc))/0xc);if(_0x2d699d===_0x55f7fe)break;else _0x288d13['push'](_0x288d13['shift']());}catch(_0x47e8d2){_0x288d13['push'](_0x288d13['shift']());}}}(a62_0x3ce4,0xa040b));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME='service.json';export function getServiceRegistryPath(_0x25d37b={}){const _0x1304e4=a62_0x2643;return resolve(_0x25d37b['homeDir']??homedir(),PRODUCT_CONFIG[_0x1304e4(0x208)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x3c7ba2={}){const _0x5aef1b=a62_0x2643,_0x5da408=getServiceRegistryPath(_0x3c7ba2);if(!existsSync(_0x5da408))return emptyServiceRegistry();try{const _0x426679=readFileSync(_0x5da408,_0x5aef1b(0x1d6));if(!_0x426679[_0x5aef1b(0x1c9)]())return emptyServiceRegistry();const _0x4803b8=JSON[_0x5aef1b(0x1f6)](_0x426679);if(_0x4803b8['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x5aef1b(0x207)]('Unsupported\x20service\x20registry\x20schemaVersion:\x20'+String(_0x4803b8['schemaVersion']),_0x5aef1b(0x1d0)+_0x5da408+'.');if(!Array[_0x5aef1b(0x204)](_0x4803b8['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x4803b8[_0x5aef1b(0x1de)],'services':_0x4803b8[_0x5aef1b(0x20b)]};}catch(_0xfdb747){if(_0xfdb747 instanceof Error&&_0xfdb747[_0x5aef1b(0x1c5)]===_0x5aef1b(0x1e5))throw _0xfdb747;throw CliErrors['validation'](_0x5aef1b(0x1fd)+_0x5da408,_0x5aef1b(0x1e4));}}export function writeServiceRegistry(_0x1761aa,_0x5e1065={}){const _0x291966=a62_0x2643,_0x39430b=getServiceRegistryPath(_0x5e1065),_0x2f6236=dirname(_0x39430b);!existsSync(_0x2f6236)&&mkdirSync(_0x2f6236,{'recursive':!![]});const _0x2bd10b=_0x39430b+_0x291966(0x1d8);try{writeFileSync(_0x2bd10b,JSON[_0x291966(0x20a)](_0x1761aa,null,0x2)+'\x0a',{'encoding':_0x291966(0x1d6),'mode':0x180}),renameSync(_0x2bd10b,_0x39430b);}catch(_0x387fd1){try{unlinkSync(_0x2bd10b);}catch{}if(_0x387fd1?.['code']===_0x291966(0x1c1))throw CliErrors[_0x291966(0x207)](_0x291966(0x1f1)+_0x39430b);throw _0x387fd1;}return _0x39430b;}export function loadServiceManifestFromFile(_0x1ba22b){const _0x31a550=a62_0x2643,_0x94a8d0=resolve(_0x1ba22b);if(!existsSync(_0x94a8d0))throw CliErrors[_0x31a550(0x207)](_0x31a550(0x1df)+_0x1ba22b);let _0x12d146;const _0x42c6ef=readFileSync(_0x94a8d0,_0x31a550(0x1d6));try{_0x12d146=JSON[_0x31a550(0x1f6)](_0x42c6ef);}catch{throw CliErrors[_0x31a550(0x207)]('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x1ba22b,_0x31a550(0x205));}const _0x31b953=sha256(_0x42c6ef),_0x3c185c=extractLoadedServiceManifests(_0x12d146,_0x31b953),_0x19bda0=aggregateValidationReports(_0x3c185c),_0x4f1cb8=_0x3c185c[0x0];return{'filePath':_0x94a8d0,'hash':_0x31b953,'kind':isServiceRegistryLike(_0x12d146)?_0x31a550(0x1c0):'manifest','manifest':_0x4f1cb8?.['manifest']??_0x12d146,'report':_0x19bda0,'normalizedManifest':_0x3c185c[_0x31a550(0x1ea)]===0x1?_0x4f1cb8?.[_0x31a550(0x1fa)]:undefined,'manifests':_0x3c185c};}export function importServiceManifest(_0x1dec11,_0x11648f={}){const _0x4ce235=a62_0x2643,_0x5e4668=loadServiceManifestFromFile(_0x1dec11);if(!_0x5e4668[_0x4ce235(0x1ec)]['ok'])throw CliErrors[_0x4ce235(0x207)](formatValidationFailure(_0x5e4668['report']),_0x4ce235(0x1ef));if(_0x5e4668['manifests']['length']===0x0)throw CliErrors[_0x4ce235(0x207)](_0x4ce235(0x1f7),'Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.');const _0x3de07e=readServiceRegistry(_0x11648f),_0x4e714b=(_0x11648f[_0x4ce235(0x1f0)]??(()=>new Date()))()[_0x4ce235(0x20d)](),_0xced61c=[];let _0x205dce=0x0,_0x184794=0x0;for(const _0x45fee4 of _0x5e4668[_0x4ce235(0x1f4)]){if(!_0x45fee4[_0x4ce235(0x1fa)])continue;const _0x5a914b=_0x45fee4[_0x4ce235(0x1fa)][_0x4ce235(0x1ff)][_0x4ce235(0x1fc)],_0x552db2={'serviceCode':_0x5a914b,'version':_0x45fee4[_0x4ce235(0x1fa)][_0x4ce235(0x203)],'importedAt':_0x4e714b,'source':{'type':'file','path':_0x5e4668[_0x4ce235(0x1e1)],'hash':_0x45fee4[_0x4ce235(0x1f3)]},'manifest':_0x45fee4[_0x4ce235(0x201)],'normalizedManifest':_0x45fee4[_0x4ce235(0x1fa)]},_0x475fa0=_0x3de07e[_0x4ce235(0x20b)][_0x4ce235(0x1e2)](_0x3aead5=>_0x3aead5['serviceCode']===_0x5a914b);_0x475fa0>=0x0?(_0x3de07e[_0x4ce235(0x20b)][_0x475fa0]=_0x552db2,_0x184794++):(_0x3de07e[_0x4ce235(0x20b)][_0x4ce235(0x1f8)](_0x552db2),_0x205dce++),_0xced61c[_0x4ce235(0x1f8)](_0x552db2);}_0x3de07e[_0x4ce235(0x20b)]['sort']((_0x5a481a,_0x497fbc)=>_0x5a481a[_0x4ce235(0x202)]['localeCompare'](_0x497fbc[_0x4ce235(0x202)])),_0x3de07e['updatedAt']=_0x4e714b;const _0x35b3bd=writeServiceRegistry(_0x3de07e,_0x11648f);return{'registryPath':_0x35b3bd,'entry':_0xced61c[0x0],'replaced':_0xced61c[_0x4ce235(0x1ea)]===0x1?_0x184794===0x1:_0x184794>0x0,'entries':_0xced61c,'imported':_0x205dce,'updated':_0x184794,'serviceCount':_0x3de07e[_0x4ce235(0x20b)][_0x4ce235(0x1ea)]};}export function exportServiceManifest(_0x5f4d2f,_0x2820c6,_0xf3c92b={}){const _0x440523=a62_0x2643,_0x21f923=getServiceRegistryPath(_0xf3c92b),_0x4bffd=getLocalServiceEntry(_0x5f4d2f,_0xf3c92b);if(!_0x4bffd)throw CliErrors[_0x440523(0x207)](_0x440523(0x1d7)+_0x5f4d2f,_0x440523(0x20e));const _0x17448c=resolve(_0x2820c6),_0x1d75bd=dirname(_0x17448c);return!existsSync(_0x1d75bd)&&mkdirSync(_0x1d75bd,{'recursive':!![]}),writeFileSync(_0x17448c,JSON[_0x440523(0x20a)](_0x4bffd['manifest'],null,0x2)+'\x0a',{'encoding':_0x440523(0x1d6),'mode':0x180}),{'registryPath':_0x21f923,'filePath':_0x17448c,'entry':_0x4bffd};}export function removeServiceManifest(_0x2ce18b,_0xf62d90={}){const _0x27cc17=a62_0x2643,_0x2a4ab5=readServiceRegistry(_0xf62d90),_0x113645=_0x2ce18b[_0x27cc17(0x1c9)](),_0x3be4b7=_0x2a4ab5[_0x27cc17(0x20b)][_0x27cc17(0x1e2)](_0x477a69=>_0x477a69[_0x27cc17(0x202)]===_0x113645);if(_0x3be4b7<0x0)throw CliErrors[_0x27cc17(0x207)]('Local\x20service\x20not\x20found:\x20'+_0x113645,_0x27cc17(0x20e));const [_0x2b918d]=_0x2a4ab5['services'][_0x27cc17(0x1cc)](_0x3be4b7,0x1),_0x5e51db=(_0xf62d90[_0x27cc17(0x1f0)]??(()=>new Date()))()['toISOString']();_0x2a4ab5['updatedAt']=_0x5e51db;const _0x1b8c03=writeServiceRegistry(_0x2a4ab5,_0xf62d90);return{'registryPath':_0x1b8c03,'entry':_0x2b918d,'serviceCount':_0x2a4ab5[_0x27cc17(0x20b)][_0x27cc17(0x1ea)]};}export function listLocalServices(_0x573405={}){return readServiceRegistry(_0x573405)['services'];}export function getLocalServiceEntry(_0x45347d,_0x47a1ad={}){const _0x3a58d6=a62_0x2643;return readServiceRegistry(_0x47a1ad)[_0x3a58d6(0x20b)]['find'](_0x2ffa6b=>_0x2ffa6b['serviceCode']===_0x45347d[_0x3a58d6(0x1c9)]());}export function listLocalServiceTrees(_0x7aa90f={}){const _0x4dc3ae=a62_0x2643;return readServiceRegistry(_0x7aa90f)[_0x4dc3ae(0x20b)][_0x4dc3ae(0x200)](_0x285941=>_0x285941['normalizedManifest']);}export function inspectServiceRegistry(_0x9d624a={}){const _0x56cce2=a62_0x2643,_0x545b9b=getServiceRegistryPath(_0x9d624a);if(!existsSync(_0x545b9b))return emptyServiceRegistryInspection(_0x545b9b,_0x56cce2(0x1ed),![]);try{const _0x5114a0=readFileSync(_0x545b9b,_0x56cce2(0x1d6));if(!_0x5114a0[_0x56cce2(0x1c9)]())return emptyServiceRegistryInspection(_0x545b9b,'empty',!![]);const _0x5668e5=JSON[_0x56cce2(0x1f6)](_0x5114a0);if(_0x5668e5[_0x56cce2(0x1ca)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x545b9b,_0x56cce2(0x1f9),!![]),'schemaVersion':_0x5668e5[_0x56cce2(0x1ca)],'message':_0x56cce2(0x1be)+String(_0x5668e5[_0x56cce2(0x1ca)])};if(!Array[_0x56cce2(0x204)](_0x5668e5['services']))return{...emptyServiceRegistryInspection(_0x545b9b,_0x56cce2(0x1f9),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5668e5[_0x56cce2(0x1de)],'message':_0x56cce2(0x1c4)};const _0x5c4489=_0x5668e5[_0x56cce2(0x20b)][_0x56cce2(0x200)](summarizeLocalServiceEntry);return{'registryPath':_0x545b9b,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5668e5[_0x56cce2(0x1de)],'serviceCount':_0x5c4489[_0x56cce2(0x1ea)],'commandCount':_0x5c4489['reduce']((_0x28cbc3,_0xd1a164)=>_0x28cbc3+_0xd1a164[_0x56cce2(0x1e7)],0x0),'services':_0x5c4489};}catch(_0x26c1b7){return{...emptyServiceRegistryInspection(_0x545b9b,_0x56cce2(0x1f9),!![]),'message':_0x26c1b7 instanceof Error?_0x26c1b7[_0x56cce2(0x1e3)]:String(_0x26c1b7)};}}export function formatValidationFailure(_0x5cc72c){const _0x2c457b=a62_0x2643,_0x1f44ee=_0x5cc72c[_0x2c457b(0x1d4)][_0x2c457b(0x200)](_0x5bd69d=>_0x5bd69d[_0x2c457b(0x1da)]+':\x20'+_0x5bd69d[_0x2c457b(0x1e3)]);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x1f44ee[_0x2c457b(0x20c)]('\x0a');}function extractLoadedServiceManifests(_0x5edb29,_0x2f705c){const _0x25a20c=a62_0x2643;if(!isServiceRegistryLike(_0x5edb29)){const _0x1e5dda=_0x5edb29,{manifest:_0x59bd2d,errors:_0x3648e6}=adaptServiceTreeManifestForLegacyFramework(_0x1e5dda),_0x6193b9=validateServiceTreeManifest(_0x59bd2d),_0x448d72=mergeValidationErrors(_0x6193b9,_0x3648e6);return[{'manifest':_0x1e5dda,'report':_0x448d72,'normalizedManifest':_0x448d72['ok']?normalizeServiceTreeManifest(_0x59bd2d):undefined,'sourceHash':_0x2f705c}];}return _0x5edb29[_0x25a20c(0x20b)][_0x25a20c(0x200)]((_0x1b9fb7,_0x4caea0)=>{const _0x237e40=_0x25a20c,_0x5f0cf7=isObjectRecord(_0x1b9fb7)?_0x1b9fb7['manifest']:undefined,{manifest:_0x1d4c2b,errors:_0x470916}=adaptServiceTreeManifestForLegacyFramework(_0x5f0cf7),_0x2ad3a5=validateServiceTreeManifest(_0x1d4c2b),_0x358ffc=mergeValidationErrors(_0x2ad3a5,_0x470916),_0x4183e2=isObjectRecord(_0x1b9fb7)&&typeof _0x1b9fb7[_0x237e40(0x202)]===_0x237e40(0x1f2)?_0x1b9fb7[_0x237e40(0x202)]:undefined;return{'manifest':_0x5f0cf7,'report':_0x358ffc,'normalizedManifest':_0x358ffc['ok']?normalizeServiceTreeManifest(_0x1d4c2b):undefined,'sourceHash':sha256(JSON[_0x237e40(0x20a)](_0x5f0cf7,null,0x2)+'\x0a'),'registryIndex':_0x4caea0,'registryServiceCode':_0x4183e2};});}function mergeValidationErrors(_0x152ed0,_0x60d7e0){const _0x5b99db=a62_0x2643,_0x1a4107=_0x152ed0['errors']['map'](_0x2e7c6d=>_0x2e7c6d[_0x5b99db(0x1e3)]==='bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.'?{..._0x2e7c6d,'message':'bff\x20target\x20requires\x20functionName.'}:_0x2e7c6d),_0x386582=[..._0x60d7e0,..._0x1a4107];return{'ok':_0x386582[_0x5b99db(0x1ea)]===0x0,'errors':_0x386582,'warnings':_0x152ed0['warnings']};}function aggregateValidationReports(_0xa66ebe){const _0x16c7b2=a62_0x2643,_0x24707d=_0xa66ebe[_0x16c7b2(0x1ee)](_0xce209f=>_0xce209f['registryIndex']===undefined?_0xce209f[_0x16c7b2(0x1ec)]['errors']:_0xce209f[_0x16c7b2(0x1ec)]['errors']['map'](_0x3f7afa=>({..._0x3f7afa,'path':prefixRegistryIssuePath(_0xce209f[_0x16c7b2(0x1db)],_0x3f7afa['path'])}))),_0x4bc86d=_0xa66ebe[_0x16c7b2(0x1ee)](_0x373913=>_0x373913[_0x16c7b2(0x1db)]===undefined?_0x373913[_0x16c7b2(0x1ec)]['warnings']:_0x373913['report'][_0x16c7b2(0x1d2)][_0x16c7b2(0x200)](_0x14720d=>({..._0x14720d,'path':prefixRegistryIssuePath(_0x373913[_0x16c7b2(0x1db)],_0x14720d['path'])})));return{'ok':_0x24707d[_0x16c7b2(0x1ea)]===0x0,'errors':_0x24707d,'warnings':_0x4bc86d};}function prefixRegistryIssuePath(_0x3fb57b,_0x3ffba9){const _0x22b245=a62_0x2643;if(_0x3ffba9==='$')return _0x22b245(0x209)+_0x3fb57b+_0x22b245(0x1c3);if(_0x3ffba9[_0x22b245(0x1cd)]('$.'))return'$.services['+_0x3fb57b+'].manifest'+_0x3ffba9[_0x22b245(0x1d1)](0x1);if(_0x3ffba9[_0x22b245(0x1cd)]('$['))return _0x22b245(0x209)+_0x3fb57b+'].manifest'+_0x3ffba9[_0x22b245(0x1d1)](0x1);return _0x22b245(0x209)+_0x3fb57b+'].manifest.'+_0x3ffba9;}function isServiceRegistryLike(_0x36ad0f){const _0x3d5a6a=a62_0x2643;return isObjectRecord(_0x36ad0f)&&_0x36ad0f[_0x3d5a6a(0x1ca)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x3d5a6a(0x204)](_0x36ad0f['services']);}function isObjectRecord(_0x2d391c){const _0x1982b2=a62_0x2643;return Boolean(_0x2d391c)&&typeof _0x2d391c===_0x1982b2(0x1c7)&&!Array['isArray'](_0x2d391c);}function emptyServiceRegistryInspection(_0x32ab61,_0x4f648f,_0x19d53f){return{'registryPath':_0x32ab61,'exists':_0x19d53f,'status':_0x4f648f,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x3618cf){const _0x57be05=a62_0x2643,_0x452ca0=_0x3618cf[_0x57be05(0x1fa)],_0x3a25e3=_0x452ca0[_0x57be05(0x1dd)][_0x57be05(0x200)](_0x1c0072=>({'path':_0x1c0072[_0x57be05(0x1fe)],'description':_0x1c0072[_0x57be05(0x1d5)],'risk':_0x1c0072[_0x57be05(0x1bf)],'targetKind':_0x1c0072[_0x57be05(0x1c2)][_0x57be05(0x1bd)],'targetCommand':_0x1c0072[_0x57be05(0x1c2)][_0x57be05(0x1e8)]}));return{'serviceCode':_0x3618cf['serviceCode'],'name':_0x452ca0[_0x57be05(0x1ff)][_0x57be05(0x1c5)],'description':_0x452ca0[_0x57be05(0x1ff)]['description'],'version':_0x3618cf[_0x57be05(0x203)],'importedAt':_0x3618cf[_0x57be05(0x1d3)],'source':_0x3618cf['source'],'commandCount':_0x3a25e3[_0x57be05(0x1ea)],'commands':_0x3a25e3};}function a62_0x2643(_0x3ed361,_0x368214){_0x3ed361=_0x3ed361-0x1bc;const _0x3ce46c=a62_0x3ce4();let _0x264343=_0x3ce46c[_0x3ed361];return _0x264343;}function sha256(_0x583ba9){const _0x51ec2c=a62_0x2643;return createHash('sha256')[_0x51ec2c(0x1e0)](_0x583ba9)[_0x51ec2c(0x1cb)](_0x51ec2c(0x1f5));}function a62_0x3ce4(){const _0x456e79=['serviceCode','version','isArray','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','158060EnFxRQ','validation','homeDirName','$.services[','stringify','services','join','toISOString','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','12zZSbzl','kind','Unsupported\x20schemaVersion:\x20','risk','registry','ENOENT','target','].manifest','services\x20must\x20be\x20an\x20array','name','15870877APIyFg','object','155076znTtTR','trim','schemaVersion','digest','splice','startsWith','140mqggZC','1772604FehMvw','Remove\x20or\x20migrate\x20','slice','warnings','importedAt','errors','description','utf8','Local\x20service\x20not\x20found:\x20','.tmp','321813huHfum','path','registryIndex','80JGOWSc','commands','updatedAt','Service\x20manifest\x20file\x20not\x20found:\x20','update','filePath','findIndex','message','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','CliError','3TUQPwy','commandCount','command','40hDwMDJ','length','1962880usouSB','report','missing','flatMap','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','now','Cannot\x20write\x20service\x20registry:\x20','string','sourceHash','manifests','hex','parse','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','push','invalid','normalizedManifest','87647hOQSBk','code','Invalid\x20service\x20registry\x20JSON:\x20','cliPath','service','map','manifest'];a62_0x3ce4=function(){return _0x456e79;};return a62_0x3ce4();}
@@ -1 +1 @@
1
- const a63_0x2f394c=a63_0x18fd;(function(_0x4ee350,_0x3e23db){const _0x42f225=a63_0x18fd,_0x28a4a2=_0x4ee350();while(!![]){try{const _0x322550=-parseInt(_0x42f225(0x1fd))/0x1+-parseInt(_0x42f225(0x1f9))/0x2*(-parseInt(_0x42f225(0x211))/0x3)+-parseInt(_0x42f225(0x215))/0x4*(-parseInt(_0x42f225(0x1fa))/0x5)+parseInt(_0x42f225(0x217))/0x6*(-parseInt(_0x42f225(0x1fb))/0x7)+-parseInt(_0x42f225(0x20d))/0x8+parseInt(_0x42f225(0x216))/0x9*(-parseInt(_0x42f225(0x213))/0xa)+-parseInt(_0x42f225(0x1fe))/0xb*(-parseInt(_0x42f225(0x203))/0xc);if(_0x322550===_0x3e23db)break;else _0x28a4a2['push'](_0x28a4a2['shift']());}catch(_0x11021a){_0x28a4a2['push'](_0x28a4a2['shift']());}}}(a63_0xa9f8,0x62804));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';function a63_0xa9f8(){const _0x1433fb=['WRITE','trim','map','1302054OExGSt','type','1913360hEIBeZ','isDirectory','2223204crPpKw','27nzhAzy','48MjyGaD','create','Refusing\x20to\x20overwrite\x20symlink:\x20','skillDir','force','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','bool','name','2prXuMI','5xoHDFD','221032axbGsT','validation','611160IYSorj','33979EXlORO','skill','read','target','files','4896SoKQyE','skillName','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','content','Skill\x20directory\x20already\x20exists:\x20','isSymbolicLink','utf8','rendered','str','path','3271160iwgLcT'];a63_0xa9f8=function(){return _0x1433fb;};return a63_0xa9f8();}import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a63_0x2f394c(0x1ff),'command':a63_0x2f394c(0x1f1),'description':'创建本地自包含的运行态\x20Skill\x20草稿','risk':a63_0x2f394c(0x200),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x486185){const _0x15aac3=a63_0x2f394c,_0x6d708e=buildSkillCreatePlan(_0x486185['str'](_0x15aac3(0x1f8)),_0x486185[_0x15aac3(0x20b)](_0x15aac3(0x212)),_0x486185['str'](_0x15aac3(0x201)));return{'method':_0x15aac3(0x20e),'url':_0x6d708e['skillDir'],'body':{'skillName':_0x6d708e[_0x15aac3(0x20a)][_0x15aac3(0x204)],'type':_0x6d708e['rendered'][_0x15aac3(0x212)],'selfContained':!![],'files':_0x6d708e[_0x15aac3(0x20a)]['files'][_0x15aac3(0x210)](_0x4b4ab1=>_0x4b4ab1[_0x15aac3(0x20c)])},'description':_0x15aac3(0x1f6)};},async 'execute'(_0x3417cc){const _0x167d5f=a63_0x2f394c,_0x136927=buildSkillCreatePlan(_0x3417cc[_0x167d5f(0x20b)]('name'),_0x3417cc[_0x167d5f(0x20b)]('type'),_0x3417cc[_0x167d5f(0x20b)]('target'));return writeSkillDraft(_0x136927,_0x3417cc[_0x167d5f(0x1f7)](_0x167d5f(0x1f4))),{'ok':!![],'data':{'skillName':_0x136927['rendered'][_0x167d5f(0x204)],'type':_0x136927[_0x167d5f(0x20a)][_0x167d5f(0x212)],'dir':_0x136927[_0x167d5f(0x1f3)],'files':_0x136927[_0x167d5f(0x20a)]['files'][_0x167d5f(0x210)](_0x7420fe=>_0x7420fe[_0x167d5f(0x20c)])},'message':'Created\x20local\x20Skill\x20draft\x20'+_0x136927[_0x167d5f(0x20a)]['skillName']};}};function a63_0x18fd(_0x33d192,_0x4718ed){_0x33d192=_0x33d192-0x1f1;const _0xa9f83=a63_0xa9f8();let _0x18fd1b=_0xa9f83[_0x33d192];return _0x18fd1b;}function buildSkillCreatePlan(_0x9f9251,_0x54a951,_0x437bb2){const _0xdfac56=a63_0x2f394c,_0x4d34c7=_0x54a951[_0xdfac56(0x20f)](),_0x2c590a=renderSkillTemplate({'skillName':_0x9f9251,'type':_0x4d34c7});!_0x4d34c7&&writeCliSideChannelLine(_0xdfac56(0x205));const _0x1bc08a=resolve(normalizeSkillTarget(_0x437bb2));return{'rendered':_0x2c590a,'targetRoot':_0x1bc08a,'skillDir':resolve(_0x1bc08a,_0x2c590a[_0xdfac56(0x204)])};}function normalizeSkillTarget(_0x3eb28e){return(_0x3eb28e||DEFAULT_SKILL_TARGET)['trim']()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x3d2253,_0x13596d){const _0x3233c3=a63_0x2f394c;if(existsSync(_0x3d2253['skillDir'])){const _0x2a4088=lstatSync(_0x3d2253[_0x3233c3(0x1f3)]);if(!_0x2a4088[_0x3233c3(0x214)]()||_0x2a4088[_0x3233c3(0x208)]())throw CliErrors[_0x3233c3(0x1fc)]('Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20'+_0x3d2253[_0x3233c3(0x1f3)]);if(!_0x13596d)throw CliErrors[_0x3233c3(0x1fc)](_0x3233c3(0x207)+_0x3d2253[_0x3233c3(0x1f3)],_0x3233c3(0x1f5));}for(const _0x543fdd of _0x3d2253[_0x3233c3(0x20a)][_0x3233c3(0x202)]){const _0x467e7e=resolve(_0x3d2253['skillDir'],_0x543fdd[_0x3233c3(0x20c)]),_0x463959=dirname(_0x467e7e);mkdirSync(_0x463959,{'recursive':!![]});if(existsSync(_0x467e7e)&&lstatSync(_0x467e7e)[_0x3233c3(0x208)]())throw CliErrors['validation'](_0x3233c3(0x1f2)+_0x467e7e);writeFileSync(_0x467e7e,_0x543fdd[_0x3233c3(0x206)],_0x3233c3(0x209));}}
1
+ const a63_0x1db356=a63_0x3bf9;(function(_0xd51c6d,_0x5b6a96){const _0x21b58d=a63_0x3bf9,_0x465bb5=_0xd51c6d();while(!![]){try{const _0x1faf4a=parseInt(_0x21b58d(0x168))/0x1+parseInt(_0x21b58d(0x159))/0x2+parseInt(_0x21b58d(0x16c))/0x3+parseInt(_0x21b58d(0x173))/0x4*(-parseInt(_0x21b58d(0x165))/0x5)+parseInt(_0x21b58d(0x15a))/0x6*(parseInt(_0x21b58d(0x171))/0x7)+-parseInt(_0x21b58d(0x164))/0x8+parseInt(_0x21b58d(0x172))/0x9;if(_0x1faf4a===_0x5b6a96)break;else _0x465bb5['push'](_0x465bb5['shift']());}catch(_0x306e7e){_0x465bb5['push'](_0x465bb5['shift']());}}}(a63_0x228a,0x604ec));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';function a63_0x228a(){const _0x4ad3f2=['174316OPcUBE','78TUOuAV','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','WRITE','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','skill','isSymbolicLink','isDirectory','str','Skill\x20directory\x20already\x20exists:\x20','force','5109192dAExPm','61970wrnxeO','skillName','validation','62767XabYXx','type','map','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','1149117GwThUD','content','Refusing\x20to\x20overwrite\x20symlink:\x20','skillDir','files','406217hlQVWL','4739220cQHero','252YbYWRz','name','bool','rendered','创建本地自包含的运行态\x20Skill\x20草稿','path','target','trim','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.'];a63_0x228a=function(){return _0x4ad3f2;};return a63_0x228a();}import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a63_0x1db356(0x15e),'command':'create','description':a63_0x1db356(0x154),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x4a1140){const _0x41874d=a63_0x1db356,_0x789d1=buildSkillCreatePlan(_0x4a1140[_0x41874d(0x161)](_0x41874d(0x174)),_0x4a1140[_0x41874d(0x161)](_0x41874d(0x169)),_0x4a1140['str'](_0x41874d(0x156)));return{'method':_0x41874d(0x15c),'url':_0x789d1[_0x41874d(0x16f)],'body':{'skillName':_0x789d1[_0x41874d(0x153)][_0x41874d(0x166)],'type':_0x789d1[_0x41874d(0x153)][_0x41874d(0x169)],'selfContained':!![],'files':_0x789d1[_0x41874d(0x153)][_0x41874d(0x170)][_0x41874d(0x16a)](_0x475fd0=>_0x475fd0[_0x41874d(0x155)])},'description':_0x41874d(0x158)};},async 'execute'(_0x376d25){const _0x9cd8a5=a63_0x1db356,_0x499706=buildSkillCreatePlan(_0x376d25[_0x9cd8a5(0x161)]('name'),_0x376d25[_0x9cd8a5(0x161)](_0x9cd8a5(0x169)),_0x376d25[_0x9cd8a5(0x161)](_0x9cd8a5(0x156)));return writeSkillDraft(_0x499706,_0x376d25[_0x9cd8a5(0x175)](_0x9cd8a5(0x163))),{'ok':!![],'data':{'skillName':_0x499706[_0x9cd8a5(0x153)][_0x9cd8a5(0x166)],'type':_0x499706['rendered']['type'],'dir':_0x499706[_0x9cd8a5(0x16f)],'files':_0x499706[_0x9cd8a5(0x153)][_0x9cd8a5(0x170)][_0x9cd8a5(0x16a)](_0x172299=>_0x172299['path'])},'message':'Created\x20local\x20Skill\x20draft\x20'+_0x499706[_0x9cd8a5(0x153)][_0x9cd8a5(0x166)]};}};function buildSkillCreatePlan(_0x4c9eb8,_0x2b2209,_0x166691){const _0x4e8f2e=a63_0x1db356,_0x5617d1=_0x2b2209[_0x4e8f2e(0x157)](),_0x1c457a=renderSkillTemplate({'skillName':_0x4c9eb8,'type':_0x5617d1});!_0x5617d1&&writeCliSideChannelLine(_0x4e8f2e(0x16b));const _0x5c91ea=resolve(normalizeSkillTarget(_0x166691));return{'rendered':_0x1c457a,'targetRoot':_0x5c91ea,'skillDir':resolve(_0x5c91ea,_0x1c457a[_0x4e8f2e(0x166)])};}function normalizeSkillTarget(_0x393eae){const _0x46ea03=a63_0x1db356;return(_0x393eae||DEFAULT_SKILL_TARGET)[_0x46ea03(0x157)]()||DEFAULT_SKILL_TARGET;}function a63_0x3bf9(_0x3d1f89,_0x5c20a1){_0x3d1f89=_0x3d1f89-0x153;const _0x228aaa=a63_0x228a();let _0x3bf9a3=_0x228aaa[_0x3d1f89];return _0x3bf9a3;}function writeSkillDraft(_0x2ca679,_0x579352){const _0x44531f=a63_0x1db356;if(existsSync(_0x2ca679[_0x44531f(0x16f)])){const _0x2a991f=lstatSync(_0x2ca679[_0x44531f(0x16f)]);if(!_0x2a991f[_0x44531f(0x160)]()||_0x2a991f['isSymbolicLink']())throw CliErrors[_0x44531f(0x167)](_0x44531f(0x15b)+_0x2ca679[_0x44531f(0x16f)]);if(!_0x579352)throw CliErrors['validation'](_0x44531f(0x162)+_0x2ca679[_0x44531f(0x16f)],_0x44531f(0x15d));}for(const _0x103e35 of _0x2ca679[_0x44531f(0x153)][_0x44531f(0x170)]){const _0xb751fd=resolve(_0x2ca679['skillDir'],_0x103e35['path']),_0x13cbad=dirname(_0xb751fd);mkdirSync(_0x13cbad,{'recursive':!![]});if(existsSync(_0xb751fd)&&lstatSync(_0xb751fd)[_0x44531f(0x15f)]())throw CliErrors['validation'](_0x44531f(0x16e)+_0xb751fd);writeFileSync(_0xb751fd,_0x103e35[_0x44531f(0x16d)],'utf8');}}
@@ -1 +1 @@
1
- const a64_0xa4673f=a64_0x4465;(function(_0x35617b,_0x5d6d06){const _0x27a971=a64_0x4465,_0x28361c=_0x35617b();while(!![]){try{const _0x16c020=parseInt(_0x27a971(0xbd))/0x1*(-parseInt(_0x27a971(0xc9))/0x2)+parseInt(_0x27a971(0xb6))/0x3*(parseInt(_0x27a971(0xcb))/0x4)+parseInt(_0x27a971(0xd4))/0x5*(parseInt(_0x27a971(0xad))/0x6)+parseInt(_0x27a971(0xcf))/0x7+-parseInt(_0x27a971(0xc8))/0x8+parseInt(_0x27a971(0xd5))/0x9+-parseInt(_0x27a971(0xaf))/0xa;if(_0x16c020===_0x5d6d06)break;else _0x28361c['push'](_0x28361c['shift']());}catch(_0x261c91){_0x28361c['push'](_0x28361c['shift']());}}}(a64_0x3881,0xca756));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x51ed37){const _0x303dcb=a64_0x4465,_0x14521e=_0x51ed37[_0x303dcb(0xd6)](_0x303dcb(0xb5))[_0x303dcb(0xc5)](),_0x4c592d=_0x51ed37[_0x303dcb(0xd6)](_0x303dcb(0xc3))[_0x303dcb(0xc5)](),_0x180a51=_0x51ed37[_0x303dcb(0xd6)](_0x303dcb(0xae));if(!_0x14521e||!_0x4c592d||_0x180a51!==_0x303dcb(0xb4)&&_0x180a51!==_0x303dcb(0xb2))throw CliErrors[_0x303dcb(0xbc)](_0x303dcb(0xb8));return{'skillCode':_0x14521e,'version':_0x4c592d,'scope':_0x180a51};}async function readDiagramWriteInput(_0x371b68){const _0x1ca115=a64_0x4465,_0x2336f5=_0x371b68[_0x1ca115(0xbf)]('expected-diagram-revision'),_0x5b44dd=_0x371b68['str'](_0x1ca115(0xd2))[_0x1ca115(0xc5)]();if(!Number[_0x1ca115(0xbe)](_0x2336f5)||_0x2336f5<0x0)throw CliErrors[_0x1ca115(0xbc)]('--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.');if(!/^sha256:[0-9a-f]{64}$/[_0x1ca115(0xca)](_0x5b44dd))throw CliErrors[_0x1ca115(0xbc)](_0x1ca115(0xbb));return{'expectedDiagramRevision':_0x2336f5,'sourceFingerprint':_0x5b44dd,'diagram':await readRequiredSkillDiagram(_0x371b68['str']('diagram-file'))};}export const diagramValidateCommand={'service':a64_0xa4673f(0xc2),'command':'diagram-validate','description':'Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','risk':a64_0xa4673f(0xc7),'flags':WRITE_FLAGS,async 'execute'(_0x3d2982){const _0x543689=a64_0xa4673f,_0x3180ea=readDiagramTarget(_0x3d2982),_0x44fd38=await validateRuntimeSkillVersionDiagram(_0x3d2982[_0x543689(0xcc)],_0x3180ea['skillCode'],_0x3180ea[_0x543689(0xc3)],_0x3180ea['scope'],await readDiagramWriteInput(_0x3d2982));return{'ok':!![],'data':_0x44fd38,'message':_0x543689(0xba)+_0x3180ea[_0x543689(0xd3)]+'@'+_0x3180ea[_0x543689(0xc3)]+'.'};}};function a64_0x4465(_0x12044b,_0x4ac1b0){_0x12044b=_0x12044b-0xad;const _0x3881b8=a64_0x3881();let _0x446563=_0x3881b8[_0x12044b];return _0x446563;}export const diagramPushCommand={'service':a64_0xa4673f(0xc2),'command':'diagram-push','description':'为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','risk':a64_0xa4673f(0xb3),'confirmationDescription':a64_0xa4673f(0xd0),'flags':WRITE_FLAGS,async 'execute'(_0x42f0e0){const _0x29703c=a64_0xa4673f,_0x45b14e=readDiagramTarget(_0x42f0e0),_0x45ad9c=await putRuntimeSkillVersionDiagram(_0x42f0e0['appCode'],_0x45b14e[_0x29703c(0xd3)],_0x45b14e['version'],_0x45b14e[_0x29703c(0xae)],await readDiagramWriteInput(_0x42f0e0));return{'ok':!![],'data':_0x45ad9c,'message':_0x45ad9c[_0x29703c(0xce)]===_0x29703c(0xc1)?_0x29703c(0xc0)+_0x45b14e[_0x29703c(0xd3)]+'@'+_0x45b14e[_0x29703c(0xc3)]+'\x20is\x20unchanged.':(_0x45ad9c['action']===_0x29703c(0xd7)?_0x29703c(0xcd):'Updated')+_0x29703c(0xc6)+_0x45b14e[_0x29703c(0xd3)]+'@'+_0x45b14e['version']+'.'};}};export const diagramShowCommand={'service':a64_0xa4673f(0xc2),'command':a64_0xa4673f(0xb1),'description':'Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','risk':'read','flags':TARGET_FLAGS,async 'execute'(_0x5c7d43){const _0x35b525=a64_0xa4673f,_0x3ffe0e=readDiagramTarget(_0x5c7d43),_0x11be2c=await getRuntimeSkillVersionDiagram(_0x5c7d43[_0x35b525(0xcc)],_0x3ffe0e['skillCode'],_0x3ffe0e[_0x35b525(0xc3)],_0x3ffe0e[_0x35b525(0xae)]);return{'ok':!![],'data':_0x11be2c,'message':_0x11be2c[_0x35b525(0xc4)]?_0x35b525(0xb7)+_0x3ffe0e[_0x35b525(0xd3)]+'@'+_0x3ffe0e[_0x35b525(0xc3)]+_0x35b525(0xd1)+_0x11be2c[_0x35b525(0xb9)]+'.':'No\x20Skill\x20diagram\x20is\x20stored\x20for\x20'+_0x3ffe0e[_0x35b525(0xd3)]+'@'+_0x3ffe0e[_0x35b525(0xc3)]+_0x35b525(0xb0)+_0x11be2c[_0x35b525(0xb9)]+'.'};}};function a64_0x3881(){const _0x378d79=['appCode','Created','action','9182292INEXAu','将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。',';\x20next\x20write\x20expects\x20revision\x20','source-fingerprint','skillCode','1720DgSCLx','6123141HnevaL','str','created','3642ApvJMU','scope','8241560DFjUda',';\x20first\x20write\x20expects\x20revision\x20','diagram-show','company','write','personal','skill-code','1437syqQXL','Found\x20Skill\x20diagram\x20for\x20','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','expectedDiagramRevision','Skill\x20diagram\x20validation\x20passed\x20for\x20','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','validation','2lURBLb','isInteger','num','Skill\x20diagram\x20for\x20','unchanged','skill','version','found','trim','\x20Skill\x20diagram\x20for\x20','read','11533072CnglwK','718646XAEEFU','test','13468BEMpqx'];a64_0x3881=function(){return _0x378d79;};return a64_0x3881();}
1
+ function a64_0x51d9(_0x4e6045,_0x50e256){_0x4e6045=_0x4e6045-0xfe;const _0x3a41d5=a64_0x3a41();let _0x51d9c1=_0x3a41d5[_0x4e6045];return _0x51d9c1;}const a64_0x2cc290=a64_0x51d9;(function(_0x435028,_0x29120d){const _0x241961=a64_0x51d9,_0x8b1626=_0x435028();while(!![]){try{const _0x12576e=-parseInt(_0x241961(0x119))/0x1*(parseInt(_0x241961(0x118))/0x2)+parseInt(_0x241961(0x102))/0x3+parseInt(_0x241961(0x113))/0x4+parseInt(_0x241961(0x11d))/0x5+-parseInt(_0x241961(0xfe))/0x6+-parseInt(_0x241961(0x10f))/0x7*(-parseInt(_0x241961(0x11f))/0x8)+-parseInt(_0x241961(0xff))/0x9;if(_0x12576e===_0x29120d)break;else _0x8b1626['push'](_0x8b1626['shift']());}catch(_0x228b17){_0x8b1626['push'](_0x8b1626['shift']());}}}(a64_0x3a41,0xccfba));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';function a64_0x3a41(){const _0x2839be=['skill','validation','write','created','test','Updated','source-fingerprint','1534239xdPksu','personal','action','\x20is\x20unchanged.','5475276dTGhHF','diagram-show','Skill\x20diagram\x20for\x20','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','company','2AieGSV','1610044HvfBJw','scope','appCode','Created','5780285jtrTXh','expected-diagram-revision','24lPtnZb','trim','Skill\x20diagram\x20validation\x20passed\x20for\x20','diagram-validate','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','version','\x20Skill\x20diagram\x20for\x20','skillCode','diagram-push',';\x20next\x20write\x20expects\x20revision\x20','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','5062968rvKfMO','10252764VEYNeu','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','str','3750813XtXxAj','diagram-file','Found\x20Skill\x20diagram\x20for\x20','num','found',';\x20first\x20write\x20expects\x20revision\x20'];a64_0x3a41=function(){return _0x2839be;};return a64_0x3a41();}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(_0x4c32f6){const _0x2097c1=a64_0x51d9,_0x978f9a=_0x4c32f6[_0x2097c1(0x101)]('skill-code')[_0x2097c1(0x120)](),_0x239a72=_0x4c32f6[_0x2097c1(0x101)]('version')[_0x2097c1(0x120)](),_0x4910c0=_0x4c32f6[_0x2097c1(0x101)]('scope');if(!_0x978f9a||!_0x239a72||_0x4910c0!==_0x2097c1(0x110)&&_0x4910c0!==_0x2097c1(0x117))throw CliErrors[_0x2097c1(0x109)](_0x2097c1(0x100));return{'skillCode':_0x978f9a,'version':_0x239a72,'scope':_0x4910c0};}async function readDiagramWriteInput(_0x65ac6b){const _0x29b3cc=a64_0x51d9,_0x284b94=_0x65ac6b[_0x29b3cc(0x105)](_0x29b3cc(0x11e)),_0x41117b=_0x65ac6b[_0x29b3cc(0x101)](_0x29b3cc(0x10e))[_0x29b3cc(0x120)]();if(!Number['isInteger'](_0x284b94)||_0x284b94<0x0)throw CliErrors[_0x29b3cc(0x109)](_0x29b3cc(0x116));if(!/^sha256:[0-9a-f]{64}$/[_0x29b3cc(0x10c)](_0x41117b))throw CliErrors[_0x29b3cc(0x109)](_0x29b3cc(0x123));return{'expectedDiagramRevision':_0x284b94,'sourceFingerprint':_0x41117b,'diagram':await readRequiredSkillDiagram(_0x65ac6b[_0x29b3cc(0x101)](_0x29b3cc(0x103)))};}export const diagramValidateCommand={'service':a64_0x2cc290(0x108),'command':a64_0x2cc290(0x122),'description':a64_0x2cc290(0x129),'risk':'read','flags':WRITE_FLAGS,async 'execute'(_0x3a2a88){const _0x5529c8=a64_0x2cc290,_0x435a61=readDiagramTarget(_0x3a2a88),_0x5bc4d=await validateRuntimeSkillVersionDiagram(_0x3a2a88['appCode'],_0x435a61['skillCode'],_0x435a61[_0x5529c8(0x124)],_0x435a61['scope'],await readDiagramWriteInput(_0x3a2a88));return{'ok':!![],'data':_0x5bc4d,'message':_0x5529c8(0x121)+_0x435a61[_0x5529c8(0x126)]+'@'+_0x435a61['version']+'.'};}};export const diagramPushCommand={'service':a64_0x2cc290(0x108),'command':a64_0x2cc290(0x127),'description':'为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','risk':a64_0x2cc290(0x10a),'confirmationDescription':'将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','flags':WRITE_FLAGS,async 'execute'(_0x2ce0b9){const _0x483c13=a64_0x2cc290,_0x339c00=readDiagramTarget(_0x2ce0b9),_0x3f33ca=await putRuntimeSkillVersionDiagram(_0x2ce0b9[_0x483c13(0x11b)],_0x339c00[_0x483c13(0x126)],_0x339c00[_0x483c13(0x124)],_0x339c00['scope'],await readDiagramWriteInput(_0x2ce0b9));return{'ok':!![],'data':_0x3f33ca,'message':_0x3f33ca[_0x483c13(0x111)]==='unchanged'?_0x483c13(0x115)+_0x339c00[_0x483c13(0x126)]+'@'+_0x339c00[_0x483c13(0x124)]+_0x483c13(0x112):(_0x3f33ca[_0x483c13(0x111)]===_0x483c13(0x10b)?_0x483c13(0x11c):_0x483c13(0x10d))+_0x483c13(0x125)+_0x339c00[_0x483c13(0x126)]+'@'+_0x339c00[_0x483c13(0x124)]+'.'};}};export const diagramShowCommand={'service':a64_0x2cc290(0x108),'command':a64_0x2cc290(0x114),'description':'Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','risk':'read','flags':TARGET_FLAGS,async 'execute'(_0x3a1566){const _0x57763c=a64_0x2cc290,_0x31cc23=readDiagramTarget(_0x3a1566),_0x1a00b9=await getRuntimeSkillVersionDiagram(_0x3a1566[_0x57763c(0x11b)],_0x31cc23[_0x57763c(0x126)],_0x31cc23[_0x57763c(0x124)],_0x31cc23[_0x57763c(0x11a)]);return{'ok':!![],'data':_0x1a00b9,'message':_0x1a00b9[_0x57763c(0x106)]?_0x57763c(0x104)+_0x31cc23['skillCode']+'@'+_0x31cc23[_0x57763c(0x124)]+_0x57763c(0x128)+_0x1a00b9['expectedDiagramRevision']+'.':'No\x20Skill\x20diagram\x20is\x20stored\x20for\x20'+_0x31cc23[_0x57763c(0x126)]+'@'+_0x31cc23[_0x57763c(0x124)]+_0x57763c(0x107)+_0x1a00b9['expectedDiagramRevision']+'.'};}};
@@ -1 +1 @@
1
- const a65_0x4f4335=a65_0x3c04;(function(_0x44197f,_0x48908f){const _0x311d56=a65_0x3c04,_0x118176=_0x44197f();while(!![]){try{const _0x55a00c=-parseInt(_0x311d56(0x158))/0x1*(parseInt(_0x311d56(0x15e))/0x2)+-parseInt(_0x311d56(0x15a))/0x3*(-parseInt(_0x311d56(0x14c))/0x4)+parseInt(_0x311d56(0x156))/0x5+-parseInt(_0x311d56(0x148))/0x6+-parseInt(_0x311d56(0x152))/0x7+-parseInt(_0x311d56(0x14e))/0x8+parseInt(_0x311d56(0x153))/0x9;if(_0x55a00c===_0x48908f)break;else _0x118176['push'](_0x118176['shift']());}catch(_0x4d2999){_0x118176['push'](_0x118176['shift']());}}}(a65_0x1218,0x380d0));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':'skill','command':a65_0x4f4335(0x167),'description':'Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','risk':'read','requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x1ba4dc){return syncRuntimeSkills(_0x1ba4dc);}};function a65_0x3c04(_0x315771,_0x412f4e){_0x315771=_0x315771-0x145;const _0x12185c=a65_0x1218();let _0x3c0409=_0x12185c[_0x315771];return _0x3c0409;}async function syncRuntimeSkills(_0x28fb5a){const _0x426f61=a65_0x4f4335,{downloadRuntimeSkillPackage:_0x4207c6,listRuntimeSkills:_0x2aa43e}=await import(_0x426f61(0x157)),{linkEffectiveRuntimeSkills:_0x4d953f,materializeRuntimeSkill:_0x51dffa,pruneStaleRuntimeSkillCache:_0x461139,pruneStaleRuntimeSkillLinks:_0x1156fa,resolveRuntimeSkillInstallTarget:_0x13e730}=await import(_0x426f61(0x169)),_0x125258=_0x28fb5a[_0x426f61(0x155)](_0x426f61(0x164)),_0x2fe815=normalizeSyncScopes(_0x28fb5a[_0x426f61(0x155)](_0x426f61(0x16a))),_0x5a2dd0=_0x28fb5a[_0x426f61(0x165)]??'production',_0x1ecbb6=_0x28fb5a['accessKey'],_0xd07912=_0x28fb5a[_0x426f61(0x14f)](_0x426f61(0x14b));if(!_0x1ecbb6)throw CliErrors[_0x426f61(0x162)](_0x426f61(0x14d));const _0x2217b8=_0x13e730(_0x28fb5a['appCode'],_0x28fb5a['bool'](_0x426f61(0x150))?_0x426f61(0x150):'global'),_0x3135e3=_0x13e730(_0x28fb5a[_0x426f61(0x16b)],_0x2217b8[_0x426f61(0x16a)]===_0x426f61(0x150)?'global':_0x426f61(0x150)),_0x3e35b0=await Promise[_0x426f61(0x15f)](_0x2fe815[_0x426f61(0x15d)](_0x1a3e76=>_0x2aa43e({'appCode':_0x28fb5a[_0x426f61(0x16b)],'scope':_0x1a3e76,'code':_0x125258[_0x426f61(0x166)]()||undefined}))),_0xb913fd=_0x2fe815[_0x426f61(0x159)]('personal')?_0x3e35b0[_0x426f61(0x147)]((_0x23c61b,_0x45323c)=>_0x2fe815[_0x45323c]===_0x426f61(0x151)?_0x23c61b[_0x426f61(0x151)]:[]):[],_0x4a3089=_0x2fe815['includes'](_0x426f61(0x16d))?_0x3e35b0[_0x426f61(0x147)]((_0x4f3e99,_0x165d7d)=>_0x2fe815[_0x165d7d]===_0x426f61(0x16d)?_0x4f3e99[_0x426f61(0x16d)]:[]):[],_0x26b21c=new Set([..._0xb913fd[_0x426f61(0x15d)](_0x499e66=>_0x499e66['skillCode']?.[_0x426f61(0x166)]())[_0x426f61(0x154)](_0x248e8a=>Boolean(_0x248e8a)),..._0x4a3089[_0x426f61(0x15d)](_0x18faf2=>_0x18faf2[_0x426f61(0x145)]?.[_0x426f61(0x166)]())[_0x426f61(0x154)](_0x32d507=>Boolean(_0x32d507))]),_0x19c429=_0x125258[_0x426f61(0x166)]()?[_0x125258[_0x426f61(0x166)]()]:undefined,_0x17554c=_0x2fe815[_0x426f61(0x160)]===0x2&&_0x2fe815[_0x426f61(0x159)]('personal')&&_0x2fe815['includes'](_0x426f61(0x16d)),_0x166a8b=_0x17554c?_0x1156fa(_0x2217b8,_0x26b21c,_0x19c429):[],_0xe92b65=_0x461139({'env':_0x5a2dd0,'accessKey':_0x1ecbb6,'appCode':_0x28fb5a['appCode'],'activeSkillCodes':_0x26b21c,'pruneSkillCodes':_0x19c429,'scopes':_0x2fe815,'protectedLinkRoots':_0x3135e3['skillRoots']}),_0x177349=[];for(const _0x3eb2a7 of _0xb913fd){_0x177349[_0x426f61(0x168)](_0x51dffa(_0x3eb2a7,_0x426f61(0x151),{'env':_0x5a2dd0,'accessKey':_0x1ecbb6,'appCode':_0x28fb5a[_0x426f61(0x16b)],'force':_0xd07912,'packageBytes':await downloadSkillPackage(_0x3eb2a7,_0x426f61(0x151),_0x28fb5a[_0x426f61(0x16b)],_0x4207c6)}));}for(const _0x2e72d9 of _0x4a3089){_0x177349[_0x426f61(0x168)](_0x51dffa(_0x2e72d9,_0x426f61(0x16d),{'env':_0x5a2dd0,'accessKey':_0x1ecbb6,'appCode':_0x28fb5a[_0x426f61(0x16b)],'force':_0xd07912,'packageBytes':await downloadSkillPackage(_0x2e72d9,_0x426f61(0x16d),_0x28fb5a[_0x426f61(0x16b)],_0x4207c6)}));}const _0x4b89e6=_0x4d953f(_0x177349,_0x2217b8),_0x2f029c=countLinkActions(_0x4b89e6);return{'ok':!![],'data':{'appCode':_0x28fb5a[_0x426f61(0x16b)],..._0x2217b8[_0x426f61(0x16a)]===_0x426f61(0x150)?{'installTarget':{'scope':_0x2217b8[_0x426f61(0x16a)],'skillRoots':[..._0x2217b8[_0x426f61(0x14a)]]}}:{},'personal':_0xb913fd[_0x426f61(0x160)],'company':_0x4a3089['length'],'materialized':_0x177349[_0x426f61(0x160)],'links':{'total':_0x4b89e6[_0x426f61(0x160)],'created':_0x2f029c[_0x426f61(0x161)]??0x0,'updated':_0x2f029c[_0x426f61(0x15c)]??0x0,'unchanged':_0x2f029c['unchanged']??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x166a8b[_0x426f61(0x154)](_0x5e7d35=>_0x5e7d35['action']===_0x426f61(0x163))['length'],'cacheDirs':_0xe92b65[_0x426f61(0x154)](_0x4377a0=>_0x4377a0[_0x426f61(0x149)]===_0x426f61(0x163))[_0x426f61(0x160)],'skipped':[..._0x166a8b,..._0xe92b65]['filter'](_0x238890=>_0x238890[_0x426f61(0x149)]==='skipped')['length']},'skills':{'personal':_0xb913fd[_0x426f61(0x15d)](summarizeRuntimeSkill),'company':_0x4a3089['map'](summarizeRuntimeSkill)}},'message':_0x426f61(0x146)+_0xb913fd['length']+'\x20personal\x20and\x20'+_0x4a3089['length']+'\x20company\x20Skill(s).'};}async function downloadSkillPackage(_0x2c0959,_0x235730,_0x5da9dd,_0x185f98){const _0x1151df=a65_0x4f4335,_0x3044e0=_0x2c0959[_0x1151df(0x15b)]?.[_0x1151df(0x166)]();return _0x3044e0?_0x185f98(_0x235730,_0x2c0959[_0x1151df(0x145)],_0x5da9dd,_0x3044e0):_0x185f98(_0x235730,_0x2c0959['skillCode'],_0x5da9dd);}function a65_0x1218(){const _0x418d0e=['company','skillCode','Installed\x20','flatMap','463698uIeDiF','action','skillRoots','force','1164404ENlsNC','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','2304768cqRgTQ','bool','project','personal','2616201FIvEFM','3977271rslBwj','filter','str','1687570mzPhyt','../../../core/api-client.js','101828eLDcTQ','includes','3QjaVVd','version','updated','map','2UAueNw','all','length','created','authRequired','removed','code','envName','trim','install','push','../../../skills/runtime-skill-sync.js','scope','appCode','reduce'];a65_0x1218=function(){return _0x418d0e;};return a65_0x1218();}function countLinkActions(_0x5496df){const _0x49e543=a65_0x4f4335;return _0x5496df[_0x49e543(0x16c)]((_0x190eee,_0x192f95)=>{const _0x2b4aa3=_0x49e543;return _0x190eee[_0x192f95[_0x2b4aa3(0x149)]]=(_0x190eee[_0x192f95[_0x2b4aa3(0x149)]]??0x0)+0x1,_0x190eee;},{});}
1
+ const a65_0x2ee19e=a65_0x5e86;(function(_0x5ce6d5,_0x347366){const _0x404586=a65_0x5e86,_0x9a1182=_0x5ce6d5();while(!![]){try{const _0x299acf=parseInt(_0x404586(0x7c))/0x1*(parseInt(_0x404586(0x86))/0x2)+-parseInt(_0x404586(0x9b))/0x3*(-parseInt(_0x404586(0x7b))/0x4)+parseInt(_0x404586(0x83))/0x5+parseInt(_0x404586(0x7f))/0x6+-parseInt(_0x404586(0x80))/0x7+-parseInt(_0x404586(0x85))/0x8*(parseInt(_0x404586(0x82))/0x9)+-parseInt(_0x404586(0x92))/0xa;if(_0x299acf===_0x347366)break;else _0x9a1182['push'](_0x9a1182['shift']());}catch(_0x1ffb76){_0x9a1182['push'](_0x9a1182['shift']());}}}(a65_0xb563,0xdf0f2));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';function a65_0xb563(){const _0x51418c=['2103WAjWLm','all','production','reduce','filter','skillRoots','length','created','removed','code','personal','appCode','force','../../../skills/runtime-skill-sync.js','6412NUzanq','82714qPfNhf','push','includes','9349494DkYBxz','12502686csbERo','updated','348237EVmrbO','5545180HlBhTI','flatMap','168EZugJu','2WoYJen','envName','bool','\x20company\x20Skill(s).','skillCode','version','scope','Installed\x20','map','str','authRequired','unchanged','3614010gUipWD','read','trim','company','action','skill','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','accessKey','project'];a65_0xb563=function(){return _0x51418c;};return a65_0xb563();}import{normalizeSyncScopes}from'../scopes.js';function a65_0x5e86(_0x3c377d,_0x2a485d){_0x3c377d=_0x3c377d-0x7b;const _0xb56303=a65_0xb563();let _0x5e862b=_0xb56303[_0x3c377d];return _0x5e862b;}import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':a65_0x2ee19e(0x97),'command':'install','description':a65_0x2ee19e(0x98),'risk':a65_0x2ee19e(0x93),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x834503){return syncRuntimeSkills(_0x834503);}};async function syncRuntimeSkills(_0x5c739b){const _0x51a8a4=a65_0x2ee19e,{downloadRuntimeSkillPackage:_0x27d84a,listRuntimeSkills:_0x1630de}=await import('../../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x1182a2,materializeRuntimeSkill:_0x5dc3eb,pruneStaleRuntimeSkillCache:_0xad5c06,pruneStaleRuntimeSkillLinks:_0x2cda4f,resolveRuntimeSkillInstallTarget:_0x57660a}=await import(_0x51a8a4(0xa8)),_0x1825db=_0x5c739b['str'](_0x51a8a4(0xa4)),_0xfd2aa0=normalizeSyncScopes(_0x5c739b[_0x51a8a4(0x8f)](_0x51a8a4(0x8c))),_0x151105=_0x5c739b[_0x51a8a4(0x87)]??_0x51a8a4(0x9d),_0x40b4ab=_0x5c739b[_0x51a8a4(0x99)],_0x5354e2=_0x5c739b[_0x51a8a4(0x88)](_0x51a8a4(0xa7));if(!_0x40b4ab)throw CliErrors[_0x51a8a4(0x90)]('Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.');const _0x8f8518=_0x57660a(_0x5c739b[_0x51a8a4(0xa6)],_0x5c739b['bool'](_0x51a8a4(0x9a))?_0x51a8a4(0x9a):'global'),_0x301616=_0x57660a(_0x5c739b[_0x51a8a4(0xa6)],_0x8f8518[_0x51a8a4(0x8c)]==='project'?'global':'project'),_0x5dd565=await Promise[_0x51a8a4(0x9c)](_0xfd2aa0[_0x51a8a4(0x8e)](_0x3fc097=>_0x1630de({'appCode':_0x5c739b['appCode'],'scope':_0x3fc097,'code':_0x1825db[_0x51a8a4(0x94)]()||undefined}))),_0x4ee934=_0xfd2aa0[_0x51a8a4(0x7e)](_0x51a8a4(0xa5))?_0x5dd565[_0x51a8a4(0x84)]((_0x263da3,_0x54f3de)=>_0xfd2aa0[_0x54f3de]===_0x51a8a4(0xa5)?_0x263da3[_0x51a8a4(0xa5)]:[]):[],_0x540270=_0xfd2aa0[_0x51a8a4(0x7e)](_0x51a8a4(0x95))?_0x5dd565[_0x51a8a4(0x84)]((_0x2c488f,_0x62be35)=>_0xfd2aa0[_0x62be35]==='company'?_0x2c488f[_0x51a8a4(0x95)]:[]):[],_0x53aafc=new Set([..._0x4ee934[_0x51a8a4(0x8e)](_0x4429fd=>_0x4429fd['skillCode']?.[_0x51a8a4(0x94)]())[_0x51a8a4(0x9f)](_0x41c7ce=>Boolean(_0x41c7ce)),..._0x540270[_0x51a8a4(0x8e)](_0x2b250d=>_0x2b250d[_0x51a8a4(0x8a)]?.[_0x51a8a4(0x94)]())[_0x51a8a4(0x9f)](_0x38972b=>Boolean(_0x38972b))]),_0x4e281d=_0x1825db[_0x51a8a4(0x94)]()?[_0x1825db['trim']()]:undefined,_0x97f5f6=_0xfd2aa0[_0x51a8a4(0xa1)]===0x2&&_0xfd2aa0[_0x51a8a4(0x7e)]('personal')&&_0xfd2aa0['includes'](_0x51a8a4(0x95)),_0xcfeddf=_0x97f5f6?_0x2cda4f(_0x8f8518,_0x53aafc,_0x4e281d):[],_0x136858=_0xad5c06({'env':_0x151105,'accessKey':_0x40b4ab,'appCode':_0x5c739b['appCode'],'activeSkillCodes':_0x53aafc,'pruneSkillCodes':_0x4e281d,'scopes':_0xfd2aa0,'protectedLinkRoots':_0x301616[_0x51a8a4(0xa0)]}),_0x3388db=[];for(const _0x265fba of _0x4ee934){_0x3388db[_0x51a8a4(0x7d)](_0x5dc3eb(_0x265fba,'personal',{'env':_0x151105,'accessKey':_0x40b4ab,'appCode':_0x5c739b[_0x51a8a4(0xa6)],'force':_0x5354e2,'packageBytes':await downloadSkillPackage(_0x265fba,'personal',_0x5c739b[_0x51a8a4(0xa6)],_0x27d84a)}));}for(const _0x2a9c2b of _0x540270){_0x3388db[_0x51a8a4(0x7d)](_0x5dc3eb(_0x2a9c2b,_0x51a8a4(0x95),{'env':_0x151105,'accessKey':_0x40b4ab,'appCode':_0x5c739b['appCode'],'force':_0x5354e2,'packageBytes':await downloadSkillPackage(_0x2a9c2b,_0x51a8a4(0x95),_0x5c739b[_0x51a8a4(0xa6)],_0x27d84a)}));}const _0x5b12b5=_0x1182a2(_0x3388db,_0x8f8518),_0x4e4b87=countLinkActions(_0x5b12b5);return{'ok':!![],'data':{'appCode':_0x5c739b[_0x51a8a4(0xa6)],..._0x8f8518[_0x51a8a4(0x8c)]===_0x51a8a4(0x9a)?{'installTarget':{'scope':_0x8f8518[_0x51a8a4(0x8c)],'skillRoots':[..._0x8f8518['skillRoots']]}}:{},'personal':_0x4ee934['length'],'company':_0x540270['length'],'materialized':_0x3388db[_0x51a8a4(0xa1)],'links':{'total':_0x5b12b5[_0x51a8a4(0xa1)],'created':_0x4e4b87[_0x51a8a4(0xa2)]??0x0,'updated':_0x4e4b87[_0x51a8a4(0x81)]??0x0,'unchanged':_0x4e4b87[_0x51a8a4(0x91)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0xcfeddf['filter'](_0x386909=>_0x386909[_0x51a8a4(0x96)]===_0x51a8a4(0xa3))[_0x51a8a4(0xa1)],'cacheDirs':_0x136858['filter'](_0xb4aaa6=>_0xb4aaa6['action']===_0x51a8a4(0xa3))[_0x51a8a4(0xa1)],'skipped':[..._0xcfeddf,..._0x136858]['filter'](_0x350de8=>_0x350de8['action']==='skipped')[_0x51a8a4(0xa1)]},'skills':{'personal':_0x4ee934[_0x51a8a4(0x8e)](summarizeRuntimeSkill),'company':_0x540270['map'](summarizeRuntimeSkill)}},'message':_0x51a8a4(0x8d)+_0x4ee934[_0x51a8a4(0xa1)]+'\x20personal\x20and\x20'+_0x540270[_0x51a8a4(0xa1)]+_0x51a8a4(0x89)};}async function downloadSkillPackage(_0x309dbd,_0x3e1f72,_0x395fdd,_0xc25d7b){const _0x592974=a65_0x2ee19e,_0x2ad31c=_0x309dbd[_0x592974(0x8b)]?.['trim']();return _0x2ad31c?_0xc25d7b(_0x3e1f72,_0x309dbd[_0x592974(0x8a)],_0x395fdd,_0x2ad31c):_0xc25d7b(_0x3e1f72,_0x309dbd[_0x592974(0x8a)],_0x395fdd);}function countLinkActions(_0x23f8eb){const _0x51568a=a65_0x2ee19e;return _0x23f8eb[_0x51568a(0x9e)]((_0x2156b6,_0x3a1a0f)=>{const _0x44a577=_0x51568a;return _0x2156b6[_0x3a1a0f[_0x44a577(0x96)]]=(_0x2156b6[_0x3a1a0f[_0x44a577(0x96)]]??0x0)+0x1,_0x2156b6;},{});}
@@ -1 +1 @@
1
- const a66_0x42a1b0=a66_0x3904;(function(_0x4cf755,_0x1e2c2a){const _0x403fd6=a66_0x3904,_0x2e9736=_0x4cf755();while(!![]){try{const _0x12bba1=parseInt(_0x403fd6(0x160))/0x1*(-parseInt(_0x403fd6(0x16c))/0x2)+parseInt(_0x403fd6(0x154))/0x3*(parseInt(_0x403fd6(0x162))/0x4)+parseInt(_0x403fd6(0x163))/0x5+-parseInt(_0x403fd6(0x158))/0x6*(parseInt(_0x403fd6(0x164))/0x7)+-parseInt(_0x403fd6(0x166))/0x8*(parseInt(_0x403fd6(0x15e))/0x9)+-parseInt(_0x403fd6(0x165))/0xa*(parseInt(_0x403fd6(0x17a))/0xb)+parseInt(_0x403fd6(0x172))/0xc*(parseInt(_0x403fd6(0x15c))/0xd);if(_0x12bba1===_0x1e2c2a)break;else _0x2e9736['push'](_0x2e9736['shift']());}catch(_0x386c5d){_0x2e9736['push'](_0x2e9736['shift']());}}}(a66_0x32b8,0x327a1));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';function a66_0x3904(_0xba3a36,_0x3f0c4c){_0xba3a36=_0xba3a36-0x154;const _0x32b851=a66_0x32b8();let _0x390416=_0x32b851[_0xba3a36];return _0x390416;}function a66_0x32b8(){const _0x191b83=['project','60dNJDVi','filter','code','\x20local\x20Skill(s).','bool','production','scope','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','45727VGVQNm','Listed\x20','3PxTXrs','remote','accessKey','global','78kdUZIX','local','length','../../../core/api-client.js','775996sOIkwt','envName','19593QttOfJ','skill','39ZELKQl','map','861132MafNnR','316065Otumug','49798bDJRDi','130TkoQse','696IjnOrM','list','../../../skills/runtime-skill-sync.js','authRequired','personal','builtin','1758iXJRLX','appCode','trim','company','str'];a66_0x32b8=function(){return _0x191b83;};return a66_0x32b8();}import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a66_0x42a1b0(0x15f),'command':a66_0x42a1b0(0x167),'description':a66_0x42a1b0(0x179),'risk':'read','flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x1fe802){const _0x2ab003=a66_0x42a1b0,_0x1c793d=_0x1fe802[_0x2ab003(0x170)](_0x2ab003(0x174)),_0x54fb01=normalizeListScope(_0x1fe802['str'](_0x2ab003(0x178)));if(_0x1fe802[_0x2ab003(0x176)](_0x2ab003(0x159))){const _0x1dd2f7=_0x1fe802[_0x2ab003(0x156)];if(!_0x1dd2f7)throw CliErrors[_0x2ab003(0x169)]();const {listLocalRuntimeSkills:_0x58846d,resolveRuntimeSkillInstallTarget:_0x4a86d9}=await import(_0x2ab003(0x168)),_0x5ad0c1=_0x4a86d9(_0x1fe802[_0x2ab003(0x16d)],_0x1fe802['bool'](_0x2ab003(0x171))?_0x2ab003(0x171):_0x2ab003(0x157)),_0x581983=_0x58846d({'env':_0x1fe802[_0x2ab003(0x15d)]??_0x2ab003(0x177),'accessKey':_0x1dd2f7,'appCode':_0x1fe802[_0x2ab003(0x16d)],'scopes':listScopeToRuntimeScopes(_0x54fb01),'code':_0x1c793d[_0x2ab003(0x16e)]()||undefined},_0x5ad0c1),_0xa49d8=groupLocalRuntimeSkills(_0x581983);return{'ok':!![],'data':{'appCode':_0x1fe802['appCode'],'source':_0x2ab003(0x159),..._0x5ad0c1[_0x2ab003(0x178)]===_0x2ab003(0x171)?{'installScope':_0x5ad0c1[_0x2ab003(0x178)]}:{},'scope':_0x54fb01,'total':_0x581983[_0x2ab003(0x15a)],'personal':_0xa49d8[_0x2ab003(0x16a)]['length'],'company':_0xa49d8[_0x2ab003(0x16f)]['length'],'items':_0x581983[_0x2ab003(0x161)](summarizeLocalRuntimeSkill),'skills':{'personal':_0xa49d8[_0x2ab003(0x16a)][_0x2ab003(0x161)](summarizeLocalRuntimeSkill),'company':_0xa49d8['company'][_0x2ab003(0x161)](summarizeLocalRuntimeSkill)}},'message':'Listed\x20'+_0x581983[_0x2ab003(0x15a)]+_0x2ab003(0x175)};}const {listRuntimeSkills:_0x29154a}=await import(_0x2ab003(0x15b)),_0x300eb5=await _0x29154a({'appCode':_0x1fe802[_0x2ab003(0x16d)],'scope':listScopeToRemoteScope(_0x54fb01),'code':_0x1c793d['trim']()||undefined}),_0x20d9dc=shouldListScope(_0x54fb01,'personal')?_0x300eb5[_0x2ab003(0x16a)]??[]:[],_0x10028d=shouldListScope(_0x54fb01,_0x2ab003(0x16f))?_0x300eb5[_0x2ab003(0x16f)]??[]:[],_0x5926c8=[..._0x20d9dc,..._0x10028d];return{'ok':!![],'data':{'appCode':_0x1fe802[_0x2ab003(0x16d)],'source':_0x2ab003(0x155),'scope':_0x54fb01,'total':_0x5926c8['length'],'personal':_0x20d9dc[_0x2ab003(0x15a)],'company':_0x10028d[_0x2ab003(0x15a)],'items':_0x5926c8[_0x2ab003(0x161)](summarizeRuntimeSkill),'skills':{'personal':_0x20d9dc['map'](summarizeRuntimeSkill),'company':_0x10028d[_0x2ab003(0x161)](summarizeRuntimeSkill)}},'message':_0x2ab003(0x17b)+_0x5926c8[_0x2ab003(0x15a)]+'\x20remote\x20Skill(s).'};}};function groupLocalRuntimeSkills(_0x3f316e){const _0x4f4f4b=a66_0x42a1b0;return{'personal':_0x3f316e['filter'](_0x2a8642=>_0x2a8642[_0x4f4f4b(0x178)]===_0x4f4f4b(0x16a)),'company':_0x3f316e[_0x4f4f4b(0x173)](_0x4fa923=>_0x4fa923['scope']===_0x4f4f4b(0x16f)),'builtin':_0x3f316e[_0x4f4f4b(0x173)](_0x28c2db=>_0x28c2db['scope']===_0x4f4f4b(0x16b))};}
1
+ const a66_0x25b328=a66_0x2a21;(function(_0x5a7440,_0x137f02){const _0x239a64=a66_0x2a21,_0x3041d6=_0x5a7440();while(!![]){try{const _0x528986=-parseInt(_0x239a64(0x118))/0x1+parseInt(_0x239a64(0x135))/0x2+parseInt(_0x239a64(0x11c))/0x3+-parseInt(_0x239a64(0x132))/0x4+parseInt(_0x239a64(0x130))/0x5+parseInt(_0x239a64(0x12f))/0x6+parseInt(_0x239a64(0x128))/0x7*(parseInt(_0x239a64(0x12a))/0x8);if(_0x528986===_0x137f02)break;else _0x3041d6['push'](_0x3041d6['shift']());}catch(_0x6901af){_0x3041d6['push'](_0x3041d6['shift']());}}}(a66_0x4e3b,0xed46b));import{CliErrors}from'../../../errors.js';function a66_0x4e3b(){const _0x133b93=['bool','builtin','list','project','\x20local\x20Skill(s).','Listed\x20','accessKey','1323QZifYu','personal','3576DyxPua','filter','local','skill','global','5578392GlcgXp','5577600TeTjAj','company','3387960hCgHpB','map','../../../core/api-client.js','608132yCyqbv','scope','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','str','942574OUCPmC','appCode','length','read','982938NXWrUQ','production','authRequired','\x20remote\x20Skill(s).','trim'];a66_0x4e3b=function(){return _0x133b93;};return a66_0x4e3b();}import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';function a66_0x2a21(_0x1a949f,_0x46bb48){_0x1a949f=_0x1a949f-0x115;const _0x4e3b8d=a66_0x4e3b();let _0x2a21be=_0x4e3b8d[_0x1a949f];return _0x2a21be;}import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a66_0x25b328(0x12d),'command':a66_0x25b328(0x123),'description':a66_0x25b328(0x116),'risk':a66_0x25b328(0x11b),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x1f54f4){const _0x249297=a66_0x25b328,_0x320307=_0x1f54f4[_0x249297(0x117)]('code'),_0x40d56f=normalizeListScope(_0x1f54f4['str'](_0x249297(0x115)));if(_0x1f54f4[_0x249297(0x121)]('local')){const _0x531a92=_0x1f54f4[_0x249297(0x127)];if(!_0x531a92)throw CliErrors[_0x249297(0x11e)]();const {listLocalRuntimeSkills:_0x3e7577,resolveRuntimeSkillInstallTarget:_0x54e838}=await import('../../../skills/runtime-skill-sync.js'),_0x4d7da1=_0x54e838(_0x1f54f4[_0x249297(0x119)],_0x1f54f4['bool'](_0x249297(0x124))?_0x249297(0x124):_0x249297(0x12e)),_0x3f627b=_0x3e7577({'env':_0x1f54f4['envName']??_0x249297(0x11d),'accessKey':_0x531a92,'appCode':_0x1f54f4[_0x249297(0x119)],'scopes':listScopeToRuntimeScopes(_0x40d56f),'code':_0x320307[_0x249297(0x120)]()||undefined},_0x4d7da1),_0x3081d5=groupLocalRuntimeSkills(_0x3f627b);return{'ok':!![],'data':{'appCode':_0x1f54f4[_0x249297(0x119)],'source':_0x249297(0x12c),..._0x4d7da1[_0x249297(0x115)]===_0x249297(0x124)?{'installScope':_0x4d7da1[_0x249297(0x115)]}:{},'scope':_0x40d56f,'total':_0x3f627b[_0x249297(0x11a)],'personal':_0x3081d5[_0x249297(0x129)][_0x249297(0x11a)],'company':_0x3081d5[_0x249297(0x131)]['length'],'items':_0x3f627b[_0x249297(0x133)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x3081d5[_0x249297(0x129)][_0x249297(0x133)](summarizeLocalRuntimeSkill),'company':_0x3081d5[_0x249297(0x131)][_0x249297(0x133)](summarizeLocalRuntimeSkill)}},'message':_0x249297(0x126)+_0x3f627b[_0x249297(0x11a)]+_0x249297(0x125)};}const {listRuntimeSkills:_0x4de29}=await import(_0x249297(0x134)),_0xa77cfb=await _0x4de29({'appCode':_0x1f54f4[_0x249297(0x119)],'scope':listScopeToRemoteScope(_0x40d56f),'code':_0x320307[_0x249297(0x120)]()||undefined}),_0x849231=shouldListScope(_0x40d56f,_0x249297(0x129))?_0xa77cfb['personal']??[]:[],_0x593c9a=shouldListScope(_0x40d56f,'company')?_0xa77cfb[_0x249297(0x131)]??[]:[],_0x5f1130=[..._0x849231,..._0x593c9a];return{'ok':!![],'data':{'appCode':_0x1f54f4['appCode'],'source':'remote','scope':_0x40d56f,'total':_0x5f1130[_0x249297(0x11a)],'personal':_0x849231[_0x249297(0x11a)],'company':_0x593c9a['length'],'items':_0x5f1130['map'](summarizeRuntimeSkill),'skills':{'personal':_0x849231[_0x249297(0x133)](summarizeRuntimeSkill),'company':_0x593c9a[_0x249297(0x133)](summarizeRuntimeSkill)}},'message':_0x249297(0x126)+_0x5f1130[_0x249297(0x11a)]+_0x249297(0x11f)};}};function groupLocalRuntimeSkills(_0x2a01ed){const _0x3a0092=a66_0x25b328;return{'personal':_0x2a01ed[_0x3a0092(0x12b)](_0x19eeda=>_0x19eeda[_0x3a0092(0x115)]===_0x3a0092(0x129)),'company':_0x2a01ed[_0x3a0092(0x12b)](_0x5e0d7a=>_0x5e0d7a[_0x3a0092(0x115)]===_0x3a0092(0x131)),'builtin':_0x2a01ed[_0x3a0092(0x12b)](_0x5a3f30=>_0x5a3f30[_0x3a0092(0x115)]===_0x3a0092(0x122))};}
@@ -1 +1 @@
1
- const a67_0x535d29=a67_0x3155;function a67_0x5574(){const _0x4afa37=['400203KOFKZS','900908IASjTV','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','1243024fbrosc','864760YlvUic','push','skill','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','6vgUEQh','757712BMJNCL','1303995FFmqEM','505425ITDytz'];a67_0x5574=function(){return _0x4afa37;};return a67_0x5574();}function a67_0x3155(_0x4ae462,_0x501cc8){_0x4ae462=_0x4ae462-0x174;const _0x557455=a67_0x5574();let _0x3155e8=_0x557455[_0x4ae462];return _0x3155e8;}(function(_0x52b375,_0x557e06){const _0x3e9b27=a67_0x3155,_0x3252db=_0x52b375();while(!![]){try{const _0xeb8a69=-parseInt(_0x3e9b27(0x17b))/0x1+parseInt(_0x3e9b27(0x178))/0x2+parseInt(_0x3e9b27(0x17a))/0x3+parseInt(_0x3e9b27(0x17c))/0x4+parseInt(_0x3e9b27(0x17f))/0x5*(parseInt(_0x3e9b27(0x177))/0x6)+-parseInt(_0x3e9b27(0x179))/0x7+-parseInt(_0x3e9b27(0x17e))/0x8;if(_0xeb8a69===_0x557e06)break;else _0x3252db['push'](_0x3252db['shift']());}catch(_0x2d45bd){_0x3252db['push'](_0x3252db['shift']());}}}(a67_0x5574,0x31b7c));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':a67_0x535d29(0x175),'command':a67_0x535d29(0x174),'description':a67_0x535d29(0x176),'risk':'write','confirmationDescription':a67_0x535d29(0x17d),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
1
+ const a67_0x5bada1=a67_0xa879;function a67_0xa879(_0x18bf44,_0x23edc7){_0x18bf44=_0x18bf44-0x1d2;const _0x3faf79=a67_0x3faf();let _0xa879e4=_0x3faf79[_0x18bf44];return _0xa879e4;}(function(_0x276bc0,_0x485fb9){const _0x33dad8=a67_0xa879,_0x9f2959=_0x276bc0();while(!![]){try{const _0x320470=parseInt(_0x33dad8(0x1d3))/0x1*(parseInt(_0x33dad8(0x1d9))/0x2)+parseInt(_0x33dad8(0x1d5))/0x3+parseInt(_0x33dad8(0x1d4))/0x4+-parseInt(_0x33dad8(0x1d8))/0x5*(-parseInt(_0x33dad8(0x1dc))/0x6)+parseInt(_0x33dad8(0x1de))/0x7+-parseInt(_0x33dad8(0x1da))/0x8+-parseInt(_0x33dad8(0x1dd))/0x9*(parseInt(_0x33dad8(0x1d2))/0xa);if(_0x320470===_0x485fb9)break;else _0x9f2959['push'](_0x9f2959['shift']());}catch(_0x3937dd){_0x9f2959['push'](_0x9f2959['shift']());}}}(a67_0x3faf,0x6bdb5));function a67_0x3faf(){const _0x53686a=['4719672KOcslj','push','6vdZFth','9yBHBVk','2390745OenChp','skill','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','12897610NKehIC','37oihiBt','3198940CaFNun','1285425BJBdcJ','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','write','147765yxKxvs','39038QtoBOP'];a67_0x3faf=function(){return _0x53686a;};return a67_0x3faf();}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':a67_0x5bada1(0x1df),'command':a67_0x5bada1(0x1db),'description':a67_0x5bada1(0x1e0),'risk':a67_0x5bada1(0x1d7),'confirmationDescription':a67_0x5bada1(0x1d6),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};