@lovrabet/lovrabet-cli 2.3.1-beta.1 → 2.3.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) 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/init.d.ts +1 -1
  25. package/lib/commands/config/init.js +1 -1
  26. package/lib/commands/config/shared.js +1 -1
  27. package/lib/commands/data/index.js +1 -1
  28. package/lib/commands/dataset/detail.js +1 -1
  29. package/lib/commands/dataset/index.js +1 -1
  30. package/lib/commands/dataset/list.js +1 -1
  31. package/lib/commands/dataset/sdk-doc.js +1 -1
  32. package/lib/commands/doctor.js +1 -1
  33. package/lib/commands/file/index.js +1 -1
  34. package/lib/commands/init.js +1 -1
  35. package/lib/commands/kb/index.js +1 -1
  36. package/lib/commands/logs/index.js +1 -1
  37. package/lib/commands/notification/config-list.js +1 -1
  38. package/lib/commands/notification/index.js +1 -1
  39. package/lib/commands/notification/shared.js +1 -1
  40. package/lib/commands/ocr/index.js +1 -1
  41. package/lib/commands/permit/dataset-get.js +1 -1
  42. package/lib/commands/permit/dataset-set.js +1 -1
  43. package/lib/commands/permit/index.js +1 -1
  44. package/lib/commands/permit/page-get.js +1 -1
  45. package/lib/commands/permit/page-set.js +1 -1
  46. package/lib/commands/permit/role-menus-set.js +1 -1
  47. package/lib/commands/permit/role-menus.js +1 -1
  48. package/lib/commands/permit/shared.js +1 -1
  49. package/lib/commands/personal-bff/index.js +1 -1
  50. package/lib/commands/registry.js +1 -1
  51. package/lib/commands/role/create.js +1 -1
  52. package/lib/commands/role/delete.js +1 -1
  53. package/lib/commands/role/detail.js +1 -1
  54. package/lib/commands/role/index.js +1 -1
  55. package/lib/commands/role/list.js +1 -1
  56. package/lib/commands/role/shared.js +1 -1
  57. package/lib/commands/role/update.js +1 -1
  58. package/lib/commands/role/user-add.js +1 -1
  59. package/lib/commands/role/user-remove.js +1 -1
  60. package/lib/commands/schedule/index.js +1 -1
  61. package/lib/commands/schema.js +1 -1
  62. package/lib/commands/service/dynamic.js +1 -1
  63. package/lib/commands/service/function-name-adapter.js +1 -1
  64. package/lib/commands/service/index.js +1 -1
  65. package/lib/commands/service/registry.js +1 -1
  66. package/lib/commands/skill/commands/create.js +1 -1
  67. package/lib/commands/skill/commands/diagram.js +1 -1
  68. package/lib/commands/skill/commands/install.js +1 -1
  69. package/lib/commands/skill/commands/list.js +1 -1
  70. package/lib/commands/skill/commands/push.js +1 -1
  71. package/lib/commands/skill/commands/validate.js +1 -1
  72. package/lib/commands/skill/diagram.js +1 -1
  73. package/lib/commands/skill/flags.js +1 -1
  74. package/lib/commands/skill/index.js +1 -1
  75. package/lib/commands/skill/manifest-helpers.js +1 -1
  76. package/lib/commands/skill/push-execute.js +1 -1
  77. package/lib/commands/skill/push-flow-helpers.js +1 -1
  78. package/lib/commands/skill/push-retarget.js +1 -1
  79. package/lib/commands/skill/scopes.js +1 -1
  80. package/lib/commands/skill/summary.js +1 -1
  81. package/lib/commands/skill/templates.js +1 -1
  82. package/lib/commands/skill/validate.js +1 -1
  83. package/lib/commands/sql/detail.js +1 -1
  84. package/lib/commands/sql/exec.js +1 -1
  85. package/lib/commands/sql/index.js +1 -1
  86. package/lib/commands/update.js +1 -1
  87. package/lib/commands/user-account/bind.js +1 -1
  88. package/lib/commands/user-account/index.js +1 -1
  89. package/lib/commands/workspace/index.js +1 -1
  90. package/lib/config/domain-config.d.ts +1 -1
  91. package/lib/config/domain-config.js +1 -1
  92. package/lib/config/schema.d.ts +1 -1
  93. package/lib/config/schema.js +1 -1
  94. package/lib/constant/app.js +1 -1
  95. package/lib/constant/auth-mode.js +1 -1
  96. package/lib/constant/cli.js +1 -1
  97. package/lib/constant/defaults.js +1 -1
  98. package/lib/constant/distribution.js +1 -1
  99. package/lib/constant/domain.d.ts +0 -3
  100. package/lib/constant/domain.js +1 -1
  101. package/lib/constant/env.js +1 -1
  102. package/lib/constant/output.js +1 -1
  103. package/lib/constant/product.js +1 -1
  104. package/lib/constant/region.js +1 -1
  105. package/lib/constant/risk.js +1 -1
  106. package/lib/constant/url.js +1 -1
  107. package/lib/context.js +1 -1
  108. package/lib/core/api-client.js +1 -1
  109. package/lib/core/db-resolver.js +1 -1
  110. package/lib/core/kb-search-client.js +1 -1
  111. package/lib/core/sdk-client.js +1 -1
  112. package/lib/errors.js +1 -1
  113. package/lib/framework/build-all-flags.js +1 -1
  114. package/lib/framework/dryrun.js +1 -1
  115. package/lib/framework/flags.js +1 -1
  116. package/lib/framework/help.js +1 -1
  117. package/lib/framework/index.js +1 -1
  118. package/lib/framework/output.js +1 -1
  119. package/lib/framework/preparse.js +1 -1
  120. package/lib/framework/rate-limit.js +1 -1
  121. package/lib/framework/raw-flags.js +1 -1
  122. package/lib/framework/response.js +1 -1
  123. package/lib/framework/runner-confirmation.js +1 -1
  124. package/lib/framework/runner-error.js +1 -1
  125. package/lib/framework/runner.js +1 -1
  126. package/lib/framework/schema-export.js +1 -1
  127. package/lib/framework/service-order.js +1 -1
  128. package/lib/framework/types.js +1 -1
  129. package/lib/generated/build-info.d.ts +4 -4
  130. package/lib/generated/build-info.js +1 -1
  131. package/lib/help.js +1 -1
  132. package/lib/postinstall.js +1 -1
  133. package/lib/runtime/confirmation.js +1 -1
  134. package/lib/runtime/event.js +1 -1
  135. package/lib/runtime/index.js +1 -1
  136. package/lib/runtime/queue.js +1 -1
  137. package/lib/runtime/resolve.js +1 -1
  138. package/lib/skills/builtin-skill.js +1 -1
  139. package/lib/skills/npx-skills-add.js +1 -1
  140. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  141. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  142. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  143. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  144. package/lib/skills/runtime-skill-sync/links.js +1 -1
  145. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  146. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  147. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  148. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  149. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  150. package/lib/skills/runtime-skill-sync/push.js +1 -1
  151. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  152. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  153. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  154. package/lib/skills/runtime-skill-sync.js +1 -1
  155. package/lib/skills/skill-presence.js +1 -1
  156. package/lib/utils/access-key-redaction.js +1 -1
  157. package/lib/utils/apply-jq-filter.js +1 -1
  158. package/lib/utils/cli-version-check.js +1 -1
  159. package/lib/utils/cli-version-policy.js +1 -1
  160. package/lib/utils/logger.js +1 -1
  161. package/lib/utils/lossless-json.js +1 -1
  162. package/lib/utils/params.js +1 -1
  163. package/lib/utils/platform.js +1 -1
  164. package/lib/utils/update-notice.js +1 -1
  165. package/lib/utils/version.js +1 -1
  166. package/lib/utils/write-cli-side-channel.js +1 -1
  167. package/package.json +1 -1
  168. package/skills/lovrabet/SKILL.md +1 -1
  169. package/skills/lovrabet/references/lovrabet-config-commands.md +5 -6
  170. package/skills/lovrabet/references/lovrabet-config.md +8 -9
  171. package/skills/lovrabet/references/lovrabet-doctor.md +1 -1
  172. package/skills/lovrabet/references/lovrabet-kb-workflow.md +1 -1
  173. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- const a55_0x4a2aba=a55_0x1628;function a55_0x28fe(){const _0x4f90b6=['trim','The\x20current\x20runtime\x20role\x20API\x20does\x20not\x20support\x20clearing\x20an\x20existing\x20remark.','name','2905840mZicsc','New\x20non-empty\x20role\x20remark','str','3306324SRItaf','807BbQDLj','1802980OsOtFJ','Preview:\x20update\x20a\x20runtime\x20CUSTOM\x20role','13263390EQCPSa','body','Update\x20a\x20runtime\x20CUSTOM\x20role','build','POST','978bcabMg','description','New\x20role\x20name','--name\x20must\x20not\x20be\x20blank.','/client/permit/role/update','role','update','574eCBnZb','57472FEaNtZ','remark','appCode','--remark\x20must\x20not\x20be\x20blank.','Pass\x20--name\x20or\x20--remark\x20to\x20update\x20the\x20runtime\x20role.','num','string','flag','663921wCvZgf','validation'];a55_0x28fe=function(){return _0x4f90b6;};return a55_0x28fe();}(function(_0x4d9852,_0x5353c2){const _0x5878f6=a55_0x1628,_0x3315db=_0x4d9852();while(!![]){try{const _0x19b1a2=parseInt(_0x5878f6(0x1c4))/0x1*(-parseInt(_0x5878f6(0x1cc))/0x2)+parseInt(_0x5878f6(0x1bb))/0x3+-parseInt(_0x5878f6(0x1c5))/0x4+-parseInt(_0x5878f6(0x1c0))/0x5+-parseInt(_0x5878f6(0x1c3))/0x6+parseInt(_0x5878f6(0x1d3))/0x7*(parseInt(_0x5878f6(0x1d4))/0x8)+parseInt(_0x5878f6(0x1c7))/0x9;if(_0x19b1a2===_0x5353c2)break;else _0x3315db['push'](_0x3315db['shift']());}catch(_0x5507f5){_0x3315db['push'](_0x3315db['shift']());}}}(a55_0x28fe,0x4ad53));import{updateRuntimeAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a55_0x1628(_0x461d9a,_0x5130fa){_0x461d9a=_0x461d9a-0x1b9;const _0x28fe01=a55_0x28fe();let _0x1628ac=_0x28fe01[_0x461d9a];return _0x1628ac;}import{dryRun}from'../../framework/dryrun.js';import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';function updateFields(_0x4e3a58){const _0xbe5e20=a55_0x1628,_0x481845=_0x4e3a58[_0xbe5e20(0x1ba)](_0xbe5e20(0x1bf))!==undefined,_0x23b686=_0x4e3a58['flag'](_0xbe5e20(0x1d5))!==undefined;if(!_0x481845&&!_0x23b686)throw CliErrors[_0xbe5e20(0x1bc)](_0xbe5e20(0x1d8));const _0x1c8f09=_0x4e3a58[_0xbe5e20(0x1c2)]('name')[_0xbe5e20(0x1bd)](),_0x33dab2=_0x4e3a58['str'](_0xbe5e20(0x1d5))[_0xbe5e20(0x1bd)]();if(_0x481845&&!_0x1c8f09)throw CliErrors[_0xbe5e20(0x1bc)](_0xbe5e20(0x1cf));if(_0x23b686&&!_0x33dab2)throw CliErrors[_0xbe5e20(0x1bc)](_0xbe5e20(0x1d7),_0xbe5e20(0x1be));return{..._0x481845?{'roleName':_0x1c8f09}:{},..._0x23b686?{'remark':_0x33dab2}:{}};}async function prepare(_0x1cb664){const _0x831520=a55_0x1628,_0x41c7ff=await getRuntimeRoleById(_0x1cb664['appCode'],_0x1cb664[_0x831520(0x1d9)]('id'));return assertCustomRuntimeRole(_0x41c7ff,_0x831520(0x1d2)),{'role':_0x41c7ff,'body':{'id':_0x41c7ff['id'],'appCode':_0x1cb664[_0x831520(0x1d6)],...updateFields(_0x1cb664)}};}export const roleUpdate={'service':a55_0x4a2aba(0x1d1),'command':a55_0x4a2aba(0x1d2),'description':a55_0x4a2aba(0x1c9),'risk':'high-risk-write','confirmationDescription':'Changes\x20the\x20custom\x20role\x20name\x20or\x20note\x20in\x20the\x20current\x20runtime\x20app.\x20The\x20role\x20display\x20updates\x20immediately.','flags':[ROLE_ID_FLAG,{'name':a55_0x4a2aba(0x1bf),'type':'string','description':a55_0x4a2aba(0x1ce)},{'name':a55_0x4a2aba(0x1d5),'type':a55_0x4a2aba(0x1b9),'description':a55_0x4a2aba(0x1c1)}],async 'validate'(_0x56ae9e){updateFields(_0x56ae9e);},async 'dryRun'(_0x25268d){const _0x300ad2=a55_0x4a2aba,{body:_0x416090}=await prepare(_0x25268d);return dryRun(_0x300ad2(0x1cb),_0x300ad2(0x1d0))[_0x300ad2(0x1c8)](_0x416090)[_0x300ad2(0x1cd)](_0x300ad2(0x1c6))[_0x300ad2(0x1ca)]();},async 'execute'(_0x183b8d){const _0x2caf09=a55_0x4a2aba,{role:_0x33fe67,body:_0x433993}=await prepare(_0x183b8d),_0x24b751=await updateRuntimeAppRole(_0x433993);return{'ok':!![],'data':runtimeRoleWriteResult('update',{'roleId':_0x33fe67['id']},projectRuntimeRole(_0x33fe67),projectRuntimeRole(_0x24b751),{'method':_0x2caf09(0x1cb),'path':_0x2caf09(0x1d0)})};}};
1
+ const a55_0x4f1229=a55_0x1ca5;(function(_0x3f6b32,_0xa43c80){const _0x42e02a=a55_0x1ca5,_0x715ad2=_0x3f6b32();while(!![]){try{const _0x175bcc=parseInt(_0x42e02a(0xa1))/0x1+-parseInt(_0x42e02a(0x93))/0x2+parseInt(_0x42e02a(0x97))/0x3*(-parseInt(_0x42e02a(0x88))/0x4)+-parseInt(_0x42e02a(0x94))/0x5+parseInt(_0x42e02a(0xa0))/0x6+parseInt(_0x42e02a(0x9e))/0x7+-parseInt(_0x42e02a(0x87))/0x8*(parseInt(_0x42e02a(0x86))/0x9);if(_0x175bcc===_0xa43c80)break;else _0x715ad2['push'](_0x715ad2['shift']());}catch(_0x222a9c){_0x715ad2['push'](_0x715ad2['shift']());}}}(a55_0x5d86,0xcf80a));import{updateRuntimeAppRole}from'../../core/api-client.js';function a55_0x1ca5(_0x479b92,_0x48a9c3){_0x479b92=_0x479b92-0x85;const _0x5d8649=a55_0x5d86();let _0x1ca530=_0x5d8649[_0x479b92];return _0x1ca530;}function a55_0x5d86(){const _0x5e7538=['string','The\x20current\x20runtime\x20role\x20API\x20does\x20not\x20support\x20clearing\x20an\x20existing\x20remark.','high-risk-write','body','remark','/client/permit/role/update','11446673LrhhzM','str','3186426cPANEN','1693712dOxCtm','--name\x20must\x20not\x20be\x20blank.','description','num','update','3537OibHDC','15160wCNaNI','3152792VhJESi','flag','Update\x20a\x20runtime\x20CUSTOM\x20role','Pass\x20--name\x20or\x20--remark\x20to\x20update\x20the\x20runtime\x20role.','POST','validation','New\x20role\x20name','name','trim','--remark\x20must\x20not\x20be\x20blank.','New\x20non-empty\x20role\x20remark','202344jGBwWP','2938945xNRaQB','Preview:\x20update\x20a\x20runtime\x20CUSTOM\x20role','appCode','6rYfjKa'];a55_0x5d86=function(){return _0x5e7538;};return a55_0x5d86();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';function updateFields(_0x7cddcc){const _0x3421da=a55_0x1ca5,_0x143eb9=_0x7cddcc['flag']('name')!==undefined,_0x56e3b6=_0x7cddcc[_0x3421da(0x89)](_0x3421da(0x9c))!==undefined;if(!_0x143eb9&&!_0x56e3b6)throw CliErrors[_0x3421da(0x8d)](_0x3421da(0x8b));const _0x20d24a=_0x7cddcc[_0x3421da(0x9f)](_0x3421da(0x8f))['trim'](),_0x4ee85f=_0x7cddcc['str'](_0x3421da(0x9c))[_0x3421da(0x90)]();if(_0x143eb9&&!_0x20d24a)throw CliErrors[_0x3421da(0x8d)](_0x3421da(0xa2));if(_0x56e3b6&&!_0x4ee85f)throw CliErrors[_0x3421da(0x8d)](_0x3421da(0x91),_0x3421da(0x99));return{..._0x143eb9?{'roleName':_0x20d24a}:{},..._0x56e3b6?{'remark':_0x4ee85f}:{}};}async function prepare(_0x1aa6a1){const _0x20f1b8=a55_0x1ca5,_0x597be0=await getRuntimeRoleById(_0x1aa6a1['appCode'],_0x1aa6a1[_0x20f1b8(0xa4)]('id'));return assertCustomRuntimeRole(_0x597be0,_0x20f1b8(0x85)),{'role':_0x597be0,'body':{'id':_0x597be0['id'],'appCode':_0x1aa6a1[_0x20f1b8(0x96)],...updateFields(_0x1aa6a1)}};}export const roleUpdate={'service':'role','command':a55_0x4f1229(0x85),'description':a55_0x4f1229(0x8a),'risk':a55_0x4f1229(0x9a),'confirmationDescription':'Changes\x20the\x20custom\x20role\x20name\x20or\x20note\x20in\x20the\x20current\x20runtime\x20app.\x20The\x20role\x20display\x20updates\x20immediately.','flags':[ROLE_ID_FLAG,{'name':a55_0x4f1229(0x8f),'type':a55_0x4f1229(0x98),'description':a55_0x4f1229(0x8e)},{'name':a55_0x4f1229(0x9c),'type':a55_0x4f1229(0x98),'description':a55_0x4f1229(0x92)}],async 'validate'(_0x327db9){updateFields(_0x327db9);},async 'dryRun'(_0x23c4fe){const _0x486eec=a55_0x4f1229,{body:_0x3b0510}=await prepare(_0x23c4fe);return dryRun('POST',_0x486eec(0x9d))[_0x486eec(0x9b)](_0x3b0510)[_0x486eec(0xa3)](_0x486eec(0x95))['build']();},async 'execute'(_0x54dcaf){const _0x28c5b8=a55_0x4f1229,{role:_0x296d14,body:_0x54a1db}=await prepare(_0x54dcaf),_0x40372d=await updateRuntimeAppRole(_0x54a1db);return{'ok':!![],'data':runtimeRoleWriteResult(_0x28c5b8(0x85),{'roleId':_0x296d14['id']},projectRuntimeRole(_0x296d14),projectRuntimeRole(_0x40372d),{'method':_0x28c5b8(0x8c),'path':_0x28c5b8(0x9d)})};}};
@@ -1 +1 @@
1
- function a56_0x4d2b(_0x515896,_0x2a70a4){_0x515896=_0x515896-0xc9;const _0xc078f1=a56_0xc078();let _0x4d2b39=_0xc078f1[_0x515896];return _0x4d2b39;}const a56_0x5da0e6=a56_0x4d2b;(function(_0x39efb8,_0x5bc184){const _0x3ce1db=a56_0x4d2b,_0x52a56d=_0x39efb8();while(!![]){try{const _0x1b8ef6=-parseInt(_0x3ce1db(0xdd))/0x1*(-parseInt(_0x3ce1db(0xd5))/0x2)+-parseInt(_0x3ce1db(0xce))/0x3*(-parseInt(_0x3ce1db(0xe4))/0x4)+-parseInt(_0x3ce1db(0xcd))/0x5*(parseInt(_0x3ce1db(0xd6))/0x6)+parseInt(_0x3ce1db(0xde))/0x7*(-parseInt(_0x3ce1db(0xdb))/0x8)+parseInt(_0x3ce1db(0xe0))/0x9*(parseInt(_0x3ce1db(0xd8))/0xa)+parseInt(_0x3ce1db(0xca))/0xb*(parseInt(_0x3ce1db(0xd0))/0xc)+-parseInt(_0x3ce1db(0xd7))/0xd*(-parseInt(_0x3ce1db(0xe1))/0xe);if(_0x1b8ef6===_0x5bc184)break;else _0x52a56d['push'](_0x52a56d['shift']());}catch(_0xa60f03){_0x52a56d['push'](_0x52a56d['shift']());}}}(a56_0xc078,0x34f0b));import{updateRuntimeRoleUsers}from'../../core/api-client.js';function a56_0xc078(){const _0x3ebb6b=['19362FpkQTn','after','build','57784ElDOYm','before','55tRARGB','high-risk-write','POST','277195AwxVLX','27LvIdNR','roleList','158748KAlszs','/client/permit/user-role/update-user-list','role','Preview:\x20add\x20runtime\x20role\x20member','Add\x20a\x20numeric\x20userId\x20to\x20one\x20runtime\x20role','84958MoYSQz','6QevMkC','481QBiNGU','223760AqAQPH','warnings','user-add','120AsjNKz','appCode','2dyhkBp','121982CeyeIb','description','81HviTNX'];a56_0xc078=function(){return _0x3ebb6b;};return a56_0xc078();}import{dryRun}from'../../framework/dryrun.js';import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':'role','command':a56_0x5da0e6(0xda),'description':a56_0x5da0e6(0xd4),'risk':a56_0x5da0e6(0xcb),'confirmationDescription':'Adds\x20the\x20given\x20runtime\x20user\x20to\x20the\x20target\x20role.\x20The\x20user\x20receives\x20the\x20permissions\x20of\x20that\x20role.','flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x2dcea2){const _0x2b2f6b=a56_0x5da0e6,_0x1e763f=await prepareRuntimeMemberMutation(_0x2dcea2,_0x2b2f6b(0xda));return dryRun('POST',_0x2b2f6b(0xd1))['body']({'appCode':_0x2dcea2[_0x2b2f6b(0xdc)],'roleList':_0x1e763f[_0x2b2f6b(0xcf)]})[_0x2b2f6b(0xdf)](_0x1e763f['shouldWrite']?_0x2b2f6b(0xd3):_0x1e763f[_0x2b2f6b(0xd9)][0x0])[_0x2b2f6b(0xe3)]();},async 'execute'(_0x2f82ed){const _0x5dd458=a56_0x5da0e6,_0x3c1f5d=await prepareRuntimeMemberMutation(_0x2f82ed,_0x5dd458(0xda));return _0x3c1f5d['shouldWrite']&&await updateRuntimeRoleUsers(_0x2f82ed['appCode'],_0x3c1f5d['roleList']),{'ok':!![],'data':runtimeRoleWriteResult(_0x5dd458(0xda),{'roleId':_0x3c1f5d[_0x5dd458(0xd2)]['id'],'userId':_0x3c1f5d['userId']},_0x3c1f5d[_0x5dd458(0xc9)],_0x3c1f5d[_0x5dd458(0xe2)],{'method':_0x5dd458(0xcc),'path':'/client/permit/user-role/update-user-list'},_0x3c1f5d['warnings'])};}};
1
+ const a56_0xaba181=a56_0xcdc0;(function(_0x567563,_0x5c2031){const _0x3c6113=a56_0xcdc0,_0x36703d=_0x567563();while(!![]){try{const _0x31e31b=parseInt(_0x3c6113(0x195))/0x1+-parseInt(_0x3c6113(0x196))/0x2+parseInt(_0x3c6113(0x190))/0x3*(-parseInt(_0x3c6113(0x19c))/0x4)+parseInt(_0x3c6113(0x19a))/0x5+parseInt(_0x3c6113(0x194))/0x6+-parseInt(_0x3c6113(0x19b))/0x7*(-parseInt(_0x3c6113(0x19d))/0x8)+parseInt(_0x3c6113(0x18b))/0x9*(-parseInt(_0x3c6113(0x192))/0xa);if(_0x31e31b===_0x5c2031)break;else _0x36703d['push'](_0x36703d['shift']());}catch(_0x5a15d4){_0x36703d['push'](_0x36703d['shift']());}}}(a56_0x4b32,0xe2f6d));import{updateRuntimeRoleUsers}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';function a56_0xcdc0(_0xf6e9ea,_0x145e7e){_0xf6e9ea=_0xf6e9ea-0x18b;const _0x4b320b=a56_0x4b32();let _0xcdc0d5=_0x4b320b[_0xf6e9ea];return _0xcdc0d5;}import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';function a56_0x4b32(){const _0x4bba5a=['922587FGAvDK','body','713420woJYmJ','role','2867094hkMQqQ','600868ZeeORe','100792VmsttZ','before','POST','/client/permit/user-role/update-user-list','88425EdSJkM','2931691moTeRe','16utdkuR','24UNpGOq','Add\x20a\x20numeric\x20userId\x20to\x20one\x20runtime\x20role','high-risk-write','Adds\x20the\x20given\x20runtime\x20user\x20to\x20the\x20target\x20role.\x20The\x20user\x20receives\x20the\x20permissions\x20of\x20that\x20role.','description','roleList','shouldWrite','after','user-add','18KjTYqz','build','warnings','appCode','Preview:\x20add\x20runtime\x20role\x20member'];a56_0x4b32=function(){return _0x4bba5a;};return a56_0x4b32();}export const roleUserAdd={'service':a56_0xaba181(0x193),'command':a56_0xaba181(0x1a5),'description':a56_0xaba181(0x19e),'risk':a56_0xaba181(0x19f),'confirmationDescription':a56_0xaba181(0x1a0),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x2c3a4b){const _0x2b42d4=a56_0xaba181,_0x30d970=await prepareRuntimeMemberMutation(_0x2c3a4b,_0x2b42d4(0x1a5));return dryRun(_0x2b42d4(0x198),_0x2b42d4(0x199))[_0x2b42d4(0x191)]({'appCode':_0x2c3a4b[_0x2b42d4(0x18e)],'roleList':_0x30d970[_0x2b42d4(0x1a2)]})[_0x2b42d4(0x1a1)](_0x30d970[_0x2b42d4(0x1a3)]?_0x2b42d4(0x18f):_0x30d970[_0x2b42d4(0x18d)][0x0])[_0x2b42d4(0x18c)]();},async 'execute'(_0xbf632d){const _0x2bed27=a56_0xaba181,_0x244d1b=await prepareRuntimeMemberMutation(_0xbf632d,_0x2bed27(0x1a5));return _0x244d1b[_0x2bed27(0x1a3)]&&await updateRuntimeRoleUsers(_0xbf632d[_0x2bed27(0x18e)],_0x244d1b['roleList']),{'ok':!![],'data':runtimeRoleWriteResult(_0x2bed27(0x1a5),{'roleId':_0x244d1b[_0x2bed27(0x193)]['id'],'userId':_0x244d1b['userId']},_0x244d1b[_0x2bed27(0x197)],_0x244d1b[_0x2bed27(0x1a4)],{'method':_0x2bed27(0x198),'path':_0x2bed27(0x199)},_0x244d1b[_0x2bed27(0x18d)])};}};
@@ -1 +1 @@
1
- const a57_0x12e9bb=a57_0x4187;(function(_0x5b33c0,_0x59c743){const _0x42981a=a57_0x4187,_0x4a7c5e=_0x5b33c0();while(!![]){try{const _0x35673b=parseInt(_0x42981a(0x1f4))/0x1*(parseInt(_0x42981a(0x1fc))/0x2)+-parseInt(_0x42981a(0x207))/0x3+parseInt(_0x42981a(0x1f1))/0x4*(-parseInt(_0x42981a(0x204))/0x5)+-parseInt(_0x42981a(0x1f2))/0x6+parseInt(_0x42981a(0x1fb))/0x7*(parseInt(_0x42981a(0x1ef))/0x8)+parseInt(_0x42981a(0x1f5))/0x9*(parseInt(_0x42981a(0x1f3))/0xa)+-parseInt(_0x42981a(0x1fe))/0xb*(-parseInt(_0x42981a(0x1f0))/0xc);if(_0x35673b===_0x59c743)break;else _0x4a7c5e['push'](_0x4a7c5e['shift']());}catch(_0x3069d3){_0x4a7c5e['push'](_0x4a7c5e['shift']());}}}(a57_0x595c,0xec2e3));import{updateRuntimeRoleUsers}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';function a57_0x595c(){const _0x1a4725=['user-remove','88yqlmzR','4078572KCRvVF','1228EgUxMQ','3140982yRKiaS','50XCDOwf','22KzWjnJ','2997585AbWFyb','warnings','appCode','Removes\x20the\x20given\x20runtime\x20user\x20from\x20the\x20target\x20role.\x20The\x20user\x20loses\x20permissions\x20granted\x20only\x20by\x20that\x20role.','/client/permit/user-role/update-user-list','POST','384461UtWCxi','117358SlZFrC','role','22hsCJFG','shouldWrite','roleList','after','Preview:\x20remove\x20runtime\x20role\x20member','description','28605MoIYFx','userId','before','2978817hZVigh'];a57_0x595c=function(){return _0x1a4725;};return a57_0x595c();}function a57_0x4187(_0x1e7a63,_0x2c7382){_0x1e7a63=_0x1e7a63-0x1ee;const _0x595c72=a57_0x595c();let _0x4187b8=_0x595c72[_0x1e7a63];return _0x4187b8;}import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a57_0x12e9bb(0x1fd),'command':'user-remove','description':'Remove\x20a\x20numeric\x20userId\x20from\x20one\x20runtime\x20role','risk':'high-risk-write','confirmationDescription':a57_0x12e9bb(0x1f8),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x144394){const _0x19f837=a57_0x12e9bb,_0x2a6214=await prepareRuntimeMemberMutation(_0x144394,_0x19f837(0x1ee));return dryRun('POST',_0x19f837(0x1f9))['body']({'appCode':_0x144394[_0x19f837(0x1f7)],'roleList':_0x2a6214['roleList']})[_0x19f837(0x203)](_0x2a6214[_0x19f837(0x1ff)]?_0x19f837(0x202):_0x2a6214[_0x19f837(0x1f6)][0x0])['build']();},async 'execute'(_0x1c283d){const _0x54f93b=a57_0x12e9bb,_0x486ac6=await prepareRuntimeMemberMutation(_0x1c283d,_0x54f93b(0x1ee));return _0x486ac6[_0x54f93b(0x1ff)]&&await updateRuntimeRoleUsers(_0x1c283d[_0x54f93b(0x1f7)],_0x486ac6[_0x54f93b(0x200)]),{'ok':!![],'data':runtimeRoleWriteResult('user-remove',{'roleId':_0x486ac6[_0x54f93b(0x1fd)]['id'],'userId':_0x486ac6[_0x54f93b(0x205)]},_0x486ac6[_0x54f93b(0x206)],_0x486ac6[_0x54f93b(0x201)],{'method':_0x54f93b(0x1fa),'path':'/client/permit/user-role/update-user-list'},_0x486ac6[_0x54f93b(0x1f6)])};}};
1
+ const a57_0x468237=a57_0x46ed;(function(_0x3f05eb,_0x47685e){const _0x3b7fbc=a57_0x46ed,_0x2ba0db=_0x3f05eb();while(!![]){try{const _0xade985=parseInt(_0x3b7fbc(0x99))/0x1+-parseInt(_0x3b7fbc(0xa5))/0x2*(parseInt(_0x3b7fbc(0x93))/0x3)+-parseInt(_0x3b7fbc(0x8c))/0x4+-parseInt(_0x3b7fbc(0x91))/0x5+-parseInt(_0x3b7fbc(0x9c))/0x6*(-parseInt(_0x3b7fbc(0x96))/0x7)+parseInt(_0x3b7fbc(0x8e))/0x8+-parseInt(_0x3b7fbc(0x9a))/0x9*(-parseInt(_0x3b7fbc(0x9f))/0xa);if(_0xade985===_0x47685e)break;else _0x2ba0db['push'](_0x2ba0db['shift']());}catch(_0x2e61b3){_0x2ba0db['push'](_0x2ba0db['shift']());}}}(a57_0x47fb,0x3324a));import{updateRuntimeRoleUsers}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';function a57_0x47fb(){const _0x19e959=['role','16647hTDlIb','POST','high-risk-write','14zGkAIx','appCode','Removes\x20the\x20given\x20runtime\x20user\x20from\x20the\x20target\x20role.\x20The\x20user\x20loses\x20permissions\x20granted\x20only\x20by\x20that\x20role.','138985eECxIi','1575jbloCS','/client/permit/user-role/update-user-list','15396nmWlwh','warnings','description','19930ccsGXX','before','userId','body','user-remove','build','76RNKlLQ','471364KUeaLS','shouldWrite','454272kPIcLk','roleList','after','57455swwYRj'];a57_0x47fb=function(){return _0x19e959;};return a57_0x47fb();}import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';function a57_0x46ed(_0x44dcef,_0x4dc704){_0x44dcef=_0x44dcef-0x8c;const _0x47fb48=a57_0x47fb();let _0x46edfe=_0x47fb48[_0x44dcef];return _0x46edfe;}export const roleUserRemove={'service':'role','command':a57_0x468237(0xa3),'description':'Remove\x20a\x20numeric\x20userId\x20from\x20one\x20runtime\x20role','risk':a57_0x468237(0x95),'confirmationDescription':a57_0x468237(0x98),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x6434b3){const _0x3c713f=a57_0x468237,_0x515a4b=await prepareRuntimeMemberMutation(_0x6434b3,_0x3c713f(0xa3));return dryRun(_0x3c713f(0x94),_0x3c713f(0x9b))[_0x3c713f(0xa2)]({'appCode':_0x6434b3[_0x3c713f(0x97)],'roleList':_0x515a4b[_0x3c713f(0x8f)]})[_0x3c713f(0x9e)](_0x515a4b['shouldWrite']?'Preview:\x20remove\x20runtime\x20role\x20member':_0x515a4b[_0x3c713f(0x9d)][0x0])[_0x3c713f(0xa4)]();},async 'execute'(_0x1fd451){const _0x599a42=a57_0x468237,_0x2d16a4=await prepareRuntimeMemberMutation(_0x1fd451,_0x599a42(0xa3));return _0x2d16a4[_0x599a42(0x8d)]&&await updateRuntimeRoleUsers(_0x1fd451[_0x599a42(0x97)],_0x2d16a4[_0x599a42(0x8f)]),{'ok':!![],'data':runtimeRoleWriteResult('user-remove',{'roleId':_0x2d16a4[_0x599a42(0x92)]['id'],'userId':_0x2d16a4[_0x599a42(0xa1)]},_0x2d16a4[_0x599a42(0xa0)],_0x2d16a4[_0x599a42(0x90)],{'method':_0x599a42(0x94),'path':_0x599a42(0x9b)},_0x2d16a4['warnings'])};}};
@@ -1 +1 @@
1
- const a58_0x519fe7=a58_0x5b83;(function(_0x805a50,_0x5e5b35){const _0xb3d77f=a58_0x5b83,_0x3c9e95=_0x805a50();while(!![]){try{const _0x10d7b7=-parseInt(_0xb3d77f(0x125))/0x1+-parseInt(_0xb3d77f(0x129))/0x2+-parseInt(_0xb3d77f(0x112))/0x3*(parseInt(_0xb3d77f(0x134))/0x4)+-parseInt(_0xb3d77f(0x10a))/0x5+parseInt(_0xb3d77f(0x10d))/0x6*(-parseInt(_0xb3d77f(0x108))/0x7)+-parseInt(_0xb3d77f(0x120))/0x8+parseInt(_0xb3d77f(0x100))/0x9*(parseInt(_0xb3d77f(0x13d))/0xa);if(_0x10d7b7===_0x5e5b35)break;else _0x3c9e95['push'](_0x3c9e95['shift']());}catch(_0x2a72e3){_0x3c9e95['push'](_0x3c9e95['shift']());}}}(a58_0x48bb,0x944b7));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':a58_0x519fe7(0x12c),'type':a58_0x519fe7(0x12f),'required':!![],'enum':[a58_0x519fe7(0x133),a58_0x519fe7(0x138)],'description':a58_0x519fe7(0x13a)},CRON_FLAG={'name':a58_0x519fe7(0x121),'type':'string','description':'Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules'},SCHEDULED_AT_FLAG={'name':'scheduled-at','type':a58_0x519fe7(0x12f),'description':a58_0x519fe7(0x132)},TITLE_FLAG={'name':a58_0x519fe7(0x116),'type':'string','required':!![],'description':'Schedule\x20title'},PROMPT_FLAG={'name':a58_0x519fe7(0x11b),'type':a58_0x519fe7(0x12f),'required':!![],'description':a58_0x519fe7(0x144)},MODEL_FLAG={'name':'model','type':'string','enum':[a58_0x519fe7(0x109),a58_0x519fe7(0x11a),'deepseek-v4-pro-0813'],'default':a58_0x519fe7(0x11a),'description':a58_0x519fe7(0x126)},SCHEDULE_ID_FLAG={'name':a58_0x519fe7(0x10e),'type':a58_0x519fe7(0x12f),'required':!![],'description':a58_0x519fe7(0x136),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':'a\x20UUID\x20returned\x20by\x20schedule\x20create/list'}},LIMIT_FLAG={'name':a58_0x519fe7(0x11c),'type':a58_0x519fe7(0x110),'default':0x14,'description':a58_0x519fe7(0x11f)},CURSOR_FLAG={'name':a58_0x519fe7(0x141),'type':'string','description':a58_0x519fe7(0x13b)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function readScheduleInput(_0x5c9291){const _0x2ca05c=a58_0x519fe7,_0x58738a=_0x5c9291[_0x2ca05c(0x130)](_0x2ca05c(0x12c)),_0x2a3b6d=_0x5c9291['str'](_0x2ca05c(0x116))['trim'](),_0x30bf18=_0x5c9291[_0x2ca05c(0x130)](_0x2ca05c(0x11b))['trim'](),_0x4635eb=_0x5c9291['str']('model'),_0x4e52f0=_0x5c9291[_0x2ca05c(0x130)](_0x2ca05c(0x121)),_0x4010c0=_0x5c9291[_0x2ca05c(0x130)]('scheduled-at');if(!_0x2a3b6d)throw CliErrors[_0x2ca05c(0x123)](_0x2ca05c(0x104));if(!_0x30bf18)throw CliErrors['validation']('--prompt\x20must\x20not\x20be\x20blank.');if(_0x58738a===_0x2ca05c(0x133)){if(!_0x4e52f0||_0x4010c0)throw CliErrors[_0x2ca05c(0x123)](_0x2ca05c(0x11e));return{'kind':_0x58738a,'timezone':_0x2ca05c(0x135),'cron':_0x4e52f0,'title':_0x2a3b6d,'prompt':_0x30bf18,'model':_0x4635eb};}if(_0x58738a===_0x2ca05c(0x138)){if(!_0x4010c0||_0x4e52f0)throw CliErrors[_0x2ca05c(0x123)](_0x2ca05c(0x12a));return{'kind':_0x58738a,'timezone':_0x2ca05c(0x135),'scheduledAt':_0x4010c0,'title':_0x2a3b6d,'prompt':_0x30bf18,'model':_0x4635eb};}throw CliErrors['validation'](_0x2ca05c(0x102));}function scheduleCollectionPath(_0x44caa9){const _0xafae90=a58_0x519fe7;return'/api/harness/apps/'+encodeURIComponent(_0x44caa9)+_0xafae90(0x12e);}function a58_0x5b83(_0x3cf882,_0x4ee227){_0x3cf882=_0x3cf882-0xff;const _0x48bb60=a58_0x48bb();let _0x5b83bf=_0x48bb60[_0x3cf882];return _0x5b83bf;}function scheduleItemPath(_0x34f16f,_0x5a8b1a){return scheduleCollectionPath(_0x34f16f)+'/'+encodeURIComponent(_0x5a8b1a);}function a58_0x48bb(){const _0x4bdf6c=['str','Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','CRON','5156BVsWdB','UTC','Schedule\x20UUID','Created\x20','ONCE','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','Schedule\x20kind:\x20CRON\x20or\x20ONCE','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','20oJlLFB','isSafeInteger','POST','build','cursor','detail','num','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','Schedule\x20input\x20is\x20valid','22443606tKHDip','Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','DELETE','--title\x20must\x20not\x20be\x20blank.','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','validate','14RjMmNn','kimi/k3','4338195WAsysq','\x20immediately','high-risk-write','1048056jKuQIV','schedule-id','schedule','number','Deleted\x20schedule\x20','1113mGpKdq','Queued\x20Task\x20','Preview:\x20create\x20an\x20Agent\x20schedule','/run','title','create','scheduleId','Show\x20one\x20schedule\x20by\x20schedule\x20ID','deepseek-v4-flash-0731','prompt','limit','description','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','Page\x20size\x20from\x201\x20to\x20100','5902816VRHkSd','cron','trim','validation','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','887075fLvyKE','Task\x20model\x20used\x20when\x20the\x20schedule\x20runs','Creates\x20a\x20schedule\x20in\x20the\x20current\x20app\x20that\x20can\x20auto-trigger\x20an\x20Agent.\x20At\x20the\x20scheduled\x20time\x20a\x20Task\x20is\x20created\x20and\x20run.','taskId','2119832QzIRUW','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','read','kind','appCode','/schedules','string'];a58_0x48bb=function(){return _0x4bdf6c;};return a58_0x48bb();}const scheduleValidate={'service':'schedule','command':a58_0x519fe7(0x107),'description':a58_0x519fe7(0x105),'risk':a58_0x519fe7(0x12b),'flags':INPUT_FLAGS,async 'validate'(_0x285c82){readScheduleInput(_0x285c82);},async 'execute'(_0x244e79){const _0x223431=a58_0x519fe7,_0x5e533d=readScheduleInput(_0x244e79),_0x5f1f70=await validateRuntimeSchedule(_0x244e79[_0x223431(0x12d)],_0x5e533d);return{'ok':!![],'data':_0x5f1f70,'message':_0x223431(0xff)};}},scheduleCreate={'service':a58_0x519fe7(0x10f),'command':a58_0x519fe7(0x117),'description':a58_0x519fe7(0x13c),'risk':a58_0x519fe7(0x10c),'confirmationDescription':a58_0x519fe7(0x127),'flags':INPUT_FLAGS,async 'validate'(_0x244976){readScheduleInput(_0x244976);},async 'execute'(_0x5c1dae){const _0x85c1b1=a58_0x519fe7,_0x2f37c4=readScheduleInput(_0x5c1dae),_0x8bfac4=await validateRuntimeSchedule(_0x5c1dae[_0x85c1b1(0x12d)],_0x2f37c4),_0x2e54c0=await createRuntimeSchedule(_0x5c1dae[_0x85c1b1(0x12d)],_0x8bfac4);return{'ok':!![],'data':_0x2e54c0,'message':_0x85c1b1(0x137)+_0x2e54c0[_0x85c1b1(0x12c)]+'\x20schedule\x20'+_0x2e54c0[_0x85c1b1(0x118)]};},async 'dryRun'(_0x306d59){const _0x2c107f=a58_0x519fe7,_0x32490f=readScheduleInput(_0x306d59);return dryRun(_0x2c107f(0x13f),scheduleCollectionPath(_0x306d59['appCode']))['body'](_0x32490f)[_0x2c107f(0x11d)](_0x2c107f(0x114))[_0x2c107f(0x140)]();}},scheduleList={'service':a58_0x519fe7(0x10f),'command':'list','description':a58_0x519fe7(0x124),'risk':a58_0x519fe7(0x12b),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x29f28d){const _0x1cd8e6=a58_0x519fe7,_0x2715cd=_0x29f28d[_0x1cd8e6(0x143)](_0x1cd8e6(0x11c));if(!Number[_0x1cd8e6(0x13e)](_0x2715cd)||_0x2715cd<0x1||_0x2715cd>0x64)throw CliErrors[_0x1cd8e6(0x123)]('--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.');const _0x277142=_0x29f28d['str']('cursor');if(_0x277142&&(_0x277142['length']>0x400||_0x277142[_0x1cd8e6(0x122)]()!==_0x277142))throw CliErrors[_0x1cd8e6(0x123)](_0x1cd8e6(0x139));},async 'execute'(_0x10ac0f){const _0x9ca395=a58_0x519fe7,_0x27d3f2=_0x10ac0f[_0x9ca395(0x130)](_0x9ca395(0x141)),_0x279dd4=await listRuntimeSchedules(_0x10ac0f[_0x9ca395(0x12d)],{'kind':_0x10ac0f[_0x9ca395(0x130)](_0x9ca395(0x12c)),'limit':_0x10ac0f[_0x9ca395(0x143)](_0x9ca395(0x11c)),..._0x27d3f2?{'cursor':_0x27d3f2}:{}});return{'ok':!![],'data':_0x279dd4};}},scheduleDetail={'service':a58_0x519fe7(0x10f),'command':a58_0x519fe7(0x142),'description':a58_0x519fe7(0x119),'risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x1cde04){const _0x3f0e76=a58_0x519fe7,_0x2dac5d=await getRuntimeSchedule(_0x1cde04[_0x3f0e76(0x12d)],_0x1cde04['str'](_0x3f0e76(0x10e)));return{'ok':!![],'data':_0x2dac5d};}},scheduleRun={'service':a58_0x519fe7(0x10f),'command':'run','description':a58_0x519fe7(0x131),'risk':a58_0x519fe7(0x10c),'confirmationDescription':a58_0x519fe7(0x101),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x45fb62){const _0x42f9b3=a58_0x519fe7,_0x3ecdd3=_0x45fb62['str']('schedule-id'),_0x234467=await runRuntimeSchedule(_0x45fb62[_0x42f9b3(0x12d)],_0x3ecdd3);return{'ok':!![],'data':_0x234467,'message':_0x42f9b3(0x113)+_0x234467[_0x42f9b3(0x128)]+'\x20from\x20schedule\x20'+_0x3ecdd3};},async 'dryRun'(_0x460e5e){const _0xf9bb1=a58_0x519fe7,_0x2538ef=_0x460e5e['str']('schedule-id');return dryRun('POST',scheduleItemPath(_0x460e5e[_0xf9bb1(0x12d)],_0x2538ef)+_0xf9bb1(0x115))[_0xf9bb1(0x11d)]('Preview:\x20run\x20schedule\x20'+_0x2538ef+_0xf9bb1(0x10b))[_0xf9bb1(0x140)]();}},scheduleDelete={'service':a58_0x519fe7(0x10f),'command':'delete','description':a58_0x519fe7(0x106),'risk':a58_0x519fe7(0x10c),'confirmationDescription':'Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x4b2c85){const _0x378cdf=a58_0x519fe7,_0x2a333e=_0x4b2c85[_0x378cdf(0x130)](_0x378cdf(0x10e)),_0x197657=await deleteRuntimeSchedule(_0x4b2c85['appCode'],_0x2a333e);return{'ok':!![],'data':_0x197657,'message':_0x378cdf(0x111)+_0x2a333e};},async 'dryRun'(_0x3e3ee8){const _0x1e69d4=a58_0x519fe7,_0x2c3a06=_0x3e3ee8[_0x1e69d4(0x130)](_0x1e69d4(0x10e));return dryRun(_0x1e69d4(0x103),scheduleItemPath(_0x3e3ee8[_0x1e69d4(0x12d)],_0x2c3a06))[_0x1e69d4(0x11d)]('Preview:\x20delete\x20schedule\x20'+_0x2c3a06)[_0x1e69d4(0x140)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
1
+ const a58_0x28822a=a58_0xe6b8;function a58_0x3e91(){const _0x5289e9=['--prompt\x20must\x20not\x20be\x20blank.','string','cron','high-risk-write','trim','schedule-id','taskId','Creates\x20a\x20schedule\x20in\x20the\x20current\x20app\x20that\x20can\x20auto-trigger\x20an\x20Agent.\x20At\x20the\x20scheduled\x20time\x20a\x20Task\x20is\x20created\x20and\x20run.','2883hklHOn','2752816IbgCAg','deepseek-v4-pro-0813','Preview:\x20run\x20schedule\x20','read','POST','7WvllQT','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','scheduled-at','Page\x20size\x20from\x201\x20to\x20100','Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','Schedule\x20kind:\x20CRON\x20or\x20ONCE','limit','Show\x20one\x20schedule\x20by\x20schedule\x20ID','106460GJJUop','2387yltgNg','deepseek-v4-flash-0731','CRON','num','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','detail','Created\x20','\x20from\x20schedule\x20','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','cursor','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','292764nmodWI','delete','Task\x20model\x20used\x20when\x20the\x20schedule\x20runs','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','number','Deleted\x20schedule\x20','1594gNChlj','schedule','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','1930664sdJwjN','--title\x20must\x20not\x20be\x20blank.','Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','/api/harness/apps/','Preview:\x20delete\x20schedule\x20','ONCE','Schedule\x20UUID','kind','run','isSafeInteger','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.','Schedule\x20input\x20is\x20valid','length','DELETE','87753uscdjS','validation','validate','appCode','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','70Jdgtds','build','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','kimi/k3','scheduleId','str','3294963vWnszZ','\x20schedule\x20','description','Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.'];a58_0x3e91=function(){return _0x5289e9;};return a58_0x3e91();}(function(_0x33ba5b,_0x2b0581){const _0x5ebc33=a58_0xe6b8,_0xe71e9=_0x33ba5b();while(!![]){try{const _0x49e0df=parseInt(_0x5ebc33(0xde))/0x1+parseInt(_0x5ebc33(0xcc))/0x2*(-parseInt(_0x5ebc33(0xac))/0x3)+-parseInt(_0x5ebc33(0xad))/0x4+parseInt(_0x5ebc33(0xe3))/0x5*(-parseInt(_0x5ebc33(0xc6))/0x6)+parseInt(_0x5ebc33(0xb2))/0x7*(-parseInt(_0x5ebc33(0xcf))/0x8)+parseInt(_0x5ebc33(0xea))/0x9+-parseInt(_0x5ebc33(0xba))/0xa*(-parseInt(_0x5ebc33(0xbb))/0xb);if(_0x49e0df===_0x2b0581)break;else _0xe71e9['push'](_0xe71e9['shift']());}catch(_0x3e51a6){_0xe71e9['push'](_0xe71e9['shift']());}}}(a58_0x3e91,0x5e1c0));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':a58_0x28822a(0xd6),'type':a58_0x28822a(0xa5),'required':!![],'enum':[a58_0x28822a(0xbd),'ONCE'],'description':a58_0x28822a(0xb7)},CRON_FLAG={'name':a58_0x28822a(0xa6),'type':a58_0x28822a(0xa5),'description':'Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules'},SCHEDULED_AT_FLAG={'name':a58_0x28822a(0xb4),'type':a58_0x28822a(0xa5),'description':a58_0x28822a(0xe5)},TITLE_FLAG={'name':'title','type':a58_0x28822a(0xa5),'required':!![],'description':'Schedule\x20title'},PROMPT_FLAG={'name':'prompt','type':a58_0x28822a(0xa5),'required':!![],'description':'Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs'},MODEL_FLAG={'name':'model','type':'string','enum':[a58_0x28822a(0xe7),a58_0x28822a(0xbc),a58_0x28822a(0xae)],'default':a58_0x28822a(0xbc),'description':a58_0x28822a(0xc8)},SCHEDULE_ID_FLAG={'name':a58_0x28822a(0xa9),'type':a58_0x28822a(0xa5),'required':!![],'description':a58_0x28822a(0xd5),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a58_0x28822a(0xc5)}},LIMIT_FLAG={'name':'limit','type':a58_0x28822a(0xca),'default':0x14,'description':a58_0x28822a(0xb5)},CURSOR_FLAG={'name':a58_0x28822a(0xc4),'type':a58_0x28822a(0xa5),'description':a58_0x28822a(0xbf)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function readScheduleInput(_0x20dcd7){const _0x528641=a58_0x28822a,_0x1854ff=_0x20dcd7[_0x528641(0xe9)]('kind'),_0x129ce4=_0x20dcd7[_0x528641(0xe9)]('title')[_0x528641(0xa8)](),_0x1136df=_0x20dcd7[_0x528641(0xe9)]('prompt')[_0x528641(0xa8)](),_0x5b9496=_0x20dcd7['str']('model'),_0x5957a6=_0x20dcd7[_0x528641(0xe9)](_0x528641(0xa6)),_0x3850e6=_0x20dcd7[_0x528641(0xe9)](_0x528641(0xb4));if(!_0x129ce4)throw CliErrors['validation'](_0x528641(0xd0));if(!_0x1136df)throw CliErrors[_0x528641(0xdf)](_0x528641(0xa4));if(_0x1854ff===_0x528641(0xbd)){if(!_0x5957a6||_0x3850e6)throw CliErrors[_0x528641(0xdf)](_0x528641(0xe2));return{'kind':_0x1854ff,'timezone':'UTC','cron':_0x5957a6,'title':_0x129ce4,'prompt':_0x1136df,'model':_0x5b9496};}if(_0x1854ff===_0x528641(0xd4)){if(!_0x3850e6||_0x5957a6)throw CliErrors[_0x528641(0xdf)](_0x528641(0xe6));return{'kind':_0x1854ff,'timezone':'UTC','scheduledAt':_0x3850e6,'title':_0x129ce4,'prompt':_0x1136df,'model':_0x5b9496};}throw CliErrors['validation'](_0x528641(0xc3));}function scheduleCollectionPath(_0x56eea9){const _0x2b7852=a58_0x28822a;return _0x2b7852(0xd2)+encodeURIComponent(_0x56eea9)+'/schedules';}function a58_0xe6b8(_0x5a480e,_0x10d663){_0x5a480e=_0x5a480e-0xa2;const _0x3e912f=a58_0x3e91();let _0xe6b81d=_0x3e912f[_0x5a480e];return _0xe6b81d;}function scheduleItemPath(_0xb28878,_0x95a135){return scheduleCollectionPath(_0xb28878)+'/'+encodeURIComponent(_0x95a135);}const scheduleValidate={'service':'schedule','command':a58_0x28822a(0xe0),'description':a58_0x28822a(0xc9),'risk':a58_0x28822a(0xb0),'flags':INPUT_FLAGS,async 'validate'(_0x34fd40){readScheduleInput(_0x34fd40);},async 'execute'(_0x50f659){const _0x5b46cb=a58_0x28822a,_0x53048d=readScheduleInput(_0x50f659),_0x5ed402=await validateRuntimeSchedule(_0x50f659[_0x5b46cb(0xe1)],_0x53048d);return{'ok':!![],'data':_0x5ed402,'message':_0x5b46cb(0xdb)};}},scheduleCreate={'service':'schedule','command':'create','description':'Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','risk':a58_0x28822a(0xa7),'confirmationDescription':a58_0x28822a(0xab),'flags':INPUT_FLAGS,async 'validate'(_0xb0a04a){readScheduleInput(_0xb0a04a);},async 'execute'(_0x2af780){const _0x2fea00=a58_0x28822a,_0x4df432=readScheduleInput(_0x2af780),_0x5c7011=await validateRuntimeSchedule(_0x2af780['appCode'],_0x4df432),_0x17606d=await createRuntimeSchedule(_0x2af780[_0x2fea00(0xe1)],_0x5c7011);return{'ok':!![],'data':_0x17606d,'message':_0x2fea00(0xc1)+_0x17606d[_0x2fea00(0xd6)]+_0x2fea00(0xeb)+_0x17606d[_0x2fea00(0xe8)]};},async 'dryRun'(_0x161895){const _0x23079a=a58_0x28822a,_0x3a7e66=readScheduleInput(_0x161895);return dryRun(_0x23079a(0xb1),scheduleCollectionPath(_0x161895[_0x23079a(0xe1)]))['body'](_0x3a7e66)['description']('Preview:\x20create\x20an\x20Agent\x20schedule')['build']();}},scheduleList={'service':'schedule','command':'list','description':a58_0x28822a(0xce),'risk':a58_0x28822a(0xb0),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x14d5bf){const _0x44acd3=a58_0x28822a,_0x4e4249=_0x14d5bf[_0x44acd3(0xbe)](_0x44acd3(0xb8));if(!Number[_0x44acd3(0xd8)](_0x4e4249)||_0x4e4249<0x1||_0x4e4249>0x64)throw CliErrors['validation'](_0x44acd3(0xd9));const _0x3b8f65=_0x14d5bf[_0x44acd3(0xe9)](_0x44acd3(0xc4));if(_0x3b8f65&&(_0x3b8f65[_0x44acd3(0xdc)]>0x400||_0x3b8f65[_0x44acd3(0xa8)]()!==_0x3b8f65))throw CliErrors['validation'](_0x44acd3(0xb3));},async 'execute'(_0x448045){const _0x27800f=a58_0x28822a,_0x200058=_0x448045[_0x27800f(0xe9)](_0x27800f(0xc4)),_0x430821=await listRuntimeSchedules(_0x448045['appCode'],{'kind':_0x448045[_0x27800f(0xe9)](_0x27800f(0xd6)),'limit':_0x448045[_0x27800f(0xbe)]('limit'),..._0x200058?{'cursor':_0x200058}:{}});return{'ok':!![],'data':_0x430821};}},scheduleDetail={'service':a58_0x28822a(0xcd),'command':a58_0x28822a(0xc0),'description':a58_0x28822a(0xb9),'risk':a58_0x28822a(0xb0),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x72970d){const _0x1145b5=a58_0x28822a,_0x3a1cd7=await getRuntimeSchedule(_0x72970d[_0x1145b5(0xe1)],_0x72970d['str'](_0x1145b5(0xa9)));return{'ok':!![],'data':_0x3a1cd7};}},scheduleRun={'service':'schedule','command':a58_0x28822a(0xd7),'description':a58_0x28822a(0xd1),'risk':a58_0x28822a(0xa7),'confirmationDescription':a58_0x28822a(0xda),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x42554b){const _0x2631f7=a58_0x28822a,_0x498384=_0x42554b['str'](_0x2631f7(0xa9)),_0x37f175=await runRuntimeSchedule(_0x42554b[_0x2631f7(0xe1)],_0x498384);return{'ok':!![],'data':_0x37f175,'message':'Queued\x20Task\x20'+_0x37f175[_0x2631f7(0xaa)]+_0x2631f7(0xc2)+_0x498384};},async 'dryRun'(_0x476c64){const _0x43dd77=a58_0x28822a,_0x2cc372=_0x476c64[_0x43dd77(0xe9)](_0x43dd77(0xa9));return dryRun('POST',scheduleItemPath(_0x476c64[_0x43dd77(0xe1)],_0x2cc372)+'/run')['description'](_0x43dd77(0xaf)+_0x2cc372+'\x20immediately')[_0x43dd77(0xe4)]();}},scheduleDelete={'service':a58_0x28822a(0xcd),'command':a58_0x28822a(0xc7),'description':a58_0x28822a(0xb6),'risk':a58_0x28822a(0xa7),'confirmationDescription':a58_0x28822a(0xa3),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x39accf){const _0x2949b2=a58_0x28822a,_0x3fc057=_0x39accf[_0x2949b2(0xe9)]('schedule-id'),_0x154399=await deleteRuntimeSchedule(_0x39accf[_0x2949b2(0xe1)],_0x3fc057);return{'ok':!![],'data':_0x154399,'message':_0x2949b2(0xcb)+_0x3fc057};},async 'dryRun'(_0x3b0780){const _0x36edde=a58_0x28822a,_0xcd4849=_0x3b0780[_0x36edde(0xe9)](_0x36edde(0xa9));return dryRun(_0x36edde(0xdd),scheduleItemPath(_0x3b0780[_0x36edde(0xe1)],_0xcd4849))[_0x36edde(0xa2)](_0x36edde(0xd3)+_0xcd4849)['build']();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
@@ -1 +1 @@
1
- const a59_0x3559ee=a59_0x1d37;(function(_0x3718d0,_0x378f71){const _0x2067ba=a59_0x1d37,_0x4c609e=_0x3718d0();while(!![]){try{const _0x2c622a=parseInt(_0x2067ba(0x112))/0x1+parseInt(_0x2067ba(0x117))/0x2+-parseInt(_0x2067ba(0x118))/0x3*(-parseInt(_0x2067ba(0x119))/0x4)+parseInt(_0x2067ba(0x111))/0x5*(-parseInt(_0x2067ba(0x115))/0x6)+-parseInt(_0x2067ba(0x110))/0x7+parseInt(_0x2067ba(0x11b))/0x8*(parseInt(_0x2067ba(0x116))/0x9)+-parseInt(_0x2067ba(0x114))/0xa;if(_0x2c622a===_0x378f71)break;else _0x4c609e['push'](_0x4c609e['shift']());}catch(_0x5ab624){_0x4c609e['push'](_0x4c609e['shift']());}}}(a59_0x10be,0xf22d4));import{buildSchemaPayload}from'../framework/schema-export.js';function a59_0x10be(){const _0x33924e=['172031wKnNNp','Export\x20machine-readable\x20command\x20schema\x20(JSON)','13497480fNTLPP','102bNzjyh','85833vmdeJp','2621544JLUHou','83829LnPYLi','276FMomep','schema','1136wPsypq','8621802hfukyL','350510KMHtZX'];a59_0x10be=function(){return _0x33924e;};return a59_0x10be();}function a59_0x1d37(_0x3bf5b7,_0x537bd8){_0x3bf5b7=_0x3bf5b7-0x110;const _0x10bed0=a59_0x10be();let _0x1d3706=_0x10bed0[_0x3bf5b7];return _0x1d3706;}async function execute(_0xe92e9b){const _0x5c3952=await buildSchemaPayload();return{'ok':!![],'data':_0x5c3952};}export const schemaDefinition={'service':a59_0x3559ee(0x11a),'command':'export','description':a59_0x3559ee(0x113),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
1
+ const a59_0x34f800=a59_0x2352;(function(_0x578b05,_0x11d438){const _0x2a98a2=a59_0x2352,_0x2131dd=_0x578b05();while(!![]){try{const _0x2388f5=-parseInt(_0x2a98a2(0xdc))/0x1*(parseInt(_0x2a98a2(0xdb))/0x2)+-parseInt(_0x2a98a2(0xe0))/0x3*(parseInt(_0x2a98a2(0xe1))/0x4)+-parseInt(_0x2a98a2(0xd9))/0x5+-parseInt(_0x2a98a2(0xdf))/0x6+-parseInt(_0x2a98a2(0xe7))/0x7*(-parseInt(_0x2a98a2(0xe4))/0x8)+-parseInt(_0x2a98a2(0xe2))/0x9*(-parseInt(_0x2a98a2(0xda))/0xa)+-parseInt(_0x2a98a2(0xe3))/0xb*(-parseInt(_0x2a98a2(0xde))/0xc);if(_0x2388f5===_0x11d438)break;else _0x2131dd['push'](_0x2131dd['shift']());}catch(_0x4e1c52){_0x2131dd['push'](_0x2131dd['shift']());}}}(a59_0x34c5,0x81fe7));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x238611){const _0xe41189=await buildSchemaPayload();return{'ok':!![],'data':_0xe41189};}function a59_0x2352(_0x572402,_0x8144d1){_0x572402=_0x572402-0xd9;const _0x34c5c0=a59_0x34c5();let _0x235204=_0x34c5c0[_0x572402];return _0x235204;}export const schemaDefinition={'service':a59_0x34f800(0xe5),'command':a59_0x34f800(0xe6),'description':a59_0x34f800(0xdd),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};function a59_0x34c5(){const _0x3008a1=['export','1897NTjtMh','1271290gVOjin','3104280IGimqi','10QEZsJb','857loWrhY','Export\x20machine-readable\x20command\x20schema\x20(JSON)','3636dBxjRP','1783824PaliOX','1175667YiJbKG','8MpehXE','9KRWycm','37873DHTTrb','15304Lmqazl','schema'];a59_0x34c5=function(){return _0x3008a1;};return a59_0x34c5();}
@@ -1 +1 @@
1
- (function(_0x1fcc35,_0x16bdf4){const _0x797e52=a60_0x206f,_0x29f8b4=_0x1fcc35();while(!![]){try{const _0x425afd=-parseInt(_0x797e52(0xf0))/0x1+-parseInt(_0x797e52(0xe0))/0x2*(-parseInt(_0x797e52(0xd6))/0x3)+-parseInt(_0x797e52(0xbd))/0x4*(-parseInt(_0x797e52(0xf2))/0x5)+parseInt(_0x797e52(0x10a))/0x6+-parseInt(_0x797e52(0xec))/0x7*(-parseInt(_0x797e52(0xf5))/0x8)+parseInt(_0x797e52(0xad))/0x9*(-parseInt(_0x797e52(0xd4))/0xa)+parseInt(_0x797e52(0x108))/0xb;if(_0x425afd===_0x16bdf4)break;else _0x29f8b4['push'](_0x29f8b4['shift']());}catch(_0x99afb9){_0x29f8b4['push'](_0x29f8b4['shift']());}}}(a60_0x37b9,0xb2c23));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';function a60_0x37b9(){const _0x38919a=['sql','sqlCode','dbtableConfig','default','Commands:','datasetCode','userName','fullPath','tenantCode','code','appRef','app','1660gXbKiw','scriptName','3AXDLft','\x20service\x20detail\x20--service\x20','appBindings','json','entries','appcode','slice','name','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','\x20->\x20','941962ltuuGX','risk','length','Unsupported\x20service\x20target\x20kind:\x20','service','cliPath','bffId','Run\x20service\x20command\x20','Unknown\x20appRef\x20\x22','flags','map','Cannot\x20resolve\x20datatable\x20\x22','443387xxzejj','userId','target','read','36016javcEL','mapTo','170EuyPCG','padEnd','commands','16mdpMTI','`\x20to\x20inspect\x20the\x20manifest.','username','tree','validation','\x20\x20MAP\x20TO','\x20requires\x20target.functionName.','rawFlags','params','\x20completed\x20in\x20','\x20\x20\x20\x20kind:\x20\x20\x20\x20','\x20requires\x20target.sqlCode.','loginName','remainingArgs','type','\x20\x20\x20\x20sqlCode:\x20','operator','push','bff','3681634qjPNFm','appCode','3415968KnAoEH','envName','now','\x20\x20\x20\x20','\x22.\x20','trim','flatMap','Service\x20command\x20','number','required','string','68562ocYBME','\x22\x20in\x20service\x20command\x20','context.','boolean','\x20\x20\x20\x20functionName:\x20','high-risk-write','tableName','nickName','find','nickname','kind','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.','startsWith','\x20\x20\x20\x20datasetCode:\x20','join','description','62484qcNPQh','datatable','source','data','args','normalizedManifest','command','env','filter','bffCode','\x20<command>\x20[flags]'];a60_0x37b9=function(){return _0x38919a;};return a60_0x37b9();}export function resolveDynamicServiceCommand(_0x3de2aa,_0x47023e){const _0x230a67=a60_0x206f,_0x7a278c=listLocalServiceTrees();let _0x344cbe;for(const _0x424c92 of _0x7a278c){const _0x2d48d0=matchServiceTreeCommand(_0x424c92,_0x3de2aa);if(!_0x2d48d0)continue;(!_0x344cbe||_0x2d48d0[_0x230a67(0xc3)]['fullPath'][_0x230a67(0xe2)]>_0x344cbe['command'][_0x230a67(0xcf)][_0x230a67(0xe2)])&&(_0x344cbe={'tree':_0x424c92,'command':_0x2d48d0[_0x230a67(0xc3)],'remainingArgs':_0x2d48d0[_0x230a67(0x102)]});}if(!_0x344cbe)return undefined;const _0x2f3fb6={..._0x47023e};return applyAppBinding(_0x344cbe['tree'],_0x344cbe['command'],_0x2f3fb6),{'definition':buildDynamicCommandDefinition(_0x344cbe[_0x230a67(0xf8)],_0x344cbe[_0x230a67(0xc3)]),'args':_0x344cbe[_0x230a67(0x102)],'flags':_0x2f3fb6,'tree':_0x344cbe[_0x230a67(0xf8)],'command':_0x344cbe[_0x230a67(0xc3)]};}export function generateDynamicServiceHelp(_0x3f2e17){const _0x2f35ec=a60_0x206f,_0x144119=listLocalServiceTrees()[_0x2f35ec(0xb5)](_0x50555b=>_0x50555b['service'][_0x2f35ec(0xd1)]===_0x3f2e17);if(!_0x144119)return undefined;const _0x280938=[CLI_BIN_NAME+'\x20'+_0x3f2e17+_0x2f35ec(0xc7),'',_0x144119[_0x2f35ec(0xe4)][_0x2f35ec(0xdd)]||_0x3f2e17,_0x144119[_0x2f35ec(0xe4)][_0x2f35ec(0xbc)]?'\x20\x20'+_0x144119[_0x2f35ec(0xe4)]['description']:'','',_0x2f35ec(0xcc),..._0x144119[_0x2f35ec(0xf4)][_0x2f35ec(0xea)](_0x1ea5ad=>{const _0x3ab43c=_0x2f35ec,_0x2858e7=_0x1ea5ad[_0x3ab43c(0xcf)]['slice'](0x1)['join']('\x20'),_0x397224=_0x1ea5ad['risk']==='read'?'':'\x20['+_0x1ea5ad['risk']+']';return'\x20\x20'+_0x2858e7[_0x3ab43c(0xf3)](0x18)+'\x20'+(_0x1ea5ad[_0x3ab43c(0xbc)]||'')+_0x397224;}),'','Use\x20`'+CLI_BIN_NAME+_0x2f35ec(0xd7)+_0x3f2e17+_0x2f35ec(0xf6)][_0x2f35ec(0xc5)](Boolean);return _0x280938['join']('\x0a');}export function listDynamicServiceEntries(){const _0x29957e=a60_0x206f;return listLocalServices()[_0x29957e(0xea)](_0x6dfe1c=>{const _0x570730=_0x29957e,_0x3c3245=_0x6dfe1c[_0x570730(0xc2)];return{'service':_0x3c3245[_0x570730(0xe4)][_0x570730(0xd1)],'label':_0x3c3245['service'][_0x570730(0xdd)]||_0x3c3245[_0x570730(0xe4)][_0x570730(0xd1)],'commands':_0x3c3245[_0x570730(0xf4)][_0x570730(0xea)](_0x4ceb91=>({'command':dynamicCommandName(_0x4ceb91),'description':_0x4ceb91['description']||_0x570730(0xe7)+_0x4ceb91[_0x570730(0xe5)],'tag':riskTag(_0x4ceb91[_0x570730(0xe1)])}))};});}export function getDynamicServiceEntry(_0x330cac){const _0x175922=a60_0x206f;return listDynamicServiceEntries()[_0x175922(0xb5)](_0x414877=>_0x414877[_0x175922(0xe4)]===_0x330cac);}export function listDynamicServiceDefinitions(_0x31d736){const _0x507c22=a60_0x206f;return listLocalServiceTrees()[_0x507c22(0xc5)](_0x3fde7f=>!_0x31d736||_0x3fde7f[_0x507c22(0xe4)][_0x507c22(0xd1)]===_0x31d736)[_0x507c22(0x110)](_0x5bcdad=>_0x5bcdad['commands'][_0x507c22(0xea)](_0x3b8008=>buildDynamicCommandDefinition(_0x5bcdad,_0x3b8008)));}export function getDynamicServiceDefinitions(_0x4d5792){const _0x1e7a2=listDynamicServiceDefinitions(_0x4d5792);return _0x1e7a2['length']>0x0?_0x1e7a2:undefined;}export function findDynamicServiceDefinition(_0xa944a8,_0x264535){const _0xe45abf=a60_0x206f;return listDynamicServiceDefinitions(_0xa944a8)[_0xe45abf(0xb5)](_0x345574=>_0x345574[_0xe45abf(0xc3)]===_0x264535);}export function buildDynamicCommandDefinition(_0x1088e4,_0x437977){const _0x4752ac=a60_0x206f;return{'service':_0x1088e4['service'][_0x4752ac(0xd1)],'command':dynamicCommandName(_0x437977),'description':_0x437977[_0x4752ac(0xbc)]||_0x4752ac(0xe7)+_0x437977[_0x4752ac(0xe5)],'risk':_0x437977[_0x4752ac(0xe1)],..._0x437977[_0x4752ac(0xe1)]===_0x4752ac(0xef)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x437977)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x437977[_0x4752ac(0xc1)][_0x4752ac(0xea)](_0x38251b=>({'name':_0x38251b[_0x4752ac(0xdd)],'description':_0x38251b[_0x4752ac(0xbc)]||_0x38251b[_0x4752ac(0xdd)],'required':_0x38251b[_0x4752ac(0xab)]})),'flags':_0x437977[_0x4752ac(0xe9)][_0x4752ac(0xea)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x437977),async 'dryRun'(_0x452fbb){const _0x5d9e29=_0x4752ac,_0x4e3b90=await compilePlan(_0x437977,_0x452fbb);return{'method':'SERVICE_TREE','url':_0x437977[_0x5d9e29(0xe5)],'body':{'target':targetPreview(_0x4e3b90),'params':_0x4e3b90['params']},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x437977[_0x5d9e29(0xe5)]};},async 'execute'(_0x59d820){const _0x4f0e9d=_0x4752ac,_0xc86553=await compilePlan(_0x437977,_0x59d820),_0x92d15b=Date[_0x4f0e9d(0x10c)](),_0x501d70=await executePlan(_0xc86553,_0x437977,_0x59d820),_0x45855f=Date[_0x4f0e9d(0x10c)]()-_0x92d15b;return{'ok':!![],'data':{'service':_0x1088e4[_0x4f0e9d(0xe4)],'command':_0x437977[_0x4f0e9d(0xe5)],'target':targetPreview(_0xc86553),'result':_0x501d70,'elapsed':_0x45855f},'message':'Service\x20command\x20'+_0x437977[_0x4f0e9d(0xe5)]+_0x4f0e9d(0xfe)+_0x45855f+'ms'};}};}function buildDynamicConfirmationDescription(_0x21b6ad){const _0x564e58=a60_0x206f,_0x2ac949=_0x21b6ad[_0x564e58(0xbc)]||_0x21b6ad[_0x564e58(0xe5)],_0x51aa67=_0x21b6ad[_0x564e58(0xe1)]===_0x564e58(0xb2)?_0x564e58(0xb8):'The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.';return'This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22'+_0x2ac949+_0x564e58(0x10e)+_0x51aa67;}function dynamicCommandName(_0x1697d1){const _0x4c3568=a60_0x206f;return _0x1697d1[_0x4c3568(0xcf)][_0x4c3568(0xdc)](0x1)['join']('\x20');}function riskTag(_0x47924b){const _0x31d341=a60_0x206f;return _0x47924b===_0x31d341(0xef)?'':'\x20\x20['+_0x47924b+']';}function flagToCommandFlag(_0x414a85){const _0x10bfe2=a60_0x206f;return{'name':_0x414a85['cliName'],'type':_0x414a85[_0x10bfe2(0x103)]===_0x10bfe2(0xd9)?_0x10bfe2(0xac):_0x414a85['type'],'description':_0x414a85[_0x10bfe2(0xbc)]||_0x414a85[_0x10bfe2(0xdd)],'required':_0x414a85[_0x10bfe2(0xab)],'default':isPrimitiveFlagDefault(_0x414a85[_0x10bfe2(0xcb)])?_0x414a85[_0x10bfe2(0xcb)]:undefined,'enum':_0x414a85['enum']};}async function compilePlan(_0x93a840,_0x33f4dc){const _0xaef5f5=a60_0x206f;return compileServiceTreeCommand(_0x93a840,{'flags':_0x33f4dc[_0xaef5f5(0xfc)],'args':_0x33f4dc[_0xaef5f5(0xc1)],'context':await buildServiceContext(_0x93a840,_0x33f4dc)});}async function buildServiceContext(_0x2af4c5,_0x3d4001){const _0x5b0bbe=a60_0x206f,_0x1ca18c={'appCode':_0x3d4001['appCode'],'env':_0x3d4001[_0x5b0bbe(0x10b)],'envName':_0x3d4001[_0x5b0bbe(0x10b)]};if(!usesRuntimeContext(_0x2af4c5))return _0x1ca18c;const _0x391d03=await getLoginUserInfo(),_0x151d2e=pickFirst(_0x391d03[_0x5b0bbe(0xed)],_0x391d03['id']);return{..._0x1ca18c,'user':_0x391d03,'userId':_0x151d2e,'id':_0x391d03['id'],'username':pickFirst(_0x391d03[_0x5b0bbe(0xf7)],_0x391d03[_0x5b0bbe(0xce)],_0x391d03[_0x5b0bbe(0x101)]),'userName':_0x391d03[_0x5b0bbe(0xce)],'nickname':pickFirst(_0x391d03[_0x5b0bbe(0xb6)],_0x391d03[_0x5b0bbe(0xb4)]),'nickName':_0x391d03[_0x5b0bbe(0xb4)],'tenantCode':_0x391d03[_0x5b0bbe(0xd0)],'employeeId':_0x391d03['employeeId']};}function usesRuntimeContext(_0x5691f8){const _0x289403=a60_0x206f;return _0x5691f8[_0x289403(0xf1)]['some'](_0x53639c=>typeof _0x53639c[_0x289403(0xbf)]===_0x289403(0xac)&&(_0x53639c[_0x289403(0xbf)][_0x289403(0xb9)](_0x289403(0xaf))||_0x53639c[_0x289403(0xbf)][_0x289403(0xb9)]('ctx.')));}function pickFirst(..._0x581a49){const _0x3e9fcb=a60_0x206f;return _0x581a49[_0x3e9fcb(0xb5)](_0x2fe123=>_0x2fe123!==undefined&&_0x2fe123!==null);}async function executePlan(_0x39dc23,_0x28aa73,_0x28c240){const _0x35a02f=a60_0x206f;if(_0x39dc23[_0x35a02f(0xb7)]===_0x35a02f(0xc0)){const _0x454946=await resolveDatasetCode(_0x39dc23,_0x28aa73,_0x28c240);return executeData(_0x454946,_0x39dc23[_0x35a02f(0xc3)],_0x39dc23[_0x35a02f(0xfd)]);}if(_0x39dc23[_0x35a02f(0xb7)]===_0x35a02f(0xc8)){if(!_0x39dc23[_0x35a02f(0xc9)])throw CliErrors[_0x35a02f(0xf9)](_0x35a02f(0x111)+_0x28aa73[_0x35a02f(0xe5)]+_0x35a02f(0x100));return executeSdkSql(_0x39dc23[_0x35a02f(0xc9)],normalizeScalarParams(_0x39dc23['params']));}if(_0x39dc23[_0x35a02f(0xb7)]===_0x35a02f(0x107)){const _0x97f20e=_0x39dc23[_0x35a02f(0xd5)]||_0x39dc23[_0x35a02f(0xc6)]||(_0x39dc23['bffId']==null?'':String(_0x39dc23[_0x35a02f(0xe6)]));if(!_0x97f20e)throw CliErrors[_0x35a02f(0xf9)]('Service\x20command\x20'+_0x28aa73[_0x35a02f(0xe5)]+_0x35a02f(0xfb));return executeSdkBff(_0x97f20e,_0x39dc23['params']);}throw CliErrors['validation'](_0x35a02f(0xe3)+_0x39dc23[_0x35a02f(0xb7)]);}async function resolveDatasetCode(_0x5b9671,_0x329bef,_0x501884){const _0x421114=a60_0x206f;if(_0x5b9671[_0x421114(0xcd)])return _0x5b9671[_0x421114(0xcd)];if(!_0x5b9671['datatable'])throw CliErrors['validation']('Service\x20command\x20'+_0x329bef[_0x421114(0xe5)]+_0x421114(0xde));const _0x38d0ee=await listDatasets(_0x501884[_0x421114(0x109)]),_0x31a311=_0x38d0ee[_0x421114(0xb5)](_0x60e1b4=>_0x60e1b4[_0x421114(0xca)]?.[_0x421114(0xb3)]===_0x5b9671['datatable']);if(!_0x31a311?.['code'])throw CliErrors[_0x421114(0xf9)](_0x421114(0xeb)+_0x5b9671[_0x421114(0xbe)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x501884['appCode']+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x31a311[_0x421114(0xd1)];}function applyAppBinding(_0x820e9,_0x2ce3c4,_0x3ed2c7){const _0x36e4e7=a60_0x206f,_0xcec987=_0x2ce3c4[_0x36e4e7(0xee)][_0x36e4e7(0xd2)];if(!_0xcec987)return;const _0x4fa6e0=_0x820e9[_0x36e4e7(0xd8)][_0xcec987];if(!_0x4fa6e0)throw CliErrors[_0x36e4e7(0xf9)](_0x36e4e7(0xe8)+_0xcec987+_0x36e4e7(0xae)+_0x2ce3c4[_0x36e4e7(0xe5)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0xb89851=_0x4fa6e0[_0x36e4e7(0xdb)]||_0x4fa6e0[_0x36e4e7(0x109)];_0xb89851&&!hasText(_0x3ed2c7[_0x36e4e7(0xdb)])&&(_0x3ed2c7[_0x36e4e7(0xdb)]=_0xb89851),_0x4fa6e0['app']&&!hasText(_0x3ed2c7[_0x36e4e7(0xd3)])&&!hasText(_0x3ed2c7[_0x36e4e7(0xdb)])&&(_0x3ed2c7[_0x36e4e7(0xd3)]=_0x4fa6e0[_0x36e4e7(0xd3)]),_0x4fa6e0[_0x36e4e7(0xc4)]&&!hasText(_0x3ed2c7[_0x36e4e7(0xc4)])&&(_0x3ed2c7[_0x36e4e7(0xc4)]=_0x4fa6e0[_0x36e4e7(0xc4)]);}function renderDynamicCommandHelp(_0x5883a9){const _0x5a41a7=a60_0x206f,_0x474f31=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x5a41a7(0xff)+_0x5883a9[_0x5a41a7(0xee)]['kind'],'\x20\x20\x20\x20command:\x20'+_0x5883a9['target']['command']];if(_0x5883a9['target'][_0x5a41a7(0xcd)])_0x474f31[_0x5a41a7(0x106)](_0x5a41a7(0xba)+_0x5883a9[_0x5a41a7(0xee)][_0x5a41a7(0xcd)]);if(_0x5883a9[_0x5a41a7(0xee)][_0x5a41a7(0xbe)])_0x474f31[_0x5a41a7(0x106)]('\x20\x20\x20\x20datatable:\x20'+_0x5883a9[_0x5a41a7(0xee)][_0x5a41a7(0xbe)]);if(_0x5883a9[_0x5a41a7(0xee)][_0x5a41a7(0xc9)])_0x474f31[_0x5a41a7(0x106)](_0x5a41a7(0x104)+_0x5883a9[_0x5a41a7(0xee)][_0x5a41a7(0xc9)]);if(_0x5883a9[_0x5a41a7(0xee)][_0x5a41a7(0xd5)])_0x474f31[_0x5a41a7(0x106)](_0x5a41a7(0xb1)+_0x5883a9[_0x5a41a7(0xee)]['scriptName']);if(_0x5883a9['mapTo'][_0x5a41a7(0xe2)]>0x0){_0x474f31[_0x5a41a7(0x106)]('',_0x5a41a7(0xfa));for(const _0x4969f1 of _0x5883a9['mapTo']){_0x474f31['push'](_0x5a41a7(0x10d)+(_0x4969f1['source']||'const')+_0x5a41a7(0xdf)+_0x4969f1[_0x5a41a7(0xee)]+(_0x4969f1['operator']?'.'+_0x4969f1[_0x5a41a7(0x105)]:''));}}return _0x474f31[_0x5a41a7(0xbb)]('\x0a');}function a60_0x206f(_0x5b6d9d,_0x5acab8){_0x5b6d9d=_0x5b6d9d-0xab;const _0x37b9cc=a60_0x37b9();let _0x206fab=_0x37b9cc[_0x5b6d9d];return _0x206fab;}function targetPreview(_0x2a7050){const _0x4893ff=a60_0x206f;return{'kind':_0x2a7050[_0x4893ff(0xb7)],'command':_0x2a7050['command'],'appRef':_0x2a7050[_0x4893ff(0xd2)],'datasetCode':_0x2a7050[_0x4893ff(0xcd)],'datatable':_0x2a7050[_0x4893ff(0xbe)],'sqlCode':_0x2a7050[_0x4893ff(0xc9)],'bffCode':_0x2a7050[_0x4893ff(0xc6)],'bffId':_0x2a7050[_0x4893ff(0xe6)],'functionName':_0x2a7050['scriptName']};}function normalizeScalarParams(_0x1b27d3){const _0xa85149=a60_0x206f;return Object['fromEntries'](Object[_0xa85149(0xda)](_0x1b27d3)[_0xa85149(0xc5)](([,_0xa1054])=>typeof _0xa1054===_0xa85149(0xac)||typeof _0xa1054===_0xa85149(0x112)));}function hasText(_0x261d2d){const _0x556274=a60_0x206f;return typeof _0x261d2d===_0x556274(0xac)&&_0x261d2d[_0x556274(0x10f)]()[_0x556274(0xe2)]>0x0;}function isPrimitiveFlagDefault(_0x330fd4){const _0x318db6=a60_0x206f;return _0x330fd4===undefined||typeof _0x330fd4===_0x318db6(0xac)||typeof _0x330fd4===_0x318db6(0x112)||typeof _0x330fd4===_0x318db6(0xb0);}
1
+ (function(_0x373b5c,_0x2ac112){const _0x1d72b8=a60_0x33b0,_0x20cc55=_0x373b5c();while(!![]){try{const _0x605e1b=-parseInt(_0x1d72b8(0x113))/0x1*(parseInt(_0x1d72b8(0x127))/0x2)+parseInt(_0x1d72b8(0x120))/0x3*(parseInt(_0x1d72b8(0x12f))/0x4)+parseInt(_0x1d72b8(0x14c))/0x5+-parseInt(_0x1d72b8(0x129))/0x6+-parseInt(_0x1d72b8(0x11e))/0x7+parseInt(_0x1d72b8(0x130))/0x8*(-parseInt(_0x1d72b8(0x12e))/0x9)+parseInt(_0x1d72b8(0x176))/0xa*(parseInt(_0x1d72b8(0x163))/0xb);if(_0x605e1b===_0x2ac112)break;else _0x20cc55['push'](_0x20cc55['shift']());}catch(_0x47e85d){_0x20cc55['push'](_0x20cc55['shift']());}}}(a60_0x691d,0x7ea60));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(_0x239dab,_0x39581b){const _0x58e28f=a60_0x33b0,_0x1998fc=listLocalServiceTrees();let _0x4cae39;for(const _0x56a062 of _0x1998fc){const _0x3546d0=matchServiceTreeCommand(_0x56a062,_0x239dab);if(!_0x3546d0)continue;(!_0x4cae39||_0x3546d0[_0x58e28f(0x150)][_0x58e28f(0x131)][_0x58e28f(0x171)]>_0x4cae39[_0x58e28f(0x150)]['fullPath'][_0x58e28f(0x171)])&&(_0x4cae39={'tree':_0x56a062,'command':_0x3546d0[_0x58e28f(0x150)],'remainingArgs':_0x3546d0[_0x58e28f(0x13d)]});}if(!_0x4cae39)return undefined;const _0x246a30={..._0x39581b};return applyAppBinding(_0x4cae39['tree'],_0x4cae39[_0x58e28f(0x150)],_0x246a30),{'definition':buildDynamicCommandDefinition(_0x4cae39[_0x58e28f(0x141)],_0x4cae39['command']),'args':_0x4cae39[_0x58e28f(0x13d)],'flags':_0x246a30,'tree':_0x4cae39[_0x58e28f(0x141)],'command':_0x4cae39[_0x58e28f(0x150)]};}export function generateDynamicServiceHelp(_0x1069c3){const _0x36e3dc=a60_0x33b0,_0x234211=listLocalServiceTrees()['find'](_0x5e82c5=>_0x5e82c5[_0x36e3dc(0x139)]['code']===_0x1069c3);if(!_0x234211)return undefined;const _0x1a54b4=[CLI_BIN_NAME+'\x20'+_0x1069c3+_0x36e3dc(0x146),'',_0x234211[_0x36e3dc(0x139)][_0x36e3dc(0x12d)]||_0x1069c3,_0x234211[_0x36e3dc(0x139)][_0x36e3dc(0x151)]?'\x20\x20'+_0x234211[_0x36e3dc(0x139)][_0x36e3dc(0x151)]:'','',_0x36e3dc(0x143),..._0x234211[_0x36e3dc(0x124)]['map'](_0x4bac82=>{const _0x406a1f=_0x36e3dc,_0x4691a6=_0x4bac82['fullPath'][_0x406a1f(0x15f)](0x1)['join']('\x20'),_0x2bb609=_0x4bac82[_0x406a1f(0x142)]===_0x406a1f(0x15c)?'':'\x20['+_0x4bac82['risk']+']';return'\x20\x20'+_0x4691a6['padEnd'](0x18)+'\x20'+(_0x4bac82[_0x406a1f(0x151)]||'')+_0x2bb609;}),'',_0x36e3dc(0x12c)+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x1069c3+_0x36e3dc(0x132)][_0x36e3dc(0x122)](Boolean);return _0x1a54b4[_0x36e3dc(0x116)]('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x6896ef=>{const _0x18d6c0=a60_0x33b0,_0x31dc2f=_0x6896ef['normalizedManifest'];return{'service':_0x31dc2f[_0x18d6c0(0x139)][_0x18d6c0(0x14b)],'label':_0x31dc2f['service']['name']||_0x31dc2f[_0x18d6c0(0x139)]['code'],'commands':_0x31dc2f[_0x18d6c0(0x124)][_0x18d6c0(0x158)](_0xfb47e3=>({'command':dynamicCommandName(_0xfb47e3),'description':_0xfb47e3['description']||_0x18d6c0(0x118)+_0xfb47e3['cliPath'],'tag':riskTag(_0xfb47e3['risk'])}))};});}export function getDynamicServiceEntry(_0x4d97ff){const _0x380a9f=a60_0x33b0;return listDynamicServiceEntries()[_0x380a9f(0x173)](_0x33a387=>_0x33a387[_0x380a9f(0x139)]===_0x4d97ff);}export function listDynamicServiceDefinitions(_0x34e91e){const _0x7d761e=a60_0x33b0;return listLocalServiceTrees()[_0x7d761e(0x122)](_0x1355e8=>!_0x34e91e||_0x1355e8[_0x7d761e(0x139)][_0x7d761e(0x14b)]===_0x34e91e)[_0x7d761e(0x16a)](_0x39b85d=>_0x39b85d[_0x7d761e(0x124)][_0x7d761e(0x158)](_0x440e4f=>buildDynamicCommandDefinition(_0x39b85d,_0x440e4f)));}export function getDynamicServiceDefinitions(_0x392cff){const _0x33b82e=a60_0x33b0,_0x3d5fc2=listDynamicServiceDefinitions(_0x392cff);return _0x3d5fc2[_0x33b82e(0x171)]>0x0?_0x3d5fc2:undefined;}export function findDynamicServiceDefinition(_0x52cefb,_0x5269df){const _0x1ab9dd=a60_0x33b0;return listDynamicServiceDefinitions(_0x52cefb)[_0x1ab9dd(0x173)](_0x42c8db=>_0x42c8db[_0x1ab9dd(0x150)]===_0x5269df);}export function buildDynamicCommandDefinition(_0x2f2842,_0x428a06){const _0x128f78=a60_0x33b0;return{'service':_0x2f2842[_0x128f78(0x139)][_0x128f78(0x14b)],'command':dynamicCommandName(_0x428a06),'description':_0x428a06[_0x128f78(0x151)]||_0x128f78(0x118)+_0x428a06[_0x128f78(0x14a)],'risk':_0x428a06['risk'],..._0x428a06[_0x128f78(0x142)]===_0x128f78(0x15c)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x428a06)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x428a06['args']['map'](_0x1a6561=>({'name':_0x1a6561[_0x128f78(0x12d)],'description':_0x1a6561[_0x128f78(0x151)]||_0x1a6561[_0x128f78(0x12d)],'required':_0x1a6561['required']})),'flags':_0x428a06[_0x128f78(0x167)][_0x128f78(0x158)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x428a06),async 'dryRun'(_0x1240ee){const _0x497efc=_0x128f78,_0x4b3f33=await compilePlan(_0x428a06,_0x1240ee);return{'method':'SERVICE_TREE','url':_0x428a06['cliPath'],'body':{'target':targetPreview(_0x4b3f33),'params':_0x4b3f33[_0x497efc(0x161)]},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x428a06[_0x497efc(0x14a)]};},async 'execute'(_0x2a5968){const _0x5c259f=_0x128f78,_0x34df79=await compilePlan(_0x428a06,_0x2a5968),_0xeaedd=Date['now'](),_0x4175ee=await executePlan(_0x34df79,_0x428a06,_0x2a5968),_0xe3e526=Date[_0x5c259f(0x159)]()-_0xeaedd;return{'ok':!![],'data':{'service':_0x2f2842['service'],'command':_0x428a06[_0x5c259f(0x14a)],'target':targetPreview(_0x34df79),'result':_0x4175ee,'elapsed':_0xe3e526},'message':_0x5c259f(0x170)+_0x428a06[_0x5c259f(0x14a)]+_0x5c259f(0x149)+_0xe3e526+'ms'};}};}function a60_0x691d(){const _0x2d69e7=['bffId','userName','map','now','nickName','\x20\x20\x20\x20command:\x20','read','datatable','appCode','slice','appcode','params','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','192731lbPSvv','sql','\x20->\x20','source','flags','startsWith','\x20requires\x20target.sqlCode.','flatMap','type','\x20\x20SERVICE\x20TREE\x20TARGET','\x20requires\x20target.functionName.','dbtableConfig','required','Service\x20command\x20','length','validation','find','\x20\x20MAP\x20TO','userId','1070noaGrr','entries','env','rawFlags','app','username','const','scriptName','37GmtRAP','tableName','string','join','\x20\x20\x20\x20datatable:\x20','Run\x20service\x20command\x20','args','context.','\x22\x20in\x20service\x20command\x20','\x22.\x20','json','117775ULdmJS','cliName','3kwHGaB','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.','filter','bff','commands','sqlCode','loginName','53726qLnMXd','number','2201328TmiTzI','tenantCode','default','Use\x20`','name','7253523tOVbQS','955380lcIRIu','8GAqAyc','fullPath','`\x20to\x20inspect\x20the\x20manifest.','ctx.','Unknown\x20appRef\x20\x22','mapTo','fromEntries','bffCode','appRef','service','trim','target','\x20\x20\x20\x20kind:\x20\x20\x20\x20','remainingArgs','push','This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22','Cannot\x20resolve\x20datatable\x20\x22','tree','risk','Commands:','appBindings','enum','\x20<command>\x20[flags]','envName','kind','\x20completed\x20in\x20','cliPath','code','2943755YbzGij','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','data','operator','command','description','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','nickname','\x20\x20\x20\x20datasetCode:\x20','datasetCode'];a60_0x691d=function(){return _0x2d69e7;};return a60_0x691d();}function buildDynamicConfirmationDescription(_0x25ab97){const _0x4d9699=a60_0x33b0,_0x1dc52b=_0x25ab97[_0x4d9699(0x151)]||_0x25ab97[_0x4d9699(0x14a)],_0x582cfd=_0x25ab97['risk']==='high-risk-write'?'The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.':_0x4d9699(0x121);return _0x4d9699(0x13f)+_0x1dc52b+_0x4d9699(0x11c)+_0x582cfd;}function dynamicCommandName(_0x4357e3){const _0x11952b=a60_0x33b0;return _0x4357e3[_0x11952b(0x131)]['slice'](0x1)['join']('\x20');}function a60_0x33b0(_0x32a074,_0x5bbea9){_0x32a074=_0x32a074-0x113;const _0x691ddf=a60_0x691d();let _0x33b03c=_0x691ddf[_0x32a074];return _0x33b03c;}function riskTag(_0x3d5554){const _0x45e679=a60_0x33b0;return _0x3d5554===_0x45e679(0x15c)?'':'\x20\x20['+_0x3d5554+']';}function flagToCommandFlag(_0x460168){const _0x278adf=a60_0x33b0;return{'name':_0x460168[_0x278adf(0x11f)],'type':_0x460168['type']===_0x278adf(0x11d)?_0x278adf(0x115):_0x460168[_0x278adf(0x16b)],'description':_0x460168[_0x278adf(0x151)]||_0x460168[_0x278adf(0x12d)],'required':_0x460168[_0x278adf(0x16f)],'default':isPrimitiveFlagDefault(_0x460168[_0x278adf(0x12b)])?_0x460168[_0x278adf(0x12b)]:undefined,'enum':_0x460168[_0x278adf(0x145)]};}async function compilePlan(_0x4b010f,_0x7dcb10){const _0x3cbce7=a60_0x33b0;return compileServiceTreeCommand(_0x4b010f,{'flags':_0x7dcb10[_0x3cbce7(0x179)],'args':_0x7dcb10[_0x3cbce7(0x119)],'context':await buildServiceContext(_0x4b010f,_0x7dcb10)});}async function buildServiceContext(_0x4d5eb1,_0x369df6){const _0x3de335=a60_0x33b0,_0x5cd120={'appCode':_0x369df6[_0x3de335(0x15e)],'env':_0x369df6[_0x3de335(0x147)],'envName':_0x369df6[_0x3de335(0x147)]};if(!usesRuntimeContext(_0x4d5eb1))return _0x5cd120;const _0x5ec1c5=await getLoginUserInfo(),_0x1185b4=pickFirst(_0x5ec1c5[_0x3de335(0x175)],_0x5ec1c5['id']);return{..._0x5cd120,'user':_0x5ec1c5,'userId':_0x1185b4,'id':_0x5ec1c5['id'],'username':pickFirst(_0x5ec1c5[_0x3de335(0x17b)],_0x5ec1c5[_0x3de335(0x157)],_0x5ec1c5[_0x3de335(0x126)]),'userName':_0x5ec1c5[_0x3de335(0x157)],'nickname':pickFirst(_0x5ec1c5[_0x3de335(0x153)],_0x5ec1c5[_0x3de335(0x15a)]),'nickName':_0x5ec1c5[_0x3de335(0x15a)],'tenantCode':_0x5ec1c5[_0x3de335(0x12a)],'employeeId':_0x5ec1c5['employeeId']};}function usesRuntimeContext(_0x55b9d3){const _0x21e858=a60_0x33b0;return _0x55b9d3[_0x21e858(0x135)]['some'](_0x32ac6e=>typeof _0x32ac6e[_0x21e858(0x166)]===_0x21e858(0x115)&&(_0x32ac6e[_0x21e858(0x166)][_0x21e858(0x168)](_0x21e858(0x11a))||_0x32ac6e['source'][_0x21e858(0x168)](_0x21e858(0x133))));}function pickFirst(..._0x5dfb64){const _0x4bffe3=a60_0x33b0;return _0x5dfb64[_0x4bffe3(0x173)](_0x23a34e=>_0x23a34e!==undefined&&_0x23a34e!==null);}async function executePlan(_0x25514e,_0x2385dd,_0x525826){const _0x59353f=a60_0x33b0;if(_0x25514e['kind']===_0x59353f(0x14e)){const _0x32c1c3=await resolveDatasetCode(_0x25514e,_0x2385dd,_0x525826);return executeData(_0x32c1c3,_0x25514e[_0x59353f(0x150)],_0x25514e[_0x59353f(0x161)]);}if(_0x25514e[_0x59353f(0x148)]===_0x59353f(0x164)){if(!_0x25514e[_0x59353f(0x125)])throw CliErrors[_0x59353f(0x172)](_0x59353f(0x170)+_0x2385dd[_0x59353f(0x14a)]+_0x59353f(0x169));return executeSdkSql(_0x25514e[_0x59353f(0x125)],normalizeScalarParams(_0x25514e['params']));}if(_0x25514e[_0x59353f(0x148)]===_0x59353f(0x123)){const _0x19a2e5=_0x25514e[_0x59353f(0x17d)]||_0x25514e['bffCode']||(_0x25514e[_0x59353f(0x156)]==null?'':String(_0x25514e[_0x59353f(0x156)]));if(!_0x19a2e5)throw CliErrors[_0x59353f(0x172)](_0x59353f(0x170)+_0x2385dd[_0x59353f(0x14a)]+_0x59353f(0x16d));return executeSdkBff(_0x19a2e5,_0x25514e[_0x59353f(0x161)]);}throw CliErrors[_0x59353f(0x172)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x25514e[_0x59353f(0x148)]);}async function resolveDatasetCode(_0x2eca68,_0x22395f,_0x16f761){const _0x1f9899=a60_0x33b0;if(_0x2eca68['datasetCode'])return _0x2eca68['datasetCode'];if(!_0x2eca68[_0x1f9899(0x15d)])throw CliErrors[_0x1f9899(0x172)](_0x1f9899(0x170)+_0x22395f['cliPath']+_0x1f9899(0x162));const _0x6aff6f=await listDatasets(_0x16f761[_0x1f9899(0x15e)]),_0x454805=_0x6aff6f[_0x1f9899(0x173)](_0x2cabc6=>_0x2cabc6[_0x1f9899(0x16e)]?.[_0x1f9899(0x114)]===_0x2eca68[_0x1f9899(0x15d)]);if(!_0x454805?.[_0x1f9899(0x14b)])throw CliErrors[_0x1f9899(0x172)](_0x1f9899(0x140)+_0x2eca68[_0x1f9899(0x15d)]+_0x1f9899(0x152)+_0x16f761[_0x1f9899(0x15e)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x454805[_0x1f9899(0x14b)];}function applyAppBinding(_0x1ee1b7,_0x1f4c2e,_0x2e112f){const _0x63aab9=a60_0x33b0,_0x2a6414=_0x1f4c2e[_0x63aab9(0x13b)][_0x63aab9(0x138)];if(!_0x2a6414)return;const _0x38efda=_0x1ee1b7[_0x63aab9(0x144)][_0x2a6414];if(!_0x38efda)throw CliErrors['validation'](_0x63aab9(0x134)+_0x2a6414+_0x63aab9(0x11b)+_0x1f4c2e[_0x63aab9(0x14a)]+'.',_0x63aab9(0x14d));const _0x2f0747=_0x38efda['appcode']||_0x38efda[_0x63aab9(0x15e)];_0x2f0747&&!hasText(_0x2e112f[_0x63aab9(0x160)])&&(_0x2e112f['appcode']=_0x2f0747),_0x38efda[_0x63aab9(0x17a)]&&!hasText(_0x2e112f[_0x63aab9(0x17a)])&&!hasText(_0x2e112f[_0x63aab9(0x160)])&&(_0x2e112f[_0x63aab9(0x17a)]=_0x38efda[_0x63aab9(0x17a)]),_0x38efda[_0x63aab9(0x178)]&&!hasText(_0x2e112f[_0x63aab9(0x178)])&&(_0x2e112f[_0x63aab9(0x178)]=_0x38efda[_0x63aab9(0x178)]);}function renderDynamicCommandHelp(_0x65d901){const _0xbfb184=a60_0x33b0,_0x512bab=[_0xbfb184(0x16c),_0xbfb184(0x13c)+_0x65d901[_0xbfb184(0x13b)][_0xbfb184(0x148)],_0xbfb184(0x15b)+_0x65d901[_0xbfb184(0x13b)]['command']];if(_0x65d901[_0xbfb184(0x13b)]['datasetCode'])_0x512bab[_0xbfb184(0x13e)](_0xbfb184(0x154)+_0x65d901[_0xbfb184(0x13b)][_0xbfb184(0x155)]);if(_0x65d901[_0xbfb184(0x13b)]['datatable'])_0x512bab['push'](_0xbfb184(0x117)+_0x65d901[_0xbfb184(0x13b)][_0xbfb184(0x15d)]);if(_0x65d901[_0xbfb184(0x13b)][_0xbfb184(0x125)])_0x512bab['push']('\x20\x20\x20\x20sqlCode:\x20'+_0x65d901['target'][_0xbfb184(0x125)]);if(_0x65d901[_0xbfb184(0x13b)][_0xbfb184(0x17d)])_0x512bab[_0xbfb184(0x13e)]('\x20\x20\x20\x20functionName:\x20'+_0x65d901[_0xbfb184(0x13b)][_0xbfb184(0x17d)]);if(_0x65d901[_0xbfb184(0x135)][_0xbfb184(0x171)]>0x0){_0x512bab[_0xbfb184(0x13e)]('',_0xbfb184(0x174));for(const _0x3f15c6 of _0x65d901[_0xbfb184(0x135)]){_0x512bab['push']('\x20\x20\x20\x20'+(_0x3f15c6[_0xbfb184(0x166)]||_0xbfb184(0x17c))+_0xbfb184(0x165)+_0x3f15c6[_0xbfb184(0x13b)]+(_0x3f15c6['operator']?'.'+_0x3f15c6[_0xbfb184(0x14f)]:''));}}return _0x512bab[_0xbfb184(0x116)]('\x0a');}function targetPreview(_0x59cf52){const _0x222ce2=a60_0x33b0;return{'kind':_0x59cf52[_0x222ce2(0x148)],'command':_0x59cf52[_0x222ce2(0x150)],'appRef':_0x59cf52['appRef'],'datasetCode':_0x59cf52[_0x222ce2(0x155)],'datatable':_0x59cf52[_0x222ce2(0x15d)],'sqlCode':_0x59cf52[_0x222ce2(0x125)],'bffCode':_0x59cf52[_0x222ce2(0x137)],'bffId':_0x59cf52[_0x222ce2(0x156)],'functionName':_0x59cf52[_0x222ce2(0x17d)]};}function normalizeScalarParams(_0x132152){const _0x3c1a97=a60_0x33b0;return Object[_0x3c1a97(0x136)](Object[_0x3c1a97(0x177)](_0x132152)[_0x3c1a97(0x122)](([,_0x2623e6])=>typeof _0x2623e6===_0x3c1a97(0x115)||typeof _0x2623e6===_0x3c1a97(0x128)));}function hasText(_0x1ce58c){const _0x30a813=a60_0x33b0;return typeof _0x1ce58c==='string'&&_0x1ce58c[_0x30a813(0x13a)]()[_0x30a813(0x171)]>0x0;}function isPrimitiveFlagDefault(_0x330319){const _0x51ea11=a60_0x33b0;return _0x330319===undefined||typeof _0x330319===_0x51ea11(0x115)||typeof _0x330319===_0x51ea11(0x128)||typeof _0x330319==='boolean';}
@@ -1 +1 @@
1
- (function(_0x12f75d,_0x595bf7){const _0x1d569d=a61_0x8424,_0x46354b=_0x12f75d();while(!![]){try{const _0x32676c=-parseInt(_0x1d569d(0x199))/0x1+parseInt(_0x1d569d(0x19a))/0x2+parseInt(_0x1d569d(0x198))/0x3+parseInt(_0x1d569d(0x1b0))/0x4+parseInt(_0x1d569d(0x1b6))/0x5+-parseInt(_0x1d569d(0x19b))/0x6*(-parseInt(_0x1d569d(0x1aa))/0x7)+-parseInt(_0x1d569d(0x1b8))/0x8*(parseInt(_0x1d569d(0x1b2))/0x9);if(_0x32676c===_0x595bf7)break;else _0x46354b['push'](_0x46354b['shift']());}catch(_0x47ebfd){_0x46354b['push'](_0x46354b['shift']());}}}(a61_0x2b6a,0x816b3));export function adaptServiceTreeManifestForLegacyFramework(_0x543475){const _0x95afc2=a61_0x8424,_0x5cfb9e=cloneJsonValue(_0x543475),_0x268fb1=[];if(!isObjectRecord(_0x5cfb9e))return{'manifest':_0x5cfb9e,'errors':_0x268fb1};return Array[_0x95afc2(0x1b3)](_0x5cfb9e[_0x95afc2(0x1a1)])&&_0x5cfb9e[_0x95afc2(0x1a1)][_0x95afc2(0x1a7)]((_0x2bfb8b,_0x28297e)=>{const _0x158324=_0x95afc2;if(!isObjectRecord(_0x2bfb8b))return;adaptBffTarget(_0x2bfb8b[_0x158324(0x1b9)],'$.commands['+_0x28297e+_0x158324(0x1ae),_0x268fb1);}),adaptResources(_0x5cfb9e[_0x95afc2(0x1ab)],_0x95afc2(0x1a4),_0x268fb1),{'manifest':_0x5cfb9e,'errors':_0x268fb1};}export function toPublicServiceTreeTarget(_0xbd2949){const _0x338add=a61_0x8424,{scriptName:_0x14c78b,..._0x1d5ea9}=_0xbd2949;return typeof _0x14c78b===_0x338add(0x1b5)&&_0x14c78b[_0x338add(0x1a8)]()&&(_0x1d5ea9[_0x338add(0x1b4)]=_0x14c78b),_0x1d5ea9;}export function toPublicNormalizedServiceTree(_0x4fad05){const _0x8c99e4=a61_0x8424;return{..._0x4fad05,'commands':_0x4fad05[_0x8c99e4(0x1a1)][_0x8c99e4(0x1ad)](_0x275352=>({..._0x275352,'target':toPublicServiceTreeTarget(_0x275352['target'])}))};}function a61_0x8424(_0x4d4934,_0xdbec85){_0x4d4934=_0x4d4934-0x198;const _0x2b6ae1=a61_0x2b6a();let _0x84247e=_0x2b6ae1[_0x4d4934];return _0x84247e;}function adaptResources(_0x4dde3d,_0x5a0a59,_0x37d237){const _0x1aba8e=a61_0x8424;if(!isObjectRecord(_0x4dde3d))return;for(const [_0x41ca45,_0x115fa0]of Object[_0x1aba8e(0x1ba)](_0x4dde3d)){if(!isObjectRecord(_0x115fa0))continue;const _0x1ac4f3=_0x5a0a59+'.'+_0x41ca45;if(isObjectRecord(_0x115fa0[_0x1aba8e(0x1a3)]))for(const [_0xc0ee23,_0x53db13]of Object[_0x1aba8e(0x1ba)](_0x115fa0[_0x1aba8e(0x1a3)])){if(!isObjectRecord(_0x53db13))continue;const _0x591c9c=_0x1ac4f3+_0x1aba8e(0x19d)+_0xc0ee23,_0x382094=isObjectRecord(_0x53db13['target'])&&_0x53db13[_0x1aba8e(0x1b9)][_0x1aba8e(0x19c)]==='bff';adaptBffTarget(_0x53db13[_0x1aba8e(0x1b9)],_0x591c9c+'.target',_0x37d237),(_0x382094||isBffAction(_0x53db13))&&adaptFunctionNameField(_0x53db13,_0x591c9c,_0x37d237);}adaptResources(_0x115fa0[_0x1aba8e(0x1ab)],_0x1ac4f3+_0x1aba8e(0x1a9),_0x37d237);}}function adaptBffTarget(_0x2ef4dc,_0x43a52f,_0x2ce33e){const _0x7f095=a61_0x8424;if(!isObjectRecord(_0x2ef4dc)||_0x2ef4dc[_0x7f095(0x19c)]!==_0x7f095(0x19f))return;adaptFunctionNameField(_0x2ef4dc,_0x43a52f,_0x2ce33e);}function a61_0x2b6a(){const _0x270f38=['string','5153595lkJVFB','object','184WXnlSp','target','entries','1780722gGAFMj','653378IuyQjM','1343192VjQlDJ','324RsgpTZ','kind','.actions.','scriptName','bff','.scriptName','commands','hasOwnProperty','actions','$.resources','error','.functionName','forEach','trim','.resources','103383Xzowxj','resources','push','map','].target','call','2430292BSQXOB','bff.exec','985113CeWHtT','isArray','functionName'];a61_0x2b6a=function(){return _0x270f38;};return a61_0x2b6a();}function adaptFunctionNameField(_0x75f1e3,_0x575cd3,_0x17c237){const _0x20d523=a61_0x8424;Object['prototype'][_0x20d523(0x1a2)][_0x20d523(0x1af)](_0x75f1e3,_0x20d523(0x19e))&&_0x17c237[_0x20d523(0x1ac)]({'level':_0x20d523(0x1a5),'path':_0x575cd3+_0x20d523(0x1a0),'message':'Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.'});if(Object['prototype'][_0x20d523(0x1a2)][_0x20d523(0x1af)](_0x75f1e3,'functionName')){if(typeof _0x75f1e3[_0x20d523(0x1b4)]!==_0x20d523(0x1b5)||!_0x75f1e3[_0x20d523(0x1b4)][_0x20d523(0x1a8)]()){_0x17c237['push']({'level':_0x20d523(0x1a5),'path':_0x575cd3+_0x20d523(0x1a6),'message':'functionName\x20must\x20be\x20a\x20non-empty\x20string.'}),delete _0x75f1e3[_0x20d523(0x1b4)];return;}_0x75f1e3[_0x20d523(0x19e)]=_0x75f1e3[_0x20d523(0x1b4)],delete _0x75f1e3[_0x20d523(0x1b4)];}}function isBffAction(_0x5db58d){const _0x3708f4=a61_0x8424;return _0x5db58d[_0x3708f4(0x19c)]===_0x3708f4(0x19f)||_0x5db58d['action']===_0x3708f4(0x1b1)||_0x5db58d['target']===_0x3708f4(0x1b1);}function cloneJsonValue(_0x2024be){const _0x1ec9e9=a61_0x8424;if(Array[_0x1ec9e9(0x1b3)](_0x2024be))return _0x2024be[_0x1ec9e9(0x1ad)](_0x5e4dc1=>cloneJsonValue(_0x5e4dc1));if(isObjectRecord(_0x2024be))return Object['fromEntries'](Object['entries'](_0x2024be)[_0x1ec9e9(0x1ad)](([_0x17cd5c,_0x36037e])=>[_0x17cd5c,cloneJsonValue(_0x36037e)]));return _0x2024be;}function isObjectRecord(_0xae9fbe){const _0x3e4e56=a61_0x8424;return Boolean(_0xae9fbe)&&typeof _0xae9fbe===_0x3e4e56(0x1b7)&&!Array[_0x3e4e56(0x1b3)](_0xae9fbe);}
1
+ (function(_0x437317,_0x4c8187){const _0x2c5eec=a61_0x4b75,_0x13bd89=_0x437317();while(!![]){try{const _0xb8e3ec=-parseInt(_0x2c5eec(0x16e))/0x1*(-parseInt(_0x2c5eec(0x189))/0x2)+parseInt(_0x2c5eec(0x175))/0x3*(-parseInt(_0x2c5eec(0x188))/0x4)+-parseInt(_0x2c5eec(0x186))/0x5*(-parseInt(_0x2c5eec(0x179))/0x6)+-parseInt(_0x2c5eec(0x168))/0x7+-parseInt(_0x2c5eec(0x166))/0x8*(-parseInt(_0x2c5eec(0x18d))/0x9)+parseInt(_0x2c5eec(0x174))/0xa+-parseInt(_0x2c5eec(0x180))/0xb*(-parseInt(_0x2c5eec(0x173))/0xc);if(_0xb8e3ec===_0x4c8187)break;else _0x13bd89['push'](_0x13bd89['shift']());}catch(_0x29f452){_0x13bd89['push'](_0x13bd89['shift']());}}}(a61_0x43ed,0x9a3e7));export function adaptServiceTreeManifestForLegacyFramework(_0x598a7d){const _0x592b62=a61_0x4b75,_0x52c1f5=cloneJsonValue(_0x598a7d),_0x1adda2=[];if(!isObjectRecord(_0x52c1f5))return{'manifest':_0x52c1f5,'errors':_0x1adda2};return Array[_0x592b62(0x18c)](_0x52c1f5[_0x592b62(0x18e)])&&_0x52c1f5[_0x592b62(0x18e)][_0x592b62(0x17a)]((_0x28a5b5,_0x253f4d)=>{const _0x4e36ae=_0x592b62;if(!isObjectRecord(_0x28a5b5))return;adaptBffTarget(_0x28a5b5['target'],_0x4e36ae(0x178)+_0x253f4d+_0x4e36ae(0x17f),_0x1adda2);}),adaptResources(_0x52c1f5[_0x592b62(0x16a)],_0x592b62(0x172),_0x1adda2),{'manifest':_0x52c1f5,'errors':_0x1adda2};}export function toPublicServiceTreeTarget(_0x612904){const _0x4d3673=a61_0x4b75,{scriptName:_0x498ded,..._0x2172ce}=_0x612904;return typeof _0x498ded===_0x4d3673(0x17b)&&_0x498ded[_0x4d3673(0x185)]()&&(_0x2172ce[_0x4d3673(0x18b)]=_0x498ded),_0x2172ce;}export function toPublicNormalizedServiceTree(_0x4d7ba3){const _0x3b7999=a61_0x4b75;return{..._0x4d7ba3,'commands':_0x4d7ba3[_0x3b7999(0x18e)][_0x3b7999(0x16d)](_0x4ac3f2=>({..._0x4ac3f2,'target':toPublicServiceTreeTarget(_0x4ac3f2[_0x3b7999(0x16f)])}))};}function adaptResources(_0x16e15c,_0x21751e,_0x1649b2){const _0x4e61fe=a61_0x4b75;if(!isObjectRecord(_0x16e15c))return;for(const [_0x409fb5,_0x153075]of Object['entries'](_0x16e15c)){if(!isObjectRecord(_0x153075))continue;const _0x250dbc=_0x21751e+'.'+_0x409fb5;if(isObjectRecord(_0x153075[_0x4e61fe(0x17d)]))for(const [_0x33d0f8,_0x4a740f]of Object[_0x4e61fe(0x182)](_0x153075[_0x4e61fe(0x17d)])){if(!isObjectRecord(_0x4a740f))continue;const _0x173d9e=_0x250dbc+_0x4e61fe(0x183)+_0x33d0f8,_0xe27dbd=isObjectRecord(_0x4a740f[_0x4e61fe(0x16f)])&&_0x4a740f[_0x4e61fe(0x16f)]['kind']===_0x4e61fe(0x167);adaptBffTarget(_0x4a740f['target'],_0x173d9e+_0x4e61fe(0x16c),_0x1649b2),(_0xe27dbd||isBffAction(_0x4a740f))&&adaptFunctionNameField(_0x4a740f,_0x173d9e,_0x1649b2);}adaptResources(_0x153075[_0x4e61fe(0x16a)],_0x250dbc+_0x4e61fe(0x184),_0x1649b2);}}function a61_0x4b75(_0x3daa74,_0x50b2ec){_0x3daa74=_0x3daa74-0x165;const _0x43edef=a61_0x43ed();let _0x4b752e=_0x43edef[_0x3daa74];return _0x4b752e;}function adaptBffTarget(_0x58c6a2,_0x585556,_0x141eef){const _0x53fba2=a61_0x4b75;if(!isObjectRecord(_0x58c6a2)||_0x58c6a2[_0x53fba2(0x169)]!==_0x53fba2(0x167))return;adaptFunctionNameField(_0x58c6a2,_0x585556,_0x141eef);}function adaptFunctionNameField(_0x3440d1,_0x3e8039,_0x123b91){const _0x126ef7=a61_0x4b75;Object[_0x126ef7(0x17e)]['hasOwnProperty']['call'](_0x3440d1,_0x126ef7(0x165))&&_0x123b91[_0x126ef7(0x17c)]({'level':_0x126ef7(0x176),'path':_0x3e8039+_0x126ef7(0x171),'message':_0x126ef7(0x187)});if(Object[_0x126ef7(0x17e)][_0x126ef7(0x18a)][_0x126ef7(0x177)](_0x3440d1,_0x126ef7(0x18b))){if(typeof _0x3440d1[_0x126ef7(0x18b)]!==_0x126ef7(0x17b)||!_0x3440d1[_0x126ef7(0x18b)][_0x126ef7(0x185)]()){_0x123b91[_0x126ef7(0x17c)]({'level':_0x126ef7(0x176),'path':_0x3e8039+'.functionName','message':_0x126ef7(0x16b)}),delete _0x3440d1[_0x126ef7(0x18b)];return;}_0x3440d1[_0x126ef7(0x165)]=_0x3440d1[_0x126ef7(0x18b)],delete _0x3440d1[_0x126ef7(0x18b)];}}function a61_0x43ed(){const _0x435b90=['3qivbNG','error','call','$.commands[','37362MZXUFY','forEach','string','push','actions','prototype','].target','4565tORFfe','bff.exec','entries','.actions.','.resources','trim','265cBHftT','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','4543160joBCYm','190654KWDTDU','hasOwnProperty','functionName','isArray','43551dMxwZz','commands','scriptName','184CUzARc','bff','8346338RirAsh','kind','resources','functionName\x20must\x20be\x20a\x20non-empty\x20string.','.target','map','13gNBbRL','target','fromEntries','.scriptName','$.resources','32532HNVpkm','1542630WiyRwY'];a61_0x43ed=function(){return _0x435b90;};return a61_0x43ed();}function isBffAction(_0x1e72d1){const _0x231d62=a61_0x4b75;return _0x1e72d1[_0x231d62(0x169)]===_0x231d62(0x167)||_0x1e72d1['action']===_0x231d62(0x181)||_0x1e72d1[_0x231d62(0x16f)]===_0x231d62(0x181);}function cloneJsonValue(_0xc421b2){const _0x23e53f=a61_0x4b75;if(Array[_0x23e53f(0x18c)](_0xc421b2))return _0xc421b2[_0x23e53f(0x16d)](_0x960075=>cloneJsonValue(_0x960075));if(isObjectRecord(_0xc421b2))return Object[_0x23e53f(0x170)](Object['entries'](_0xc421b2)[_0x23e53f(0x16d)](([_0x353d5d,_0xb697ce])=>[_0x353d5d,cloneJsonValue(_0xb697ce)]));return _0xc421b2;}function isObjectRecord(_0x28dde9){const _0x3b1540=a61_0x4b75;return Boolean(_0x28dde9)&&typeof _0x28dde9==='object'&&!Array[_0x3b1540(0x18c)](_0x28dde9);}
@@ -1 +1 @@
1
- const a62_0x466038=a62_0x365e;(function(_0x388d6f,_0x5632d1){const _0x88377a=a62_0x365e,_0x3a0c89=_0x388d6f();while(!![]){try{const _0x5916cb=parseInt(_0x88377a(0x18d))/0x1*(parseInt(_0x88377a(0x1ac))/0x2)+-parseInt(_0x88377a(0x1b6))/0x3*(-parseInt(_0x88377a(0x1b5))/0x4)+-parseInt(_0x88377a(0x1bc))/0x5*(-parseInt(_0x88377a(0x199))/0x6)+-parseInt(_0x88377a(0x190))/0x7*(-parseInt(_0x88377a(0x1b3))/0x8)+parseInt(_0x88377a(0x194))/0x9*(parseInt(_0x88377a(0x17c))/0xa)+-parseInt(_0x88377a(0x1a6))/0xb+-parseInt(_0x88377a(0x18a))/0xc*(parseInt(_0x88377a(0x1af))/0xd);if(_0x5916cb===_0x5632d1)break;else _0x3a0c89['push'](_0x3a0c89['shift']());}catch(_0x59d21e){_0x3a0c89['push'](_0x3a0c89['shift']());}}}(a62_0x46c5,0x25d11));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 a62_0x365e(_0x141eaa,_0x5dae94){_0x141eaa=_0x141eaa-0x17b;const _0x46c59f=a62_0x46c5();let _0x365e19=_0x46c59f[_0x141eaa];return _0x365e19;}const FILE_FLAG={'name':a62_0x466038(0x1c5),'type':a62_0x466038(0x195),'required':!![],'description':a62_0x466038(0x1a5)},SERVICE_FLAG={'name':'service','type':a62_0x466038(0x195),'required':!![],'description':a62_0x466038(0x1c2),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a62_0x466038(0x19e)}};function summarizeService(_0xd5bfc3){const _0xdb4f04=a62_0x466038;return{'serviceCode':_0xd5bfc3[_0xdb4f04(0x1c0)],'name':_0xd5bfc3[_0xdb4f04(0x191)][_0xdb4f04(0x1bd)]['name'],'version':_0xd5bfc3[_0xdb4f04(0x19a)],'importedAt':_0xd5bfc3[_0xdb4f04(0x181)],'source':_0xd5bfc3[_0xdb4f04(0x186)],'commandCount':_0xd5bfc3[_0xdb4f04(0x191)][_0xdb4f04(0x1c3)][_0xdb4f04(0x196)],'commands':_0xd5bfc3[_0xdb4f04(0x191)][_0xdb4f04(0x1c3)][_0xdb4f04(0x1a7)](_0xa19b9a=>({'path':_0xa19b9a['cliPath'],'description':_0xa19b9a[_0xdb4f04(0x187)],'risk':_0xa19b9a[_0xdb4f04(0x1a0)],'target':toPublicServiceTreeTarget(_0xa19b9a[_0xdb4f04(0x1aa)]),'flags':_0xa19b9a[_0xdb4f04(0x1c1)][_0xdb4f04(0x1a7)](_0x155d0c=>({'name':_0x155d0c['name'],'cliName':_0x155d0c[_0xdb4f04(0x18c)],'type':_0x155d0c[_0xdb4f04(0x189)],'required':_0x155d0c[_0xdb4f04(0x1b7)]===!![]}))}))};}function summarizeLoadedManifest(_0x255013){const _0x4c47ab=a62_0x466038;return{'service':_0x255013[_0x4c47ab(0x191)]?.[_0x4c47ab(0x1bd)],'version':_0x255013[_0x4c47ab(0x191)]?.['version'],'commandCount':_0x255013[_0x4c47ab(0x191)]?.[_0x4c47ab(0x1c3)][_0x4c47ab(0x196)]??0x0,'commands':_0x255013[_0x4c47ab(0x191)]?.[_0x4c47ab(0x1c3)][_0x4c47ab(0x1a7)](_0x43574f=>({'path':_0x43574f[_0x4c47ab(0x1a2)],'risk':_0x43574f[_0x4c47ab(0x1a0)],'target':toPublicServiceTreeTarget(_0x43574f[_0x4c47ab(0x1aa)])}))??[],'registryIndex':_0x255013['registryIndex'],'registryServiceCode':_0x255013['registryServiceCode'],'errors':_0x255013[_0x4c47ab(0x17b)][_0x4c47ab(0x182)],'warnings':_0x255013[_0x4c47ab(0x17b)][_0x4c47ab(0x180)]};}export const serviceDefinitions=[{'service':a62_0x466038(0x1bd),'command':'validate','description':a62_0x466038(0x1a4),'risk':a62_0x466038(0x19b),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x3abef9){const _0x41951b=a62_0x466038,_0x17a3d4=loadServiceManifestFromFile(_0x3abef9[_0x41951b(0x17d)]('file'));if(!_0x17a3d4[_0x41951b(0x17b)]['ok'])return{'ok':![],'data':{'file':_0x17a3d4[_0x41951b(0x1bf)],'hash':_0x17a3d4[_0x41951b(0x192)],'kind':_0x17a3d4[_0x41951b(0x1b8)],'serviceCount':_0x17a3d4[_0x41951b(0x1b4)]['length'],'services':_0x17a3d4['manifests'][_0x41951b(0x1a7)](summarizeLoadedManifest),'errors':_0x17a3d4[_0x41951b(0x17b)][_0x41951b(0x182)],'warnings':_0x17a3d4[_0x41951b(0x17b)][_0x41951b(0x180)]},'message':formatValidationFailure(_0x17a3d4[_0x41951b(0x17b)])};if(_0x17a3d4[_0x41951b(0x1b8)]===_0x41951b(0x17e)||_0x17a3d4[_0x41951b(0x1b4)][_0x41951b(0x196)]!==0x1)return{'ok':!![],'data':{'file':_0x17a3d4[_0x41951b(0x1bf)],'hash':_0x17a3d4[_0x41951b(0x192)],'kind':_0x17a3d4[_0x41951b(0x1b8)],'serviceCount':_0x17a3d4[_0x41951b(0x1b4)][_0x41951b(0x196)],'commandCount':_0x17a3d4[_0x41951b(0x1b4)][_0x41951b(0x1a8)]((_0x2b1c20,_0x5ef4cc)=>_0x2b1c20+(_0x5ef4cc[_0x41951b(0x191)]?.['commands'][_0x41951b(0x196)]??0x0),0x0),'services':_0x17a3d4[_0x41951b(0x1b4)]['map'](summarizeLoadedManifest),'warnings':_0x17a3d4[_0x41951b(0x17b)][_0x41951b(0x180)]},'message':_0x41951b(0x184)};return{'ok':!![],'data':{'file':_0x17a3d4[_0x41951b(0x1bf)],'hash':_0x17a3d4[_0x41951b(0x192)],'kind':_0x17a3d4[_0x41951b(0x1b8)],'service':_0x17a3d4[_0x41951b(0x191)]?.[_0x41951b(0x1bd)],'version':_0x17a3d4['normalizedManifest']?.['version'],'commandCount':_0x17a3d4[_0x41951b(0x191)]?.[_0x41951b(0x1c3)]['length']??0x0,'commands':_0x17a3d4['normalizedManifest']?.[_0x41951b(0x1c3)][_0x41951b(0x1a7)](_0x13355d=>({'path':_0x13355d['cliPath'],'risk':_0x13355d[_0x41951b(0x1a0)],'target':toPublicServiceTreeTarget(_0x13355d['target'])})),'warnings':_0x17a3d4[_0x41951b(0x17b)][_0x41951b(0x180)]},'message':_0x41951b(0x197)};}},{'service':a62_0x466038(0x1bd),'command':a62_0x466038(0x19c),'description':a62_0x466038(0x18e),'risk':a62_0x466038(0x1b9),'confirmationDescription':a62_0x466038(0x1ad),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x54d65c){const _0x456f30=a62_0x466038,_0x18568e=loadServiceManifestFromFile(_0x54d65c[_0x456f30(0x17d)]('file'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x18568e[_0x456f30(0x1bf)],'hash':_0x18568e[_0x456f30(0x192)],'kind':_0x18568e[_0x456f30(0x1b8)],'ok':_0x18568e[_0x456f30(0x17b)]['ok'],'service':_0x18568e['normalizedManifest']?.[_0x456f30(0x1bd)],'version':_0x18568e[_0x456f30(0x191)]?.[_0x456f30(0x19a)],'serviceCount':_0x18568e[_0x456f30(0x1b4)][_0x456f30(0x196)],'services':_0x18568e[_0x456f30(0x1b4)][_0x456f30(0x1a7)](_0x31bf42=>({'service':_0x31bf42[_0x456f30(0x191)]?.['service'],'version':_0x31bf42[_0x456f30(0x191)]?.[_0x456f30(0x19a)],'commandCount':_0x31bf42['normalizedManifest']?.[_0x456f30(0x1c3)][_0x456f30(0x196)]??0x0,'errors':_0x31bf42['report'][_0x456f30(0x182)]})),'errors':_0x18568e[_0x456f30(0x17b)][_0x456f30(0x182)],'commandCount':_0x18568e[_0x456f30(0x191)]?.['commands'][_0x456f30(0x196)]??0x0},'description':_0x456f30(0x183)};},async 'execute'(_0xc3d0d5){const _0x24ad66=a62_0x466038,_0x352a41=importServiceManifest(_0xc3d0d5['str'](_0x24ad66(0x1c5)));if(_0x352a41[_0x24ad66(0x185)][_0x24ad66(0x196)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x352a41[_0x24ad66(0x19f)],'imported':_0x352a41[_0x24ad66(0x17f)],'updated':_0x352a41[_0x24ad66(0x18b)],'serviceCount':_0x352a41[_0x24ad66(0x1b0)],'services':_0x352a41[_0x24ad66(0x185)][_0x24ad66(0x1a7)](summarizeService)},'message':_0x24ad66(0x1c8)+_0x352a41[_0x24ad66(0x17f)]+'\x20service(s),\x20updated\x20'+_0x352a41[_0x24ad66(0x18b)]+_0x24ad66(0x1be)};return{'ok':!![],'data':{'registryPath':_0x352a41[_0x24ad66(0x19f)],'replaced':_0x352a41[_0x24ad66(0x18f)],'imported':_0x352a41['imported'],'updated':_0x352a41['updated'],'serviceCount':_0x352a41[_0x24ad66(0x1b0)],'service':summarizeService(_0x352a41[_0x24ad66(0x1a3)])},'message':(_0x352a41[_0x24ad66(0x18f)]?_0x24ad66(0x1ae):'Imported')+_0x24ad66(0x1a1)+_0x352a41['entry'][_0x24ad66(0x1c0)]+'.'};}},{'service':a62_0x466038(0x1bd),'command':a62_0x466038(0x1c4),'description':a62_0x466038(0x1c6),'risk':'write','confirmationDescription':a62_0x466038(0x1b2),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x4e8ff5){const _0xdd679=a62_0x466038,_0x4f75f4=getLocalServiceEntry(_0x4e8ff5[_0xdd679(0x17d)](_0xdd679(0x1bd)));return{'method':_0xdd679(0x193),'url':_0x4e8ff5[_0xdd679(0x17d)](_0xdd679(0x1c5)),'body':{'service':_0x4e8ff5[_0xdd679(0x17d)](_0xdd679(0x1bd)),'found':Boolean(_0x4f75f4),'version':_0x4f75f4?.['version'],'source':_0x4f75f4?.[_0xdd679(0x186)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0xe95414){const _0x1bc1eb=a62_0x466038,_0x1cf021=exportServiceManifest(_0xe95414[_0x1bc1eb(0x17d)]('service'),_0xe95414[_0x1bc1eb(0x17d)](_0x1bc1eb(0x1c5)));return{'ok':!![],'data':{'registryPath':_0x1cf021[_0x1bc1eb(0x19f)],'file':_0x1cf021[_0x1bc1eb(0x1bf)],'service':summarizeService(_0x1cf021['entry'])},'message':_0x1bc1eb(0x19d)+_0x1cf021[_0x1bc1eb(0x1a3)][_0x1bc1eb(0x1c0)]+'.'};}},{'service':a62_0x466038(0x1bd),'command':a62_0x466038(0x1bb),'description':a62_0x466038(0x198),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x13179e=a62_0x466038,_0x1bf0ec=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x1bf0ec[_0x13179e(0x196)],'services':_0x1bf0ec[_0x13179e(0x1a7)](summarizeService)}};}},{'service':a62_0x466038(0x1bd),'command':a62_0x466038(0x1a9),'description':a62_0x466038(0x1c7),'risk':'write','confirmationDescription':'Removes\x20the\x20given\x20service\x20manifest\x20from\x20the\x20local\x20Service\x20Tree\x20registry.\x20Dynamic\x20commands\x20from\x20that\x20manifest\x20will\x20no\x20longer\x20be\x20available.','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x40a6a5){const _0x3ac23f=a62_0x466038,_0x3184a2=getLocalServiceEntry(_0x40a6a5[_0x3ac23f(0x17d)](_0x3ac23f(0x1bd)));return{'method':_0x3ac23f(0x193),'url':getServiceRegistryPath(),'body':{'service':_0x40a6a5[_0x3ac23f(0x17d)](_0x3ac23f(0x1bd)),'found':Boolean(_0x3184a2),'version':_0x3184a2?.[_0x3ac23f(0x19a)],'source':_0x3184a2?.['source']},'description':_0x3ac23f(0x1ab)};},async 'execute'(_0x1bf287){const _0x4946bb=a62_0x466038,_0x5649c4=removeServiceManifest(_0x1bf287['str']('service'));return{'ok':!![],'data':{'registryPath':_0x5649c4['registryPath'],'serviceCount':_0x5649c4[_0x4946bb(0x1b0)],'service':summarizeService(_0x5649c4['entry'])},'message':_0x4946bb(0x1c9)+_0x5649c4[_0x4946bb(0x1a3)][_0x4946bb(0x1c0)]+'.'};}},{'service':a62_0x466038(0x1bd),'command':a62_0x466038(0x188),'description':'Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x776882){const _0x574a66=a62_0x466038,_0x4d7583=getLocalServiceEntry(_0x776882['str'](_0x574a66(0x1bd)));if(!_0x4d7583)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x776882['str'](_0x574a66(0x1bd))},'message':_0x574a66(0x1b1)+_0x776882[_0x574a66(0x17d)](_0x574a66(0x1bd))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x4d7583),'manifest':_0x4d7583[_0x574a66(0x1ba)],'normalizedManifest':toPublicNormalizedServiceTree(_0x4d7583[_0x574a66(0x191)])}};}}];function a62_0x46c5(){const _0x4d431d=['description','detail','type','36Sfmopd','updated','cliName','8324PoOlqf','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','replaced','140YanYHZ','normalizedManifest','hash','WRITE','27fWrtHx','string','length','Service\x20manifest\x20validation\x20passed.','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','25338UfQFwd','version','read','import','Exported\x20service\x20','lower\x20kebab-case\x20service\x20code','registryPath','risk','\x20service\x20','cliPath','entry','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Service\x20Tree\x20manifest\x20file\x20path','393613hPYMzN','map','reduce','remove','target','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','12DMqMBV','Reads\x20the\x20given\x20manifest\x20into\x20the\x20local\x20Service\x20Tree\x20registry.\x20An\x20existing\x20manifest\x20with\x20the\x20same\x20service\x20code\x20is\x20updated.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','Updated','1847963ZcQZJD','serviceCount','Local\x20service\x20not\x20found:\x20','Writes\x20the\x20local\x20Service\x20Tree\x20manifest\x20for\x20the\x20given\x20service\x20to\x20a\x20JSON\x20file.\x20An\x20existing\x20file\x20at\x20the\x20target\x20may\x20be\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','72456eSasmF','manifests','76yOpsHh','40305AnvhtK','required','kind','write','manifest','list','125bsXkXB','service','\x20service(s).','filePath','serviceCode','flags','Local\x20service\x20code,\x20for\x20example\x20crm','commands','export','file','Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','Imported\x20','Removed\x20service\x20','report','84030lihBYp','str','registry','imported','warnings','importedAt','errors','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Service\x20registry\x20validation\x20passed.','entries','source'];a62_0x46c5=function(){return _0x4d431d;};return a62_0x46c5();}
1
+ const a62_0x39c7eb=a62_0x3a63;(function(_0x5b721f,_0x54869a){const _0x516e5a=a62_0x3a63,_0xb0b177=_0x5b721f();while(!![]){try{const _0x14267f=parseInt(_0x516e5a(0xb3))/0x1*(-parseInt(_0x516e5a(0xb0))/0x2)+-parseInt(_0x516e5a(0x93))/0x3+-parseInt(_0x516e5a(0xb2))/0x4*(-parseInt(_0x516e5a(0xb4))/0x5)+-parseInt(_0x516e5a(0x9c))/0x6+parseInt(_0x516e5a(0x89))/0x7+-parseInt(_0x516e5a(0x9f))/0x8*(parseInt(_0x516e5a(0x8e))/0x9)+-parseInt(_0x516e5a(0xd1))/0xa*(-parseInt(_0x516e5a(0xc4))/0xb);if(_0x14267f===_0x54869a)break;else _0xb0b177['push'](_0xb0b177['shift']());}catch(_0x4039a1){_0xb0b177['push'](_0xb0b177['shift']());}}}(a62_0x125f,0x4f16e));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':'file','type':a62_0x39c7eb(0x95),'required':!![],'description':a62_0x39c7eb(0xa6)},SERVICE_FLAG={'name':a62_0x39c7eb(0xa0),'type':a62_0x39c7eb(0x95),'required':!![],'description':a62_0x39c7eb(0xab),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a62_0x39c7eb(0xc8)}};function a62_0x125f(){const _0x1ea9a5=['Imported\x20','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','source','errors','map','10tHZXMi','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','hash','entry','detail','Removes\x20the\x20given\x20service\x20manifest\x20from\x20the\x20local\x20Service\x20Tree\x20registry.\x20Dynamic\x20commands\x20from\x20that\x20manifest\x20will\x20no\x20longer\x20be\x20available.','3295222xFpBmI','length','\x20service(s).','importedAt','required','9kGJjPp','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','str','kind','remove','1505610oBsRba','Exported\x20service\x20','string','serviceCount','registry','registryPath','warnings','manifests','import','1816824SxlbTe','Writes\x20the\x20local\x20Service\x20Tree\x20manifest\x20for\x20the\x20given\x20service\x20to\x20a\x20JSON\x20file.\x20An\x20existing\x20file\x20at\x20the\x20target\x20may\x20be\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','reduce','4713608bpRZJI','service','manifest','Service\x20manifest\x20validation\x20passed.','Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','read','target','Service\x20Tree\x20manifest\x20file\x20path','report','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','\x20service(s),\x20updated\x20','Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','Local\x20service\x20code,\x20for\x20example\x20crm','flags','risk','Local\x20service\x20not\x20found:\x20','filePath','50pTowPA','imported','4bfgTTI','4741NBNduE','2232385vOiXYX','updated','Reads\x20the\x20given\x20manifest\x20into\x20the\x20local\x20Service\x20Tree\x20registry.\x20An\x20existing\x20manifest\x20with\x20the\x20same\x20service\x20code\x20is\x20updated.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','write','commands','registryIndex','normalizedManifest','serviceCode','WRITE','Removed\x20service\x20','replaced','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','Service\x20registry\x20validation\x20passed.','cliPath','type','export','10110397xGVgxn','entries','description','file','lower\x20kebab-case\x20service\x20code','\x20service\x20','registryServiceCode','version'];a62_0x125f=function(){return _0x1ea9a5;};return a62_0x125f();}function a62_0x3a63(_0x455ae8,_0x58d661){_0x455ae8=_0x455ae8-0x89;const _0x125fed=a62_0x125f();let _0x3a638c=_0x125fed[_0x455ae8];return _0x3a638c;}function summarizeService(_0xd29136){const _0x447a73=a62_0x39c7eb;return{'serviceCode':_0xd29136[_0x447a73(0xbb)],'name':_0xd29136[_0x447a73(0xba)]['service']['name'],'version':_0xd29136['version'],'importedAt':_0xd29136[_0x447a73(0x8c)],'source':_0xd29136[_0x447a73(0xce)],'commandCount':_0xd29136[_0x447a73(0xba)][_0x447a73(0xb8)][_0x447a73(0x8a)],'commands':_0xd29136[_0x447a73(0xba)][_0x447a73(0xb8)]['map'](_0xf56d69=>({'path':_0xf56d69['cliPath'],'description':_0xf56d69[_0x447a73(0xc6)],'risk':_0xf56d69[_0x447a73(0xad)],'target':toPublicServiceTreeTarget(_0xf56d69['target']),'flags':_0xf56d69[_0x447a73(0xac)][_0x447a73(0xd0)](_0x163243=>({'name':_0x163243['name'],'cliName':_0x163243['cliName'],'type':_0x163243[_0x447a73(0xc2)],'required':_0x163243[_0x447a73(0x8d)]===!![]}))}))};}function summarizeLoadedManifest(_0x206653){const _0x18da10=a62_0x39c7eb;return{'service':_0x206653[_0x18da10(0xba)]?.[_0x18da10(0xa0)],'version':_0x206653['normalizedManifest']?.[_0x18da10(0xcb)],'commandCount':_0x206653[_0x18da10(0xba)]?.['commands'][_0x18da10(0x8a)]??0x0,'commands':_0x206653['normalizedManifest']?.[_0x18da10(0xb8)][_0x18da10(0xd0)](_0x213489=>({'path':_0x213489[_0x18da10(0xc1)],'risk':_0x213489['risk'],'target':toPublicServiceTreeTarget(_0x213489[_0x18da10(0xa5)])}))??[],'registryIndex':_0x206653[_0x18da10(0xb9)],'registryServiceCode':_0x206653[_0x18da10(0xca)],'errors':_0x206653[_0x18da10(0xa7)]['errors'],'warnings':_0x206653[_0x18da10(0xa7)]['warnings']};}export const serviceDefinitions=[{'service':a62_0x39c7eb(0xa0),'command':'validate','description':a62_0x39c7eb(0xa8),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x2a9f5d){const _0x1e41b3=a62_0x39c7eb,_0x1e3e50=loadServiceManifestFromFile(_0x2a9f5d[_0x1e41b3(0x90)](_0x1e41b3(0xc7)));if(!_0x1e3e50['report']['ok'])return{'ok':![],'data':{'file':_0x1e3e50[_0x1e41b3(0xaf)],'hash':_0x1e3e50['hash'],'kind':_0x1e3e50['kind'],'serviceCount':_0x1e3e50['manifests'][_0x1e41b3(0x8a)],'services':_0x1e3e50[_0x1e41b3(0x9a)]['map'](summarizeLoadedManifest),'errors':_0x1e3e50[_0x1e41b3(0xa7)][_0x1e41b3(0xcf)],'warnings':_0x1e3e50[_0x1e41b3(0xa7)][_0x1e41b3(0x99)]},'message':formatValidationFailure(_0x1e3e50[_0x1e41b3(0xa7)])};if(_0x1e3e50[_0x1e41b3(0x91)]===_0x1e41b3(0x97)||_0x1e3e50['manifests'][_0x1e41b3(0x8a)]!==0x1)return{'ok':!![],'data':{'file':_0x1e3e50[_0x1e41b3(0xaf)],'hash':_0x1e3e50[_0x1e41b3(0xd3)],'kind':_0x1e3e50['kind'],'serviceCount':_0x1e3e50[_0x1e41b3(0x9a)][_0x1e41b3(0x8a)],'commandCount':_0x1e3e50['manifests'][_0x1e41b3(0x9e)]((_0x454cad,_0x4aea9a)=>_0x454cad+(_0x4aea9a[_0x1e41b3(0xba)]?.[_0x1e41b3(0xb8)][_0x1e41b3(0x8a)]??0x0),0x0),'services':_0x1e3e50[_0x1e41b3(0x9a)][_0x1e41b3(0xd0)](summarizeLoadedManifest),'warnings':_0x1e3e50[_0x1e41b3(0xa7)][_0x1e41b3(0x99)]},'message':_0x1e41b3(0xc0)};return{'ok':!![],'data':{'file':_0x1e3e50[_0x1e41b3(0xaf)],'hash':_0x1e3e50['hash'],'kind':_0x1e3e50['kind'],'service':_0x1e3e50[_0x1e41b3(0xba)]?.[_0x1e41b3(0xa0)],'version':_0x1e3e50['normalizedManifest']?.[_0x1e41b3(0xcb)],'commandCount':_0x1e3e50[_0x1e41b3(0xba)]?.[_0x1e41b3(0xb8)][_0x1e41b3(0x8a)]??0x0,'commands':_0x1e3e50[_0x1e41b3(0xba)]?.[_0x1e41b3(0xb8)][_0x1e41b3(0xd0)](_0x3317e4=>({'path':_0x3317e4['cliPath'],'risk':_0x3317e4['risk'],'target':toPublicServiceTreeTarget(_0x3317e4[_0x1e41b3(0xa5)])})),'warnings':_0x1e3e50[_0x1e41b3(0xa7)][_0x1e41b3(0x99)]},'message':_0x1e41b3(0xa2)};}},{'service':a62_0x39c7eb(0xa0),'command':a62_0x39c7eb(0x9b),'description':'Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','risk':a62_0x39c7eb(0xb7),'confirmationDescription':a62_0x39c7eb(0xb6),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x506cf0){const _0x299a96=a62_0x39c7eb,_0x2639d8=loadServiceManifestFromFile(_0x506cf0['str']('file'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x2639d8[_0x299a96(0xaf)],'hash':_0x2639d8[_0x299a96(0xd3)],'kind':_0x2639d8[_0x299a96(0x91)],'ok':_0x2639d8[_0x299a96(0xa7)]['ok'],'service':_0x2639d8[_0x299a96(0xba)]?.[_0x299a96(0xa0)],'version':_0x2639d8[_0x299a96(0xba)]?.[_0x299a96(0xcb)],'serviceCount':_0x2639d8['manifests'][_0x299a96(0x8a)],'services':_0x2639d8[_0x299a96(0x9a)][_0x299a96(0xd0)](_0x5f0e1e=>({'service':_0x5f0e1e[_0x299a96(0xba)]?.[_0x299a96(0xa0)],'version':_0x5f0e1e[_0x299a96(0xba)]?.[_0x299a96(0xcb)],'commandCount':_0x5f0e1e[_0x299a96(0xba)]?.['commands'][_0x299a96(0x8a)]??0x0,'errors':_0x5f0e1e['report'][_0x299a96(0xcf)]})),'errors':_0x2639d8[_0x299a96(0xa7)][_0x299a96(0xcf)],'commandCount':_0x2639d8[_0x299a96(0xba)]?.[_0x299a96(0xb8)][_0x299a96(0x8a)]??0x0},'description':_0x299a96(0x8f)};},async 'execute'(_0x3f579e){const _0x4ba4c3=a62_0x39c7eb,_0x2b494b=importServiceManifest(_0x3f579e['str']('file'));if(_0x2b494b[_0x4ba4c3(0xc5)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x2b494b[_0x4ba4c3(0x98)],'imported':_0x2b494b[_0x4ba4c3(0xb1)],'updated':_0x2b494b[_0x4ba4c3(0xb5)],'serviceCount':_0x2b494b['serviceCount'],'services':_0x2b494b[_0x4ba4c3(0xc5)]['map'](summarizeService)},'message':_0x4ba4c3(0xcc)+_0x2b494b[_0x4ba4c3(0xb1)]+_0x4ba4c3(0xa9)+_0x2b494b[_0x4ba4c3(0xb5)]+_0x4ba4c3(0x8b)};return{'ok':!![],'data':{'registryPath':_0x2b494b[_0x4ba4c3(0x98)],'replaced':_0x2b494b[_0x4ba4c3(0xbe)],'imported':_0x2b494b['imported'],'updated':_0x2b494b['updated'],'serviceCount':_0x2b494b[_0x4ba4c3(0x96)],'service':summarizeService(_0x2b494b['entry'])},'message':(_0x2b494b['replaced']?'Updated':'Imported')+_0x4ba4c3(0xc9)+_0x2b494b[_0x4ba4c3(0xd4)][_0x4ba4c3(0xbb)]+'.'};}},{'service':a62_0x39c7eb(0xa0),'command':a62_0x39c7eb(0xc3),'description':a62_0x39c7eb(0xa3),'risk':a62_0x39c7eb(0xb7),'confirmationDescription':a62_0x39c7eb(0x9d),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x5d888d){const _0x3c28e8=a62_0x39c7eb,_0x3c2118=getLocalServiceEntry(_0x5d888d[_0x3c28e8(0x90)](_0x3c28e8(0xa0)));return{'method':'WRITE','url':_0x5d888d[_0x3c28e8(0x90)]('file'),'body':{'service':_0x5d888d[_0x3c28e8(0x90)](_0x3c28e8(0xa0)),'found':Boolean(_0x3c2118),'version':_0x3c2118?.['version'],'source':_0x3c2118?.[_0x3c28e8(0xce)]},'description':_0x3c28e8(0xbf)};},async 'execute'(_0x2e8b02){const _0x26b820=a62_0x39c7eb,_0x352829=exportServiceManifest(_0x2e8b02['str']('service'),_0x2e8b02[_0x26b820(0x90)](_0x26b820(0xc7)));return{'ok':!![],'data':{'registryPath':_0x352829['registryPath'],'file':_0x352829[_0x26b820(0xaf)],'service':summarizeService(_0x352829['entry'])},'message':_0x26b820(0x94)+_0x352829[_0x26b820(0xd4)][_0x26b820(0xbb)]+'.'};}},{'service':a62_0x39c7eb(0xa0),'command':'list','description':a62_0x39c7eb(0xd2),'risk':a62_0x39c7eb(0xa4),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x190272=a62_0x39c7eb,_0x58d0a5=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x58d0a5[_0x190272(0x8a)],'services':_0x58d0a5['map'](summarizeService)}};}},{'service':a62_0x39c7eb(0xa0),'command':a62_0x39c7eb(0x92),'description':a62_0x39c7eb(0xaa),'risk':'write','confirmationDescription':a62_0x39c7eb(0xd6),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x3ffd7b){const _0x5d1885=a62_0x39c7eb,_0x5b02b2=getLocalServiceEntry(_0x3ffd7b[_0x5d1885(0x90)](_0x5d1885(0xa0)));return{'method':_0x5d1885(0xbc),'url':getServiceRegistryPath(),'body':{'service':_0x3ffd7b[_0x5d1885(0x90)](_0x5d1885(0xa0)),'found':Boolean(_0x5b02b2),'version':_0x5b02b2?.[_0x5d1885(0xcb)],'source':_0x5b02b2?.[_0x5d1885(0xce)]},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x90fb59){const _0x1a86e7=a62_0x39c7eb,_0x2b9aed=removeServiceManifest(_0x90fb59['str'](_0x1a86e7(0xa0)));return{'ok':!![],'data':{'registryPath':_0x2b9aed[_0x1a86e7(0x98)],'serviceCount':_0x2b9aed['serviceCount'],'service':summarizeService(_0x2b9aed[_0x1a86e7(0xd4)])},'message':_0x1a86e7(0xbd)+_0x2b9aed['entry'][_0x1a86e7(0xbb)]+'.'};}},{'service':a62_0x39c7eb(0xa0),'command':a62_0x39c7eb(0xd5),'description':a62_0x39c7eb(0xcd),'risk':a62_0x39c7eb(0xa4),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x48b98b){const _0x142367=a62_0x39c7eb,_0x3e9fdb=getLocalServiceEntry(_0x48b98b[_0x142367(0x90)](_0x142367(0xa0)));if(!_0x3e9fdb)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x48b98b[_0x142367(0x90)]('service')},'message':_0x142367(0xae)+_0x48b98b[_0x142367(0x90)](_0x142367(0xa0))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x3e9fdb),'manifest':_0x3e9fdb[_0x142367(0xa1)],'normalizedManifest':toPublicNormalizedServiceTree(_0x3e9fdb['normalizedManifest'])}};}}];
@@ -1 +1 @@
1
- (function(_0x4de3c6,_0xd40b37){const _0x1e55f5=a63_0x1ab9,_0x34206a=_0x4de3c6();while(!![]){try{const _0x1d7ed0=parseInt(_0x1e55f5(0x160))/0x1*(-parseInt(_0x1e55f5(0x135))/0x2)+parseInt(_0x1e55f5(0x14b))/0x3+-parseInt(_0x1e55f5(0x16e))/0x4*(parseInt(_0x1e55f5(0x147))/0x5)+parseInt(_0x1e55f5(0x161))/0x6*(parseInt(_0x1e55f5(0x16a))/0x7)+parseInt(_0x1e55f5(0x150))/0x8+-parseInt(_0x1e55f5(0x140))/0x9*(-parseInt(_0x1e55f5(0x14a))/0xa)+parseInt(_0x1e55f5(0x11f))/0xb*(-parseInt(_0x1e55f5(0x15b))/0xc);if(_0x1d7ed0===_0xd40b37)break;else _0x34206a['push'](_0x34206a['shift']());}catch(_0x2aa91c){_0x34206a['push'](_0x34206a['shift']());}}}(a63_0x38bd,0xec139));import{createHash}from'node:crypto';function a63_0x1ab9(_0x4830df,_0x1e82f0){_0x4830df=_0x4830df-0x11a;const _0x38bd62=a63_0x38bd();let _0x1ab9a3=_0x38bd62[_0x4830df];return _0x1ab9a3;}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(_0x36cbc8={}){const _0x3e34c2=a63_0x1ab9;return resolve(_0x36cbc8[_0x3e34c2(0x12c)]??homedir(),PRODUCT_CONFIG[_0x3e34c2(0x155)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x32df07={}){const _0x75badb=a63_0x1ab9,_0x54b0b0=getServiceRegistryPath(_0x32df07);if(!existsSync(_0x54b0b0))return emptyServiceRegistry();try{const _0x59940c=readFileSync(_0x54b0b0,_0x75badb(0x164));if(!_0x59940c[_0x75badb(0x125)]())return emptyServiceRegistry();const _0xa14a96=JSON['parse'](_0x59940c);if(_0xa14a96[_0x75badb(0x138)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x75badb(0x169)+String(_0xa14a96[_0x75badb(0x138)]),_0x75badb(0x146)+_0x54b0b0+'.');if(!Array[_0x75badb(0x11b)](_0xa14a96[_0x75badb(0x126)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0xa14a96[_0x75badb(0x13b)],'services':_0xa14a96[_0x75badb(0x126)]};}catch(_0x5ecc6d){if(_0x5ecc6d instanceof Error&&_0x5ecc6d[_0x75badb(0x166)]===_0x75badb(0x158))throw _0x5ecc6d;throw CliErrors[_0x75badb(0x11c)](_0x75badb(0x11e)+_0x54b0b0,_0x75badb(0x14d));}}export function writeServiceRegistry(_0x7024cc,_0x1ae1e1={}){const _0x1f855e=a63_0x1ab9,_0x135db8=getServiceRegistryPath(_0x1ae1e1),_0x8ad91=dirname(_0x135db8);!existsSync(_0x8ad91)&&mkdirSync(_0x8ad91,{'recursive':!![]});const _0xdd8b6f=_0x135db8+_0x1f855e(0x16f);try{writeFileSync(_0xdd8b6f,JSON[_0x1f855e(0x121)](_0x7024cc,null,0x2)+'\x0a',{'encoding':_0x1f855e(0x164),'mode':0x180}),renameSync(_0xdd8b6f,_0x135db8);}catch(_0x45f6f2){try{unlinkSync(_0xdd8b6f);}catch{}if(_0x45f6f2?.['code']===_0x1f855e(0x128))throw CliErrors['validation'](_0x1f855e(0x148)+_0x135db8);throw _0x45f6f2;}return _0x135db8;}export function loadServiceManifestFromFile(_0x295d79){const _0x235c7d=a63_0x1ab9,_0x4f28ab=resolve(_0x295d79);if(!existsSync(_0x4f28ab))throw CliErrors[_0x235c7d(0x11c)](_0x235c7d(0x124)+_0x295d79);let _0x3cd978;const _0x3ef6b9=readFileSync(_0x4f28ab,'utf8');try{_0x3cd978=JSON[_0x235c7d(0x11a)](_0x3ef6b9);}catch{throw CliErrors['validation'](_0x235c7d(0x141)+_0x295d79,_0x235c7d(0x143));}const _0x16eea0=sha256(_0x3ef6b9),_0x50daaf=extractLoadedServiceManifests(_0x3cd978,_0x16eea0),_0x3aca2a=aggregateValidationReports(_0x50daaf),_0x37dc16=_0x50daaf[0x0];return{'filePath':_0x4f28ab,'hash':_0x16eea0,'kind':isServiceRegistryLike(_0x3cd978)?_0x235c7d(0x149):_0x235c7d(0x12f),'manifest':_0x37dc16?.[_0x235c7d(0x12f)]??_0x3cd978,'report':_0x3aca2a,'normalizedManifest':_0x50daaf['length']===0x1?_0x37dc16?.[_0x235c7d(0x12d)]:undefined,'manifests':_0x50daaf};}export function importServiceManifest(_0x35e95a,_0x20fd41={}){const _0x455af4=a63_0x1ab9,_0xc45f20=loadServiceManifestFromFile(_0x35e95a);if(!_0xc45f20['report']['ok'])throw CliErrors[_0x455af4(0x11c)](formatValidationFailure(_0xc45f20[_0x455af4(0x134)]),_0x455af4(0x120));if(_0xc45f20[_0x455af4(0x168)][_0x455af4(0x12a)]===0x0)throw CliErrors[_0x455af4(0x11c)](_0x455af4(0x16c),_0x455af4(0x127));const _0x368579=readServiceRegistry(_0x20fd41),_0x1343f8=(_0x20fd41[_0x455af4(0x14e)]??(()=>new Date()))()[_0x455af4(0x13a)](),_0x535b87=[];let _0x13c059=0x0,_0x241530=0x0;for(const _0x50d535 of _0xc45f20['manifests']){if(!_0x50d535['normalizedManifest'])continue;const _0x4484de=_0x50d535[_0x455af4(0x12d)][_0x455af4(0x163)][_0x455af4(0x15f)],_0x49def3={'serviceCode':_0x4484de,'version':_0x50d535[_0x455af4(0x12d)][_0x455af4(0x130)],'importedAt':_0x1343f8,'source':{'type':_0x455af4(0x15e),'path':_0xc45f20[_0x455af4(0x13d)],'hash':_0x50d535[_0x455af4(0x13e)]},'manifest':_0x50d535[_0x455af4(0x12f)],'normalizedManifest':_0x50d535[_0x455af4(0x12d)]},_0xbfcda5=_0x368579[_0x455af4(0x126)]['findIndex'](_0xd252d6=>_0xd252d6[_0x455af4(0x165)]===_0x4484de);_0xbfcda5>=0x0?(_0x368579[_0x455af4(0x126)][_0xbfcda5]=_0x49def3,_0x241530++):(_0x368579[_0x455af4(0x126)][_0x455af4(0x15d)](_0x49def3),_0x13c059++),_0x535b87['push'](_0x49def3);}_0x368579['services'][_0x455af4(0x153)]((_0x2c45ba,_0x516ff6)=>_0x2c45ba['serviceCode'][_0x455af4(0x136)](_0x516ff6['serviceCode'])),_0x368579['updatedAt']=_0x1343f8;const _0x3760ce=writeServiceRegistry(_0x368579,_0x20fd41);return{'registryPath':_0x3760ce,'entry':_0x535b87[0x0],'replaced':_0x535b87[_0x455af4(0x12a)]===0x1?_0x241530===0x1:_0x241530>0x0,'entries':_0x535b87,'imported':_0x13c059,'updated':_0x241530,'serviceCount':_0x368579['services'][_0x455af4(0x12a)]};}export function exportServiceManifest(_0x216c0c,_0xc0b4ba,_0x6c9b92={}){const _0x2f193b=a63_0x1ab9,_0x2b56fa=getServiceRegistryPath(_0x6c9b92),_0x142136=getLocalServiceEntry(_0x216c0c,_0x6c9b92);if(!_0x142136)throw CliErrors['validation'](_0x2f193b(0x139)+_0x216c0c,_0x2f193b(0x13f));const _0x13016c=resolve(_0xc0b4ba),_0x3f2fbd=dirname(_0x13016c);return!existsSync(_0x3f2fbd)&&mkdirSync(_0x3f2fbd,{'recursive':!![]}),writeFileSync(_0x13016c,JSON['stringify'](_0x142136[_0x2f193b(0x12f)],null,0x2)+'\x0a',{'encoding':_0x2f193b(0x164),'mode':0x180}),{'registryPath':_0x2b56fa,'filePath':_0x13016c,'entry':_0x142136};}export function removeServiceManifest(_0x3f5715,_0x5d485a={}){const _0x3665d5=a63_0x1ab9,_0x60ed2a=readServiceRegistry(_0x5d485a),_0x2b4d25=_0x3f5715[_0x3665d5(0x125)](),_0x1826a6=_0x60ed2a[_0x3665d5(0x126)]['findIndex'](_0x392d71=>_0x392d71[_0x3665d5(0x165)]===_0x2b4d25);if(_0x1826a6<0x0)throw CliErrors['validation'](_0x3665d5(0x139)+_0x2b4d25,_0x3665d5(0x13f));const [_0x2750cd]=_0x60ed2a[_0x3665d5(0x126)][_0x3665d5(0x123)](_0x1826a6,0x1),_0x4d46d9=(_0x5d485a[_0x3665d5(0x14e)]??(()=>new Date()))()['toISOString']();_0x60ed2a[_0x3665d5(0x13b)]=_0x4d46d9;const _0x5016c8=writeServiceRegistry(_0x60ed2a,_0x5d485a);return{'registryPath':_0x5016c8,'entry':_0x2750cd,'serviceCount':_0x60ed2a['services'][_0x3665d5(0x12a)]};}export function listLocalServices(_0x10a5f2={}){const _0x190beb=a63_0x1ab9;return readServiceRegistry(_0x10a5f2)[_0x190beb(0x126)];}export function getLocalServiceEntry(_0x5dc281,_0x215702={}){const _0x1119a1=a63_0x1ab9;return readServiceRegistry(_0x215702)[_0x1119a1(0x126)][_0x1119a1(0x16d)](_0xd0f6f8=>_0xd0f6f8[_0x1119a1(0x165)]===_0x5dc281[_0x1119a1(0x125)]());}export function listLocalServiceTrees(_0x18ebdd={}){const _0xca5cda=a63_0x1ab9;return readServiceRegistry(_0x18ebdd)[_0xca5cda(0x126)][_0xca5cda(0x14f)](_0x2790ab=>_0x2790ab[_0xca5cda(0x12d)]);}export function inspectServiceRegistry(_0x117522={}){const _0x24f200=a63_0x1ab9,_0x5447b3=getServiceRegistryPath(_0x117522);if(!existsSync(_0x5447b3))return emptyServiceRegistryInspection(_0x5447b3,'missing',![]);try{const _0x1a555b=readFileSync(_0x5447b3,_0x24f200(0x164));if(!_0x1a555b[_0x24f200(0x125)]())return emptyServiceRegistryInspection(_0x5447b3,_0x24f200(0x14c),!![]);const _0x18fb27=JSON['parse'](_0x1a555b);if(_0x18fb27[_0x24f200(0x138)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x5447b3,'invalid',!![]),'schemaVersion':_0x18fb27['schemaVersion'],'message':_0x24f200(0x144)+String(_0x18fb27[_0x24f200(0x138)])};if(!Array[_0x24f200(0x11b)](_0x18fb27[_0x24f200(0x126)]))return{...emptyServiceRegistryInspection(_0x5447b3,_0x24f200(0x133),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x18fb27[_0x24f200(0x13b)],'message':'services\x20must\x20be\x20an\x20array'};const _0x1a6231=_0x18fb27[_0x24f200(0x126)][_0x24f200(0x14f)](summarizeLocalServiceEntry);return{'registryPath':_0x5447b3,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x18fb27[_0x24f200(0x13b)],'serviceCount':_0x1a6231[_0x24f200(0x12a)],'commandCount':_0x1a6231['reduce']((_0x5e7321,_0x428be)=>_0x5e7321+_0x428be[_0x24f200(0x132)],0x0),'services':_0x1a6231};}catch(_0x7d6a3b){return{...emptyServiceRegistryInspection(_0x5447b3,_0x24f200(0x133),!![]),'message':_0x7d6a3b instanceof Error?_0x7d6a3b[_0x24f200(0x142)]:String(_0x7d6a3b)};}}export function formatValidationFailure(_0xf328ea){const _0xa75667=a63_0x1ab9,_0x54e611=_0xf328ea[_0xa75667(0x167)][_0xa75667(0x14f)](_0x3571d5=>_0x3571d5[_0xa75667(0x162)]+':\x20'+_0x3571d5[_0xa75667(0x142)]);return _0xa75667(0x159)+_0x54e611['join']('\x0a');}function a63_0x38bd(){const _0x1a31e9=['empty','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','now','map','6872320qaeayZ','cliPath','description','sort','registryIndex','homeDirName','target','].manifest','CliError','Service\x20manifest\x20validation\x20failed:\x0a','bff\x20target\x20requires\x20functionName.','24vEOZtT','].manifest.','push','file','code','3yoLKUS','151116aCXwHh','path','service','utf8','serviceCode','name','errors','manifests','Unsupported\x20service\x20registry\x20schemaVersion:\x20','154rPVFdD','startsWith','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','find','4GeSRei','.tmp','parse','isArray','validation','$.services[','Invalid\x20service\x20registry\x20JSON:\x20','7194429DPiUOx','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','stringify','source','splice','Service\x20manifest\x20file\x20not\x20found:\x20','trim','services','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','ENOENT','warnings','length','update','homeDir','normalizedManifest','digest','manifest','version','risk','commandCount','invalid','report','229694LHZDyy','localeCompare','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','schemaVersion','Local\x20service\x20not\x20found:\x20','toISOString','updatedAt','sha256','filePath','sourceHash','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','3303coKzBd','Invalid\x20service\x20manifest\x20JSON:\x20','message','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','Unsupported\x20schemaVersion:\x20','flatMap','Remove\x20or\x20migrate\x20','9064195ucAOSX','Cannot\x20write\x20service\x20registry:\x20','registry','30970VDHgTn','5648088vMKAMd'];a63_0x38bd=function(){return _0x1a31e9;};return a63_0x38bd();}function extractLoadedServiceManifests(_0x104bc0,_0x4142af){const _0x4df301=a63_0x1ab9;if(!isServiceRegistryLike(_0x104bc0)){const _0x3132ee=_0x104bc0,{manifest:_0x1414cd,errors:_0x12ede4}=adaptServiceTreeManifestForLegacyFramework(_0x3132ee),_0x5e3c76=validateServiceTreeManifest(_0x1414cd),_0x486ad0=mergeValidationErrors(_0x5e3c76,_0x12ede4);return[{'manifest':_0x3132ee,'report':_0x486ad0,'normalizedManifest':_0x486ad0['ok']?normalizeServiceTreeManifest(_0x1414cd):undefined,'sourceHash':_0x4142af}];}return _0x104bc0[_0x4df301(0x126)][_0x4df301(0x14f)]((_0x19f616,_0x2820b3)=>{const _0x5d7529=_0x4df301,_0x3081ec=isObjectRecord(_0x19f616)?_0x19f616['manifest']:undefined,{manifest:_0x48de55,errors:_0x5e0d70}=adaptServiceTreeManifestForLegacyFramework(_0x3081ec),_0x485a2c=validateServiceTreeManifest(_0x48de55),_0x438d44=mergeValidationErrors(_0x485a2c,_0x5e0d70),_0x33cc10=isObjectRecord(_0x19f616)&&typeof _0x19f616[_0x5d7529(0x165)]==='string'?_0x19f616[_0x5d7529(0x165)]:undefined;return{'manifest':_0x3081ec,'report':_0x438d44,'normalizedManifest':_0x438d44['ok']?normalizeServiceTreeManifest(_0x48de55):undefined,'sourceHash':sha256(JSON[_0x5d7529(0x121)](_0x3081ec,null,0x2)+'\x0a'),'registryIndex':_0x2820b3,'registryServiceCode':_0x33cc10};});}function mergeValidationErrors(_0x1d532d,_0x5d9ec5){const _0x4bd823=a63_0x1ab9,_0x689251=_0x1d532d[_0x4bd823(0x167)][_0x4bd823(0x14f)](_0x2cdcaf=>_0x2cdcaf[_0x4bd823(0x142)]===_0x4bd823(0x137)?{..._0x2cdcaf,'message':_0x4bd823(0x15a)}:_0x2cdcaf),_0x5cec3e=[..._0x5d9ec5,..._0x689251];return{'ok':_0x5cec3e['length']===0x0,'errors':_0x5cec3e,'warnings':_0x1d532d[_0x4bd823(0x129)]};}function aggregateValidationReports(_0x359c8f){const _0x26ba2f=a63_0x1ab9,_0x8302e6=_0x359c8f[_0x26ba2f(0x145)](_0x2767aa=>_0x2767aa[_0x26ba2f(0x154)]===undefined?_0x2767aa['report'][_0x26ba2f(0x167)]:_0x2767aa[_0x26ba2f(0x134)][_0x26ba2f(0x167)][_0x26ba2f(0x14f)](_0x191061=>({..._0x191061,'path':prefixRegistryIssuePath(_0x2767aa[_0x26ba2f(0x154)],_0x191061['path'])}))),_0x469663=_0x359c8f[_0x26ba2f(0x145)](_0x3ac47b=>_0x3ac47b[_0x26ba2f(0x154)]===undefined?_0x3ac47b['report']['warnings']:_0x3ac47b[_0x26ba2f(0x134)][_0x26ba2f(0x129)]['map'](_0x2b9caa=>({..._0x2b9caa,'path':prefixRegistryIssuePath(_0x3ac47b[_0x26ba2f(0x154)],_0x2b9caa[_0x26ba2f(0x162)])})));return{'ok':_0x8302e6[_0x26ba2f(0x12a)]===0x0,'errors':_0x8302e6,'warnings':_0x469663};}function prefixRegistryIssuePath(_0x3943e5,_0x5436bd){const _0x31e244=a63_0x1ab9;if(_0x5436bd==='$')return _0x31e244(0x11d)+_0x3943e5+'].manifest';if(_0x5436bd[_0x31e244(0x16b)]('$.'))return'$.services['+_0x3943e5+_0x31e244(0x157)+_0x5436bd['slice'](0x1);if(_0x5436bd['startsWith']('$['))return _0x31e244(0x11d)+_0x3943e5+_0x31e244(0x157)+_0x5436bd['slice'](0x1);return _0x31e244(0x11d)+_0x3943e5+_0x31e244(0x15c)+_0x5436bd;}function isServiceRegistryLike(_0x26b54a){const _0x4456d9=a63_0x1ab9;return isObjectRecord(_0x26b54a)&&_0x26b54a[_0x4456d9(0x138)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x4456d9(0x11b)](_0x26b54a[_0x4456d9(0x126)]);}function isObjectRecord(_0x2e166a){const _0x5e0e9b=a63_0x1ab9;return Boolean(_0x2e166a)&&typeof _0x2e166a==='object'&&!Array[_0x5e0e9b(0x11b)](_0x2e166a);}function emptyServiceRegistryInspection(_0x3d8707,_0x1726c1,_0x4e1d87){return{'registryPath':_0x3d8707,'exists':_0x4e1d87,'status':_0x1726c1,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x460eec){const _0x4f8d2b=a63_0x1ab9,_0x14fc8d=_0x460eec[_0x4f8d2b(0x12d)],_0x349ce4=_0x14fc8d['commands'][_0x4f8d2b(0x14f)](_0x49c6e2=>({'path':_0x49c6e2[_0x4f8d2b(0x151)],'description':_0x49c6e2[_0x4f8d2b(0x152)],'risk':_0x49c6e2[_0x4f8d2b(0x131)],'targetKind':_0x49c6e2[_0x4f8d2b(0x156)]['kind'],'targetCommand':_0x49c6e2['target']['command']}));return{'serviceCode':_0x460eec[_0x4f8d2b(0x165)],'name':_0x14fc8d['service']['name'],'description':_0x14fc8d['service'][_0x4f8d2b(0x152)],'version':_0x460eec[_0x4f8d2b(0x130)],'importedAt':_0x460eec['importedAt'],'source':_0x460eec[_0x4f8d2b(0x122)],'commandCount':_0x349ce4[_0x4f8d2b(0x12a)],'commands':_0x349ce4};}function sha256(_0xc83cb8){const _0x2a8dae=a63_0x1ab9;return createHash(_0x2a8dae(0x13c))[_0x2a8dae(0x12b)](_0xc83cb8)[_0x2a8dae(0x12e)]('hex');}
1
+ const a63_0x42e8ec=a63_0x49cc;(function(_0x576a6c,_0x2a4681){const _0x39972e=a63_0x49cc,_0xe863d4=_0x576a6c();while(!![]){try{const _0x482424=parseInt(_0x39972e(0x15c))/0x1+-parseInt(_0x39972e(0x189))/0x2+-parseInt(_0x39972e(0x150))/0x3*(-parseInt(_0x39972e(0x137))/0x4)+parseInt(_0x39972e(0x163))/0x5+-parseInt(_0x39972e(0x146))/0x6+parseInt(_0x39972e(0x176))/0x7*(parseInt(_0x39972e(0x14f))/0x8)+-parseInt(_0x39972e(0x13c))/0x9*(parseInt(_0x39972e(0x143))/0xa);if(_0x482424===_0x2a4681)break;else _0xe863d4['push'](_0xe863d4['shift']());}catch(_0x39f805){_0xe863d4['push'](_0xe863d4['shift']());}}}(a63_0x1fcc,0x53143));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=a63_0x42e8ec(0x149);export function getServiceRegistryPath(_0x49d6c0={}){const _0x42155f=a63_0x42e8ec;return resolve(_0x49d6c0[_0x42155f(0x13b)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x2ac70b={}){const _0x2d0e28=a63_0x42e8ec,_0x217a07=getServiceRegistryPath(_0x2ac70b);if(!existsSync(_0x217a07))return emptyServiceRegistry();try{const _0x46a95f=readFileSync(_0x217a07,_0x2d0e28(0x17b));if(!_0x46a95f[_0x2d0e28(0x13f)]())return emptyServiceRegistry();const _0x3970a7=JSON['parse'](_0x46a95f);if(_0x3970a7['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x2d0e28(0x140)](_0x2d0e28(0x15f)+String(_0x3970a7[_0x2d0e28(0x14e)]),_0x2d0e28(0x14c)+_0x217a07+'.');if(!Array['isArray'](_0x3970a7[_0x2d0e28(0x15e)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3970a7['updatedAt'],'services':_0x3970a7[_0x2d0e28(0x15e)]};}catch(_0x1b44d1){if(_0x1b44d1 instanceof Error&&_0x1b44d1[_0x2d0e28(0x187)]===_0x2d0e28(0x181))throw _0x1b44d1;throw CliErrors[_0x2d0e28(0x140)](_0x2d0e28(0x154)+_0x217a07,_0x2d0e28(0x161));}}function a63_0x49cc(_0x59d54b,_0x19535b){_0x59d54b=_0x59d54b-0x133;const _0x1fcc80=a63_0x1fcc();let _0x49cc57=_0x1fcc80[_0x59d54b];return _0x49cc57;}export function writeServiceRegistry(_0x4df5d4,_0xa2327b={}){const _0x2fef06=a63_0x42e8ec,_0x5e9f5c=getServiceRegistryPath(_0xa2327b),_0x366efe=dirname(_0x5e9f5c);!existsSync(_0x366efe)&&mkdirSync(_0x366efe,{'recursive':!![]});const _0x104da7=_0x5e9f5c+_0x2fef06(0x16e);try{writeFileSync(_0x104da7,JSON[_0x2fef06(0x157)](_0x4df5d4,null,0x2)+'\x0a',{'encoding':_0x2fef06(0x17b),'mode':0x180}),renameSync(_0x104da7,_0x5e9f5c);}catch(_0x48de66){try{unlinkSync(_0x104da7);}catch{}if(_0x48de66?.['code']===_0x2fef06(0x182))throw CliErrors['validation'](_0x2fef06(0x16f)+_0x5e9f5c);throw _0x48de66;}return _0x5e9f5c;}export function loadServiceManifestFromFile(_0x3f8121){const _0x3eb50d=a63_0x42e8ec,_0x3fe34e=resolve(_0x3f8121);if(!existsSync(_0x3fe34e))throw CliErrors[_0x3eb50d(0x140)](_0x3eb50d(0x15a)+_0x3f8121);let _0x2f4082;const _0x2064a9=readFileSync(_0x3fe34e,_0x3eb50d(0x17b));try{_0x2f4082=JSON[_0x3eb50d(0x139)](_0x2064a9);}catch{throw CliErrors['validation']('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x3f8121,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x4dface=sha256(_0x2064a9),_0x857610=extractLoadedServiceManifests(_0x2f4082,_0x4dface),_0x30f3cb=aggregateValidationReports(_0x857610),_0x213757=_0x857610[0x0];return{'filePath':_0x3fe34e,'hash':_0x4dface,'kind':isServiceRegistryLike(_0x2f4082)?_0x3eb50d(0x13e):_0x3eb50d(0x13d),'manifest':_0x213757?.[_0x3eb50d(0x13d)]??_0x2f4082,'report':_0x30f3cb,'normalizedManifest':_0x857610[_0x3eb50d(0x17c)]===0x1?_0x213757?.[_0x3eb50d(0x174)]:undefined,'manifests':_0x857610};}export function importServiceManifest(_0x357457,_0x471c6c={}){const _0xaa21a=a63_0x42e8ec,_0x4ed2ea=loadServiceManifestFromFile(_0x357457);if(!_0x4ed2ea[_0xaa21a(0x17f)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0x4ed2ea[_0xaa21a(0x17f)]),_0xaa21a(0x145));if(_0x4ed2ea[_0xaa21a(0x167)][_0xaa21a(0x17c)]===0x0)throw CliErrors[_0xaa21a(0x140)](_0xaa21a(0x15b),_0xaa21a(0x148));const _0x55f64d=readServiceRegistry(_0x471c6c),_0x54e594=(_0x471c6c[_0xaa21a(0x16c)]??(()=>new Date()))()[_0xaa21a(0x14b)](),_0x4f5863=[];let _0x448651=0x0,_0x27417e=0x0;for(const _0x211f45 of _0x4ed2ea[_0xaa21a(0x167)]){if(!_0x211f45[_0xaa21a(0x174)])continue;const _0x399189=_0x211f45[_0xaa21a(0x174)]['service']['code'],_0x145eac={'serviceCode':_0x399189,'version':_0x211f45[_0xaa21a(0x174)][_0xaa21a(0x13a)],'importedAt':_0x54e594,'source':{'type':'file','path':_0x4ed2ea[_0xaa21a(0x166)],'hash':_0x211f45[_0xaa21a(0x153)]},'manifest':_0x211f45[_0xaa21a(0x13d)],'normalizedManifest':_0x211f45[_0xaa21a(0x174)]},_0x400105=_0x55f64d[_0xaa21a(0x15e)][_0xaa21a(0x177)](_0x26faae=>_0x26faae['serviceCode']===_0x399189);_0x400105>=0x0?(_0x55f64d[_0xaa21a(0x15e)][_0x400105]=_0x145eac,_0x27417e++):(_0x55f64d[_0xaa21a(0x15e)][_0xaa21a(0x14d)](_0x145eac),_0x448651++),_0x4f5863[_0xaa21a(0x14d)](_0x145eac);}_0x55f64d[_0xaa21a(0x15e)][_0xaa21a(0x183)]((_0x460a25,_0x5cbfdf)=>_0x460a25[_0xaa21a(0x136)][_0xaa21a(0x160)](_0x5cbfdf['serviceCode'])),_0x55f64d[_0xaa21a(0x144)]=_0x54e594;const _0x623a16=writeServiceRegistry(_0x55f64d,_0x471c6c);return{'registryPath':_0x623a16,'entry':_0x4f5863[0x0],'replaced':_0x4f5863['length']===0x1?_0x27417e===0x1:_0x27417e>0x0,'entries':_0x4f5863,'imported':_0x448651,'updated':_0x27417e,'serviceCount':_0x55f64d[_0xaa21a(0x15e)][_0xaa21a(0x17c)]};}export function exportServiceManifest(_0x59dbd3,_0x9d2901,_0x4f879b={}){const _0x3e818a=a63_0x42e8ec,_0xce9c34=getServiceRegistryPath(_0x4f879b),_0x5d8e9a=getLocalServiceEntry(_0x59dbd3,_0x4f879b);if(!_0x5d8e9a)throw CliErrors[_0x3e818a(0x140)](_0x3e818a(0x165)+_0x59dbd3,_0x3e818a(0x159));const _0x3ff514=resolve(_0x9d2901),_0xcf0770=dirname(_0x3ff514);return!existsSync(_0xcf0770)&&mkdirSync(_0xcf0770,{'recursive':!![]}),writeFileSync(_0x3ff514,JSON[_0x3e818a(0x157)](_0x5d8e9a['manifest'],null,0x2)+'\x0a',{'encoding':_0x3e818a(0x17b),'mode':0x180}),{'registryPath':_0xce9c34,'filePath':_0x3ff514,'entry':_0x5d8e9a};}export function removeServiceManifest(_0xd4741,_0x561e77={}){const _0x2f6a2e=a63_0x42e8ec,_0x1f41cb=readServiceRegistry(_0x561e77),_0xa4f312=_0xd4741[_0x2f6a2e(0x13f)](),_0x45a4be=_0x1f41cb[_0x2f6a2e(0x15e)][_0x2f6a2e(0x177)](_0x5c1540=>_0x5c1540[_0x2f6a2e(0x136)]===_0xa4f312);if(_0x45a4be<0x0)throw CliErrors[_0x2f6a2e(0x140)](_0x2f6a2e(0x165)+_0xa4f312,_0x2f6a2e(0x159));const [_0x11d788]=_0x1f41cb[_0x2f6a2e(0x15e)][_0x2f6a2e(0x186)](_0x45a4be,0x1),_0xaf3b24=(_0x561e77[_0x2f6a2e(0x16c)]??(()=>new Date()))()[_0x2f6a2e(0x14b)]();_0x1f41cb[_0x2f6a2e(0x144)]=_0xaf3b24;const _0x173153=writeServiceRegistry(_0x1f41cb,_0x561e77);return{'registryPath':_0x173153,'entry':_0x11d788,'serviceCount':_0x1f41cb[_0x2f6a2e(0x15e)][_0x2f6a2e(0x17c)]};}export function listLocalServices(_0x1bb86f={}){const _0x370114=a63_0x42e8ec;return readServiceRegistry(_0x1bb86f)[_0x370114(0x15e)];}export function getLocalServiceEntry(_0xdd8075,_0x29f8ad={}){const _0x443356=a63_0x42e8ec;return readServiceRegistry(_0x29f8ad)[_0x443356(0x15e)][_0x443356(0x162)](_0x30dcfb=>_0x30dcfb[_0x443356(0x136)]===_0xdd8075[_0x443356(0x13f)]());}export function listLocalServiceTrees(_0x1f4f92={}){const _0x75ecfa=a63_0x42e8ec;return readServiceRegistry(_0x1f4f92)[_0x75ecfa(0x15e)][_0x75ecfa(0x152)](_0x4f2526=>_0x4f2526['normalizedManifest']);}export function inspectServiceRegistry(_0x17f39f={}){const _0x5e6ba1=a63_0x42e8ec,_0x1b8e16=getServiceRegistryPath(_0x17f39f);if(!existsSync(_0x1b8e16))return emptyServiceRegistryInspection(_0x1b8e16,_0x5e6ba1(0x168),![]);try{const _0x5b29c6=readFileSync(_0x1b8e16,'utf8');if(!_0x5b29c6[_0x5e6ba1(0x13f)]())return emptyServiceRegistryInspection(_0x1b8e16,_0x5e6ba1(0x17d),!![]);const _0x1c60e0=JSON[_0x5e6ba1(0x139)](_0x5b29c6);if(_0x1c60e0[_0x5e6ba1(0x14e)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x1b8e16,'invalid',!![]),'schemaVersion':_0x1c60e0[_0x5e6ba1(0x14e)],'message':_0x5e6ba1(0x17a)+String(_0x1c60e0[_0x5e6ba1(0x14e)])};if(!Array[_0x5e6ba1(0x188)](_0x1c60e0[_0x5e6ba1(0x15e)]))return{...emptyServiceRegistryInspection(_0x1b8e16,'invalid',!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1c60e0[_0x5e6ba1(0x144)],'message':'services\x20must\x20be\x20an\x20array'};const _0x5a96f4=_0x1c60e0['services'][_0x5e6ba1(0x152)](summarizeLocalServiceEntry);return{'registryPath':_0x1b8e16,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1c60e0[_0x5e6ba1(0x144)],'serviceCount':_0x5a96f4[_0x5e6ba1(0x17c)],'commandCount':_0x5a96f4[_0x5e6ba1(0x178)]((_0x327815,_0x4c504a)=>_0x327815+_0x4c504a[_0x5e6ba1(0x175)],0x0),'services':_0x5a96f4};}catch(_0x46b86f){return{...emptyServiceRegistryInspection(_0x1b8e16,_0x5e6ba1(0x134),!![]),'message':_0x46b86f instanceof Error?_0x46b86f[_0x5e6ba1(0x172)]:String(_0x46b86f)};}}export function formatValidationFailure(_0x2c3812){const _0x4a57c=a63_0x42e8ec,_0x3dfd4d=_0x2c3812[_0x4a57c(0x17e)][_0x4a57c(0x152)](_0x4530e0=>_0x4530e0[_0x4a57c(0x179)]+':\x20'+_0x4530e0[_0x4a57c(0x172)]);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x3dfd4d[_0x4a57c(0x170)]('\x0a');}function extractLoadedServiceManifests(_0x16134e,_0x5c2b02){const _0x1369d3=a63_0x42e8ec;if(!isServiceRegistryLike(_0x16134e)){const _0x325688=_0x16134e,{manifest:_0x5316a5,errors:_0x583162}=adaptServiceTreeManifestForLegacyFramework(_0x325688),_0x5dc41e=validateServiceTreeManifest(_0x5316a5),_0x302597=mergeValidationErrors(_0x5dc41e,_0x583162);return[{'manifest':_0x325688,'report':_0x302597,'normalizedManifest':_0x302597['ok']?normalizeServiceTreeManifest(_0x5316a5):undefined,'sourceHash':_0x5c2b02}];}return _0x16134e['services'][_0x1369d3(0x152)]((_0x8e6510,_0x204025)=>{const _0x44e650=_0x1369d3,_0x31d94d=isObjectRecord(_0x8e6510)?_0x8e6510['manifest']:undefined,{manifest:_0x1f2420,errors:_0x4b8e17}=adaptServiceTreeManifestForLegacyFramework(_0x31d94d),_0xfeaf23=validateServiceTreeManifest(_0x1f2420),_0x3c6367=mergeValidationErrors(_0xfeaf23,_0x4b8e17),_0x30725b=isObjectRecord(_0x8e6510)&&typeof _0x8e6510[_0x44e650(0x136)]==='string'?_0x8e6510['serviceCode']:undefined;return{'manifest':_0x31d94d,'report':_0x3c6367,'normalizedManifest':_0x3c6367['ok']?normalizeServiceTreeManifest(_0x1f2420):undefined,'sourceHash':sha256(JSON[_0x44e650(0x157)](_0x31d94d,null,0x2)+'\x0a'),'registryIndex':_0x204025,'registryServiceCode':_0x30725b};});}function mergeValidationErrors(_0x804db7,_0x28d8cb){const _0x51d5ca=a63_0x42e8ec,_0x2d2637=_0x804db7[_0x51d5ca(0x17e)][_0x51d5ca(0x152)](_0x21dc71=>_0x21dc71['message']===_0x51d5ca(0x15d)?{..._0x21dc71,'message':'bff\x20target\x20requires\x20functionName.'}:_0x21dc71),_0x4249fc=[..._0x28d8cb,..._0x2d2637];return{'ok':_0x4249fc[_0x51d5ca(0x17c)]===0x0,'errors':_0x4249fc,'warnings':_0x804db7[_0x51d5ca(0x158)]};}function aggregateValidationReports(_0xf940a8){const _0x28f78f=a63_0x42e8ec,_0x5cb0ef=_0xf940a8[_0x28f78f(0x155)](_0x4e424b=>_0x4e424b[_0x28f78f(0x184)]===undefined?_0x4e424b[_0x28f78f(0x17f)][_0x28f78f(0x17e)]:_0x4e424b[_0x28f78f(0x17f)][_0x28f78f(0x17e)]['map'](_0x18a528=>({..._0x18a528,'path':prefixRegistryIssuePath(_0x4e424b['registryIndex'],_0x18a528[_0x28f78f(0x179)])}))),_0x52496b=_0xf940a8[_0x28f78f(0x155)](_0x4a7a3d=>_0x4a7a3d[_0x28f78f(0x184)]===undefined?_0x4a7a3d[_0x28f78f(0x17f)][_0x28f78f(0x158)]:_0x4a7a3d[_0x28f78f(0x17f)][_0x28f78f(0x158)]['map'](_0x245b82=>({..._0x245b82,'path':prefixRegistryIssuePath(_0x4a7a3d[_0x28f78f(0x184)],_0x245b82[_0x28f78f(0x179)])})));return{'ok':_0x5cb0ef[_0x28f78f(0x17c)]===0x0,'errors':_0x5cb0ef,'warnings':_0x52496b};}function prefixRegistryIssuePath(_0x29567c,_0x13a85a){const _0x37e122=a63_0x42e8ec;if(_0x13a85a==='$')return _0x37e122(0x14a)+_0x29567c+'].manifest';if(_0x13a85a['startsWith']('$.'))return _0x37e122(0x14a)+_0x29567c+_0x37e122(0x16b)+_0x13a85a['slice'](0x1);if(_0x13a85a[_0x37e122(0x138)]('$['))return'$.services['+_0x29567c+_0x37e122(0x16b)+_0x13a85a[_0x37e122(0x141)](0x1);return'$.services['+_0x29567c+_0x37e122(0x169)+_0x13a85a;}function isServiceRegistryLike(_0x5c2a92){const _0x59c5c5=a63_0x42e8ec;return isObjectRecord(_0x5c2a92)&&_0x5c2a92[_0x59c5c5(0x14e)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0x5c2a92['services']);}function isObjectRecord(_0x1edf44){const _0x303400=a63_0x42e8ec;return Boolean(_0x1edf44)&&typeof _0x1edf44===_0x303400(0x185)&&!Array[_0x303400(0x188)](_0x1edf44);}function emptyServiceRegistryInspection(_0x3fec1a,_0x554389,_0x2fd6d8){return{'registryPath':_0x3fec1a,'exists':_0x2fd6d8,'status':_0x554389,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function a63_0x1fcc(){const _0x492f32=['empty','errors','report','target','CliError','ENOENT','sort','registryIndex','object','splice','name','isArray','1139118sKBScx','description','invalid','hex','serviceCode','4yIxgyA','startsWith','parse','version','homeDir','4815WgSfBy','manifest','registry','trim','validation','slice','service','13900ZcmGNV','updatedAt','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','99852NNUGyV','update','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','service.json','$.services[','toISOString','Remove\x20or\x20migrate\x20','push','schemaVersion','16MHzbam','1731222tekqVZ','sha256','map','sourceHash','Invalid\x20service\x20registry\x20JSON:\x20','flatMap','source','stringify','warnings','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','Service\x20manifest\x20file\x20not\x20found:\x20','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','30372zRcndC','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','services','Unsupported\x20service\x20registry\x20schemaVersion:\x20','localeCompare','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','find','2255930teOdHm','command','Local\x20service\x20not\x20found:\x20','filePath','manifests','missing','].manifest.','digest','].manifest','now','cliPath','.tmp','Cannot\x20write\x20service\x20registry:\x20','join','risk','message','kind','normalizedManifest','commandCount','2140285rTaREw','findIndex','reduce','path','Unsupported\x20schemaVersion:\x20','utf8','length'];a63_0x1fcc=function(){return _0x492f32;};return a63_0x1fcc();}function summarizeLocalServiceEntry(_0x4b3898){const _0x1d8bb2=a63_0x42e8ec,_0x3894e6=_0x4b3898['normalizedManifest'],_0x2eeaf6=_0x3894e6['commands'][_0x1d8bb2(0x152)](_0x628931=>({'path':_0x628931[_0x1d8bb2(0x16d)],'description':_0x628931[_0x1d8bb2(0x133)],'risk':_0x628931[_0x1d8bb2(0x171)],'targetKind':_0x628931[_0x1d8bb2(0x180)][_0x1d8bb2(0x173)],'targetCommand':_0x628931[_0x1d8bb2(0x180)][_0x1d8bb2(0x164)]}));return{'serviceCode':_0x4b3898[_0x1d8bb2(0x136)],'name':_0x3894e6[_0x1d8bb2(0x142)][_0x1d8bb2(0x187)],'description':_0x3894e6[_0x1d8bb2(0x142)][_0x1d8bb2(0x133)],'version':_0x4b3898[_0x1d8bb2(0x13a)],'importedAt':_0x4b3898['importedAt'],'source':_0x4b3898[_0x1d8bb2(0x156)],'commandCount':_0x2eeaf6['length'],'commands':_0x2eeaf6};}function sha256(_0xfd6720){const _0x1c7659=a63_0x42e8ec;return createHash(_0x1c7659(0x151))[_0x1c7659(0x147)](_0xfd6720)[_0x1c7659(0x16a)](_0x1c7659(0x135));}
@@ -1 +1 @@
1
- const a64_0x4bc08c=a64_0xdd91;(function(_0x469972,_0x2a284a){const _0x350c6c=a64_0xdd91,_0x59e216=_0x469972();while(!![]){try{const _0x1e7713=parseInt(_0x350c6c(0x1b7))/0x1+parseInt(_0x350c6c(0x1ca))/0x2+-parseInt(_0x350c6c(0x1ba))/0x3*(parseInt(_0x350c6c(0x1c9))/0x4)+-parseInt(_0x350c6c(0x1cb))/0x5+-parseInt(_0x350c6c(0x1b6))/0x6+-parseInt(_0x350c6c(0x1cc))/0x7*(parseInt(_0x350c6c(0x1b5))/0x8)+parseInt(_0x350c6c(0x1c4))/0x9*(parseInt(_0x350c6c(0x1af))/0xa);if(_0x1e7713===_0x2a284a)break;else _0x59e216['push'](_0x59e216['shift']());}catch(_0x56afbc){_0x59e216['push'](_0x59e216['shift']());}}}(a64_0x3b91,0xb3ba8));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';function a64_0xdd91(_0x147b7e,_0x1c8487){_0x147b7e=_0x147b7e-0x1ad;const _0x3b9114=a64_0x3b91();let _0xdd9161=_0x3b9114[_0x147b7e];return _0xdd9161;}import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a64_0x4bc08c(0x1c0),'command':a64_0x4bc08c(0x1bf),'description':a64_0x4bc08c(0x1d1),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x4707d8){const _0x25f401=a64_0x4bc08c,_0x3058a8=buildSkillCreatePlan(_0x4707d8[_0x25f401(0x1c6)]('name'),_0x4707d8[_0x25f401(0x1c6)](_0x25f401(0x1cf)),_0x4707d8['str']('target'));return{'method':_0x25f401(0x1b8),'url':_0x3058a8['skillDir'],'body':{'skillName':_0x3058a8[_0x25f401(0x1bd)][_0x25f401(0x1c2)],'type':_0x3058a8[_0x25f401(0x1bd)][_0x25f401(0x1cf)],'selfContained':!![],'files':_0x3058a8['rendered'][_0x25f401(0x1ad)][_0x25f401(0x1d0)](_0x1a244a=>_0x1a244a[_0x25f401(0x1b1)])},'description':_0x25f401(0x1b4)};},async 'execute'(_0xa16000){const _0x5118db=a64_0x4bc08c,_0x3099a1=buildSkillCreatePlan(_0xa16000[_0x5118db(0x1c6)](_0x5118db(0x1c7)),_0xa16000['str'](_0x5118db(0x1cf)),_0xa16000[_0x5118db(0x1c6)]('target'));return writeSkillDraft(_0x3099a1,_0xa16000[_0x5118db(0x1c1)](_0x5118db(0x1b9))),{'ok':!![],'data':{'skillName':_0x3099a1[_0x5118db(0x1bd)][_0x5118db(0x1c2)],'type':_0x3099a1[_0x5118db(0x1bd)][_0x5118db(0x1cf)],'dir':_0x3099a1['skillDir'],'files':_0x3099a1['rendered'][_0x5118db(0x1ad)][_0x5118db(0x1d0)](_0xdcdcf9=>_0xdcdcf9[_0x5118db(0x1b1)])},'message':'Created\x20local\x20Skill\x20draft\x20'+_0x3099a1['rendered'][_0x5118db(0x1c2)]};}};function a64_0x3b91(){const _0x5ba219=['Skill\x20directory\x20already\x20exists:\x20','isDirectory','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','8DtDUAg','1655910kgiLhx','607747wIsdQe','WRITE','force','299199btjSCR','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','content','rendered','validation','create','skill','bool','skillName','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','10611ctvWqK','isSymbolicLink','str','name','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','20oChQsW','497366mAOwgH','2751595gvBiaw','5852994kbChmJ','utf8','trim','type','map','Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','files','Refusing\x20to\x20overwrite\x20symlink:\x20','17310BvJflj','skillDir','path'];a64_0x3b91=function(){return _0x5ba219;};return a64_0x3b91();}function buildSkillCreatePlan(_0x5f3c4e,_0x2730b0,_0x3ed2c3){const _0xa234a5=a64_0x4bc08c,_0x370101=_0x2730b0[_0xa234a5(0x1ce)](),_0x2a66a3=renderSkillTemplate({'skillName':_0x5f3c4e,'type':_0x370101});!_0x370101&&writeCliSideChannelLine(_0xa234a5(0x1c8));const _0x458ab5=resolve(normalizeSkillTarget(_0x3ed2c3));return{'rendered':_0x2a66a3,'targetRoot':_0x458ab5,'skillDir':resolve(_0x458ab5,_0x2a66a3[_0xa234a5(0x1c2)])};}function normalizeSkillTarget(_0xbcf18c){const _0x2da67a=a64_0x4bc08c;return(_0xbcf18c||DEFAULT_SKILL_TARGET)[_0x2da67a(0x1ce)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x129c06,_0x4993da){const _0x4366d8=a64_0x4bc08c;if(existsSync(_0x129c06[_0x4366d8(0x1b0)])){const _0x51bb6e=lstatSync(_0x129c06[_0x4366d8(0x1b0)]);if(!_0x51bb6e[_0x4366d8(0x1b3)]()||_0x51bb6e[_0x4366d8(0x1c5)]())throw CliErrors[_0x4366d8(0x1be)](_0x4366d8(0x1bb)+_0x129c06[_0x4366d8(0x1b0)]);if(!_0x4993da)throw CliErrors['validation'](_0x4366d8(0x1b2)+_0x129c06[_0x4366d8(0x1b0)],_0x4366d8(0x1c3));}for(const _0x20ad22 of _0x129c06[_0x4366d8(0x1bd)][_0x4366d8(0x1ad)]){const _0x2e8781=resolve(_0x129c06['skillDir'],_0x20ad22[_0x4366d8(0x1b1)]),_0x50754a=dirname(_0x2e8781);mkdirSync(_0x50754a,{'recursive':!![]});if(existsSync(_0x2e8781)&&lstatSync(_0x2e8781)[_0x4366d8(0x1c5)]())throw CliErrors[_0x4366d8(0x1be)](_0x4366d8(0x1ae)+_0x2e8781);writeFileSync(_0x2e8781,_0x20ad22[_0x4366d8(0x1bc)],_0x4366d8(0x1cd));}}
1
+ const a64_0x167c55=a64_0xa024;function a64_0x5c2f(){const _0x139817=['type','rendered','skillDir','5QJnHeW','isSymbolicLink','1580666FZppal','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','8OFJDbO','skill','target','1515330zAXajT','skillName','53496qscscR','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','1356tcqNZi','force','isDirectory','131065ZDsYDd','1hiadpr','1553044TypaHd','files','path','name','trim','validation','str','map','2634918ZTJqOm','Created\x20local\x20Skill\x20draft\x20','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','read','bool','WRITE','content','Refusing\x20to\x20overwrite\x20symlink:\x20','14okJmZO','11813810ySvOcP'];a64_0x5c2f=function(){return _0x139817;};return a64_0x5c2f();}(function(_0x5f03e6,_0x39469b){const _0x9865aa=a64_0xa024,_0x88d437=_0x5f03e6();while(!![]){try{const _0x189c9e=parseInt(_0x9865aa(0x167))/0x1*(parseInt(_0x9865aa(0x17f))/0x2)+parseInt(_0x9865aa(0x170))/0x3+parseInt(_0x9865aa(0x168))/0x4*(-parseInt(_0x9865aa(0x17d))/0x5)+-parseInt(_0x9865aa(0x15f))/0x6*(parseInt(_0x9865aa(0x178))/0x7)+parseInt(_0x9865aa(0x15c))/0x8*(parseInt(_0x9865aa(0x161))/0x9)+parseInt(_0x9865aa(0x179))/0xa+-parseInt(_0x9865aa(0x166))/0xb*(parseInt(_0x9865aa(0x163))/0xc);if(_0x189c9e===_0x39469b)break;else _0x88d437['push'](_0x88d437['shift']());}catch(_0x4cf585){_0x88d437['push'](_0x88d437['shift']());}}}(a64_0x5c2f,0x96706));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';function a64_0xa024(_0x3df056,_0x2907bf){_0x3df056=_0x3df056-0x15b;const _0x5c2f56=a64_0x5c2f();let _0xa024ac=_0x5c2f56[_0x3df056];return _0xa024ac;}export const createCommand={'service':a64_0x167c55(0x15d),'command':'create','description':'Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','risk':a64_0x167c55(0x173),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x37d824){const _0xbac7b2=a64_0x167c55,_0x4e3051=buildSkillCreatePlan(_0x37d824[_0xbac7b2(0x16e)](_0xbac7b2(0x16b)),_0x37d824[_0xbac7b2(0x16e)]('type'),_0x37d824[_0xbac7b2(0x16e)](_0xbac7b2(0x15e)));return{'method':_0xbac7b2(0x175),'url':_0x4e3051[_0xbac7b2(0x17c)],'body':{'skillName':_0x4e3051[_0xbac7b2(0x17b)][_0xbac7b2(0x160)],'type':_0x4e3051[_0xbac7b2(0x17b)][_0xbac7b2(0x17a)],'selfContained':!![],'files':_0x4e3051[_0xbac7b2(0x17b)][_0xbac7b2(0x169)][_0xbac7b2(0x16f)](_0x23c67c=>_0x23c67c[_0xbac7b2(0x16a)])},'description':_0xbac7b2(0x172)};},async 'execute'(_0x56899e){const _0x5d3e81=a64_0x167c55,_0xfd5718=buildSkillCreatePlan(_0x56899e[_0x5d3e81(0x16e)]('name'),_0x56899e['str'](_0x5d3e81(0x17a)),_0x56899e['str'](_0x5d3e81(0x15e)));return writeSkillDraft(_0xfd5718,_0x56899e[_0x5d3e81(0x174)](_0x5d3e81(0x164))),{'ok':!![],'data':{'skillName':_0xfd5718[_0x5d3e81(0x17b)][_0x5d3e81(0x160)],'type':_0xfd5718['rendered'][_0x5d3e81(0x17a)],'dir':_0xfd5718[_0x5d3e81(0x17c)],'files':_0xfd5718[_0x5d3e81(0x17b)][_0x5d3e81(0x169)][_0x5d3e81(0x16f)](_0x16aa0d=>_0x16aa0d['path'])},'message':_0x5d3e81(0x171)+_0xfd5718['rendered'][_0x5d3e81(0x160)]};}};function buildSkillCreatePlan(_0x1496d0,_0x5492bf,_0x4fb2d8){const _0x179c5b=a64_0x167c55,_0xef46d1=_0x5492bf[_0x179c5b(0x16c)](),_0x1da955=renderSkillTemplate({'skillName':_0x1496d0,'type':_0xef46d1});!_0xef46d1&&writeCliSideChannelLine('Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.');const _0x1075b8=resolve(normalizeSkillTarget(_0x4fb2d8));return{'rendered':_0x1da955,'targetRoot':_0x1075b8,'skillDir':resolve(_0x1075b8,_0x1da955['skillName'])};}function normalizeSkillTarget(_0x1d2da5){const _0x3ef0dc=a64_0x167c55;return(_0x1d2da5||DEFAULT_SKILL_TARGET)[_0x3ef0dc(0x16c)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x2914d5,_0x5d5990){const _0x2f1097=a64_0x167c55;if(existsSync(_0x2914d5[_0x2f1097(0x17c)])){const _0x52ea9f=lstatSync(_0x2914d5[_0x2f1097(0x17c)]);if(!_0x52ea9f[_0x2f1097(0x165)]()||_0x52ea9f[_0x2f1097(0x17e)]())throw CliErrors[_0x2f1097(0x16d)](_0x2f1097(0x162)+_0x2914d5[_0x2f1097(0x17c)]);if(!_0x5d5990)throw CliErrors['validation']('Skill\x20directory\x20already\x20exists:\x20'+_0x2914d5[_0x2f1097(0x17c)],_0x2f1097(0x15b));}for(const _0x26fe33 of _0x2914d5['rendered']['files']){const _0x4ea0b5=resolve(_0x2914d5[_0x2f1097(0x17c)],_0x26fe33[_0x2f1097(0x16a)]),_0x2f8ef3=dirname(_0x4ea0b5);mkdirSync(_0x2f8ef3,{'recursive':!![]});if(existsSync(_0x4ea0b5)&&lstatSync(_0x4ea0b5)[_0x2f1097(0x17e)]())throw CliErrors[_0x2f1097(0x16d)](_0x2f1097(0x177)+_0x4ea0b5);writeFileSync(_0x4ea0b5,_0x26fe33[_0x2f1097(0x176)],'utf8');}}
@@ -1 +1 @@
1
- const a65_0xef66f6=a65_0x3a77;(function(_0x14afdf,_0x424df9){const _0x28f25b=a65_0x3a77,_0x4bde33=_0x14afdf();while(!![]){try{const _0x1d2df6=parseInt(_0x28f25b(0x8e))/0x1*(-parseInt(_0x28f25b(0x93))/0x2)+-parseInt(_0x28f25b(0x8b))/0x3*(-parseInt(_0x28f25b(0xb9))/0x4)+parseInt(_0x28f25b(0x96))/0x5*(-parseInt(_0x28f25b(0xa0))/0x6)+-parseInt(_0x28f25b(0xb1))/0x7+-parseInt(_0x28f25b(0xb8))/0x8+parseInt(_0x28f25b(0xb3))/0x9*(parseInt(_0x28f25b(0xa9))/0xa)+parseInt(_0x28f25b(0xb6))/0xb;if(_0x1d2df6===_0x424df9)break;else _0x4bde33['push'](_0x4bde33['shift']());}catch(_0x3710fc){_0x4bde33['push'](_0x4bde33['shift']());}}}(a65_0x2f0a,0xba641));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';function a65_0x2f0a(){const _0x2ad01b=['validation','12682620NuWhzT','version','str','15742914LkiCZW','trim','2065760CGpoRx','443204ExxhLc','action','skill','30MMiXUL','expected-diagram-revision','Skill\x20diagram\x20validation\x20passed\x20for\x20','93nUvDIC','expectedDiagramRevision','\x20Skill\x20diagram\x20for\x20',';\x20next\x20write\x20expects\x20revision\x20','personal','30178sOLyNp','Creates\x20or\x20replaces\x20a\x20Mermaid\x20diagram\x20for\x20an\x20exact\x20Skill\x20version.\x20The\x20write\x20is\x20rejected\x20if\x20the\x20server\x20version\x20has\x20changed.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20diagram\x20body.','diagram-validate','1807045HfbtFG','created','Create\x20or\x20replace\x20a\x20Mermaid\x20diagram\x20for\x20a\x20specific\x20Skill\x20version','write','diagram-push','Skill\x20diagram\x20for\x20','scope','test','appCode','unchanged','6SfQZwa','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','found','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','Created','Found\x20Skill\x20diagram\x20for\x20','read','source-fingerprint','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','10hYoyXz','Updated','num','diagram-file','skill-code','skillCode','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','8134007MeYZJo'];a65_0x2f0a=function(){return _0x2ad01b;};return a65_0x2f0a();}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 a65_0x3a77(_0x1db674,_0x19adbe){_0x1db674=_0x1db674-0x8b;const _0x2f0ade=a65_0x2f0a();let _0x3a77e4=_0x2f0ade[_0x1db674];return _0x3a77e4;}function readDiagramTarget(_0x2e5314){const _0x23b99d=a65_0x3a77,_0x42cad2=_0x2e5314[_0x23b99d(0xb5)](_0x23b99d(0xad))['trim'](),_0x408344=_0x2e5314[_0x23b99d(0xb5)]('version')[_0x23b99d(0xb7)](),_0x528969=_0x2e5314[_0x23b99d(0xb5)]('scope');if(!_0x42cad2||!_0x408344||_0x528969!==_0x23b99d(0x92)&&_0x528969!=='company')throw CliErrors[_0x23b99d(0xb2)](_0x23b99d(0xaf));return{'skillCode':_0x42cad2,'version':_0x408344,'scope':_0x528969};}async function readDiagramWriteInput(_0x2909d2){const _0xe9506d=a65_0x3a77,_0x3523a0=_0x2909d2[_0xe9506d(0xab)](_0xe9506d(0x8c)),_0x5e71a1=_0x2909d2[_0xe9506d(0xb5)](_0xe9506d(0xa7))['trim']();if(!Number['isInteger'](_0x3523a0)||_0x3523a0<0x0)throw CliErrors['validation'](_0xe9506d(0xa1));if(!/^sha256:[0-9a-f]{64}$/[_0xe9506d(0x9d)](_0x5e71a1))throw CliErrors[_0xe9506d(0xb2)](_0xe9506d(0xa8));return{'expectedDiagramRevision':_0x3523a0,'sourceFingerprint':_0x5e71a1,'diagram':await readRequiredSkillDiagram(_0x2909d2[_0xe9506d(0xb5)](_0xe9506d(0xac)))};}export const diagramValidateCommand={'service':a65_0xef66f6(0xbb),'command':a65_0xef66f6(0x95),'description':'Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','risk':a65_0xef66f6(0xa6),'flags':WRITE_FLAGS,async 'execute'(_0xeee0be){const _0x170d97=a65_0xef66f6,_0x546d15=readDiagramTarget(_0xeee0be),_0x2c313f=await validateRuntimeSkillVersionDiagram(_0xeee0be['appCode'],_0x546d15[_0x170d97(0xae)],_0x546d15[_0x170d97(0xb4)],_0x546d15[_0x170d97(0x9c)],await readDiagramWriteInput(_0xeee0be));return{'ok':!![],'data':_0x2c313f,'message':_0x170d97(0x8d)+_0x546d15[_0x170d97(0xae)]+'@'+_0x546d15[_0x170d97(0xb4)]+'.'};}};export const diagramPushCommand={'service':'skill','command':a65_0xef66f6(0x9a),'description':a65_0xef66f6(0x98),'risk':a65_0xef66f6(0x99),'confirmationDescription':a65_0xef66f6(0x94),'flags':WRITE_FLAGS,async 'execute'(_0x1b1bfe){const _0x2ddfeb=a65_0xef66f6,_0x2a89f9=readDiagramTarget(_0x1b1bfe),_0x34ba3c=await putRuntimeSkillVersionDiagram(_0x1b1bfe[_0x2ddfeb(0x9e)],_0x2a89f9[_0x2ddfeb(0xae)],_0x2a89f9[_0x2ddfeb(0xb4)],_0x2a89f9[_0x2ddfeb(0x9c)],await readDiagramWriteInput(_0x1b1bfe));return{'ok':!![],'data':_0x34ba3c,'message':_0x34ba3c[_0x2ddfeb(0xba)]===_0x2ddfeb(0x9f)?_0x2ddfeb(0x9b)+_0x2a89f9[_0x2ddfeb(0xae)]+'@'+_0x2a89f9[_0x2ddfeb(0xb4)]+'\x20is\x20unchanged.':(_0x34ba3c[_0x2ddfeb(0xba)]===_0x2ddfeb(0x97)?_0x2ddfeb(0xa4):_0x2ddfeb(0xaa))+_0x2ddfeb(0x90)+_0x2a89f9[_0x2ddfeb(0xae)]+'@'+_0x2a89f9[_0x2ddfeb(0xb4)]+'.'};}};export const diagramShowCommand={'service':a65_0xef66f6(0xbb),'command':'diagram-show','description':a65_0xef66f6(0xb0),'risk':a65_0xef66f6(0xa6),'flags':TARGET_FLAGS,async 'execute'(_0x5e1968){const _0x45fce4=a65_0xef66f6,_0x30ec99=readDiagramTarget(_0x5e1968),_0x853ad3=await getRuntimeSkillVersionDiagram(_0x5e1968['appCode'],_0x30ec99[_0x45fce4(0xae)],_0x30ec99[_0x45fce4(0xb4)],_0x30ec99[_0x45fce4(0x9c)]);return{'ok':!![],'data':_0x853ad3,'message':_0x853ad3[_0x45fce4(0xa2)]?_0x45fce4(0xa5)+_0x30ec99[_0x45fce4(0xae)]+'@'+_0x30ec99[_0x45fce4(0xb4)]+_0x45fce4(0x91)+_0x853ad3[_0x45fce4(0x8f)]+'.':_0x45fce4(0xa3)+_0x30ec99[_0x45fce4(0xae)]+'@'+_0x30ec99[_0x45fce4(0xb4)]+';\x20first\x20write\x20expects\x20revision\x20'+_0x853ad3[_0x45fce4(0x8f)]+'.'};}};
1
+ const a65_0x5cb08d=a65_0x6f47;(function(_0xba1190,_0x39d64f){const _0x1ad7c3=a65_0x6f47,_0x45b5ab=_0xba1190();while(!![]){try{const _0x1e44a5=parseInt(_0x1ad7c3(0xa5))/0x1*(-parseInt(_0x1ad7c3(0xa0))/0x2)+-parseInt(_0x1ad7c3(0xb9))/0x3+-parseInt(_0x1ad7c3(0xaa))/0x4*(parseInt(_0x1ad7c3(0xb6))/0x5)+-parseInt(_0x1ad7c3(0xab))/0x6*(-parseInt(_0x1ad7c3(0xcd))/0x7)+parseInt(_0x1ad7c3(0xc5))/0x8*(parseInt(_0x1ad7c3(0xc6))/0x9)+parseInt(_0x1ad7c3(0xcb))/0xa*(parseInt(_0x1ad7c3(0xa3))/0xb)+parseInt(_0x1ad7c3(0xbc))/0xc*(parseInt(_0x1ad7c3(0xae))/0xd);if(_0x1e44a5===_0x39d64f)break;else _0x45b5ab['push'](_0x45b5ab['shift']());}catch(_0x28da83){_0x45b5ab['push'](_0x45b5ab['shift']());}}}(a65_0x58a1,0xc1e79));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';function a65_0x6f47(_0x1af39f,_0x49ffac){_0x1af39f=_0x1af39f-0x9f;const _0x58a1d5=a65_0x58a1();let _0x6f4755=_0x58a1d5[_0x1af39f];return _0x6f4755;}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(_0x388dd8){const _0x5e5400=a65_0x6f47,_0x31b0b5=_0x388dd8['str']('skill-code')[_0x5e5400(0x9f)](),_0x53b538=_0x388dd8['str'](_0x5e5400(0xa2))[_0x5e5400(0x9f)](),_0x14c708=_0x388dd8[_0x5e5400(0xbe)]('scope');if(!_0x31b0b5||!_0x53b538||_0x14c708!==_0x5e5400(0xb2)&&_0x14c708!=='company')throw CliErrors[_0x5e5400(0xa9)](_0x5e5400(0xa1));return{'skillCode':_0x31b0b5,'version':_0x53b538,'scope':_0x14c708};}function a65_0x58a1(){const _0x34e2f2=['--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','version','11CfFuWJ','source-fingerprint','822839BLyDGe','expected-diagram-revision','scope','found','validation','564BWgAbn','1001094kTTRRJ','\x20is\x20unchanged.','Created','13SbsJPK','action','read','expectedDiagramRevision','personal','Creates\x20or\x20replaces\x20a\x20Mermaid\x20diagram\x20for\x20an\x20exact\x20Skill\x20version.\x20The\x20write\x20is\x20rejected\x20if\x20the\x20server\x20version\x20has\x20changed.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20diagram\x20body.','Found\x20Skill\x20diagram\x20for\x20','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','33740wjrXRs','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','\x20Skill\x20diagram\x20for\x20','663420bBBImw','created','diagram-show','179508gNKhdh','Updated','str','write','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','test','isInteger','diagram-file','Create\x20or\x20replace\x20a\x20Mermaid\x20diagram\x20for\x20a\x20specific\x20Skill\x20version','42448RdqWpy','1017LdoEim','skillCode','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','appCode','diagram-validate','6735020iNnbUr','diagram-push','63BcHCxZ','skill','trim','2DceMyc'];a65_0x58a1=function(){return _0x34e2f2;};return a65_0x58a1();}async function readDiagramWriteInput(_0x380027){const _0x15bb7b=a65_0x6f47,_0x2452aa=_0x380027['num'](_0x15bb7b(0xa6)),_0x319b51=_0x380027[_0x15bb7b(0xbe)](_0x15bb7b(0xa4))['trim']();if(!Number[_0x15bb7b(0xc2)](_0x2452aa)||_0x2452aa<0x0)throw CliErrors['validation'](_0x15bb7b(0xb7));if(!/^sha256:[0-9a-f]{64}$/[_0x15bb7b(0xc1)](_0x319b51))throw CliErrors[_0x15bb7b(0xa9)]('--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.');return{'expectedDiagramRevision':_0x2452aa,'sourceFingerprint':_0x319b51,'diagram':await readRequiredSkillDiagram(_0x380027[_0x15bb7b(0xbe)](_0x15bb7b(0xc3)))};}export const diagramValidateCommand={'service':a65_0x5cb08d(0xce),'command':a65_0x5cb08d(0xca),'description':a65_0x5cb08d(0xb5),'risk':a65_0x5cb08d(0xb0),'flags':WRITE_FLAGS,async 'execute'(_0x30361a){const _0x23bfea=a65_0x5cb08d,_0xf844f8=readDiagramTarget(_0x30361a),_0x233c64=await validateRuntimeSkillVersionDiagram(_0x30361a[_0x23bfea(0xc9)],_0xf844f8['skillCode'],_0xf844f8[_0x23bfea(0xa2)],_0xf844f8[_0x23bfea(0xa7)],await readDiagramWriteInput(_0x30361a));return{'ok':!![],'data':_0x233c64,'message':'Skill\x20diagram\x20validation\x20passed\x20for\x20'+_0xf844f8['skillCode']+'@'+_0xf844f8['version']+'.'};}};export const diagramPushCommand={'service':a65_0x5cb08d(0xce),'command':a65_0x5cb08d(0xcc),'description':a65_0x5cb08d(0xc4),'risk':a65_0x5cb08d(0xbf),'confirmationDescription':a65_0x5cb08d(0xb3),'flags':WRITE_FLAGS,async 'execute'(_0x465cc6){const _0x5b979d=a65_0x5cb08d,_0x9e8f5a=readDiagramTarget(_0x465cc6),_0x335c34=await putRuntimeSkillVersionDiagram(_0x465cc6['appCode'],_0x9e8f5a[_0x5b979d(0xc7)],_0x9e8f5a[_0x5b979d(0xa2)],_0x9e8f5a[_0x5b979d(0xa7)],await readDiagramWriteInput(_0x465cc6));return{'ok':!![],'data':_0x335c34,'message':_0x335c34[_0x5b979d(0xaf)]==='unchanged'?'Skill\x20diagram\x20for\x20'+_0x9e8f5a[_0x5b979d(0xc7)]+'@'+_0x9e8f5a[_0x5b979d(0xa2)]+_0x5b979d(0xac):(_0x335c34[_0x5b979d(0xaf)]===_0x5b979d(0xba)?_0x5b979d(0xad):_0x5b979d(0xbd))+_0x5b979d(0xb8)+_0x9e8f5a[_0x5b979d(0xc7)]+'@'+_0x9e8f5a['version']+'.'};}};export const diagramShowCommand={'service':a65_0x5cb08d(0xce),'command':a65_0x5cb08d(0xbb),'description':a65_0x5cb08d(0xc0),'risk':a65_0x5cb08d(0xb0),'flags':TARGET_FLAGS,async 'execute'(_0x2e891b){const _0x49875f=a65_0x5cb08d,_0x31ac24=readDiagramTarget(_0x2e891b),_0x331a30=await getRuntimeSkillVersionDiagram(_0x2e891b[_0x49875f(0xc9)],_0x31ac24['skillCode'],_0x31ac24[_0x49875f(0xa2)],_0x31ac24[_0x49875f(0xa7)]);return{'ok':!![],'data':_0x331a30,'message':_0x331a30[_0x49875f(0xa8)]?_0x49875f(0xb4)+_0x31ac24[_0x49875f(0xc7)]+'@'+_0x31ac24[_0x49875f(0xa2)]+';\x20next\x20write\x20expects\x20revision\x20'+_0x331a30['expectedDiagramRevision']+'.':_0x49875f(0xc8)+_0x31ac24['skillCode']+'@'+_0x31ac24[_0x49875f(0xa2)]+';\x20first\x20write\x20expects\x20revision\x20'+_0x331a30[_0x49875f(0xb1)]+'.'};}};