@lovrabet/lovrabet-cli 2.3.2-beta.3 → 2.3.3-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) 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/approval/index.d.ts +15 -0
  12. package/lib/commands/approval/index.js +1 -0
  13. package/lib/commands/artifact/index.js +1 -1
  14. package/lib/commands/auth/device.js +1 -1
  15. package/lib/commands/auth/index.js +1 -1
  16. package/lib/commands/auth/prompt.js +1 -1
  17. package/lib/commands/bff/detail.js +1 -1
  18. package/lib/commands/bff/exec.js +1 -1
  19. package/lib/commands/bff/index.js +1 -1
  20. package/lib/commands/cli-skill/index.js +1 -1
  21. package/lib/commands/common/config-policy.js +1 -1
  22. package/lib/commands/common/constraints.js +1 -1
  23. package/lib/commands/common/flags.js +1 -1
  24. package/lib/commands/common/local-file.js +1 -1
  25. package/lib/commands/config/definitions.js +1 -1
  26. package/lib/commands/config/init.js +1 -1
  27. package/lib/commands/config/shared.js +1 -1
  28. package/lib/commands/data/index.js +1 -1
  29. package/lib/commands/dataset/detail.js +1 -1
  30. package/lib/commands/dataset/index.js +1 -1
  31. package/lib/commands/dataset/list.js +1 -1
  32. package/lib/commands/dataset/sdk-doc.js +1 -1
  33. package/lib/commands/doctor.js +1 -1
  34. package/lib/commands/file/index.js +1 -1
  35. package/lib/commands/init.js +1 -1
  36. package/lib/commands/kb/index.js +1 -1
  37. package/lib/commands/logs/index.js +1 -1
  38. package/lib/commands/notification/config-list.js +1 -1
  39. package/lib/commands/notification/index.js +1 -1
  40. package/lib/commands/notification/shared.js +1 -1
  41. package/lib/commands/ocr/index.js +1 -1
  42. package/lib/commands/permit/dataset-get.js +1 -1
  43. package/lib/commands/permit/dataset-set.js +1 -1
  44. package/lib/commands/permit/index.js +1 -1
  45. package/lib/commands/permit/page-get.js +1 -1
  46. package/lib/commands/permit/page-set.js +1 -1
  47. package/lib/commands/permit/role-menus-set.js +1 -1
  48. package/lib/commands/permit/role-menus.js +1 -1
  49. package/lib/commands/permit/shared.js +1 -1
  50. package/lib/commands/personal-bff/index.js +1 -1
  51. package/lib/commands/registry.js +1 -1
  52. package/lib/commands/role/create.js +1 -1
  53. package/lib/commands/role/delete.js +1 -1
  54. package/lib/commands/role/detail.js +1 -1
  55. package/lib/commands/role/index.js +1 -1
  56. package/lib/commands/role/list.js +1 -1
  57. package/lib/commands/role/shared.js +1 -1
  58. package/lib/commands/role/update.js +1 -1
  59. package/lib/commands/role/user-add.js +1 -1
  60. package/lib/commands/role/user-remove.js +1 -1
  61. package/lib/commands/schedule/index.js +1 -1
  62. package/lib/commands/schema.js +1 -1
  63. package/lib/commands/service/dynamic.js +1 -1
  64. package/lib/commands/service/function-name-adapter.js +1 -1
  65. package/lib/commands/service/index.js +1 -1
  66. package/lib/commands/service/registry.js +1 -1
  67. package/lib/commands/skill/commands/create.js +1 -1
  68. package/lib/commands/skill/commands/diagram.js +1 -1
  69. package/lib/commands/skill/commands/install.js +1 -1
  70. package/lib/commands/skill/commands/list.js +1 -1
  71. package/lib/commands/skill/commands/push.js +1 -1
  72. package/lib/commands/skill/commands/validate.js +1 -1
  73. package/lib/commands/skill/diagram.js +1 -1
  74. package/lib/commands/skill/flags.js +1 -1
  75. package/lib/commands/skill/index.js +1 -1
  76. package/lib/commands/skill/manifest-helpers.js +1 -1
  77. package/lib/commands/skill/push-execute.js +1 -1
  78. package/lib/commands/skill/push-flow-helpers.js +1 -1
  79. package/lib/commands/skill/push-retarget.js +1 -1
  80. package/lib/commands/skill/scopes.js +1 -1
  81. package/lib/commands/skill/summary.js +1 -1
  82. package/lib/commands/skill/templates.js +1 -1
  83. package/lib/commands/skill/validate.js +1 -1
  84. package/lib/commands/sql/detail.js +1 -1
  85. package/lib/commands/sql/exec.js +1 -1
  86. package/lib/commands/sql/index.js +1 -1
  87. package/lib/commands/update.js +1 -1
  88. package/lib/commands/user-account/bind.js +1 -1
  89. package/lib/commands/user-account/index.js +1 -1
  90. package/lib/commands/workspace/index.js +1 -1
  91. package/lib/config/domain-config.js +1 -1
  92. package/lib/config/schema.js +1 -1
  93. package/lib/constant/app.js +1 -1
  94. package/lib/constant/auth-mode.js +1 -1
  95. package/lib/constant/cli.js +1 -1
  96. package/lib/constant/defaults.js +1 -1
  97. package/lib/constant/distribution.js +1 -1
  98. package/lib/constant/domain.js +1 -1
  99. package/lib/constant/env.js +1 -1
  100. package/lib/constant/output.js +1 -1
  101. package/lib/constant/product.js +1 -1
  102. package/lib/constant/region.js +1 -1
  103. package/lib/constant/risk.js +1 -1
  104. package/lib/constant/url.js +1 -1
  105. package/lib/context.js +1 -1
  106. package/lib/core/api-client.d.ts +83 -0
  107. package/lib/core/api-client.js +1 -1
  108. package/lib/core/db-resolver.js +1 -1
  109. package/lib/core/kb-search-client.js +1 -1
  110. package/lib/core/sdk-client.js +1 -1
  111. package/lib/errors.js +1 -1
  112. package/lib/framework/build-all-flags.js +1 -1
  113. package/lib/framework/dryrun.js +1 -1
  114. package/lib/framework/flags.js +1 -1
  115. package/lib/framework/help.js +1 -1
  116. package/lib/framework/index.js +1 -1
  117. package/lib/framework/output.js +1 -1
  118. package/lib/framework/preparse.js +1 -1
  119. package/lib/framework/rate-limit.js +1 -1
  120. package/lib/framework/raw-flags.js +1 -1
  121. package/lib/framework/response.js +1 -1
  122. package/lib/framework/runner-confirmation.js +1 -1
  123. package/lib/framework/runner-error.js +1 -1
  124. package/lib/framework/runner.js +1 -1
  125. package/lib/framework/schema-export.js +1 -1
  126. package/lib/framework/service-order.js +1 -1
  127. package/lib/framework/types.js +1 -1
  128. package/lib/generated/build-info.d.ts +4 -4
  129. package/lib/generated/build-info.js +1 -1
  130. package/lib/generated/official-routing.js +1 -1
  131. package/lib/generated/routing-contract.js +1 -1
  132. package/lib/help.js +1 -1
  133. package/lib/postinstall.js +1 -1
  134. package/lib/runtime/confirmation.js +1 -1
  135. package/lib/runtime/event.js +1 -1
  136. package/lib/runtime/index.js +1 -1
  137. package/lib/runtime/queue.js +1 -1
  138. package/lib/runtime/resolve.js +1 -1
  139. package/lib/skills/builtin-skill.js +1 -1
  140. package/lib/skills/npx-skills-add.js +1 -1
  141. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  142. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  143. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  144. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  145. package/lib/skills/runtime-skill-sync/links.js +1 -1
  146. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  147. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  148. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  149. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  150. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  151. package/lib/skills/runtime-skill-sync/push.js +1 -1
  152. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  153. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  154. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  155. package/lib/skills/runtime-skill-sync.js +1 -1
  156. package/lib/skills/skill-presence.js +1 -1
  157. package/lib/utils/access-key-redaction.js +1 -1
  158. package/lib/utils/apply-jq-filter.js +1 -1
  159. package/lib/utils/cli-version-check.js +1 -1
  160. package/lib/utils/cli-version-policy.js +1 -1
  161. package/lib/utils/logger.js +1 -1
  162. package/lib/utils/lossless-json.js +1 -1
  163. package/lib/utils/params.js +1 -1
  164. package/lib/utils/positive-safe-integer.d.ts +5 -0
  165. package/lib/utils/positive-safe-integer.js +1 -0
  166. package/lib/utils/redaction.d.ts +17 -0
  167. package/lib/utils/redaction.js +1 -0
  168. package/lib/utils/update-notice.js +1 -1
  169. package/lib/utils/version.js +1 -1
  170. package/lib/utils/write-cli-side-channel.js +1 -1
  171. package/package.json +1 -1
  172. package/skills/lovrabet/SKILL.md +3 -2
  173. package/skills/lovrabet/references/lovrabet-approval-workflow.md +73 -0
  174. package/skills/lovrabet.manifest.json +4 -3
@@ -1 +1 @@
1
- function a55_0x34b9(_0x4a88e9,_0x28b955){_0x4a88e9=_0x4a88e9-0x19d;const _0x1596c3=a55_0x1596();let _0x34b9a3=_0x1596c3[_0x4a88e9];return _0x34b9a3;}const a55_0x48524b=a55_0x34b9;(function(_0x4ebcc8,_0x537184){const _0xee9843=a55_0x34b9,_0x176606=_0x4ebcc8();while(!![]){try{const _0x3a4b11=parseInt(_0xee9843(0x19d))/0x1+parseInt(_0xee9843(0x1b0))/0x2*(parseInt(_0xee9843(0x19f))/0x3)+parseInt(_0xee9843(0x1ae))/0x4+parseInt(_0xee9843(0x1b9))/0x5*(-parseInt(_0xee9843(0x1aa))/0x6)+-parseInt(_0xee9843(0x1b8))/0x7*(parseInt(_0xee9843(0x1af))/0x8)+parseInt(_0xee9843(0x1a0))/0x9*(parseInt(_0xee9843(0x1a3))/0xa)+-parseInt(_0xee9843(0x1b3))/0xb*(parseInt(_0xee9843(0x1a6))/0xc);if(_0x3a4b11===_0x537184)break;else _0x176606['push'](_0x176606['shift']());}catch(_0x2b4cf8){_0x176606['push'](_0x176606['shift']());}}}(a55_0x1596,0xae3f7));import{updateRuntimeAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,readOptionalRuntimeRoleCode,ROLE_CODE_FLAG,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';function updateFields(_0x3cb99a){const _0x11dbc5=a55_0x34b9,_0x2d77a8=_0x3cb99a[_0x11dbc5(0x1a1)](_0x11dbc5(0x1a2))!==undefined,_0x5dfef6=_0x3cb99a[_0x11dbc5(0x1a1)](_0x11dbc5(0x1b5))!==undefined,_0x1e91df=_0x3cb99a['flag'](_0x11dbc5(0x1b7))!==undefined;if(!_0x2d77a8&&!_0x5dfef6&&!_0x1e91df)throw CliErrors['validation'](_0x11dbc5(0x1a4));const _0xc093fd=readOptionalRuntimeRoleCode(_0x3cb99a),_0x3cca83=_0x3cb99a[_0x11dbc5(0x19e)](_0x11dbc5(0x1b5))[_0x11dbc5(0x1b2)](),_0x41887f=_0x3cb99a[_0x11dbc5(0x19e)]('remark')[_0x11dbc5(0x1b2)]();if(_0x5dfef6&&!_0x3cca83)throw CliErrors[_0x11dbc5(0x1bf)]('--name\x20must\x20not\x20be\x20blank.');if(_0x1e91df&&!_0x41887f)throw CliErrors[_0x11dbc5(0x1bf)](_0x11dbc5(0x1ac),_0x11dbc5(0x1b4));return{..._0xc093fd?{'roleCode':_0xc093fd}:{},..._0x5dfef6?{'roleName':_0x3cca83}:{},..._0x1e91df?{'remark':_0x41887f}:{}};}async function prepare(_0x2b0719){const _0x2b74ec=a55_0x34b9,_0x28ad5e=await getRuntimeRoleById(_0x2b0719[_0x2b74ec(0x1b1)],_0x2b0719[_0x2b74ec(0x1a7)]('id'));return assertCustomRuntimeRole(_0x28ad5e,_0x2b74ec(0x1bc)),{'role':_0x28ad5e,'body':{'id':_0x28ad5e['id'],'appCode':_0x2b0719[_0x2b74ec(0x1b1)],...updateFields(_0x2b0719)}};}function a55_0x1596(){const _0x2c3692=['name','Preview:\x20update\x20a\x20runtime\x20CUSTOM\x20role','remark','7VrcrEA','1291205mPxhiJ','high-risk-write','string','update','role','New\x20non-empty\x20role\x20remark','validation','101404YPiBRl','str','2833491cluAFI','8919VlLJLp','flag','role-code','11350SQmfJy','Pass\x20--role-code,\x20--name,\x20or\x20--remark\x20to\x20update\x20the\x20runtime\x20role.','Update\x20a\x20runtime\x20CUSTOM\x20role\x27s\x20code,\x20name,\x20or\x20remark','132aNCaUA','num','New\x20role\x20name','body','6dqKiLA','/client/permit/role/update','--remark\x20must\x20not\x20be\x20blank.','POST','4967656upPhhs','6093768sAsfMF','2YhnFDL','appCode','trim','1678919vYSKVV','The\x20current\x20runtime\x20role\x20API\x20does\x20not\x20support\x20clearing\x20an\x20existing\x20remark.'];a55_0x1596=function(){return _0x2c3692;};return a55_0x1596();}export const roleUpdate={'service':a55_0x48524b(0x1bd),'command':'update','description':a55_0x48524b(0x1a5),'risk':a55_0x48524b(0x1ba),'confirmationDescription':'Changes\x20the\x20custom\x20role\x20code,\x20name,\x20or\x20note\x20in\x20the\x20current\x20runtime\x20app.\x20The\x20role\x20updates\x20immediately.','flags':[ROLE_ID_FLAG,ROLE_CODE_FLAG,{'name':'name','type':a55_0x48524b(0x1bb),'description':a55_0x48524b(0x1a8)},{'name':a55_0x48524b(0x1b7),'type':a55_0x48524b(0x1bb),'description':a55_0x48524b(0x1be)}],async 'validate'(_0x54e6f4){updateFields(_0x54e6f4);},async 'dryRun'(_0x1586a8){const _0x1fb363=a55_0x48524b,{body:_0x88682c}=await prepare(_0x1586a8);return dryRun(_0x1fb363(0x1ad),'/client/permit/role/update')[_0x1fb363(0x1a9)](_0x88682c)['description'](_0x1fb363(0x1b6))['build']();},async 'execute'(_0x39c39c){const _0x9bc01a=a55_0x48524b,{role:_0xa78f53,body:_0x5b0900}=await prepare(_0x39c39c),_0x3f62d2=await updateRuntimeAppRole(_0x5b0900);return{'ok':!![],'data':runtimeRoleWriteResult(_0x9bc01a(0x1bc),{'roleId':_0xa78f53['id']},projectRuntimeRole(_0xa78f53),projectRuntimeRole(_0x3f62d2),{'method':_0x9bc01a(0x1ad),'path':_0x9bc01a(0x1ab)})};}};
1
+ const a56_0x4d968c=a56_0x2836;(function(_0x391202,_0xdf062d){const _0x5daaf1=a56_0x2836,_0x427a86=_0x391202();while(!![]){try{const _0x90bdba=-parseInt(_0x5daaf1(0xb9))/0x1+-parseInt(_0x5daaf1(0xa9))/0x2*(-parseInt(_0x5daaf1(0xbb))/0x3)+-parseInt(_0x5daaf1(0xbf))/0x4+-parseInt(_0x5daaf1(0xc2))/0x5+-parseInt(_0x5daaf1(0xac))/0x6*(-parseInt(_0x5daaf1(0xa3))/0x7)+parseInt(_0x5daaf1(0xaf))/0x8*(-parseInt(_0x5daaf1(0xb6))/0x9)+parseInt(_0x5daaf1(0xa4))/0xa;if(_0x90bdba===_0xdf062d)break;else _0x427a86['push'](_0x427a86['shift']());}catch(_0x2a155e){_0x427a86['push'](_0x427a86['shift']());}}}(a56_0x3eed,0xe7220));import{updateRuntimeAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a56_0x3eed(){const _0x5d8a63=['172539UuyYMg','Preview:\x20update\x20a\x20runtime\x20CUSTOM\x20role','name','971567DBljny','trim','9FqtkOe','str','Update\x20a\x20runtime\x20CUSTOM\x20role\x27s\x20code,\x20name,\x20or\x20remark','The\x20current\x20runtime\x20role\x20API\x20does\x20not\x20support\x20clearing\x20an\x20existing\x20remark.','1351936GQTYOs','--remark\x20must\x20not\x20be\x20blank.','Pass\x20--role-code,\x20--name,\x20or\x20--remark\x20to\x20update\x20the\x20runtime\x20role.','1243725kXNILF','633654kjlUhA','23615370AZKzYA','build','body','New\x20role\x20name','role-code','10510cQnfTz','update','/client/permit/role/update','72SKBomj','flag','remark','400aLltMq','string','New\x20non-empty\x20role\x20remark','POST','--name\x20must\x20not\x20be\x20blank.','validation','appCode'];a56_0x3eed=function(){return _0x5d8a63;};return a56_0x3eed();}import{dryRun}from'../../framework/dryrun.js';import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,readOptionalRuntimeRoleCode,ROLE_CODE_FLAG,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';function updateFields(_0x2789b2){const _0x44c66d=a56_0x2836,_0x16902f=_0x2789b2[_0x44c66d(0xad)](_0x44c66d(0xa8))!==undefined,_0xcf8652=_0x2789b2[_0x44c66d(0xad)](_0x44c66d(0xb8))!==undefined,_0x32436e=_0x2789b2[_0x44c66d(0xad)](_0x44c66d(0xae))!==undefined;if(!_0x16902f&&!_0xcf8652&&!_0x32436e)throw CliErrors[_0x44c66d(0xb4)](_0x44c66d(0xc1));const _0x2ef645=readOptionalRuntimeRoleCode(_0x2789b2),_0x465130=_0x2789b2[_0x44c66d(0xbc)](_0x44c66d(0xb8))[_0x44c66d(0xba)](),_0x5ea7f0=_0x2789b2[_0x44c66d(0xbc)](_0x44c66d(0xae))[_0x44c66d(0xba)]();if(_0xcf8652&&!_0x465130)throw CliErrors[_0x44c66d(0xb4)](_0x44c66d(0xb3));if(_0x32436e&&!_0x5ea7f0)throw CliErrors[_0x44c66d(0xb4)](_0x44c66d(0xc0),_0x44c66d(0xbe));return{..._0x2ef645?{'roleCode':_0x2ef645}:{},..._0xcf8652?{'roleName':_0x465130}:{},..._0x32436e?{'remark':_0x5ea7f0}:{}};}function a56_0x2836(_0x955849,_0x47a293){_0x955849=_0x955849-0xa3;const _0x3eeda3=a56_0x3eed();let _0x283644=_0x3eeda3[_0x955849];return _0x283644;}async function prepare(_0xef0dc2){const _0x4f4231=a56_0x2836,_0x2eedd3=await getRuntimeRoleById(_0xef0dc2[_0x4f4231(0xb5)],_0xef0dc2['num']('id'));return assertCustomRuntimeRole(_0x2eedd3,_0x4f4231(0xaa)),{'role':_0x2eedd3,'body':{'id':_0x2eedd3['id'],'appCode':_0xef0dc2['appCode'],...updateFields(_0xef0dc2)}};}export const roleUpdate={'service':'role','command':a56_0x4d968c(0xaa),'description':a56_0x4d968c(0xbd),'risk':'high-risk-write','confirmationDescription':'Changes\x20the\x20custom\x20role\x20code,\x20name,\x20or\x20note\x20in\x20the\x20current\x20runtime\x20app.\x20The\x20role\x20updates\x20immediately.','flags':[ROLE_ID_FLAG,ROLE_CODE_FLAG,{'name':a56_0x4d968c(0xb8),'type':a56_0x4d968c(0xb0),'description':a56_0x4d968c(0xa7)},{'name':a56_0x4d968c(0xae),'type':a56_0x4d968c(0xb0),'description':a56_0x4d968c(0xb1)}],async 'validate'(_0x97c9aa){updateFields(_0x97c9aa);},async 'dryRun'(_0x3f20ab){const _0x22204c=a56_0x4d968c,{body:_0xadd776}=await prepare(_0x3f20ab);return dryRun(_0x22204c(0xb2),_0x22204c(0xab))[_0x22204c(0xa6)](_0xadd776)['description'](_0x22204c(0xb7))[_0x22204c(0xa5)]();},async 'execute'(_0x5bd9bc){const _0x37cbd9=a56_0x4d968c,{role:_0x420230,body:_0x2787ea}=await prepare(_0x5bd9bc),_0x414064=await updateRuntimeAppRole(_0x2787ea);return{'ok':!![],'data':runtimeRoleWriteResult(_0x37cbd9(0xaa),{'roleId':_0x420230['id']},projectRuntimeRole(_0x420230),projectRuntimeRole(_0x414064),{'method':'POST','path':'/client/permit/role/update'})};}};
@@ -1 +1 @@
1
- function a56_0xdad2(_0x5b8e51,_0x3c9680){_0x5b8e51=_0x5b8e51-0xe7;const _0x120cc6=a56_0x120c();let _0xdad21a=_0x120cc6[_0x5b8e51];return _0xdad21a;}function a56_0x120c(){const _0x71c4be=['6738830RjMlqA','3997050IzlfNn','120568wakQcJ','shouldWrite','231740liYnos','/client/permit/user-role/update-user-list','description','roleList','after','before','1572627zooVUL','body','1585dBuNeH','176eBeycQ','appCode','Add\x20a\x20numeric\x20userId\x20to\x20one\x20runtime\x20role','build','high-risk-write','warnings','Adds\x20the\x20given\x20runtime\x20user\x20to\x20the\x20target\x20role.\x20The\x20user\x20receives\x20the\x20permissions\x20of\x20that\x20role.','400820yJhYXE','role','user-add','15444cCxKnd','18hsvqOJ','POST'];a56_0x120c=function(){return _0x71c4be;};return a56_0x120c();}const a56_0x1cfaee=a56_0xdad2;(function(_0x13c399,_0x229b90){const _0x14985e=a56_0xdad2,_0x36f067=_0x13c399();while(!![]){try{const _0x1edff7=-parseInt(_0x14985e(0xe9))/0x1+parseInt(_0x14985e(0xf3))/0x2+-parseInt(_0x14985e(0xf9))/0x3+-parseInt(_0x14985e(0xec))/0x4*(-parseInt(_0x14985e(0xfb))/0x5)+-parseInt(_0x14985e(0xf0))/0x6+-parseInt(_0x14985e(0xf1))/0x7*(parseInt(_0x14985e(0xfc))/0x8)+parseInt(_0x14985e(0xed))/0x9*(parseInt(_0x14985e(0xef))/0xa);if(_0x1edff7===_0x229b90)break;else _0x36f067['push'](_0x36f067['shift']());}catch(_0xd5e4c0){_0x36f067['push'](_0x36f067['shift']());}}}(a56_0x120c,0xaf281));import{updateRuntimeRoleUsers}from'../../core/api-client.js';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':a56_0x1cfaee(0xea),'command':a56_0x1cfaee(0xeb),'description':a56_0x1cfaee(0xfe),'risk':a56_0x1cfaee(0x100),'confirmationDescription':a56_0x1cfaee(0xe8),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x57234a){const _0x5240fa=a56_0x1cfaee,_0x5f2f44=await prepareRuntimeMemberMutation(_0x57234a,'user-add');return dryRun(_0x5240fa(0xee),_0x5240fa(0xf4))[_0x5240fa(0xfa)]({'appCode':_0x57234a[_0x5240fa(0xfd)],'roleList':_0x5f2f44[_0x5240fa(0xf6)]})[_0x5240fa(0xf5)](_0x5f2f44['shouldWrite']?'Preview:\x20add\x20runtime\x20role\x20member':_0x5f2f44[_0x5240fa(0xe7)][0x0])[_0x5240fa(0xff)]();},async 'execute'(_0x3d6d10){const _0x432c8e=a56_0x1cfaee,_0x116bf2=await prepareRuntimeMemberMutation(_0x3d6d10,_0x432c8e(0xeb));return _0x116bf2[_0x432c8e(0xf2)]&&await updateRuntimeRoleUsers(_0x3d6d10['appCode'],_0x116bf2[_0x432c8e(0xf6)]),{'ok':!![],'data':runtimeRoleWriteResult(_0x432c8e(0xeb),{'roleId':_0x116bf2['role']['id'],'userId':_0x116bf2['userId']},_0x116bf2[_0x432c8e(0xf8)],_0x116bf2[_0x432c8e(0xf7)],{'method':_0x432c8e(0xee),'path':_0x432c8e(0xf4)},_0x116bf2[_0x432c8e(0xe7)])};}};
1
+ const a57_0x1a4791=a57_0x5627;function a57_0x14ef(){const _0x14c3f6=['7PNSMbM','32VtnYFO','869678KpLaDq','9164UVFkeU','description','high-risk-write','1hRnckM','warnings','after','build','userId','user-add','27137SMggVD','1521114PaYxdb','/client/permit/user-role/update-user-list','820503gsBqiN','3522790RsWNYS','shouldWrite','845QDWOqV','role','1572lHyPXN','Adds\x20the\x20given\x20runtime\x20user\x20to\x20the\x20target\x20role.\x20The\x20user\x20receives\x20the\x20permissions\x20of\x20that\x20role.','roleList','Add\x20a\x20numeric\x20userId\x20to\x20one\x20runtime\x20role','appCode','before','1434303fuFFnA'];a57_0x14ef=function(){return _0x14c3f6;};return a57_0x14ef();}function a57_0x5627(_0x37d700,_0xb625a5){_0x37d700=_0x37d700-0x1a4;const _0x14ef3f=a57_0x14ef();let _0x5627db=_0x14ef3f[_0x37d700];return _0x5627db;}(function(_0x4e219f,_0x3aa165){const _0x4edd15=a57_0x5627,_0x153e21=_0x4e219f();while(!![]){try{const _0x55ba8a=-parseInt(_0x4edd15(0x1b8))/0x1*(-parseInt(_0x4edd15(0x1b4))/0x2)+-parseInt(_0x4edd15(0x1b1))/0x3+parseInt(_0x4edd15(0x1b5))/0x4*(parseInt(_0x4edd15(0x1a9))/0x5)+parseInt(_0x4edd15(0x1a4))/0x6*(parseInt(_0x4edd15(0x1b2))/0x7)+-parseInt(_0x4edd15(0x1b3))/0x8*(parseInt(_0x4edd15(0x1a6))/0x9)+parseInt(_0x4edd15(0x1a7))/0xa+-parseInt(_0x4edd15(0x1be))/0xb*(parseInt(_0x4edd15(0x1ab))/0xc);if(_0x55ba8a===_0x3aa165)break;else _0x153e21['push'](_0x153e21['shift']());}catch(_0x277273){_0x153e21['push'](_0x153e21['shift']());}}}(a57_0x14ef,0x3feee));import{updateRuntimeRoleUsers}from'../../core/api-client.js';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':a57_0x1a4791(0x1aa),'command':a57_0x1a4791(0x1bd),'description':a57_0x1a4791(0x1ae),'risk':a57_0x1a4791(0x1b7),'confirmationDescription':a57_0x1a4791(0x1ac),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0xf6a049){const _0x399ebe=a57_0x1a4791,_0x323f60=await prepareRuntimeMemberMutation(_0xf6a049,'user-add');return dryRun('POST',_0x399ebe(0x1a5))['body']({'appCode':_0xf6a049[_0x399ebe(0x1af)],'roleList':_0x323f60[_0x399ebe(0x1ad)]})[_0x399ebe(0x1b6)](_0x323f60['shouldWrite']?'Preview:\x20add\x20runtime\x20role\x20member':_0x323f60['warnings'][0x0])[_0x399ebe(0x1bb)]();},async 'execute'(_0x26514d){const _0x45d106=a57_0x1a4791,_0x5de626=await prepareRuntimeMemberMutation(_0x26514d,_0x45d106(0x1bd));return _0x5de626[_0x45d106(0x1a8)]&&await updateRuntimeRoleUsers(_0x26514d['appCode'],_0x5de626[_0x45d106(0x1ad)]),{'ok':!![],'data':runtimeRoleWriteResult('user-add',{'roleId':_0x5de626['role']['id'],'userId':_0x5de626[_0x45d106(0x1bc)]},_0x5de626[_0x45d106(0x1b0)],_0x5de626[_0x45d106(0x1ba)],{'method':'POST','path':_0x45d106(0x1a5)},_0x5de626[_0x45d106(0x1b9)])};}};
@@ -1 +1 @@
1
- const a57_0x198a0a=a57_0x19a1;function a57_0x2b68(){const _0x58a48c=['body','5911941fDiiVb','10wWDOBw','8JimDuI','role','high-risk-write','user-remove','after','102CcNLdv','before','shouldWrite','POST','build','2013261XdeanA','userId','24mxPCZa','description','roleList','2392rTGAPA','/client/permit/user-role/update-user-list','86JgTLow','8520354moHxNo','154mXDxKo','81265bQdkhD','Remove\x20a\x20numeric\x20userId\x20from\x20one\x20runtime\x20role','appCode','warnings','870818lCbBvo','Preview:\x20remove\x20runtime\x20role\x20member','4uxdulG','5907682qioGQA'];a57_0x2b68=function(){return _0x58a48c;};return a57_0x2b68();}(function(_0x5d3dd3,_0x5c4bc1){const _0x3aeee2=a57_0x19a1,_0x158753=_0x5d3dd3();while(!![]){try{const _0x4981f5=parseInt(_0x3aeee2(0x1d5))/0x1*(parseInt(_0x3aeee2(0x1d7))/0x2)+-parseInt(_0x3aeee2(0x1d0))/0x3*(parseInt(_0x3aeee2(0x1e0))/0x4)+-parseInt(_0x3aeee2(0x1da))/0x5*(parseInt(_0x3aeee2(0x1cb))/0x6)+-parseInt(_0x3aeee2(0x1c4))/0x7*(-parseInt(_0x3aeee2(0x1c6))/0x8)+-parseInt(_0x3aeee2(0x1d8))/0x9*(-parseInt(_0x3aeee2(0x1c5))/0xa)+parseInt(_0x3aeee2(0x1c2))/0xb*(-parseInt(_0x3aeee2(0x1d2))/0xc)+-parseInt(_0x3aeee2(0x1de))/0xd*(-parseInt(_0x3aeee2(0x1d9))/0xe);if(_0x4981f5===_0x5c4bc1)break;else _0x158753['push'](_0x158753['shift']());}catch(_0x4b8d72){_0x158753['push'](_0x158753['shift']());}}}(a57_0x2b68,0x94cb3));import{updateRuntimeRoleUsers}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';function a57_0x19a1(_0x3e5b85,_0x182fad){_0x3e5b85=_0x3e5b85-0x1c2;const _0x2b68d2=a57_0x2b68();let _0x19a1c8=_0x2b68d2[_0x3e5b85];return _0x19a1c8;}export const roleUserRemove={'service':a57_0x198a0a(0x1c7),'command':a57_0x198a0a(0x1c9),'description':a57_0x198a0a(0x1db),'risk':a57_0x198a0a(0x1c8),'confirmationDescription':'Removes\x20the\x20given\x20runtime\x20user\x20from\x20the\x20target\x20role.\x20The\x20user\x20loses\x20permissions\x20granted\x20only\x20by\x20that\x20role.','flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x2470d2){const _0x5d0f1c=a57_0x198a0a,_0x2259b6=await prepareRuntimeMemberMutation(_0x2470d2,_0x5d0f1c(0x1c9));return dryRun(_0x5d0f1c(0x1ce),_0x5d0f1c(0x1d6))[_0x5d0f1c(0x1c3)]({'appCode':_0x2470d2[_0x5d0f1c(0x1dc)],'roleList':_0x2259b6[_0x5d0f1c(0x1d4)]})[_0x5d0f1c(0x1d3)](_0x2259b6[_0x5d0f1c(0x1cd)]?_0x5d0f1c(0x1df):_0x2259b6['warnings'][0x0])[_0x5d0f1c(0x1cf)]();},async 'execute'(_0x4406df){const _0x3e051b=a57_0x198a0a,_0x14cda5=await prepareRuntimeMemberMutation(_0x4406df,_0x3e051b(0x1c9));return _0x14cda5['shouldWrite']&&await updateRuntimeRoleUsers(_0x4406df[_0x3e051b(0x1dc)],_0x14cda5[_0x3e051b(0x1d4)]),{'ok':!![],'data':runtimeRoleWriteResult(_0x3e051b(0x1c9),{'roleId':_0x14cda5[_0x3e051b(0x1c7)]['id'],'userId':_0x14cda5[_0x3e051b(0x1d1)]},_0x14cda5[_0x3e051b(0x1cc)],_0x14cda5[_0x3e051b(0x1ca)],{'method':_0x3e051b(0x1ce),'path':_0x3e051b(0x1d6)},_0x14cda5[_0x3e051b(0x1dd)])};}};
1
+ function a58_0x52b0(_0x69f539,_0x1a3e6f){_0x69f539=_0x69f539-0x84;const _0xe604da=a58_0xe604();let _0x52b08e=_0xe604da[_0x69f539];return _0x52b08e;}const a58_0x7ed71b=a58_0x52b0;function a58_0xe604(){const _0x570c21=['POST','6rMBzta','1234247AEqixt','/client/permit/user-role/update-user-list','role','9nWsMvl','build','appCode','3629400BLunBV','before','3TdkOlz','1093568Aulknw','1131128PYLalk','Removes\x20the\x20given\x20runtime\x20user\x20from\x20the\x20target\x20role.\x20The\x20user\x20loses\x20permissions\x20granted\x20only\x20by\x20that\x20role.','Remove\x20a\x20numeric\x20userId\x20from\x20one\x20runtime\x20role','warnings','high-risk-write','after','369004oLHfWc','userId','644870PMhvpk','146994KMxJWM','user-remove','roleList'];a58_0xe604=function(){return _0x570c21;};return a58_0xe604();}(function(_0x137cfb,_0x9384e5){const _0xf87222=a58_0x52b0,_0x4a00e1=_0x137cfb();while(!![]){try{const _0x2660cd=parseInt(_0xf87222(0x96))/0x1+-parseInt(_0xf87222(0x99))/0x2+parseInt(_0xf87222(0x8e))/0x3*(-parseInt(_0xf87222(0x8f))/0x4)+parseInt(_0xf87222(0x98))/0x5+-parseInt(_0xf87222(0x85))/0x6*(parseInt(_0xf87222(0x86))/0x7)+-parseInt(_0xf87222(0x90))/0x8+-parseInt(_0xf87222(0x89))/0x9*(-parseInt(_0xf87222(0x8c))/0xa);if(_0x2660cd===_0x9384e5)break;else _0x4a00e1['push'](_0x4a00e1['shift']());}catch(_0x4ff58e){_0x4a00e1['push'](_0x4a00e1['shift']());}}}(a58_0xe604,0x2fedd));import{updateRuntimeRoleUsers}from'../../core/api-client.js';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 roleUserRemove={'service':a58_0x7ed71b(0x88),'command':a58_0x7ed71b(0x9a),'description':a58_0x7ed71b(0x92),'risk':a58_0x7ed71b(0x94),'confirmationDescription':a58_0x7ed71b(0x91),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x1d76f8){const _0x47bceb=a58_0x7ed71b,_0x33e9b9=await prepareRuntimeMemberMutation(_0x1d76f8,_0x47bceb(0x9a));return dryRun('POST','/client/permit/user-role/update-user-list')['body']({'appCode':_0x1d76f8[_0x47bceb(0x8b)],'roleList':_0x33e9b9['roleList']})['description'](_0x33e9b9['shouldWrite']?'Preview:\x20remove\x20runtime\x20role\x20member':_0x33e9b9[_0x47bceb(0x93)][0x0])[_0x47bceb(0x8a)]();},async 'execute'(_0x341d39){const _0x1d64e2=a58_0x7ed71b,_0x2d7907=await prepareRuntimeMemberMutation(_0x341d39,_0x1d64e2(0x9a));return _0x2d7907['shouldWrite']&&await updateRuntimeRoleUsers(_0x341d39[_0x1d64e2(0x8b)],_0x2d7907[_0x1d64e2(0x9b)]),{'ok':!![],'data':runtimeRoleWriteResult(_0x1d64e2(0x9a),{'roleId':_0x2d7907['role']['id'],'userId':_0x2d7907[_0x1d64e2(0x97)]},_0x2d7907[_0x1d64e2(0x8d)],_0x2d7907[_0x1d64e2(0x95)],{'method':_0x1d64e2(0x84),'path':_0x1d64e2(0x87)},_0x2d7907['warnings'])};}};
@@ -1 +1 @@
1
- const a58_0x59d16c=a58_0x4553;(function(_0x31e051,_0x5cdae3){const _0x16e626=a58_0x4553,_0x403255=_0x31e051();while(!![]){try{const _0x19577a=-parseInt(_0x16e626(0x1a2))/0x1*(-parseInt(_0x16e626(0x1b2))/0x2)+parseInt(_0x16e626(0x19b))/0x3+-parseInt(_0x16e626(0x190))/0x4*(parseInt(_0x16e626(0x1af))/0x5)+-parseInt(_0x16e626(0x1ac))/0x6*(parseInt(_0x16e626(0x1a7))/0x7)+parseInt(_0x16e626(0x177))/0x8+-parseInt(_0x16e626(0x19e))/0x9+parseInt(_0x16e626(0x185))/0xa*(parseInt(_0x16e626(0x18f))/0xb);if(_0x19577a===_0x5cdae3)break;else _0x403255['push'](_0x403255['shift']());}catch(_0x2b6c94){_0x403255['push'](_0x403255['shift']());}}}(a58_0x22c8,0x4b830));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':'kind','type':a58_0x59d16c(0x181),'required':!![],'enum':[a58_0x59d16c(0x1ab),a58_0x59d16c(0x1a8)],'description':'Schedule\x20kind:\x20CRON\x20or\x20ONCE'},CRON_FLAG={'name':'cron','type':a58_0x59d16c(0x181),'description':'Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules'},SCHEDULED_AT_FLAG={'name':a58_0x59d16c(0x196),'type':a58_0x59d16c(0x181),'description':'Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules'},TITLE_FLAG={'name':a58_0x59d16c(0x179),'type':a58_0x59d16c(0x181),'required':!![],'description':a58_0x59d16c(0x1b3)},PROMPT_FLAG={'name':a58_0x59d16c(0x18d),'type':a58_0x59d16c(0x181),'required':!![],'description':a58_0x59d16c(0x18a)},MODEL_FLAG={'name':'model','type':a58_0x59d16c(0x181),'enum':['kimi/k3',a58_0x59d16c(0x187),a58_0x59d16c(0x1a5)],'default':'deepseek-v4-flash-0731','description':a58_0x59d16c(0x1b8)},SCHEDULE_ID_FLAG={'name':a58_0x59d16c(0x19f),'type':'string','required':!![],'description':'Schedule\x20UUID','pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a58_0x59d16c(0x176)}},LIMIT_FLAG={'name':a58_0x59d16c(0x188),'type':'number','default':0x14,'description':a58_0x59d16c(0x19c)},CURSOR_FLAG={'name':'cursor','type':a58_0x59d16c(0x181),'description':a58_0x59d16c(0x1a4)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function readScheduleInput(_0x5b5f8c){const _0x53c6b8=a58_0x59d16c,_0x1ef49e=_0x5b5f8c['str'](_0x53c6b8(0x1b7)),_0x4a8757=_0x5b5f8c[_0x53c6b8(0x183)](_0x53c6b8(0x179))['trim'](),_0x40e6c2=_0x5b5f8c[_0x53c6b8(0x183)](_0x53c6b8(0x18d))[_0x53c6b8(0x17d)](),_0x47692e=_0x5b5f8c['str']('model'),_0x1463c6=_0x5b5f8c[_0x53c6b8(0x183)](_0x53c6b8(0x1ad)),_0x2c3334=_0x5b5f8c[_0x53c6b8(0x183)](_0x53c6b8(0x196));if(!_0x4a8757)throw CliErrors['validation'](_0x53c6b8(0x18c));if(!_0x40e6c2)throw CliErrors[_0x53c6b8(0x17c)]('--prompt\x20must\x20not\x20be\x20blank.');if(_0x1ef49e===_0x53c6b8(0x1ab)){if(!_0x1463c6||_0x2c3334)throw CliErrors[_0x53c6b8(0x17c)]('CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.');return{'kind':_0x1ef49e,'timezone':_0x53c6b8(0x1b1),'cron':_0x1463c6,'title':_0x4a8757,'prompt':_0x40e6c2,'model':_0x47692e};}if(_0x1ef49e===_0x53c6b8(0x1a8)){if(!_0x2c3334||_0x1463c6)throw CliErrors[_0x53c6b8(0x17c)](_0x53c6b8(0x197));return{'kind':_0x1ef49e,'timezone':_0x53c6b8(0x1b1),'scheduledAt':_0x2c3334,'title':_0x4a8757,'prompt':_0x40e6c2,'model':_0x47692e};}throw CliErrors[_0x53c6b8(0x17c)](_0x53c6b8(0x1a9));}function scheduleCollectionPath(_0x10bb7c){const _0x1d34ff=a58_0x59d16c;return _0x1d34ff(0x184)+encodeURIComponent(_0x10bb7c)+_0x1d34ff(0x1a1);}function a58_0x22c8(){const _0x439b13=['224kFgDDL','Queued\x20Task\x20','DELETE','Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.','detail','Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.','scheduled-at','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','taskId','num','121380fSYsxN','Page\x20size\x20from\x201\x20to\x20100','POST','2115045RhxbQV','schedule-id','description','/schedules','168698jWZkDF','Preview:\x20run\x20schedule\x20','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','deepseek-v4-pro-0813','create','49kpnzPz','ONCE','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','appCode','CRON','309108GiaaVI','cron','high-risk-write','22545YaojYo','Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','UTC','6VgrEdI','Schedule\x20title','list','cursor','read','kind','Task\x20model\x20used\x20when\x20the\x20schedule\x20runs','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','Deleted\x20schedule\x20','schedule','/run','Creates\x20a\x20schedule\x20in\x20the\x20current\x20app\x20that\x20can\x20auto-trigger\x20an\x20Agent.\x20At\x20the\x20scheduled\x20time\x20a\x20Task\x20is\x20created\x20and\x20run.','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','4015912FRAodw','Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','title','validate','body','validation','trim','scheduleId','isSafeInteger','delete','string','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','str','/api/harness/apps/','10470DvzGED','\x20schedule\x20','deepseek-v4-flash-0731','limit','Created\x20','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','build','--title\x20must\x20not\x20be\x20blank.','prompt','\x20immediately','1144MSqtgk'];a58_0x22c8=function(){return _0x439b13;};return a58_0x22c8();}function a58_0x4553(_0x31cfed,_0x54ccf6){_0x31cfed=_0x31cfed-0x174;const _0x22c8a5=a58_0x22c8();let _0x455339=_0x22c8a5[_0x31cfed];return _0x455339;}function scheduleItemPath(_0x9a632d,_0x2c1900){return scheduleCollectionPath(_0x9a632d)+'/'+encodeURIComponent(_0x2c1900);}const scheduleValidate={'service':'schedule','command':a58_0x59d16c(0x17a),'description':a58_0x59d16c(0x1b9),'risk':a58_0x59d16c(0x1b6),'flags':INPUT_FLAGS,async 'validate'(_0x202b78){readScheduleInput(_0x202b78);},async 'execute'(_0x402b01){const _0x27a200=a58_0x59d16c,_0x580131=readScheduleInput(_0x402b01),_0x4ee8ad=await validateRuntimeSchedule(_0x402b01[_0x27a200(0x1aa)],_0x580131);return{'ok':!![],'data':_0x4ee8ad,'message':'Schedule\x20input\x20is\x20valid'};}},scheduleCreate={'service':a58_0x59d16c(0x1bb),'command':a58_0x59d16c(0x1a6),'description':a58_0x59d16c(0x1b0),'risk':a58_0x59d16c(0x1ae),'confirmationDescription':a58_0x59d16c(0x175),'flags':INPUT_FLAGS,async 'validate'(_0x3b2ff8){readScheduleInput(_0x3b2ff8);},async 'execute'(_0x2ec6cd){const _0x1d31fd=a58_0x59d16c,_0x25d788=readScheduleInput(_0x2ec6cd),_0x5767fb=await validateRuntimeSchedule(_0x2ec6cd[_0x1d31fd(0x1aa)],_0x25d788),_0x10eb7f=await createRuntimeSchedule(_0x2ec6cd[_0x1d31fd(0x1aa)],_0x5767fb);return{'ok':!![],'data':_0x10eb7f,'message':_0x1d31fd(0x189)+_0x10eb7f[_0x1d31fd(0x1b7)]+_0x1d31fd(0x186)+_0x10eb7f[_0x1d31fd(0x17e)]};},async 'dryRun'(_0x4711e6){const _0x2bb652=a58_0x59d16c,_0x418378=readScheduleInput(_0x4711e6);return dryRun('POST',scheduleCollectionPath(_0x4711e6['appCode']))[_0x2bb652(0x17b)](_0x418378)['description']('Preview:\x20create\x20an\x20Agent\x20schedule')['build']();}},scheduleList={'service':a58_0x59d16c(0x1bb),'command':a58_0x59d16c(0x1b4),'description':'List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','risk':a58_0x59d16c(0x1b6),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x280d0f){const _0x504ee6=a58_0x59d16c,_0x5ce417=_0x280d0f['num'](_0x504ee6(0x188));if(!Number[_0x504ee6(0x17f)](_0x5ce417)||_0x5ce417<0x1||_0x5ce417>0x64)throw CliErrors['validation'](_0x504ee6(0x182));const _0x3882af=_0x280d0f['str'](_0x504ee6(0x1b5));if(_0x3882af&&(_0x3882af['length']>0x400||_0x3882af[_0x504ee6(0x17d)]()!==_0x3882af))throw CliErrors['validation'](_0x504ee6(0x198));},async 'execute'(_0x5d4dfc){const _0x50332a=a58_0x59d16c,_0xdf595f=_0x5d4dfc['str'](_0x50332a(0x1b5)),_0xe10dd5=await listRuntimeSchedules(_0x5d4dfc[_0x50332a(0x1aa)],{'kind':_0x5d4dfc[_0x50332a(0x183)](_0x50332a(0x1b7)),'limit':_0x5d4dfc[_0x50332a(0x19a)]('limit'),..._0xdf595f?{'cursor':_0xdf595f}:{}});return{'ok':!![],'data':_0xe10dd5};}},scheduleDetail={'service':a58_0x59d16c(0x1bb),'command':a58_0x59d16c(0x194),'description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x1166e4){const _0x2c37ee=a58_0x59d16c,_0x3ec2bd=await getRuntimeSchedule(_0x1166e4[_0x2c37ee(0x1aa)],_0x1166e4[_0x2c37ee(0x183)](_0x2c37ee(0x19f)));return{'ok':!![],'data':_0x3ec2bd};}},scheduleRun={'service':a58_0x59d16c(0x1bb),'command':'run','description':'Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','risk':a58_0x59d16c(0x1ae),'confirmationDescription':a58_0x59d16c(0x193),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x50a750){const _0x4bce58=a58_0x59d16c,_0x3f3f49=_0x50a750['str'](_0x4bce58(0x19f)),_0xf9c64b=await runRuntimeSchedule(_0x50a750[_0x4bce58(0x1aa)],_0x3f3f49);return{'ok':!![],'data':_0xf9c64b,'message':_0x4bce58(0x191)+_0xf9c64b[_0x4bce58(0x199)]+'\x20from\x20schedule\x20'+_0x3f3f49};},async 'dryRun'(_0xcedcdb){const _0x30b32e=a58_0x59d16c,_0x41e40d=_0xcedcdb[_0x30b32e(0x183)](_0x30b32e(0x19f));return dryRun(_0x30b32e(0x19d),scheduleItemPath(_0xcedcdb[_0x30b32e(0x1aa)],_0x41e40d)+_0x30b32e(0x174))['description'](_0x30b32e(0x1a3)+_0x41e40d+_0x30b32e(0x18e))[_0x30b32e(0x18b)]();}},scheduleDelete={'service':a58_0x59d16c(0x1bb),'command':a58_0x59d16c(0x180),'description':a58_0x59d16c(0x178),'risk':a58_0x59d16c(0x1ae),'confirmationDescription':a58_0x59d16c(0x195),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0xb3cab1){const _0x3cf8da=a58_0x59d16c,_0x4a703b=_0xb3cab1[_0x3cf8da(0x183)](_0x3cf8da(0x19f)),_0x428cc3=await deleteRuntimeSchedule(_0xb3cab1[_0x3cf8da(0x1aa)],_0x4a703b);return{'ok':!![],'data':_0x428cc3,'message':_0x3cf8da(0x1ba)+_0x4a703b};},async 'dryRun'(_0x6bc6a5){const _0x503cb8=a58_0x59d16c,_0x5b4a17=_0x6bc6a5[_0x503cb8(0x183)](_0x503cb8(0x19f));return dryRun(_0x503cb8(0x192),scheduleItemPath(_0x6bc6a5[_0x503cb8(0x1aa)],_0x5b4a17))[_0x503cb8(0x1a0)]('Preview:\x20delete\x20schedule\x20'+_0x5b4a17)[_0x503cb8(0x18b)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
1
+ const a59_0x4c0a7e=a59_0x3e5d;(function(_0x386cfb,_0x455730){const _0x277651=a59_0x3e5d,_0x5b81c1=_0x386cfb();while(!![]){try{const _0x3bc51c=parseInt(_0x277651(0x1a7))/0x1*(parseInt(_0x277651(0x19c))/0x2)+parseInt(_0x277651(0x1b3))/0x3*(parseInt(_0x277651(0x1c3))/0x4)+-parseInt(_0x277651(0x1bc))/0x5*(parseInt(_0x277651(0x1ba))/0x6)+parseInt(_0x277651(0x184))/0x7+parseInt(_0x277651(0x190))/0x8*(-parseInt(_0x277651(0x1c5))/0x9)+-parseInt(_0x277651(0x1b9))/0xa+-parseInt(_0x277651(0x189))/0xb*(-parseInt(_0x277651(0x17e))/0xc);if(_0x3bc51c===_0x455730)break;else _0x5b81c1['push'](_0x5b81c1['shift']());}catch(_0x6c2802){_0x5b81c1['push'](_0x5b81c1['shift']());}}}(a59_0xf833,0x28e2e));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';function a59_0x3e5d(_0x7341ab,_0x448d10){_0x7341ab=_0x7341ab-0x176;const _0xf83329=a59_0xf833();let _0x3e5d40=_0xf83329[_0x7341ab];return _0x3e5d40;}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':a59_0x4c0a7e(0x180),'type':a59_0x4c0a7e(0x1a1),'required':!![],'enum':[a59_0x4c0a7e(0x1a3),'ONCE'],'description':'Schedule\x20kind:\x20CRON\x20or\x20ONCE'},CRON_FLAG={'name':a59_0x4c0a7e(0x19f),'type':a59_0x4c0a7e(0x1a1),'description':a59_0x4c0a7e(0x18d)},SCHEDULED_AT_FLAG={'name':a59_0x4c0a7e(0x194),'type':a59_0x4c0a7e(0x1a1),'description':a59_0x4c0a7e(0x17c)},TITLE_FLAG={'name':a59_0x4c0a7e(0x18c),'type':a59_0x4c0a7e(0x1a1),'required':!![],'description':a59_0x4c0a7e(0x1c4)},PROMPT_FLAG={'name':a59_0x4c0a7e(0x19b),'type':'string','required':!![],'description':a59_0x4c0a7e(0x1b7)},MODEL_FLAG={'name':'model','type':a59_0x4c0a7e(0x1a1),'enum':[a59_0x4c0a7e(0x178),a59_0x4c0a7e(0x182),a59_0x4c0a7e(0x1a9)],'default':a59_0x4c0a7e(0x182),'description':a59_0x4c0a7e(0x192)},SCHEDULE_ID_FLAG={'name':a59_0x4c0a7e(0x17a),'type':a59_0x4c0a7e(0x1a1),'required':!![],'description':a59_0x4c0a7e(0x1c7),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a59_0x4c0a7e(0x185)}},LIMIT_FLAG={'name':'limit','type':a59_0x4c0a7e(0x1a4),'default':0x14,'description':a59_0x4c0a7e(0x183)},CURSOR_FLAG={'name':'cursor','type':'string','description':a59_0x4c0a7e(0x17d)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function readScheduleInput(_0x12aadc){const _0x11405f=a59_0x4c0a7e,_0x9dc0a9=_0x12aadc[_0x11405f(0x188)](_0x11405f(0x180)),_0x7d7a96=_0x12aadc[_0x11405f(0x188)]('title')['trim'](),_0x2b4196=_0x12aadc[_0x11405f(0x188)](_0x11405f(0x19b))[_0x11405f(0x191)](),_0x5ce31e=_0x12aadc[_0x11405f(0x188)](_0x11405f(0x195)),_0x217895=_0x12aadc['str'](_0x11405f(0x19f)),_0x1bd710=_0x12aadc[_0x11405f(0x188)](_0x11405f(0x194));if(!_0x7d7a96)throw CliErrors['validation'](_0x11405f(0x1a5));if(!_0x2b4196)throw CliErrors[_0x11405f(0x19e)](_0x11405f(0x1c2));if(_0x9dc0a9===_0x11405f(0x1a3)){if(!_0x217895||_0x1bd710)throw CliErrors['validation'](_0x11405f(0x19d));return{'kind':_0x9dc0a9,'timezone':_0x11405f(0x1be),'cron':_0x217895,'title':_0x7d7a96,'prompt':_0x2b4196,'model':_0x5ce31e};}if(_0x9dc0a9===_0x11405f(0x187)){if(!_0x1bd710||_0x217895)throw CliErrors['validation'](_0x11405f(0x196));return{'kind':_0x9dc0a9,'timezone':_0x11405f(0x1be),'scheduledAt':_0x1bd710,'title':_0x7d7a96,'prompt':_0x2b4196,'model':_0x5ce31e};}throw CliErrors[_0x11405f(0x19e)](_0x11405f(0x17f));}function a59_0xf833(){const _0x3ae835=['--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','\x20immediately','taskId','Preview:\x20run\x20schedule\x20','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','111pcPaIJ','Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','Schedule\x20input\x20is\x20valid','run','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','DELETE','2997590JsYrTN','5676ZZAhHQ','POST','300qePfXm','length','UTC','detail','build','Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.','--prompt\x20must\x20not\x20be\x20blank.','33084WXwuOL','Schedule\x20title','1900251RaISNx','/schedules','Schedule\x20UUID','scheduleId','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','list','cursor','kimi/k3','validate','schedule-id','\x20schedule\x20','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','8160ZLvsuR','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','kind','Preview:\x20create\x20an\x20Agent\x20schedule','deepseek-v4-flash-0731','Page\x20size\x20from\x201\x20to\x20100','1042643sAbnYM','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','delete','ONCE','str','1859vkMVBT','read','/run','title','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','Creates\x20a\x20schedule\x20in\x20the\x20current\x20app\x20that\x20can\x20auto-trigger\x20an\x20Agent.\x20At\x20the\x20scheduled\x20time\x20a\x20Task\x20is\x20created\x20and\x20run.','Deleted\x20schedule\x20','8RkAgPU','trim','Task\x20model\x20used\x20when\x20the\x20schedule\x20runs','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','scheduled-at','model','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','appCode','/api/harness/apps/','high-risk-write','limit','prompt','330464vFPDnN','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','validation','cron','Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','string','Show\x20one\x20schedule\x20by\x20schedule\x20ID','CRON','number','--title\x20must\x20not\x20be\x20blank.','Queued\x20Task\x20','1uGbMRo','schedule','deepseek-v4-pro-0813','description','num','Created\x20','Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.'];a59_0xf833=function(){return _0x3ae835;};return a59_0xf833();}function scheduleCollectionPath(_0xa5da92){const _0x19219d=a59_0x4c0a7e;return _0x19219d(0x198)+encodeURIComponent(_0xa5da92)+_0x19219d(0x1c6);}function scheduleItemPath(_0x3a8d10,_0x1c515f){return scheduleCollectionPath(_0x3a8d10)+'/'+encodeURIComponent(_0x1c515f);}const scheduleValidate={'service':'schedule','command':a59_0x4c0a7e(0x179),'description':a59_0x4c0a7e(0x1b2),'risk':a59_0x4c0a7e(0x18a),'flags':INPUT_FLAGS,async 'validate'(_0x25fe37){readScheduleInput(_0x25fe37);},async 'execute'(_0x5cabe5){const _0x25109b=a59_0x4c0a7e,_0x36025d=readScheduleInput(_0x5cabe5),_0x1e75d7=await validateRuntimeSchedule(_0x5cabe5[_0x25109b(0x197)],_0x36025d);return{'ok':!![],'data':_0x1e75d7,'message':_0x25109b(0x1b5)};}},scheduleCreate={'service':a59_0x4c0a7e(0x1a8),'command':'create','description':a59_0x4c0a7e(0x1a0),'risk':'high-risk-write','confirmationDescription':a59_0x4c0a7e(0x18e),'flags':INPUT_FLAGS,async 'validate'(_0x1b14fe){readScheduleInput(_0x1b14fe);},async 'execute'(_0x2df3da){const _0x3a16e2=a59_0x4c0a7e,_0x26c9bd=readScheduleInput(_0x2df3da),_0xeb3774=await validateRuntimeSchedule(_0x2df3da['appCode'],_0x26c9bd),_0x3de0da=await createRuntimeSchedule(_0x2df3da[_0x3a16e2(0x197)],_0xeb3774);return{'ok':!![],'data':_0x3de0da,'message':_0x3a16e2(0x1ac)+_0x3de0da[_0x3a16e2(0x180)]+_0x3a16e2(0x17b)+_0x3de0da[_0x3a16e2(0x1c8)]};},async 'dryRun'(_0xb24efe){const _0x5770a4=a59_0x4c0a7e,_0x361e30=readScheduleInput(_0xb24efe);return dryRun(_0x5770a4(0x1bb),scheduleCollectionPath(_0xb24efe[_0x5770a4(0x197)]))['body'](_0x361e30)[_0x5770a4(0x1aa)](_0x5770a4(0x181))['build']();}},scheduleList={'service':a59_0x4c0a7e(0x1a8),'command':a59_0x4c0a7e(0x176),'description':a59_0x4c0a7e(0x193),'risk':a59_0x4c0a7e(0x18a),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x247dc9){const _0x3e3359=a59_0x4c0a7e,_0x2c25b0=_0x247dc9[_0x3e3359(0x1ab)]('limit');if(!Number['isSafeInteger'](_0x2c25b0)||_0x2c25b0<0x1||_0x2c25b0>0x64)throw CliErrors[_0x3e3359(0x19e)](_0x3e3359(0x1ae));const _0x39fcd0=_0x247dc9[_0x3e3359(0x188)](_0x3e3359(0x177));if(_0x39fcd0&&(_0x39fcd0[_0x3e3359(0x1bd)]>0x400||_0x39fcd0[_0x3e3359(0x191)]()!==_0x39fcd0))throw CliErrors[_0x3e3359(0x19e)](_0x3e3359(0x1c9));},async 'execute'(_0xf0ddf8){const _0x1e5f48=a59_0x4c0a7e,_0x459793=_0xf0ddf8[_0x1e5f48(0x188)](_0x1e5f48(0x177)),_0x37a48b=await listRuntimeSchedules(_0xf0ddf8[_0x1e5f48(0x197)],{'kind':_0xf0ddf8['str']('kind'),'limit':_0xf0ddf8[_0x1e5f48(0x1ab)](_0x1e5f48(0x19a)),..._0x459793?{'cursor':_0x459793}:{}});return{'ok':!![],'data':_0x37a48b};}},scheduleDetail={'service':a59_0x4c0a7e(0x1a8),'command':a59_0x4c0a7e(0x1bf),'description':a59_0x4c0a7e(0x1a2),'risk':a59_0x4c0a7e(0x18a),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x4bce05){const _0x21bef8=a59_0x4c0a7e,_0x8a8489=await getRuntimeSchedule(_0x4bce05[_0x21bef8(0x197)],_0x4bce05[_0x21bef8(0x188)]('schedule-id'));return{'ok':!![],'data':_0x8a8489};}},scheduleRun={'service':a59_0x4c0a7e(0x1a8),'command':a59_0x4c0a7e(0x1b6),'description':'Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','risk':a59_0x4c0a7e(0x199),'confirmationDescription':a59_0x4c0a7e(0x1ad),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x160bab){const _0x5e34e8=a59_0x4c0a7e,_0x32f067=_0x160bab['str']('schedule-id'),_0x3789b7=await runRuntimeSchedule(_0x160bab[_0x5e34e8(0x197)],_0x32f067);return{'ok':!![],'data':_0x3789b7,'message':_0x5e34e8(0x1a6)+_0x3789b7[_0x5e34e8(0x1b0)]+'\x20from\x20schedule\x20'+_0x32f067};},async 'dryRun'(_0x51fd68){const _0x3001d1=a59_0x4c0a7e,_0x4965d8=_0x51fd68[_0x3001d1(0x188)]('schedule-id');return dryRun('POST',scheduleItemPath(_0x51fd68[_0x3001d1(0x197)],_0x4965d8)+_0x3001d1(0x18b))[_0x3001d1(0x1aa)](_0x3001d1(0x1b1)+_0x4965d8+_0x3001d1(0x1af))['build']();}},scheduleDelete={'service':a59_0x4c0a7e(0x1a8),'command':a59_0x4c0a7e(0x186),'description':a59_0x4c0a7e(0x1b4),'risk':'high-risk-write','confirmationDescription':a59_0x4c0a7e(0x1c1),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x19d106){const _0x218491=a59_0x4c0a7e,_0xe11724=_0x19d106[_0x218491(0x188)]('schedule-id'),_0x29a25f=await deleteRuntimeSchedule(_0x19d106[_0x218491(0x197)],_0xe11724);return{'ok':!![],'data':_0x29a25f,'message':_0x218491(0x18f)+_0xe11724};},async 'dryRun'(_0x5ed074){const _0x4dc6bd=a59_0x4c0a7e,_0x3bce3b=_0x5ed074[_0x4dc6bd(0x188)](_0x4dc6bd(0x17a));return dryRun(_0x4dc6bd(0x1b8),scheduleItemPath(_0x5ed074[_0x4dc6bd(0x197)],_0x3bce3b))[_0x4dc6bd(0x1aa)]('Preview:\x20delete\x20schedule\x20'+_0x3bce3b)[_0x4dc6bd(0x1c0)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
@@ -1 +1 @@
1
- const a59_0x2148ca=a59_0x5ea0;(function(_0x18b9b3,_0x142af0){const _0x1bdb09=a59_0x5ea0,_0x242d21=_0x18b9b3();while(!![]){try{const _0x1c5ddc=parseInt(_0x1bdb09(0x128))/0x1+-parseInt(_0x1bdb09(0x12c))/0x2+parseInt(_0x1bdb09(0x12d))/0x3*(-parseInt(_0x1bdb09(0x12b))/0x4)+parseInt(_0x1bdb09(0x12f))/0x5+parseInt(_0x1bdb09(0x12a))/0x6+parseInt(_0x1bdb09(0x12e))/0x7*(parseInt(_0x1bdb09(0x129))/0x8)+-parseInt(_0x1bdb09(0x130))/0x9;if(_0x1c5ddc===_0x142af0)break;else _0x242d21['push'](_0x242d21['shift']());}catch(_0x6a5937){_0x242d21['push'](_0x242d21['shift']());}}}(a59_0x486f,0xad683));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2bb726){const _0x7d8dbf=await buildSchemaPayload();return{'ok':!![],'data':_0x7d8dbf};}function a59_0x5ea0(_0x2d96e6,_0x3d9fcc){_0x2d96e6=_0x2d96e6-0x127;const _0x486fe3=a59_0x486f();let _0x5ea0f6=_0x486fe3[_0x2d96e6];return _0x5ea0f6;}export const schemaDefinition={'service':'schema','command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a59_0x2148ca(0x127),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};function a59_0x486f(){const _0x1fa57b=['365722STQqxv','189664hapwHJ','5300862cjggHZ','470584qEXVre','696166BOCeWq','15ODSvTd','322WUtfAR','2794645gjsjDD','11268972jBwxqA','read'];a59_0x486f=function(){return _0x1fa57b;};return a59_0x486f();}
1
+ const a60_0x10b587=a60_0x5f39;(function(_0xcf4832,_0x5dd724){const _0x108179=a60_0x5f39,_0x57ed4b=_0xcf4832();while(!![]){try{const _0x5ced38=-parseInt(_0x108179(0x168))/0x1+-parseInt(_0x108179(0x15f))/0x2*(-parseInt(_0x108179(0x15a))/0x3)+-parseInt(_0x108179(0x164))/0x4+-parseInt(_0x108179(0x162))/0x5*(-parseInt(_0x108179(0x15c))/0x6)+parseInt(_0x108179(0x166))/0x7*(parseInt(_0x108179(0x165))/0x8)+-parseInt(_0x108179(0x15e))/0x9*(-parseInt(_0x108179(0x167))/0xa)+-parseInt(_0x108179(0x160))/0xb*(parseInt(_0x108179(0x161))/0xc);if(_0x5ced38===_0x5dd724)break;else _0x57ed4b['push'](_0x57ed4b['shift']());}catch(_0x24478a){_0x57ed4b['push'](_0x57ed4b['shift']());}}}(a60_0xf8fd,0x51987));function a60_0x5f39(_0xe38ba,_0x57c87b){_0xe38ba=_0xe38ba-0x15a;const _0xf8fdc4=a60_0xf8fd();let _0x5f3932=_0xf8fdc4[_0xe38ba];return _0x5f3932;}function a60_0xf8fd(){const _0xe78e9=['schema','2358OsNSTK','read','1656qQfGPl','6lEsRAe','11GBnRKH','12684612lFtSYM','7335axmpPM','Export\x20machine-readable\x20command\x20schema\x20(JSON)','773004QJeHCK','8ivRvSH','3613414SnHHok','28330oTklHf','549907kyFnDh','export','520419VdAVSa'];a60_0xf8fd=function(){return _0xe78e9;};return a60_0xf8fd();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x405a79){const _0x40f651=await buildSchemaPayload();return{'ok':!![],'data':_0x40f651};}export const schemaDefinition={'service':a60_0x10b587(0x15b),'command':a60_0x10b587(0x169),'description':a60_0x10b587(0x163),'risk':a60_0x10b587(0x15d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- (function(_0x267e9e,_0x2e0155){const _0x55b9b5=a60_0x3f99,_0x163648=_0x267e9e();while(!![]){try{const _0x427701=parseInt(_0x55b9b5(0x73))/0x1+parseInt(_0x55b9b5(0xbf))/0x2+parseInt(_0x55b9b5(0xb8))/0x3+-parseInt(_0x55b9b5(0xa4))/0x4*(-parseInt(_0x55b9b5(0xb7))/0x5)+parseInt(_0x55b9b5(0x8e))/0x6+parseInt(_0x55b9b5(0x86))/0x7*(parseInt(_0x55b9b5(0xd5))/0x8)+-parseInt(_0x55b9b5(0x79))/0x9*(parseInt(_0x55b9b5(0x7d))/0xa);if(_0x427701===_0x2e0155)break;else _0x163648['push'](_0x163648['shift']());}catch(_0x4fe459){_0x163648['push'](_0x163648['shift']());}}}(a60_0x592b,0xbde7e));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';function a60_0x3f99(_0x11b8ee,_0x523e62){_0x11b8ee=_0x11b8ee-0x71;const _0x592b14=a60_0x592b();let _0x3f9950=_0x592b14[_0x11b8ee];return _0x3f9950;}function a60_0x592b(){const _0x371741=['\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20\x20\x20\x20command:\x20','service','Commands:','high-risk-write','\x20->\x20','type','datasetCode','cliPath','boolean','nickName','flags','filter','`\x20to\x20inspect\x20the\x20manifest.','env','Run\x20service\x20command\x20','684125qEHKWm','2135304dGZisD','data','now','sql','trim','\x22.\x20','\x20requires\x20target.sqlCode.','155912ccnvLK','normalizedManifest','entries','read','name','\x20<command>\x20[flags]','source','appBindings','Unknown\x20appRef\x20\x22','rawFlags','bff','sqlCode','const','Cannot\x20resolve\x20datatable\x20\x22','\x20\x20\x20\x20datasetCode:\x20','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','context.','startsWith','userName','length','code','remainingArgs','8pHTISD','tenantCode','default','risk','json','892934zxPpEa','fullPath','params','required','\x22\x20in\x20service\x20command\x20','datatable','13703751UejQEA','args','employeeId','\x20\x20MAP\x20TO','30fksWjV','slice','mapTo','\x20\x20\x20\x20sqlCode:\x20','fromEntries','\x20\x20\x20\x20datatable:\x20','bffId','This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22','number','4963833sROnsZ','flatMap','\x20\x20\x20\x20functionName:\x20','target','bffCode','string','app','find','8693514bGxaZY','loginName','commands','scriptName','userId','description','operator','validation','push','join','nickname','Service\x20command\x20','\x20\x20[','kind','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','\x20service\x20detail\x20--service\x20','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','\x20\x20\x20\x20','tree','command','SERVICE_TREE','map','44TKkRDD','appcode','appCode'];a60_0x592b=function(){return _0x371741;};return a60_0x592b();}import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x38d27a,_0xb9b462){const _0x14a635=a60_0x3f99,_0x286742=listLocalServiceTrees();let _0x1f9ee6;for(const _0x149fc5 of _0x286742){const _0x49bfe5=matchServiceTreeCommand(_0x149fc5,_0x38d27a);if(!_0x49bfe5)continue;(!_0x1f9ee6||_0x49bfe5[_0x14a635(0xa1)][_0x14a635(0x74)][_0x14a635(0xd2)]>_0x1f9ee6['command'][_0x14a635(0x74)][_0x14a635(0xd2)])&&(_0x1f9ee6={'tree':_0x149fc5,'command':_0x49bfe5[_0x14a635(0xa1)],'remainingArgs':_0x49bfe5[_0x14a635(0xd4)]});}if(!_0x1f9ee6)return undefined;const _0x3877b5={..._0xb9b462};return applyAppBinding(_0x1f9ee6[_0x14a635(0xa0)],_0x1f9ee6[_0x14a635(0xa1)],_0x3877b5),{'definition':buildDynamicCommandDefinition(_0x1f9ee6[_0x14a635(0xa0)],_0x1f9ee6[_0x14a635(0xa1)]),'args':_0x1f9ee6[_0x14a635(0xd4)],'flags':_0x3877b5,'tree':_0x1f9ee6[_0x14a635(0xa0)],'command':_0x1f9ee6[_0x14a635(0xa1)]};}export function generateDynamicServiceHelp(_0x24a55f){const _0x36e4cb=a60_0x3f99,_0x37160f=listLocalServiceTrees()[_0x36e4cb(0x8d)](_0x3240f8=>_0x3240f8['service'][_0x36e4cb(0xd3)]===_0x24a55f);if(!_0x37160f)return undefined;const _0x49f75d=[CLI_BIN_NAME+'\x20'+_0x24a55f+_0x36e4cb(0xc4),'',_0x37160f[_0x36e4cb(0xa9)][_0x36e4cb(0xc3)]||_0x24a55f,_0x37160f[_0x36e4cb(0xa9)]['description']?'\x20\x20'+_0x37160f[_0x36e4cb(0xa9)][_0x36e4cb(0x93)]:'','',_0x36e4cb(0xaa),..._0x37160f['commands'][_0x36e4cb(0xa3)](_0x2d1bec=>{const _0x430b60=_0x36e4cb,_0x588b01=_0x2d1bec[_0x430b60(0x74)][_0x430b60(0x7e)](0x1)['join']('\x20'),_0x41c698=_0x2d1bec[_0x430b60(0x71)]===_0x430b60(0xc2)?'':'\x20['+_0x2d1bec[_0x430b60(0x71)]+']';return'\x20\x20'+_0x588b01['padEnd'](0x18)+'\x20'+(_0x2d1bec[_0x430b60(0x93)]||'')+_0x41c698;}),'','Use\x20`'+CLI_BIN_NAME+_0x36e4cb(0x9d)+_0x24a55f+_0x36e4cb(0xb4)]['filter'](Boolean);return _0x49f75d[_0x36e4cb(0x97)]('\x0a');}export function listDynamicServiceEntries(){const _0x4a0f3e=a60_0x3f99;return listLocalServices()[_0x4a0f3e(0xa3)](_0x369fc8=>{const _0x6aa194=_0x4a0f3e,_0x3d22b4=_0x369fc8[_0x6aa194(0xc0)];return{'service':_0x3d22b4[_0x6aa194(0xa9)][_0x6aa194(0xd3)],'label':_0x3d22b4[_0x6aa194(0xa9)][_0x6aa194(0xc3)]||_0x3d22b4[_0x6aa194(0xa9)][_0x6aa194(0xd3)],'commands':_0x3d22b4[_0x6aa194(0x90)]['map'](_0x454050=>({'command':dynamicCommandName(_0x454050),'description':_0x454050[_0x6aa194(0x93)]||'Run\x20service\x20command\x20'+_0x454050['cliPath'],'tag':riskTag(_0x454050[_0x6aa194(0x71)])}))};});}export function getDynamicServiceEntry(_0x280db3){const _0x55dba6=a60_0x3f99;return listDynamicServiceEntries()[_0x55dba6(0x8d)](_0x1ff27a=>_0x1ff27a[_0x55dba6(0xa9)]===_0x280db3);}export function listDynamicServiceDefinitions(_0x38c7df){const _0x51727e=a60_0x3f99;return listLocalServiceTrees()[_0x51727e(0xb3)](_0x35b9b7=>!_0x38c7df||_0x35b9b7[_0x51727e(0xa9)][_0x51727e(0xd3)]===_0x38c7df)[_0x51727e(0x87)](_0x4c1e40=>_0x4c1e40[_0x51727e(0x90)][_0x51727e(0xa3)](_0x348b44=>buildDynamicCommandDefinition(_0x4c1e40,_0x348b44)));}export function getDynamicServiceDefinitions(_0x4b3d3d){const _0x4f61fd=a60_0x3f99,_0x3ff82b=listDynamicServiceDefinitions(_0x4b3d3d);return _0x3ff82b[_0x4f61fd(0xd2)]>0x0?_0x3ff82b:undefined;}export function findDynamicServiceDefinition(_0x31e8cc,_0x23043b){const _0x3e30c4=a60_0x3f99;return listDynamicServiceDefinitions(_0x31e8cc)[_0x3e30c4(0x8d)](_0x50ad0d=>_0x50ad0d[_0x3e30c4(0xa1)]===_0x23043b);}export function buildDynamicCommandDefinition(_0x23241c,_0x528770){const _0x1550df=a60_0x3f99;return{'service':_0x23241c[_0x1550df(0xa9)][_0x1550df(0xd3)],'command':dynamicCommandName(_0x528770),'description':_0x528770[_0x1550df(0x93)]||_0x1550df(0xb6)+_0x528770[_0x1550df(0xaf)],'risk':_0x528770[_0x1550df(0x71)],..._0x528770[_0x1550df(0x71)]===_0x1550df(0xc2)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x528770)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x528770['args'][_0x1550df(0xa3)](_0x3ba692=>({'name':_0x3ba692[_0x1550df(0xc3)],'description':_0x3ba692['description']||_0x3ba692[_0x1550df(0xc3)],'required':_0x3ba692['required']})),'flags':_0x528770[_0x1550df(0xb2)][_0x1550df(0xa3)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x528770),async 'dryRun'(_0x4e6680){const _0x2ebaa4=_0x1550df,_0x18cd2a=await compilePlan(_0x528770,_0x4e6680);return{'method':_0x2ebaa4(0xa2),'url':_0x528770['cliPath'],'body':{'target':targetPreview(_0x18cd2a),'params':_0x18cd2a[_0x2ebaa4(0x75)]},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x528770['cliPath']};},async 'execute'(_0x4da006){const _0x41cd81=_0x1550df,_0x5b2cc9=await compilePlan(_0x528770,_0x4da006),_0xbf69fe=Date[_0x41cd81(0xba)](),_0x3ffa46=await executePlan(_0x5b2cc9,_0x528770,_0x4da006),_0x9a90c4=Date[_0x41cd81(0xba)]()-_0xbf69fe;return{'ok':!![],'data':{'service':_0x23241c[_0x41cd81(0xa9)],'command':_0x528770[_0x41cd81(0xaf)],'target':targetPreview(_0x5b2cc9),'result':_0x3ffa46,'elapsed':_0x9a90c4},'message':_0x41cd81(0x99)+_0x528770[_0x41cd81(0xaf)]+'\x20completed\x20in\x20'+_0x9a90c4+'ms'};}};}function buildDynamicConfirmationDescription(_0x441562){const _0x4e3f98=a60_0x3f99,_0xc7d52b=_0x441562[_0x4e3f98(0x93)]||_0x441562['cliPath'],_0x93f5d3=_0x441562[_0x4e3f98(0x71)]===_0x4e3f98(0xab)?'The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.':'The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.';return _0x4e3f98(0x84)+_0xc7d52b+_0x4e3f98(0xbd)+_0x93f5d3;}function dynamicCommandName(_0x171688){const _0x235c16=a60_0x3f99;return _0x171688[_0x235c16(0x74)][_0x235c16(0x7e)](0x1)[_0x235c16(0x97)]('\x20');}function riskTag(_0x460204){const _0x3383b1=a60_0x3f99;return _0x460204===_0x3383b1(0xc2)?'':_0x3383b1(0x9a)+_0x460204+']';}function flagToCommandFlag(_0x2686c8){const _0x257225=a60_0x3f99;return{'name':_0x2686c8['cliName'],'type':_0x2686c8[_0x257225(0xad)]===_0x257225(0x72)?_0x257225(0x8b):_0x2686c8[_0x257225(0xad)],'description':_0x2686c8[_0x257225(0x93)]||_0x2686c8['name'],'required':_0x2686c8[_0x257225(0x76)],'default':isPrimitiveFlagDefault(_0x2686c8[_0x257225(0xd7)])?_0x2686c8['default']:undefined,'enum':_0x2686c8['enum']};}async function compilePlan(_0x4037ba,_0x3c6a92){const _0x2ade34=a60_0x3f99;return compileServiceTreeCommand(_0x4037ba,{'flags':_0x3c6a92[_0x2ade34(0xc8)],'args':_0x3c6a92[_0x2ade34(0x7a)],'context':await buildServiceContext(_0x4037ba,_0x3c6a92)});}async function buildServiceContext(_0x188f03,_0x4e9787){const _0x5388a1=a60_0x3f99,_0x269bdd={'appCode':_0x4e9787[_0x5388a1(0xa6)],'env':_0x4e9787['envName'],'envName':_0x4e9787['envName']};if(!usesRuntimeContext(_0x188f03))return _0x269bdd;const _0x595dba=await getLoginUserInfo(),_0x7d95ff=pickFirst(_0x595dba[_0x5388a1(0x92)],_0x595dba['id']);return{..._0x269bdd,'user':_0x595dba,'userId':_0x7d95ff,'id':_0x595dba['id'],'username':pickFirst(_0x595dba['username'],_0x595dba[_0x5388a1(0xd1)],_0x595dba[_0x5388a1(0x8f)]),'userName':_0x595dba['userName'],'nickname':pickFirst(_0x595dba[_0x5388a1(0x98)],_0x595dba[_0x5388a1(0xb1)]),'nickName':_0x595dba[_0x5388a1(0xb1)],'tenantCode':_0x595dba[_0x5388a1(0xd6)],'employeeId':_0x595dba[_0x5388a1(0x7b)]};}function usesRuntimeContext(_0x5e991f){const _0xdd92b3=a60_0x3f99;return _0x5e991f['mapTo']['some'](_0x5bb7dd=>typeof _0x5bb7dd[_0xdd92b3(0xc5)]===_0xdd92b3(0x8b)&&(_0x5bb7dd['source'][_0xdd92b3(0xd0)](_0xdd92b3(0xcf))||_0x5bb7dd[_0xdd92b3(0xc5)]['startsWith']('ctx.')));}function pickFirst(..._0x5f5d7e){const _0x4338d3=a60_0x3f99;return _0x5f5d7e[_0x4338d3(0x8d)](_0x540b60=>_0x540b60!==undefined&&_0x540b60!==null);}async function executePlan(_0x583e47,_0x3201c2,_0x201cbf){const _0x34414a=a60_0x3f99;if(_0x583e47[_0x34414a(0x9b)]===_0x34414a(0xb9)){const _0x3d9300=await resolveDatasetCode(_0x583e47,_0x3201c2,_0x201cbf);return executeData(_0x3d9300,_0x583e47[_0x34414a(0xa1)],_0x583e47[_0x34414a(0x75)]);}if(_0x583e47['kind']===_0x34414a(0xbb)){if(!_0x583e47['sqlCode'])throw CliErrors[_0x34414a(0x95)](_0x34414a(0x99)+_0x3201c2[_0x34414a(0xaf)]+_0x34414a(0xbe));return executeSdkSql(_0x583e47[_0x34414a(0xca)],normalizeScalarParams(_0x583e47['params']));}if(_0x583e47[_0x34414a(0x9b)]===_0x34414a(0xc9)){const _0xfca439=_0x583e47[_0x34414a(0x91)]||_0x583e47[_0x34414a(0x8a)]||(_0x583e47[_0x34414a(0x83)]==null?'':String(_0x583e47[_0x34414a(0x83)]));if(!_0xfca439)throw CliErrors[_0x34414a(0x95)](_0x34414a(0x99)+_0x3201c2[_0x34414a(0xaf)]+'\x20requires\x20target.functionName.');return executeSdkBff(_0xfca439,_0x583e47[_0x34414a(0x75)]);}throw CliErrors[_0x34414a(0x95)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x583e47[_0x34414a(0x9b)]);}async function resolveDatasetCode(_0x3e630a,_0x383434,_0x520766){const _0x443f1e=a60_0x3f99;if(_0x3e630a[_0x443f1e(0xae)])return _0x3e630a[_0x443f1e(0xae)];if(!_0x3e630a[_0x443f1e(0x78)])throw CliErrors[_0x443f1e(0x95)](_0x443f1e(0x99)+_0x383434[_0x443f1e(0xaf)]+_0x443f1e(0x9e));const _0x36595a=await listDatasets(_0x520766[_0x443f1e(0xa6)]),_0x3b8e72=_0x36595a['find'](_0x452688=>_0x452688['dbtableConfig']?.['tableName']===_0x3e630a[_0x443f1e(0x78)]);if(!_0x3b8e72?.['code'])throw CliErrors['validation'](_0x443f1e(0xcc)+_0x3e630a['datatable']+_0x443f1e(0xa7)+_0x520766['appCode']+'.',_0x443f1e(0x9c));return _0x3b8e72[_0x443f1e(0xd3)];}function applyAppBinding(_0x4967a,_0x45535f,_0x1beb0e){const _0xbbd880=a60_0x3f99,_0x42560a=_0x45535f[_0xbbd880(0x89)]['appRef'];if(!_0x42560a)return;const _0x5ba3a4=_0x4967a[_0xbbd880(0xc6)][_0x42560a];if(!_0x5ba3a4)throw CliErrors[_0xbbd880(0x95)](_0xbbd880(0xc7)+_0x42560a+_0xbbd880(0x77)+_0x45535f[_0xbbd880(0xaf)]+'.',_0xbbd880(0xce));const _0x45cbf6=_0x5ba3a4[_0xbbd880(0xa5)]||_0x5ba3a4[_0xbbd880(0xa6)];_0x45cbf6&&!hasText(_0x1beb0e['appcode'])&&(_0x1beb0e[_0xbbd880(0xa5)]=_0x45cbf6),_0x5ba3a4[_0xbbd880(0x8c)]&&!hasText(_0x1beb0e[_0xbbd880(0x8c)])&&!hasText(_0x1beb0e[_0xbbd880(0xa5)])&&(_0x1beb0e[_0xbbd880(0x8c)]=_0x5ba3a4[_0xbbd880(0x8c)]),_0x5ba3a4[_0xbbd880(0xb5)]&&!hasText(_0x1beb0e[_0xbbd880(0xb5)])&&(_0x1beb0e[_0xbbd880(0xb5)]=_0x5ba3a4[_0xbbd880(0xb5)]);}function renderDynamicCommandHelp(_0x425d92){const _0x51ce47=a60_0x3f99,_0xeb8339=['\x20\x20SERVICE\x20TREE\x20TARGET','\x20\x20\x20\x20kind:\x20\x20\x20\x20'+_0x425d92[_0x51ce47(0x89)]['kind'],_0x51ce47(0xa8)+_0x425d92['target'][_0x51ce47(0xa1)]];if(_0x425d92[_0x51ce47(0x89)][_0x51ce47(0xae)])_0xeb8339[_0x51ce47(0x96)](_0x51ce47(0xcd)+_0x425d92[_0x51ce47(0x89)]['datasetCode']);if(_0x425d92[_0x51ce47(0x89)][_0x51ce47(0x78)])_0xeb8339[_0x51ce47(0x96)](_0x51ce47(0x82)+_0x425d92[_0x51ce47(0x89)][_0x51ce47(0x78)]);if(_0x425d92[_0x51ce47(0x89)][_0x51ce47(0xca)])_0xeb8339['push'](_0x51ce47(0x80)+_0x425d92['target'][_0x51ce47(0xca)]);if(_0x425d92[_0x51ce47(0x89)][_0x51ce47(0x91)])_0xeb8339[_0x51ce47(0x96)](_0x51ce47(0x88)+_0x425d92[_0x51ce47(0x89)][_0x51ce47(0x91)]);if(_0x425d92[_0x51ce47(0x7f)][_0x51ce47(0xd2)]>0x0){_0xeb8339[_0x51ce47(0x96)]('',_0x51ce47(0x7c));for(const _0x40ea04 of _0x425d92['mapTo']){_0xeb8339['push'](_0x51ce47(0x9f)+(_0x40ea04[_0x51ce47(0xc5)]||_0x51ce47(0xcb))+_0x51ce47(0xac)+_0x40ea04[_0x51ce47(0x89)]+(_0x40ea04['operator']?'.'+_0x40ea04[_0x51ce47(0x94)]:''));}}return _0xeb8339[_0x51ce47(0x97)]('\x0a');}function targetPreview(_0x5776bc){const _0xcc11f2=a60_0x3f99;return{'kind':_0x5776bc[_0xcc11f2(0x9b)],'command':_0x5776bc[_0xcc11f2(0xa1)],'appRef':_0x5776bc['appRef'],'datasetCode':_0x5776bc[_0xcc11f2(0xae)],'datatable':_0x5776bc[_0xcc11f2(0x78)],'sqlCode':_0x5776bc[_0xcc11f2(0xca)],'bffCode':_0x5776bc['bffCode'],'bffId':_0x5776bc[_0xcc11f2(0x83)],'functionName':_0x5776bc[_0xcc11f2(0x91)]};}function normalizeScalarParams(_0x4f9d4f){const _0x32e984=a60_0x3f99;return Object[_0x32e984(0x81)](Object[_0x32e984(0xc1)](_0x4f9d4f)['filter'](([,_0x120179])=>typeof _0x120179===_0x32e984(0x8b)||typeof _0x120179===_0x32e984(0x85)));}function hasText(_0x82d503){const _0x3a634e=a60_0x3f99;return typeof _0x82d503===_0x3a634e(0x8b)&&_0x82d503[_0x3a634e(0xbc)]()[_0x3a634e(0xd2)]>0x0;}function isPrimitiveFlagDefault(_0x5b3b1e){const _0x101bc9=a60_0x3f99;return _0x5b3b1e===undefined||typeof _0x5b3b1e===_0x101bc9(0x8b)||typeof _0x5b3b1e===_0x101bc9(0x85)||typeof _0x5b3b1e===_0x101bc9(0xb0);}
1
+ (function(_0x416a76,_0x5d8ec1){const _0x1185f2=a61_0x448b,_0x228b2e=_0x416a76();while(!![]){try{const _0xf6894f=-parseInt(_0x1185f2(0x21d))/0x1+parseInt(_0x1185f2(0x222))/0x2+-parseInt(_0x1185f2(0x20e))/0x3*(parseInt(_0x1185f2(0x1fd))/0x4)+parseInt(_0x1185f2(0x1ff))/0x5+parseInt(_0x1185f2(0x20c))/0x6+parseInt(_0x1185f2(0x217))/0x7*(parseInt(_0x1185f2(0x1f7))/0x8)+-parseInt(_0x1185f2(0x20d))/0x9;if(_0xf6894f===_0x5d8ec1)break;else _0x228b2e['push'](_0x228b2e['shift']());}catch(_0x121887){_0x228b2e['push'](_0x228b2e['shift']());}}}(a61_0x33ff,0xd5348));function a61_0x448b(_0x45b995,_0x708d30){_0x45b995=_0x45b995-0x1d2;const _0x33ff52=a61_0x33ff();let _0x448ba6=_0x33ff52[_0x45b995];return _0x448ba6;}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(_0x18a3dc,_0x4e36e1){const _0x32bc1c=a61_0x448b,_0x1ded83=listLocalServiceTrees();let _0x24f3e0;for(const _0xee9a86 of _0x1ded83){const _0x4413bf=matchServiceTreeCommand(_0xee9a86,_0x18a3dc);if(!_0x4413bf)continue;(!_0x24f3e0||_0x4413bf[_0x32bc1c(0x200)][_0x32bc1c(0x221)][_0x32bc1c(0x1f2)]>_0x24f3e0[_0x32bc1c(0x200)]['fullPath'][_0x32bc1c(0x1f2)])&&(_0x24f3e0={'tree':_0xee9a86,'command':_0x4413bf['command'],'remainingArgs':_0x4413bf['remainingArgs']});}if(!_0x24f3e0)return undefined;const _0x172dd1={..._0x4e36e1};return applyAppBinding(_0x24f3e0[_0x32bc1c(0x220)],_0x24f3e0[_0x32bc1c(0x200)],_0x172dd1),{'definition':buildDynamicCommandDefinition(_0x24f3e0[_0x32bc1c(0x220)],_0x24f3e0[_0x32bc1c(0x200)]),'args':_0x24f3e0[_0x32bc1c(0x1e8)],'flags':_0x172dd1,'tree':_0x24f3e0[_0x32bc1c(0x220)],'command':_0x24f3e0['command']};}export function generateDynamicServiceHelp(_0x3cf09d){const _0x76bb79=a61_0x448b,_0x41545c=listLocalServiceTrees()[_0x76bb79(0x1e0)](_0x4ce29c=>_0x4ce29c['service']['code']===_0x3cf09d);if(!_0x41545c)return undefined;const _0x35326f=[CLI_BIN_NAME+'\x20'+_0x3cf09d+'\x20<command>\x20[flags]','',_0x41545c['service'][_0x76bb79(0x1d5)]||_0x3cf09d,_0x41545c[_0x76bb79(0x1d4)]['description']?'\x20\x20'+_0x41545c[_0x76bb79(0x1d4)]['description']:'','',_0x76bb79(0x1dc),..._0x41545c[_0x76bb79(0x228)]['map'](_0xc59061=>{const _0x5694b0=_0x76bb79,_0x4855ab=_0xc59061[_0x5694b0(0x221)]['slice'](0x1)[_0x5694b0(0x1d7)]('\x20'),_0x472505=_0xc59061[_0x5694b0(0x1ec)]===_0x5694b0(0x1e6)?'':'\x20['+_0xc59061['risk']+']';return'\x20\x20'+_0x4855ab['padEnd'](0x18)+'\x20'+(_0xc59061[_0x5694b0(0x206)]||'')+_0x472505;}),'',_0x76bb79(0x1d8)+CLI_BIN_NAME+_0x76bb79(0x213)+_0x3cf09d+_0x76bb79(0x22c)][_0x76bb79(0x22f)](Boolean);return _0x35326f[_0x76bb79(0x1d7)]('\x0a');}export function listDynamicServiceEntries(){const _0x406cb3=a61_0x448b;return listLocalServices()[_0x406cb3(0x214)](_0x2afb75=>{const _0x4e9f95=_0x406cb3,_0x19dd33=_0x2afb75[_0x4e9f95(0x20b)];return{'service':_0x19dd33[_0x4e9f95(0x1d4)][_0x4e9f95(0x1f3)],'label':_0x19dd33[_0x4e9f95(0x1d4)][_0x4e9f95(0x1d5)]||_0x19dd33[_0x4e9f95(0x1d4)]['code'],'commands':_0x19dd33['commands'][_0x4e9f95(0x214)](_0x77bae1=>({'command':dynamicCommandName(_0x77bae1),'description':_0x77bae1[_0x4e9f95(0x206)]||'Run\x20service\x20command\x20'+_0x77bae1[_0x4e9f95(0x1d9)],'tag':riskTag(_0x77bae1['risk'])}))};});}export function getDynamicServiceEntry(_0xb61f4c){const _0x1d78f3=a61_0x448b;return listDynamicServiceEntries()[_0x1d78f3(0x1e0)](_0x28321e=>_0x28321e['service']===_0xb61f4c);}export function listDynamicServiceDefinitions(_0x1f5827){const _0x225207=a61_0x448b;return listLocalServiceTrees()[_0x225207(0x22f)](_0x3300b6=>!_0x1f5827||_0x3300b6[_0x225207(0x1d4)][_0x225207(0x1f3)]===_0x1f5827)['flatMap'](_0x2c3170=>_0x2c3170[_0x225207(0x228)][_0x225207(0x214)](_0xfe96d5=>buildDynamicCommandDefinition(_0x2c3170,_0xfe96d5)));}export function getDynamicServiceDefinitions(_0x5e1114){const _0x13b0b7=listDynamicServiceDefinitions(_0x5e1114);return _0x13b0b7['length']>0x0?_0x13b0b7:undefined;}export function findDynamicServiceDefinition(_0x4b8e70,_0x76b52a){const _0x4c35ce=a61_0x448b;return listDynamicServiceDefinitions(_0x4b8e70)[_0x4c35ce(0x1e0)](_0x3b036a=>_0x3b036a[_0x4c35ce(0x200)]===_0x76b52a);}export function buildDynamicCommandDefinition(_0x3bf7ba,_0x25c0e7){const _0x7413d5=a61_0x448b;return{'service':_0x3bf7ba[_0x7413d5(0x1d4)][_0x7413d5(0x1f3)],'command':dynamicCommandName(_0x25c0e7),'description':_0x25c0e7[_0x7413d5(0x206)]||_0x7413d5(0x1e3)+_0x25c0e7['cliPath'],'risk':_0x25c0e7[_0x7413d5(0x1ec)],..._0x25c0e7[_0x7413d5(0x1ec)]===_0x7413d5(0x1e6)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x25c0e7)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x25c0e7[_0x7413d5(0x1f5)]['map'](_0x8c0d6c=>({'name':_0x8c0d6c[_0x7413d5(0x1d5)],'description':_0x8c0d6c[_0x7413d5(0x206)]||_0x8c0d6c[_0x7413d5(0x1d5)],'required':_0x8c0d6c[_0x7413d5(0x1e4)]})),'flags':_0x25c0e7[_0x7413d5(0x1e9)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x25c0e7),async 'dryRun'(_0x377128){const _0x4147f2=_0x7413d5,_0x4d54e9=await compilePlan(_0x25c0e7,_0x377128);return{'method':_0x4147f2(0x21a),'url':_0x25c0e7[_0x4147f2(0x1d9)],'body':{'target':targetPreview(_0x4d54e9),'params':_0x4d54e9['params']},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x25c0e7[_0x4147f2(0x1d9)]};},async 'execute'(_0x94a0dd){const _0x5dd968=_0x7413d5,_0x2ab2e4=await compilePlan(_0x25c0e7,_0x94a0dd),_0x58d978=Date['now'](),_0x102027=await executePlan(_0x2ab2e4,_0x25c0e7,_0x94a0dd),_0x36731d=Date['now']()-_0x58d978;return{'ok':!![],'data':{'service':_0x3bf7ba[_0x5dd968(0x1d4)],'command':_0x25c0e7[_0x5dd968(0x1d9)],'target':targetPreview(_0x2ab2e4),'result':_0x102027,'elapsed':_0x36731d},'message':'Service\x20command\x20'+_0x25c0e7[_0x5dd968(0x1d9)]+_0x5dd968(0x204)+_0x36731d+'ms'};}};}function buildDynamicConfirmationDescription(_0x42fb69){const _0x1ea4f=a61_0x448b,_0x2bd91c=_0x42fb69[_0x1ea4f(0x206)]||_0x42fb69['cliPath'],_0x598d57=_0x42fb69[_0x1ea4f(0x1ec)]==='high-risk-write'?'The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.':_0x1ea4f(0x216);return'This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22'+_0x2bd91c+'\x22.\x20'+_0x598d57;}function dynamicCommandName(_0x20b23c){const _0x46f8d5=a61_0x448b;return _0x20b23c[_0x46f8d5(0x221)][_0x46f8d5(0x223)](0x1)[_0x46f8d5(0x1d7)]('\x20');}function riskTag(_0x10646b){const _0x5f0514=a61_0x448b;return _0x10646b===_0x5f0514(0x1e6)?'':_0x5f0514(0x1db)+_0x10646b+']';}function flagToCommandFlag(_0x4c043e){const _0x360aaa=a61_0x448b;return{'name':_0x4c043e[_0x360aaa(0x22a)],'type':_0x4c043e[_0x360aaa(0x205)]===_0x360aaa(0x20f)?_0x360aaa(0x201):_0x4c043e[_0x360aaa(0x205)],'description':_0x4c043e[_0x360aaa(0x206)]||_0x4c043e[_0x360aaa(0x1d5)],'required':_0x4c043e[_0x360aaa(0x1e4)],'default':isPrimitiveFlagDefault(_0x4c043e[_0x360aaa(0x227)])?_0x4c043e[_0x360aaa(0x227)]:undefined,'enum':_0x4c043e['enum']};}async function compilePlan(_0x3d4d3f,_0x141ffd){return compileServiceTreeCommand(_0x3d4d3f,{'flags':_0x141ffd['rawFlags'],'args':_0x141ffd['args'],'context':await buildServiceContext(_0x3d4d3f,_0x141ffd)});}function a61_0x33ff(){const _0x50ffd5=['type','description','loginName','username','tableName','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','normalizedManifest','4927500aWlFQu','2622852LrKoGm','3KToHDB','json','env','nickname','\x20\x20\x20\x20','\x20service\x20detail\x20--service\x20','map','sqlCode','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.','7drTDst','source','\x20\x20\x20\x20sqlCode:\x20','SERVICE_TREE','fromEntries','appcode','1032970krJIiY','\x20->\x20','push','tree','fullPath','2337854vUlXeF','slice','userId','app','\x20\x20MAP\x20TO','default','commands','mapTo','cliName','tenantCode','`\x20to\x20inspect\x20the\x20manifest.','datasetCode','trim','filter','number','envName','\x20\x20\x20\x20datasetCode:\x20','service','name','kind','join','Use\x20`','cliPath','appBindings','\x20\x20[','Commands:','validation','bffId','startsWith','find','params','datatable','Run\x20service\x20command\x20','required','appCode','read','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','remainingArgs','flags','Service\x20command\x20','context.','risk','bffCode','\x20\x20\x20\x20datatable:\x20','data','dbtableConfig','\x22\x20in\x20service\x20command\x20','length','code','bff','args','some','2767976WbNNBN','\x20\x20\x20\x20functionName:\x20','target','\x20\x20\x20\x20kind:\x20\x20\x20\x20','appRef','\x20requires\x20target.sqlCode.','1335396QDmQoD','scriptName','976805kFEUvu','command','string','nickName','\x20requires\x20target.functionName.','\x20completed\x20in\x20'];a61_0x33ff=function(){return _0x50ffd5;};return a61_0x33ff();}async function buildServiceContext(_0x2717f6,_0x2678c7){const _0x1666ea=a61_0x448b,_0x776a50={'appCode':_0x2678c7[_0x1666ea(0x1e5)],'env':_0x2678c7[_0x1666ea(0x1d2)],'envName':_0x2678c7[_0x1666ea(0x1d2)]};if(!usesRuntimeContext(_0x2717f6))return _0x776a50;const _0x2ac4fc=await getLoginUserInfo(),_0x2733a3=pickFirst(_0x2ac4fc[_0x1666ea(0x224)],_0x2ac4fc['id']);return{..._0x776a50,'user':_0x2ac4fc,'userId':_0x2733a3,'id':_0x2ac4fc['id'],'username':pickFirst(_0x2ac4fc[_0x1666ea(0x208)],_0x2ac4fc['userName'],_0x2ac4fc[_0x1666ea(0x207)]),'userName':_0x2ac4fc['userName'],'nickname':pickFirst(_0x2ac4fc[_0x1666ea(0x211)],_0x2ac4fc[_0x1666ea(0x202)]),'nickName':_0x2ac4fc[_0x1666ea(0x202)],'tenantCode':_0x2ac4fc[_0x1666ea(0x22b)],'employeeId':_0x2ac4fc['employeeId']};}function usesRuntimeContext(_0x166b22){const _0xc7a940=a61_0x448b;return _0x166b22['mapTo'][_0xc7a940(0x1f6)](_0x38bc7b=>typeof _0x38bc7b['source']===_0xc7a940(0x201)&&(_0x38bc7b[_0xc7a940(0x218)][_0xc7a940(0x1df)](_0xc7a940(0x1eb))||_0x38bc7b[_0xc7a940(0x218)][_0xc7a940(0x1df)]('ctx.')));}function pickFirst(..._0x330935){const _0x159ca4=a61_0x448b;return _0x330935[_0x159ca4(0x1e0)](_0x3ae9f4=>_0x3ae9f4!==undefined&&_0x3ae9f4!==null);}async function executePlan(_0x8b0a72,_0x286b30,_0x12671e){const _0x3699a7=a61_0x448b;if(_0x8b0a72['kind']===_0x3699a7(0x1ef)){const _0x156722=await resolveDatasetCode(_0x8b0a72,_0x286b30,_0x12671e);return executeData(_0x156722,_0x8b0a72['command'],_0x8b0a72[_0x3699a7(0x1e1)]);}if(_0x8b0a72[_0x3699a7(0x1d6)]==='sql'){if(!_0x8b0a72[_0x3699a7(0x215)])throw CliErrors[_0x3699a7(0x1dd)]('Service\x20command\x20'+_0x286b30['cliPath']+_0x3699a7(0x1fc));return executeSdkSql(_0x8b0a72[_0x3699a7(0x215)],normalizeScalarParams(_0x8b0a72[_0x3699a7(0x1e1)]));}if(_0x8b0a72[_0x3699a7(0x1d6)]===_0x3699a7(0x1f4)){const _0x68174d=_0x8b0a72[_0x3699a7(0x1fe)]||_0x8b0a72[_0x3699a7(0x1ed)]||(_0x8b0a72[_0x3699a7(0x1de)]==null?'':String(_0x8b0a72[_0x3699a7(0x1de)]));if(!_0x68174d)throw CliErrors[_0x3699a7(0x1dd)](_0x3699a7(0x1ea)+_0x286b30[_0x3699a7(0x1d9)]+_0x3699a7(0x203));return executeSdkBff(_0x68174d,_0x8b0a72[_0x3699a7(0x1e1)]);}throw CliErrors[_0x3699a7(0x1dd)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x8b0a72['kind']);}async function resolveDatasetCode(_0x184075,_0x2b6f9a,_0x4a55c7){const _0x160141=a61_0x448b;if(_0x184075[_0x160141(0x22d)])return _0x184075[_0x160141(0x22d)];if(!_0x184075[_0x160141(0x1e2)])throw CliErrors[_0x160141(0x1dd)]('Service\x20command\x20'+_0x2b6f9a[_0x160141(0x1d9)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x850b5c=await listDatasets(_0x4a55c7[_0x160141(0x1e5)]),_0x51066b=_0x850b5c['find'](_0x14ed3e=>_0x14ed3e[_0x160141(0x1f0)]?.[_0x160141(0x209)]===_0x184075[_0x160141(0x1e2)]);if(!_0x51066b?.['code'])throw CliErrors[_0x160141(0x1dd)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x184075[_0x160141(0x1e2)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x4a55c7['appCode']+'.',_0x160141(0x1e7));return _0x51066b['code'];}function applyAppBinding(_0x59dfd2,_0x22b9cc,_0x4215e1){const _0x3d3488=a61_0x448b,_0x54db87=_0x22b9cc[_0x3d3488(0x1f9)][_0x3d3488(0x1fb)];if(!_0x54db87)return;const _0x458ce9=_0x59dfd2[_0x3d3488(0x1da)][_0x54db87];if(!_0x458ce9)throw CliErrors[_0x3d3488(0x1dd)]('Unknown\x20appRef\x20\x22'+_0x54db87+_0x3d3488(0x1f1)+_0x22b9cc[_0x3d3488(0x1d9)]+'.',_0x3d3488(0x20a));const _0x54b26e=_0x458ce9[_0x3d3488(0x21c)]||_0x458ce9['appCode'];_0x54b26e&&!hasText(_0x4215e1[_0x3d3488(0x21c)])&&(_0x4215e1['appcode']=_0x54b26e),_0x458ce9['app']&&!hasText(_0x4215e1[_0x3d3488(0x225)])&&!hasText(_0x4215e1['appcode'])&&(_0x4215e1['app']=_0x458ce9[_0x3d3488(0x225)]),_0x458ce9['env']&&!hasText(_0x4215e1[_0x3d3488(0x210)])&&(_0x4215e1[_0x3d3488(0x210)]=_0x458ce9['env']);}function renderDynamicCommandHelp(_0x364a44){const _0x3e6d0f=a61_0x448b,_0x14abc4=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x3e6d0f(0x1fa)+_0x364a44[_0x3e6d0f(0x1f9)]['kind'],'\x20\x20\x20\x20command:\x20'+_0x364a44[_0x3e6d0f(0x1f9)][_0x3e6d0f(0x200)]];if(_0x364a44[_0x3e6d0f(0x1f9)]['datasetCode'])_0x14abc4[_0x3e6d0f(0x21f)](_0x3e6d0f(0x1d3)+_0x364a44[_0x3e6d0f(0x1f9)][_0x3e6d0f(0x22d)]);if(_0x364a44[_0x3e6d0f(0x1f9)][_0x3e6d0f(0x1e2)])_0x14abc4['push'](_0x3e6d0f(0x1ee)+_0x364a44[_0x3e6d0f(0x1f9)][_0x3e6d0f(0x1e2)]);if(_0x364a44[_0x3e6d0f(0x1f9)]['sqlCode'])_0x14abc4[_0x3e6d0f(0x21f)](_0x3e6d0f(0x219)+_0x364a44['target'][_0x3e6d0f(0x215)]);if(_0x364a44[_0x3e6d0f(0x1f9)]['scriptName'])_0x14abc4[_0x3e6d0f(0x21f)](_0x3e6d0f(0x1f8)+_0x364a44[_0x3e6d0f(0x1f9)][_0x3e6d0f(0x1fe)]);if(_0x364a44['mapTo'][_0x3e6d0f(0x1f2)]>0x0){_0x14abc4[_0x3e6d0f(0x21f)]('',_0x3e6d0f(0x226));for(const _0x4e5fa4 of _0x364a44[_0x3e6d0f(0x229)]){_0x14abc4[_0x3e6d0f(0x21f)](_0x3e6d0f(0x212)+(_0x4e5fa4[_0x3e6d0f(0x218)]||'const')+_0x3e6d0f(0x21e)+_0x4e5fa4[_0x3e6d0f(0x1f9)]+(_0x4e5fa4['operator']?'.'+_0x4e5fa4['operator']:''));}}return _0x14abc4['join']('\x0a');}function targetPreview(_0x5774a9){const _0x508507=a61_0x448b;return{'kind':_0x5774a9['kind'],'command':_0x5774a9[_0x508507(0x200)],'appRef':_0x5774a9['appRef'],'datasetCode':_0x5774a9[_0x508507(0x22d)],'datatable':_0x5774a9[_0x508507(0x1e2)],'sqlCode':_0x5774a9[_0x508507(0x215)],'bffCode':_0x5774a9[_0x508507(0x1ed)],'bffId':_0x5774a9[_0x508507(0x1de)],'functionName':_0x5774a9[_0x508507(0x1fe)]};}function normalizeScalarParams(_0x17cf7f){const _0x459ccb=a61_0x448b;return Object[_0x459ccb(0x21b)](Object['entries'](_0x17cf7f)[_0x459ccb(0x22f)](([,_0x3b987f])=>typeof _0x3b987f===_0x459ccb(0x201)||typeof _0x3b987f===_0x459ccb(0x230)));}function hasText(_0x5c5ecf){const _0x56b16d=a61_0x448b;return typeof _0x5c5ecf===_0x56b16d(0x201)&&_0x5c5ecf[_0x56b16d(0x22e)]()[_0x56b16d(0x1f2)]>0x0;}function isPrimitiveFlagDefault(_0x19af7f){const _0xc3d407=a61_0x448b;return _0x19af7f===undefined||typeof _0x19af7f===_0xc3d407(0x201)||typeof _0x19af7f===_0xc3d407(0x230)||typeof _0x19af7f==='boolean';}
@@ -1 +1 @@
1
- (function(_0x3f0660,_0x53d26f){const _0x4e41d0=a61_0x31a9,_0x58c8f7=_0x3f0660();while(!![]){try{const _0x1f3bb0=parseInt(_0x4e41d0(0x74))/0x1+parseInt(_0x4e41d0(0x79))/0x2*(-parseInt(_0x4e41d0(0x7f))/0x3)+-parseInt(_0x4e41d0(0x81))/0x4+-parseInt(_0x4e41d0(0x6d))/0x5+-parseInt(_0x4e41d0(0x7e))/0x6+-parseInt(_0x4e41d0(0x89))/0x7+parseInt(_0x4e41d0(0x73))/0x8*(parseInt(_0x4e41d0(0x68))/0x9);if(_0x1f3bb0===_0x53d26f)break;else _0x58c8f7['push'](_0x58c8f7['shift']());}catch(_0x3c122c){_0x58c8f7['push'](_0x58c8f7['shift']());}}}(a61_0x54be,0x32ab0));export function adaptServiceTreeManifestForLegacyFramework(_0x16bfcf){const _0x466101=a61_0x31a9,_0x3cdf0b=cloneJsonValue(_0x16bfcf),_0x1589c8=[];if(!isObjectRecord(_0x3cdf0b))return{'manifest':_0x3cdf0b,'errors':_0x1589c8};return Array['isArray'](_0x3cdf0b[_0x466101(0x88)])&&_0x3cdf0b[_0x466101(0x88)][_0x466101(0x84)]((_0x4b552,_0x4c93a5)=>{const _0x253cbb=_0x466101;if(!isObjectRecord(_0x4b552))return;adaptBffTarget(_0x4b552[_0x253cbb(0x80)],'$.commands['+_0x4c93a5+'].target',_0x1589c8);}),adaptResources(_0x3cdf0b[_0x466101(0x6a)],_0x466101(0x6f),_0x1589c8),{'manifest':_0x3cdf0b,'errors':_0x1589c8};}export function toPublicServiceTreeTarget(_0x8e94bc){const _0x795a17=a61_0x31a9,{scriptName:_0x5904e8,..._0x35aaf0}=_0x8e94bc;return typeof _0x5904e8===_0x795a17(0x72)&&_0x5904e8['trim']()&&(_0x35aaf0[_0x795a17(0x7c)]=_0x5904e8),_0x35aaf0;}export function toPublicNormalizedServiceTree(_0x212d45){const _0x596618=a61_0x31a9;return{..._0x212d45,'commands':_0x212d45[_0x596618(0x88)][_0x596618(0x83)](_0x144634=>({..._0x144634,'target':toPublicServiceTreeTarget(_0x144634['target'])}))};}function a61_0x31a9(_0x1c1e37,_0x13a7c3){_0x1c1e37=_0x1c1e37-0x67;const _0x54be1e=a61_0x54be();let _0x31a9c3=_0x54be1e[_0x1c1e37];return _0x31a9c3;}function adaptResources(_0x573223,_0x1800ff,_0xc52b81){const _0x451af0=a61_0x31a9;if(!isObjectRecord(_0x573223))return;for(const [_0x20230a,_0x2a51a9]of Object[_0x451af0(0x6b)](_0x573223)){if(!isObjectRecord(_0x2a51a9))continue;const _0x38c2ce=_0x1800ff+'.'+_0x20230a;if(isObjectRecord(_0x2a51a9['actions']))for(const [_0x4e887c,_0xeccc2b]of Object[_0x451af0(0x6b)](_0x2a51a9[_0x451af0(0x70)])){if(!isObjectRecord(_0xeccc2b))continue;const _0x50d8c1=_0x38c2ce+_0x451af0(0x69)+_0x4e887c,_0x41e7f5=isObjectRecord(_0xeccc2b['target'])&&_0xeccc2b[_0x451af0(0x80)]['kind']===_0x451af0(0x82);adaptBffTarget(_0xeccc2b['target'],_0x50d8c1+'.target',_0xc52b81),(_0x41e7f5||isBffAction(_0xeccc2b))&&adaptFunctionNameField(_0xeccc2b,_0x50d8c1,_0xc52b81);}adaptResources(_0x2a51a9[_0x451af0(0x6a)],_0x38c2ce+'.resources',_0xc52b81);}}function adaptBffTarget(_0x4eac76,_0x172611,_0x31f9e){const _0x3778f9=a61_0x31a9;if(!isObjectRecord(_0x4eac76)||_0x4eac76[_0x3778f9(0x75)]!==_0x3778f9(0x82))return;adaptFunctionNameField(_0x4eac76,_0x172611,_0x31f9e);}function adaptFunctionNameField(_0x464219,_0x43e80d,_0x2d022d){const _0x4fa7e7=a61_0x31a9;Object[_0x4fa7e7(0x71)][_0x4fa7e7(0x7a)][_0x4fa7e7(0x6c)](_0x464219,_0x4fa7e7(0x6e))&&_0x2d022d[_0x4fa7e7(0x67)]({'level':_0x4fa7e7(0x78),'path':_0x43e80d+_0x4fa7e7(0x76),'message':_0x4fa7e7(0x7b)});if(Object[_0x4fa7e7(0x71)][_0x4fa7e7(0x7a)]['call'](_0x464219,'functionName')){if(typeof _0x464219['functionName']!==_0x4fa7e7(0x72)||!_0x464219[_0x4fa7e7(0x7c)][_0x4fa7e7(0x7d)]()){_0x2d022d[_0x4fa7e7(0x67)]({'level':_0x4fa7e7(0x78),'path':_0x43e80d+'.functionName','message':_0x4fa7e7(0x86)}),delete _0x464219['functionName'];return;}_0x464219[_0x4fa7e7(0x6e)]=_0x464219[_0x4fa7e7(0x7c)],delete _0x464219[_0x4fa7e7(0x7c)];}}function isBffAction(_0x260a83){const _0x59cbbd=a61_0x31a9;return _0x260a83[_0x59cbbd(0x75)]===_0x59cbbd(0x82)||_0x260a83['action']===_0x59cbbd(0x87)||_0x260a83[_0x59cbbd(0x80)]===_0x59cbbd(0x87);}function cloneJsonValue(_0x3304da){const _0x44e36b=a61_0x31a9;if(Array[_0x44e36b(0x77)](_0x3304da))return _0x3304da[_0x44e36b(0x83)](_0x3f3813=>cloneJsonValue(_0x3f3813));if(isObjectRecord(_0x3304da))return Object[_0x44e36b(0x85)](Object[_0x44e36b(0x6b)](_0x3304da)['map'](([_0x41ab00,_0x40d5c2])=>[_0x41ab00,cloneJsonValue(_0x40d5c2)]));return _0x3304da;}function a61_0x54be(){const _0x3e0a80=['1428NrQAeO','hasOwnProperty','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','functionName','trim','933774bMwLAA','42CQPIDH','target','48212UyqsaS','bff','map','forEach','fromEntries','functionName\x20must\x20be\x20a\x20non-empty\x20string.','bff.exec','commands','864381smnOFq','push','144csGAde','.actions.','resources','entries','call','1430930fZMACX','scriptName','$.resources','actions','prototype','string','280648wzhbEt','233587XzwYCe','kind','.scriptName','isArray','error'];a61_0x54be=function(){return _0x3e0a80;};return a61_0x54be();}function isObjectRecord(_0x369a60){return Boolean(_0x369a60)&&typeof _0x369a60==='object'&&!Array['isArray'](_0x369a60);}
1
+ (function(_0x4dfdaa,_0x1fd047){const _0x25f7b3=a62_0x384a,_0x49c39b=_0x4dfdaa();while(!![]){try{const _0x4d04ff=parseInt(_0x25f7b3(0x1e0))/0x1+-parseInt(_0x25f7b3(0x1ec))/0x2+-parseInt(_0x25f7b3(0x1e4))/0x3+parseInt(_0x25f7b3(0x1d2))/0x4+-parseInt(_0x25f7b3(0x1e7))/0x5*(-parseInt(_0x25f7b3(0x1d0))/0x6)+parseInt(_0x25f7b3(0x1e2))/0x7+-parseInt(_0x25f7b3(0x1e6))/0x8;if(_0x4d04ff===_0x1fd047)break;else _0x49c39b['push'](_0x49c39b['shift']());}catch(_0x754c1){_0x49c39b['push'](_0x49c39b['shift']());}}}(a62_0x554b,0xaed0d));export function adaptServiceTreeManifestForLegacyFramework(_0x228728){const _0x4c5170=a62_0x384a,_0x3efe3b=cloneJsonValue(_0x228728),_0xacaaba=[];if(!isObjectRecord(_0x3efe3b))return{'manifest':_0x3efe3b,'errors':_0xacaaba};return Array[_0x4c5170(0x1ce)](_0x3efe3b['commands'])&&_0x3efe3b['commands'][_0x4c5170(0x1db)]((_0x4df190,_0x269f12)=>{const _0x1e4b33=_0x4c5170;if(!isObjectRecord(_0x4df190))return;adaptBffTarget(_0x4df190['target'],_0x1e4b33(0x1dc)+_0x269f12+_0x1e4b33(0x1e3),_0xacaaba);}),adaptResources(_0x3efe3b[_0x4c5170(0x1dd)],'$.resources',_0xacaaba),{'manifest':_0x3efe3b,'errors':_0xacaaba};}export function toPublicServiceTreeTarget(_0x1dfce6){const _0x4b44e8=a62_0x384a,{scriptName:_0x5dafb2,..._0x24cc8f}=_0x1dfce6;return typeof _0x5dafb2===_0x4b44e8(0x1e1)&&_0x5dafb2[_0x4b44e8(0x1d7)]()&&(_0x24cc8f[_0x4b44e8(0x1eb)]=_0x5dafb2),_0x24cc8f;}export function toPublicNormalizedServiceTree(_0x2e08fa){const _0x236b93=a62_0x384a;return{..._0x2e08fa,'commands':_0x2e08fa['commands'][_0x236b93(0x1d3)](_0x227981=>({..._0x227981,'target':toPublicServiceTreeTarget(_0x227981[_0x236b93(0x1ed)])}))};}function a62_0x554b(){const _0x170aac=['trim','entries','action','.actions.','forEach','$.commands[','resources','scriptName','.target','1401078fyuesD','string','9540937pXaOCc','].target','2298651dEyetA','kind','17313000sdbFbE','15ARCFEa','.functionName','.resources','functionName\x20must\x20be\x20a\x20non-empty\x20string.','functionName','1332268jjmjnZ','target','bff','isArray','push','1590504lTKCmv','bff.exec','3012800CorZIo','map','hasOwnProperty','error','actions'];a62_0x554b=function(){return _0x170aac;};return a62_0x554b();}function adaptResources(_0x13d3be,_0x198f61,_0x46cd2b){const _0x3aa4dc=a62_0x384a;if(!isObjectRecord(_0x13d3be))return;for(const [_0x4a27e1,_0x5dcf82]of Object[_0x3aa4dc(0x1d8)](_0x13d3be)){if(!isObjectRecord(_0x5dcf82))continue;const _0x5f33e6=_0x198f61+'.'+_0x4a27e1;if(isObjectRecord(_0x5dcf82[_0x3aa4dc(0x1d6)]))for(const [_0x226825,_0x5e0d69]of Object['entries'](_0x5dcf82['actions'])){if(!isObjectRecord(_0x5e0d69))continue;const _0x38e652=_0x5f33e6+_0x3aa4dc(0x1da)+_0x226825,_0x1484cc=isObjectRecord(_0x5e0d69['target'])&&_0x5e0d69[_0x3aa4dc(0x1ed)]['kind']===_0x3aa4dc(0x1cd);adaptBffTarget(_0x5e0d69[_0x3aa4dc(0x1ed)],_0x38e652+_0x3aa4dc(0x1df),_0x46cd2b),(_0x1484cc||isBffAction(_0x5e0d69))&&adaptFunctionNameField(_0x5e0d69,_0x38e652,_0x46cd2b);}adaptResources(_0x5dcf82[_0x3aa4dc(0x1dd)],_0x5f33e6+_0x3aa4dc(0x1e9),_0x46cd2b);}}function adaptBffTarget(_0x24e3f7,_0x327fa1,_0x1656dd){const _0x3c4c16=a62_0x384a;if(!isObjectRecord(_0x24e3f7)||_0x24e3f7[_0x3c4c16(0x1e5)]!==_0x3c4c16(0x1cd))return;adaptFunctionNameField(_0x24e3f7,_0x327fa1,_0x1656dd);}function adaptFunctionNameField(_0xbd3979,_0x16ea24,_0x250814){const _0x44e698=a62_0x384a;Object['prototype'][_0x44e698(0x1d4)]['call'](_0xbd3979,_0x44e698(0x1de))&&_0x250814['push']({'level':_0x44e698(0x1d5),'path':_0x16ea24+'.scriptName','message':'Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.'});if(Object['prototype'][_0x44e698(0x1d4)]['call'](_0xbd3979,'functionName')){if(typeof _0xbd3979['functionName']!==_0x44e698(0x1e1)||!_0xbd3979['functionName'][_0x44e698(0x1d7)]()){_0x250814[_0x44e698(0x1cf)]({'level':_0x44e698(0x1d5),'path':_0x16ea24+_0x44e698(0x1e8),'message':_0x44e698(0x1ea)}),delete _0xbd3979['functionName'];return;}_0xbd3979[_0x44e698(0x1de)]=_0xbd3979[_0x44e698(0x1eb)],delete _0xbd3979[_0x44e698(0x1eb)];}}function isBffAction(_0x1df1cb){const _0x5c4e4d=a62_0x384a;return _0x1df1cb[_0x5c4e4d(0x1e5)]===_0x5c4e4d(0x1cd)||_0x1df1cb[_0x5c4e4d(0x1d9)]===_0x5c4e4d(0x1d1)||_0x1df1cb[_0x5c4e4d(0x1ed)]==='bff.exec';}function cloneJsonValue(_0x4bdf74){const _0x361c76=a62_0x384a;if(Array[_0x361c76(0x1ce)](_0x4bdf74))return _0x4bdf74[_0x361c76(0x1d3)](_0x20a89f=>cloneJsonValue(_0x20a89f));if(isObjectRecord(_0x4bdf74))return Object['fromEntries'](Object['entries'](_0x4bdf74)[_0x361c76(0x1d3)](([_0x20e84d,_0x21589e])=>[_0x20e84d,cloneJsonValue(_0x21589e)]));return _0x4bdf74;}function a62_0x384a(_0x827f1c,_0x595ac2){_0x827f1c=_0x827f1c-0x1cd;const _0x554b62=a62_0x554b();let _0x384ab7=_0x554b62[_0x827f1c];return _0x384ab7;}function isObjectRecord(_0x5a9a35){const _0x2f5ba8=a62_0x384a;return Boolean(_0x5a9a35)&&typeof _0x5a9a35==='object'&&!Array[_0x2f5ba8(0x1ce)](_0x5a9a35);}
@@ -1 +1 @@
1
- const a62_0x59bb4d=a62_0x1367;(function(_0x4997a2,_0x4d4b56){const _0xbc700=a62_0x1367,_0x4a0611=_0x4997a2();while(!![]){try{const _0x458205=parseInt(_0xbc700(0x1f6))/0x1+parseInt(_0xbc700(0x21c))/0x2+parseInt(_0xbc700(0x208))/0x3+parseInt(_0xbc700(0x1f4))/0x4*(-parseInt(_0xbc700(0x204))/0x5)+parseInt(_0xbc700(0x20f))/0x6+-parseInt(_0xbc700(0x20b))/0x7*(parseInt(_0xbc700(0x1f2))/0x8)+parseInt(_0xbc700(0x1f5))/0x9*(-parseInt(_0xbc700(0x225))/0xa);if(_0x458205===_0x4d4b56)break;else _0x4a0611['push'](_0x4a0611['shift']());}catch(_0x35b00f){_0x4a0611['push'](_0x4a0611['shift']());}}}(a62_0x566d,0x691c9));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_0x1367(_0x169dfa,_0x27bdd3){_0x169dfa=_0x169dfa-0x1e3;const _0x566dfc=a62_0x566d();let _0x136721=_0x566dfc[_0x169dfa];return _0x136721;}const FILE_FLAG={'name':'file','type':a62_0x59bb4d(0x201),'required':!![],'description':a62_0x59bb4d(0x22a)},SERVICE_FLAG={'name':'service','type':a62_0x59bb4d(0x201),'required':!![],'description':a62_0x59bb4d(0x1fa),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a62_0x59bb4d(0x20e)}};function summarizeService(_0x5a01d1){const _0x7170b4=a62_0x59bb4d;return{'serviceCode':_0x5a01d1['serviceCode'],'name':_0x5a01d1[_0x7170b4(0x228)][_0x7170b4(0x1e5)][_0x7170b4(0x212)],'version':_0x5a01d1[_0x7170b4(0x1e6)],'importedAt':_0x5a01d1[_0x7170b4(0x21e)],'source':_0x5a01d1[_0x7170b4(0x1ee)],'commandCount':_0x5a01d1[_0x7170b4(0x228)][_0x7170b4(0x1e8)][_0x7170b4(0x1f8)],'commands':_0x5a01d1['normalizedManifest'][_0x7170b4(0x1e8)][_0x7170b4(0x21d)](_0x4e7005=>({'path':_0x4e7005[_0x7170b4(0x1f7)],'description':_0x4e7005[_0x7170b4(0x1fb)],'risk':_0x4e7005[_0x7170b4(0x202)],'target':toPublicServiceTreeTarget(_0x4e7005[_0x7170b4(0x221)]),'flags':_0x4e7005['flags'][_0x7170b4(0x21d)](_0x1a2eb2=>({'name':_0x1a2eb2[_0x7170b4(0x212)],'cliName':_0x1a2eb2['cliName'],'type':_0x1a2eb2[_0x7170b4(0x209)],'required':_0x1a2eb2[_0x7170b4(0x216)]===!![]}))}))};}function summarizeLoadedManifest(_0x336147){const _0x25083d=a62_0x59bb4d;return{'service':_0x336147[_0x25083d(0x228)]?.[_0x25083d(0x1e5)],'version':_0x336147[_0x25083d(0x228)]?.[_0x25083d(0x1e6)],'commandCount':_0x336147[_0x25083d(0x228)]?.[_0x25083d(0x1e8)]['length']??0x0,'commands':_0x336147[_0x25083d(0x228)]?.[_0x25083d(0x1e8)][_0x25083d(0x21d)](_0xaea6d6=>({'path':_0xaea6d6[_0x25083d(0x1f7)],'risk':_0xaea6d6['risk'],'target':toPublicServiceTreeTarget(_0xaea6d6[_0x25083d(0x221)])}))??[],'registryIndex':_0x336147['registryIndex'],'registryServiceCode':_0x336147['registryServiceCode'],'errors':_0x336147[_0x25083d(0x217)]['errors'],'warnings':_0x336147[_0x25083d(0x217)][_0x25083d(0x21b)]};}export const serviceDefinitions=[{'service':a62_0x59bb4d(0x1e5),'command':a62_0x59bb4d(0x1f3),'description':a62_0x59bb4d(0x205),'risk':a62_0x59bb4d(0x1fc),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x5190d1){const _0x5d43b1=a62_0x59bb4d,_0x52c448=loadServiceManifestFromFile(_0x5190d1[_0x5d43b1(0x227)]('file'));if(!_0x52c448[_0x5d43b1(0x217)]['ok'])return{'ok':![],'data':{'file':_0x52c448[_0x5d43b1(0x20c)],'hash':_0x52c448[_0x5d43b1(0x214)],'kind':_0x52c448[_0x5d43b1(0x207)],'serviceCount':_0x52c448[_0x5d43b1(0x200)][_0x5d43b1(0x1f8)],'services':_0x52c448[_0x5d43b1(0x200)][_0x5d43b1(0x21d)](summarizeLoadedManifest),'errors':_0x52c448[_0x5d43b1(0x217)][_0x5d43b1(0x219)],'warnings':_0x52c448[_0x5d43b1(0x217)][_0x5d43b1(0x21b)]},'message':formatValidationFailure(_0x52c448[_0x5d43b1(0x217)])};if(_0x52c448['kind']===_0x5d43b1(0x226)||_0x52c448[_0x5d43b1(0x200)]['length']!==0x1)return{'ok':!![],'data':{'file':_0x52c448[_0x5d43b1(0x20c)],'hash':_0x52c448[_0x5d43b1(0x214)],'kind':_0x52c448[_0x5d43b1(0x207)],'serviceCount':_0x52c448[_0x5d43b1(0x200)][_0x5d43b1(0x1f8)],'commandCount':_0x52c448[_0x5d43b1(0x200)][_0x5d43b1(0x206)]((_0x4204ba,_0x2c1be3)=>_0x4204ba+(_0x2c1be3[_0x5d43b1(0x228)]?.[_0x5d43b1(0x1e8)][_0x5d43b1(0x1f8)]??0x0),0x0),'services':_0x52c448[_0x5d43b1(0x200)][_0x5d43b1(0x21d)](summarizeLoadedManifest),'warnings':_0x52c448[_0x5d43b1(0x217)][_0x5d43b1(0x21b)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x52c448[_0x5d43b1(0x20c)],'hash':_0x52c448[_0x5d43b1(0x214)],'kind':_0x52c448[_0x5d43b1(0x207)],'service':_0x52c448[_0x5d43b1(0x228)]?.[_0x5d43b1(0x1e5)],'version':_0x52c448[_0x5d43b1(0x228)]?.[_0x5d43b1(0x1e6)],'commandCount':_0x52c448[_0x5d43b1(0x228)]?.[_0x5d43b1(0x1e8)][_0x5d43b1(0x1f8)]??0x0,'commands':_0x52c448[_0x5d43b1(0x228)]?.['commands'][_0x5d43b1(0x21d)](_0x3cfff1=>({'path':_0x3cfff1[_0x5d43b1(0x1f7)],'risk':_0x3cfff1['risk'],'target':toPublicServiceTreeTarget(_0x3cfff1['target'])})),'warnings':_0x52c448[_0x5d43b1(0x217)][_0x5d43b1(0x21b)]},'message':_0x5d43b1(0x220)};}},{'service':'service','command':a62_0x59bb4d(0x21a),'description':'Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','risk':a62_0x59bb4d(0x1fd),'confirmationDescription':a62_0x59bb4d(0x1e4),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x2011b4){const _0x376608=a62_0x59bb4d,_0xc509d2=loadServiceManifestFromFile(_0x2011b4[_0x376608(0x227)]('file'));return{'method':_0x376608(0x203),'url':getServiceRegistryPath(),'body':{'file':_0xc509d2['filePath'],'hash':_0xc509d2[_0x376608(0x214)],'kind':_0xc509d2[_0x376608(0x207)],'ok':_0xc509d2['report']['ok'],'service':_0xc509d2['normalizedManifest']?.[_0x376608(0x1e5)],'version':_0xc509d2[_0x376608(0x228)]?.['version'],'serviceCount':_0xc509d2['manifests'][_0x376608(0x1f8)],'services':_0xc509d2[_0x376608(0x200)]['map'](_0x2ac454=>({'service':_0x2ac454[_0x376608(0x228)]?.[_0x376608(0x1e5)],'version':_0x2ac454[_0x376608(0x228)]?.[_0x376608(0x1e6)],'commandCount':_0x2ac454[_0x376608(0x228)]?.['commands'][_0x376608(0x1f8)]??0x0,'errors':_0x2ac454['report']['errors']})),'errors':_0xc509d2[_0x376608(0x217)][_0x376608(0x219)],'commandCount':_0xc509d2[_0x376608(0x228)]?.[_0x376608(0x1e8)][_0x376608(0x1f8)]??0x0},'description':_0x376608(0x1e9)};},async 'execute'(_0x3bb96d){const _0x344107=a62_0x59bb4d,_0x4eeeb7=importServiceManifest(_0x3bb96d[_0x344107(0x227)]('file'));if(_0x4eeeb7[_0x344107(0x218)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x4eeeb7['registryPath'],'imported':_0x4eeeb7[_0x344107(0x1ec)],'updated':_0x4eeeb7[_0x344107(0x20d)],'serviceCount':_0x4eeeb7['serviceCount'],'services':_0x4eeeb7[_0x344107(0x218)][_0x344107(0x21d)](summarizeService)},'message':'Imported\x20'+_0x4eeeb7[_0x344107(0x1ec)]+_0x344107(0x211)+_0x4eeeb7['updated']+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x4eeeb7['registryPath'],'replaced':_0x4eeeb7['replaced'],'imported':_0x4eeeb7[_0x344107(0x1ec)],'updated':_0x4eeeb7['updated'],'serviceCount':_0x4eeeb7['serviceCount'],'service':summarizeService(_0x4eeeb7[_0x344107(0x224)])},'message':(_0x4eeeb7[_0x344107(0x1fe)]?_0x344107(0x1ef):_0x344107(0x215))+_0x344107(0x1ea)+_0x4eeeb7['entry'][_0x344107(0x1ff)]+'.'};}},{'service':a62_0x59bb4d(0x1e5),'command':a62_0x59bb4d(0x223),'description':a62_0x59bb4d(0x21f),'risk':'write','confirmationDescription':a62_0x59bb4d(0x213),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x300415){const _0x3eda27=a62_0x59bb4d,_0x47400f=getLocalServiceEntry(_0x300415['str'](_0x3eda27(0x1e5)));return{'method':_0x3eda27(0x203),'url':_0x300415[_0x3eda27(0x227)](_0x3eda27(0x20a)),'body':{'service':_0x300415['str']('service'),'found':Boolean(_0x47400f),'version':_0x47400f?.[_0x3eda27(0x1e6)],'source':_0x47400f?.[_0x3eda27(0x1ee)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x5ba330){const _0x58dccb=a62_0x59bb4d,_0x50baab=exportServiceManifest(_0x5ba330[_0x58dccb(0x227)]('service'),_0x5ba330[_0x58dccb(0x227)]('file'));return{'ok':!![],'data':{'registryPath':_0x50baab[_0x58dccb(0x1f1)],'file':_0x50baab[_0x58dccb(0x20c)],'service':summarizeService(_0x50baab['entry'])},'message':_0x58dccb(0x222)+_0x50baab[_0x58dccb(0x224)]['serviceCode']+'.'};}},{'service':a62_0x59bb4d(0x1e5),'command':'list','description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':a62_0x59bb4d(0x1fc),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x2d18c0=a62_0x59bb4d,_0x18d546=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x18d546[_0x2d18c0(0x1f8)],'services':_0x18d546['map'](summarizeService)}};}},{'service':'service','command':a62_0x59bb4d(0x1e7),'description':a62_0x59bb4d(0x1e3),'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'(_0x29b658){const _0x2e204e=a62_0x59bb4d,_0x242953=getLocalServiceEntry(_0x29b658[_0x2e204e(0x227)]('service'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x29b658[_0x2e204e(0x227)](_0x2e204e(0x1e5)),'found':Boolean(_0x242953),'version':_0x242953?.[_0x2e204e(0x1e6)],'source':_0x242953?.['source']},'description':_0x2e204e(0x210)};},async 'execute'(_0x416237){const _0x1aee00=a62_0x59bb4d,_0x2fe66c=removeServiceManifest(_0x416237[_0x1aee00(0x227)](_0x1aee00(0x1e5)));return{'ok':!![],'data':{'registryPath':_0x2fe66c['registryPath'],'serviceCount':_0x2fe66c[_0x1aee00(0x1eb)],'service':summarizeService(_0x2fe66c[_0x1aee00(0x224)])},'message':_0x1aee00(0x1f0)+_0x2fe66c[_0x1aee00(0x224)]['serviceCode']+'.'};}},{'service':a62_0x59bb4d(0x1e5),'command':a62_0x59bb4d(0x1f9),'description':'Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','risk':a62_0x59bb4d(0x1fc),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x27bd58){const _0x3954a9=a62_0x59bb4d,_0x34806d=getLocalServiceEntry(_0x27bd58[_0x3954a9(0x227)]('service'));if(!_0x34806d)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x27bd58[_0x3954a9(0x227)](_0x3954a9(0x1e5))},'message':_0x3954a9(0x1ed)+_0x27bd58[_0x3954a9(0x227)](_0x3954a9(0x1e5))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x34806d),'manifest':_0x34806d[_0x3954a9(0x229)],'normalizedManifest':toPublicNormalizedServiceTree(_0x34806d[_0x3954a9(0x228)])}};}}];function a62_0x566d(){const _0x1e5beb=['file','28ShDLwG','filePath','updated','lower\x20kebab-case\x20service\x20code','149376dwhGJg','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','\x20service(s),\x20updated\x20','name','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.','hash','Imported','required','report','entries','errors','import','warnings','580518wtikjk','map','importedAt','Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','Service\x20manifest\x20validation\x20passed.','target','Exported\x20service\x20','export','entry','20rmpGtL','registry','str','normalizedManifest','manifest','Service\x20Tree\x20manifest\x20file\x20path','Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','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.','service','version','remove','commands','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','\x20service\x20','serviceCount','imported','Local\x20service\x20not\x20found:\x20','source','Updated','Removed\x20service\x20','registryPath','592400PbMMRN','validate','8tnxISj','948357DRrSsQ','549771AVTsjq','cliPath','length','detail','Local\x20service\x20code,\x20for\x20example\x20crm','description','read','write','replaced','serviceCode','manifests','string','risk','WRITE','176325aEBAvs','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','reduce','kind','429261zdXeTC','type'];a62_0x566d=function(){return _0x1e5beb;};return a62_0x566d();}
1
+ const a63_0x3c0973=a63_0x47d5;(function(_0x4418c7,_0x3a1b29){const _0x560034=a63_0x47d5,_0x1066a6=_0x4418c7();while(!![]){try{const _0x1be83a=parseInt(_0x560034(0x13e))/0x1*(parseInt(_0x560034(0x12a))/0x2)+parseInt(_0x560034(0x16a))/0x3+parseInt(_0x560034(0x159))/0x4+parseInt(_0x560034(0x142))/0x5*(parseInt(_0x560034(0x160))/0x6)+parseInt(_0x560034(0x13f))/0x7+parseInt(_0x560034(0x165))/0x8+-parseInt(_0x560034(0x14e))/0x9;if(_0x1be83a===_0x3a1b29)break;else _0x1066a6['push'](_0x1066a6['shift']());}catch(_0x2e81e6){_0x1066a6['push'](_0x1066a6['shift']());}}}(a63_0x53a4,0x3f208));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':a63_0x3c0973(0x141),'type':a63_0x3c0973(0x145),'required':!![],'description':a63_0x3c0973(0x13b)},SERVICE_FLAG={'name':a63_0x3c0973(0x125),'type':a63_0x3c0973(0x145),'required':!![],'description':a63_0x3c0973(0x136),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a63_0x3c0973(0x15b)}};function summarizeService(_0x27096c){const _0x300b53=a63_0x3c0973;return{'serviceCode':_0x27096c[_0x300b53(0x163)],'name':_0x27096c[_0x300b53(0x140)][_0x300b53(0x125)][_0x300b53(0x139)],'version':_0x27096c[_0x300b53(0x152)],'importedAt':_0x27096c['importedAt'],'source':_0x27096c['source'],'commandCount':_0x27096c[_0x300b53(0x140)][_0x300b53(0x126)][_0x300b53(0x14f)],'commands':_0x27096c[_0x300b53(0x140)][_0x300b53(0x126)][_0x300b53(0x162)](_0x432b1d=>({'path':_0x432b1d[_0x300b53(0x147)],'description':_0x432b1d['description'],'risk':_0x432b1d[_0x300b53(0x158)],'target':toPublicServiceTreeTarget(_0x432b1d[_0x300b53(0x12b)]),'flags':_0x432b1d[_0x300b53(0x157)][_0x300b53(0x162)](_0x5b772f=>({'name':_0x5b772f[_0x300b53(0x139)],'cliName':_0x5b772f[_0x300b53(0x15f)],'type':_0x5b772f['type'],'required':_0x5b772f['required']===!![]}))}))};}function summarizeLoadedManifest(_0x53b7e9){const _0x416e4a=a63_0x3c0973;return{'service':_0x53b7e9[_0x416e4a(0x140)]?.[_0x416e4a(0x125)],'version':_0x53b7e9[_0x416e4a(0x140)]?.[_0x416e4a(0x152)],'commandCount':_0x53b7e9[_0x416e4a(0x140)]?.[_0x416e4a(0x126)]['length']??0x0,'commands':_0x53b7e9[_0x416e4a(0x140)]?.[_0x416e4a(0x126)][_0x416e4a(0x162)](_0x32aca6=>({'path':_0x32aca6[_0x416e4a(0x147)],'risk':_0x32aca6[_0x416e4a(0x158)],'target':toPublicServiceTreeTarget(_0x32aca6[_0x416e4a(0x12b)])}))??[],'registryIndex':_0x53b7e9[_0x416e4a(0x144)],'registryServiceCode':_0x53b7e9[_0x416e4a(0x12d)],'errors':_0x53b7e9[_0x416e4a(0x128)][_0x416e4a(0x13a)],'warnings':_0x53b7e9[_0x416e4a(0x128)][_0x416e4a(0x130)]};}function a63_0x47d5(_0x15b214,_0x5b96cf){_0x15b214=_0x15b214-0x125;const _0x53a41c=a63_0x53a4();let _0x47d508=_0x53a41c[_0x15b214];return _0x47d508;}function a63_0x53a4(){const _0x320bfe=['report','imported','379172zVvNJr','target','kind','registryServiceCode','Exported\x20service\x20','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','warnings','Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','replaced','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.','filePath','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','Local\x20service\x20code,\x20for\x20example\x20crm','Removes\x20the\x20given\x20service\x20manifest\x20from\x20the\x20local\x20Service\x20Tree\x20registry.\x20Dynamic\x20commands\x20from\x20that\x20manifest\x20will\x20no\x20longer\x20be\x20available.','Imported\x20','name','errors','Service\x20Tree\x20manifest\x20file\x20path','read','manifest','1xZJrOF','1961393NUegrA','normalizedManifest','file','2053505rezSsc','Local\x20service\x20not\x20found:\x20','registryIndex','string','registry','cliPath','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.','write','entry','serviceCount','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','str','9510840NxCXVo','length','entries','Service\x20manifest\x20validation\x20passed.','version','remove','import','\x20service(s),\x20updated\x20','export','flags','risk','396616LClexb','updated','lower\x20kebab-case\x20service\x20code','WRITE','registryPath','Removed\x20service\x20','cliName','6pEnxrM','manifests','map','serviceCode','reduce','1706072BTimPG','Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','Service\x20registry\x20validation\x20passed.','hash','\x20service\x20','367287VqoXQF','service','commands','Imported'];a63_0x53a4=function(){return _0x320bfe;};return a63_0x53a4();}export const serviceDefinitions=[{'service':a63_0x3c0973(0x125),'command':'validate','description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a63_0x3c0973(0x13c),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x35810b){const _0x5b34c1=a63_0x3c0973,_0x45f61b=loadServiceManifestFromFile(_0x35810b['str']('file'));if(!_0x45f61b['report']['ok'])return{'ok':![],'data':{'file':_0x45f61b[_0x5b34c1(0x134)],'hash':_0x45f61b[_0x5b34c1(0x168)],'kind':_0x45f61b['kind'],'serviceCount':_0x45f61b['manifests'][_0x5b34c1(0x14f)],'services':_0x45f61b[_0x5b34c1(0x161)][_0x5b34c1(0x162)](summarizeLoadedManifest),'errors':_0x45f61b['report'][_0x5b34c1(0x13a)],'warnings':_0x45f61b[_0x5b34c1(0x128)][_0x5b34c1(0x130)]},'message':formatValidationFailure(_0x45f61b[_0x5b34c1(0x128)])};if(_0x45f61b['kind']===_0x5b34c1(0x146)||_0x45f61b[_0x5b34c1(0x161)]['length']!==0x1)return{'ok':!![],'data':{'file':_0x45f61b['filePath'],'hash':_0x45f61b[_0x5b34c1(0x168)],'kind':_0x45f61b[_0x5b34c1(0x12c)],'serviceCount':_0x45f61b['manifests'][_0x5b34c1(0x14f)],'commandCount':_0x45f61b[_0x5b34c1(0x161)][_0x5b34c1(0x164)]((_0x478661,_0xb2db23)=>_0x478661+(_0xb2db23[_0x5b34c1(0x140)]?.[_0x5b34c1(0x126)][_0x5b34c1(0x14f)]??0x0),0x0),'services':_0x45f61b[_0x5b34c1(0x161)][_0x5b34c1(0x162)](summarizeLoadedManifest),'warnings':_0x45f61b['report']['warnings']},'message':_0x5b34c1(0x167)};return{'ok':!![],'data':{'file':_0x45f61b[_0x5b34c1(0x134)],'hash':_0x45f61b[_0x5b34c1(0x168)],'kind':_0x45f61b['kind'],'service':_0x45f61b[_0x5b34c1(0x140)]?.[_0x5b34c1(0x125)],'version':_0x45f61b[_0x5b34c1(0x140)]?.[_0x5b34c1(0x152)],'commandCount':_0x45f61b[_0x5b34c1(0x140)]?.[_0x5b34c1(0x126)][_0x5b34c1(0x14f)]??0x0,'commands':_0x45f61b[_0x5b34c1(0x140)]?.[_0x5b34c1(0x126)][_0x5b34c1(0x162)](_0x45d66b=>({'path':_0x45d66b[_0x5b34c1(0x147)],'risk':_0x45d66b[_0x5b34c1(0x158)],'target':toPublicServiceTreeTarget(_0x45d66b[_0x5b34c1(0x12b)])})),'warnings':_0x45f61b[_0x5b34c1(0x128)][_0x5b34c1(0x130)]},'message':_0x5b34c1(0x151)};}},{'service':a63_0x3c0973(0x125),'command':a63_0x3c0973(0x154),'description':'Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','risk':a63_0x3c0973(0x149),'confirmationDescription':a63_0x3c0973(0x133),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x278587){const _0x4496e8=a63_0x3c0973,_0x1c33a5=loadServiceManifestFromFile(_0x278587[_0x4496e8(0x14d)](_0x4496e8(0x141)));return{'method':_0x4496e8(0x15c),'url':getServiceRegistryPath(),'body':{'file':_0x1c33a5[_0x4496e8(0x134)],'hash':_0x1c33a5[_0x4496e8(0x168)],'kind':_0x1c33a5[_0x4496e8(0x12c)],'ok':_0x1c33a5['report']['ok'],'service':_0x1c33a5['normalizedManifest']?.[_0x4496e8(0x125)],'version':_0x1c33a5[_0x4496e8(0x140)]?.['version'],'serviceCount':_0x1c33a5[_0x4496e8(0x161)]['length'],'services':_0x1c33a5['manifests'][_0x4496e8(0x162)](_0x128d52=>({'service':_0x128d52[_0x4496e8(0x140)]?.[_0x4496e8(0x125)],'version':_0x128d52[_0x4496e8(0x140)]?.['version'],'commandCount':_0x128d52[_0x4496e8(0x140)]?.[_0x4496e8(0x126)][_0x4496e8(0x14f)]??0x0,'errors':_0x128d52[_0x4496e8(0x128)][_0x4496e8(0x13a)]})),'errors':_0x1c33a5[_0x4496e8(0x128)][_0x4496e8(0x13a)],'commandCount':_0x1c33a5[_0x4496e8(0x140)]?.['commands']['length']??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x54de1e){const _0x2db5a6=a63_0x3c0973,_0x30575c=importServiceManifest(_0x54de1e[_0x2db5a6(0x14d)](_0x2db5a6(0x141)));if(_0x30575c[_0x2db5a6(0x150)][_0x2db5a6(0x14f)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x30575c[_0x2db5a6(0x15d)],'imported':_0x30575c['imported'],'updated':_0x30575c[_0x2db5a6(0x15a)],'serviceCount':_0x30575c[_0x2db5a6(0x14b)],'services':_0x30575c[_0x2db5a6(0x150)][_0x2db5a6(0x162)](summarizeService)},'message':_0x2db5a6(0x138)+_0x30575c[_0x2db5a6(0x129)]+_0x2db5a6(0x155)+_0x30575c['updated']+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x30575c['registryPath'],'replaced':_0x30575c[_0x2db5a6(0x132)],'imported':_0x30575c['imported'],'updated':_0x30575c[_0x2db5a6(0x15a)],'serviceCount':_0x30575c['serviceCount'],'service':summarizeService(_0x30575c[_0x2db5a6(0x14a)])},'message':(_0x30575c[_0x2db5a6(0x132)]?'Updated':_0x2db5a6(0x127))+_0x2db5a6(0x169)+_0x30575c[_0x2db5a6(0x14a)]['serviceCode']+'.'};}},{'service':a63_0x3c0973(0x125),'command':a63_0x3c0973(0x156),'description':a63_0x3c0973(0x166),'risk':a63_0x3c0973(0x149),'confirmationDescription':a63_0x3c0973(0x148),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x94edd6){const _0x3b37ac=a63_0x3c0973,_0x111f4b=getLocalServiceEntry(_0x94edd6[_0x3b37ac(0x14d)](_0x3b37ac(0x125)));return{'method':_0x3b37ac(0x15c),'url':_0x94edd6[_0x3b37ac(0x14d)]('file'),'body':{'service':_0x94edd6[_0x3b37ac(0x14d)](_0x3b37ac(0x125)),'found':Boolean(_0x111f4b),'version':_0x111f4b?.[_0x3b37ac(0x152)],'source':_0x111f4b?.['source']},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x5c9509){const _0x3aa34a=a63_0x3c0973,_0x44af4a=exportServiceManifest(_0x5c9509['str']('service'),_0x5c9509[_0x3aa34a(0x14d)](_0x3aa34a(0x141)));return{'ok':!![],'data':{'registryPath':_0x44af4a[_0x3aa34a(0x15d)],'file':_0x44af4a[_0x3aa34a(0x134)],'service':summarizeService(_0x44af4a[_0x3aa34a(0x14a)])},'message':_0x3aa34a(0x12e)+_0x44af4a[_0x3aa34a(0x14a)]['serviceCode']+'.'};}},{'service':a63_0x3c0973(0x125),'command':'list','description':a63_0x3c0973(0x12f),'risk':a63_0x3c0973(0x13c),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x327cea=a63_0x3c0973,_0x1b7b8b=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x1b7b8b[_0x327cea(0x14f)],'services':_0x1b7b8b[_0x327cea(0x162)](summarizeService)}};}},{'service':'service','command':a63_0x3c0973(0x153),'description':a63_0x3c0973(0x131),'risk':a63_0x3c0973(0x149),'confirmationDescription':a63_0x3c0973(0x137),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x478aa2){const _0x33f907=a63_0x3c0973,_0x4a8a7e=getLocalServiceEntry(_0x478aa2[_0x33f907(0x14d)](_0x33f907(0x125)));return{'method':_0x33f907(0x15c),'url':getServiceRegistryPath(),'body':{'service':_0x478aa2[_0x33f907(0x14d)](_0x33f907(0x125)),'found':Boolean(_0x4a8a7e),'version':_0x4a8a7e?.['version'],'source':_0x4a8a7e?.['source']},'description':_0x33f907(0x135)};},async 'execute'(_0x17ba98){const _0x5e9503=a63_0x3c0973,_0x208dc3=removeServiceManifest(_0x17ba98[_0x5e9503(0x14d)]('service'));return{'ok':!![],'data':{'registryPath':_0x208dc3[_0x5e9503(0x15d)],'serviceCount':_0x208dc3[_0x5e9503(0x14b)],'service':summarizeService(_0x208dc3['entry'])},'message':_0x5e9503(0x15e)+_0x208dc3[_0x5e9503(0x14a)][_0x5e9503(0x163)]+'.'};}},{'service':'service','command':'detail','description':a63_0x3c0973(0x14c),'risk':a63_0x3c0973(0x13c),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x420b3d){const _0x2a4bd7=a63_0x3c0973,_0x5f545d=getLocalServiceEntry(_0x420b3d['str']('service'));if(!_0x5f545d)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x420b3d[_0x2a4bd7(0x14d)]('service')},'message':_0x2a4bd7(0x143)+_0x420b3d[_0x2a4bd7(0x14d)](_0x2a4bd7(0x125))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x5f545d),'manifest':_0x5f545d[_0x2a4bd7(0x13d)],'normalizedManifest':toPublicNormalizedServiceTree(_0x5f545d['normalizedManifest'])}};}}];
@@ -1 +1 @@
1
- const a63_0x518345=a63_0x3e24;function a63_0x516e(){const _0x14511c=['Unsupported\x20schemaVersion:\x20','32645619soOKuu','Remove\x20or\x20migrate\x20','normalizedManifest','string','code','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','source','map','Service\x20manifest\x20validation\x20failed:\x0a','digest','reduce','bff\x20target\x20requires\x20functionName.','593262BeJoZo','message','registryIndex','Invalid\x20service\x20manifest\x20JSON:\x20','$.services[','202804HnTXeN','ENOENT','startsWith','target','schemaVersion','invalid','10pymOmL','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','service','description','homeDir','cliPath','utf8','1751624kyDwsR','object','service.json','Local\x20service\x20not\x20found:\x20','Cannot\x20write\x20service\x20registry:\x20','report','commandCount','missing','command','findIndex','6oOBRsi','Unsupported\x20service\x20registry\x20schemaVersion:\x20','sha256','kind','CliError','stringify','30lOQarm','errors','path','8566936tOATnr','services','parse','now','localeCompare','file','manifest','validation','toISOString','.tmp','length','2249660blcPiD','warnings','sort','commands','name','4283540peYMsU','].manifest.','slice','Service\x20manifest\x20file\x20not\x20found:\x20','trim','splice','update','Invalid\x20service\x20registry\x20JSON:\x20','updatedAt','serviceCode','hex','importedAt','isArray','].manifest','manifests'];a63_0x516e=function(){return _0x14511c;};return a63_0x516e();}(function(_0x572392,_0x222149){const _0xcafae2=a63_0x3e24,_0x5953a6=_0x572392();while(!![]){try{const _0x11625e=parseInt(_0xcafae2(0x1c4))/0x1+-parseInt(_0xcafae2(0x1d6))/0x2+-parseInt(_0xcafae2(0x195))/0x3*(parseInt(_0xcafae2(0x1c9))/0x4)+-parseInt(_0xcafae2(0x1a8))/0x5*(parseInt(_0xcafae2(0x18f))/0x6)+-parseInt(_0xcafae2(0x1a3))/0x7+-parseInt(_0xcafae2(0x198))/0x8+parseInt(_0xcafae2(0x1b8))/0x9*(parseInt(_0xcafae2(0x1cf))/0xa);if(_0x11625e===_0x222149)break;else _0x5953a6['push'](_0x5953a6['shift']());}catch(_0x1521ca){_0x5953a6['push'](_0x5953a6['shift']());}}}(a63_0x516e,0x8fbe8));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_0x518345(0x1d8);export function getServiceRegistryPath(_0x3b4b30={}){const _0x2f2520=a63_0x518345;return resolve(_0x3b4b30[_0x2f2520(0x1d3)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}function a63_0x3e24(_0x41c0f4,_0x2cce85){_0x41c0f4=_0x41c0f4-0x18e;const _0x516ec4=a63_0x516e();let _0x3e2495=_0x516ec4[_0x41c0f4];return _0x3e2495;}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0xcb76cb={}){const _0x57c2d3=a63_0x518345,_0x2123f0=getServiceRegistryPath(_0xcb76cb);if(!existsSync(_0x2123f0))return emptyServiceRegistry();try{const _0x4a8240=readFileSync(_0x2123f0,'utf8');if(!_0x4a8240['trim']())return emptyServiceRegistry();const _0x3d128c=JSON[_0x57c2d3(0x19a)](_0x4a8240);if(_0x3d128c[_0x57c2d3(0x1cd)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x57c2d3(0x190)+String(_0x3d128c[_0x57c2d3(0x1cd)]),_0x57c2d3(0x1b9)+_0x2123f0+'.');if(!Array['isArray'](_0x3d128c['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3d128c[_0x57c2d3(0x1b0)],'services':_0x3d128c[_0x57c2d3(0x199)]};}catch(_0x2fabda){if(_0x2fabda instanceof Error&&_0x2fabda[_0x57c2d3(0x1a7)]===_0x57c2d3(0x193))throw _0x2fabda;throw CliErrors[_0x57c2d3(0x19f)](_0x57c2d3(0x1af)+_0x2123f0,_0x57c2d3(0x1bd));}}export function writeServiceRegistry(_0xda84f2,_0x452d2e={}){const _0x2b0924=a63_0x518345,_0x25f06f=getServiceRegistryPath(_0x452d2e),_0x646975=dirname(_0x25f06f);!existsSync(_0x646975)&&mkdirSync(_0x646975,{'recursive':!![]});const _0x5602f9=_0x25f06f+_0x2b0924(0x1a1);try{writeFileSync(_0x5602f9,JSON[_0x2b0924(0x194)](_0xda84f2,null,0x2)+'\x0a',{'encoding':_0x2b0924(0x1d5),'mode':0x180}),renameSync(_0x5602f9,_0x25f06f);}catch(_0x5944c9){try{unlinkSync(_0x5602f9);}catch{}if(_0x5944c9?.['code']===_0x2b0924(0x1ca))throw CliErrors[_0x2b0924(0x19f)](_0x2b0924(0x1da)+_0x25f06f);throw _0x5944c9;}return _0x25f06f;}export function loadServiceManifestFromFile(_0x321f0b){const _0x7b5839=a63_0x518345,_0x33f63d=resolve(_0x321f0b);if(!existsSync(_0x33f63d))throw CliErrors[_0x7b5839(0x19f)](_0x7b5839(0x1ab)+_0x321f0b);let _0xc72715;const _0x1cdfc1=readFileSync(_0x33f63d,_0x7b5839(0x1d5));try{_0xc72715=JSON['parse'](_0x1cdfc1);}catch{throw CliErrors['validation'](_0x7b5839(0x1c7)+_0x321f0b,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x6ebff0=sha256(_0x1cdfc1),_0x19c94e=extractLoadedServiceManifests(_0xc72715,_0x6ebff0),_0x436be7=aggregateValidationReports(_0x19c94e),_0x197dd8=_0x19c94e[0x0];return{'filePath':_0x33f63d,'hash':_0x6ebff0,'kind':isServiceRegistryLike(_0xc72715)?'registry':'manifest','manifest':_0x197dd8?.[_0x7b5839(0x19e)]??_0xc72715,'report':_0x436be7,'normalizedManifest':_0x19c94e[_0x7b5839(0x1a2)]===0x1?_0x197dd8?.[_0x7b5839(0x1ba)]:undefined,'manifests':_0x19c94e};}export function importServiceManifest(_0x2aae8e,_0x1bf4e4={}){const _0x5d5441=a63_0x518345,_0x11d0d1=loadServiceManifestFromFile(_0x2aae8e);if(!_0x11d0d1[_0x5d5441(0x1db)]['ok'])throw CliErrors[_0x5d5441(0x19f)](formatValidationFailure(_0x11d0d1[_0x5d5441(0x1db)]),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x11d0d1[_0x5d5441(0x1b6)][_0x5d5441(0x1a2)]===0x0)throw CliErrors[_0x5d5441(0x19f)]('Service\x20registry\x20has\x20no\x20services\x20to\x20import.','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.');const _0x2fb8f3=readServiceRegistry(_0x1bf4e4),_0x30577d=(_0x1bf4e4[_0x5d5441(0x19b)]??(()=>new Date()))()[_0x5d5441(0x1a0)](),_0x2b7307=[];let _0x26f6af=0x0,_0x4c1aec=0x0;for(const _0x26f725 of _0x11d0d1[_0x5d5441(0x1b6)]){if(!_0x26f725[_0x5d5441(0x1ba)])continue;const _0x3ca470=_0x26f725[_0x5d5441(0x1ba)]['service'][_0x5d5441(0x1bc)],_0x264fbd={'serviceCode':_0x3ca470,'version':_0x26f725[_0x5d5441(0x1ba)]['version'],'importedAt':_0x30577d,'source':{'type':_0x5d5441(0x19d),'path':_0x11d0d1['filePath'],'hash':_0x26f725['sourceHash']},'manifest':_0x26f725['manifest'],'normalizedManifest':_0x26f725[_0x5d5441(0x1ba)]},_0x51bbdf=_0x2fb8f3[_0x5d5441(0x199)][_0x5d5441(0x18e)](_0x2ffc1c=>_0x2ffc1c[_0x5d5441(0x1b1)]===_0x3ca470);_0x51bbdf>=0x0?(_0x2fb8f3[_0x5d5441(0x199)][_0x51bbdf]=_0x264fbd,_0x4c1aec++):(_0x2fb8f3[_0x5d5441(0x199)]['push'](_0x264fbd),_0x26f6af++),_0x2b7307['push'](_0x264fbd);}_0x2fb8f3['services'][_0x5d5441(0x1a5)]((_0x1d3729,_0x5c7aa6)=>_0x1d3729[_0x5d5441(0x1b1)][_0x5d5441(0x19c)](_0x5c7aa6[_0x5d5441(0x1b1)])),_0x2fb8f3[_0x5d5441(0x1b0)]=_0x30577d;const _0x5f59e5=writeServiceRegistry(_0x2fb8f3,_0x1bf4e4);return{'registryPath':_0x5f59e5,'entry':_0x2b7307[0x0],'replaced':_0x2b7307[_0x5d5441(0x1a2)]===0x1?_0x4c1aec===0x1:_0x4c1aec>0x0,'entries':_0x2b7307,'imported':_0x26f6af,'updated':_0x4c1aec,'serviceCount':_0x2fb8f3[_0x5d5441(0x199)][_0x5d5441(0x1a2)]};}export function exportServiceManifest(_0x41dcc0,_0x17ce8b,_0x3f6773={}){const _0x6a98d4=a63_0x518345,_0x4a6163=getServiceRegistryPath(_0x3f6773),_0x1063a3=getLocalServiceEntry(_0x41dcc0,_0x3f6773);if(!_0x1063a3)throw CliErrors[_0x6a98d4(0x19f)](_0x6a98d4(0x1d9)+_0x41dcc0,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const _0x53c3d5=resolve(_0x17ce8b),_0x595a71=dirname(_0x53c3d5);return!existsSync(_0x595a71)&&mkdirSync(_0x595a71,{'recursive':!![]}),writeFileSync(_0x53c3d5,JSON[_0x6a98d4(0x194)](_0x1063a3[_0x6a98d4(0x19e)],null,0x2)+'\x0a',{'encoding':_0x6a98d4(0x1d5),'mode':0x180}),{'registryPath':_0x4a6163,'filePath':_0x53c3d5,'entry':_0x1063a3};}export function removeServiceManifest(_0x3940dc,_0x310cab={}){const _0x1375b1=a63_0x518345,_0x3e0b25=readServiceRegistry(_0x310cab),_0x1b3b3f=_0x3940dc['trim'](),_0xaa26a5=_0x3e0b25[_0x1375b1(0x199)][_0x1375b1(0x18e)](_0x5ca116=>_0x5ca116['serviceCode']===_0x1b3b3f);if(_0xaa26a5<0x0)throw CliErrors[_0x1375b1(0x19f)]('Local\x20service\x20not\x20found:\x20'+_0x1b3b3f,_0x1375b1(0x1d0));const [_0x2592cd]=_0x3e0b25[_0x1375b1(0x199)][_0x1375b1(0x1ad)](_0xaa26a5,0x1),_0x11a186=(_0x310cab['now']??(()=>new Date()))()[_0x1375b1(0x1a0)]();_0x3e0b25[_0x1375b1(0x1b0)]=_0x11a186;const _0x4646ea=writeServiceRegistry(_0x3e0b25,_0x310cab);return{'registryPath':_0x4646ea,'entry':_0x2592cd,'serviceCount':_0x3e0b25[_0x1375b1(0x199)][_0x1375b1(0x1a2)]};}export function listLocalServices(_0x3200b5={}){return readServiceRegistry(_0x3200b5)['services'];}export function getLocalServiceEntry(_0x998df2,_0x414559={}){const _0x5c068d=a63_0x518345;return readServiceRegistry(_0x414559)[_0x5c068d(0x199)]['find'](_0x2ce316=>_0x2ce316['serviceCode']===_0x998df2[_0x5c068d(0x1ac)]());}export function listLocalServiceTrees(_0x11e7cd={}){const _0x6d54cc=a63_0x518345;return readServiceRegistry(_0x11e7cd)[_0x6d54cc(0x199)][_0x6d54cc(0x1bf)](_0x5d5626=>_0x5d5626['normalizedManifest']);}export function inspectServiceRegistry(_0x493f8c={}){const _0x49a525=a63_0x518345,_0xa0ba85=getServiceRegistryPath(_0x493f8c);if(!existsSync(_0xa0ba85))return emptyServiceRegistryInspection(_0xa0ba85,_0x49a525(0x1dd),![]);try{const _0xa13c30=readFileSync(_0xa0ba85,_0x49a525(0x1d5));if(!_0xa13c30[_0x49a525(0x1ac)]())return emptyServiceRegistryInspection(_0xa0ba85,'empty',!![]);const _0x1787b9=JSON[_0x49a525(0x19a)](_0xa13c30);if(_0x1787b9[_0x49a525(0x1cd)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0xa0ba85,'invalid',!![]),'schemaVersion':_0x1787b9[_0x49a525(0x1cd)],'message':_0x49a525(0x1b7)+String(_0x1787b9[_0x49a525(0x1cd)])};if(!Array[_0x49a525(0x1b4)](_0x1787b9[_0x49a525(0x199)]))return{...emptyServiceRegistryInspection(_0xa0ba85,_0x49a525(0x1ce),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1787b9[_0x49a525(0x1b0)],'message':'services\x20must\x20be\x20an\x20array'};const _0x5c8286=_0x1787b9[_0x49a525(0x199)][_0x49a525(0x1bf)](summarizeLocalServiceEntry);return{'registryPath':_0xa0ba85,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1787b9[_0x49a525(0x1b0)],'serviceCount':_0x5c8286['length'],'commandCount':_0x5c8286[_0x49a525(0x1c2)]((_0x2a2056,_0xf94a9e)=>_0x2a2056+_0xf94a9e[_0x49a525(0x1dc)],0x0),'services':_0x5c8286};}catch(_0x34f012){return{...emptyServiceRegistryInspection(_0xa0ba85,_0x49a525(0x1ce),!![]),'message':_0x34f012 instanceof Error?_0x34f012[_0x49a525(0x1c5)]:String(_0x34f012)};}}export function formatValidationFailure(_0x1f7aa7){const _0xa45af=a63_0x518345,_0x5251d6=_0x1f7aa7['errors'][_0xa45af(0x1bf)](_0x593a8d=>_0x593a8d[_0xa45af(0x197)]+':\x20'+_0x593a8d[_0xa45af(0x1c5)]);return _0xa45af(0x1c0)+_0x5251d6['join']('\x0a');}function extractLoadedServiceManifests(_0x580a92,_0xb85802){const _0x263847=a63_0x518345;if(!isServiceRegistryLike(_0x580a92)){const _0x4d8abf=_0x580a92,{manifest:_0x11fb41,errors:_0x55f48e}=adaptServiceTreeManifestForLegacyFramework(_0x4d8abf),_0xc7276e=validateServiceTreeManifest(_0x11fb41),_0x4454ef=mergeValidationErrors(_0xc7276e,_0x55f48e);return[{'manifest':_0x4d8abf,'report':_0x4454ef,'normalizedManifest':_0x4454ef['ok']?normalizeServiceTreeManifest(_0x11fb41):undefined,'sourceHash':_0xb85802}];}return _0x580a92[_0x263847(0x199)][_0x263847(0x1bf)]((_0x466896,_0x365e05)=>{const _0x5394a1=_0x263847,_0x21c10d=isObjectRecord(_0x466896)?_0x466896['manifest']:undefined,{manifest:_0x74cfad,errors:_0x3265b9}=adaptServiceTreeManifestForLegacyFramework(_0x21c10d),_0x5017ec=validateServiceTreeManifest(_0x74cfad),_0x3f8e34=mergeValidationErrors(_0x5017ec,_0x3265b9),_0x4846e6=isObjectRecord(_0x466896)&&typeof _0x466896[_0x5394a1(0x1b1)]===_0x5394a1(0x1bb)?_0x466896[_0x5394a1(0x1b1)]:undefined;return{'manifest':_0x21c10d,'report':_0x3f8e34,'normalizedManifest':_0x3f8e34['ok']?normalizeServiceTreeManifest(_0x74cfad):undefined,'sourceHash':sha256(JSON['stringify'](_0x21c10d,null,0x2)+'\x0a'),'registryIndex':_0x365e05,'registryServiceCode':_0x4846e6};});}function mergeValidationErrors(_0x20ce79,_0x2da0c7){const _0x4166bb=a63_0x518345,_0x4c7c55=_0x20ce79[_0x4166bb(0x196)]['map'](_0x2ba9b1=>_0x2ba9b1['message']==='bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.'?{..._0x2ba9b1,'message':_0x4166bb(0x1c3)}:_0x2ba9b1),_0x20d1ca=[..._0x2da0c7,..._0x4c7c55];return{'ok':_0x20d1ca[_0x4166bb(0x1a2)]===0x0,'errors':_0x20d1ca,'warnings':_0x20ce79[_0x4166bb(0x1a4)]};}function aggregateValidationReports(_0x5e7aae){const _0x591cb2=a63_0x518345,_0x3afd7a=_0x5e7aae['flatMap'](_0x273e84=>_0x273e84['registryIndex']===undefined?_0x273e84[_0x591cb2(0x1db)][_0x591cb2(0x196)]:_0x273e84[_0x591cb2(0x1db)][_0x591cb2(0x196)][_0x591cb2(0x1bf)](_0x57d567=>({..._0x57d567,'path':prefixRegistryIssuePath(_0x273e84[_0x591cb2(0x1c6)],_0x57d567[_0x591cb2(0x197)])}))),_0x2d2459=_0x5e7aae['flatMap'](_0x5412ff=>_0x5412ff[_0x591cb2(0x1c6)]===undefined?_0x5412ff['report'][_0x591cb2(0x1a4)]:_0x5412ff[_0x591cb2(0x1db)][_0x591cb2(0x1a4)][_0x591cb2(0x1bf)](_0x56a395=>({..._0x56a395,'path':prefixRegistryIssuePath(_0x5412ff['registryIndex'],_0x56a395['path'])})));return{'ok':_0x3afd7a[_0x591cb2(0x1a2)]===0x0,'errors':_0x3afd7a,'warnings':_0x2d2459};}function prefixRegistryIssuePath(_0x5b4844,_0x3775cd){const _0x434dff=a63_0x518345;if(_0x3775cd==='$')return _0x434dff(0x1c8)+_0x5b4844+_0x434dff(0x1b5);if(_0x3775cd['startsWith']('$.'))return _0x434dff(0x1c8)+_0x5b4844+_0x434dff(0x1b5)+_0x3775cd['slice'](0x1);if(_0x3775cd[_0x434dff(0x1cb)]('$['))return _0x434dff(0x1c8)+_0x5b4844+_0x434dff(0x1b5)+_0x3775cd[_0x434dff(0x1aa)](0x1);return _0x434dff(0x1c8)+_0x5b4844+_0x434dff(0x1a9)+_0x3775cd;}function isServiceRegistryLike(_0x5c978f){const _0x4438d6=a63_0x518345;return isObjectRecord(_0x5c978f)&&_0x5c978f['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x4438d6(0x1b4)](_0x5c978f[_0x4438d6(0x199)]);}function isObjectRecord(_0x516d0e){const _0x298d37=a63_0x518345;return Boolean(_0x516d0e)&&typeof _0x516d0e===_0x298d37(0x1d7)&&!Array[_0x298d37(0x1b4)](_0x516d0e);}function emptyServiceRegistryInspection(_0x5cb949,_0x120a22,_0x153ab5){return{'registryPath':_0x5cb949,'exists':_0x153ab5,'status':_0x120a22,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x54099a){const _0x205242=a63_0x518345,_0x57068d=_0x54099a[_0x205242(0x1ba)],_0x27fecb=_0x57068d[_0x205242(0x1a6)]['map'](_0x372732=>({'path':_0x372732[_0x205242(0x1d4)],'description':_0x372732[_0x205242(0x1d2)],'risk':_0x372732['risk'],'targetKind':_0x372732[_0x205242(0x1cc)][_0x205242(0x192)],'targetCommand':_0x372732['target'][_0x205242(0x1de)]}));return{'serviceCode':_0x54099a[_0x205242(0x1b1)],'name':_0x57068d[_0x205242(0x1d1)]['name'],'description':_0x57068d[_0x205242(0x1d1)][_0x205242(0x1d2)],'version':_0x54099a['version'],'importedAt':_0x54099a[_0x205242(0x1b3)],'source':_0x54099a[_0x205242(0x1be)],'commandCount':_0x27fecb[_0x205242(0x1a2)],'commands':_0x27fecb};}function sha256(_0x5f3d37){const _0x3d4547=a63_0x518345;return createHash(_0x3d4547(0x191))[_0x3d4547(0x1ae)](_0x5f3d37)[_0x3d4547(0x1c1)](_0x3d4547(0x1b2));}
1
+ (function(_0x2e3f73,_0x5e1bb4){const _0x37b0c3=a64_0x1772,_0x59edf8=_0x2e3f73();while(!![]){try{const _0x55590e=-parseInt(_0x37b0c3(0x1a8))/0x1+-parseInt(_0x37b0c3(0x1b4))/0x2*(parseInt(_0x37b0c3(0x17f))/0x3)+parseInt(_0x37b0c3(0x1bf))/0x4*(-parseInt(_0x37b0c3(0x1b7))/0x5)+-parseInt(_0x37b0c3(0x19b))/0x6+parseInt(_0x37b0c3(0x1b1))/0x7*(parseInt(_0x37b0c3(0x1ba))/0x8)+-parseInt(_0x37b0c3(0x167))/0x9*(-parseInt(_0x37b0c3(0x198))/0xa)+parseInt(_0x37b0c3(0x1a5))/0xb*(parseInt(_0x37b0c3(0x17b))/0xc);if(_0x55590e===_0x5e1bb4)break;else _0x59edf8['push'](_0x59edf8['shift']());}catch(_0x16668e){_0x59edf8['push'](_0x59edf8['shift']());}}}(a64_0x5ecb,0xb142a));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME='service.json';function a64_0x1772(_0xefc1f1,_0x1431db){_0xefc1f1=_0xefc1f1-0x167;const _0x5ecbfb=a64_0x5ecb();let _0x177245=_0x5ecbfb[_0xefc1f1];return _0x177245;}export function getServiceRegistryPath(_0xa64cdd={}){const _0x13c84b=a64_0x1772;return resolve(_0xa64cdd['homeDir']??homedir(),PRODUCT_CONFIG[_0x13c84b(0x1a9)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x49f4da={}){const _0x56786b=a64_0x1772,_0x2abf2b=getServiceRegistryPath(_0x49f4da);if(!existsSync(_0x2abf2b))return emptyServiceRegistry();try{const _0x492332=readFileSync(_0x2abf2b,'utf8');if(!_0x492332['trim']())return emptyServiceRegistry();const _0x167a03=JSON[_0x56786b(0x1b0)](_0x492332);if(_0x167a03['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x56786b(0x188)](_0x56786b(0x16e)+String(_0x167a03['schemaVersion']),_0x56786b(0x1b9)+_0x2abf2b+'.');if(!Array[_0x56786b(0x1ad)](_0x167a03[_0x56786b(0x199)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x167a03[_0x56786b(0x182)],'services':_0x167a03[_0x56786b(0x199)]};}catch(_0x5d942b){if(_0x5d942b instanceof Error&&_0x5d942b[_0x56786b(0x18a)]===_0x56786b(0x1bc))throw _0x5d942b;throw CliErrors['validation']('Invalid\x20service\x20registry\x20JSON:\x20'+_0x2abf2b,_0x56786b(0x195));}}export function writeServiceRegistry(_0x23847f,_0x245ca7={}){const _0x5c1dd4=a64_0x1772,_0x1f446e=getServiceRegistryPath(_0x245ca7),_0x22ece4=dirname(_0x1f446e);!existsSync(_0x22ece4)&&mkdirSync(_0x22ece4,{'recursive':!![]});const _0x1fa67c=_0x1f446e+'.tmp';try{writeFileSync(_0x1fa67c,JSON[_0x5c1dd4(0x16d)](_0x23847f,null,0x2)+'\x0a',{'encoding':_0x5c1dd4(0x1b2),'mode':0x180}),renameSync(_0x1fa67c,_0x1f446e);}catch(_0x5095dd){try{unlinkSync(_0x1fa67c);}catch{}if(_0x5095dd?.[_0x5c1dd4(0x196)]===_0x5c1dd4(0x1ae))throw CliErrors[_0x5c1dd4(0x188)](_0x5c1dd4(0x1bd)+_0x1f446e);throw _0x5095dd;}return _0x1f446e;}export function loadServiceManifestFromFile(_0x38348d){const _0x5f45e2=a64_0x1772,_0x68e58=resolve(_0x38348d);if(!existsSync(_0x68e58))throw CliErrors['validation'](_0x5f45e2(0x180)+_0x38348d);let _0x363305;const _0x1d0c2b=readFileSync(_0x68e58,_0x5f45e2(0x1b2));try{_0x363305=JSON[_0x5f45e2(0x1b0)](_0x1d0c2b);}catch{throw CliErrors[_0x5f45e2(0x188)](_0x5f45e2(0x16f)+_0x38348d,_0x5f45e2(0x1be));}const _0x5aab4e=sha256(_0x1d0c2b),_0x35a4c4=extractLoadedServiceManifests(_0x363305,_0x5aab4e),_0x3aa0bf=aggregateValidationReports(_0x35a4c4),_0x4b007b=_0x35a4c4[0x0];return{'filePath':_0x68e58,'hash':_0x5aab4e,'kind':isServiceRegistryLike(_0x363305)?_0x5f45e2(0x17a):_0x5f45e2(0x18c),'manifest':_0x4b007b?.['manifest']??_0x363305,'report':_0x3aa0bf,'normalizedManifest':_0x35a4c4[_0x5f45e2(0x190)]===0x1?_0x4b007b?.[_0x5f45e2(0x189)]:undefined,'manifests':_0x35a4c4};}export function importServiceManifest(_0xa73013,_0x17bd63={}){const _0x4a61e0=a64_0x1772,_0x33bc44=loadServiceManifestFromFile(_0xa73013);if(!_0x33bc44[_0x4a61e0(0x17d)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0x33bc44[_0x4a61e0(0x17d)]),_0x4a61e0(0x184));if(_0x33bc44['manifests'][_0x4a61e0(0x190)]===0x0)throw CliErrors['validation']('Service\x20registry\x20has\x20no\x20services\x20to\x20import.','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.');const _0x58a465=readServiceRegistry(_0x17bd63),_0x3f6b16=(_0x17bd63[_0x4a61e0(0x177)]??(()=>new Date()))()[_0x4a61e0(0x192)](),_0x144cc6=[];let _0x16ce9c=0x0,_0x18e048=0x0;for(const _0xa2d99 of _0x33bc44[_0x4a61e0(0x1a1)]){if(!_0xa2d99[_0x4a61e0(0x189)])continue;const _0x4f3d13=_0xa2d99[_0x4a61e0(0x189)][_0x4a61e0(0x174)][_0x4a61e0(0x196)],_0x59f48e={'serviceCode':_0x4f3d13,'version':_0xa2d99['normalizedManifest'][_0x4a61e0(0x16c)],'importedAt':_0x3f6b16,'source':{'type':_0x4a61e0(0x171),'path':_0x33bc44['filePath'],'hash':_0xa2d99[_0x4a61e0(0x1b8)]},'manifest':_0xa2d99[_0x4a61e0(0x18c)],'normalizedManifest':_0xa2d99[_0x4a61e0(0x189)]},_0x4d9294=_0x58a465[_0x4a61e0(0x199)][_0x4a61e0(0x1ac)](_0x42240=>_0x42240['serviceCode']===_0x4f3d13);_0x4d9294>=0x0?(_0x58a465[_0x4a61e0(0x199)][_0x4d9294]=_0x59f48e,_0x18e048++):(_0x58a465[_0x4a61e0(0x199)]['push'](_0x59f48e),_0x16ce9c++),_0x144cc6[_0x4a61e0(0x186)](_0x59f48e);}_0x58a465['services'][_0x4a61e0(0x172)]((_0x370571,_0x580cb3)=>_0x370571[_0x4a61e0(0x1b5)]['localeCompare'](_0x580cb3[_0x4a61e0(0x1b5)])),_0x58a465[_0x4a61e0(0x182)]=_0x3f6b16;const _0x56aac4=writeServiceRegistry(_0x58a465,_0x17bd63);return{'registryPath':_0x56aac4,'entry':_0x144cc6[0x0],'replaced':_0x144cc6[_0x4a61e0(0x190)]===0x1?_0x18e048===0x1:_0x18e048>0x0,'entries':_0x144cc6,'imported':_0x16ce9c,'updated':_0x18e048,'serviceCount':_0x58a465[_0x4a61e0(0x199)]['length']};}export function exportServiceManifest(_0xdbab65,_0x30cea1,_0x38c37e={}){const _0x2aa616=a64_0x1772,_0x3824ce=getServiceRegistryPath(_0x38c37e),_0x21e647=getLocalServiceEntry(_0xdbab65,_0x38c37e);if(!_0x21e647)throw CliErrors[_0x2aa616(0x188)](_0x2aa616(0x169)+_0xdbab65,_0x2aa616(0x1aa));const _0xac400c=resolve(_0x30cea1),_0xaffb1e=dirname(_0xac400c);return!existsSync(_0xaffb1e)&&mkdirSync(_0xaffb1e,{'recursive':!![]}),writeFileSync(_0xac400c,JSON[_0x2aa616(0x16d)](_0x21e647[_0x2aa616(0x18c)],null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),{'registryPath':_0x3824ce,'filePath':_0xac400c,'entry':_0x21e647};}export function removeServiceManifest(_0x10537d,_0x294628={}){const _0x6317fe=a64_0x1772,_0x4898d8=readServiceRegistry(_0x294628),_0x1616f8=_0x10537d[_0x6317fe(0x193)](),_0x52c3b6=_0x4898d8[_0x6317fe(0x199)]['findIndex'](_0x5eb3b1=>_0x5eb3b1['serviceCode']===_0x1616f8);if(_0x52c3b6<0x0)throw CliErrors[_0x6317fe(0x188)](_0x6317fe(0x169)+_0x1616f8,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x27a5d9]=_0x4898d8[_0x6317fe(0x199)][_0x6317fe(0x17c)](_0x52c3b6,0x1),_0x5d0eb8=(_0x294628['now']??(()=>new Date()))()[_0x6317fe(0x192)]();_0x4898d8[_0x6317fe(0x182)]=_0x5d0eb8;const _0x5c85c8=writeServiceRegistry(_0x4898d8,_0x294628);return{'registryPath':_0x5c85c8,'entry':_0x27a5d9,'serviceCount':_0x4898d8[_0x6317fe(0x199)][_0x6317fe(0x190)]};}function a64_0x5ecb(){const _0x4e3823=['Unsupported\x20schemaVersion:\x20','1597089ItBFOk','Service\x20manifest\x20file\x20not\x20found:\x20','slice','updatedAt','commands','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','map','push','].manifest','validation','normalizedManifest','name','invalid','manifest','registryIndex','errors','message','length','object','toISOString','trim','].manifest.','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','code','sha256','2907410wPyldV','services','schemaVersion','4044348bUkQxi','empty','command','warnings','digest','join','manifests','Service\x20manifest\x20validation\x20failed:\x0a','importedAt','commandCount','87406xjWIfH','startsWith','missing','174489ONrqtj','homeDirName','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','path','findIndex','isArray','ENOENT','bff\x20target\x20requires\x20functionName.','parse','175IGuZYr','utf8','target','4WnLtic','serviceCode','string','5nJRHwj','sourceHash','Remove\x20or\x20migrate\x20','329624plcXHq','source','CliError','Cannot\x20write\x20service\x20registry:\x20','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','1432364uvXNaA','9khLeEb','update','Local\x20service\x20not\x20found:\x20','description','$.services[','version','stringify','Unsupported\x20service\x20registry\x20schemaVersion:\x20','Invalid\x20service\x20manifest\x20JSON:\x20','flatMap','file','sort','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','service','kind','reduce','now','hex','find','registry','2532cCoGgD','splice','report'];a64_0x5ecb=function(){return _0x4e3823;};return a64_0x5ecb();}export function listLocalServices(_0x154918={}){const _0x512f71=a64_0x1772;return readServiceRegistry(_0x154918)[_0x512f71(0x199)];}export function getLocalServiceEntry(_0x158666,_0x514208={}){const _0x663c91=a64_0x1772;return readServiceRegistry(_0x514208)[_0x663c91(0x199)][_0x663c91(0x179)](_0x488908=>_0x488908['serviceCode']===_0x158666['trim']());}export function listLocalServiceTrees(_0x3c0deb={}){const _0x4b7210=a64_0x1772;return readServiceRegistry(_0x3c0deb)[_0x4b7210(0x199)][_0x4b7210(0x185)](_0x363e33=>_0x363e33['normalizedManifest']);}export function inspectServiceRegistry(_0x34bae9={}){const _0x23b6b9=a64_0x1772,_0x2c14f0=getServiceRegistryPath(_0x34bae9);if(!existsSync(_0x2c14f0))return emptyServiceRegistryInspection(_0x2c14f0,_0x23b6b9(0x1a7),![]);try{const _0x2c8c8f=readFileSync(_0x2c14f0,'utf8');if(!_0x2c8c8f[_0x23b6b9(0x193)]())return emptyServiceRegistryInspection(_0x2c14f0,_0x23b6b9(0x19c),!![]);const _0x1d0dfc=JSON[_0x23b6b9(0x1b0)](_0x2c8c8f);if(_0x1d0dfc['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x2c14f0,_0x23b6b9(0x18b),!![]),'schemaVersion':_0x1d0dfc[_0x23b6b9(0x19a)],'message':_0x23b6b9(0x17e)+String(_0x1d0dfc[_0x23b6b9(0x19a)])};if(!Array['isArray'](_0x1d0dfc[_0x23b6b9(0x199)]))return{...emptyServiceRegistryInspection(_0x2c14f0,'invalid',!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1d0dfc[_0x23b6b9(0x182)],'message':'services\x20must\x20be\x20an\x20array'};const _0xee9db=_0x1d0dfc[_0x23b6b9(0x199)]['map'](summarizeLocalServiceEntry);return{'registryPath':_0x2c14f0,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1d0dfc[_0x23b6b9(0x182)],'serviceCount':_0xee9db['length'],'commandCount':_0xee9db[_0x23b6b9(0x176)]((_0x1a6e8a,_0x3e6b26)=>_0x1a6e8a+_0x3e6b26[_0x23b6b9(0x1a4)],0x0),'services':_0xee9db};}catch(_0x20c822){return{...emptyServiceRegistryInspection(_0x2c14f0,_0x23b6b9(0x18b),!![]),'message':_0x20c822 instanceof Error?_0x20c822[_0x23b6b9(0x18f)]:String(_0x20c822)};}}export function formatValidationFailure(_0x21d533){const _0x20a2ea=a64_0x1772,_0x2a2277=_0x21d533[_0x20a2ea(0x18e)][_0x20a2ea(0x185)](_0x394b52=>_0x394b52[_0x20a2ea(0x1ab)]+':\x20'+_0x394b52['message']);return _0x20a2ea(0x1a2)+_0x2a2277[_0x20a2ea(0x1a0)]('\x0a');}function extractLoadedServiceManifests(_0x2e7bcf,_0x405a4b){const _0x4ad3c3=a64_0x1772;if(!isServiceRegistryLike(_0x2e7bcf)){const _0x206ab1=_0x2e7bcf,{manifest:_0x42e56a,errors:_0x2c5141}=adaptServiceTreeManifestForLegacyFramework(_0x206ab1),_0x3e97c8=validateServiceTreeManifest(_0x42e56a),_0x1b6332=mergeValidationErrors(_0x3e97c8,_0x2c5141);return[{'manifest':_0x206ab1,'report':_0x1b6332,'normalizedManifest':_0x1b6332['ok']?normalizeServiceTreeManifest(_0x42e56a):undefined,'sourceHash':_0x405a4b}];}return _0x2e7bcf[_0x4ad3c3(0x199)][_0x4ad3c3(0x185)]((_0x21ae66,_0x209fa1)=>{const _0x128556=_0x4ad3c3,_0x5b2f3d=isObjectRecord(_0x21ae66)?_0x21ae66[_0x128556(0x18c)]:undefined,{manifest:_0x49e13e,errors:_0x10db20}=adaptServiceTreeManifestForLegacyFramework(_0x5b2f3d),_0x29b77a=validateServiceTreeManifest(_0x49e13e),_0x20dd05=mergeValidationErrors(_0x29b77a,_0x10db20),_0x2cd0c7=isObjectRecord(_0x21ae66)&&typeof _0x21ae66['serviceCode']===_0x128556(0x1b6)?_0x21ae66['serviceCode']:undefined;return{'manifest':_0x5b2f3d,'report':_0x20dd05,'normalizedManifest':_0x20dd05['ok']?normalizeServiceTreeManifest(_0x49e13e):undefined,'sourceHash':sha256(JSON[_0x128556(0x16d)](_0x5b2f3d,null,0x2)+'\x0a'),'registryIndex':_0x209fa1,'registryServiceCode':_0x2cd0c7};});}function mergeValidationErrors(_0x9cc00a,_0x68395f){const _0x44e95e=a64_0x1772,_0x5d2275=_0x9cc00a['errors'][_0x44e95e(0x185)](_0x45eaea=>_0x45eaea[_0x44e95e(0x18f)]===_0x44e95e(0x173)?{..._0x45eaea,'message':_0x44e95e(0x1af)}:_0x45eaea),_0x1fc08f=[..._0x68395f,..._0x5d2275];return{'ok':_0x1fc08f[_0x44e95e(0x190)]===0x0,'errors':_0x1fc08f,'warnings':_0x9cc00a[_0x44e95e(0x19e)]};}function aggregateValidationReports(_0x4415d7){const _0x303936=a64_0x1772,_0xe28b15=_0x4415d7[_0x303936(0x170)](_0x20a91b=>_0x20a91b[_0x303936(0x18d)]===undefined?_0x20a91b[_0x303936(0x17d)][_0x303936(0x18e)]:_0x20a91b[_0x303936(0x17d)][_0x303936(0x18e)]['map'](_0x3df79a=>({..._0x3df79a,'path':prefixRegistryIssuePath(_0x20a91b[_0x303936(0x18d)],_0x3df79a[_0x303936(0x1ab)])}))),_0x3ac167=_0x4415d7[_0x303936(0x170)](_0x2dbc37=>_0x2dbc37[_0x303936(0x18d)]===undefined?_0x2dbc37[_0x303936(0x17d)][_0x303936(0x19e)]:_0x2dbc37[_0x303936(0x17d)][_0x303936(0x19e)]['map'](_0x40d403=>({..._0x40d403,'path':prefixRegistryIssuePath(_0x2dbc37[_0x303936(0x18d)],_0x40d403[_0x303936(0x1ab)])})));return{'ok':_0xe28b15[_0x303936(0x190)]===0x0,'errors':_0xe28b15,'warnings':_0x3ac167};}function prefixRegistryIssuePath(_0x5651f0,_0x6f6904){const _0x1f36fc=a64_0x1772;if(_0x6f6904==='$')return _0x1f36fc(0x16b)+_0x5651f0+_0x1f36fc(0x187);if(_0x6f6904[_0x1f36fc(0x1a6)]('$.'))return _0x1f36fc(0x16b)+_0x5651f0+'].manifest'+_0x6f6904[_0x1f36fc(0x181)](0x1);if(_0x6f6904[_0x1f36fc(0x1a6)]('$['))return'$.services['+_0x5651f0+_0x1f36fc(0x187)+_0x6f6904[_0x1f36fc(0x181)](0x1);return _0x1f36fc(0x16b)+_0x5651f0+_0x1f36fc(0x194)+_0x6f6904;}function isServiceRegistryLike(_0x4b1fa9){const _0x576343=a64_0x1772;return isObjectRecord(_0x4b1fa9)&&_0x4b1fa9[_0x576343(0x19a)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x576343(0x1ad)](_0x4b1fa9['services']);}function isObjectRecord(_0x5b6a72){const _0x40e879=a64_0x1772;return Boolean(_0x5b6a72)&&typeof _0x5b6a72===_0x40e879(0x191)&&!Array[_0x40e879(0x1ad)](_0x5b6a72);}function emptyServiceRegistryInspection(_0x220803,_0x37453a,_0x4c7fe3){return{'registryPath':_0x220803,'exists':_0x4c7fe3,'status':_0x37453a,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x1b96e8){const _0x23041b=a64_0x1772,_0x3acd25=_0x1b96e8[_0x23041b(0x189)],_0x3a9b6e=_0x3acd25[_0x23041b(0x183)][_0x23041b(0x185)](_0x38e3c4=>({'path':_0x38e3c4['cliPath'],'description':_0x38e3c4[_0x23041b(0x16a)],'risk':_0x38e3c4['risk'],'targetKind':_0x38e3c4[_0x23041b(0x1b3)][_0x23041b(0x175)],'targetCommand':_0x38e3c4[_0x23041b(0x1b3)][_0x23041b(0x19d)]}));return{'serviceCode':_0x1b96e8[_0x23041b(0x1b5)],'name':_0x3acd25['service'][_0x23041b(0x18a)],'description':_0x3acd25[_0x23041b(0x174)][_0x23041b(0x16a)],'version':_0x1b96e8[_0x23041b(0x16c)],'importedAt':_0x1b96e8[_0x23041b(0x1a3)],'source':_0x1b96e8[_0x23041b(0x1bb)],'commandCount':_0x3a9b6e[_0x23041b(0x190)],'commands':_0x3a9b6e};}function sha256(_0x11bb04){const _0x5cd615=a64_0x1772;return createHash(_0x5cd615(0x197))[_0x5cd615(0x168)](_0x11bb04)[_0x5cd615(0x19f)](_0x5cd615(0x178));}
@@ -1 +1 @@
1
- const a64_0x390bba=a64_0x4ccd;(function(_0x22c75d,_0x4c1935){const _0x4a4003=a64_0x4ccd,_0x11da79=_0x22c75d();while(!![]){try{const _0x185ec8=-parseInt(_0x4a4003(0x19b))/0x1*(parseInt(_0x4a4003(0x192))/0x2)+parseInt(_0x4a4003(0x183))/0x3+-parseInt(_0x4a4003(0x186))/0x4+-parseInt(_0x4a4003(0x19a))/0x5*(parseInt(_0x4a4003(0x181))/0x6)+parseInt(_0x4a4003(0x195))/0x7+-parseInt(_0x4a4003(0x193))/0x8+-parseInt(_0x4a4003(0x18e))/0x9*(-parseInt(_0x4a4003(0x18f))/0xa);if(_0x185ec8===_0x4c1935)break;else _0x11da79['push'](_0x11da79['shift']());}catch(_0x1eec7a){_0x11da79['push'](_0x11da79['shift']());}}}(a64_0x23dd,0xc74ca));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';function a64_0x23dd(){const _0x3737e9=['2612568qsPtPM','rendered','7723877RXDJBj','path','validation','read','type','2671880XHyhkH','2779yJTdVp','create','str','skill','force','Created\x20local\x20Skill\x20draft\x20','files','skillDir','map','6kmQdGy','name','3672069dEDfDL','trim','WRITE','2768636ePYzMN','skillName','isSymbolicLink','Refusing\x20to\x20overwrite\x20symlink:\x20','content','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','35613NSpSkk','2810yYipkY','utf8','target','770CFTPwo'];a64_0x23dd=function(){return _0x3737e9;};return a64_0x23dd();}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_0x4ccd(_0x2b4dde,_0xf91a2e){_0x2b4dde=_0x2b4dde-0x180;const _0x23ddd9=a64_0x23dd();let _0x4ccd3b=_0x23ddd9[_0x2b4dde];return _0x4ccd3b;}export const createCommand={'service':a64_0x390bba(0x19e),'command':a64_0x390bba(0x19c),'description':'Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','risk':a64_0x390bba(0x198),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x393601){const _0x5a1963=a64_0x390bba,_0x2e052d=buildSkillCreatePlan(_0x393601[_0x5a1963(0x19d)](_0x5a1963(0x182)),_0x393601[_0x5a1963(0x19d)](_0x5a1963(0x199)),_0x393601[_0x5a1963(0x19d)](_0x5a1963(0x191)));return{'method':_0x5a1963(0x185),'url':_0x2e052d[_0x5a1963(0x1a2)],'body':{'skillName':_0x2e052d[_0x5a1963(0x194)][_0x5a1963(0x187)],'type':_0x2e052d[_0x5a1963(0x194)][_0x5a1963(0x199)],'selfContained':!![],'files':_0x2e052d[_0x5a1963(0x194)][_0x5a1963(0x1a1)][_0x5a1963(0x180)](_0x1aa027=>_0x1aa027[_0x5a1963(0x196)])},'description':_0x5a1963(0x18d)};},async 'execute'(_0x44732d){const _0x3aa1e7=a64_0x390bba,_0x283716=buildSkillCreatePlan(_0x44732d[_0x3aa1e7(0x19d)](_0x3aa1e7(0x182)),_0x44732d[_0x3aa1e7(0x19d)](_0x3aa1e7(0x199)),_0x44732d[_0x3aa1e7(0x19d)]('target'));return writeSkillDraft(_0x283716,_0x44732d['bool'](_0x3aa1e7(0x19f))),{'ok':!![],'data':{'skillName':_0x283716['rendered'][_0x3aa1e7(0x187)],'type':_0x283716['rendered']['type'],'dir':_0x283716['skillDir'],'files':_0x283716['rendered']['files']['map'](_0x23be6=>_0x23be6['path'])},'message':_0x3aa1e7(0x1a0)+_0x283716[_0x3aa1e7(0x194)]['skillName']};}};function buildSkillCreatePlan(_0x518913,_0x543f5f,_0x369246){const _0x3fa324=a64_0x390bba,_0x298122=_0x543f5f[_0x3fa324(0x184)](),_0x32a039=renderSkillTemplate({'skillName':_0x518913,'type':_0x298122});!_0x298122&&writeCliSideChannelLine('Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.');const _0x22f082=resolve(normalizeSkillTarget(_0x369246));return{'rendered':_0x32a039,'targetRoot':_0x22f082,'skillDir':resolve(_0x22f082,_0x32a039[_0x3fa324(0x187)])};}function normalizeSkillTarget(_0x4bc47d){const _0x51be3d=a64_0x390bba;return(_0x4bc47d||DEFAULT_SKILL_TARGET)[_0x51be3d(0x184)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x5e9402,_0x277e63){const _0xdbf511=a64_0x390bba;if(existsSync(_0x5e9402['skillDir'])){const _0x5dca5b=lstatSync(_0x5e9402[_0xdbf511(0x1a2)]);if(!_0x5dca5b['isDirectory']()||_0x5dca5b[_0xdbf511(0x188)]())throw CliErrors[_0xdbf511(0x197)](_0xdbf511(0x18c)+_0x5e9402[_0xdbf511(0x1a2)]);if(!_0x277e63)throw CliErrors[_0xdbf511(0x197)]('Skill\x20directory\x20already\x20exists:\x20'+_0x5e9402[_0xdbf511(0x1a2)],_0xdbf511(0x18b));}for(const _0x1c291d of _0x5e9402['rendered'][_0xdbf511(0x1a1)]){const _0x416c5f=resolve(_0x5e9402[_0xdbf511(0x1a2)],_0x1c291d[_0xdbf511(0x196)]),_0x29325a=dirname(_0x416c5f);mkdirSync(_0x29325a,{'recursive':!![]});if(existsSync(_0x416c5f)&&lstatSync(_0x416c5f)[_0xdbf511(0x188)]())throw CliErrors['validation'](_0xdbf511(0x189)+_0x416c5f);writeFileSync(_0x416c5f,_0x1c291d[_0xdbf511(0x18a)],_0xdbf511(0x190));}}
1
+ function a65_0x190c(_0x431e67,_0x178c2d){_0x431e67=_0x431e67-0x78;const _0x16715a=a65_0x1671();let _0x190ce4=_0x16715a[_0x431e67];return _0x190ce4;}const a65_0x20ad37=a65_0x190c;(function(_0x42b038,_0x2f6b56){const _0x3d9454=a65_0x190c,_0x1037d2=_0x42b038();while(!![]){try{const _0x5dbf2f=parseInt(_0x3d9454(0x95))/0x1*(-parseInt(_0x3d9454(0x8f))/0x2)+parseInt(_0x3d9454(0x90))/0x3+parseInt(_0x3d9454(0x8c))/0x4+parseInt(_0x3d9454(0x94))/0x5*(parseInt(_0x3d9454(0x85))/0x6)+-parseInt(_0x3d9454(0x97))/0x7+parseInt(_0x3d9454(0x7d))/0x8*(-parseInt(_0x3d9454(0x93))/0x9)+parseInt(_0x3d9454(0x7a))/0xa;if(_0x5dbf2f===_0x2f6b56)break;else _0x1037d2['push'](_0x1037d2['shift']());}catch(_0x5173d7){_0x1037d2['push'](_0x1037d2['shift']());}}}(a65_0x1671,0x4e03a));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';function a65_0x1671(){const _0xe95850=['isSymbolicLink','rendered','type','isDirectory','1457808QJNzqs','Created\x20local\x20Skill\x20draft\x20','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','118966dOgnxP','1137210cnUdfK','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','target','162sgioxh','706915cvZTiT','10jFqZdZ','Skill\x20directory\x20already\x20exists:\x20','2664725NwlduJ','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','trim','Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','8931760PLyBuD','create','skillDir','214680WZzVjJ','str','validation','map','read','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','name','files','6RhonBw','path','WRITE'];a65_0x1671=function(){return _0xe95850;};return a65_0x1671();}import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':'skill','command':a65_0x20ad37(0x7b),'description':a65_0x20ad37(0x79),'risk':a65_0x20ad37(0x81),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x49f3ba){const _0x309dd8=a65_0x20ad37,_0x433b82=buildSkillCreatePlan(_0x49f3ba['str'](_0x309dd8(0x83)),_0x49f3ba[_0x309dd8(0x7e)](_0x309dd8(0x8a)),_0x49f3ba[_0x309dd8(0x7e)](_0x309dd8(0x92)));return{'method':_0x309dd8(0x87),'url':_0x433b82[_0x309dd8(0x7c)],'body':{'skillName':_0x433b82[_0x309dd8(0x89)]['skillName'],'type':_0x433b82['rendered'][_0x309dd8(0x8a)],'selfContained':!![],'files':_0x433b82['rendered'][_0x309dd8(0x84)]['map'](_0x462eb0=>_0x462eb0['path'])},'description':_0x309dd8(0x91)};},async 'execute'(_0x25334e){const _0x1692d5=a65_0x20ad37,_0x2ec597=buildSkillCreatePlan(_0x25334e[_0x1692d5(0x7e)](_0x1692d5(0x83)),_0x25334e[_0x1692d5(0x7e)](_0x1692d5(0x8a)),_0x25334e[_0x1692d5(0x7e)](_0x1692d5(0x92)));return writeSkillDraft(_0x2ec597,_0x25334e['bool']('force')),{'ok':!![],'data':{'skillName':_0x2ec597[_0x1692d5(0x89)]['skillName'],'type':_0x2ec597[_0x1692d5(0x89)][_0x1692d5(0x8a)],'dir':_0x2ec597['skillDir'],'files':_0x2ec597[_0x1692d5(0x89)][_0x1692d5(0x84)][_0x1692d5(0x80)](_0x337347=>_0x337347[_0x1692d5(0x86)])},'message':_0x1692d5(0x8d)+_0x2ec597[_0x1692d5(0x89)]['skillName']};}};function buildSkillCreatePlan(_0x41a57c,_0x26b545,_0x30effc){const _0x17183f=a65_0x20ad37,_0x2be9a5=_0x26b545['trim'](),_0x4b051c=renderSkillTemplate({'skillName':_0x41a57c,'type':_0x2be9a5});!_0x2be9a5&&writeCliSideChannelLine(_0x17183f(0x98));const _0x46ff2c=resolve(normalizeSkillTarget(_0x30effc));return{'rendered':_0x4b051c,'targetRoot':_0x46ff2c,'skillDir':resolve(_0x46ff2c,_0x4b051c['skillName'])};}function normalizeSkillTarget(_0x1860e0){const _0x19c006=a65_0x20ad37;return(_0x1860e0||DEFAULT_SKILL_TARGET)[_0x19c006(0x78)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x4bff0e,_0x5dff29){const _0x311610=a65_0x20ad37;if(existsSync(_0x4bff0e[_0x311610(0x7c)])){const _0x225914=lstatSync(_0x4bff0e['skillDir']);if(!_0x225914[_0x311610(0x8b)]()||_0x225914[_0x311610(0x88)]())throw CliErrors[_0x311610(0x7f)](_0x311610(0x8e)+_0x4bff0e[_0x311610(0x7c)]);if(!_0x5dff29)throw CliErrors[_0x311610(0x7f)](_0x311610(0x96)+_0x4bff0e[_0x311610(0x7c)],_0x311610(0x82));}for(const _0x13a031 of _0x4bff0e[_0x311610(0x89)][_0x311610(0x84)]){const _0x293107=resolve(_0x4bff0e[_0x311610(0x7c)],_0x13a031['path']),_0x3815c6=dirname(_0x293107);mkdirSync(_0x3815c6,{'recursive':!![]});if(existsSync(_0x293107)&&lstatSync(_0x293107)[_0x311610(0x88)]())throw CliErrors[_0x311610(0x7f)]('Refusing\x20to\x20overwrite\x20symlink:\x20'+_0x293107);writeFileSync(_0x293107,_0x13a031['content'],'utf8');}}
@@ -1 +1 @@
1
- const a65_0x4c8f01=a65_0x1052;(function(_0x3cf389,_0x4ad248){const _0x4d23d1=a65_0x1052,_0x167db0=_0x3cf389();while(!![]){try{const _0x44002d=-parseInt(_0x4d23d1(0x1b8))/0x1*(-parseInt(_0x4d23d1(0x1b7))/0x2)+parseInt(_0x4d23d1(0x1ce))/0x3*(parseInt(_0x4d23d1(0x1d4))/0x4)+-parseInt(_0x4d23d1(0x1af))/0x5*(-parseInt(_0x4d23d1(0x1d3))/0x6)+-parseInt(_0x4d23d1(0x1aa))/0x7+parseInt(_0x4d23d1(0x1c7))/0x8+-parseInt(_0x4d23d1(0x1b0))/0x9*(parseInt(_0x4d23d1(0x1c2))/0xa)+-parseInt(_0x4d23d1(0x1b1))/0xb;if(_0x44002d===_0x4ad248)break;else _0x167db0['push'](_0x167db0['shift']());}catch(_0x11d0a2){_0x167db0['push'](_0x167db0['shift']());}}}(a65_0x526e,0xe74ca));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x54efe8){const _0x41e7b7=a65_0x1052,_0x35b984=_0x54efe8[_0x41e7b7(0x1be)]('skill-code')[_0x41e7b7(0x1c6)](),_0x1fe9b7=_0x54efe8[_0x41e7b7(0x1be)](_0x41e7b7(0x1cd))[_0x41e7b7(0x1c6)](),_0x56cfba=_0x54efe8[_0x41e7b7(0x1be)](_0x41e7b7(0x1ab));if(!_0x35b984||!_0x1fe9b7||_0x56cfba!==_0x41e7b7(0x1b5)&&_0x56cfba!=='company')throw CliErrors['validation']('--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.');return{'skillCode':_0x35b984,'version':_0x1fe9b7,'scope':_0x56cfba};}async function readDiagramWriteInput(_0x7c331d){const _0x5bdb84=a65_0x1052,_0x1432f3=_0x7c331d['num'](_0x5bdb84(0x1ad)),_0x14747a=_0x7c331d[_0x5bdb84(0x1be)]('source-fingerprint')[_0x5bdb84(0x1c6)]();if(!Number[_0x5bdb84(0x1c9)](_0x1432f3)||_0x1432f3<0x0)throw CliErrors[_0x5bdb84(0x1ae)](_0x5bdb84(0x1c1));if(!/^sha256:[0-9a-f]{64}$/['test'](_0x14747a))throw CliErrors['validation'](_0x5bdb84(0x1b6));return{'expectedDiagramRevision':_0x1432f3,'sourceFingerprint':_0x14747a,'diagram':await readRequiredSkillDiagram(_0x7c331d['str'](_0x5bdb84(0x1d5)))};}export const diagramValidateCommand={'service':a65_0x4c8f01(0x1bb),'command':a65_0x4c8f01(0x1bc),'description':a65_0x4c8f01(0x1ba),'risk':a65_0x4c8f01(0x1d1),'flags':WRITE_FLAGS,async 'execute'(_0xf17e5f){const _0x1b5f57=a65_0x4c8f01,_0x31ea22=readDiagramTarget(_0xf17e5f),_0x1e6be3=await validateRuntimeSkillVersionDiagram(_0xf17e5f[_0x1b5f57(0x1c4)],_0x31ea22[_0x1b5f57(0x1c0)],_0x31ea22['version'],_0x31ea22[_0x1b5f57(0x1ab)],await readDiagramWriteInput(_0xf17e5f));return{'ok':!![],'data':_0x1e6be3,'message':_0x1b5f57(0x1ca)+_0x31ea22['skillCode']+'@'+_0x31ea22[_0x1b5f57(0x1cd)]+'.'};}};export const diagramPushCommand={'service':'skill','command':a65_0x4c8f01(0x1cb),'description':a65_0x4c8f01(0x1d6),'risk':a65_0x4c8f01(0x1b9),'confirmationDescription':a65_0x4c8f01(0x1b2),'flags':WRITE_FLAGS,async 'execute'(_0x78ce4d){const _0x1cb3a9=a65_0x4c8f01,_0x12c1d9=readDiagramTarget(_0x78ce4d),_0x10527e=await putRuntimeSkillVersionDiagram(_0x78ce4d[_0x1cb3a9(0x1c4)],_0x12c1d9['skillCode'],_0x12c1d9[_0x1cb3a9(0x1cd)],_0x12c1d9['scope'],await readDiagramWriteInput(_0x78ce4d));return{'ok':!![],'data':_0x10527e,'message':_0x10527e[_0x1cb3a9(0x1b3)]===_0x1cb3a9(0x1bf)?_0x1cb3a9(0x1cc)+_0x12c1d9['skillCode']+'@'+_0x12c1d9[_0x1cb3a9(0x1cd)]+_0x1cb3a9(0x1d2):(_0x10527e[_0x1cb3a9(0x1b3)]===_0x1cb3a9(0x1b4)?'Created':'Updated')+_0x1cb3a9(0x1d7)+_0x12c1d9[_0x1cb3a9(0x1c0)]+'@'+_0x12c1d9[_0x1cb3a9(0x1cd)]+'.'};}};function a65_0x526e(){const _0x5b3a0e=['884009MCCMSN','scope',';\x20next\x20write\x20expects\x20revision\x20','expected-diagram-revision','validation','15KxyCwW','9RrBLOP','34393898ykDpNV','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.','action','created','personal','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','2854402XkwVJX','1Kvbapm','write','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','skill','diagram-validate','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','str','unchanged','skillCode','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','3988830PUoBbr',';\x20first\x20write\x20expects\x20revision\x20','appCode','expectedDiagramRevision','trim','9677600EUBALm','diagram-show','isInteger','Skill\x20diagram\x20validation\x20passed\x20for\x20','diagram-push','Skill\x20diagram\x20for\x20','version','91236cfWyOM','found','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','read','\x20is\x20unchanged.','3620658MPLGex','20gheeJZ','diagram-file','Create\x20or\x20replace\x20a\x20Mermaid\x20diagram\x20for\x20a\x20specific\x20Skill\x20version','\x20Skill\x20diagram\x20for\x20'];a65_0x526e=function(){return _0x5b3a0e;};return a65_0x526e();}function a65_0x1052(_0x53e79d,_0x23d8bb){_0x53e79d=_0x53e79d-0x1aa;const _0x526e4e=a65_0x526e();let _0x10523f=_0x526e4e[_0x53e79d];return _0x10523f;}export const diagramShowCommand={'service':a65_0x4c8f01(0x1bb),'command':a65_0x4c8f01(0x1c8),'description':a65_0x4c8f01(0x1d0),'risk':a65_0x4c8f01(0x1d1),'flags':TARGET_FLAGS,async 'execute'(_0x2b27d1){const _0xc44d98=a65_0x4c8f01,_0xef6d94=readDiagramTarget(_0x2b27d1),_0x5d9371=await getRuntimeSkillVersionDiagram(_0x2b27d1[_0xc44d98(0x1c4)],_0xef6d94[_0xc44d98(0x1c0)],_0xef6d94[_0xc44d98(0x1cd)],_0xef6d94[_0xc44d98(0x1ab)]);return{'ok':!![],'data':_0x5d9371,'message':_0x5d9371[_0xc44d98(0x1cf)]?'Found\x20Skill\x20diagram\x20for\x20'+_0xef6d94['skillCode']+'@'+_0xef6d94[_0xc44d98(0x1cd)]+_0xc44d98(0x1ac)+_0x5d9371[_0xc44d98(0x1c5)]+'.':_0xc44d98(0x1bd)+_0xef6d94[_0xc44d98(0x1c0)]+'@'+_0xef6d94['version']+_0xc44d98(0x1c3)+_0x5d9371[_0xc44d98(0x1c5)]+'.'};}};
1
+ const a66_0x1c56c1=a66_0x5441;(function(_0x3be295,_0x4495b2){const _0x74a8a=a66_0x5441,_0x2b4f36=_0x3be295();while(!![]){try{const _0x1fb471=-parseInt(_0x74a8a(0x1a7))/0x1+parseInt(_0x74a8a(0x199))/0x2*(-parseInt(_0x74a8a(0x194))/0x3)+-parseInt(_0x74a8a(0x18f))/0x4+-parseInt(_0x74a8a(0x19a))/0x5+-parseInt(_0x74a8a(0x192))/0x6*(parseInt(_0x74a8a(0x19d))/0x7)+-parseInt(_0x74a8a(0x1a3))/0x8+-parseInt(_0x74a8a(0x18d))/0x9*(-parseInt(_0x74a8a(0x18b))/0xa);if(_0x1fb471===_0x4495b2)break;else _0x2b4f36['push'](_0x2b4f36['shift']());}catch(_0x4b0bb9){_0x2b4f36['push'](_0x2b4f36['shift']());}}}(a66_0x3a3a,0x2f661));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';function a66_0x3a3a(){const _0x278adf=['action','company',';\x20next\x20write\x20expects\x20revision\x20','Found\x20Skill\x20diagram\x20for\x20','isInteger','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','skill-code','personal','scope','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','expectedDiagramRevision','4187710ULUFav','str','27wqrpUa','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','936056PmVdrs','Updated','skill','12vbbxbC','appCode','33ZlcYki','trim','Skill\x20diagram\x20for\x20','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','\x20Skill\x20diagram\x20for\x20','9534CAJFsQ','1226195HvjIYL','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','diagram-file','473361vzMIKe','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.','expected-diagram-revision','diagram-push','\x20is\x20unchanged.','version','144728SzRUED','diagram-validate',';\x20first\x20write\x20expects\x20revision\x20','skillCode','377141ALOrxa','source-fingerprint'];a66_0x3a3a=function(){return _0x278adf;};return a66_0x3a3a();}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 a66_0x5441(_0x4e7e6a,_0x209ca5){_0x4e7e6a=_0x4e7e6a-0x189;const _0x3a3a59=a66_0x3a3a();let _0x5441ce=_0x3a3a59[_0x4e7e6a];return _0x5441ce;}function readDiagramTarget(_0x3b7765){const _0x50ade5=a66_0x5441,_0x349ac3=_0x3b7765[_0x50ade5(0x18c)](_0x50ade5(0x1af))[_0x50ade5(0x195)](),_0x381292=_0x3b7765[_0x50ade5(0x18c)](_0x50ade5(0x1a2))['trim'](),_0x348f0c=_0x3b7765[_0x50ade5(0x18c)](_0x50ade5(0x1b1));if(!_0x349ac3||!_0x381292||_0x348f0c!==_0x50ade5(0x1b0)&&_0x348f0c!==_0x50ade5(0x1aa))throw CliErrors['validation'](_0x50ade5(0x1ae));return{'skillCode':_0x349ac3,'version':_0x381292,'scope':_0x348f0c};}async function readDiagramWriteInput(_0x18e83e){const _0xaabc24=a66_0x5441,_0x4c8299=_0x18e83e['num'](_0xaabc24(0x19f)),_0x24f400=_0x18e83e['str'](_0xaabc24(0x1a8))[_0xaabc24(0x195)]();if(!Number[_0xaabc24(0x1ad)](_0x4c8299)||_0x4c8299<0x0)throw CliErrors['validation'](_0xaabc24(0x18e));if(!/^sha256:[0-9a-f]{64}$/['test'](_0x24f400))throw CliErrors['validation'](_0xaabc24(0x19b));return{'expectedDiagramRevision':_0x4c8299,'sourceFingerprint':_0x24f400,'diagram':await readRequiredSkillDiagram(_0x18e83e[_0xaabc24(0x18c)](_0xaabc24(0x19c)))};}export const diagramValidateCommand={'service':a66_0x1c56c1(0x191),'command':a66_0x1c56c1(0x1a4),'description':'Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','risk':'read','flags':WRITE_FLAGS,async 'execute'(_0x2d7857){const _0xb02027=a66_0x1c56c1,_0x125753=readDiagramTarget(_0x2d7857),_0x5ebe96=await validateRuntimeSkillVersionDiagram(_0x2d7857[_0xb02027(0x193)],_0x125753[_0xb02027(0x1a6)],_0x125753['version'],_0x125753[_0xb02027(0x1b1)],await readDiagramWriteInput(_0x2d7857));return{'ok':!![],'data':_0x5ebe96,'message':'Skill\x20diagram\x20validation\x20passed\x20for\x20'+_0x125753[_0xb02027(0x1a6)]+'@'+_0x125753['version']+'.'};}};export const diagramPushCommand={'service':a66_0x1c56c1(0x191),'command':a66_0x1c56c1(0x1a0),'description':'Create\x20or\x20replace\x20a\x20Mermaid\x20diagram\x20for\x20a\x20specific\x20Skill\x20version','risk':'write','confirmationDescription':a66_0x1c56c1(0x19e),'flags':WRITE_FLAGS,async 'execute'(_0xaf441d){const _0x5f53ba=a66_0x1c56c1,_0x2e5b19=readDiagramTarget(_0xaf441d),_0x3b0fea=await putRuntimeSkillVersionDiagram(_0xaf441d[_0x5f53ba(0x193)],_0x2e5b19[_0x5f53ba(0x1a6)],_0x2e5b19[_0x5f53ba(0x1a2)],_0x2e5b19[_0x5f53ba(0x1b1)],await readDiagramWriteInput(_0xaf441d));return{'ok':!![],'data':_0x3b0fea,'message':_0x3b0fea[_0x5f53ba(0x1a9)]==='unchanged'?_0x5f53ba(0x196)+_0x2e5b19['skillCode']+'@'+_0x2e5b19[_0x5f53ba(0x1a2)]+_0x5f53ba(0x1a1):(_0x3b0fea['action']==='created'?'Created':_0x5f53ba(0x190))+_0x5f53ba(0x198)+_0x2e5b19[_0x5f53ba(0x1a6)]+'@'+_0x2e5b19[_0x5f53ba(0x1a2)]+'.'};}};export const diagramShowCommand={'service':a66_0x1c56c1(0x191),'command':'diagram-show','description':a66_0x1c56c1(0x189),'risk':'read','flags':TARGET_FLAGS,async 'execute'(_0x246f2e){const _0x142562=a66_0x1c56c1,_0x151300=readDiagramTarget(_0x246f2e),_0xc8d290=await getRuntimeSkillVersionDiagram(_0x246f2e[_0x142562(0x193)],_0x151300[_0x142562(0x1a6)],_0x151300[_0x142562(0x1a2)],_0x151300[_0x142562(0x1b1)]);return{'ok':!![],'data':_0xc8d290,'message':_0xc8d290['found']?_0x142562(0x1ac)+_0x151300['skillCode']+'@'+_0x151300[_0x142562(0x1a2)]+_0x142562(0x1ab)+_0xc8d290[_0x142562(0x18a)]+'.':_0x142562(0x197)+_0x151300[_0x142562(0x1a6)]+'@'+_0x151300[_0x142562(0x1a2)]+_0x142562(0x1a5)+_0xc8d290[_0x142562(0x18a)]+'.'};}};