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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/README.md +1 -1
  2. package/lib/cli.js +1 -1
  3. package/lib/commands/api-doc/index.js +1 -1
  4. package/lib/commands/app/cache.js +1 -1
  5. package/lib/commands/app/definitions.js +1 -1
  6. package/lib/commands/app/eligibility.js +1 -1
  7. package/lib/commands/app/mock-loader.js +1 -1
  8. package/lib/commands/app/remote-source.js +1 -1
  9. package/lib/commands/app/shared.js +1 -1
  10. package/lib/commands/app-config/get.js +1 -1
  11. package/lib/commands/app-config/index.js +1 -1
  12. package/lib/commands/artifact/index.js +1 -1
  13. package/lib/commands/auth/device.js +1 -1
  14. package/lib/commands/auth/index.js +1 -1
  15. package/lib/commands/auth/prompt.js +1 -1
  16. package/lib/commands/bff/detail.js +1 -1
  17. package/lib/commands/bff/exec.js +1 -1
  18. package/lib/commands/bff/index.js +1 -1
  19. package/lib/commands/cli-skill/index.js +1 -1
  20. package/lib/commands/common/config-policy.js +1 -1
  21. package/lib/commands/common/constraints.js +1 -1
  22. package/lib/commands/common/flags.js +1 -1
  23. package/lib/commands/common/local-file.js +1 -1
  24. package/lib/commands/config/definitions.js +1 -1
  25. package/lib/commands/config/shared.js +1 -1
  26. package/lib/commands/data/index.js +1 -1
  27. package/lib/commands/dataset/detail.js +1 -1
  28. package/lib/commands/dataset/index.js +1 -1
  29. package/lib/commands/dataset/list.js +1 -1
  30. package/lib/commands/dataset/sdk-doc.js +1 -1
  31. package/lib/commands/doctor.js +1 -1
  32. package/lib/commands/file/index.js +1 -1
  33. package/lib/commands/init.js +1 -1
  34. package/lib/commands/kb/index.js +1 -1
  35. package/lib/commands/logs/index.js +1 -1
  36. package/lib/commands/ocr/index.js +1 -1
  37. package/lib/commands/personal-bff/index.js +1 -1
  38. package/lib/commands/registry.js +1 -1
  39. package/lib/commands/schedule/index.js +1 -1
  40. package/lib/commands/schema.js +1 -1
  41. package/lib/commands/service/dynamic.js +1 -1
  42. package/lib/commands/service/function-name-adapter.js +1 -1
  43. package/lib/commands/service/index.js +1 -1
  44. package/lib/commands/service/registry.js +1 -1
  45. package/lib/commands/skill/commands/create.js +1 -1
  46. package/lib/commands/skill/commands/diagram.d.ts +4 -0
  47. package/lib/commands/skill/commands/diagram.js +1 -0
  48. package/lib/commands/skill/commands/install.js +1 -1
  49. package/lib/commands/skill/commands/list.js +1 -1
  50. package/lib/commands/skill/commands/push.js +1 -1
  51. package/lib/commands/skill/commands/validate.js +1 -1
  52. package/lib/commands/skill/diagram.d.ts +5 -0
  53. package/lib/commands/skill/diagram.js +1 -0
  54. package/lib/commands/skill/flags.d.ts +6 -0
  55. package/lib/commands/skill/flags.js +1 -1
  56. package/lib/commands/skill/index.js +1 -1
  57. package/lib/commands/skill/manifest-helpers.js +1 -1
  58. package/lib/commands/skill/push-execute.d.ts +4 -0
  59. package/lib/commands/skill/push-execute.js +1 -1
  60. package/lib/commands/skill/push-flow-helpers.js +1 -1
  61. package/lib/commands/skill/push-retarget.js +1 -1
  62. package/lib/commands/skill/scopes.js +1 -1
  63. package/lib/commands/skill/summary.js +1 -1
  64. package/lib/commands/skill/templates.js +1 -1
  65. package/lib/commands/skill/validate.js +1 -1
  66. package/lib/commands/sql/detail.js +1 -1
  67. package/lib/commands/sql/exec.js +1 -1
  68. package/lib/commands/sql/index.js +1 -1
  69. package/lib/commands/update.js +1 -1
  70. package/lib/commands/workspace/index.js +1 -1
  71. package/lib/config/schema.js +1 -1
  72. package/lib/constant/app.js +1 -1
  73. package/lib/constant/auth-mode.js +1 -1
  74. package/lib/constant/cli.js +1 -1
  75. package/lib/constant/defaults.js +1 -1
  76. package/lib/constant/distribution.js +1 -1
  77. package/lib/constant/domain.js +1 -1
  78. package/lib/constant/env.js +1 -1
  79. package/lib/constant/output.js +1 -1
  80. package/lib/constant/product.js +1 -1
  81. package/lib/constant/risk.js +1 -1
  82. package/lib/constant/url.js +1 -1
  83. package/lib/context.js +1 -1
  84. package/lib/core/api-client.d.ts +52 -0
  85. package/lib/core/api-client.js +1 -1
  86. package/lib/core/db-resolver.js +1 -1
  87. package/lib/core/sdk-client.js +1 -1
  88. package/lib/errors.js +1 -1
  89. package/lib/framework/build-all-flags.js +1 -1
  90. package/lib/framework/dryrun.js +1 -1
  91. package/lib/framework/flags.js +1 -1
  92. package/lib/framework/help.js +1 -1
  93. package/lib/framework/index.js +1 -1
  94. package/lib/framework/output.js +1 -1
  95. package/lib/framework/preparse.js +1 -1
  96. package/lib/framework/rate-limit.js +1 -1
  97. package/lib/framework/raw-flags.js +1 -1
  98. package/lib/framework/response.js +1 -1
  99. package/lib/framework/runner-confirmation.js +1 -1
  100. package/lib/framework/runner-error.js +1 -1
  101. package/lib/framework/runner.js +1 -1
  102. package/lib/framework/schema-export.js +1 -1
  103. package/lib/framework/service-order.js +1 -1
  104. package/lib/framework/types.js +1 -1
  105. package/lib/generated/build-info.d.ts +4 -4
  106. package/lib/generated/build-info.js +1 -1
  107. package/lib/help.js +1 -1
  108. package/lib/runtime/event.js +1 -1
  109. package/lib/runtime/index.js +1 -1
  110. package/lib/runtime/queue.js +1 -1
  111. package/lib/runtime/resolve.js +1 -1
  112. package/lib/skills/npx-skills-add.js +1 -1
  113. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  114. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  115. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  116. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  117. package/lib/skills/runtime-skill-sync/links.js +1 -1
  118. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  119. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  120. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  121. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  122. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  123. package/lib/skills/runtime-skill-sync/push.js +1 -1
  124. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  125. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  126. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  127. package/lib/skills/runtime-skill-sync.js +1 -1
  128. package/lib/utils/apply-jq-filter.js +1 -1
  129. package/lib/utils/logger.js +1 -1
  130. package/lib/utils/lossless-json.js +1 -1
  131. package/lib/utils/params.js +1 -1
  132. package/lib/utils/platform.js +1 -1
  133. package/lib/utils/update-notice.js +1 -1
  134. package/lib/utils/version.js +1 -1
  135. package/lib/utils/write-cli-side-channel.js +1 -1
  136. package/package.json +3 -1
@@ -1 +1 @@
1
- const a29_0x2e43f0=a29_0x2e56;function a29_0x2e56(_0x4665c5,_0x25e21b){_0x4665c5=_0x4665c5-0x9a;const _0x16827c=a29_0x1682();let _0x2e5693=_0x16827c[_0x4665c5];return _0x2e5693;}(function(_0x1a1e09,_0x405177){const _0x5a2860=a29_0x2e56,_0x56d4f6=_0x1a1e09();while(!![]){try{const _0x3fa794=-parseInt(_0x5a2860(0xe6))/0x1+parseInt(_0x5a2860(0xab))/0x2*(-parseInt(_0x5a2860(0xe1))/0x3)+parseInt(_0x5a2860(0xc9))/0x4*(-parseInt(_0x5a2860(0xd4))/0x5)+-parseInt(_0x5a2860(0x9d))/0x6+-parseInt(_0x5a2860(0xbb))/0x7+parseInt(_0x5a2860(0xa9))/0x8+parseInt(_0x5a2860(0xd7))/0x9;if(_0x3fa794===_0x405177)break;else _0x56d4f6['push'](_0x56d4f6['shift']());}catch(_0x4b8588){_0x56d4f6['push'](_0x56d4f6['shift']());}}}(a29_0x1682,0x4ca25));import a29_0x2b2004 from'chalk';function a29_0x1682(){const _0x12b9c5=['1164hZxczD','log','doctor','✗\x20Invalid\x20JSON','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','\x20doctor','(default:\x20','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','format','⚠\x20Empty\x20(treated\x20as\x20{})','10715UvFIXO','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Diagnose\x20CLI\x20configuration\x20and\x20environment','20206035hLFYtw','✓\x20Valid\x20JSON','platform','✗\x20Invalid','Project','red','\x20\x20API\x20Endpoints','(none)','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','pageSize','3954TfsNeI','message','padEnd','✓\x20Loaded','empty','261697DLshPo','registryPath','\x20\x20auth\x20(effective):\x20','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','status','(set,\x20length=','\x20Imported\x20from:\x20','length','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Service\x20Tree','yellow','\x20\x20Auth','3016596PcoFlr','services','green','\x20\x20─','(default)','verbose','(removed\x20—\x20cookie\x20auth\x20disabled)','(not\x20set)','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','defaultApp','env','\x20\x20Config\x20Files','906520ewXjDV','check','662dUZlmr','read','accessKey','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Merged\x20Config','(unnamed)','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','arch','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20found)','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','repeat','Global','1541421aQurZO','gray','serviceCount','missing','(no\x20file)','\x20(accessKey)','name','⚠\x20Empty','ClientAk','\x20\x20Config\x20JSON','locale','commandCount','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','bold'];a29_0x1682=function(){return _0x12b9c5;};return a29_0x1682();}import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x193c7b){const _0xddc3bc=a29_0x2e56,_0x3ade04=getCliVersion(),_0x54464a=buildConfigFromFlags({});await initGlobalEnvironment(_0x54464a),console[_0xddc3bc(0xca)](),console[_0xddc3bc(0xca)](a29_0x2b2004[_0xddc3bc(0xc8)](CLI_BIN_NAME+_0xddc3bc(0xcf))),console[_0xddc3bc(0xca)](a29_0x2b2004[_0xddc3bc(0xbc)]('─'['repeat'](0x32))),console[_0xddc3bc(0xca)]('\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20'+_0x3ade04),console[_0xddc3bc(0xca)](_0xddc3bc(0xc7)+process['version']),console[_0xddc3bc(0xca)](_0xddc3bc(0xeb)+process[_0xddc3bc(0xd9)]+'\x20'+process[_0xddc3bc(0xb3)]),console[_0xddc3bc(0xca)](),console[_0xddc3bc(0xca)](a29_0x2b2004['bold'](_0xddc3bc(0xa8))),console[_0xddc3bc(0xca)](a29_0x2b2004[_0xddc3bc(0xbc)]('\x20\x20─'[_0xddc3bc(0xb9)](0x1e)));const _0x14cb72=getGlobalConfigPath(),_0x28dc64=getProjectConfigPath();console[_0xddc3bc(0xca)](_0xddc3bc(0xd5)+(_0x14cb72||a29_0x2b2004['gray'](_0xddc3bc(0xb5)))),console[_0xddc3bc(0xca)](_0xddc3bc(0xa5)+(_0x28dc64||a29_0x2b2004[_0xddc3bc(0xbc)]('(not\x20found)'))),console['log'](),console[_0xddc3bc(0xca)](a29_0x2b2004[_0xddc3bc(0xc8)](_0xddc3bc(0xc4))),console[_0xddc3bc(0xca)](a29_0x2b2004[_0xddc3bc(0xbc)](_0xddc3bc(0xa0)[_0xddc3bc(0xb9)](0x1e)));const _0x55d04c=(_0x20111a,_0x57bb75)=>{const _0x53c0f4=_0xddc3bc;if(!_0x57bb75){console[_0x53c0f4(0xca)]('\x20\x20'+_0x20111a[_0x53c0f4(0xe3)](0x11)+'\x20'+a29_0x2b2004[_0x53c0f4(0xbc)](_0x53c0f4(0xbf)));return;}const _0x5846e0=inspectCliConfigJsonFile(_0x57bb75);if(_0x5846e0[_0x53c0f4(0xec)]==='ok')console[_0x53c0f4(0xca)]('\x20\x20'+_0x20111a['padEnd'](0x11)+'\x20'+a29_0x2b2004[_0x53c0f4(0x9f)](_0x53c0f4(0xd8)));else{if(_0x5846e0[_0x53c0f4(0xec)]===_0x53c0f4(0xe5))console[_0x53c0f4(0xca)]('\x20\x20'+_0x20111a[_0x53c0f4(0xe3)](0x11)+'\x20'+a29_0x2b2004[_0x53c0f4(0x9b)](_0x53c0f4(0xd3)));else _0x5846e0[_0x53c0f4(0xec)]===_0x53c0f4(0xbe)?console[_0x53c0f4(0xca)]('\x20\x20'+_0x20111a[_0x53c0f4(0xe3)](0x11)+'\x20'+a29_0x2b2004[_0x53c0f4(0xbc)]('(missing)')):(console['log']('\x20\x20'+_0x20111a[_0x53c0f4(0xe3)](0x11)+'\x20'+a29_0x2b2004[_0x53c0f4(0xdc)](_0x53c0f4(0xcc))),console[_0x53c0f4(0xca)]('\x20\x20'+''['padEnd'](0x11)+'\x20'+a29_0x2b2004[_0x53c0f4(0xdc)](_0x5846e0['message'])));}};_0x55d04c(_0xddc3bc(0xba),_0x14cb72),_0x55d04c(_0xddc3bc(0xdb),_0x28dc64),console[_0xddc3bc(0xca)](),console['log'](a29_0x2b2004[_0xddc3bc(0xc8)](_0xddc3bc(0xaf))),console[_0xddc3bc(0xca)](a29_0x2b2004[_0xddc3bc(0xbc)](_0xddc3bc(0xa0)['repeat'](0x1e))),console[_0xddc3bc(0xca)]('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x54464a['appCode']||a29_0x2b2004['red'](_0xddc3bc(0xa4)))),console[_0xddc3bc(0xca)](_0xddc3bc(0xb8)+_0x54464a[_0xddc3bc(0xa7)]);const _0x2241fe=isLegacyCompatConfigKey(_0xddc3bc(0xc5))?a29_0x2b2004[_0xddc3bc(0xbc)](_0x54464a[_0xddc3bc(0xc5)]+'\x20(legacy/compat\x20only)'):_0x54464a[_0xddc3bc(0xc5)];console['log'](_0xddc3bc(0xae)+_0x2241fe),console['log'](_0xddc3bc(0xdf)+(_0x54464a[_0xddc3bc(0xa6)]||a29_0x2b2004[_0xddc3bc(0xbc)]('(none)'))),console['log'](_0xddc3bc(0xb7)+(_0x54464a['currentApp']||a29_0x2b2004[_0xddc3bc(0xbc)](_0xddc3bc(0xde)))),console[_0xddc3bc(0xca)](_0xddc3bc(0xb2)+(_0x54464a[_0xddc3bc(0xd2)]||a29_0x2b2004[_0xddc3bc(0xbc)](_0xddc3bc(0xd0)+DEFAULT_CONFIG_VALUES[_0xddc3bc(0xd2)]+')'))),console[_0xddc3bc(0xca)](_0xddc3bc(0xf0)+(_0x54464a[_0xddc3bc(0xe0)]??a29_0x2b2004['gray'](_0xddc3bc(0xa1)))),console[_0xddc3bc(0xca)](_0xddc3bc(0xcd)+_0x54464a['riskLevel']),console[_0xddc3bc(0xca)](_0xddc3bc(0xb4)+_0x54464a[_0xddc3bc(0xa2)]),console[_0xddc3bc(0xca)](_0xddc3bc(0xe8)+AUTH_MODE[_0xddc3bc(0xc3)]),console[_0xddc3bc(0xca)]('\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20'+(_0x54464a[_0xddc3bc(0xad)]?a29_0x2b2004[_0xddc3bc(0x9f)](_0xddc3bc(0xed)+_0x54464a[_0xddc3bc(0xad)][_0xddc3bc(0xef)]+')'):a29_0x2b2004[_0xddc3bc(0xbc)](_0xddc3bc(0xde)))),console[_0xddc3bc(0xca)](),console[_0xddc3bc(0xca)](a29_0x2b2004[_0xddc3bc(0xc8)](_0xddc3bc(0xdd))),console[_0xddc3bc(0xca)](a29_0x2b2004['gray'](_0xddc3bc(0xa0)[_0xddc3bc(0xb9)](0x1e))),console['log']('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0xddc3bc(0xca)]('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console['log'](_0xddc3bc(0xea)+getRuntimeDomain()),console['log'](),console[_0xddc3bc(0xca)](a29_0x2b2004[_0xddc3bc(0xc8)](_0xddc3bc(0x9a))),console[_0xddc3bc(0xca)](a29_0x2b2004[_0xddc3bc(0xbc)](_0xddc3bc(0xa0)[_0xddc3bc(0xb9)](0x1e)));const _0x24e405=inspectServiceRegistry();console[_0xddc3bc(0xca)](_0xddc3bc(0xe9)+_0x24e405[_0xddc3bc(0xe7)]),console[_0xddc3bc(0xca)](_0xddc3bc(0xd1)+formatServiceRegistryStatus(_0x24e405)),console[_0xddc3bc(0xca)](_0xddc3bc(0xb6)+_0x24e405[_0xddc3bc(0xbd)]),console[_0xddc3bc(0xca)](_0xddc3bc(0xce)+_0x24e405[_0xddc3bc(0xc6)]);for(const _0x16de12 of _0x24e405[_0xddc3bc(0x9e)]){console['log']('\x20\x20'+(_0x16de12['serviceCode']+':')['padEnd'](0x11)+'\x20'+(_0x16de12[_0xddc3bc(0xc1)]||a29_0x2b2004[_0xddc3bc(0xbc)](_0xddc3bc(0xb0)))+'\x20('+_0x16de12['commandCount']+'\x20commands)'),console[_0xddc3bc(0xca)]('\x20\x20'+''['padEnd'](0x11)+_0xddc3bc(0xee)+_0x16de12['source']['path']);}return console[_0xddc3bc(0xca)](),console[_0xddc3bc(0xca)](a29_0x2b2004[_0xddc3bc(0xc8)](_0xddc3bc(0x9c))),console[_0xddc3bc(0xca)](a29_0x2b2004[_0xddc3bc(0xbc)]('\x20\x20─'['repeat'](0x1e))),console[_0xddc3bc(0xca)](_0xddc3bc(0xb1)+a29_0x2b2004[_0xddc3bc(0x9f)](AUTH_MODE[_0xddc3bc(0xc3)]+_0xddc3bc(0xc0))),console[_0xddc3bc(0xca)]('\x20\x20Session\x20check:\x20\x20\x20'+a29_0x2b2004['gray'](_0xddc3bc(0xa3))),console[_0xddc3bc(0xca)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x29de4e){const _0x1a645b=a29_0x2e56;if(_0x29de4e[_0x1a645b(0xec)]==='ok')return a29_0x2b2004[_0x1a645b(0x9f)](_0x1a645b(0xe4));if(_0x29de4e[_0x1a645b(0xec)]===_0x1a645b(0xbe))return a29_0x2b2004[_0x1a645b(0xbc)](_0x1a645b(0xb5));if(_0x29de4e[_0x1a645b(0xec)]===_0x1a645b(0xe5))return a29_0x2b2004[_0x1a645b(0x9b)](_0x1a645b(0xc2));return a29_0x2b2004[_0x1a645b(0xdc)](_0x1a645b(0xda)+(_0x29de4e[_0x1a645b(0xe2)]?':\x20'+_0x29de4e[_0x1a645b(0xe2)]:''));}export const doctorDefinition={'service':a29_0x2e43f0(0xcb),'command':a29_0x2e43f0(0xaa),'description':a29_0x2e43f0(0xd6),'risk':a29_0x2e43f0(0xac),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
1
+ const a29_0x346c06=a29_0x3cab;(function(_0x847b87,_0x106368){const _0x4cbb23=a29_0x3cab,_0x1f40d0=_0x847b87();while(!![]){try{const _0x105767=parseInt(_0x4cbb23(0x14b))/0x1*(-parseInt(_0x4cbb23(0x15a))/0x2)+parseInt(_0x4cbb23(0x141))/0x3*(parseInt(_0x4cbb23(0x15c))/0x4)+-parseInt(_0x4cbb23(0x145))/0x5*(-parseInt(_0x4cbb23(0x163))/0x6)+parseInt(_0x4cbb23(0x12b))/0x7*(-parseInt(_0x4cbb23(0x153))/0x8)+parseInt(_0x4cbb23(0x16a))/0x9*(-parseInt(_0x4cbb23(0x175))/0xa)+-parseInt(_0x4cbb23(0x168))/0xb+-parseInt(_0x4cbb23(0x14f))/0xc*(-parseInt(_0x4cbb23(0x136))/0xd);if(_0x105767===_0x106368)break;else _0x1f40d0['push'](_0x1f40d0['shift']());}catch(_0x227104){_0x1f40d0['push'](_0x1f40d0['shift']());}}}(a29_0x4f6c,0x82a35));import a29_0x236dc7 from'chalk';function a29_0x4f6c(){const _0x15cc2f=['green','⚠\x20Empty','Global','length','defaultApp','red','✗\x20Invalid\x20JSON','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','120150SQEgyf','commandCount','(removed\x20—\x20cookie\x20auth\x20disabled)','status','format','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','arch','services','(missing)','(none)','\x20\x20Config\x20Files','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','4619909XwiEnJ','gray','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','missing','Project','(unnamed)','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Service\x20Tree','(default)','empty','currentApp','3887eXWUMo','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','env','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20Merged\x20Config','✗\x20Invalid','name','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20found)','54963mGEDUP','padEnd','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','serviceCode','1040430admemR','\x20\x20─','yellow','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','platform','✓\x20Valid\x20JSON','5997SivQyp','bold','\x20\x20Auth','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','95496yJeUTx','\x20commands)','path','\x20\x20API\x20Endpoints','8KIQtmF','(no\x20file)','log','ClientAk','\x20(legacy/compat\x20only)','version','(set,\x20length=','304JqucUs','message','8oRfDMy','pageSize','\x20\x20Config\x20JSON','repeat','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','accessKey','registryPath','24EZrkgW','verbose','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','10841699eVGtkn','locale','117pzxKMx','\x20(accessKey)','\x20\x20Session\x20check:\x20\x20\x20'];a29_0x4f6c=function(){return _0x15cc2f;};return a29_0x4f6c();}import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x2fea5b){const _0x53320f=a29_0x3cab,_0xc7ecb7=getCliVersion(),_0x37a192=buildConfigFromFlags({});await initGlobalEnvironment(_0x37a192),console[_0x53320f(0x155)](),console[_0x53320f(0x155)](a29_0x236dc7[_0x53320f(0x14c)](CLI_BIN_NAME+'\x20doctor')),console[_0x53320f(0x155)](a29_0x236dc7[_0x53320f(0x12c)]('─'['repeat'](0x32))),console[_0x53320f(0x155)](_0x53320f(0x143)+_0xc7ecb7),console[_0x53320f(0x155)](_0x53320f(0x13f)+process[_0x53320f(0x158)]),console[_0x53320f(0x155)](_0x53320f(0x174)+process[_0x53320f(0x149)]+'\x20'+process[_0x53320f(0x17b)]),console[_0x53320f(0x155)](),console['log'](a29_0x236dc7[_0x53320f(0x14c)](_0x53320f(0x129))),console[_0x53320f(0x155)](a29_0x236dc7[_0x53320f(0x12c)](_0x53320f(0x146)[_0x53320f(0x15f)](0x1e)));const _0x1a175c=getGlobalConfigPath(),_0x2447b9=getProjectConfigPath();console[_0x53320f(0x155)](_0x53320f(0x17a)+(_0x1a175c||a29_0x236dc7[_0x53320f(0x12c)](_0x53320f(0x140)))),console[_0x53320f(0x155)](_0x53320f(0x12a)+(_0x2447b9||a29_0x236dc7['gray'](_0x53320f(0x140)))),console[_0x53320f(0x155)](),console['log'](a29_0x236dc7[_0x53320f(0x14c)](_0x53320f(0x15e))),console[_0x53320f(0x155)](a29_0x236dc7[_0x53320f(0x12c)](_0x53320f(0x146)['repeat'](0x1e)));const _0x1e431f=(_0x1c5e8b,_0x3812a2)=>{const _0x2a221c=_0x53320f;if(!_0x3812a2){console['log']('\x20\x20'+_0x1c5e8b[_0x2a221c(0x142)](0x11)+'\x20'+a29_0x236dc7[_0x2a221c(0x12c)](_0x2a221c(0x154)));return;}const _0x9f3d8f=inspectCliConfigJsonFile(_0x3812a2);if(_0x9f3d8f[_0x2a221c(0x178)]==='ok')console[_0x2a221c(0x155)]('\x20\x20'+_0x1c5e8b[_0x2a221c(0x142)](0x11)+'\x20'+a29_0x236dc7[_0x2a221c(0x16d)](_0x2a221c(0x14a)));else{if(_0x9f3d8f[_0x2a221c(0x178)]===_0x2a221c(0x134))console[_0x2a221c(0x155)]('\x20\x20'+_0x1c5e8b[_0x2a221c(0x142)](0x11)+'\x20'+a29_0x236dc7['yellow']('⚠\x20Empty\x20(treated\x20as\x20{})'));else _0x9f3d8f['status']===_0x2a221c(0x12e)?console['log']('\x20\x20'+_0x1c5e8b['padEnd'](0x11)+'\x20'+a29_0x236dc7[_0x2a221c(0x12c)](_0x2a221c(0x17d))):(console[_0x2a221c(0x155)]('\x20\x20'+_0x1c5e8b[_0x2a221c(0x142)](0x11)+'\x20'+a29_0x236dc7[_0x2a221c(0x172)](_0x2a221c(0x173))),console[_0x2a221c(0x155)]('\x20\x20'+''['padEnd'](0x11)+'\x20'+a29_0x236dc7['red'](_0x9f3d8f['message'])));}};_0x1e431f(_0x53320f(0x16f),_0x1a175c),_0x1e431f(_0x53320f(0x12f),_0x2447b9),console['log'](),console[_0x53320f(0x155)](a29_0x236dc7[_0x53320f(0x14c)](_0x53320f(0x13c))),console[_0x53320f(0x155)](a29_0x236dc7[_0x53320f(0x12c)](_0x53320f(0x146)['repeat'](0x1e))),console[_0x53320f(0x155)](_0x53320f(0x131)+(_0x37a192['appCode']||a29_0x236dc7[_0x53320f(0x172)]('(not\x20set)'))),console[_0x53320f(0x155)](_0x53320f(0x167)+_0x37a192[_0x53320f(0x139)]);const _0x4b8ca6=isLegacyCompatConfigKey(_0x53320f(0x169))?a29_0x236dc7[_0x53320f(0x12c)](_0x37a192[_0x53320f(0x169)]+_0x53320f(0x157)):_0x37a192[_0x53320f(0x169)];console['log']('\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x4b8ca6),console[_0x53320f(0x155)](_0x53320f(0x166)+(_0x37a192[_0x53320f(0x171)]||a29_0x236dc7[_0x53320f(0x12c)](_0x53320f(0x17e)))),console['log'](_0x53320f(0x13b)+(_0x37a192[_0x53320f(0x135)]||a29_0x236dc7[_0x53320f(0x12c)]('(none)'))),console[_0x53320f(0x155)]('\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x37a192[_0x53320f(0x179)]||a29_0x236dc7[_0x53320f(0x12c)]('(default:\x20'+DEFAULT_CONFIG_VALUES[_0x53320f(0x179)]+')'))),console[_0x53320f(0x155)](_0x53320f(0x14e)+(_0x37a192[_0x53320f(0x15d)]??a29_0x236dc7[_0x53320f(0x12c)](_0x53320f(0x133)))),console[_0x53320f(0x155)](_0x53320f(0x138)+_0x37a192['riskLevel']),console[_0x53320f(0x155)]('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x37a192[_0x53320f(0x164)]),console[_0x53320f(0x155)]('\x20\x20auth\x20(effective):\x20'+AUTH_MODE[_0x53320f(0x156)]),console[_0x53320f(0x155)](_0x53320f(0x165)+(_0x37a192[_0x53320f(0x161)]?a29_0x236dc7[_0x53320f(0x16d)](_0x53320f(0x159)+_0x37a192[_0x53320f(0x161)][_0x53320f(0x170)]+')'):a29_0x236dc7['gray']('(none)'))),console[_0x53320f(0x155)](),console['log'](a29_0x236dc7[_0x53320f(0x14c)](_0x53320f(0x152))),console[_0x53320f(0x155)](a29_0x236dc7[_0x53320f(0x12c)](_0x53320f(0x146)['repeat'](0x1e))),console[_0x53320f(0x155)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console['log']('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console[_0x53320f(0x155)]('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x53320f(0x155)](),console['log'](a29_0x236dc7[_0x53320f(0x14c)](_0x53320f(0x132))),console[_0x53320f(0x155)](a29_0x236dc7['gray']('\x20\x20─'['repeat'](0x1e)));const _0x5860e2=inspectServiceRegistry();console[_0x53320f(0x155)]('\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5860e2[_0x53320f(0x162)]),console['log'](_0x53320f(0x148)+formatServiceRegistryStatus(_0x5860e2)),console['log'](_0x53320f(0x12d)+_0x5860e2['serviceCount']),console[_0x53320f(0x155)](_0x53320f(0x137)+_0x5860e2[_0x53320f(0x176)]);for(const _0x2af0a8 of _0x5860e2[_0x53320f(0x17c)]){console[_0x53320f(0x155)]('\x20\x20'+(_0x2af0a8[_0x53320f(0x144)]+':')[_0x53320f(0x142)](0x11)+'\x20'+(_0x2af0a8[_0x53320f(0x13e)]||a29_0x236dc7[_0x53320f(0x12c)](_0x53320f(0x130)))+'\x20('+_0x2af0a8['commandCount']+_0x53320f(0x150)),console[_0x53320f(0x155)]('\x20\x20'+''[_0x53320f(0x142)](0x11)+'\x20Imported\x20from:\x20'+_0x2af0a8['source'][_0x53320f(0x151)]);}return console[_0x53320f(0x155)](),console['log'](a29_0x236dc7['bold'](_0x53320f(0x14d))),console['log'](a29_0x236dc7[_0x53320f(0x12c)](_0x53320f(0x146)[_0x53320f(0x15f)](0x1e))),console['log'](_0x53320f(0x160)+a29_0x236dc7[_0x53320f(0x16d)](AUTH_MODE[_0x53320f(0x156)]+_0x53320f(0x16b))),console[_0x53320f(0x155)](_0x53320f(0x16c)+a29_0x236dc7[_0x53320f(0x12c)](_0x53320f(0x177))),console[_0x53320f(0x155)](),{'ok':!![]};}function a29_0x3cab(_0x31507e,_0x1b852c){_0x31507e=_0x31507e-0x129;const _0x4f6c10=a29_0x4f6c();let _0x3cabeb=_0x4f6c10[_0x31507e];return _0x3cabeb;}function formatServiceRegistryStatus(_0x43a0a3){const _0xb1ea62=a29_0x3cab;if(_0x43a0a3[_0xb1ea62(0x178)]==='ok')return a29_0x236dc7[_0xb1ea62(0x16d)]('✓\x20Loaded');if(_0x43a0a3[_0xb1ea62(0x178)]===_0xb1ea62(0x12e))return a29_0x236dc7[_0xb1ea62(0x12c)](_0xb1ea62(0x140));if(_0x43a0a3[_0xb1ea62(0x178)]==='empty')return a29_0x236dc7[_0xb1ea62(0x147)](_0xb1ea62(0x16e));return a29_0x236dc7[_0xb1ea62(0x172)](_0xb1ea62(0x13d)+(_0x43a0a3[_0xb1ea62(0x15b)]?':\x20'+_0x43a0a3['message']:''));}export const doctorDefinition={'service':'doctor','command':'check','description':a29_0x346c06(0x13a),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a30_0x5cef24=a30_0x1abc;(function(_0x3e36dd,_0x1f7fdf){const _0x78748d=a30_0x1abc,_0x45185d=_0x3e36dd();while(!![]){try{const _0x51618e=parseInt(_0x78748d(0x13a))/0x1*(-parseInt(_0x78748d(0x13e))/0x2)+-parseInt(_0x78748d(0x12a))/0x3*(parseInt(_0x78748d(0x136))/0x4)+parseInt(_0x78748d(0x131))/0x5*(-parseInt(_0x78748d(0x11a))/0x6)+parseInt(_0x78748d(0x13d))/0x7*(parseInt(_0x78748d(0x13c))/0x8)+parseInt(_0x78748d(0x11d))/0x9*(parseInt(_0x78748d(0x137))/0xa)+-parseInt(_0x78748d(0x132))/0xb*(-parseInt(_0x78748d(0x12d))/0xc)+parseInt(_0x78748d(0x125))/0xd;if(_0x51618e===_0x1f7fdf)break;else _0x45185d['push'](_0x45185d['shift']());}catch(_0x42ef04){_0x45185d['push'](_0x45185d['shift']());}}}(a30_0x4b6c,0x69aa8));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';function a30_0x1abc(_0x3765c5,_0x314350){_0x3765c5=_0x3765c5-0x11a;const _0x4b6c88=a30_0x4b6c();let _0x1abc42=_0x4b6c88[_0x3765c5];return _0x1abc42;}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x5cef24(0x11b),'type':a30_0x5cef24(0x126),'required':!![],'description':a30_0x5cef24(0x11c)},FILEPATH_FLAG={'name':a30_0x5cef24(0x11f),'type':a30_0x5cef24(0x126),'required':!![],'description':'Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data'},DOWNLOAD_FLAG={'name':a30_0x5cef24(0x122),'type':'boolean','description':'Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL'},LONG_TERM_FLAG={'name':a30_0x5cef24(0x134),'type':a30_0x5cef24(0x13f),'description':a30_0x5cef24(0x12e)};function requireFilePath(_0x368d11){const _0x53e085=a30_0x5cef24,_0x4c76ad=_0x368d11[_0x53e085(0x12f)]();if(!_0x4c76ad)throw CliErrors['validation'](_0x53e085(0x124));return _0x4c76ad;}const fileUpload={'service':a30_0x5cef24(0x11b),'command':a30_0x5cef24(0x120),'description':a30_0x5cef24(0x121),'risk':a30_0x5cef24(0x133),'flags':[FILE_FLAG],async 'dryRun'(_0x9494c9){const _0x57a9f3=a30_0x5cef24,_0x209756=requireRuntimeUploadFile(_0x9494c9[_0x57a9f3(0x11e)](_0x57a9f3(0x11b)),_0x57a9f3(0x13b));return dryRun(_0x57a9f3(0x12b),_0x57a9f3(0x129))[_0x57a9f3(0x130)]({'appCode':_0x9494c9[_0x57a9f3(0x138)],'multipart':{'file':_0x209756}})['description']('Preview:\x20upload\x20'+_0x209756[_0x57a9f3(0x12c)]+_0x57a9f3(0x141)+_0x9494c9[_0x57a9f3(0x138)])[_0x57a9f3(0x140)]();},async 'execute'(_0x4db25a){const _0x54dcc2=a30_0x5cef24,_0x2038d2=requireRuntimeUploadFile(_0x4db25a['str'](_0x54dcc2(0x11b)),_0x54dcc2(0x13b)),_0x30db04=await uploadRuntimeFile(_0x4db25a['appCode'],_0x2038d2['path']);return{'ok':!![],'data':_0x30db04,'message':_0x30db04[_0x54dcc2(0x127)]?'Uploaded\x20file:\x20'+_0x30db04['filePath']+_0x54dcc2(0x128):_0x54dcc2(0x139)};}},fileQueryUrl={'service':a30_0x5cef24(0x11b),'command':a30_0x5cef24(0x135),'description':'Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','risk':a30_0x5cef24(0x133),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x83eb4d){const _0x2509ce=a30_0x5cef24,_0x29de3f=requireFilePath(_0x83eb4d[_0x2509ce(0x11e)]('filepath')),_0x1c55b4=await queryRuntimeFileUrl(_0x29de3f,{'download':_0x83eb4d['bool'](_0x2509ce(0x122)),'longTerm':_0x83eb4d[_0x2509ce(0x123)](_0x2509ce(0x134))});return{'ok':!![],'data':_0x1c55b4};}};function a30_0x4b6c(){const _0x18eb45=['Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','1rbxVQw','File','80iUepEQ','266329ldWFyo','450852mAHuAs','boolean','build','\x20to\x20runtime\x20app\x20','6SPFxMi','file','Path\x20to\x20the\x20local\x20file\x20to\x20upload','45CkJoZt','str','filepath','upload','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','download','bool','filePath\x20is\x20required.','9266465wkkhFK','string','filePath','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','/client/uploadFile','9spdBVo','POST','path','276CzKbHR','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','trim','body','2622175qqwcsf','138347Taqsgu','read','long-term','query-url','329796QNiLRA','94940UwJatM','appCode'];a30_0x4b6c=function(){return _0x18eb45;};return a30_0x4b6c();}export const fileDefinitions=[fileUpload,fileQueryUrl];
1
+ const a30_0x478127=a30_0x123d;(function(_0x4629d8,_0x53f12e){const _0x1f1f35=a30_0x123d,_0x40348e=_0x4629d8();while(!![]){try{const _0x411fcc=-parseInt(_0x1f1f35(0x17d))/0x1+-parseInt(_0x1f1f35(0x161))/0x2+parseInt(_0x1f1f35(0x165))/0x3*(-parseInt(_0x1f1f35(0x171))/0x4)+parseInt(_0x1f1f35(0x16f))/0x5*(-parseInt(_0x1f1f35(0x175))/0x6)+parseInt(_0x1f1f35(0x16a))/0x7*(parseInt(_0x1f1f35(0x16c))/0x8)+-parseInt(_0x1f1f35(0x182))/0x9+parseInt(_0x1f1f35(0x169))/0xa*(parseInt(_0x1f1f35(0x172))/0xb);if(_0x411fcc===_0x53f12e)break;else _0x40348e['push'](_0x40348e['shift']());}catch(_0x44d6a3){_0x40348e['push'](_0x40348e['shift']());}}}(a30_0x36ee,0x492cc));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';function a30_0x36ee(){const _0x3bfd98=['7BWVxLM','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','522440PMNPhx','validation','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','220085ZyXKZr','Uploaded\x20file:\x20','2072216jVoGJq','11EeZtio','string','long-term','54iSnuqh','description','filePath','bool','str','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','Path\x20to\x20the\x20local\x20file\x20to\x20upload','File','249527Czvikd','download','POST','boolean','filepath','5151636BYVydN','read','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','appCode','1049724jPCTWg','upload','path','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','3ByKHcZ','file','query-url','trim','24954190uWEzLc'];a30_0x36ee=function(){return _0x3bfd98;};return a30_0x36ee();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a30_0x123d(_0x102ec5,_0x300925){_0x102ec5=_0x102ec5-0x15e;const _0x36ee9e=a30_0x36ee();let _0x123d4b=_0x36ee9e[_0x102ec5];return _0x123d4b;}const FILE_FLAG={'name':'file','type':a30_0x478127(0x173),'required':!![],'description':a30_0x478127(0x17b)},FILEPATH_FLAG={'name':a30_0x478127(0x181),'type':a30_0x478127(0x173),'required':!![],'description':a30_0x478127(0x16b)},DOWNLOAD_FLAG={'name':a30_0x478127(0x17e),'type':a30_0x478127(0x180),'description':'Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL'},LONG_TERM_FLAG={'name':a30_0x478127(0x174),'type':'boolean','description':'Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML'};function requireFilePath(_0x87b5ff){const _0x1b0920=a30_0x478127,_0x244f4c=_0x87b5ff[_0x1b0920(0x168)]();if(!_0x244f4c)throw CliErrors[_0x1b0920(0x16d)]('filePath\x20is\x20required.');return _0x244f4c;}const fileUpload={'service':a30_0x478127(0x166),'command':a30_0x478127(0x162),'description':a30_0x478127(0x16e),'risk':a30_0x478127(0x15e),'flags':[FILE_FLAG],async 'dryRun'(_0x5395d6){const _0x1d7595=a30_0x478127,_0x1391e6=requireRuntimeUploadFile(_0x5395d6[_0x1d7595(0x179)]('file'),_0x1d7595(0x17c));return dryRun(_0x1d7595(0x17f),'/client/uploadFile')['body']({'appCode':_0x5395d6[_0x1d7595(0x160)],'multipart':{'file':_0x1391e6}})[_0x1d7595(0x176)]('Preview:\x20upload\x20'+_0x1391e6[_0x1d7595(0x163)]+'\x20to\x20runtime\x20app\x20'+_0x5395d6[_0x1d7595(0x160)])['build']();},async 'execute'(_0x35dff6){const _0xd19a5b=a30_0x478127,_0x2a90db=requireRuntimeUploadFile(_0x35dff6[_0xd19a5b(0x179)](_0xd19a5b(0x166)),_0xd19a5b(0x17c)),_0x17b45d=await uploadRuntimeFile(_0x35dff6['appCode'],_0x2a90db[_0xd19a5b(0x163)]);return{'ok':!![],'data':_0x17b45d,'message':_0x17b45d[_0xd19a5b(0x177)]?_0xd19a5b(0x170)+_0x17b45d[_0xd19a5b(0x177)]+_0xd19a5b(0x17a):_0xd19a5b(0x164)};}},fileQueryUrl={'service':a30_0x478127(0x166),'command':a30_0x478127(0x167),'description':a30_0x478127(0x15f),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x33b329){const _0xaf8b45=a30_0x478127,_0x3decd8=requireFilePath(_0x33b329['str'](_0xaf8b45(0x181))),_0x45ba29=await queryRuntimeFileUrl(_0x3decd8,{'download':_0x33b329[_0xaf8b45(0x178)](_0xaf8b45(0x17e)),'longTerm':_0x33b329[_0xaf8b45(0x178)](_0xaf8b45(0x174))});return{'ok':!![],'data':_0x45ba29};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
@@ -1 +1 @@
1
- const a31_0x246b72=a31_0x102f;(function(_0x1eca44,_0x528166){const _0x56b91c=a31_0x102f,_0x41bc23=_0x1eca44();while(!![]){try{const _0x45e740=parseInt(_0x56b91c(0xa7))/0x1*(parseInt(_0x56b91c(0x83))/0x2)+-parseInt(_0x56b91c(0xa1))/0x3+-parseInt(_0x56b91c(0x96))/0x4*(-parseInt(_0x56b91c(0x94))/0x5)+-parseInt(_0x56b91c(0x8e))/0x6+-parseInt(_0x56b91c(0x6f))/0x7*(-parseInt(_0x56b91c(0x73))/0x8)+-parseInt(_0x56b91c(0x98))/0x9*(parseInt(_0x56b91c(0x75))/0xa)+parseInt(_0x56b91c(0x67))/0xb*(-parseInt(_0x56b91c(0x8b))/0xc);if(_0x45e740===_0x528166)break;else _0x41bc23['push'](_0x41bc23['shift']());}catch(_0x3fbee8){_0x41bc23['push'](_0x41bc23['shift']());}}}(a31_0x590c,0xb98c0));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x246b72(0x81),'type':a31_0x246b72(0x72),'description':a31_0x246b72(0x95)},{'name':a31_0x246b72(0x85),'type':a31_0x246b72(0x72),'description':a31_0x246b72(0x91)+DEFAULT_CONFIG_VALUES[a31_0x246b72(0x85)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x246b72(0x86),'type':a31_0x246b72(0x8d),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0x246b72(0x9b)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x246b72(0x9a),'type':'boolean','description':a31_0x246b72(0x7c),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x246b72(0xa9),'type':a31_0x246b72(0x72),'description':a31_0x246b72(0x6b),'required':!![]},{'name':a31_0x246b72(0x81),'type':'string','description':a31_0x246b72(0xb0)},{'name':'env','type':'string','description':a31_0x246b72(0x6a),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x246b72(0x86),'type':'boolean','description':a31_0x246b72(0x7f)+PRODUCT_CONFIG[a31_0x246b72(0x9b)]+a31_0x246b72(0x80),'default':![]},{'name':a31_0x246b72(0x9a),'type':a31_0x246b72(0x8d),'description':a31_0x246b72(0x7c),'default':![]}];export async function runInit(_0x2fa535){const _0x32313b=a31_0x246b72,_0x525c39=isNonInteractiveMode(_0x2fa535),_0xb50573=_0x2fa535[_0x32313b(0x86)]?_0x32313b(0x86):_0x32313b(0x7e),_0x3ba248=resolveWriteConfigPath(_0xb50573);try{_0x525c39?await runNonInteractive(_0x2fa535,_0x3ba248):await runInteractive(_0x2fa535,_0x3ba248);}catch(_0x1b36f2){if(_0x1b36f2 instanceof AbortPrompt)throw CliErrors[_0x32313b(0xa6)]();throw _0x1b36f2;}}export async function runInitImport(_0x28b4ac){const _0x3a473a=a31_0x246b72,_0x3c94c5=_0x28b4ac['global']?_0x3a473a(0x86):_0x3a473a(0x7e),_0x1c6197=resolveWriteConfigPath(_0x3c94c5);await runFromImport(_0x28b4ac,_0x1c6197);}function a31_0x590c(){const _0x5839d0=['boolean','628620rdSKiD','object','[y/N]','Target\x20environment\x20(default\x20','parse','SIGINT','5DLSRDA','App\x20code\x20for\x20the\x20project','4011376IVcjQX','removeListener','651177dTHYNV','File\x20','yes','newConfigFileName','Invalid\x20env\x20\x22','question','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Imported\x20from\x20','663561TPdegb','once','\x0aInitialized\x20','race','close','cancelled','2TZxvay','utf8','file','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','App\x20code\x20cannot\x20be\x20empty.','app','AbortPrompt','log','\x22.\x20Allowed:\x20','Override\x20imported\x20default\x20appcode','message','\x20\x20env:\x20\x20\x20\x20\x20','1295833aKoyPh','\x20already\x20exists.\x20Overwrite?','Aborted.','Override\x20imported\x20default\x20env','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','stdin','join','riskLevel','21GtHHFn','):\x20','flagMissing','string','156808QYpTxl','\x20\x20config:\x20\x20','100wumlUU','apps','cwd','entries','defaultApp','trim','validation','Skip\x20confirmation\x20when\x20overwriting','\x20\x20appcode:\x20','project','Write\x20to\x20global\x20(~/',')\x20instead\x20of\x20project','appcode','\x20init\x20—\x20Create\x20','983446hUHrvv','toLowerCase','env','global','User\x20aborted\x20prompt','App\x20code','apiDir','Usage:\x20','24aWQjpI','Initialized\x20'];a31_0x590c=function(){return _0x5839d0;};return a31_0x590c();}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x246b72(0x89)]);async function runFromImport(_0x4ca8c8,_0x155d6c){const _0x307a5f=a31_0x246b72,_0x5ef224=resolveFilePath(_0x4ca8c8['file']);if(!existsSync(_0x5ef224))throw CliErrors[_0x307a5f(0x7b)]('Source\x20file\x20not\x20found:\x20'+_0x5ef224);const _0x559078=readSourceFile(_0x5ef224),_0x2e5a05=convertToRuntimeConfig(_0x559078);_0x4ca8c8['appcode']&&(_0x2e5a05[_0x307a5f(0x81)]=String(_0x4ca8c8[_0x307a5f(0x81)]));_0x4ca8c8[_0x307a5f(0x85)]&&(_0x2e5a05['env']=resolveInitEnv(_0x4ca8c8));if(!_0x2e5a05['appcode'])throw CliErrors[_0x307a5f(0x7b)](_0x307a5f(0x9f),'Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.');await writeInitConfig(_0x155d6c,_0x2e5a05,_0x4ca8c8),console[_0x307a5f(0xae)](_0x307a5f(0xa0)+_0x5ef224),console['log'](_0x307a5f(0x74)+_0x155d6c),console[_0x307a5f(0xae)](_0x307a5f(0x7d)+_0x2e5a05[_0x307a5f(0x81)]);if(_0x2e5a05[_0x307a5f(0x79)])console[_0x307a5f(0xae)]('\x20\x20default:\x20'+_0x2e5a05[_0x307a5f(0x79)]);}function convertToRuntimeConfig(_0x41b138){const _0x3dedda=a31_0x246b72;if(_0x41b138[_0x3dedda(0x76)]&&typeof _0x41b138[_0x3dedda(0x76)]===_0x3dedda(0x8f))throw CliErrors[_0x3dedda(0x7b)](_0x3dedda(0x9e),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x5a37bb={};for(const _0x48e46e of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x41b138[_0x48e46e]!==undefined&&(_0x5a37bb[_0x48e46e]=_0x41b138[_0x48e46e]);}return!_0x5a37bb[_0x3dedda(0x6e)]&&(_0x5a37bb[_0x3dedda(0x6e)]=DEFAULT_CONFIG_VALUES[_0x3dedda(0x6e)]),_0x5a37bb;}async function runNonInteractive(_0x36dba0,_0x233241){const _0x22456c=a31_0x246b72,_0x1a1d86=_0x36dba0[_0x22456c(0x81)];if(!_0x1a1d86)throw CliErrors[_0x22456c(0x71)](_0x22456c(0x81),_0x22456c(0x8a)+CLI_BIN_NAME+_0x22456c(0xaa));const _0xe56737=resolveInitEnv(_0x36dba0);await writeInitConfig(_0x233241,{'appcode':_0x1a1d86,'env':_0xe56737},_0x36dba0),console['log'](_0x22456c(0x8c)+_0x233241),console['log'](_0x22456c(0x7d)+_0x1a1d86),console[_0x22456c(0xae)](_0x22456c(0x66)+_0xe56737);}async function runInteractive(_0x1ce05f,_0x2cda1e){const _0x1e63e4=a31_0x246b72,_0x49ca6c=loadExisting(_0x2cda1e),_0x2a0d90=typeof _0x49ca6c?.['appcode']==='string'?_0x49ca6c[_0x1e63e4(0x81)]:'',_0x594bd9=resolveInitEnv(_0x1ce05f);console[_0x1e63e4(0xae)](CLI_BIN_NAME+_0x1e63e4(0x82)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x2cda1e)&&!_0x1ce05f[_0x1e63e4(0x9a)]){const _0x403d9f=await promptYesNo(_0x1e63e4(0x99)+_0x2cda1e+_0x1e63e4(0x68),![]);if(!_0x403d9f){console[_0x1e63e4(0xae)](_0x1e63e4(0x69));return;}}const _0x39b92d=typeof _0x1ce05f[_0x1e63e4(0x81)]===_0x1e63e4(0x72)?_0x1ce05f[_0x1e63e4(0x81)]['trim']():'';let _0x119eb1=_0x39b92d;!_0x119eb1&&(_0x119eb1=await promptInput(_0x1e63e4(0x88),_0x2a0d90));if(!_0x119eb1['trim']())throw CliErrors['validation'](_0x1e63e4(0xab));await writeInitConfig(_0x2cda1e,{'appcode':_0x119eb1[_0x1e63e4(0x7a)](),'env':_0x594bd9},_0x1ce05f),console['log'](_0x1e63e4(0xa3)+_0x2cda1e),console['log'](_0x1e63e4(0x7d)+_0x119eb1[_0x1e63e4(0x7a)]()),console[_0x1e63e4(0xae)](_0x1e63e4(0x66)+_0x594bd9);}async function writeInitConfig(_0x5b5df0,_0x1cc5d9,_0x23eec9){const _0x4a0d1c=a31_0x246b72;let _0x3cb521={};existsSync(_0x5b5df0)&&!_0x23eec9[_0x4a0d1c(0x9a)]&&(_0x3cb521=readConfigFile(_0x5b5df0));for(const [_0x381cb3,_0x26318c]of Object[_0x4a0d1c(0x78)](_0x1cc5d9)){_0x26318c!==undefined&&(_0x3cb521[_0x381cb3]=_0x26318c);}if(_0x3cb521['app'])delete _0x3cb521[_0x4a0d1c(0xac)];writeConfigFile(_0x5b5df0,_0x3cb521);}class AbortPrompt extends Error{constructor(){const _0x264ba7=a31_0x246b72;super(_0x264ba7(0x87)),this['name']=_0x264ba7(0xad);}}function createSafeRl(){const _0x208d2a=a31_0x246b72,_0x5242b1=createInterface({'input':process[_0x208d2a(0x6c)],'output':process['stdout']});let _0x23e6cd;const _0x1342a0=new Promise((_0x178277,_0x54144e)=>{const _0x3104bf=_0x208d2a;_0x23e6cd=()=>{const _0x5e6027=a31_0x102f;_0x23e6cd&&(_0x5242b1[_0x5e6027(0x97)]('SIGINT',_0x23e6cd),_0x23e6cd=undefined);try{_0x5242b1[_0x5e6027(0xa5)]();}catch{}_0x54144e(new AbortPrompt());},_0x5242b1[_0x3104bf(0xa2)](_0x3104bf(0x93),_0x23e6cd);}),_0x105de4=()=>{const _0x14ccea=_0x208d2a;_0x23e6cd&&(_0x5242b1[_0x14ccea(0x97)](_0x14ccea(0x93),_0x23e6cd),_0x23e6cd=undefined);try{_0x5242b1['close']();}catch{}};return{'rl':_0x5242b1,'abortPromise':_0x1342a0,'disposeSuccess':_0x105de4};}async function promptInput(_0x23eb0b,_0x4d2d48){const _0x45ebeb=a31_0x246b72,{rl:_0x29921b,abortPromise:_0x17a66c,disposeSuccess:_0x557fe8}=createSafeRl(),_0x4f4c8a=new Promise(_0x1a33d1=>{const _0x5c2d1e=a31_0x102f,_0x378bf4=_0x4d2d48?'\x20\x20'+_0x23eb0b+'\x20('+_0x4d2d48+_0x5c2d1e(0x70):'\x20\x20'+_0x23eb0b+':\x20';_0x29921b[_0x5c2d1e(0x9d)](_0x378bf4,_0x3e9c82=>{const _0x15e929=_0x5c2d1e;_0x557fe8(),_0x1a33d1(_0x3e9c82[_0x15e929(0x7a)]()||_0x4d2d48);});});return Promise[_0x45ebeb(0xa4)]([_0x4f4c8a,_0x17a66c]);}async function promptYesNo(_0xf8c199,_0x110f19){const _0x46ce55=a31_0x246b72,{rl:_0x1488b1,abortPromise:_0x462321,disposeSuccess:_0x4b14f1}=createSafeRl(),_0x45dcd7=new Promise(_0x4fe8ab=>{const _0x2c8dc4=a31_0x102f,_0x5b1542=_0x110f19?'[Y/n]':_0x2c8dc4(0x90);_0x1488b1[_0x2c8dc4(0x9d)]('\x20\x20'+_0xf8c199+'\x20'+_0x5b1542+':\x20',_0x5a8633=>{const _0x159f79=_0x2c8dc4;_0x4b14f1();const _0x2c56d1=_0x5a8633[_0x159f79(0x7a)]()[_0x159f79(0x84)]();if(_0x2c56d1==='y'||_0x2c56d1===_0x159f79(0x9a))_0x4fe8ab(!![]);else{if(_0x2c56d1==='n'||_0x2c56d1==='no')_0x4fe8ab(![]);else _0x4fe8ab(_0x110f19);}});});return Promise[_0x46ce55(0xa4)]([_0x45dcd7,_0x462321]);}function loadExisting(_0xdf8f25){if(!existsSync(_0xdf8f25))return null;return readConfigFile(_0xdf8f25);}function resolveFilePath(_0x4344b1){const _0x56c1d4=a31_0x246b72;return isAbsolute(_0x4344b1)?_0x4344b1:resolve(process[_0x56c1d4(0x77)](),_0x4344b1);}function readSourceFile(_0x225bde){const _0x8ae66=a31_0x246b72;try{const _0x1cb966=readFileSync(_0x225bde,{'encoding':_0x8ae66(0xa8)});return JSON[_0x8ae66(0x92)](_0x1cb966);}catch(_0x4c4e13){throw CliErrors[_0x8ae66(0x7b)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x4c4e13[_0x8ae66(0xb1)]);}}function a31_0x102f(_0x5aafad,_0x1986c8){_0x5aafad=_0x5aafad-0x66;const _0x590c0f=a31_0x590c();let _0x102f95=_0x590c0f[_0x5aafad];return _0x102f95;}function resolveInitEnv(_0x505826){const _0x5ab3a6=a31_0x246b72,_0x3a0388=_0x505826[_0x5ab3a6(0x85)];if(_0x3a0388===undefined||_0x3a0388==='')return DEFAULT_CONFIG_VALUES[_0x5ab3a6(0x85)];if(!RUNTIME_ENV_VALUES['includes'](_0x3a0388))throw CliErrors[_0x5ab3a6(0x7b)](_0x5ab3a6(0x9c)+_0x3a0388+_0x5ab3a6(0xaf)+RUNTIME_ENV_VALUES[_0x5ab3a6(0x6d)](',\x20'));return _0x3a0388;}
1
+ const a31_0xc56787=a31_0x2db2;(function(_0x598a7f,_0x568d70){const _0x20bb66=a31_0x2db2,_0x2337f1=_0x598a7f();while(!![]){try{const _0x16bf42=parseInt(_0x20bb66(0x1a8))/0x1*(parseInt(_0x20bb66(0x1a2))/0x2)+-parseInt(_0x20bb66(0x19b))/0x3+parseInt(_0x20bb66(0x182))/0x4*(-parseInt(_0x20bb66(0x19d))/0x5)+-parseInt(_0x20bb66(0x1a4))/0x6*(-parseInt(_0x20bb66(0x175))/0x7)+-parseInt(_0x20bb66(0x196))/0x8*(-parseInt(_0x20bb66(0x170))/0x9)+-parseInt(_0x20bb66(0x183))/0xa+parseInt(_0x20bb66(0x173))/0xb;if(_0x16bf42===_0x568d70)break;else _0x2337f1['push'](_0x2337f1['shift']());}catch(_0x3c0b40){_0x2337f1['push'](_0x2337f1['shift']());}}}(a31_0x38bc,0x5720d));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0xc56787(0x172),'type':a31_0xc56787(0x18f),'description':a31_0xc56787(0x165)},{'name':'env','type':a31_0xc56787(0x18f),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a31_0xc56787(0x177)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0xc56787(0x1a9),'type':a31_0xc56787(0x176),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0xc56787(0x19e)]+a31_0xc56787(0x19a),'default':![]},{'name':a31_0xc56787(0x198),'type':a31_0xc56787(0x176),'description':a31_0xc56787(0x17c),'default':![]}];export const initImportFlagDefs=[{'name':a31_0xc56787(0x164),'type':'string','description':a31_0xc56787(0x193),'required':!![]},{'name':'appcode','type':a31_0xc56787(0x18f),'description':a31_0xc56787(0x1a5)},{'name':a31_0xc56787(0x177),'type':a31_0xc56787(0x18f),'description':a31_0xc56787(0x17a),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0xc56787(0x1a9),'type':a31_0xc56787(0x176),'description':a31_0xc56787(0x168)+PRODUCT_CONFIG['newConfigFileName']+a31_0xc56787(0x19a),'default':![]},{'name':a31_0xc56787(0x198),'type':a31_0xc56787(0x176),'description':a31_0xc56787(0x17c),'default':![]}];export async function runInit(_0x533c83){const _0x331399=a31_0xc56787,_0x4f600c=isNonInteractiveMode(_0x533c83),_0x4d500f=_0x533c83[_0x331399(0x1a9)]?'global':'project',_0x331001=resolveWriteConfigPath(_0x4d500f);try{_0x4f600c?await runNonInteractive(_0x533c83,_0x331001):await runInteractive(_0x533c83,_0x331001);}catch(_0x274d5f){if(_0x274d5f instanceof AbortPrompt)throw CliErrors[_0x331399(0x179)]();throw _0x274d5f;}}export async function runInitImport(_0x5eb1c4){const _0x247f9c=a31_0xc56787,_0x4872e4=_0x5eb1c4['global']?_0x247f9c(0x1a9):_0x247f9c(0x197),_0xf97467=resolveWriteConfigPath(_0x4872e4);await runFromImport(_0x5eb1c4,_0xf97467);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0xc56787(0x184)]);function a31_0x2db2(_0x12a618,_0x1e7a79){_0x12a618=_0x12a618-0x164;const _0x38bcba=a31_0x38bc();let _0x2db2ec=_0x38bcba[_0x12a618];return _0x2db2ec;}async function runFromImport(_0x5355e2,_0x1ddeba){const _0x4c7dd8=a31_0xc56787,_0x2d1050=resolveFilePath(_0x5355e2[_0x4c7dd8(0x164)]);if(!existsSync(_0x2d1050))throw CliErrors[_0x4c7dd8(0x18b)](_0x4c7dd8(0x167)+_0x2d1050);const _0x578074=readSourceFile(_0x2d1050),_0x3c8bf1=convertToRuntimeConfig(_0x578074);_0x5355e2[_0x4c7dd8(0x172)]&&(_0x3c8bf1[_0x4c7dd8(0x172)]=String(_0x5355e2[_0x4c7dd8(0x172)]));_0x5355e2['env']&&(_0x3c8bf1['env']=resolveInitEnv(_0x5355e2));if(!_0x3c8bf1[_0x4c7dd8(0x172)])throw CliErrors[_0x4c7dd8(0x18b)](_0x4c7dd8(0x16d),'Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.');await writeInitConfig(_0x1ddeba,_0x3c8bf1,_0x5355e2),console[_0x4c7dd8(0x187)](_0x4c7dd8(0x1a7)+_0x2d1050),console[_0x4c7dd8(0x187)](_0x4c7dd8(0x190)+_0x1ddeba),console[_0x4c7dd8(0x187)](_0x4c7dd8(0x19f)+_0x3c8bf1[_0x4c7dd8(0x172)]);if(_0x3c8bf1[_0x4c7dd8(0x18e)])console[_0x4c7dd8(0x187)](_0x4c7dd8(0x17d)+_0x3c8bf1['defaultApp']);}function convertToRuntimeConfig(_0x44a6ac){const _0x35fde2=a31_0xc56787;if(_0x44a6ac[_0x35fde2(0x16c)]&&typeof _0x44a6ac[_0x35fde2(0x16c)]==='object')throw CliErrors[_0x35fde2(0x18b)](_0x35fde2(0x180),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x1c20f2={};for(const _0x42f5f6 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x44a6ac[_0x42f5f6]!==undefined&&(_0x1c20f2[_0x42f5f6]=_0x44a6ac[_0x42f5f6]);}return!_0x1c20f2[_0x35fde2(0x16f)]&&(_0x1c20f2[_0x35fde2(0x16f)]=DEFAULT_CONFIG_VALUES[_0x35fde2(0x16f)]),_0x1c20f2;}async function runNonInteractive(_0x335ea8,_0x1e10dd){const _0x52ca1d=a31_0xc56787,_0x114b40=_0x335ea8[_0x52ca1d(0x172)];if(!_0x114b40)throw CliErrors[_0x52ca1d(0x194)]('appcode',_0x52ca1d(0x188)+CLI_BIN_NAME+_0x52ca1d(0x189));const _0x44e8ac=resolveInitEnv(_0x335ea8);await writeInitConfig(_0x1e10dd,{'appcode':_0x114b40,'env':_0x44e8ac},_0x335ea8),console['log'](_0x52ca1d(0x18c)+_0x1e10dd),console['log'](_0x52ca1d(0x19f)+_0x114b40),console[_0x52ca1d(0x187)](_0x52ca1d(0x16e)+_0x44e8ac);}async function runInteractive(_0x2d6ebd,_0x1d3bcb){const _0x428dcd=a31_0xc56787,_0x35a7b0=loadExisting(_0x1d3bcb),_0x25e024=typeof _0x35a7b0?.[_0x428dcd(0x172)]===_0x428dcd(0x18f)?_0x35a7b0['appcode']:'',_0x55f1ce=resolveInitEnv(_0x2d6ebd);console[_0x428dcd(0x187)](CLI_BIN_NAME+_0x428dcd(0x16b)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x1d3bcb)&&!_0x2d6ebd[_0x428dcd(0x198)]){const _0xa08e61=await promptYesNo('File\x20'+_0x1d3bcb+_0x428dcd(0x186),![]);if(!_0xa08e61){console[_0x428dcd(0x187)](_0x428dcd(0x171));return;}}const _0x5ec3da=typeof _0x2d6ebd[_0x428dcd(0x172)]==='string'?_0x2d6ebd[_0x428dcd(0x172)][_0x428dcd(0x1a3)]():'';let _0x1a29dd=_0x5ec3da;!_0x1a29dd&&(_0x1a29dd=await promptInput('App\x20code',_0x25e024));if(!_0x1a29dd[_0x428dcd(0x1a3)]())throw CliErrors[_0x428dcd(0x18b)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x1d3bcb,{'appcode':_0x1a29dd[_0x428dcd(0x1a3)](),'env':_0x55f1ce},_0x2d6ebd),console[_0x428dcd(0x187)]('\x0aInitialized\x20'+_0x1d3bcb),console[_0x428dcd(0x187)](_0x428dcd(0x19f)+_0x1a29dd[_0x428dcd(0x1a3)]()),console[_0x428dcd(0x187)](_0x428dcd(0x16e)+_0x55f1ce);}function a31_0x38bc(){const _0x2c8852=['\x20\x20env:\x20\x20\x20\x20\x20','riskLevel','9PwdAvh','Aborted.','appcode','4584019WKdQXq','SIGINT','399DGIQYp','boolean','env','[y/N]','cancelled','Override\x20imported\x20default\x20env','close','Skip\x20confirmation\x20when\x20overwriting','\x20\x20default:\x20','):\x20','name','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Invalid\x20env\x20\x22','227524unltpL','6027410CIBWLh','apiDir','join','\x20already\x20exists.\x20Overwrite?','log','Usage:\x20','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','stdout','validation','Initialized\x20','Failed\x20to\x20parse\x20source\x20file:\x20','defaultApp','string','\x20\x20config:\x20\x20','\x22.\x20Allowed:\x20','entries','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','flagMissing','cwd','2185016vWqsPX','project','yes','question',')\x20instead\x20of\x20project','772707hPAaFW','toLowerCase','40qFFoZD','newConfigFileName','\x20\x20appcode:\x20','removeListener','race','470hEPQcT','trim','28332ZPEEik','Override\x20imported\x20default\x20appcode','parse','Imported\x20from\x20','3035WmvJqP','global','file','App\x20code\x20for\x20the\x20project','message','Source\x20file\x20not\x20found:\x20','Write\x20to\x20global\x20(~/','app','once','\x20init\x20—\x20Create\x20','apps','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.'];a31_0x38bc=function(){return _0x2c8852;};return a31_0x38bc();}async function writeInitConfig(_0x58d7a6,_0xe3afa3,_0x358dfb){const _0x4c27f1=a31_0xc56787;let _0x432ea={};existsSync(_0x58d7a6)&&!_0x358dfb[_0x4c27f1(0x198)]&&(_0x432ea=readConfigFile(_0x58d7a6));for(const [_0x1b5d98,_0x4536fe]of Object[_0x4c27f1(0x192)](_0xe3afa3)){_0x4536fe!==undefined&&(_0x432ea[_0x1b5d98]=_0x4536fe);}if(_0x432ea[_0x4c27f1(0x169)])delete _0x432ea[_0x4c27f1(0x169)];writeConfigFile(_0x58d7a6,_0x432ea);}class AbortPrompt extends Error{constructor(){const _0x214f3e=a31_0xc56787;super('User\x20aborted\x20prompt'),this[_0x214f3e(0x17f)]='AbortPrompt';}}function createSafeRl(){const _0x41b3fe=a31_0xc56787,_0x479711=createInterface({'input':process['stdin'],'output':process[_0x41b3fe(0x18a)]});let _0x3f819a;const _0x5d7df7=new Promise((_0x1c7e28,_0x1d3684)=>{const _0x373f9e=_0x41b3fe;_0x3f819a=()=>{const _0x473c72=a31_0x2db2;_0x3f819a&&(_0x479711[_0x473c72(0x1a0)]('SIGINT',_0x3f819a),_0x3f819a=undefined);try{_0x479711[_0x473c72(0x17b)]();}catch{}_0x1d3684(new AbortPrompt());},_0x479711[_0x373f9e(0x16a)](_0x373f9e(0x174),_0x3f819a);}),_0x2821ca=()=>{const _0x293864=_0x41b3fe;_0x3f819a&&(_0x479711[_0x293864(0x1a0)](_0x293864(0x174),_0x3f819a),_0x3f819a=undefined);try{_0x479711[_0x293864(0x17b)]();}catch{}};return{'rl':_0x479711,'abortPromise':_0x5d7df7,'disposeSuccess':_0x2821ca};}async function promptInput(_0x5a8843,_0x38d4e4){const _0x2cacf0=a31_0xc56787,{rl:_0x1669b0,abortPromise:_0x1b6499,disposeSuccess:_0x42c777}=createSafeRl(),_0x4b7021=new Promise(_0x5b6a5b=>{const _0x4be0f0=a31_0x2db2,_0x422e01=_0x38d4e4?'\x20\x20'+_0x5a8843+'\x20('+_0x38d4e4+_0x4be0f0(0x17e):'\x20\x20'+_0x5a8843+':\x20';_0x1669b0['question'](_0x422e01,_0x1c7de7=>{const _0x5b0209=_0x4be0f0;_0x42c777(),_0x5b6a5b(_0x1c7de7[_0x5b0209(0x1a3)]()||_0x38d4e4);});});return Promise[_0x2cacf0(0x1a1)]([_0x4b7021,_0x1b6499]);}async function promptYesNo(_0x1eee8a,_0x31a99b){const {rl:_0x2245c0,abortPromise:_0x409776,disposeSuccess:_0x434e8b}=createSafeRl(),_0x169d3e=new Promise(_0x1e7a43=>{const _0x2f5583=a31_0x2db2,_0x31fb38=_0x31a99b?'[Y/n]':_0x2f5583(0x178);_0x2245c0[_0x2f5583(0x199)]('\x20\x20'+_0x1eee8a+'\x20'+_0x31fb38+':\x20',_0x37d479=>{const _0x33f072=_0x2f5583;_0x434e8b();const _0x43a6ae=_0x37d479[_0x33f072(0x1a3)]()[_0x33f072(0x19c)]();if(_0x43a6ae==='y'||_0x43a6ae==='yes')_0x1e7a43(!![]);else{if(_0x43a6ae==='n'||_0x43a6ae==='no')_0x1e7a43(![]);else _0x1e7a43(_0x31a99b);}});});return Promise['race']([_0x169d3e,_0x409776]);}function loadExisting(_0x3aab89){if(!existsSync(_0x3aab89))return null;return readConfigFile(_0x3aab89);}function resolveFilePath(_0x470f62){const _0x48ce8a=a31_0xc56787;return isAbsolute(_0x470f62)?_0x470f62:resolve(process[_0x48ce8a(0x195)](),_0x470f62);}function readSourceFile(_0x24b1ef){const _0x4673fa=a31_0xc56787;try{const _0x1e1598=readFileSync(_0x24b1ef,{'encoding':'utf8'});return JSON[_0x4673fa(0x1a6)](_0x1e1598);}catch(_0x50afff){throw CliErrors[_0x4673fa(0x18b)](_0x4673fa(0x18d)+_0x50afff[_0x4673fa(0x166)]);}}function resolveInitEnv(_0x508fdd){const _0x54b0f0=a31_0xc56787,_0x2e9d0d=_0x508fdd[_0x54b0f0(0x177)];if(_0x2e9d0d===undefined||_0x2e9d0d==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES['includes'](_0x2e9d0d))throw CliErrors[_0x54b0f0(0x18b)](_0x54b0f0(0x181)+_0x2e9d0d+_0x54b0f0(0x191)+RUNTIME_ENV_VALUES[_0x54b0f0(0x185)](',\x20'));return _0x2e9d0d;}
@@ -1 +1 @@
1
- const a32_0x22d0e4=a32_0x1cef;(function(_0x592cef,_0x559c1a){const _0x3162e2=a32_0x1cef,_0x22118a=_0x592cef();while(!![]){try{const _0xaa141c=parseInt(_0x3162e2(0x11e))/0x1+parseInt(_0x3162e2(0xfa))/0x2*(parseInt(_0x3162e2(0xf8))/0x3)+parseInt(_0x3162e2(0xeb))/0x4*(parseInt(_0x3162e2(0x10e))/0x5)+-parseInt(_0x3162e2(0x103))/0x6*(parseInt(_0x3162e2(0x10d))/0x7)+-parseInt(_0x3162e2(0x123))/0x8+parseInt(_0x3162e2(0xf4))/0x9*(parseInt(_0x3162e2(0x108))/0xa)+-parseInt(_0x3162e2(0x122))/0xb;if(_0xaa141c===_0x559c1a)break;else _0x22118a['push'](_0x22118a['shift']());}catch(_0x575c70){_0x22118a['push'](_0x22118a['shift']());}}}(a32_0x4cfc,0x1c3ce));import{existsSync,readFileSync,statSync}from'node:fs';function a32_0x4cfc(){const _0x3c35f0=['str','length','File\x20is\x20not\x20a\x20regular\x20file:\x20','276793JNELRn','1662984FFqRBj','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','read','number','detail','utf8','query','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','topk','184764dArBsL','ragErrorMessage','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','isFinite','bool','search','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','string','update','1107hKyMpJ','build','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','create','178107HYVwHh','score','2dsMQcq','file','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','appCode','write','map','metadata','updateTime','version','42VZUSSZ','ragStatus','createTime','Personal\x20knowledge-base\x20entry\x20ID','trim','3470zqkyYo','num','title','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','flag','58597UlFBGb','15zTkWRr','verbose','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','scope','--topk\x20must\x20be\x20a\x20positive\x20number.','Override\x20the\x20existing\x20entry\x20title','validation','Created\x20KB\x20entry\x20','POST','description','docId','body','File\x20path\x20is\x20required.','weightedScore','/update','166672wEltOM'];a32_0x4cfc=function(){return _0x3c35f0;};return a32_0x4cfc();}import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x22d0e4(0x10a),'type':a32_0x22d0e4(0xf2),'required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':a32_0x22d0e4(0xfb),'type':a32_0x22d0e4(0xf2),'required':!![],'description':a32_0x22d0e4(0x111)},QUERY_FLAG={'name':a32_0x22d0e4(0x129),'type':a32_0x22d0e4(0xf2),'required':!![],'description':a32_0x22d0e4(0x124)},TOPK_FLAG={'name':a32_0x22d0e4(0x12b),'type':a32_0x22d0e4(0x126),'description':'Maximum\x20number\x20of\x20search\x20hits\x20to\x20return'};function readKnowledgeFile(_0xd30454){const _0x114378=a32_0x22d0e4;if(!_0xd30454)throw CliErrors['validation'](_0x114378(0x11b));if(!existsSync(_0xd30454))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0xd30454);if(!statSync(_0xd30454)['isFile']())throw CliErrors[_0x114378(0x115)](_0x114378(0x121)+_0xd30454);return readFileSync(_0xd30454,_0x114378(0x128));}function summarizePersonalItem(_0x398d93){const _0x2830c2=a32_0x22d0e4;return{'id':_0x398d93['id'],'title':_0x398d93[_0x2830c2(0x10a)],'version':_0x398d93['version'],'ragStatus':_0x398d93[_0x2830c2(0x104)],'ragErrorMessage':_0x398d93[_0x2830c2(0xec)],'updateTime':_0x398d93[_0x2830c2(0x101)]};}function detailPersonalItem(_0xca5fc5){const _0x1eb986=a32_0x22d0e4;return{'id':_0xca5fc5['id'],'appCode':_0xca5fc5[_0x1eb986(0xfd)],'scope':_0xca5fc5['scope'],'userId':_0xca5fc5['userId'],'title':_0xca5fc5[_0x1eb986(0x10a)],'content':_0xca5fc5['content']??'','version':_0xca5fc5[_0x1eb986(0x102)],'ragStatus':_0xca5fc5[_0x1eb986(0x104)],'ragErrorMessage':_0xca5fc5[_0x1eb986(0xec)],'createTime':_0xca5fc5[_0x1eb986(0x105)],'updateTime':_0xca5fc5[_0x1eb986(0x101)]};}function a32_0x1cef(_0x11b910,_0x40c8c2){_0x11b910=_0x11b910-0xeb;const _0x4cfc46=a32_0x4cfc();let _0x1cefa9=_0x4cfc46[_0x11b910];return _0x1cefa9;}function summarizeSearchHit(_0x2dda6f){const _0xdc3e74=a32_0x22d0e4;return{'scope':_0x2dda6f[_0xdc3e74(0x112)],'title':_0x2dda6f[_0xdc3e74(0x10a)],'docId':_0x2dda6f[_0xdc3e74(0x119)],'score':_0x2dda6f[_0xdc3e74(0xf9)],'weightedScore':_0x2dda6f[_0xdc3e74(0x11c)],'content':_0x2dda6f['content'],'metadata':_0x2dda6f[_0xdc3e74(0x100)]};}function readTopK(_0x412d34){const _0x47a2b1=a32_0x22d0e4,_0x431a8c=_0x412d34[_0x47a2b1(0x10c)](_0x47a2b1(0x12b));if(_0x431a8c===undefined||_0x431a8c===null||_0x431a8c==='')return undefined;const _0x5dc170=_0x412d34['num'](_0x47a2b1(0x12b));if(!Number[_0x47a2b1(0xee)](_0x5dc170)||_0x5dc170<0x1)throw CliErrors[_0x47a2b1(0x115)](_0x47a2b1(0x113));return _0x5dc170;}const kbList={'service':'kb','command':'list','description':a32_0x22d0e4(0xed),'risk':a32_0x22d0e4(0x125),'flags':[VERBOSE_FLAG],async 'execute'(_0x2476b6){const _0x10f43e=a32_0x22d0e4,_0x5739c0=await listPersonalKnowledgeBaseItems(_0x2476b6[_0x10f43e(0xfd)]);if(_0x2476b6[_0x10f43e(0xef)](_0x10f43e(0x10f)))return{'ok':!![],'data':{'total':_0x5739c0[_0x10f43e(0x120)],'items':_0x5739c0}};return{'ok':!![],'data':{'total':_0x5739c0[_0x10f43e(0x120)],'items':_0x5739c0[_0x10f43e(0xff)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x22d0e4(0x127),'description':a32_0x22d0e4(0xf6),'risk':a32_0x22d0e4(0x125),'flags':[{...ID_FLAG,'description':a32_0x22d0e4(0x106)}],async 'execute'(_0x8ba635){const _0x1ddc96=a32_0x22d0e4,_0x341c39=await getPersonalKnowledgeBaseItem(_0x8ba635['num']('id'),_0x8ba635[_0x1ddc96(0xfd)]);return{'ok':!![],'data':detailPersonalItem(_0x341c39)};}},kbCreate={'service':'kb','command':a32_0x22d0e4(0xf7),'description':a32_0x22d0e4(0xf1),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x3a7115){const _0x3986c6=a32_0x22d0e4,_0x5021ad=_0x3a7115[_0x3986c6(0x11f)]('title'),_0x582b1e=readKnowledgeFile(_0x3a7115[_0x3986c6(0x11f)](_0x3986c6(0xfb))),_0x327f74=await createPersonalKnowledgeBaseItem(_0x3a7115[_0x3986c6(0xfd)],{'title':_0x5021ad,'content':_0x582b1e});return{'ok':!![],'data':summarizePersonalItem(_0x327f74),'message':_0x3986c6(0x116)+_0x327f74['id']+'\x20('+_0x327f74[_0x3986c6(0x10a)]+')'};},async 'dryRun'(_0x31f267){const _0x465eb0=a32_0x22d0e4,_0x10befa=_0x31f267[_0x465eb0(0x11f)](_0x465eb0(0x10a)),_0x4c9c4c=readKnowledgeFile(_0x31f267[_0x465eb0(0x11f)](_0x465eb0(0xfb)));return dryRun(_0x465eb0(0x117),'/client/knowledge-base/personal/create')[_0x465eb0(0x11a)]({'appCode':_0x31f267[_0x465eb0(0xfd)],'title':_0x10befa,'content':_0x4c9c4c})['description'](_0x465eb0(0x110)+_0x10befa+'\x22')[_0x465eb0(0xf5)]();}},kbUpdate={'service':'kb','command':a32_0x22d0e4(0xf3),'description':a32_0x22d0e4(0xfc),'risk':a32_0x22d0e4(0xfe),'flags':[{...ID_FLAG,'description':a32_0x22d0e4(0x106)},{...TITLE_FLAG,'required':![],'description':a32_0x22d0e4(0x114)},FILE_FLAG],async 'execute'(_0x3e2a68){const _0x315ecb=a32_0x22d0e4,_0x33bb41=_0x3e2a68[_0x315ecb(0x109)]('id'),_0x167f24=readKnowledgeFile(_0x3e2a68[_0x315ecb(0x11f)]('file')),_0x136ce0=_0x3e2a68[_0x315ecb(0x11f)]('title')||(await getPersonalKnowledgeBaseItem(_0x33bb41,_0x3e2a68['appCode']))[_0x315ecb(0x10a)],_0x336bce=await updatePersonalKnowledgeBaseItem(_0x33bb41,_0x3e2a68[_0x315ecb(0xfd)],{'title':_0x136ce0,'content':_0x167f24});return{'ok':!![],'data':summarizePersonalItem(_0x336bce),'message':'Updated\x20KB\x20entry\x20'+_0x336bce['id']+'\x20('+_0x336bce['title']+')'};},async 'dryRun'(_0x340ecf){const _0x13cf1b=a32_0x22d0e4,_0x2bdfe9=_0x340ecf[_0x13cf1b(0x109)]('id'),_0x5534a2=readKnowledgeFile(_0x340ecf[_0x13cf1b(0x11f)](_0x13cf1b(0xfb))),_0x9e2b82=_0x340ecf['str']('title')||(await getPersonalKnowledgeBaseItem(_0x2bdfe9,_0x340ecf[_0x13cf1b(0xfd)]))[_0x13cf1b(0x10a)];return dryRun(_0x13cf1b(0x117),'/client/knowledge-base/personal/'+_0x2bdfe9+_0x13cf1b(0x11d))[_0x13cf1b(0x11a)]({'appCode':_0x340ecf['appCode'],'title':_0x9e2b82,'content':_0x5534a2})[_0x13cf1b(0x118)](_0x13cf1b(0x12a)+_0x2bdfe9)[_0x13cf1b(0xf5)]();}},kbSearch={'service':'kb','command':a32_0x22d0e4(0xf0),'description':a32_0x22d0e4(0x10b),'risk':a32_0x22d0e4(0x125),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x183ae1){const _0xe0ec05=a32_0x22d0e4;if(!_0x183ae1[_0xe0ec05(0x11f)](_0xe0ec05(0x129))[_0xe0ec05(0x107)]())throw CliErrors[_0xe0ec05(0x115)]('Search\x20query\x20is\x20required.');readTopK(_0x183ae1);},async 'execute'(_0x31adcf){const _0x3a2031=a32_0x22d0e4,_0x51bf12=_0x31adcf['str'](_0x3a2031(0x129))['trim'](),_0x3c7aa3=readTopK(_0x31adcf),_0x4388e6=await searchKnowledgeBase(_0x31adcf[_0x3a2031(0xfd)],{'query':_0x51bf12,'topK':_0x3c7aa3});return{'ok':!![],'data':{'total':_0x4388e6[_0x3a2031(0x120)],'hits':_0x4388e6['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
1
+ const a32_0x2f30d7=a32_0x4063;(function(_0x4f05f5,_0x360b53){const _0x375732=a32_0x4063,_0x29b997=_0x4f05f5();while(!![]){try{const _0x5a53cb=parseInt(_0x375732(0x15e))/0x1*(parseInt(_0x375732(0x178))/0x2)+parseInt(_0x375732(0x166))/0x3+parseInt(_0x375732(0x176))/0x4*(-parseInt(_0x375732(0x154))/0x5)+parseInt(_0x375732(0x167))/0x6+-parseInt(_0x375732(0x152))/0x7*(parseInt(_0x375732(0x171))/0x8)+parseInt(_0x375732(0x150))/0x9+parseInt(_0x375732(0x139))/0xa;if(_0x5a53cb===_0x360b53)break;else _0x29b997['push'](_0x29b997['shift']());}catch(_0x3b3025){_0x29b997['push'](_0x29b997['shift']());}}}(a32_0x5927,0x298dc));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x2f30d7(0x165),'type':'string','required':!![],'description':a32_0x2f30d7(0x162)},FILE_FLAG={'name':a32_0x2f30d7(0x174),'type':a32_0x2f30d7(0x16b),'required':!![],'description':a32_0x2f30d7(0x175)},QUERY_FLAG={'name':a32_0x2f30d7(0x15a),'type':a32_0x2f30d7(0x16b),'required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':a32_0x2f30d7(0x177),'type':a32_0x2f30d7(0x15b),'description':a32_0x2f30d7(0x168)};function readKnowledgeFile(_0x4c14aa){const _0x514a59=a32_0x2f30d7;if(!_0x4c14aa)throw CliErrors[_0x514a59(0x161)](_0x514a59(0x158));if(!existsSync(_0x4c14aa))throw CliErrors[_0x514a59(0x161)](_0x514a59(0x15d)+_0x4c14aa);if(!statSync(_0x4c14aa)[_0x514a59(0x169)]())throw CliErrors[_0x514a59(0x161)](_0x514a59(0x13d)+_0x4c14aa);return readFileSync(_0x4c14aa,'utf8');}function summarizePersonalItem(_0xc992d6){const _0x4b2699=a32_0x2f30d7;return{'id':_0xc992d6['id'],'title':_0xc992d6[_0x4b2699(0x165)],'version':_0xc992d6[_0x4b2699(0x14a)],'ragStatus':_0xc992d6['ragStatus'],'ragErrorMessage':_0xc992d6[_0x4b2699(0x172)],'updateTime':_0xc992d6['updateTime']};}function detailPersonalItem(_0xcc113){const _0x2d149e=a32_0x2f30d7;return{'id':_0xcc113['id'],'appCode':_0xcc113[_0x2d149e(0x143)],'scope':_0xcc113['scope'],'userId':_0xcc113['userId'],'title':_0xcc113[_0x2d149e(0x165)],'content':_0xcc113[_0x2d149e(0x146)]??'','version':_0xcc113[_0x2d149e(0x14a)],'ragStatus':_0xcc113[_0x2d149e(0x148)],'ragErrorMessage':_0xcc113[_0x2d149e(0x172)],'createTime':_0xcc113[_0x2d149e(0x16d)],'updateTime':_0xcc113[_0x2d149e(0x151)]};}function summarizeSearchHit(_0xf6012){const _0x5bf17a=a32_0x2f30d7;return{'scope':_0xf6012[_0x5bf17a(0x14e)],'title':_0xf6012[_0x5bf17a(0x165)],'docId':_0xf6012[_0x5bf17a(0x173)],'score':_0xf6012[_0x5bf17a(0x15c)],'weightedScore':_0xf6012[_0x5bf17a(0x141)],'content':_0xf6012[_0x5bf17a(0x146)],'metadata':_0xf6012['metadata']};}function readTopK(_0x4ad341){const _0x3f8274=a32_0x2f30d7,_0x53aa1f=_0x4ad341[_0x3f8274(0x13c)](_0x3f8274(0x177));if(_0x53aa1f===undefined||_0x53aa1f===null||_0x53aa1f==='')return undefined;const _0x158545=_0x4ad341[_0x3f8274(0x155)](_0x3f8274(0x177));if(!Number[_0x3f8274(0x149)](_0x158545)||_0x158545<0x1)throw CliErrors['validation'](_0x3f8274(0x147));return _0x158545;}function a32_0x5927(){const _0xea7626=['str','1583768beOepv','ragErrorMessage','docId','file','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','1278644wqwPnL','topk','105778yPgAxN','length','139080cUvyPc','verbose','read','flag','File\x20is\x20not\x20a\x20regular\x20file:\x20','search','list','Search\x20query\x20is\x20required.','weightedScore','bool','appCode','POST','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','content','--topk\x20must\x20be\x20a\x20positive\x20number.','ragStatus','isFinite','version','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','trim','scope','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','555804swyDGf','updateTime','7WjZqoe','/update','5NUcaQi','num','body','map','File\x20path\x20is\x20required.','description','query','number','score','File\x20not\x20found:\x20','2OvQvOU','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Personal\x20knowledge-base\x20entry\x20ID','validation','Personal\x20knowledge-base\x20entry\x20title','create','/client/knowledge-base/personal/','title','860712HLnjDh','1316940xSYvOb','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','isFile','write','string','build','createTime','/client/knowledge-base/personal/create','update'];a32_0x5927=function(){return _0xea7626;};return a32_0x5927();}function a32_0x4063(_0x8a621,_0x282b6b){_0x8a621=_0x8a621-0x139;const _0x5927e5=a32_0x5927();let _0x4063fc=_0x5927e5[_0x8a621];return _0x4063fc;}const kbList={'service':'kb','command':a32_0x2f30d7(0x13f),'description':a32_0x2f30d7(0x14b),'risk':a32_0x2f30d7(0x13b),'flags':[VERBOSE_FLAG],async 'execute'(_0x3fc1e8){const _0x4a8ce1=a32_0x2f30d7,_0x54f7e0=await listPersonalKnowledgeBaseItems(_0x3fc1e8[_0x4a8ce1(0x143)]);if(_0x3fc1e8[_0x4a8ce1(0x142)](_0x4a8ce1(0x13a)))return{'ok':!![],'data':{'total':_0x54f7e0[_0x4a8ce1(0x179)],'items':_0x54f7e0}};return{'ok':!![],'data':{'total':_0x54f7e0['length'],'items':_0x54f7e0['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':'Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','risk':a32_0x2f30d7(0x13b),'flags':[{...ID_FLAG,'description':a32_0x2f30d7(0x160)}],async 'execute'(_0x255262){const _0x54fb76=a32_0x2f30d7,_0x362877=await getPersonalKnowledgeBaseItem(_0x255262[_0x54fb76(0x155)]('id'),_0x255262[_0x54fb76(0x143)]);return{'ok':!![],'data':detailPersonalItem(_0x362877)};}},kbCreate={'service':'kb','command':a32_0x2f30d7(0x163),'description':a32_0x2f30d7(0x15f),'risk':a32_0x2f30d7(0x16a),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x548e5f){const _0x1b4a46=a32_0x2f30d7,_0x4e36c0=_0x548e5f[_0x1b4a46(0x170)]('title'),_0x487fae=readKnowledgeFile(_0x548e5f['str']('file')),_0x5a6ab3=await createPersonalKnowledgeBaseItem(_0x548e5f['appCode'],{'title':_0x4e36c0,'content':_0x487fae});return{'ok':!![],'data':summarizePersonalItem(_0x5a6ab3),'message':'Created\x20KB\x20entry\x20'+_0x5a6ab3['id']+'\x20('+_0x5a6ab3[_0x1b4a46(0x165)]+')'};},async 'dryRun'(_0x3a7f93){const _0x45683e=a32_0x2f30d7,_0x3dd217=_0x3a7f93[_0x45683e(0x170)](_0x45683e(0x165)),_0x236057=readKnowledgeFile(_0x3a7f93[_0x45683e(0x170)]('file'));return dryRun(_0x45683e(0x144),_0x45683e(0x16e))[_0x45683e(0x156)]({'appCode':_0x3a7f93[_0x45683e(0x143)],'title':_0x3dd217,'content':_0x236057})['description'](_0x45683e(0x14f)+_0x3dd217+'\x22')[_0x45683e(0x16c)]();}},kbUpdate={'service':'kb','command':a32_0x2f30d7(0x16f),'description':a32_0x2f30d7(0x145),'risk':a32_0x2f30d7(0x16a),'flags':[{...ID_FLAG,'description':a32_0x2f30d7(0x160)},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x19e041){const _0xf57a87=a32_0x2f30d7,_0x4c8fa5=_0x19e041[_0xf57a87(0x155)]('id'),_0x4178e8=readKnowledgeFile(_0x19e041[_0xf57a87(0x170)](_0xf57a87(0x174))),_0xa61b9b=_0x19e041['str'](_0xf57a87(0x165))||(await getPersonalKnowledgeBaseItem(_0x4c8fa5,_0x19e041[_0xf57a87(0x143)]))[_0xf57a87(0x165)],_0x41cfa8=await updatePersonalKnowledgeBaseItem(_0x4c8fa5,_0x19e041[_0xf57a87(0x143)],{'title':_0xa61b9b,'content':_0x4178e8});return{'ok':!![],'data':summarizePersonalItem(_0x41cfa8),'message':'Updated\x20KB\x20entry\x20'+_0x41cfa8['id']+'\x20('+_0x41cfa8[_0xf57a87(0x165)]+')'};},async 'dryRun'(_0x23d018){const _0x23bd47=a32_0x2f30d7,_0x2697d6=_0x23d018[_0x23bd47(0x155)]('id'),_0x2b3296=readKnowledgeFile(_0x23d018['str'](_0x23bd47(0x174))),_0x5b319c=_0x23d018[_0x23bd47(0x170)](_0x23bd47(0x165))||(await getPersonalKnowledgeBaseItem(_0x2697d6,_0x23d018['appCode']))[_0x23bd47(0x165)];return dryRun(_0x23bd47(0x144),_0x23bd47(0x164)+_0x2697d6+_0x23bd47(0x153))[_0x23bd47(0x156)]({'appCode':_0x23d018['appCode'],'title':_0x5b319c,'content':_0x2b3296})[_0x23bd47(0x159)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x2697d6)[_0x23bd47(0x16c)]();}},kbSearch={'service':'kb','command':a32_0x2f30d7(0x13e),'description':a32_0x2f30d7(0x14c),'risk':a32_0x2f30d7(0x13b),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0xcc7d40){const _0x4eff52=a32_0x2f30d7;if(!_0xcc7d40[_0x4eff52(0x170)](_0x4eff52(0x15a))[_0x4eff52(0x14d)]())throw CliErrors[_0x4eff52(0x161)](_0x4eff52(0x140));readTopK(_0xcc7d40);},async 'execute'(_0xd1237a){const _0x3a04e6=a32_0x2f30d7,_0x2eab56=_0xd1237a[_0x3a04e6(0x170)](_0x3a04e6(0x15a))[_0x3a04e6(0x14d)](),_0x355cbe=readTopK(_0xd1237a),_0x4ad4d4=await searchKnowledgeBase(_0xd1237a['appCode'],{'query':_0x2eab56,'topK':_0x355cbe});return{'ok':!![],'data':{'total':_0x4ad4d4[_0x3a04e6(0x179)],'hits':_0x4ad4d4[_0x3a04e6(0x157)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
@@ -1 +1 @@
1
- const a33_0x36b5db=a33_0x1190;function a33_0x1190(_0x110a24,_0x4fe6f5){_0x110a24=_0x110a24-0x1a6;const _0x927390=a33_0x9273();let _0x1190e4=_0x927390[_0x110a24];return _0x1190e4;}(function(_0x4b4477,_0x4055df){const _0x53afc0=a33_0x1190,_0x37b3bf=_0x4b4477();while(!![]){try{const _0x274dbd=-parseInt(_0x53afc0(0x1ae))/0x1*(parseInt(_0x53afc0(0x1ab))/0x2)+parseInt(_0x53afc0(0x1a6))/0x3+-parseInt(_0x53afc0(0x1bb))/0x4*(parseInt(_0x53afc0(0x1b7))/0x5)+-parseInt(_0x53afc0(0x1b4))/0x6+parseInt(_0x53afc0(0x1c1))/0x7+-parseInt(_0x53afc0(0x1c3))/0x8+parseInt(_0x53afc0(0x1a9))/0x9*(-parseInt(_0x53afc0(0x1b9))/0xa);if(_0x274dbd===_0x4055df)break;else _0x37b3bf['push'](_0x37b3bf['shift']());}catch(_0x357d35){_0x37b3bf['push'](_0x37b3bf['shift']());}}}(a33_0x9273,0x19961));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a33_0x9273(){const _0x4943f8=['message','duration','179385EzLJAH','\x20logs:\x0a','320cDQcDu','length','4BJmmIt','logs','toLocaleString','details','forEach','stringify','1290779Ijhmxv','keys','357840PXSukq','log','level','481866VGoclG','read','warn','20556hMWnAe','View\x20command\x20history\x20logs','54BHyylC','timestamp','success','2207JfFFpb','readLogs','en-US','*\x20No\x20logs\x20found','command','show','161604WPfwzh'];a33_0x9273=function(){return _0x4943f8;};return a33_0x9273();}function printLogs(_0x5747d1){const _0x34ff68=a33_0x1190;if(_0x5747d1[_0x34ff68(0x1ba)]===0x0){console[_0x34ff68(0x1c4)](_0x34ff68(0x1b1));return;}console[_0x34ff68(0x1c4)]('*\x20'+CLI_DISPLAY_NAME+_0x34ff68(0x1b8)),_0x5747d1[_0x34ff68(0x1bf)]((_0x1c252d,_0x1537f2)=>{const _0x2bc6d6=_0x34ff68,_0x398e42=new Date(_0x1c252d[_0x2bc6d6(0x1ac)])[_0x2bc6d6(0x1bd)](_0x2bc6d6(0x1b0)),_0x350db3=_0x1c252d[_0x2bc6d6(0x1c5)]===_0x2bc6d6(0x1ad)?'√':_0x1c252d['level']==='error'?'×':_0x1c252d[_0x2bc6d6(0x1c5)]===_0x2bc6d6(0x1a8)?'!':'i';console[_0x2bc6d6(0x1c4)](_0x1537f2+0x1+'.\x20'+_0x350db3+'\x20['+_0x1c252d[_0x2bc6d6(0x1b2)]+']\x20'+_0x1c252d[_0x2bc6d6(0x1b5)]),console[_0x2bc6d6(0x1c4)]('\x20\x20\x20Time:\x20'+_0x398e42),_0x1c252d[_0x2bc6d6(0x1b6)]&&console[_0x2bc6d6(0x1c4)]('\x20\x20\x20Duration:\x20'+_0x1c252d[_0x2bc6d6(0x1b6)]+'ms'),_0x1c252d[_0x2bc6d6(0x1be)]&&Object[_0x2bc6d6(0x1c2)](_0x1c252d[_0x2bc6d6(0x1be)])[_0x2bc6d6(0x1ba)]>0x0&&console[_0x2bc6d6(0x1c4)]('\x20\x20\x20Details:\x20'+JSON[_0x2bc6d6(0x1c0)](_0x1c252d[_0x2bc6d6(0x1be)],null,0x2)),console['log']('');});}export const logsDefinitions=[{'service':a33_0x36b5db(0x1bc),'command':a33_0x36b5db(0x1b3),'description':a33_0x36b5db(0x1aa),'risk':a33_0x36b5db(0x1a7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x44e7a5){const _0x472412=a33_0x36b5db;return printLogs(logger[_0x472412(0x1af)]()),{'ok':!![]};}},{'service':a33_0x36b5db(0x1bc),'command':'clear','description':'Clear\x20command\x20history\x20logs','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5cb863){const _0x2789ca=a33_0x36b5db;return logger['clearLogs'](),console[_0x2789ca(0x1c4)]('*\x20Logs\x20cleared'),{'ok':!![]};}}];
1
+ const a33_0x5e22bd=a33_0x1de2;(function(_0x2c88f8,_0x47d48e){const _0x2e0a00=a33_0x1de2,_0x5d5119=_0x2c88f8();while(!![]){try{const _0x1c6c97=parseInt(_0x2e0a00(0x13d))/0x1*(-parseInt(_0x2e0a00(0x152))/0x2)+parseInt(_0x2e0a00(0x13f))/0x3*(-parseInt(_0x2e0a00(0x148))/0x4)+parseInt(_0x2e0a00(0x158))/0x5+-parseInt(_0x2e0a00(0x146))/0x6+-parseInt(_0x2e0a00(0x151))/0x7+parseInt(_0x2e0a00(0x147))/0x8+parseInt(_0x2e0a00(0x142))/0x9;if(_0x1c6c97===_0x47d48e)break;else _0x5d5119['push'](_0x5d5119['shift']());}catch(_0x4c9b9c){_0x5d5119['push'](_0x5d5119['shift']());}}}(a33_0xa4d5,0xcdad7));import{logger}from'../../utils/logger.js';function a33_0x1de2(_0x1129b9,_0x70c71c){_0x1129b9=_0x1129b9-0x13c;const _0xa4d5c7=a33_0xa4d5();let _0x1de2da=_0xa4d5c7[_0x1129b9];return _0x1de2da;}function a33_0xa4d5(){const _0x36ba34=['level','20586141nzRdRf','length','\x20\x20\x20Duration:\x20','\x20\x20\x20Time:\x20','2967006KfIive','3526424qMLQKK','8LOxCKE','keys','View\x20command\x20history\x20logs','toLocaleString','read','log','error','duration','*\x20No\x20logs\x20found','10994900zmUnhw','2906nCjeoS','\x20logs:\x0a','clearLogs','en-US','write','\x20\x20\x20Details:\x20','6007095vFqVqJ','clear','Clear\x20command\x20history\x20logs','forEach','details','stringify','command','569NkVIii','show','292737atjQem','logs'];a33_0xa4d5=function(){return _0x36ba34;};return a33_0xa4d5();}import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x19e518){const _0x2468fa=a33_0x1de2;if(_0x19e518[_0x2468fa(0x143)]===0x0){console[_0x2468fa(0x14d)](_0x2468fa(0x150));return;}console[_0x2468fa(0x14d)]('*\x20'+CLI_DISPLAY_NAME+_0x2468fa(0x153)),_0x19e518[_0x2468fa(0x15b)]((_0x351cc6,_0x53acb8)=>{const _0x12619d=_0x2468fa,_0x558b84=new Date(_0x351cc6['timestamp'])[_0x12619d(0x14b)](_0x12619d(0x155)),_0x5d6cf7=_0x351cc6[_0x12619d(0x141)]==='success'?'√':_0x351cc6[_0x12619d(0x141)]===_0x12619d(0x14e)?'×':_0x351cc6[_0x12619d(0x141)]==='warn'?'!':'i';console[_0x12619d(0x14d)](_0x53acb8+0x1+'.\x20'+_0x5d6cf7+'\x20['+_0x351cc6[_0x12619d(0x13c)]+']\x20'+_0x351cc6['message']),console['log'](_0x12619d(0x145)+_0x558b84),_0x351cc6[_0x12619d(0x14f)]&&console['log'](_0x12619d(0x144)+_0x351cc6[_0x12619d(0x14f)]+'ms'),_0x351cc6[_0x12619d(0x15c)]&&Object[_0x12619d(0x149)](_0x351cc6['details'])[_0x12619d(0x143)]>0x0&&console['log'](_0x12619d(0x157)+JSON[_0x12619d(0x15d)](_0x351cc6['details'],null,0x2)),console[_0x12619d(0x14d)]('');});}export const logsDefinitions=[{'service':a33_0x5e22bd(0x140),'command':a33_0x5e22bd(0x13e),'description':a33_0x5e22bd(0x14a),'risk':a33_0x5e22bd(0x14c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x404b9d){return printLogs(logger['readLogs']()),{'ok':!![]};}},{'service':'logs','command':a33_0x5e22bd(0x159),'description':a33_0x5e22bd(0x15a),'risk':a33_0x5e22bd(0x156),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2b3a6a){const _0x408e60=a33_0x5e22bd;return logger[_0x408e60(0x154)](),console[_0x408e60(0x14d)]('*\x20Logs\x20cleared'),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a34_0x15a0e5=a34_0x12d0;(function(_0x12dd35,_0x30bca8){const _0x5bcbcd=a34_0x12d0,_0x4c1d17=_0x12dd35();while(!![]){try{const _0x5f3916=-parseInt(_0x5bcbcd(0x1e2))/0x1+-parseInt(_0x5bcbcd(0x1d2))/0x2+-parseInt(_0x5bcbcd(0x1ff))/0x3*(parseInt(_0x5bcbcd(0x1d4))/0x4)+parseInt(_0x5bcbcd(0x1f0))/0x5+parseInt(_0x5bcbcd(0x1e1))/0x6+-parseInt(_0x5bcbcd(0x1ea))/0x7+-parseInt(_0x5bcbcd(0x1cf))/0x8*(-parseInt(_0x5bcbcd(0x1e8))/0x9);if(_0x5f3916===_0x30bca8)break;else _0x4c1d17['push'](_0x4c1d17['shift']());}catch(_0xe775e){_0x4c1d17['push'](_0x4c1d17['shift']());}}}(a34_0x3c86,0x3791b));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x15a0e5(0x1f5),a34_0x15a0e5(0x1e6),a34_0x15a0e5(0x1f8),'idCard'],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x15a0e5(0x1d0),'general':a34_0x15a0e5(0x1f9),'form':a34_0x15a0e5(0x1e4),'idCard':a34_0x15a0e5(0x1d7)},SCENE_FLAG={'name':a34_0x15a0e5(0x1eb),'type':a34_0x15a0e5(0x1f7),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x15a0e5(0x1d6)},IMAGE_FILE_FLAG={'name':a34_0x15a0e5(0x1ce),'type':a34_0x15a0e5(0x1f7),'description':a34_0x15a0e5(0x1cb)},IMAGE_URL_FLAG={'name':a34_0x15a0e5(0x1e7),'type':a34_0x15a0e5(0x1f7),'description':a34_0x15a0e5(0x1de)};function normalizeScene(_0x4155b5){const _0xd1f850=a34_0x15a0e5,_0x60c5fc=_0x4155b5[_0xd1f850(0x1ee)]()[_0xd1f850(0x1ed)]();if(_0x60c5fc===_0xd1f850(0x1e0))return'idCard';if(_0x60c5fc===_0xd1f850(0x1f5)||_0x60c5fc===_0xd1f850(0x1e6)||_0x60c5fc===_0xd1f850(0x1f8))return _0x60c5fc;throw CliErrors[_0xd1f850(0x1cc)](_0xd1f850(0x1da)+_0x4155b5+_0xd1f850(0x1fb)+SUPPORTED_SCENES['join'](',\x20'));}function a34_0x12d0(_0x4b4983,_0x20553d){_0x4b4983=_0x4b4983-0x1c8;const _0x3c8660=a34_0x3c86();let _0x12d0ce=_0x3c8660[_0x4b4983];return _0x12d0ce;}function selectedInputs(_0x3d2174){const _0x2c0417=a34_0x15a0e5,_0x3494bc=_0x3d2174[_0x2c0417(0x1fa)](_0x2c0417(0x1ce))[_0x2c0417(0x1ee)](),_0x2e7c32=_0x3d2174[_0x2c0417(0x1fa)]('image-url')['trim']();return{'imageFile':_0x3494bc,'imageUrl':_0x2e7c32,'count':[_0x3494bc,_0x2e7c32][_0x2c0417(0x1f4)](Boolean)[_0x2c0417(0x1cd)]};}function a34_0x3c86(){const _0x564902=['recognize','general','image-url','1481301Qnofzp','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','1281910OabOrX','scene','/client/ocr','toLowerCase','trim','/client/uploadFile','1908345PlRzpg','appCode','body','description','filter','invoice','filePath','string','form','General','str','.\x20Supported\x20scenes:\x20','imageUrl','fileUrl','apiError','1710mcuMtq','imageFile','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','\x20OCR','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','validation','length','image-file','32bbMANT','Invoice','File\x20URL\x20response\x20missing\x20fileUrl.','295164bHWzSN','File\x20upload\x20response\x20missing\x20filePath.','904CtEFFh','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','IdCard','count','Preview:\x20recognize\x20','Unsupported\x20OCR\x20scene:\x20','fileName','build','\x20OCR\x20from\x20URL','Publicly\x20accessible\x20image\x20or\x20file\x20URL','POST','idcard','139644zQKnqg','376156yqKaOH','ocr','Table'];a34_0x3c86=function(){return _0x564902;};return a34_0x3c86();}function validateInputSelection(_0x57472e){const _0x5a8a82=a34_0x15a0e5,_0x179078=selectedInputs(_0x57472e);if(_0x179078[_0x5a8a82(0x1d8)]!==0x1)throw CliErrors[_0x5a8a82(0x1cc)]('Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.');return _0x179078;}function withScene(_0x132268,_0x17343e,_0x5d2039){const _0x760b61=a34_0x15a0e5;return{..._0x132268,'scene':_0x17343e,..._0x5d2039?{'sourceFile':{'fileName':_0x5d2039[_0x760b61(0x1db)],'filePath':_0x5d2039['filePath']}}:{}};}const ocrRecognize={'service':a34_0x15a0e5(0x1e3),'command':a34_0x15a0e5(0x1e5),'description':a34_0x15a0e5(0x1c9),'risk':'write','flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x37aa4f){const _0x5b857f=a34_0x15a0e5,_0x105313=normalizeScene(_0x37aa4f['str'](_0x5b857f(0x1eb))),_0x54d410=SCENE_TO_LEGACY_TYPE[_0x105313],_0x31903e=validateInputSelection(_0x37aa4f);if(_0x31903e[_0x5b857f(0x1fc)])return dryRun(_0x5b857f(0x1df),_0x5b857f(0x1ec))[_0x5b857f(0x1f2)]({'appCode':_0x37aa4f[_0x5b857f(0x1f1)],'url':_0x31903e[_0x5b857f(0x1fc)],'type':_0x54d410})['description'](_0x5b857f(0x1d9)+_0x105313+_0x5b857f(0x1dd))[_0x5b857f(0x1dc)]();const _0x4b8ab7=requireRuntimeUploadFile(_0x31903e[_0x5b857f(0x1c8)],_0x5b857f(0x1ce));return dryRun(_0x5b857f(0x1df),_0x5b857f(0x1ef))[_0x5b857f(0x1f2)]({'steps':[{'method':'POST','url':_0x5b857f(0x1ef),'body':{'appCode':_0x37aa4f[_0x5b857f(0x1f1)],'multipart':{'file':_0x4b8ab7}}},{'method':_0x5b857f(0x1df),'url':'/client/queryFileUrl','body':{'filePath':'<filePath\x20returned\x20by\x20/client/uploadFile>','downloadFlag':![]}},{'method':_0x5b857f(0x1df),'url':_0x5b857f(0x1ec),'body':{'appCode':_0x37aa4f[_0x5b857f(0x1f1)],'url':_0x5b857f(0x1e9),'type':_0x54d410}}]})[_0x5b857f(0x1f3)](_0x5b857f(0x1d5)+_0x105313+_0x5b857f(0x1ca))['build']();},async 'execute'(_0x59c8e0){const _0x66e86c=a34_0x15a0e5,_0x17816f=normalizeScene(_0x59c8e0[_0x66e86c(0x1fa)](_0x66e86c(0x1eb))),_0x573142=SCENE_TO_LEGACY_TYPE[_0x17816f],_0x415a92=validateInputSelection(_0x59c8e0);if(_0x415a92['imageUrl']){const _0x89f4d6=await recognizeRuntimeOcr(_0x59c8e0[_0x66e86c(0x1f1)],{'url':_0x415a92[_0x66e86c(0x1fc)],'type':_0x573142});return{'ok':!![],'data':withScene(_0x89f4d6,_0x17816f)};}const _0x453713=requireRuntimeUploadFile(_0x415a92[_0x66e86c(0x1c8)],'image-file'),_0x288aad=await uploadRuntimeFile(_0x59c8e0[_0x66e86c(0x1f1)],_0x453713['path']);if(!_0x288aad[_0x66e86c(0x1f6)])throw CliErrors['apiError'](_0x66e86c(0x1d3));const _0x1cadc0=await queryRuntimeFileUrl(_0x288aad[_0x66e86c(0x1f6)],{'download':![]});if(!_0x1cadc0['fileUrl'])throw CliErrors[_0x66e86c(0x1fe)](_0x66e86c(0x1d1));const _0x2212f8=await recognizeRuntimeOcr(_0x59c8e0[_0x66e86c(0x1f1)],{'url':_0x1cadc0[_0x66e86c(0x1fd)],'type':_0x573142});return{'ok':!![],'data':withScene(_0x2212f8,_0x17816f,_0x288aad)};}};export const ocrDefinitions=[ocrRecognize];
1
+ const a34_0x3a7f88=a34_0x1ad4;function a34_0x1ad4(_0x2d8a69,_0x381ae4){_0x2d8a69=_0x2d8a69-0x1b4;const _0x423103=a34_0x4231();let _0x1ad4e1=_0x423103[_0x2d8a69];return _0x1ad4e1;}(function(_0x16cb9f,_0x572ea2){const _0x4d5f3b=a34_0x1ad4,_0x36954d=_0x16cb9f();while(!![]){try{const _0x1a1d93=-parseInt(_0x4d5f3b(0x1b6))/0x1+parseInt(_0x4d5f3b(0x1c7))/0x2+parseInt(_0x4d5f3b(0x1bf))/0x3+parseInt(_0x4d5f3b(0x1ce))/0x4+parseInt(_0x4d5f3b(0x1c1))/0x5+parseInt(_0x4d5f3b(0x1e5))/0x6+-parseInt(_0x4d5f3b(0x1c9))/0x7*(parseInt(_0x4d5f3b(0x1c5))/0x8);if(_0x1a1d93===_0x572ea2)break;else _0x36954d['push'](_0x36954d['shift']());}catch(_0x3a301f){_0x36954d['push'](_0x36954d['shift']());}}}(a34_0x4231,0xe474f));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';function a34_0x4231(){const _0x15c2ba=['string','/client/ocr','write','\x20OCR\x20from\x20URL','POST','build','Publicly\x20accessible\x20image\x20or\x20file\x20URL','length','description','validation','path','fileUrl','filter','ocr','.\x20Supported\x20scenes:\x20','idCard','<filePath\x20returned\x20by\x20/client/uploadFile>','str','trim','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','8837832CMlcUa','filePath','General','1429475NshSQE','scene','Unsupported\x20OCR\x20scene:\x20','body','imageFile','apiError','fileName','Invoice','toLowerCase','2446917OEdmTe','\x20OCR','2618050jQGtrH','idcard','general','Table','279248Yjefsy','appCode','877126cpquzM','imageUrl','273FWIXmX','count','image-file','image-url','/client/uploadFile','1903136jWDxQi','invoice'];a34_0x4231=function(){return _0x15c2ba;};return a34_0x4231();}import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=['invoice',a34_0x3a7f88(0x1c3),'form',a34_0x3a7f88(0x1df)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x3a7f88(0x1bd),'general':a34_0x3a7f88(0x1b5),'form':a34_0x3a7f88(0x1c4),'idCard':'IdCard'},SCENE_FLAG={'name':'scene','type':a34_0x3a7f88(0x1d0),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x3a7f88(0x1e4)},IMAGE_FILE_FLAG={'name':a34_0x3a7f88(0x1cb),'type':'string','description':'Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':'image-url','type':a34_0x3a7f88(0x1d0),'description':a34_0x3a7f88(0x1d6)};function normalizeScene(_0x4b5b11){const _0x4b20a1=a34_0x3a7f88,_0x4d08f7=_0x4b5b11[_0x4b20a1(0x1e2)]()[_0x4b20a1(0x1be)]();if(_0x4d08f7===_0x4b20a1(0x1c2))return _0x4b20a1(0x1df);if(_0x4d08f7===_0x4b20a1(0x1cf)||_0x4d08f7===_0x4b20a1(0x1c3)||_0x4d08f7==='form')return _0x4d08f7;throw CliErrors['validation'](_0x4b20a1(0x1b8)+_0x4b5b11+_0x4b20a1(0x1de)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x328685){const _0xbcfaca=a34_0x3a7f88,_0x37ad0f=_0x328685[_0xbcfaca(0x1e1)](_0xbcfaca(0x1cb))[_0xbcfaca(0x1e2)](),_0x45c854=_0x328685['str'](_0xbcfaca(0x1cc))[_0xbcfaca(0x1e2)]();return{'imageFile':_0x37ad0f,'imageUrl':_0x45c854,'count':[_0x37ad0f,_0x45c854][_0xbcfaca(0x1dc)](Boolean)[_0xbcfaca(0x1d7)]};}function validateInputSelection(_0x26ba6f){const _0x4ec2e2=a34_0x3a7f88,_0x2126bc=selectedInputs(_0x26ba6f);if(_0x2126bc[_0x4ec2e2(0x1ca)]!==0x1)throw CliErrors[_0x4ec2e2(0x1d9)]('Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.');return _0x2126bc;}function withScene(_0x15bcb5,_0x400a99,_0x5396d0){const _0x230d03=a34_0x3a7f88;return{..._0x15bcb5,'scene':_0x400a99,..._0x5396d0?{'sourceFile':{'fileName':_0x5396d0[_0x230d03(0x1bc)],'filePath':_0x5396d0[_0x230d03(0x1b4)]}}:{}};}const ocrRecognize={'service':a34_0x3a7f88(0x1dd),'command':'recognize','description':'Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','risk':a34_0x3a7f88(0x1d2),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x4a108b){const _0x33f031=a34_0x3a7f88,_0x39ae5e=normalizeScene(_0x4a108b['str']('scene')),_0x5b015c=SCENE_TO_LEGACY_TYPE[_0x39ae5e],_0x257819=validateInputSelection(_0x4a108b);if(_0x257819[_0x33f031(0x1c8)])return dryRun(_0x33f031(0x1d4),_0x33f031(0x1d1))['body']({'appCode':_0x4a108b[_0x33f031(0x1c6)],'url':_0x257819[_0x33f031(0x1c8)],'type':_0x5b015c})['description']('Preview:\x20recognize\x20'+_0x39ae5e+_0x33f031(0x1d3))['build']();const _0x24977d=requireRuntimeUploadFile(_0x257819[_0x33f031(0x1ba)],_0x33f031(0x1cb));return dryRun(_0x33f031(0x1d4),_0x33f031(0x1cd))[_0x33f031(0x1b9)]({'steps':[{'method':_0x33f031(0x1d4),'url':_0x33f031(0x1cd),'body':{'appCode':_0x4a108b[_0x33f031(0x1c6)],'multipart':{'file':_0x24977d}}},{'method':_0x33f031(0x1d4),'url':'/client/queryFileUrl','body':{'filePath':_0x33f031(0x1e0),'downloadFlag':![]}},{'method':_0x33f031(0x1d4),'url':_0x33f031(0x1d1),'body':{'appCode':_0x4a108b['appCode'],'url':_0x33f031(0x1e3),'type':_0x5b015c}}]})[_0x33f031(0x1d8)]('Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0x39ae5e+_0x33f031(0x1c0))[_0x33f031(0x1d5)]();},async 'execute'(_0xb7c957){const _0x8c0486=a34_0x3a7f88,_0x1bb668=normalizeScene(_0xb7c957[_0x8c0486(0x1e1)](_0x8c0486(0x1b7))),_0x1d8244=SCENE_TO_LEGACY_TYPE[_0x1bb668],_0x239e0c=validateInputSelection(_0xb7c957);if(_0x239e0c[_0x8c0486(0x1c8)]){const _0x241531=await recognizeRuntimeOcr(_0xb7c957[_0x8c0486(0x1c6)],{'url':_0x239e0c[_0x8c0486(0x1c8)],'type':_0x1d8244});return{'ok':!![],'data':withScene(_0x241531,_0x1bb668)};}const _0x32a55b=requireRuntimeUploadFile(_0x239e0c[_0x8c0486(0x1ba)],_0x8c0486(0x1cb)),_0x17460c=await uploadRuntimeFile(_0xb7c957[_0x8c0486(0x1c6)],_0x32a55b[_0x8c0486(0x1da)]);if(!_0x17460c['filePath'])throw CliErrors['apiError']('File\x20upload\x20response\x20missing\x20filePath.');const _0x30334e=await queryRuntimeFileUrl(_0x17460c[_0x8c0486(0x1b4)],{'download':![]});if(!_0x30334e[_0x8c0486(0x1db)])throw CliErrors[_0x8c0486(0x1bb)]('File\x20URL\x20response\x20missing\x20fileUrl.');const _0x4c43d4=await recognizeRuntimeOcr(_0xb7c957[_0x8c0486(0x1c6)],{'url':_0x30334e[_0x8c0486(0x1db)],'type':_0x1d8244});return{'ok':!![],'data':withScene(_0x4c43d4,_0x1bb668,_0x17460c)};}};export const ocrDefinitions=[ocrRecognize];
@@ -1 +1 @@
1
- const a35_0x29d8bb=a35_0x37ca;(function(_0x4b8c5a,_0x2b120a){const _0x2866e3=a35_0x37ca,_0x19e078=_0x4b8c5a();while(!![]){try{const _0x3b955b=parseInt(_0x2866e3(0x152))/0x1*(-parseInt(_0x2866e3(0x14c))/0x2)+parseInt(_0x2866e3(0x16e))/0x3+-parseInt(_0x2866e3(0x132))/0x4+parseInt(_0x2866e3(0x135))/0x5+-parseInt(_0x2866e3(0x146))/0x6+-parseInt(_0x2866e3(0x14f))/0x7+-parseInt(_0x2866e3(0x137))/0x8*(-parseInt(_0x2866e3(0x143))/0x9);if(_0x3b955b===_0x2b120a)break;else _0x19e078['push'](_0x19e078['shift']());}catch(_0x5aed5b){_0x19e078['push'](_0x19e078['shift']());}}}(a35_0x2bb6,0x67ff9));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x2bb6(){const _0x2d48eb=['549iYLnbR','updateTime','Preview:\x20update\x20personal\x20BFF\x20','1733988bNhUMa','File\x20path\x20is\x20required.','Personal\x20BFF\x20description','flag','Updated\x20personal\x20BFF\x20','File\x20is\x20not\x20a\x20regular\x20file:\x20','5734aLhYem','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','1390389MMdHdJ','string','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','195jjdBov','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','exec','gmtModified','num','version','name','personal-bff','test','appCode','Update\x20a\x20personal\x20BFF\x20by\x20id','high-risk-write','POST','verbose','str','functionName','validation','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','body','File\x20not\x20found:\x20','scriptType','source-session-id','sourceSessionId','create','Personal\x20BFF\x20script\x20file\x20is\x20blank.','/client/runtime-bff/personal/create','/client/runtime-bff/personal/','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','859419GohubO','map','file','14756PuPtwY','description','bool','2295515takvKn','scriptContent','95840EOyKFG','trim','--params\x20must\x20be\x20a\x20JSON\x20object.','utf8','gmtCreate','Created\x20personal\x20BFF\x20','/update','length','config','build','read','Personal\x20BFF\x20script\x20ID'];a35_0x2bb6=function(){return _0x2d48eb;};return a35_0x2bb6();}import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x29d8bb(0x131),'type':a35_0x29d8bb(0x150),'description':a35_0x29d8bb(0x14d)},FUNCTION_NAME_FLAG={'name':a35_0x29d8bb(0x158),'type':'string','required':!![],'description':a35_0x29d8bb(0x163)},DESCRIPTION_FLAG={'name':a35_0x29d8bb(0x133),'type':a35_0x29d8bb(0x150),'description':a35_0x29d8bb(0x148)},SOURCE_SESSION_FLAG={'name':a35_0x29d8bb(0x167),'type':a35_0x29d8bb(0x150),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function normalizeFunctionName(_0x3d51f0){const _0x54efe0=a35_0x29d8bb,_0x2b6347=String(_0x3d51f0||'')['trim']();if(!_0x2b6347||!FUNCTION_NAME_PATTERN[_0x54efe0(0x15a)](_0x2b6347))throw CliErrors[_0x54efe0(0x162)](_0x54efe0(0x16d));return _0x2b6347;}function readScriptFile(_0x43a84b){const _0x157afa=a35_0x29d8bb;if(!_0x43a84b)throw CliErrors['validation'](_0x157afa(0x147));if(!existsSync(_0x43a84b))throw CliErrors[_0x157afa(0x162)](_0x157afa(0x165)+_0x43a84b);if(!statSync(_0x43a84b)['isFile']())throw CliErrors[_0x157afa(0x162)](_0x157afa(0x14b)+_0x43a84b);const _0x893d2=readFileSync(_0x43a84b,_0x157afa(0x13a));if(!_0x893d2[_0x157afa(0x138)]())throw CliErrors[_0x157afa(0x162)](_0x157afa(0x16a));return _0x893d2;}function optionalTrimmed(_0xb22c4b){const _0x3ea1e1=String(_0xb22c4b||'')['trim']();return _0x3ea1e1||undefined;}function a35_0x37ca(_0x4a6827,_0x1826f3){_0x4a6827=_0x4a6827-0x131;const _0x2bb652=a35_0x2bb6();let _0x37ca87=_0x2bb652[_0x4a6827];return _0x37ca87;}function summarizeBff(_0x2a0b08){const _0x176f20=a35_0x29d8bb;return{'id':_0x2a0b08['id'],'appCode':_0x2a0b08[_0x176f20(0x15b)],'functionName':_0x2a0b08['functionName'],'description':_0x2a0b08[_0x176f20(0x133)],'scriptType':_0x2a0b08[_0x176f20(0x166)],'version':_0x2a0b08[_0x176f20(0x157)],'gmtModified':_0x2a0b08[_0x176f20(0x155)],'updateTime':_0x2a0b08[_0x176f20(0x144)]};}function detailBff(_0x4b041b){const _0x44b43d=a35_0x29d8bb;return{'id':_0x4b041b['id'],'appCode':_0x4b041b[_0x44b43d(0x15b)],'functionName':_0x4b041b[_0x44b43d(0x161)],'description':_0x4b041b['description'],'scriptType':_0x4b041b[_0x44b43d(0x166)],'scriptContent':_0x4b041b['scriptContent']??'','config':_0x4b041b[_0x44b43d(0x13f)],'version':_0x4b041b[_0x44b43d(0x157)],'createUserId':_0x4b041b['createUserId'],'gmtCreate':_0x4b041b[_0x44b43d(0x13b)],'gmtModified':_0x4b041b['gmtModified'],'createTime':_0x4b041b['createTime'],'updateTime':_0x4b041b[_0x44b43d(0x144)]};}function buildCreateInput(_0x3031a9){const _0x45fae4=a35_0x29d8bb;return{'functionName':normalizeFunctionName(_0x3031a9[_0x45fae4(0x160)](_0x45fae4(0x158))),...optionalTrimmed(_0x3031a9[_0x45fae4(0x160)](_0x45fae4(0x133)))?{'description':optionalTrimmed(_0x3031a9[_0x45fae4(0x160)](_0x45fae4(0x133)))}:{},'scriptContent':readScriptFile(_0x3031a9[_0x45fae4(0x160)](_0x45fae4(0x131))),...optionalTrimmed(_0x3031a9['str'](_0x45fae4(0x167)))?{'sourceSessionId':optionalTrimmed(_0x3031a9['str'](_0x45fae4(0x167)))}:{}};}function buildUpdateInput(_0x3ca201){const _0x57fa4b=a35_0x29d8bb,_0x357caa={};optionalTrimmed(_0x3ca201[_0x57fa4b(0x160)](_0x57fa4b(0x158)))&&(_0x357caa[_0x57fa4b(0x161)]=normalizeFunctionName(_0x3ca201[_0x57fa4b(0x160)](_0x57fa4b(0x158))));_0x3ca201[_0x57fa4b(0x149)](_0x57fa4b(0x133))!==undefined&&(_0x357caa[_0x57fa4b(0x133)]=_0x3ca201[_0x57fa4b(0x160)](_0x57fa4b(0x133)));optionalTrimmed(_0x3ca201['str'](_0x57fa4b(0x131)))&&(_0x357caa[_0x57fa4b(0x136)]=readScriptFile(_0x3ca201[_0x57fa4b(0x160)](_0x57fa4b(0x131))));_0x3ca201[_0x57fa4b(0x149)](_0x57fa4b(0x167))!==undefined&&(_0x357caa[_0x57fa4b(0x168)]=_0x3ca201['str'](_0x57fa4b(0x167)));if(Object['keys'](_0x357caa)[_0x57fa4b(0x13e)]===0x0)throw CliErrors['validation'](_0x57fa4b(0x14e));return _0x357caa;}function parseExecParams(_0x3f0beb){const _0x289601=a35_0x29d8bb,_0x44dc80=parseJsonParams(_0x3f0beb)??{};if(Array['isArray'](_0x44dc80))throw CliErrors[_0x289601(0x162)](_0x289601(0x139));return _0x44dc80;}const personalBffList={'service':a35_0x29d8bb(0x159),'command':'list','description':a35_0x29d8bb(0x153),'risk':a35_0x29d8bb(0x141),'flags':[VERBOSE_FLAG],async 'execute'(_0x210d3f){const _0x3e9f96=a35_0x29d8bb,_0x3a780f=await listPersonalBffs(_0x210d3f[_0x3e9f96(0x15b)]);return{'ok':!![],'data':{'total':_0x3a780f[_0x3e9f96(0x13e)],'items':_0x210d3f[_0x3e9f96(0x134)](_0x3e9f96(0x15f))?_0x3a780f:_0x3a780f[_0x3e9f96(0x16f)](summarizeBff)}};}},personalBffDetail={'service':a35_0x29d8bb(0x159),'command':'detail','description':'Show\x20one\x20personal\x20BFF\x20by\x20id','risk':'read','flags':[{...ID_FLAG,'description':a35_0x29d8bb(0x142)}],async 'execute'(_0x573b21){const _0x2e2980=a35_0x29d8bb,_0x3df296=await getPersonalBff(_0x573b21[_0x2e2980(0x156)]('id'),_0x573b21['appCode']);return{'ok':!![],'data':detailBff(_0x3df296)};}},personalBffCreate={'service':'personal-bff','command':a35_0x29d8bb(0x169),'description':'Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','risk':'write','flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x136b6f){const _0x4b10e=a35_0x29d8bb,_0xb7e651=buildCreateInput(_0x136b6f),_0x20cfa7=await createPersonalBff(_0x136b6f[_0x4b10e(0x15b)],_0xb7e651);return{'ok':!![],'data':detailBff(_0x20cfa7),'message':_0x4b10e(0x13c)+_0x20cfa7['id']+(_0x20cfa7[_0x4b10e(0x161)]?'\x20('+_0x20cfa7['functionName']+')':'')};},async 'dryRun'(_0x47d03c){const _0x58c42e=a35_0x29d8bb,_0x578b5d=buildCreateInput(_0x47d03c);return dryRun('POST',_0x58c42e(0x16b))[_0x58c42e(0x164)]({'appCode':_0x47d03c['appCode'],..._0x578b5d})[_0x58c42e(0x133)]('Preview:\x20create\x20personal\x20BFF\x20'+_0x578b5d[_0x58c42e(0x161)])[_0x58c42e(0x140)]();}},personalBffUpdate={'service':a35_0x29d8bb(0x159),'command':'update','description':a35_0x29d8bb(0x15c),'risk':'write','flags':[{...ID_FLAG,'description':a35_0x29d8bb(0x142)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x40b637){const _0x382c18=a35_0x29d8bb,_0x3a9784=_0x40b637[_0x382c18(0x156)]('id'),_0x59477b=buildUpdateInput(_0x40b637),_0x56619a=await updatePersonalBff(_0x3a9784,_0x40b637['appCode'],_0x59477b);return{'ok':!![],'data':detailBff(_0x56619a),'message':_0x382c18(0x14a)+_0x56619a['id']+(_0x56619a[_0x382c18(0x161)]?'\x20('+_0x56619a['functionName']+')':'')};},async 'dryRun'(_0x54afd9){const _0x4cebb9=a35_0x29d8bb,_0x32f7bc=_0x54afd9[_0x4cebb9(0x156)]('id'),_0x2253d6=buildUpdateInput(_0x54afd9);return dryRun(_0x4cebb9(0x15e),_0x4cebb9(0x16c)+_0x32f7bc+_0x4cebb9(0x13d))[_0x4cebb9(0x164)]({'appCode':_0x54afd9['appCode'],..._0x2253d6})[_0x4cebb9(0x133)](_0x4cebb9(0x145)+_0x32f7bc)[_0x4cebb9(0x140)]();}},personalBffExec={'service':a35_0x29d8bb(0x159),'command':a35_0x29d8bb(0x154),'description':'Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','risk':a35_0x29d8bb(0x15d),'flags':[{...ID_FLAG,'description':a35_0x29d8bb(0x142)},{...PARAMS_FLAG,'description':a35_0x29d8bb(0x151)}],async 'validate'(_0x2c1f8e){const _0x3f1d5e=a35_0x29d8bb;parseExecParams(_0x2c1f8e[_0x3f1d5e(0x160)]('params'));},async 'execute'(_0x37d844){const _0x5963f2=a35_0x29d8bb,_0x1ac4ec=_0x37d844[_0x5963f2(0x156)]('id'),_0x109df2=parseExecParams(_0x37d844['str']('params')),_0x367c61=await executePersonalBff(_0x1ac4ec,_0x37d844[_0x5963f2(0x15b)],_0x109df2);return{'ok':!![],'data':{'result':_0x367c61},'message':'Executed\x20personal\x20BFF\x20'+_0x1ac4ec};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
1
+ const a35_0x3ec7a3=a35_0x298f;function a35_0x4e65(){const _0x4c1e04=['Personal\x20BFF\x20script\x20ID','write','POST','functionName','Updated\x20personal\x20BFF\x20','length','updateTime','Update\x20a\x20personal\x20BFF\x20by\x20id','/client/runtime-bff/personal/create','1858940yVlsGQ','isArray','high-risk-write','read','flag','--params\x20must\x20be\x20a\x20JSON\x20object.','createUserId','1AaNaVD','appCode','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','verbose','scriptContent','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','Executed\x20personal\x20BFF\x20','string','Preview:\x20create\x20personal\x20BFF\x20','str','3693690WtTveR','update','4004164dSvChb','num','map','1758072sgsPrV','7GLPBnS','exec','gmtCreate','description','File\x20is\x20not\x20a\x20regular\x20file:\x20','1434159wkAQNf','params','150tTsSzj','body','File\x20path\x20is\x20required.','version','Preview:\x20update\x20personal\x20BFF\x20','sourceSessionId','3759335IhHNkk','build','Created\x20personal\x20BFF\x20','2834320yXqrmx','scriptType','validation','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','/client/runtime-bff/personal/','config','Personal\x20BFF\x20script\x20file\x20is\x20blank.','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','File\x20not\x20found:\x20','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','gmtModified','personal-bff','source-session-id','Show\x20one\x20personal\x20BFF\x20by\x20id','isFile','test','name','file','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.'];a35_0x4e65=function(){return _0x4c1e04;};return a35_0x4e65();}(function(_0x158014,_0x3c43a4){const _0x3034c9=a35_0x298f,_0x243c83=_0x158014();while(!![]){try{const _0x295b18=parseInt(_0x3034c9(0x192))/0x1*(-parseInt(_0x3034c9(0x18b))/0x2)+parseInt(_0x3034c9(0x19c))/0x3+-parseInt(_0x3034c9(0x19e))/0x4+-parseInt(_0x3034c9(0x1af))/0x5+-parseInt(_0x3034c9(0x1a1))/0x6*(-parseInt(_0x3034c9(0x1a2))/0x7)+-parseInt(_0x3034c9(0x1b2))/0x8+parseInt(_0x3034c9(0x1a7))/0x9*(parseInt(_0x3034c9(0x1a9))/0xa);if(_0x295b18===_0x3c43a4)break;else _0x243c83['push'](_0x243c83['shift']());}catch(_0x2c3fbf){_0x243c83['push'](_0x243c83['shift']());}}}(a35_0x4e65,0xd650f));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x3ec7a3(0x180),'type':a35_0x3ec7a3(0x199),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':'name','type':a35_0x3ec7a3(0x199),'required':!![],'description':a35_0x3ec7a3(0x1b5)},DESCRIPTION_FLAG={'name':a35_0x3ec7a3(0x1a5),'type':'string','description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a35_0x3ec7a3(0x17b),'type':a35_0x3ec7a3(0x199),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function a35_0x298f(_0x4c7fc,_0x220985){_0x4c7fc=_0x4c7fc-0x17b;const _0x4e6545=a35_0x4e65();let _0x298fdd=_0x4e6545[_0x4c7fc];return _0x298fdd;}function normalizeFunctionName(_0x1b1151){const _0x4ffaa4=a35_0x3ec7a3,_0x16d6d4=String(_0x1b1151||'')['trim']();if(!_0x16d6d4||!FUNCTION_NAME_PATTERN[_0x4ffaa4(0x17e)](_0x16d6d4))throw CliErrors[_0x4ffaa4(0x1b4)]('--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.');return _0x16d6d4;}function readScriptFile(_0x398446){const _0x54e9d7=a35_0x3ec7a3;if(!_0x398446)throw CliErrors[_0x54e9d7(0x1b4)](_0x54e9d7(0x1ab));if(!existsSync(_0x398446))throw CliErrors[_0x54e9d7(0x1b4)](_0x54e9d7(0x1ba)+_0x398446);if(!statSync(_0x398446)[_0x54e9d7(0x17d)]())throw CliErrors[_0x54e9d7(0x1b4)](_0x54e9d7(0x1a6)+_0x398446);const _0xe7a06d=readFileSync(_0x398446,'utf8');if(!_0xe7a06d['trim']())throw CliErrors[_0x54e9d7(0x1b4)](_0x54e9d7(0x1b8));return _0xe7a06d;}function optionalTrimmed(_0x2a5004){const _0x31940c=String(_0x2a5004||'')['trim']();return _0x31940c||undefined;}function summarizeBff(_0x23b5e0){const _0x15c734=a35_0x3ec7a3;return{'id':_0x23b5e0['id'],'appCode':_0x23b5e0[_0x15c734(0x193)],'functionName':_0x23b5e0[_0x15c734(0x185)],'description':_0x23b5e0[_0x15c734(0x1a5)],'scriptType':_0x23b5e0[_0x15c734(0x1b3)],'version':_0x23b5e0[_0x15c734(0x1ac)],'gmtModified':_0x23b5e0[_0x15c734(0x1bc)],'updateTime':_0x23b5e0[_0x15c734(0x188)]};}function detailBff(_0x4ff747){const _0x592b93=a35_0x3ec7a3;return{'id':_0x4ff747['id'],'appCode':_0x4ff747[_0x592b93(0x193)],'functionName':_0x4ff747[_0x592b93(0x185)],'description':_0x4ff747[_0x592b93(0x1a5)],'scriptType':_0x4ff747['scriptType'],'scriptContent':_0x4ff747['scriptContent']??'','config':_0x4ff747[_0x592b93(0x1b7)],'version':_0x4ff747[_0x592b93(0x1ac)],'createUserId':_0x4ff747[_0x592b93(0x191)],'gmtCreate':_0x4ff747[_0x592b93(0x1a4)],'gmtModified':_0x4ff747[_0x592b93(0x1bc)],'createTime':_0x4ff747['createTime'],'updateTime':_0x4ff747['updateTime']};}function buildCreateInput(_0xca2c8b){const _0x19b511=a35_0x3ec7a3;return{'functionName':normalizeFunctionName(_0xca2c8b['str'](_0x19b511(0x17f))),...optionalTrimmed(_0xca2c8b[_0x19b511(0x19b)](_0x19b511(0x1a5)))?{'description':optionalTrimmed(_0xca2c8b[_0x19b511(0x19b)](_0x19b511(0x1a5)))}:{},'scriptContent':readScriptFile(_0xca2c8b[_0x19b511(0x19b)](_0x19b511(0x180))),...optionalTrimmed(_0xca2c8b[_0x19b511(0x19b)](_0x19b511(0x17b)))?{'sourceSessionId':optionalTrimmed(_0xca2c8b[_0x19b511(0x19b)](_0x19b511(0x17b)))}:{}};}function buildUpdateInput(_0x50a1bb){const _0x5e841d=a35_0x3ec7a3,_0x1817cd={};optionalTrimmed(_0x50a1bb[_0x5e841d(0x19b)](_0x5e841d(0x17f)))&&(_0x1817cd[_0x5e841d(0x185)]=normalizeFunctionName(_0x50a1bb[_0x5e841d(0x19b)](_0x5e841d(0x17f))));_0x50a1bb[_0x5e841d(0x18f)]('description')!==undefined&&(_0x1817cd[_0x5e841d(0x1a5)]=_0x50a1bb[_0x5e841d(0x19b)](_0x5e841d(0x1a5)));optionalTrimmed(_0x50a1bb['str'](_0x5e841d(0x180)))&&(_0x1817cd[_0x5e841d(0x196)]=readScriptFile(_0x50a1bb[_0x5e841d(0x19b)](_0x5e841d(0x180))));_0x50a1bb[_0x5e841d(0x18f)](_0x5e841d(0x17b))!==undefined&&(_0x1817cd[_0x5e841d(0x1ae)]=_0x50a1bb[_0x5e841d(0x19b)](_0x5e841d(0x17b)));if(Object['keys'](_0x1817cd)[_0x5e841d(0x187)]===0x0)throw CliErrors['validation'](_0x5e841d(0x181));return _0x1817cd;}function parseExecParams(_0x4b959b){const _0x24aa2a=a35_0x3ec7a3,_0x1abafc=parseJsonParams(_0x4b959b)??{};if(Array[_0x24aa2a(0x18c)](_0x1abafc))throw CliErrors['validation'](_0x24aa2a(0x190));return _0x1abafc;}const personalBffList={'service':'personal-bff','command':'list','description':a35_0x3ec7a3(0x1b9),'risk':a35_0x3ec7a3(0x18e),'flags':[VERBOSE_FLAG],async 'execute'(_0x545f38){const _0x551ba8=a35_0x3ec7a3,_0x1b64fb=await listPersonalBffs(_0x545f38[_0x551ba8(0x193)]);return{'ok':!![],'data':{'total':_0x1b64fb['length'],'items':_0x545f38['bool'](_0x551ba8(0x195))?_0x1b64fb:_0x1b64fb[_0x551ba8(0x1a0)](summarizeBff)}};}},personalBffDetail={'service':a35_0x3ec7a3(0x1bd),'command':'detail','description':a35_0x3ec7a3(0x17c),'risk':a35_0x3ec7a3(0x18e),'flags':[{...ID_FLAG,'description':a35_0x3ec7a3(0x182)}],async 'execute'(_0x1efe16){const _0x23d615=a35_0x3ec7a3,_0x230d40=await getPersonalBff(_0x1efe16[_0x23d615(0x19f)]('id'),_0x1efe16[_0x23d615(0x193)]);return{'ok':!![],'data':detailBff(_0x230d40)};}},personalBffCreate={'service':a35_0x3ec7a3(0x1bd),'command':'create','description':a35_0x3ec7a3(0x194),'risk':a35_0x3ec7a3(0x183),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x2bb0c1){const _0x295b2c=a35_0x3ec7a3,_0x59480d=buildCreateInput(_0x2bb0c1),_0x239ca5=await createPersonalBff(_0x2bb0c1[_0x295b2c(0x193)],_0x59480d);return{'ok':!![],'data':detailBff(_0x239ca5),'message':_0x295b2c(0x1b1)+_0x239ca5['id']+(_0x239ca5[_0x295b2c(0x185)]?'\x20('+_0x239ca5[_0x295b2c(0x185)]+')':'')};},async 'dryRun'(_0x34fd2){const _0x28c993=a35_0x3ec7a3,_0xa9b1e2=buildCreateInput(_0x34fd2);return dryRun('POST',_0x28c993(0x18a))[_0x28c993(0x1aa)]({'appCode':_0x34fd2[_0x28c993(0x193)],..._0xa9b1e2})[_0x28c993(0x1a5)](_0x28c993(0x19a)+_0xa9b1e2[_0x28c993(0x185)])[_0x28c993(0x1b0)]();}},personalBffUpdate={'service':a35_0x3ec7a3(0x1bd),'command':a35_0x3ec7a3(0x19d),'description':a35_0x3ec7a3(0x189),'risk':a35_0x3ec7a3(0x183),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x554d78){const _0x1faacd=a35_0x3ec7a3,_0x34a820=_0x554d78[_0x1faacd(0x19f)]('id'),_0x21e521=buildUpdateInput(_0x554d78),_0x51643c=await updatePersonalBff(_0x34a820,_0x554d78[_0x1faacd(0x193)],_0x21e521);return{'ok':!![],'data':detailBff(_0x51643c),'message':_0x1faacd(0x186)+_0x51643c['id']+(_0x51643c[_0x1faacd(0x185)]?'\x20('+_0x51643c['functionName']+')':'')};},async 'dryRun'(_0x36e54f){const _0x53f5d9=a35_0x3ec7a3,_0x5db89a=_0x36e54f[_0x53f5d9(0x19f)]('id'),_0x3cd2f7=buildUpdateInput(_0x36e54f);return dryRun(_0x53f5d9(0x184),_0x53f5d9(0x1b6)+_0x5db89a+'/update')['body']({'appCode':_0x36e54f[_0x53f5d9(0x193)],..._0x3cd2f7})[_0x53f5d9(0x1a5)](_0x53f5d9(0x1ad)+_0x5db89a)['build']();}},personalBffExec={'service':a35_0x3ec7a3(0x1bd),'command':a35_0x3ec7a3(0x1a3),'description':a35_0x3ec7a3(0x1bb),'risk':a35_0x3ec7a3(0x18d),'flags':[{...ID_FLAG,'description':a35_0x3ec7a3(0x182)},{...PARAMS_FLAG,'description':a35_0x3ec7a3(0x197)}],async 'validate'(_0x2c948b){const _0x35b1c7=a35_0x3ec7a3;parseExecParams(_0x2c948b['str'](_0x35b1c7(0x1a8)));},async 'execute'(_0x3cc781){const _0x6edcee=a35_0x3ec7a3,_0x443692=_0x3cc781['num']('id'),_0xf098ea=parseExecParams(_0x3cc781['str']('params')),_0x5eaa86=await executePersonalBff(_0x443692,_0x3cc781[_0x6edcee(0x193)],_0xf098ea);return{'ok':!![],'data':{'result':_0x5eaa86},'message':_0x6edcee(0x198)+_0x443692};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
1
- const a36_0x2fb4d8=a36_0x2b9c;(function(_0x1fbac7,_0x1e3f14){const _0x9239db=a36_0x2b9c,_0xf95b92=_0x1fbac7();while(!![]){try{const _0x113cca=parseInt(_0x9239db(0xf2))/0x1*(-parseInt(_0x9239db(0xe0))/0x2)+parseInt(_0x9239db(0xf6))/0x3*(parseInt(_0x9239db(0xdf))/0x4)+parseInt(_0x9239db(0xd6))/0x5+parseInt(_0x9239db(0xe1))/0x6+-parseInt(_0x9239db(0xe7))/0x7*(-parseInt(_0x9239db(0xee))/0x8)+parseInt(_0x9239db(0xd8))/0x9+-parseInt(_0x9239db(0xde))/0xa*(parseInt(_0x9239db(0xd9))/0xb);if(_0x113cca===_0x1e3f14)break;else _0xf95b92['push'](_0xf95b92['shift']());}catch(_0x361bd9){_0xf95b92['push'](_0xf95b92['shift']());}}}(a36_0x996d,0xa3a9b));import{authDefinitions}from'../commands/auth/index.js';function a36_0x996d(){const _0x20aa5f=['3690356hrPATc','4lSuEZl','963840bsTPqQ','Datasets','Service\x20Tree','read','map','Logs','38815jjSDZO','Artifacts','isSingleCommand','Personal\x20BFF','command','set','description','1640reMzll','BFF\x20Scripts','values','API\x20Documentation','389141JGMUtq','write','run','list','3QCWcLt','Knowledge\x20Base','push','Schema','Self\x20Update','Instant\x20API','defaultCommand','service','install','Workspace','Skills','CLI\x20Built-in\x20Skill','Configuration','\x20\x20[write]','login','4492205XKADlj','get','4421556RkJTnW','11dUloQZ','File','App\x20Management','OCR','\x20\x20[high-risk-write]','21610340BzucnO'];a36_0x996d=function(){return _0x20aa5f;};return a36_0x996d();}import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{scheduleDefinitions}from'../commands/schedule/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x13dac8){const _0x217dd1=a36_0x2b9c;for(const _0x1c9e86 of _0x13dac8){definitions['set'](_0x1c9e86['service']+':'+_0x1c9e86[_0x217dd1(0xeb)],_0x1c9e86);let _0x5c8981=serviceGroups[_0x217dd1(0xd7)](_0x1c9e86['service']);!_0x5c8981&&(_0x5c8981=[],serviceGroups[_0x217dd1(0xec)](_0x1c9e86[_0x217dd1(0xce)],_0x5c8981)),_0x5c8981[_0x217dd1(0xc9)](_0x1c9e86);}}function registerService(_0x218d9e,_0x2e8914,_0x191389){const _0x2b7d25=a36_0x2b9c;registerDefinitions(_0x2e8914);const _0x4003fc=_0x27b84f=>_0x27b84f===_0x2b7d25(0xe4)?'':_0x27b84f===_0x2b7d25(0xf3)?_0x2b7d25(0xd4):_0x2b7d25(0xdd),_0xc38106={'service':_0x2e8914[0x0][_0x2b7d25(0xce)],'label':_0x218d9e,'commands':_0x2e8914[_0x2b7d25(0xe5)](_0x544362=>({'command':_0x544362['command'],'description':_0x544362[_0x2b7d25(0xed)],'tag':_0x4003fc(_0x544362['risk'])})),'defaultCommand':_0x191389?.[_0x2b7d25(0xcd)]??(_0x191389?.[_0x2b7d25(0xe9)]?_0x2e8914[0x0]['command']:undefined),'isSingleCommand':_0x191389?.['isSingleCommand']};serviceRegistry[_0x2b7d25(0xc9)](_0xc38106),serviceByName[_0x2b7d25(0xec)](_0xc38106[_0x2b7d25(0xce)],_0xc38106);}registerService('Authentication',authDefinitions,{'defaultCommand':a36_0x2fb4d8(0xd5)}),registerService(a36_0x2fb4d8(0xdb),appDefinitions,{'defaultCommand':a36_0x2fb4d8(0xf5)}),registerService(a36_0x2fb4d8(0xd0),workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService(a36_0x2fb4d8(0xd3),configDefinitions,{'defaultCommand':'list'}),registerService(a36_0x2fb4d8(0xf1),apiDocDefinitions),registerService(a36_0x2fb4d8(0xe2),datasetDefinitions),registerService(a36_0x2fb4d8(0xcc),dataDefinitions),registerService('SQL\x20Queries',sqlDefinitions),registerService(a36_0x2fb4d8(0xef),bffDefinitions),registerService(a36_0x2fb4d8(0xea),personalBffDefinitions),registerService(a36_0x2fb4d8(0xe8),artifactDefinitions),registerService(a36_0x2fb4d8(0xda),fileDefinitions),registerService(a36_0x2fb4d8(0xdc),ocrDefinitions),registerService(a36_0x2fb4d8(0xc8),kbDefinitions),registerService('Agent\x20Schedules',scheduleDefinitions,{'defaultCommand':a36_0x2fb4d8(0xf5)}),registerService(a36_0x2fb4d8(0xe3),serviceDefinitions,{'defaultCommand':a36_0x2fb4d8(0xf5)}),registerService(a36_0x2fb4d8(0xd1),skillDefinitions,{'defaultCommand':a36_0x2fb4d8(0xcf)}),registerService(a36_0x2fb4d8(0xd2),cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x2fb4d8(0xcb),[updateDefinition],{'defaultCommand':a36_0x2fb4d8(0xf4),'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x2fb4d8(0xca),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x2fb4d8(0xe6),logsDefinitions,{'defaultCommand':'show'});export function findDefinition(_0xd33d2a,_0x508888){const _0x58e6df=a36_0x2fb4d8;return definitions[_0x58e6df(0xd7)](_0xd33d2a+':'+_0x508888);}export function isKnownService(_0x5a3635){return serviceByName['has'](_0x5a3635);}function a36_0x2b9c(_0x44bf85,_0x4e9557){_0x44bf85=_0x44bf85-0xc8;const _0x996de2=a36_0x996d();let _0x2b9c20=_0x996de2[_0x44bf85];return _0x2b9c20;}export function getServiceEntry(_0xe7e233){const _0x3da855=a36_0x2fb4d8;return serviceByName[_0x3da855(0xd7)](_0xe7e233);}export function getAllDefinitions(){const _0x3f33bc=a36_0x2fb4d8;return Array['from'](definitions[_0x3f33bc(0xf0)]());}
1
+ const a36_0x2bb1d0=a36_0x43ab;(function(_0x5afa06,_0xc7a377){const _0x5fc89c=a36_0x43ab,_0x3c57ed=_0x5afa06();while(!![]){try{const _0x578a8=-parseInt(_0x5fc89c(0xdf))/0x1*(parseInt(_0x5fc89c(0xcc))/0x2)+parseInt(_0x5fc89c(0xf1))/0x3*(-parseInt(_0x5fc89c(0xdd))/0x4)+-parseInt(_0x5fc89c(0xd1))/0x5*(parseInt(_0x5fc89c(0xca))/0x6)+parseInt(_0x5fc89c(0xe9))/0x7+-parseInt(_0x5fc89c(0xf4))/0x8+-parseInt(_0x5fc89c(0xf3))/0x9+-parseInt(_0x5fc89c(0xe0))/0xa*(-parseInt(_0x5fc89c(0xc7))/0xb);if(_0x578a8===_0xc7a377)break;else _0x3c57ed['push'](_0x3c57ed['shift']());}catch(_0x539998){_0x3c57ed['push'](_0x3c57ed['shift']());}}}(a36_0x5b30,0x2bb99));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';function a36_0x5b30(){const _0x25e459=['Logs','BFF\x20Scripts','549045LqOMaD','isSingleCommand','Configuration','defaultCommand','run','show','Schema','Service\x20Tree','945423JlkVTa','Runtime\x20App\x20Config','654471hstVfK','1095832oLyLXt','install','1488157EQMlDq','\x20\x20[high-risk-write]','has','1668726nxMYPx','App\x20Management','2xJPboV','Workspace','description','Datasets','SQL\x20Queries','5boIBHm','set','CLI\x20Built-in\x20Skill','Agent\x20Schedules','list','login','Personal\x20BFF','values','push','command','read','Instant\x20API','4Qpddcu','service','178674EbGABq','80jvFure','map','Self\x20Update','File','OCR','get','write'];a36_0x5b30=function(){return _0x25e459;};return a36_0x5b30();}import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{scheduleDefinitions}from'../commands/schedule/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x2a205b){const _0x1a25ec=a36_0x43ab;for(const _0x33cfa6 of _0x2a205b){definitions[_0x1a25ec(0xd2)](_0x33cfa6[_0x1a25ec(0xde)]+':'+_0x33cfa6[_0x1a25ec(0xda)],_0x33cfa6);let _0x5643e1=serviceGroups[_0x1a25ec(0xe5)](_0x33cfa6['service']);!_0x5643e1&&(_0x5643e1=[],serviceGroups['set'](_0x33cfa6['service'],_0x5643e1)),_0x5643e1[_0x1a25ec(0xd9)](_0x33cfa6);}}function registerService(_0x1be3be,_0x3f6e81,_0x3d2b69){const _0x3f7d35=a36_0x43ab;registerDefinitions(_0x3f6e81);const _0x431aae=_0x550d85=>_0x550d85===_0x3f7d35(0xdb)?'':_0x550d85===_0x3f7d35(0xe6)?'\x20\x20[write]':_0x3f7d35(0xc8),_0x365e39={'service':_0x3f6e81[0x0]['service'],'label':_0x1be3be,'commands':_0x3f6e81[_0x3f7d35(0xe1)](_0x4c867a=>({'command':_0x4c867a[_0x3f7d35(0xda)],'description':_0x4c867a[_0x3f7d35(0xce)],'tag':_0x431aae(_0x4c867a['risk'])})),'defaultCommand':_0x3d2b69?.[_0x3f7d35(0xec)]??(_0x3d2b69?.['isSingleCommand']?_0x3f6e81[0x0]['command']:undefined),'isSingleCommand':_0x3d2b69?.[_0x3f7d35(0xea)]};serviceRegistry[_0x3f7d35(0xd9)](_0x365e39),serviceByName[_0x3f7d35(0xd2)](_0x365e39[_0x3f7d35(0xde)],_0x365e39);}function a36_0x43ab(_0x1962c3,_0x5b0f7e){_0x1962c3=_0x1962c3-0xc7;const _0x5b30ab=a36_0x5b30();let _0x43ab32=_0x5b30ab[_0x1962c3];return _0x43ab32;}registerService('Authentication',authDefinitions,{'defaultCommand':a36_0x2bb1d0(0xd6)}),registerService(a36_0x2bb1d0(0xcb),appDefinitions,{'defaultCommand':a36_0x2bb1d0(0xd5)}),registerService(a36_0x2bb1d0(0xcd),workspaceDefinitions),registerService(a36_0x2bb1d0(0xf2),appConfigDefinitions),registerService(a36_0x2bb1d0(0xeb),configDefinitions,{'defaultCommand':'list'}),registerService('API\x20Documentation',apiDocDefinitions),registerService(a36_0x2bb1d0(0xcf),datasetDefinitions),registerService(a36_0x2bb1d0(0xdc),dataDefinitions),registerService(a36_0x2bb1d0(0xd0),sqlDefinitions),registerService(a36_0x2bb1d0(0xe8),bffDefinitions),registerService(a36_0x2bb1d0(0xd7),personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a36_0x2bb1d0(0xe3),fileDefinitions),registerService(a36_0x2bb1d0(0xe4),ocrDefinitions),registerService('Knowledge\x20Base',kbDefinitions),registerService(a36_0x2bb1d0(0xd4),scheduleDefinitions,{'defaultCommand':'list'}),registerService(a36_0x2bb1d0(0xf0),serviceDefinitions,{'defaultCommand':a36_0x2bb1d0(0xd5)}),registerService('Skills',skillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x2bb1d0(0xd3),cliSkillDefinitions,{'defaultCommand':a36_0x2bb1d0(0xf5)}),registerService(a36_0x2bb1d0(0xe2),[updateDefinition],{'defaultCommand':a36_0x2bb1d0(0xed),'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x2bb1d0(0xef),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x2bb1d0(0xe7),logsDefinitions,{'defaultCommand':a36_0x2bb1d0(0xee)});export function findDefinition(_0x36af5f,_0x269321){return definitions['get'](_0x36af5f+':'+_0x269321);}export function isKnownService(_0x2c065e){const _0x1f734b=a36_0x2bb1d0;return serviceByName[_0x1f734b(0xc9)](_0x2c065e);}export function getServiceEntry(_0x3ddfaf){const _0x43edb1=a36_0x2bb1d0;return serviceByName[_0x43edb1(0xe5)](_0x3ddfaf);}export function getAllDefinitions(){const _0x32bcde=a36_0x2bb1d0;return Array['from'](definitions[_0x32bcde(0xd8)]());}
@@ -1 +1 @@
1
- const a37_0x4c81bb=a37_0x4614;(function(_0x1fff8b,_0x167872){const _0x11474d=a37_0x4614,_0x51270e=_0x1fff8b();while(!![]){try{const _0x5d692b=-parseInt(_0x11474d(0x22a))/0x1*(parseInt(_0x11474d(0x1f7))/0x2)+parseInt(_0x11474d(0x1ec))/0x3*(-parseInt(_0x11474d(0x225))/0x4)+parseInt(_0x11474d(0x228))/0x5*(-parseInt(_0x11474d(0x214))/0x6)+-parseInt(_0x11474d(0x20a))/0x7*(-parseInt(_0x11474d(0x212))/0x8)+parseInt(_0x11474d(0x1ef))/0x9+parseInt(_0x11474d(0x216))/0xa*(-parseInt(_0x11474d(0x1f5))/0xb)+parseInt(_0x11474d(0x1f6))/0xc*(parseInt(_0x11474d(0x213))/0xd);if(_0x5d692b===_0x167872)break;else _0x51270e['push'](_0x51270e['shift']());}catch(_0x4e855b){_0x51270e['push'](_0x51270e['shift']());}}}(a37_0xfacf,0xb9f80));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':a37_0x4c81bb(0x1ee),'type':a37_0x4c81bb(0x1fd),'required':!![],'enum':[a37_0x4c81bb(0x201),a37_0x4c81bb(0x211)],'description':a37_0x4c81bb(0x221)},CRON_FLAG={'name':a37_0x4c81bb(0x207),'type':a37_0x4c81bb(0x1fd),'description':a37_0x4c81bb(0x230)},SCHEDULED_AT_FLAG={'name':a37_0x4c81bb(0x1f0),'type':a37_0x4c81bb(0x1fd),'description':a37_0x4c81bb(0x1f2)},TITLE_FLAG={'name':'title','type':a37_0x4c81bb(0x1fd),'required':!![],'description':a37_0x4c81bb(0x1ff)},PROMPT_FLAG={'name':a37_0x4c81bb(0x20b),'type':a37_0x4c81bb(0x1fd),'required':!![],'description':a37_0x4c81bb(0x209)},CHANNEL_FLAG={'name':a37_0x4c81bb(0x226),'type':'string','enum':['auto','premium'],'default':a37_0x4c81bb(0x204),'description':a37_0x4c81bb(0x232)},SCHEDULE_ID_FLAG={'name':a37_0x4c81bb(0x1f9),'type':'string','required':!![],'description':'Schedule\x20UUID','pattern':{'regex':SCHEDULE_ID_PATTERN,'description':'a\x20UUID\x20returned\x20by\x20schedule\x20create/list'}},LIMIT_FLAG={'name':'limit','type':a37_0x4c81bb(0x210),'default':0x14,'description':a37_0x4c81bb(0x227)},CURSOR_FLAG={'name':a37_0x4c81bb(0x236),'type':a37_0x4c81bb(0x1fd),'description':a37_0x4c81bb(0x234)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x3b09e6){const _0x231894=a37_0x4c81bb,_0x1542ef=_0x3b09e6['str']('kind'),_0x19f853=_0x3b09e6[_0x231894(0x208)](_0x231894(0x1f4))[_0x231894(0x1fc)](),_0x1d6a3c=_0x3b09e6[_0x231894(0x208)](_0x231894(0x20b))[_0x231894(0x1fc)](),_0x281fd4=_0x3b09e6['str'](_0x231894(0x226)),_0x3d12a0=_0x3b09e6[_0x231894(0x208)]('cron'),_0x218816=_0x3b09e6['str'](_0x231894(0x1f0));if(!_0x19f853)throw CliErrors[_0x231894(0x21b)]('--title\x20must\x20not\x20be\x20blank.');if(!_0x1d6a3c)throw CliErrors[_0x231894(0x21b)](_0x231894(0x1f8));if(_0x1542ef===_0x231894(0x201)){if(!_0x3d12a0||_0x218816)throw CliErrors[_0x231894(0x21b)](_0x231894(0x1fa));return{'kind':_0x1542ef,'timezone':_0x231894(0x22b),'cron':_0x3d12a0,'title':_0x19f853,'prompt':_0x1d6a3c,'channel':_0x281fd4};}if(_0x1542ef===_0x231894(0x211)){if(!_0x218816||_0x3d12a0)throw CliErrors['validation'](_0x231894(0x1f1));return{'kind':_0x1542ef,'timezone':_0x231894(0x22b),'scheduledAt':_0x218816,'title':_0x19f853,'prompt':_0x1d6a3c,'channel':_0x281fd4};}throw CliErrors[_0x231894(0x21b)]('--kind\x20must\x20be\x20CRON\x20or\x20ONCE.');}function a37_0xfacf(){const _0x5ae157=['Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','run','cursor','3037317tadYmp','Preview:\x20create\x20an\x20Agent\x20schedule','kind','5956038rTAIbU','scheduled-at','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','title','11wikUfZ','331932jfiNRg','2wtzyNj','--prompt\x20must\x20not\x20be\x20blank.','schedule-id','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','\x20schedule\x20','trim','string','detail','Schedule\x20title','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','CRON','\x20immediately','delete','premium','Create\x20a\x20recurring\x20or\x20one-time\x20Agent\x20schedule','create','cron','str','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','7jCSoFL','prompt','validate','Run\x20one\x20schedule\x20immediately\x20and\x20create\x20a\x20Task','scheduleId','taskId','number','ONCE','8616376UZsNxI','1183XVTpam','72qGjvdE','high-risk-write','15186580WhLOlc','appCode','/schedules','Preview:\x20run\x20schedule\x20','length','validation','isSafeInteger','DELETE','build','list','POST','Schedule\x20kind:\x20CRON\x20or\x20ONCE','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','\x20from\x20schedule\x20','4CGcirX','channel','Page\x20size\x20from\x201\x20to\x20100','385830vEwRDF','/api/harness/apps/','37163UkKEJe','UTC','/run','Deleted\x20schedule\x20','limit','Show\x20one\x20schedule\x20by\x20schedule\x20ID','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','description','Task\x20channel:\x20auto\x20or\x20premium','schedule'];a37_0xfacf=function(){return _0x5ae157;};return a37_0xfacf();}function scheduleCollectionPath(_0xaefb32){const _0x1dc915=a37_0x4c81bb;return _0x1dc915(0x229)+encodeURIComponent(_0xaefb32)+_0x1dc915(0x218);}function a37_0x4614(_0xba4e87,_0x171809){_0xba4e87=_0xba4e87-0x1ec;const _0xfacfa4=a37_0xfacf();let _0x461448=_0xfacfa4[_0xba4e87];return _0x461448;}function scheduleItemPath(_0x4cf839,_0x3481de){return scheduleCollectionPath(_0x4cf839)+'/'+encodeURIComponent(_0x3481de);}const scheduleValidate={'service':'schedule','command':a37_0x4c81bb(0x20c),'description':a37_0x4c81bb(0x223),'risk':'read','flags':INPUT_FLAGS,async 'validate'(_0x2ad933){readScheduleInput(_0x2ad933);},async 'execute'(_0xcdcdc4){const _0x5be2b0=a37_0x4c81bb,_0x464504=readScheduleInput(_0xcdcdc4),_0x4e78e2=await validateRuntimeSchedule(_0xcdcdc4[_0x5be2b0(0x217)],_0x464504);return{'ok':!![],'data':_0x4e78e2,'message':'Schedule\x20input\x20is\x20valid'};}},scheduleCreate={'service':a37_0x4c81bb(0x233),'command':a37_0x4c81bb(0x206),'description':a37_0x4c81bb(0x205),'risk':a37_0x4c81bb(0x215),'flags':INPUT_FLAGS,async 'validate'(_0x3096e5){readScheduleInput(_0x3096e5);},async 'execute'(_0x317001){const _0x1e6ab1=a37_0x4c81bb,_0x58c15d=readScheduleInput(_0x317001),_0x132e92=await validateRuntimeSchedule(_0x317001[_0x1e6ab1(0x217)],_0x58c15d),_0x4870e5=await createRuntimeSchedule(_0x317001[_0x1e6ab1(0x217)],_0x132e92);return{'ok':!![],'data':_0x4870e5,'message':'Created\x20'+_0x4870e5['kind']+_0x1e6ab1(0x1fb)+_0x4870e5[_0x1e6ab1(0x20e)]};},async 'dryRun'(_0x515c72){const _0x1dcfe1=a37_0x4c81bb,_0x1593a6=readScheduleInput(_0x515c72);return dryRun(_0x1dcfe1(0x220),scheduleCollectionPath(_0x515c72[_0x1dcfe1(0x217)]))['body'](_0x1593a6)[_0x1dcfe1(0x231)](_0x1dcfe1(0x1ed))['build']();}},scheduleList={'service':a37_0x4c81bb(0x233),'command':a37_0x4c81bb(0x21f),'description':a37_0x4c81bb(0x200),'risk':'read','flags':[LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x13b77d){const _0x3d8783=a37_0x4c81bb,_0x14b3b5=_0x13b77d['num'](_0x3d8783(0x22e));if(!Number[_0x3d8783(0x21c)](_0x14b3b5)||_0x14b3b5<0x1||_0x14b3b5>0x64)throw CliErrors[_0x3d8783(0x21b)](_0x3d8783(0x1f3));const _0x5e5b90=_0x13b77d[_0x3d8783(0x208)](_0x3d8783(0x236));if(_0x5e5b90&&(_0x5e5b90[_0x3d8783(0x21a)]>0x400||_0x5e5b90[_0x3d8783(0x1fc)]()!==_0x5e5b90))throw CliErrors[_0x3d8783(0x21b)](_0x3d8783(0x222));},async 'execute'(_0x440f6e){const _0x48cf66=a37_0x4c81bb,_0x50d05b=_0x440f6e['str']('cursor'),_0x165922=await listRuntimeSchedules(_0x440f6e['appCode'],{'limit':_0x440f6e['num'](_0x48cf66(0x22e)),..._0x50d05b?{'cursor':_0x50d05b}:{}});return{'ok':!![],'data':_0x165922};}},scheduleDetail={'service':a37_0x4c81bb(0x233),'command':a37_0x4c81bb(0x1fe),'description':a37_0x4c81bb(0x22f),'risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x2b1232){const _0x54fa0b=a37_0x4c81bb,_0x26c5d7=await getRuntimeSchedule(_0x2b1232[_0x54fa0b(0x217)],_0x2b1232[_0x54fa0b(0x208)]('schedule-id'));return{'ok':!![],'data':_0x26c5d7};}},scheduleRun={'service':a37_0x4c81bb(0x233),'command':a37_0x4c81bb(0x235),'description':a37_0x4c81bb(0x20d),'risk':'high-risk-write','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x295ad5){const _0x75fde3=a37_0x4c81bb,_0x49fa67=_0x295ad5[_0x75fde3(0x208)](_0x75fde3(0x1f9)),_0x2984c8=await runRuntimeSchedule(_0x295ad5[_0x75fde3(0x217)],_0x49fa67);return{'ok':!![],'data':_0x2984c8,'message':'Queued\x20Task\x20'+_0x2984c8[_0x75fde3(0x20f)]+_0x75fde3(0x224)+_0x49fa67};},async 'dryRun'(_0xa7189c){const _0x53c8a8=a37_0x4c81bb,_0x511d71=_0xa7189c[_0x53c8a8(0x208)](_0x53c8a8(0x1f9));return dryRun(_0x53c8a8(0x220),scheduleItemPath(_0xa7189c[_0x53c8a8(0x217)],_0x511d71)+_0x53c8a8(0x22c))[_0x53c8a8(0x231)](_0x53c8a8(0x219)+_0x511d71+_0x53c8a8(0x202))[_0x53c8a8(0x21e)]();}},scheduleDelete={'service':a37_0x4c81bb(0x233),'command':a37_0x4c81bb(0x203),'description':'Delete\x20a\x20schedule\x20and\x20stop\x20its\x20future\x20triggers','risk':a37_0x4c81bb(0x215),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x534fb4){const _0x12b4fc=a37_0x4c81bb,_0x549427=_0x534fb4[_0x12b4fc(0x208)](_0x12b4fc(0x1f9)),_0x62e50f=await deleteRuntimeSchedule(_0x534fb4[_0x12b4fc(0x217)],_0x549427);return{'ok':!![],'data':_0x62e50f,'message':_0x12b4fc(0x22d)+_0x549427};},async 'dryRun'(_0x442786){const _0x39b39f=a37_0x4c81bb,_0x280005=_0x442786['str'](_0x39b39f(0x1f9));return dryRun(_0x39b39f(0x21d),scheduleItemPath(_0x442786['appCode'],_0x280005))[_0x39b39f(0x231)]('Preview:\x20delete\x20schedule\x20'+_0x280005)[_0x39b39f(0x21e)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
1
+ const a37_0x5ce3ad=a37_0x2e4e;function a37_0x18aa(){const _0xabd91c=['Page\x20size\x20from\x201\x20to\x20100','appCode','Task\x20channel:\x20auto\x20or\x20premium','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','--title\x20must\x20not\x20be\x20blank.','1915116Umrquu','auto','high-risk-write','CRON','--prompt\x20must\x20not\x20be\x20blank.','validation','/schedules','653910MftZaM','schedule-id','list','36ZqCZum','Preview:\x20run\x20schedule\x20','number','\x20schedule\x20','delete','4692072mNpsPc','/run','description','read','taskId','prompt','466148CNPJeb','\x20immediately','Schedule\x20UUID','build','31659ewUWyN','Preview:\x20create\x20an\x20Agent\x20schedule','DELETE','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','string','Run\x20one\x20schedule\x20immediately\x20and\x20create\x20a\x20Task','UTC','premium','scheduleId','trim','kind','cursor','POST','num','scheduled-at','Show\x20one\x20schedule\x20by\x20schedule\x20ID','schedule','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','Schedule\x20kind:\x20CRON\x20or\x20ONCE','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','Queued\x20Task\x20','\x20from\x20schedule\x20','channel','body','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','ONCE','limit','/api/harness/apps/','cron','create','Created\x20','validate','385842CrtIAs','Preview:\x20delete\x20schedule\x20','Deleted\x20schedule\x20','str','title','detail','run','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','153818nrQDog'];a37_0x18aa=function(){return _0xabd91c;};return a37_0x18aa();}(function(_0xdcb306,_0x24fb78){const _0x29f2a7=a37_0x2e4e,_0xc72902=_0xdcb306();while(!![]){try{const _0x3c290a=parseInt(_0x29f2a7(0x1e8))/0x1+parseInt(_0x29f2a7(0x1bb))/0x2+-parseInt(_0x29f2a7(0x1bf))/0x3*(parseInt(_0x29f2a7(0x1b0))/0x4)+parseInt(_0x29f2a7(0x1f5))/0x5+parseInt(_0x29f2a7(0x1e0))/0x6+parseInt(_0x29f2a7(0x1ee))/0x7+-parseInt(_0x29f2a7(0x1b5))/0x8;if(_0x3c290a===_0x24fb78)break;else _0xc72902['push'](_0xc72902['shift']());}catch(_0x1cbd4d){_0xc72902['push'](_0xc72902['shift']());}}}(a37_0x18aa,0x2a803));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a37_0x2e4e(_0x2f7c13,_0x52aed9){_0x2f7c13=_0x2f7c13-0x1af;const _0x18aa66=a37_0x18aa();let _0x2e4e24=_0x18aa66[_0x2f7c13];return _0x2e4e24;}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':a37_0x5ce3ad(0x1c9),'type':a37_0x5ce3ad(0x1c3),'required':!![],'enum':['CRON',a37_0x5ce3ad(0x1d9)],'description':a37_0x5ce3ad(0x1d2)},CRON_FLAG={'name':a37_0x5ce3ad(0x1dc),'type':'string','description':'Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules'},SCHEDULED_AT_FLAG={'name':a37_0x5ce3ad(0x1cd),'type':a37_0x5ce3ad(0x1c3),'description':'Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules'},TITLE_FLAG={'name':a37_0x5ce3ad(0x1e4),'type':a37_0x5ce3ad(0x1c3),'required':!![],'description':'Schedule\x20title'},PROMPT_FLAG={'name':a37_0x5ce3ad(0x1ba),'type':a37_0x5ce3ad(0x1c3),'required':!![],'description':a37_0x5ce3ad(0x1d0)},CHANNEL_FLAG={'name':a37_0x5ce3ad(0x1d6),'type':'string','enum':[a37_0x5ce3ad(0x1ef),a37_0x5ce3ad(0x1c6)],'default':a37_0x5ce3ad(0x1c6),'description':a37_0x5ce3ad(0x1eb)},SCHEDULE_ID_FLAG={'name':'schedule-id','type':a37_0x5ce3ad(0x1c3),'required':!![],'description':a37_0x5ce3ad(0x1bd),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a37_0x5ce3ad(0x1d8)}},LIMIT_FLAG={'name':a37_0x5ce3ad(0x1da),'type':a37_0x5ce3ad(0x1b2),'default':0x14,'description':a37_0x5ce3ad(0x1e9)},CURSOR_FLAG={'name':a37_0x5ce3ad(0x1ca),'type':'string','description':a37_0x5ce3ad(0x1d3)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x2dd5d8){const _0xbc904c=a37_0x5ce3ad,_0x2d5db3=_0x2dd5d8[_0xbc904c(0x1e3)](_0xbc904c(0x1c9)),_0x30eac2=_0x2dd5d8[_0xbc904c(0x1e3)]('title')['trim'](),_0x3c46d3=_0x2dd5d8[_0xbc904c(0x1e3)](_0xbc904c(0x1ba))[_0xbc904c(0x1c8)](),_0x1dd40f=_0x2dd5d8[_0xbc904c(0x1e3)](_0xbc904c(0x1d6)),_0x518593=_0x2dd5d8['str']('cron'),_0x201b6e=_0x2dd5d8['str'](_0xbc904c(0x1cd));if(!_0x30eac2)throw CliErrors['validation'](_0xbc904c(0x1ed));if(!_0x3c46d3)throw CliErrors[_0xbc904c(0x1f3)](_0xbc904c(0x1f2));if(_0x2d5db3===_0xbc904c(0x1f1)){if(!_0x518593||_0x201b6e)throw CliErrors['validation'](_0xbc904c(0x1c2));return{'kind':_0x2d5db3,'timezone':_0xbc904c(0x1c5),'cron':_0x518593,'title':_0x30eac2,'prompt':_0x3c46d3,'channel':_0x1dd40f};}if(_0x2d5db3==='ONCE'){if(!_0x201b6e||_0x518593)throw CliErrors[_0xbc904c(0x1f3)](_0xbc904c(0x1e7));return{'kind':_0x2d5db3,'timezone':_0xbc904c(0x1c5),'scheduledAt':_0x201b6e,'title':_0x30eac2,'prompt':_0x3c46d3,'channel':_0x1dd40f};}throw CliErrors[_0xbc904c(0x1f3)]('--kind\x20must\x20be\x20CRON\x20or\x20ONCE.');}function scheduleCollectionPath(_0x106443){const _0x30db56=a37_0x5ce3ad;return _0x30db56(0x1db)+encodeURIComponent(_0x106443)+_0x30db56(0x1f4);}function scheduleItemPath(_0x9a8971,_0x35117d){return scheduleCollectionPath(_0x9a8971)+'/'+encodeURIComponent(_0x35117d);}const scheduleValidate={'service':a37_0x5ce3ad(0x1cf),'command':a37_0x5ce3ad(0x1df),'description':a37_0x5ce3ad(0x1ec),'risk':'read','flags':INPUT_FLAGS,async 'validate'(_0x16f270){readScheduleInput(_0x16f270);},async 'execute'(_0x593fc){const _0xabd687=a37_0x5ce3ad,_0x1b5808=readScheduleInput(_0x593fc),_0x334945=await validateRuntimeSchedule(_0x593fc[_0xabd687(0x1ea)],_0x1b5808);return{'ok':!![],'data':_0x334945,'message':'Schedule\x20input\x20is\x20valid'};}},scheduleCreate={'service':a37_0x5ce3ad(0x1cf),'command':a37_0x5ce3ad(0x1dd),'description':'Create\x20a\x20recurring\x20or\x20one-time\x20Agent\x20schedule','risk':a37_0x5ce3ad(0x1f0),'flags':INPUT_FLAGS,async 'validate'(_0x5275e6){readScheduleInput(_0x5275e6);},async 'execute'(_0x1bc557){const _0x1618e0=a37_0x5ce3ad,_0xf94ff3=readScheduleInput(_0x1bc557),_0x43364b=await validateRuntimeSchedule(_0x1bc557['appCode'],_0xf94ff3),_0x488a11=await createRuntimeSchedule(_0x1bc557[_0x1618e0(0x1ea)],_0x43364b);return{'ok':!![],'data':_0x488a11,'message':_0x1618e0(0x1de)+_0x488a11[_0x1618e0(0x1c9)]+_0x1618e0(0x1b3)+_0x488a11[_0x1618e0(0x1c7)]};},async 'dryRun'(_0x49bbc8){const _0x21af73=a37_0x5ce3ad,_0x22922f=readScheduleInput(_0x49bbc8);return dryRun(_0x21af73(0x1cb),scheduleCollectionPath(_0x49bbc8['appCode']))[_0x21af73(0x1d7)](_0x22922f)[_0x21af73(0x1b7)](_0x21af73(0x1c0))['build']();}},scheduleList={'service':a37_0x5ce3ad(0x1cf),'command':a37_0x5ce3ad(0x1af),'description':'List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','risk':a37_0x5ce3ad(0x1b8),'flags':[LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x548adf){const _0x25bc05=a37_0x5ce3ad,_0x2313c4=_0x548adf[_0x25bc05(0x1cc)](_0x25bc05(0x1da));if(!Number['isSafeInteger'](_0x2313c4)||_0x2313c4<0x1||_0x2313c4>0x64)throw CliErrors[_0x25bc05(0x1f3)](_0x25bc05(0x1d1));const _0x50a1c1=_0x548adf[_0x25bc05(0x1e3)]('cursor');if(_0x50a1c1&&(_0x50a1c1['length']>0x400||_0x50a1c1['trim']()!==_0x50a1c1))throw CliErrors[_0x25bc05(0x1f3)]('--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.');},async 'execute'(_0x46e499){const _0x3ca18c=a37_0x5ce3ad,_0x29f10a=_0x46e499[_0x3ca18c(0x1e3)](_0x3ca18c(0x1ca)),_0x2845c5=await listRuntimeSchedules(_0x46e499['appCode'],{'limit':_0x46e499[_0x3ca18c(0x1cc)](_0x3ca18c(0x1da)),..._0x29f10a?{'cursor':_0x29f10a}:{}});return{'ok':!![],'data':_0x2845c5};}},scheduleDetail={'service':a37_0x5ce3ad(0x1cf),'command':a37_0x5ce3ad(0x1e5),'description':a37_0x5ce3ad(0x1ce),'risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0xcf9466){const _0x423f55=a37_0x5ce3ad,_0x3a146c=await getRuntimeSchedule(_0xcf9466['appCode'],_0xcf9466[_0x423f55(0x1e3)]('schedule-id'));return{'ok':!![],'data':_0x3a146c};}},scheduleRun={'service':a37_0x5ce3ad(0x1cf),'command':a37_0x5ce3ad(0x1e6),'description':a37_0x5ce3ad(0x1c4),'risk':a37_0x5ce3ad(0x1f0),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x4f4339){const _0x1acde1=a37_0x5ce3ad,_0x2b9271=_0x4f4339[_0x1acde1(0x1e3)](_0x1acde1(0x1f6)),_0x447975=await runRuntimeSchedule(_0x4f4339[_0x1acde1(0x1ea)],_0x2b9271);return{'ok':!![],'data':_0x447975,'message':_0x1acde1(0x1d4)+_0x447975[_0x1acde1(0x1b9)]+_0x1acde1(0x1d5)+_0x2b9271};},async 'dryRun'(_0x142fea){const _0x5c444e=a37_0x5ce3ad,_0x26eb29=_0x142fea['str']('schedule-id');return dryRun(_0x5c444e(0x1cb),scheduleItemPath(_0x142fea['appCode'],_0x26eb29)+_0x5c444e(0x1b6))['description'](_0x5c444e(0x1b1)+_0x26eb29+_0x5c444e(0x1bc))[_0x5c444e(0x1be)]();}},scheduleDelete={'service':a37_0x5ce3ad(0x1cf),'command':a37_0x5ce3ad(0x1b4),'description':'Delete\x20a\x20schedule\x20and\x20stop\x20its\x20future\x20triggers','risk':a37_0x5ce3ad(0x1f0),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x324e7c){const _0x52715f=a37_0x5ce3ad,_0x5d3be8=_0x324e7c[_0x52715f(0x1e3)]('schedule-id'),_0xc8b90a=await deleteRuntimeSchedule(_0x324e7c[_0x52715f(0x1ea)],_0x5d3be8);return{'ok':!![],'data':_0xc8b90a,'message':_0x52715f(0x1e2)+_0x5d3be8};},async 'dryRun'(_0x497cc3){const _0x4d4d27=a37_0x5ce3ad,_0x4799f3=_0x497cc3['str']('schedule-id');return dryRun(_0x4d4d27(0x1c1),scheduleItemPath(_0x497cc3[_0x4d4d27(0x1ea)],_0x4799f3))[_0x4d4d27(0x1b7)](_0x4d4d27(0x1e1)+_0x4799f3)[_0x4d4d27(0x1be)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
@@ -1 +1 @@
1
- const a38_0x2c4f4c=a38_0x50a8;function a38_0x5454(){const _0x2966e8=['4081176GGwvoz','247511dmSnpL','1398510GaHVza','5BMitdx','48vNgkvj','4794180xJBAlg','3142338yqKfiD','202584ZbYfHz','schema','140PCTsHb','export','63203LJzZBL','24QEhjmt'];a38_0x5454=function(){return _0x2966e8;};return a38_0x5454();}(function(_0x188f61,_0xaef451){const _0x571186=a38_0x50a8,_0x59f33b=_0x188f61();while(!![]){try{const _0x3d3858=parseInt(_0x571186(0x102))/0x1+-parseInt(_0x571186(0xfa))/0x2*(-parseInt(_0x571186(0xff))/0x3)+-parseInt(_0x571186(0x105))/0x4+-parseInt(_0x571186(0x103))/0x5*(-parseInt(_0x571186(0x106))/0x6)+-parseInt(_0x571186(0xfe))/0x7*(parseInt(_0x571186(0x104))/0x8)+-parseInt(_0x571186(0x100))/0x9+-parseInt(_0x571186(0xfc))/0xa*(parseInt(_0x571186(0x101))/0xb);if(_0x3d3858===_0xaef451)break;else _0x59f33b['push'](_0x59f33b['shift']());}catch(_0x59770e){_0x59f33b['push'](_0x59f33b['shift']());}}}(a38_0x5454,0xadacc));import{buildSchemaPayload}from'../framework/schema-export.js';function a38_0x50a8(_0x1fa786,_0x376348){_0x1fa786=_0x1fa786-0xfa;const _0x5454bf=a38_0x5454();let _0x50a80c=_0x5454bf[_0x1fa786];return _0x50a80c;}async function execute(_0x50f8d2){const _0x5296d8=await buildSchemaPayload();return{'ok':!![],'data':_0x5296d8};}export const schemaDefinition={'service':a38_0x2c4f4c(0xfb),'command':a38_0x2c4f4c(0xfd),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
1
+ const a38_0x52f19b=a38_0x3ce5;(function(_0x42972f,_0x211f00){const _0x343f37=a38_0x3ce5,_0x4b7eff=_0x42972f();while(!![]){try{const _0x341cb5=parseInt(_0x343f37(0x1c6))/0x1+parseInt(_0x343f37(0x1cd))/0x2*(-parseInt(_0x343f37(0x1ca))/0x3)+parseInt(_0x343f37(0x1d2))/0x4*(parseInt(_0x343f37(0x1d0))/0x5)+-parseInt(_0x343f37(0x1d1))/0x6*(-parseInt(_0x343f37(0x1c4))/0x7)+parseInt(_0x343f37(0x1cb))/0x8+-parseInt(_0x343f37(0x1c8))/0x9+-parseInt(_0x343f37(0x1cf))/0xa*(-parseInt(_0x343f37(0x1c5))/0xb);if(_0x341cb5===_0x211f00)break;else _0x4b7eff['push'](_0x4b7eff['shift']());}catch(_0x57bda9){_0x4b7eff['push'](_0x4b7eff['shift']());}}}(a38_0x4bc8,0xc065e));import{buildSchemaPayload}from'../framework/schema-export.js';function a38_0x4bc8(){const _0x56e8cd=['4vhJrRl','7xVBVwj','2900568yGEopD','789219IKFGYA','schema','10887147YAUbrn','export','3813tNjQia','8983648tneMsZ','read','1462FzqTaI','Export\x20machine-readable\x20command\x20schema\x20(JSON)','10YKTbzw','3171710NGSDRW','699846Owefuv'];a38_0x4bc8=function(){return _0x56e8cd;};return a38_0x4bc8();}async function execute(_0x1686cc){const _0x31101f=await buildSchemaPayload();return{'ok':!![],'data':_0x31101f};}function a38_0x3ce5(_0xd54c33,_0x46ee31){_0xd54c33=_0xd54c33-0x1c4;const _0x4bc8e2=a38_0x4bc8();let _0x3ce571=_0x4bc8e2[_0xd54c33];return _0x3ce571;}export const schemaDefinition={'service':a38_0x52f19b(0x1c7),'command':a38_0x52f19b(0x1c9),'description':a38_0x52f19b(0x1ce),'risk':a38_0x52f19b(0x1cc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};