@lovrabet/lovrabet-cli 2.1.23-beta.2 → 2.1.23-beta.4

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 (139) 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.d.ts +2 -8
  35. package/lib/commands/logs/index.js +1 -1
  36. package/lib/commands/ocr/index.js +1 -1
  37. package/lib/commands/personal-bff/index.js +1 -1
  38. package/lib/commands/registry.js +1 -1
  39. package/lib/commands/schedule/index.js +1 -1
  40. package/lib/commands/schema.js +1 -1
  41. package/lib/commands/service/dynamic.js +1 -1
  42. package/lib/commands/service/function-name-adapter.js +1 -1
  43. package/lib/commands/service/index.js +1 -1
  44. package/lib/commands/service/registry.js +1 -1
  45. package/lib/commands/skill/commands/create.js +1 -1
  46. package/lib/commands/skill/commands/diagram.js +1 -1
  47. package/lib/commands/skill/commands/install.js +1 -1
  48. package/lib/commands/skill/commands/list.js +1 -1
  49. package/lib/commands/skill/commands/push.js +1 -1
  50. package/lib/commands/skill/commands/validate.js +1 -1
  51. package/lib/commands/skill/diagram.d.ts +6 -0
  52. package/lib/commands/skill/diagram.js +1 -1
  53. package/lib/commands/skill/flags.js +1 -1
  54. package/lib/commands/skill/index.js +1 -1
  55. package/lib/commands/skill/manifest-helpers.js +1 -1
  56. package/lib/commands/skill/push-execute.js +1 -1
  57. package/lib/commands/skill/push-flow-helpers.js +1 -1
  58. package/lib/commands/skill/push-retarget.js +1 -1
  59. package/lib/commands/skill/scopes.js +1 -1
  60. package/lib/commands/skill/summary.js +1 -1
  61. package/lib/commands/skill/templates.js +1 -1
  62. package/lib/commands/skill/validate.js +1 -1
  63. package/lib/commands/sql/detail.js +1 -1
  64. package/lib/commands/sql/exec.js +1 -1
  65. package/lib/commands/sql/index.js +1 -1
  66. package/lib/commands/update.js +1 -1
  67. package/lib/commands/workspace/index.js +1 -1
  68. package/lib/config/schema.js +1 -1
  69. package/lib/constant/app.js +1 -1
  70. package/lib/constant/auth-mode.js +1 -1
  71. package/lib/constant/cli.js +1 -1
  72. package/lib/constant/defaults.js +1 -1
  73. package/lib/constant/distribution.js +1 -1
  74. package/lib/constant/domain.js +1 -1
  75. package/lib/constant/env.js +1 -1
  76. package/lib/constant/output.js +1 -1
  77. package/lib/constant/product.d.ts +14 -0
  78. package/lib/constant/product.js +1 -1
  79. package/lib/constant/risk.js +1 -1
  80. package/lib/constant/url.js +1 -1
  81. package/lib/context.js +1 -1
  82. package/lib/core/api-client.js +1 -1
  83. package/lib/core/db-resolver.js +1 -1
  84. package/lib/core/sdk-client.js +1 -1
  85. package/lib/errors.js +1 -1
  86. package/lib/framework/build-all-flags.js +1 -1
  87. package/lib/framework/dryrun.js +1 -1
  88. package/lib/framework/flags.js +1 -1
  89. package/lib/framework/help.js +1 -1
  90. package/lib/framework/index.js +1 -1
  91. package/lib/framework/output.js +1 -1
  92. package/lib/framework/preparse.js +1 -1
  93. package/lib/framework/rate-limit.js +1 -1
  94. package/lib/framework/raw-flags.js +1 -1
  95. package/lib/framework/response.js +1 -1
  96. package/lib/framework/runner-confirmation.js +1 -1
  97. package/lib/framework/runner-error.js +1 -1
  98. package/lib/framework/runner.js +1 -1
  99. package/lib/framework/schema-export.js +1 -1
  100. package/lib/framework/service-order.js +1 -1
  101. package/lib/framework/types.js +1 -1
  102. package/lib/generated/build-info.d.ts +4 -4
  103. package/lib/generated/build-info.js +1 -1
  104. package/lib/help.js +1 -1
  105. package/lib/runtime/confirmation.js +1 -1
  106. package/lib/runtime/event.js +1 -1
  107. package/lib/runtime/index.js +1 -1
  108. package/lib/runtime/queue.js +1 -1
  109. package/lib/runtime/resolve.js +1 -1
  110. package/lib/skills/npx-skills-add.d.ts +30 -0
  111. package/lib/skills/npx-skills-add.js +1 -1
  112. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  113. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  114. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  115. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  116. package/lib/skills/runtime-skill-sync/links.js +1 -1
  117. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  118. package/lib/skills/runtime-skill-sync/local-files.d.ts +4 -1
  119. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  120. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  121. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  122. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  123. package/lib/skills/runtime-skill-sync/push.d.ts +1 -0
  124. package/lib/skills/runtime-skill-sync/push.js +1 -1
  125. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  126. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  127. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  128. package/lib/skills/runtime-skill-sync.js +1 -1
  129. package/lib/skills/skill-presence.d.ts +48 -0
  130. package/lib/skills/skill-presence.js +1 -0
  131. package/lib/utils/apply-jq-filter.js +1 -1
  132. package/lib/utils/logger.js +1 -1
  133. package/lib/utils/lossless-json.js +1 -1
  134. package/lib/utils/params.js +1 -1
  135. package/lib/utils/platform.js +1 -1
  136. package/lib/utils/update-notice.js +1 -1
  137. package/lib/utils/version.js +1 -1
  138. package/lib/utils/write-cli-side-channel.js +1 -1
  139. package/package.json +1 -1
@@ -1 +1 @@
1
- const a28_0xb9c266=a28_0x1a0f;(function(_0xf05479,_0x2316a4){const _0x213507=a28_0x1a0f,_0xfb6156=_0xf05479();while(!![]){try{const _0x15a3bd=parseInt(_0x213507(0xad))/0x1*(parseInt(_0x213507(0xbb))/0x2)+-parseInt(_0x213507(0xbc))/0x3+-parseInt(_0x213507(0xb0))/0x4+-parseInt(_0x213507(0xac))/0x5*(parseInt(_0x213507(0xbe))/0x6)+-parseInt(_0x213507(0xb5))/0x7*(parseInt(_0x213507(0xb3))/0x8)+parseInt(_0x213507(0xbd))/0x9*(parseInt(_0x213507(0xb6))/0xa)+parseInt(_0x213507(0xb9))/0xb*(parseInt(_0x213507(0xc0))/0xc);if(_0x15a3bd===_0x2316a4)break;else _0xfb6156['push'](_0xfb6156['shift']());}catch(_0x3a8085){_0xfb6156['push'](_0xfb6156['shift']());}}}(a28_0x1591,0x5e995));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a28_0x1591(){const _0x5dc7e2=['408DwbWLU','sdk-doc','4555164CMlxWZ','code','52265dNSAJd','1658dJPJBm','str','trim','1870080ZZlVdY','read','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','16vYozAa','dataset','16716FZJUQK','207670RWiYXC','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','appCode','33GzzuOr','string','808WBDPQW','776439nZtCuw','9VhbCmL'];a28_0x1591=function(){return _0x5dc7e2;};return a28_0x1591();}const DEFAULT_MARKDOWN=a28_0xb9c266(0xb7);function a28_0x1a0f(_0x3d2918,_0x24aacc){_0x3d2918=_0x3d2918-0xab;const _0x15911b=a28_0x1591();let _0x1a0f3d=_0x15911b[_0x3d2918];return _0x1a0f3d;}export function formatDatasetSdkMarkdown(_0x30566b){const _0x34a57f=a28_0xb9c266,_0x1672a9=typeof _0x30566b===_0x34a57f(0xba)?_0x30566b[_0x34a57f(0xaf)]():'';return _0x1672a9||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a28_0xb9c266(0xb4),'command':a28_0xb9c266(0xbf),'description':'Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','risk':a28_0xb9c266(0xb1),'flags':[{...CODE_FLAG,'description':a28_0xb9c266(0xb2)}],async 'execute'(_0xc68445){const _0x386265=a28_0xb9c266,_0x533c47=_0xc68445[_0x386265(0xae)](_0x386265(0xab)),_0x529c68=await getDatasetSdkUsageDoc(_0x533c47,_0xc68445[_0x386265(0xb8)]);return{'ok':!![],'data':{'code':_0x533c47,'appCode':_0xc68445['appCode'],'markdown':formatDatasetSdkMarkdown(_0x529c68)}};}};
1
+ const a28_0x445479=a28_0x5c05;function a28_0x5cf6(){const _0x421cfe=['1344SoYuvW','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','sdk-doc','1460358AGLmtx','appCode','6596106nLfZUn','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','1ufZQrp','trim','7702047RcgSAt','3422392yPDLQD','5TehLIS','1407ZFCrho','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','str','1935142BArRWH','code','16375560rGjzHZ'];a28_0x5cf6=function(){return _0x421cfe;};return a28_0x5cf6();}(function(_0x539bbc,_0x5cd377){const _0x257791=a28_0x5c05,_0x471713=_0x539bbc();while(!![]){try{const _0x66f2ae=parseInt(_0x257791(0x83))/0x1*(parseInt(_0x257791(0x8b))/0x2)+parseInt(_0x257791(0x7f))/0x3+parseInt(_0x257791(0x86))/0x4*(-parseInt(_0x257791(0x87))/0x5)+parseInt(_0x257791(0x81))/0x6+-parseInt(_0x257791(0x88))/0x7*(parseInt(_0x257791(0x8e))/0x8)+parseInt(_0x257791(0x85))/0x9+-parseInt(_0x257791(0x8d))/0xa;if(_0x66f2ae===_0x5cd377)break;else _0x471713['push'](_0x471713['shift']());}catch(_0x2a8547){_0x471713['push'](_0x471713['shift']());}}}(a28_0x5cf6,0xd7789));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';function a28_0x5c05(_0x2a29ca,_0x1e1b2b){_0x2a29ca=_0x2a29ca-0x7f;const _0x5cf650=a28_0x5cf6();let _0x5c0549=_0x5cf650[_0x2a29ca];return _0x5c0549;}import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a28_0x445479(0x89);export function formatDatasetSdkMarkdown(_0x1dfac4){const _0x3f41ea=a28_0x445479,_0x27c21b=typeof _0x1dfac4==='string'?_0x1dfac4[_0x3f41ea(0x84)]():'';return _0x27c21b||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':'dataset','command':a28_0x445479(0x90),'description':a28_0x445479(0x8f),'risk':'read','flags':[{...CODE_FLAG,'description':a28_0x445479(0x82)}],async 'execute'(_0x1a77a){const _0x34bc5e=a28_0x445479,_0x3f25a8=_0x1a77a[_0x34bc5e(0x8a)](_0x34bc5e(0x8c)),_0x53b683=await getDatasetSdkUsageDoc(_0x3f25a8,_0x1a77a[_0x34bc5e(0x80)]);return{'ok':!![],'data':{'code':_0x3f25a8,'appCode':_0x1a77a[_0x34bc5e(0x80)],'markdown':formatDatasetSdkMarkdown(_0x53b683)}};}};
@@ -1 +1 @@
1
- function a29_0x541f(_0x22686e,_0x5f2099){_0x22686e=_0x22686e-0x78;const _0x1e2b50=a29_0x1e2b();let _0x541f24=_0x1e2b50[_0x22686e];return _0x541f24;}const a29_0x9e2646=a29_0x541f;(function(_0x10a0a9,_0x46db5d){const _0x4c35de=a29_0x541f,_0xae02bb=_0x10a0a9();while(!![]){try{const _0x375120=-parseInt(_0x4c35de(0x7d))/0x1+-parseInt(_0x4c35de(0x93))/0x2*(parseInt(_0x4c35de(0x97))/0x3)+-parseInt(_0x4c35de(0xa3))/0x4+-parseInt(_0x4c35de(0x8f))/0x5*(parseInt(_0x4c35de(0x83))/0x6)+-parseInt(_0x4c35de(0x89))/0x7+-parseInt(_0x4c35de(0xc7))/0x8*(-parseInt(_0x4c35de(0x78))/0x9)+-parseInt(_0x4c35de(0xc8))/0xa*(-parseInt(_0x4c35de(0xa8))/0xb);if(_0x375120===_0x46db5d)break;else _0xae02bb['push'](_0xae02bb['shift']());}catch(_0x4774df){_0xae02bb['push'](_0xae02bb['shift']());}}}(a29_0x1e2b,0x66043));import a29_0x5f25d8 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0xdea1cf){const _0x143588=a29_0x541f,_0x642e2b=getCliVersion(),_0x4800d5=buildConfigFromFlags({});await initGlobalEnvironment(_0x4800d5),console[_0x143588(0x9e)](),console[_0x143588(0x9e)](a29_0x5f25d8[_0x143588(0xb2)](CLI_BIN_NAME+_0x143588(0xa4))),console[_0x143588(0x9e)](a29_0x5f25d8[_0x143588(0x94)]('─'['repeat'](0x32))),console['log'](_0x143588(0xa7)+_0x642e2b),console[_0x143588(0x9e)](_0x143588(0x9a)+process[_0x143588(0x85)]),console['log'](_0x143588(0x88)+process[_0x143588(0xad)]+'\x20'+process['arch']),console[_0x143588(0x9e)](),console[_0x143588(0x9e)](a29_0x5f25d8['bold'](_0x143588(0xb4))),console[_0x143588(0x9e)](a29_0x5f25d8[_0x143588(0x94)](_0x143588(0x92)[_0x143588(0xb0)](0x1e)));const _0x47652c=getGlobalConfigPath(),_0x2ca4f4=getProjectConfigPath();console[_0x143588(0x9e)](_0x143588(0xb8)+(_0x47652c||a29_0x5f25d8[_0x143588(0x94)](_0x143588(0x87)))),console['log'](_0x143588(0x84)+(_0x2ca4f4||a29_0x5f25d8[_0x143588(0x94)](_0x143588(0x87)))),console[_0x143588(0x9e)](),console['log'](a29_0x5f25d8[_0x143588(0xb2)](_0x143588(0x95))),console[_0x143588(0x9e)](a29_0x5f25d8[_0x143588(0x94)]('\x20\x20─'['repeat'](0x1e)));const _0xd6c35a=(_0x3c9a68,_0x529df1)=>{const _0x446666=_0x143588;if(!_0x529df1){console['log']('\x20\x20'+_0x3c9a68[_0x446666(0x9c)](0x11)+'\x20'+a29_0x5f25d8[_0x446666(0x94)]('(no\x20file)'));return;}const _0x1b2626=inspectCliConfigJsonFile(_0x529df1);if(_0x1b2626[_0x446666(0xb3)]==='ok')console[_0x446666(0x9e)]('\x20\x20'+_0x3c9a68['padEnd'](0x11)+'\x20'+a29_0x5f25d8[_0x446666(0x9d)](_0x446666(0xb7)));else{if(_0x1b2626['status']===_0x446666(0xbe))console[_0x446666(0x9e)]('\x20\x20'+_0x3c9a68['padEnd'](0x11)+'\x20'+a29_0x5f25d8[_0x446666(0x81)](_0x446666(0xc5)));else _0x1b2626[_0x446666(0xb3)]===_0x446666(0xac)?console[_0x446666(0x9e)]('\x20\x20'+_0x3c9a68[_0x446666(0x9c)](0x11)+'\x20'+a29_0x5f25d8['gray']('(missing)')):(console[_0x446666(0x9e)]('\x20\x20'+_0x3c9a68[_0x446666(0x9c)](0x11)+'\x20'+a29_0x5f25d8[_0x446666(0xa0)]('✗\x20Invalid\x20JSON')),console[_0x446666(0x9e)]('\x20\x20'+''[_0x446666(0x9c)](0x11)+'\x20'+a29_0x5f25d8[_0x446666(0xa0)](_0x1b2626['message'])));}};_0xd6c35a('Global',_0x47652c),_0xd6c35a('Project',_0x2ca4f4),console[_0x143588(0x9e)](),console['log'](a29_0x5f25d8[_0x143588(0xb2)](_0x143588(0xa5))),console[_0x143588(0x9e)](a29_0x5f25d8[_0x143588(0x94)](_0x143588(0x92)[_0x143588(0xb0)](0x1e))),console[_0x143588(0x9e)](_0x143588(0xa6)+(_0x4800d5[_0x143588(0xba)]||a29_0x5f25d8[_0x143588(0xa0)](_0x143588(0xb9)))),console['log'](_0x143588(0xab)+_0x4800d5['env']);const _0x178267=isLegacyCompatConfigKey(_0x143588(0x8e))?a29_0x5f25d8[_0x143588(0x94)](_0x4800d5[_0x143588(0x8e)]+'\x20(legacy/compat\x20only)'):_0x4800d5[_0x143588(0x8e)];console['log'](_0x143588(0xc1)+_0x178267),console[_0x143588(0x9e)]('\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'+(_0x4800d5[_0x143588(0xb6)]||a29_0x5f25d8[_0x143588(0x94)](_0x143588(0x96)))),console['log'](_0x143588(0xc6)+(_0x4800d5[_0x143588(0xc4)]||a29_0x5f25d8[_0x143588(0x94)](_0x143588(0x96)))),console['log'](_0x143588(0xc9)+(_0x4800d5[_0x143588(0x7a)]||a29_0x5f25d8['gray'](_0x143588(0x7f)+DEFAULT_CONFIG_VALUES['format']+')'))),console[_0x143588(0x9e)](_0x143588(0x9b)+(_0x4800d5[_0x143588(0xbb)]??a29_0x5f25d8[_0x143588(0x94)](_0x143588(0xa9)))),console[_0x143588(0x9e)]('\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20'+_0x4800d5[_0x143588(0x9f)]),console[_0x143588(0x9e)](_0x143588(0x86)+_0x4800d5[_0x143588(0x99)]),console[_0x143588(0x9e)](_0x143588(0xb5)+AUTH_MODE[_0x143588(0x7b)]),console['log']('\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20'+(_0x4800d5[_0x143588(0xc0)]?a29_0x5f25d8[_0x143588(0x9d)](_0x143588(0xb1)+_0x4800d5[_0x143588(0xc0)][_0x143588(0x80)]+')'):a29_0x5f25d8[_0x143588(0x94)](_0x143588(0x96)))),console[_0x143588(0x9e)](),console[_0x143588(0x9e)](a29_0x5f25d8['bold'](_0x143588(0xbf))),console[_0x143588(0x9e)](a29_0x5f25d8['gray'](_0x143588(0x92)[_0x143588(0xb0)](0x1e))),console[_0x143588(0x9e)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x143588(0x9e)](_0x143588(0xa2)+getUserDomain()),console[_0x143588(0x9e)](_0x143588(0x91)+getRuntimeDomain()),console[_0x143588(0x9e)](),console['log'](a29_0x5f25d8[_0x143588(0xb2)]('\x20\x20Service\x20Tree')),console[_0x143588(0x9e)](a29_0x5f25d8[_0x143588(0x94)](_0x143588(0x92)[_0x143588(0xb0)](0x1e)));const _0x191653=inspectServiceRegistry();console[_0x143588(0x9e)](_0x143588(0x7c)+_0x191653[_0x143588(0xae)]),console['log']('\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+formatServiceRegistryStatus(_0x191653)),console[_0x143588(0x9e)](_0x143588(0xc3)+_0x191653[_0x143588(0x79)]),console['log'](_0x143588(0xbc)+_0x191653[_0x143588(0x8a)]);for(const _0x4d414e of _0x191653['services']){console[_0x143588(0x9e)]('\x20\x20'+(_0x4d414e[_0x143588(0xc2)]+':')['padEnd'](0x11)+'\x20'+(_0x4d414e['name']||a29_0x5f25d8[_0x143588(0x94)](_0x143588(0xaa)))+'\x20('+_0x4d414e['commandCount']+'\x20commands)'),console['log']('\x20\x20'+''[_0x143588(0x9c)](0x11)+_0x143588(0x98)+_0x4d414e['source']['path']);}return console['log'](),console[_0x143588(0x9e)](a29_0x5f25d8[_0x143588(0xb2)]('\x20\x20Auth')),console[_0x143588(0x9e)](a29_0x5f25d8['gray'](_0x143588(0x92)[_0x143588(0xb0)](0x1e))),console[_0x143588(0x9e)](_0x143588(0x8c)+a29_0x5f25d8['green'](AUTH_MODE[_0x143588(0x7b)]+_0x143588(0x8b))),console[_0x143588(0x9e)](_0x143588(0x90)+a29_0x5f25d8['gray'](_0x143588(0xaf))),console['log'](),{'ok':!![]};}function formatServiceRegistryStatus(_0x1152f5){const _0x58e38e=a29_0x541f;if(_0x1152f5[_0x58e38e(0xb3)]==='ok')return a29_0x5f25d8[_0x58e38e(0x9d)]('✓\x20Loaded');if(_0x1152f5['status']===_0x58e38e(0xac))return a29_0x5f25d8[_0x58e38e(0x94)](_0x58e38e(0x87));if(_0x1152f5[_0x58e38e(0xb3)]===_0x58e38e(0xbe))return a29_0x5f25d8[_0x58e38e(0x81)](_0x58e38e(0xbd));return a29_0x5f25d8[_0x58e38e(0xa0)]('✗\x20Invalid'+(_0x1152f5[_0x58e38e(0x7e)]?':\x20'+_0x1152f5['message']:''));}function a29_0x1e2b(){const _0x1e1736=['ClientAk','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','39430GmEDHu','message','(default:\x20','length','yellow','Diagnose\x20CLI\x20configuration\x20and\x20environment','474972fZJMvm','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','version','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20found)','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','617008BUbxfu','commandCount','\x20(accessKey)','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','check','locale','5KOReGA','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20─','102kqZxza','gray','\x20\x20Config\x20JSON','(none)','25923mStdMF','\x20Imported\x20from:\x20','verbose','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','padEnd','green','log','riskLevel','red','doctor','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','1730572ZIykzJ','\x20doctor','\x20\x20Merged\x20Config','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','77xBVvOc','(default)','(unnamed)','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','missing','platform','registryPath','(removed\x20—\x20cookie\x20auth\x20disabled)','repeat','(set,\x20length=','bold','status','\x20\x20Config\x20Files','\x20\x20auth\x20(effective):\x20','defaultApp','✓\x20Valid\x20JSON','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20set)','appCode','pageSize','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','⚠\x20Empty','empty','\x20\x20API\x20Endpoints','accessKey','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','serviceCode','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','currentApp','⚠\x20Empty\x20(treated\x20as\x20{})','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','47776BroMKs','1073470jVFdzc','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','1125lXygRK','serviceCount','format'];a29_0x1e2b=function(){return _0x1e1736;};return a29_0x1e2b();}export const doctorDefinition={'service':a29_0x9e2646(0xa1),'command':a29_0x9e2646(0x8d),'description':a29_0x9e2646(0x82),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
1
+ function a29_0x1ec8(){const _0x566d10=['format','currentApp','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','534104xsYSse','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✗\x20Invalid\x20JSON','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','message','\x20doctor','36ASEMuE','locale','(no\x20file)','green','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','length','log','appCode','env','7kbBrpZ','\x20\x20─','\x20(accessKey)','2791344BTFbHq','red','(default)','\x20\x20Service\x20Tree','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','(not\x20found)','path','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','repeat','\x20\x20Auth','services','\x20\x20Merged\x20Config','arch','yellow','\x20\x20runtimeDomain:\x20\x20\x20','5SFBPHg','29066dOWwvq','Global','(missing)','(set,\x20length=','866104GmvpxO','(default:\x20','read','commandCount','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20Valid\x20JSON','empty','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','3990811KjTvAQ','source','2dpVVhz','Project','✓\x20Loaded','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','status','gray','\x20\x20Config\x20JSON','⚠\x20Empty\x20(treated\x20as\x20{})','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20\x20API\x20Endpoints','⚠\x20Empty','riskLevel','\x20\x20Config\x20Files','registryPath','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','doctor','\x20Imported\x20from:\x20','10XyVVZI','pageSize','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','bold','version','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','platform','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','verbose','79494Lxnwxn','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✗\x20Invalid','missing','(removed\x20—\x20cookie\x20auth\x20disabled)','743844PivILa','ClientAk','(none)','padEnd'];a29_0x1ec8=function(){return _0x566d10;};return a29_0x1ec8();}const a29_0x289b7e=a29_0x17df;(function(_0x3447e1,_0xb48ec){const _0x373578=a29_0x17df,_0x14e822=_0x3447e1();while(!![]){try{const _0x2a4ac0=parseInt(_0x373578(0x1a8))/0x1*(parseInt(_0x373578(0x1b6))/0x2)+parseInt(_0x373578(0x1db))/0x3+parseInt(_0x373578(0x1e2))/0x4*(parseInt(_0x373578(0x1a7))/0x5)+-parseInt(_0x373578(0x1d3))/0x6*(-parseInt(_0x373578(0x193))/0x7)+parseInt(_0x373578(0x1ac))/0x8*(parseInt(_0x373578(0x18a))/0x9)+parseInt(_0x373578(0x1c9))/0xa*(-parseInt(_0x373578(0x1b4))/0xb)+-parseInt(_0x373578(0x196))/0xc;if(_0x2a4ac0===_0xb48ec)break;else _0x14e822['push'](_0x14e822['shift']());}catch(_0x526409){_0x14e822['push'](_0x14e822['shift']());}}}(a29_0x1ec8,0x3fd34));import a29_0x43935f from'chalk';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';function a29_0x17df(_0x5c8d77,_0x1c8704){_0x5c8d77=_0x5c8d77-0x187;const _0x1ec870=a29_0x1ec8();let _0x17df03=_0x1ec870[_0x5c8d77];return _0x17df03;}import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x33c6ad){const _0x494d29=a29_0x17df,_0x7a9058=getCliVersion(),_0x5e5672=buildConfigFromFlags({});await initGlobalEnvironment(_0x5e5672),console[_0x494d29(0x190)](),console['log'](a29_0x43935f[_0x494d29(0x1cc)](CLI_BIN_NAME+_0x494d29(0x189))),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1bb)]('─'[_0x494d29(0x1a0)](0x32))),console['log'](_0x494d29(0x1cf)+_0x7a9058),console[_0x494d29(0x190)](_0x494d29(0x1d7)+process[_0x494d29(0x1cd)]),console['log'](_0x494d29(0x187)+process[_0x494d29(0x1d0)]+'\x20'+process[_0x494d29(0x1a4)]),console[_0x494d29(0x190)](),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1cc)](_0x494d29(0x1c2))),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x194)[_0x494d29(0x1a0)](0x1e)));const _0x3ea0aa=getGlobalConfigPath(),_0x1512f6=getProjectConfigPath();console[_0x494d29(0x190)](_0x494d29(0x19a)+(_0x3ea0aa||a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x19d)))),console[_0x494d29(0x190)](_0x494d29(0x1b0)+(_0x1512f6||a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x19d)))),console[_0x494d29(0x190)](),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1cc)](_0x494d29(0x1bc))),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x194)[_0x494d29(0x1a0)](0x1e)));const _0x23ed47=(_0x4e9c89,_0xccbb85)=>{const _0x446c92=_0x494d29;if(!_0xccbb85){console['log']('\x20\x20'+_0x4e9c89[_0x446c92(0x1de)](0x11)+'\x20'+a29_0x43935f[_0x446c92(0x1bb)](_0x446c92(0x18c)));return;}const _0x2f1dd3=inspectCliConfigJsonFile(_0xccbb85);if(_0x2f1dd3['status']==='ok')console[_0x446c92(0x190)]('\x20\x20'+_0x4e9c89[_0x446c92(0x1de)](0x11)+'\x20'+a29_0x43935f[_0x446c92(0x18d)](_0x446c92(0x1b1)));else{if(_0x2f1dd3['status']===_0x446c92(0x1b2))console[_0x446c92(0x190)]('\x20\x20'+_0x4e9c89[_0x446c92(0x1de)](0x11)+'\x20'+a29_0x43935f[_0x446c92(0x1a5)](_0x446c92(0x1bd)));else _0x2f1dd3[_0x446c92(0x1ba)]==='missing'?console[_0x446c92(0x190)]('\x20\x20'+_0x4e9c89[_0x446c92(0x1de)](0x11)+'\x20'+a29_0x43935f[_0x446c92(0x1bb)](_0x446c92(0x1aa))):(console[_0x446c92(0x190)]('\x20\x20'+_0x4e9c89[_0x446c92(0x1de)](0x11)+'\x20'+a29_0x43935f['red'](_0x446c92(0x1e4))),console['log']('\x20\x20'+''[_0x446c92(0x1de)](0x11)+'\x20'+a29_0x43935f['red'](_0x2f1dd3[_0x446c92(0x188)])));}};_0x23ed47(_0x494d29(0x1a9),_0x3ea0aa),_0x23ed47(_0x494d29(0x1b7),_0x1512f6),console[_0x494d29(0x190)](),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1cc)](_0x494d29(0x1a3))),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x194)['repeat'](0x1e))),console[_0x494d29(0x190)]('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x5e5672[_0x494d29(0x191)]||a29_0x43935f['red']('(not\x20set)'))),console['log'](_0x494d29(0x1b9)+_0x5e5672[_0x494d29(0x192)]);const _0x1d5545=isLegacyCompatConfigKey(_0x494d29(0x18b))?a29_0x43935f[_0x494d29(0x1bb)](_0x5e5672[_0x494d29(0x18b)]+'\x20(legacy/compat\x20only)'):_0x5e5672[_0x494d29(0x18b)];console[_0x494d29(0x190)](_0x494d29(0x1e3)+_0x1d5545),console[_0x494d29(0x190)](_0x494d29(0x1c5)+(_0x5e5672['defaultApp']||a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x1dd)))),console[_0x494d29(0x190)](_0x494d29(0x1d5)+(_0x5e5672[_0x494d29(0x1e0)]||a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x1dd)))),console['log'](_0x494d29(0x19f)+(_0x5e5672[_0x494d29(0x1df)]||a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x1ad)+DEFAULT_CONFIG_VALUES[_0x494d29(0x1df)]+')'))),console[_0x494d29(0x190)](_0x494d29(0x1d1)+(_0x5e5672[_0x494d29(0x1ca)]??a29_0x43935f['gray'](_0x494d29(0x198)))),console[_0x494d29(0x190)](_0x494d29(0x1ce)+_0x5e5672[_0x494d29(0x1c1)]),console[_0x494d29(0x190)](_0x494d29(0x18e)+_0x5e5672[_0x494d29(0x1d2)]),console[_0x494d29(0x190)](_0x494d29(0x19c)+AUTH_MODE[_0x494d29(0x1dc)]),console[_0x494d29(0x190)](_0x494d29(0x1d6)+(_0x5e5672['accessKey']?a29_0x43935f[_0x494d29(0x18d)](_0x494d29(0x1ab)+_0x5e5672['accessKey'][_0x494d29(0x18f)]+')'):a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x1dd)))),console[_0x494d29(0x190)](),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1cc)](_0x494d29(0x1bf))),console[_0x494d29(0x190)](a29_0x43935f['gray'](_0x494d29(0x194)[_0x494d29(0x1a0)](0x1e))),console[_0x494d29(0x190)](_0x494d29(0x1b3)+getApiDomain()),console[_0x494d29(0x190)]('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console['log'](_0x494d29(0x1a6)+getRuntimeDomain()),console[_0x494d29(0x190)](),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1cc)](_0x494d29(0x199))),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x194)[_0x494d29(0x1a0)](0x1e)));const _0x5dd13d=inspectServiceRegistry();console[_0x494d29(0x190)](_0x494d29(0x1cb)+_0x5dd13d[_0x494d29(0x1c3)]),console[_0x494d29(0x190)](_0x494d29(0x1e1)+formatServiceRegistryStatus(_0x5dd13d)),console['log'](_0x494d29(0x1c4)+_0x5dd13d['serviceCount']),console[_0x494d29(0x190)](_0x494d29(0x19b)+_0x5dd13d[_0x494d29(0x1af)]);for(const _0x2e6e3d of _0x5dd13d[_0x494d29(0x1a2)]){console[_0x494d29(0x190)]('\x20\x20'+(_0x2e6e3d['serviceCode']+':')[_0x494d29(0x1de)](0x11)+'\x20'+(_0x2e6e3d['name']||a29_0x43935f['gray']('(unnamed)'))+'\x20('+_0x2e6e3d[_0x494d29(0x1af)]+'\x20commands)'),console['log']('\x20\x20'+''['padEnd'](0x11)+_0x494d29(0x1c8)+_0x2e6e3d[_0x494d29(0x1b5)][_0x494d29(0x19e)]);}return console[_0x494d29(0x190)](),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1cc)](_0x494d29(0x1a1))),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x194)[_0x494d29(0x1a0)](0x1e))),console['log'](_0x494d29(0x1c6)+a29_0x43935f[_0x494d29(0x18d)](AUTH_MODE[_0x494d29(0x1dc)]+_0x494d29(0x195))),console[_0x494d29(0x190)](_0x494d29(0x1d4)+a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x1da))),console[_0x494d29(0x190)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x9c8d1){const _0x71f4f7=a29_0x17df;if(_0x9c8d1['status']==='ok')return a29_0x43935f[_0x71f4f7(0x18d)](_0x71f4f7(0x1b8));if(_0x9c8d1['status']===_0x71f4f7(0x1d9))return a29_0x43935f[_0x71f4f7(0x1bb)](_0x71f4f7(0x19d));if(_0x9c8d1['status']===_0x71f4f7(0x1b2))return a29_0x43935f[_0x71f4f7(0x1a5)](_0x71f4f7(0x1c0));return a29_0x43935f[_0x71f4f7(0x197)](_0x71f4f7(0x1d8)+(_0x9c8d1[_0x71f4f7(0x188)]?':\x20'+_0x9c8d1['message']:''));}export const doctorDefinition={'service':a29_0x289b7e(0x1c7),'command':'check','description':a29_0x289b7e(0x1be),'risk':a29_0x289b7e(0x1ae),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a30_0x3b1747=a30_0x5976;function a30_0x5976(_0xa72cd7,_0x15909f){_0xa72cd7=_0xa72cd7-0x7d;const _0x44de63=a30_0x44de();let _0x597626=_0x44de63[_0xa72cd7];return _0x597626;}(function(_0x59b5ae,_0x1b1b16){const _0x3e5f2e=a30_0x5976,_0x5e08e6=_0x59b5ae();while(!![]){try{const _0x418676=parseInt(_0x3e5f2e(0x9b))/0x1*(parseInt(_0x3e5f2e(0xa0))/0x2)+-parseInt(_0x3e5f2e(0x85))/0x3+-parseInt(_0x3e5f2e(0x90))/0x4+-parseInt(_0x3e5f2e(0x8f))/0x5+-parseInt(_0x3e5f2e(0x8a))/0x6+-parseInt(_0x3e5f2e(0x8d))/0x7+-parseInt(_0x3e5f2e(0x82))/0x8*(-parseInt(_0x3e5f2e(0x7d))/0x9);if(_0x418676===_0x1b1b16)break;else _0x5e08e6['push'](_0x5e08e6['shift']());}catch(_0x200b2b){_0x5e08e6['push'](_0x5e08e6['shift']());}}}(a30_0x44de,0x97685));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_0x3b1747(0x99),'type':'string','required':!![],'description':a30_0x3b1747(0x94)},FILEPATH_FLAG={'name':a30_0x3b1747(0x93),'type':a30_0x3b1747(0x83),'required':!![],'description':'Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data'},DOWNLOAD_FLAG={'name':a30_0x3b1747(0xa1),'type':a30_0x3b1747(0x9a),'description':'Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL'},LONG_TERM_FLAG={'name':'long-term','type':'boolean','description':'Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML'};function requireFilePath(_0x86a31d){const _0xe0bf09=a30_0x3b1747,_0x378d11=_0x86a31d[_0xe0bf09(0x9f)]();if(!_0x378d11)throw CliErrors[_0xe0bf09(0x81)](_0xe0bf09(0x80));return _0x378d11;}const fileUpload={'service':a30_0x3b1747(0x99),'command':'upload','description':'Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','risk':'read','flags':[FILE_FLAG],async 'dryRun'(_0x3e3713){const _0x3e6eed=a30_0x3b1747,_0x298d9f=requireRuntimeUploadFile(_0x3e3713[_0x3e6eed(0x98)](_0x3e6eed(0x99)),_0x3e6eed(0x89));return dryRun(_0x3e6eed(0x91),_0x3e6eed(0x96))[_0x3e6eed(0x8b)]({'appCode':_0x3e3713['appCode'],'multipart':{'file':_0x298d9f}})[_0x3e6eed(0x9e)](_0x3e6eed(0x92)+_0x298d9f[_0x3e6eed(0x95)]+_0x3e6eed(0x9c)+_0x3e3713[_0x3e6eed(0x9d)])[_0x3e6eed(0x86)]();},async 'execute'(_0x44f21c){const _0x4301c2=a30_0x3b1747,_0x514649=requireRuntimeUploadFile(_0x44f21c[_0x4301c2(0x98)]('file'),'File'),_0x25399d=await uploadRuntimeFile(_0x44f21c[_0x4301c2(0x9d)],_0x514649['path']);return{'ok':!![],'data':_0x25399d,'message':_0x25399d[_0x4301c2(0x8e)]?_0x4301c2(0x97)+_0x25399d['filePath']+_0x4301c2(0x8c):_0x4301c2(0x88)};}},fileQueryUrl={'service':a30_0x3b1747(0x99),'command':a30_0x3b1747(0x84),'description':a30_0x3b1747(0x87),'risk':a30_0x3b1747(0x7e),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x18d7f9){const _0xe3f3c1=a30_0x3b1747,_0x63e8ec=requireFilePath(_0x18d7f9[_0xe3f3c1(0x98)](_0xe3f3c1(0x93))),_0xa7dbd6=await queryRuntimeFileUrl(_0x63e8ec,{'download':_0x18d7f9[_0xe3f3c1(0x7f)](_0xe3f3c1(0xa1)),'longTerm':_0x18d7f9[_0xe3f3c1(0x7f)]('long-term')});return{'ok':!![],'data':_0xa7dbd6};}};function a30_0x44de(){const _0x3b7c8e=['\x20to\x20runtime\x20app\x20','appCode','description','trim','4390PcmnZg','download','27891TAoRvF','read','bool','filePath\x20is\x20required.','validation','10232YjvktL','string','query-url','843144JloqoE','build','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','File','6205470NNdAwT','body','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','7725431fzBpZD','filePath','2448490nbKeCb','2696348GCdCwm','POST','Preview:\x20upload\x20','filepath','Path\x20to\x20the\x20local\x20file\x20to\x20upload','path','/client/uploadFile','Uploaded\x20file:\x20','str','file','boolean','109opdzlD'];a30_0x44de=function(){return _0x3b7c8e;};return a30_0x44de();}export const fileDefinitions=[fileUpload,fileQueryUrl];
1
+ const a30_0x31de80=a30_0x5d56;(function(_0x7945d5,_0x5fd4b5){const _0x49ab92=a30_0x5d56,_0xf5ff25=_0x7945d5();while(!![]){try{const _0x200378=-parseInt(_0x49ab92(0x1da))/0x1+parseInt(_0x49ab92(0x1cc))/0x2*(-parseInt(_0x49ab92(0x1d4))/0x3)+parseInt(_0x49ab92(0x1d5))/0x4+-parseInt(_0x49ab92(0x1e9))/0x5*(-parseInt(_0x49ab92(0x1d9))/0x6)+-parseInt(_0x49ab92(0x1e4))/0x7+parseInt(_0x49ab92(0x1e1))/0x8+parseInt(_0x49ab92(0x1e7))/0x9*(parseInt(_0x49ab92(0x1d2))/0xa);if(_0x200378===_0x5fd4b5)break;else _0xf5ff25['push'](_0xf5ff25['shift']());}catch(_0x338781){_0xf5ff25['push'](_0xf5ff25['shift']());}}}(a30_0x53b8,0x42c49));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a30_0x53b8(){const _0x123e8c=['download','build','1391416szRsec','filePath','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','1887291sJwART','Path\x20to\x20the\x20local\x20file\x20to\x20upload','long-term','114993Xnoviw','upload','45CFojnc','query-url','path','body','filepath','string','File','filePath\x20is\x20required.','1832QKkWhF','boolean','str','bool','\x20to\x20runtime\x20app\x20','Preview:\x20upload\x20','230QQZNjj','/client/uploadFile','390lnKujk','970264mtTNJt','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','validation','file','77034zsnepi','163741JhvYSD','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','description','POST','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML'];a30_0x53b8=function(){return _0x123e8c;};return a30_0x53b8();}const FILE_FLAG={'name':'file','type':a30_0x31de80(0x1ee),'required':!![],'description':a30_0x31de80(0x1e5)},FILEPATH_FLAG={'name':a30_0x31de80(0x1ed),'type':'string','required':!![],'description':'Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data'},DOWNLOAD_FLAG={'name':'download','type':a30_0x31de80(0x1cd),'description':a30_0x31de80(0x1e3)},LONG_TERM_FLAG={'name':a30_0x31de80(0x1e6),'type':a30_0x31de80(0x1cd),'description':a30_0x31de80(0x1de)};function requireFilePath(_0x16aaeb){const _0x1b9e39=a30_0x31de80,_0x4e081b=_0x16aaeb['trim']();if(!_0x4e081b)throw CliErrors[_0x1b9e39(0x1d7)](_0x1b9e39(0x1f0));return _0x4e081b;}const fileUpload={'service':'file','command':a30_0x31de80(0x1e8),'description':a30_0x31de80(0x1db),'risk':'read','flags':[FILE_FLAG],async 'dryRun'(_0x2b0e43){const _0x124ee0=a30_0x31de80,_0x522e72=requireRuntimeUploadFile(_0x2b0e43[_0x124ee0(0x1ce)](_0x124ee0(0x1d8)),_0x124ee0(0x1ef));return dryRun(_0x124ee0(0x1dd),_0x124ee0(0x1d3))[_0x124ee0(0x1ec)]({'appCode':_0x2b0e43['appCode'],'multipart':{'file':_0x522e72}})[_0x124ee0(0x1dc)](_0x124ee0(0x1d1)+_0x522e72[_0x124ee0(0x1eb)]+_0x124ee0(0x1d0)+_0x2b0e43['appCode'])[_0x124ee0(0x1e0)]();},async 'execute'(_0x39a07d){const _0x528cc6=a30_0x31de80,_0x38073c=requireRuntimeUploadFile(_0x39a07d['str'](_0x528cc6(0x1d8)),_0x528cc6(0x1ef)),_0x3c53db=await uploadRuntimeFile(_0x39a07d['appCode'],_0x38073c[_0x528cc6(0x1eb)]);return{'ok':!![],'data':_0x3c53db,'message':_0x3c53db['filePath']?'Uploaded\x20file:\x20'+_0x3c53db[_0x528cc6(0x1e2)]+'.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.':_0x528cc6(0x1d6)};}},fileQueryUrl={'service':a30_0x31de80(0x1d8),'command':a30_0x31de80(0x1ea),'description':'Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x3bb3a0){const _0x3dfd22=a30_0x31de80,_0x45ba0e=requireFilePath(_0x3bb3a0[_0x3dfd22(0x1ce)](_0x3dfd22(0x1ed))),_0x19d278=await queryRuntimeFileUrl(_0x45ba0e,{'download':_0x3bb3a0[_0x3dfd22(0x1cf)](_0x3dfd22(0x1df)),'longTerm':_0x3bb3a0['bool'](_0x3dfd22(0x1e6))});return{'ok':!![],'data':_0x19d278};}};function a30_0x5d56(_0x3fb5b6,_0xde7ab1){_0x3fb5b6=_0x3fb5b6-0x1cc;const _0x53b8e0=a30_0x53b8();let _0x5d563e=_0x53b8e0[_0x3fb5b6];return _0x5d563e;}export const fileDefinitions=[fileUpload,fileQueryUrl];
@@ -1 +1 @@
1
- const a31_0x11f26a=a31_0x3800;(function(_0xdc09ed,_0x1b687c){const _0x4d7d85=a31_0x3800,_0x1a600d=_0xdc09ed();while(!![]){try{const _0x3cdaec=parseInt(_0x4d7d85(0x83))/0x1*(parseInt(_0x4d7d85(0xad))/0x2)+-parseInt(_0x4d7d85(0xa0))/0x3*(parseInt(_0x4d7d85(0x82))/0x4)+parseInt(_0x4d7d85(0xa8))/0x5*(parseInt(_0x4d7d85(0x9f))/0x6)+-parseInt(_0x4d7d85(0x8f))/0x7*(parseInt(_0x4d7d85(0x91))/0x8)+parseInt(_0x4d7d85(0x9d))/0x9*(parseInt(_0x4d7d85(0x9b))/0xa)+-parseInt(_0x4d7d85(0x86))/0xb+parseInt(_0x4d7d85(0x97))/0xc*(parseInt(_0x4d7d85(0x90))/0xd);if(_0x3cdaec===_0x1b687c)break;else _0x1a600d['push'](_0x1a600d['shift']());}catch(_0x593486){_0x1a600d['push'](_0x1a600d['shift']());}}}(a31_0x1924,0xe7101));import{existsSync,readFileSync}from'node:fs';function a31_0x3800(_0x16ab08,_0x1440fe){_0x16ab08=_0x16ab08-0x7e;const _0x19248d=a31_0x1924();let _0x380073=_0x19248d[_0x16ab08];return _0x380073;}import{resolve,isAbsolute}from'node:path';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const appImportFlagDefs=[{'name':a31_0x11f26a(0x80),'type':a31_0x11f26a(0x7f),'description':a31_0x11f26a(0x81),'required':!![]},{'name':a31_0x11f26a(0x96),'type':a31_0x11f26a(0x7f),'description':a31_0x11f26a(0x8c)},{'name':a31_0x11f26a(0x8b),'type':a31_0x11f26a(0x7f),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':'boolean','description':a31_0x11f26a(0x92)+PRODUCT_CONFIG['newConfigFileName']+a31_0x11f26a(0x93),'default':![]},{'name':a31_0x11f26a(0xab),'type':a31_0x11f26a(0x98),'description':a31_0x11f26a(0x85),'default':![]}];function a31_0x1924(){const _0x16b532=['12Hkvskz','boolean','parse','cwd','5090WHdEkM','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`.','9414NjFzRW','apps','12GvDmcP','21kpOqrW','log','Failed\x20to\x20parse\x20source\x20file:\x20','validation','Source\x20file\x20not\x20found:\x20','\x20\x20appcode:\x20','\x20\x20default:\x20','Imported\x20from\x20','907585XSPIrf','\x22.\x20Allowed:\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','yes','includes','14788qWWKoT','defaultApp','string','file','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','1061524vROIHK','13HWeCwf','global','Skip\x20confirmation\x20when\x20overwriting','12784783BcoNLc','app','project','message','entries','env','Override\x20imported\x20default\x20appcode','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','\x20\x20config:\x20\x20','7266448rzkOWk','52167011oIHQLG','8GErSnN','Write\x20to\x20global\x20(~/',')\x20instead\x20of\x20project','riskLevel','object','appcode'];a31_0x1924=function(){return _0x16b532;};return a31_0x1924();}export async function runAppImport(_0x1f72ee){const _0x3d33fc=a31_0x11f26a,_0x154f7c=_0x1f72ee[_0x3d33fc(0x84)]?'global':_0x3d33fc(0x88),_0x50cec9=resolveWriteConfigPath(_0x154f7c);await runFromImport(_0x1f72ee,_0x50cec9);}async function runFromImport(_0x25c85f,_0x4f4299){const _0x241f5a=a31_0x11f26a,_0x5c3282=resolveFilePath(_0x25c85f[_0x241f5a(0x80)]);if(!existsSync(_0x5c3282))throw CliErrors[_0x241f5a(0xa3)](_0x241f5a(0xa4)+_0x5c3282);const _0x40a662=readSourceFile(_0x5c3282),_0x1072d9=convertToRuntimeConfig(_0x40a662);_0x25c85f[_0x241f5a(0x96)]&&(_0x1072d9[_0x241f5a(0x96)]=String(_0x25c85f[_0x241f5a(0x96)]));_0x25c85f['env']&&(_0x1072d9[_0x241f5a(0x8b)]=resolveImportEnv(_0x25c85f));if(!_0x1072d9[_0x241f5a(0x96)])throw CliErrors[_0x241f5a(0xa3)](_0x241f5a(0x8d),_0x241f5a(0x9c));await writeImportConfig(_0x4f4299,_0x1072d9,_0x25c85f),console[_0x241f5a(0xa1)](_0x241f5a(0xa7)+_0x5c3282),console[_0x241f5a(0xa1)](_0x241f5a(0x8e)+_0x4f4299),console['log'](_0x241f5a(0xa5)+_0x1072d9[_0x241f5a(0x96)]);if(_0x1072d9[_0x241f5a(0x7e)])console[_0x241f5a(0xa1)](_0x241f5a(0xa6)+_0x1072d9[_0x241f5a(0x7e)]);}function convertToRuntimeConfig(_0x1a3b28){const _0x3e641b=a31_0x11f26a;if(_0x1a3b28[_0x3e641b(0x9e)]&&typeof _0x1a3b28[_0x3e641b(0x9e)]===_0x3e641b(0x95))throw CliErrors[_0x3e641b(0xa3)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x3e641b(0xaa));const _0x9a756f={};for(const _0x35c40c of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x1a3b28[_0x35c40c]!==undefined&&(_0x9a756f[_0x35c40c]=_0x1a3b28[_0x35c40c]);}return!_0x9a756f[_0x3e641b(0x94)]&&(_0x9a756f[_0x3e641b(0x94)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x9a756f;}async function writeImportConfig(_0x15925b,_0x216979,_0x207b91){const _0x6c0623=a31_0x11f26a;let _0x369be0={};existsSync(_0x15925b)&&!_0x207b91[_0x6c0623(0xab)]&&(_0x369be0=readConfigFile(_0x15925b));for(const [_0x421199,_0x4540ad]of Object[_0x6c0623(0x8a)](_0x216979)){_0x4540ad!==undefined&&(_0x369be0[_0x421199]=_0x4540ad);}if(_0x369be0[_0x6c0623(0x87)])delete _0x369be0[_0x6c0623(0x87)];writeConfigFile(_0x15925b,_0x369be0);}function resolveFilePath(_0x47299b){const _0x8525e1=a31_0x11f26a;return isAbsolute(_0x47299b)?_0x47299b:resolve(process[_0x8525e1(0x9a)](),_0x47299b);}function readSourceFile(_0x24d834){const _0x4b9311=a31_0x11f26a;try{const _0x2e80ab=readFileSync(_0x24d834,{'encoding':'utf8'});return JSON[_0x4b9311(0x99)](_0x2e80ab);}catch(_0x3634d3){throw CliErrors[_0x4b9311(0xa3)](_0x4b9311(0xa2)+_0x3634d3[_0x4b9311(0x89)]);}}function resolveImportEnv(_0x223634){const _0x53672e=a31_0x11f26a,_0x313170=_0x223634[_0x53672e(0x8b)];if(_0x313170===undefined||_0x313170==='')return DEFAULT_CONFIG_VALUES[_0x53672e(0x8b)];if(!RUNTIME_ENV_VALUES[_0x53672e(0xac)](_0x313170))throw CliErrors[_0x53672e(0xa3)]('Invalid\x20env\x20\x22'+_0x313170+_0x53672e(0xa9)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x313170;}
1
+ const a31_0x5acc5a=a31_0x4478;(function(_0x3ef435,_0x5cca6a){const _0x99ed39=a31_0x4478,_0x10c1d1=_0x3ef435();while(!![]){try{const _0x32cd3a=-parseInt(_0x99ed39(0xf8))/0x1+parseInt(_0x99ed39(0x10e))/0x2+parseInt(_0x99ed39(0xfb))/0x3*(-parseInt(_0x99ed39(0x10b))/0x4)+-parseInt(_0x99ed39(0x103))/0x5*(parseInt(_0x99ed39(0x10f))/0x6)+parseInt(_0x99ed39(0x114))/0x7+-parseInt(_0x99ed39(0xf6))/0x8+parseInt(_0x99ed39(0x102))/0x9;if(_0x32cd3a===_0x5cca6a)break;else _0x10c1d1['push'](_0x10c1d1['shift']());}catch(_0x52b4d8){_0x10c1d1['push'](_0x10c1d1['shift']());}}}(a31_0x3687,0x2da10));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';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';function a31_0x3687(){const _0x5958ce=['join','1174537PRuzCa','entries','includes','\x20\x20appcode:\x20','global','validation','log','utf8','newConfigFileName','project','Invalid\x20env\x20\x22','parse','cwd','apps','1722592ZEjfFD','file','269203LiJuSc','Override\x20imported\x20default\x20env','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','228ZhwiCq','Source\x20file\x20not\x20found:\x20','object','Skip\x20confirmation\x20when\x20overwriting','riskLevel','\x20\x20config:\x20\x20','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`.','7223760PDiolJ','50FOUtgb','string','yes','boolean','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','app','message','\x20\x20default:\x20','18028lJXdCm','appcode','\x22.\x20Allowed:\x20','252428zegngR','49614APQRXT','env','defaultApp','Write\x20to\x20global\x20(~/'];a31_0x3687=function(){return _0x5958ce;};return a31_0x3687();}import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const appImportFlagDefs=[{'name':'file','type':a31_0x5acc5a(0x104),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x5acc5a(0x10c),'type':a31_0x5acc5a(0x104),'description':'Override\x20imported\x20default\x20appcode'},{'name':a31_0x5acc5a(0x110),'type':a31_0x5acc5a(0x104),'description':a31_0x5acc5a(0xf9),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x5acc5a(0x118),'type':a31_0x5acc5a(0x106),'description':a31_0x5acc5a(0x112)+PRODUCT_CONFIG[a31_0x5acc5a(0x11c)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x5acc5a(0x105),'type':a31_0x5acc5a(0x106),'description':a31_0x5acc5a(0xfe),'default':![]}];export async function runAppImport(_0x2f1c10){const _0x4f6c01=a31_0x5acc5a,_0x471d38=_0x2f1c10[_0x4f6c01(0x118)]?_0x4f6c01(0x118):_0x4f6c01(0x11d),_0x2f6646=resolveWriteConfigPath(_0x471d38);await runFromImport(_0x2f1c10,_0x2f6646);}async function runFromImport(_0x47ad8a,_0x44ac6c){const _0x473a25=a31_0x5acc5a,_0x582998=resolveFilePath(_0x47ad8a[_0x473a25(0xf7)]);if(!existsSync(_0x582998))throw CliErrors[_0x473a25(0x119)](_0x473a25(0xfc)+_0x582998);const _0x346331=readSourceFile(_0x582998),_0x48efba=convertToRuntimeConfig(_0x346331);_0x47ad8a[_0x473a25(0x10c)]&&(_0x48efba[_0x473a25(0x10c)]=String(_0x47ad8a[_0x473a25(0x10c)]));_0x47ad8a[_0x473a25(0x110)]&&(_0x48efba[_0x473a25(0x110)]=resolveImportEnv(_0x47ad8a));if(!_0x48efba[_0x473a25(0x10c)])throw CliErrors[_0x473a25(0x119)](_0x473a25(0xfa),_0x473a25(0x101));await writeImportConfig(_0x44ac6c,_0x48efba,_0x47ad8a),console['log']('Imported\x20from\x20'+_0x582998),console[_0x473a25(0x11a)](_0x473a25(0x100)+_0x44ac6c),console[_0x473a25(0x11a)](_0x473a25(0x117)+_0x48efba[_0x473a25(0x10c)]);if(_0x48efba[_0x473a25(0x111)])console[_0x473a25(0x11a)](_0x473a25(0x10a)+_0x48efba[_0x473a25(0x111)]);}function convertToRuntimeConfig(_0x1a3e0e){const _0x3c9edc=a31_0x5acc5a;if(_0x1a3e0e['apps']&&typeof _0x1a3e0e[_0x3c9edc(0xf5)]===_0x3c9edc(0xfd))throw CliErrors[_0x3c9edc(0x119)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x3c9edc(0x107));const _0x589054={};for(const _0x56c399 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x1a3e0e[_0x56c399]!==undefined&&(_0x589054[_0x56c399]=_0x1a3e0e[_0x56c399]);}return!_0x589054[_0x3c9edc(0xff)]&&(_0x589054[_0x3c9edc(0xff)]=DEFAULT_CONFIG_VALUES[_0x3c9edc(0xff)]),_0x589054;}async function writeImportConfig(_0x1c0072,_0x123d95,_0x414785){const _0x571025=a31_0x5acc5a;let _0x18a2ee={};existsSync(_0x1c0072)&&!_0x414785[_0x571025(0x105)]&&(_0x18a2ee=readConfigFile(_0x1c0072));for(const [_0x2ba510,_0x1a3a47]of Object[_0x571025(0x115)](_0x123d95)){_0x1a3a47!==undefined&&(_0x18a2ee[_0x2ba510]=_0x1a3a47);}if(_0x18a2ee[_0x571025(0x108)])delete _0x18a2ee[_0x571025(0x108)];writeConfigFile(_0x1c0072,_0x18a2ee);}function resolveFilePath(_0x1dd8ec){const _0x37105d=a31_0x5acc5a;return isAbsolute(_0x1dd8ec)?_0x1dd8ec:resolve(process[_0x37105d(0xf4)](),_0x1dd8ec);}function a31_0x4478(_0x38fdfc,_0x35af14){_0x38fdfc=_0x38fdfc-0xf4;const _0x3687ca=a31_0x3687();let _0x44788c=_0x3687ca[_0x38fdfc];return _0x44788c;}function readSourceFile(_0x3e837a){const _0x89096a=a31_0x5acc5a;try{const _0x3335c3=readFileSync(_0x3e837a,{'encoding':_0x89096a(0x11b)});return JSON[_0x89096a(0x11f)](_0x3335c3);}catch(_0x1de286){throw CliErrors[_0x89096a(0x119)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x1de286[_0x89096a(0x109)]);}}function resolveImportEnv(_0x49232a){const _0x1e1de3=a31_0x5acc5a,_0x2ebe3e=_0x49232a['env'];if(_0x2ebe3e===undefined||_0x2ebe3e==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x1e1de3(0x116)](_0x2ebe3e))throw CliErrors[_0x1e1de3(0x119)](_0x1e1de3(0x11e)+_0x2ebe3e+_0x1e1de3(0x10d)+RUNTIME_ENV_VALUES[_0x1e1de3(0x113)](',\x20'));return _0x2ebe3e;}
@@ -1 +1 @@
1
- const a32_0x2d4647=a32_0x5421;(function(_0x45cf81,_0x4c08cb){const _0x5b831f=a32_0x5421,_0x2230e2=_0x45cf81();while(!![]){try{const _0x2619c5=parseInt(_0x5b831f(0xf7))/0x1+-parseInt(_0x5b831f(0xf9))/0x2+-parseInt(_0x5b831f(0xd9))/0x3*(-parseInt(_0x5b831f(0xda))/0x4)+parseInt(_0x5b831f(0xd6))/0x5*(-parseInt(_0x5b831f(0xbd))/0x6)+-parseInt(_0x5b831f(0xe2))/0x7*(-parseInt(_0x5b831f(0xc4))/0x8)+parseInt(_0x5b831f(0xfc))/0x9+-parseInt(_0x5b831f(0xe8))/0xa;if(_0x2619c5===_0x4c08cb)break;else _0x2230e2['push'](_0x2230e2['shift']());}catch(_0x567979){_0x2230e2['push'](_0x2230e2['shift']());}}}(a32_0xcfe4,0xa377b));function a32_0xcfe4(){const _0x1f7bc9=['把本地文件内容保存为个人知识库条目,并进入后续检索同步流程。','/client/knowledge-base/personal/','isFinite','update','Personal\x20knowledge-base\x20entry\x20ID','updateTime','query','detail','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','metadata','433217MMSKYz','file','1236388pwXrth','build','ragErrorMessage','9152748wcIXeU','content','12OiCuaH','/update','appCode','File\x20path\x20is\x20required.','search','score','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','8AMKcgf','Updated\x20KB\x20entry\x20','根据本地文件更新个人知识库条目','trim','POST','title','number','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','docId','validation','topk','verbose','body','用本地文件内容替换个人知识库条目正文,并触发新的检索同步。','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','list','userId','File\x20is\x20not\x20a\x20regular\x20file:\x20','396920xwRcFL','create','num','1461fummSD','1820xototA','createTime','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','Search\x20query\x20is\x20required.','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','/client/knowledge-base/personal/create','length','scope','3833627nXAbcR','Personal\x20knowledge-base\x20entry\x20title','bool','string','weightedScore','read','7729100nyNnvG','description','File\x20not\x20found:\x20','根据本地文件创建个人知识库条目','str'];a32_0xcfe4=function(){return _0x1f7bc9;};return a32_0xcfe4();}import{existsSync,readFileSync,statSync}from'node:fs';function a32_0x5421(_0xed0c7d,_0x3abd1c){_0xed0c7d=_0xed0c7d-0xbd;const _0xcfe4c9=a32_0xcfe4();let _0x5421a3=_0xcfe4c9[_0xed0c7d];return _0x5421a3;}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_0x2d4647(0xc9),'type':a32_0x2d4647(0xe5),'required':!![],'description':a32_0x2d4647(0xe3)},FILE_FLAG={'name':a32_0x2d4647(0xf8),'type':'string','required':!![],'description':a32_0x2d4647(0xdc)},QUERY_FLAG={'name':a32_0x2d4647(0xf3),'type':a32_0x2d4647(0xe5),'required':!![],'description':a32_0x2d4647(0xde)},TOPK_FLAG={'name':'topk','type':a32_0x2d4647(0xca),'description':a32_0x2d4647(0xd2)};function readKnowledgeFile(_0x18f231){const _0x38cb8c=a32_0x2d4647;if(!_0x18f231)throw CliErrors['validation'](_0x38cb8c(0xc0));if(!existsSync(_0x18f231))throw CliErrors['validation'](_0x38cb8c(0xea)+_0x18f231);if(!statSync(_0x18f231)['isFile']())throw CliErrors[_0x38cb8c(0xcd)](_0x38cb8c(0xd5)+_0x18f231);return readFileSync(_0x18f231,'utf8');}function summarizePersonalItem(_0x3d058a){const _0x5c7f7b=a32_0x2d4647;return{'id':_0x3d058a['id'],'title':_0x3d058a[_0x5c7f7b(0xc9)],'version':_0x3d058a['version'],'ragStatus':_0x3d058a['ragStatus'],'ragErrorMessage':_0x3d058a[_0x5c7f7b(0xfb)],'updateTime':_0x3d058a['updateTime']};}function detailPersonalItem(_0x120558){const _0x480243=a32_0x2d4647;return{'id':_0x120558['id'],'appCode':_0x120558[_0x480243(0xbf)],'scope':_0x120558['scope'],'userId':_0x120558[_0x480243(0xd4)],'title':_0x120558[_0x480243(0xc9)],'content':_0x120558[_0x480243(0xfd)]??'','version':_0x120558['version'],'ragStatus':_0x120558['ragStatus'],'ragErrorMessage':_0x120558[_0x480243(0xfb)],'createTime':_0x120558[_0x480243(0xdb)],'updateTime':_0x120558[_0x480243(0xf2)]};}function summarizeSearchHit(_0x2d9424){const _0x55c4af=a32_0x2d4647;return{'scope':_0x2d9424[_0x55c4af(0xe1)],'title':_0x2d9424['title'],'docId':_0x2d9424[_0x55c4af(0xcc)],'score':_0x2d9424[_0x55c4af(0xc2)],'weightedScore':_0x2d9424[_0x55c4af(0xe6)],'content':_0x2d9424[_0x55c4af(0xfd)],'metadata':_0x2d9424[_0x55c4af(0xf6)]};}function readTopK(_0x71827c){const _0x58d779=a32_0x2d4647,_0x1bfb63=_0x71827c['flag'](_0x58d779(0xce));if(_0x1bfb63===undefined||_0x1bfb63===null||_0x1bfb63==='')return undefined;const _0x83eeae=_0x71827c[_0x58d779(0xd8)](_0x58d779(0xce));if(!Number[_0x58d779(0xef)](_0x83eeae)||_0x83eeae<0x1)throw CliErrors[_0x58d779(0xcd)]('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0x83eeae;}const kbList={'service':'kb','command':a32_0x2d4647(0xd3),'description':a32_0x2d4647(0xc3),'risk':a32_0x2d4647(0xe7),'flags':[VERBOSE_FLAG],async 'execute'(_0x2f9f11){const _0x2eab53=a32_0x2d4647,_0x3f242a=await listPersonalKnowledgeBaseItems(_0x2f9f11[_0x2eab53(0xbf)]);if(_0x2f9f11[_0x2eab53(0xe4)](_0x2eab53(0xcf)))return{'ok':!![],'data':{'total':_0x3f242a['length'],'items':_0x3f242a}};return{'ok':!![],'data':{'total':_0x3f242a[_0x2eab53(0xe0)],'items':_0x3f242a['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x2d4647(0xf4),'description':'Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','risk':'read','flags':[{...ID_FLAG,'description':a32_0x2d4647(0xf1)}],async 'execute'(_0xfd4f99){const _0x719be=a32_0x2d4647,_0x5ca12e=await getPersonalKnowledgeBaseItem(_0xfd4f99[_0x719be(0xd8)]('id'),_0xfd4f99[_0x719be(0xbf)]);return{'ok':!![],'data':detailPersonalItem(_0x5ca12e)};}},kbCreate={'service':'kb','command':a32_0x2d4647(0xd7),'description':a32_0x2d4647(0xeb),'risk':'write','confirmationDescription':a32_0x2d4647(0xed),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x4e5249){const _0x28245b=a32_0x2d4647,_0x5ad6e3=_0x4e5249[_0x28245b(0xec)](_0x28245b(0xc9)),_0x2a8c7a=readKnowledgeFile(_0x4e5249['str'](_0x28245b(0xf8))),_0x962f7d=await createPersonalKnowledgeBaseItem(_0x4e5249[_0x28245b(0xbf)],{'title':_0x5ad6e3,'content':_0x2a8c7a});return{'ok':!![],'data':summarizePersonalItem(_0x962f7d),'message':'Created\x20KB\x20entry\x20'+_0x962f7d['id']+'\x20('+_0x962f7d['title']+')'};},async 'dryRun'(_0x4364e8){const _0x3d7ddf=a32_0x2d4647,_0x272dd3=_0x4364e8[_0x3d7ddf(0xec)](_0x3d7ddf(0xc9)),_0x1309ca=readKnowledgeFile(_0x4364e8[_0x3d7ddf(0xec)](_0x3d7ddf(0xf8)));return dryRun(_0x3d7ddf(0xc8),_0x3d7ddf(0xdf))[_0x3d7ddf(0xd0)]({'appCode':_0x4364e8[_0x3d7ddf(0xbf)],'title':_0x272dd3,'content':_0x1309ca})[_0x3d7ddf(0xe9)]('Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22'+_0x272dd3+'\x22')[_0x3d7ddf(0xfa)]();}},kbUpdate={'service':'kb','command':a32_0x2d4647(0xf0),'description':a32_0x2d4647(0xc6),'risk':'write','confirmationDescription':a32_0x2d4647(0xd1),'flags':[{...ID_FLAG,'description':a32_0x2d4647(0xf1)},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x172160){const _0x3dfbaf=a32_0x2d4647,_0x3e4676=_0x172160['num']('id'),_0x3fcb48=readKnowledgeFile(_0x172160[_0x3dfbaf(0xec)](_0x3dfbaf(0xf8))),_0x1b8a9c=_0x172160[_0x3dfbaf(0xec)](_0x3dfbaf(0xc9))||(await getPersonalKnowledgeBaseItem(_0x3e4676,_0x172160[_0x3dfbaf(0xbf)]))['title'],_0x255237=await updatePersonalKnowledgeBaseItem(_0x3e4676,_0x172160[_0x3dfbaf(0xbf)],{'title':_0x1b8a9c,'content':_0x3fcb48});return{'ok':!![],'data':summarizePersonalItem(_0x255237),'message':_0x3dfbaf(0xc5)+_0x255237['id']+'\x20('+_0x255237[_0x3dfbaf(0xc9)]+')'};},async 'dryRun'(_0x2fbc06){const _0x5d349a=a32_0x2d4647,_0x4899ec=_0x2fbc06['num']('id'),_0x155ac3=readKnowledgeFile(_0x2fbc06[_0x5d349a(0xec)]('file')),_0x580bbe=_0x2fbc06[_0x5d349a(0xec)]('title')||(await getPersonalKnowledgeBaseItem(_0x4899ec,_0x2fbc06[_0x5d349a(0xbf)]))['title'];return dryRun(_0x5d349a(0xc8),_0x5d349a(0xee)+_0x4899ec+_0x5d349a(0xbe))[_0x5d349a(0xd0)]({'appCode':_0x2fbc06['appCode'],'title':_0x580bbe,'content':_0x155ac3})[_0x5d349a(0xe9)](_0x5d349a(0xf5)+_0x4899ec)[_0x5d349a(0xfa)]();}},kbSearch={'service':'kb','command':a32_0x2d4647(0xc1),'description':a32_0x2d4647(0xcb),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x444fbe){const _0x3c1fab=a32_0x2d4647;if(!_0x444fbe['str'](_0x3c1fab(0xf3))[_0x3c1fab(0xc7)]())throw CliErrors[_0x3c1fab(0xcd)](_0x3c1fab(0xdd));readTopK(_0x444fbe);},async 'execute'(_0x464ab8){const _0x5f4efe=a32_0x2d4647,_0x46647=_0x464ab8[_0x5f4efe(0xec)]('query')[_0x5f4efe(0xc7)](),_0x5b438e=readTopK(_0x464ab8),_0x36383c=await searchKnowledgeBase(_0x464ab8[_0x5f4efe(0xbf)],{'query':_0x46647,'topK':_0x5b438e});return{'ok':!![],'data':{'total':_0x36383c[_0x5f4efe(0xe0)],'hits':_0x36383c['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
1
+ const a32_0x19bdd7=a32_0x114b;(function(_0x4491c8,_0x3ec474){const _0x4b0750=a32_0x114b,_0x1f6fb6=_0x4491c8();while(!![]){try{const _0x39634a=-parseInt(_0x4b0750(0x116))/0x1*(parseInt(_0x4b0750(0x128))/0x2)+-parseInt(_0x4b0750(0x13b))/0x3+parseInt(_0x4b0750(0x137))/0x4*(-parseInt(_0x4b0750(0x139))/0x5)+parseInt(_0x4b0750(0x145))/0x6*(-parseInt(_0x4b0750(0x144))/0x7)+parseInt(_0x4b0750(0x133))/0x8+parseInt(_0x4b0750(0x127))/0x9*(-parseInt(_0x4b0750(0x135))/0xa)+parseInt(_0x4b0750(0x138))/0xb*(parseInt(_0x4b0750(0x140))/0xc);if(_0x39634a===_0x3ec474)break;else _0x1f6fb6['push'](_0x1f6fb6['shift']());}catch(_0x4f2a30){_0x1f6fb6['push'](_0x1f6fb6['shift']());}}}(a32_0x2521,0x25003));function a32_0x2521(){const _0x327809=['read','/update','Search\x20query\x20is\x20required.','isFinite','file','docId','Updated\x20KB\x20entry\x20','score','POST','152839gBglJj','write','query','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','utf8','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','build','length','Personal\x20knowledge-base\x20entry\x20ID','description','create','ragErrorMessage','--topk\x20must\x20be\x20a\x20positive\x20number.','ragStatus','body','title','createTime','99AKtRFf','2dSDRvn','detail','list','File\x20not\x20found:\x20','number','weightedScore','根据本地文件更新个人知识库条目','appCode','File\x20path\x20is\x20required.','Created\x20KB\x20entry\x20','search','924032BLmoRh','str','106300fvUPTr','/client/knowledge-base/personal/','265356ojPPvv','4147mbXHse','10vnQsKl','map','537855nAarFH','version','bool','string','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','28416pqrSLz','Override\x20the\x20existing\x20entry\x20title','topk','Personal\x20knowledge-base\x20entry\x20title','49bXwsOm','235674bWvlFG','updateTime','trim','num','update','validation','/client/knowledge-base/personal/create','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','flag'];a32_0x2521=function(){return _0x327809;};return a32_0x2521();}function a32_0x114b(_0x121799,_0x598c4b){_0x121799=_0x121799-0x115;const _0x2521eb=a32_0x2521();let _0x114b08=_0x2521eb[_0x121799];return _0x114b08;}import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x19bdd7(0x125),'type':a32_0x19bdd7(0x13e),'required':!![],'description':a32_0x19bdd7(0x143)},FILE_FLAG={'name':a32_0x19bdd7(0x152),'type':a32_0x19bdd7(0x13e),'required':!![],'description':a32_0x19bdd7(0x14c)},QUERY_FLAG={'name':'query','type':a32_0x19bdd7(0x13e),'required':!![],'description':a32_0x19bdd7(0x11b)},TOPK_FLAG={'name':'topk','type':a32_0x19bdd7(0x12c),'description':'Maximum\x20number\x20of\x20search\x20hits\x20to\x20return'};function readKnowledgeFile(_0x470724){const _0x47b2f4=a32_0x19bdd7;if(!_0x470724)throw CliErrors['validation'](_0x47b2f4(0x130));if(!existsSync(_0x470724))throw CliErrors[_0x47b2f4(0x14a)](_0x47b2f4(0x12b)+_0x470724);if(!statSync(_0x470724)['isFile']())throw CliErrors[_0x47b2f4(0x14a)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x470724);return readFileSync(_0x470724,_0x47b2f4(0x11a));}function summarizePersonalItem(_0x4d0688){const _0x1e60db=a32_0x19bdd7;return{'id':_0x4d0688['id'],'title':_0x4d0688[_0x1e60db(0x125)],'version':_0x4d0688[_0x1e60db(0x13c)],'ragStatus':_0x4d0688[_0x1e60db(0x123)],'ragErrorMessage':_0x4d0688[_0x1e60db(0x121)],'updateTime':_0x4d0688[_0x1e60db(0x146)]};}function detailPersonalItem(_0x33936){const _0x418e91=a32_0x19bdd7;return{'id':_0x33936['id'],'appCode':_0x33936[_0x418e91(0x12f)],'scope':_0x33936['scope'],'userId':_0x33936['userId'],'title':_0x33936[_0x418e91(0x125)],'content':_0x33936['content']??'','version':_0x33936[_0x418e91(0x13c)],'ragStatus':_0x33936[_0x418e91(0x123)],'ragErrorMessage':_0x33936[_0x418e91(0x121)],'createTime':_0x33936[_0x418e91(0x126)],'updateTime':_0x33936['updateTime']};}function summarizeSearchHit(_0x4e2bc2){const _0x1b6d0a=a32_0x19bdd7;return{'scope':_0x4e2bc2['scope'],'title':_0x4e2bc2['title'],'docId':_0x4e2bc2[_0x1b6d0a(0x153)],'score':_0x4e2bc2[_0x1b6d0a(0x155)],'weightedScore':_0x4e2bc2[_0x1b6d0a(0x12d)],'content':_0x4e2bc2['content'],'metadata':_0x4e2bc2['metadata']};}function readTopK(_0x986b2a){const _0x75bb40=a32_0x19bdd7,_0x33852e=_0x986b2a[_0x75bb40(0x14d)](_0x75bb40(0x142));if(_0x33852e===undefined||_0x33852e===null||_0x33852e==='')return undefined;const _0x2bf384=_0x986b2a['num']('topk');if(!Number[_0x75bb40(0x151)](_0x2bf384)||_0x2bf384<0x1)throw CliErrors[_0x75bb40(0x14a)](_0x75bb40(0x122));return _0x2bf384;}const kbList={'service':'kb','command':a32_0x19bdd7(0x12a),'description':a32_0x19bdd7(0x13f),'risk':a32_0x19bdd7(0x14e),'flags':[VERBOSE_FLAG],async 'execute'(_0x72058){const _0x565639=a32_0x19bdd7,_0x419433=await listPersonalKnowledgeBaseItems(_0x72058[_0x565639(0x12f)]);if(_0x72058[_0x565639(0x13d)]('verbose'))return{'ok':!![],'data':{'total':_0x419433[_0x565639(0x11d)],'items':_0x419433}};return{'ok':!![],'data':{'total':_0x419433['length'],'items':_0x419433[_0x565639(0x13a)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x19bdd7(0x129),'description':a32_0x19bdd7(0x119),'risk':a32_0x19bdd7(0x14e),'flags':[{...ID_FLAG,'description':a32_0x19bdd7(0x11e)}],async 'execute'(_0x30a13c){const _0xfea1d7=a32_0x19bdd7,_0x8460cd=await getPersonalKnowledgeBaseItem(_0x30a13c[_0xfea1d7(0x148)]('id'),_0x30a13c[_0xfea1d7(0x12f)]);return{'ok':!![],'data':detailPersonalItem(_0x8460cd)};}},kbCreate={'service':'kb','command':a32_0x19bdd7(0x120),'description':'根据本地文件创建个人知识库条目','risk':a32_0x19bdd7(0x117),'confirmationDescription':'把本地文件内容保存为个人知识库条目,并进入后续检索同步流程。','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x51409e){const _0x50a156=a32_0x19bdd7,_0x2c0670=_0x51409e[_0x50a156(0x134)]('title'),_0x428e68=readKnowledgeFile(_0x51409e[_0x50a156(0x134)](_0x50a156(0x152))),_0x1cc248=await createPersonalKnowledgeBaseItem(_0x51409e[_0x50a156(0x12f)],{'title':_0x2c0670,'content':_0x428e68});return{'ok':!![],'data':summarizePersonalItem(_0x1cc248),'message':_0x50a156(0x131)+_0x1cc248['id']+'\x20('+_0x1cc248[_0x50a156(0x125)]+')'};},async 'dryRun'(_0x32d463){const _0x32d6e2=a32_0x19bdd7,_0x2729ed=_0x32d463[_0x32d6e2(0x134)](_0x32d6e2(0x125)),_0x41eed3=readKnowledgeFile(_0x32d463[_0x32d6e2(0x134)](_0x32d6e2(0x152)));return dryRun(_0x32d6e2(0x115),_0x32d6e2(0x14b))[_0x32d6e2(0x124)]({'appCode':_0x32d463[_0x32d6e2(0x12f)],'title':_0x2729ed,'content':_0x41eed3})[_0x32d6e2(0x11f)]('Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22'+_0x2729ed+'\x22')[_0x32d6e2(0x11c)]();}},kbUpdate={'service':'kb','command':a32_0x19bdd7(0x149),'description':a32_0x19bdd7(0x12e),'risk':a32_0x19bdd7(0x117),'confirmationDescription':'用本地文件内容替换个人知识库条目正文,并触发新的检索同步。','flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'},{...TITLE_FLAG,'required':![],'description':a32_0x19bdd7(0x141)},FILE_FLAG],async 'execute'(_0xdb9b06){const _0x267784=a32_0x19bdd7,_0x5203aa=_0xdb9b06[_0x267784(0x148)]('id'),_0x4d1a04=readKnowledgeFile(_0xdb9b06[_0x267784(0x134)](_0x267784(0x152))),_0x3941cb=_0xdb9b06[_0x267784(0x134)](_0x267784(0x125))||(await getPersonalKnowledgeBaseItem(_0x5203aa,_0xdb9b06['appCode']))[_0x267784(0x125)],_0x3b8b01=await updatePersonalKnowledgeBaseItem(_0x5203aa,_0xdb9b06[_0x267784(0x12f)],{'title':_0x3941cb,'content':_0x4d1a04});return{'ok':!![],'data':summarizePersonalItem(_0x3b8b01),'message':_0x267784(0x154)+_0x3b8b01['id']+'\x20('+_0x3b8b01[_0x267784(0x125)]+')'};},async 'dryRun'(_0x118640){const _0x3e9956=a32_0x19bdd7,_0x3cfa93=_0x118640[_0x3e9956(0x148)]('id'),_0x48cbd0=readKnowledgeFile(_0x118640['str']('file')),_0x1c4773=_0x118640['str']('title')||(await getPersonalKnowledgeBaseItem(_0x3cfa93,_0x118640[_0x3e9956(0x12f)]))[_0x3e9956(0x125)];return dryRun(_0x3e9956(0x115),_0x3e9956(0x136)+_0x3cfa93+_0x3e9956(0x14f))['body']({'appCode':_0x118640[_0x3e9956(0x12f)],'title':_0x1c4773,'content':_0x48cbd0})['description']('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x3cfa93)[_0x3e9956(0x11c)]();}},kbSearch={'service':'kb','command':a32_0x19bdd7(0x132),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x15282a){const _0xd8956a=a32_0x19bdd7;if(!_0x15282a[_0xd8956a(0x134)](_0xd8956a(0x118))[_0xd8956a(0x147)]())throw CliErrors['validation'](_0xd8956a(0x150));readTopK(_0x15282a);},async 'execute'(_0x31c3ac){const _0x2d1f88=a32_0x19bdd7,_0x4fd54c=_0x31c3ac['str'](_0x2d1f88(0x118))[_0x2d1f88(0x147)](),_0xfc8fc7=readTopK(_0x31c3ac),_0x113c87=await searchKnowledgeBase(_0x31c3ac[_0x2d1f88(0x12f)],{'query':_0x4fd54c,'topK':_0xfc8fc7});return{'ok':!![],'data':{'total':_0x113c87[_0x2d1f88(0x11d)],'hits':_0x113c87['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
@@ -1,20 +1,14 @@
1
1
  /**
2
- * @fileoverview `logs` command definitions — show and clear command history.
2
+ * @fileoverview `logs` command definition — show command history.
3
3
  *
4
4
  * Why a separate logger module: Lovrabet Runtime CLI uses Winston to write
5
5
  * structured JSON logs to `.lovrabet-runtime.log`. The `logs` command provides
6
6
  * a human-readable view of this file (formatted output with icons, timestamps)
7
- * and a way to clear it.
7
+ * as a read-only diagnostic view.
8
8
  *
9
9
  * Why `printLogs` is a standalone function: it formats the raw log entries
10
10
  * into a human-readable report. Keeping it separate from the command definition
11
11
  * makes it easier to test the formatting logic independently.
12
- *
13
- * Design decision: `logs show` and `logs clear` both use `risk: "read"` and
14
- * `"write"` respectively. `logs clear` is `"write"` because it modifies the
15
- * log file on disk. However, it does NOT require `--yes` even in CI because
16
- * clearing logs is not a data-modifying operation in the Lovrabet sense —
17
- * it only affects the local diagnostic file.
18
12
  */
19
13
  import type { CommandDefinition } from "../../framework/types.js";
20
14
  export declare const logsDefinitions: CommandDefinition[];
@@ -1 +1 @@
1
- const a33_0x1171d8=a33_0x340a;function a33_0x3d21(){const _0x25fc08=['\x20\x20\x20Time:\x20','750726phcKZY','message','forEach','将永久清空当前工作目录下的\x20Lovrabet\x20CLI\x20本地诊断日志;不会影响平台业务数据。','1710zkKpAy','*\x20No\x20logs\x20found','312dQRhcL','\x20logs:\x0a','409509TVHLTO','level','\x20\x20\x20Details:\x20','*\x20Logs\x20cleared','26719bOktBp','log','clear','2246656tZhixC','toLocaleString','277833DFlPJq','en-US','error','95ImoGNY','read','86436TDCmBb','readLogs','success','清除命令历史日志','28237ZHdOQT','keys','length','\x20\x20\x20Duration:\x20','4GXKZfP','details','command','show','timestamp','logs'];a33_0x3d21=function(){return _0x25fc08;};return a33_0x3d21();}(function(_0x382595,_0x46be1d){const _0x1dab54=a33_0x340a,_0x250a64=_0x382595();while(!![]){try{const _0xa0683b=parseInt(_0x1dab54(0x72))/0x1+parseInt(_0x1dab54(0x88))/0x2*(-parseInt(_0x1dab54(0x7b))/0x3)+parseInt(_0x1dab54(0x80))/0x4*(-parseInt(_0x1dab54(0x7e))/0x5)+-parseInt(_0x1dab54(0x70))/0x6*(parseInt(_0x1dab54(0x76))/0x7)+parseInt(_0x1dab54(0x79))/0x8+parseInt(_0x1dab54(0x8f))/0x9+parseInt(_0x1dab54(0x93))/0xa*(parseInt(_0x1dab54(0x84))/0xb);if(_0xa0683b===_0x46be1d)break;else _0x250a64['push'](_0x250a64['shift']());}catch(_0x3eb9ba){_0x250a64['push'](_0x250a64['shift']());}}}(a33_0x3d21,0x66283));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x21c4c0){const _0x3978d9=a33_0x340a;if(_0x21c4c0[_0x3978d9(0x86)]===0x0){console[_0x3978d9(0x77)](_0x3978d9(0x6f));return;}console[_0x3978d9(0x77)]('*\x20'+CLI_DISPLAY_NAME+_0x3978d9(0x71)),_0x21c4c0[_0x3978d9(0x91)]((_0x3bb833,_0x537d12)=>{const _0x3cb724=_0x3978d9,_0x1e349b=new Date(_0x3bb833[_0x3cb724(0x8c)])[_0x3cb724(0x7a)](_0x3cb724(0x7c)),_0x7761e=_0x3bb833['level']===_0x3cb724(0x82)?'√':_0x3bb833[_0x3cb724(0x73)]===_0x3cb724(0x7d)?'×':_0x3bb833['level']==='warn'?'!':'i';console['log'](_0x537d12+0x1+'.\x20'+_0x7761e+'\x20['+_0x3bb833[_0x3cb724(0x8a)]+']\x20'+_0x3bb833[_0x3cb724(0x90)]),console[_0x3cb724(0x77)](_0x3cb724(0x8e)+_0x1e349b),_0x3bb833['duration']&&console[_0x3cb724(0x77)](_0x3cb724(0x87)+_0x3bb833['duration']+'ms'),_0x3bb833[_0x3cb724(0x89)]&&Object[_0x3cb724(0x85)](_0x3bb833['details'])[_0x3cb724(0x86)]>0x0&&console['log'](_0x3cb724(0x74)+JSON['stringify'](_0x3bb833['details'],null,0x2)),console[_0x3cb724(0x77)]('');});}function a33_0x340a(_0x516e2a,_0x1a4b02){_0x516e2a=_0x516e2a-0x6f;const _0x3d212c=a33_0x3d21();let _0x340a45=_0x3d212c[_0x516e2a];return _0x340a45;}export const logsDefinitions=[{'service':'logs','command':a33_0x1171d8(0x8b),'description':'View\x20command\x20history\x20logs','risk':a33_0x1171d8(0x7f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3ee25d){const _0x383b6f=a33_0x1171d8;return printLogs(logger[_0x383b6f(0x81)]()),{'ok':!![]};}},{'service':a33_0x1171d8(0x8d),'command':a33_0x1171d8(0x78),'description':a33_0x1171d8(0x83),'risk':'write','confirmationDescription':a33_0x1171d8(0x92),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x19983b){const _0xfb946=a33_0x1171d8;return logger['clearLogs'](),console[_0xfb946(0x77)](_0xfb946(0x75)),{'ok':!![]};}}];
1
+ const a33_0x898175=a33_0x57d8;(function(_0x352b3c,_0x581196){const _0x313cb9=a33_0x57d8,_0x3972e8=_0x352b3c();while(!![]){try{const _0x2c39fe=-parseInt(_0x313cb9(0xbf))/0x1*(parseInt(_0x313cb9(0xcd))/0x2)+parseInt(_0x313cb9(0xc8))/0x3+-parseInt(_0x313cb9(0xc7))/0x4+parseInt(_0x313cb9(0xc0))/0x5+parseInt(_0x313cb9(0xb9))/0x6+parseInt(_0x313cb9(0xc4))/0x7+parseInt(_0x313cb9(0xbd))/0x8;if(_0x2c39fe===_0x581196)break;else _0x3972e8['push'](_0x3972e8['shift']());}catch(_0x931393){_0x3972e8['push'](_0x3972e8['shift']());}}}(a33_0x2855,0x2ccc7));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a33_0x57d8(_0x567d47,_0x48d770){_0x567d47=_0x567d47-0xb5;const _0x2855ae=a33_0x2855();let _0x57d80f=_0x2855ae[_0x567d47];return _0x57d80f;}function a33_0x2855(){const _0x3cfd08=['log','toLocaleString','251896WeTVIh','47787rjopvD','command','duration','timestamp','View\x20command\x20history\x20logs','2URBpLC','read','success','readLogs','details','logs','en-US','length','1309644fWbPdj','forEach','\x20\x20\x20Duration:\x20','keys','1764064VqvgxC','\x20\x20\x20Time:\x20','318337JGVKAu','234185HmmIJs','error','*\x20No\x20logs\x20found','level','442806nMAsxE'];a33_0x2855=function(){return _0x3cfd08;};return a33_0x2855();}function printLogs(_0x2cf70d){const _0x2b867f=a33_0x57d8;if(_0x2cf70d[_0x2b867f(0xb8)]===0x0){console[_0x2b867f(0xc5)](_0x2b867f(0xc2));return;}console[_0x2b867f(0xc5)]('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x2cf70d[_0x2b867f(0xba)]((_0x39b42d,_0x1188bf)=>{const _0x3e9bc0=_0x2b867f,_0x3b8fe4=new Date(_0x39b42d[_0x3e9bc0(0xcb)])[_0x3e9bc0(0xc6)](_0x3e9bc0(0xb7)),_0x4ae4d6=_0x39b42d['level']===_0x3e9bc0(0xcf)?'√':_0x39b42d[_0x3e9bc0(0xc3)]===_0x3e9bc0(0xc1)?'×':_0x39b42d['level']==='warn'?'!':'i';console[_0x3e9bc0(0xc5)](_0x1188bf+0x1+'.\x20'+_0x4ae4d6+'\x20['+_0x39b42d[_0x3e9bc0(0xc9)]+']\x20'+_0x39b42d['message']),console[_0x3e9bc0(0xc5)](_0x3e9bc0(0xbe)+_0x3b8fe4),_0x39b42d['duration']&&console[_0x3e9bc0(0xc5)](_0x3e9bc0(0xbb)+_0x39b42d[_0x3e9bc0(0xca)]+'ms'),_0x39b42d['details']&&Object[_0x3e9bc0(0xbc)](_0x39b42d[_0x3e9bc0(0xb5)])[_0x3e9bc0(0xb8)]>0x0&&console[_0x3e9bc0(0xc5)]('\x20\x20\x20Details:\x20'+JSON['stringify'](_0x39b42d[_0x3e9bc0(0xb5)],null,0x2)),console['log']('');});}export const logsDefinitions=[{'service':a33_0x898175(0xb6),'command':'show','description':a33_0x898175(0xcc),'risk':a33_0x898175(0xce),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x48645a){const _0x1252a4=a33_0x898175;return printLogs(logger[_0x1252a4(0xd0)]()),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a34_0x365baf=a34_0x390f;(function(_0x5aec4d,_0x261c63){const _0x23e3ec=a34_0x390f,_0x1c5b60=_0x5aec4d();while(!![]){try{const _0x38338b=-parseInt(_0x23e3ec(0xe2))/0x1+-parseInt(_0x23e3ec(0xdc))/0x2*(-parseInt(_0x23e3ec(0x10c))/0x3)+-parseInt(_0x23e3ec(0xf2))/0x4*(-parseInt(_0x23e3ec(0xd3))/0x5)+parseInt(_0x23e3ec(0xf0))/0x6+parseInt(_0x23e3ec(0x10a))/0x7*(parseInt(_0x23e3ec(0xf6))/0x8)+-parseInt(_0x23e3ec(0xf3))/0x9*(-parseInt(_0x23e3ec(0xfd))/0xa)+parseInt(_0x23e3ec(0xef))/0xb*(-parseInt(_0x23e3ec(0x108))/0xc);if(_0x38338b===_0x261c63)break;else _0x1c5b60['push'](_0x1c5b60['shift']());}catch(_0x536c10){_0x1c5b60['push'](_0x1c5b60['shift']());}}}(a34_0x206b,0xd0a2e));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_0x365baf(0xde),'general',a34_0x365baf(0xd4),a34_0x365baf(0xf8)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x365baf(0xe0),'general':a34_0x365baf(0xd5),'form':a34_0x365baf(0x102),'idCard':'IdCard'},SCENE_FLAG={'name':'scene','type':a34_0x365baf(0xd8),'required':!![],'enum':[...SUPPORTED_SCENES],'description':'OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard'},IMAGE_FILE_FLAG={'name':a34_0x365baf(0xd2),'type':a34_0x365baf(0xd8),'description':a34_0x365baf(0x106)},IMAGE_URL_FLAG={'name':a34_0x365baf(0x104),'type':a34_0x365baf(0xd8),'description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x5b6819){const _0x46dbe4=a34_0x365baf,_0x2421c6=_0x5b6819[_0x46dbe4(0xee)]()[_0x46dbe4(0xe5)]();if(_0x2421c6===_0x46dbe4(0xe1))return _0x46dbe4(0xf8);if(_0x2421c6==='invoice'||_0x2421c6===_0x46dbe4(0xfb)||_0x2421c6===_0x46dbe4(0xd4))return _0x2421c6;throw CliErrors['validation'](_0x46dbe4(0xfe)+_0x5b6819+'.\x20Supported\x20scenes:\x20'+SUPPORTED_SCENES[_0x46dbe4(0x101)](',\x20'));}function selectedInputs(_0x4fd5a1){const _0xc4c3e9=a34_0x365baf,_0x1c434b=_0x4fd5a1[_0xc4c3e9(0xf7)]('image-file')[_0xc4c3e9(0xee)](),_0x425bde=_0x4fd5a1[_0xc4c3e9(0xf7)](_0xc4c3e9(0x104))[_0xc4c3e9(0xee)]();return{'imageFile':_0x1c434b,'imageUrl':_0x425bde,'count':[_0x1c434b,_0x425bde][_0xc4c3e9(0x10d)](Boolean)[_0xc4c3e9(0x100)]};}function a34_0x390f(_0x111a2a,_0x1225ed){_0x111a2a=_0x111a2a-0xd2;const _0x206bda=a34_0x206b();let _0x390ff7=_0x206bda[_0x111a2a];return _0x390ff7;}function validateInputSelection(_0x383396){const _0x4ec788=a34_0x365baf,_0x2d9b5a=selectedInputs(_0x383396);if(_0x2d9b5a[_0x4ec788(0xdf)]!==0x1)throw CliErrors[_0x4ec788(0xe7)](_0x4ec788(0xda));return _0x2d9b5a;}function a34_0x206b(){const _0x1f5279=['480571CsoFXP','\x20OCR\x20from\x20URL','3398874mHrLwo','filter','image-file','5906045PWSkzt','form','General','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','build','string','apiError','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','/client/queryFileUrl','2NuuFbU','File\x20URL\x20response\x20missing\x20fileUrl.','invoice','count','Invoice','idcard','21099HjshIm','path','File\x20upload\x20response\x20missing\x20filePath.','toLowerCase','使用运行态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','validation','\x20OCR','appCode','POST','description','fileName','/client/uploadFile','trim','152317fsRDNN','4396362roNNEk','body','4abtJok','18xXfWVA','ocr','imageFile','56XRPPRn','str','idCard','imageUrl','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','general','filePath','5434490eawElu','Unsupported\x20OCR\x20scene:\x20','fileUrl','length','join','Table','scene','image-url','<filePath\x20returned\x20by\x20/client/uploadFile>','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','read','3240JUrEmC','/client/ocr'];a34_0x206b=function(){return _0x1f5279;};return a34_0x206b();}function withScene(_0x4c5d49,_0x40c0fa,_0x2e3f4c){const _0x1a2f96=a34_0x365baf;return{..._0x4c5d49,'scene':_0x40c0fa,..._0x2e3f4c?{'sourceFile':{'fileName':_0x2e3f4c[_0x1a2f96(0xec)],'filePath':_0x2e3f4c[_0x1a2f96(0xfc)]}}:{}};}const ocrRecognize={'service':a34_0x365baf(0xf4),'command':'recognize','description':a34_0x365baf(0xe6),'risk':a34_0x365baf(0x107),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x36b34f){const _0x433a46=a34_0x365baf,_0x454ae8=normalizeScene(_0x36b34f['str'](_0x433a46(0x103))),_0x25825c=SCENE_TO_LEGACY_TYPE[_0x454ae8],_0x522ee2=validateInputSelection(_0x36b34f);if(_0x522ee2[_0x433a46(0xf9)])return dryRun(_0x433a46(0xea),'/client/ocr')[_0x433a46(0xf1)]({'appCode':_0x36b34f[_0x433a46(0xe9)],'url':_0x522ee2[_0x433a46(0xf9)],'type':_0x25825c})[_0x433a46(0xeb)]('Preview:\x20recognize\x20'+_0x454ae8+_0x433a46(0x10b))[_0x433a46(0xd7)]();const _0x29ccfd=requireRuntimeUploadFile(_0x522ee2[_0x433a46(0xf5)],_0x433a46(0xd2));return dryRun(_0x433a46(0xea),'/client/uploadFile')[_0x433a46(0xf1)]({'steps':[{'method':_0x433a46(0xea),'url':_0x433a46(0xed),'body':{'appCode':_0x36b34f['appCode'],'multipart':{'file':_0x29ccfd}}},{'method':_0x433a46(0xea),'url':_0x433a46(0xdb),'body':{'filePath':_0x433a46(0x105),'downloadFlag':![]}},{'method':'POST','url':_0x433a46(0x109),'body':{'appCode':_0x36b34f[_0x433a46(0xe9)],'url':_0x433a46(0xfa),'type':_0x25825c}}]})[_0x433a46(0xeb)](_0x433a46(0xd6)+_0x454ae8+_0x433a46(0xe8))['build']();},async 'execute'(_0x1c1ddb){const _0x462a4a=a34_0x365baf,_0x3e80af=normalizeScene(_0x1c1ddb[_0x462a4a(0xf7)](_0x462a4a(0x103))),_0x1fa4fb=SCENE_TO_LEGACY_TYPE[_0x3e80af],_0x3ef9c4=validateInputSelection(_0x1c1ddb);if(_0x3ef9c4[_0x462a4a(0xf9)]){const _0x3337e8=await recognizeRuntimeOcr(_0x1c1ddb[_0x462a4a(0xe9)],{'url':_0x3ef9c4[_0x462a4a(0xf9)],'type':_0x1fa4fb});return{'ok':!![],'data':withScene(_0x3337e8,_0x3e80af)};}const _0x1ea3c0=requireRuntimeUploadFile(_0x3ef9c4['imageFile'],'image-file'),_0x508545=await uploadRuntimeFile(_0x1c1ddb[_0x462a4a(0xe9)],_0x1ea3c0[_0x462a4a(0xe3)]);if(!_0x508545[_0x462a4a(0xfc)])throw CliErrors[_0x462a4a(0xd9)](_0x462a4a(0xe4));const _0x1a79f6=await queryRuntimeFileUrl(_0x508545['filePath'],{'download':![]});if(!_0x1a79f6[_0x462a4a(0xff)])throw CliErrors[_0x462a4a(0xd9)](_0x462a4a(0xdd));const _0x37321c=await recognizeRuntimeOcr(_0x1c1ddb[_0x462a4a(0xe9)],{'url':_0x1a79f6['fileUrl'],'type':_0x1fa4fb});return{'ok':!![],'data':withScene(_0x37321c,_0x3e80af,_0x508545)};}};export const ocrDefinitions=[ocrRecognize];
1
+ const a34_0x5d2415=a34_0x4905;(function(_0x19593b,_0x36b089){const _0x9c8e2f=a34_0x4905,_0x31ff9d=_0x19593b();while(!![]){try{const _0x4a0274=parseInt(_0x9c8e2f(0x171))/0x1*(parseInt(_0x9c8e2f(0x165))/0x2)+-parseInt(_0x9c8e2f(0x16f))/0x3*(parseInt(_0x9c8e2f(0x14b))/0x4)+parseInt(_0x9c8e2f(0x148))/0x5*(-parseInt(_0x9c8e2f(0x153))/0x6)+parseInt(_0x9c8e2f(0x15b))/0x7+parseInt(_0x9c8e2f(0x146))/0x8+parseInt(_0x9c8e2f(0x154))/0x9+-parseInt(_0x9c8e2f(0x162))/0xa*(-parseInt(_0x9c8e2f(0x15c))/0xb);if(_0x4a0274===_0x36b089)break;else _0x31ff9d['push'](_0x31ff9d['shift']());}catch(_0x5f5086){_0x31ff9d['push'](_0x31ff9d['shift']());}}}(a34_0x5eaf,0x9707b));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_0x5d2415(0x16b),'general',a34_0x5d2415(0x14c),a34_0x5d2415(0x15a)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x5d2415(0x143),'general':'General','form':'Table','idCard':a34_0x5d2415(0x173)},SCENE_FLAG={'name':a34_0x5d2415(0x147),'type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x5d2415(0x164)},IMAGE_FILE_FLAG={'name':a34_0x5d2415(0x152),'type':a34_0x5d2415(0x16e),'description':a34_0x5d2415(0x13f)},IMAGE_URL_FLAG={'name':a34_0x5d2415(0x151),'type':a34_0x5d2415(0x16e),'description':a34_0x5d2415(0x150)};function a34_0x4905(_0x4c4c62,_0x48c656){_0x4c4c62=_0x4c4c62-0x13e;const _0x5eaf2b=a34_0x5eaf();let _0x4905ca=_0x5eaf2b[_0x4c4c62];return _0x4905ca;}function a34_0x5eaf(){const _0x31a151=['string','65349bKWmpU','length','1001629TvVcvi','ocr','IdCard','POST','\x20OCR','File\x20upload\x20response\x20missing\x20filePath.','\x20OCR\x20from\x20URL','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','join','recognize','imageFile','Invoice','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','validation','1578800sIVRuw','scene','124060QZkkdg','trim','apiError','196VPVSJD','form','build','toLowerCase','description','Publicly\x20accessible\x20image\x20or\x20file\x20URL','image-url','image-file','264Hjxadi','6330825MoWYmv','appCode','imageUrl','filePath','<filePath\x20returned\x20by\x20/client/uploadFile>','/client/queryFileUrl','idCard','2568377vPcrnS','118987msAPpv','read','count','/client/ocr','str','general','470soDKnc','body','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','2XouEjw','idcard','Preview:\x20recognize\x20','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','/client/uploadFile','path','invoice','filter','fileUrl'];a34_0x5eaf=function(){return _0x31a151;};return a34_0x5eaf();}function normalizeScene(_0x3aa325){const _0x53d898=a34_0x5d2415,_0x330490=_0x3aa325[_0x53d898(0x149)]()[_0x53d898(0x14e)]();if(_0x330490===_0x53d898(0x166))return _0x53d898(0x15a);if(_0x330490===_0x53d898(0x16b)||_0x330490===_0x53d898(0x161)||_0x330490===_0x53d898(0x14c))return _0x330490;throw CliErrors[_0x53d898(0x145)]('Unsupported\x20OCR\x20scene:\x20'+_0x3aa325+'.\x20Supported\x20scenes:\x20'+SUPPORTED_SCENES[_0x53d898(0x140)](',\x20'));}function selectedInputs(_0xbdd58b){const _0x3f697a=a34_0x5d2415,_0x4375b5=_0xbdd58b['str'](_0x3f697a(0x152))[_0x3f697a(0x149)](),_0x57f71f=_0xbdd58b[_0x3f697a(0x160)](_0x3f697a(0x151))[_0x3f697a(0x149)]();return{'imageFile':_0x4375b5,'imageUrl':_0x57f71f,'count':[_0x4375b5,_0x57f71f][_0x3f697a(0x16c)](Boolean)[_0x3f697a(0x170)]};}function validateInputSelection(_0x2d61e8){const _0x7b924f=a34_0x5d2415,_0x59c540=selectedInputs(_0x2d61e8);if(_0x59c540[_0x7b924f(0x15e)]!==0x1)throw CliErrors['validation'](_0x7b924f(0x168));return _0x59c540;}function withScene(_0x2652ef,_0x3ded9a,_0x36e2c6){const _0x118a9d=a34_0x5d2415;return{..._0x2652ef,'scene':_0x3ded9a,..._0x36e2c6?{'sourceFile':{'fileName':_0x36e2c6['fileName'],'filePath':_0x36e2c6[_0x118a9d(0x157)]}}:{}};}const ocrRecognize={'service':a34_0x5d2415(0x172),'command':a34_0x5d2415(0x141),'description':'使用运行态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','risk':a34_0x5d2415(0x15d),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x55c688){const _0x3a95bf=a34_0x5d2415,_0x2510bf=normalizeScene(_0x55c688[_0x3a95bf(0x160)]('scene')),_0x39dee0=SCENE_TO_LEGACY_TYPE[_0x2510bf],_0x1d20f4=validateInputSelection(_0x55c688);if(_0x1d20f4['imageUrl'])return dryRun(_0x3a95bf(0x174),_0x3a95bf(0x15f))[_0x3a95bf(0x163)]({'appCode':_0x55c688[_0x3a95bf(0x155)],'url':_0x1d20f4['imageUrl'],'type':_0x39dee0})[_0x3a95bf(0x14f)](_0x3a95bf(0x167)+_0x2510bf+_0x3a95bf(0x13e))[_0x3a95bf(0x14d)]();const _0x47f8e3=requireRuntimeUploadFile(_0x1d20f4[_0x3a95bf(0x142)],_0x3a95bf(0x152));return dryRun(_0x3a95bf(0x174),'/client/uploadFile')[_0x3a95bf(0x163)]({'steps':[{'method':_0x3a95bf(0x174),'url':_0x3a95bf(0x169),'body':{'appCode':_0x55c688[_0x3a95bf(0x155)],'multipart':{'file':_0x47f8e3}}},{'method':_0x3a95bf(0x174),'url':_0x3a95bf(0x159),'body':{'filePath':_0x3a95bf(0x158),'downloadFlag':![]}},{'method':_0x3a95bf(0x174),'url':_0x3a95bf(0x15f),'body':{'appCode':_0x55c688[_0x3a95bf(0x155)],'url':'<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','type':_0x39dee0}}]})['description'](_0x3a95bf(0x144)+_0x2510bf+_0x3a95bf(0x175))[_0x3a95bf(0x14d)]();},async 'execute'(_0x17f849){const _0x3a8476=a34_0x5d2415,_0x3e0e60=normalizeScene(_0x17f849[_0x3a8476(0x160)](_0x3a8476(0x147))),_0x518d1f=SCENE_TO_LEGACY_TYPE[_0x3e0e60],_0x2c2582=validateInputSelection(_0x17f849);if(_0x2c2582[_0x3a8476(0x156)]){const _0x47d14e=await recognizeRuntimeOcr(_0x17f849[_0x3a8476(0x155)],{'url':_0x2c2582[_0x3a8476(0x156)],'type':_0x518d1f});return{'ok':!![],'data':withScene(_0x47d14e,_0x3e0e60)};}const _0x5a7ff7=requireRuntimeUploadFile(_0x2c2582[_0x3a8476(0x142)],_0x3a8476(0x152)),_0x164307=await uploadRuntimeFile(_0x17f849[_0x3a8476(0x155)],_0x5a7ff7[_0x3a8476(0x16a)]);if(!_0x164307[_0x3a8476(0x157)])throw CliErrors[_0x3a8476(0x14a)](_0x3a8476(0x176));const _0x3621fc=await queryRuntimeFileUrl(_0x164307[_0x3a8476(0x157)],{'download':![]});if(!_0x3621fc[_0x3a8476(0x16d)])throw CliErrors[_0x3a8476(0x14a)]('File\x20URL\x20response\x20missing\x20fileUrl.');const _0x168b6f=await recognizeRuntimeOcr(_0x17f849[_0x3a8476(0x155)],{'url':_0x3621fc[_0x3a8476(0x16d)],'type':_0x518d1f});return{'ok':!![],'data':withScene(_0x168b6f,_0x3e0e60,_0x164307)};}};export const ocrDefinitions=[ocrRecognize];
@@ -1 +1 @@
1
- const a35_0x2d05f7=a35_0x3453;(function(_0x2be189,_0x340386){const _0x409234=a35_0x3453,_0xab01dd=_0x2be189();while(!![]){try{const _0x387590=parseInt(_0x409234(0x15f))/0x1*(parseInt(_0x409234(0x164))/0x2)+parseInt(_0x409234(0x160))/0x3*(-parseInt(_0x409234(0x150))/0x4)+parseInt(_0x409234(0x161))/0x5*(-parseInt(_0x409234(0x12b))/0x6)+parseInt(_0x409234(0x139))/0x7*(-parseInt(_0x409234(0x165))/0x8)+-parseInt(_0x409234(0x14b))/0x9*(parseInt(_0x409234(0x15b))/0xa)+parseInt(_0x409234(0x156))/0xb*(-parseInt(_0x409234(0x15c))/0xc)+-parseInt(_0x409234(0x14f))/0xd*(-parseInt(_0x409234(0x125))/0xe);if(_0x387590===_0x340386)break;else _0xab01dd['push'](_0xab01dd['shift']());}catch(_0x422435){_0xab01dd['push'](_0xab01dd['shift']());}}}(a35_0x2c87,0x9a731));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x2d05f7(0x158),'type':a35_0x2d05f7(0x13f),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a35_0x2d05f7(0x147),'type':a35_0x2d05f7(0x13f),'required':!![],'description':a35_0x2d05f7(0x12f)},DESCRIPTION_FLAG={'name':a35_0x2d05f7(0x15e),'type':a35_0x2d05f7(0x13f),'description':a35_0x2d05f7(0x159)},SOURCE_SESSION_FLAG={'name':a35_0x2d05f7(0x14e),'type':'string','description':a35_0x2d05f7(0x162)};function normalizeFunctionName(_0x3fff79){const _0x4f7a62=a35_0x2d05f7,_0x33dad6=String(_0x3fff79||'')[_0x4f7a62(0x12d)]();if(!_0x33dad6||!FUNCTION_NAME_PATTERN[_0x4f7a62(0x148)](_0x33dad6))throw CliErrors[_0x4f7a62(0x11c)](_0x4f7a62(0x12a));return _0x33dad6;}function readScriptFile(_0x368cc1){const _0x4c72d1=a35_0x2d05f7;if(!_0x368cc1)throw CliErrors[_0x4c72d1(0x11c)](_0x4c72d1(0x157));if(!existsSync(_0x368cc1))throw CliErrors[_0x4c72d1(0x11c)](_0x4c72d1(0x135)+_0x368cc1);if(!statSync(_0x368cc1)[_0x4c72d1(0x142)]())throw CliErrors[_0x4c72d1(0x11c)](_0x4c72d1(0x15a)+_0x368cc1);const _0x5cc9b6=readFileSync(_0x368cc1,_0x4c72d1(0x143));if(!_0x5cc9b6['trim']())throw CliErrors[_0x4c72d1(0x11c)](_0x4c72d1(0x134));return _0x5cc9b6;}function optionalTrimmed(_0x3a6787){const _0x37b1cf=a35_0x2d05f7,_0x50ce0a=String(_0x3a6787||'')[_0x37b1cf(0x12d)]();return _0x50ce0a||undefined;}function summarizeBff(_0x2f653b){const _0x32f33c=a35_0x2d05f7;return{'id':_0x2f653b['id'],'appCode':_0x2f653b[_0x32f33c(0x11e)],'functionName':_0x2f653b['functionName'],'description':_0x2f653b[_0x32f33c(0x15e)],'scriptType':_0x2f653b[_0x32f33c(0x117)],'version':_0x2f653b[_0x32f33c(0x124)],'gmtModified':_0x2f653b[_0x32f33c(0x149)],'updateTime':_0x2f653b[_0x32f33c(0x13b)]};}function detailBff(_0x2ace30){const _0x3a3535=a35_0x2d05f7;return{'id':_0x2ace30['id'],'appCode':_0x2ace30[_0x3a3535(0x11e)],'functionName':_0x2ace30[_0x3a3535(0x154)],'description':_0x2ace30[_0x3a3535(0x15e)],'scriptType':_0x2ace30['scriptType'],'scriptContent':_0x2ace30[_0x3a3535(0x129)]??'','config':_0x2ace30[_0x3a3535(0x155)],'version':_0x2ace30['version'],'createUserId':_0x2ace30[_0x3a3535(0x12c)],'gmtCreate':_0x2ace30[_0x3a3535(0x120)],'gmtModified':_0x2ace30[_0x3a3535(0x149)],'createTime':_0x2ace30[_0x3a3535(0x138)],'updateTime':_0x2ace30['updateTime']};}function a35_0x3453(_0x5717e2,_0x152ccc){_0x5717e2=_0x5717e2-0x114;const _0x2c87dd=a35_0x2c87();let _0x3453c5=_0x2c87dd[_0x5717e2];return _0x3453c5;}function buildCreateInput(_0x56b26f){const _0xd0409e=a35_0x2d05f7;return{'functionName':normalizeFunctionName(_0x56b26f['str'](_0xd0409e(0x147))),...optionalTrimmed(_0x56b26f['str']('description'))?{'description':optionalTrimmed(_0x56b26f['str'](_0xd0409e(0x15e)))}:{},'scriptContent':readScriptFile(_0x56b26f['str'](_0xd0409e(0x158))),...optionalTrimmed(_0x56b26f[_0xd0409e(0x151)](_0xd0409e(0x14e)))?{'sourceSessionId':optionalTrimmed(_0x56b26f[_0xd0409e(0x151)](_0xd0409e(0x14e)))}:{}};}function a35_0x2c87(){const _0x1fad88=['length','Show\x20one\x20personal\x20BFF\x20by\x20id','create','Personal\x20BFF\x20script\x20file\x20is\x20blank.','File\x20not\x20found:\x20','keys','把本地脚本保存为个人\x20BFF;之后可在当前应用中调用该脚本。','createTime','1102241MVtbEu','Preview:\x20create\x20personal\x20BFF\x20','updateTime','--params\x20must\x20be\x20a\x20JSON\x20object.','根据\x20ID\x20更新个人\x20BFF','read','string','sourceSessionId','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','isFile','utf8','执行个人\x20BFF\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','write','detail','name','test','gmtModified','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','1694871AVEXxs','exec','isArray','source-session-id','923sONEfL','296GRdyDr','str','Updated\x20personal\x20BFF\x20','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','functionName','config','3773YIOQSA','File\x20path\x20is\x20required.','file','Personal\x20BFF\x20description','File\x20is\x20not\x20a\x20regular\x20file:\x20','50SmBEry','32292moGxmT','personal-bff','description','1FeBKBs','36516fETKHF','5XprqEy','Optional\x20source\x20RuntimeAgent\x20session\x20id','POST','624534xZvbDo','24SxZzSA','根据\x20ID\x20执行个人\x20BFF,并可传入\x20JSON\x20参数','Created\x20personal\x20BFF\x20','Personal\x20BFF\x20script\x20ID','scriptType','params','flag','num','根据本地脚本文件创建个人\x20BFF','validation','high-risk-write','appCode','update','gmtCreate','body','/client/runtime-bff/personal/create','/client/runtime-bff/personal/','version','876400dcSXnh','verbose','build','list','scriptContent','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','5319102vMWVkT','createUserId','trim','/update','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','map'];a35_0x2c87=function(){return _0x1fad88;};return a35_0x2c87();}function buildUpdateInput(_0x5763e3){const _0x528b30=a35_0x2d05f7,_0x17beab={};optionalTrimmed(_0x5763e3[_0x528b30(0x151)](_0x528b30(0x147)))&&(_0x17beab[_0x528b30(0x154)]=normalizeFunctionName(_0x5763e3[_0x528b30(0x151)](_0x528b30(0x147))));_0x5763e3['flag'](_0x528b30(0x15e))!==undefined&&(_0x17beab[_0x528b30(0x15e)]=_0x5763e3[_0x528b30(0x151)](_0x528b30(0x15e)));optionalTrimmed(_0x5763e3[_0x528b30(0x151)](_0x528b30(0x158)))&&(_0x17beab['scriptContent']=readScriptFile(_0x5763e3[_0x528b30(0x151)](_0x528b30(0x158))));_0x5763e3[_0x528b30(0x119)](_0x528b30(0x14e))!==undefined&&(_0x17beab[_0x528b30(0x140)]=_0x5763e3[_0x528b30(0x151)](_0x528b30(0x14e)));if(Object[_0x528b30(0x136)](_0x17beab)['length']===0x0)throw CliErrors[_0x528b30(0x11c)](_0x528b30(0x14a));return _0x17beab;}function parseExecParams(_0x28e57f){const _0x8ebffe=a35_0x2d05f7,_0x26bf7d=parseJsonParams(_0x28e57f)??{};if(Array[_0x8ebffe(0x14d)](_0x26bf7d))throw CliErrors[_0x8ebffe(0x11c)](_0x8ebffe(0x13c));return _0x26bf7d;}const personalBffList={'service':a35_0x2d05f7(0x15d),'command':a35_0x2d05f7(0x128),'description':a35_0x2d05f7(0x141),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0xcae4cd){const _0x5997a2=a35_0x2d05f7,_0x2c6130=await listPersonalBffs(_0xcae4cd[_0x5997a2(0x11e)]);return{'ok':!![],'data':{'total':_0x2c6130[_0x5997a2(0x131)],'items':_0xcae4cd['bool'](_0x5997a2(0x126))?_0x2c6130:_0x2c6130[_0x5997a2(0x130)](summarizeBff)}};}},personalBffDetail={'service':a35_0x2d05f7(0x15d),'command':a35_0x2d05f7(0x146),'description':a35_0x2d05f7(0x132),'risk':a35_0x2d05f7(0x13e),'flags':[{...ID_FLAG,'description':a35_0x2d05f7(0x116)}],async 'execute'(_0x2f80c0){const _0x2bdad3=a35_0x2d05f7,_0x5ef316=await getPersonalBff(_0x2f80c0[_0x2bdad3(0x11a)]('id'),_0x2f80c0[_0x2bdad3(0x11e)]);return{'ok':!![],'data':detailBff(_0x5ef316)};}},personalBffCreate={'service':'personal-bff','command':a35_0x2d05f7(0x133),'description':a35_0x2d05f7(0x11b),'risk':a35_0x2d05f7(0x145),'confirmationDescription':a35_0x2d05f7(0x137),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x2b0292){const _0x37af0b=a35_0x2d05f7,_0x66987e=buildCreateInput(_0x2b0292),_0x279469=await createPersonalBff(_0x2b0292['appCode'],_0x66987e);return{'ok':!![],'data':detailBff(_0x279469),'message':_0x37af0b(0x115)+_0x279469['id']+(_0x279469[_0x37af0b(0x154)]?'\x20('+_0x279469[_0x37af0b(0x154)]+')':'')};},async 'dryRun'(_0x28d5e1){const _0x576c33=a35_0x2d05f7,_0x1d4a51=buildCreateInput(_0x28d5e1);return dryRun(_0x576c33(0x163),_0x576c33(0x122))[_0x576c33(0x121)]({'appCode':_0x28d5e1[_0x576c33(0x11e)],..._0x1d4a51})[_0x576c33(0x15e)](_0x576c33(0x13a)+_0x1d4a51[_0x576c33(0x154)])[_0x576c33(0x127)]();}},personalBffUpdate={'service':a35_0x2d05f7(0x15d),'command':a35_0x2d05f7(0x11f),'description':a35_0x2d05f7(0x13d),'risk':a35_0x2d05f7(0x145),'confirmationDescription':'更新个人\x20BFF\x20的脚本或元信息;之后的调用将使用新版本。','flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x496c78){const _0xc4cf13=a35_0x2d05f7,_0x26ea8b=_0x496c78['num']('id'),_0x283c9e=buildUpdateInput(_0x496c78),_0xa8cb45=await updatePersonalBff(_0x26ea8b,_0x496c78[_0xc4cf13(0x11e)],_0x283c9e);return{'ok':!![],'data':detailBff(_0xa8cb45),'message':_0xc4cf13(0x152)+_0xa8cb45['id']+(_0xa8cb45['functionName']?'\x20('+_0xa8cb45[_0xc4cf13(0x154)]+')':'')};},async 'dryRun'(_0x55703f){const _0x553794=a35_0x2d05f7,_0x18116c=_0x55703f[_0x553794(0x11a)]('id'),_0x399feb=buildUpdateInput(_0x55703f);return dryRun(_0x553794(0x163),_0x553794(0x123)+_0x18116c+_0x553794(0x12e))[_0x553794(0x121)]({'appCode':_0x55703f['appCode'],..._0x399feb})[_0x553794(0x15e)]('Preview:\x20update\x20personal\x20BFF\x20'+_0x18116c)[_0x553794(0x127)]();}},personalBffExec={'service':a35_0x2d05f7(0x15d),'command':a35_0x2d05f7(0x14c),'description':a35_0x2d05f7(0x114),'risk':a35_0x2d05f7(0x11d),'confirmationDescription':a35_0x2d05f7(0x144),'flags':[{...ID_FLAG,'description':a35_0x2d05f7(0x116)},{...PARAMS_FLAG,'description':a35_0x2d05f7(0x153)}],async 'validate'(_0x37f240){parseExecParams(_0x37f240['str']('params'));},async 'execute'(_0x1611b1){const _0x36cabd=a35_0x2d05f7,_0x5819fe=_0x1611b1['num']('id'),_0x25c68e=parseExecParams(_0x1611b1[_0x36cabd(0x151)](_0x36cabd(0x118))),_0x64d2fb=await executePersonalBff(_0x5819fe,_0x1611b1[_0x36cabd(0x11e)],_0x25c68e);return{'ok':!![],'data':{'result':_0x64d2fb},'message':'Executed\x20personal\x20BFF\x20'+_0x5819fe};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
1
+ const a35_0x26974f=a35_0x336c;(function(_0x193ff3,_0x348f0a){const _0x1a9902=a35_0x336c,_0x7c48b2=_0x193ff3();while(!![]){try{const _0x6c06fc=parseInt(_0x1a9902(0x12d))/0x1+parseInt(_0x1a9902(0x12b))/0x2+-parseInt(_0x1a9902(0x14e))/0x3+-parseInt(_0x1a9902(0x150))/0x4*(parseInt(_0x1a9902(0x15e))/0x5)+parseInt(_0x1a9902(0x152))/0x6*(-parseInt(_0x1a9902(0x151))/0x7)+-parseInt(_0x1a9902(0x162))/0x8*(-parseInt(_0x1a9902(0x15f))/0x9)+-parseInt(_0x1a9902(0x157))/0xa*(parseInt(_0x1a9902(0x13e))/0xb);if(_0x6c06fc===_0x348f0a)break;else _0x7c48b2['push'](_0x7c48b2['shift']());}catch(_0x341969){_0x7c48b2['push'](_0x7c48b2['shift']());}}}(a35_0x5a5c,0xeb920));import{existsSync,readFileSync,statSync}from'node:fs';function a35_0x336c(_0x463274,_0x191318){_0x463274=_0x463274-0x12b;const _0x5a5c8d=a35_0x5a5c();let _0x336c46=_0x5a5c8d[_0x463274];return _0x336c46;}import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x26974f(0x156),'type':a35_0x26974f(0x138),'description':a35_0x26974f(0x153)},FUNCTION_NAME_FLAG={'name':a35_0x26974f(0x14b),'type':a35_0x26974f(0x138),'required':!![],'description':a35_0x26974f(0x154)},DESCRIPTION_FLAG={'name':a35_0x26974f(0x14d),'type':a35_0x26974f(0x138),'description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a35_0x26974f(0x145),'type':'string','description':a35_0x26974f(0x135)};function normalizeFunctionName(_0x5587a7){const _0x4f7eef=a35_0x26974f,_0x5de50a=String(_0x5587a7||'')['trim']();if(!_0x5de50a||!FUNCTION_NAME_PATTERN[_0x4f7eef(0x14c)](_0x5de50a))throw CliErrors[_0x4f7eef(0x15c)](_0x4f7eef(0x13a));return _0x5de50a;}function readScriptFile(_0x539cb0){const _0x1c8ac0=a35_0x26974f;if(!_0x539cb0)throw CliErrors[_0x1c8ac0(0x15c)]('File\x20path\x20is\x20required.');if(!existsSync(_0x539cb0))throw CliErrors[_0x1c8ac0(0x15c)](_0x1c8ac0(0x14f)+_0x539cb0);if(!statSync(_0x539cb0)[_0x1c8ac0(0x14a)]())throw CliErrors[_0x1c8ac0(0x15c)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x539cb0);const _0x54f332=readFileSync(_0x539cb0,_0x1c8ac0(0x158));if(!_0x54f332['trim']())throw CliErrors[_0x1c8ac0(0x15c)](_0x1c8ac0(0x141));return _0x54f332;}function optionalTrimmed(_0x233e59){const _0x311f53=a35_0x26974f,_0x28badc=String(_0x233e59||'')[_0x311f53(0x12c)]();return _0x28badc||undefined;}function summarizeBff(_0x14f77f){const _0x217310=a35_0x26974f;return{'id':_0x14f77f['id'],'appCode':_0x14f77f[_0x217310(0x15d)],'functionName':_0x14f77f[_0x217310(0x143)],'description':_0x14f77f[_0x217310(0x14d)],'scriptType':_0x14f77f[_0x217310(0x160)],'version':_0x14f77f['version'],'gmtModified':_0x14f77f[_0x217310(0x142)],'updateTime':_0x14f77f[_0x217310(0x136)]};}function detailBff(_0x5aa8ec){const _0x4eb3bc=a35_0x26974f;return{'id':_0x5aa8ec['id'],'appCode':_0x5aa8ec['appCode'],'functionName':_0x5aa8ec['functionName'],'description':_0x5aa8ec[_0x4eb3bc(0x14d)],'scriptType':_0x5aa8ec[_0x4eb3bc(0x160)],'scriptContent':_0x5aa8ec[_0x4eb3bc(0x139)]??'','config':_0x5aa8ec[_0x4eb3bc(0x132)],'version':_0x5aa8ec['version'],'createUserId':_0x5aa8ec['createUserId'],'gmtCreate':_0x5aa8ec[_0x4eb3bc(0x155)],'gmtModified':_0x5aa8ec['gmtModified'],'createTime':_0x5aa8ec[_0x4eb3bc(0x166)],'updateTime':_0x5aa8ec[_0x4eb3bc(0x136)]};}function buildCreateInput(_0x575658){const _0x2e0632=a35_0x26974f;return{'functionName':normalizeFunctionName(_0x575658[_0x2e0632(0x13d)](_0x2e0632(0x14b))),...optionalTrimmed(_0x575658[_0x2e0632(0x13d)]('description'))?{'description':optionalTrimmed(_0x575658[_0x2e0632(0x13d)](_0x2e0632(0x14d)))}:{},'scriptContent':readScriptFile(_0x575658['str'](_0x2e0632(0x156))),...optionalTrimmed(_0x575658[_0x2e0632(0x13d)](_0x2e0632(0x145)))?{'sourceSessionId':optionalTrimmed(_0x575658['str']('source-session-id'))}:{}};}function buildUpdateInput(_0x5d2dac){const _0x24e71a=a35_0x26974f,_0x53f7ac={};optionalTrimmed(_0x5d2dac['str'](_0x24e71a(0x14b)))&&(_0x53f7ac['functionName']=normalizeFunctionName(_0x5d2dac[_0x24e71a(0x13d)](_0x24e71a(0x14b))));_0x5d2dac['flag'](_0x24e71a(0x14d))!==undefined&&(_0x53f7ac[_0x24e71a(0x14d)]=_0x5d2dac['str'](_0x24e71a(0x14d)));optionalTrimmed(_0x5d2dac[_0x24e71a(0x13d)]('file'))&&(_0x53f7ac[_0x24e71a(0x139)]=readScriptFile(_0x5d2dac['str'](_0x24e71a(0x156))));_0x5d2dac['flag'](_0x24e71a(0x145))!==undefined&&(_0x53f7ac[_0x24e71a(0x12f)]=_0x5d2dac[_0x24e71a(0x13d)]('source-session-id'));if(Object[_0x24e71a(0x13f)](_0x53f7ac)[_0x24e71a(0x12e)]===0x0)throw CliErrors['validation']('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x53f7ac;}function a35_0x5a5c(){const _0x4a0da5=['scriptType','detail','8qeoGPL','Updated\x20personal\x20BFF\x20','body','更新个人\x20BFF\x20的脚本或元信息;之后的调用将使用新版本。','createTime','list','Show\x20one\x20personal\x20BFF\x20by\x20id','根据\x20ID\x20更新个人\x20BFF','3556488JetFJq','trim','1824855rZVJbr','length','sourceSessionId','map','POST','config','num','/client/runtime-bff/personal/create','Optional\x20source\x20RuntimeAgent\x20session\x20id','updateTime','把本地脚本保存为个人\x20BFF;之后可在当前应用中调用该脚本。','string','scriptContent','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','根据本地脚本文件创建个人\x20BFF','build','str','1289387dFdevJ','keys','personal-bff','Personal\x20BFF\x20script\x20file\x20is\x20blank.','gmtModified','functionName','exec','source-session-id','/update','params','bool','update','isFile','name','test','description','5455980KvlSbQ','File\x20not\x20found:\x20','712792PxnMKm','7RzCuVE','2106726jJppsk','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','gmtCreate','file','130EkMhEp','utf8','Personal\x20BFF\x20script\x20ID','write','Preview:\x20create\x20personal\x20BFF\x20','validation','appCode','5tPQHss','11102373FHITuQ'];a35_0x5a5c=function(){return _0x4a0da5;};return a35_0x5a5c();}function parseExecParams(_0x4da413){const _0x179137=parseJsonParams(_0x4da413)??{};if(Array['isArray'](_0x179137))throw CliErrors['validation']('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x179137;}const personalBffList={'service':a35_0x26974f(0x140),'command':a35_0x26974f(0x167),'description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0xa984f1){const _0x3869f1=a35_0x26974f,_0x5f3f2e=await listPersonalBffs(_0xa984f1[_0x3869f1(0x15d)]);return{'ok':!![],'data':{'total':_0x5f3f2e[_0x3869f1(0x12e)],'items':_0xa984f1[_0x3869f1(0x148)]('verbose')?_0x5f3f2e:_0x5f3f2e[_0x3869f1(0x130)](summarizeBff)}};}},personalBffDetail={'service':'personal-bff','command':a35_0x26974f(0x161),'description':a35_0x26974f(0x168),'risk':'read','flags':[{...ID_FLAG,'description':a35_0x26974f(0x159)}],async 'execute'(_0x703b80){const _0x3e2deb=a35_0x26974f,_0x4d30c2=await getPersonalBff(_0x703b80[_0x3e2deb(0x133)]('id'),_0x703b80[_0x3e2deb(0x15d)]);return{'ok':!![],'data':detailBff(_0x4d30c2)};}},personalBffCreate={'service':a35_0x26974f(0x140),'command':'create','description':a35_0x26974f(0x13b),'risk':'write','confirmationDescription':a35_0x26974f(0x137),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x148e7f){const _0x5c6224=a35_0x26974f,_0x1a609d=buildCreateInput(_0x148e7f),_0x43990f=await createPersonalBff(_0x148e7f['appCode'],_0x1a609d);return{'ok':!![],'data':detailBff(_0x43990f),'message':'Created\x20personal\x20BFF\x20'+_0x43990f['id']+(_0x43990f[_0x5c6224(0x143)]?'\x20('+_0x43990f[_0x5c6224(0x143)]+')':'')};},async 'dryRun'(_0x44cc2b){const _0x4f23ca=a35_0x26974f,_0x57c6f6=buildCreateInput(_0x44cc2b);return dryRun(_0x4f23ca(0x131),_0x4f23ca(0x134))[_0x4f23ca(0x164)]({'appCode':_0x44cc2b['appCode'],..._0x57c6f6})[_0x4f23ca(0x14d)](_0x4f23ca(0x15b)+_0x57c6f6[_0x4f23ca(0x143)])[_0x4f23ca(0x13c)]();}},personalBffUpdate={'service':a35_0x26974f(0x140),'command':a35_0x26974f(0x149),'description':a35_0x26974f(0x169),'risk':a35_0x26974f(0x15a),'confirmationDescription':a35_0x26974f(0x165),'flags':[{...ID_FLAG,'description':a35_0x26974f(0x159)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x335e99){const _0x5392bd=a35_0x26974f,_0x2a646d=_0x335e99['num']('id'),_0x452f66=buildUpdateInput(_0x335e99),_0x1d02f3=await updatePersonalBff(_0x2a646d,_0x335e99[_0x5392bd(0x15d)],_0x452f66);return{'ok':!![],'data':detailBff(_0x1d02f3),'message':_0x5392bd(0x163)+_0x1d02f3['id']+(_0x1d02f3[_0x5392bd(0x143)]?'\x20('+_0x1d02f3[_0x5392bd(0x143)]+')':'')};},async 'dryRun'(_0x52c399){const _0x37c486=a35_0x26974f,_0x82a4eb=_0x52c399['num']('id'),_0x311e2d=buildUpdateInput(_0x52c399);return dryRun(_0x37c486(0x131),'/client/runtime-bff/personal/'+_0x82a4eb+_0x37c486(0x146))[_0x37c486(0x164)]({'appCode':_0x52c399[_0x37c486(0x15d)],..._0x311e2d})[_0x37c486(0x14d)]('Preview:\x20update\x20personal\x20BFF\x20'+_0x82a4eb)[_0x37c486(0x13c)]();}},personalBffExec={'service':'personal-bff','command':a35_0x26974f(0x144),'description':'根据\x20ID\x20执行个人\x20BFF,并可传入\x20JSON\x20参数','risk':a35_0x26974f(0x15a),'confirmationDescription':'执行个人\x20BFF\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':'JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'}],async 'validate'(_0x5f3669){const _0x1fe1af=a35_0x26974f;parseExecParams(_0x5f3669[_0x1fe1af(0x13d)]('params'));},async 'execute'(_0x576db9){const _0x41933f=a35_0x26974f,_0x68013e=_0x576db9[_0x41933f(0x133)]('id'),_0x3e9273=parseExecParams(_0x576db9['str'](_0x41933f(0x147))),_0x346e57=await executePersonalBff(_0x68013e,_0x576db9['appCode'],_0x3e9273);return{'ok':!![],'data':{'result':_0x346e57},'message':'Executed\x20personal\x20BFF\x20'+_0x68013e};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
1
- const a36_0x44acb6=a36_0x4187;(function(_0x5a2ac0,_0x142e36){const _0x3408a6=a36_0x4187,_0x27fe33=_0x5a2ac0();while(!![]){try{const _0x2caf9d=parseInt(_0x3408a6(0x86))/0x1+parseInt(_0x3408a6(0x9d))/0x2*(parseInt(_0x3408a6(0x84))/0x3)+-parseInt(_0x3408a6(0x9e))/0x4*(-parseInt(_0x3408a6(0xa0))/0x5)+parseInt(_0x3408a6(0x8a))/0x6*(-parseInt(_0x3408a6(0x87))/0x7)+-parseInt(_0x3408a6(0x90))/0x8*(-parseInt(_0x3408a6(0x97))/0x9)+parseInt(_0x3408a6(0x76))/0xa+-parseInt(_0x3408a6(0xa3))/0xb;if(_0x2caf9d===_0x142e36)break;else _0x27fe33['push'](_0x27fe33['shift']());}catch(_0x154fd5){_0x27fe33['push'](_0x27fe33['shift']());}}}(a36_0x2862,0x23c84));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';function a36_0x2862(){const _0x1f1be0=['`lovrabet\x20app\x20use`\x20has\x20been\x20removed.','Runtime\x20App\x20Config','list','push','Agent\x20Schedules','133186lWgKFA','8UUfIjd','set','70255itTzZF','values','app\x20use','3939947SJEGjj','Self\x20Update','BFF\x20Scripts','command','Use\x20`lovrabet\x20workspace\x20use\x20--app\x20<name>`\x20instead.','app\x20init','API\x20Documentation','init','write','1322600dbTYVA','get','service','use','\x20\x20[high-risk-write]','isSingleCommand','Schema','Personal\x20BFF','app','has','login','from','Service\x20Tree','`lovrabet\x20app\x20init`\x20has\x20been\x20removed.','3BlrcMA','App\x20Management','289696HOQOjc','1414IirPeZ','defaultCommand','OCR','1488BHCVca','SQL\x20Queries','Logs','install','Use\x20`lovrabet\x20workspace\x20init\x20--appcode\x20<code>`\x20instead.','Authentication','305488zSZOdl','Workspace','run','read','Configuration','Knowledge\x20Base','map','9SEKKMD'];a36_0x2862=function(){return _0x1f1be0;};return a36_0x2862();}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(_0xce294d){const _0x2d056e=a36_0x4187;for(const _0x23d0d1 of _0xce294d){definitions[_0x2d056e(0x9f)](_0x23d0d1['service']+':'+_0x23d0d1[_0x2d056e(0x70)],_0x23d0d1);let _0x14327f=serviceGroups[_0x2d056e(0x77)](_0x23d0d1[_0x2d056e(0x78)]);!_0x14327f&&(_0x14327f=[],serviceGroups[_0x2d056e(0x9f)](_0x23d0d1['service'],_0x14327f)),_0x14327f[_0x2d056e(0x9b)](_0x23d0d1);}}function registerService(_0x271338,_0x3aed76,_0x1989c2){const _0x4d6052=a36_0x4187;registerDefinitions(_0x3aed76);const _0x2a5b84=_0x2cf780=>_0x2cf780===_0x4d6052(0x93)?'':_0x2cf780===_0x4d6052(0x75)?'\x20\x20[write]':_0x4d6052(0x7a),_0x158544={'service':_0x3aed76[0x0][_0x4d6052(0x78)],'label':_0x271338,'commands':_0x3aed76[_0x4d6052(0x96)](_0x12f6b2=>({'command':_0x12f6b2[_0x4d6052(0x70)],'description':_0x12f6b2['description'],'tag':_0x2a5b84(_0x12f6b2['risk'])})),'defaultCommand':_0x1989c2?.[_0x4d6052(0x88)]??(_0x1989c2?.['isSingleCommand']?_0x3aed76[0x0][_0x4d6052(0x70)]:undefined),'isSingleCommand':_0x1989c2?.[_0x4d6052(0x7b)]};serviceRegistry['push'](_0x158544),serviceByName['set'](_0x158544['service'],_0x158544);}registerService(a36_0x44acb6(0x8f),authDefinitions,{'defaultCommand':a36_0x44acb6(0x80)}),registerService(a36_0x44acb6(0x85),appDefinitions,{'defaultCommand':a36_0x44acb6(0x9a)}),registerService(a36_0x44acb6(0x91),workspaceDefinitions),registerService(a36_0x44acb6(0x99),appConfigDefinitions),registerService(a36_0x44acb6(0x94),configDefinitions,{'defaultCommand':a36_0x44acb6(0x9a)}),registerService(a36_0x44acb6(0x73),apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService('Instant\x20API',dataDefinitions),registerService(a36_0x44acb6(0x8b),sqlDefinitions),registerService(a36_0x44acb6(0x6f),bffDefinitions),registerService(a36_0x44acb6(0x7d),personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService('File',fileDefinitions),registerService(a36_0x44acb6(0x89),ocrDefinitions),registerService(a36_0x44acb6(0x95),kbDefinitions),registerService(a36_0x44acb6(0x9c),scheduleDefinitions,{'defaultCommand':'list'}),registerService(a36_0x44acb6(0x82),serviceDefinitions,{'defaultCommand':a36_0x44acb6(0x9a)}),registerService('Skills',skillDefinitions,{'defaultCommand':a36_0x44acb6(0x8d)}),registerService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':a36_0x44acb6(0x8d)}),registerService(a36_0x44acb6(0x6e),[updateDefinition],{'defaultCommand':a36_0x44acb6(0x92),'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x44acb6(0x7c),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x44acb6(0x8c),logsDefinitions,{'defaultCommand':'show'});function a36_0x4187(_0x479459,_0x24644c){_0x479459=_0x479459-0x6e;const _0x2862e6=a36_0x2862();let _0x41871a=_0x2862e6[_0x479459];return _0x41871a;}export function findDefinition(_0x21677c,_0x1608bb){const _0x3a9dcb=a36_0x44acb6;return definitions[_0x3a9dcb(0x77)](_0x21677c+':'+_0x1608bb);}export function resolveRemovedCommand(_0x213926,_0x3199b1){const _0x13aaa5=a36_0x44acb6;if(_0x213926===_0x13aaa5(0x7e)&&_0x3199b1===_0x13aaa5(0x74))return{'command':_0x13aaa5(0x72),'message':_0x13aaa5(0x83),'hint':_0x13aaa5(0x8e)};if(_0x213926===_0x13aaa5(0x7e)&&_0x3199b1===_0x13aaa5(0x79))return{'command':_0x13aaa5(0xa2),'message':_0x13aaa5(0x98),'hint':_0x13aaa5(0x71)};return undefined;}export function isKnownService(_0x2870ae){const _0x2e6279=a36_0x44acb6;return serviceByName[_0x2e6279(0x7f)](_0x2870ae);}export function getServiceEntry(_0xf89aac){return serviceByName['get'](_0xf89aac);}export function getAllDefinitions(){const _0x4fe79d=a36_0x44acb6;return Array[_0x4fe79d(0x81)](definitions[_0x4fe79d(0xa1)]());}
1
+ const a36_0x500895=a36_0x597e;(function(_0xe9b603,_0x5573a4){const _0x11b635=a36_0x597e,_0x5931ac=_0xe9b603();while(!![]){try{const _0x3da8cd=parseInt(_0x11b635(0xc4))/0x1*(-parseInt(_0x11b635(0xcd))/0x2)+parseInt(_0x11b635(0xd9))/0x3*(parseInt(_0x11b635(0xb2))/0x4)+parseInt(_0x11b635(0xc6))/0x5+-parseInt(_0x11b635(0xd2))/0x6+-parseInt(_0x11b635(0xcc))/0x7*(parseInt(_0x11b635(0xd5))/0x8)+-parseInt(_0x11b635(0xb8))/0x9+-parseInt(_0x11b635(0xda))/0xa*(-parseInt(_0x11b635(0xa6))/0xb);if(_0x3da8cd===_0x5573a4)break;else _0x5931ac['push'](_0x5931ac['shift']());}catch(_0x2a8d39){_0x5931ac['push'](_0x5931ac['shift']());}}}(a36_0xcc74,0xed1fb));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';function a36_0xcc74(){const _0x4b0657=['from','defaultCommand','Use\x20`lovrabet\x20workspace\x20use\x20--app\x20<name>`\x20instead.','Skills','BFF\x20Scripts','39086IVmNNr','read','3079400MvPKTK','`lovrabet\x20app\x20init`\x20has\x20been\x20removed.','Personal\x20BFF','init','Agent\x20Schedules','map','22358htLute','42hidoNZ','SQL\x20Queries','install','Knowledge\x20Base','list','8780952Aizoeq','app\x20init','Instant\x20API','2384hViXHJ','command','Self\x20Update','write','15uMFGqP','350PSndHV','description','App\x20Management','run','Logs','app\x20use','\x20\x20[high-risk-write]','Authentication','set','1405019RmqLtu','CLI\x20Built-in\x20Skill','API\x20Documentation','File','Workspace','Use\x20`lovrabet\x20logs\x20show`\x20to\x20view\x20command\x20history.','Use\x20`lovrabet\x20workspace\x20init\x20--appcode\x20<code>`\x20instead.','`lovrabet\x20app\x20use`\x20has\x20been\x20removed.','has','Diagnostics','push','Configuration','452460PWuEcx','app','show','Runtime\x20App\x20Config','login','get','13001409oJdUrv','\x20\x20[write]','service','Artifacts','clear','isSingleCommand','values'];a36_0xcc74=function(){return _0x4b0657;};return a36_0xcc74();}import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{scheduleDefinitions}from'../commands/schedule/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x4924e2){const _0x4df84c=a36_0x597e;for(const _0xe6d91f of _0x4924e2){definitions[_0x4df84c(0xa5)](_0xe6d91f['service']+':'+_0xe6d91f[_0x4df84c(0xd6)],_0xe6d91f);let _0x501d8d=serviceGroups[_0x4df84c(0xb7)](_0xe6d91f[_0x4df84c(0xba)]);!_0x501d8d&&(_0x501d8d=[],serviceGroups[_0x4df84c(0xa5)](_0xe6d91f[_0x4df84c(0xba)],_0x501d8d)),_0x501d8d[_0x4df84c(0xb0)](_0xe6d91f);}}function registerService(_0x3921d1,_0x281bba,_0xcf4fbc){const _0x47ed90=a36_0x597e;registerDefinitions(_0x281bba);const _0x2515f1=_0x28dfea=>_0x28dfea===_0x47ed90(0xc5)?'':_0x28dfea===_0x47ed90(0xd8)?_0x47ed90(0xb9):_0x47ed90(0xa3),_0x514238={'service':_0x281bba[0x0]['service'],'label':_0x3921d1,'commands':_0x281bba[_0x47ed90(0xcb)](_0xc1760e=>({'command':_0xc1760e[_0x47ed90(0xd6)],'description':_0xc1760e[_0x47ed90(0xdb)],'tag':_0x2515f1(_0xc1760e['risk'])})),'defaultCommand':_0xcf4fbc?.[_0x47ed90(0xc0)]??(_0xcf4fbc?.['isSingleCommand']?_0x281bba[0x0][_0x47ed90(0xd6)]:undefined),'isSingleCommand':_0xcf4fbc?.[_0x47ed90(0xbd)]};serviceRegistry['push'](_0x514238),serviceByName[_0x47ed90(0xa5)](_0x514238[_0x47ed90(0xba)],_0x514238);}registerService(a36_0x500895(0xa4),authDefinitions,{'defaultCommand':a36_0x500895(0xb6)}),registerService(a36_0x500895(0xdc),appDefinitions,{'defaultCommand':a36_0x500895(0xd1)}),registerService(a36_0x500895(0xaa),workspaceDefinitions),registerService(a36_0x500895(0xb5),appConfigDefinitions),registerService(a36_0x500895(0xb1),configDefinitions,{'defaultCommand':'list'}),registerService(a36_0x500895(0xa8),apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a36_0x500895(0xd4),dataDefinitions),registerService(a36_0x500895(0xce),sqlDefinitions),registerService(a36_0x500895(0xc3),bffDefinitions),registerService(a36_0x500895(0xc8),personalBffDefinitions),registerService(a36_0x500895(0xbb),artifactDefinitions),registerService(a36_0x500895(0xa9),fileDefinitions),registerService('OCR',ocrDefinitions),registerService(a36_0x500895(0xd0),kbDefinitions),registerService(a36_0x500895(0xca),scheduleDefinitions,{'defaultCommand':a36_0x500895(0xd1)}),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a36_0x500895(0xd1)}),registerService(a36_0x500895(0xc2),skillDefinitions,{'defaultCommand':a36_0x500895(0xcf)}),registerService(a36_0x500895(0xa7),cliSkillDefinitions,{'defaultCommand':a36_0x500895(0xcf)}),registerService(a36_0x500895(0xd7),[updateDefinition],{'defaultCommand':a36_0x500895(0xdd),'isSingleCommand':!![]}),registerService(a36_0x500895(0xaf),[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x500895(0xde),logsDefinitions,{'defaultCommand':a36_0x500895(0xb4)});export function findDefinition(_0x310812,_0x29c5fb){const _0x500762=a36_0x500895;return definitions[_0x500762(0xb7)](_0x310812+':'+_0x29c5fb);}export function resolveRemovedCommand(_0x3174aa,_0x35f760){const _0x58b120=a36_0x500895;if(_0x3174aa==='app'&&_0x35f760===_0x58b120(0xc9))return{'command':_0x58b120(0xd3),'message':_0x58b120(0xc7),'hint':_0x58b120(0xac)};if(_0x3174aa===_0x58b120(0xb3)&&_0x35f760==='use')return{'command':_0x58b120(0xa2),'message':_0x58b120(0xad),'hint':_0x58b120(0xc1)};if(_0x3174aa==='logs'&&_0x35f760===_0x58b120(0xbc))return{'command':'logs\x20clear','message':'`lovrabet\x20logs\x20clear`\x20has\x20been\x20removed.','hint':_0x58b120(0xab)};return undefined;}function a36_0x597e(_0x3246ad,_0x4f9082){_0x3246ad=_0x3246ad-0xa2;const _0xcc74da=a36_0xcc74();let _0x597e5f=_0xcc74da[_0x3246ad];return _0x597e5f;}export function isKnownService(_0x2f11a2){const _0x290805=a36_0x500895;return serviceByName[_0x290805(0xae)](_0x2f11a2);}export function getServiceEntry(_0x34f536){const _0x4eca8a=a36_0x500895;return serviceByName[_0x4eca8a(0xb7)](_0x34f536);}export function getAllDefinitions(){const _0x1ed370=a36_0x500895;return Array[_0x1ed370(0xbf)](definitions[_0x1ed370(0xbe)]());}
@@ -1 +1 @@
1
- const a37_0x55887b=a37_0x5d25;(function(_0x56f577,_0x55c33b){const _0xee403c=a37_0x5d25,_0x1593b5=_0x56f577();while(!![]){try{const _0x2af0e3=-parseInt(_0xee403c(0x1ab))/0x1*(-parseInt(_0xee403c(0x1ba))/0x2)+parseInt(_0xee403c(0x1c4))/0x3+parseInt(_0xee403c(0x1ae))/0x4*(-parseInt(_0xee403c(0x193))/0x5)+parseInt(_0xee403c(0x19e))/0x6+parseInt(_0xee403c(0x1c0))/0x7*(parseInt(_0xee403c(0x1b7))/0x8)+-parseInt(_0xee403c(0x18b))/0x9+-parseInt(_0xee403c(0x19f))/0xa;if(_0x2af0e3===_0x55c33b)break;else _0x1593b5['push'](_0x1593b5['shift']());}catch(_0x2cd59e){_0x1593b5['push'](_0x1593b5['shift']());}}}(a37_0xf0a7,0x260e6));function a37_0x5d25(_0x1303de,_0x541f70){_0x1303de=_0x1303de-0x182;const _0xf0a70=a37_0xf0a7();let _0x5d2563=_0xf0a70[_0x1303de];return _0x5d2563;}import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':'kind','type':'string','required':!![],'enum':['CRON',a37_0x55887b(0x19b)],'description':a37_0x55887b(0x1c1)},CRON_FLAG={'name':a37_0x55887b(0x1bb),'type':'string','description':a37_0x55887b(0x190)},SCHEDULED_AT_FLAG={'name':a37_0x55887b(0x185),'type':'string','description':a37_0x55887b(0x1a0)},TITLE_FLAG={'name':'title','type':a37_0x55887b(0x1a2),'required':!![],'description':'Schedule\x20title'},PROMPT_FLAG={'name':a37_0x55887b(0x1ad),'type':'string','required':!![],'description':'Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs'},CHANNEL_FLAG={'name':a37_0x55887b(0x1ac),'type':'string','enum':[a37_0x55887b(0x1c7),a37_0x55887b(0x1a5)],'default':a37_0x55887b(0x1a5),'description':'Task\x20channel:\x20auto\x20or\x20premium'},SCHEDULE_ID_FLAG={'name':a37_0x55887b(0x1a4),'type':'string','required':!![],'description':a37_0x55887b(0x1be),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':'a\x20UUID\x20returned\x20by\x20schedule\x20create/list'}},LIMIT_FLAG={'name':a37_0x55887b(0x19c),'type':a37_0x55887b(0x1a6),'default':0x14,'description':a37_0x55887b(0x18c)},CURSOR_FLAG={'name':'cursor','type':a37_0x55887b(0x1a2),'description':a37_0x55887b(0x1b0)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function a37_0xf0a7(){const _0x3239c9=['body','run','--title\x20must\x20not\x20be\x20blank.','trim','214504AXwHtJ','Show\x20one\x20schedule\x20by\x20schedule\x20ID','将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','166038dbNHPB','cron','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','num','Schedule\x20UUID','build','7rrrAwa','Schedule\x20kind:\x20CRON\x20or\x20ONCE','\x20schedule\x20','DELETE','922257UGutRY','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','appCode','auto','kind','UTC','Queued\x20Task\x20','scheduled-at','validation','description','Preview:\x20create\x20an\x20Agent\x20schedule','cursor','taskId','1363005pEBbKh','Page\x20size\x20from\x201\x20to\x20100','--prompt\x20must\x20not\x20be\x20blank.','high-risk-write','str','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','schedule','Created\x20','37165HrlzKq','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','Preview:\x20run\x20schedule\x20','Preview:\x20delete\x20schedule\x20','删除定时任务并停止其后续触发','/schedules','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','read','ONCE','limit','/run','804180sgutfg','1621950NTtyoe','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','/api/harness/apps/','string','length','schedule-id','premium','number','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','立即运行一次定时任务并创建\x20Task','validate','\x20from\x20schedule\x20','1agHgcQ','channel','prompt','44PKIOdD','CRON','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','list','创建周期性或单次执行的\x20Agent\x20定时任务'];a37_0xf0a7=function(){return _0x3239c9;};return a37_0xf0a7();}function readScheduleInput(_0x169d1b){const _0x52ec7c=a37_0x55887b,_0x31c43a=_0x169d1b[_0x52ec7c(0x18f)](_0x52ec7c(0x182)),_0x14b7ae=_0x169d1b[_0x52ec7c(0x18f)]('title')[_0x52ec7c(0x1b6)](),_0x200163=_0x169d1b[_0x52ec7c(0x18f)]('prompt')[_0x52ec7c(0x1b6)](),_0x23e11f=_0x169d1b[_0x52ec7c(0x18f)](_0x52ec7c(0x1ac)),_0x1494db=_0x169d1b[_0x52ec7c(0x18f)]('cron'),_0x4b7767=_0x169d1b['str'](_0x52ec7c(0x185));if(!_0x14b7ae)throw CliErrors[_0x52ec7c(0x186)](_0x52ec7c(0x1b5));if(!_0x200163)throw CliErrors[_0x52ec7c(0x186)](_0x52ec7c(0x18d));if(_0x31c43a===_0x52ec7c(0x1af)){if(!_0x1494db||_0x4b7767)throw CliErrors['validation']('CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.');return{'kind':_0x31c43a,'timezone':_0x52ec7c(0x183),'cron':_0x1494db,'title':_0x14b7ae,'prompt':_0x200163,'channel':_0x23e11f};}if(_0x31c43a===_0x52ec7c(0x19b)){if(!_0x4b7767||_0x1494db)throw CliErrors[_0x52ec7c(0x186)]('ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.');return{'kind':_0x31c43a,'timezone':'UTC','scheduledAt':_0x4b7767,'title':_0x14b7ae,'prompt':_0x200163,'channel':_0x23e11f};}throw CliErrors[_0x52ec7c(0x186)](_0x52ec7c(0x1a7));}function scheduleCollectionPath(_0x64025e){const _0x4339c8=a37_0x55887b;return _0x4339c8(0x1a1)+encodeURIComponent(_0x64025e)+_0x4339c8(0x198);}function scheduleItemPath(_0x1ce830,_0x3cef46){return scheduleCollectionPath(_0x1ce830)+'/'+encodeURIComponent(_0x3cef46);}const scheduleValidate={'service':'schedule','command':a37_0x55887b(0x1a9),'description':a37_0x55887b(0x194),'risk':a37_0x55887b(0x19a),'flags':INPUT_FLAGS,async 'validate'(_0x3d9de2){readScheduleInput(_0x3d9de2);},async 'execute'(_0x1f2622){const _0x44620a=a37_0x55887b,_0x1e54a4=readScheduleInput(_0x1f2622),_0x1153b5=await validateRuntimeSchedule(_0x1f2622[_0x44620a(0x1c6)],_0x1e54a4);return{'ok':!![],'data':_0x1153b5,'message':'Schedule\x20input\x20is\x20valid'};}},scheduleCreate={'service':a37_0x55887b(0x191),'command':'create','description':a37_0x55887b(0x1b2),'risk':a37_0x55887b(0x18e),'confirmationDescription':'将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','flags':INPUT_FLAGS,async 'validate'(_0x8a9b59){readScheduleInput(_0x8a9b59);},async 'execute'(_0x17c1df){const _0xf44156=a37_0x55887b,_0x59fea7=readScheduleInput(_0x17c1df),_0x384898=await validateRuntimeSchedule(_0x17c1df[_0xf44156(0x1c6)],_0x59fea7),_0x5e4fb0=await createRuntimeSchedule(_0x17c1df['appCode'],_0x384898);return{'ok':!![],'data':_0x5e4fb0,'message':_0xf44156(0x192)+_0x5e4fb0[_0xf44156(0x182)]+_0xf44156(0x1c2)+_0x5e4fb0['scheduleId']};},async 'dryRun'(_0x21e2d1){const _0x29bf7e=a37_0x55887b,_0x40ac28=readScheduleInput(_0x21e2d1);return dryRun('POST',scheduleCollectionPath(_0x21e2d1[_0x29bf7e(0x1c6)]))[_0x29bf7e(0x1b3)](_0x40ac28)[_0x29bf7e(0x187)](_0x29bf7e(0x188))['build']();}},scheduleList={'service':'schedule','command':a37_0x55887b(0x1b1),'description':a37_0x55887b(0x199),'risk':a37_0x55887b(0x19a),'flags':[LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x129ceb){const _0xad69a5=a37_0x55887b,_0x4fc368=_0x129ceb[_0xad69a5(0x1bd)]('limit');if(!Number['isSafeInteger'](_0x4fc368)||_0x4fc368<0x1||_0x4fc368>0x64)throw CliErrors[_0xad69a5(0x186)](_0xad69a5(0x1bc));const _0x34a72c=_0x129ceb[_0xad69a5(0x18f)](_0xad69a5(0x189));if(_0x34a72c&&(_0x34a72c[_0xad69a5(0x1a3)]>0x400||_0x34a72c['trim']()!==_0x34a72c))throw CliErrors[_0xad69a5(0x186)](_0xad69a5(0x1c5));},async 'execute'(_0x230cc7){const _0x36e0db=a37_0x55887b,_0x4e83ec=_0x230cc7['str'](_0x36e0db(0x189)),_0x42a085=await listRuntimeSchedules(_0x230cc7[_0x36e0db(0x1c6)],{'limit':_0x230cc7[_0x36e0db(0x1bd)]('limit'),..._0x4e83ec?{'cursor':_0x4e83ec}:{}});return{'ok':!![],'data':_0x42a085};}},scheduleDetail={'service':'schedule','command':'detail','description':a37_0x55887b(0x1b8),'risk':a37_0x55887b(0x19a),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x25f783){const _0x5e5752=a37_0x55887b,_0x1d2af6=await getRuntimeSchedule(_0x25f783[_0x5e5752(0x1c6)],_0x25f783[_0x5e5752(0x18f)]('schedule-id'));return{'ok':!![],'data':_0x1d2af6};}},scheduleRun={'service':a37_0x55887b(0x191),'command':a37_0x55887b(0x1b4),'description':a37_0x55887b(0x1a8),'risk':a37_0x55887b(0x18e),'confirmationDescription':a37_0x55887b(0x1b9),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x104bfc){const _0x535731=a37_0x55887b,_0x28cce3=_0x104bfc[_0x535731(0x18f)]('schedule-id'),_0x17cd5b=await runRuntimeSchedule(_0x104bfc[_0x535731(0x1c6)],_0x28cce3);return{'ok':!![],'data':_0x17cd5b,'message':_0x535731(0x184)+_0x17cd5b[_0x535731(0x18a)]+_0x535731(0x1aa)+_0x28cce3};},async 'dryRun'(_0xa38fdc){const _0x1a4ccf=a37_0x55887b,_0x5cef6e=_0xa38fdc['str'](_0x1a4ccf(0x1a4));return dryRun('POST',scheduleItemPath(_0xa38fdc[_0x1a4ccf(0x1c6)],_0x5cef6e)+_0x1a4ccf(0x19d))['description'](_0x1a4ccf(0x195)+_0x5cef6e+'\x20immediately')[_0x1a4ccf(0x1bf)]();}},scheduleDelete={'service':a37_0x55887b(0x191),'command':'delete','description':a37_0x55887b(0x197),'risk':a37_0x55887b(0x18e),'confirmationDescription':'将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x43f4f3){const _0x3a05a1=a37_0x55887b,_0x4bbe8e=_0x43f4f3['str'](_0x3a05a1(0x1a4)),_0x4e3938=await deleteRuntimeSchedule(_0x43f4f3['appCode'],_0x4bbe8e);return{'ok':!![],'data':_0x4e3938,'message':'Deleted\x20schedule\x20'+_0x4bbe8e};},async 'dryRun'(_0x372993){const _0x1896b5=a37_0x55887b,_0x48413e=_0x372993[_0x1896b5(0x18f)]('schedule-id');return dryRun(_0x1896b5(0x1c3),scheduleItemPath(_0x372993[_0x1896b5(0x1c6)],_0x48413e))['description'](_0x1896b5(0x196)+_0x48413e)[_0x1896b5(0x1bf)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
1
+ const a37_0x5420e1=a37_0x4b51;function a37_0x4b51(_0x7c9d47,_0x57dc02){_0x7c9d47=_0x7c9d47-0xbc;const _0x5750c9=a37_0x5750();let _0x4b5181=_0x5750c9[_0x7c9d47];return _0x4b5181;}(function(_0xb36065,_0x226192){const _0x46c742=a37_0x4b51,_0x43fbfe=_0xb36065();while(!![]){try{const _0x5be36c=parseInt(_0x46c742(0xee))/0x1*(-parseInt(_0x46c742(0xc0))/0x2)+-parseInt(_0x46c742(0xfa))/0x3*(parseInt(_0x46c742(0xce))/0x4)+-parseInt(_0x46c742(0xd8))/0x5*(-parseInt(_0x46c742(0xd4))/0x6)+-parseInt(_0x46c742(0xc7))/0x7+parseInt(_0x46c742(0xe6))/0x8+parseInt(_0x46c742(0xf0))/0x9+parseInt(_0x46c742(0xbe))/0xa;if(_0x5be36c===_0x226192)break;else _0x43fbfe['push'](_0x43fbfe['shift']());}catch(_0x42e745){_0x43fbfe['push'](_0x43fbfe['shift']());}}}(a37_0x5750,0xb58e3));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_0x5420e1(0xf9),'type':a37_0x5420e1(0xc4),'required':!![],'enum':[a37_0x5420e1(0xd2),a37_0x5420e1(0xc2)],'description':'Schedule\x20kind:\x20CRON\x20or\x20ONCE'},CRON_FLAG={'name':'cron','type':a37_0x5420e1(0xc4),'description':a37_0x5420e1(0xcb)},SCHEDULED_AT_FLAG={'name':'scheduled-at','type':'string','description':a37_0x5420e1(0xd3)},TITLE_FLAG={'name':a37_0x5420e1(0xe2),'type':a37_0x5420e1(0xc4),'required':!![],'description':'Schedule\x20title'},PROMPT_FLAG={'name':a37_0x5420e1(0xc5),'type':a37_0x5420e1(0xc4),'required':!![],'description':a37_0x5420e1(0xe4)},CHANNEL_FLAG={'name':a37_0x5420e1(0xd1),'type':a37_0x5420e1(0xc4),'enum':['auto','premium'],'default':'premium','description':a37_0x5420e1(0xdc)},SCHEDULE_ID_FLAG={'name':a37_0x5420e1(0xda),'type':'string','required':!![],'description':a37_0x5420e1(0xd9),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a37_0x5420e1(0xea)}},LIMIT_FLAG={'name':'limit','type':a37_0x5420e1(0xd6),'default':0x14,'description':'Page\x20size\x20from\x201\x20to\x20100'},CURSOR_FLAG={'name':'cursor','type':a37_0x5420e1(0xc4),'description':a37_0x5420e1(0xf5)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x58d349){const _0x2ed502=a37_0x5420e1,_0x581ede=_0x58d349[_0x2ed502(0xcc)](_0x2ed502(0xf9)),_0x49acce=_0x58d349[_0x2ed502(0xcc)](_0x2ed502(0xe2))[_0x2ed502(0xf1)](),_0x5687a0=_0x58d349[_0x2ed502(0xcc)]('prompt')[_0x2ed502(0xf1)](),_0x2bd4c4=_0x58d349[_0x2ed502(0xcc)](_0x2ed502(0xd1)),_0x53be4d=_0x58d349['str'](_0x2ed502(0xfd)),_0x250637=_0x58d349['str']('scheduled-at');if(!_0x49acce)throw CliErrors[_0x2ed502(0xdb)](_0x2ed502(0xde));if(!_0x5687a0)throw CliErrors[_0x2ed502(0xdb)](_0x2ed502(0xe0));if(_0x581ede===_0x2ed502(0xd2)){if(!_0x53be4d||_0x250637)throw CliErrors[_0x2ed502(0xdb)](_0x2ed502(0xbf));return{'kind':_0x581ede,'timezone':_0x2ed502(0xbc),'cron':_0x53be4d,'title':_0x49acce,'prompt':_0x5687a0,'channel':_0x2bd4c4};}if(_0x581ede==='ONCE'){if(!_0x250637||_0x53be4d)throw CliErrors[_0x2ed502(0xdb)]('ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.');return{'kind':_0x581ede,'timezone':_0x2ed502(0xbc),'scheduledAt':_0x250637,'title':_0x49acce,'prompt':_0x5687a0,'channel':_0x2bd4c4};}throw CliErrors[_0x2ed502(0xdb)](_0x2ed502(0xf4));}function scheduleCollectionPath(_0x5a72af){const _0x2ce0d6=a37_0x5420e1;return _0x2ce0d6(0xe9)+encodeURIComponent(_0x5a72af)+'/schedules';}function scheduleItemPath(_0x123ac2,_0x5c6da2){return scheduleCollectionPath(_0x123ac2)+'/'+encodeURIComponent(_0x5c6da2);}function a37_0x5750(){const _0x4503ac=['appCode','删除定时任务并停止其后续触发','UTC','validate','12540840ylFBzO','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','6tQzhUh','high-risk-write','ONCE','\x20from\x20schedule\x20','string','prompt','Preview:\x20run\x20schedule\x20','8377187bgqiIO','将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','POST','schedule','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','str','/run','3918188AfOZKE','Preview:\x20delete\x20schedule\x20','isSafeInteger','channel','CRON','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','702bCGJWH','build','number','body','32005ulgQzc','Schedule\x20UUID','schedule-id','validation','Task\x20channel:\x20auto\x20or\x20premium','创建周期性或单次执行的\x20Agent\x20定时任务','--title\x20must\x20not\x20be\x20blank.','Created\x20','--prompt\x20must\x20not\x20be\x20blank.','description','title','Schedule\x20input\x20is\x20valid','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','limit','5266992gHOArL','taskId','\x20schedule\x20','/api/harness/apps/','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','list','delete','Deleted\x20schedule\x20','197871hBGqeb','read','7669593pDKwyW','trim','\x20immediately','length','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','num','create','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','kind','3mrLgcu','cursor','run','cron','Queued\x20Task\x20'];a37_0x5750=function(){return _0x4503ac;};return a37_0x5750();}const scheduleValidate={'service':'schedule','command':a37_0x5420e1(0xbd),'description':'Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','risk':a37_0x5420e1(0xef),'flags':INPUT_FLAGS,async 'validate'(_0x3cc29a){readScheduleInput(_0x3cc29a);},async 'execute'(_0x2f569f){const _0x44ecfb=a37_0x5420e1,_0x1a9dcd=readScheduleInput(_0x2f569f),_0xdf60a8=await validateRuntimeSchedule(_0x2f569f[_0x44ecfb(0xff)],_0x1a9dcd);return{'ok':!![],'data':_0xdf60a8,'message':_0x44ecfb(0xe3)};}},scheduleCreate={'service':'schedule','command':a37_0x5420e1(0xf7),'description':a37_0x5420e1(0xdd),'risk':a37_0x5420e1(0xc1),'confirmationDescription':a37_0x5420e1(0xc8),'flags':INPUT_FLAGS,async 'validate'(_0x2b16aa){readScheduleInput(_0x2b16aa);},async 'execute'(_0x3c9470){const _0x2a76df=a37_0x5420e1,_0x4f2bf1=readScheduleInput(_0x3c9470),_0x5cb5f3=await validateRuntimeSchedule(_0x3c9470[_0x2a76df(0xff)],_0x4f2bf1),_0x50c09a=await createRuntimeSchedule(_0x3c9470['appCode'],_0x5cb5f3);return{'ok':!![],'data':_0x50c09a,'message':_0x2a76df(0xdf)+_0x50c09a['kind']+_0x2a76df(0xe8)+_0x50c09a['scheduleId']};},async 'dryRun'(_0x1e1359){const _0x3f384f=a37_0x5420e1,_0x43595b=readScheduleInput(_0x1e1359);return dryRun(_0x3f384f(0xc9),scheduleCollectionPath(_0x1e1359[_0x3f384f(0xff)]))[_0x3f384f(0xd7)](_0x43595b)[_0x3f384f(0xe1)]('Preview:\x20create\x20an\x20Agent\x20schedule')['build']();}},scheduleList={'service':'schedule','command':a37_0x5420e1(0xeb),'description':'List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','risk':'read','flags':[LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x1b54a1){const _0x155d09=a37_0x5420e1,_0xe984dd=_0x1b54a1[_0x155d09(0xf6)]('limit');if(!Number[_0x155d09(0xd0)](_0xe984dd)||_0xe984dd<0x1||_0xe984dd>0x64)throw CliErrors[_0x155d09(0xdb)](_0x155d09(0xf8));const _0x4785c7=_0x1b54a1['str'](_0x155d09(0xfb));if(_0x4785c7&&(_0x4785c7[_0x155d09(0xf3)]>0x400||_0x4785c7[_0x155d09(0xf1)]()!==_0x4785c7))throw CliErrors[_0x155d09(0xdb)]('--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.');},async 'execute'(_0xe3876b){const _0x5432a7=a37_0x5420e1,_0x3f6650=_0xe3876b[_0x5432a7(0xcc)](_0x5432a7(0xfb)),_0x5c6433=await listRuntimeSchedules(_0xe3876b['appCode'],{'limit':_0xe3876b[_0x5432a7(0xf6)](_0x5432a7(0xe5)),..._0x3f6650?{'cursor':_0x3f6650}:{}});return{'ok':!![],'data':_0x5c6433};}},scheduleDetail={'service':'schedule','command':'detail','description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':a37_0x5420e1(0xef),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x257c1e){const _0x53af12=a37_0x5420e1,_0x52efce=await getRuntimeSchedule(_0x257c1e['appCode'],_0x257c1e[_0x53af12(0xcc)](_0x53af12(0xda)));return{'ok':!![],'data':_0x52efce};}},scheduleRun={'service':'schedule','command':a37_0x5420e1(0xfc),'description':'立即运行一次定时任务并创建\x20Task','risk':'high-risk-write','confirmationDescription':'将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x425b97){const _0x3a514d=a37_0x5420e1,_0x4dfeda=_0x425b97[_0x3a514d(0xcc)](_0x3a514d(0xda)),_0x11f26f=await runRuntimeSchedule(_0x425b97[_0x3a514d(0xff)],_0x4dfeda);return{'ok':!![],'data':_0x11f26f,'message':_0x3a514d(0xfe)+_0x11f26f[_0x3a514d(0xe7)]+_0x3a514d(0xc3)+_0x4dfeda};},async 'dryRun'(_0xf362be){const _0x36889b=a37_0x5420e1,_0x320885=_0xf362be[_0x36889b(0xcc)](_0x36889b(0xda));return dryRun(_0x36889b(0xc9),scheduleItemPath(_0xf362be[_0x36889b(0xff)],_0x320885)+_0x36889b(0xcd))[_0x36889b(0xe1)](_0x36889b(0xc6)+_0x320885+_0x36889b(0xf2))[_0x36889b(0xd5)]();}},scheduleDelete={'service':a37_0x5420e1(0xca),'command':a37_0x5420e1(0xec),'description':a37_0x5420e1(0x100),'risk':a37_0x5420e1(0xc1),'confirmationDescription':'将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x2e8c69){const _0x5de1c1=a37_0x5420e1,_0x10985b=_0x2e8c69[_0x5de1c1(0xcc)](_0x5de1c1(0xda)),_0x4eb0d0=await deleteRuntimeSchedule(_0x2e8c69['appCode'],_0x10985b);return{'ok':!![],'data':_0x4eb0d0,'message':_0x5de1c1(0xed)+_0x10985b};},async 'dryRun'(_0x43a33c){const _0x40389c=a37_0x5420e1,_0x51bd80=_0x43a33c[_0x40389c(0xcc)](_0x40389c(0xda));return dryRun('DELETE',scheduleItemPath(_0x43a33c['appCode'],_0x51bd80))[_0x40389c(0xe1)](_0x40389c(0xcf)+_0x51bd80)[_0x40389c(0xd5)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
@@ -1 +1 @@
1
- const a38_0x58fa45=a38_0x1a12;(function(_0x153fae,_0x4d159b){const _0x1a4596=a38_0x1a12,_0x466b73=_0x153fae();while(!![]){try{const _0x82c497=-parseInt(_0x1a4596(0x105))/0x1*(-parseInt(_0x1a4596(0xfe))/0x2)+-parseInt(_0x1a4596(0x101))/0x3*(-parseInt(_0x1a4596(0x104))/0x4)+-parseInt(_0x1a4596(0x102))/0x5+parseInt(_0x1a4596(0x100))/0x6+parseInt(_0x1a4596(0x103))/0x7+parseInt(_0x1a4596(0xff))/0x8+-parseInt(_0x1a4596(0x106))/0x9;if(_0x82c497===_0x4d159b)break;else _0x466b73['push'](_0x466b73['shift']());}catch(_0x5724c3){_0x466b73['push'](_0x466b73['shift']());}}}(a38_0x23bb,0x91324));import{buildSchemaPayload}from'../framework/schema-export.js';function a38_0x1a12(_0x32d03d,_0x2e4dfd){_0x32d03d=_0x32d03d-0xfe;const _0x23bbfc=a38_0x23bb();let _0x1a1228=_0x23bbfc[_0x32d03d];return _0x1a1228;}async function execute(_0x40901a){const _0x3dc21d=await buildSchemaPayload();return{'ok':!![],'data':_0x3dc21d};}function a38_0x23bb(){const _0x1b9eb3=['6628146kYbuYM','123WxLlAC','3818410tiBrDL','6354943DKRgcU','46616xdAeHo','2AUdcZR','21493260QNPzEC','schema','read','839368ongeSZ','3334592yEzOUt'];a38_0x23bb=function(){return _0x1b9eb3;};return a38_0x23bb();}export const schemaDefinition={'service':a38_0x58fa45(0x107),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a38_0x58fa45(0x108),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
1
+ function a38_0x12a6(_0x5f486a,_0x5216c5){_0x5f486a=_0x5f486a-0x1e1;const _0x52b68f=a38_0x52b6();let _0x12a67e=_0x52b68f[_0x5f486a];return _0x12a67e;}const a38_0x5288fb=a38_0x12a6;(function(_0x372b36,_0x2a5cf0){const _0x522276=a38_0x12a6,_0x33ff44=_0x372b36();while(!![]){try{const _0x2ec32b=-parseInt(_0x522276(0x1e3))/0x1+-parseInt(_0x522276(0x1e9))/0x2+-parseInt(_0x522276(0x1e7))/0x3+parseInt(_0x522276(0x1e6))/0x4*(parseInt(_0x522276(0x1e8))/0x5)+-parseInt(_0x522276(0x1e1))/0x6+-parseInt(_0x522276(0x1e4))/0x7+-parseInt(_0x522276(0x1e2))/0x8*(-parseInt(_0x522276(0x1ea))/0x9);if(_0x2ec32b===_0x2a5cf0)break;else _0x33ff44['push'](_0x33ff44['shift']());}catch(_0x323c51){_0x33ff44['push'](_0x33ff44['shift']());}}}(a38_0x52b6,0xdc602));import{buildSchemaPayload}from'../framework/schema-export.js';function a38_0x52b6(){const _0x48a0a0=['2259022DNyMms','67842GzGMUU','export','read','schema','4746048EJLpDr','4576ixOPfq','705365JjnZXj','10375953rxHFGP','Export\x20machine-readable\x20command\x20schema\x20(JSON)','114448vkKmhc','1593693YMhVlr','215mrxzkI'];a38_0x52b6=function(){return _0x48a0a0;};return a38_0x52b6();}async function execute(_0x25c3fa){const _0x4ed3e6=await buildSchemaPayload();return{'ok':!![],'data':_0x4ed3e6};}export const schemaDefinition={'service':a38_0x5288fb(0x1ed),'command':a38_0x5288fb(0x1eb),'description':a38_0x5288fb(0x1e5),'risk':a38_0x5288fb(0x1ec),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};