@lovrabet/lovrabet-cli 2.2.1-beta.1 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a28_0x2ffc(){const _0x24fcf8=['5922QqEdCf','122661aPWCoD','8CLFhRi','3027031dLkpaV','code','dataset','str','325854DYmhsk','238490QQSvEJ','3yCkCTW','626440mFdDsz','appCode','628155Vjvoty','sdk-doc','88KierZU','20PJxYhK'];a28_0x2ffc=function(){return _0x24fcf8;};return a28_0x2ffc();}const a28_0x1ee5db=a28_0x4323;(function(_0x1e847c,_0x293e76){const _0x26b0fa=a28_0x4323,_0x4192ba=_0x1e847c();while(!![]){try{const _0x3ab586=parseInt(_0x26b0fa(0x168))/0x1+-parseInt(_0x26b0fa(0x163))/0x2*(parseInt(_0x26b0fa(0x165))/0x3)+parseInt(_0x26b0fa(0x166))/0x4*(-parseInt(_0x26b0fa(0x16b))/0x5)+-parseInt(_0x26b0fa(0x15c))/0x6+-parseInt(_0x26b0fa(0x15f))/0x7*(-parseInt(_0x26b0fa(0x15e))/0x8)+-parseInt(_0x26b0fa(0x15d))/0x9+-parseInt(_0x26b0fa(0x164))/0xa*(-parseInt(_0x26b0fa(0x16a))/0xb);if(_0x3ab586===_0x293e76)break;else _0x4192ba['push'](_0x4192ba['shift']());}catch(_0x25cabf){_0x4192ba['push'](_0x4192ba['shift']());}}}(a28_0x2ffc,0x6d3a5));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN='#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档';function a28_0x4323(_0x2556d4,_0x53f505){_0x2556d4=_0x2556d4-0x15c;const _0x2ffc46=a28_0x2ffc();let _0x432335=_0x2ffc46[_0x2556d4];return _0x432335;}export function formatDatasetSdkMarkdown(_0x32e7d6){const _0x282bdf=typeof _0x32e7d6==='string'?_0x32e7d6['trim']():'';return _0x282bdf||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a28_0x1ee5db(0x161),'command':a28_0x1ee5db(0x169),'description':'Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','risk':'read','flags':[{...CODE_FLAG,'description':'Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.'}],async 'execute'(_0x50ab19){const _0x5213d4=a28_0x1ee5db,_0x53a7e6=_0x50ab19[_0x5213d4(0x162)](_0x5213d4(0x160)),_0x1dd671=await getDatasetSdkUsageDoc(_0x53a7e6,_0x50ab19['appCode']);return{'ok':!![],'data':{'code':_0x53a7e6,'appCode':_0x50ab19[_0x5213d4(0x167)],'markdown':formatDatasetSdkMarkdown(_0x1dd671)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x534ddf=a29_0x3237;(function(_0x46ef23,_0x103f1b){const _0x4e73cb=a29_0x3237,_0x19afa6=_0x46ef23();while(!![]){try{const _0x3d43a3=parseInt(_0x4e73cb(0x99))/0x1*(parseInt(_0x4e73cb(0xb8))/0x2)+-parseInt(_0x4e73cb(0xb1))/0x3+-parseInt(_0x4e73cb(0xaf))/0x4+-parseInt(_0x4e73cb(0xbe))/0x5+-parseInt(_0x4e73cb(0xbb))/0x6+-parseInt(_0x4e73cb(0x7e))/0x7+parseInt(_0x4e73cb(0xc9))/0x8;if(_0x3d43a3===_0x103f1b)break;else _0x19afa6['push'](_0x19afa6['shift']());}catch(_0x3b2c71){_0x19afa6['push'](_0x19afa6['shift']());}}}(a29_0x278e,0x3828a));import a29_0xb411fa from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a29_0x3237(_0x16d2d3,_0x26fc55){_0x16d2d3=_0x16d2d3-0x77;const _0x278e12=a29_0x278e();let _0x3237e8=_0x278e12[_0x16d2d3];return _0x3237e8;}import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';function a29_0x278e(){const _0x4143b5=['padEnd','\x20\x20Repair:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20JSON','registryPath','✓\x20Valid\x20JSON','name','locale','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20─','green','(not\x20found)','verbose','(not\x20set)','\x20(legacy/compat\x20only)','\x20\x20auth\x20(effective):\x20','arch','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','(no\x20file)','773208VSzhuL','\x20\x20Installed\x20Path:\x20\x20','321309drsqrq','packageVersion','doctor','\x20\x20Config\x20Files','source','ClientAk','(default)','28zEAaAq','missing','\x20commands)','1905492neVSds','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20Built-in\x20Skill','252685SxgdjR','reason','red','format','⚠\x20Empty\x20(treated\x20as\x20{})','✓\x20current','\x20\x20Merged\x20Config','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(unnamed)','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','7603384AiYljX','riskLevel','✓\x20Loaded','(removed\x20—\x20cookie\x20auth\x20disabled)','version','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Skill\x20Version:\x20\x20\x20','empty','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','current','bold','serviceCode','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','appCode','path','serviceCount','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','2981769FIuGCL','gray','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20State:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','accessKey','log','Project','(missing)','yellow','repairCommand','state','✗\x20Invalid','installedPath','repeat','\x20Imported\x20from:\x20','\x20\x20Auth','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','read','(none)','defaultApp','(default:\x20','message','\x20\x20Package\x20Version:\x20','pageSize','status','currentApp','26721fhKyrR','(set,\x20length=','env','✗\x20Invalid\x20JSON'];a29_0x278e=function(){return _0x4143b5;};return a29_0x278e();}import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';import{inspectBuiltinSkill}from'../skills/builtin-skill.js';async function execute(_0x1402e3){const _0x2af583=a29_0x3237,_0x319672=getCliVersion(),_0x98461=buildConfigFromFlags({});await initGlobalEnvironment(_0x98461),console[_0x2af583(0x83)](),console[_0x2af583(0x83)](a29_0xb411fa[_0x2af583(0x77)](CLI_BIN_NAME+'\x20doctor')),console[_0x2af583(0x83)](a29_0xb411fa[_0x2af583(0x7f)]('─'[_0x2af583(0x8b)](0x32))),console[_0x2af583(0x83)](_0x2af583(0xad)+_0x319672),console[_0x2af583(0x83)](_0x2af583(0xd2)+process[_0x2af583(0xcd)]),console[_0x2af583(0x83)](_0x2af583(0x8e)+process['platform']+'\x20'+process[_0x2af583(0xac)]);const _0x30add5=inspectBuiltinSkill();console[_0x2af583(0x83)](),console[_0x2af583(0x83)](a29_0xb411fa[_0x2af583(0x77)](_0x2af583(0xbd))),console[_0x2af583(0x83)](a29_0xb411fa[_0x2af583(0x7f)](_0x2af583(0xa5)[_0x2af583(0x8b)](0x1e))),console[_0x2af583(0x83)](_0x2af583(0x81)+(_0x30add5[_0x2af583(0x88)]===_0x2af583(0xd3)?a29_0xb411fa[_0x2af583(0xa6)](_0x2af583(0xc3)):a29_0xb411fa['red']('✗\x20'+_0x30add5[_0x2af583(0x88)]))),console[_0x2af583(0x83)](_0x2af583(0x95)+_0x30add5[_0x2af583(0xb2)]),console['log'](_0x2af583(0xd0)+(_0x30add5['skillVersion']||a29_0xb411fa[_0x2af583(0x7f)](_0x2af583(0x85)))),console[_0x2af583(0x83)](_0x2af583(0xb0)+(_0x30add5[_0x2af583(0x8a)]||a29_0xb411fa[_0x2af583(0x7f)](_0x2af583(0xa7))));_0x30add5[_0x2af583(0x88)]!==_0x2af583(0xd3)&&console['log'](_0x2af583(0x9e)+_0x30add5[_0x2af583(0x87)]);_0x30add5[_0x2af583(0xbf)]&&console['log']('\x20\x20Reason:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x30add5['reason']);console[_0x2af583(0x83)](),console[_0x2af583(0x83)](a29_0xb411fa[_0x2af583(0x77)](_0x2af583(0xb4))),console['log'](a29_0xb411fa['gray'](_0x2af583(0xa5)[_0x2af583(0x8b)](0x1e)));const _0x9ddd2f=getGlobalConfigPath(),_0x49d5f5=getProjectConfigPath();console['log']('\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x9ddd2f||a29_0xb411fa[_0x2af583(0x7f)](_0x2af583(0xa7)))),console[_0x2af583(0x83)](_0x2af583(0xc5)+(_0x49d5f5||a29_0xb411fa[_0x2af583(0x7f)]('(not\x20found)'))),console[_0x2af583(0x83)](),console[_0x2af583(0x83)](a29_0xb411fa[_0x2af583(0x77)](_0x2af583(0x9f))),console[_0x2af583(0x83)](a29_0xb411fa[_0x2af583(0x7f)]('\x20\x20─'['repeat'](0x1e)));const _0x2c7a26=(_0x28a3bf,_0x4597db)=>{const _0x119afd=_0x2af583;if(!_0x4597db){console[_0x119afd(0x83)]('\x20\x20'+_0x28a3bf[_0x119afd(0x9d)](0x11)+'\x20'+a29_0xb411fa[_0x119afd(0x7f)](_0x119afd(0xae)));return;}const _0x3fe177=inspectCliConfigJsonFile(_0x4597db);if(_0x3fe177[_0x119afd(0x97)]==='ok')console[_0x119afd(0x83)]('\x20\x20'+_0x28a3bf['padEnd'](0x11)+'\x20'+a29_0xb411fa['green'](_0x119afd(0xa1)));else{if(_0x3fe177[_0x119afd(0x97)]===_0x119afd(0xd1))console[_0x119afd(0x83)]('\x20\x20'+_0x28a3bf['padEnd'](0x11)+'\x20'+a29_0xb411fa['yellow'](_0x119afd(0xc2)));else _0x3fe177[_0x119afd(0x97)]==='missing'?console[_0x119afd(0x83)]('\x20\x20'+_0x28a3bf['padEnd'](0x11)+'\x20'+a29_0xb411fa[_0x119afd(0x7f)](_0x119afd(0x85))):(console['log']('\x20\x20'+_0x28a3bf['padEnd'](0x11)+'\x20'+a29_0xb411fa[_0x119afd(0xc0)](_0x119afd(0x9c))),console[_0x119afd(0x83)]('\x20\x20'+''[_0x119afd(0x9d)](0x11)+'\x20'+a29_0xb411fa['red'](_0x3fe177[_0x119afd(0x94)])));}};_0x2c7a26('Global',_0x9ddd2f),_0x2c7a26(_0x2af583(0x84),_0x49d5f5),console['log'](),console[_0x2af583(0x83)](a29_0xb411fa['bold'](_0x2af583(0xc4))),console[_0x2af583(0x83)](a29_0xb411fa[_0x2af583(0x7f)](_0x2af583(0xa5)[_0x2af583(0x8b)](0x1e))),console[_0x2af583(0x83)](_0x2af583(0xc7)+(_0x98461[_0x2af583(0x7a)]||a29_0xb411fa[_0x2af583(0xc0)](_0x2af583(0xa9)))),console[_0x2af583(0x83)]('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x98461[_0x2af583(0x9b)]);const _0x1f960c=isLegacyCompatConfigKey(_0x2af583(0xa3))?a29_0xb411fa[_0x2af583(0x7f)](_0x98461['locale']+_0x2af583(0xaa)):_0x98461[_0x2af583(0xa3)];console['log'](_0x2af583(0x79)+_0x1f960c),console[_0x2af583(0x83)]('\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'+(_0x98461[_0x2af583(0x92)]||a29_0xb411fa['gray'](_0x2af583(0x91)))),console['log'](_0x2af583(0xbc)+(_0x98461[_0x2af583(0x98)]||a29_0xb411fa[_0x2af583(0x7f)]('(none)'))),console[_0x2af583(0x83)](_0x2af583(0xc8)+(_0x98461[_0x2af583(0xc1)]||a29_0xb411fa[_0x2af583(0x7f)](_0x2af583(0x93)+DEFAULT_CONFIG_VALUES[_0x2af583(0xc1)]+')'))),console['log'](_0x2af583(0xa4)+(_0x98461[_0x2af583(0x96)]??a29_0xb411fa[_0x2af583(0x7f)](_0x2af583(0xb7)))),console[_0x2af583(0x83)](_0x2af583(0xce)+_0x98461[_0x2af583(0xca)]),console[_0x2af583(0x83)]('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x98461[_0x2af583(0xa8)]),console['log'](_0x2af583(0xab)+AUTH_MODE[_0x2af583(0xb6)]),console[_0x2af583(0x83)]('\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20'+(_0x98461['accessKey']?a29_0xb411fa[_0x2af583(0xa6)](_0x2af583(0x9a)+_0x98461[_0x2af583(0x82)]['length']+')'):a29_0xb411fa[_0x2af583(0x7f)](_0x2af583(0x91)))),console['log'](),console[_0x2af583(0x83)](a29_0xb411fa[_0x2af583(0x77)]('\x20\x20API\x20Endpoints')),console['log'](a29_0xb411fa[_0x2af583(0x7f)]('\x20\x20─'[_0x2af583(0x8b)](0x1e))),console['log']('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x2af583(0x83)]('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console[_0x2af583(0x83)]('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x2af583(0x83)](),console[_0x2af583(0x83)](a29_0xb411fa['bold']('\x20\x20Service\x20Tree')),console[_0x2af583(0x83)](a29_0xb411fa['gray'](_0x2af583(0xa5)[_0x2af583(0x8b)](0x1e)));const _0x8e369=inspectServiceRegistry();console[_0x2af583(0x83)](_0x2af583(0x8f)+_0x8e369[_0x2af583(0xa0)]),console['log'](_0x2af583(0x7d)+formatServiceRegistryStatus(_0x8e369)),console[_0x2af583(0x83)](_0x2af583(0xcf)+_0x8e369[_0x2af583(0x7c)]),console['log'](_0x2af583(0x80)+_0x8e369['commandCount']);for(const _0xbb07d0 of _0x8e369['services']){console[_0x2af583(0x83)]('\x20\x20'+(_0xbb07d0[_0x2af583(0x78)]+':')['padEnd'](0x11)+'\x20'+(_0xbb07d0[_0x2af583(0xa2)]||a29_0xb411fa['gray'](_0x2af583(0xc6)))+'\x20('+_0xbb07d0['commandCount']+_0x2af583(0xba)),console[_0x2af583(0x83)]('\x20\x20'+''[_0x2af583(0x9d)](0x11)+_0x2af583(0x8c)+_0xbb07d0[_0x2af583(0xb5)][_0x2af583(0x7b)]);}return console[_0x2af583(0x83)](),console[_0x2af583(0x83)](a29_0xb411fa[_0x2af583(0x77)](_0x2af583(0x8d))),console[_0x2af583(0x83)](a29_0xb411fa['gray'](_0x2af583(0xa5)['repeat'](0x1e))),console[_0x2af583(0x83)]('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a29_0xb411fa[_0x2af583(0xa6)](AUTH_MODE[_0x2af583(0xb6)]+'\x20(accessKey)')),console[_0x2af583(0x83)]('\x20\x20Session\x20check:\x20\x20\x20'+a29_0xb411fa[_0x2af583(0x7f)](_0x2af583(0xcc))),console[_0x2af583(0x83)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x3f5cd1){const _0x274712=a29_0x3237;if(_0x3f5cd1['status']==='ok')return a29_0xb411fa[_0x274712(0xa6)](_0x274712(0xcb));if(_0x3f5cd1['status']===_0x274712(0xb9))return a29_0xb411fa[_0x274712(0x7f)](_0x274712(0xa7));if(_0x3f5cd1[_0x274712(0x97)]===_0x274712(0xd1))return a29_0xb411fa[_0x274712(0x86)]('⚠\x20Empty');return a29_0xb411fa[_0x274712(0xc0)](_0x274712(0x89)+(_0x3f5cd1[_0x274712(0x94)]?':\x20'+_0x3f5cd1['message']:''));}export const doctorDefinition={'service':a29_0x534ddf(0xb3),'command':'check','description':'Diagnose\x20CLI\x20configuration\x20and\x20environment','risk':a29_0x534ddf(0x90),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
1
|
+
function a29_0x18a7(){const _0x296add=['repairCommand','commandCount','\x20(legacy/compat\x20only)','padEnd','516566ptmJWY','(none)','log','red','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','ClientAk','serviceCount','1729101ffNFRX','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20─','4868370PjQyZl','\x20\x20Repair:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','gray','arch','(set,\x20length=','⚠\x20Empty\x20(treated\x20as\x20{})','\x20\x20Merged\x20Config','\x20\x20Config\x20Files','(no\x20file)','accessKey','packageVersion','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','11dTqeze','currentApp','state','Project','check','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','source','current','⚠\x20Empty','read','\x20\x20API\x20Endpoints','pageSize','\x20(accessKey)','2iDNwNH','empty','790OkaxUH','✗\x20Invalid','(default:\x20','✗\x20Invalid\x20JSON','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','repeat','Diagnose\x20CLI\x20configuration\x20and\x20environment','3913931AVskIx','8LUOLQj','path','missing','\x20doctor','status','message','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','appCode','\x20\x20Built-in\x20Skill','3076UlJdfv','\x20commands)','6CVCJJU','✓\x20Loaded','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20JSON','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20Service\x20Tree','name','doctor','yellow','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20set)','(missing)','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Global','bold','installedPath','locale','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','green','(default)','reason','(not\x20found)','\x20\x20Auth','4488003TBToHP','env','(unnamed)','684912CdUEkH','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','registryPath','\x20Imported\x20from:\x20','format','\x20\x20runtimeDomain:\x20\x20\x20','skillVersion'];a29_0x18a7=function(){return _0x296add;};return a29_0x18a7();}const a29_0xdd2a81=a29_0x1aee;(function(_0x12b119,_0x1fd7ca){const _0x56a463=a29_0x1aee,_0x1389b2=_0x12b119();while(!![]){try{const _0x333b39=parseInt(_0x56a463(0x11b))/0x1*(-parseInt(_0x56a463(0x141))/0x2)+parseInt(_0x56a463(0x122))/0x3+parseInt(_0x56a463(0x155))/0x4*(-parseInt(_0x56a463(0x143))/0x5)+parseInt(_0x56a463(0x157))/0x6*(-parseInt(_0x56a463(0x14b))/0x7)+-parseInt(_0x56a463(0x14c))/0x8*(-parseInt(_0x56a463(0x10d))/0x9)+parseInt(_0x56a463(0x126))/0xa+parseInt(_0x56a463(0x134))/0xb*(-parseInt(_0x56a463(0x110))/0xc);if(_0x333b39===_0x1fd7ca)break;else _0x1389b2['push'](_0x1389b2['shift']());}catch(_0x3cde8e){_0x1389b2['push'](_0x1389b2['shift']());}}}(a29_0x18a7,0x4b18a));import a29_0x4da7c0 from'chalk';function a29_0x1aee(_0x9a1dfa,_0x1358cb){_0x9a1dfa=_0x9a1dfa-0xf5;const _0x18a7d2=a29_0x18a7();let _0x1aee96=_0x18a7d2[_0x9a1dfa];return _0x1aee96;}import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';import{inspectBuiltinSkill}from'../skills/builtin-skill.js';async function execute(_0x19fef2){const _0x13c366=a29_0x1aee,_0x2964e6=getCliVersion(),_0x5a6578=buildConfigFromFlags({});await initGlobalEnvironment(_0x5a6578),console['log'](),console[_0x13c366(0x11d)](a29_0x4da7c0['bold'](CLI_BIN_NAME+_0x13c366(0x14f))),console[_0x13c366(0x11d)](a29_0x4da7c0['gray']('─'[_0x13c366(0x149)](0x32))),console[_0x13c366(0x11d)](_0x13c366(0x139)+_0x2964e6),console[_0x13c366(0x11d)](_0x13c366(0x123)+process['version']),console['log'](_0x13c366(0xfd)+process['platform']+'\x20'+process[_0x13c366(0x129)]);const _0xdc55e8=inspectBuiltinSkill();console[_0x13c366(0x11d)](),console['log'](a29_0x4da7c0[_0x13c366(0x103)](_0x13c366(0x154))),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x128)]('\x20\x20─'[_0x13c366(0x149)](0x1e))),console[_0x13c366(0x11d)]('\x20\x20State:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0xdc55e8[_0x13c366(0x136)]==='current'?a29_0x4da7c0[_0x13c366(0x108)]('✓\x20current'):a29_0x4da7c0['red']('✗\x20'+_0xdc55e8[_0x13c366(0x136)]))),console['log']('\x20\x20Package\x20Version:\x20'+_0xdc55e8[_0x13c366(0x130)]),console[_0x13c366(0x11d)]('\x20\x20Skill\x20Version:\x20\x20\x20'+(_0xdc55e8[_0x13c366(0x116)]||a29_0x4da7c0[_0x13c366(0x128)]('(missing)'))),console[_0x13c366(0x11d)]('\x20\x20Installed\x20Path:\x20\x20'+(_0xdc55e8[_0x13c366(0x104)]||a29_0x4da7c0[_0x13c366(0x128)]('(not\x20found)')));_0xdc55e8[_0x13c366(0x136)]!==_0x13c366(0x13b)&&console['log'](_0x13c366(0x127)+_0xdc55e8[_0x13c366(0x117)]);_0xdc55e8[_0x13c366(0x10a)]&&console['log']('\x20\x20Reason:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0xdc55e8[_0x13c366(0x10a)]);console['log'](),console['log'](a29_0x4da7c0['bold'](_0x13c366(0x12d))),console['log'](a29_0x4da7c0[_0x13c366(0x128)]('\x20\x20─'[_0x13c366(0x149)](0x1e)));const _0x1ce552=getGlobalConfigPath(),_0x7f2c53=getProjectConfigPath();console[_0x13c366(0x11d)]('\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x1ce552||a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x10b)))),console[_0x13c366(0x11d)](_0x13c366(0x11f)+(_0x7f2c53||a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x10b)))),console[_0x13c366(0x11d)](),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x103)](_0x13c366(0xf7))),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x125)[_0x13c366(0x149)](0x1e)));const _0xff660a=(_0x467011,_0x299b56)=>{const _0x494ffb=_0x13c366;if(!_0x299b56){console[_0x494ffb(0x11d)]('\x20\x20'+_0x467011['padEnd'](0x11)+'\x20'+a29_0x4da7c0[_0x494ffb(0x128)](_0x494ffb(0x12e)));return;}const _0x120053=inspectCliConfigJsonFile(_0x299b56);if(_0x120053[_0x494ffb(0x150)]==='ok')console['log']('\x20\x20'+_0x467011[_0x494ffb(0x11a)](0x11)+'\x20'+a29_0x4da7c0['green']('✓\x20Valid\x20JSON'));else{if(_0x120053[_0x494ffb(0x150)]==='empty')console[_0x494ffb(0x11d)]('\x20\x20'+_0x467011['padEnd'](0x11)+'\x20'+a29_0x4da7c0[_0x494ffb(0xfc)](_0x494ffb(0x12b)));else _0x120053[_0x494ffb(0x150)]===_0x494ffb(0x14e)?console['log']('\x20\x20'+_0x467011[_0x494ffb(0x11a)](0x11)+'\x20'+a29_0x4da7c0[_0x494ffb(0x128)](_0x494ffb(0xff))):(console[_0x494ffb(0x11d)]('\x20\x20'+_0x467011[_0x494ffb(0x11a)](0x11)+'\x20'+a29_0x4da7c0[_0x494ffb(0x11e)](_0x494ffb(0x146))),console[_0x494ffb(0x11d)]('\x20\x20'+''[_0x494ffb(0x11a)](0x11)+'\x20'+a29_0x4da7c0['red'](_0x120053[_0x494ffb(0x151)])));}};_0xff660a(_0x13c366(0x102),_0x1ce552),_0xff660a(_0x13c366(0x137),_0x7f2c53),console[_0x13c366(0x11d)](),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x103)](_0x13c366(0x12c))),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x125)['repeat'](0x1e))),console['log'](_0x13c366(0x101)+(_0x5a6578[_0x13c366(0x153)]||a29_0x4da7c0[_0x13c366(0x11e)](_0x13c366(0xfe)))),console[_0x13c366(0x11d)]('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5a6578[_0x13c366(0x10e)]);const _0x406851=isLegacyCompatConfigKey('locale')?a29_0x4da7c0[_0x13c366(0x128)](_0x5a6578[_0x13c366(0x105)]+_0x13c366(0x119)):_0x5a6578[_0x13c366(0x105)];console[_0x13c366(0x11d)]('\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x406851),console[_0x13c366(0x11d)](_0x13c366(0x106)+(_0x5a6578['defaultApp']||a29_0x4da7c0['gray'](_0x13c366(0x11c)))),console[_0x13c366(0x11d)](_0x13c366(0x133)+(_0x5a6578[_0x13c366(0x135)]||a29_0x4da7c0['gray'](_0x13c366(0x11c)))),console[_0x13c366(0x11d)](_0x13c366(0x111)+(_0x5a6578[_0x13c366(0x114)]||a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x145)+DEFAULT_CONFIG_VALUES[_0x13c366(0x114)]+')'))),console[_0x13c366(0x11d)](_0x13c366(0x132)+(_0x5a6578[_0x13c366(0x13f)]??a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x109)))),console[_0x13c366(0x11d)](_0x13c366(0x147)+_0x5a6578['riskLevel']),console[_0x13c366(0x11d)](_0x13c366(0xf6)+_0x5a6578['verbose']),console[_0x13c366(0x11d)]('\x20\x20auth\x20(effective):\x20'+AUTH_MODE[_0x13c366(0x120)]),console[_0x13c366(0x11d)](_0x13c366(0x124)+(_0x5a6578[_0x13c366(0x12f)]?a29_0x4da7c0[_0x13c366(0x108)](_0x13c366(0x12a)+_0x5a6578[_0x13c366(0x12f)]['length']+')'):a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x11c)))),console['log'](),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x103)](_0x13c366(0x13e))),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x128)]('\x20\x20─'[_0x13c366(0x149)](0x1e))),console[_0x13c366(0x11d)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x13c366(0x11d)](_0x13c366(0x131)+getUserDomain()),console['log'](_0x13c366(0x115)+getRuntimeDomain()),console[_0x13c366(0x11d)](),console[_0x13c366(0x11d)](a29_0x4da7c0['bold'](_0x13c366(0xf9))),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x128)]('\x20\x20─'['repeat'](0x1e)));const _0x6dfdbf=inspectServiceRegistry();console[_0x13c366(0x11d)](_0x13c366(0x107)+_0x6dfdbf[_0x13c366(0x112)]),console[_0x13c366(0x11d)](_0x13c366(0x148)+formatServiceRegistryStatus(_0x6dfdbf)),console['log'](_0x13c366(0x152)+_0x6dfdbf[_0x13c366(0x121)]),console[_0x13c366(0x11d)](_0x13c366(0x100)+_0x6dfdbf[_0x13c366(0x118)]);for(const _0x50f203 of _0x6dfdbf['services']){console[_0x13c366(0x11d)]('\x20\x20'+(_0x50f203['serviceCode']+':')[_0x13c366(0x11a)](0x11)+'\x20'+(_0x50f203[_0x13c366(0xfa)]||a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x10f)))+'\x20('+_0x50f203[_0x13c366(0x118)]+_0x13c366(0x156)),console['log']('\x20\x20'+''[_0x13c366(0x11a)](0x11)+_0x13c366(0x113)+_0x50f203[_0x13c366(0x13a)][_0x13c366(0x14d)]);}return console[_0x13c366(0x11d)](),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x103)](_0x13c366(0x10c))),console[_0x13c366(0x11d)](a29_0x4da7c0[_0x13c366(0x128)](_0x13c366(0x125)[_0x13c366(0x149)](0x1e))),console[_0x13c366(0x11d)]('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a29_0x4da7c0[_0x13c366(0x108)](AUTH_MODE[_0x13c366(0x120)]+_0x13c366(0x140))),console[_0x13c366(0x11d)](_0x13c366(0xf8)+a29_0x4da7c0[_0x13c366(0x128)]('(removed\x20—\x20cookie\x20auth\x20disabled)')),console['log'](),{'ok':!![]};}function formatServiceRegistryStatus(_0x1322f9){const _0x194bc5=a29_0x1aee;if(_0x1322f9[_0x194bc5(0x150)]==='ok')return a29_0x4da7c0['green'](_0x194bc5(0xf5));if(_0x1322f9['status']===_0x194bc5(0x14e))return a29_0x4da7c0[_0x194bc5(0x128)]('(not\x20found)');if(_0x1322f9['status']===_0x194bc5(0x142))return a29_0x4da7c0[_0x194bc5(0xfc)](_0x194bc5(0x13c));return a29_0x4da7c0[_0x194bc5(0x11e)](_0x194bc5(0x144)+(_0x1322f9[_0x194bc5(0x151)]?':\x20'+_0x1322f9[_0x194bc5(0x151)]:''));}export const doctorDefinition={'service':a29_0xdd2a81(0xfb),'command':a29_0xdd2a81(0x138),'description':a29_0xdd2a81(0x14a),'risk':a29_0xdd2a81(0x13d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x53aae5=a30_0x1bb8;(function(_0x375909,_0x1f9d20){const _0xcc1d92=a30_0x1bb8,_0x48e52b=_0x375909();while(!![]){try{const _0x18dd9d=parseInt(_0xcc1d92(0x1bd))/0x1+-parseInt(_0xcc1d92(0x1d0))/0x2+parseInt(_0xcc1d92(0x1b6))/0x3+-parseInt(_0xcc1d92(0x1b7))/0x4+-parseInt(_0xcc1d92(0x1c8))/0x5+parseInt(_0xcc1d92(0x1d2))/0x6+-parseInt(_0xcc1d92(0x1bb))/0x7*(-parseInt(_0xcc1d92(0x1c3))/0x8);if(_0x18dd9d===_0x1f9d20)break;else _0x48e52b['push'](_0x48e52b['shift']());}catch(_0x40f44b){_0x48e52b['push'](_0x48e52b['shift']());}}}(a30_0x100d,0x44079));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':'file','type':a30_0x53aae5(0x1c6),'required':!![],'description':a30_0x53aae5(0x1cc)},FILEPATH_FLAG={'name':a30_0x53aae5(0x1d4),'type':a30_0x53aae5(0x1c6),'required':!![],'description':a30_0x53aae5(0x1ae)},DOWNLOAD_FLAG={'name':a30_0x53aae5(0x1ba),'type':a30_0x53aae5(0x1b2),'description':a30_0x53aae5(0x1c1)},LONG_TERM_FLAG={'name':'long-term','type':a30_0x53aae5(0x1b2),'description':a30_0x53aae5(0x1cf)};function a30_0x1bb8(_0x5c19b6,_0x322ad5){_0x5c19b6=_0x5c19b6-0x1ae;const _0x100d44=a30_0x100d();let _0x1bb812=_0x100d44[_0x5c19b6];return _0x1bb812;}function requireFilePath(_0x4571e9){const _0x47c868=a30_0x53aae5,_0x14690d=_0x4571e9[_0x47c868(0x1c7)]();if(!_0x14690d)throw CliErrors[_0x47c868(0x1d3)](_0x47c868(0x1bf));return _0x14690d;}function a30_0x100d(){const _0x2c5a58=['7IgZAZB','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','88790VUlCfL','POST','filePath\x20is\x20required.','file','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','5624184ixOvzf','long-term','query-url','string','trim','489905iITGgK','build','filePath','body','Path\x20to\x20the\x20local\x20file\x20to\x20upload','str','bool','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','945260mQURAv','description','295794tvXQZE','validation','filepath','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','Uploaded\x20file:\x20','/client/uploadFile','path','boolean','read','Preview:\x20upload\x20','File','1344891ojgEne','1760596BEtAbU','appCode','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','download'];a30_0x100d=function(){return _0x2c5a58;};return a30_0x100d();}const fileUpload={'service':'file','command':'upload','description':a30_0x53aae5(0x1b9),'risk':a30_0x53aae5(0x1b3),'flags':[FILE_FLAG],async 'dryRun'(_0x2294a9){const _0x24523c=a30_0x53aae5,_0x12dcdf=requireRuntimeUploadFile(_0x2294a9[_0x24523c(0x1cd)](_0x24523c(0x1c0)),_0x24523c(0x1b5));return dryRun(_0x24523c(0x1be),_0x24523c(0x1b0))[_0x24523c(0x1cb)]({'appCode':_0x2294a9[_0x24523c(0x1b8)],'multipart':{'file':_0x12dcdf}})[_0x24523c(0x1d1)](_0x24523c(0x1b4)+_0x12dcdf[_0x24523c(0x1b1)]+'\x20to\x20runtime\x20app\x20'+_0x2294a9[_0x24523c(0x1b8)])[_0x24523c(0x1c9)]();},async 'execute'(_0x344f1e){const _0x4a9cf1=a30_0x53aae5,_0x3c4e37=requireRuntimeUploadFile(_0x344f1e['str'](_0x4a9cf1(0x1c0)),_0x4a9cf1(0x1b5)),_0x832128=await uploadRuntimeFile(_0x344f1e['appCode'],_0x3c4e37['path']);return{'ok':!![],'data':_0x832128,'message':_0x832128[_0x4a9cf1(0x1ca)]?_0x4a9cf1(0x1af)+_0x832128[_0x4a9cf1(0x1ca)]+_0x4a9cf1(0x1c2):_0x4a9cf1(0x1bc)};}},fileQueryUrl={'service':a30_0x53aae5(0x1c0),'command':a30_0x53aae5(0x1c5),'description':'Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','risk':a30_0x53aae5(0x1b3),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x32137d){const _0x363eed=a30_0x53aae5,_0x52ead8=requireFilePath(_0x32137d['str'](_0x363eed(0x1d4))),_0x14b9cb=await queryRuntimeFileUrl(_0x52ead8,{'download':_0x32137d[_0x363eed(0x1ce)](_0x363eed(0x1ba)),'longTerm':_0x32137d['bool'](_0x363eed(0x1c4))});return{'ok':!![],'data':_0x14b9cb};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x147ca7=a31_0x83b9;(function(_0x502863,_0x5b2d02){const _0x2d3ad7=a31_0x83b9,_0x51b42a=_0x502863();while(!![]){try{const _0xc58969=-parseInt(_0x2d3ad7(0x179))/0x1+-parseInt(_0x2d3ad7(0x17d))/0x2+parseInt(_0x2d3ad7(0x17a))/0x3*(-parseInt(_0x2d3ad7(0x16e))/0x4)+parseInt(_0x2d3ad7(0x16a))/0x5+parseInt(_0x2d3ad7(0x176))/0x6*(-parseInt(_0x2d3ad7(0x159))/0x7)+parseInt(_0x2d3ad7(0x15f))/0x8+-parseInt(_0x2d3ad7(0x168))/0x9*(-parseInt(_0x2d3ad7(0x15a))/0xa);if(_0xc58969===_0x5b2d02)break;else _0x51b42a['push'](_0x51b42a['shift']());}catch(_0x425005){_0x51b42a['push'](_0x51b42a['shift']());}}}(a31_0x2eb7,0xe58a0));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';function a31_0x2eb7(){const _0x19f769=['Invalid\x20env\x20\x22','file','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','cwd','log','Imported\x20from\x20','9mnAukh','entries','4548135gqNCCd','\x22.\x20Allowed:\x20','global','message','16AgZKji','Write\x20to\x20global\x20(~/','includes','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','env','appcode','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','object','222qMhbIv','project','yes','1558980LdCAuK','877842aJoGAq','string','validation','3039680CskBbC','defaultApp','apps','Override\x20imported\x20default\x20appcode','214543OTKeCT','47214710vdJzpy','riskLevel','\x20\x20appcode:\x20','newConfigFileName','\x20\x20config:\x20\x20','5539064nqgJbF','Override\x20imported\x20default\x20env','parse'];a31_0x2eb7=function(){return _0x19f769;};return a31_0x2eb7();}import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';function a31_0x83b9(_0x102202,_0x3691fb){_0x102202=_0x102202-0x158;const _0x2eb771=a31_0x2eb7();let _0x83b942=_0x2eb771[_0x102202];return _0x83b942;}import{PRODUCT_CONFIG}from'../constant/product.js';export const appImportFlagDefs=[{'name':'file','type':a31_0x147ca7(0x17b),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x147ca7(0x173),'type':a31_0x147ca7(0x17b),'description':a31_0x147ca7(0x158)},{'name':a31_0x147ca7(0x172),'type':a31_0x147ca7(0x17b),'description':a31_0x147ca7(0x160),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x147ca7(0x16c),'type':'boolean','description':a31_0x147ca7(0x16f)+PRODUCT_CONFIG[a31_0x147ca7(0x15d)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x147ca7(0x178),'type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runAppImport(_0x4c53b3){const _0x3b02b1=a31_0x147ca7,_0x233073=_0x4c53b3[_0x3b02b1(0x16c)]?_0x3b02b1(0x16c):_0x3b02b1(0x177),_0x530b5d=resolveWriteConfigPath(_0x233073);await runFromImport(_0x4c53b3,_0x530b5d);}async function runFromImport(_0x19bd36,_0x2a1555){const _0x53561b=a31_0x147ca7,_0x3de070=resolveFilePath(_0x19bd36[_0x53561b(0x163)]);if(!existsSync(_0x3de070))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0x3de070);const _0x59f5af=readSourceFile(_0x3de070),_0x53efac=convertToRuntimeConfig(_0x59f5af);_0x19bd36['appcode']&&(_0x53efac[_0x53561b(0x173)]=String(_0x19bd36['appcode']));_0x19bd36[_0x53561b(0x172)]&&(_0x53efac[_0x53561b(0x172)]=resolveImportEnv(_0x19bd36));if(!_0x53efac[_0x53561b(0x173)])throw CliErrors[_0x53561b(0x17c)](_0x53561b(0x164),_0x53561b(0x171));await writeImportConfig(_0x2a1555,_0x53efac,_0x19bd36),console[_0x53561b(0x166)](_0x53561b(0x167)+_0x3de070),console[_0x53561b(0x166)](_0x53561b(0x15e)+_0x2a1555),console[_0x53561b(0x166)](_0x53561b(0x15c)+_0x53efac[_0x53561b(0x173)]);if(_0x53efac[_0x53561b(0x17e)])console[_0x53561b(0x166)]('\x20\x20default:\x20'+_0x53efac[_0x53561b(0x17e)]);}function convertToRuntimeConfig(_0x29d5b0){const _0x406b5a=a31_0x147ca7;if(_0x29d5b0[_0x406b5a(0x17f)]&&typeof _0x29d5b0[_0x406b5a(0x17f)]===_0x406b5a(0x175))throw CliErrors['validation'](_0x406b5a(0x174),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x520981={};for(const _0x3f5374 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x29d5b0[_0x3f5374]!==undefined&&(_0x520981[_0x3f5374]=_0x29d5b0[_0x3f5374]);}return!_0x520981[_0x406b5a(0x15b)]&&(_0x520981[_0x406b5a(0x15b)]=DEFAULT_CONFIG_VALUES[_0x406b5a(0x15b)]),_0x520981;}async function writeImportConfig(_0x508ff4,_0x46c55e,_0x2ea3c1){const _0x1f9fee=a31_0x147ca7;let _0x1af424={};existsSync(_0x508ff4)&&!_0x2ea3c1[_0x1f9fee(0x178)]&&(_0x1af424=readConfigFile(_0x508ff4));for(const [_0x48b272,_0x499415]of Object[_0x1f9fee(0x169)](_0x46c55e)){_0x499415!==undefined&&(_0x1af424[_0x48b272]=_0x499415);}if(_0x1af424['app'])delete _0x1af424['app'];writeConfigFile(_0x508ff4,_0x1af424);}function resolveFilePath(_0x2b5641){const _0x17397a=a31_0x147ca7;return isAbsolute(_0x2b5641)?_0x2b5641:resolve(process[_0x17397a(0x165)](),_0x2b5641);}function readSourceFile(_0x29a6bd){const _0x443c7f=a31_0x147ca7;try{const _0x12b888=readFileSync(_0x29a6bd,{'encoding':'utf8'});return JSON[_0x443c7f(0x161)](_0x12b888);}catch(_0x3a364d){throw CliErrors[_0x443c7f(0x17c)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x3a364d[_0x443c7f(0x16d)]);}}function resolveImportEnv(_0x58a0f9){const _0x1f8140=a31_0x147ca7,_0x62c7cb=_0x58a0f9[_0x1f8140(0x172)];if(_0x62c7cb===undefined||_0x62c7cb==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x1f8140(0x170)](_0x62c7cb))throw CliErrors['validation'](_0x1f8140(0x162)+_0x62c7cb+_0x1f8140(0x16b)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x62c7cb;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a32_0x3b0d(_0x1745f9,_0x5b8ce6){_0x1745f9=_0x1745f9-0x1cc;const _0x41de7f=a32_0x41de();let _0x3b0d06=_0x41de7f[_0x1745f9];return _0x3b0d06;}const a32_0x52a7b6=a32_0x3b0d;(function(_0x1433cc,_0x256a5e){const _0x24f941=a32_0x3b0d,_0xf62ec3=_0x1433cc();while(!![]){try{const _0x35d16c=parseInt(_0x24f941(0x1d8))/0x1+parseInt(_0x24f941(0x20b))/0x2+-parseInt(_0x24f941(0x1df))/0x3*(parseInt(_0x24f941(0x1e7))/0x4)+-parseInt(_0x24f941(0x1fd))/0x5*(-parseInt(_0x24f941(0x20c))/0x6)+-parseInt(_0x24f941(0x202))/0x7+parseInt(_0x24f941(0x1f9))/0x8+-parseInt(_0x24f941(0x1e9))/0x9;if(_0x35d16c===_0x256a5e)break;else _0xf62ec3['push'](_0xf62ec3['shift']());}catch(_0x325384){_0xf62ec3['push'](_0xf62ec3['shift']());}}}(a32_0x41de,0xcae00));import{existsSync,readFileSync,statSync}from'node:fs';function a32_0x41de(){const _0x50a3f3=['isFinite','create','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','4265597ONFkKT','string','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','length','score','docId','weightedScore','Override\x20the\x20existing\x20entry\x20title','964020IHQuCS','12jSEXKh','isFile','content','version','query','Search\x20query\x20is\x20required.','--topk\x20must\x20be\x20a\x20positive\x20number.','map','/update','Created\x20KB\x20entry\x20','file','num','ragErrorMessage','/client/knowledge-base/personal/create','verbose','File\x20path\x20is\x20required.','1658188zmYhjH','Personal\x20knowledge-base\x20entry\x20ID','用本地文件内容替换个人知识库条目正文,并触发新的检索同步。','trim','scope','metadata','userId','255zfYUCJ','POST','ragStatus','number','topk','Updated\x20KB\x20entry\x20','update','validation','4804VEToUJ','Personal\x20knowledge-base\x20entry\x20title','17218962kweTIr','appCode','根据本地文件创建个人知识库条目','description','updateTime','search','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','body','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','/client/knowledge-base/personal/','write','File\x20is\x20not\x20a\x20regular\x20file:\x20','list','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','read','把本地文件内容保存为个人知识库条目,并进入后续检索同步流程。','5950912oikZpv','str','根据本地文件更新个人知识库条目','createTime','1428970dGKjKA','title'];a32_0x41de=function(){return _0x50a3f3;};return a32_0x41de();}import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x52a7b6(0x1fe),'type':a32_0x52a7b6(0x203),'required':!![],'description':a32_0x52a7b6(0x1e8)},FILE_FLAG={'name':a32_0x52a7b6(0x1d2),'type':a32_0x52a7b6(0x203),'required':!![],'description':a32_0x52a7b6(0x1f1)},QUERY_FLAG={'name':a32_0x52a7b6(0x1cc),'type':'string','required':!![],'description':a32_0x52a7b6(0x1f6)},TOPK_FLAG={'name':'topk','type':a32_0x52a7b6(0x1e2),'description':a32_0x52a7b6(0x204)};function readKnowledgeFile(_0x3396e5){const _0x15090c=a32_0x52a7b6;if(!_0x3396e5)throw CliErrors[_0x15090c(0x1e6)](_0x15090c(0x1d7));if(!existsSync(_0x3396e5))throw CliErrors[_0x15090c(0x1e6)]('File\x20not\x20found:\x20'+_0x3396e5);if(!statSync(_0x3396e5)[_0x15090c(0x20d)]())throw CliErrors[_0x15090c(0x1e6)](_0x15090c(0x1f4)+_0x3396e5);return readFileSync(_0x3396e5,'utf8');}function summarizePersonalItem(_0x5a3601){const _0x4f1e81=a32_0x52a7b6;return{'id':_0x5a3601['id'],'title':_0x5a3601[_0x4f1e81(0x1fe)],'version':_0x5a3601[_0x4f1e81(0x20f)],'ragStatus':_0x5a3601[_0x4f1e81(0x1e1)],'ragErrorMessage':_0x5a3601[_0x4f1e81(0x1d4)],'updateTime':_0x5a3601[_0x4f1e81(0x1ed)]};}function detailPersonalItem(_0x1a8dcc){const _0xddcb1f=a32_0x52a7b6;return{'id':_0x1a8dcc['id'],'appCode':_0x1a8dcc[_0xddcb1f(0x1ea)],'scope':_0x1a8dcc[_0xddcb1f(0x1dc)],'userId':_0x1a8dcc[_0xddcb1f(0x1de)],'title':_0x1a8dcc[_0xddcb1f(0x1fe)],'content':_0x1a8dcc['content']??'','version':_0x1a8dcc['version'],'ragStatus':_0x1a8dcc['ragStatus'],'ragErrorMessage':_0x1a8dcc[_0xddcb1f(0x1d4)],'createTime':_0x1a8dcc[_0xddcb1f(0x1fc)],'updateTime':_0x1a8dcc[_0xddcb1f(0x1ed)]};}function summarizeSearchHit(_0x5f3c57){const _0x5b6ccb=a32_0x52a7b6;return{'scope':_0x5f3c57['scope'],'title':_0x5f3c57[_0x5b6ccb(0x1fe)],'docId':_0x5f3c57[_0x5b6ccb(0x208)],'score':_0x5f3c57[_0x5b6ccb(0x207)],'weightedScore':_0x5f3c57[_0x5b6ccb(0x209)],'content':_0x5f3c57[_0x5b6ccb(0x20e)],'metadata':_0x5f3c57[_0x5b6ccb(0x1dd)]};}function readTopK(_0x18ad02){const _0x243e61=a32_0x52a7b6,_0x1ba328=_0x18ad02['flag']('topk');if(_0x1ba328===undefined||_0x1ba328===null||_0x1ba328==='')return undefined;const _0x1ab4f0=_0x18ad02[_0x243e61(0x1d3)](_0x243e61(0x1e3));if(!Number[_0x243e61(0x1ff)](_0x1ab4f0)||_0x1ab4f0<0x1)throw CliErrors[_0x243e61(0x1e6)](_0x243e61(0x1ce));return _0x1ab4f0;}const kbList={'service':'kb','command':a32_0x52a7b6(0x1f5),'description':a32_0x52a7b6(0x201),'risk':a32_0x52a7b6(0x1f7),'flags':[VERBOSE_FLAG],async 'execute'(_0x501338){const _0x320fa0=a32_0x52a7b6,_0x1c0f98=await listPersonalKnowledgeBaseItems(_0x501338['appCode']);if(_0x501338['bool'](_0x320fa0(0x1d6)))return{'ok':!![],'data':{'total':_0x1c0f98[_0x320fa0(0x206)],'items':_0x1c0f98}};return{'ok':!![],'data':{'total':_0x1c0f98[_0x320fa0(0x206)],'items':_0x1c0f98[_0x320fa0(0x1cf)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':a32_0x52a7b6(0x205),'risk':a32_0x52a7b6(0x1f7),'flags':[{...ID_FLAG,'description':a32_0x52a7b6(0x1d9)}],async 'execute'(_0x2f8390){const _0x2b0354=a32_0x52a7b6,_0xab540d=await getPersonalKnowledgeBaseItem(_0x2f8390[_0x2b0354(0x1d3)]('id'),_0x2f8390['appCode']);return{'ok':!![],'data':detailPersonalItem(_0xab540d)};}},kbCreate={'service':'kb','command':a32_0x52a7b6(0x200),'description':a32_0x52a7b6(0x1eb),'risk':a32_0x52a7b6(0x1f3),'confirmationDescription':a32_0x52a7b6(0x1f8),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x512beb){const _0x596e21=a32_0x52a7b6,_0x3645cd=_0x512beb['str'](_0x596e21(0x1fe)),_0x1b58bc=readKnowledgeFile(_0x512beb[_0x596e21(0x1fa)]('file')),_0x580260=await createPersonalKnowledgeBaseItem(_0x512beb[_0x596e21(0x1ea)],{'title':_0x3645cd,'content':_0x1b58bc});return{'ok':!![],'data':summarizePersonalItem(_0x580260),'message':_0x596e21(0x1d1)+_0x580260['id']+'\x20('+_0x580260['title']+')'};},async 'dryRun'(_0x29e8b6){const _0x232259=a32_0x52a7b6,_0x18dd87=_0x29e8b6[_0x232259(0x1fa)](_0x232259(0x1fe)),_0x59a26b=readKnowledgeFile(_0x29e8b6['str']('file'));return dryRun(_0x232259(0x1e0),_0x232259(0x1d5))[_0x232259(0x1f0)]({'appCode':_0x29e8b6[_0x232259(0x1ea)],'title':_0x18dd87,'content':_0x59a26b})[_0x232259(0x1ec)]('Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22'+_0x18dd87+'\x22')['build']();}},kbUpdate={'service':'kb','command':a32_0x52a7b6(0x1e5),'description':a32_0x52a7b6(0x1fb),'risk':a32_0x52a7b6(0x1f3),'confirmationDescription':a32_0x52a7b6(0x1da),'flags':[{...ID_FLAG,'description':a32_0x52a7b6(0x1d9)},{...TITLE_FLAG,'required':![],'description':a32_0x52a7b6(0x20a)},FILE_FLAG],async 'execute'(_0x40b8f8){const _0x107ff7=a32_0x52a7b6,_0x1e50a8=_0x40b8f8[_0x107ff7(0x1d3)]('id'),_0x245bfc=readKnowledgeFile(_0x40b8f8[_0x107ff7(0x1fa)](_0x107ff7(0x1d2))),_0x384b98=_0x40b8f8['str'](_0x107ff7(0x1fe))||(await getPersonalKnowledgeBaseItem(_0x1e50a8,_0x40b8f8['appCode']))['title'],_0x4878fa=await updatePersonalKnowledgeBaseItem(_0x1e50a8,_0x40b8f8['appCode'],{'title':_0x384b98,'content':_0x245bfc});return{'ok':!![],'data':summarizePersonalItem(_0x4878fa),'message':_0x107ff7(0x1e4)+_0x4878fa['id']+'\x20('+_0x4878fa[_0x107ff7(0x1fe)]+')'};},async 'dryRun'(_0x22ee04){const _0x2ccf7d=a32_0x52a7b6,_0x195c69=_0x22ee04[_0x2ccf7d(0x1d3)]('id'),_0x37671c=readKnowledgeFile(_0x22ee04[_0x2ccf7d(0x1fa)](_0x2ccf7d(0x1d2))),_0x50e03f=_0x22ee04[_0x2ccf7d(0x1fa)](_0x2ccf7d(0x1fe))||(await getPersonalKnowledgeBaseItem(_0x195c69,_0x22ee04[_0x2ccf7d(0x1ea)]))[_0x2ccf7d(0x1fe)];return dryRun(_0x2ccf7d(0x1e0),_0x2ccf7d(0x1f2)+_0x195c69+_0x2ccf7d(0x1d0))[_0x2ccf7d(0x1f0)]({'appCode':_0x22ee04['appCode'],'title':_0x50e03f,'content':_0x37671c})[_0x2ccf7d(0x1ec)](_0x2ccf7d(0x1ef)+_0x195c69)['build']();}},kbSearch={'service':'kb','command':a32_0x52a7b6(0x1ee),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':a32_0x52a7b6(0x1f7),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x105dfb){const _0x448cc1=a32_0x52a7b6;if(!_0x105dfb['str'](_0x448cc1(0x1cc))['trim']())throw CliErrors[_0x448cc1(0x1e6)](_0x448cc1(0x1cd));readTopK(_0x105dfb);},async 'execute'(_0x187cd4){const _0x4584b0=a32_0x52a7b6,_0x580b01=_0x187cd4[_0x4584b0(0x1fa)](_0x4584b0(0x1cc))[_0x4584b0(0x1db)](),_0x467465=readTopK(_0x187cd4),_0x10c1aa=await searchKnowledgeBase(_0x187cd4['appCode'],{'query':_0x580b01,'topK':_0x467465});return{'ok':!![],'data':{'total':_0x10c1aa['length'],'hits':_0x10c1aa[_0x4584b0(0x1cf)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a33_0xe8b2(){const _0x2d42a5=['3187683nEaezS','View\x20command\x20history\x20logs','\x20logs:\x0a','show','details','error','4gbeMjv','*\x20No\x20logs\x20found','9630180vaQXDK','logs','64QHHteA','6dQhqbl','56yYumzq','45162535IrRpYE','forEach','3760605PMsBrR','log','510354yJHrlL','level','readLogs','stringify','19732ZVThtw','timestamp','\x20\x20\x20Details:\x20','10985100BwURpr','toLocaleString','en-US','read','length'];a33_0xe8b2=function(){return _0x2d42a5;};return a33_0xe8b2();}const a33_0x5af82f=a33_0x4b81;(function(_0x16071d,_0x2cd288){const _0x1cd03c=a33_0x4b81,_0x54bdc0=_0x16071d();while(!![]){try{const _0x2c490c=-parseInt(_0x1cd03c(0x7f))/0x1*(-parseInt(_0x1cd03c(0x74))/0x2)+parseInt(_0x1cd03c(0x6a))/0x3*(-parseInt(_0x1cd03c(0x70))/0x4)+-parseInt(_0x1cd03c(0x79))/0x5+-parseInt(_0x1cd03c(0x75))/0x6*(parseInt(_0x1cd03c(0x72))/0x7)+-parseInt(_0x1cd03c(0x76))/0x8*(-parseInt(_0x1cd03c(0x7b))/0x9)+-parseInt(_0x1cd03c(0x65))/0xa+parseInt(_0x1cd03c(0x77))/0xb;if(_0x2c490c===_0x2cd288)break;else _0x54bdc0['push'](_0x54bdc0['shift']());}catch(_0x4ad418){_0x54bdc0['push'](_0x54bdc0['shift']());}}}(a33_0xe8b2,0xce53f));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a33_0x4b81(_0x2a7d41,_0x248272){_0x2a7d41=_0x2a7d41-0x64;const _0xe8b222=a33_0xe8b2();let _0x4b81ee=_0xe8b222[_0x2a7d41];return _0x4b81ee;}function printLogs(_0x200475){const _0x2833f6=a33_0x4b81;if(_0x200475[_0x2833f6(0x69)]===0x0){console['log'](_0x2833f6(0x71));return;}console[_0x2833f6(0x7a)]('*\x20'+CLI_DISPLAY_NAME+_0x2833f6(0x6c)),_0x200475[_0x2833f6(0x78)]((_0x136e75,_0x156bd0)=>{const _0x20e012=_0x2833f6,_0x55bc92=new Date(_0x136e75[_0x20e012(0x80)])[_0x20e012(0x66)](_0x20e012(0x67)),_0x1a874f=_0x136e75['level']==='success'?'√':_0x136e75[_0x20e012(0x7c)]===_0x20e012(0x6f)?'×':_0x136e75[_0x20e012(0x7c)]==='warn'?'!':'i';console[_0x20e012(0x7a)](_0x156bd0+0x1+'.\x20'+_0x1a874f+'\x20['+_0x136e75['command']+']\x20'+_0x136e75['message']),console[_0x20e012(0x7a)]('\x20\x20\x20Time:\x20'+_0x55bc92),_0x136e75['duration']&&console[_0x20e012(0x7a)]('\x20\x20\x20Duration:\x20'+_0x136e75['duration']+'ms'),_0x136e75[_0x20e012(0x6e)]&&Object['keys'](_0x136e75[_0x20e012(0x6e)])[_0x20e012(0x69)]>0x0&&console['log'](_0x20e012(0x64)+JSON[_0x20e012(0x7e)](_0x136e75[_0x20e012(0x6e)],null,0x2)),console['log']('');});}export const logsDefinitions=[{'service':a33_0x5af82f(0x73),'command':a33_0x5af82f(0x6d),'description':a33_0x5af82f(0x6b),'risk':a33_0x5af82f(0x68),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1a3f73){const _0x5b6ddb=a33_0x5af82f;return printLogs(logger[_0x5b6ddb(0x7d)]()),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a34_0x5a5ba0=a34_0xb46f;(function(_0xef2560,_0x1fa8f0){const _0x2ec8fe=a34_0xb46f,_0x60a152=_0xef2560();while(!![]){try{const _0x5dc00a=-parseInt(_0x2ec8fe(0x17c))/0x1*(parseInt(_0x2ec8fe(0x199))/0x2)+-parseInt(_0x2ec8fe(0x172))/0x3*(parseInt(_0x2ec8fe(0x187))/0x4)+-parseInt(_0x2ec8fe(0x19a))/0x5+-parseInt(_0x2ec8fe(0x191))/0x6*(-parseInt(_0x2ec8fe(0x175))/0x7)+parseInt(_0x2ec8fe(0x19d))/0x8+-parseInt(_0x2ec8fe(0x19e))/0x9+-parseInt(_0x2ec8fe(0x16a))/0xa*(-parseInt(_0x2ec8fe(0x167))/0xb);if(_0x5dc00a===_0x1fa8f0)break;else _0x60a152['push'](_0x60a152['shift']());}catch(_0x3a3597){_0x60a152['push'](_0x60a152['shift']());}}}(a34_0x4699,0x82ab8));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';function a34_0xb46f(_0x475ab9,_0x473500){_0x475ab9=_0x475ab9-0x166;const _0x4699fc=a34_0x4699();let _0xb46f57=_0x4699fc[_0x475ab9];return _0xb46f57;}function a34_0x4699(){const _0x2e2aca=['174645PiMNNV','trim','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','6539920wpMmpf','6730812YiJsHU','fileUrl','Preview:\x20recognize\x20','25949mtabnB','build','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','440poeqWq','Invoice','string','general','idcard','path','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','<filePath\x20returned\x20by\x20/client/uploadFile>','182271HtsmTJ','/client/ocr','ocr','7066262orlXao','fileName','body','idCard','Table','description','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','1XXwHiO','form','recognize','filePath','POST','length','read','General','.\x20Supported\x20scenes:\x20','join','File\x20upload\x20response\x20missing\x20filePath.','16GyrwVl','Unsupported\x20OCR\x20scene:\x20','str','image-url','imageUrl','/client/queryFileUrl','validation','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','scene','\x20OCR\x20from\x20URL','6xcmQBX','/client/uploadFile','toLowerCase','imageFile','appCode','\x20OCR','invoice','image-file','739406cvRAvh'];a34_0x4699=function(){return _0x2e2aca;};return a34_0x4699();}import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x5a5ba0(0x197),a34_0x5a5ba0(0x16d),a34_0x5a5ba0(0x17d),'idCard'],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x5a5ba0(0x16b),'general':a34_0x5a5ba0(0x183),'form':a34_0x5a5ba0(0x179),'idCard':'IdCard'},SCENE_FLAG={'name':a34_0x5a5ba0(0x18f),'type':a34_0x5a5ba0(0x16c),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x5a5ba0(0x169)},IMAGE_FILE_FLAG={'name':a34_0x5a5ba0(0x198),'type':a34_0x5a5ba0(0x16c),'description':a34_0x5a5ba0(0x18e)},IMAGE_URL_FLAG={'name':a34_0x5a5ba0(0x18a),'type':a34_0x5a5ba0(0x16c),'description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x1f4d87){const _0x43dd4f=a34_0x5a5ba0,_0x5e5b27=_0x1f4d87[_0x43dd4f(0x19b)]()[_0x43dd4f(0x193)]();if(_0x5e5b27===_0x43dd4f(0x16e))return _0x43dd4f(0x178);if(_0x5e5b27===_0x43dd4f(0x197)||_0x5e5b27===_0x43dd4f(0x16d)||_0x5e5b27==='form')return _0x5e5b27;throw CliErrors['validation'](_0x43dd4f(0x188)+_0x1f4d87+_0x43dd4f(0x184)+SUPPORTED_SCENES[_0x43dd4f(0x185)](',\x20'));}function selectedInputs(_0x17c4c1){const _0x5a8450=a34_0x5a5ba0,_0x84eff3=_0x17c4c1[_0x5a8450(0x189)](_0x5a8450(0x198))[_0x5a8450(0x19b)](),_0x590f35=_0x17c4c1['str']('image-url')[_0x5a8450(0x19b)]();return{'imageFile':_0x84eff3,'imageUrl':_0x590f35,'count':[_0x84eff3,_0x590f35]['filter'](Boolean)[_0x5a8450(0x181)]};}function validateInputSelection(_0x5d0562){const _0x896788=a34_0x5a5ba0,_0x1ea170=selectedInputs(_0x5d0562);if(_0x1ea170['count']!==0x1)throw CliErrors[_0x896788(0x18d)](_0x896788(0x19c));return _0x1ea170;}function withScene(_0x13dcbd,_0x14aa0e,_0x5a74c0){const _0x32dd3e=a34_0x5a5ba0;return{..._0x13dcbd,'scene':_0x14aa0e,..._0x5a74c0?{'sourceFile':{'fileName':_0x5a74c0[_0x32dd3e(0x176)],'filePath':_0x5a74c0[_0x32dd3e(0x17f)]}}:{}};}const ocrRecognize={'service':a34_0x5a5ba0(0x174),'command':a34_0x5a5ba0(0x17e),'description':'使用运行态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','risk':a34_0x5a5ba0(0x182),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x2cb419){const _0x3c9506=a34_0x5a5ba0,_0x5b2f4d=normalizeScene(_0x2cb419[_0x3c9506(0x189)](_0x3c9506(0x18f))),_0xc2d612=SCENE_TO_LEGACY_TYPE[_0x5b2f4d],_0x35038f=validateInputSelection(_0x2cb419);if(_0x35038f['imageUrl'])return dryRun(_0x3c9506(0x180),_0x3c9506(0x173))[_0x3c9506(0x177)]({'appCode':_0x2cb419[_0x3c9506(0x195)],'url':_0x35038f[_0x3c9506(0x18b)],'type':_0xc2d612})[_0x3c9506(0x17a)](_0x3c9506(0x166)+_0x5b2f4d+_0x3c9506(0x190))[_0x3c9506(0x168)]();const _0x782006=requireRuntimeUploadFile(_0x35038f[_0x3c9506(0x194)],_0x3c9506(0x198));return dryRun(_0x3c9506(0x180),_0x3c9506(0x192))[_0x3c9506(0x177)]({'steps':[{'method':_0x3c9506(0x180),'url':_0x3c9506(0x192),'body':{'appCode':_0x2cb419[_0x3c9506(0x195)],'multipart':{'file':_0x782006}}},{'method':_0x3c9506(0x180),'url':_0x3c9506(0x18c),'body':{'filePath':_0x3c9506(0x171),'downloadFlag':![]}},{'method':_0x3c9506(0x180),'url':'/client/ocr','body':{'appCode':_0x2cb419[_0x3c9506(0x195)],'url':_0x3c9506(0x170),'type':_0xc2d612}}]})[_0x3c9506(0x17a)](_0x3c9506(0x17b)+_0x5b2f4d+_0x3c9506(0x196))[_0x3c9506(0x168)]();},async 'execute'(_0x59c455){const _0x4e7d05=a34_0x5a5ba0,_0x5001a1=normalizeScene(_0x59c455[_0x4e7d05(0x189)]('scene')),_0x286244=SCENE_TO_LEGACY_TYPE[_0x5001a1],_0x541fdc=validateInputSelection(_0x59c455);if(_0x541fdc[_0x4e7d05(0x18b)]){const _0x1a1ea4=await recognizeRuntimeOcr(_0x59c455[_0x4e7d05(0x195)],{'url':_0x541fdc[_0x4e7d05(0x18b)],'type':_0x286244});return{'ok':!![],'data':withScene(_0x1a1ea4,_0x5001a1)};}const _0x1e21fa=requireRuntimeUploadFile(_0x541fdc[_0x4e7d05(0x194)],'image-file'),_0x398b0a=await uploadRuntimeFile(_0x59c455['appCode'],_0x1e21fa[_0x4e7d05(0x16f)]);if(!_0x398b0a[_0x4e7d05(0x17f)])throw CliErrors['apiError'](_0x4e7d05(0x186));const _0x1a2e69=await queryRuntimeFileUrl(_0x398b0a['filePath'],{'download':![]});if(!_0x1a2e69[_0x4e7d05(0x19f)])throw CliErrors['apiError']('File\x20URL\x20response\x20missing\x20fileUrl.');const _0x53cbf6=await recognizeRuntimeOcr(_0x59c455[_0x4e7d05(0x195)],{'url':_0x1a2e69[_0x4e7d05(0x19f)],'type':_0x286244});return{'ok':!![],'data':withScene(_0x53cbf6,_0x5001a1,_0x398b0a)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x961b3d=a35_0x2e79;(function(_0x3e361f,_0x162419){const _0x2e7b50=a35_0x2e79,_0x583a06=_0x3e361f();while(!![]){try{const _0x5d4617=parseInt(_0x2e7b50(0xd1))/0x1*(parseInt(_0x2e7b50(0xe6))/0x2)+-parseInt(_0x2e7b50(0xf6))/0x3*(-parseInt(_0x2e7b50(0xfc))/0x4)+-parseInt(_0x2e7b50(0xe1))/0x5+parseInt(_0x2e7b50(0xce))/0x6*(parseInt(_0x2e7b50(0xc4))/0x7)+-parseInt(_0x2e7b50(0xcb))/0x8*(parseInt(_0x2e7b50(0xeb))/0x9)+-parseInt(_0x2e7b50(0xbf))/0xa*(-parseInt(_0x2e7b50(0xcf))/0xb)+parseInt(_0x2e7b50(0xc6))/0xc*(-parseInt(_0x2e7b50(0xbd))/0xd);if(_0x5d4617===_0x162419)break;else _0x583a06['push'](_0x583a06['shift']());}catch(_0x27a9cf){_0x583a06['push'](_0x583a06['shift']());}}}(a35_0x200e,0xb6b87));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';function a35_0x200e(){const _0x59401f=['Executed\x20personal\x20BFF\x20','detail','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','Preview:\x20update\x20personal\x20BFF\x20','4902695cFMRPD','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','22308wxmOTs','functionName','--params\x20must\x20be\x20a\x20JSON\x20object.','根据\x20ID\x20执行个人\x20BFF,并可传入\x20JSON\x20参数','根据\x20ID\x20更新个人\x20BFF','344UsWfjM','str','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','6Zhxkqs','11oFQRHM','version','1NSFwXq','write','/client/runtime-bff/personal/create','params','Show\x20one\x20personal\x20BFF\x20by\x20id','description','keys','sourceSessionId','read','File\x20path\x20is\x20required.','updateTime','Personal\x20BFF\x20description','执行个人\x20BFF\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','validation','isFile','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','2018690ITcUvS','config','num','更新个人\x20BFF\x20的脚本或元信息;之后的调用将使用新版本。','name','1225100QodZkS','body','/update','file','scriptContent','232092LsJtUZ','length','trim','File\x20not\x20found:\x20','createTime','flag','bool','Preview:\x20create\x20personal\x20BFF\x20','scriptType','build','gmtCreate','3iXrZkM','/client/runtime-bff/personal/','appCode','POST','source-session-id','Personal\x20BFF\x20script\x20ID','4742804SUAgum','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','gmtModified','Personal\x20BFF\x20script\x20file\x20is\x20blank.','utf8','personal-bff','list','File\x20is\x20not\x20a\x20regular\x20file:\x20','string','根据本地脚本文件创建个人\x20BFF','test','6448RFvrep','update','6844730fURcKt'];a35_0x200e=function(){return _0x59401f;};return a35_0x200e();}const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x961b3d(0xe9),'type':a35_0x961b3d(0xba),'description':a35_0x961b3d(0xc2)},FUNCTION_NAME_FLAG={'name':a35_0x961b3d(0xe5),'type':a35_0x961b3d(0xba),'required':!![],'description':a35_0x961b3d(0xfd)},DESCRIPTION_FLAG={'name':a35_0x961b3d(0xd6),'type':a35_0x961b3d(0xba),'description':a35_0x961b3d(0xdc)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a35_0x961b3d(0xba),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function normalizeFunctionName(_0x54eb48){const _0x249fc9=a35_0x961b3d,_0x507963=String(_0x54eb48||'')[_0x249fc9(0xed)]();if(!_0x507963||!FUNCTION_NAME_PATTERN[_0x249fc9(0xbc)](_0x507963))throw CliErrors['validation'](_0x249fc9(0xcd));return _0x507963;}function readScriptFile(_0x4d56ec){const _0x16474b=a35_0x961b3d;if(!_0x4d56ec)throw CliErrors[_0x16474b(0xde)](_0x16474b(0xda));if(!existsSync(_0x4d56ec))throw CliErrors[_0x16474b(0xde)](_0x16474b(0xee)+_0x4d56ec);if(!statSync(_0x4d56ec)[_0x16474b(0xdf)]())throw CliErrors[_0x16474b(0xde)](_0x16474b(0x103)+_0x4d56ec);const _0x4c6299=readFileSync(_0x4d56ec,_0x16474b(0x100));if(!_0x4c6299[_0x16474b(0xed)]())throw CliErrors[_0x16474b(0xde)](_0x16474b(0xff));return _0x4c6299;}function optionalTrimmed(_0x2b85c5){const _0x6c32d0=String(_0x2b85c5||'')['trim']();return _0x6c32d0||undefined;}function summarizeBff(_0x493a47){const _0x1321a1=a35_0x961b3d;return{'id':_0x493a47['id'],'appCode':_0x493a47[_0x1321a1(0xf8)],'functionName':_0x493a47[_0x1321a1(0xc7)],'description':_0x493a47['description'],'scriptType':_0x493a47['scriptType'],'version':_0x493a47[_0x1321a1(0xd0)],'gmtModified':_0x493a47[_0x1321a1(0xfe)],'updateTime':_0x493a47['updateTime']};}function a35_0x2e79(_0x18c9f2,_0x3a0846){_0x18c9f2=_0x18c9f2-0xba;const _0x200e08=a35_0x200e();let _0x2e79d3=_0x200e08[_0x18c9f2];return _0x2e79d3;}function detailBff(_0x4fb0cd){const _0x2a0314=a35_0x961b3d;return{'id':_0x4fb0cd['id'],'appCode':_0x4fb0cd[_0x2a0314(0xf8)],'functionName':_0x4fb0cd[_0x2a0314(0xc7)],'description':_0x4fb0cd[_0x2a0314(0xd6)],'scriptType':_0x4fb0cd[_0x2a0314(0xf3)],'scriptContent':_0x4fb0cd[_0x2a0314(0xea)]??'','config':_0x4fb0cd[_0x2a0314(0xe2)],'version':_0x4fb0cd[_0x2a0314(0xd0)],'createUserId':_0x4fb0cd['createUserId'],'gmtCreate':_0x4fb0cd[_0x2a0314(0xf5)],'gmtModified':_0x4fb0cd[_0x2a0314(0xfe)],'createTime':_0x4fb0cd[_0x2a0314(0xef)],'updateTime':_0x4fb0cd[_0x2a0314(0xdb)]};}function buildCreateInput(_0x49ff53){const _0x336753=a35_0x961b3d;return{'functionName':normalizeFunctionName(_0x49ff53[_0x336753(0xcc)](_0x336753(0xe5))),...optionalTrimmed(_0x49ff53[_0x336753(0xcc)](_0x336753(0xd6)))?{'description':optionalTrimmed(_0x49ff53[_0x336753(0xcc)](_0x336753(0xd6)))}:{},'scriptContent':readScriptFile(_0x49ff53[_0x336753(0xcc)](_0x336753(0xe9))),...optionalTrimmed(_0x49ff53[_0x336753(0xcc)](_0x336753(0xfa)))?{'sourceSessionId':optionalTrimmed(_0x49ff53[_0x336753(0xcc)](_0x336753(0xfa)))}:{}};}function buildUpdateInput(_0x5b0ba1){const _0xdb986b=a35_0x961b3d,_0x5e8773={};optionalTrimmed(_0x5b0ba1[_0xdb986b(0xcc)]('name'))&&(_0x5e8773[_0xdb986b(0xc7)]=normalizeFunctionName(_0x5b0ba1[_0xdb986b(0xcc)]('name')));_0x5b0ba1[_0xdb986b(0xf0)](_0xdb986b(0xd6))!==undefined&&(_0x5e8773[_0xdb986b(0xd6)]=_0x5b0ba1[_0xdb986b(0xcc)](_0xdb986b(0xd6)));optionalTrimmed(_0x5b0ba1[_0xdb986b(0xcc)](_0xdb986b(0xe9)))&&(_0x5e8773[_0xdb986b(0xea)]=readScriptFile(_0x5b0ba1[_0xdb986b(0xcc)](_0xdb986b(0xe9))));_0x5b0ba1['flag'](_0xdb986b(0xfa))!==undefined&&(_0x5e8773[_0xdb986b(0xd8)]=_0x5b0ba1['str'](_0xdb986b(0xfa)));if(Object[_0xdb986b(0xd7)](_0x5e8773)['length']===0x0)throw CliErrors[_0xdb986b(0xde)](_0xdb986b(0xe0));return _0x5e8773;}function parseExecParams(_0x5064d6){const _0x2e5508=a35_0x961b3d,_0x5041ba=parseJsonParams(_0x5064d6)??{};if(Array['isArray'](_0x5041ba))throw CliErrors[_0x2e5508(0xde)](_0x2e5508(0xc8));return _0x5041ba;}const personalBffList={'service':a35_0x961b3d(0x101),'command':a35_0x961b3d(0x102),'description':a35_0x961b3d(0xc5),'risk':a35_0x961b3d(0xd9),'flags':[VERBOSE_FLAG],async 'execute'(_0x4986c2){const _0x248782=a35_0x961b3d,_0x2cb45e=await listPersonalBffs(_0x4986c2[_0x248782(0xf8)]);return{'ok':!![],'data':{'total':_0x2cb45e[_0x248782(0xec)],'items':_0x4986c2[_0x248782(0xf1)]('verbose')?_0x2cb45e:_0x2cb45e['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x961b3d(0x101),'command':a35_0x961b3d(0xc1),'description':a35_0x961b3d(0xd5),'risk':'read','flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'}],async 'execute'(_0x1c2dc5){const _0x82dd65=a35_0x961b3d,_0x4f1066=await getPersonalBff(_0x1c2dc5[_0x82dd65(0xe3)]('id'),_0x1c2dc5['appCode']);return{'ok':!![],'data':detailBff(_0x4f1066)};}},personalBffCreate={'service':a35_0x961b3d(0x101),'command':'create','description':a35_0x961b3d(0xbb),'risk':a35_0x961b3d(0xd2),'confirmationDescription':'把本地脚本保存为个人\x20BFF;之后可在当前应用中调用该脚本。','flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x48555b){const _0x7002a6=a35_0x961b3d,_0x57c809=buildCreateInput(_0x48555b),_0x5497ab=await createPersonalBff(_0x48555b[_0x7002a6(0xf8)],_0x57c809);return{'ok':!![],'data':detailBff(_0x5497ab),'message':'Created\x20personal\x20BFF\x20'+_0x5497ab['id']+(_0x5497ab[_0x7002a6(0xc7)]?'\x20('+_0x5497ab[_0x7002a6(0xc7)]+')':'')};},async 'dryRun'(_0x647b75){const _0x55dd1e=a35_0x961b3d,_0x42d71b=buildCreateInput(_0x647b75);return dryRun(_0x55dd1e(0xf9),_0x55dd1e(0xd3))[_0x55dd1e(0xe7)]({'appCode':_0x647b75[_0x55dd1e(0xf8)],..._0x42d71b})[_0x55dd1e(0xd6)](_0x55dd1e(0xf2)+_0x42d71b['functionName'])[_0x55dd1e(0xf4)]();}},personalBffUpdate={'service':'personal-bff','command':a35_0x961b3d(0xbe),'description':a35_0x961b3d(0xca),'risk':a35_0x961b3d(0xd2),'confirmationDescription':a35_0x961b3d(0xe4),'flags':[{...ID_FLAG,'description':a35_0x961b3d(0xfb)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x52113d){const _0x1e4c63=a35_0x961b3d,_0x2251ae=_0x52113d['num']('id'),_0x366f75=buildUpdateInput(_0x52113d),_0x12dcc7=await updatePersonalBff(_0x2251ae,_0x52113d['appCode'],_0x366f75);return{'ok':!![],'data':detailBff(_0x12dcc7),'message':'Updated\x20personal\x20BFF\x20'+_0x12dcc7['id']+(_0x12dcc7[_0x1e4c63(0xc7)]?'\x20('+_0x12dcc7['functionName']+')':'')};},async 'dryRun'(_0xfe20a5){const _0xf440ae=a35_0x961b3d,_0x25a518=_0xfe20a5[_0xf440ae(0xe3)]('id'),_0x379cb1=buildUpdateInput(_0xfe20a5);return dryRun(_0xf440ae(0xf9),_0xf440ae(0xf7)+_0x25a518+_0xf440ae(0xe8))[_0xf440ae(0xe7)]({'appCode':_0xfe20a5['appCode'],..._0x379cb1})[_0xf440ae(0xd6)](_0xf440ae(0xc3)+_0x25a518)[_0xf440ae(0xf4)]();}},personalBffExec={'service':a35_0x961b3d(0x101),'command':'exec','description':a35_0x961b3d(0xc9),'risk':a35_0x961b3d(0xd2),'confirmationDescription':a35_0x961b3d(0xdd),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':'JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'}],async 'validate'(_0x5e522c){const _0x3c9331=a35_0x961b3d;parseExecParams(_0x5e522c[_0x3c9331(0xcc)](_0x3c9331(0xd4)));},async 'execute'(_0x5c2dbb){const _0x1f244e=a35_0x961b3d,_0x5b4d51=_0x5c2dbb[_0x1f244e(0xe3)]('id'),_0x309537=parseExecParams(_0x5c2dbb[_0x1f244e(0xcc)](_0x1f244e(0xd4))),_0xa949e4=await executePersonalBff(_0x5b4d51,_0x5c2dbb[_0x1f244e(0xf8)],_0x309537);return{'ok':!![],'data':{'result':_0xa949e4},'message':_0x1f244e(0xc0)+_0x5b4d51};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
function a35_0x46b7(_0x437df8,_0x2499da){_0x437df8=_0x437df8-0xa0;const _0x4db386=a35_0x4db3();let _0x46b744=_0x4db386[_0x437df8];return _0x46b744;}const a35_0x34fb29=a35_0x46b7;(function(_0x507ff3,_0x5b4a12){const _0x5d153b=a35_0x46b7,_0x598b34=_0x507ff3();while(!![]){try{const _0x5dde06=parseInt(_0x5d153b(0xda))/0x1*(-parseInt(_0x5d153b(0xe2))/0x2)+parseInt(_0x5d153b(0xa8))/0x3+parseInt(_0x5d153b(0xad))/0x4*(parseInt(_0x5d153b(0xbc))/0x5)+parseInt(_0x5d153b(0xab))/0x6+parseInt(_0x5d153b(0xce))/0x7+parseInt(_0x5d153b(0xe0))/0x8*(parseInt(_0x5d153b(0xde))/0x9)+-parseInt(_0x5d153b(0xa6))/0xa*(parseInt(_0x5d153b(0xbb))/0xb);if(_0x5dde06===_0x5b4a12)break;else _0x598b34['push'](_0x598b34['shift']());}catch(_0x3b31fb){_0x598b34['push'](_0x598b34['shift']());}}}(a35_0x4db3,0xcd8e7));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';function a35_0x4db3(){const _0x3010fb=['string','isArray','17956939jwAWsd','40285CzBkwE','bool','config','Preview:\x20create\x20personal\x20BFF\x20','Created\x20personal\x20BFF\x20','exec','根据\x20ID\x20更新个人\x20BFF','validation','isFile','trim','list','根据本地脚本文件创建个人\x20BFF','Preview:\x20update\x20personal\x20BFF\x20','name','createTime','Personal\x20BFF\x20script\x20file\x20is\x20blank.','length','/client/runtime-bff/personal/','577619gLIjIj','map','utf8','File\x20path\x20is\x20required.','description','updateTime','scriptContent','test','scriptType','num','gmtModified','File\x20not\x20found:\x20','852253bHBLoR','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','sourceSessionId','Personal\x20BFF\x20description','4814217edPKGz','build','8vjJiIW','str','2wCkCpB','verbose','functionName','把本地脚本保存为个人\x20BFF;之后可在当前应用中调用该脚本。','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','createUserId','flag','personal-bff','更新个人\x20BFF\x20的脚本或元信息;之后的调用将使用新版本。','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','read','POST','10DBhNxl','file','1234377ombbyQ','appCode','update','7163778DzCLsy','Show\x20one\x20personal\x20BFF\x20by\x20id','548MKpiti','gmtCreate','keys','Executed\x20personal\x20BFF\x20','params','source-session-id','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','Updated\x20personal\x20BFF\x20','version','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','write','根据\x20ID\x20执行个人\x20BFF,并可传入\x20JSON\x20参数'];a35_0x4db3=function(){return _0x3010fb;};return a35_0x4db3();}const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x34fb29(0xa7),'type':a35_0x34fb29(0xb9),'description':a35_0x34fb29(0xb6)},FUNCTION_NAME_FLAG={'name':a35_0x34fb29(0xc9),'type':a35_0x34fb29(0xb9),'required':!![],'description':a35_0x34fb29(0xb3)},DESCRIPTION_FLAG={'name':a35_0x34fb29(0xd2),'type':a35_0x34fb29(0xb9),'description':a35_0x34fb29(0xdd)},SOURCE_SESSION_FLAG={'name':a35_0x34fb29(0xb2),'type':'string','description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function normalizeFunctionName(_0x5e01a4){const _0x1ee382=a35_0x34fb29,_0x338751=String(_0x5e01a4||'')['trim']();if(!_0x338751||!FUNCTION_NAME_PATTERN[_0x1ee382(0xd5)](_0x338751))throw CliErrors[_0x1ee382(0xc3)](_0x1ee382(0xa3));return _0x338751;}function readScriptFile(_0x40927f){const _0x4272dd=a35_0x34fb29;if(!_0x40927f)throw CliErrors[_0x4272dd(0xc3)](_0x4272dd(0xd1));if(!existsSync(_0x40927f))throw CliErrors[_0x4272dd(0xc3)](_0x4272dd(0xd9)+_0x40927f);if(!statSync(_0x40927f)[_0x4272dd(0xc4)]())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x40927f);const _0x5d2070=readFileSync(_0x40927f,_0x4272dd(0xd0));if(!_0x5d2070[_0x4272dd(0xc5)]())throw CliErrors[_0x4272dd(0xc3)](_0x4272dd(0xcb));return _0x5d2070;}function optionalTrimmed(_0x1ac740){const _0x4abf56=a35_0x34fb29,_0xcd6589=String(_0x1ac740||'')[_0x4abf56(0xc5)]();return _0xcd6589||undefined;}function summarizeBff(_0x315ce5){const _0x522c41=a35_0x34fb29;return{'id':_0x315ce5['id'],'appCode':_0x315ce5[_0x522c41(0xa9)],'functionName':_0x315ce5[_0x522c41(0xe4)],'description':_0x315ce5[_0x522c41(0xd2)],'scriptType':_0x315ce5[_0x522c41(0xd6)],'version':_0x315ce5[_0x522c41(0xb5)],'gmtModified':_0x315ce5[_0x522c41(0xd8)],'updateTime':_0x315ce5[_0x522c41(0xd3)]};}function detailBff(_0x3bd203){const _0x16c6a6=a35_0x34fb29;return{'id':_0x3bd203['id'],'appCode':_0x3bd203['appCode'],'functionName':_0x3bd203[_0x16c6a6(0xe4)],'description':_0x3bd203[_0x16c6a6(0xd2)],'scriptType':_0x3bd203[_0x16c6a6(0xd6)],'scriptContent':_0x3bd203[_0x16c6a6(0xd4)]??'','config':_0x3bd203[_0x16c6a6(0xbe)],'version':_0x3bd203[_0x16c6a6(0xb5)],'createUserId':_0x3bd203[_0x16c6a6(0xe7)],'gmtCreate':_0x3bd203[_0x16c6a6(0xae)],'gmtModified':_0x3bd203[_0x16c6a6(0xd8)],'createTime':_0x3bd203[_0x16c6a6(0xca)],'updateTime':_0x3bd203[_0x16c6a6(0xd3)]};}function buildCreateInput(_0x16e7c3){const _0x2fe56d=a35_0x34fb29;return{'functionName':normalizeFunctionName(_0x16e7c3['str']('name')),...optionalTrimmed(_0x16e7c3['str'](_0x2fe56d(0xd2)))?{'description':optionalTrimmed(_0x16e7c3[_0x2fe56d(0xe1)]('description'))}:{},'scriptContent':readScriptFile(_0x16e7c3[_0x2fe56d(0xe1)](_0x2fe56d(0xa7))),...optionalTrimmed(_0x16e7c3[_0x2fe56d(0xe1)]('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x16e7c3['str'](_0x2fe56d(0xb2)))}:{}};}function buildUpdateInput(_0x2d0e7b){const _0x5ec473=a35_0x34fb29,_0x4f71a2={};optionalTrimmed(_0x2d0e7b[_0x5ec473(0xe1)]('name'))&&(_0x4f71a2[_0x5ec473(0xe4)]=normalizeFunctionName(_0x2d0e7b[_0x5ec473(0xe1)]('name')));_0x2d0e7b[_0x5ec473(0xa0)](_0x5ec473(0xd2))!==undefined&&(_0x4f71a2['description']=_0x2d0e7b[_0x5ec473(0xe1)]('description'));optionalTrimmed(_0x2d0e7b[_0x5ec473(0xe1)](_0x5ec473(0xa7)))&&(_0x4f71a2['scriptContent']=readScriptFile(_0x2d0e7b['str'](_0x5ec473(0xa7))));_0x2d0e7b[_0x5ec473(0xa0)](_0x5ec473(0xb2))!==undefined&&(_0x4f71a2[_0x5ec473(0xdc)]=_0x2d0e7b[_0x5ec473(0xe1)](_0x5ec473(0xb2)));if(Object[_0x5ec473(0xaf)](_0x4f71a2)[_0x5ec473(0xcc)]===0x0)throw CliErrors[_0x5ec473(0xc3)](_0x5ec473(0xe6));return _0x4f71a2;}function parseExecParams(_0x71bde7){const _0x357952=a35_0x34fb29,_0x13cbd1=parseJsonParams(_0x71bde7)??{};if(Array[_0x357952(0xba)](_0x13cbd1))throw CliErrors['validation']('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x13cbd1;}const personalBffList={'service':a35_0x34fb29(0xa1),'command':a35_0x34fb29(0xc6),'description':a35_0x34fb29(0xdb),'risk':a35_0x34fb29(0xa4),'flags':[VERBOSE_FLAG],async 'execute'(_0x5c9bf5){const _0x4ccd40=a35_0x34fb29,_0x3adb50=await listPersonalBffs(_0x5c9bf5[_0x4ccd40(0xa9)]);return{'ok':!![],'data':{'total':_0x3adb50[_0x4ccd40(0xcc)],'items':_0x5c9bf5[_0x4ccd40(0xbd)](_0x4ccd40(0xe3))?_0x3adb50:_0x3adb50[_0x4ccd40(0xcf)](summarizeBff)}};}},personalBffDetail={'service':a35_0x34fb29(0xa1),'command':'detail','description':a35_0x34fb29(0xac),'risk':a35_0x34fb29(0xa4),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'}],async 'execute'(_0x58f781){const _0x44c9be=a35_0x34fb29,_0xc42cd5=await getPersonalBff(_0x58f781[_0x44c9be(0xd7)]('id'),_0x58f781[_0x44c9be(0xa9)]);return{'ok':!![],'data':detailBff(_0xc42cd5)};}},personalBffCreate={'service':a35_0x34fb29(0xa1),'command':'create','description':a35_0x34fb29(0xc7),'risk':a35_0x34fb29(0xb7),'confirmationDescription':a35_0x34fb29(0xe5),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x584e9b){const _0xcd0246=a35_0x34fb29,_0x4f6b65=buildCreateInput(_0x584e9b),_0x5db342=await createPersonalBff(_0x584e9b['appCode'],_0x4f6b65);return{'ok':!![],'data':detailBff(_0x5db342),'message':_0xcd0246(0xc0)+_0x5db342['id']+(_0x5db342[_0xcd0246(0xe4)]?'\x20('+_0x5db342[_0xcd0246(0xe4)]+')':'')};},async 'dryRun'(_0x449d6a){const _0xabf284=a35_0x34fb29,_0x5ec58b=buildCreateInput(_0x449d6a);return dryRun(_0xabf284(0xa5),'/client/runtime-bff/personal/create')['body']({'appCode':_0x449d6a['appCode'],..._0x5ec58b})[_0xabf284(0xd2)](_0xabf284(0xbf)+_0x5ec58b[_0xabf284(0xe4)])[_0xabf284(0xdf)]();}},personalBffUpdate={'service':a35_0x34fb29(0xa1),'command':a35_0x34fb29(0xaa),'description':a35_0x34fb29(0xc2),'risk':a35_0x34fb29(0xb7),'confirmationDescription':a35_0x34fb29(0xa2),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x586cad){const _0xf3f16d=a35_0x34fb29,_0x5943f3=_0x586cad[_0xf3f16d(0xd7)]('id'),_0x385772=buildUpdateInput(_0x586cad),_0x527567=await updatePersonalBff(_0x5943f3,_0x586cad[_0xf3f16d(0xa9)],_0x385772);return{'ok':!![],'data':detailBff(_0x527567),'message':_0xf3f16d(0xb4)+_0x527567['id']+(_0x527567['functionName']?'\x20('+_0x527567[_0xf3f16d(0xe4)]+')':'')};},async 'dryRun'(_0x32b4d8){const _0x11b233=a35_0x34fb29,_0x30739c=_0x32b4d8[_0x11b233(0xd7)]('id'),_0x3ef7a9=buildUpdateInput(_0x32b4d8);return dryRun(_0x11b233(0xa5),_0x11b233(0xcd)+_0x30739c+'/update')['body']({'appCode':_0x32b4d8[_0x11b233(0xa9)],..._0x3ef7a9})[_0x11b233(0xd2)](_0x11b233(0xc8)+_0x30739c)['build']();}},personalBffExec={'service':'personal-bff','command':a35_0x34fb29(0xc1),'description':a35_0x34fb29(0xb8),'risk':a35_0x34fb29(0xb7),'confirmationDescription':'执行个人\x20BFF\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':'JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'}],async 'validate'(_0x187a5c){const _0x4385eb=a35_0x34fb29;parseExecParams(_0x187a5c['str'](_0x4385eb(0xb1)));},async 'execute'(_0x3210ce){const _0x228930=a35_0x34fb29,_0x5baa95=_0x3210ce[_0x228930(0xd7)]('id'),_0x69fcca=parseExecParams(_0x3210ce[_0x228930(0xe1)](_0x228930(0xb1))),_0x1eeec4=await executePersonalBff(_0x5baa95,_0x3210ce['appCode'],_0x69fcca);return{'ok':!![],'data':{'result':_0x1eeec4},'message':_0x228930(0xb0)+_0x5baa95};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x398eaf=a36_0x3eb2;(function(_0x154370,_0x49693b){const _0xefb1ac=a36_0x3eb2,_0x220d36=_0x154370();while(!![]){try{const _0x3a3811=parseInt(_0xefb1ac(0x81))/0x1*(-parseInt(_0xefb1ac(0xa3))/0x2)+-parseInt(_0xefb1ac(0x8c))/0x3*(-parseInt(_0xefb1ac(0xa5))/0x4)+-parseInt(_0xefb1ac(0x80))/0x5*(parseInt(_0xefb1ac(0x9d))/0x6)+-parseInt(_0xefb1ac(0x9e))/0x7*(parseInt(_0xefb1ac(0x82))/0x8)+-parseInt(_0xefb1ac(0x88))/0x9*(parseInt(_0xefb1ac(0x97))/0xa)+parseInt(_0xefb1ac(0x99))/0xb+-parseInt(_0xefb1ac(0xa4))/0xc*(-parseInt(_0xefb1ac(0x8a))/0xd);if(_0x3a3811===_0x49693b)break;else _0x220d36['push'](_0x220d36['shift']());}catch(_0x15b28a){_0x220d36['push'](_0x220d36['shift']());}}}(a36_0x35da,0x20efa));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';function a36_0x3eb2(_0x4b1fbc,_0x51f364){_0x4b1fbc=_0x4b1fbc-0x6f;const _0x35da2f=a36_0x35da();let _0x3eb2a4=_0x35da2f[_0x4b1fbc];return _0x3eb2a4;}import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';function a36_0x35da(){const _0x5b6f37=['`lovrabet\x20app\x20use`\x20has\x20been\x20removed.','install','run','service','2510CJjssH','Workspace','731753nlrLIh','Use\x20`lovrabet\x20workspace\x20init\x20--appcode\x20<code>`\x20instead.','Skills','app','6xFWRIl','7FTGAPn','app\x20use','\x20\x20[high-risk-write]','set','map','62380hooLtW','408tWpugq','2908GGHOMq','push','Use\x20`lovrabet\x20logs\x20show`\x20to\x20view\x20command\x20history.','Configuration','Use\x20`lovrabet\x20workspace\x20use\x20--app\x20<name>`\x20instead.','description','Authentication','get','`lovrabet\x20logs\x20clear`\x20has\x20been\x20removed.','Self\x20Update','CLI\x20Built-in\x20Skill','Knowledge\x20Base','logs','has','write','Agent\x20Schedules','App\x20Management','SQL\x20Queries','746185ZrCtBP','2FeHcrk','804384HhpLap','command','Schema','values','BFF\x20Scripts','Instant\x20API','9441afcLDg','`lovrabet\x20app\x20init`\x20has\x20been\x20removed.','225329MSgvhZ','clear','225utyUom','login','\x20\x20[write]','isSingleCommand','list','API\x20Documentation','init'];a36_0x35da=function(){return _0x5b6f37;};return a36_0x35da();}import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{scheduleDefinitions}from'../commands/schedule/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x14885e){const _0x2af540=a36_0x3eb2;for(const _0xd02908 of _0x14885e){definitions['set'](_0xd02908['service']+':'+_0xd02908['command'],_0xd02908);let _0x52c32f=serviceGroups[_0x2af540(0x75)](_0xd02908['service']);!_0x52c32f&&(_0x52c32f=[],serviceGroups[_0x2af540(0xa1)](_0xd02908[_0x2af540(0x96)],_0x52c32f)),_0x52c32f[_0x2af540(0x6f)](_0xd02908);}}function registerService(_0x51620f,_0x18886d,_0x48ea1c){const _0x2f2111=a36_0x3eb2;registerDefinitions(_0x18886d);const _0x44582b=_0x3fb615=>_0x3fb615==='read'?'':_0x3fb615===_0x2f2111(0x7c)?_0x2f2111(0x8e):_0x2f2111(0xa0),_0x8b19d6={'service':_0x18886d[0x0]['service'],'label':_0x51620f,'commands':_0x18886d[_0x2f2111(0xa2)](_0x1ce983=>({'command':_0x1ce983['command'],'description':_0x1ce983[_0x2f2111(0x73)],'tag':_0x44582b(_0x1ce983['risk'])})),'defaultCommand':_0x48ea1c?.['defaultCommand']??(_0x48ea1c?.[_0x2f2111(0x8f)]?_0x18886d[0x0][_0x2f2111(0x83)]:undefined),'isSingleCommand':_0x48ea1c?.['isSingleCommand']};serviceRegistry[_0x2f2111(0x6f)](_0x8b19d6),serviceByName['set'](_0x8b19d6[_0x2f2111(0x96)],_0x8b19d6);}registerService(a36_0x398eaf(0x74),authDefinitions,{'defaultCommand':a36_0x398eaf(0x8d)}),registerService(a36_0x398eaf(0x7e),appDefinitions,{'defaultCommand':a36_0x398eaf(0x90)}),registerService(a36_0x398eaf(0x98),workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService(a36_0x398eaf(0x71),configDefinitions,{'defaultCommand':a36_0x398eaf(0x90)}),registerService(a36_0x398eaf(0x91),apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a36_0x398eaf(0x87),dataDefinitions),registerService(a36_0x398eaf(0x7f),sqlDefinitions),registerService(a36_0x398eaf(0x86),bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService('File',fileDefinitions),registerService('OCR',ocrDefinitions),registerService(a36_0x398eaf(0x79),kbDefinitions),registerService(a36_0x398eaf(0x7d),scheduleDefinitions,{'defaultCommand':'list'}),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a36_0x398eaf(0x90)}),registerService(a36_0x398eaf(0x9b),skillDefinitions,{'defaultCommand':a36_0x398eaf(0x94)}),registerService(a36_0x398eaf(0x78),cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x398eaf(0x77),[updateDefinition],{'defaultCommand':a36_0x398eaf(0x95),'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x398eaf(0x84),[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':'show'});export function findDefinition(_0x31fe97,_0x1b153a){const _0xf6e1e3=a36_0x398eaf;return definitions[_0xf6e1e3(0x75)](_0x31fe97+':'+_0x1b153a);}export function resolveRemovedCommand(_0x40705d,_0x24f163){const _0x236802=a36_0x398eaf;if(_0x40705d===_0x236802(0x9c)&&_0x24f163===_0x236802(0x92))return{'command':'app\x20init','message':_0x236802(0x89),'hint':_0x236802(0x9a)};if(_0x40705d==='app'&&_0x24f163==='use')return{'command':_0x236802(0x9f),'message':_0x236802(0x93),'hint':_0x236802(0x72)};if(_0x40705d===_0x236802(0x7a)&&_0x24f163===_0x236802(0x8b))return{'command':'logs\x20clear','message':_0x236802(0x76),'hint':_0x236802(0x70)};return undefined;}export function isKnownService(_0x209e27){const _0x30cc01=a36_0x398eaf;return serviceByName[_0x30cc01(0x7b)](_0x209e27);}export function getServiceEntry(_0x134a65){const _0x300d9c=a36_0x398eaf;return serviceByName[_0x300d9c(0x75)](_0x134a65);}export function getAllDefinitions(){const _0xcd07da=a36_0x398eaf;return Array['from'](definitions[_0xcd07da(0x85)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x3b8cb0=a37_0xa958;(function(_0xbccc19,_0x39dc1e){const _0x1dde94=a37_0xa958,_0x4e9195=_0xbccc19();while(!![]){try{const _0x1baf50=parseInt(_0x1dde94(0x132))/0x1*(parseInt(_0x1dde94(0xf3))/0x2)+-parseInt(_0x1dde94(0x138))/0x3*(-parseInt(_0x1dde94(0xfc))/0x4)+-parseInt(_0x1dde94(0xff))/0x5*(-parseInt(_0x1dde94(0x129))/0x6)+parseInt(_0x1dde94(0xf7))/0x7*(-parseInt(_0x1dde94(0xf5))/0x8)+parseInt(_0x1dde94(0x10e))/0x9+-parseInt(_0x1dde94(0x100))/0xa+-parseInt(_0x1dde94(0x10d))/0xb;if(_0x1baf50===_0x39dc1e)break;else _0x4e9195['push'](_0x4e9195['shift']());}catch(_0x35e3ab){_0x4e9195['push'](_0x4e9195['shift']());}}}(a37_0x4836,0xbf202));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':a37_0x3b8cb0(0xf1),'required':!![],'enum':[a37_0x3b8cb0(0x126),a37_0x3b8cb0(0x11c)],'description':a37_0x3b8cb0(0x10b)},CRON_FLAG={'name':'cron','type':a37_0x3b8cb0(0xf1),'description':'Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules'},SCHEDULED_AT_FLAG={'name':a37_0x3b8cb0(0x12d),'type':a37_0x3b8cb0(0xf1),'description':a37_0x3b8cb0(0x12b)},TITLE_FLAG={'name':a37_0x3b8cb0(0x122),'type':'string','required':!![],'description':a37_0x3b8cb0(0x11f)},PROMPT_FLAG={'name':a37_0x3b8cb0(0x121),'type':'string','required':!![],'description':a37_0x3b8cb0(0xf9)},CHANNEL_FLAG={'name':a37_0x3b8cb0(0x124),'type':a37_0x3b8cb0(0xf1),'enum':[a37_0x3b8cb0(0x11b),a37_0x3b8cb0(0x135)],'default':'premium','description':a37_0x3b8cb0(0x102)},SCHEDULE_ID_FLAG={'name':a37_0x3b8cb0(0x106),'type':a37_0x3b8cb0(0xf1),'required':!![],'description':'Schedule\x20UUID','pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a37_0x3b8cb0(0x113)}},LIMIT_FLAG={'name':a37_0x3b8cb0(0x107),'type':a37_0x3b8cb0(0x11a),'default':0x14,'description':a37_0x3b8cb0(0x104)},CURSOR_FLAG={'name':a37_0x3b8cb0(0x127),'type':'string','description':a37_0x3b8cb0(0x108)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x24921c){const _0x318758=a37_0x3b8cb0,_0x5a844c=_0x24921c[_0x318758(0x10a)](_0x318758(0x12a)),_0x510d6d=_0x24921c['str'](_0x318758(0x122))[_0x318758(0x110)](),_0x24abbc=_0x24921c['str']('prompt')[_0x318758(0x110)](),_0x39fca4=_0x24921c['str'](_0x318758(0x124)),_0x3cf8a2=_0x24921c[_0x318758(0x10a)](_0x318758(0xf4)),_0x4f7714=_0x24921c['str'](_0x318758(0x12d));if(!_0x510d6d)throw CliErrors[_0x318758(0xf2)](_0x318758(0xf6));if(!_0x24abbc)throw CliErrors[_0x318758(0xf2)]('--prompt\x20must\x20not\x20be\x20blank.');if(_0x5a844c===_0x318758(0x126)){if(!_0x3cf8a2||_0x4f7714)throw CliErrors[_0x318758(0xf2)](_0x318758(0xfa));return{'kind':_0x5a844c,'timezone':_0x318758(0xf8),'cron':_0x3cf8a2,'title':_0x510d6d,'prompt':_0x24abbc,'channel':_0x39fca4};}if(_0x5a844c===_0x318758(0x11c)){if(!_0x4f7714||_0x3cf8a2)throw CliErrors[_0x318758(0xf2)]('ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.');return{'kind':_0x5a844c,'timezone':_0x318758(0xf8),'scheduledAt':_0x4f7714,'title':_0x510d6d,'prompt':_0x24abbc,'channel':_0x39fca4};}throw CliErrors[_0x318758(0xf2)]('--kind\x20must\x20be\x20CRON\x20or\x20ONCE.');}function a37_0xa958(_0x3cbdd2,_0x59761c){_0x3cbdd2=_0x3cbdd2-0xee;const _0x4836ff=a37_0x4836();let _0xa95814=_0x4836ff[_0x3cbdd2];return _0xa95814;}function scheduleCollectionPath(_0x1584c7){const _0xa99a35=a37_0x3b8cb0;return'/api/harness/apps/'+encodeURIComponent(_0x1584c7)+_0xa99a35(0xfe);}function scheduleItemPath(_0x50b186,_0x213d8d){return scheduleCollectionPath(_0x50b186)+'/'+encodeURIComponent(_0x213d8d);}function a37_0x4836(){const _0x3c2116=['schedule','/schedules','5087265bPCDVA','8250130ijzSKt','Queued\x20Task\x20','Task\x20channel:\x20auto\x20or\x20premium','description','Page\x20size\x20from\x201\x20to\x20100','Deleted\x20schedule\x20','schedule-id','limit','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','\x20from\x20schedule\x20','str','Schedule\x20kind:\x20CRON\x20or\x20ONCE','high-risk-write','5912269XdJiCD','13158090CbyshF','创建周期性或单次执行的\x20Agent\x20定时任务','trim','将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','scheduleId','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','Created\x20','/run','validate','POST','isSafeInteger','number','auto','ONCE','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','build','Schedule\x20title','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','prompt','title','body','channel','\x20immediately','CRON','cursor','将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','6JCOkIS','kind','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','scheduled-at','length','Schedule\x20input\x20is\x20valid','delete','appCode','1WXQMoR','run','num','premium','list','Preview:\x20delete\x20schedule\x20','909uAyVMa','Preview:\x20create\x20an\x20Agent\x20schedule','read','detail','DELETE','string','validation','198754tbiTXb','cron','2101456UlrLYl','--title\x20must\x20not\x20be\x20blank.','35vhGtaL','UTC','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','11616MYBbCz'];a37_0x4836=function(){return _0x3c2116;};return a37_0x4836();}const scheduleValidate={'service':a37_0x3b8cb0(0xfd),'command':a37_0x3b8cb0(0x117),'description':a37_0x3b8cb0(0xfb),'risk':a37_0x3b8cb0(0xee),'flags':INPUT_FLAGS,async 'validate'(_0x13fc2c){readScheduleInput(_0x13fc2c);},async 'execute'(_0x4fff40){const _0x1f64ea=a37_0x3b8cb0,_0xac50d6=readScheduleInput(_0x4fff40),_0x29ed98=await validateRuntimeSchedule(_0x4fff40[_0x1f64ea(0x131)],_0xac50d6);return{'ok':!![],'data':_0x29ed98,'message':_0x1f64ea(0x12f)};}},scheduleCreate={'service':'schedule','command':'create','description':a37_0x3b8cb0(0x10f),'risk':'high-risk-write','confirmationDescription':a37_0x3b8cb0(0x111),'flags':INPUT_FLAGS,async 'validate'(_0x232ba5){readScheduleInput(_0x232ba5);},async 'execute'(_0x5011ef){const _0x3427ac=a37_0x3b8cb0,_0xe9498b=readScheduleInput(_0x5011ef),_0x1a947f=await validateRuntimeSchedule(_0x5011ef['appCode'],_0xe9498b),_0x38ed61=await createRuntimeSchedule(_0x5011ef[_0x3427ac(0x131)],_0x1a947f);return{'ok':!![],'data':_0x38ed61,'message':_0x3427ac(0x115)+_0x38ed61[_0x3427ac(0x12a)]+'\x20schedule\x20'+_0x38ed61[_0x3427ac(0x112)]};},async 'dryRun'(_0x44d1da){const _0xfa55dc=a37_0x3b8cb0,_0x46492e=readScheduleInput(_0x44d1da);return dryRun(_0xfa55dc(0x118),scheduleCollectionPath(_0x44d1da[_0xfa55dc(0x131)]))[_0xfa55dc(0x123)](_0x46492e)['description'](_0xfa55dc(0x139))[_0xfa55dc(0x11e)]();}},scheduleList={'service':a37_0x3b8cb0(0xfd),'command':a37_0x3b8cb0(0x136),'description':a37_0x3b8cb0(0x12c),'risk':a37_0x3b8cb0(0xee),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x1d3704){const _0x55b9e6=a37_0x3b8cb0,_0x12ae58=_0x1d3704[_0x55b9e6(0x134)]('limit');if(!Number[_0x55b9e6(0x119)](_0x12ae58)||_0x12ae58<0x1||_0x12ae58>0x64)throw CliErrors[_0x55b9e6(0xf2)](_0x55b9e6(0x120));const _0x2f6838=_0x1d3704[_0x55b9e6(0x10a)]('cursor');if(_0x2f6838&&(_0x2f6838[_0x55b9e6(0x12e)]>0x400||_0x2f6838['trim']()!==_0x2f6838))throw CliErrors[_0x55b9e6(0xf2)](_0x55b9e6(0x11d));},async 'execute'(_0x2b70c4){const _0x109070=a37_0x3b8cb0,_0x2465a7=_0x2b70c4[_0x109070(0x10a)](_0x109070(0x127)),_0x40c903=await listRuntimeSchedules(_0x2b70c4[_0x109070(0x131)],{'kind':_0x2b70c4[_0x109070(0x10a)](_0x109070(0x12a)),'limit':_0x2b70c4[_0x109070(0x134)](_0x109070(0x107)),..._0x2465a7?{'cursor':_0x2465a7}:{}});return{'ok':!![],'data':_0x40c903};}},scheduleDetail={'service':a37_0x3b8cb0(0xfd),'command':a37_0x3b8cb0(0xef),'description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':a37_0x3b8cb0(0xee),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0xcb62ab){const _0x3c1095=a37_0x3b8cb0,_0xb5d465=await getRuntimeSchedule(_0xcb62ab[_0x3c1095(0x131)],_0xcb62ab[_0x3c1095(0x10a)](_0x3c1095(0x106)));return{'ok':!![],'data':_0xb5d465};}},scheduleRun={'service':a37_0x3b8cb0(0xfd),'command':a37_0x3b8cb0(0x133),'description':'立即运行一次定时任务并创建\x20Task','risk':a37_0x3b8cb0(0x10c),'confirmationDescription':a37_0x3b8cb0(0x128),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x58fe71){const _0xd80b61=a37_0x3b8cb0,_0x5e9b90=_0x58fe71['str'](_0xd80b61(0x106)),_0x199877=await runRuntimeSchedule(_0x58fe71[_0xd80b61(0x131)],_0x5e9b90);return{'ok':!![],'data':_0x199877,'message':_0xd80b61(0x101)+_0x199877['taskId']+_0xd80b61(0x109)+_0x5e9b90};},async 'dryRun'(_0x12b934){const _0x765d85=a37_0x3b8cb0,_0x371572=_0x12b934[_0x765d85(0x10a)]('schedule-id');return dryRun(_0x765d85(0x118),scheduleItemPath(_0x12b934[_0x765d85(0x131)],_0x371572)+_0x765d85(0x116))[_0x765d85(0x103)]('Preview:\x20run\x20schedule\x20'+_0x371572+_0x765d85(0x125))[_0x765d85(0x11e)]();}},scheduleDelete={'service':a37_0x3b8cb0(0xfd),'command':a37_0x3b8cb0(0x130),'description':'删除定时任务并停止其后续触发','risk':'high-risk-write','confirmationDescription':a37_0x3b8cb0(0x114),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x1436ea){const _0x1b648a=a37_0x3b8cb0,_0x5ce18c=_0x1436ea[_0x1b648a(0x10a)](_0x1b648a(0x106)),_0x113e6c=await deleteRuntimeSchedule(_0x1436ea['appCode'],_0x5ce18c);return{'ok':!![],'data':_0x113e6c,'message':_0x1b648a(0x105)+_0x5ce18c};},async 'dryRun'(_0x1bca3f){const _0x32aef5=a37_0x3b8cb0,_0x1c9b30=_0x1bca3f[_0x32aef5(0x10a)](_0x32aef5(0x106));return dryRun(_0x32aef5(0xf0),scheduleItemPath(_0x1bca3f[_0x32aef5(0x131)],_0x1c9b30))['description'](_0x32aef5(0x137)+_0x1c9b30)[_0x32aef5(0x11e)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
|
1
|
+
function a37_0x3dbc(_0x2e9451,_0x207c7f){_0x2e9451=_0x2e9451-0x12d;const _0x4bca84=a37_0x4bca();let _0x3dbc10=_0x4bca84[_0x2e9451];return _0x3dbc10;}const a37_0x551f66=a37_0x3dbc;(function(_0xdc2977,_0xb21784){const _0x273f14=a37_0x3dbc,_0x2a9e03=_0xdc2977();while(!![]){try{const _0x155e07=parseInt(_0x273f14(0x161))/0x1*(parseInt(_0x273f14(0x15a))/0x2)+-parseInt(_0x273f14(0x15d))/0x3+-parseInt(_0x273f14(0x162))/0x4+parseInt(_0x273f14(0x155))/0x5+parseInt(_0x273f14(0x170))/0x6+parseInt(_0x273f14(0x16f))/0x7+-parseInt(_0x273f14(0x13e))/0x8;if(_0x155e07===_0xb21784)break;else _0x2a9e03['push'](_0x2a9e03['shift']());}catch(_0x2a2f3b){_0x2a9e03['push'](_0x2a9e03['shift']());}}}(a37_0x4bca,0x3ef70));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';function a37_0x4bca(){const _0x4d5939=['auto','list','Schedule\x20title','description','\x20from\x20schedule\x20','ONCE','Queued\x20Task\x20','length','premium','Schedule\x20kind:\x20CRON\x20or\x20ONCE','delete','POST','schedule-id','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','str','kind','title','detail','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','1104115fJZtrB','Preview:\x20delete\x20schedule\x20','prompt','high-risk-write','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','521368tpghiQ','创建周期性或单次执行的\x20Agent\x20定时任务','UTC','201489AbpVBp','--prompt\x20must\x20not\x20be\x20blank.','Preview:\x20run\x20schedule\x20','validation','1pTUDlt','1608008hVoBEA','scheduleId','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','taskId','string','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','build','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','Schedule\x20UUID','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','scheduled-at','3133270UcVPXo','2179038yufRQh','appCode','Schedule\x20input\x20is\x20valid','Page\x20size\x20from\x201\x20to\x20100','Deleted\x20schedule\x20','channel','read','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','CRON','立即运行一次定时任务并创建\x20Task','/run','删除定时任务并停止其后续触发','将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','num','run','limit','Created\x20','\x20schedule\x20','trim','number','/schedules','Show\x20one\x20schedule\x20by\x20schedule\x20ID','4521768jpCDwm','/api/harness/apps/','cursor','schedule'];a37_0x4bca=function(){return _0x4d5939;};return a37_0x4bca();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':a37_0x551f66(0x151),'type':'string','required':!![],'enum':['CRON',a37_0x551f66(0x147)],'description':a37_0x551f66(0x14b)},CRON_FLAG={'name':'cron','type':a37_0x551f66(0x167),'description':'Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules'},SCHEDULED_AT_FLAG={'name':'scheduled-at','type':a37_0x551f66(0x167),'description':'Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules'},TITLE_FLAG={'name':'title','type':a37_0x551f66(0x167),'required':!![],'description':a37_0x551f66(0x144)},PROMPT_FLAG={'name':a37_0x551f66(0x157),'type':a37_0x551f66(0x167),'required':!![],'description':a37_0x551f66(0x154)},CHANNEL_FLAG={'name':a37_0x551f66(0x12d),'type':a37_0x551f66(0x167),'enum':[a37_0x551f66(0x142),a37_0x551f66(0x14a)],'default':'premium','description':'Task\x20channel:\x20auto\x20or\x20premium'},SCHEDULE_ID_FLAG={'name':a37_0x551f66(0x14e),'type':'string','required':!![],'description':a37_0x551f66(0x16b),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a37_0x551f66(0x164)}},LIMIT_FLAG={'name':'limit','type':a37_0x551f66(0x13b),'default':0x14,'description':a37_0x551f66(0x173)},CURSOR_FLAG={'name':a37_0x551f66(0x140),'type':a37_0x551f66(0x167),'description':a37_0x551f66(0x14f)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x1bbe41){const _0x3be783=a37_0x551f66,_0x197954=_0x1bbe41[_0x3be783(0x150)](_0x3be783(0x151)),_0x56f458=_0x1bbe41[_0x3be783(0x150)](_0x3be783(0x152))[_0x3be783(0x13a)](),_0x58908c=_0x1bbe41['str'](_0x3be783(0x157))[_0x3be783(0x13a)](),_0x30974f=_0x1bbe41['str'](_0x3be783(0x12d)),_0x448160=_0x1bbe41[_0x3be783(0x150)]('cron'),_0x4af2cb=_0x1bbe41[_0x3be783(0x150)](_0x3be783(0x16e));if(!_0x56f458)throw CliErrors['validation']('--title\x20must\x20not\x20be\x20blank.');if(!_0x58908c)throw CliErrors['validation'](_0x3be783(0x15e));if(_0x197954===_0x3be783(0x130)){if(!_0x448160||_0x4af2cb)throw CliErrors[_0x3be783(0x160)](_0x3be783(0x159));return{'kind':_0x197954,'timezone':_0x3be783(0x15c),'cron':_0x448160,'title':_0x56f458,'prompt':_0x58908c,'channel':_0x30974f};}if(_0x197954===_0x3be783(0x147)){if(!_0x4af2cb||_0x448160)throw CliErrors[_0x3be783(0x160)](_0x3be783(0x168));return{'kind':_0x197954,'timezone':_0x3be783(0x15c),'scheduledAt':_0x4af2cb,'title':_0x56f458,'prompt':_0x58908c,'channel':_0x30974f};}throw CliErrors[_0x3be783(0x160)](_0x3be783(0x12f));}function scheduleCollectionPath(_0x4a841b){const _0x35131c=a37_0x551f66;return _0x35131c(0x13f)+encodeURIComponent(_0x4a841b)+_0x35131c(0x13c);}function scheduleItemPath(_0x3d37e4,_0x4910e7){return scheduleCollectionPath(_0x3d37e4)+'/'+encodeURIComponent(_0x4910e7);}const scheduleValidate={'service':a37_0x551f66(0x141),'command':'validate','description':a37_0x551f66(0x16c),'risk':a37_0x551f66(0x12e),'flags':INPUT_FLAGS,async 'validate'(_0x547346){readScheduleInput(_0x547346);},async 'execute'(_0x414aea){const _0x54de3f=a37_0x551f66,_0x3666d9=readScheduleInput(_0x414aea),_0x2652af=await validateRuntimeSchedule(_0x414aea['appCode'],_0x3666d9);return{'ok':!![],'data':_0x2652af,'message':_0x54de3f(0x172)};}},scheduleCreate={'service':a37_0x551f66(0x141),'command':'create','description':a37_0x551f66(0x15b),'risk':a37_0x551f66(0x158),'confirmationDescription':a37_0x551f66(0x165),'flags':INPUT_FLAGS,async 'validate'(_0x236c40){readScheduleInput(_0x236c40);},async 'execute'(_0x4a0462){const _0x7f284b=a37_0x551f66,_0x1c106a=readScheduleInput(_0x4a0462),_0x143b42=await validateRuntimeSchedule(_0x4a0462[_0x7f284b(0x171)],_0x1c106a),_0x2fb867=await createRuntimeSchedule(_0x4a0462[_0x7f284b(0x171)],_0x143b42);return{'ok':!![],'data':_0x2fb867,'message':_0x7f284b(0x138)+_0x2fb867[_0x7f284b(0x151)]+_0x7f284b(0x139)+_0x2fb867[_0x7f284b(0x163)]};},async 'dryRun'(_0x5058bd){const _0x4a2233=a37_0x551f66,_0x570f06=readScheduleInput(_0x5058bd);return dryRun(_0x4a2233(0x14d),scheduleCollectionPath(_0x5058bd[_0x4a2233(0x171)]))['body'](_0x570f06)[_0x4a2233(0x145)]('Preview:\x20create\x20an\x20Agent\x20schedule')['build']();}},scheduleList={'service':a37_0x551f66(0x141),'command':a37_0x551f66(0x143),'description':'List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','risk':a37_0x551f66(0x12e),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x152155){const _0x32295e=a37_0x551f66,_0x32894c=_0x152155[_0x32295e(0x135)](_0x32295e(0x137));if(!Number['isSafeInteger'](_0x32894c)||_0x32894c<0x1||_0x32894c>0x64)throw CliErrors['validation'](_0x32295e(0x16a));const _0x4459a8=_0x152155[_0x32295e(0x150)](_0x32295e(0x140));if(_0x4459a8&&(_0x4459a8[_0x32295e(0x149)]>0x400||_0x4459a8[_0x32295e(0x13a)]()!==_0x4459a8))throw CliErrors[_0x32295e(0x160)]('--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.');},async 'execute'(_0x251a00){const _0x115104=a37_0x551f66,_0x348ab0=_0x251a00[_0x115104(0x150)]('cursor'),_0x3ef120=await listRuntimeSchedules(_0x251a00[_0x115104(0x171)],{'kind':_0x251a00[_0x115104(0x150)](_0x115104(0x151)),'limit':_0x251a00[_0x115104(0x135)](_0x115104(0x137)),..._0x348ab0?{'cursor':_0x348ab0}:{}});return{'ok':!![],'data':_0x3ef120};}},scheduleDetail={'service':a37_0x551f66(0x141),'command':a37_0x551f66(0x153),'description':a37_0x551f66(0x13d),'risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x579ee8){const _0x381252=a37_0x551f66,_0x61701e=await getRuntimeSchedule(_0x579ee8[_0x381252(0x171)],_0x579ee8['str'](_0x381252(0x14e)));return{'ok':!![],'data':_0x61701e};}},scheduleRun={'service':'schedule','command':a37_0x551f66(0x136),'description':a37_0x551f66(0x131),'risk':a37_0x551f66(0x158),'confirmationDescription':a37_0x551f66(0x16d),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x4731a9){const _0x2a7ff1=a37_0x551f66,_0x181892=_0x4731a9[_0x2a7ff1(0x150)](_0x2a7ff1(0x14e)),_0x2360e2=await runRuntimeSchedule(_0x4731a9[_0x2a7ff1(0x171)],_0x181892);return{'ok':!![],'data':_0x2360e2,'message':_0x2a7ff1(0x148)+_0x2360e2[_0x2a7ff1(0x166)]+_0x2a7ff1(0x146)+_0x181892};},async 'dryRun'(_0xe7e7b3){const _0x4a7880=a37_0x551f66,_0x447414=_0xe7e7b3[_0x4a7880(0x150)](_0x4a7880(0x14e));return dryRun(_0x4a7880(0x14d),scheduleItemPath(_0xe7e7b3[_0x4a7880(0x171)],_0x447414)+_0x4a7880(0x132))[_0x4a7880(0x145)](_0x4a7880(0x15f)+_0x447414+'\x20immediately')[_0x4a7880(0x169)]();}},scheduleDelete={'service':'schedule','command':a37_0x551f66(0x14c),'description':a37_0x551f66(0x133),'risk':a37_0x551f66(0x158),'confirmationDescription':a37_0x551f66(0x134),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x186bf8){const _0x492ad0=a37_0x551f66,_0x461b96=_0x186bf8[_0x492ad0(0x150)](_0x492ad0(0x14e)),_0x523c9a=await deleteRuntimeSchedule(_0x186bf8[_0x492ad0(0x171)],_0x461b96);return{'ok':!![],'data':_0x523c9a,'message':_0x492ad0(0x174)+_0x461b96};},async 'dryRun'(_0x532d78){const _0x2badcd=a37_0x551f66,_0x3a72b0=_0x532d78[_0x2badcd(0x150)]('schedule-id');return dryRun('DELETE',scheduleItemPath(_0x532d78[_0x2badcd(0x171)],_0x3a72b0))[_0x2badcd(0x145)](_0x2badcd(0x156)+_0x3a72b0)[_0x2badcd(0x169)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a38_0x5e7d(_0x207f1c,_0x4c4c23){_0x207f1c=_0x207f1c-0x1ac;const _0x459f03=a38_0x459f();let _0x5e7d28=_0x459f03[_0x207f1c];return _0x5e7d28;}const a38_0x40096a=a38_0x5e7d;(function(_0x369fc8,_0x4944ff){const _0x4a221d=a38_0x5e7d,_0x5b7061=_0x369fc8();while(!![]){try{const _0x2160a9=-parseInt(_0x4a221d(0x1b8))/0x1+-parseInt(_0x4a221d(0x1b7))/0x2*(-parseInt(_0x4a221d(0x1b9))/0x3)+-parseInt(_0x4a221d(0x1b2))/0x4*(parseInt(_0x4a221d(0x1b6))/0x5)+-parseInt(_0x4a221d(0x1b0))/0x6*(parseInt(_0x4a221d(0x1b5))/0x7)+-parseInt(_0x4a221d(0x1af))/0x8*(parseInt(_0x4a221d(0x1ae))/0x9)+-parseInt(_0x4a221d(0x1b1))/0xa*(parseInt(_0x4a221d(0x1b4))/0xb)+parseInt(_0x4a221d(0x1ad))/0xc;if(_0x2160a9===_0x4944ff)break;else _0x5b7061['push'](_0x5b7061['shift']());}catch(_0x2c75ab){_0x5b7061['push'](_0x5b7061['shift']());}}}(a38_0x459f,0x3d0f7));function a38_0x459f(){const _0x3e8df6=['1710366DZafhB','2041175aoLwGv','1774AesPbC','360909kTMRAI','813CdvROo','Export\x20machine-readable\x20command\x20schema\x20(JSON)','17325984NocRJK','1654281Nxpjvp','16yePDKJ','6Qtaagi','265030pMSZLF','4zaWfvA','export','22HMnjMM'];a38_0x459f=function(){return _0x3e8df6;};return a38_0x459f();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x4fc370){const _0x48c971=await buildSchemaPayload();return{'ok':!![],'data':_0x48c971};}export const schemaDefinition={'service':'schema','command':a38_0x40096a(0x1b3),'description':a38_0x40096a(0x1ac),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|