@lovrabet/lovrabet-cli 2.2.1 → 2.2.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/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/shared.js +1 -1
  25. package/lib/commands/data/index.js +1 -1
  26. package/lib/commands/dataset/detail.js +1 -1
  27. package/lib/commands/dataset/index.js +1 -1
  28. package/lib/commands/dataset/list.js +1 -1
  29. package/lib/commands/dataset/sdk-doc.js +1 -1
  30. package/lib/commands/doctor.js +1 -1
  31. package/lib/commands/file/index.js +1 -1
  32. package/lib/commands/init.js +1 -1
  33. package/lib/commands/kb/index.js +1 -1
  34. package/lib/commands/logs/index.js +1 -1
  35. package/lib/commands/ocr/index.js +1 -1
  36. package/lib/commands/personal-bff/index.js +1 -1
  37. package/lib/commands/registry.js +1 -1
  38. package/lib/commands/schedule/index.js +1 -1
  39. package/lib/commands/schema.js +1 -1
  40. package/lib/commands/service/dynamic.js +1 -1
  41. package/lib/commands/service/function-name-adapter.js +1 -1
  42. package/lib/commands/service/index.js +1 -1
  43. package/lib/commands/service/registry.js +1 -1
  44. package/lib/commands/skill/commands/create.js +1 -1
  45. package/lib/commands/skill/commands/diagram.js +1 -1
  46. package/lib/commands/skill/commands/install.js +1 -1
  47. package/lib/commands/skill/commands/list.js +1 -1
  48. package/lib/commands/skill/commands/push.js +1 -1
  49. package/lib/commands/skill/commands/validate.js +1 -1
  50. package/lib/commands/skill/diagram.js +1 -1
  51. package/lib/commands/skill/flags.js +1 -1
  52. package/lib/commands/skill/index.js +1 -1
  53. package/lib/commands/skill/manifest-helpers.js +1 -1
  54. package/lib/commands/skill/push-execute.js +1 -1
  55. package/lib/commands/skill/push-flow-helpers.js +1 -1
  56. package/lib/commands/skill/push-retarget.js +1 -1
  57. package/lib/commands/skill/scopes.js +1 -1
  58. package/lib/commands/skill/summary.js +1 -1
  59. package/lib/commands/skill/templates.js +1 -1
  60. package/lib/commands/skill/validate.js +1 -1
  61. package/lib/commands/sql/detail.js +1 -1
  62. package/lib/commands/sql/exec.js +1 -1
  63. package/lib/commands/sql/index.js +1 -1
  64. package/lib/commands/update.js +1 -1
  65. package/lib/commands/workspace/index.js +1 -1
  66. package/lib/config/schema.js +1 -1
  67. package/lib/constant/app.js +1 -1
  68. package/lib/constant/auth-mode.js +1 -1
  69. package/lib/constant/cli.js +1 -1
  70. package/lib/constant/defaults.js +1 -1
  71. package/lib/constant/distribution.js +1 -1
  72. package/lib/constant/domain.js +1 -1
  73. package/lib/constant/env.js +1 -1
  74. package/lib/constant/output.js +1 -1
  75. package/lib/constant/product.js +1 -1
  76. package/lib/constant/risk.js +1 -1
  77. package/lib/constant/url.js +1 -1
  78. package/lib/context.js +1 -1
  79. package/lib/core/api-client.js +1 -1
  80. package/lib/core/db-resolver.js +1 -1
  81. package/lib/core/sdk-client.js +1 -1
  82. package/lib/errors.js +1 -1
  83. package/lib/framework/build-all-flags.js +1 -1
  84. package/lib/framework/dryrun.js +1 -1
  85. package/lib/framework/flags.js +1 -1
  86. package/lib/framework/help.js +1 -1
  87. package/lib/framework/index.js +1 -1
  88. package/lib/framework/output.js +1 -1
  89. package/lib/framework/preparse.js +1 -1
  90. package/lib/framework/rate-limit.js +1 -1
  91. package/lib/framework/raw-flags.js +1 -1
  92. package/lib/framework/response.js +1 -1
  93. package/lib/framework/runner-confirmation.js +1 -1
  94. package/lib/framework/runner-error.js +1 -1
  95. package/lib/framework/runner.js +1 -1
  96. package/lib/framework/schema-export.js +1 -1
  97. package/lib/framework/service-order.js +1 -1
  98. package/lib/framework/types.js +1 -1
  99. package/lib/generated/build-info.d.ts +4 -4
  100. package/lib/generated/build-info.js +1 -1
  101. package/lib/help.js +1 -1
  102. package/lib/postinstall.js +1 -1
  103. package/lib/runtime/confirmation.js +1 -1
  104. package/lib/runtime/event.js +1 -1
  105. package/lib/runtime/index.js +1 -1
  106. package/lib/runtime/queue.js +1 -1
  107. package/lib/runtime/resolve.js +1 -1
  108. package/lib/skills/builtin-skill.js +1 -1
  109. package/lib/skills/npx-skills-add.js +1 -1
  110. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  111. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  112. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  113. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  114. package/lib/skills/runtime-skill-sync/links.js +1 -1
  115. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  116. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  117. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  118. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  119. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  120. package/lib/skills/runtime-skill-sync/push.js +1 -1
  121. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  122. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  123. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  124. package/lib/skills/runtime-skill-sync.js +1 -1
  125. package/lib/skills/skill-presence.js +1 -1
  126. package/lib/utils/apply-jq-filter.js +1 -1
  127. package/lib/utils/logger.js +1 -1
  128. package/lib/utils/lossless-json.js +1 -1
  129. package/lib/utils/params.js +1 -1
  130. package/lib/utils/platform.js +1 -1
  131. package/lib/utils/update-notice.js +1 -1
  132. package/lib/utils/version.js +1 -1
  133. package/lib/utils/write-cli-side-channel.js +1 -1
  134. package/package.json +2 -1
  135. package/skills/lovrabet/SKILL.md +1 -1
  136. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- function a28_0x2ffc(){const _0x24fcf8=['5922QqEdCf','122661aPWCoD','8CLFhRi','3027031dLkpaV','code','dataset','str','325854DYmhsk','238490QQSvEJ','3yCkCTW','626440mFdDsz','appCode','628155Vjvoty','sdk-doc','88KierZU','20PJxYhK'];a28_0x2ffc=function(){return _0x24fcf8;};return a28_0x2ffc();}const a28_0x1ee5db=a28_0x4323;(function(_0x1e847c,_0x293e76){const _0x26b0fa=a28_0x4323,_0x4192ba=_0x1e847c();while(!![]){try{const _0x3ab586=parseInt(_0x26b0fa(0x168))/0x1+-parseInt(_0x26b0fa(0x163))/0x2*(parseInt(_0x26b0fa(0x165))/0x3)+parseInt(_0x26b0fa(0x166))/0x4*(-parseInt(_0x26b0fa(0x16b))/0x5)+-parseInt(_0x26b0fa(0x15c))/0x6+-parseInt(_0x26b0fa(0x15f))/0x7*(-parseInt(_0x26b0fa(0x15e))/0x8)+-parseInt(_0x26b0fa(0x15d))/0x9+-parseInt(_0x26b0fa(0x164))/0xa*(-parseInt(_0x26b0fa(0x16a))/0xb);if(_0x3ab586===_0x293e76)break;else _0x4192ba['push'](_0x4192ba['shift']());}catch(_0x25cabf){_0x4192ba['push'](_0x4192ba['shift']());}}}(a28_0x2ffc,0x6d3a5));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN='#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档';function a28_0x4323(_0x2556d4,_0x53f505){_0x2556d4=_0x2556d4-0x15c;const _0x2ffc46=a28_0x2ffc();let _0x432335=_0x2ffc46[_0x2556d4];return _0x432335;}export function formatDatasetSdkMarkdown(_0x32e7d6){const _0x282bdf=typeof _0x32e7d6==='string'?_0x32e7d6['trim']():'';return _0x282bdf||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a28_0x1ee5db(0x161),'command':a28_0x1ee5db(0x169),'description':'Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','risk':'read','flags':[{...CODE_FLAG,'description':'Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.'}],async 'execute'(_0x50ab19){const _0x5213d4=a28_0x1ee5db,_0x53a7e6=_0x50ab19[_0x5213d4(0x162)](_0x5213d4(0x160)),_0x1dd671=await getDatasetSdkUsageDoc(_0x53a7e6,_0x50ab19['appCode']);return{'ok':!![],'data':{'code':_0x53a7e6,'appCode':_0x50ab19[_0x5213d4(0x167)],'markdown':formatDatasetSdkMarkdown(_0x1dd671)}};}};
1
+ const a28_0x8073cb=a28_0x2f21;(function(_0x4450ee,_0x40342d){const _0x5d9184=a28_0x2f21,_0x22fdc8=_0x4450ee();while(!![]){try{const _0x641be8=-parseInt(_0x5d9184(0x1a4))/0x1*(parseInt(_0x5d9184(0x1a3))/0x2)+-parseInt(_0x5d9184(0x19d))/0x3*(-parseInt(_0x5d9184(0x198))/0x4)+parseInt(_0x5d9184(0x19b))/0x5*(parseInt(_0x5d9184(0x1a5))/0x6)+-parseInt(_0x5d9184(0x1a8))/0x7*(parseInt(_0x5d9184(0x19a))/0x8)+-parseInt(_0x5d9184(0x19c))/0x9*(parseInt(_0x5d9184(0x199))/0xa)+-parseInt(_0x5d9184(0x1ab))/0xb*(-parseInt(_0x5d9184(0x196))/0xc)+parseInt(_0x5d9184(0x1aa))/0xd*(-parseInt(_0x5d9184(0x1a0))/0xe);if(_0x641be8===_0x40342d)break;else _0x22fdc8['push'](_0x22fdc8['shift']());}catch(_0xf4c45){_0x22fdc8['push'](_0x22fdc8['shift']());}}}(a28_0x1fc4,0xadf26));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';function a28_0x1fc4(){const _0x5633f2=['1289262apGTOG','str','trim','9198910MpkZYw','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','455pTCueF','11FYszUR','12151248ehLRDH','code','403412rlravY','7437950NMwvzs','8aQBOXS','25CmHRps','9lItraM','39pXmOdu','string','appCode','41258iMhHCt','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','dataset','2rSSsbA','524522yMDHhR'];a28_0x1fc4=function(){return _0x5633f2;};return a28_0x1fc4();}import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a28_0x8073cb(0x1a1);function a28_0x2f21(_0x46c53e,_0x5ebe2b){_0x46c53e=_0x46c53e-0x196;const _0x1fc4f3=a28_0x1fc4();let _0x2f21d2=_0x1fc4f3[_0x46c53e];return _0x2f21d2;}export function formatDatasetSdkMarkdown(_0xaddcc9){const _0x446072=a28_0x8073cb,_0x33c93e=typeof _0xaddcc9===_0x446072(0x19e)?_0xaddcc9[_0x446072(0x1a7)]():'';return _0x33c93e||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a28_0x8073cb(0x1a2),'command':'sdk-doc','description':'Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','risk':'read','flags':[{...CODE_FLAG,'description':a28_0x8073cb(0x1a9)}],async 'execute'(_0x1e2a7a){const _0x588e0d=a28_0x8073cb,_0x564b54=_0x1e2a7a[_0x588e0d(0x1a6)](_0x588e0d(0x197)),_0x323aa8=await getDatasetSdkUsageDoc(_0x564b54,_0x1e2a7a[_0x588e0d(0x19f)]);return{'ok':!![],'data':{'code':_0x564b54,'appCode':_0x1e2a7a['appCode'],'markdown':formatDatasetSdkMarkdown(_0x323aa8)}};}};
@@ -1 +1 @@
1
- function a29_0x18a7(){const _0x296add=['repairCommand','commandCount','\x20(legacy/compat\x20only)','padEnd','516566ptmJWY','(none)','log','red','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','ClientAk','serviceCount','1729101ffNFRX','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20─','4868370PjQyZl','\x20\x20Repair:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','gray','arch','(set,\x20length=','⚠\x20Empty\x20(treated\x20as\x20{})','\x20\x20Merged\x20Config','\x20\x20Config\x20Files','(no\x20file)','accessKey','packageVersion','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','11dTqeze','currentApp','state','Project','check','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','source','current','⚠\x20Empty','read','\x20\x20API\x20Endpoints','pageSize','\x20(accessKey)','2iDNwNH','empty','790OkaxUH','✗\x20Invalid','(default:\x20','✗\x20Invalid\x20JSON','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','repeat','Diagnose\x20CLI\x20configuration\x20and\x20environment','3913931AVskIx','8LUOLQj','path','missing','\x20doctor','status','message','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','appCode','\x20\x20Built-in\x20Skill','3076UlJdfv','\x20commands)','6CVCJJU','✓\x20Loaded','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20JSON','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20Service\x20Tree','name','doctor','yellow','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20set)','(missing)','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Global','bold','installedPath','locale','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','green','(default)','reason','(not\x20found)','\x20\x20Auth','4488003TBToHP','env','(unnamed)','684912CdUEkH','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','registryPath','\x20Imported\x20from:\x20','format','\x20\x20runtimeDomain:\x20\x20\x20','skillVersion'];a29_0x18a7=function(){return _0x296add;};return a29_0x18a7();}const a29_0xdd2a81=a29_0x1aee;(function(_0x12b119,_0x1fd7ca){const _0x56a463=a29_0x1aee,_0x1389b2=_0x12b119();while(!![]){try{const _0x333b39=parseInt(_0x56a463(0x11b))/0x1*(-parseInt(_0x56a463(0x141))/0x2)+parseInt(_0x56a463(0x122))/0x3+parseInt(_0x56a463(0x155))/0x4*(-parseInt(_0x56a463(0x143))/0x5)+parseInt(_0x56a463(0x157))/0x6*(-parseInt(_0x56a463(0x14b))/0x7)+-parseInt(_0x56a463(0x14c))/0x8*(-parseInt(_0x56a463(0x10d))/0x9)+parseInt(_0x56a463(0x126))/0xa+parseInt(_0x56a463(0x134))/0xb*(-parseInt(_0x56a463(0x110))/0xc);if(_0x333b39===_0x1fd7ca)break;else _0x1389b2['push'](_0x1389b2['shift']());}catch(_0x3cde8e){_0x1389b2['push'](_0x1389b2['shift']());}}}(a29_0x18a7,0x4b18a));import a29_0x4da7c0 from'chalk';function a29_0x1aee(_0x9a1dfa,_0x1358cb){_0x9a1dfa=_0x9a1dfa-0xf5;const _0x18a7d2=a29_0x18a7();let _0x1aee96=_0x18a7d2[_0x9a1dfa];return _0x1aee96;}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';import{inspectBuiltinSkill}from'../skills/builtin-skill.js';async function execute(_0x19fef2){const _0x13c366=a29_0x1aee,_0x2964e6=getCliVersion(),_0x5a6578=buildConfigFromFlags({});await initGlobalEnvironment(_0x5a6578),console['log'](),console[_0x13c366(0x11d)](a29_0x4da7c0['bold'](CLI_BIN_NAME+_0x13c366(0x14f))),console[_0x13c366(0x11d)](a29_0x4da7c0['gray']('─'[_0x13c366(0x149)](0x32))),console[_0x13c366(0x11d)](_0x13c366(0x139)+_0x2964e6),console[_0x13c366(0x11d)](_0x13c366(0x123)+process['version']),console['log'](_0x13c366(0xfd)+process['platform']+'\x20'+process[_0x13c366(0x129)]);const _0xdc55e8=inspectBuiltinSkill();console[_0x13c366(0x11d)](),console['log'](a29_0x4da7c0[_0x13c366(0x103)](_0x13c366(0x154))),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x128)]('\x20\x20─'[_0x13c366(0x149)](0x1e))),console[_0x13c366(0x11d)]('\x20\x20State:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0xdc55e8[_0x13c366(0x136)]==='current'?a29_0x4da7c0[_0x13c366(0x108)]('✓\x20current'):a29_0x4da7c0['red']('✗\x20'+_0xdc55e8[_0x13c366(0x136)]))),console['log']('\x20\x20Package\x20Version:\x20'+_0xdc55e8[_0x13c366(0x130)]),console[_0x13c366(0x11d)]('\x20\x20Skill\x20Version:\x20\x20\x20'+(_0xdc55e8[_0x13c366(0x116)]||a29_0x4da7c0[_0x13c366(0x128)]('(missing)'))),console[_0x13c366(0x11d)]('\x20\x20Installed\x20Path:\x20\x20'+(_0xdc55e8[_0x13c366(0x104)]||a29_0x4da7c0[_0x13c366(0x128)]('(not\x20found)')));_0xdc55e8[_0x13c366(0x136)]!==_0x13c366(0x13b)&&console['log'](_0x13c366(0x127)+_0xdc55e8[_0x13c366(0x117)]);_0xdc55e8[_0x13c366(0x10a)]&&console['log']('\x20\x20Reason:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0xdc55e8[_0x13c366(0x10a)]);console['log'](),console['log'](a29_0x4da7c0['bold'](_0x13c366(0x12d))),console['log'](a29_0x4da7c0[_0x13c366(0x128)]('\x20\x20─'[_0x13c366(0x149)](0x1e)));const _0x1ce552=getGlobalConfigPath(),_0x7f2c53=getProjectConfigPath();console[_0x13c366(0x11d)]('\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x1ce552||a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x10b)))),console[_0x13c366(0x11d)](_0x13c366(0x11f)+(_0x7f2c53||a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x10b)))),console[_0x13c366(0x11d)](),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x103)](_0x13c366(0xf7))),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x125)[_0x13c366(0x149)](0x1e)));const _0xff660a=(_0x467011,_0x299b56)=>{const _0x494ffb=_0x13c366;if(!_0x299b56){console[_0x494ffb(0x11d)]('\x20\x20'+_0x467011['padEnd'](0x11)+'\x20'+a29_0x4da7c0[_0x494ffb(0x128)](_0x494ffb(0x12e)));return;}const _0x120053=inspectCliConfigJsonFile(_0x299b56);if(_0x120053[_0x494ffb(0x150)]==='ok')console['log']('\x20\x20'+_0x467011[_0x494ffb(0x11a)](0x11)+'\x20'+a29_0x4da7c0['green']('✓\x20Valid\x20JSON'));else{if(_0x120053[_0x494ffb(0x150)]==='empty')console[_0x494ffb(0x11d)]('\x20\x20'+_0x467011['padEnd'](0x11)+'\x20'+a29_0x4da7c0[_0x494ffb(0xfc)](_0x494ffb(0x12b)));else _0x120053[_0x494ffb(0x150)]===_0x494ffb(0x14e)?console['log']('\x20\x20'+_0x467011[_0x494ffb(0x11a)](0x11)+'\x20'+a29_0x4da7c0[_0x494ffb(0x128)](_0x494ffb(0xff))):(console[_0x494ffb(0x11d)]('\x20\x20'+_0x467011[_0x494ffb(0x11a)](0x11)+'\x20'+a29_0x4da7c0[_0x494ffb(0x11e)](_0x494ffb(0x146))),console[_0x494ffb(0x11d)]('\x20\x20'+''[_0x494ffb(0x11a)](0x11)+'\x20'+a29_0x4da7c0['red'](_0x120053[_0x494ffb(0x151)])));}};_0xff660a(_0x13c366(0x102),_0x1ce552),_0xff660a(_0x13c366(0x137),_0x7f2c53),console[_0x13c366(0x11d)](),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x103)](_0x13c366(0x12c))),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x125)['repeat'](0x1e))),console['log'](_0x13c366(0x101)+(_0x5a6578[_0x13c366(0x153)]||a29_0x4da7c0[_0x13c366(0x11e)](_0x13c366(0xfe)))),console[_0x13c366(0x11d)]('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5a6578[_0x13c366(0x10e)]);const _0x406851=isLegacyCompatConfigKey('locale')?a29_0x4da7c0[_0x13c366(0x128)](_0x5a6578[_0x13c366(0x105)]+_0x13c366(0x119)):_0x5a6578[_0x13c366(0x105)];console[_0x13c366(0x11d)]('\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x406851),console[_0x13c366(0x11d)](_0x13c366(0x106)+(_0x5a6578['defaultApp']||a29_0x4da7c0['gray'](_0x13c366(0x11c)))),console[_0x13c366(0x11d)](_0x13c366(0x133)+(_0x5a6578[_0x13c366(0x135)]||a29_0x4da7c0['gray'](_0x13c366(0x11c)))),console[_0x13c366(0x11d)](_0x13c366(0x111)+(_0x5a6578[_0x13c366(0x114)]||a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x145)+DEFAULT_CONFIG_VALUES[_0x13c366(0x114)]+')'))),console[_0x13c366(0x11d)](_0x13c366(0x132)+(_0x5a6578[_0x13c366(0x13f)]??a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x109)))),console[_0x13c366(0x11d)](_0x13c366(0x147)+_0x5a6578['riskLevel']),console[_0x13c366(0x11d)](_0x13c366(0xf6)+_0x5a6578['verbose']),console[_0x13c366(0x11d)]('\x20\x20auth\x20(effective):\x20'+AUTH_MODE[_0x13c366(0x120)]),console[_0x13c366(0x11d)](_0x13c366(0x124)+(_0x5a6578[_0x13c366(0x12f)]?a29_0x4da7c0[_0x13c366(0x108)](_0x13c366(0x12a)+_0x5a6578[_0x13c366(0x12f)]['length']+')'):a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x11c)))),console['log'](),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x103)](_0x13c366(0x13e))),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x128)]('\x20\x20─'[_0x13c366(0x149)](0x1e))),console[_0x13c366(0x11d)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x13c366(0x11d)](_0x13c366(0x131)+getUserDomain()),console['log'](_0x13c366(0x115)+getRuntimeDomain()),console[_0x13c366(0x11d)](),console[_0x13c366(0x11d)](a29_0x4da7c0['bold'](_0x13c366(0xf9))),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x128)]('\x20\x20─'['repeat'](0x1e)));const _0x6dfdbf=inspectServiceRegistry();console[_0x13c366(0x11d)](_0x13c366(0x107)+_0x6dfdbf[_0x13c366(0x112)]),console[_0x13c366(0x11d)](_0x13c366(0x148)+formatServiceRegistryStatus(_0x6dfdbf)),console['log'](_0x13c366(0x152)+_0x6dfdbf[_0x13c366(0x121)]),console[_0x13c366(0x11d)](_0x13c366(0x100)+_0x6dfdbf[_0x13c366(0x118)]);for(const _0x50f203 of _0x6dfdbf['services']){console[_0x13c366(0x11d)]('\x20\x20'+(_0x50f203['serviceCode']+':')[_0x13c366(0x11a)](0x11)+'\x20'+(_0x50f203[_0x13c366(0xfa)]||a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x10f)))+'\x20('+_0x50f203[_0x13c366(0x118)]+_0x13c366(0x156)),console['log']('\x20\x20'+''[_0x13c366(0x11a)](0x11)+_0x13c366(0x113)+_0x50f203[_0x13c366(0x13a)][_0x13c366(0x14d)]);}return console[_0x13c366(0x11d)](),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x103)](_0x13c366(0x10c))),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x125)[_0x13c366(0x149)](0x1e))),console[_0x13c366(0x11d)]('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a29_0x4da7c0[_0x13c366(0x108)](AUTH_MODE[_0x13c366(0x120)]+_0x13c366(0x140))),console[_0x13c366(0x11d)](_0x13c366(0xf8)+a29_0x4da7c0[_0x13c366(0x128)]('(removed\x20—\x20cookie\x20auth\x20disabled)')),console['log'](),{'ok':!![]};}function formatServiceRegistryStatus(_0x1322f9){const _0x194bc5=a29_0x1aee;if(_0x1322f9[_0x194bc5(0x150)]==='ok')return a29_0x4da7c0['green'](_0x194bc5(0xf5));if(_0x1322f9['status']===_0x194bc5(0x14e))return a29_0x4da7c0[_0x194bc5(0x128)]('(not\x20found)');if(_0x1322f9['status']===_0x194bc5(0x142))return a29_0x4da7c0[_0x194bc5(0xfc)](_0x194bc5(0x13c));return a29_0x4da7c0[_0x194bc5(0x11e)](_0x194bc5(0x144)+(_0x1322f9[_0x194bc5(0x151)]?':\x20'+_0x1322f9[_0x194bc5(0x151)]:''));}export const doctorDefinition={'service':a29_0xdd2a81(0xfb),'command':a29_0xdd2a81(0x138),'description':a29_0xdd2a81(0x14a),'risk':a29_0xdd2a81(0x13d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
1
+ const a29_0x8c437d=a29_0x44e1;(function(_0x3fc9f7,_0x3618c9){const _0x1f9085=a29_0x44e1,_0x5ec679=_0x3fc9f7();while(!![]){try{const _0x44eb1c=-parseInt(_0x1f9085(0x1ac))/0x1*(-parseInt(_0x1f9085(0x16f))/0x2)+parseInt(_0x1f9085(0x163))/0x3+parseInt(_0x1f9085(0x186))/0x4+-parseInt(_0x1f9085(0x160))/0x5*(parseInt(_0x1f9085(0x16a))/0x6)+parseInt(_0x1f9085(0x167))/0x7*(-parseInt(_0x1f9085(0x162))/0x8)+-parseInt(_0x1f9085(0x189))/0x9+parseInt(_0x1f9085(0x168))/0xa;if(_0x44eb1c===_0x3618c9)break;else _0x5ec679['push'](_0x5ec679['shift']());}catch(_0x52aa4d){_0x5ec679['push'](_0x5ec679['shift']());}}}(a29_0x3c98,0x3e516));import a29_0x3a1ea4 from'chalk';function a29_0x44e1(_0x2dd8cf,_0x2ad8f8){_0x2dd8cf=_0x2dd8cf-0x159;const _0x3c98d8=a29_0x3c98();let _0x44e11a=_0x3c98d8[_0x2dd8cf];return _0x44e11a;}import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';function a29_0x3c98(){const _0x1d0c5c=['red','(none)','\x20\x20Config\x20Files','missing','format','25RGBgdT','\x20\x20API\x20Endpoints','16816PXouWF','117981RnLaDG','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20(accessKey)','bold','105BkQrUD','6961790ZHSlgk','length','339948xmbASL','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','message','source','skillVersion','5924FrPqNa','repairCommand','(default)','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','services','log','\x20commands)','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','Global','(unnamed)','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20current','⚠\x20Empty\x20(treated\x20as\x20{})','padEnd','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','(set,\x20length=','accessKey','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(removed\x20—\x20cookie\x20auth\x20disabled)','reason','check','\x20\x20─','830380sgEzBn','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20Session\x20check:\x20\x20\x20','3863745uzDntC','commandCount','\x20\x20auth\x20(effective):\x20','\x20\x20Reason:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','state','(no\x20file)','gray','repeat','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','name','status','empty','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Auth','path','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','defaultApp','doctor','\x20\x20Installed\x20Path:\x20\x20','\x20\x20runtimeDomain:\x20\x20\x20','locale','(default:\x20','platform','yellow','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Built-in\x20Skill','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20Merged\x20Config','\x20Imported\x20from:\x20','green','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','serviceCount','pageSize','read','19vkTlTl','\x20\x20Config\x20JSON','ClientAk','env','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20found)','current','✗\x20Invalid'];a29_0x3c98=function(){return _0x1d0c5c;};return a29_0x3c98();}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';import{inspectBuiltinSkill}from'../skills/builtin-skill.js';async function execute(_0x3d1603){const _0x28991f=a29_0x44e1,_0x5c734d=getCliVersion(),_0x51d822=buildConfigFromFlags({});await initGlobalEnvironment(_0x51d822),console[_0x28991f(0x174)](),console[_0x28991f(0x174)](a29_0x3a1ea4[_0x28991f(0x166)](CLI_BIN_NAME+'\x20doctor')),console[_0x28991f(0x174)](a29_0x3a1ea4[_0x28991f(0x18f)]('─'[_0x28991f(0x190)](0x32))),console[_0x28991f(0x174)](_0x28991f(0x17e)+_0x5c734d),console[_0x28991f(0x174)](_0x28991f(0x1b0)+process['version']),console['log'](_0x28991f(0x198)+process[_0x28991f(0x19f)]+'\x20'+process['arch']);const _0x5e933b=inspectBuiltinSkill();console[_0x28991f(0x174)](),console[_0x28991f(0x174)](a29_0x3a1ea4['bold'](_0x28991f(0x1a2))),console[_0x28991f(0x174)](a29_0x3a1ea4[_0x28991f(0x18f)](_0x28991f(0x185)[_0x28991f(0x190)](0x1e))),console['log']('\x20\x20State:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x5e933b['state']===_0x28991f(0x159)?a29_0x3a1ea4[_0x28991f(0x1a6)](_0x28991f(0x17b)):a29_0x3a1ea4['red']('✗\x20'+_0x5e933b['state']))),console[_0x28991f(0x174)]('\x20\x20Package\x20Version:\x20'+_0x5e933b['packageVersion']),console[_0x28991f(0x174)]('\x20\x20Skill\x20Version:\x20\x20\x20'+(_0x5e933b[_0x28991f(0x16e)]||a29_0x3a1ea4[_0x28991f(0x18f)]('(missing)'))),console[_0x28991f(0x174)](_0x28991f(0x19b)+(_0x5e933b['installedPath']||a29_0x3a1ea4[_0x28991f(0x18f)](_0x28991f(0x1b3))));_0x5e933b[_0x28991f(0x18d)]!==_0x28991f(0x159)&&console[_0x28991f(0x174)]('\x20\x20Repair:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5e933b[_0x28991f(0x170)]);_0x5e933b[_0x28991f(0x183)]&&console[_0x28991f(0x174)](_0x28991f(0x18c)+_0x5e933b[_0x28991f(0x183)]);console['log'](),console[_0x28991f(0x174)](a29_0x3a1ea4['bold'](_0x28991f(0x15d))),console['log'](a29_0x3a1ea4[_0x28991f(0x18f)](_0x28991f(0x185)[_0x28991f(0x190)](0x1e)));const _0x59b894=getGlobalConfigPath(),_0x405a35=getProjectConfigPath();console[_0x28991f(0x174)](_0x28991f(0x1a1)+(_0x59b894||a29_0x3a1ea4['gray'](_0x28991f(0x1b3)))),console[_0x28991f(0x174)](_0x28991f(0x181)+(_0x405a35||a29_0x3a1ea4[_0x28991f(0x18f)](_0x28991f(0x1b3)))),console['log'](),console[_0x28991f(0x174)](a29_0x3a1ea4[_0x28991f(0x166)](_0x28991f(0x1ad))),console[_0x28991f(0x174)](a29_0x3a1ea4['gray'](_0x28991f(0x185)[_0x28991f(0x190)](0x1e)));const _0x54096e=(_0x2393aa,_0x50c7b8)=>{const _0x355170=_0x28991f;if(!_0x50c7b8){console['log']('\x20\x20'+_0x2393aa[_0x355170(0x17d)](0x11)+'\x20'+a29_0x3a1ea4[_0x355170(0x18f)](_0x355170(0x18e)));return;}const _0x2b3b9d=inspectCliConfigJsonFile(_0x50c7b8);if(_0x2b3b9d['status']==='ok')console[_0x355170(0x174)]('\x20\x20'+_0x2393aa[_0x355170(0x17d)](0x11)+'\x20'+a29_0x3a1ea4[_0x355170(0x1a6)]('✓\x20Valid\x20JSON'));else{if(_0x2b3b9d[_0x355170(0x193)]===_0x355170(0x194))console[_0x355170(0x174)]('\x20\x20'+_0x2393aa[_0x355170(0x17d)](0x11)+'\x20'+a29_0x3a1ea4[_0x355170(0x1a0)](_0x355170(0x17c)));else _0x2b3b9d[_0x355170(0x193)]===_0x355170(0x15e)?console[_0x355170(0x174)]('\x20\x20'+_0x2393aa[_0x355170(0x17d)](0x11)+'\x20'+a29_0x3a1ea4[_0x355170(0x18f)]('(missing)')):(console[_0x355170(0x174)]('\x20\x20'+_0x2393aa[_0x355170(0x17d)](0x11)+'\x20'+a29_0x3a1ea4[_0x355170(0x15b)]('✗\x20Invalid\x20JSON')),console[_0x355170(0x174)]('\x20\x20'+''['padEnd'](0x11)+'\x20'+a29_0x3a1ea4[_0x355170(0x15b)](_0x2b3b9d[_0x355170(0x16c)])));}};_0x54096e(_0x28991f(0x177),_0x59b894),_0x54096e('Project',_0x405a35),console[_0x28991f(0x174)](),console[_0x28991f(0x174)](a29_0x3a1ea4[_0x28991f(0x166)](_0x28991f(0x1a4))),console[_0x28991f(0x174)](a29_0x3a1ea4[_0x28991f(0x18f)](_0x28991f(0x185)[_0x28991f(0x190)](0x1e))),console[_0x28991f(0x174)](_0x28991f(0x1a7)+(_0x51d822['appCode']||a29_0x3a1ea4[_0x28991f(0x15b)]('(not\x20set)'))),console['log']('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x51d822[_0x28991f(0x1af)]);const _0x11aced=isLegacyCompatConfigKey(_0x28991f(0x19d))?a29_0x3a1ea4[_0x28991f(0x18f)](_0x51d822[_0x28991f(0x19d)]+'\x20(legacy/compat\x20only)'):_0x51d822['locale'];console[_0x28991f(0x174)]('\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x11aced),console['log'](_0x28991f(0x1a3)+(_0x51d822[_0x28991f(0x199)]||a29_0x3a1ea4[_0x28991f(0x18f)](_0x28991f(0x15c)))),console[_0x28991f(0x174)](_0x28991f(0x187)+(_0x51d822['currentApp']||a29_0x3a1ea4['gray'](_0x28991f(0x15c)))),console[_0x28991f(0x174)](_0x28991f(0x16b)+(_0x51d822['format']||a29_0x3a1ea4[_0x28991f(0x18f)](_0x28991f(0x19e)+DEFAULT_CONFIG_VALUES[_0x28991f(0x15f)]+')'))),console[_0x28991f(0x174)](_0x28991f(0x191)+(_0x51d822[_0x28991f(0x1aa)]??a29_0x3a1ea4[_0x28991f(0x18f)](_0x28991f(0x171)))),console['log'](_0x28991f(0x195)+_0x51d822['riskLevel']),console[_0x28991f(0x174)](_0x28991f(0x164)+_0x51d822['verbose']),console[_0x28991f(0x174)](_0x28991f(0x18b)+AUTH_MODE[_0x28991f(0x1ae)]),console['log']('\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20'+(_0x51d822[_0x28991f(0x180)]?a29_0x3a1ea4[_0x28991f(0x1a6)](_0x28991f(0x17f)+_0x51d822[_0x28991f(0x180)][_0x28991f(0x169)]+')'):a29_0x3a1ea4['gray'](_0x28991f(0x15c)))),console[_0x28991f(0x174)](),console[_0x28991f(0x174)](a29_0x3a1ea4[_0x28991f(0x166)](_0x28991f(0x161))),console[_0x28991f(0x174)](a29_0x3a1ea4['gray'](_0x28991f(0x185)[_0x28991f(0x190)](0x1e))),console['log'](_0x28991f(0x179)+getApiDomain()),console[_0x28991f(0x174)]('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console[_0x28991f(0x174)](_0x28991f(0x19c)+getRuntimeDomain()),console[_0x28991f(0x174)](),console[_0x28991f(0x174)](a29_0x3a1ea4['bold']('\x20\x20Service\x20Tree')),console['log'](a29_0x3a1ea4[_0x28991f(0x18f)](_0x28991f(0x185)[_0x28991f(0x190)](0x1e)));const _0xf6a0a3=inspectServiceRegistry();console[_0x28991f(0x174)](_0x28991f(0x1a8)+_0xf6a0a3['registryPath']),console[_0x28991f(0x174)](_0x28991f(0x17a)+formatServiceRegistryStatus(_0xf6a0a3)),console[_0x28991f(0x174)](_0x28991f(0x1b2)+_0xf6a0a3[_0x28991f(0x1a9)]),console[_0x28991f(0x174)](_0x28991f(0x176)+_0xf6a0a3[_0x28991f(0x18a)]);for(const _0x56ac98 of _0xf6a0a3[_0x28991f(0x173)]){console['log']('\x20\x20'+(_0x56ac98['serviceCode']+':')[_0x28991f(0x17d)](0x11)+'\x20'+(_0x56ac98[_0x28991f(0x192)]||a29_0x3a1ea4[_0x28991f(0x18f)](_0x28991f(0x178)))+'\x20('+_0x56ac98['commandCount']+_0x28991f(0x175)),console[_0x28991f(0x174)]('\x20\x20'+''[_0x28991f(0x17d)](0x11)+_0x28991f(0x1a5)+_0x56ac98[_0x28991f(0x16d)][_0x28991f(0x197)]);}return console[_0x28991f(0x174)](),console['log'](a29_0x3a1ea4[_0x28991f(0x166)](_0x28991f(0x196))),console[_0x28991f(0x174)](a29_0x3a1ea4['gray']('\x20\x20─'[_0x28991f(0x190)](0x1e))),console['log'](_0x28991f(0x172)+a29_0x3a1ea4['green'](AUTH_MODE['ClientAk']+_0x28991f(0x165))),console[_0x28991f(0x174)](_0x28991f(0x188)+a29_0x3a1ea4[_0x28991f(0x18f)](_0x28991f(0x182))),console[_0x28991f(0x174)](),{'ok':!![]};}function formatServiceRegistryStatus(_0xae6e81){const _0x504923=a29_0x44e1;if(_0xae6e81[_0x504923(0x193)]==='ok')return a29_0x3a1ea4[_0x504923(0x1a6)]('✓\x20Loaded');if(_0xae6e81[_0x504923(0x193)]===_0x504923(0x15e))return a29_0x3a1ea4[_0x504923(0x18f)](_0x504923(0x1b3));if(_0xae6e81['status']==='empty')return a29_0x3a1ea4['yellow']('⚠\x20Empty');return a29_0x3a1ea4[_0x504923(0x15b)](_0x504923(0x15a)+(_0xae6e81['message']?':\x20'+_0xae6e81[_0x504923(0x16c)]:''));}export const doctorDefinition={'service':a29_0x8c437d(0x19a),'command':a29_0x8c437d(0x184),'description':a29_0x8c437d(0x1b1),'risk':a29_0x8c437d(0x1ab),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a30_0x53aae5=a30_0x1bb8;(function(_0x375909,_0x1f9d20){const _0xcc1d92=a30_0x1bb8,_0x48e52b=_0x375909();while(!![]){try{const _0x18dd9d=parseInt(_0xcc1d92(0x1bd))/0x1+-parseInt(_0xcc1d92(0x1d0))/0x2+parseInt(_0xcc1d92(0x1b6))/0x3+-parseInt(_0xcc1d92(0x1b7))/0x4+-parseInt(_0xcc1d92(0x1c8))/0x5+parseInt(_0xcc1d92(0x1d2))/0x6+-parseInt(_0xcc1d92(0x1bb))/0x7*(-parseInt(_0xcc1d92(0x1c3))/0x8);if(_0x18dd9d===_0x1f9d20)break;else _0x48e52b['push'](_0x48e52b['shift']());}catch(_0x40f44b){_0x48e52b['push'](_0x48e52b['shift']());}}}(a30_0x100d,0x44079));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':'file','type':a30_0x53aae5(0x1c6),'required':!![],'description':a30_0x53aae5(0x1cc)},FILEPATH_FLAG={'name':a30_0x53aae5(0x1d4),'type':a30_0x53aae5(0x1c6),'required':!![],'description':a30_0x53aae5(0x1ae)},DOWNLOAD_FLAG={'name':a30_0x53aae5(0x1ba),'type':a30_0x53aae5(0x1b2),'description':a30_0x53aae5(0x1c1)},LONG_TERM_FLAG={'name':'long-term','type':a30_0x53aae5(0x1b2),'description':a30_0x53aae5(0x1cf)};function a30_0x1bb8(_0x5c19b6,_0x322ad5){_0x5c19b6=_0x5c19b6-0x1ae;const _0x100d44=a30_0x100d();let _0x1bb812=_0x100d44[_0x5c19b6];return _0x1bb812;}function requireFilePath(_0x4571e9){const _0x47c868=a30_0x53aae5,_0x14690d=_0x4571e9[_0x47c868(0x1c7)]();if(!_0x14690d)throw CliErrors[_0x47c868(0x1d3)](_0x47c868(0x1bf));return _0x14690d;}function a30_0x100d(){const _0x2c5a58=['7IgZAZB','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','88790VUlCfL','POST','filePath\x20is\x20required.','file','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','5624184ixOvzf','long-term','query-url','string','trim','489905iITGgK','build','filePath','body','Path\x20to\x20the\x20local\x20file\x20to\x20upload','str','bool','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','945260mQURAv','description','295794tvXQZE','validation','filepath','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','Uploaded\x20file:\x20','/client/uploadFile','path','boolean','read','Preview:\x20upload\x20','File','1344891ojgEne','1760596BEtAbU','appCode','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','download'];a30_0x100d=function(){return _0x2c5a58;};return a30_0x100d();}const fileUpload={'service':'file','command':'upload','description':a30_0x53aae5(0x1b9),'risk':a30_0x53aae5(0x1b3),'flags':[FILE_FLAG],async 'dryRun'(_0x2294a9){const _0x24523c=a30_0x53aae5,_0x12dcdf=requireRuntimeUploadFile(_0x2294a9[_0x24523c(0x1cd)](_0x24523c(0x1c0)),_0x24523c(0x1b5));return dryRun(_0x24523c(0x1be),_0x24523c(0x1b0))[_0x24523c(0x1cb)]({'appCode':_0x2294a9[_0x24523c(0x1b8)],'multipart':{'file':_0x12dcdf}})[_0x24523c(0x1d1)](_0x24523c(0x1b4)+_0x12dcdf[_0x24523c(0x1b1)]+'\x20to\x20runtime\x20app\x20'+_0x2294a9[_0x24523c(0x1b8)])[_0x24523c(0x1c9)]();},async 'execute'(_0x344f1e){const _0x4a9cf1=a30_0x53aae5,_0x3c4e37=requireRuntimeUploadFile(_0x344f1e['str'](_0x4a9cf1(0x1c0)),_0x4a9cf1(0x1b5)),_0x832128=await uploadRuntimeFile(_0x344f1e['appCode'],_0x3c4e37['path']);return{'ok':!![],'data':_0x832128,'message':_0x832128[_0x4a9cf1(0x1ca)]?_0x4a9cf1(0x1af)+_0x832128[_0x4a9cf1(0x1ca)]+_0x4a9cf1(0x1c2):_0x4a9cf1(0x1bc)};}},fileQueryUrl={'service':a30_0x53aae5(0x1c0),'command':a30_0x53aae5(0x1c5),'description':'Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','risk':a30_0x53aae5(0x1b3),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x32137d){const _0x363eed=a30_0x53aae5,_0x52ead8=requireFilePath(_0x32137d['str'](_0x363eed(0x1d4))),_0x14b9cb=await queryRuntimeFileUrl(_0x52ead8,{'download':_0x32137d[_0x363eed(0x1ce)](_0x363eed(0x1ba)),'longTerm':_0x32137d['bool'](_0x363eed(0x1c4))});return{'ok':!![],'data':_0x14b9cb};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
1
+ const a30_0x456213=a30_0x17a2;(function(_0x125876,_0xd62ae7){const _0x2caddc=a30_0x17a2,_0x43bbe5=_0x125876();while(!![]){try{const _0x6bc520=-parseInt(_0x2caddc(0x185))/0x1*(-parseInt(_0x2caddc(0x1ab))/0x2)+parseInt(_0x2caddc(0x186))/0x3+parseInt(_0x2caddc(0x199))/0x4*(parseInt(_0x2caddc(0x192))/0x5)+parseInt(_0x2caddc(0x1a8))/0x6*(-parseInt(_0x2caddc(0x18c))/0x7)+-parseInt(_0x2caddc(0x1a1))/0x8+parseInt(_0x2caddc(0x1a2))/0x9*(-parseInt(_0x2caddc(0x196))/0xa)+parseInt(_0x2caddc(0x187))/0xb;if(_0x6bc520===_0xd62ae7)break;else _0x43bbe5['push'](_0x43bbe5['shift']());}catch(_0x79075e){_0x43bbe5['push'](_0x43bbe5['shift']());}}}(a30_0x2f7c,0x52fff));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a30_0x2f7c(){const _0x4504fb=['\x20to\x20runtime\x20app\x20','string','1406464alcqMU','16857dFZEqJ','Uploaded\x20file:\x20','file','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','bool','filePath\x20is\x20required.','6mUCRSY','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','query-url','545772mfVmGu','long-term','1WOptbI','937110pYJdXh','2718606exgDgW','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','filepath','File','appCode','251657RUMWQB','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','trim','boolean','validation','str','240825ckpIQn','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','POST','Path\x20to\x20the\x20local\x20file\x20to\x20upload','2270HpHchv','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','filePath','12LElQaT','body','download','Preview:\x20upload\x20','upload','path'];a30_0x2f7c=function(){return _0x4504fb;};return a30_0x2f7c();}function a30_0x17a2(_0x4d0ead,_0x245bb1){_0x4d0ead=_0x4d0ead-0x184;const _0x2f7cd7=a30_0x2f7c();let _0x17a27a=_0x2f7cd7[_0x4d0ead];return _0x17a27a;}const FILE_FLAG={'name':a30_0x456213(0x1a4),'type':a30_0x456213(0x1a0),'required':!![],'description':a30_0x456213(0x195)},FILEPATH_FLAG={'name':a30_0x456213(0x189),'type':'string','required':!![],'description':a30_0x456213(0x1a9)},DOWNLOAD_FLAG={'name':'download','type':a30_0x456213(0x18f),'description':'Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL'},LONG_TERM_FLAG={'name':'long-term','type':a30_0x456213(0x18f),'description':a30_0x456213(0x193)};function requireFilePath(_0x407ab1){const _0x261d24=a30_0x456213,_0x377a12=_0x407ab1[_0x261d24(0x18e)]();if(!_0x377a12)throw CliErrors[_0x261d24(0x190)](_0x261d24(0x1a7));return _0x377a12;}const fileUpload={'service':'file','command':a30_0x456213(0x19d),'description':a30_0x456213(0x188),'risk':'read','flags':[FILE_FLAG],async 'dryRun'(_0x5dcf30){const _0x590923=a30_0x456213,_0x48b9d4=requireRuntimeUploadFile(_0x5dcf30[_0x590923(0x191)](_0x590923(0x1a4)),_0x590923(0x18a));return dryRun(_0x590923(0x194),'/client/uploadFile')[_0x590923(0x19a)]({'appCode':_0x5dcf30[_0x590923(0x18b)],'multipart':{'file':_0x48b9d4}})['description'](_0x590923(0x19c)+_0x48b9d4[_0x590923(0x19e)]+_0x590923(0x19f)+_0x5dcf30[_0x590923(0x18b)])['build']();},async 'execute'(_0x2c2f2f){const _0x51ed1b=a30_0x456213,_0x150103=requireRuntimeUploadFile(_0x2c2f2f[_0x51ed1b(0x191)](_0x51ed1b(0x1a4)),_0x51ed1b(0x18a)),_0x2a82b6=await uploadRuntimeFile(_0x2c2f2f[_0x51ed1b(0x18b)],_0x150103[_0x51ed1b(0x19e)]);return{'ok':!![],'data':_0x2a82b6,'message':_0x2a82b6[_0x51ed1b(0x198)]?_0x51ed1b(0x1a3)+_0x2a82b6[_0x51ed1b(0x198)]+_0x51ed1b(0x197):_0x51ed1b(0x1a5)};}},fileQueryUrl={'service':'file','command':a30_0x456213(0x1aa),'description':a30_0x456213(0x18d),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0xe14c48){const _0x1686b1=a30_0x456213,_0x20a389=requireFilePath(_0xe14c48[_0x1686b1(0x191)](_0x1686b1(0x189))),_0x49834f=await queryRuntimeFileUrl(_0x20a389,{'download':_0xe14c48['bool'](_0x1686b1(0x19b)),'longTerm':_0xe14c48[_0x1686b1(0x1a6)](_0x1686b1(0x184))});return{'ok':!![],'data':_0x49834f};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
@@ -1 +1 @@
1
- const a31_0x147ca7=a31_0x83b9;(function(_0x502863,_0x5b2d02){const _0x2d3ad7=a31_0x83b9,_0x51b42a=_0x502863();while(!![]){try{const _0xc58969=-parseInt(_0x2d3ad7(0x179))/0x1+-parseInt(_0x2d3ad7(0x17d))/0x2+parseInt(_0x2d3ad7(0x17a))/0x3*(-parseInt(_0x2d3ad7(0x16e))/0x4)+parseInt(_0x2d3ad7(0x16a))/0x5+parseInt(_0x2d3ad7(0x176))/0x6*(-parseInt(_0x2d3ad7(0x159))/0x7)+parseInt(_0x2d3ad7(0x15f))/0x8+-parseInt(_0x2d3ad7(0x168))/0x9*(-parseInt(_0x2d3ad7(0x15a))/0xa);if(_0xc58969===_0x5b2d02)break;else _0x51b42a['push'](_0x51b42a['shift']());}catch(_0x425005){_0x51b42a['push'](_0x51b42a['shift']());}}}(a31_0x2eb7,0xe58a0));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';function a31_0x2eb7(){const _0x19f769=['Invalid\x20env\x20\x22','file','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','cwd','log','Imported\x20from\x20','9mnAukh','entries','4548135gqNCCd','\x22.\x20Allowed:\x20','global','message','16AgZKji','Write\x20to\x20global\x20(~/','includes','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`.','env','appcode','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','object','222qMhbIv','project','yes','1558980LdCAuK','877842aJoGAq','string','validation','3039680CskBbC','defaultApp','apps','Override\x20imported\x20default\x20appcode','214543OTKeCT','47214710vdJzpy','riskLevel','\x20\x20appcode:\x20','newConfigFileName','\x20\x20config:\x20\x20','5539064nqgJbF','Override\x20imported\x20default\x20env','parse'];a31_0x2eb7=function(){return _0x19f769;};return a31_0x2eb7();}import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';function a31_0x83b9(_0x102202,_0x3691fb){_0x102202=_0x102202-0x158;const _0x2eb771=a31_0x2eb7();let _0x83b942=_0x2eb771[_0x102202];return _0x83b942;}import{PRODUCT_CONFIG}from'../constant/product.js';export const appImportFlagDefs=[{'name':'file','type':a31_0x147ca7(0x17b),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x147ca7(0x173),'type':a31_0x147ca7(0x17b),'description':a31_0x147ca7(0x158)},{'name':a31_0x147ca7(0x172),'type':a31_0x147ca7(0x17b),'description':a31_0x147ca7(0x160),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x147ca7(0x16c),'type':'boolean','description':a31_0x147ca7(0x16f)+PRODUCT_CONFIG[a31_0x147ca7(0x15d)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x147ca7(0x178),'type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runAppImport(_0x4c53b3){const _0x3b02b1=a31_0x147ca7,_0x233073=_0x4c53b3[_0x3b02b1(0x16c)]?_0x3b02b1(0x16c):_0x3b02b1(0x177),_0x530b5d=resolveWriteConfigPath(_0x233073);await runFromImport(_0x4c53b3,_0x530b5d);}async function runFromImport(_0x19bd36,_0x2a1555){const _0x53561b=a31_0x147ca7,_0x3de070=resolveFilePath(_0x19bd36[_0x53561b(0x163)]);if(!existsSync(_0x3de070))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0x3de070);const _0x59f5af=readSourceFile(_0x3de070),_0x53efac=convertToRuntimeConfig(_0x59f5af);_0x19bd36['appcode']&&(_0x53efac[_0x53561b(0x173)]=String(_0x19bd36['appcode']));_0x19bd36[_0x53561b(0x172)]&&(_0x53efac[_0x53561b(0x172)]=resolveImportEnv(_0x19bd36));if(!_0x53efac[_0x53561b(0x173)])throw CliErrors[_0x53561b(0x17c)](_0x53561b(0x164),_0x53561b(0x171));await writeImportConfig(_0x2a1555,_0x53efac,_0x19bd36),console[_0x53561b(0x166)](_0x53561b(0x167)+_0x3de070),console[_0x53561b(0x166)](_0x53561b(0x15e)+_0x2a1555),console[_0x53561b(0x166)](_0x53561b(0x15c)+_0x53efac[_0x53561b(0x173)]);if(_0x53efac[_0x53561b(0x17e)])console[_0x53561b(0x166)]('\x20\x20default:\x20'+_0x53efac[_0x53561b(0x17e)]);}function convertToRuntimeConfig(_0x29d5b0){const _0x406b5a=a31_0x147ca7;if(_0x29d5b0[_0x406b5a(0x17f)]&&typeof _0x29d5b0[_0x406b5a(0x17f)]===_0x406b5a(0x175))throw CliErrors['validation'](_0x406b5a(0x174),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x520981={};for(const _0x3f5374 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x29d5b0[_0x3f5374]!==undefined&&(_0x520981[_0x3f5374]=_0x29d5b0[_0x3f5374]);}return!_0x520981[_0x406b5a(0x15b)]&&(_0x520981[_0x406b5a(0x15b)]=DEFAULT_CONFIG_VALUES[_0x406b5a(0x15b)]),_0x520981;}async function writeImportConfig(_0x508ff4,_0x46c55e,_0x2ea3c1){const _0x1f9fee=a31_0x147ca7;let _0x1af424={};existsSync(_0x508ff4)&&!_0x2ea3c1[_0x1f9fee(0x178)]&&(_0x1af424=readConfigFile(_0x508ff4));for(const [_0x48b272,_0x499415]of Object[_0x1f9fee(0x169)](_0x46c55e)){_0x499415!==undefined&&(_0x1af424[_0x48b272]=_0x499415);}if(_0x1af424['app'])delete _0x1af424['app'];writeConfigFile(_0x508ff4,_0x1af424);}function resolveFilePath(_0x2b5641){const _0x17397a=a31_0x147ca7;return isAbsolute(_0x2b5641)?_0x2b5641:resolve(process[_0x17397a(0x165)](),_0x2b5641);}function readSourceFile(_0x29a6bd){const _0x443c7f=a31_0x147ca7;try{const _0x12b888=readFileSync(_0x29a6bd,{'encoding':'utf8'});return JSON[_0x443c7f(0x161)](_0x12b888);}catch(_0x3a364d){throw CliErrors[_0x443c7f(0x17c)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x3a364d[_0x443c7f(0x16d)]);}}function resolveImportEnv(_0x58a0f9){const _0x1f8140=a31_0x147ca7,_0x62c7cb=_0x58a0f9[_0x1f8140(0x172)];if(_0x62c7cb===undefined||_0x62c7cb==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x1f8140(0x170)](_0x62c7cb))throw CliErrors['validation'](_0x1f8140(0x162)+_0x62c7cb+_0x1f8140(0x16b)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x62c7cb;}
1
+ const a31_0x128e1c=a31_0x2bb5;(function(_0x3381e3,_0x16fc72){const _0x2fedb4=a31_0x2bb5,_0x5821e7=_0x3381e3();while(!![]){try{const _0x191573=parseInt(_0x2fedb4(0x1b5))/0x1*(-parseInt(_0x2fedb4(0x1bd))/0x2)+parseInt(_0x2fedb4(0x1ab))/0x3+-parseInt(_0x2fedb4(0x1b4))/0x4*(parseInt(_0x2fedb4(0x1d0))/0x5)+parseInt(_0x2fedb4(0x1b9))/0x6*(parseInt(_0x2fedb4(0x1c3))/0x7)+-parseInt(_0x2fedb4(0x1ca))/0x8*(parseInt(_0x2fedb4(0x1d2))/0x9)+parseInt(_0x2fedb4(0x1ac))/0xa*(parseInt(_0x2fedb4(0x1b6))/0xb)+-parseInt(_0x2fedb4(0x1b7))/0xc*(-parseInt(_0x2fedb4(0x1c7))/0xd);if(_0x191573===_0x16fc72)break;else _0x5821e7['push'](_0x5821e7['shift']());}catch(_0x481e79){_0x5821e7['push'](_0x5821e7['shift']());}}}(a31_0x399b,0x21c32));import{existsSync,readFileSync}from'node:fs';function a31_0x2bb5(_0x1fbe86,_0x178e48){_0x1fbe86=_0x1fbe86-0x1aa;const _0x399b4e=a31_0x399b();let _0x2bb572=_0x399b4e[_0x1fbe86];return _0x2bb572;}import{resolve,isAbsolute}from'node:path';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}from'../context.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const appImportFlagDefs=[{'name':a31_0x128e1c(0x1b2),'type':'string','description':a31_0x128e1c(0x1ba),'required':!![]},{'name':a31_0x128e1c(0x1cb),'type':a31_0x128e1c(0x1cc),'description':'Override\x20imported\x20default\x20appcode'},{'name':a31_0x128e1c(0x1b1),'type':a31_0x128e1c(0x1cc),'description':a31_0x128e1c(0x1c6),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x128e1c(0x1c4),'type':'boolean','description':a31_0x128e1c(0x1ad)+PRODUCT_CONFIG['newConfigFileName']+a31_0x128e1c(0x1cd),'default':![]},{'name':a31_0x128e1c(0x1c1),'type':'boolean','description':a31_0x128e1c(0x1ce),'default':![]}];export async function runAppImport(_0xc26ac5){const _0x28c7de=a31_0x128e1c,_0xfa22fc=_0xc26ac5[_0x28c7de(0x1c4)]?_0x28c7de(0x1c4):'project',_0x598787=resolveWriteConfigPath(_0xfa22fc);await runFromImport(_0xc26ac5,_0x598787);}async function runFromImport(_0x5dbb55,_0x432cac){const _0x43f964=a31_0x128e1c,_0xd10679=resolveFilePath(_0x5dbb55['file']);if(!existsSync(_0xd10679))throw CliErrors[_0x43f964(0x1c2)](_0x43f964(0x1b8)+_0xd10679);const _0x7b35c0=readSourceFile(_0xd10679),_0x506c53=convertToRuntimeConfig(_0x7b35c0);_0x5dbb55[_0x43f964(0x1cb)]&&(_0x506c53[_0x43f964(0x1cb)]=String(_0x5dbb55[_0x43f964(0x1cb)]));_0x5dbb55['env']&&(_0x506c53[_0x43f964(0x1b1)]=resolveImportEnv(_0x5dbb55));if(!_0x506c53['appcode'])throw CliErrors[_0x43f964(0x1c2)](_0x43f964(0x1b3),_0x43f964(0x1d1));await writeImportConfig(_0x432cac,_0x506c53,_0x5dbb55),console[_0x43f964(0x1b0)](_0x43f964(0x1d3)+_0xd10679),console[_0x43f964(0x1b0)](_0x43f964(0x1c8)+_0x432cac),console['log'](_0x43f964(0x1bc)+_0x506c53[_0x43f964(0x1cb)]);if(_0x506c53['defaultApp'])console[_0x43f964(0x1b0)]('\x20\x20default:\x20'+_0x506c53[_0x43f964(0x1c0)]);}function convertToRuntimeConfig(_0x53b555){const _0x4ac71d=a31_0x128e1c;if(_0x53b555['apps']&&typeof _0x53b555[_0x4ac71d(0x1af)]==='object')throw CliErrors[_0x4ac71d(0x1c2)](_0x4ac71d(0x1ae),_0x4ac71d(0x1bf));const _0x33ceb6={};for(const _0x20e95a of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x53b555[_0x20e95a]!==undefined&&(_0x33ceb6[_0x20e95a]=_0x53b555[_0x20e95a]);}return!_0x33ceb6[_0x4ac71d(0x1aa)]&&(_0x33ceb6[_0x4ac71d(0x1aa)]=DEFAULT_CONFIG_VALUES[_0x4ac71d(0x1aa)]),_0x33ceb6;}async function writeImportConfig(_0x3ed216,_0x35801c,_0x1b61f3){const _0xad9de8=a31_0x128e1c;let _0x59b1cb={};existsSync(_0x3ed216)&&!_0x1b61f3[_0xad9de8(0x1c1)]&&(_0x59b1cb=readConfigFile(_0x3ed216));for(const [_0x386ae5,_0x16fd66]of Object['entries'](_0x35801c)){_0x16fd66!==undefined&&(_0x59b1cb[_0x386ae5]=_0x16fd66);}if(_0x59b1cb['app'])delete _0x59b1cb['app'];writeConfigFile(_0x3ed216,_0x59b1cb);}function resolveFilePath(_0x3771af){return isAbsolute(_0x3771af)?_0x3771af:resolve(process['cwd'](),_0x3771af);}function readSourceFile(_0x3e26dd){const _0x3b4a87=a31_0x128e1c;try{const _0x57c992=readFileSync(_0x3e26dd,{'encoding':'utf8'});return JSON[_0x3b4a87(0x1bb)](_0x57c992);}catch(_0x2cbb09){throw CliErrors[_0x3b4a87(0x1c2)](_0x3b4a87(0x1cf)+_0x2cbb09[_0x3b4a87(0x1c9)]);}}function resolveImportEnv(_0x1bb4b0){const _0x40b720=a31_0x128e1c,_0x58607e=_0x1bb4b0[_0x40b720(0x1b1)];if(_0x58607e===undefined||_0x58607e==='')return DEFAULT_CONFIG_VALUES[_0x40b720(0x1b1)];if(!RUNTIME_ENV_VALUES['includes'](_0x58607e))throw CliErrors[_0x40b720(0x1c2)]('Invalid\x20env\x20\x22'+_0x58607e+_0x40b720(0x1c5)+RUNTIME_ENV_VALUES[_0x40b720(0x1be)](',\x20'));return _0x58607e;}function a31_0x399b(){const _0x3faeb3=['\x22.\x20Allowed:\x20','Override\x20imported\x20default\x20env','26uInbpf','\x20\x20config:\x20\x20','message','68152PncSFP','appcode','string',')\x20instead\x20of\x20project','Skip\x20confirmation\x20when\x20overwriting','Failed\x20to\x20parse\x20source\x20file:\x20','1227455SZoQRB','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`.','279yscwlU','Imported\x20from\x20','riskLevel','392724vozMHr','12830BGSLuA','Write\x20to\x20global\x20(~/','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','apps','log','env','file','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','4EWoPzq','8772dAIlmd','22CePVgS','1695624gNSDtY','Source\x20file\x20not\x20found:\x20','83112kWETZo','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','parse','\x20\x20appcode:\x20','4pipUDj','join','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','defaultApp','yes','validation','126dpXmQv','global'];a31_0x399b=function(){return _0x3faeb3;};return a31_0x399b();}
@@ -1 +1 @@
1
- function a32_0x3b0d(_0x1745f9,_0x5b8ce6){_0x1745f9=_0x1745f9-0x1cc;const _0x41de7f=a32_0x41de();let _0x3b0d06=_0x41de7f[_0x1745f9];return _0x3b0d06;}const a32_0x52a7b6=a32_0x3b0d;(function(_0x1433cc,_0x256a5e){const _0x24f941=a32_0x3b0d,_0xf62ec3=_0x1433cc();while(!![]){try{const _0x35d16c=parseInt(_0x24f941(0x1d8))/0x1+parseInt(_0x24f941(0x20b))/0x2+-parseInt(_0x24f941(0x1df))/0x3*(parseInt(_0x24f941(0x1e7))/0x4)+-parseInt(_0x24f941(0x1fd))/0x5*(-parseInt(_0x24f941(0x20c))/0x6)+-parseInt(_0x24f941(0x202))/0x7+parseInt(_0x24f941(0x1f9))/0x8+-parseInt(_0x24f941(0x1e9))/0x9;if(_0x35d16c===_0x256a5e)break;else _0xf62ec3['push'](_0xf62ec3['shift']());}catch(_0x325384){_0xf62ec3['push'](_0xf62ec3['shift']());}}}(a32_0x41de,0xcae00));import{existsSync,readFileSync,statSync}from'node:fs';function a32_0x41de(){const _0x50a3f3=['isFinite','create','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','4265597ONFkKT','string','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','length','score','docId','weightedScore','Override\x20the\x20existing\x20entry\x20title','964020IHQuCS','12jSEXKh','isFile','content','version','query','Search\x20query\x20is\x20required.','--topk\x20must\x20be\x20a\x20positive\x20number.','map','/update','Created\x20KB\x20entry\x20','file','num','ragErrorMessage','/client/knowledge-base/personal/create','verbose','File\x20path\x20is\x20required.','1658188zmYhjH','Personal\x20knowledge-base\x20entry\x20ID','用本地文件内容替换个人知识库条目正文,并触发新的检索同步。','trim','scope','metadata','userId','255zfYUCJ','POST','ragStatus','number','topk','Updated\x20KB\x20entry\x20','update','validation','4804VEToUJ','Personal\x20knowledge-base\x20entry\x20title','17218962kweTIr','appCode','根据本地文件创建个人知识库条目','description','updateTime','search','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','body','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','/client/knowledge-base/personal/','write','File\x20is\x20not\x20a\x20regular\x20file:\x20','list','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','read','把本地文件内容保存为个人知识库条目,并进入后续检索同步流程。','5950912oikZpv','str','根据本地文件更新个人知识库条目','createTime','1428970dGKjKA','title'];a32_0x41de=function(){return _0x50a3f3;};return a32_0x41de();}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_0x52a7b6(0x1fe),'type':a32_0x52a7b6(0x203),'required':!![],'description':a32_0x52a7b6(0x1e8)},FILE_FLAG={'name':a32_0x52a7b6(0x1d2),'type':a32_0x52a7b6(0x203),'required':!![],'description':a32_0x52a7b6(0x1f1)},QUERY_FLAG={'name':a32_0x52a7b6(0x1cc),'type':'string','required':!![],'description':a32_0x52a7b6(0x1f6)},TOPK_FLAG={'name':'topk','type':a32_0x52a7b6(0x1e2),'description':a32_0x52a7b6(0x204)};function readKnowledgeFile(_0x3396e5){const _0x15090c=a32_0x52a7b6;if(!_0x3396e5)throw CliErrors[_0x15090c(0x1e6)](_0x15090c(0x1d7));if(!existsSync(_0x3396e5))throw CliErrors[_0x15090c(0x1e6)]('File\x20not\x20found:\x20'+_0x3396e5);if(!statSync(_0x3396e5)[_0x15090c(0x20d)]())throw CliErrors[_0x15090c(0x1e6)](_0x15090c(0x1f4)+_0x3396e5);return readFileSync(_0x3396e5,'utf8');}function summarizePersonalItem(_0x5a3601){const _0x4f1e81=a32_0x52a7b6;return{'id':_0x5a3601['id'],'title':_0x5a3601[_0x4f1e81(0x1fe)],'version':_0x5a3601[_0x4f1e81(0x20f)],'ragStatus':_0x5a3601[_0x4f1e81(0x1e1)],'ragErrorMessage':_0x5a3601[_0x4f1e81(0x1d4)],'updateTime':_0x5a3601[_0x4f1e81(0x1ed)]};}function detailPersonalItem(_0x1a8dcc){const _0xddcb1f=a32_0x52a7b6;return{'id':_0x1a8dcc['id'],'appCode':_0x1a8dcc[_0xddcb1f(0x1ea)],'scope':_0x1a8dcc[_0xddcb1f(0x1dc)],'userId':_0x1a8dcc[_0xddcb1f(0x1de)],'title':_0x1a8dcc[_0xddcb1f(0x1fe)],'content':_0x1a8dcc['content']??'','version':_0x1a8dcc['version'],'ragStatus':_0x1a8dcc['ragStatus'],'ragErrorMessage':_0x1a8dcc[_0xddcb1f(0x1d4)],'createTime':_0x1a8dcc[_0xddcb1f(0x1fc)],'updateTime':_0x1a8dcc[_0xddcb1f(0x1ed)]};}function summarizeSearchHit(_0x5f3c57){const _0x5b6ccb=a32_0x52a7b6;return{'scope':_0x5f3c57['scope'],'title':_0x5f3c57[_0x5b6ccb(0x1fe)],'docId':_0x5f3c57[_0x5b6ccb(0x208)],'score':_0x5f3c57[_0x5b6ccb(0x207)],'weightedScore':_0x5f3c57[_0x5b6ccb(0x209)],'content':_0x5f3c57[_0x5b6ccb(0x20e)],'metadata':_0x5f3c57[_0x5b6ccb(0x1dd)]};}function readTopK(_0x18ad02){const _0x243e61=a32_0x52a7b6,_0x1ba328=_0x18ad02['flag']('topk');if(_0x1ba328===undefined||_0x1ba328===null||_0x1ba328==='')return undefined;const _0x1ab4f0=_0x18ad02[_0x243e61(0x1d3)](_0x243e61(0x1e3));if(!Number[_0x243e61(0x1ff)](_0x1ab4f0)||_0x1ab4f0<0x1)throw CliErrors[_0x243e61(0x1e6)](_0x243e61(0x1ce));return _0x1ab4f0;}const kbList={'service':'kb','command':a32_0x52a7b6(0x1f5),'description':a32_0x52a7b6(0x201),'risk':a32_0x52a7b6(0x1f7),'flags':[VERBOSE_FLAG],async 'execute'(_0x501338){const _0x320fa0=a32_0x52a7b6,_0x1c0f98=await listPersonalKnowledgeBaseItems(_0x501338['appCode']);if(_0x501338['bool'](_0x320fa0(0x1d6)))return{'ok':!![],'data':{'total':_0x1c0f98[_0x320fa0(0x206)],'items':_0x1c0f98}};return{'ok':!![],'data':{'total':_0x1c0f98[_0x320fa0(0x206)],'items':_0x1c0f98[_0x320fa0(0x1cf)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':a32_0x52a7b6(0x205),'risk':a32_0x52a7b6(0x1f7),'flags':[{...ID_FLAG,'description':a32_0x52a7b6(0x1d9)}],async 'execute'(_0x2f8390){const _0x2b0354=a32_0x52a7b6,_0xab540d=await getPersonalKnowledgeBaseItem(_0x2f8390[_0x2b0354(0x1d3)]('id'),_0x2f8390['appCode']);return{'ok':!![],'data':detailPersonalItem(_0xab540d)};}},kbCreate={'service':'kb','command':a32_0x52a7b6(0x200),'description':a32_0x52a7b6(0x1eb),'risk':a32_0x52a7b6(0x1f3),'confirmationDescription':a32_0x52a7b6(0x1f8),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x512beb){const _0x596e21=a32_0x52a7b6,_0x3645cd=_0x512beb['str'](_0x596e21(0x1fe)),_0x1b58bc=readKnowledgeFile(_0x512beb[_0x596e21(0x1fa)]('file')),_0x580260=await createPersonalKnowledgeBaseItem(_0x512beb[_0x596e21(0x1ea)],{'title':_0x3645cd,'content':_0x1b58bc});return{'ok':!![],'data':summarizePersonalItem(_0x580260),'message':_0x596e21(0x1d1)+_0x580260['id']+'\x20('+_0x580260['title']+')'};},async 'dryRun'(_0x29e8b6){const _0x232259=a32_0x52a7b6,_0x18dd87=_0x29e8b6[_0x232259(0x1fa)](_0x232259(0x1fe)),_0x59a26b=readKnowledgeFile(_0x29e8b6['str']('file'));return dryRun(_0x232259(0x1e0),_0x232259(0x1d5))[_0x232259(0x1f0)]({'appCode':_0x29e8b6[_0x232259(0x1ea)],'title':_0x18dd87,'content':_0x59a26b})[_0x232259(0x1ec)]('Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22'+_0x18dd87+'\x22')['build']();}},kbUpdate={'service':'kb','command':a32_0x52a7b6(0x1e5),'description':a32_0x52a7b6(0x1fb),'risk':a32_0x52a7b6(0x1f3),'confirmationDescription':a32_0x52a7b6(0x1da),'flags':[{...ID_FLAG,'description':a32_0x52a7b6(0x1d9)},{...TITLE_FLAG,'required':![],'description':a32_0x52a7b6(0x20a)},FILE_FLAG],async 'execute'(_0x40b8f8){const _0x107ff7=a32_0x52a7b6,_0x1e50a8=_0x40b8f8[_0x107ff7(0x1d3)]('id'),_0x245bfc=readKnowledgeFile(_0x40b8f8[_0x107ff7(0x1fa)](_0x107ff7(0x1d2))),_0x384b98=_0x40b8f8['str'](_0x107ff7(0x1fe))||(await getPersonalKnowledgeBaseItem(_0x1e50a8,_0x40b8f8['appCode']))['title'],_0x4878fa=await updatePersonalKnowledgeBaseItem(_0x1e50a8,_0x40b8f8['appCode'],{'title':_0x384b98,'content':_0x245bfc});return{'ok':!![],'data':summarizePersonalItem(_0x4878fa),'message':_0x107ff7(0x1e4)+_0x4878fa['id']+'\x20('+_0x4878fa[_0x107ff7(0x1fe)]+')'};},async 'dryRun'(_0x22ee04){const _0x2ccf7d=a32_0x52a7b6,_0x195c69=_0x22ee04[_0x2ccf7d(0x1d3)]('id'),_0x37671c=readKnowledgeFile(_0x22ee04[_0x2ccf7d(0x1fa)](_0x2ccf7d(0x1d2))),_0x50e03f=_0x22ee04[_0x2ccf7d(0x1fa)](_0x2ccf7d(0x1fe))||(await getPersonalKnowledgeBaseItem(_0x195c69,_0x22ee04[_0x2ccf7d(0x1ea)]))[_0x2ccf7d(0x1fe)];return dryRun(_0x2ccf7d(0x1e0),_0x2ccf7d(0x1f2)+_0x195c69+_0x2ccf7d(0x1d0))[_0x2ccf7d(0x1f0)]({'appCode':_0x22ee04['appCode'],'title':_0x50e03f,'content':_0x37671c})[_0x2ccf7d(0x1ec)](_0x2ccf7d(0x1ef)+_0x195c69)['build']();}},kbSearch={'service':'kb','command':a32_0x52a7b6(0x1ee),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':a32_0x52a7b6(0x1f7),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x105dfb){const _0x448cc1=a32_0x52a7b6;if(!_0x105dfb['str'](_0x448cc1(0x1cc))['trim']())throw CliErrors[_0x448cc1(0x1e6)](_0x448cc1(0x1cd));readTopK(_0x105dfb);},async 'execute'(_0x187cd4){const _0x4584b0=a32_0x52a7b6,_0x580b01=_0x187cd4[_0x4584b0(0x1fa)](_0x4584b0(0x1cc))[_0x4584b0(0x1db)](),_0x467465=readTopK(_0x187cd4),_0x10c1aa=await searchKnowledgeBase(_0x187cd4['appCode'],{'query':_0x580b01,'topK':_0x467465});return{'ok':!![],'data':{'total':_0x10c1aa['length'],'hits':_0x10c1aa[_0x4584b0(0x1cf)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
1
+ const a32_0x168118=a32_0x30bb;function a32_0x30bb(_0x3db67a,_0x27f398){_0x3db67a=_0x3db67a-0x1d7;const _0x42ef45=a32_0x42ef();let _0x30bbaa=_0x42ef45[_0x3db67a];return _0x30bbaa;}(function(_0x390e84,_0x2a1fd8){const _0x1dc99a=a32_0x30bb,_0x311e71=_0x390e84();while(!![]){try{const _0x522513=-parseInt(_0x1dc99a(0x1e2))/0x1*(parseInt(_0x1dc99a(0x20e))/0x2)+-parseInt(_0x1dc99a(0x209))/0x3*(parseInt(_0x1dc99a(0x1db))/0x4)+parseInt(_0x1dc99a(0x217))/0x5*(-parseInt(_0x1dc99a(0x20b))/0x6)+parseInt(_0x1dc99a(0x1ec))/0x7+-parseInt(_0x1dc99a(0x216))/0x8+parseInt(_0x1dc99a(0x1ef))/0x9*(parseInt(_0x1dc99a(0x1ee))/0xa)+parseInt(_0x1dc99a(0x1fd))/0xb;if(_0x522513===_0x2a1fd8)break;else _0x311e71['push'](_0x311e71['shift']());}catch(_0x3fc26d){_0x311e71['push'](_0x311e71['shift']());}}}(a32_0x42ef,0x19212));import{existsSync,readFileSync,statSync}from'node:fs';function a32_0x42ef(){const _0x358376=['Search\x20query\x20is\x20required.','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','--topk\x20must\x20be\x20a\x20positive\x20number.','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','file','detail','body','topk','3040939hcJrCS','length','str','isFile','description','write','ragStatus','File\x20is\x20not\x20a\x20regular\x20file:\x20','ragErrorMessage','isFinite','query','num','8049sSocVn','weightedScore','12yakxJR','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','Personal\x20knowledge-base\x20entry\x20title','119078UPdqjx','POST','Updated\x20KB\x20entry\x20','metadata','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','updateTime','File\x20path\x20is\x20required.','/update','1347536COKqwP','137285ffEZZn','File\x20not\x20found:\x20','content','把本地文件内容保存为个人知识库条目,并进入后续检索同步流程。','Override\x20the\x20existing\x20entry\x20title','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','score','map','create','title','version','validation','184CrviaA','Personal\x20knowledge-base\x20entry\x20ID','用本地文件内容替换个人知识库条目正文,并触发新的检索同步。','scope','/client/knowledge-base/personal/','userId','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','1DXfbsW','flag','根据本地文件更新个人知识库条目','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','search','string','appCode','/client/knowledge-base/personal/create','read','createTime','620102VtUvEC','docId','20rFYJMy','648936UEPQgE','根据本地文件创建个人知识库条目','verbose','Created\x20KB\x20entry\x20','build','trim'];a32_0x42ef=function(){return _0x358376;};return a32_0x42ef();}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_0x168118(0x1d8),'type':'string','required':!![],'description':a32_0x168118(0x20d)},FILE_FLAG={'name':a32_0x168118(0x1f9),'type':a32_0x168118(0x1e7),'required':!![],'description':a32_0x168118(0x20c)},QUERY_FLAG={'name':a32_0x168118(0x207),'type':'string','required':!![],'description':a32_0x168118(0x212)},TOPK_FLAG={'name':'topk','type':'number','description':a32_0x168118(0x1e1)};function readKnowledgeFile(_0xd20930){const _0x30627c=a32_0x168118;if(!_0xd20930)throw CliErrors[_0x30627c(0x1da)](_0x30627c(0x214));if(!existsSync(_0xd20930))throw CliErrors['validation'](_0x30627c(0x218)+_0xd20930);if(!statSync(_0xd20930)[_0x30627c(0x200)]())throw CliErrors[_0x30627c(0x1da)](_0x30627c(0x204)+_0xd20930);return readFileSync(_0xd20930,'utf8');}function summarizePersonalItem(_0x16244b){const _0x1017c1=a32_0x168118;return{'id':_0x16244b['id'],'title':_0x16244b[_0x1017c1(0x1d8)],'version':_0x16244b[_0x1017c1(0x1d9)],'ragStatus':_0x16244b['ragStatus'],'ragErrorMessage':_0x16244b[_0x1017c1(0x205)],'updateTime':_0x16244b['updateTime']};}function detailPersonalItem(_0xbd21bb){const _0x178b89=a32_0x168118;return{'id':_0xbd21bb['id'],'appCode':_0xbd21bb[_0x178b89(0x1e8)],'scope':_0xbd21bb[_0x178b89(0x1de)],'userId':_0xbd21bb[_0x178b89(0x1e0)],'title':_0xbd21bb[_0x178b89(0x1d8)],'content':_0xbd21bb[_0x178b89(0x219)]??'','version':_0xbd21bb[_0x178b89(0x1d9)],'ragStatus':_0xbd21bb[_0x178b89(0x203)],'ragErrorMessage':_0xbd21bb['ragErrorMessage'],'createTime':_0xbd21bb[_0x178b89(0x1eb)],'updateTime':_0xbd21bb[_0x178b89(0x213)]};}function summarizeSearchHit(_0x129e04){const _0xc54381=a32_0x168118;return{'scope':_0x129e04[_0xc54381(0x1de)],'title':_0x129e04['title'],'docId':_0x129e04[_0xc54381(0x1ed)],'score':_0x129e04[_0xc54381(0x21d)],'weightedScore':_0x129e04[_0xc54381(0x20a)],'content':_0x129e04[_0xc54381(0x219)],'metadata':_0x129e04[_0xc54381(0x211)]};}function readTopK(_0x5a024c){const _0x2761c1=a32_0x168118,_0x404301=_0x5a024c[_0x2761c1(0x1e3)](_0x2761c1(0x1fc));if(_0x404301===undefined||_0x404301===null||_0x404301==='')return undefined;const _0x537f61=_0x5a024c[_0x2761c1(0x208)]('topk');if(!Number[_0x2761c1(0x206)](_0x537f61)||_0x537f61<0x1)throw CliErrors[_0x2761c1(0x1da)](_0x2761c1(0x1f7));return _0x537f61;}const kbList={'service':'kb','command':'list','description':a32_0x168118(0x1f8),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0xc8b89a){const _0x197a02=a32_0x168118,_0x441c31=await listPersonalKnowledgeBaseItems(_0xc8b89a['appCode']);if(_0xc8b89a['bool'](_0x197a02(0x1f1)))return{'ok':!![],'data':{'total':_0x441c31['length'],'items':_0x441c31}};return{'ok':!![],'data':{'total':_0x441c31[_0x197a02(0x1fe)],'items':_0x441c31['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x168118(0x1fa),'description':a32_0x168118(0x21c),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x168118(0x1dc)}],async 'execute'(_0xa2bd2b){const _0x482176=a32_0x168118,_0x4fb64a=await getPersonalKnowledgeBaseItem(_0xa2bd2b['num']('id'),_0xa2bd2b[_0x482176(0x1e8)]);return{'ok':!![],'data':detailPersonalItem(_0x4fb64a)};}},kbCreate={'service':'kb','command':a32_0x168118(0x1d7),'description':a32_0x168118(0x1f0),'risk':a32_0x168118(0x202),'confirmationDescription':a32_0x168118(0x21a),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x5d5953){const _0x18c937=a32_0x168118,_0xc48ed5=_0x5d5953['str'](_0x18c937(0x1d8)),_0xf8748d=readKnowledgeFile(_0x5d5953[_0x18c937(0x1ff)]('file')),_0x231313=await createPersonalKnowledgeBaseItem(_0x5d5953[_0x18c937(0x1e8)],{'title':_0xc48ed5,'content':_0xf8748d});return{'ok':!![],'data':summarizePersonalItem(_0x231313),'message':_0x18c937(0x1f2)+_0x231313['id']+'\x20('+_0x231313[_0x18c937(0x1d8)]+')'};},async 'dryRun'(_0x45baf6){const _0x536a60=a32_0x168118,_0xae08=_0x45baf6[_0x536a60(0x1ff)](_0x536a60(0x1d8)),_0x5dc5a2=readKnowledgeFile(_0x45baf6['str']('file'));return dryRun(_0x536a60(0x20f),_0x536a60(0x1e9))[_0x536a60(0x1fb)]({'appCode':_0x45baf6[_0x536a60(0x1e8)],'title':_0xae08,'content':_0x5dc5a2})[_0x536a60(0x201)](_0x536a60(0x1f6)+_0xae08+'\x22')['build']();}},kbUpdate={'service':'kb','command':'update','description':a32_0x168118(0x1e4),'risk':a32_0x168118(0x202),'confirmationDescription':a32_0x168118(0x1dd),'flags':[{...ID_FLAG,'description':a32_0x168118(0x1dc)},{...TITLE_FLAG,'required':![],'description':a32_0x168118(0x21b)},FILE_FLAG],async 'execute'(_0x551b3b){const _0x3b339d=a32_0x168118,_0x34201b=_0x551b3b[_0x3b339d(0x208)]('id'),_0x35195a=readKnowledgeFile(_0x551b3b[_0x3b339d(0x1ff)](_0x3b339d(0x1f9))),_0x1ccfa9=_0x551b3b['str'](_0x3b339d(0x1d8))||(await getPersonalKnowledgeBaseItem(_0x34201b,_0x551b3b[_0x3b339d(0x1e8)]))[_0x3b339d(0x1d8)],_0x168202=await updatePersonalKnowledgeBaseItem(_0x34201b,_0x551b3b[_0x3b339d(0x1e8)],{'title':_0x1ccfa9,'content':_0x35195a});return{'ok':!![],'data':summarizePersonalItem(_0x168202),'message':_0x3b339d(0x210)+_0x168202['id']+'\x20('+_0x168202['title']+')'};},async 'dryRun'(_0x8322d6){const _0x25292d=a32_0x168118,_0x27a197=_0x8322d6['num']('id'),_0x493490=readKnowledgeFile(_0x8322d6[_0x25292d(0x1ff)](_0x25292d(0x1f9))),_0x4e44c4=_0x8322d6[_0x25292d(0x1ff)](_0x25292d(0x1d8))||(await getPersonalKnowledgeBaseItem(_0x27a197,_0x8322d6[_0x25292d(0x1e8)]))[_0x25292d(0x1d8)];return dryRun(_0x25292d(0x20f),_0x25292d(0x1df)+_0x27a197+_0x25292d(0x215))['body']({'appCode':_0x8322d6[_0x25292d(0x1e8)],'title':_0x4e44c4,'content':_0x493490})[_0x25292d(0x201)](_0x25292d(0x1e5)+_0x27a197)[_0x25292d(0x1f3)]();}},kbSearch={'service':'kb','command':a32_0x168118(0x1e6),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':a32_0x168118(0x1ea),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x3ca31a){const _0x409549=a32_0x168118;if(!_0x3ca31a[_0x409549(0x1ff)](_0x409549(0x207))[_0x409549(0x1f4)]())throw CliErrors[_0x409549(0x1da)](_0x409549(0x1f5));readTopK(_0x3ca31a);},async 'execute'(_0x5829e8){const _0x42e8f3=a32_0x168118,_0x39e065=_0x5829e8[_0x42e8f3(0x1ff)](_0x42e8f3(0x207))[_0x42e8f3(0x1f4)](),_0x109d9f=readTopK(_0x5829e8),_0x5e7d0d=await searchKnowledgeBase(_0x5829e8['appCode'],{'query':_0x39e065,'topK':_0x109d9f});return{'ok':!![],'data':{'total':_0x5e7d0d[_0x42e8f3(0x1fe)],'hits':_0x5e7d0d[_0x42e8f3(0x21e)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
@@ -1 +1 @@
1
- function a33_0xe8b2(){const _0x2d42a5=['3187683nEaezS','View\x20command\x20history\x20logs','\x20logs:\x0a','show','details','error','4gbeMjv','*\x20No\x20logs\x20found','9630180vaQXDK','logs','64QHHteA','6dQhqbl','56yYumzq','45162535IrRpYE','forEach','3760605PMsBrR','log','510354yJHrlL','level','readLogs','stringify','19732ZVThtw','timestamp','\x20\x20\x20Details:\x20','10985100BwURpr','toLocaleString','en-US','read','length'];a33_0xe8b2=function(){return _0x2d42a5;};return a33_0xe8b2();}const a33_0x5af82f=a33_0x4b81;(function(_0x16071d,_0x2cd288){const _0x1cd03c=a33_0x4b81,_0x54bdc0=_0x16071d();while(!![]){try{const _0x2c490c=-parseInt(_0x1cd03c(0x7f))/0x1*(-parseInt(_0x1cd03c(0x74))/0x2)+parseInt(_0x1cd03c(0x6a))/0x3*(-parseInt(_0x1cd03c(0x70))/0x4)+-parseInt(_0x1cd03c(0x79))/0x5+-parseInt(_0x1cd03c(0x75))/0x6*(parseInt(_0x1cd03c(0x72))/0x7)+-parseInt(_0x1cd03c(0x76))/0x8*(-parseInt(_0x1cd03c(0x7b))/0x9)+-parseInt(_0x1cd03c(0x65))/0xa+parseInt(_0x1cd03c(0x77))/0xb;if(_0x2c490c===_0x2cd288)break;else _0x54bdc0['push'](_0x54bdc0['shift']());}catch(_0x4ad418){_0x54bdc0['push'](_0x54bdc0['shift']());}}}(a33_0xe8b2,0xce53f));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a33_0x4b81(_0x2a7d41,_0x248272){_0x2a7d41=_0x2a7d41-0x64;const _0xe8b222=a33_0xe8b2();let _0x4b81ee=_0xe8b222[_0x2a7d41];return _0x4b81ee;}function printLogs(_0x200475){const _0x2833f6=a33_0x4b81;if(_0x200475[_0x2833f6(0x69)]===0x0){console['log'](_0x2833f6(0x71));return;}console[_0x2833f6(0x7a)]('*\x20'+CLI_DISPLAY_NAME+_0x2833f6(0x6c)),_0x200475[_0x2833f6(0x78)]((_0x136e75,_0x156bd0)=>{const _0x20e012=_0x2833f6,_0x55bc92=new Date(_0x136e75[_0x20e012(0x80)])[_0x20e012(0x66)](_0x20e012(0x67)),_0x1a874f=_0x136e75['level']==='success'?'√':_0x136e75[_0x20e012(0x7c)]===_0x20e012(0x6f)?'×':_0x136e75[_0x20e012(0x7c)]==='warn'?'!':'i';console[_0x20e012(0x7a)](_0x156bd0+0x1+'.\x20'+_0x1a874f+'\x20['+_0x136e75['command']+']\x20'+_0x136e75['message']),console[_0x20e012(0x7a)]('\x20\x20\x20Time:\x20'+_0x55bc92),_0x136e75['duration']&&console[_0x20e012(0x7a)]('\x20\x20\x20Duration:\x20'+_0x136e75['duration']+'ms'),_0x136e75[_0x20e012(0x6e)]&&Object['keys'](_0x136e75[_0x20e012(0x6e)])[_0x20e012(0x69)]>0x0&&console['log'](_0x20e012(0x64)+JSON[_0x20e012(0x7e)](_0x136e75[_0x20e012(0x6e)],null,0x2)),console['log']('');});}export const logsDefinitions=[{'service':a33_0x5af82f(0x73),'command':a33_0x5af82f(0x6d),'description':a33_0x5af82f(0x6b),'risk':a33_0x5af82f(0x68),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1a3f73){const _0x5b6ddb=a33_0x5af82f;return printLogs(logger[_0x5b6ddb(0x7d)]()),{'ok':!![]};}}];
1
+ const a33_0x366d8c=a33_0x3ccc;(function(_0x4d3200,_0x4eec75){const _0xdf3d7f=a33_0x3ccc,_0x34d5f8=_0x4d3200();while(!![]){try{const _0x4fec25=-parseInt(_0xdf3d7f(0x1f7))/0x1+parseInt(_0xdf3d7f(0x1ef))/0x2*(-parseInt(_0xdf3d7f(0x1fa))/0x3)+parseInt(_0xdf3d7f(0x200))/0x4+parseInt(_0xdf3d7f(0x1fc))/0x5*(parseInt(_0xdf3d7f(0x1fb))/0x6)+parseInt(_0xdf3d7f(0x1f0))/0x7*(-parseInt(_0xdf3d7f(0x1ff))/0x8)+parseInt(_0xdf3d7f(0x1f4))/0x9+parseInt(_0xdf3d7f(0x1fe))/0xa;if(_0x4fec25===_0x4eec75)break;else _0x34d5f8['push'](_0x34d5f8['shift']());}catch(_0x25b4ac){_0x34d5f8['push'](_0x34d5f8['shift']());}}}(a33_0x2227,0x8d44e));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a33_0x2227(){const _0x3d6d2f=['4216419EBvbKk','details','\x20\x20\x20Details:\x20','599291hIHJJl','*\x20No\x20logs\x20found','success','353217Mlfaax','1380ynPRDq','6000KbCWJE','read','10324790pFSVFm','683896DCBovN','42548QzPcUp','level','keys','readLogs','\x20\x20\x20Duration:\x20','\x20\x20\x20Time:\x20','logs','length','timestamp','warn','log','show','\x20logs:\x0a','6IcXOKS','21iliJcg','toLocaleString','duration','en-US'];a33_0x2227=function(){return _0x3d6d2f;};return a33_0x2227();}function a33_0x3ccc(_0x3b6da6,_0xd11ceb){_0x3b6da6=_0x3b6da6-0x1e4;const _0x2227ae=a33_0x2227();let _0x3ccc0a=_0x2227ae[_0x3b6da6];return _0x3ccc0a;}function printLogs(_0xd0293){const _0x3da1f1=a33_0x3ccc;if(_0xd0293[_0x3da1f1(0x1e9)]===0x0){console[_0x3da1f1(0x1ec)](_0x3da1f1(0x1f8));return;}console[_0x3da1f1(0x1ec)]('*\x20'+CLI_DISPLAY_NAME+_0x3da1f1(0x1ee)),_0xd0293['forEach']((_0x518ee1,_0x2e70fc)=>{const _0x276880=_0x3da1f1,_0x54fc06=new Date(_0x518ee1[_0x276880(0x1ea)])[_0x276880(0x1f1)](_0x276880(0x1f3)),_0x518533=_0x518ee1['level']===_0x276880(0x1f9)?'√':_0x518ee1[_0x276880(0x201)]==='error'?'×':_0x518ee1[_0x276880(0x201)]===_0x276880(0x1eb)?'!':'i';console['log'](_0x2e70fc+0x1+'.\x20'+_0x518533+'\x20['+_0x518ee1['command']+']\x20'+_0x518ee1['message']),console[_0x276880(0x1ec)](_0x276880(0x1e7)+_0x54fc06),_0x518ee1[_0x276880(0x1f2)]&&console['log'](_0x276880(0x1e6)+_0x518ee1[_0x276880(0x1f2)]+'ms'),_0x518ee1[_0x276880(0x1f5)]&&Object[_0x276880(0x1e4)](_0x518ee1[_0x276880(0x1f5)])[_0x276880(0x1e9)]>0x0&&console[_0x276880(0x1ec)](_0x276880(0x1f6)+JSON['stringify'](_0x518ee1['details'],null,0x2)),console[_0x276880(0x1ec)]('');});}export const logsDefinitions=[{'service':a33_0x366d8c(0x1e8),'command':a33_0x366d8c(0x1ed),'description':'View\x20command\x20history\x20logs','risk':a33_0x366d8c(0x1fd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x363173){const _0x57422b=a33_0x366d8c;return printLogs(logger[_0x57422b(0x1e5)]()),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a34_0x5a5ba0=a34_0xb46f;(function(_0xef2560,_0x1fa8f0){const _0x2ec8fe=a34_0xb46f,_0x60a152=_0xef2560();while(!![]){try{const _0x5dc00a=-parseInt(_0x2ec8fe(0x17c))/0x1*(parseInt(_0x2ec8fe(0x199))/0x2)+-parseInt(_0x2ec8fe(0x172))/0x3*(parseInt(_0x2ec8fe(0x187))/0x4)+-parseInt(_0x2ec8fe(0x19a))/0x5+-parseInt(_0x2ec8fe(0x191))/0x6*(-parseInt(_0x2ec8fe(0x175))/0x7)+parseInt(_0x2ec8fe(0x19d))/0x8+-parseInt(_0x2ec8fe(0x19e))/0x9+-parseInt(_0x2ec8fe(0x16a))/0xa*(-parseInt(_0x2ec8fe(0x167))/0xb);if(_0x5dc00a===_0x1fa8f0)break;else _0x60a152['push'](_0x60a152['shift']());}catch(_0x3a3597){_0x60a152['push'](_0x60a152['shift']());}}}(a34_0x4699,0x82ab8));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';function a34_0xb46f(_0x475ab9,_0x473500){_0x475ab9=_0x475ab9-0x166;const _0x4699fc=a34_0x4699();let _0xb46f57=_0x4699fc[_0x475ab9];return _0xb46f57;}function a34_0x4699(){const _0x2e2aca=['174645PiMNNV','trim','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','6539920wpMmpf','6730812YiJsHU','fileUrl','Preview:\x20recognize\x20','25949mtabnB','build','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','440poeqWq','Invoice','string','general','idcard','path','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','<filePath\x20returned\x20by\x20/client/uploadFile>','182271HtsmTJ','/client/ocr','ocr','7066262orlXao','fileName','body','idCard','Table','description','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','1XXwHiO','form','recognize','filePath','POST','length','read','General','.\x20Supported\x20scenes:\x20','join','File\x20upload\x20response\x20missing\x20filePath.','16GyrwVl','Unsupported\x20OCR\x20scene:\x20','str','image-url','imageUrl','/client/queryFileUrl','validation','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','scene','\x20OCR\x20from\x20URL','6xcmQBX','/client/uploadFile','toLowerCase','imageFile','appCode','\x20OCR','invoice','image-file','739406cvRAvh'];a34_0x4699=function(){return _0x2e2aca;};return a34_0x4699();}import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x5a5ba0(0x197),a34_0x5a5ba0(0x16d),a34_0x5a5ba0(0x17d),'idCard'],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x5a5ba0(0x16b),'general':a34_0x5a5ba0(0x183),'form':a34_0x5a5ba0(0x179),'idCard':'IdCard'},SCENE_FLAG={'name':a34_0x5a5ba0(0x18f),'type':a34_0x5a5ba0(0x16c),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x5a5ba0(0x169)},IMAGE_FILE_FLAG={'name':a34_0x5a5ba0(0x198),'type':a34_0x5a5ba0(0x16c),'description':a34_0x5a5ba0(0x18e)},IMAGE_URL_FLAG={'name':a34_0x5a5ba0(0x18a),'type':a34_0x5a5ba0(0x16c),'description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x1f4d87){const _0x43dd4f=a34_0x5a5ba0,_0x5e5b27=_0x1f4d87[_0x43dd4f(0x19b)]()[_0x43dd4f(0x193)]();if(_0x5e5b27===_0x43dd4f(0x16e))return _0x43dd4f(0x178);if(_0x5e5b27===_0x43dd4f(0x197)||_0x5e5b27===_0x43dd4f(0x16d)||_0x5e5b27==='form')return _0x5e5b27;throw CliErrors['validation'](_0x43dd4f(0x188)+_0x1f4d87+_0x43dd4f(0x184)+SUPPORTED_SCENES[_0x43dd4f(0x185)](',\x20'));}function selectedInputs(_0x17c4c1){const _0x5a8450=a34_0x5a5ba0,_0x84eff3=_0x17c4c1[_0x5a8450(0x189)](_0x5a8450(0x198))[_0x5a8450(0x19b)](),_0x590f35=_0x17c4c1['str']('image-url')[_0x5a8450(0x19b)]();return{'imageFile':_0x84eff3,'imageUrl':_0x590f35,'count':[_0x84eff3,_0x590f35]['filter'](Boolean)[_0x5a8450(0x181)]};}function validateInputSelection(_0x5d0562){const _0x896788=a34_0x5a5ba0,_0x1ea170=selectedInputs(_0x5d0562);if(_0x1ea170['count']!==0x1)throw CliErrors[_0x896788(0x18d)](_0x896788(0x19c));return _0x1ea170;}function withScene(_0x13dcbd,_0x14aa0e,_0x5a74c0){const _0x32dd3e=a34_0x5a5ba0;return{..._0x13dcbd,'scene':_0x14aa0e,..._0x5a74c0?{'sourceFile':{'fileName':_0x5a74c0[_0x32dd3e(0x176)],'filePath':_0x5a74c0[_0x32dd3e(0x17f)]}}:{}};}const ocrRecognize={'service':a34_0x5a5ba0(0x174),'command':a34_0x5a5ba0(0x17e),'description':'使用运行态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','risk':a34_0x5a5ba0(0x182),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x2cb419){const _0x3c9506=a34_0x5a5ba0,_0x5b2f4d=normalizeScene(_0x2cb419[_0x3c9506(0x189)](_0x3c9506(0x18f))),_0xc2d612=SCENE_TO_LEGACY_TYPE[_0x5b2f4d],_0x35038f=validateInputSelection(_0x2cb419);if(_0x35038f['imageUrl'])return dryRun(_0x3c9506(0x180),_0x3c9506(0x173))[_0x3c9506(0x177)]({'appCode':_0x2cb419[_0x3c9506(0x195)],'url':_0x35038f[_0x3c9506(0x18b)],'type':_0xc2d612})[_0x3c9506(0x17a)](_0x3c9506(0x166)+_0x5b2f4d+_0x3c9506(0x190))[_0x3c9506(0x168)]();const _0x782006=requireRuntimeUploadFile(_0x35038f[_0x3c9506(0x194)],_0x3c9506(0x198));return dryRun(_0x3c9506(0x180),_0x3c9506(0x192))[_0x3c9506(0x177)]({'steps':[{'method':_0x3c9506(0x180),'url':_0x3c9506(0x192),'body':{'appCode':_0x2cb419[_0x3c9506(0x195)],'multipart':{'file':_0x782006}}},{'method':_0x3c9506(0x180),'url':_0x3c9506(0x18c),'body':{'filePath':_0x3c9506(0x171),'downloadFlag':![]}},{'method':_0x3c9506(0x180),'url':'/client/ocr','body':{'appCode':_0x2cb419[_0x3c9506(0x195)],'url':_0x3c9506(0x170),'type':_0xc2d612}}]})[_0x3c9506(0x17a)](_0x3c9506(0x17b)+_0x5b2f4d+_0x3c9506(0x196))[_0x3c9506(0x168)]();},async 'execute'(_0x59c455){const _0x4e7d05=a34_0x5a5ba0,_0x5001a1=normalizeScene(_0x59c455[_0x4e7d05(0x189)]('scene')),_0x286244=SCENE_TO_LEGACY_TYPE[_0x5001a1],_0x541fdc=validateInputSelection(_0x59c455);if(_0x541fdc[_0x4e7d05(0x18b)]){const _0x1a1ea4=await recognizeRuntimeOcr(_0x59c455[_0x4e7d05(0x195)],{'url':_0x541fdc[_0x4e7d05(0x18b)],'type':_0x286244});return{'ok':!![],'data':withScene(_0x1a1ea4,_0x5001a1)};}const _0x1e21fa=requireRuntimeUploadFile(_0x541fdc[_0x4e7d05(0x194)],'image-file'),_0x398b0a=await uploadRuntimeFile(_0x59c455['appCode'],_0x1e21fa[_0x4e7d05(0x16f)]);if(!_0x398b0a[_0x4e7d05(0x17f)])throw CliErrors['apiError'](_0x4e7d05(0x186));const _0x1a2e69=await queryRuntimeFileUrl(_0x398b0a['filePath'],{'download':![]});if(!_0x1a2e69[_0x4e7d05(0x19f)])throw CliErrors['apiError']('File\x20URL\x20response\x20missing\x20fileUrl.');const _0x53cbf6=await recognizeRuntimeOcr(_0x59c455[_0x4e7d05(0x195)],{'url':_0x1a2e69[_0x4e7d05(0x19f)],'type':_0x286244});return{'ok':!![],'data':withScene(_0x53cbf6,_0x5001a1,_0x398b0a)};}};export const ocrDefinitions=[ocrRecognize];
1
+ const a34_0x3bc1db=a34_0x2ba0;(function(_0x54ea74,_0x27836b){const _0x3af8b8=a34_0x2ba0,_0x256a9b=_0x54ea74();while(!![]){try{const _0x46e3a1=-parseInt(_0x3af8b8(0x82))/0x1+parseInt(_0x3af8b8(0x72))/0x2*(-parseInt(_0x3af8b8(0x92))/0x3)+-parseInt(_0x3af8b8(0x8f))/0x4*(-parseInt(_0x3af8b8(0x8e))/0x5)+-parseInt(_0x3af8b8(0x7c))/0x6*(-parseInt(_0x3af8b8(0x77))/0x7)+parseInt(_0x3af8b8(0x73))/0x8*(parseInt(_0x3af8b8(0x88))/0x9)+parseInt(_0x3af8b8(0xa8))/0xa+-parseInt(_0x3af8b8(0x8d))/0xb*(parseInt(_0x3af8b8(0x76))/0xc);if(_0x46e3a1===_0x27836b)break;else _0x256a9b['push'](_0x256a9b['shift']());}catch(_0x28b4e9){_0x256a9b['push'](_0x256a9b['shift']());}}}(a34_0x9bbf,0xd9c00));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_0x3bc1db(0x8a),a34_0x3bc1db(0x9a),a34_0x3bc1db(0x7d),a34_0x3bc1db(0xa5)],SCENE_TO_LEGACY_TYPE={'invoice':'Invoice','general':'General','form':a34_0x3bc1db(0x99),'idCard':a34_0x3bc1db(0xa7)},SCENE_FLAG={'name':a34_0x3bc1db(0x9d),'type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x3bc1db(0x89)},IMAGE_FILE_FLAG={'name':a34_0x3bc1db(0xa6),'type':'string','description':a34_0x3bc1db(0x95)},IMAGE_URL_FLAG={'name':a34_0x3bc1db(0x84),'type':a34_0x3bc1db(0x9f),'description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x3aa69a){const _0x2b94af=a34_0x3bc1db,_0x577505=_0x3aa69a[_0x2b94af(0xa4)]()['toLowerCase']();if(_0x577505===_0x2b94af(0x96))return _0x2b94af(0xa5);if(_0x577505===_0x2b94af(0x8a)||_0x577505==='general'||_0x577505===_0x2b94af(0x7d))return _0x577505;throw CliErrors[_0x2b94af(0x98)](_0x2b94af(0x7b)+_0x3aa69a+_0x2b94af(0x7e)+SUPPORTED_SCENES[_0x2b94af(0x97)](',\x20'));}function a34_0x2ba0(_0x3cb0f4,_0x12f1d2){_0x3cb0f4=_0x3cb0f4-0x72;const _0x9bbfba=a34_0x9bbf();let _0x2ba0a3=_0x9bbfba[_0x3cb0f4];return _0x2ba0a3;}function selectedInputs(_0x3800d8){const _0x298398=a34_0x3bc1db,_0x8c8748=_0x3800d8[_0x298398(0xa2)](_0x298398(0xa6))[_0x298398(0xa4)](),_0x380d9a=_0x3800d8[_0x298398(0xa2)]('image-url')[_0x298398(0xa4)]();return{'imageFile':_0x8c8748,'imageUrl':_0x380d9a,'count':[_0x8c8748,_0x380d9a]['filter'](Boolean)[_0x298398(0x8c)]};}function validateInputSelection(_0x348b30){const _0x3feeb5=a34_0x3bc1db,_0x9704a4=selectedInputs(_0x348b30);if(_0x9704a4['count']!==0x1)throw CliErrors[_0x3feeb5(0x98)](_0x3feeb5(0x7a));return _0x9704a4;}function withScene(_0x4e397a,_0x2de16a,_0x5222b5){const _0x5527d1=a34_0x3bc1db;return{..._0x4e397a,'scene':_0x2de16a,..._0x5222b5?{'sourceFile':{'fileName':_0x5222b5[_0x5527d1(0x80)],'filePath':_0x5222b5['filePath']}}:{}};}function a34_0x9bbf(){const _0x368dec=['使用运行态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','scene','description','string','body','recognize','str','path','trim','idCard','image-file','IdCard','13263140dknoOv','359330hByejl','104lHLzfu','<filePath\x20returned\x20by\x20/client/uploadFile>','\x20OCR\x20from\x20URL','9273048bWouWi','28UPvYkC','appCode','apiError','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','Unsupported\x20OCR\x20scene:\x20','1100184sOXXvO','form','.\x20Supported\x20scenes:\x20','imageFile','fileName','read','495506XpugtM','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','image-url','POST','/client/uploadFile','/client/queryFileUrl','871866QJgCBQ','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','invoice','imageUrl','length','22xKVXOx','5iHQGqG','2048444XVbWGB','build','File\x20URL\x20response\x20missing\x20fileUrl.','15ihInSm','ocr','fileUrl','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','idcard','join','validation','Table','general','\x20OCR'];a34_0x9bbf=function(){return _0x368dec;};return a34_0x9bbf();}const ocrRecognize={'service':a34_0x3bc1db(0x93),'command':a34_0x3bc1db(0xa1),'description':a34_0x3bc1db(0x9c),'risk':a34_0x3bc1db(0x81),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x402f23){const _0x439d2f=a34_0x3bc1db,_0x14eab6=normalizeScene(_0x402f23[_0x439d2f(0xa2)](_0x439d2f(0x9d))),_0x73c386=SCENE_TO_LEGACY_TYPE[_0x14eab6],_0x1185d4=validateInputSelection(_0x402f23);if(_0x1185d4[_0x439d2f(0x8b)])return dryRun('POST','/client/ocr')['body']({'appCode':_0x402f23[_0x439d2f(0x78)],'url':_0x1185d4[_0x439d2f(0x8b)],'type':_0x73c386})[_0x439d2f(0x9e)]('Preview:\x20recognize\x20'+_0x14eab6+_0x439d2f(0x75))[_0x439d2f(0x90)]();const _0x2b5e9a=requireRuntimeUploadFile(_0x1185d4[_0x439d2f(0x7f)],_0x439d2f(0xa6));return dryRun(_0x439d2f(0x85),_0x439d2f(0x86))[_0x439d2f(0xa0)]({'steps':[{'method':_0x439d2f(0x85),'url':'/client/uploadFile','body':{'appCode':_0x402f23[_0x439d2f(0x78)],'multipart':{'file':_0x2b5e9a}}},{'method':_0x439d2f(0x85),'url':_0x439d2f(0x87),'body':{'filePath':_0x439d2f(0x74),'downloadFlag':![]}},{'method':_0x439d2f(0x85),'url':'/client/ocr','body':{'appCode':_0x402f23['appCode'],'url':_0x439d2f(0x83),'type':_0x73c386}}]})[_0x439d2f(0x9e)]('Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0x14eab6+_0x439d2f(0x9b))['build']();},async 'execute'(_0x51035f){const _0x591ec2=a34_0x3bc1db,_0x5633db=normalizeScene(_0x51035f[_0x591ec2(0xa2)]('scene')),_0x494b40=SCENE_TO_LEGACY_TYPE[_0x5633db],_0x7d889e=validateInputSelection(_0x51035f);if(_0x7d889e[_0x591ec2(0x8b)]){const _0x524b4c=await recognizeRuntimeOcr(_0x51035f['appCode'],{'url':_0x7d889e[_0x591ec2(0x8b)],'type':_0x494b40});return{'ok':!![],'data':withScene(_0x524b4c,_0x5633db)};}const _0xd4e08a=requireRuntimeUploadFile(_0x7d889e[_0x591ec2(0x7f)],_0x591ec2(0xa6)),_0x3bdf4a=await uploadRuntimeFile(_0x51035f[_0x591ec2(0x78)],_0xd4e08a[_0x591ec2(0xa3)]);if(!_0x3bdf4a['filePath'])throw CliErrors['apiError']('File\x20upload\x20response\x20missing\x20filePath.');const _0x2310c1=await queryRuntimeFileUrl(_0x3bdf4a['filePath'],{'download':![]});if(!_0x2310c1[_0x591ec2(0x94)])throw CliErrors[_0x591ec2(0x79)](_0x591ec2(0x91));const _0x47069c=await recognizeRuntimeOcr(_0x51035f['appCode'],{'url':_0x2310c1[_0x591ec2(0x94)],'type':_0x494b40});return{'ok':!![],'data':withScene(_0x47069c,_0x5633db,_0x3bdf4a)};}};export const ocrDefinitions=[ocrRecognize];
@@ -1 +1 @@
1
- function a35_0x46b7(_0x437df8,_0x2499da){_0x437df8=_0x437df8-0xa0;const _0x4db386=a35_0x4db3();let _0x46b744=_0x4db386[_0x437df8];return _0x46b744;}const a35_0x34fb29=a35_0x46b7;(function(_0x507ff3,_0x5b4a12){const _0x5d153b=a35_0x46b7,_0x598b34=_0x507ff3();while(!![]){try{const _0x5dde06=parseInt(_0x5d153b(0xda))/0x1*(-parseInt(_0x5d153b(0xe2))/0x2)+parseInt(_0x5d153b(0xa8))/0x3+parseInt(_0x5d153b(0xad))/0x4*(parseInt(_0x5d153b(0xbc))/0x5)+parseInt(_0x5d153b(0xab))/0x6+parseInt(_0x5d153b(0xce))/0x7+parseInt(_0x5d153b(0xe0))/0x8*(parseInt(_0x5d153b(0xde))/0x9)+-parseInt(_0x5d153b(0xa6))/0xa*(parseInt(_0x5d153b(0xbb))/0xb);if(_0x5dde06===_0x5b4a12)break;else _0x598b34['push'](_0x598b34['shift']());}catch(_0x3b31fb){_0x598b34['push'](_0x598b34['shift']());}}}(a35_0x4db3,0xcd8e7));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';function a35_0x4db3(){const _0x3010fb=['string','isArray','17956939jwAWsd','40285CzBkwE','bool','config','Preview:\x20create\x20personal\x20BFF\x20','Created\x20personal\x20BFF\x20','exec','根据\x20ID\x20更新个人\x20BFF','validation','isFile','trim','list','根据本地脚本文件创建个人\x20BFF','Preview:\x20update\x20personal\x20BFF\x20','name','createTime','Personal\x20BFF\x20script\x20file\x20is\x20blank.','length','/client/runtime-bff/personal/','577619gLIjIj','map','utf8','File\x20path\x20is\x20required.','description','updateTime','scriptContent','test','scriptType','num','gmtModified','File\x20not\x20found:\x20','852253bHBLoR','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','sourceSessionId','Personal\x20BFF\x20description','4814217edPKGz','build','8vjJiIW','str','2wCkCpB','verbose','functionName','把本地脚本保存为个人\x20BFF;之后可在当前应用中调用该脚本。','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','createUserId','flag','personal-bff','更新个人\x20BFF\x20的脚本或元信息;之后的调用将使用新版本。','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','read','POST','10DBhNxl','file','1234377ombbyQ','appCode','update','7163778DzCLsy','Show\x20one\x20personal\x20BFF\x20by\x20id','548MKpiti','gmtCreate','keys','Executed\x20personal\x20BFF\x20','params','source-session-id','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','Updated\x20personal\x20BFF\x20','version','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','write','根据\x20ID\x20执行个人\x20BFF,并可传入\x20JSON\x20参数'];a35_0x4db3=function(){return _0x3010fb;};return a35_0x4db3();}const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x34fb29(0xa7),'type':a35_0x34fb29(0xb9),'description':a35_0x34fb29(0xb6)},FUNCTION_NAME_FLAG={'name':a35_0x34fb29(0xc9),'type':a35_0x34fb29(0xb9),'required':!![],'description':a35_0x34fb29(0xb3)},DESCRIPTION_FLAG={'name':a35_0x34fb29(0xd2),'type':a35_0x34fb29(0xb9),'description':a35_0x34fb29(0xdd)},SOURCE_SESSION_FLAG={'name':a35_0x34fb29(0xb2),'type':'string','description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function normalizeFunctionName(_0x5e01a4){const _0x1ee382=a35_0x34fb29,_0x338751=String(_0x5e01a4||'')['trim']();if(!_0x338751||!FUNCTION_NAME_PATTERN[_0x1ee382(0xd5)](_0x338751))throw CliErrors[_0x1ee382(0xc3)](_0x1ee382(0xa3));return _0x338751;}function readScriptFile(_0x40927f){const _0x4272dd=a35_0x34fb29;if(!_0x40927f)throw CliErrors[_0x4272dd(0xc3)](_0x4272dd(0xd1));if(!existsSync(_0x40927f))throw CliErrors[_0x4272dd(0xc3)](_0x4272dd(0xd9)+_0x40927f);if(!statSync(_0x40927f)[_0x4272dd(0xc4)]())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x40927f);const _0x5d2070=readFileSync(_0x40927f,_0x4272dd(0xd0));if(!_0x5d2070[_0x4272dd(0xc5)]())throw CliErrors[_0x4272dd(0xc3)](_0x4272dd(0xcb));return _0x5d2070;}function optionalTrimmed(_0x1ac740){const _0x4abf56=a35_0x34fb29,_0xcd6589=String(_0x1ac740||'')[_0x4abf56(0xc5)]();return _0xcd6589||undefined;}function summarizeBff(_0x315ce5){const _0x522c41=a35_0x34fb29;return{'id':_0x315ce5['id'],'appCode':_0x315ce5[_0x522c41(0xa9)],'functionName':_0x315ce5[_0x522c41(0xe4)],'description':_0x315ce5[_0x522c41(0xd2)],'scriptType':_0x315ce5[_0x522c41(0xd6)],'version':_0x315ce5[_0x522c41(0xb5)],'gmtModified':_0x315ce5[_0x522c41(0xd8)],'updateTime':_0x315ce5[_0x522c41(0xd3)]};}function detailBff(_0x3bd203){const _0x16c6a6=a35_0x34fb29;return{'id':_0x3bd203['id'],'appCode':_0x3bd203['appCode'],'functionName':_0x3bd203[_0x16c6a6(0xe4)],'description':_0x3bd203[_0x16c6a6(0xd2)],'scriptType':_0x3bd203[_0x16c6a6(0xd6)],'scriptContent':_0x3bd203[_0x16c6a6(0xd4)]??'','config':_0x3bd203[_0x16c6a6(0xbe)],'version':_0x3bd203[_0x16c6a6(0xb5)],'createUserId':_0x3bd203[_0x16c6a6(0xe7)],'gmtCreate':_0x3bd203[_0x16c6a6(0xae)],'gmtModified':_0x3bd203[_0x16c6a6(0xd8)],'createTime':_0x3bd203[_0x16c6a6(0xca)],'updateTime':_0x3bd203[_0x16c6a6(0xd3)]};}function buildCreateInput(_0x16e7c3){const _0x2fe56d=a35_0x34fb29;return{'functionName':normalizeFunctionName(_0x16e7c3['str']('name')),...optionalTrimmed(_0x16e7c3['str'](_0x2fe56d(0xd2)))?{'description':optionalTrimmed(_0x16e7c3[_0x2fe56d(0xe1)]('description'))}:{},'scriptContent':readScriptFile(_0x16e7c3[_0x2fe56d(0xe1)](_0x2fe56d(0xa7))),...optionalTrimmed(_0x16e7c3[_0x2fe56d(0xe1)]('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x16e7c3['str'](_0x2fe56d(0xb2)))}:{}};}function buildUpdateInput(_0x2d0e7b){const _0x5ec473=a35_0x34fb29,_0x4f71a2={};optionalTrimmed(_0x2d0e7b[_0x5ec473(0xe1)]('name'))&&(_0x4f71a2[_0x5ec473(0xe4)]=normalizeFunctionName(_0x2d0e7b[_0x5ec473(0xe1)]('name')));_0x2d0e7b[_0x5ec473(0xa0)](_0x5ec473(0xd2))!==undefined&&(_0x4f71a2['description']=_0x2d0e7b[_0x5ec473(0xe1)]('description'));optionalTrimmed(_0x2d0e7b[_0x5ec473(0xe1)](_0x5ec473(0xa7)))&&(_0x4f71a2['scriptContent']=readScriptFile(_0x2d0e7b['str'](_0x5ec473(0xa7))));_0x2d0e7b[_0x5ec473(0xa0)](_0x5ec473(0xb2))!==undefined&&(_0x4f71a2[_0x5ec473(0xdc)]=_0x2d0e7b[_0x5ec473(0xe1)](_0x5ec473(0xb2)));if(Object[_0x5ec473(0xaf)](_0x4f71a2)[_0x5ec473(0xcc)]===0x0)throw CliErrors[_0x5ec473(0xc3)](_0x5ec473(0xe6));return _0x4f71a2;}function parseExecParams(_0x71bde7){const _0x357952=a35_0x34fb29,_0x13cbd1=parseJsonParams(_0x71bde7)??{};if(Array[_0x357952(0xba)](_0x13cbd1))throw CliErrors['validation']('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x13cbd1;}const personalBffList={'service':a35_0x34fb29(0xa1),'command':a35_0x34fb29(0xc6),'description':a35_0x34fb29(0xdb),'risk':a35_0x34fb29(0xa4),'flags':[VERBOSE_FLAG],async 'execute'(_0x5c9bf5){const _0x4ccd40=a35_0x34fb29,_0x3adb50=await listPersonalBffs(_0x5c9bf5[_0x4ccd40(0xa9)]);return{'ok':!![],'data':{'total':_0x3adb50[_0x4ccd40(0xcc)],'items':_0x5c9bf5[_0x4ccd40(0xbd)](_0x4ccd40(0xe3))?_0x3adb50:_0x3adb50[_0x4ccd40(0xcf)](summarizeBff)}};}},personalBffDetail={'service':a35_0x34fb29(0xa1),'command':'detail','description':a35_0x34fb29(0xac),'risk':a35_0x34fb29(0xa4),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'}],async 'execute'(_0x58f781){const _0x44c9be=a35_0x34fb29,_0xc42cd5=await getPersonalBff(_0x58f781[_0x44c9be(0xd7)]('id'),_0x58f781[_0x44c9be(0xa9)]);return{'ok':!![],'data':detailBff(_0xc42cd5)};}},personalBffCreate={'service':a35_0x34fb29(0xa1),'command':'create','description':a35_0x34fb29(0xc7),'risk':a35_0x34fb29(0xb7),'confirmationDescription':a35_0x34fb29(0xe5),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x584e9b){const _0xcd0246=a35_0x34fb29,_0x4f6b65=buildCreateInput(_0x584e9b),_0x5db342=await createPersonalBff(_0x584e9b['appCode'],_0x4f6b65);return{'ok':!![],'data':detailBff(_0x5db342),'message':_0xcd0246(0xc0)+_0x5db342['id']+(_0x5db342[_0xcd0246(0xe4)]?'\x20('+_0x5db342[_0xcd0246(0xe4)]+')':'')};},async 'dryRun'(_0x449d6a){const _0xabf284=a35_0x34fb29,_0x5ec58b=buildCreateInput(_0x449d6a);return dryRun(_0xabf284(0xa5),'/client/runtime-bff/personal/create')['body']({'appCode':_0x449d6a['appCode'],..._0x5ec58b})[_0xabf284(0xd2)](_0xabf284(0xbf)+_0x5ec58b[_0xabf284(0xe4)])[_0xabf284(0xdf)]();}},personalBffUpdate={'service':a35_0x34fb29(0xa1),'command':a35_0x34fb29(0xaa),'description':a35_0x34fb29(0xc2),'risk':a35_0x34fb29(0xb7),'confirmationDescription':a35_0x34fb29(0xa2),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x586cad){const _0xf3f16d=a35_0x34fb29,_0x5943f3=_0x586cad[_0xf3f16d(0xd7)]('id'),_0x385772=buildUpdateInput(_0x586cad),_0x527567=await updatePersonalBff(_0x5943f3,_0x586cad[_0xf3f16d(0xa9)],_0x385772);return{'ok':!![],'data':detailBff(_0x527567),'message':_0xf3f16d(0xb4)+_0x527567['id']+(_0x527567['functionName']?'\x20('+_0x527567[_0xf3f16d(0xe4)]+')':'')};},async 'dryRun'(_0x32b4d8){const _0x11b233=a35_0x34fb29,_0x30739c=_0x32b4d8[_0x11b233(0xd7)]('id'),_0x3ef7a9=buildUpdateInput(_0x32b4d8);return dryRun(_0x11b233(0xa5),_0x11b233(0xcd)+_0x30739c+'/update')['body']({'appCode':_0x32b4d8[_0x11b233(0xa9)],..._0x3ef7a9})[_0x11b233(0xd2)](_0x11b233(0xc8)+_0x30739c)['build']();}},personalBffExec={'service':'personal-bff','command':a35_0x34fb29(0xc1),'description':a35_0x34fb29(0xb8),'risk':a35_0x34fb29(0xb7),'confirmationDescription':'执行个人\x20BFF\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':'JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'}],async 'validate'(_0x187a5c){const _0x4385eb=a35_0x34fb29;parseExecParams(_0x187a5c['str'](_0x4385eb(0xb1)));},async 'execute'(_0x3210ce){const _0x228930=a35_0x34fb29,_0x5baa95=_0x3210ce[_0x228930(0xd7)]('id'),_0x69fcca=parseExecParams(_0x3210ce[_0x228930(0xe1)](_0x228930(0xb1))),_0x1eeec4=await executePersonalBff(_0x5baa95,_0x3210ce['appCode'],_0x69fcca);return{'ok':!![],'data':{'result':_0x1eeec4},'message':_0x228930(0xb0)+_0x5baa95};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
1
+ const a35_0x1f8967=a35_0x3c3a;(function(_0x13e722,_0x18a5f3){const _0x5279f2=a35_0x3c3a,_0x5e1836=_0x13e722();while(!![]){try{const _0x373ac3=parseInt(_0x5279f2(0x1ae))/0x1+-parseInt(_0x5279f2(0x19d))/0x2*(-parseInt(_0x5279f2(0x1d7))/0x3)+parseInt(_0x5279f2(0x1cd))/0x4+-parseInt(_0x5279f2(0x18e))/0x5*(parseInt(_0x5279f2(0x1d5))/0x6)+parseInt(_0x5279f2(0x197))/0x7*(parseInt(_0x5279f2(0x19e))/0x8)+-parseInt(_0x5279f2(0x1bf))/0x9*(-parseInt(_0x5279f2(0x1cb))/0xa)+-parseInt(_0x5279f2(0x1c3))/0xb;if(_0x373ac3===_0x18a5f3)break;else _0x5e1836['push'](_0x5e1836['shift']());}catch(_0x291afa){_0x5e1836['push'](_0x5e1836['shift']());}}}(a35_0x146b,0xd316b));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':'file','type':a35_0x1f8967(0x1a5),'description':a35_0x1f8967(0x199)},FUNCTION_NAME_FLAG={'name':a35_0x1f8967(0x19a),'type':a35_0x1f8967(0x1a5),'required':!![],'description':a35_0x1f8967(0x19c)},DESCRIPTION_FLAG={'name':a35_0x1f8967(0x19f),'type':a35_0x1f8967(0x1a5),'description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':'source-session-id','type':'string','description':a35_0x1f8967(0x1cc)};function normalizeFunctionName(_0x2bf1d9){const _0x2b7b0e=a35_0x1f8967,_0x2f7a4e=String(_0x2bf1d9||'')[_0x2b7b0e(0x193)]();if(!_0x2f7a4e||!FUNCTION_NAME_PATTERN[_0x2b7b0e(0x1bb)](_0x2f7a4e))throw CliErrors['validation'](_0x2b7b0e(0x1ce));return _0x2f7a4e;}function readScriptFile(_0x2a655a){const _0x45107e=a35_0x1f8967;if(!_0x2a655a)throw CliErrors[_0x45107e(0x1c7)](_0x45107e(0x1c9));if(!existsSync(_0x2a655a))throw CliErrors[_0x45107e(0x1c7)](_0x45107e(0x1b8)+_0x2a655a);if(!statSync(_0x2a655a)[_0x45107e(0x198)]())throw CliErrors[_0x45107e(0x1c7)](_0x45107e(0x195)+_0x2a655a);const _0x6464d4=readFileSync(_0x2a655a,_0x45107e(0x1d6));if(!_0x6464d4['trim']())throw CliErrors[_0x45107e(0x1c7)](_0x45107e(0x1b9));return _0x6464d4;}function optionalTrimmed(_0xd65f55){const _0x3117b6=String(_0xd65f55||'')['trim']();return _0x3117b6||undefined;}function summarizeBff(_0x395474){const _0x16d2b6=a35_0x1f8967;return{'id':_0x395474['id'],'appCode':_0x395474[_0x16d2b6(0x1a7)],'functionName':_0x395474[_0x16d2b6(0x1c4)],'description':_0x395474['description'],'scriptType':_0x395474[_0x16d2b6(0x196)],'version':_0x395474[_0x16d2b6(0x194)],'gmtModified':_0x395474['gmtModified'],'updateTime':_0x395474[_0x16d2b6(0x1ad)]};}function a35_0x146b(){const _0x9142e0=['length','params','read','27ropBcd','gmtModified','sourceSessionId','Created\x20personal\x20BFF\x20','39319236HqimHp','functionName','Preview:\x20update\x20personal\x20BFF\x20','body','validation','Updated\x20personal\x20BFF\x20','File\x20path\x20is\x20required.','--params\x20must\x20be\x20a\x20JSON\x20object.','1955320mNPMLj','Optional\x20source\x20RuntimeAgent\x20session\x20id','4794788dxXrca','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','num','isArray','personal-bff','执行个人\x20BFF\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','exec','createUserId','7980402lBEgdd','utf8','6PoBadk','create','config','/client/runtime-bff/personal/','5VwqatN','source-session-id','gmtCreate','Personal\x20BFF\x20script\x20ID','scriptContent','trim','version','File\x20is\x20not\x20a\x20regular\x20file:\x20','scriptType','14gdZOeO','isFile','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','name','Executed\x20personal\x20BFF\x20','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','1676718TufHOY','2378624UYnvNz','description','flag','createTime','根据本地脚本文件创建个人\x20BFF','update','map','string','更新个人\x20BFF\x20的脚本或元信息;之后的调用将使用新版本。','appCode','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','把本地脚本保存为个人\x20BFF;之后可在当前应用中调用该脚本。','str','detail','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','updateTime','1712495ZKkoNQ','POST','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','file','write','build','根据\x20ID\x20执行个人\x20BFF,并可传入\x20JSON\x20参数','list','verbose','根据\x20ID\x20更新个人\x20BFF','File\x20not\x20found:\x20','Personal\x20BFF\x20script\x20file\x20is\x20blank.','keys','test'];a35_0x146b=function(){return _0x9142e0;};return a35_0x146b();}function detailBff(_0xea22f0){const _0x1239ba=a35_0x1f8967;return{'id':_0xea22f0['id'],'appCode':_0xea22f0['appCode'],'functionName':_0xea22f0[_0x1239ba(0x1c4)],'description':_0xea22f0['description'],'scriptType':_0xea22f0[_0x1239ba(0x196)],'scriptContent':_0xea22f0['scriptContent']??'','config':_0xea22f0[_0x1239ba(0x1d9)],'version':_0xea22f0[_0x1239ba(0x194)],'createUserId':_0xea22f0[_0x1239ba(0x1d4)],'gmtCreate':_0xea22f0[_0x1239ba(0x190)],'gmtModified':_0xea22f0[_0x1239ba(0x1c0)],'createTime':_0xea22f0[_0x1239ba(0x1a1)],'updateTime':_0xea22f0['updateTime']};}function buildCreateInput(_0x3126c6){const _0x38718a=a35_0x1f8967;return{'functionName':normalizeFunctionName(_0x3126c6['str'](_0x38718a(0x19a))),...optionalTrimmed(_0x3126c6['str'](_0x38718a(0x19f)))?{'description':optionalTrimmed(_0x3126c6['str']('description'))}:{},'scriptContent':readScriptFile(_0x3126c6[_0x38718a(0x1aa)](_0x38718a(0x1b1))),...optionalTrimmed(_0x3126c6[_0x38718a(0x1aa)](_0x38718a(0x18f)))?{'sourceSessionId':optionalTrimmed(_0x3126c6[_0x38718a(0x1aa)](_0x38718a(0x18f)))}:{}};}function buildUpdateInput(_0x2d01fe){const _0x1d263a=a35_0x1f8967,_0x416895={};optionalTrimmed(_0x2d01fe[_0x1d263a(0x1aa)](_0x1d263a(0x19a)))&&(_0x416895[_0x1d263a(0x1c4)]=normalizeFunctionName(_0x2d01fe[_0x1d263a(0x1aa)]('name')));_0x2d01fe['flag'](_0x1d263a(0x19f))!==undefined&&(_0x416895[_0x1d263a(0x19f)]=_0x2d01fe[_0x1d263a(0x1aa)](_0x1d263a(0x19f)));optionalTrimmed(_0x2d01fe[_0x1d263a(0x1aa)](_0x1d263a(0x1b1)))&&(_0x416895[_0x1d263a(0x192)]=readScriptFile(_0x2d01fe[_0x1d263a(0x1aa)](_0x1d263a(0x1b1))));_0x2d01fe[_0x1d263a(0x1a0)](_0x1d263a(0x18f))!==undefined&&(_0x416895[_0x1d263a(0x1c1)]=_0x2d01fe[_0x1d263a(0x1aa)](_0x1d263a(0x18f)));if(Object[_0x1d263a(0x1ba)](_0x416895)[_0x1d263a(0x1bc)]===0x0)throw CliErrors['validation'](_0x1d263a(0x1a8));return _0x416895;}function parseExecParams(_0x40edab){const _0x192637=a35_0x1f8967,_0x143080=parseJsonParams(_0x40edab)??{};if(Array[_0x192637(0x1d0)](_0x143080))throw CliErrors[_0x192637(0x1c7)](_0x192637(0x1ca));return _0x143080;}const personalBffList={'service':a35_0x1f8967(0x1d1),'command':a35_0x1f8967(0x1b5),'description':a35_0x1f8967(0x1b0),'risk':a35_0x1f8967(0x1be),'flags':[VERBOSE_FLAG],async 'execute'(_0x8ef37b){const _0x5646fc=a35_0x1f8967,_0x483686=await listPersonalBffs(_0x8ef37b['appCode']);return{'ok':!![],'data':{'total':_0x483686[_0x5646fc(0x1bc)],'items':_0x8ef37b['bool'](_0x5646fc(0x1b6))?_0x483686:_0x483686[_0x5646fc(0x1a4)](summarizeBff)}};}},personalBffDetail={'service':a35_0x1f8967(0x1d1),'command':a35_0x1f8967(0x1ab),'description':'Show\x20one\x20personal\x20BFF\x20by\x20id','risk':'read','flags':[{...ID_FLAG,'description':a35_0x1f8967(0x191)}],async 'execute'(_0xb29546){const _0x4b52a7=a35_0x1f8967,_0x59447d=await getPersonalBff(_0xb29546[_0x4b52a7(0x1cf)]('id'),_0xb29546[_0x4b52a7(0x1a7)]);return{'ok':!![],'data':detailBff(_0x59447d)};}},personalBffCreate={'service':a35_0x1f8967(0x1d1),'command':a35_0x1f8967(0x1d8),'description':a35_0x1f8967(0x1a2),'risk':a35_0x1f8967(0x1b2),'confirmationDescription':a35_0x1f8967(0x1a9),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3966a9){const _0x51aad4=a35_0x1f8967,_0x3ccec2=buildCreateInput(_0x3966a9),_0x3023d7=await createPersonalBff(_0x3966a9['appCode'],_0x3ccec2);return{'ok':!![],'data':detailBff(_0x3023d7),'message':_0x51aad4(0x1c2)+_0x3023d7['id']+(_0x3023d7[_0x51aad4(0x1c4)]?'\x20('+_0x3023d7[_0x51aad4(0x1c4)]+')':'')};},async 'dryRun'(_0x16b282){const _0x502f36=a35_0x1f8967,_0x508817=buildCreateInput(_0x16b282);return dryRun(_0x502f36(0x1af),'/client/runtime-bff/personal/create')['body']({'appCode':_0x16b282['appCode'],..._0x508817})[_0x502f36(0x19f)]('Preview:\x20create\x20personal\x20BFF\x20'+_0x508817[_0x502f36(0x1c4)])[_0x502f36(0x1b3)]();}},personalBffUpdate={'service':a35_0x1f8967(0x1d1),'command':a35_0x1f8967(0x1a3),'description':a35_0x1f8967(0x1b7),'risk':'write','confirmationDescription':a35_0x1f8967(0x1a6),'flags':[{...ID_FLAG,'description':a35_0x1f8967(0x191)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x38399f){const _0x582607=a35_0x1f8967,_0x3271ec=_0x38399f[_0x582607(0x1cf)]('id'),_0x5b6423=buildUpdateInput(_0x38399f),_0x35aa83=await updatePersonalBff(_0x3271ec,_0x38399f[_0x582607(0x1a7)],_0x5b6423);return{'ok':!![],'data':detailBff(_0x35aa83),'message':_0x582607(0x1c8)+_0x35aa83['id']+(_0x35aa83[_0x582607(0x1c4)]?'\x20('+_0x35aa83[_0x582607(0x1c4)]+')':'')};},async 'dryRun'(_0x1de379){const _0x591320=a35_0x1f8967,_0x5822ca=_0x1de379[_0x591320(0x1cf)]('id'),_0x2d2328=buildUpdateInput(_0x1de379);return dryRun('POST',_0x591320(0x18d)+_0x5822ca+'/update')[_0x591320(0x1c6)]({'appCode':_0x1de379['appCode'],..._0x2d2328})[_0x591320(0x19f)](_0x591320(0x1c5)+_0x5822ca)['build']();}},personalBffExec={'service':a35_0x1f8967(0x1d1),'command':a35_0x1f8967(0x1d3),'description':a35_0x1f8967(0x1b4),'risk':a35_0x1f8967(0x1b2),'confirmationDescription':a35_0x1f8967(0x1d2),'flags':[{...ID_FLAG,'description':a35_0x1f8967(0x191)},{...PARAMS_FLAG,'description':a35_0x1f8967(0x1ac)}],async 'validate'(_0x3e30ae){const _0x28a5a9=a35_0x1f8967;parseExecParams(_0x3e30ae[_0x28a5a9(0x1aa)](_0x28a5a9(0x1bd)));},async 'execute'(_0x3de434){const _0x250631=a35_0x1f8967,_0x1a8682=_0x3de434[_0x250631(0x1cf)]('id'),_0x440bf2=parseExecParams(_0x3de434[_0x250631(0x1aa)](_0x250631(0x1bd))),_0x1473af=await executePersonalBff(_0x1a8682,_0x3de434[_0x250631(0x1a7)],_0x440bf2);return{'ok':!![],'data':{'result':_0x1473af},'message':_0x250631(0x19b)+_0x1a8682};}};function a35_0x3c3a(_0x2321c2,_0x1935cc){_0x2321c2=_0x2321c2-0x18d;const _0x146bac=a35_0x146b();let _0x3c3a6c=_0x146bac[_0x2321c2];return _0x3c3a6c;}export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
1
- const a36_0x398eaf=a36_0x3eb2;(function(_0x154370,_0x49693b){const _0xefb1ac=a36_0x3eb2,_0x220d36=_0x154370();while(!![]){try{const _0x3a3811=parseInt(_0xefb1ac(0x81))/0x1*(-parseInt(_0xefb1ac(0xa3))/0x2)+-parseInt(_0xefb1ac(0x8c))/0x3*(-parseInt(_0xefb1ac(0xa5))/0x4)+-parseInt(_0xefb1ac(0x80))/0x5*(parseInt(_0xefb1ac(0x9d))/0x6)+-parseInt(_0xefb1ac(0x9e))/0x7*(parseInt(_0xefb1ac(0x82))/0x8)+-parseInt(_0xefb1ac(0x88))/0x9*(parseInt(_0xefb1ac(0x97))/0xa)+parseInt(_0xefb1ac(0x99))/0xb+-parseInt(_0xefb1ac(0xa4))/0xc*(-parseInt(_0xefb1ac(0x8a))/0xd);if(_0x3a3811===_0x49693b)break;else _0x220d36['push'](_0x220d36['shift']());}catch(_0x15b28a){_0x220d36['push'](_0x220d36['shift']());}}}(a36_0x35da,0x20efa));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';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';function a36_0x3eb2(_0x4b1fbc,_0x51f364){_0x4b1fbc=_0x4b1fbc-0x6f;const _0x35da2f=a36_0x35da();let _0x3eb2a4=_0x35da2f[_0x4b1fbc];return _0x3eb2a4;}import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';function a36_0x35da(){const _0x5b6f37=['`lovrabet\x20app\x20use`\x20has\x20been\x20removed.','install','run','service','2510CJjssH','Workspace','731753nlrLIh','Use\x20`lovrabet\x20workspace\x20init\x20--appcode\x20<code>`\x20instead.','Skills','app','6xFWRIl','7FTGAPn','app\x20use','\x20\x20[high-risk-write]','set','map','62380hooLtW','408tWpugq','2908GGHOMq','push','Use\x20`lovrabet\x20logs\x20show`\x20to\x20view\x20command\x20history.','Configuration','Use\x20`lovrabet\x20workspace\x20use\x20--app\x20<name>`\x20instead.','description','Authentication','get','`lovrabet\x20logs\x20clear`\x20has\x20been\x20removed.','Self\x20Update','CLI\x20Built-in\x20Skill','Knowledge\x20Base','logs','has','write','Agent\x20Schedules','App\x20Management','SQL\x20Queries','746185ZrCtBP','2FeHcrk','804384HhpLap','command','Schema','values','BFF\x20Scripts','Instant\x20API','9441afcLDg','`lovrabet\x20app\x20init`\x20has\x20been\x20removed.','225329MSgvhZ','clear','225utyUom','login','\x20\x20[write]','isSingleCommand','list','API\x20Documentation','init'];a36_0x35da=function(){return _0x5b6f37;};return a36_0x35da();}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(_0x14885e){const _0x2af540=a36_0x3eb2;for(const _0xd02908 of _0x14885e){definitions['set'](_0xd02908['service']+':'+_0xd02908['command'],_0xd02908);let _0x52c32f=serviceGroups[_0x2af540(0x75)](_0xd02908['service']);!_0x52c32f&&(_0x52c32f=[],serviceGroups[_0x2af540(0xa1)](_0xd02908[_0x2af540(0x96)],_0x52c32f)),_0x52c32f[_0x2af540(0x6f)](_0xd02908);}}function registerService(_0x51620f,_0x18886d,_0x48ea1c){const _0x2f2111=a36_0x3eb2;registerDefinitions(_0x18886d);const _0x44582b=_0x3fb615=>_0x3fb615==='read'?'':_0x3fb615===_0x2f2111(0x7c)?_0x2f2111(0x8e):_0x2f2111(0xa0),_0x8b19d6={'service':_0x18886d[0x0]['service'],'label':_0x51620f,'commands':_0x18886d[_0x2f2111(0xa2)](_0x1ce983=>({'command':_0x1ce983['command'],'description':_0x1ce983[_0x2f2111(0x73)],'tag':_0x44582b(_0x1ce983['risk'])})),'defaultCommand':_0x48ea1c?.['defaultCommand']??(_0x48ea1c?.[_0x2f2111(0x8f)]?_0x18886d[0x0][_0x2f2111(0x83)]:undefined),'isSingleCommand':_0x48ea1c?.['isSingleCommand']};serviceRegistry[_0x2f2111(0x6f)](_0x8b19d6),serviceByName['set'](_0x8b19d6[_0x2f2111(0x96)],_0x8b19d6);}registerService(a36_0x398eaf(0x74),authDefinitions,{'defaultCommand':a36_0x398eaf(0x8d)}),registerService(a36_0x398eaf(0x7e),appDefinitions,{'defaultCommand':a36_0x398eaf(0x90)}),registerService(a36_0x398eaf(0x98),workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService(a36_0x398eaf(0x71),configDefinitions,{'defaultCommand':a36_0x398eaf(0x90)}),registerService(a36_0x398eaf(0x91),apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a36_0x398eaf(0x87),dataDefinitions),registerService(a36_0x398eaf(0x7f),sqlDefinitions),registerService(a36_0x398eaf(0x86),bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService('File',fileDefinitions),registerService('OCR',ocrDefinitions),registerService(a36_0x398eaf(0x79),kbDefinitions),registerService(a36_0x398eaf(0x7d),scheduleDefinitions,{'defaultCommand':'list'}),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a36_0x398eaf(0x90)}),registerService(a36_0x398eaf(0x9b),skillDefinitions,{'defaultCommand':a36_0x398eaf(0x94)}),registerService(a36_0x398eaf(0x78),cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x398eaf(0x77),[updateDefinition],{'defaultCommand':a36_0x398eaf(0x95),'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x398eaf(0x84),[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':'show'});export function findDefinition(_0x31fe97,_0x1b153a){const _0xf6e1e3=a36_0x398eaf;return definitions[_0xf6e1e3(0x75)](_0x31fe97+':'+_0x1b153a);}export function resolveRemovedCommand(_0x40705d,_0x24f163){const _0x236802=a36_0x398eaf;if(_0x40705d===_0x236802(0x9c)&&_0x24f163===_0x236802(0x92))return{'command':'app\x20init','message':_0x236802(0x89),'hint':_0x236802(0x9a)};if(_0x40705d==='app'&&_0x24f163==='use')return{'command':_0x236802(0x9f),'message':_0x236802(0x93),'hint':_0x236802(0x72)};if(_0x40705d===_0x236802(0x7a)&&_0x24f163===_0x236802(0x8b))return{'command':'logs\x20clear','message':_0x236802(0x76),'hint':_0x236802(0x70)};return undefined;}export function isKnownService(_0x209e27){const _0x30cc01=a36_0x398eaf;return serviceByName[_0x30cc01(0x7b)](_0x209e27);}export function getServiceEntry(_0x134a65){const _0x300d9c=a36_0x398eaf;return serviceByName[_0x300d9c(0x75)](_0x134a65);}export function getAllDefinitions(){const _0xcd07da=a36_0x398eaf;return Array['from'](definitions[_0xcd07da(0x85)]());}
1
+ const a36_0x5b7d27=a36_0x53ac;(function(_0x50df12,_0x3ac675){const _0x35a30b=a36_0x53ac,_0x28e33d=_0x50df12();while(!![]){try{const _0x440f7f=-parseInt(_0x35a30b(0x1e8))/0x1+parseInt(_0x35a30b(0x202))/0x2+-parseInt(_0x35a30b(0x1ef))/0x3+parseInt(_0x35a30b(0x211))/0x4*(-parseInt(_0x35a30b(0x1f6))/0x5)+-parseInt(_0x35a30b(0x1e7))/0x6+parseInt(_0x35a30b(0x1f9))/0x7+parseInt(_0x35a30b(0x210))/0x8*(parseInt(_0x35a30b(0x1f2))/0x9);if(_0x440f7f===_0x3ac675)break;else _0x28e33d['push'](_0x28e33d['shift']());}catch(_0x5dbed9){_0x28e33d['push'](_0x28e33d['shift']());}}}(a36_0x9d89,0x9094c));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';function a36_0x53ac(_0x57bc33,_0x19945a){_0x57bc33=_0x57bc33-0x1e7;const _0x9d89b4=a36_0x9d89();let _0x53ac12=_0x9d89b4[_0x57bc33];return _0x53ac12;}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(_0x34c8da){const _0x2015f5=a36_0x53ac;for(const _0x303c19 of _0x34c8da){definitions[_0x2015f5(0x1fd)](_0x303c19['service']+':'+_0x303c19['command'],_0x303c19);let _0x47a31b=serviceGroups[_0x2015f5(0x213)](_0x303c19['service']);!_0x47a31b&&(_0x47a31b=[],serviceGroups[_0x2015f5(0x1fd)](_0x303c19['service'],_0x47a31b)),_0x47a31b[_0x2015f5(0x1ea)](_0x303c19);}}function registerService(_0x13b598,_0x481f00,_0x2219b8){const _0x5ca73a=a36_0x53ac;registerDefinitions(_0x481f00);const _0x1c28dc=_0xe0e8d5=>_0xe0e8d5===_0x5ca73a(0x217)?'':_0xe0e8d5===_0x5ca73a(0x203)?'\x20\x20[write]':_0x5ca73a(0x1f8),_0x384615={'service':_0x481f00[0x0][_0x5ca73a(0x1f7)],'label':_0x13b598,'commands':_0x481f00[_0x5ca73a(0x1ed)](_0x4f82a8=>({'command':_0x4f82a8[_0x5ca73a(0x207)],'description':_0x4f82a8[_0x5ca73a(0x1fa)],'tag':_0x1c28dc(_0x4f82a8['risk'])})),'defaultCommand':_0x2219b8?.['defaultCommand']??(_0x2219b8?.[_0x5ca73a(0x1ec)]?_0x481f00[0x0][_0x5ca73a(0x207)]:undefined),'isSingleCommand':_0x2219b8?.[_0x5ca73a(0x1ec)]};serviceRegistry[_0x5ca73a(0x1ea)](_0x384615),serviceByName[_0x5ca73a(0x1fd)](_0x384615[_0x5ca73a(0x1f7)],_0x384615);}registerService(a36_0x5b7d27(0x20d),authDefinitions,{'defaultCommand':a36_0x5b7d27(0x205)}),registerService('App\x20Management',appDefinitions,{'defaultCommand':a36_0x5b7d27(0x1fb)}),registerService(a36_0x5b7d27(0x20a),workspaceDefinitions),registerService(a36_0x5b7d27(0x218),appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':'list'}),registerService(a36_0x5b7d27(0x1f3),apiDocDefinitions),registerService(a36_0x5b7d27(0x20c),datasetDefinitions),registerService(a36_0x5b7d27(0x20e),dataDefinitions),registerService('SQL\x20Queries',sqlDefinitions),registerService(a36_0x5b7d27(0x209),bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService(a36_0x5b7d27(0x200),artifactDefinitions),registerService(a36_0x5b7d27(0x201),fileDefinitions),registerService(a36_0x5b7d27(0x215),ocrDefinitions),registerService(a36_0x5b7d27(0x219),kbDefinitions),registerService(a36_0x5b7d27(0x208),scheduleDefinitions,{'defaultCommand':a36_0x5b7d27(0x1fb)}),registerService(a36_0x5b7d27(0x1ff),serviceDefinitions,{'defaultCommand':a36_0x5b7d27(0x1fb)}),registerService(a36_0x5b7d27(0x1ee),skillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x5b7d27(0x1fe),cliSkillDefinitions,{'defaultCommand':'install'}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':a36_0x5b7d27(0x21a),'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x5b7d27(0x1eb),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x5b7d27(0x20f),logsDefinitions,{'defaultCommand':a36_0x5b7d27(0x20b)});export function findDefinition(_0x2e1723,_0x375619){return definitions['get'](_0x2e1723+':'+_0x375619);}export function resolveRemovedCommand(_0x47df79,_0x266901){const _0x484017=a36_0x5b7d27;if(_0x47df79==='app'&&_0x266901==='init')return{'command':_0x484017(0x1f0),'message':_0x484017(0x204),'hint':_0x484017(0x1fc)};if(_0x47df79==='app'&&_0x266901==='use')return{'command':_0x484017(0x1e9),'message':_0x484017(0x1f5),'hint':'Use\x20`lovrabet\x20workspace\x20use\x20--app\x20<name>`\x20instead.'};if(_0x47df79===_0x484017(0x212)&&_0x266901===_0x484017(0x214))return{'command':_0x484017(0x206),'message':_0x484017(0x1f4),'hint':'Use\x20`lovrabet\x20logs\x20show`\x20to\x20view\x20command\x20history.'};return undefined;}export function isKnownService(_0x1037de){const _0x5bc6c4=a36_0x5b7d27;return serviceByName[_0x5bc6c4(0x1f1)](_0x1037de);}function a36_0x9d89(){const _0xf99f69=['Artifacts','File','18104mtAUxn','write','`lovrabet\x20app\x20init`\x20has\x20been\x20removed.','login','logs\x20clear','command','Agent\x20Schedules','BFF\x20Scripts','Workspace','show','Datasets','Authentication','Instant\x20API','Logs','14133160iPCHSA','2648qmNytK','logs','get','clear','OCR','from','read','Runtime\x20App\x20Config','Knowledge\x20Base','run','6330786nwDyGP','120692RtVbIL','app\x20use','push','Schema','isSingleCommand','map','Skills','104988AKHadn','app\x20init','has','9PHPqwP','API\x20Documentation','`lovrabet\x20logs\x20clear`\x20has\x20been\x20removed.','`lovrabet\x20app\x20use`\x20has\x20been\x20removed.','95WHusaE','service','\x20\x20[high-risk-write]','279328TlnFGs','description','list','Use\x20`lovrabet\x20workspace\x20init\x20--appcode\x20<code>`\x20instead.','set','CLI\x20Built-in\x20Skill','Service\x20Tree'];a36_0x9d89=function(){return _0xf99f69;};return a36_0x9d89();}export function getServiceEntry(_0x157593){return serviceByName['get'](_0x157593);}export function getAllDefinitions(){const _0x5ced3b=a36_0x5b7d27;return Array[_0x5ced3b(0x216)](definitions['values']());}
@@ -1 +1 @@
1
- function a37_0x3dbc(_0x2e9451,_0x207c7f){_0x2e9451=_0x2e9451-0x12d;const _0x4bca84=a37_0x4bca();let _0x3dbc10=_0x4bca84[_0x2e9451];return _0x3dbc10;}const a37_0x551f66=a37_0x3dbc;(function(_0xdc2977,_0xb21784){const _0x273f14=a37_0x3dbc,_0x2a9e03=_0xdc2977();while(!![]){try{const _0x155e07=parseInt(_0x273f14(0x161))/0x1*(parseInt(_0x273f14(0x15a))/0x2)+-parseInt(_0x273f14(0x15d))/0x3+-parseInt(_0x273f14(0x162))/0x4+parseInt(_0x273f14(0x155))/0x5+parseInt(_0x273f14(0x170))/0x6+parseInt(_0x273f14(0x16f))/0x7+-parseInt(_0x273f14(0x13e))/0x8;if(_0x155e07===_0xb21784)break;else _0x2a9e03['push'](_0x2a9e03['shift']());}catch(_0x2a2f3b){_0x2a9e03['push'](_0x2a9e03['shift']());}}}(a37_0x4bca,0x3ef70));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';function a37_0x4bca(){const _0x4d5939=['auto','list','Schedule\x20title','description','\x20from\x20schedule\x20','ONCE','Queued\x20Task\x20','length','premium','Schedule\x20kind:\x20CRON\x20or\x20ONCE','delete','POST','schedule-id','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','str','kind','title','detail','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','1104115fJZtrB','Preview:\x20delete\x20schedule\x20','prompt','high-risk-write','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','521368tpghiQ','创建周期性或单次执行的\x20Agent\x20定时任务','UTC','201489AbpVBp','--prompt\x20must\x20not\x20be\x20blank.','Preview:\x20run\x20schedule\x20','validation','1pTUDlt','1608008hVoBEA','scheduleId','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','taskId','string','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','build','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','Schedule\x20UUID','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','scheduled-at','3133270UcVPXo','2179038yufRQh','appCode','Schedule\x20input\x20is\x20valid','Page\x20size\x20from\x201\x20to\x20100','Deleted\x20schedule\x20','channel','read','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','CRON','立即运行一次定时任务并创建\x20Task','/run','删除定时任务并停止其后续触发','将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','num','run','limit','Created\x20','\x20schedule\x20','trim','number','/schedules','Show\x20one\x20schedule\x20by\x20schedule\x20ID','4521768jpCDwm','/api/harness/apps/','cursor','schedule'];a37_0x4bca=function(){return _0x4d5939;};return a37_0x4bca();}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_0x551f66(0x151),'type':'string','required':!![],'enum':['CRON',a37_0x551f66(0x147)],'description':a37_0x551f66(0x14b)},CRON_FLAG={'name':'cron','type':a37_0x551f66(0x167),'description':'Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules'},SCHEDULED_AT_FLAG={'name':'scheduled-at','type':a37_0x551f66(0x167),'description':'Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules'},TITLE_FLAG={'name':'title','type':a37_0x551f66(0x167),'required':!![],'description':a37_0x551f66(0x144)},PROMPT_FLAG={'name':a37_0x551f66(0x157),'type':a37_0x551f66(0x167),'required':!![],'description':a37_0x551f66(0x154)},CHANNEL_FLAG={'name':a37_0x551f66(0x12d),'type':a37_0x551f66(0x167),'enum':[a37_0x551f66(0x142),a37_0x551f66(0x14a)],'default':'premium','description':'Task\x20channel:\x20auto\x20or\x20premium'},SCHEDULE_ID_FLAG={'name':a37_0x551f66(0x14e),'type':'string','required':!![],'description':a37_0x551f66(0x16b),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a37_0x551f66(0x164)}},LIMIT_FLAG={'name':'limit','type':a37_0x551f66(0x13b),'default':0x14,'description':a37_0x551f66(0x173)},CURSOR_FLAG={'name':a37_0x551f66(0x140),'type':a37_0x551f66(0x167),'description':a37_0x551f66(0x14f)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x1bbe41){const _0x3be783=a37_0x551f66,_0x197954=_0x1bbe41[_0x3be783(0x150)](_0x3be783(0x151)),_0x56f458=_0x1bbe41[_0x3be783(0x150)](_0x3be783(0x152))[_0x3be783(0x13a)](),_0x58908c=_0x1bbe41['str'](_0x3be783(0x157))[_0x3be783(0x13a)](),_0x30974f=_0x1bbe41['str'](_0x3be783(0x12d)),_0x448160=_0x1bbe41[_0x3be783(0x150)]('cron'),_0x4af2cb=_0x1bbe41[_0x3be783(0x150)](_0x3be783(0x16e));if(!_0x56f458)throw CliErrors['validation']('--title\x20must\x20not\x20be\x20blank.');if(!_0x58908c)throw CliErrors['validation'](_0x3be783(0x15e));if(_0x197954===_0x3be783(0x130)){if(!_0x448160||_0x4af2cb)throw CliErrors[_0x3be783(0x160)](_0x3be783(0x159));return{'kind':_0x197954,'timezone':_0x3be783(0x15c),'cron':_0x448160,'title':_0x56f458,'prompt':_0x58908c,'channel':_0x30974f};}if(_0x197954===_0x3be783(0x147)){if(!_0x4af2cb||_0x448160)throw CliErrors[_0x3be783(0x160)](_0x3be783(0x168));return{'kind':_0x197954,'timezone':_0x3be783(0x15c),'scheduledAt':_0x4af2cb,'title':_0x56f458,'prompt':_0x58908c,'channel':_0x30974f};}throw CliErrors[_0x3be783(0x160)](_0x3be783(0x12f));}function scheduleCollectionPath(_0x4a841b){const _0x35131c=a37_0x551f66;return _0x35131c(0x13f)+encodeURIComponent(_0x4a841b)+_0x35131c(0x13c);}function scheduleItemPath(_0x3d37e4,_0x4910e7){return scheduleCollectionPath(_0x3d37e4)+'/'+encodeURIComponent(_0x4910e7);}const scheduleValidate={'service':a37_0x551f66(0x141),'command':'validate','description':a37_0x551f66(0x16c),'risk':a37_0x551f66(0x12e),'flags':INPUT_FLAGS,async 'validate'(_0x547346){readScheduleInput(_0x547346);},async 'execute'(_0x414aea){const _0x54de3f=a37_0x551f66,_0x3666d9=readScheduleInput(_0x414aea),_0x2652af=await validateRuntimeSchedule(_0x414aea['appCode'],_0x3666d9);return{'ok':!![],'data':_0x2652af,'message':_0x54de3f(0x172)};}},scheduleCreate={'service':a37_0x551f66(0x141),'command':'create','description':a37_0x551f66(0x15b),'risk':a37_0x551f66(0x158),'confirmationDescription':a37_0x551f66(0x165),'flags':INPUT_FLAGS,async 'validate'(_0x236c40){readScheduleInput(_0x236c40);},async 'execute'(_0x4a0462){const _0x7f284b=a37_0x551f66,_0x1c106a=readScheduleInput(_0x4a0462),_0x143b42=await validateRuntimeSchedule(_0x4a0462[_0x7f284b(0x171)],_0x1c106a),_0x2fb867=await createRuntimeSchedule(_0x4a0462[_0x7f284b(0x171)],_0x143b42);return{'ok':!![],'data':_0x2fb867,'message':_0x7f284b(0x138)+_0x2fb867[_0x7f284b(0x151)]+_0x7f284b(0x139)+_0x2fb867[_0x7f284b(0x163)]};},async 'dryRun'(_0x5058bd){const _0x4a2233=a37_0x551f66,_0x570f06=readScheduleInput(_0x5058bd);return dryRun(_0x4a2233(0x14d),scheduleCollectionPath(_0x5058bd[_0x4a2233(0x171)]))['body'](_0x570f06)[_0x4a2233(0x145)]('Preview:\x20create\x20an\x20Agent\x20schedule')['build']();}},scheduleList={'service':a37_0x551f66(0x141),'command':a37_0x551f66(0x143),'description':'List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','risk':a37_0x551f66(0x12e),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x152155){const _0x32295e=a37_0x551f66,_0x32894c=_0x152155[_0x32295e(0x135)](_0x32295e(0x137));if(!Number['isSafeInteger'](_0x32894c)||_0x32894c<0x1||_0x32894c>0x64)throw CliErrors['validation'](_0x32295e(0x16a));const _0x4459a8=_0x152155[_0x32295e(0x150)](_0x32295e(0x140));if(_0x4459a8&&(_0x4459a8[_0x32295e(0x149)]>0x400||_0x4459a8[_0x32295e(0x13a)]()!==_0x4459a8))throw CliErrors[_0x32295e(0x160)]('--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.');},async 'execute'(_0x251a00){const _0x115104=a37_0x551f66,_0x348ab0=_0x251a00[_0x115104(0x150)]('cursor'),_0x3ef120=await listRuntimeSchedules(_0x251a00[_0x115104(0x171)],{'kind':_0x251a00[_0x115104(0x150)](_0x115104(0x151)),'limit':_0x251a00[_0x115104(0x135)](_0x115104(0x137)),..._0x348ab0?{'cursor':_0x348ab0}:{}});return{'ok':!![],'data':_0x3ef120};}},scheduleDetail={'service':a37_0x551f66(0x141),'command':a37_0x551f66(0x153),'description':a37_0x551f66(0x13d),'risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x579ee8){const _0x381252=a37_0x551f66,_0x61701e=await getRuntimeSchedule(_0x579ee8[_0x381252(0x171)],_0x579ee8['str'](_0x381252(0x14e)));return{'ok':!![],'data':_0x61701e};}},scheduleRun={'service':'schedule','command':a37_0x551f66(0x136),'description':a37_0x551f66(0x131),'risk':a37_0x551f66(0x158),'confirmationDescription':a37_0x551f66(0x16d),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x4731a9){const _0x2a7ff1=a37_0x551f66,_0x181892=_0x4731a9[_0x2a7ff1(0x150)](_0x2a7ff1(0x14e)),_0x2360e2=await runRuntimeSchedule(_0x4731a9[_0x2a7ff1(0x171)],_0x181892);return{'ok':!![],'data':_0x2360e2,'message':_0x2a7ff1(0x148)+_0x2360e2[_0x2a7ff1(0x166)]+_0x2a7ff1(0x146)+_0x181892};},async 'dryRun'(_0xe7e7b3){const _0x4a7880=a37_0x551f66,_0x447414=_0xe7e7b3[_0x4a7880(0x150)](_0x4a7880(0x14e));return dryRun(_0x4a7880(0x14d),scheduleItemPath(_0xe7e7b3[_0x4a7880(0x171)],_0x447414)+_0x4a7880(0x132))[_0x4a7880(0x145)](_0x4a7880(0x15f)+_0x447414+'\x20immediately')[_0x4a7880(0x169)]();}},scheduleDelete={'service':'schedule','command':a37_0x551f66(0x14c),'description':a37_0x551f66(0x133),'risk':a37_0x551f66(0x158),'confirmationDescription':a37_0x551f66(0x134),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x186bf8){const _0x492ad0=a37_0x551f66,_0x461b96=_0x186bf8[_0x492ad0(0x150)](_0x492ad0(0x14e)),_0x523c9a=await deleteRuntimeSchedule(_0x186bf8[_0x492ad0(0x171)],_0x461b96);return{'ok':!![],'data':_0x523c9a,'message':_0x492ad0(0x174)+_0x461b96};},async 'dryRun'(_0x532d78){const _0x2badcd=a37_0x551f66,_0x3a72b0=_0x532d78[_0x2badcd(0x150)]('schedule-id');return dryRun('DELETE',scheduleItemPath(_0x532d78[_0x2badcd(0x171)],_0x3a72b0))[_0x2badcd(0x145)](_0x2badcd(0x156)+_0x3a72b0)[_0x2badcd(0x169)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
1
+ const a37_0x5b9d2a=a37_0x25e2;function a37_0x25e2(_0x57abea,_0x20664d){_0x57abea=_0x57abea-0xc2;const _0x2d1acd=a37_0x2d1a();let _0x25e2d5=_0x2d1acd[_0x57abea];return _0x25e2d5;}function a37_0x2d1a(){const _0x22682e=['Queued\x20Task\x20','18HRqCqD','delete','isSafeInteger','117226DKxdhf','create','taskId','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','Preview:\x20run\x20schedule\x20','premium','68496sRwNiW','kind','POST','6181880EBLKAt','DELETE','将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','body','5239717AuSFBk','Task\x20channel:\x20auto\x20or\x20premium','\x20from\x20schedule\x20','Created\x20','/run','Deleted\x20schedule\x20','validate','--title\x20must\x20not\x20be\x20blank.','145gjcEFa','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','string','--prompt\x20must\x20not\x20be\x20blank.','validation','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','/schedules','length','str','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','schedule','prompt','appCode','list','channel','cursor','创建周期性或单次执行的\x20Agent\x20定时任务','read','Schedule\x20title','trim','删除定时任务并停止其后续触发','limit','description','Preview:\x20delete\x20schedule\x20','4WxmjUa','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','cron','665832JUJXGI','\x20immediately','Page\x20size\x20from\x201\x20to\x20100','num','ONCE','scheduled-at','384327OgTEjC','Preview:\x20create\x20an\x20Agent\x20schedule','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','\x20schedule\x20','8PMbnaD','将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','detail','high-risk-write','build','Schedule\x20input\x20is\x20valid','UTC','4161025nLeAXe','schedule-id','CRON','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.'];a37_0x2d1a=function(){return _0x22682e;};return a37_0x2d1a();}(function(_0x2b7894,_0x35afb1){const _0x1ba41b=a37_0x25e2,_0x8e3a6c=_0x2b7894();while(!![]){try{const _0x183d51=parseInt(_0x1ba41b(0xc3))/0x1*(-parseInt(_0x1ba41b(0xf1))/0x2)+-parseInt(_0x1ba41b(0x10b))/0x3*(-parseInt(_0x1ba41b(0xf5))/0x4)+parseInt(_0x1ba41b(0xd8))/0x5*(-parseInt(_0x1ba41b(0xc9))/0x6)+parseInt(_0x1ba41b(0xd0))/0x7+-parseInt(_0x1ba41b(0xff))/0x8*(-parseInt(_0x1ba41b(0xfb))/0x9)+-parseInt(_0x1ba41b(0xcc))/0xa+parseInt(_0x1ba41b(0x106))/0xb;if(_0x183d51===_0x35afb1)break;else _0x8e3a6c['push'](_0x8e3a6c['shift']());}catch(_0x5e8fec){_0x8e3a6c['push'](_0x8e3a6c['shift']());}}}(a37_0x2d1a,0xf05e9));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_0x5b9d2a(0xca),'type':a37_0x5b9d2a(0xda),'required':!![],'enum':['CRON',a37_0x5b9d2a(0xf9)],'description':'Schedule\x20kind:\x20CRON\x20or\x20ONCE'},CRON_FLAG={'name':a37_0x5b9d2a(0xf4),'type':a37_0x5b9d2a(0xda),'description':'Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules'},SCHEDULED_AT_FLAG={'name':a37_0x5b9d2a(0xfa),'type':'string','description':'Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules'},TITLE_FLAG={'name':'title','type':'string','required':!![],'description':a37_0x5b9d2a(0xeb)},PROMPT_FLAG={'name':'prompt','type':a37_0x5b9d2a(0xda),'required':!![],'description':a37_0x5b9d2a(0xfd)},CHANNEL_FLAG={'name':a37_0x5b9d2a(0xe7),'type':a37_0x5b9d2a(0xda),'enum':['auto',a37_0x5b9d2a(0xc8)],'default':'premium','description':a37_0x5b9d2a(0xd1)},SCHEDULE_ID_FLAG={'name':'schedule-id','type':a37_0x5b9d2a(0xda),'required':!![],'description':'Schedule\x20UUID','pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a37_0x5b9d2a(0xe2)}},LIMIT_FLAG={'name':'limit','type':'number','default':0x14,'description':a37_0x5b9d2a(0xf7)},CURSOR_FLAG={'name':a37_0x5b9d2a(0xe8),'type':a37_0x5b9d2a(0xda),'description':a37_0x5b9d2a(0xf2)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x2edbcd){const _0x5e0bfa=a37_0x5b9d2a,_0x132621=_0x2edbcd[_0x5e0bfa(0xe1)]('kind'),_0xe7766=_0x2edbcd[_0x5e0bfa(0xe1)]('title')[_0x5e0bfa(0xec)](),_0xf1de9c=_0x2edbcd[_0x5e0bfa(0xe1)](_0x5e0bfa(0xe4))[_0x5e0bfa(0xec)](),_0x2dce79=_0x2edbcd[_0x5e0bfa(0xe1)](_0x5e0bfa(0xe7)),_0x44dd0b=_0x2edbcd[_0x5e0bfa(0xe1)]('cron'),_0x1a5543=_0x2edbcd[_0x5e0bfa(0xe1)](_0x5e0bfa(0xfa));if(!_0xe7766)throw CliErrors[_0x5e0bfa(0xdc)](_0x5e0bfa(0xd7));if(!_0xf1de9c)throw CliErrors[_0x5e0bfa(0xdc)](_0x5e0bfa(0xdb));if(_0x132621===_0x5e0bfa(0x108)){if(!_0x44dd0b||_0x1a5543)throw CliErrors[_0x5e0bfa(0xdc)](_0x5e0bfa(0xdd));return{'kind':_0x132621,'timezone':_0x5e0bfa(0x105),'cron':_0x44dd0b,'title':_0xe7766,'prompt':_0xf1de9c,'channel':_0x2dce79};}if(_0x132621===_0x5e0bfa(0xf9)){if(!_0x1a5543||_0x44dd0b)throw CliErrors['validation'](_0x5e0bfa(0x109));return{'kind':_0x132621,'timezone':_0x5e0bfa(0x105),'scheduledAt':_0x1a5543,'title':_0xe7766,'prompt':_0xf1de9c,'channel':_0x2dce79};}throw CliErrors['validation']('--kind\x20must\x20be\x20CRON\x20or\x20ONCE.');}function scheduleCollectionPath(_0x51373a){const _0x1f5586=a37_0x5b9d2a;return'/api/harness/apps/'+encodeURIComponent(_0x51373a)+_0x1f5586(0xdf);}function scheduleItemPath(_0x13183b,_0x3493a0){return scheduleCollectionPath(_0x13183b)+'/'+encodeURIComponent(_0x3493a0);}const scheduleValidate={'service':'schedule','command':a37_0x5b9d2a(0xd6),'description':a37_0x5b9d2a(0xd9),'risk':a37_0x5b9d2a(0xea),'flags':INPUT_FLAGS,async 'validate'(_0x121439){readScheduleInput(_0x121439);},async 'execute'(_0x1436e6){const _0x1d1a14=a37_0x5b9d2a,_0x2d1f69=readScheduleInput(_0x1436e6),_0x4279b7=await validateRuntimeSchedule(_0x1436e6['appCode'],_0x2d1f69);return{'ok':!![],'data':_0x4279b7,'message':_0x1d1a14(0x104)};}},scheduleCreate={'service':a37_0x5b9d2a(0xe3),'command':a37_0x5b9d2a(0xc4),'description':a37_0x5b9d2a(0xe9),'risk':a37_0x5b9d2a(0x102),'confirmationDescription':a37_0x5b9d2a(0xde),'flags':INPUT_FLAGS,async 'validate'(_0x39404d){readScheduleInput(_0x39404d);},async 'execute'(_0x42d280){const _0x44952a=a37_0x5b9d2a,_0x16d52b=readScheduleInput(_0x42d280),_0x3dac18=await validateRuntimeSchedule(_0x42d280[_0x44952a(0xe5)],_0x16d52b),_0xcb311e=await createRuntimeSchedule(_0x42d280['appCode'],_0x3dac18);return{'ok':!![],'data':_0xcb311e,'message':_0x44952a(0xd3)+_0xcb311e[_0x44952a(0xca)]+_0x44952a(0xfe)+_0xcb311e['scheduleId']};},async 'dryRun'(_0x31b412){const _0xb4f621=a37_0x5b9d2a,_0x379844=readScheduleInput(_0x31b412);return dryRun(_0xb4f621(0xcb),scheduleCollectionPath(_0x31b412[_0xb4f621(0xe5)]))[_0xb4f621(0xcf)](_0x379844)[_0xb4f621(0xef)](_0xb4f621(0xfc))['build']();}},scheduleList={'service':'schedule','command':a37_0x5b9d2a(0xe6),'description':'List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','risk':a37_0x5b9d2a(0xea),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0xf9567f){const _0x17c572=a37_0x5b9d2a,_0x1d08a7=_0xf9567f[_0x17c572(0xf8)]('limit');if(!Number[_0x17c572(0xc2)](_0x1d08a7)||_0x1d08a7<0x1||_0x1d08a7>0x64)throw CliErrors[_0x17c572(0xdc)](_0x17c572(0xc6));const _0x239aeb=_0xf9567f[_0x17c572(0xe1)]('cursor');if(_0x239aeb&&(_0x239aeb[_0x17c572(0xe0)]>0x400||_0x239aeb[_0x17c572(0xec)]()!==_0x239aeb))throw CliErrors[_0x17c572(0xdc)](_0x17c572(0xf3));},async 'execute'(_0x4b1608){const _0x14b50e=a37_0x5b9d2a,_0x4d07c4=_0x4b1608['str'](_0x14b50e(0xe8)),_0x2901af=await listRuntimeSchedules(_0x4b1608[_0x14b50e(0xe5)],{'kind':_0x4b1608[_0x14b50e(0xe1)](_0x14b50e(0xca)),'limit':_0x4b1608[_0x14b50e(0xf8)](_0x14b50e(0xee)),..._0x4d07c4?{'cursor':_0x4d07c4}:{}});return{'ok':!![],'data':_0x2901af};}},scheduleDetail={'service':'schedule','command':a37_0x5b9d2a(0x101),'description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':a37_0x5b9d2a(0xea),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x16469b){const _0x26f4a0=a37_0x5b9d2a,_0x4a9fe9=await getRuntimeSchedule(_0x16469b[_0x26f4a0(0xe5)],_0x16469b[_0x26f4a0(0xe1)](_0x26f4a0(0x107)));return{'ok':!![],'data':_0x4a9fe9};}},scheduleRun={'service':a37_0x5b9d2a(0xe3),'command':'run','description':'立即运行一次定时任务并创建\x20Task','risk':'high-risk-write','confirmationDescription':a37_0x5b9d2a(0xce),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x25b82e){const _0xe3a2f8=a37_0x5b9d2a,_0x34af73=_0x25b82e[_0xe3a2f8(0xe1)]('schedule-id'),_0x3f2f34=await runRuntimeSchedule(_0x25b82e[_0xe3a2f8(0xe5)],_0x34af73);return{'ok':!![],'data':_0x3f2f34,'message':_0xe3a2f8(0x10a)+_0x3f2f34[_0xe3a2f8(0xc5)]+_0xe3a2f8(0xd2)+_0x34af73};},async 'dryRun'(_0x21266b){const _0x401c15=a37_0x5b9d2a,_0x5c2fa9=_0x21266b[_0x401c15(0xe1)](_0x401c15(0x107));return dryRun(_0x401c15(0xcb),scheduleItemPath(_0x21266b[_0x401c15(0xe5)],_0x5c2fa9)+_0x401c15(0xd4))[_0x401c15(0xef)](_0x401c15(0xc7)+_0x5c2fa9+_0x401c15(0xf6))[_0x401c15(0x103)]();}},scheduleDelete={'service':a37_0x5b9d2a(0xe3),'command':a37_0x5b9d2a(0x10c),'description':a37_0x5b9d2a(0xed),'risk':'high-risk-write','confirmationDescription':a37_0x5b9d2a(0x100),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x1c6bbe){const _0x24ec00=a37_0x5b9d2a,_0x19c215=_0x1c6bbe[_0x24ec00(0xe1)](_0x24ec00(0x107)),_0x159764=await deleteRuntimeSchedule(_0x1c6bbe[_0x24ec00(0xe5)],_0x19c215);return{'ok':!![],'data':_0x159764,'message':_0x24ec00(0xd5)+_0x19c215};},async 'dryRun'(_0x586260){const _0x1ab5a5=a37_0x5b9d2a,_0x131459=_0x586260[_0x1ab5a5(0xe1)](_0x1ab5a5(0x107));return dryRun(_0x1ab5a5(0xcd),scheduleItemPath(_0x586260['appCode'],_0x131459))[_0x1ab5a5(0xef)](_0x1ab5a5(0xf0)+_0x131459)['build']();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
@@ -1 +1 @@
1
- function a38_0x5e7d(_0x207f1c,_0x4c4c23){_0x207f1c=_0x207f1c-0x1ac;const _0x459f03=a38_0x459f();let _0x5e7d28=_0x459f03[_0x207f1c];return _0x5e7d28;}const a38_0x40096a=a38_0x5e7d;(function(_0x369fc8,_0x4944ff){const _0x4a221d=a38_0x5e7d,_0x5b7061=_0x369fc8();while(!![]){try{const _0x2160a9=-parseInt(_0x4a221d(0x1b8))/0x1+-parseInt(_0x4a221d(0x1b7))/0x2*(-parseInt(_0x4a221d(0x1b9))/0x3)+-parseInt(_0x4a221d(0x1b2))/0x4*(parseInt(_0x4a221d(0x1b6))/0x5)+-parseInt(_0x4a221d(0x1b0))/0x6*(parseInt(_0x4a221d(0x1b5))/0x7)+-parseInt(_0x4a221d(0x1af))/0x8*(parseInt(_0x4a221d(0x1ae))/0x9)+-parseInt(_0x4a221d(0x1b1))/0xa*(parseInt(_0x4a221d(0x1b4))/0xb)+parseInt(_0x4a221d(0x1ad))/0xc;if(_0x2160a9===_0x4944ff)break;else _0x5b7061['push'](_0x5b7061['shift']());}catch(_0x2c75ab){_0x5b7061['push'](_0x5b7061['shift']());}}}(a38_0x459f,0x3d0f7));function a38_0x459f(){const _0x3e8df6=['1710366DZafhB','2041175aoLwGv','1774AesPbC','360909kTMRAI','813CdvROo','Export\x20machine-readable\x20command\x20schema\x20(JSON)','17325984NocRJK','1654281Nxpjvp','16yePDKJ','6Qtaagi','265030pMSZLF','4zaWfvA','export','22HMnjMM'];a38_0x459f=function(){return _0x3e8df6;};return a38_0x459f();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x4fc370){const _0x48c971=await buildSchemaPayload();return{'ok':!![],'data':_0x48c971};}export const schemaDefinition={'service':'schema','command':a38_0x40096a(0x1b3),'description':a38_0x40096a(0x1ac),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
1
+ const a38_0x30eab3=a38_0x1489;function a38_0x30ae(){const _0x24cba1=['1017lJzXwZ','13214lLqeNO','Export\x20machine-readable\x20command\x20schema\x20(JSON)','4YmsQsT','584qHvnSZ','31eMCSqL','3854543wkShwz','19621LmNxae','936768HtvWaP','10190zGknjx','12435QPjgIK','read','154830coFRMQ'];a38_0x30ae=function(){return _0x24cba1;};return a38_0x30ae();}(function(_0x34175c,_0x170823){const _0x2a7189=a38_0x1489,_0x2a5705=_0x34175c();while(!![]){try{const _0x2f1e41=parseInt(_0x2a7189(0x17e))/0x1*(parseInt(_0x2a7189(0x187))/0x2)+-parseInt(_0x2a7189(0x181))/0x3+parseInt(_0x2a7189(0x189))/0x4*(parseInt(_0x2a7189(0x183))/0x5)+parseInt(_0x2a7189(0x185))/0x6+-parseInt(_0x2a7189(0x180))/0x7*(parseInt(_0x2a7189(0x17d))/0x8)+parseInt(_0x2a7189(0x186))/0x9*(parseInt(_0x2a7189(0x182))/0xa)+parseInt(_0x2a7189(0x17f))/0xb;if(_0x2f1e41===_0x170823)break;else _0x2a5705['push'](_0x2a5705['shift']());}catch(_0x172b13){_0x2a5705['push'](_0x2a5705['shift']());}}}(a38_0x30ae,0x2c622));function a38_0x1489(_0xea601b,_0x487535){_0xea601b=_0xea601b-0x17d;const _0x30ae70=a38_0x30ae();let _0x148931=_0x30ae70[_0xea601b];return _0x148931;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x31e056){const _0x136f43=await buildSchemaPayload();return{'ok':!![],'data':_0x136f43};}export const schemaDefinition={'service':'schema','command':'export','description':a38_0x30eab3(0x188),'risk':a38_0x30eab3(0x184),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};