@lovrabet/lovrabet-cli 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) 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.d.ts +2 -1
  80. package/lib/core/api-client.js +1 -1
  81. package/lib/core/db-resolver.js +1 -1
  82. package/lib/core/sdk-client.js +1 -1
  83. package/lib/errors.js +1 -1
  84. package/lib/framework/build-all-flags.js +1 -1
  85. package/lib/framework/dryrun.js +1 -1
  86. package/lib/framework/flags.js +1 -1
  87. package/lib/framework/help.js +1 -1
  88. package/lib/framework/index.js +1 -1
  89. package/lib/framework/output.js +1 -1
  90. package/lib/framework/preparse.js +1 -1
  91. package/lib/framework/rate-limit.js +1 -1
  92. package/lib/framework/raw-flags.js +1 -1
  93. package/lib/framework/response.js +1 -1
  94. package/lib/framework/runner-confirmation.js +1 -1
  95. package/lib/framework/runner-error.js +1 -1
  96. package/lib/framework/runner.js +1 -1
  97. package/lib/framework/schema-export.js +1 -1
  98. package/lib/framework/service-order.js +1 -1
  99. package/lib/framework/types.js +1 -1
  100. package/lib/generated/build-info.d.ts +4 -4
  101. package/lib/generated/build-info.js +1 -1
  102. package/lib/help.js +1 -1
  103. package/lib/postinstall.js +1 -1
  104. package/lib/runtime/confirmation.js +1 -1
  105. package/lib/runtime/event.js +1 -1
  106. package/lib/runtime/index.js +1 -1
  107. package/lib/runtime/queue.js +1 -1
  108. package/lib/runtime/resolve.js +1 -1
  109. package/lib/skills/builtin-skill.js +1 -1
  110. package/lib/skills/npx-skills-add.js +1 -1
  111. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  112. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  113. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  114. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  115. package/lib/skills/runtime-skill-sync/links.js +1 -1
  116. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  117. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  118. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  119. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  120. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  121. package/lib/skills/runtime-skill-sync/push.js +1 -1
  122. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  123. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  124. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  125. package/lib/skills/runtime-skill-sync.js +1 -1
  126. package/lib/skills/skill-presence.js +1 -1
  127. package/lib/utils/apply-jq-filter.js +1 -1
  128. package/lib/utils/logger.js +1 -1
  129. package/lib/utils/lossless-json.js +1 -1
  130. package/lib/utils/params.js +1 -1
  131. package/lib/utils/platform.js +1 -1
  132. package/lib/utils/update-notice.js +1 -1
  133. package/lib/utils/version.js +1 -1
  134. package/lib/utils/write-cli-side-channel.js +1 -1
  135. package/package.json +1 -1
  136. package/skills/lovrabet/SKILL.md +4 -2
  137. package/skills/lovrabet/references/lovrabet-schedule-workflow.md +10 -4
  138. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- function a28_0x4e7a(_0x11355f,_0x42ae63){_0x11355f=_0x11355f-0xad;const _0x11fc76=a28_0x11fc();let _0x4e7a4a=_0x11fc76[_0x11355f];return _0x4e7a4a;}function a28_0x11fc(){const _0x2d84ff=['5ZVeQKD','98037MYqOBE','trim','44gEDYKN','read','appCode','27490qYGqBf','sdk-doc','262731IArmhk','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','str','39GXMQWz','7FbSlfw','3443drBXQa','3690798FwCGGc','848604OxzPOH','433516hxrmwE','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','72QrBRMn','863185FeKNID'];a28_0x11fc=function(){return _0x2d84ff;};return a28_0x11fc();}const a28_0x159333=a28_0x4e7a;(function(_0x534e55,_0x250d05){const _0x659046=a28_0x4e7a,_0x5c46a5=_0x534e55();while(!![]){try{const _0x358f3e=parseInt(_0x659046(0xbd))/0x1*(-parseInt(_0x659046(0xb9))/0x2)+-parseInt(_0x659046(0xb1))/0x3*(-parseInt(_0x659046(0xc0))/0x4)+parseInt(_0x659046(0xbc))/0x5+-parseInt(_0x659046(0xb7))/0x6*(parseInt(_0x659046(0xb5))/0x7)+parseInt(_0x659046(0xbb))/0x8*(parseInt(_0x659046(0xbe))/0x9)+-parseInt(_0x659046(0xaf))/0xa*(-parseInt(_0x659046(0xb6))/0xb)+-parseInt(_0x659046(0xb8))/0xc*(-parseInt(_0x659046(0xb4))/0xd);if(_0x358f3e===_0x250d05)break;else _0x5c46a5['push'](_0x5c46a5['shift']());}catch(_0x293977){_0x5c46a5['push'](_0x5c46a5['shift']());}}}(a28_0x11fc,0x945c6));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使用文档';export function formatDatasetSdkMarkdown(_0x11ef4a){const _0x3c54ec=a28_0x4e7a,_0x2075f1=typeof _0x11ef4a==='string'?_0x11ef4a[_0x3c54ec(0xbf)]():'';return _0x2075f1||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':'dataset','command':a28_0x159333(0xb0),'description':a28_0x159333(0xb2),'risk':a28_0x159333(0xad),'flags':[{...CODE_FLAG,'description':a28_0x159333(0xba)}],async 'execute'(_0xf8a243){const _0x23a079=a28_0x159333,_0x3311de=_0xf8a243[_0x23a079(0xb3)]('code'),_0x325e9b=await getDatasetSdkUsageDoc(_0x3311de,_0xf8a243[_0x23a079(0xae)]);return{'ok':!![],'data':{'code':_0x3311de,'appCode':_0xf8a243['appCode'],'markdown':formatDatasetSdkMarkdown(_0x325e9b)}};}};
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 +1 @@
1
- const a29_0x3cf988=a29_0x508a;(function(_0x5d9826,_0x8738c6){const _0x35a4e9=a29_0x508a,_0x5b4727=_0x5d9826();while(!![]){try{const _0x361b87=parseInt(_0x35a4e9(0x21f))/0x1+parseInt(_0x35a4e9(0x1fa))/0x2*(parseInt(_0x35a4e9(0x1cc))/0x3)+parseInt(_0x35a4e9(0x1e0))/0x4+parseInt(_0x35a4e9(0x203))/0x5*(parseInt(_0x35a4e9(0x1d9))/0x6)+-parseInt(_0x35a4e9(0x1d2))/0x7+-parseInt(_0x35a4e9(0x1f0))/0x8*(-parseInt(_0x35a4e9(0x200))/0x9)+-parseInt(_0x35a4e9(0x21c))/0xa*(parseInt(_0x35a4e9(0x1d8))/0xb);if(_0x361b87===_0x8738c6)break;else _0x5b4727['push'](_0x5b4727['shift']());}catch(_0x1203fd){_0x5b4727['push'](_0x5b4727['shift']());}}}(a29_0x30f1,0xb69fe));import a29_0x581959 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';function a29_0x508a(_0x3d8ab1,_0xbb73f2){_0x3d8ab1=_0x3d8ab1-0x1ca;const _0x30f1e6=a29_0x30f1();let _0x508a34=_0x30f1e6[_0x3d8ab1];return _0x508a34;}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';function a29_0x30f1(){const _0x27dfeb=['\x20\x20Merged\x20Config','appCode','✗\x20Invalid','\x20\x20Reason:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(missing)','\x20\x20─','installedPath','1421256NFdTLZ','⚠\x20Empty\x20(treated\x20as\x20{})','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','riskLevel','ClientAk','\x20\x20Repair:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Auth','(not\x20set)','arch','\x20\x20API\x20Endpoints','854NbwIgb','\x20\x20Service\x20Tree','reason','serviceCount','\x20\x20Installed\x20Path:\x20\x20','repairCommand','72EOHxKN','(default)','\x20\x20Session\x20check:\x20\x20\x20','5oxxJZw','⚠\x20Empty','padEnd','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','locale','green','\x20\x20Package\x20Version:\x20','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(none)','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','(unnamed)','accessKey','commandCount','(default:\x20','repeat','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20commands)','\x20(legacy/compat\x20only)','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','path','red','\x20\x20Config\x20Files','format','current','2410190oVIBxd','(not\x20found)','packageVersion','800480iVxvuZ','empty','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','log','✗\x20Invalid\x20JSON','gray','verbose','source','(removed\x20—\x20cookie\x20auth\x20disabled)','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Skill\x20Version:\x20\x20\x20','status','Diagnose\x20CLI\x20configuration\x20and\x20environment','(no\x20file)','10401WPmExm','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','✓\x20current','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','Project','\x20\x20State:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','10423091dqmkjd','services','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','length','missing','\x20\x20auth\x20(effective):\x20','121ELMGUu','894618xlLuUI','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','bold','name','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','state','4148016slOkeW','message','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','version','\x20Imported\x20from:\x20','doctor','(set,\x20length=','pageSize','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'];a29_0x30f1=function(){return _0x27dfeb;};return a29_0x30f1();}import{inspectBuiltinSkill}from'../skills/builtin-skill.js';async function execute(_0x37bcd0){const _0x4ca641=a29_0x508a,_0xe6ed81=getCliVersion(),_0x5073d9=buildConfigFromFlags({});await initGlobalEnvironment(_0x5073d9),console[_0x4ca641(0x222)](),console['log'](a29_0x581959[_0x4ca641(0x1dc)](CLI_BIN_NAME+'\x20doctor')),console[_0x4ca641(0x222)](a29_0x581959[_0x4ca641(0x224)]('─'['repeat'](0x32))),console[_0x4ca641(0x222)](_0x4ca641(0x1cd)+_0xe6ed81),console[_0x4ca641(0x222)](_0x4ca641(0x1e2)+process[_0x4ca641(0x1e3)]),console['log'](_0x4ca641(0x1de)+process['platform']+'\x20'+process[_0x4ca641(0x1f8)]);const _0x2d6716=inspectBuiltinSkill();console[_0x4ca641(0x222)](),console[_0x4ca641(0x222)](a29_0x581959[_0x4ca641(0x1dc)]('\x20\x20Built-in\x20Skill')),console[_0x4ca641(0x222)](a29_0x581959[_0x4ca641(0x224)]('\x20\x20─'[_0x4ca641(0x212)](0x1e))),console[_0x4ca641(0x222)](_0x4ca641(0x1d1)+(_0x2d6716[_0x4ca641(0x1df)]==='current'?a29_0x581959[_0x4ca641(0x208)](_0x4ca641(0x1ce)):a29_0x581959[_0x4ca641(0x218)]('✗\x20'+_0x2d6716[_0x4ca641(0x1df)]))),console[_0x4ca641(0x222)](_0x4ca641(0x209)+_0x2d6716[_0x4ca641(0x21e)]),console[_0x4ca641(0x222)](_0x4ca641(0x229)+(_0x2d6716['skillVersion']||a29_0x581959[_0x4ca641(0x224)](_0x4ca641(0x1ed)))),console[_0x4ca641(0x222)](_0x4ca641(0x1fe)+(_0x2d6716[_0x4ca641(0x1ef)]||a29_0x581959['gray'](_0x4ca641(0x21d))));_0x2d6716[_0x4ca641(0x1df)]!==_0x4ca641(0x21b)&&console['log'](_0x4ca641(0x1f5)+_0x2d6716[_0x4ca641(0x1ff)]);_0x2d6716[_0x4ca641(0x1fc)]&&console['log'](_0x4ca641(0x1ec)+_0x2d6716[_0x4ca641(0x1fc)]);console[_0x4ca641(0x222)](),console[_0x4ca641(0x222)](a29_0x581959[_0x4ca641(0x1dc)](_0x4ca641(0x219))),console['log'](a29_0x581959[_0x4ca641(0x224)](_0x4ca641(0x1ee)[_0x4ca641(0x212)](0x1e)));const _0x3a552b=getGlobalConfigPath(),_0x46ad70=getProjectConfigPath();console['log'](_0x4ca641(0x1db)+(_0x3a552b||a29_0x581959[_0x4ca641(0x224)](_0x4ca641(0x21d)))),console[_0x4ca641(0x222)](_0x4ca641(0x20b)+(_0x46ad70||a29_0x581959[_0x4ca641(0x224)](_0x4ca641(0x21d)))),console[_0x4ca641(0x222)](),console[_0x4ca641(0x222)](a29_0x581959[_0x4ca641(0x1dc)]('\x20\x20Config\x20JSON')),console['log'](a29_0x581959[_0x4ca641(0x224)]('\x20\x20─'['repeat'](0x1e)));const _0x2ebc2c=(_0x717f41,_0x2076f8)=>{const _0x3035e0=_0x4ca641;if(!_0x2076f8){console[_0x3035e0(0x222)]('\x20\x20'+_0x717f41[_0x3035e0(0x205)](0x11)+'\x20'+a29_0x581959['gray'](_0x3035e0(0x1cb)));return;}const _0x348d2a=inspectCliConfigJsonFile(_0x2076f8);if(_0x348d2a[_0x3035e0(0x22a)]==='ok')console['log']('\x20\x20'+_0x717f41[_0x3035e0(0x205)](0x11)+'\x20'+a29_0x581959[_0x3035e0(0x208)]('✓\x20Valid\x20JSON'));else{if(_0x348d2a[_0x3035e0(0x22a)]==='empty')console[_0x3035e0(0x222)]('\x20\x20'+_0x717f41[_0x3035e0(0x205)](0x11)+'\x20'+a29_0x581959['yellow'](_0x3035e0(0x1f1)));else _0x348d2a[_0x3035e0(0x22a)]===_0x3035e0(0x1d6)?console[_0x3035e0(0x222)]('\x20\x20'+_0x717f41[_0x3035e0(0x205)](0x11)+'\x20'+a29_0x581959[_0x3035e0(0x224)](_0x3035e0(0x1ed))):(console[_0x3035e0(0x222)]('\x20\x20'+_0x717f41['padEnd'](0x11)+'\x20'+a29_0x581959[_0x3035e0(0x218)](_0x3035e0(0x223))),console[_0x3035e0(0x222)]('\x20\x20'+''[_0x3035e0(0x205)](0x11)+'\x20'+a29_0x581959[_0x3035e0(0x218)](_0x348d2a[_0x3035e0(0x1e1)])));}};_0x2ebc2c('Global',_0x3a552b),_0x2ebc2c(_0x4ca641(0x1d0),_0x46ad70),console[_0x4ca641(0x222)](),console[_0x4ca641(0x222)](a29_0x581959[_0x4ca641(0x1dc)](_0x4ca641(0x1e9))),console['log'](a29_0x581959['gray'](_0x4ca641(0x1ee)[_0x4ca641(0x212)](0x1e))),console[_0x4ca641(0x222)](_0x4ca641(0x1da)+(_0x5073d9[_0x4ca641(0x1ea)]||a29_0x581959[_0x4ca641(0x218)](_0x4ca641(0x1f7)))),console[_0x4ca641(0x222)]('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5073d9['env']);const _0x163353=isLegacyCompatConfigKey(_0x4ca641(0x207))?a29_0x581959[_0x4ca641(0x224)](_0x5073d9[_0x4ca641(0x207)]+_0x4ca641(0x215)):_0x5073d9[_0x4ca641(0x207)];console[_0x4ca641(0x222)](_0x4ca641(0x221)+_0x163353),console[_0x4ca641(0x222)](_0x4ca641(0x1cf)+(_0x5073d9['defaultApp']||a29_0x581959['gray'](_0x4ca641(0x20c)))),console[_0x4ca641(0x222)]('\x20\x20currentApp:\x20\x20\x20\x20\x20\x20'+(_0x5073d9['currentApp']||a29_0x581959[_0x4ca641(0x224)]('(none)'))),console['log']('\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x5073d9[_0x4ca641(0x21a)]||a29_0x581959[_0x4ca641(0x224)](_0x4ca641(0x211)+DEFAULT_CONFIG_VALUES[_0x4ca641(0x21a)]+')'))),console[_0x4ca641(0x222)](_0x4ca641(0x1d4)+(_0x5073d9[_0x4ca641(0x1e7)]??a29_0x581959[_0x4ca641(0x224)](_0x4ca641(0x201)))),console['log'](_0x4ca641(0x20d)+_0x5073d9[_0x4ca641(0x1f3)]),console['log']('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5073d9[_0x4ca641(0x225)]),console[_0x4ca641(0x222)](_0x4ca641(0x1d7)+AUTH_MODE[_0x4ca641(0x1f4)]),console[_0x4ca641(0x222)](_0x4ca641(0x228)+(_0x5073d9['accessKey']?a29_0x581959[_0x4ca641(0x208)](_0x4ca641(0x1e6)+_0x5073d9[_0x4ca641(0x20f)][_0x4ca641(0x1d5)]+')'):a29_0x581959[_0x4ca641(0x224)](_0x4ca641(0x20c)))),console['log'](),console[_0x4ca641(0x222)](a29_0x581959[_0x4ca641(0x1dc)](_0x4ca641(0x1f9))),console[_0x4ca641(0x222)](a29_0x581959[_0x4ca641(0x224)](_0x4ca641(0x1ee)[_0x4ca641(0x212)](0x1e))),console[_0x4ca641(0x222)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x4ca641(0x222)](_0x4ca641(0x216)+getUserDomain()),console[_0x4ca641(0x222)](_0x4ca641(0x20a)+getRuntimeDomain()),console[_0x4ca641(0x222)](),console['log'](a29_0x581959['bold'](_0x4ca641(0x1fb))),console[_0x4ca641(0x222)](a29_0x581959[_0x4ca641(0x224)](_0x4ca641(0x1ee)[_0x4ca641(0x212)](0x1e)));const _0x9d2a85=inspectServiceRegistry();console[_0x4ca641(0x222)](_0x4ca641(0x206)+_0x9d2a85['registryPath']),console[_0x4ca641(0x222)]('\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+formatServiceRegistryStatus(_0x9d2a85)),console[_0x4ca641(0x222)](_0x4ca641(0x213)+_0x9d2a85[_0x4ca641(0x1fd)]),console['log'](_0x4ca641(0x1f2)+_0x9d2a85[_0x4ca641(0x210)]);for(const _0x4f0e0e of _0x9d2a85[_0x4ca641(0x1d3)]){console[_0x4ca641(0x222)]('\x20\x20'+(_0x4f0e0e['serviceCode']+':')[_0x4ca641(0x205)](0x11)+'\x20'+(_0x4f0e0e[_0x4ca641(0x1dd)]||a29_0x581959[_0x4ca641(0x224)](_0x4ca641(0x20e)))+'\x20('+_0x4f0e0e[_0x4ca641(0x210)]+_0x4ca641(0x214)),console['log']('\x20\x20'+''['padEnd'](0x11)+_0x4ca641(0x1e4)+_0x4f0e0e[_0x4ca641(0x226)][_0x4ca641(0x217)]);}return console['log'](),console[_0x4ca641(0x222)](a29_0x581959[_0x4ca641(0x1dc)](_0x4ca641(0x1f6))),console['log'](a29_0x581959[_0x4ca641(0x224)]('\x20\x20─'[_0x4ca641(0x212)](0x1e))),console['log'](_0x4ca641(0x1e8)+a29_0x581959[_0x4ca641(0x208)](AUTH_MODE[_0x4ca641(0x1f4)]+'\x20(accessKey)')),console['log'](_0x4ca641(0x202)+a29_0x581959[_0x4ca641(0x224)](_0x4ca641(0x227))),console[_0x4ca641(0x222)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x44440a){const _0x540974=a29_0x508a;if(_0x44440a['status']==='ok')return a29_0x581959[_0x540974(0x208)]('✓\x20Loaded');if(_0x44440a[_0x540974(0x22a)]==='missing')return a29_0x581959['gray'](_0x540974(0x21d));if(_0x44440a[_0x540974(0x22a)]===_0x540974(0x220))return a29_0x581959['yellow'](_0x540974(0x204));return a29_0x581959[_0x540974(0x218)](_0x540974(0x1eb)+(_0x44440a[_0x540974(0x1e1)]?':\x20'+_0x44440a[_0x540974(0x1e1)]:''));}export const doctorDefinition={'service':a29_0x3cf988(0x1e5),'command':'check','description':a29_0x3cf988(0x1ca),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
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 +1 @@
1
- const a30_0xc38f42=a30_0x3d2f;(function(_0x45c862,_0x17ddbc){const _0x432e9a=a30_0x3d2f,_0x4b5ff8=_0x45c862();while(!![]){try{const _0x7f3055=-parseInt(_0x432e9a(0x181))/0x1+parseInt(_0x432e9a(0x173))/0x2+parseInt(_0x432e9a(0x15f))/0x3+-parseInt(_0x432e9a(0x16c))/0x4*(parseInt(_0x432e9a(0x16a))/0x5)+-parseInt(_0x432e9a(0x172))/0x6+parseInt(_0x432e9a(0x16d))/0x7*(-parseInt(_0x432e9a(0x17a))/0x8)+parseInt(_0x432e9a(0x170))/0x9;if(_0x7f3055===_0x17ddbc)break;else _0x4b5ff8['push'](_0x4b5ff8['shift']());}catch(_0x2e0b70){_0x4b5ff8['push'](_0x4b5ff8['shift']());}}}(a30_0x33f7,0x30d1d));function a30_0x33f7(){const _0x1cf38=['Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','5FxUZrW','file','410672Eqrdhr','91WCejiM','\x20to\x20runtime\x20app\x20','body','4384026uxXces','boolean','1063728OMTNRu','522006qQuzTg','read','string','upload','POST','query-url','validation','87296WNlDPw','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','description','bool','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','long-term','path','345073LYSYMw','str','filePath','File','656199erHMBL','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','Uploaded\x20file:\x20','filePath\x20is\x20required.','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','download','appCode','filepath','Path\x20to\x20the\x20local\x20file\x20to\x20upload'];a30_0x33f7=function(){return _0x1cf38;};return a30_0x33f7();}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':a30_0xc38f42(0x16b),'type':a30_0xc38f42(0x175),'required':!![],'description':a30_0xc38f42(0x167)},FILEPATH_FLAG={'name':'filepath','type':a30_0xc38f42(0x175),'required':!![],'description':a30_0xc38f42(0x168)},DOWNLOAD_FLAG={'name':a30_0xc38f42(0x164),'type':a30_0xc38f42(0x171),'description':a30_0xc38f42(0x160)},LONG_TERM_FLAG={'name':a30_0xc38f42(0x17f),'type':'boolean','description':a30_0xc38f42(0x17b)};function a30_0x3d2f(_0xaafa0a,_0x5f3db8){_0xaafa0a=_0xaafa0a-0x15f;const _0x33f7c7=a30_0x33f7();let _0x3d2fc5=_0x33f7c7[_0xaafa0a];return _0x3d2fc5;}function requireFilePath(_0x874e6a){const _0x590838=a30_0xc38f42,_0x5873ed=_0x874e6a['trim']();if(!_0x5873ed)throw CliErrors[_0x590838(0x179)](_0x590838(0x162));return _0x5873ed;}const fileUpload={'service':a30_0xc38f42(0x16b),'command':a30_0xc38f42(0x176),'description':a30_0xc38f42(0x169),'risk':a30_0xc38f42(0x174),'flags':[FILE_FLAG],async 'dryRun'(_0x46fb3f){const _0x86f82f=a30_0xc38f42,_0x20197b=requireRuntimeUploadFile(_0x46fb3f[_0x86f82f(0x182)]('file'),_0x86f82f(0x184));return dryRun(_0x86f82f(0x177),'/client/uploadFile')[_0x86f82f(0x16f)]({'appCode':_0x46fb3f[_0x86f82f(0x165)],'multipart':{'file':_0x20197b}})[_0x86f82f(0x17c)]('Preview:\x20upload\x20'+_0x20197b[_0x86f82f(0x180)]+_0x86f82f(0x16e)+_0x46fb3f['appCode'])['build']();},async 'execute'(_0x2cb587){const _0x5dd43a=a30_0xc38f42,_0x2383c9=requireRuntimeUploadFile(_0x2cb587[_0x5dd43a(0x182)](_0x5dd43a(0x16b)),_0x5dd43a(0x184)),_0x3608f5=await uploadRuntimeFile(_0x2cb587[_0x5dd43a(0x165)],_0x2383c9['path']);return{'ok':!![],'data':_0x3608f5,'message':_0x3608f5['filePath']?_0x5dd43a(0x161)+_0x3608f5[_0x5dd43a(0x183)]+_0x5dd43a(0x163):'Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.'};}},fileQueryUrl={'service':a30_0xc38f42(0x16b),'command':a30_0xc38f42(0x178),'description':a30_0xc38f42(0x17e),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x404c85){const _0x29838a=a30_0xc38f42,_0x596b7b=requireFilePath(_0x404c85[_0x29838a(0x182)](_0x29838a(0x166))),_0x82c32f=await queryRuntimeFileUrl(_0x596b7b,{'download':_0x404c85[_0x29838a(0x17d)](_0x29838a(0x164)),'longTerm':_0x404c85[_0x29838a(0x17d)](_0x29838a(0x17f))});return{'ok':!![],'data':_0x82c32f};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
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 +1 @@
1
- const a31_0xb5dd1b=a31_0x104e;(function(_0x107383,_0x20e8f4){const _0x1f3c2a=a31_0x104e,_0x13816c=_0x107383();while(!![]){try{const _0x28fdc3=-parseInt(_0x1f3c2a(0xe9))/0x1*(-parseInt(_0x1f3c2a(0xe3))/0x2)+parseInt(_0x1f3c2a(0xd0))/0x3+-parseInt(_0x1f3c2a(0xce))/0x4+-parseInt(_0x1f3c2a(0xe0))/0x5*(parseInt(_0x1f3c2a(0xdf))/0x6)+parseInt(_0x1f3c2a(0xdb))/0x7+-parseInt(_0x1f3c2a(0xd4))/0x8*(parseInt(_0x1f3c2a(0xf3))/0x9)+parseInt(_0x1f3c2a(0xf6))/0xa*(parseInt(_0x1f3c2a(0xcd))/0xb);if(_0x28fdc3===_0x20e8f4)break;else _0x13816c['push'](_0x13816c['shift']());}catch(_0x50aa2b){_0x13816c['push'](_0x13816c['shift']());}}}(a31_0x1837,0xa5ca3));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';function a31_0x1837(){const _0x32f7ad=['newConfigFileName','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','global','Override\x20imported\x20default\x20appcode','env','entries','cwd','99OQTARr','join','file','2220620DkAkAp','Skip\x20confirmation\x20when\x20overwriting','parse','yes','55gxlHdE','4620632oPvhsF','defaultApp','1444044BMBcRu','Source\x20file\x20not\x20found:\x20','project','Write\x20to\x20global\x20(~/','483768gMCvIX','appcode','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','message','apps','log','validation','1656634nqmVWS','Imported\x20from\x20','includes','riskLevel','144702nivpMS','55iPetMa','string','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','39846zJDFdI','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`.','boolean','object','app','\x22.\x20Allowed:\x20','47ZHNKiZ','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','\x20\x20default:\x20'];a31_0x1837=function(){return _0x32f7ad;};return a31_0x1837();}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_0xb5dd1b(0xf5),'type':a31_0xb5dd1b(0xe1),'description':a31_0xb5dd1b(0xe2),'required':!![]},{'name':a31_0xb5dd1b(0xd5),'type':'string','description':a31_0xb5dd1b(0xef)},{'name':a31_0xb5dd1b(0xf0),'type':a31_0xb5dd1b(0xe1),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0xb5dd1b(0xee),'type':'boolean','description':a31_0xb5dd1b(0xd3)+PRODUCT_CONFIG[a31_0xb5dd1b(0xec)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0xb5dd1b(0xcc),'type':a31_0xb5dd1b(0xe5),'description':a31_0xb5dd1b(0xca),'default':![]}];export async function runAppImport(_0x3254a1){const _0x478cc3=a31_0xb5dd1b,_0x76b302=_0x3254a1[_0x478cc3(0xee)]?_0x478cc3(0xee):_0x478cc3(0xd2),_0x41d19a=resolveWriteConfigPath(_0x76b302);await runFromImport(_0x3254a1,_0x41d19a);}async function runFromImport(_0x1b64a3,_0x535320){const _0x1a4dfa=a31_0xb5dd1b,_0x388be4=resolveFilePath(_0x1b64a3[_0x1a4dfa(0xf5)]);if(!existsSync(_0x388be4))throw CliErrors['validation'](_0x1a4dfa(0xd1)+_0x388be4);const _0x2c2f79=readSourceFile(_0x388be4),_0x31fd08=convertToRuntimeConfig(_0x2c2f79);_0x1b64a3[_0x1a4dfa(0xd5)]&&(_0x31fd08[_0x1a4dfa(0xd5)]=String(_0x1b64a3[_0x1a4dfa(0xd5)]));_0x1b64a3[_0x1a4dfa(0xf0)]&&(_0x31fd08[_0x1a4dfa(0xf0)]=resolveImportEnv(_0x1b64a3));if(!_0x31fd08[_0x1a4dfa(0xd5)])throw CliErrors[_0x1a4dfa(0xda)](_0x1a4dfa(0xed),_0x1a4dfa(0xe4));await writeImportConfig(_0x535320,_0x31fd08,_0x1b64a3),console['log'](_0x1a4dfa(0xdc)+_0x388be4),console['log']('\x20\x20config:\x20\x20'+_0x535320),console[_0x1a4dfa(0xd9)]('\x20\x20appcode:\x20'+_0x31fd08['appcode']);if(_0x31fd08[_0x1a4dfa(0xcf)])console[_0x1a4dfa(0xd9)](_0x1a4dfa(0xeb)+_0x31fd08['defaultApp']);}function a31_0x104e(_0x2f0483,_0x1136b7){_0x2f0483=_0x2f0483-0xca;const _0x183740=a31_0x1837();let _0x104e56=_0x183740[_0x2f0483];return _0x104e56;}function convertToRuntimeConfig(_0xe80703){const _0x1e45a8=a31_0xb5dd1b;if(_0xe80703[_0x1e45a8(0xd8)]&&typeof _0xe80703['apps']===_0x1e45a8(0xe6))throw CliErrors[_0x1e45a8(0xda)](_0x1e45a8(0xea),_0x1e45a8(0xd6));const _0x5b83bf={};for(const _0x47d94b of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0xe80703[_0x47d94b]!==undefined&&(_0x5b83bf[_0x47d94b]=_0xe80703[_0x47d94b]);}return!_0x5b83bf[_0x1e45a8(0xde)]&&(_0x5b83bf[_0x1e45a8(0xde)]=DEFAULT_CONFIG_VALUES[_0x1e45a8(0xde)]),_0x5b83bf;}async function writeImportConfig(_0x401591,_0x11525c,_0x1e6c99){const _0x2cc1da=a31_0xb5dd1b;let _0x2a7fb0={};existsSync(_0x401591)&&!_0x1e6c99[_0x2cc1da(0xcc)]&&(_0x2a7fb0=readConfigFile(_0x401591));for(const [_0x5bef8b,_0x1aec91]of Object[_0x2cc1da(0xf1)](_0x11525c)){_0x1aec91!==undefined&&(_0x2a7fb0[_0x5bef8b]=_0x1aec91);}if(_0x2a7fb0[_0x2cc1da(0xe7)])delete _0x2a7fb0[_0x2cc1da(0xe7)];writeConfigFile(_0x401591,_0x2a7fb0);}function resolveFilePath(_0x5ac339){const _0xc4c509=a31_0xb5dd1b;return isAbsolute(_0x5ac339)?_0x5ac339:resolve(process[_0xc4c509(0xf2)](),_0x5ac339);}function readSourceFile(_0x410d83){const _0x1c9747=a31_0xb5dd1b;try{const _0x15a1ce=readFileSync(_0x410d83,{'encoding':'utf8'});return JSON[_0x1c9747(0xcb)](_0x15a1ce);}catch(_0x29de79){throw CliErrors[_0x1c9747(0xda)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x29de79[_0x1c9747(0xd7)]);}}function resolveImportEnv(_0x392925){const _0x1ff011=a31_0xb5dd1b,_0xe60e1f=_0x392925[_0x1ff011(0xf0)];if(_0xe60e1f===undefined||_0xe60e1f==='')return DEFAULT_CONFIG_VALUES[_0x1ff011(0xf0)];if(!RUNTIME_ENV_VALUES[_0x1ff011(0xdd)](_0xe60e1f))throw CliErrors[_0x1ff011(0xda)]('Invalid\x20env\x20\x22'+_0xe60e1f+_0x1ff011(0xe8)+RUNTIME_ENV_VALUES[_0x1ff011(0xf4)](',\x20'));return _0xe60e1f;}
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 +1 @@
1
- const a32_0x3c66a8=a32_0x1f3e;(function(_0xcad310,_0x3a69ab){const _0x33b0cf=a32_0x1f3e,_0xd0338b=_0xcad310();while(!![]){try{const _0x46f2bc=-parseInt(_0x33b0cf(0x1ad))/0x1*(parseInt(_0x33b0cf(0x1ac))/0x2)+parseInt(_0x33b0cf(0x18c))/0x3+-parseInt(_0x33b0cf(0x1be))/0x4*(parseInt(_0x33b0cf(0x1b2))/0x5)+parseInt(_0x33b0cf(0x190))/0x6*(-parseInt(_0x33b0cf(0x1a3))/0x7)+parseInt(_0x33b0cf(0x1c1))/0x8+-parseInt(_0x33b0cf(0x1b3))/0x9*(parseInt(_0x33b0cf(0x1ba))/0xa)+parseInt(_0x33b0cf(0x1b6))/0xb;if(_0x46f2bc===_0x3a69ab)break;else _0xd0338b['push'](_0xd0338b['shift']());}catch(_0x2e0a0d){_0xd0338b['push'](_0xd0338b['shift']());}}}(a32_0x1af1,0x57d20));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':'title','type':a32_0x3c66a8(0x1c5),'required':!![],'description':a32_0x3c66a8(0x1bb)},FILE_FLAG={'name':a32_0x3c66a8(0x1ae),'type':a32_0x3c66a8(0x1c5),'required':!![],'description':a32_0x3c66a8(0x198)},QUERY_FLAG={'name':a32_0x3c66a8(0x199),'type':a32_0x3c66a8(0x1c5),'required':!![],'description':a32_0x3c66a8(0x18d)},TOPK_FLAG={'name':a32_0x3c66a8(0x1b0),'type':a32_0x3c66a8(0x1a1),'description':a32_0x3c66a8(0x1a7)};function a32_0x1f3e(_0x9f0126,_0x255b3b){_0x9f0126=_0x9f0126-0x189;const _0x1af1b7=a32_0x1af1();let _0x1f3e88=_0x1af1b7[_0x9f0126];return _0x1f3e88;}function readKnowledgeFile(_0x2b8bba){const _0x141514=a32_0x3c66a8;if(!_0x2b8bba)throw CliErrors[_0x141514(0x18f)](_0x141514(0x191));if(!existsSync(_0x2b8bba))throw CliErrors[_0x141514(0x18f)]('File\x20not\x20found:\x20'+_0x2b8bba);if(!statSync(_0x2b8bba)[_0x141514(0x1b8)]())throw CliErrors[_0x141514(0x18f)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x2b8bba);return readFileSync(_0x2b8bba,_0x141514(0x18b));}function summarizePersonalItem(_0x314153){const _0x597705=a32_0x3c66a8;return{'id':_0x314153['id'],'title':_0x314153[_0x597705(0x195)],'version':_0x314153['version'],'ragStatus':_0x314153[_0x597705(0x1a5)],'ragErrorMessage':_0x314153['ragErrorMessage'],'updateTime':_0x314153['updateTime']};}function a32_0x1af1(){const _0x5f1452=['version','isFile','scope','13810ExBlkg','Personal\x20knowledge-base\x20entry\x20title','/client/knowledge-base/personal/','length','24772pmcXnu','read','create','2511952vIlzJo','list','description','num','string','update','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','Personal\x20knowledge-base\x20entry\x20ID','utf8','1712790mrYQbo','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','build','validation','4205724WlCWpZ','File\x20path\x20is\x20required.','Created\x20KB\x20entry\x20','--topk\x20must\x20be\x20a\x20positive\x20number.','Override\x20the\x20existing\x20entry\x20title','title','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','Updated\x20KB\x20entry\x20','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','query','flag','docId','trim','Search\x20query\x20is\x20required.','appCode','map','body','number','把本地文件内容保存为个人知识库条目,并进入后续检索同步流程。','7LynlkU','write','ragStatus','updateTime','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','search','createTime','/update','ragErrorMessage','2WYGwBA','351926ULHbPp','file','str','topk','根据本地文件创建个人知识库条目','215dpcsVW','3123FWWKwt','metadata','score','14004914RNJxez'];a32_0x1af1=function(){return _0x5f1452;};return a32_0x1af1();}function detailPersonalItem(_0x3ea018){const _0x54cf56=a32_0x3c66a8;return{'id':_0x3ea018['id'],'appCode':_0x3ea018[_0x54cf56(0x19e)],'scope':_0x3ea018['scope'],'userId':_0x3ea018['userId'],'title':_0x3ea018[_0x54cf56(0x195)],'content':_0x3ea018['content']??'','version':_0x3ea018[_0x54cf56(0x1b7)],'ragStatus':_0x3ea018['ragStatus'],'ragErrorMessage':_0x3ea018[_0x54cf56(0x1ab)],'createTime':_0x3ea018[_0x54cf56(0x1a9)],'updateTime':_0x3ea018[_0x54cf56(0x1a6)]};}function summarizeSearchHit(_0x46f555){const _0x32dc75=a32_0x3c66a8;return{'scope':_0x46f555[_0x32dc75(0x1b9)],'title':_0x46f555[_0x32dc75(0x195)],'docId':_0x46f555[_0x32dc75(0x19b)],'score':_0x46f555[_0x32dc75(0x1b5)],'weightedScore':_0x46f555['weightedScore'],'content':_0x46f555['content'],'metadata':_0x46f555[_0x32dc75(0x1b4)]};}function readTopK(_0x2d2db8){const _0x4b5f47=a32_0x3c66a8,_0x42bf69=_0x2d2db8[_0x4b5f47(0x19a)](_0x4b5f47(0x1b0));if(_0x42bf69===undefined||_0x42bf69===null||_0x42bf69==='')return undefined;const _0x39cd0c=_0x2d2db8['num'](_0x4b5f47(0x1b0));if(!Number['isFinite'](_0x39cd0c)||_0x39cd0c<0x1)throw CliErrors[_0x4b5f47(0x18f)](_0x4b5f47(0x193));return _0x39cd0c;}const kbList={'service':'kb','command':a32_0x3c66a8(0x1c2),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a32_0x3c66a8(0x1bf),'flags':[VERBOSE_FLAG],async 'execute'(_0x4a0de2){const _0x49b41e=a32_0x3c66a8,_0x25bf1b=await listPersonalKnowledgeBaseItems(_0x4a0de2[_0x49b41e(0x19e)]);if(_0x4a0de2['bool']('verbose'))return{'ok':!![],'data':{'total':_0x25bf1b[_0x49b41e(0x1bd)],'items':_0x25bf1b}};return{'ok':!![],'data':{'total':_0x25bf1b['length'],'items':_0x25bf1b[_0x49b41e(0x19f)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':'Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','risk':a32_0x3c66a8(0x1bf),'flags':[{...ID_FLAG,'description':a32_0x3c66a8(0x18a)}],async 'execute'(_0x2c10a4){const _0x544ac6=a32_0x3c66a8,_0x2b97af=await getPersonalKnowledgeBaseItem(_0x2c10a4[_0x544ac6(0x1c4)]('id'),_0x2c10a4['appCode']);return{'ok':!![],'data':detailPersonalItem(_0x2b97af)};}},kbCreate={'service':'kb','command':a32_0x3c66a8(0x1c0),'description':a32_0x3c66a8(0x1b1),'risk':a32_0x3c66a8(0x1a4),'confirmationDescription':a32_0x3c66a8(0x1a2),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x1a3eeb){const _0x1a27be=a32_0x3c66a8,_0x83c1ca=_0x1a3eeb[_0x1a27be(0x1af)]('title'),_0x18aef1=readKnowledgeFile(_0x1a3eeb[_0x1a27be(0x1af)](_0x1a27be(0x1ae))),_0x38275d=await createPersonalKnowledgeBaseItem(_0x1a3eeb[_0x1a27be(0x19e)],{'title':_0x83c1ca,'content':_0x18aef1});return{'ok':!![],'data':summarizePersonalItem(_0x38275d),'message':_0x1a27be(0x192)+_0x38275d['id']+'\x20('+_0x38275d[_0x1a27be(0x195)]+')'};},async 'dryRun'(_0x3045b3){const _0xb6b4e6=a32_0x3c66a8,_0x395f3b=_0x3045b3[_0xb6b4e6(0x1af)](_0xb6b4e6(0x195)),_0x2d7f25=readKnowledgeFile(_0x3045b3['str'](_0xb6b4e6(0x1ae)));return dryRun('POST','/client/knowledge-base/personal/create')['body']({'appCode':_0x3045b3[_0xb6b4e6(0x19e)],'title':_0x395f3b,'content':_0x2d7f25})[_0xb6b4e6(0x1c3)](_0xb6b4e6(0x196)+_0x395f3b+'\x22')[_0xb6b4e6(0x18e)]();}},kbUpdate={'service':'kb','command':a32_0x3c66a8(0x1c6),'description':'根据本地文件更新个人知识库条目','risk':a32_0x3c66a8(0x1a4),'confirmationDescription':'用本地文件内容替换个人知识库条目正文,并触发新的检索同步。','flags':[{...ID_FLAG,'description':a32_0x3c66a8(0x18a)},{...TITLE_FLAG,'required':![],'description':a32_0x3c66a8(0x194)},FILE_FLAG],async 'execute'(_0x774f1c){const _0x36d2b3=a32_0x3c66a8,_0x5af081=_0x774f1c[_0x36d2b3(0x1c4)]('id'),_0x4d2962=readKnowledgeFile(_0x774f1c[_0x36d2b3(0x1af)](_0x36d2b3(0x1ae))),_0x5ce560=_0x774f1c[_0x36d2b3(0x1af)]('title')||(await getPersonalKnowledgeBaseItem(_0x5af081,_0x774f1c['appCode']))[_0x36d2b3(0x195)],_0x416480=await updatePersonalKnowledgeBaseItem(_0x5af081,_0x774f1c[_0x36d2b3(0x19e)],{'title':_0x5ce560,'content':_0x4d2962});return{'ok':!![],'data':summarizePersonalItem(_0x416480),'message':_0x36d2b3(0x197)+_0x416480['id']+'\x20('+_0x416480[_0x36d2b3(0x195)]+')'};},async 'dryRun'(_0x5c0669){const _0x4492b0=a32_0x3c66a8,_0x429d65=_0x5c0669[_0x4492b0(0x1c4)]('id'),_0x3b4655=readKnowledgeFile(_0x5c0669['str']('file')),_0x561d26=_0x5c0669[_0x4492b0(0x1af)](_0x4492b0(0x195))||(await getPersonalKnowledgeBaseItem(_0x429d65,_0x5c0669[_0x4492b0(0x19e)]))[_0x4492b0(0x195)];return dryRun('POST',_0x4492b0(0x1bc)+_0x429d65+_0x4492b0(0x1aa))[_0x4492b0(0x1a0)]({'appCode':_0x5c0669[_0x4492b0(0x19e)],'title':_0x561d26,'content':_0x3b4655})[_0x4492b0(0x1c3)](_0x4492b0(0x189)+_0x429d65)[_0x4492b0(0x18e)]();}},kbSearch={'service':'kb','command':a32_0x3c66a8(0x1a8),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':a32_0x3c66a8(0x1bf),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x369bb6){const _0x59ce3d=a32_0x3c66a8;if(!_0x369bb6['str'](_0x59ce3d(0x199))['trim']())throw CliErrors['validation'](_0x59ce3d(0x19d));readTopK(_0x369bb6);},async 'execute'(_0x15b086){const _0x17b625=a32_0x3c66a8,_0x1f43ec=_0x15b086[_0x17b625(0x1af)](_0x17b625(0x199))[_0x17b625(0x19c)](),_0x52544b=readTopK(_0x15b086),_0xec1dd2=await searchKnowledgeBase(_0x15b086['appCode'],{'query':_0x1f43ec,'topK':_0x52544b});return{'ok':!![],'data':{'total':_0xec1dd2['length'],'hits':_0xec1dd2[_0x17b625(0x19f)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
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 +1 @@
1
- const a33_0x3a8789=a33_0xabd9;function a33_0x4cec(){const _0x417a60=['4jmKKlP','logs','log','236916YlTDxh','45773ecrhMA','details','toLocaleString','30OfYhRy','6650168qnOiNh','9613917ITNafd','*\x20No\x20logs\x20found','message','\x20\x20\x20Time:\x20','14966061MhxyIr','380936QLAalz','command','duration','show','\x20logs:\x0a','View\x20command\x20history\x20logs','length','timestamp','en-US','57ktakjU','stringify','level','378nRRRdu','read','error','699140anvEYC'];a33_0x4cec=function(){return _0x417a60;};return a33_0x4cec();}(function(_0x13f121,_0x3fdb5c){const _0x3cb8a3=a33_0xabd9,_0x2e8750=_0x13f121();while(!![]){try{const _0x26eaba=-parseInt(_0x3cb8a3(0xb7))/0x1*(parseInt(_0x3cb8a3(0xc5))/0x2)+parseInt(_0x3cb8a3(0xce))/0x3*(-parseInt(_0x3cb8a3(0xba))/0x4)+-parseInt(_0x3cb8a3(0xb6))/0x5+-parseInt(_0x3cb8a3(0xb3))/0x6*(-parseInt(_0x3cb8a3(0xbb))/0x7)+-parseInt(_0x3cb8a3(0xbf))/0x8+-parseInt(_0x3cb8a3(0xc0))/0x9+parseInt(_0x3cb8a3(0xbe))/0xa*(parseInt(_0x3cb8a3(0xc4))/0xb);if(_0x26eaba===_0x3fdb5c)break;else _0x2e8750['push'](_0x2e8750['shift']());}catch(_0x411528){_0x2e8750['push'](_0x2e8750['shift']());}}}(a33_0x4cec,0x8a723));function a33_0xabd9(_0x52c325,_0x23dd57){_0x52c325=_0x52c325-0xb3;const _0x4cece4=a33_0x4cec();let _0xabd9be=_0x4cece4[_0x52c325];return _0xabd9be;}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x6610ca){const _0x124cc3=a33_0xabd9;if(_0x6610ca[_0x124cc3(0xcb)]===0x0){console[_0x124cc3(0xb9)](_0x124cc3(0xc1));return;}console[_0x124cc3(0xb9)]('*\x20'+CLI_DISPLAY_NAME+_0x124cc3(0xc9)),_0x6610ca['forEach']((_0x5d5f20,_0x3c2186)=>{const _0x323f2a=_0x124cc3,_0x97f2a5=new Date(_0x5d5f20[_0x323f2a(0xcc)])[_0x323f2a(0xbd)](_0x323f2a(0xcd)),_0x1481a0=_0x5d5f20[_0x323f2a(0xd0)]==='success'?'√':_0x5d5f20[_0x323f2a(0xd0)]===_0x323f2a(0xb5)?'×':_0x5d5f20['level']==='warn'?'!':'i';console[_0x323f2a(0xb9)](_0x3c2186+0x1+'.\x20'+_0x1481a0+'\x20['+_0x5d5f20[_0x323f2a(0xc6)]+']\x20'+_0x5d5f20[_0x323f2a(0xc2)]),console[_0x323f2a(0xb9)](_0x323f2a(0xc3)+_0x97f2a5),_0x5d5f20[_0x323f2a(0xc7)]&&console[_0x323f2a(0xb9)]('\x20\x20\x20Duration:\x20'+_0x5d5f20[_0x323f2a(0xc7)]+'ms'),_0x5d5f20[_0x323f2a(0xbc)]&&Object['keys'](_0x5d5f20[_0x323f2a(0xbc)])['length']>0x0&&console[_0x323f2a(0xb9)]('\x20\x20\x20Details:\x20'+JSON[_0x323f2a(0xcf)](_0x5d5f20[_0x323f2a(0xbc)],null,0x2)),console[_0x323f2a(0xb9)]('');});}export const logsDefinitions=[{'service':a33_0x3a8789(0xb8),'command':a33_0x3a8789(0xc8),'description':a33_0x3a8789(0xca),'risk':a33_0x3a8789(0xb4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x126706){return printLogs(logger['readLogs']()),{'ok':!![]};}}];
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 +1 @@
1
- const a34_0x22813e=a34_0x18a0;(function(_0x338dc6,_0x160cf8){const _0x513143=a34_0x18a0,_0x2d0404=_0x338dc6();while(!![]){try{const _0x1b75a6=-parseInt(_0x513143(0x195))/0x1+parseInt(_0x513143(0x1bc))/0x2*(-parseInt(_0x513143(0x1a7))/0x3)+parseInt(_0x513143(0x1c3))/0x4+-parseInt(_0x513143(0x19f))/0x5+-parseInt(_0x513143(0x199))/0x6*(parseInt(_0x513143(0x1a3))/0x7)+-parseInt(_0x513143(0x1c0))/0x8+parseInt(_0x513143(0x197))/0x9;if(_0x1b75a6===_0x160cf8)break;else _0x2d0404['push'](_0x2d0404['shift']());}catch(_0x5e0e21){_0x2d0404['push'](_0x2d0404['shift']());}}}(a34_0x1669,0xc1c54));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_0x22813e(0x1b1),'general','form',a34_0x22813e(0x1bb)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x22813e(0x198),'general':a34_0x22813e(0x1c4),'form':a34_0x22813e(0x1b5),'idCard':a34_0x22813e(0x1b3)},SCENE_FLAG={'name':a34_0x22813e(0x1c1),'type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x22813e(0x1a1)},IMAGE_FILE_FLAG={'name':a34_0x22813e(0x1b7),'type':a34_0x22813e(0x1a2),'description':a34_0x22813e(0x19c)},IMAGE_URL_FLAG={'name':a34_0x22813e(0x1c2),'type':a34_0x22813e(0x1a2),'description':a34_0x22813e(0x191)};function normalizeScene(_0x16bd39){const _0x2ac4ab=a34_0x22813e,_0x2a6461=_0x16bd39[_0x2ac4ab(0x1a8)]()[_0x2ac4ab(0x1ba)]();if(_0x2a6461===_0x2ac4ab(0x1bd))return _0x2ac4ab(0x1bb);if(_0x2a6461===_0x2ac4ab(0x1b1)||_0x2a6461==='general'||_0x2a6461===_0x2ac4ab(0x1c5))return _0x2a6461;throw CliErrors['validation'](_0x2ac4ab(0x18f)+_0x16bd39+_0x2ac4ab(0x1b8)+SUPPORTED_SCENES[_0x2ac4ab(0x1bf)](',\x20'));}function selectedInputs(_0x4696d0){const _0x54be24=a34_0x22813e,_0x33bcd1=_0x4696d0[_0x54be24(0x1be)](_0x54be24(0x1b7))[_0x54be24(0x1a8)](),_0x2d6c9d=_0x4696d0[_0x54be24(0x1be)](_0x54be24(0x1c2))['trim']();return{'imageFile':_0x33bcd1,'imageUrl':_0x2d6c9d,'count':[_0x33bcd1,_0x2d6c9d][_0x54be24(0x19a)](Boolean)[_0x54be24(0x1a0)]};}function a34_0x1669(){const _0x5af246=['validation','fileUrl','File\x20upload\x20response\x20missing\x20filePath.','description','POST','invoice','/client/queryFileUrl','IdCard','path','Table','fileName','image-file','.\x20Supported\x20scenes:\x20','Preview:\x20recognize\x20','toLowerCase','idCard','28364Bomtck','idcard','str','join','6997656kXJVzn','scene','image-url','3411344rMQPXQ','General','form','filePath','build','Unsupported\x20OCR\x20scene:\x20','imageFile','Publicly\x20accessible\x20image\x20or\x20file\x20URL','apiError','\x20OCR\x20from\x20URL','recognize','1301275XnSPCp','使用运行态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','38363094enQyWL','Invoice','12aHaBlg','filter','appCode','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','/client/uploadFile','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','4290070nDwqiP','length','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','string','1677718UkFzXO','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','imageUrl','\x20OCR','171NQVDml','trim','read','/client/ocr','body'];a34_0x1669=function(){return _0x5af246;};return a34_0x1669();}function validateInputSelection(_0x2e2f6f){const _0x2c3733=a34_0x22813e,_0x1a621e=selectedInputs(_0x2e2f6f);if(_0x1a621e['count']!==0x1)throw CliErrors[_0x2c3733(0x1ac)](_0x2c3733(0x19e));return _0x1a621e;}function a34_0x18a0(_0x551128,_0xccdaad){_0x551128=_0x551128-0x18f;const _0x166969=a34_0x1669();let _0x18a04d=_0x166969[_0x551128];return _0x18a04d;}function withScene(_0x63d2c4,_0x4c9ba4,_0x101d41){const _0x32f9ab=a34_0x22813e;return{..._0x63d2c4,'scene':_0x4c9ba4,..._0x101d41?{'sourceFile':{'fileName':_0x101d41[_0x32f9ab(0x1b6)],'filePath':_0x101d41[_0x32f9ab(0x1c6)]}}:{}};}const ocrRecognize={'service':'ocr','command':a34_0x22813e(0x194),'description':a34_0x22813e(0x196),'risk':a34_0x22813e(0x1a9),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x4dc937){const _0x2c8933=a34_0x22813e,_0x31b20f=normalizeScene(_0x4dc937[_0x2c8933(0x1be)](_0x2c8933(0x1c1))),_0xa4399d=SCENE_TO_LEGACY_TYPE[_0x31b20f],_0x1ef8bf=validateInputSelection(_0x4dc937);if(_0x1ef8bf[_0x2c8933(0x1a5)])return dryRun(_0x2c8933(0x1b0),_0x2c8933(0x1aa))[_0x2c8933(0x1ab)]({'appCode':_0x4dc937['appCode'],'url':_0x1ef8bf[_0x2c8933(0x1a5)],'type':_0xa4399d})['description'](_0x2c8933(0x1b9)+_0x31b20f+_0x2c8933(0x193))['build']();const _0x1b2f3e=requireRuntimeUploadFile(_0x1ef8bf['imageFile'],'image-file');return dryRun(_0x2c8933(0x1b0),_0x2c8933(0x19d))[_0x2c8933(0x1ab)]({'steps':[{'method':_0x2c8933(0x1b0),'url':'/client/uploadFile','body':{'appCode':_0x4dc937[_0x2c8933(0x19b)],'multipart':{'file':_0x1b2f3e}}},{'method':'POST','url':_0x2c8933(0x1b2),'body':{'filePath':'<filePath\x20returned\x20by\x20/client/uploadFile>','downloadFlag':![]}},{'method':_0x2c8933(0x1b0),'url':_0x2c8933(0x1aa),'body':{'appCode':_0x4dc937[_0x2c8933(0x19b)],'url':'<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','type':_0xa4399d}}]})[_0x2c8933(0x1af)](_0x2c8933(0x1a4)+_0x31b20f+_0x2c8933(0x1a6))[_0x2c8933(0x1c7)]();},async 'execute'(_0x5c6bc0){const _0x4d351c=a34_0x22813e,_0x5d0e3e=normalizeScene(_0x5c6bc0[_0x4d351c(0x1be)](_0x4d351c(0x1c1))),_0x56d921=SCENE_TO_LEGACY_TYPE[_0x5d0e3e],_0x509187=validateInputSelection(_0x5c6bc0);if(_0x509187[_0x4d351c(0x1a5)]){const _0x841361=await recognizeRuntimeOcr(_0x5c6bc0['appCode'],{'url':_0x509187[_0x4d351c(0x1a5)],'type':_0x56d921});return{'ok':!![],'data':withScene(_0x841361,_0x5d0e3e)};}const _0x2c837c=requireRuntimeUploadFile(_0x509187[_0x4d351c(0x190)],_0x4d351c(0x1b7)),_0x4f1a26=await uploadRuntimeFile(_0x5c6bc0['appCode'],_0x2c837c[_0x4d351c(0x1b4)]);if(!_0x4f1a26['filePath'])throw CliErrors[_0x4d351c(0x192)](_0x4d351c(0x1ae));const _0x433594=await queryRuntimeFileUrl(_0x4f1a26[_0x4d351c(0x1c6)],{'download':![]});if(!_0x433594[_0x4d351c(0x1ad)])throw CliErrors[_0x4d351c(0x192)]('File\x20URL\x20response\x20missing\x20fileUrl.');const _0x25492c=await recognizeRuntimeOcr(_0x5c6bc0[_0x4d351c(0x19b)],{'url':_0x433594[_0x4d351c(0x1ad)],'type':_0x56d921});return{'ok':!![],'data':withScene(_0x25492c,_0x5d0e3e,_0x4f1a26)};}};export const ocrDefinitions=[ocrRecognize];
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 +1 @@
1
- const a35_0x4cc9ca=a35_0x1672;(function(_0x5e9e00,_0x5e4cc9){const _0x49c1dd=a35_0x1672,_0x406e8f=_0x5e9e00();while(!![]){try{const _0x172819=parseInt(_0x49c1dd(0x1ad))/0x1+-parseInt(_0x49c1dd(0x1a8))/0x2*(-parseInt(_0x49c1dd(0x1e2))/0x3)+-parseInt(_0x49c1dd(0x1ec))/0x4*(-parseInt(_0x49c1dd(0x1e5))/0x5)+parseInt(_0x49c1dd(0x1e0))/0x6*(parseInt(_0x49c1dd(0x1d8))/0x7)+parseInt(_0x49c1dd(0x1d7))/0x8+-parseInt(_0x49c1dd(0x1ac))/0x9*(-parseInt(_0x49c1dd(0x1ea))/0xa)+parseInt(_0x49c1dd(0x1de))/0xb*(-parseInt(_0x49c1dd(0x1be))/0xc);if(_0x172819===_0x5e4cc9)break;else _0x406e8f['push'](_0x406e8f['shift']());}catch(_0x37700a){_0x406e8f['push'](_0x406e8f['shift']());}}}(a35_0x287d,0xe4b71));import{existsSync,readFileSync,statSync}from'node:fs';function a35_0x287d(){const _0xfd2050=['6642488CqEmti','5968774xKZQgj','POST','length','verbose','bool','Personal\x20BFF\x20script\x20ID','44733777rgiFAQ','keys','6EYqvMa','根据\x20ID\x20更新个人\x20BFF','3FmOhpI','Executed\x20personal\x20BFF\x20','validation','34285TbDORS','flag','createUserId','name','File\x20path\x20is\x20required.','1129450NmfAKU','根据本地脚本文件创建个人\x20BFF','1052YmHhVI','/update','根据\x20ID\x20执行个人\x20BFF,并可传入\x20JSON\x20参数','create','796636PwVzVb','Updated\x20personal\x20BFF\x20','scriptType','params','18KNAcqK','892932aTpCKs','gmtModified','file','更新个人\x20BFF\x20的脚本或元信息;之后的调用将使用新版本。','write','description','personal-bff','appCode','sourceSessionId','scriptContent','Preview:\x20create\x20personal\x20BFF\x20','str','num','File\x20is\x20not\x20a\x20regular\x20file:\x20','string','把本地脚本保存为个人\x20BFF;之后可在当前应用中调用该脚本。','updateTime','12mbYGVh','--params\x20must\x20be\x20a\x20JSON\x20object.','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','read','config','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','/client/runtime-bff/personal/create','functionName','Preview:\x20update\x20personal\x20BFF\x20','trim','source-session-id','Personal\x20BFF\x20description','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','Personal\x20BFF\x20script\x20file\x20is\x20blank.','body','Optional\x20source\x20RuntimeAgent\x20session\x20id','utf8','update','map','Show\x20one\x20personal\x20BFF\x20by\x20id','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','version','isArray','detail'];a35_0x287d=function(){return _0xfd2050;};return a35_0x287d();}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_0x4cc9ca(0x1bb),'description':a35_0x4cc9ca(0x1cb)},FUNCTION_NAME_FLAG={'name':'name','type':a35_0x4cc9ca(0x1bb),'required':!![],'description':a35_0x4cc9ca(0x1c4)},DESCRIPTION_FLAG={'name':a35_0x4cc9ca(0x1b2),'type':a35_0x4cc9ca(0x1bb),'description':a35_0x4cc9ca(0x1ca)},SOURCE_SESSION_FLAG={'name':a35_0x4cc9ca(0x1c9),'type':a35_0x4cc9ca(0x1bb),'description':a35_0x4cc9ca(0x1ce)};function normalizeFunctionName(_0x47b8b6){const _0x3eb80a=a35_0x4cc9ca,_0x50dcad=String(_0x47b8b6||'')['trim']();if(!_0x50dcad||!FUNCTION_NAME_PATTERN['test'](_0x50dcad))throw CliErrors[_0x3eb80a(0x1e4)]('--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.');return _0x50dcad;}function readScriptFile(_0x2fb992){const _0x5020b2=a35_0x4cc9ca;if(!_0x2fb992)throw CliErrors[_0x5020b2(0x1e4)](_0x5020b2(0x1e9));if(!existsSync(_0x2fb992))throw CliErrors[_0x5020b2(0x1e4)]('File\x20not\x20found:\x20'+_0x2fb992);if(!statSync(_0x2fb992)['isFile']())throw CliErrors[_0x5020b2(0x1e4)](_0x5020b2(0x1ba)+_0x2fb992);const _0x2b9888=readFileSync(_0x2fb992,_0x5020b2(0x1cf));if(!_0x2b9888[_0x5020b2(0x1c8)]())throw CliErrors[_0x5020b2(0x1e4)](_0x5020b2(0x1cc));return _0x2b9888;}function optionalTrimmed(_0x41f5ca){const _0x2a5e94=String(_0x41f5ca||'')['trim']();return _0x2a5e94||undefined;}function summarizeBff(_0x304407){const _0x5b452a=a35_0x4cc9ca;return{'id':_0x304407['id'],'appCode':_0x304407[_0x5b452a(0x1b4)],'functionName':_0x304407[_0x5b452a(0x1c6)],'description':_0x304407[_0x5b452a(0x1b2)],'scriptType':_0x304407[_0x5b452a(0x1aa)],'version':_0x304407[_0x5b452a(0x1d4)],'gmtModified':_0x304407['gmtModified'],'updateTime':_0x304407[_0x5b452a(0x1bd)]};}function detailBff(_0x20692e){const _0x5c09ca=a35_0x4cc9ca;return{'id':_0x20692e['id'],'appCode':_0x20692e[_0x5c09ca(0x1b4)],'functionName':_0x20692e[_0x5c09ca(0x1c6)],'description':_0x20692e['description'],'scriptType':_0x20692e[_0x5c09ca(0x1aa)],'scriptContent':_0x20692e[_0x5c09ca(0x1b6)]??'','config':_0x20692e[_0x5c09ca(0x1c2)],'version':_0x20692e[_0x5c09ca(0x1d4)],'createUserId':_0x20692e[_0x5c09ca(0x1e7)],'gmtCreate':_0x20692e['gmtCreate'],'gmtModified':_0x20692e[_0x5c09ca(0x1ae)],'createTime':_0x20692e['createTime'],'updateTime':_0x20692e[_0x5c09ca(0x1bd)]};}function buildCreateInput(_0x3afd8e){const _0x553463=a35_0x4cc9ca;return{'functionName':normalizeFunctionName(_0x3afd8e['str'](_0x553463(0x1e8))),...optionalTrimmed(_0x3afd8e[_0x553463(0x1b8)](_0x553463(0x1b2)))?{'description':optionalTrimmed(_0x3afd8e[_0x553463(0x1b8)](_0x553463(0x1b2)))}:{},'scriptContent':readScriptFile(_0x3afd8e['str'](_0x553463(0x1af))),...optionalTrimmed(_0x3afd8e['str'](_0x553463(0x1c9)))?{'sourceSessionId':optionalTrimmed(_0x3afd8e[_0x553463(0x1b8)](_0x553463(0x1c9)))}:{}};}function a35_0x1672(_0x364906,_0x541b4c){_0x364906=_0x364906-0x1a6;const _0x287dec=a35_0x287d();let _0x167274=_0x287dec[_0x364906];return _0x167274;}function buildUpdateInput(_0x4ebc93){const _0x3a708b=a35_0x4cc9ca,_0x1ad641={};optionalTrimmed(_0x4ebc93[_0x3a708b(0x1b8)](_0x3a708b(0x1e8)))&&(_0x1ad641[_0x3a708b(0x1c6)]=normalizeFunctionName(_0x4ebc93[_0x3a708b(0x1b8)](_0x3a708b(0x1e8))));_0x4ebc93[_0x3a708b(0x1e6)](_0x3a708b(0x1b2))!==undefined&&(_0x1ad641[_0x3a708b(0x1b2)]=_0x4ebc93['str'](_0x3a708b(0x1b2)));optionalTrimmed(_0x4ebc93[_0x3a708b(0x1b8)](_0x3a708b(0x1af)))&&(_0x1ad641[_0x3a708b(0x1b6)]=readScriptFile(_0x4ebc93[_0x3a708b(0x1b8)](_0x3a708b(0x1af))));_0x4ebc93['flag'](_0x3a708b(0x1c9))!==undefined&&(_0x1ad641[_0x3a708b(0x1b5)]=_0x4ebc93[_0x3a708b(0x1b8)](_0x3a708b(0x1c9)));if(Object[_0x3a708b(0x1df)](_0x1ad641)['length']===0x0)throw CliErrors[_0x3a708b(0x1e4)](_0x3a708b(0x1c0));return _0x1ad641;}function parseExecParams(_0x3f717b){const _0x22ce5e=a35_0x4cc9ca,_0x35dbb9=parseJsonParams(_0x3f717b)??{};if(Array[_0x22ce5e(0x1d5)](_0x35dbb9))throw CliErrors[_0x22ce5e(0x1e4)](_0x22ce5e(0x1bf));return _0x35dbb9;}const personalBffList={'service':a35_0x4cc9ca(0x1b3),'command':'list','description':a35_0x4cc9ca(0x1c3),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x190ae7){const _0x18af9a=a35_0x4cc9ca,_0x16d7bf=await listPersonalBffs(_0x190ae7['appCode']);return{'ok':!![],'data':{'total':_0x16d7bf[_0x18af9a(0x1da)],'items':_0x190ae7[_0x18af9a(0x1dc)](_0x18af9a(0x1db))?_0x16d7bf:_0x16d7bf[_0x18af9a(0x1d1)](summarizeBff)}};}},personalBffDetail={'service':a35_0x4cc9ca(0x1b3),'command':a35_0x4cc9ca(0x1d6),'description':a35_0x4cc9ca(0x1d2),'risk':a35_0x4cc9ca(0x1c1),'flags':[{...ID_FLAG,'description':a35_0x4cc9ca(0x1dd)}],async 'execute'(_0x3c27bc){const _0x3b08d9=a35_0x4cc9ca,_0x46fe3c=await getPersonalBff(_0x3c27bc[_0x3b08d9(0x1b9)]('id'),_0x3c27bc['appCode']);return{'ok':!![],'data':detailBff(_0x46fe3c)};}},personalBffCreate={'service':a35_0x4cc9ca(0x1b3),'command':a35_0x4cc9ca(0x1a7),'description':a35_0x4cc9ca(0x1eb),'risk':a35_0x4cc9ca(0x1b1),'confirmationDescription':a35_0x4cc9ca(0x1bc),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x5ba807){const _0x32d329=buildCreateInput(_0x5ba807),_0x3fb41e=await createPersonalBff(_0x5ba807['appCode'],_0x32d329);return{'ok':!![],'data':detailBff(_0x3fb41e),'message':'Created\x20personal\x20BFF\x20'+_0x3fb41e['id']+(_0x3fb41e['functionName']?'\x20('+_0x3fb41e['functionName']+')':'')};},async 'dryRun'(_0x25049e){const _0x28685c=a35_0x4cc9ca,_0xdf60b2=buildCreateInput(_0x25049e);return dryRun(_0x28685c(0x1d9),_0x28685c(0x1c5))[_0x28685c(0x1cd)]({'appCode':_0x25049e['appCode'],..._0xdf60b2})[_0x28685c(0x1b2)](_0x28685c(0x1b7)+_0xdf60b2[_0x28685c(0x1c6)])['build']();}},personalBffUpdate={'service':a35_0x4cc9ca(0x1b3),'command':a35_0x4cc9ca(0x1d0),'description':a35_0x4cc9ca(0x1e1),'risk':a35_0x4cc9ca(0x1b1),'confirmationDescription':a35_0x4cc9ca(0x1b0),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3acbc9){const _0x2606ba=a35_0x4cc9ca,_0x138128=_0x3acbc9[_0x2606ba(0x1b9)]('id'),_0x5ac3b1=buildUpdateInput(_0x3acbc9),_0x2ffbce=await updatePersonalBff(_0x138128,_0x3acbc9[_0x2606ba(0x1b4)],_0x5ac3b1);return{'ok':!![],'data':detailBff(_0x2ffbce),'message':_0x2606ba(0x1a9)+_0x2ffbce['id']+(_0x2ffbce[_0x2606ba(0x1c6)]?'\x20('+_0x2ffbce[_0x2606ba(0x1c6)]+')':'')};},async 'dryRun'(_0x10630e){const _0x5f3fbb=a35_0x4cc9ca,_0x39dc58=_0x10630e[_0x5f3fbb(0x1b9)]('id'),_0x449952=buildUpdateInput(_0x10630e);return dryRun(_0x5f3fbb(0x1d9),'/client/runtime-bff/personal/'+_0x39dc58+_0x5f3fbb(0x1ed))[_0x5f3fbb(0x1cd)]({'appCode':_0x10630e[_0x5f3fbb(0x1b4)],..._0x449952})[_0x5f3fbb(0x1b2)](_0x5f3fbb(0x1c7)+_0x39dc58)['build']();}},personalBffExec={'service':'personal-bff','command':'exec','description':a35_0x4cc9ca(0x1a6),'risk':'write','confirmationDescription':'执行个人\x20BFF\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','flags':[{...ID_FLAG,'description':a35_0x4cc9ca(0x1dd)},{...PARAMS_FLAG,'description':a35_0x4cc9ca(0x1d3)}],async 'validate'(_0x5b35d4){const _0x1e0be7=a35_0x4cc9ca;parseExecParams(_0x5b35d4[_0x1e0be7(0x1b8)](_0x1e0be7(0x1ab)));},async 'execute'(_0x3d16cc){const _0xabf857=a35_0x4cc9ca,_0x2dd3a0=_0x3d16cc[_0xabf857(0x1b9)]('id'),_0x460805=parseExecParams(_0x3d16cc['str']('params')),_0x1be42d=await executePersonalBff(_0x2dd3a0,_0x3d16cc[_0xabf857(0x1b4)],_0x460805);return{'ok':!![],'data':{'result':_0x1be42d},'message':_0xabf857(0x1e3)+_0x2dd3a0};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
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 +1 @@
1
- const a36_0x360783=a36_0x5508;(function(_0x577aae,_0x311ae0){const _0x29eff8=a36_0x5508,_0x24808c=_0x577aae();while(!![]){try{const _0x23bc19=-parseInt(_0x29eff8(0x112))/0x1+-parseInt(_0x29eff8(0x115))/0x2+parseInt(_0x29eff8(0xf7))/0x3*(parseInt(_0x29eff8(0xe4))/0x4)+parseInt(_0x29eff8(0x113))/0x5+parseInt(_0x29eff8(0x116))/0x6*(-parseInt(_0x29eff8(0x101))/0x7)+-parseInt(_0x29eff8(0x10d))/0x8*(parseInt(_0x29eff8(0xff))/0x9)+parseInt(_0x29eff8(0x111))/0xa;if(_0x23bc19===_0x311ae0)break;else _0x24808c['push'](_0x24808c['shift']());}catch(_0x2ee54a){_0x24808c['push'](_0x24808c['shift']());}}}(a36_0x2da1,0x9c716));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';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';function a36_0x2da1(){const _0x41fe0b=['logs\x20clear','Use\x20`lovrabet\x20workspace\x20init\x20--appcode\x20<code>`\x20instead.','BFF\x20Scripts','Knowledge\x20Base','2325112zHZQMT','install','Agent\x20Schedules','list','10468810VAwTZQ','18815Borjga','2204265GVVWsp','Runtime\x20App\x20Config','805054bfSJfS','534018GOeGTq','push','defaultCommand','`lovrabet\x20app\x20use`\x20has\x20been\x20removed.','\x20\x20[write]','get','logs','3732292LVeemN','Service\x20Tree','`lovrabet\x20logs\x20clear`\x20has\x20been\x20removed.','command','from','init','set','has','risk','App\x20Management','app\x20init','Authentication','API\x20Documentation','app','`lovrabet\x20app\x20init`\x20has\x20been\x20removed.','Use\x20`lovrabet\x20workspace\x20use\x20--app\x20<name>`\x20instead.','Self\x20Update','map','CLI\x20Built-in\x20Skill','3jKMbJY','run','service','Configuration','Instant\x20API','write','\x20\x20[high-risk-write]','isSingleCommand','9CoitKE','Diagnostics','84lbqINC','Personal\x20BFF','SQL\x20Queries','values','Skills','clear','app\x20use','use'];a36_0x2da1=function(){return _0x41fe0b;};return a36_0x2da1();}import{ocrDefinitions}from'../commands/ocr/index.js';import{scheduleDefinitions}from'../commands/schedule/index.js';function a36_0x5508(_0x4d7a04,_0x532a6f){_0x4d7a04=_0x4d7a04-0xe0;const _0x2da1f4=a36_0x2da1();let _0x5508b5=_0x2da1f4[_0x4d7a04];return _0x5508b5;}export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x106cf6){const _0x56b2b8=a36_0x5508;for(const _0xadd6c1 of _0x106cf6){definitions['set'](_0xadd6c1[_0x56b2b8(0xf9)]+':'+_0xadd6c1['command'],_0xadd6c1);let _0x24e785=serviceGroups[_0x56b2b8(0xe2)](_0xadd6c1[_0x56b2b8(0xf9)]);!_0x24e785&&(_0x24e785=[],serviceGroups[_0x56b2b8(0xea)](_0xadd6c1['service'],_0x24e785)),_0x24e785[_0x56b2b8(0x117)](_0xadd6c1);}}function registerService(_0x43cf6f,_0x44f35b,_0x54faa8){const _0x5c61d5=a36_0x5508;registerDefinitions(_0x44f35b);const _0xba822d=_0x1368b6=>_0x1368b6==='read'?'':_0x1368b6===_0x5c61d5(0xfc)?_0x5c61d5(0xe1):_0x5c61d5(0xfd),_0x48a4ad={'service':_0x44f35b[0x0][_0x5c61d5(0xf9)],'label':_0x43cf6f,'commands':_0x44f35b[_0x5c61d5(0xf5)](_0x4c8c17=>({'command':_0x4c8c17[_0x5c61d5(0xe7)],'description':_0x4c8c17['description'],'tag':_0xba822d(_0x4c8c17[_0x5c61d5(0xec)])})),'defaultCommand':_0x54faa8?.[_0x5c61d5(0x118)]??(_0x54faa8?.[_0x5c61d5(0xfe)]?_0x44f35b[0x0][_0x5c61d5(0xe7)]:undefined),'isSingleCommand':_0x54faa8?.['isSingleCommand']};serviceRegistry['push'](_0x48a4ad),serviceByName[_0x5c61d5(0xea)](_0x48a4ad[_0x5c61d5(0xf9)],_0x48a4ad);}registerService(a36_0x360783(0xef),authDefinitions,{'defaultCommand':'login'}),registerService(a36_0x360783(0xed),appDefinitions,{'defaultCommand':a36_0x360783(0x110)}),registerService('Workspace',workspaceDefinitions),registerService(a36_0x360783(0x114),appConfigDefinitions),registerService(a36_0x360783(0xfa),configDefinitions,{'defaultCommand':'list'}),registerService(a36_0x360783(0xf0),apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a36_0x360783(0xfb),dataDefinitions),registerService(a36_0x360783(0x103),sqlDefinitions),registerService(a36_0x360783(0x10b),bffDefinitions),registerService(a36_0x360783(0x102),personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService('File',fileDefinitions),registerService('OCR',ocrDefinitions),registerService(a36_0x360783(0x10c),kbDefinitions),registerService(a36_0x360783(0x10f),scheduleDefinitions,{'defaultCommand':a36_0x360783(0x110)}),registerService(a36_0x360783(0xe5),serviceDefinitions,{'defaultCommand':a36_0x360783(0x110)}),registerService(a36_0x360783(0x105),skillDefinitions,{'defaultCommand':a36_0x360783(0x10e)}),registerService(a36_0x360783(0xf6),cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x360783(0xf4),[updateDefinition],{'defaultCommand':a36_0x360783(0xf8),'isSingleCommand':!![]}),registerService(a36_0x360783(0x100),[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':'show'});export function findDefinition(_0x4d9141,_0x2873da){const _0x550c7f=a36_0x360783;return definitions[_0x550c7f(0xe2)](_0x4d9141+':'+_0x2873da);}export function resolveRemovedCommand(_0x1f7580,_0x497577){const _0x54dfbc=a36_0x360783;if(_0x1f7580===_0x54dfbc(0xf1)&&_0x497577===_0x54dfbc(0xe9))return{'command':_0x54dfbc(0xee),'message':_0x54dfbc(0xf2),'hint':_0x54dfbc(0x10a)};if(_0x1f7580===_0x54dfbc(0xf1)&&_0x497577===_0x54dfbc(0x108))return{'command':_0x54dfbc(0x107),'message':_0x54dfbc(0xe0),'hint':_0x54dfbc(0xf3)};if(_0x1f7580===_0x54dfbc(0xe3)&&_0x497577===_0x54dfbc(0x106))return{'command':_0x54dfbc(0x109),'message':_0x54dfbc(0xe6),'hint':'Use\x20`lovrabet\x20logs\x20show`\x20to\x20view\x20command\x20history.'};return undefined;}export function isKnownService(_0x36e280){const _0x1d3050=a36_0x360783;return serviceByName[_0x1d3050(0xeb)](_0x36e280);}export function getServiceEntry(_0x2204eb){return serviceByName['get'](_0x2204eb);}export function getAllDefinitions(){const _0x4f5afb=a36_0x360783;return Array[_0x4f5afb(0xe8)](definitions[_0x4f5afb(0x104)]());}
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 +1 @@
1
- const a37_0x541186=a37_0x1573;function a37_0x1573(_0x45f2c0,_0x4a4556){_0x45f2c0=_0x45f2c0-0x1b2;const _0x47e9e0=a37_0x47e9();let _0x157362=_0x47e9e0[_0x45f2c0];return _0x157362;}(function(_0x34b33d,_0x4da3b9){const _0x23357f=a37_0x1573,_0x5cf614=_0x34b33d();while(!![]){try{const _0x227bcc=parseInt(_0x23357f(0x1c5))/0x1+-parseInt(_0x23357f(0x1f8))/0x2+-parseInt(_0x23357f(0x1ee))/0x3+parseInt(_0x23357f(0x1bd))/0x4*(parseInt(_0x23357f(0x1e8))/0x5)+parseInt(_0x23357f(0x1f0))/0x6+-parseInt(_0x23357f(0x1cd))/0x7*(parseInt(_0x23357f(0x1f9))/0x8)+-parseInt(_0x23357f(0x1fc))/0x9;if(_0x227bcc===_0x4da3b9)break;else _0x5cf614['push'](_0x5cf614['shift']());}catch(_0x484fd7){_0x5cf614['push'](_0x5cf614['shift']());}}}(a37_0x47e9,0xb2299));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_0x541186(0x1e7),'type':a37_0x541186(0x1e0),'required':!![],'enum':[a37_0x541186(0x1db),'ONCE'],'description':a37_0x541186(0x1fd)},CRON_FLAG={'name':'cron','type':a37_0x541186(0x1e0),'description':a37_0x541186(0x1d2)},SCHEDULED_AT_FLAG={'name':a37_0x541186(0x1c0),'type':a37_0x541186(0x1e0),'description':a37_0x541186(0x1b3)},TITLE_FLAG={'name':a37_0x541186(0x1e4),'type':a37_0x541186(0x1e0),'required':!![],'description':a37_0x541186(0x1bf)},PROMPT_FLAG={'name':a37_0x541186(0x1b7),'type':a37_0x541186(0x1e0),'required':!![],'description':'Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs'},CHANNEL_FLAG={'name':'channel','type':a37_0x541186(0x1e0),'enum':[a37_0x541186(0x1d1),'premium'],'default':'premium','description':a37_0x541186(0x1b2)},SCHEDULE_ID_FLAG={'name':a37_0x541186(0x1f5),'type':'string','required':!![],'description':a37_0x541186(0x1bc),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a37_0x541186(0x1b6)}},LIMIT_FLAG={'name':a37_0x541186(0x1d5),'type':a37_0x541186(0x1e2),'default':0x14,'description':a37_0x541186(0x1f6)},CURSOR_FLAG={'name':a37_0x541186(0x1d4),'type':a37_0x541186(0x1e0),'description':a37_0x541186(0x1c9)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0xf2422){const _0x1e797e=a37_0x541186,_0xff9e2f=_0xf2422[_0x1e797e(0x1d8)](_0x1e797e(0x1e7)),_0x466992=_0xf2422[_0x1e797e(0x1d8)](_0x1e797e(0x1e4))[_0x1e797e(0x1cb)](),_0x58241b=_0xf2422[_0x1e797e(0x1d8)]('prompt')[_0x1e797e(0x1cb)](),_0x269b02=_0xf2422['str'](_0x1e797e(0x1e1)),_0x20cce5=_0xf2422[_0x1e797e(0x1d8)](_0x1e797e(0x1d9)),_0xd3b582=_0xf2422['str'](_0x1e797e(0x1c0));if(!_0x466992)throw CliErrors[_0x1e797e(0x1d0)](_0x1e797e(0x1c4));if(!_0x58241b)throw CliErrors['validation']('--prompt\x20must\x20not\x20be\x20blank.');if(_0xff9e2f===_0x1e797e(0x1db)){if(!_0x20cce5||_0xd3b582)throw CliErrors['validation'](_0x1e797e(0x1eb));return{'kind':_0xff9e2f,'timezone':'UTC','cron':_0x20cce5,'title':_0x466992,'prompt':_0x58241b,'channel':_0x269b02};}if(_0xff9e2f===_0x1e797e(0x1cf)){if(!_0xd3b582||_0x20cce5)throw CliErrors[_0x1e797e(0x1d0)](_0x1e797e(0x1ef));return{'kind':_0xff9e2f,'timezone':'UTC','scheduledAt':_0xd3b582,'title':_0x466992,'prompt':_0x58241b,'channel':_0x269b02};}throw CliErrors[_0x1e797e(0x1d0)](_0x1e797e(0x1fa));}function a37_0x47e9(){const _0x391660=['Preview:\x20delete\x20schedule\x20','18597501CGmmqb','Schedule\x20kind:\x20CRON\x20or\x20ONCE','Task\x20channel:\x20auto\x20or\x20premium','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','schedule','创建周期性或单次执行的\x20Agent\x20定时任务','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','prompt','detail','description','num','立即运行一次定时任务并创建\x20Task','Schedule\x20UUID','101524IOQvbx','Deleted\x20schedule\x20','Schedule\x20title','scheduled-at','DELETE','read','/schedules','--title\x20must\x20not\x20be\x20blank.','1300407wtlOWC','Preview:\x20run\x20schedule\x20','length','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','high-risk-write','trim','isSafeInteger','7PnwdZW','删除定时任务并停止其后续触发','ONCE','validation','auto','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','cursor','limit','POST','\x20immediately','str','cron','Schedule\x20input\x20is\x20valid','CRON','\x20from\x20schedule\x20','Created\x20','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','string','channel','number','/run','title','list','validate','kind','285SqtMQZ','Preview:\x20create\x20an\x20Agent\x20schedule','scheduleId','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','Queued\x20Task\x20','build','1511034TsFksc','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','5431200IKixnP','将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','run','appCode','schedule-id','Page\x20size\x20from\x201\x20to\x20100','/api/harness/apps/','334210WTDeal','1483192YpeDnn','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.'];a37_0x47e9=function(){return _0x391660;};return a37_0x47e9();}function scheduleCollectionPath(_0x1d3c24){const _0x177305=a37_0x541186;return _0x177305(0x1f7)+encodeURIComponent(_0x1d3c24)+_0x177305(0x1c3);}function scheduleItemPath(_0x4b7602,_0x3757f2){return scheduleCollectionPath(_0x4b7602)+'/'+encodeURIComponent(_0x3757f2);}const scheduleValidate={'service':'schedule','command':a37_0x541186(0x1e6),'description':a37_0x541186(0x1df),'risk':a37_0x541186(0x1c2),'flags':INPUT_FLAGS,async 'validate'(_0x3885b7){readScheduleInput(_0x3885b7);},async 'execute'(_0x107a60){const _0x2c5ca8=a37_0x541186,_0x3d125e=readScheduleInput(_0x107a60),_0x2bcf7d=await validateRuntimeSchedule(_0x107a60[_0x2c5ca8(0x1f4)],_0x3d125e);return{'ok':!![],'data':_0x2bcf7d,'message':_0x2c5ca8(0x1da)};}},scheduleCreate={'service':a37_0x541186(0x1b4),'command':'create','description':a37_0x541186(0x1b5),'risk':a37_0x541186(0x1ca),'confirmationDescription':a37_0x541186(0x1f1),'flags':INPUT_FLAGS,async 'validate'(_0x30af22){readScheduleInput(_0x30af22);},async 'execute'(_0x3873fc){const _0x2e62c2=a37_0x541186,_0x462273=readScheduleInput(_0x3873fc),_0x3d1239=await validateRuntimeSchedule(_0x3873fc[_0x2e62c2(0x1f4)],_0x462273),_0x522fd5=await createRuntimeSchedule(_0x3873fc[_0x2e62c2(0x1f4)],_0x3d1239);return{'ok':!![],'data':_0x522fd5,'message':_0x2e62c2(0x1dd)+_0x522fd5['kind']+'\x20schedule\x20'+_0x522fd5[_0x2e62c2(0x1ea)]};},async 'dryRun'(_0x2947ea){const _0x524008=a37_0x541186,_0x5078b8=readScheduleInput(_0x2947ea);return dryRun(_0x524008(0x1d6),scheduleCollectionPath(_0x2947ea[_0x524008(0x1f4)]))['body'](_0x5078b8)[_0x524008(0x1b9)](_0x524008(0x1e9))[_0x524008(0x1ed)]();}},scheduleList={'service':a37_0x541186(0x1b4),'command':a37_0x541186(0x1e5),'description':a37_0x541186(0x1c8),'risk':a37_0x541186(0x1c2),'flags':[LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x9175c5){const _0xfc3f1c=a37_0x541186,_0x36346d=_0x9175c5[_0xfc3f1c(0x1ba)](_0xfc3f1c(0x1d5));if(!Number[_0xfc3f1c(0x1cc)](_0x36346d)||_0x36346d<0x1||_0x36346d>0x64)throw CliErrors['validation'](_0xfc3f1c(0x1de));const _0x5c9a28=_0x9175c5[_0xfc3f1c(0x1d8)](_0xfc3f1c(0x1d4));if(_0x5c9a28&&(_0x5c9a28[_0xfc3f1c(0x1c7)]>0x400||_0x5c9a28[_0xfc3f1c(0x1cb)]()!==_0x5c9a28))throw CliErrors['validation'](_0xfc3f1c(0x1d3));},async 'execute'(_0x2443d5){const _0x5080fd=a37_0x541186,_0x4f724b=_0x2443d5[_0x5080fd(0x1d8)](_0x5080fd(0x1d4)),_0xeac34c=await listRuntimeSchedules(_0x2443d5[_0x5080fd(0x1f4)],{'limit':_0x2443d5['num'](_0x5080fd(0x1d5)),..._0x4f724b?{'cursor':_0x4f724b}:{}});return{'ok':!![],'data':_0xeac34c};}},scheduleDetail={'service':'schedule','command':a37_0x541186(0x1b8),'description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':a37_0x541186(0x1c2),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x205e29){const _0x189480=a37_0x541186,_0x33f513=await getRuntimeSchedule(_0x205e29[_0x189480(0x1f4)],_0x205e29[_0x189480(0x1d8)](_0x189480(0x1f5)));return{'ok':!![],'data':_0x33f513};}},scheduleRun={'service':'schedule','command':a37_0x541186(0x1f3),'description':a37_0x541186(0x1bb),'risk':'high-risk-write','confirmationDescription':'将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x12b41f){const _0x579a07=a37_0x541186,_0x4fbe49=_0x12b41f['str'](_0x579a07(0x1f5)),_0x336696=await runRuntimeSchedule(_0x12b41f[_0x579a07(0x1f4)],_0x4fbe49);return{'ok':!![],'data':_0x336696,'message':_0x579a07(0x1ec)+_0x336696['taskId']+_0x579a07(0x1dc)+_0x4fbe49};},async 'dryRun'(_0x2a216c){const _0x33a47c=a37_0x541186,_0x2e1061=_0x2a216c['str'](_0x33a47c(0x1f5));return dryRun(_0x33a47c(0x1d6),scheduleItemPath(_0x2a216c[_0x33a47c(0x1f4)],_0x2e1061)+_0x33a47c(0x1e3))[_0x33a47c(0x1b9)](_0x33a47c(0x1c6)+_0x2e1061+_0x33a47c(0x1d7))['build']();}},scheduleDelete={'service':a37_0x541186(0x1b4),'command':'delete','description':a37_0x541186(0x1ce),'risk':a37_0x541186(0x1ca),'confirmationDescription':a37_0x541186(0x1f2),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x986871){const _0x53c588=a37_0x541186,_0x5bbd52=_0x986871['str'](_0x53c588(0x1f5)),_0x4e718f=await deleteRuntimeSchedule(_0x986871[_0x53c588(0x1f4)],_0x5bbd52);return{'ok':!![],'data':_0x4e718f,'message':_0x53c588(0x1be)+_0x5bbd52};},async 'dryRun'(_0x42add1){const _0x3f98e7=a37_0x541186,_0x42d6e4=_0x42add1[_0x3f98e7(0x1d8)](_0x3f98e7(0x1f5));return dryRun(_0x3f98e7(0x1c1),scheduleItemPath(_0x42add1[_0x3f98e7(0x1f4)],_0x42d6e4))[_0x3f98e7(0x1b9)](_0x3f98e7(0x1fb)+_0x42d6e4)[_0x3f98e7(0x1ed)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
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 +1 @@
1
- const a38_0x2c4840=a38_0x30a8;(function(_0x677905,_0x34c9f4){const _0x2da613=a38_0x30a8,_0x4f821d=_0x677905();while(!![]){try{const _0x457103=-parseInt(_0x2da613(0x108))/0x1*(parseInt(_0x2da613(0x10c))/0x2)+parseInt(_0x2da613(0x101))/0x3+-parseInt(_0x2da613(0x103))/0x4*(-parseInt(_0x2da613(0x107))/0x5)+-parseInt(_0x2da613(0x102))/0x6*(parseInt(_0x2da613(0x10a))/0x7)+parseInt(_0x2da613(0x10b))/0x8*(parseInt(_0x2da613(0x10d))/0x9)+-parseInt(_0x2da613(0x105))/0xa+parseInt(_0x2da613(0x106))/0xb;if(_0x457103===_0x34c9f4)break;else _0x4f821d['push'](_0x4f821d['shift']());}catch(_0x2ce629){_0x4f821d['push'](_0x4f821d['shift']());}}}(a38_0x1e5d,0x7b7a8));function a38_0x1e5d(){const _0x3c0e43=['schema','322sLYKqA','1640iMJHtw','46NEckqa','1071XnKSMx','Export\x20machine-readable\x20command\x20schema\x20(JSON)','491625uLaYsP','34674dWyugO','4vBcCBF','read','5008470wwDeVQ','9127118eMNMih','2809985LxfrqZ','13372ycTMUs'];a38_0x1e5d=function(){return _0x3c0e43;};return a38_0x1e5d();}import{buildSchemaPayload}from'../framework/schema-export.js';function a38_0x30a8(_0x59482b,_0x46177b){_0x59482b=_0x59482b-0x100;const _0x1e5d8b=a38_0x1e5d();let _0x30a8c1=_0x1e5d8b[_0x59482b];return _0x30a8c1;}async function execute(_0x3753e1){const _0x2e15db=await buildSchemaPayload();return{'ok':!![],'data':_0x2e15db};}export const schemaDefinition={'service':a38_0x2c4840(0x109),'command':'export','description':a38_0x2c4840(0x100),'risk':a38_0x2c4840(0x104),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
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};