@lovrabet/lovrabet-cli 2.1.9-beta.4 → 2.1.10
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/app-config/shared.js +1 -1
- package/lib/commands/artifact/index.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/schema.js +1 -1
- package/lib/commands/service/dynamic.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/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/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/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.js +1 -1
- package/lib/help.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/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/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.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
|
@@ -1 +1 @@
|
|
|
1
|
-
const a55_0x38de35=a55_0x4d05;(function(_0x1790ed,_0x2d8844){const _0x4578a3=a55_0x4d05,_0x2fb84b=_0x1790ed();while(!![]){try{const _0x417944=parseInt(_0x4578a3(0x219))/0x1+parseInt(_0x4578a3(0x213))/0x2+-parseInt(_0x4578a3(0x211))/0x3*(parseInt(_0x4578a3(0x1e6))/0x4)+parseInt(_0x4578a3(0x22e))/0x5+-parseInt(_0x4578a3(0x1f2))/0x6*(-parseInt(_0x4578a3(0x1eb))/0x7)+parseInt(_0x4578a3(0x21d))/0x8*(parseInt(_0x4578a3(0x20a))/0x9)+-parseInt(_0x4578a3(0x200))/0xa;if(_0x417944===_0x2d8844)break;else _0x2fb84b['push'](_0x2fb84b['shift']());}catch(_0x31deb4){_0x2fb84b['push'](_0x2fb84b['shift']());}}}(a55_0x33e5,0x85d54));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{resolve}from'node:path';import{parse as a55_0x3cb111}from'yaml';import{CliErrors}from'../../errors.js';import{fileText,scanSkillDirectory}from'../../skills/runtime-skill-sync/local-files.js';const SKILL_FILE=a55_0x38de35(0x22c),SUPPORTED_SKILL_TYPES=new Set(['write',a55_0x38de35(0x21c),a55_0x38de35(0x1ef)]),TEXT_SKILL_FILE_PATTERN=/(?:^SKILL\.md$|\.(?:md|mdx|txt|json|ya?ml|js|mjs|cjs|ts|tsx|sh|sql))$/i;export function validateSkillDirectory(_0x5a1c62,_0x19f06f={}){const _0x3f009b=a55_0x38de35,_0x57a0c8=resolveSkillDirectoryRoot(_0x5a1c62),_0x3d7aea=[],_0x2761c2=loadRequiredSkillFile(_0x57a0c8,_0x3d7aea),_0x7ce6f6=_0x2761c2?parseFrontmatter(_0x2761c2['content']):{'hasFrontmatter':![]};_0x2761c2&&validateFrontmatter(_0x2761c2[_0x3f009b(0x220)],_0x7ce6f6,_0x3d7aea);validateRuntimeCliReferences(_0x57a0c8,_0x3d7aea);const _0x20d309=_0x3d7aea[_0x3f009b(0x226)](_0x36cd60=>_0x36cd60[_0x3f009b(0x1e5)]==='error'),_0x317f27=_0x3d7aea[_0x3f009b(0x226)](_0x44b652=>_0x44b652['level']==='warning');return{'ok':_0x20d309[_0x3f009b(0x230)]===0x0,'dir':_0x57a0c8,'type':_0x7ce6f6[_0x3f009b(0x21e)],'errors':_0x20d309,'warnings':_0x317f27};}function resolveSkillDirectoryRoot(_0x54e805){const _0x392ab1=a55_0x38de35,_0x1a7539=resolve(_0x54e805);if(!existsSync(_0x1a7539))throw CliErrors[_0x392ab1(0x1f6)]('Skill\x20directory\x20not\x20found:\x20'+_0x54e805);const _0xf4da77=lstatSync(_0x1a7539);if(_0xf4da77['isDirectory']())return _0x1a7539;if(_0xf4da77['isSymbolicLink']()){const _0x1d2a8b=realpathSync(_0x1a7539);if(lstatSync(_0x1d2a8b)[_0x392ab1(0x1f1)]())return _0x1d2a8b;}throw CliErrors[_0x392ab1(0x1f6)](_0x392ab1(0x21b)+_0x54e805);}export function throwIfSkillValidationFailed(_0x6ba8ba,_0x2ae7bb=![]){const _0x38cc17=a55_0x38de35;if(_0x6ba8ba['ok'])return;const _0x36be39=_0x6ba8ba['errors'][_0x38cc17(0x221)](_0x3012a0=>{const _0xce160e=_0x38cc17,_0x56e985=_0x3012a0[_0xce160e(0x210)]?'#'+_0x3012a0[_0xce160e(0x210)]:'';return _0x3012a0[_0xce160e(0x1e5)][_0xce160e(0x20e)]()+'\x20'+_0x3012a0[_0xce160e(0x223)]+'\x20'+_0x3012a0[_0xce160e(0x206)]+_0x56e985+':\x20'+_0x3012a0[_0xce160e(0x1e9)]+_0xce160e(0x228)+_0x3012a0['suggestion'];});throw CliErrors[_0x38cc17(0x1f6)](_0x38cc17(0x20c)+_0x36be39[_0x38cc17(0x1f8)]('\x0a'),'Fix\x20the\x20Skill\x20metadata\x20before\x20running\x20skill\x20push.');}function loadRequiredSkillFile(_0x485007,_0x1d8544){const _0x18377b=a55_0x38de35,_0x54ced0=resolve(_0x485007,SKILL_FILE);if(!existsSync(_0x54ced0))return _0x1d8544[_0x18377b(0x205)](issue('error',_0x18377b(0x1f5),SKILL_FILE,_0x18377b(0x1fe),_0x18377b(0x229))),undefined;const _0xa7bb1b=lstatSync(_0x54ced0);if(_0xa7bb1b[_0x18377b(0x1e8)]())return _0x1d8544[_0x18377b(0x205)](issue(_0x18377b(0x234),'structure-complete',SKILL_FILE,_0x18377b(0x209),_0x18377b(0x20d))),undefined;if(!_0xa7bb1b[_0x18377b(0x22d)]())return _0x1d8544['push'](issue(_0x18377b(0x234),_0x18377b(0x1f5),SKILL_FILE,_0x18377b(0x1ee),'Add\x20SKILL.md\x20as\x20a\x20regular\x20file\x20at\x20the\x20Skill\x20directory\x20root.')),undefined;return{'path':SKILL_FILE,'content':readFileSync(_0x54ced0,'utf8')};}function validateFrontmatter(_0x5921ec,_0x3e001e,_0x519c42){const _0x172636=a55_0x38de35;if(!_0x3e001e[_0x172636(0x1ec)]){_0x519c42[_0x172636(0x205)](issue(_0x172636(0x234),'frontmatter-required',_0x5921ec,_0x172636(0x1f4),'Add\x20frontmatter\x20with\x20name\x20and\x20description.'));return;}!_0x3e001e[_0x172636(0x231)]?.[_0x172636(0x1ff)]()&&_0x519c42['push'](issue(_0x172636(0x234),_0x172636(0x1f0),_0x5921ec,'Frontmatter\x20name\x20is\x20missing.',_0x172636(0x203))),!_0x3e001e[_0x172636(0x21f)]?.[_0x172636(0x1ff)]()&&_0x519c42[_0x172636(0x205)](issue(_0x172636(0x22f),_0x172636(0x232),_0x5921ec,_0x172636(0x1f3),'Set\x20displayName\x20to\x20the\x20human-readable\x20Skill\x20name\x20shown\x20in\x20SkillHub.')),!_0x3e001e['description']?.['trim']()&&_0x519c42[_0x172636(0x205)](issue(_0x172636(0x234),_0x172636(0x1fb),_0x5921ec,_0x172636(0x20b),_0x172636(0x21a))),_0x3e001e['internal']===!![]&&_0x519c42[_0x172636(0x205)](issue('error','internal-skill',_0x5921ec,_0x172636(0x22b),_0x172636(0x204))),_0x3e001e[_0x172636(0x21e)]?.[_0x172636(0x1ff)]()&&!SUPPORTED_SKILL_TYPES['has'](_0x3e001e[_0x172636(0x21e)])&&_0x519c42[_0x172636(0x205)](issue(_0x172636(0x234),'frontmatter-required',_0x5921ec,_0x172636(0x212),'Set\x20metadata.type\x20to\x20write,\x20read,\x20or\x20trainer.'));}function validateRuntimeCliReferences(_0x43e86b,_0x284260){const _0x3eba56=a55_0x38de35;for(const _0x384563 of findRabetbaseCliInvocations(_0x43e86b)){_0x284260[_0x3eba56(0x205)](issue('warning',_0x3eba56(0x1ea),_0x384563[_0x3eba56(0x206)],_0x3eba56(0x1e4),_0x3eba56(0x1f7),'L'+_0x384563['line']));}}function findRabetbaseCliInvocations(_0x464293){const _0x593d15=a55_0x38de35;return scanSkillDirectory(_0x464293)[_0x593d15(0x226)](_0x33b993=>TEXT_SKILL_FILE_PATTERN[_0x593d15(0x1fa)](_0x33b993[_0x593d15(0x220)]))[_0x593d15(0x1e7)](_0x228a39=>{const _0x4b67a5=_0x593d15,_0x511ac7=fileText(_0x228a39);return _0x511ac7[_0x4b67a5(0x218)](/\r?\n/)['map']((_0x2c5ef7,_0x1c61b6)=>({'file':_0x228a39[_0x4b67a5(0x220)],'line':_0x1c61b6+0x1,'text':_0x2c5ef7}))[_0x4b67a5(0x226)](({text:_0xe4309e})=>isRabetbaseCliInvocation(_0xe4309e))['map'](({file:_0x37007e,line:_0x127812})=>({'file':_0x37007e,'line':_0x127812}));});}const RABETBASE_SUBCOMMANDS=['dataset','sql',a55_0x38de35(0x1fc),a55_0x38de35(0x207),'project','app',a55_0x38de35(0x227),'service','artifact','kb',a55_0x38de35(0x216),a55_0x38de35(0x233),'data',a55_0x38de35(0x215),a55_0x38de35(0x225),'registry'],RABETBASE_INVOCATION=new RegExp(String[a55_0x38de35(0x1fd)]`\brabetbase\s+(?:${RABETBASE_SUBCOMMANDS[a55_0x38de35(0x1f8)]('|')})\b`+String[a55_0x38de35(0x1fd)]`(?:\s+[a-z][\w-]*){0,2}\s+(?:--?[a-z]|[\w.-]+=)`,'i');function isRabetbaseCliInvocation(_0x703595){const _0x5c9c1d=a55_0x38de35,_0x26ec83=_0x703595[_0x5c9c1d(0x217)](/\brabetbase\b/i);if(_0x26ec83<0x0)return![];const _0x4fa973=_0x703595[_0x5c9c1d(0x22a)](_0x26ec83)['split'](/\blovrabet\b/i)[0x0]??'';return RABETBASE_INVOCATION[_0x5c9c1d(0x1fa)](_0x4fa973);}function a55_0x4d05(_0x575bda,_0x42fe52){_0x575bda=_0x575bda-0x1e4;const _0x33e5c0=a55_0x33e5();let _0x4d05f9=_0x33e5c0[_0x575bda];return _0x4d05f9;}function parseFrontmatter(_0x2f0962){const _0x2622b3=a55_0x38de35,_0x1bfff5=_0x2f0962[_0x2622b3(0x214)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1bfff5)return{'hasFrontmatter':![]};const _0x50442c=_0x1bfff5[0x1]??'',_0x33f8d9={'hasFrontmatter':!![]};let _0x5bfd03;try{_0x5bfd03=a55_0x3cb111(_0x50442c);}catch{return _0x33f8d9;}const _0x6cfac5=asRecord(_0x5bfd03);if(!_0x6cfac5)return _0x33f8d9;_0x33f8d9['name']=scalarToString(_0x6cfac5[_0x2622b3(0x231)]),_0x33f8d9[_0x2622b3(0x21f)]=scalarToString(_0x6cfac5[_0x2622b3(0x21f)]),_0x33f8d9[_0x2622b3(0x202)]=scalarToString(_0x6cfac5['description']);const _0x4fab21=asRecord(_0x6cfac5['metadata']);return _0x4fab21&&(_0x33f8d9[_0x2622b3(0x21e)]=scalarToString(_0x4fab21[_0x2622b3(0x21e)]),_0x33f8d9[_0x2622b3(0x1ed)]=scalarToBoolean(_0x4fab21[_0x2622b3(0x1ed)])),_0x33f8d9;}function asRecord(_0x5c49e1){if(_0x5c49e1&&typeof _0x5c49e1==='object'&&!Array['isArray'](_0x5c49e1))return _0x5c49e1;return undefined;}function scalarToString(_0x5ed266){const _0x3559a2=a55_0x38de35;if(typeof _0x5ed266==='string')return _0x5ed266[_0x3559a2(0x1ff)]();if(typeof _0x5ed266===_0x3559a2(0x222)||typeof _0x5ed266==='boolean')return String(_0x5ed266);return undefined;}function scalarToBoolean(_0x9aaf81){const _0x56006f=a55_0x38de35;if(typeof _0x9aaf81===_0x56006f(0x20f))return _0x9aaf81;if(typeof _0x9aaf81===_0x56006f(0x208))return cleanBoolean(_0x9aaf81);return undefined;}function cleanBoolean(_0x467901){const _0x3719f1=a55_0x38de35,_0x45e482=_0x467901[_0x3719f1(0x1ff)]()[_0x3719f1(0x224)]();if(_0x45e482===_0x3719f1(0x201))return!![];if(_0x45e482===_0x3719f1(0x1f9))return![];return undefined;}function issue(_0x434bf5,_0x147b92,_0x35bd0b,_0x3f7804,_0x467c3b,_0x1934d3){return{'level':_0x434bf5,'ruleId':_0x147b92,'file':_0x35bd0b,'section':_0x1934d3,'message':_0x3f7804,'suggestion':_0x467c3b};}function a55_0x33e5(){const _0x4a0b04=['false','test','description-required','bff','raw','Missing\x20SKILL.md.','trim','15532550VEVFIw','true','description','Set\x20name\x20to\x20the\x20Skill\x20directory\x20code.','Remove\x20metadata.internal\x20or\x20set\x20it\x20to\x20false\x20before\x20running\x20skill\x20push.','push','file','page','string','SKILL.md\x20must\x20be\x20a\x20regular\x20file.','3230622OlqtoI','Frontmatter\x20description\x20is\x20empty.','Skill\x20validation\x20failed:\x0a','Replace\x20the\x20symlink\x20with\x20a\x20regular\x20SKILL.md\x20file\x20inside\x20the\x20Skill\x20directory.','toUpperCase','boolean','section','116988ipUjiR','metadata.type\x20must\x20be\x20one\x20of\x20write,\x20read,\x20or\x20trainer.','1613630faoxDI','match','auth','config','search','split','752523shHCrL','填写模型触发语义:用户在什么场景应使用本\x20Skill、不要使用的边界和关键词。','Skill\x20directory\x20not\x20found:\x20','read','24pJrhyz','type','displayName','path','map','number','ruleId','toLowerCase','logs','filter','schema','\x20Fix:\x20','Add\x20SKILL.md\x20at\x20the\x20Skill\x20directory\x20root.','slice','metadata.internal=true\x20Skills\x20cannot\x20be\x20uploaded.','SKILL.md','isFile','666930icwDxF','warning','length','name','display-name-recommended','workspace','error','This\x20line\x20invokes\x20the\x20rabetbase\x20CLI.\x20rabetbase\x20is\x20a\x20dev-time\x20tool;\x20runtime\x20Skills\x20should\x20drive\x20runtime\x20work\x20through\x20lovrabet\x20commands.','level','72lBYDyV','flatMap','isSymbolicLink','message','rabetbase-cli-reference','236355mGMDPe','hasFrontmatter','internal','SKILL.md\x20is\x20not\x20a\x20file.','trainer','frontmatter-required','isDirectory','6jsRIPL','Frontmatter\x20displayName\x20is\x20missing.','SKILL.md\x20must\x20start\x20with\x20frontmatter.','structure-complete','validation','If\x20this\x20is\x20a\x20runtime\x20step,\x20replace\x20it\x20with\x20the\x20equivalent\x20lovrabet\x20command.\x20Dev-time\x20discovery\x20or\x20handoff\x20notes\x20can\x20stay.','join'];a55_0x33e5=function(){return _0x4a0b04;};return a55_0x33e5();}
|
|
1
|
+
const a55_0x4f7faa=a55_0x95aa;(function(_0x5db506,_0x256fa0){const _0xb6530d=a55_0x95aa,_0x15d913=_0x5db506();while(!![]){try{const _0x3401ef=-parseInt(_0xb6530d(0x187))/0x1*(parseInt(_0xb6530d(0x174))/0x2)+-parseInt(_0xb6530d(0x1a0))/0x3+-parseInt(_0xb6530d(0x188))/0x4*(parseInt(_0xb6530d(0x154))/0x5)+-parseInt(_0xb6530d(0x155))/0x6*(parseInt(_0xb6530d(0x15b))/0x7)+parseInt(_0xb6530d(0x16e))/0x8+-parseInt(_0xb6530d(0x162))/0x9+parseInt(_0xb6530d(0x19e))/0xa;if(_0x3401ef===_0x256fa0)break;else _0x15d913['push'](_0x15d913['shift']());}catch(_0x46bc3f){_0x15d913['push'](_0x15d913['shift']());}}}(a55_0x44bc,0x6a066));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{resolve}from'node:path';import{parse as a55_0x1c98ec}from'yaml';function a55_0x95aa(_0x1b55f6,_0x496ef1){_0x1b55f6=_0x1b55f6-0x14f;const _0x44bc1e=a55_0x44bc();let _0x95aad2=_0x44bc1e[_0x1b55f6];return _0x95aad2;}function a55_0x44bc(){const _0x51fb49=['level','Skill\x20validation\x20failed:\x0a','1JYJUNa','76UoyPxd','sql','This\x20line\x20invokes\x20the\x20rabetbase\x20CLI.\x20rabetbase\x20is\x20a\x20dev-time\x20tool;\x20runtime\x20Skills\x20should\x20drive\x20runtime\x20work\x20through\x20lovrabet\x20commands.','errors','Fix\x20the\x20Skill\x20metadata\x20before\x20running\x20skill\x20push.','data','SKILL.md\x20must\x20start\x20with\x20frontmatter.','description-required','name','Replace\x20the\x20symlink\x20with\x20a\x20regular\x20SKILL.md\x20file\x20inside\x20the\x20Skill\x20directory.','Add\x20SKILL.md\x20as\x20a\x20regular\x20file\x20at\x20the\x20Skill\x20directory\x20root.','validation','message','structure-complete','registry','workspace','dataset','metadata.type\x20must\x20be\x20one\x20of\x20write,\x20read,\x20or\x20trainer.','artifact','isFile','section','Add\x20frontmatter\x20with\x20name\x20and\x20description.','27736120snBhIq','type','1820070HjhAZr','ruleId','trainer','Missing\x20SKILL.md.','error','warning','Set\x20displayName\x20to\x20the\x20human-readable\x20Skill\x20name\x20shown\x20in\x20SkillHub.','object','internal','196715aRWNPO','5820YOvepl','push','match','internal-skill','string','displayName','3682UhMWkK','frontmatter-required','display-name-recommended','isSymbolicLink','If\x20this\x20is\x20a\x20runtime\x20step,\x20replace\x20it\x20with\x20the\x20equivalent\x20lovrabet\x20command.\x20Dev-time\x20discovery\x20or\x20handoff\x20notes\x20can\x20stay.','slice','true','2242611XuxeuG','SKILL.md','Frontmatter\x20displayName\x20is\x20missing.','isArray','Skill\x20directory\x20not\x20found:\x20','description','write','Add\x20SKILL.md\x20at\x20the\x20Skill\x20directory\x20root.','Frontmatter\x20name\x20is\x20missing.','number','raw','\x20Fix:\x20','2149544UeKmhR','line','join','page','SKILL.md\x20is\x20not\x20a\x20file.','suggestion','988842bRJbRE','map','Set\x20metadata.type\x20to\x20write,\x20read,\x20or\x20trainer.','search','path','trim','metadata.internal=true\x20Skills\x20cannot\x20be\x20uploaded.','flatMap','hasFrontmatter','service','filter','project','length','boolean','read','SKILL.md\x20must\x20be\x20a\x20regular\x20file.','test'];a55_0x44bc=function(){return _0x51fb49;};return a55_0x44bc();}import{CliErrors}from'../../errors.js';import{fileText,scanSkillDirectory}from'../../skills/runtime-skill-sync/local-files.js';const SKILL_FILE=a55_0x4f7faa(0x163),SUPPORTED_SKILL_TYPES=new Set([a55_0x4f7faa(0x168),a55_0x4f7faa(0x182),a55_0x4f7faa(0x1a2)]),TEXT_SKILL_FILE_PATTERN=/(?:^SKILL\.md$|\.(?:md|mdx|txt|json|ya?ml|js|mjs|cjs|ts|tsx|sh|sql))$/i;export function validateSkillDirectory(_0x5642fb,_0x553b68={}){const _0x40504f=a55_0x4f7faa,_0x61d216=resolveSkillDirectoryRoot(_0x5642fb),_0x41e530=[],_0x1e7653=loadRequiredSkillFile(_0x61d216,_0x41e530),_0x48bf9a=_0x1e7653?parseFrontmatter(_0x1e7653['content']):{'hasFrontmatter':![]};_0x1e7653&&validateFrontmatter(_0x1e7653[_0x40504f(0x178)],_0x48bf9a,_0x41e530);validateRuntimeCliReferences(_0x61d216,_0x41e530);const _0x1accc3=_0x41e530[_0x40504f(0x17e)](_0x461d94=>_0x461d94['level']===_0x40504f(0x14f)),_0xbf8275=_0x41e530['filter'](_0x276fdb=>_0x276fdb[_0x40504f(0x185)]===_0x40504f(0x150));return{'ok':_0x1accc3[_0x40504f(0x180)]===0x0,'dir':_0x61d216,'type':_0x48bf9a[_0x40504f(0x19f)],'errors':_0x1accc3,'warnings':_0xbf8275};}function resolveSkillDirectoryRoot(_0x2a6071){const _0x2a48f3=a55_0x4f7faa,_0xb23ade=resolve(_0x2a6071);if(!existsSync(_0xb23ade))throw CliErrors[_0x2a48f3(0x193)](_0x2a48f3(0x166)+_0x2a6071);const _0x4156fe=lstatSync(_0xb23ade);if(_0x4156fe['isDirectory']())return _0xb23ade;if(_0x4156fe[_0x2a48f3(0x15e)]()){const _0x42df48=realpathSync(_0xb23ade);if(lstatSync(_0x42df48)['isDirectory']())return _0x42df48;}throw CliErrors[_0x2a48f3(0x193)]('Skill\x20directory\x20not\x20found:\x20'+_0x2a6071);}export function throwIfSkillValidationFailed(_0x2335fe,_0xd91e6=![]){const _0x4622cd=a55_0x4f7faa;if(_0x2335fe['ok'])return;const _0x5a4cdf=_0x2335fe[_0x4622cd(0x18b)][_0x4622cd(0x175)](_0x461f70=>{const _0x57bee6=_0x4622cd,_0x4bb0c2=_0x461f70[_0x57bee6(0x19c)]?'#'+_0x461f70[_0x57bee6(0x19c)]:'';return _0x461f70[_0x57bee6(0x185)]['toUpperCase']()+'\x20'+_0x461f70[_0x57bee6(0x1a1)]+'\x20'+_0x461f70['file']+_0x4bb0c2+':\x20'+_0x461f70[_0x57bee6(0x194)]+_0x57bee6(0x16d)+_0x461f70[_0x57bee6(0x173)];});throw CliErrors[_0x4622cd(0x193)](_0x4622cd(0x186)+_0x5a4cdf[_0x4622cd(0x170)]('\x0a'),_0x4622cd(0x18c));}function loadRequiredSkillFile(_0x416f19,_0x43b24a){const _0x5a4c06=a55_0x4f7faa,_0x3664d4=resolve(_0x416f19,SKILL_FILE);if(!existsSync(_0x3664d4))return _0x43b24a[_0x5a4c06(0x156)](issue(_0x5a4c06(0x14f),'structure-complete',SKILL_FILE,_0x5a4c06(0x1a3),_0x5a4c06(0x169))),undefined;const _0xf0592f=lstatSync(_0x3664d4);if(_0xf0592f[_0x5a4c06(0x15e)]())return _0x43b24a['push'](issue(_0x5a4c06(0x14f),_0x5a4c06(0x195),SKILL_FILE,_0x5a4c06(0x183),_0x5a4c06(0x191))),undefined;if(!_0xf0592f[_0x5a4c06(0x19b)]())return _0x43b24a[_0x5a4c06(0x156)](issue(_0x5a4c06(0x14f),_0x5a4c06(0x195),SKILL_FILE,_0x5a4c06(0x172),_0x5a4c06(0x192))),undefined;return{'path':SKILL_FILE,'content':readFileSync(_0x3664d4,'utf8')};}function validateFrontmatter(_0x3e59e8,_0x18570b,_0x441a5d){const _0x1cc83a=a55_0x4f7faa;if(!_0x18570b[_0x1cc83a(0x17c)]){_0x441a5d[_0x1cc83a(0x156)](issue(_0x1cc83a(0x14f),_0x1cc83a(0x15c),_0x3e59e8,_0x1cc83a(0x18e),_0x1cc83a(0x19d)));return;}!_0x18570b[_0x1cc83a(0x190)]?.[_0x1cc83a(0x179)]()&&_0x441a5d[_0x1cc83a(0x156)](issue(_0x1cc83a(0x14f),_0x1cc83a(0x15c),_0x3e59e8,_0x1cc83a(0x16a),'Set\x20name\x20to\x20the\x20Skill\x20directory\x20code.')),!_0x18570b[_0x1cc83a(0x15a)]?.['trim']()&&_0x441a5d[_0x1cc83a(0x156)](issue(_0x1cc83a(0x150),_0x1cc83a(0x15d),_0x3e59e8,_0x1cc83a(0x164),_0x1cc83a(0x151))),!_0x18570b[_0x1cc83a(0x167)]?.[_0x1cc83a(0x179)]()&&_0x441a5d[_0x1cc83a(0x156)](issue(_0x1cc83a(0x14f),_0x1cc83a(0x18f),_0x3e59e8,'Frontmatter\x20description\x20is\x20empty.','填写模型触发语义:用户在什么场景应使用本\x20Skill、不要使用的边界和关键词。')),_0x18570b[_0x1cc83a(0x153)]===!![]&&_0x441a5d['push'](issue(_0x1cc83a(0x14f),_0x1cc83a(0x158),_0x3e59e8,_0x1cc83a(0x17a),'Remove\x20metadata.internal\x20or\x20set\x20it\x20to\x20false\x20before\x20running\x20skill\x20push.')),_0x18570b[_0x1cc83a(0x19f)]?.['trim']()&&!SUPPORTED_SKILL_TYPES['has'](_0x18570b[_0x1cc83a(0x19f)])&&_0x441a5d['push'](issue('error',_0x1cc83a(0x15c),_0x3e59e8,_0x1cc83a(0x199),_0x1cc83a(0x176)));}function validateRuntimeCliReferences(_0x8fe564,_0xb0796c){const _0x55a5d1=a55_0x4f7faa;for(const _0x45bb51 of findRabetbaseCliInvocations(_0x8fe564)){_0xb0796c[_0x55a5d1(0x156)](issue(_0x55a5d1(0x150),'rabetbase-cli-reference',_0x45bb51['file'],_0x55a5d1(0x18a),_0x55a5d1(0x15f),'L'+_0x45bb51[_0x55a5d1(0x16f)]));}}function findRabetbaseCliInvocations(_0xad46d3){const _0x1e7baf=a55_0x4f7faa;return scanSkillDirectory(_0xad46d3)[_0x1e7baf(0x17e)](_0x4ab0e1=>TEXT_SKILL_FILE_PATTERN[_0x1e7baf(0x184)](_0x4ab0e1['path']))[_0x1e7baf(0x17b)](_0x3bb644=>{const _0x2b93dd=_0x1e7baf,_0x3e18ad=fileText(_0x3bb644);return _0x3e18ad['split'](/\r?\n/)[_0x2b93dd(0x175)]((_0x96dbaa,_0x3e04c8)=>({'file':_0x3bb644['path'],'line':_0x3e04c8+0x1,'text':_0x96dbaa}))[_0x2b93dd(0x17e)](({text:_0x41789d})=>isRabetbaseCliInvocation(_0x41789d))[_0x2b93dd(0x175)](({file:_0x3a28fc,line:_0x13c2aa})=>({'file':_0x3a28fc,'line':_0x13c2aa}));});}const RABETBASE_SUBCOMMANDS=[a55_0x4f7faa(0x198),a55_0x4f7faa(0x189),'bff',a55_0x4f7faa(0x171),a55_0x4f7faa(0x17f),'app','schema',a55_0x4f7faa(0x17d),a55_0x4f7faa(0x19a),'kb','config',a55_0x4f7faa(0x197),a55_0x4f7faa(0x18d),'auth','logs',a55_0x4f7faa(0x196)],RABETBASE_INVOCATION=new RegExp(String[a55_0x4f7faa(0x16c)]`\brabetbase\s+(?:${RABETBASE_SUBCOMMANDS[a55_0x4f7faa(0x170)]('|')})\b`+String['raw']`(?:\s+[a-z][\w-]*){0,2}\s+(?:--?[a-z]|[\w.-]+=)`,'i');function isRabetbaseCliInvocation(_0x2c0131){const _0x34f959=a55_0x4f7faa,_0x2a7b7a=_0x2c0131[_0x34f959(0x177)](/\brabetbase\b/i);if(_0x2a7b7a<0x0)return![];const _0x2f6e41=_0x2c0131[_0x34f959(0x160)](_0x2a7b7a)['split'](/\blovrabet\b/i)[0x0]??'';return RABETBASE_INVOCATION[_0x34f959(0x184)](_0x2f6e41);}function parseFrontmatter(_0x1e000b){const _0x168d7e=a55_0x4f7faa,_0x27ef4b=_0x1e000b[_0x168d7e(0x157)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x27ef4b)return{'hasFrontmatter':![]};const _0x4bb570=_0x27ef4b[0x1]??'',_0x128737={'hasFrontmatter':!![]};let _0xc6de20;try{_0xc6de20=a55_0x1c98ec(_0x4bb570);}catch{return _0x128737;}const _0x123c80=asRecord(_0xc6de20);if(!_0x123c80)return _0x128737;_0x128737[_0x168d7e(0x190)]=scalarToString(_0x123c80[_0x168d7e(0x190)]),_0x128737[_0x168d7e(0x15a)]=scalarToString(_0x123c80[_0x168d7e(0x15a)]),_0x128737['description']=scalarToString(_0x123c80[_0x168d7e(0x167)]);const _0xe8358e=asRecord(_0x123c80['metadata']);return _0xe8358e&&(_0x128737['type']=scalarToString(_0xe8358e[_0x168d7e(0x19f)]),_0x128737[_0x168d7e(0x153)]=scalarToBoolean(_0xe8358e[_0x168d7e(0x153)])),_0x128737;}function asRecord(_0x1f9f29){const _0x6014e=a55_0x4f7faa;if(_0x1f9f29&&typeof _0x1f9f29===_0x6014e(0x152)&&!Array[_0x6014e(0x165)](_0x1f9f29))return _0x1f9f29;return undefined;}function scalarToString(_0x4bc417){const _0x1a6f9f=a55_0x4f7faa;if(typeof _0x4bc417==='string')return _0x4bc417[_0x1a6f9f(0x179)]();if(typeof _0x4bc417===_0x1a6f9f(0x16b)||typeof _0x4bc417===_0x1a6f9f(0x181))return String(_0x4bc417);return undefined;}function scalarToBoolean(_0x4aca47){const _0x466165=a55_0x4f7faa;if(typeof _0x4aca47===_0x466165(0x181))return _0x4aca47;if(typeof _0x4aca47===_0x466165(0x159))return cleanBoolean(_0x4aca47);return undefined;}function cleanBoolean(_0x3eb437){const _0x1479d5=a55_0x4f7faa,_0x5154ff=_0x3eb437[_0x1479d5(0x179)]()['toLowerCase']();if(_0x5154ff===_0x1479d5(0x161))return!![];if(_0x5154ff==='false')return![];return undefined;}function issue(_0x1cc198,_0x5ec9c9,_0x371152,_0x36e070,_0x47bb92,_0x5197b8){return{'level':_0x1cc198,'ruleId':_0x5ec9c9,'file':_0x371152,'section':_0x5197b8,'message':_0x36e070,'suggestion':_0x47bb92};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a56_0xf89e49=a56_0x59d5;(function(_0x5508fa,_0x4aa6a2){const _0x2c9659=a56_0x59d5,_0x3a3a30=_0x5508fa();while(!![]){try{const _0xa4a0e=parseInt(_0x2c9659(0x17c))/0x1+parseInt(_0x2c9659(0x187))/0x2*(-parseInt(_0x2c9659(0x183))/0x3)+-parseInt(_0x2c9659(0x184))/0x4*(parseInt(_0x2c9659(0x18e))/0x5)+-parseInt(_0x2c9659(0x18b))/0x6+-parseInt(_0x2c9659(0x17d))/0x7*(-parseInt(_0x2c9659(0x18d))/0x8)+parseInt(_0x2c9659(0x191))/0x9*(-parseInt(_0x2c9659(0x18f))/0xa)+parseInt(_0x2c9659(0x188))/0xb;if(_0xa4a0e===_0x4aa6a2)break;else _0x3a3a30['push'](_0x3a3a30['shift']());}catch(_0x4a5d36){_0x3a3a30['push'](_0x3a3a30['shift']());}}}(a56_0x80cd,0xa423e));function a56_0x80cd(){const _0x18fa64=['verbose','317052ZXejYf','461379CtKLvJ','91GPsVEs','sqlContent','sqlcode','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','description','dbId','21aHwoRk','2160ZrYToO','read','appCode','199336pqExKc','29421359VCeiRP','bool','sql','6940422hpmKuN','sqlCode','690616wxtynv','12445KkbzFU','110CtQtum'];a56_0x80cd=function(){return _0x18fa64;};return a56_0x80cd();}import{getSqlQueryInfo}from'../../core/api-client.js';function a56_0x59d5(_0x2ca362,_0x3ace2a){_0x2ca362=_0x2ca362-0x17c;const _0x80cda8=a56_0x80cd();let _0x59d540=_0x80cda8[_0x2ca362];return _0x59d540;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a56_0xf89e49(0x18a),'command':'detail','description':a56_0xf89e49(0x180),'risk':a56_0xf89e49(0x185),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x3f9785){const _0x55e2ae=a56_0xf89e49,_0x59c31a=await getSqlQueryInfo(_0x3f9785['appCode'],_0x3f9785['str'](_0x55e2ae(0x17f))),_0x2ecbbd=_0x3f9785[_0x55e2ae(0x189)](_0x55e2ae(0x190));if(_0x2ecbbd)return{'ok':!![],'data':_0x59c31a};const _0x4c6d2b=_0x59c31a[_0x55e2ae(0x182)]?await getDbName(_0x3f9785[_0x55e2ae(0x186)],_0x59c31a[_0x55e2ae(0x182)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x59c31a[_0x55e2ae(0x18c)],'sqlName':_0x59c31a['sqlName'],'db':_0x4c6d2b?_0x4c6d2b+'\x20('+_0x59c31a[_0x55e2ae(0x182)]+')':_0x59c31a[_0x55e2ae(0x182)]??'','description':_0x59c31a[_0x55e2ae(0x181)]??'','sqlContent':_0x59c31a[_0x55e2ae(0x17e)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a57_0x554332=a57_0x4038;(function(_0x6b0f4d,_0x126b97){const _0x23c8d9=a57_0x4038,_0x3c6439=_0x6b0f4d();while(!![]){try{const _0x183775=parseInt(_0x23c8d9(0xc6))/0x1+parseInt(_0x23c8d9(0xc5))/0x2*(parseInt(_0x23c8d9(0xcd))/0x3)+-parseInt(_0x23c8d9(0xd2))/0x4*(-parseInt(_0x23c8d9(0xd3))/0x5)+parseInt(_0x23c8d9(0xd0))/0x6+-parseInt(_0x23c8d9(0xd1))/0x7+parseInt(_0x23c8d9(0xd7))/0x8*(-parseInt(_0x23c8d9(0xc8))/0x9)+-parseInt(_0x23c8d9(0xd4))/0xa*(-parseInt(_0x23c8d9(0xcf))/0xb);if(_0x183775===_0x126b97)break;else _0x3c6439['push'](_0x3c6439['shift']());}catch(_0x55db39){_0x3c6439['push'](_0x3c6439['shift']());}}}(a57_0x575f,0xe9609));function a57_0x575f(){const _0x5916a8=['10503507rNeIbR','4fDJwyc','5552615WvvyWA','1564930MFpldp','sql','str','88lojjaG','execSuccess','SQL\x20execution\x20failed','execResult','now','1964PbeoXq','1048874HoyzNw','execError','910827QHEQDp','read','length','isArray','exec','1791BAsObg','sqlcode','44HgmRJE','1188144qiSiiB'];a57_0x575f=function(){return _0x5916a8;};return a57_0x575f();}import{executeSdkSql}from'../../core/sdk-client.js';import{SQLCODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a57_0x4038(_0x37afd5,_0x301879){_0x37afd5=_0x37afd5-0xc5;const _0x575f7f=a57_0x575f();let _0x403865=_0x575f7f[_0x37afd5];return _0x403865;}export const sqlExec={'service':a57_0x554332(0xd5),'command':a57_0x554332(0xcc),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a57_0x554332(0xc9),'flags':[SQLCODE_FLAG,PARAMS_FLAG],async 'execute'(_0x28eb2e){const _0x448965=a57_0x554332,_0x263f94=parseJsonParams(_0x28eb2e[_0x448965(0xd6)]('params')),_0x293f8b=Date[_0x448965(0xdb)](),_0x8f1885=await executeSdkSql(_0x28eb2e['str'](_0x448965(0xce)),_0x263f94),_0x59a3be=Date[_0x448965(0xdb)]()-_0x293f8b,_0x264b1a=_0x8f1885?.[_0x448965(0xda)]??_0x8f1885,_0x3a3785=_0x8f1885?.[_0x448965(0xd8)]??!![];if(!_0x3a3785)return{'ok':![],'data':{'error':_0x8f1885?.[_0x448965(0xc7)]||_0x448965(0xd9),'elapsed':_0x59a3be},'message':_0x448965(0xd9)};const _0x2df99c=Array[_0x448965(0xcb)](_0x264b1a)?_0x264b1a:[];return{'ok':!![],'data':{'rows':_0x2df99c,'rowCount':_0x2df99c[_0x448965(0xca)],'elapsed':_0x59a3be},'message':'Returned\x20'+_0x2df99c[_0x448965(0xca)]+'\x20row(s)\x20in\x20'+_0x59a3be+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5d2a26,_0x59ae8b){const _0x43964a=a58_0x19f5,_0x55de40=_0x5d2a26();while(!![]){try{const _0x1b1b03=parseInt(_0x43964a(0x149))/0x1*(-parseInt(_0x43964a(0x148))/0x2)+-parseInt(_0x43964a(0x14b))/0x3+parseInt(_0x43964a(0x151))/0x4+parseInt(_0x43964a(0x14f))/0x5+parseInt(_0x43964a(0x14a))/0x6*(-parseInt(_0x43964a(0x150))/0x7)+parseInt(_0x43964a(0x14d))/0x8+-parseInt(_0x43964a(0x14c))/0x9*(-parseInt(_0x43964a(0x14e))/0xa);if(_0x1b1b03===_0x59ae8b)break;else _0x55de40['push'](_0x55de40['shift']());}catch(_0x4ddb72){_0x55de40['push'](_0x55de40['shift']());}}}(a58_0x50da,0xbd1e2));function a58_0x19f5(_0x1dcaac,_0x3292e6){_0x1dcaac=_0x1dcaac-0x148;const _0x50da0b=a58_0x50da();let _0x19f543=_0x50da0b[_0x1dcaac];return _0x19f543;}import{sqlDetail}from'../../commands/sql/detail.js';import{sqlExec}from'../../commands/sql/exec.js';export const sqlDefinitions=[sqlDetail,sqlExec];function a58_0x50da(){const _0x540484=['3548635BFzPxR','7XEiFcR','3528012nolOMz','3232JcUGBQ','865yrWZcj','362058DncUSR','1371825rUAHYy','65565SJxTSS','6397352OCXLeq','410WwdBUQ'];a58_0x50da=function(){return _0x540484;};return a58_0x50da();}
|
package/lib/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a59_0x558648=a59_0x5cb2;(function(_0x4857c3,_0x492342){const _0x5eb26a=a59_0x5cb2,_0xeb7ba0=_0x4857c3();while(!![]){try{const _0xb181f5=parseInt(_0x5eb26a(0x1fd))/0x1+-parseInt(_0x5eb26a(0x1eb))/0x2+parseInt(_0x5eb26a(0x1ec))/0x3+-parseInt(_0x5eb26a(0x1f5))/0x4*(-parseInt(_0x5eb26a(0x1cb))/0x5)+-parseInt(_0x5eb26a(0x1f1))/0x6+parseInt(_0x5eb26a(0x1c5))/0x7+-parseInt(_0x5eb26a(0x1e1))/0x8;if(_0xb181f5===_0x492342)break;else _0xeb7ba0['push'](_0xeb7ba0['shift']());}catch(_0x2e14bb){_0xeb7ba0['push'](_0xeb7ba0['shift']());}}}(a59_0x4c9d,0x2676a));import{spawnSync}from'node:child_process';function a59_0x4c9d(){const _0x2efac4=['filter','fromEntries','1635025weHxeM','major','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(','Checking\x20npm\x20dist-tags...','timeout','stdout','50ooyNLz','unknown','Invalid\x20version:\x20','match','\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20','\x20\x20Run\x20manually:\x20lovrabet\x20cli-skill\x20install','install','warn','version','pipe','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','beta','str','status','run','validation','join','Update\x20failed:\x20','message','npm','update','json','1134344Rgcmqg','bool','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','entries','source','prerelease','string','boolean','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','\x20version\x20from\x20npm.','513200QVvmdr','446412KtzWsU','length','log','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','428166lqiFrE','stderr','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.','10004XiJwFs','Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','Already\x20on\x20requested\x20version\x20(v','error','flag','args','\x20->\x20','map','219911LumjqP','no-skills','skills','minor','\x20CLI\x20from\x20npm','toString','Version\x20comparison\x20failed.','cwd','inherit','/dist-tags','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','trim','latest'];a59_0x4c9d=function(){return _0x2efac4;};return a59_0x4c9d();}import{CliErrors}from'../errors.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{LOVRABET_NPM_PACKAGE_NAME,LOVRABET_SKILL_SOURCE,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{resolveNpmBin}from'../utils/platform.js';import{getCliVersion}from'../utils/version.js';import{LOVRABET_SKIP_NPX_SKILLS_ENV,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';const updateFlags=[{'name':a59_0x558648(0x1c2),'type':a59_0x558648(0x1e8),'description':'Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','default':![]},{'name':'beta','type':a59_0x558648(0x1e8),'description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':a59_0x558648(0x1d3),'type':a59_0x558648(0x1e7),'description':'Install\x20a\x20specific\x20CLI\x20version'},{'name':a59_0x558648(0x1fe),'type':a59_0x558648(0x1e8),'description':a59_0x558648(0x1d5),'default':![]},{'name':a59_0x558648(0x1ff),'type':'boolean','description':'Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','default':!![],'hidden':!![]}];function parseSemver(_0x27dca0){const _0x1861e1=a59_0x558648,_0x1cace0=_0x27dca0[_0x1861e1(0x1c1)]()[_0x1861e1(0x1ce)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x1cace0)return null;return{'major':Number(_0x1cace0[0x1]),'minor':Number(_0x1cace0[0x2]),'patch':Number(_0x1cace0[0x3]),'prerelease':_0x1cace0[0x4]};}function compareSemver(_0x112c2c,_0x591d10){const _0x3131bd=a59_0x558648,_0x53e74e=parseSemver(_0x112c2c),_0x326571=parseSemver(_0x591d10);if(!_0x53e74e||!_0x326571)throw CliErrors[_0x3131bd(0x1da)](_0x3131bd(0x1bc),_0x3131bd(0x1c0));for(const _0x59814a of[_0x3131bd(0x1c6),_0x3131bd(0x200),'patch']){if(_0x53e74e[_0x59814a]<_0x326571[_0x59814a])return-0x1;if(_0x53e74e[_0x59814a]>_0x326571[_0x59814a])return 0x1;}if(!_0x53e74e[_0x3131bd(0x1e6)]&&!_0x326571['prerelease'])return 0x0;if(!_0x53e74e[_0x3131bd(0x1e6)])return 0x1;if(!_0x326571[_0x3131bd(0x1e6)])return-0x1;if(_0x53e74e[_0x3131bd(0x1e6)]===_0x326571[_0x3131bd(0x1e6)])return 0x0;return _0x53e74e[_0x3131bd(0x1e6)]<_0x326571[_0x3131bd(0x1e6)]?-0x1:0x1;}function getRequestedVersion(_0x3cffbe){const _0x5310f8=a59_0x558648,_0x416c99=_0x3cffbe[_0x5310f8(0x1d7)](_0x5310f8(0x1d3))[_0x5310f8(0x1c1)]();if(_0x416c99)return _0x416c99;return String(_0x3cffbe[_0x5310f8(0x1fa)]?.[0x0]??'')['trim']();}function shouldSkipCliBuiltInSkill(_0x12f881){const _0x12cb85=a59_0x558648;return _0x12f881[_0x12cb85(0x1e2)](_0x12cb85(0x1fe))||_0x12f881[_0x12cb85(0x1f9)](_0x12cb85(0x1ff))===![];}function a59_0x5cb2(_0x435fef,_0x4e5ff2){_0x435fef=_0x435fef-0x1bb;const _0x4c9d59=a59_0x4c9d();let _0x5cb2a5=_0x4c9d59[_0x435fef];return _0x5cb2a5;}async function validateUpdateFlags(_0x3e5808){const _0x4355c3=a59_0x558648,_0x46be60=getRequestedVersion(_0x3e5808),_0x3f5bff=[_0x3e5808['bool'](_0x4355c3(0x1c2))?_0x4355c3(0x1c2):'',_0x3e5808['bool'](_0x4355c3(0x1d6))?'beta':'',_0x46be60?'version':'']['filter'](Boolean);if(_0x3f5bff[_0x4355c3(0x1ed)]>0x1)throw CliErrors[_0x4355c3(0x1da)]('--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.',_0x4355c3(0x1f4));if(_0x46be60&&!parseSemver(_0x46be60))throw CliErrors[_0x4355c3(0x1da)](_0x4355c3(0x1cd)+_0x46be60,_0x4355c3(0x1f6));}async function fetchNpmDistTags(){const _0x38829f=a59_0x558648;try{const _0x21d26d=NPM_REGISTRY_BASE_URL+'/-/package/'+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x38829f(0x1bf),_0xf459aa=await fetch(_0x21d26d,{'signal':AbortSignal[_0x38829f(0x1c9)](0x2710)});if(!_0xf459aa['ok'])return null;const _0x250089=await _0xf459aa[_0x38829f(0x1e0)]();if(!_0x250089||typeof _0x250089!=='object')return null;return Object[_0x38829f(0x1c4)](Object[_0x38829f(0x1e4)](_0x250089)[_0x38829f(0x1c3)](([,_0x1486fe])=>typeof _0x1486fe===_0x38829f(0x1e7)&&_0x1486fe[_0x38829f(0x1c1)]())[_0x38829f(0x1fc)](([_0x13633a,_0x5f1b29])=>[_0x13633a,String(_0x5f1b29)[_0x38829f(0x1c1)]()]));}catch{return null;}}async function resolveTargetVersion(_0x90a2df){const _0x2f74ad=a59_0x558648,_0x25201a=getRequestedVersion(_0x90a2df);if(_0x25201a)return{'version':_0x25201a,'source':'version'};const _0x58b8c1=_0x90a2df['bool'](_0x2f74ad(0x1d6))?_0x2f74ad(0x1d6):_0x2f74ad(0x1c2),_0x40cc28=await fetchNpmDistTags(),_0x261212=_0x40cc28?.[_0x58b8c1];if(!_0x261212)return null;return{'version':_0x261212,'source':_0x58b8c1};}function shouldInstallTarget(_0x196da1,_0x146565){const _0x323e06=a59_0x558648,_0x30565c=compareSemver(_0x196da1,_0x146565[_0x323e06(0x1d3)]);if(_0x146565[_0x323e06(0x1e5)]===_0x323e06(0x1d3))return _0x30565c!==0x0;return _0x30565c<0x0;}function installCliPackage(_0x30d2fb,_0xb4f4e1){const _0x484fd3=a59_0x558648,_0x16eaa7=resolveNpmBin(_0x484fd3(0x1de)),_0x2c7a09=[_0x484fd3(0x1d1),'-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x30d2fb];console[_0x484fd3(0x1ee)]('*\x20'+[_0x16eaa7,..._0x2c7a09][_0x484fd3(0x1db)]('\x20'));const _0x1f0df6=spawnSync(_0x16eaa7,_0x2c7a09,{'cwd':process[_0x484fd3(0x1bd)](),'stdio':_0xb4f4e1?'pipe':_0x484fd3(0x1be),'env':process.env,'shell':![]});if(_0x1f0df6[_0x484fd3(0x1d8)]===0x0)return{'ok':!![]};let _0x4a1bcc=_0x1f0df6[_0x484fd3(0x1f8)]?.[_0x484fd3(0x1dd)]||'exit\x20'+(_0x1f0df6[_0x484fd3(0x1d8)]??_0x484fd3(0x1cc));if(_0xb4f4e1){const _0x15bafa=_0x1f0df6[_0x484fd3(0x1f2)]?_0x1f0df6[_0x484fd3(0x1f2)][_0x484fd3(0x1bb)]()['trim']():'',_0x3cdc4a=_0x1f0df6[_0x484fd3(0x1ca)]?_0x1f0df6[_0x484fd3(0x1ca)][_0x484fd3(0x1bb)]()['trim']():'';if(_0x15bafa)_0x4a1bcc=_0x15bafa;else{if(_0x3cdc4a)_0x4a1bcc=_0x3cdc4a;}}return{'ok':![],'error':_0x4a1bcc};}async function installCliBuiltInSkill(_0x5b5646){const _0x441028=a59_0x558648;console[_0x441028(0x1ee)]('Checking\x20CLI\x20Built-in\x20Skill...');const _0x331564=runNpxSkillsAddGlobal(process[_0x441028(0x1bd)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x5b5646?_0x441028(0x1d4):_0x441028(0x1be)});if(_0x331564['skipped']){console[_0x441028(0x1ee)](_0x441028(0x1c7)+LOVRABET_SKIP_NPX_SKILLS_ENV+'=1).');return;}if(_0x331564['ok']){console[_0x441028(0x1ee)](_0x441028(0x1f0));return;}console[_0x441028(0x1d2)](_0x441028(0x1ef)+(_0x331564[_0x441028(0x1f8)]||_0x441028(0x1cc))),console['log'](_0x441028(0x1d0));}async function execute(_0x5e106e){const _0x8f7330=a59_0x558648;await validateUpdateFlags(_0x5e106e);const _0x20a38b=getCliVersion();console['log']('Current\x20version:\x20'+_0x20a38b),console['log'](_0x8f7330(0x1c8));const _0x506f35=await resolveTargetVersion(_0x5e106e);if(!_0x506f35){const _0x5e2db5=_0x5e106e[_0x8f7330(0x1e2)](_0x8f7330(0x1d6))?_0x8f7330(0x1d6):'latest',_0x5bf591='Unable\x20to\x20resolve\x20'+_0x5e2db5+_0x8f7330(0x1ea);return console['warn'](_0x5bf591),console[_0x8f7330(0x1ee)](_0x8f7330(0x1e9)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x5e2db5),{'ok':![]};}if(!shouldInstallTarget(_0x20a38b,_0x506f35)){const _0x11356f=_0x506f35[_0x8f7330(0x1e5)]===_0x8f7330(0x1d3)?_0x8f7330(0x1f7)+_0x506f35['version']+').':'Already\x20up\x20to\x20date\x20(v'+_0x506f35['version']+').';return console[_0x8f7330(0x1ee)](_0x11356f),shouldSkipCliBuiltInSkill(_0x5e106e)?console['log'](_0x8f7330(0x1e3)):await installCliBuiltInSkill(_0x5e106e['nonInteractive']),{'ok':!![]};}console[_0x8f7330(0x1ee)]('Updating\x20'+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x20a38b+_0x8f7330(0x1fb)+_0x506f35[_0x8f7330(0x1d3)]);const _0x499492=installCliPackage(_0x506f35[_0x8f7330(0x1d3)],_0x5e106e['nonInteractive']);if(!_0x499492['ok']){const _0xb06992=_0x8f7330(0x1dc)+(_0x499492[_0x8f7330(0x1f8)]||_0x8f7330(0x1cc));return console[_0x8f7330(0x1f8)](_0xb06992),console[_0x8f7330(0x1ee)](_0x8f7330(0x1cf)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x506f35[_0x8f7330(0x1d3)]),{'ok':![]};}return console[_0x8f7330(0x1ee)]('Updated\x20to\x20v'+_0x506f35['version']+'.'),console[_0x8f7330(0x1ee)](_0x8f7330(0x1f3)),shouldSkipCliBuiltInSkill(_0x5e106e)?console['log'](_0x8f7330(0x1e3)):await installCliBuiltInSkill(_0x5e106e['nonInteractive']),{'ok':!![]};}export const updateDefinition={'service':a59_0x558648(0x1df),'command':a59_0x558648(0x1d9),'description':'Update\x20'+CLI_BIN_NAME+a59_0x558648(0x201),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
function a59_0x5234(_0x2db630,_0x5c4e67){_0x2db630=_0x2db630-0x19a;const _0x3ff0a3=a59_0x3ff0();let _0x52344d=_0x3ff0a3[_0x2db630];return _0x52344d;}const a59_0x160ec9=a59_0x5234;(function(_0x3c4abc,_0xc0c2d7){const _0xf5f1d5=a59_0x5234,_0x22f58b=_0x3c4abc();while(!![]){try{const _0x3f4d8b=-parseInt(_0xf5f1d5(0x1dc))/0x1+-parseInt(_0xf5f1d5(0x1d6))/0x2+-parseInt(_0xf5f1d5(0x1d1))/0x3*(parseInt(_0xf5f1d5(0x1b0))/0x4)+-parseInt(_0xf5f1d5(0x1bf))/0x5*(-parseInt(_0xf5f1d5(0x1e7))/0x6)+parseInt(_0xf5f1d5(0x1a1))/0x7+parseInt(_0xf5f1d5(0x1e1))/0x8*(-parseInt(_0xf5f1d5(0x1ca))/0x9)+-parseInt(_0xf5f1d5(0x1a9))/0xa*(-parseInt(_0xf5f1d5(0x1a4))/0xb);if(_0x3f4d8b===_0xc0c2d7)break;else _0x22f58b['push'](_0x22f58b['shift']());}catch(_0x4471ca){_0x22f58b['push'](_0x22f58b['shift']());}}}(a59_0x3ff0,0x8ab34));import{spawnSync}from'node:child_process';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{LOVRABET_NPM_PACKAGE_NAME,LOVRABET_SKILL_SOURCE,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';function a59_0x3ff0(){const _0x512b6c=['16WeNsZU','prerelease','Checking\x20npm\x20dist-tags...','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','str','no-skills','1266tHEvJJ','log','match','Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','stdout','string','\x20version\x20from\x20npm.','bool','/-/package/','7776195cqWOWZ','write','Install\x20a\x20specific\x20CLI\x20version','23385901ALLWLx','\x20->\x20','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','minor','trim','10EAzAoc','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','cwd','Unable\x20to\x20resolve\x20','object','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','flag','4336Bizree','latest','Updated\x20to\x20v','source','npm','map','Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.','Already\x20up\x20to\x20date\x20(v','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(','boolean','inherit','filter','patch','\x20\x20Run\x20manually:\x20lovrabet\x20cli-skill\x20install','validation','12340aUDfTB','length','Current\x20version:\x20','Invalid\x20version:\x20','run','version','Update\x20','--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','Already\x20on\x20requested\x20version\x20(v','\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20','780345CagfIs','skills','Updating\x20','beta','status','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','unknown','2220HLcrIM','nonInteractive','warn','major','error','2270624jLrpvw','json','install','toString','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Update\x20failed:\x20','1078626KySfDt','\x20CLI\x20from\x20npm','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','pipe','stderr'];a59_0x3ff0=function(){return _0x512b6c;};return a59_0x3ff0();}import{resolveNpmBin}from'../utils/platform.js';import{getCliVersion}from'../utils/version.js';import{LOVRABET_SKIP_NPX_SKILLS_ENV,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';const updateFlags=[{'name':a59_0x160ec9(0x1b1),'type':a59_0x160ec9(0x1b9),'description':'Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','default':![]},{'name':'beta','type':a59_0x160ec9(0x1b9),'description':a59_0x160ec9(0x1da),'default':![]},{'name':'version','type':a59_0x160ec9(0x19d),'description':a59_0x160ec9(0x1a3)},{'name':a59_0x160ec9(0x1e6),'type':a59_0x160ec9(0x1b9),'description':a59_0x160ec9(0x1c7),'default':![]},{'name':a59_0x160ec9(0x1cb),'type':a59_0x160ec9(0x1b9),'description':'Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','default':!![],'hidden':!![]}];function parseSemver(_0x36b4fd){const _0x1ce4b3=a59_0x160ec9,_0x2ac361=_0x36b4fd['trim']()[_0x1ce4b3(0x19a)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x2ac361)return null;return{'major':Number(_0x2ac361[0x1]),'minor':Number(_0x2ac361[0x2]),'patch':Number(_0x2ac361[0x3]),'prerelease':_0x2ac361[0x4]};}function compareSemver(_0x143f84,_0x2da2cd){const _0x4dac6a=a59_0x160ec9,_0x42ab33=parseSemver(_0x143f84),_0x41f302=parseSemver(_0x2da2cd);if(!_0x42ab33||!_0x41f302)throw CliErrors['validation']('Version\x20comparison\x20failed.',_0x4dac6a(0x1aa));for(const _0x105faf of[_0x4dac6a(0x1d4),_0x4dac6a(0x1a7),_0x4dac6a(0x1bc)]){if(_0x42ab33[_0x105faf]<_0x41f302[_0x105faf])return-0x1;if(_0x42ab33[_0x105faf]>_0x41f302[_0x105faf])return 0x1;}if(!_0x42ab33[_0x4dac6a(0x1e2)]&&!_0x41f302[_0x4dac6a(0x1e2)])return 0x0;if(!_0x42ab33[_0x4dac6a(0x1e2)])return 0x1;if(!_0x41f302['prerelease'])return-0x1;if(_0x42ab33['prerelease']===_0x41f302['prerelease'])return 0x0;return _0x42ab33[_0x4dac6a(0x1e2)]<_0x41f302[_0x4dac6a(0x1e2)]?-0x1:0x1;}function getRequestedVersion(_0x506e5e){const _0x70f1f7=a59_0x160ec9,_0x18bdf5=_0x506e5e[_0x70f1f7(0x1e5)](_0x70f1f7(0x1c4))[_0x70f1f7(0x1a8)]();if(_0x18bdf5)return _0x18bdf5;return String(_0x506e5e['args']?.[0x0]??'')['trim']();}function shouldSkipCliBuiltInSkill(_0x369da6){const _0x4c2208=a59_0x160ec9;return _0x369da6[_0x4c2208(0x19f)]('no-skills')||_0x369da6[_0x4c2208(0x1af)](_0x4c2208(0x1cb))===![];}async function validateUpdateFlags(_0x4cb279){const _0x1b6059=a59_0x160ec9,_0x7861f7=getRequestedVersion(_0x4cb279),_0x246869=[_0x4cb279[_0x1b6059(0x19f)](_0x1b6059(0x1b1))?_0x1b6059(0x1b1):'',_0x4cb279[_0x1b6059(0x19f)]('beta')?_0x1b6059(0x1cd):'',_0x7861f7?_0x1b6059(0x1c4):''][_0x1b6059(0x1bb)](Boolean);if(_0x246869[_0x1b6059(0x1c0)]>0x1)throw CliErrors[_0x1b6059(0x1be)](_0x1b6059(0x1c6),_0x1b6059(0x1b6));if(_0x7861f7&&!parseSemver(_0x7861f7))throw CliErrors[_0x1b6059(0x1be)](_0x1b6059(0x1c2)+_0x7861f7,_0x1b6059(0x19b));}async function fetchNpmDistTags(){const _0x34e5fb=a59_0x160ec9;try{const _0x6dce2=NPM_REGISTRY_BASE_URL+_0x34e5fb(0x1a0)+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+'/dist-tags',_0x3325e5=await fetch(_0x6dce2,{'signal':AbortSignal['timeout'](0x2710)});if(!_0x3325e5['ok'])return null;const _0x2657b1=await _0x3325e5[_0x34e5fb(0x1d7)]();if(!_0x2657b1||typeof _0x2657b1!==_0x34e5fb(0x1ad))return null;return Object['fromEntries'](Object['entries'](_0x2657b1)[_0x34e5fb(0x1bb)](([,_0x2c2ce7])=>typeof _0x2c2ce7===_0x34e5fb(0x19d)&&_0x2c2ce7['trim']())[_0x34e5fb(0x1b5)](([_0x253a33,_0x162ede])=>[_0x253a33,String(_0x162ede)[_0x34e5fb(0x1a8)]()]));}catch{return null;}}async function resolveTargetVersion(_0x51e6ac){const _0x34908a=a59_0x160ec9,_0x557bef=getRequestedVersion(_0x51e6ac);if(_0x557bef)return{'version':_0x557bef,'source':'version'};const _0x32c5b2=_0x51e6ac[_0x34908a(0x19f)](_0x34908a(0x1cd))?_0x34908a(0x1cd):_0x34908a(0x1b1),_0x1bc266=await fetchNpmDistTags(),_0x5630e8=_0x1bc266?.[_0x32c5b2];if(!_0x5630e8)return null;return{'version':_0x5630e8,'source':_0x32c5b2};}function shouldInstallTarget(_0x39837a,_0x35e7d4){const _0x1e51e0=a59_0x160ec9,_0x1a56a5=compareSemver(_0x39837a,_0x35e7d4['version']);if(_0x35e7d4[_0x1e51e0(0x1b3)]===_0x1e51e0(0x1c4))return _0x1a56a5!==0x0;return _0x1a56a5<0x0;}function installCliPackage(_0x8a5ed6,_0x5dcea5){const _0x2d1feb=a59_0x160ec9,_0x43513c=resolveNpmBin(_0x2d1feb(0x1b4)),_0x249894=[_0x2d1feb(0x1d8),'-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x8a5ed6];console[_0x2d1feb(0x1e8)]('*\x20'+[_0x43513c,..._0x249894]['join']('\x20'));const _0x4a88da=spawnSync(_0x43513c,_0x249894,{'cwd':process[_0x2d1feb(0x1ab)](),'stdio':_0x5dcea5?_0x2d1feb(0x1df):'inherit','env':process.env,'shell':![]});if(_0x4a88da[_0x2d1feb(0x1ce)]===0x0)return{'ok':!![]};let _0x100b3a=_0x4a88da['error']?.['message']||'exit\x20'+(_0x4a88da[_0x2d1feb(0x1ce)]??'unknown');if(_0x5dcea5){const _0x31ff00=_0x4a88da['stderr']?_0x4a88da[_0x2d1feb(0x1e0)]['toString']()[_0x2d1feb(0x1a8)]():'',_0x3ae5c8=_0x4a88da[_0x2d1feb(0x19c)]?_0x4a88da[_0x2d1feb(0x19c)][_0x2d1feb(0x1d9)]()[_0x2d1feb(0x1a8)]():'';if(_0x31ff00)_0x100b3a=_0x31ff00;else{if(_0x3ae5c8)_0x100b3a=_0x3ae5c8;}}return{'ok':![],'error':_0x100b3a};}async function installCliBuiltInSkill(_0x4af3cc){const _0x272eb6=a59_0x160ec9;console[_0x272eb6(0x1e8)]('Checking\x20CLI\x20Built-in\x20Skill...');const _0x15d5ef=runNpxSkillsAddGlobal(process[_0x272eb6(0x1ab)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x4af3cc?_0x272eb6(0x1df):_0x272eb6(0x1ba)});if(_0x15d5ef['skipped']){console[_0x272eb6(0x1e8)](_0x272eb6(0x1b8)+LOVRABET_SKIP_NPX_SKILLS_ENV+'=1).');return;}if(_0x15d5ef['ok']){console[_0x272eb6(0x1e8)](_0x272eb6(0x1de));return;}console[_0x272eb6(0x1d3)](_0x272eb6(0x1a6)+(_0x15d5ef[_0x272eb6(0x1d5)]||_0x272eb6(0x1d0))),console[_0x272eb6(0x1e8)](_0x272eb6(0x1bd));}async function execute(_0x1a2b96){const _0x4d7aa7=a59_0x160ec9;await validateUpdateFlags(_0x1a2b96);const _0x1a5174=getCliVersion();console[_0x4d7aa7(0x1e8)](_0x4d7aa7(0x1c1)+_0x1a5174),console[_0x4d7aa7(0x1e8)](_0x4d7aa7(0x1e3));const _0x57ac03=await resolveTargetVersion(_0x1a2b96);if(!_0x57ac03){const _0xfc5044=_0x1a2b96[_0x4d7aa7(0x19f)]('beta')?_0x4d7aa7(0x1cd):'latest',_0x33ab6d=_0x4d7aa7(0x1ac)+_0xfc5044+_0x4d7aa7(0x19e);return console[_0x4d7aa7(0x1d3)](_0x33ab6d),console[_0x4d7aa7(0x1e8)](_0x4d7aa7(0x1e4)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0xfc5044),{'ok':![]};}if(!shouldInstallTarget(_0x1a5174,_0x57ac03)){const _0x3e5850=_0x57ac03[_0x4d7aa7(0x1b3)]===_0x4d7aa7(0x1c4)?_0x4d7aa7(0x1c8)+_0x57ac03[_0x4d7aa7(0x1c4)]+').':_0x4d7aa7(0x1b7)+_0x57ac03[_0x4d7aa7(0x1c4)]+').';return console['log'](_0x3e5850),shouldSkipCliBuiltInSkill(_0x1a2b96)?console['log']('Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).'):await installCliBuiltInSkill(_0x1a2b96[_0x4d7aa7(0x1d2)]),{'ok':!![]};}console[_0x4d7aa7(0x1e8)](_0x4d7aa7(0x1cc)+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x1a5174+_0x4d7aa7(0x1a5)+_0x57ac03['version']);const _0x50712a=installCliPackage(_0x57ac03['version'],_0x1a2b96[_0x4d7aa7(0x1d2)]);if(!_0x50712a['ok']){const _0x760715=_0x4d7aa7(0x1db)+(_0x50712a[_0x4d7aa7(0x1d5)]||_0x4d7aa7(0x1d0));return console[_0x4d7aa7(0x1d5)](_0x760715),console[_0x4d7aa7(0x1e8)](_0x4d7aa7(0x1c9)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x57ac03[_0x4d7aa7(0x1c4)]),{'ok':![]};}return console[_0x4d7aa7(0x1e8)](_0x4d7aa7(0x1b2)+_0x57ac03[_0x4d7aa7(0x1c4)]+'.'),console[_0x4d7aa7(0x1e8)](_0x4d7aa7(0x1ae)),shouldSkipCliBuiltInSkill(_0x1a2b96)?console[_0x4d7aa7(0x1e8)](_0x4d7aa7(0x1cf)):await installCliBuiltInSkill(_0x1a2b96[_0x4d7aa7(0x1d2)]),{'ok':!![]};}export const updateDefinition={'service':'update','command':a59_0x160ec9(0x1c3),'description':a59_0x160ec9(0x1c5)+CLI_BIN_NAME+a59_0x160ec9(0x1dd),'risk':a59_0x160ec9(0x1a2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0x541d9d=a60_0x236f;(function(_0x26dc57,_0x5d7e63){const _0x318ba4=a60_0x236f,_0x5049fe=_0x26dc57();while(!![]){try{const _0x35ce4d=parseInt(_0x318ba4(0x14f))/0x1+parseInt(_0x318ba4(0x13b))/0x2+-parseInt(_0x318ba4(0x144))/0x3*(-parseInt(_0x318ba4(0x14a))/0x4)+parseInt(_0x318ba4(0x132))/0x5*(-parseInt(_0x318ba4(0x13d))/0x6)+-parseInt(_0x318ba4(0x148))/0x7*(parseInt(_0x318ba4(0x149))/0x8)+parseInt(_0x318ba4(0x14b))/0x9+parseInt(_0x318ba4(0x138))/0xa*(-parseInt(_0x318ba4(0x14e))/0xb);if(_0x35ce4d===_0x5d7e63)break;else _0x5049fe['push'](_0x5049fe['shift']());}catch(_0x168bf5){_0x5049fe['push'](_0x5049fe['shift']());}}}(a60_0x3d65,0x79ac1));import{CLI_BIN_NAME}from'../../constant/cli.js';function a60_0x236f(_0x47191b,_0x5b4293){_0x47191b=_0x47191b-0x119;const _0x3d6594=a60_0x3d65();let _0x236f2e=_0x3d6594[_0x47191b];return _0x236f2e;}import{DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../../constant/env.js';import{CliErrors}from'../../errors.js';import{readConfigFile,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{findAppByName,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../../commands/app/eligibility.js';const WORKSPACE_USE_FLAGS=[{'name':a60_0x541d9d(0x136),'type':'string','description':a60_0x541d9d(0x12e)},{'name':a60_0x541d9d(0x128),'type':a60_0x541d9d(0x147),'description':a60_0x541d9d(0x13a)},{'name':'env','type':a60_0x541d9d(0x147),'description':a60_0x541d9d(0x126),'enum':[...RUNTIME_ENV_VALUES]},{'name':a60_0x541d9d(0x141),'type':a60_0x541d9d(0x12d),'description':'Compatibility\x20flag;\x20workspace\x20config\x20updates\x20are\x20non-interactive','default':![]}];async function executeWorkspaceUse(_0x3fb5d0,_0x595407){const _0x4d6c0a=a60_0x541d9d,_0x1dabb9=_0x3fb5d0[_0x4d6c0a(0x129)](_0x4d6c0a(0x136))[_0x4d6c0a(0x12f)](),_0x4f5687=_0x3fb5d0['str'](_0x4d6c0a(0x128))[_0x4d6c0a(0x12f)](),_0x21259d=_0x3fb5d0['str'](_0x4d6c0a(0x11c))[_0x4d6c0a(0x12f)](),_0x3a23d1=resolveWorkspaceEnv(_0x21259d||_0x3fb5d0['envName']||DEFAULT_CONFIG_VALUES['env']);if(!_0x1dabb9&&!_0x4f5687)throw CliErrors[_0x4d6c0a(0x137)](_0x4d6c0a(0x13f),'Usage:\x20'+CLI_BIN_NAME+_0x4d6c0a(0x131)+_0x595407+_0x4d6c0a(0x12b)+CLI_BIN_NAME+'\x20workspace\x20'+_0x595407+'\x20--appcode\x20<code>\x20[--env\x20daily]');const _0x1061e3=_0x4f5687||await resolveRemoteAppCode({'command':_0x595407,'appName':_0x1dabb9,'env':_0x3a23d1,'accessKey':_0x3fb5d0[_0x4d6c0a(0x121)]}),_0x4cff59=writeWorkspaceConfig({'command':_0x595407,'appName':_0x1dabb9,'appcode':_0x1061e3,'env':_0x3a23d1,'shouldWriteEnv':!!_0x21259d,'accessKey':_0x3fb5d0[_0x4d6c0a(0x121)]});return{'ok':!![],'data':{'configPath':_0x4cff59,'app':_0x1dabb9||null,'appcode':_0x1061e3,'env':_0x21259d?_0x3a23d1:null,'accessKeyWritten':![],'command':'workspace\x20'+_0x595407},'message':buildWorkspaceMessage(_0x4cff59,_0x1dabb9,_0x1061e3,_0x21259d?_0x3a23d1:undefined)};}async function resolveRemoteAppCode(_0x1d754e){const _0xcd2927=a60_0x541d9d;if(!_0x1d754e[_0xcd2927(0x121)])throw CliErrors[_0xcd2927(0x11a)](_0xcd2927(0x13e)+CLI_BIN_NAME+_0xcd2927(0x131)+_0x1d754e[_0xcd2927(0x133)]+'.');const {setActiveAK:_0x516cbf}=await import('../../core/api-client.js'),{getRemoteAppList:_0x34d3b2}=await import(_0xcd2927(0x125));_0x516cbf(_0x1d754e[_0xcd2927(0x121)]);const _0x205365=await _0x34d3b2({'env':_0x1d754e[_0xcd2927(0x11c)],'accessKey':_0x1d754e[_0xcd2927(0x121)],'noCache':![]}),_0x51e913=findAppByName(_0x205365['items'],_0x1d754e['appName']);if(_0x51e913&&!isRuntimeAccessibleApp(_0x51e913))throw runtimeInaccessibleAppError(_0x51e913,'\x22'+_0x1d754e[_0xcd2927(0x123)]+'\x22');const _0x2d883b=_0x51e913?.[_0xcd2927(0x11d)]?.[_0xcd2927(0x12f)]();if(_0x2d883b)return _0x2d883b;const _0x57340c=_0x205365[_0xcd2927(0x143)]['map'](_0x145a63=>_0x145a63['appName'])[_0xcd2927(0x150)](Boolean),_0x2c7c2b=_0x57340c[_0xcd2927(0x124)]?_0xcd2927(0x127)+Array['from'](new Set(_0x57340c))[_0xcd2927(0x135)](',\x20')+'.':_0xcd2927(0x120)+CLI_BIN_NAME+'\x20app\x20list\x20--no-cache`\x20to\x20refresh\x20available\x20apps,\x20or\x20pass\x20--appcode\x20directly.';throw CliErrors[_0xcd2927(0x137)](_0xcd2927(0x11f)+_0x1d754e[_0xcd2927(0x123)]+_0xcd2927(0x14d),_0x2c7c2b);}function writeWorkspaceConfig(_0x3e9694){const _0x18f170=a60_0x541d9d,_0xe1d7c3=resolveWriteConfigPath(_0x18f170(0x146)),_0x482d70=readConfigFile(_0xe1d7c3);_0x3e9694[_0x18f170(0x12a)]&&(_0x482d70[_0x18f170(0x11c)]=_0x3e9694[_0x18f170(0x11c)]);if(_0x3e9694[_0x18f170(0x123)]){const _0x2044b6=isRecord(_0x482d70[_0x18f170(0x130)])?{..._0x482d70[_0x18f170(0x130)]}:{},_0x382ce0=isRecord(_0x2044b6[_0x3e9694['appName']])?_0x2044b6[_0x3e9694[_0x18f170(0x123)]]:{};_0x2044b6[_0x3e9694[_0x18f170(0x123)]]={..._0x382ce0,'appcode':_0x3e9694['appcode']},_0x482d70[_0x18f170(0x130)]=_0x2044b6,_0x482d70['defaultApp']=_0x3e9694[_0x18f170(0x123)];if(_0x482d70[_0x18f170(0x136)])delete _0x482d70['app'];return writeAndReturn(_0xe1d7c3,_0x482d70);}_0x482d70[_0x18f170(0x128)]=_0x3e9694[_0x18f170(0x128)];if(_0x482d70[_0x18f170(0x136)])delete _0x482d70[_0x18f170(0x136)];return writeAndReturn(_0xe1d7c3,_0x482d70);}function a60_0x3d65(){const _0x16a487=['length','../../commands/app/remote-source.js','Target\x20environment','Available\x20apps:\x20','appcode','str','shouldWriteEnv','\x20--app\x20<name>\x20[--env\x20daily]\x20or\x20','write','boolean','App\x20name\x20to\x20bind\x20as\x20the\x20current\x20workspace\x20default','trim','apps','\x20workspace\x20','355DLUUUh','command','Invalid\x20env\x20\x22','join','app','validation','350420GkrulM','\x0aEnv:\x20','App\x20code\x20to\x20bind\x20directly','1376736ggCTPF','workspace','18030jJsLUT','Resolving\x20--app\x20requires\x20accessKey.\x20Pass\x20--appcode\x20directly,\x20or\x20set\x20accessKey\x20before\x20running\x20','Missing\x20workspace\x20app\x20selector.','Initialize\x20app\x20context\x20for\x20the\x20current\x20workspace','yes','init','items','15oyYkVJ','use','project','string','21moMRwW','62808ChnjgN','189832uhBLwo','4884516CxvpTH','Workspace\x20configured.\x0aConfig\x20file:\x20','\x22\x20not\x20found.','539xXSucS','983953yNSaJy','filter','isArray','authRequired','object','env','appCode','includes','App\x20\x22','Run\x20`','accessKey','\x0aDefault\x20app:\x20','appName'];a60_0x3d65=function(){return _0x16a487;};return a60_0x3d65();}function writeAndReturn(_0x416a69,_0x2e5c75){return writeConfigFile(_0x416a69,_0x2e5c75),_0x416a69;}function resolveWorkspaceEnv(_0x9e0bcc){const _0x24382b=a60_0x541d9d;if(RUNTIME_ENV_VALUES[_0x24382b(0x11e)](_0x9e0bcc))return _0x9e0bcc;throw CliErrors['validation'](_0x24382b(0x134)+_0x9e0bcc+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES[_0x24382b(0x135)](',\x20'));}function buildWorkspaceMessage(_0x20cbf0,_0x332bf2,_0x1e4c25,_0x2e091e){const _0xc03665=a60_0x541d9d,_0x400622=_0x332bf2?_0x332bf2+'\x20('+_0x1e4c25+')':_0x1e4c25,_0x2b95b2=_0x2e091e?_0xc03665(0x139)+_0x2e091e:'';return _0xc03665(0x14c)+_0x20cbf0+_0xc03665(0x122)+_0x400622+_0x2b95b2+'\x0aAccessKey:\x20not\x20written';}function isRecord(_0xe36b96){const _0xe4148a=a60_0x541d9d;return typeof _0xe36b96===_0xe4148a(0x11b)&&_0xe36b96!==null&&!Array[_0xe4148a(0x119)](_0xe36b96);}function makeWorkspaceCommand(_0x369e7f){const _0x30f8e8=a60_0x541d9d;return{'service':_0x30f8e8(0x13c),'command':_0x369e7f,'description':_0x369e7f===_0x30f8e8(0x142)?_0x30f8e8(0x140):'Set\x20app\x20context\x20for\x20the\x20current\x20workspace','risk':_0x30f8e8(0x12c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':WORKSPACE_USE_FLAGS,async 'execute'(_0x4a02d5){return executeWorkspaceUse(_0x4a02d5,_0x369e7f);}};}export const workspaceDefinitions=[makeWorkspaceCommand(a60_0x541d9d(0x142)),makeWorkspaceCommand(a60_0x541d9d(0x145))];
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a61_0x3d487b=a61_0x47d9;(function(_0x4462fd,_0x4270a0){const _0x50af9f=a61_0x47d9,_0x528cc6=_0x4462fd();while(!![]){try{const _0x33e5e2=-parseInt(_0x50af9f(0x176))/0x1+parseInt(_0x50af9f(0x191))/0x2+-parseInt(_0x50af9f(0x18d))/0x3*(-parseInt(_0x50af9f(0x180))/0x4)+-parseInt(_0x50af9f(0x186))/0x5+-parseInt(_0x50af9f(0x178))/0x6+parseInt(_0x50af9f(0x17e))/0x7+parseInt(_0x50af9f(0x175))/0x8;if(_0x33e5e2===_0x4270a0)break;else _0x528cc6['push'](_0x528cc6['shift']());}catch(_0x1bd7eb){_0x528cc6['push'](_0x528cc6['shift']());}}}(a61_0xf95c,0x3fdbd));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{OUTPUT_FORMAT_VALUES}from'../constant/output.js';export const CONFIG_FIELD_SCHEMAS={'env':{'description':'Target\x20environment','topLevel':!![],'cliSettableTopLevel':!![],'enumValues':RUNTIME_ENV_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a61_0x3d487b(0x190)],'importable':!![]},'format':{'description':a61_0x3d487b(0x17d),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':OUTPUT_FORMAT_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a61_0x3d487b(0x187)],'importable':!![]},'pageSize':{'description':a61_0x3d487b(0x179),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'apiDomain':{'description':a61_0x3d487b(0x182),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'userDomain':{'description':a61_0x3d487b(0x18f),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'runtimeDomain':{'description':a61_0x3d487b(0x188),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'skillHubDomain':{'description':a61_0x3d487b(0x185),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'accessKey':{'description':a61_0x3d487b(0x17f),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'riskLevel':{'description':a61_0x3d487b(0x184),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a61_0x3d487b(0x177)],'importable':!![]},'locale':{'description':a61_0x3d487b(0x18e),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a61_0x3d487b(0x183)],'importable':!![],'legacyCompatOnly':!![]}};export const TOP_LEVEL_CONFIG_KEYS=new Set(Object[a61_0x3d487b(0x17a)](CONFIG_FIELD_SCHEMAS)[a61_0x3d487b(0x18a)](([,_0x13803a])=>_0x13803a['cliSettableTopLevel'])[a61_0x3d487b(0x18b)](([_0x4da7e6])=>_0x4da7e6));export const CONFIG_ENUM_VALUES=Object['fromEntries'](Object[a61_0x3d487b(0x17a)](CONFIG_FIELD_SCHEMAS)[a61_0x3d487b(0x18a)](([,_0x122777])=>_0x122777[a61_0x3d487b(0x181)])[a61_0x3d487b(0x18b)](([_0x5e12a2,_0x445641])=>[_0x5e12a2,[..._0x445641[a61_0x3d487b(0x181)]||[]]]));export const IMPORTABLE_RUNTIME_CONFIG_KEYS=Object['entries'](CONFIG_FIELD_SCHEMAS)[a61_0x3d487b(0x18a)](([,_0x27e517])=>_0x27e517[a61_0x3d487b(0x189)])['map'](([_0x22b6c1])=>_0x22b6c1);export function getConfigFieldSchema(_0x1a615e){return CONFIG_FIELD_SCHEMAS[_0x1a615e];}export function getConfigEnumValues(_0x145c4e){const _0x1271bb=a61_0x3d487b;return getConfigFieldSchema(_0x145c4e)?.[_0x1271bb(0x181)];}function a61_0xf95c(){const _0xc806b1=['Default\x20output\x20format','1719172LFWXBQ','Access\x20key\x20(client-ak\x20auth)','1637380zAPPnM','enumValues','Override\x20API\x20domain','locale','Risk\x20level','Override\x20SkillHub\x20domain','1719425lWAmRw','format','Override\x20runtime\x20domain','importable','filter','map','legacyCompatOnly','3Wyovpy','Locale','Override\x20user\x20domain','env','366390XNBnAo','Config\x20key.\x20Top-level:\x20','2522432kMfnRR','187645vkgmSS','riskLevel','2162070fYTOlq','Default\x20page\x20size','entries','has',';\x20local\x20alias:\x20apps.<alias>.appcode'];a61_0xf95c=function(){return _0xc806b1;};return a61_0xf95c();}export function getConfigDefaultValue(_0x453b50){return getConfigFieldSchema(_0x453b50)?.['defaultValue'];}export function isTopLevelConfigKey(_0x243f18){const _0x2a3cbc=a61_0x3d487b;return TOP_LEVEL_CONFIG_KEYS[_0x2a3cbc(0x17b)](_0x243f18);}export function isLegacyCompatConfigKey(_0x4cafec){const _0x180a99=a61_0x3d487b;return getConfigFieldSchema(_0x4cafec)?.[_0x180a99(0x18c)]===!![];}function a61_0x47d9(_0x4a3fc5,_0x2ec2c3){_0x4a3fc5=_0x4a3fc5-0x174;const _0xf95c91=a61_0xf95c();let _0x47d9d4=_0xf95c91[_0x4a3fc5];return _0x47d9d4;}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function formatConfigKeyList(_0x56d9ec){return[..._0x56d9ec]['join'](',\x20');}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x580637=a61_0x3d487b;return _0x580637(0x174)+getTopLevelConfigKeySummary()+_0x580637(0x17c);}export function buildAppProfileListFields(_0x155754){return{'env':_0x155754,'hasAccessKey':![],'format':null,'pageSize':null,'riskLevel':null,'locale':null};}
|
package/lib/constant/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a62_0x1998(_0x1556af,_0x3f8c34){_0x1556af=_0x1556af-0x6c;const _0x5a683b=a62_0x5a68();let _0x1998bd=_0x5a683b[_0x1556af];return _0x1998bd;}const a62_0x21986c=a62_0x1998;function a62_0x5a68(){const _0x2a16d7=['1140FkESRK','152OWSnDl','120810yNRNHX','45221dVGcjV','65925SPczUV','334594xhsBLS','UNPUBLISH','663adziLk','6648222FslXjb','216kxXQQX','42rmhtQL','2290xkdSyH','12884FKHWJe','13428irolHD'];a62_0x5a68=function(){return _0x2a16d7;};return a62_0x5a68();}(function(_0xaecd8a,_0x56a427){const _0xdeb23e=a62_0x1998,_0x2af5d9=_0xaecd8a();while(!![]){try{const _0x581782=-parseInt(_0xdeb23e(0x6c))/0x1*(parseInt(_0xdeb23e(0x6e))/0x2)+parseInt(_0xdeb23e(0x77))/0x3*(-parseInt(_0xdeb23e(0x6f))/0x4)+parseInt(_0xdeb23e(0x72))/0x5*(parseInt(_0xdeb23e(0x79))/0x6)+-parseInt(_0xdeb23e(0x78))/0x7+parseInt(_0xdeb23e(0x71))/0x8*(parseInt(_0xdeb23e(0x74))/0x9)+parseInt(_0xdeb23e(0x6d))/0xa*(-parseInt(_0xdeb23e(0x73))/0xb)+-parseInt(_0xdeb23e(0x70))/0xc*(-parseInt(_0xdeb23e(0x75))/0xd);if(_0x581782===_0x56a427)break;else _0x2af5d9['push'](_0x2af5d9['shift']());}catch(_0x527c5c){_0x2af5d9['push'](_0x2af5d9['shift']());}}}(a62_0x5a68,0x8665b));export const APP_PUBLISH_STATUS={'Published':'PUBLISHED','Unpublished':a62_0x21986c(0x76)};export const RUNTIME_ACCESSIBLE_APP_STATUS=APP_PUBLISH_STATUS['Published'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a63_0x1ffe5f=a63_0x5250;(function(_0x41f8df,_0x4e9f2b){const _0x45432e=a63_0x5250,_0x51eb04=_0x41f8df();while(!![]){try{const _0x271b8e=-parseInt(_0x45432e(0x86))/0x1*(-parseInt(_0x45432e(0x89))/0x2)+parseInt(_0x45432e(0x7e))/0x3+parseInt(_0x45432e(0x80))/0x4*(-parseInt(_0x45432e(0x87))/0x5)+parseInt(_0x45432e(0x8a))/0x6*(-parseInt(_0x45432e(0x82))/0x7)+-parseInt(_0x45432e(0x88))/0x8+parseInt(_0x45432e(0x8b))/0x9*(-parseInt(_0x45432e(0x83))/0xa)+-parseInt(_0x45432e(0x81))/0xb*(-parseInt(_0x45432e(0x7f))/0xc);if(_0x271b8e===_0x4e9f2b)break;else _0x51eb04['push'](_0x51eb04['shift']());}catch(_0x2caa45){_0x51eb04['push'](_0x51eb04['shift']());}}}(a63_0x28a0,0x5b072));function a63_0x5250(_0x6bee48,_0x273b31){_0x6bee48=_0x6bee48-0x7e;const _0x28a015=a63_0x28a0();let _0x52505b=_0x28a015[_0x6bee48];return _0x52505b;}function a63_0x28a0(){const _0x34397b=['1679988IEgzWO','877509orhVAN','207129ySwiNr','274872MWOrxS','4EqGkQa','649OKHMwi','7JIsGvr','40bimeDo','ClientAk','client-ak','499bYHWYD','1110255qMbWRU','2230776BbrWRx','494bTYaAF'];a63_0x28a0=function(){return _0x34397b;};return a63_0x28a0();}export const AUTH_MODE={'ClientAk':a63_0x1ffe5f(0x85)};export function isAuthMode(_0x1f6a3f){const _0x32a942=a63_0x1ffe5f;return _0x1f6a3f===AUTH_MODE[_0x32a942(0x84)];}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x2867c6=a64_0x5602;function a64_0xefad(){const _0x29e5af=['verbose','340824GoOMBy','boolean','format','3535992NoUAKi','dry-run','Skip\x20confirmation\x20for\x20high-risk\x20writes','app','json\x20|\x20pretty\x20|\x20compress','Verbose\x20output','clear','1245490ZBegUb','SQL\x20query\x20code','appcode','<expr>','cliDisplayName','<name>','386678SAqxOD','params','1bqHrFW','Force\x20non-interactive\x20mode\x20(CI)','yes','type','28ptqzPX','Show\x20help','non-interactive','fromEntries','meowKey','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20implies\x20--format\x20json\x20when\x20current\x20format\x20is\x20pretty)','production\x20|\x20development\x20|\x20daily','global','Preview\x20operation\x20without\x20executing','Override\x20appcode','sqlcode','string','Select\x20app\x20profile\x20by\x20name','12bBzKmV','Output\x20format','map','env','JSON\x20params\x20for\x20execute\x20commands','Name\x20filter','4203160RRKpWF','name','Use\x20global\x20config\x20scope','Record\x20ID','429892pGfUQb','Clear\x20output','15017640fCGSNT'];a64_0xefad=function(){return _0x29e5af;};return a64_0xefad();}(function(_0x11ed76,_0x1f9bfc){const _0x45db26=a64_0x5602,_0x57290f=_0x11ed76();while(!![]){try{const _0xb8ae01=parseInt(_0x45db26(0x11c))/0x1*(parseInt(_0x45db26(0x11a))/0x2)+-parseInt(_0x45db26(0x12d))/0x3*(parseInt(_0x45db26(0x137))/0x4)+-parseInt(_0x45db26(0x114))/0x5+parseInt(_0x45db26(0x13b))/0x6*(parseInt(_0x45db26(0x120))/0x7)+-parseInt(_0x45db26(0x133))/0x8+-parseInt(_0x45db26(0x10d))/0x9+parseInt(_0x45db26(0x139))/0xa;if(_0xb8ae01===_0x1f9bfc)break;else _0x57290f['push'](_0x57290f['shift']());}catch(_0x5c4ca3){_0x57290f['push'](_0x57290f['shift']());}}}(a64_0xefad,0x4f5b6));import{PRODUCT_CONFIG}from'../constant/product.js';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';export const CLI_BIN_NAME=PRODUCT_CONFIG['cliBinName'];export const CLI_DISPLAY_NAME=PRODUCT_CONFIG[a64_0x2867c6(0x118)];export const NPM_PACKAGE_NAME=LOVRABET_NPM_PACKAGE_NAME;export const GLOBAL_FLAGS=[{'name':a64_0x2867c6(0x116),'meowKey':a64_0x2867c6(0x116),'type':a64_0x2867c6(0x12b),'description':a64_0x2867c6(0x129),'hint':'<code>'},{'name':a64_0x2867c6(0x110),'meowKey':a64_0x2867c6(0x110),'type':a64_0x2867c6(0x12b),'description':a64_0x2867c6(0x12c),'hint':a64_0x2867c6(0x119)},{'name':a64_0x2867c6(0x130),'meowKey':'env','type':a64_0x2867c6(0x12b),'description':'Environment','hint':a64_0x2867c6(0x126)},{'name':'format','meowKey':'format','type':'string','description':a64_0x2867c6(0x12e),'hint':a64_0x2867c6(0x111)},{'name':'jq','meowKey':'jq','type':a64_0x2867c6(0x12b),'description':a64_0x2867c6(0x125),'hint':a64_0x2867c6(0x117)},{'name':a64_0x2867c6(0x10e),'meowKey':'dryRun','type':'boolean','description':a64_0x2867c6(0x128)},{'name':a64_0x2867c6(0x11e),'meowKey':'yes','type':a64_0x2867c6(0x10b),'description':a64_0x2867c6(0x10f)},{'name':a64_0x2867c6(0x122),'meowKey':'nonInteractive','type':'boolean','description':a64_0x2867c6(0x11d)},{'name':a64_0x2867c6(0x127),'meowKey':a64_0x2867c6(0x127),'type':a64_0x2867c6(0x10b),'description':a64_0x2867c6(0x135)},{'name':'ci','meowKey':'ci','type':a64_0x2867c6(0x10b),'description':'Alias\x20for\x20--non-interactive','hidden':!![]},{'name':'help','meowKey':'help','type':a64_0x2867c6(0x10b),'description':a64_0x2867c6(0x121)},{'name':'id','meowKey':'id','type':a64_0x2867c6(0x12b),'description':a64_0x2867c6(0x136),'hidden':!![]},{'name':a64_0x2867c6(0x134),'meowKey':a64_0x2867c6(0x134),'type':a64_0x2867c6(0x12b),'description':a64_0x2867c6(0x132),'hidden':!![]},{'name':a64_0x2867c6(0x12a),'meowKey':a64_0x2867c6(0x12a),'type':a64_0x2867c6(0x12b),'description':a64_0x2867c6(0x115),'hidden':!![]},{'name':'params','meowKey':a64_0x2867c6(0x11b),'type':a64_0x2867c6(0x12b),'description':a64_0x2867c6(0x131),'hidden':!![]},{'name':'verbose','meowKey':a64_0x2867c6(0x13a),'type':a64_0x2867c6(0x10b),'description':a64_0x2867c6(0x112),'hidden':!![]},{'name':a64_0x2867c6(0x113),'meowKey':a64_0x2867c6(0x113),'type':'boolean','description':a64_0x2867c6(0x138),'hidden':!![]}];function a64_0x5602(_0x461155,_0x33f592){_0x461155=_0x461155-0x10b;const _0xefadce=a64_0xefad();let _0x5602ff=_0xefadce[_0x461155];return _0x5602ff;}export const PIPELINE_FLAG_NAMES=new Set([a64_0x2867c6(0x116),a64_0x2867c6(0x110),a64_0x2867c6(0x130),a64_0x2867c6(0x10c),'jq','dry-run',a64_0x2867c6(0x11e),'non-interactive','ci']);export function buildMeowFlags(){const _0x319c50=a64_0x2867c6;return Object[_0x319c50(0x123)](GLOBAL_FLAGS[_0x319c50(0x12f)](_0x42b7de=>[_0x42b7de[_0x319c50(0x124)],{'type':_0x42b7de[_0x319c50(0x11f)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a65_0x1f98(){const _0x44fd96=['production','2CGBYHI','write','1135460ifDwCs','54109sblLkI','838584EHfCfB','8RZFCrT','main','3693968NAfGUp','3LJVrek','4870EnJsPN','compress','8239338NdTOfF','11555397gkfeXY','11078977jYAhir'];a65_0x1f98=function(){return _0x44fd96;};return a65_0x1f98();}const a65_0x22e05f=a65_0x19ec;(function(_0x569582,_0x39eaea){const _0x66cebd=a65_0x19ec,_0x32f759=_0x569582();while(!![]){try{const _0x3c0254=-parseInt(_0x66cebd(0x138))/0x1*(-parseInt(_0x66cebd(0x134))/0x2)+parseInt(_0x66cebd(0x13c))/0x3*(parseInt(_0x66cebd(0x13b))/0x4)+-parseInt(_0x66cebd(0x136))/0x5+parseInt(_0x66cebd(0x13f))/0x6+parseInt(_0x66cebd(0x141))/0x7+parseInt(_0x66cebd(0x139))/0x8*(-parseInt(_0x66cebd(0x140))/0x9)+parseInt(_0x66cebd(0x13d))/0xa*(-parseInt(_0x66cebd(0x137))/0xb);if(_0x3c0254===_0x39eaea)break;else _0x32f759['push'](_0x32f759['shift']());}catch(_0x3a3af9){_0x32f759['push'](_0x32f759['shift']());}}}(a65_0x1f98,0xc61a8));export const DEFAULT_APP_PROFILE_NAME=a65_0x22e05f(0x13a);export const DEFAULT_CONFIG_VALUES={'env':a65_0x22e05f(0x142),'format':'compress','locale':'en-US','riskLevel':a65_0x22e05f(0x135)};function a65_0x19ec(_0x4e80e6,_0x4e74d2){_0x4e80e6=_0x4e80e6-0x134;const _0x1f98b5=a65_0x1f98();let _0x19ecd9=_0x1f98b5[_0x4e80e6];return _0x19ecd9;}export const DEFAULT_COMMAND_OUTPUT_FORMAT=a65_0x22e05f(0x13e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x14c108=a66_0x1a9b;function a66_0x4d27(){const _0x39c230=['5098962iitAAc','80412ClbqNV','13138600FipJDZ','skillSource','6396415Lutnje','52xMHjlt','42yfcSVh','7vTOWmk','npmPackageName','6311350aasQQK','42297717qskBRi','9ZgkyWX','52609HJZOOO'];a66_0x4d27=function(){return _0x39c230;};return a66_0x4d27();}function a66_0x1a9b(_0x37d1ba,_0x37e584){_0x37d1ba=_0x37d1ba-0x168;const _0x4d2707=a66_0x4d27();let _0x1a9bfc=_0x4d2707[_0x37d1ba];return _0x1a9bfc;}(function(_0x1ac04c,_0x23120b){const _0x226f47=a66_0x1a9b,_0x787a49=_0x1ac04c();while(!![]){try{const _0xb76ee0=parseInt(_0x226f47(0x16e))/0x1*(-parseInt(_0x226f47(0x168))/0x2)+parseInt(_0x226f47(0x170))/0x3*(-parseInt(_0x226f47(0x174))/0x4)+-parseInt(_0x226f47(0x173))/0x5+parseInt(_0x226f47(0x16f))/0x6*(parseInt(_0x226f47(0x169))/0x7)+-parseInt(_0x226f47(0x171))/0x8+-parseInt(_0x226f47(0x16d))/0x9*(-parseInt(_0x226f47(0x16b))/0xa)+parseInt(_0x226f47(0x16c))/0xb;if(_0xb76ee0===_0x23120b)break;else _0x787a49['push'](_0x787a49['shift']());}catch(_0x3c0439){_0x787a49['push'](_0x787a49['shift']());}}}(a66_0x4d27,0xe8440));import{PRODUCT_CONFIG}from'../constant/product.js';export const LOVRABET_NPM_PACKAGE_NAME=PRODUCT_CONFIG[a66_0x14c108(0x16a)];export const LOVRABET_SKILL_SOURCE=PRODUCT_CONFIG[a66_0x14c108(0x172)];export const NPM_REGISTRY_BASE_URL=PRODUCT_CONFIG['npmRegistryBaseUrl'];
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a67_0x337b(_0x15e7e4,_0x215d3c){_0x15e7e4=_0x15e7e4-0x144;const _0xd4218f=a67_0xd421();let _0x337b17=_0xd4218f[_0x15e7e4];return _0x337b17;}const a67_0x1ce712=a67_0x337b;function a67_0xd421(){const _0x26fdc3=['user','1314344OUyQWN','373518xjSbJf','721324afYgJK','domains','25GGzPZA','skillHubDomain','runtime','skillhub','apiDomain','nonProduction','462auAFMe','119602QWqBha','api','328926EOQviK','3000453THPVMo','production','runtimeDomain','54tWtSGp','7613530trFphO'];a67_0xd421=function(){return _0x26fdc3;};return a67_0xd421();}(function(_0x5406bb,_0x1476ce){const _0x4fc42d=a67_0x337b,_0x547279=_0x5406bb();while(!![]){try{const _0x223ba0=-parseInt(_0x4fc42d(0x14c))/0x1+-parseInt(_0x4fc42d(0x154))/0x2+parseInt(_0x4fc42d(0x14d))/0x3+parseInt(_0x4fc42d(0x155))/0x4*(-parseInt(_0x4fc42d(0x157))/0x5)+parseInt(_0x4fc42d(0x149))/0x6*(parseInt(_0x4fc42d(0x14a))/0x7)+parseInt(_0x4fc42d(0x153))/0x8*(-parseInt(_0x4fc42d(0x150))/0x9)+parseInt(_0x4fc42d(0x151))/0xa;if(_0x223ba0===_0x1476ce)break;else _0x547279['push'](_0x547279['shift']());}catch(_0x2878be){_0x547279['push'](_0x547279['shift']());}}}(a67_0xd421,0xa48ec));import{getEnv,isProduction}from'../constant/env.js';import{PRODUCT_CONFIG}from'../constant/product.js';let customApiDomain,customUserDomain,customRuntimeDomain,customSkillHubDomain;export function initDomains(_0x13b729){const _0xfbb471=a67_0x337b;customApiDomain=_0x13b729?.[_0xfbb471(0x147)],customUserDomain=_0x13b729?.['userDomain'],customRuntimeDomain=_0x13b729?.[_0xfbb471(0x14f)],customSkillHubDomain=_0x13b729?.[_0xfbb471(0x144)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a67_0x1ce712(0x156)]['production'][a67_0x1ce712(0x152)]:PRODUCT_CONFIG[a67_0x1ce712(0x156)]['nonProduction'][a67_0x1ce712(0x152)]);export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a67_0x1ce712(0x156)][a67_0x1ce712(0x14e)][a67_0x1ce712(0x14b)]:PRODUCT_CONFIG[a67_0x1ce712(0x156)]['nonProduction'][a67_0x1ce712(0x14b)]);export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?PRODUCT_CONFIG['domains'][a67_0x1ce712(0x14e)][a67_0x1ce712(0x145)]:PRODUCT_CONFIG['domains'][a67_0x1ce712(0x148)][a67_0x1ce712(0x145)]);export const getSkillHubDomain=()=>customSkillHubDomain||(isProduction(getEnv())?PRODUCT_CONFIG['domains'][a67_0x1ce712(0x14e)][a67_0x1ce712(0x146)]:PRODUCT_CONFIG['domains'][a67_0x1ce712(0x148)][a67_0x1ce712(0x146)]);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a68_0x1a09b4=a68_0x4e40;(function(_0x181442,_0x42944a){const _0x279a4c=a68_0x4e40,_0x58fe6f=_0x181442();while(!![]){try{const _0x1e8c74=-parseInt(_0x279a4c(0x121))/0x1+parseInt(_0x279a4c(0x11b))/0x2+parseInt(_0x279a4c(0x11f))/0x3+parseInt(_0x279a4c(0x11a))/0x4*(-parseInt(_0x279a4c(0x122))/0x5)+parseInt(_0x279a4c(0x11e))/0x6*(parseInt(_0x279a4c(0x11d))/0x7)+-parseInt(_0x279a4c(0x120))/0x8+-parseInt(_0x279a4c(0x116))/0x9*(parseInt(_0x279a4c(0x119))/0xa);if(_0x1e8c74===_0x42944a)break;else _0x58fe6f['push'](_0x58fe6f['shift']());}catch(_0x2d11c5){_0x58fe6f['push'](_0x58fe6f['shift']());}}}(a68_0x28a3,0xe8258));import{productEnv}from'../constant/product.js';function a68_0x4e40(_0x3ff4b2,_0x4185ab){_0x3ff4b2=_0x3ff4b2-0x113;const _0x28a357=a68_0x28a3();let _0x4e40cc=_0x28a357[_0x3ff4b2];return _0x4e40cc;}export const RUNTIME_ENV_VALUES=['production','development',a68_0x1a09b4(0x114)];export function normalizeEnv(_0x329ae6){const _0x4842b1=a68_0x1a09b4;return _0x329ae6===_0x4842b1(0x115)?_0x4842b1(0x118):_0x329ae6;}export function isProduction(_0x2cec33){const _0x584c07=a68_0x1a09b4;return normalizeEnv(_0x2cec33)===_0x584c07(0x118);}export function isDaily(_0x19881){const _0x5626be=a68_0x1a09b4;return normalizeEnv(_0x19881)===_0x5626be(0x114);}export function isDev(_0x522876){const _0x3cac17=a68_0x1a09b4,_0x4e132a=normalizeEnv(_0x522876);return _0x4e132a===_0x3cac17(0x11c)||_0x4e132a===_0x3cac17(0x117);}let env=normalizeEnv(productEnv(a68_0x1a09b4(0x113))||a68_0x1a09b4(0x118));export function getEnv(){return env;}function a68_0x28a3(){const _0x3aafc4=['802646gcpDsX','3436170XwYHeP','ENV','daily','online','234mDvBmW','dev','production','300470gZBOWg','4jBvOnp','1566432vUsxzO','development','6422227AcYpkg','6uNqbRx','4883406uHchKT','852040QGVLtP'];a68_0x28a3=function(){return _0x3aafc4;};return a68_0x28a3();}export function initEnv(_0x2e7049){env=normalizeEnv(_0x2e7049);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a69_0x2042(){const _0x2eee1d=['1508740HNErWz','json','222130tIgPju','1324074XPrXCA','1754712IdVrJg','13920KIvhVO','1862336nHSneu','56657kQTHTG','1875BlHRDk','4FMWjLD','855pugmPo'];a69_0x2042=function(){return _0x2eee1d;};return a69_0x2042();}const a69_0x52f5af=a69_0x4eea;(function(_0x1213a3,_0x5195c4){const _0x4ba481=a69_0x4eea,_0x53a178=_0x1213a3();while(!![]){try{const _0xdc1845=parseInt(_0x4ba481(0xc9))/0x1+parseInt(_0x4ba481(0xcd))/0x2+parseInt(_0x4ba481(0xd0))/0x3*(parseInt(_0x4ba481(0xcb))/0x4)+parseInt(_0x4ba481(0xca))/0x5*(parseInt(_0x4ba481(0xc7))/0x6)+parseInt(_0x4ba481(0xc8))/0x7+parseInt(_0x4ba481(0xd1))/0x8+-parseInt(_0x4ba481(0xcc))/0x9*(parseInt(_0x4ba481(0xcf))/0xa);if(_0xdc1845===_0x5195c4)break;else _0x53a178['push'](_0x53a178['shift']());}catch(_0x534524){_0x53a178['push'](_0x53a178['shift']());}}}(a69_0x2042,0x79781));function a69_0x4eea(_0x4378a0,_0x541d86){_0x4378a0=_0x4378a0-0xc7;const _0x204248=a69_0x2042();let _0x4eea9d=_0x204248[_0x4378a0];return _0x4eea9d;}export const OUTPUT_FORMAT_VALUES=[a69_0x52f5af(0xce),'pretty','compress'];
|
package/lib/constant/product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a70_0x1cd8(_0x50912f,_0xe1b8bd){_0x50912f=_0x50912f-0xdd;const _0x53e270=a70_0x53e2();let _0x1cd85e=_0x53e270[_0x50912f];return _0x1cd85e;}const a70_0x360ab7=a70_0x1cd8;(function(_0x353b6a,_0x5da892){const _0x55bbe1=a70_0x1cd8,_0x575ffa=_0x353b6a();while(!![]){try{const _0x196a44=-parseInt(_0x55bbe1(0xe0))/0x1*(-parseInt(_0x55bbe1(0xf4))/0x2)+parseInt(_0x55bbe1(0xeb))/0x3*(parseInt(_0x55bbe1(0xde))/0x4)+parseInt(_0x55bbe1(0xe7))/0x5*(-parseInt(_0x55bbe1(0xf1))/0x6)+-parseInt(_0x55bbe1(0xdd))/0x7+parseInt(_0x55bbe1(0xe6))/0x8*(-parseInt(_0x55bbe1(0xfb))/0x9)+parseInt(_0x55bbe1(0xf8))/0xa+parseInt(_0x55bbe1(0xe9))/0xb*(parseInt(_0x55bbe1(0xee))/0xc);if(_0x196a44===_0x5da892)break;else _0x575ffa['push'](_0x575ffa['shift']());}catch(_0x469fd2){_0x575ffa['push'](_0x575ffa['shift']());}}}(a70_0x53e2,0x2c49e));export const PRODUCT_CONFIG={'cliBinName':'lovrabet','cliDisplayName':a70_0x360ab7(0xfa),'npmPackageName':a70_0x360ab7(0xf5),'skillSource':a70_0x360ab7(0xe2),'npmRegistryBaseUrl':a70_0x360ab7(0xef),'envPrefix':a70_0x360ab7(0xe5),'legacyEnvPrefixes':['RABETBASE'],'configFileNames':[a70_0x360ab7(0xec),a70_0x360ab7(0xf3)],'newConfigFileName':a70_0x360ab7(0xec),'homeDirName':'.lovrabet','logFileName':a70_0x360ab7(0xf7),'invokeSource':a70_0x360ab7(0xf9),'userCenterDisplayName':'Lovrabet\x20User\x20Center','skipNpxSkillsEnvSuffix':a70_0x360ab7(0xdf),'domains':{'production':{'user':a70_0x360ab7(0xe4),'api':a70_0x360ab7(0xf6),'runtime':a70_0x360ab7(0xed),'skillhub':a70_0x360ab7(0xe8)},'nonProduction':{'user':'https://user-daily.lovrabet.com','api':'https://daily-api.lovrabet.com','runtime':a70_0x360ab7(0xea),'skillhub':a70_0x360ab7(0xe1)}},'accessKeyCreatePath':a70_0x360ab7(0xf2)};export function productEnvName(_0x488075){return PRODUCT_CONFIG['envPrefix']+'_'+_0x488075;}function a70_0x53e2(){const _0x8c0985=['https://runtime.lovrabet.com','1170768EaBtAm','https://registry.npmjs.org','map','33642NApYMT','/user/ak','.lovrabetrc','4jpTtHA','@lovrabet/lovrabet-cli','https://api.lovrabet.com','.lovrabet-runtime.log','395970YaRzmb','cli:lovrabet-runtime','Lovrabet\x20Runtime\x20CLI','9BGDlkP','1026879iBHzwM','1296448RldBxU','SKIP_NPX_SKILLS','84979JeAArm','https://skills-daily.lovrabet.com','lovrabet/lovrabet-cli','legacyEnvPrefixes','https://user.lovrabet.com','LOVRABET','1752184LLUYKg','75kyUQrA','https://skills.lovrabet.com','11NMhXUv','https://daily-runtime.lovrabet.com','3YvcgdJ','.lovrabet.json'];a70_0x53e2=function(){return _0x8c0985;};return a70_0x53e2();}export function productEnvNames(_0x4c8d36){const _0x1f4dd9=a70_0x360ab7;return[productEnvName(_0x4c8d36),...PRODUCT_CONFIG[_0x1f4dd9(0xe3)][_0x1f4dd9(0xf0)](_0x13d417=>_0x13d417+'_'+_0x4c8d36)];}export function productEnv(_0x1f6ad7){for(const _0x594bcb of productEnvNames(_0x1f6ad7)){const _0x326600=process.env[_0x594bcb];if(_0x326600!==undefined)return _0x326600;}return undefined;}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a71_0x468e56=a71_0x21fe;(function(_0x451598,_0xabcde3){const _0x2eb2c5=a71_0x21fe,_0x33e1a0=_0x451598();while(!![]){try{const _0xfdfa93=parseInt(_0x2eb2c5(0x135))/0x1*(parseInt(_0x2eb2c5(0x132))/0x2)+parseInt(_0x2eb2c5(0x131))/0x3*(parseInt(_0x2eb2c5(0x136))/0x4)+parseInt(_0x2eb2c5(0x137))/0x5+-parseInt(_0x2eb2c5(0x138))/0x6+parseInt(_0x2eb2c5(0x13a))/0x7+parseInt(_0x2eb2c5(0x133))/0x8+-parseInt(_0x2eb2c5(0x13b))/0x9;if(_0xfdfa93===_0xabcde3)break;else _0x33e1a0['push'](_0x33e1a0['shift']());}catch(_0x5ac705){_0x33e1a0['push'](_0x33e1a0['shift']());}}}(a71_0x4a9d,0x96795));function a71_0x21fe(_0xd8f1e9,_0xba7227){_0xd8f1e9=_0xd8f1e9-0x130;const _0x4a9db2=a71_0x4a9d();let _0x21fe3a=_0x4a9db2[_0xd8f1e9];return _0x21fe3a;}function a71_0x4a9d(){const _0x133dca=['18414891vSjqdw','write','3LpPwwc','2GEFQlt','7079424PeBorx','read','1090493uigzbJ','3040436spWyqE','1455660rcNdMl','6772086aagaUj','high-risk-write','5351213fZjukG'];a71_0x4a9d=function(){return _0x133dca;};return a71_0x4a9d();}export const RISK_LEVEL_VALUES=[a71_0x468e56(0x134),a71_0x468e56(0x130),a71_0x468e56(0x139)];
|
package/lib/constant/url.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a72_0x40e9(){const _0x4f78d4=['8gsscll','2565048XtZiGe','1239714zWKKkj','651849BiePHw','production','10901862osFwum','4036753Iettqt','114740MwbNzm','1366110ZkVnuN','5rdzigf','domains'];a72_0x40e9=function(){return _0x4f78d4;};return a72_0x40e9();}const a72_0x47bc6c=a72_0x42f5;(function(_0x76279b,_0x422840){const _0x29698e=a72_0x42f5,_0xe45f39=_0x76279b();while(!![]){try{const _0x5af61d=parseInt(_0x29698e(0xe2))/0x1+parseInt(_0x29698e(0xe6))/0x2+-parseInt(_0x29698e(0xe1))/0x3+parseInt(_0x29698e(0xe0))/0x4*(parseInt(_0x29698e(0xe8))/0x5)+parseInt(_0x29698e(0xe7))/0x6+-parseInt(_0x29698e(0xe5))/0x7*(-parseInt(_0x29698e(0xdf))/0x8)+-parseInt(_0x29698e(0xe4))/0x9;if(_0x5af61d===_0x422840)break;else _0xe45f39['push'](_0xe45f39['shift']());}catch(_0x3a1e6e){_0xe45f39['push'](_0xe45f39['shift']());}}}(a72_0x40e9,0x81771));import{PRODUCT_CONFIG}from'../constant/product.js';function a72_0x42f5(_0x2d9e0c,_0x559353){_0x2d9e0c=_0x2d9e0c-0xdf;const _0x40e920=a72_0x40e9();let _0x42f5b5=_0x40e920[_0x2d9e0c];return _0x42f5b5;}export const USER_ACCESS_KEY_CREATE_URL=''+PRODUCT_CONFIG[a72_0x47bc6c(0xe9)][a72_0x47bc6c(0xe3)]['user']+PRODUCT_CONFIG['accessKeyCreatePath'];
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a73_0x5926b1=a73_0xde75;(function(_0x30d5b9,_0x380117){const _0x23b292=a73_0xde75,_0x485c8f=_0x30d5b9();while(!![]){try{const _0x4bc082=parseInt(_0x23b292(0x18c))/0x1*(-parseInt(_0x23b292(0x17b))/0x2)+parseInt(_0x23b292(0x187))/0x3*(parseInt(_0x23b292(0x170))/0x4)+-parseInt(_0x23b292(0x1ab))/0x5+parseInt(_0x23b292(0x1a4))/0x6*(-parseInt(_0x23b292(0x179))/0x7)+-parseInt(_0x23b292(0x18f))/0x8+-parseInt(_0x23b292(0x171))/0x9+parseInt(_0x23b292(0x18b))/0xa*(parseInt(_0x23b292(0x173))/0xb);if(_0x4bc082===_0x380117)break;else _0x485c8f['push'](_0x485c8f['shift']());}catch(_0x5a703f){_0x485c8f['push'](_0x485c8f['shift']());}}}(a73_0x5df9,0x8b9c4));import{readFileSync,existsSync,mkdirSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{CliErrors}from'./errors.js';function a73_0xde75(_0x455914,_0x3d4c47){_0x455914=_0x455914-0x170;const _0x5df932=a73_0x5df9();let _0xde750e=_0x5df932[_0x455914];return _0xde750e;}import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvNames}from'./constant/product.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily,isDev}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';import{resolveCachedAppCode}from'./commands/app/cache.js';export{AUTH_MODE,isAuthMode}from'./constant/auth-mode.js';const CONFIG_NAMES=PRODUCT_CONFIG[a73_0x5926b1(0x1be)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a73_0x5926b1(0x186)];function resolveConfigPath(_0x1ede3e){for(const _0x2683fe of CONFIG_NAMES){const _0x12be37=resolve(_0x1ede3e,_0x2683fe);if(existsSync(_0x12be37))return _0x12be37;}return undefined;}export function resolveWriteConfigPath(_0x260eb8){const _0x2bae8d=a73_0x5926b1,_0x5d643e=_0x260eb8===_0x2bae8d(0x189)?process[_0x2bae8d(0x1b5)]():homedir(),_0x527c0b=resolveConfigPath(_0x5d643e);return _0x527c0b??resolve(_0x5d643e,NEW_CONFIG_NAME);}export function readConfigFile(_0x47b4fe){const _0xf6d34e=a73_0x5926b1;try{if(existsSync(_0x47b4fe)){const _0x242ec=readFileSync(_0x47b4fe,{'encoding':_0xf6d34e(0x1ad)});if(_0x242ec){const _0x5905ca=JSON[_0xf6d34e(0x17a)](_0x242ec);return migrateOnlineEnv(_0x47b4fe,_0x5905ca),_0x5905ca;}}}catch{}return{};}function migrateOnlineEnv(_0x4219e1,_0x43c15d){const _0x479727=a73_0x5926b1;let _0x3eb9d2=![];_0x43c15d['env']===_0x479727(0x196)&&(_0x43c15d[_0x479727(0x1af)]=_0x479727(0x1ba),_0x3eb9d2=!![]);if(_0x43c15d[_0x479727(0x1b4)]&&typeof _0x43c15d[_0x479727(0x1b4)]===_0x479727(0x1a1))for(const _0x402049 of Object[_0x479727(0x198)](_0x43c15d[_0x479727(0x1b4)])){_0x402049&&_0x402049['env']===_0x479727(0x196)&&(_0x402049[_0x479727(0x1af)]=_0x479727(0x1ba),_0x3eb9d2=!![]);}if(_0x3eb9d2)try{writeConfigFile(_0x4219e1,_0x43c15d);}catch{}}export function writeConfigFile(_0x5dc4ee,_0x392bff){const _0x239fec=a73_0x5926b1,_0x1e871a=dirname(_0x5dc4ee);!existsSync(_0x1e871a)&&mkdirSync(_0x1e871a,{'recursive':!![]});const _0x12a69e=_0x5dc4ee+_0x239fec(0x182);try{writeFileSync(_0x12a69e,JSON[_0x239fec(0x172)](_0x392bff,null,0x2)+'\x0a',{'encoding':_0x239fec(0x1ad),'mode':0x180});try{renameSync(_0x12a69e,_0x5dc4ee);}catch(_0x2ffa3d){if(_0x2ffa3d[_0x239fec(0x1b0)]===_0x239fec(0x19c)||_0x2ffa3d[_0x239fec(0x1b0)]===_0x239fec(0x180)||_0x2ffa3d[_0x239fec(0x1b0)]===_0x239fec(0x18e)){writeFileSync(_0x5dc4ee,JSON[_0x239fec(0x172)](_0x392bff,null,0x2)+'\x0a',{'encoding':_0x239fec(0x1ad)});try{unlinkSync(_0x12a69e);}catch{}}else throw _0x2ffa3d;}}catch(_0x3da378){try{unlinkSync(_0x12a69e);}catch{}throw _0x3da378;}}export function isNonInteractiveMode(_0x511fcc){const _0x4fd643=a73_0x5926b1;return!!(_0x511fcc[_0x4fd643(0x1ac)]||_0x511fcc['ci']||productEnvNames('CI')[_0x4fd643(0x1b1)](_0x61445e=>process.env[_0x61445e]===_0x4fd643(0x188))||process.env.CI===_0x4fd643(0x188)||!process[_0x4fd643(0x17f)]['isTTY']||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x59d88e=a73_0x5926b1;if(!process[_0x59d88e(0x1b2)][_0x59d88e(0x1a7)])return![];try{const _0x3318d1=process[_0x59d88e(0x1b2)][_0x59d88e(0x1ae)];return process[_0x59d88e(0x1b2)][_0x59d88e(0x1a9)](!![]),process[_0x59d88e(0x1b2)][_0x59d88e(0x1a9)](_0x3318d1??![]),!![];}catch{return![];}}export async function createContext(_0x5e76dc){const _0x15d80b=a73_0x5926b1,_0x59111d=readRawConfig(),_0xb64f57=buildConfig(_0x59111d,_0x5e76dc);await initGlobalEnvironment(_0xb64f57);const {getUserDomain:_0x4a8161,getApiDomain:_0x1e0638}=await import(_0x15d80b(0x199)),_0x373de4={'apiDomain':_0x1e0638(),'userDomain':_0x4a8161()},_0x63453c=await buildAuth(_0xb64f57);logger[_0x15d80b(0x192)](process[_0x15d80b(0x1b5)]());const _0x68adc9=(CLI_BIN_NAME+'\x20'+process[_0x15d80b(0x1b6)][_0x15d80b(0x19a)](0x2)[_0x15d80b(0x1a0)]('\x20'))['trim']();logger[_0x15d80b(0x1b8)](_0x68adc9);const _0x452ba1=isNonInteractiveMode(_0x5e76dc);return{'config':_0xb64f57,'auth':_0x63453c,'logger':logger,'env':_0x373de4,'nonInteractive':_0x452ba1};}export function buildConfigFromFlags(_0x50deca){return buildConfig(readRawConfig(),_0x50deca);}export function getLocalAppAliases(_0x4fa6f1){const _0x5391b7=a73_0x5926b1;return _0x4fa6f1['apps']&&typeof _0x4fa6f1[_0x5391b7(0x1b4)]===_0x5391b7(0x1a1)?_0x4fa6f1[_0x5391b7(0x1b4)]:{};}export function resolveLocalAppAliasCode(_0x5d3f5c,_0x3f9b12){const _0x4171e6=a73_0x5926b1;if(!_0x3f9b12)return undefined;const _0x2466d7=getLocalAppAliases(_0x5d3f5c)[_0x3f9b12],_0x4233af=_0x2466d7?.[_0x4171e6(0x19d)];return typeof _0x4233af===_0x4171e6(0x1bc)&&_0x4233af[_0x4171e6(0x194)]()?_0x4233af[_0x4171e6(0x194)]():undefined;}function a73_0x5df9(){const _0x4a23f7=['development','string','projectConfig','configFileNames','5248mJjQCq','1328085TtPcYI','stringify','1826RKcOwJ','accessKey','FORMAT','PAGE_SIZE','find','explicit','81998eZDiXh','parse','2BXwitj','apiDomain','error','message','stdout','EXDEV','VERBOSE','.tmp','maxRisk','authRequired','ACCESS_KEY','newConfigFileName','1473ijMYug','true','project','riskLevel','137040RWVrwY','126481nbxqsl','write','EACCES','7263560zWEDZU','local-alias','raw','setLogPath','format','trim','APP','online','app','values','./constant/domain.js','slice','cache','EPERM','appcode','locale','global','join','object','runtimeDomain','high-risk-write','462pHztVh','missing','userDomain','isTTY','daily','setRawMode','inherit','1316215zqRlvf','nonInteractive','utf8','isRaw','env','code','some','stdin','empty','apps','cwd','argv','defaultApp','setRawCommand','skillHubDomain','production'];a73_0x5df9=function(){return _0x4a23f7;};return a73_0x5df9();}export function readAppCodeFromConfig(){const _0x1ed4f3=a73_0x5926b1,_0x2dcb9c=readRawConfig(),_0x147f72=_0x2dcb9c[_0x1ed4f3(0x19d)]??_0x2dcb9c['app'];if(typeof _0x147f72===_0x1ed4f3(0x1bc)&&_0x147f72[_0x1ed4f3(0x194)]())return _0x147f72[_0x1ed4f3(0x194)]();const _0x46fce4=resolveLocalAppAliasCode(_0x2dcb9c,typeof _0x2dcb9c['defaultApp']==='string'?_0x2dcb9c[_0x1ed4f3(0x1b7)]:undefined);if(_0x46fce4)return _0x46fce4;const _0xe2430b=normalizeEnv(String(_0x2dcb9c[_0x1ed4f3(0x1af)]||_0x1ed4f3(0x1ba))),_0x1c6eda=isDaily(_0xe2430b)?_0x1ed4f3(0x1a8):isDev(_0xe2430b)?_0x1ed4f3(0x1bb):_0x1ed4f3(0x1ba),_0x56dd47=resolveCachedAppCode(typeof _0x2dcb9c[_0x1ed4f3(0x1b7)]===_0x1ed4f3(0x1bc)?_0x2dcb9c['defaultApp']:undefined,_0x1c6eda,typeof _0x2dcb9c[_0x1ed4f3(0x174)]===_0x1ed4f3(0x1bc)?_0x2dcb9c['accessKey']:undefined);if(_0x56dd47)return _0x56dd47;const _0x2ffba1=Object[_0x1ed4f3(0x198)](getLocalAppAliases(_0x2dcb9c))[_0x1ed4f3(0x177)](_0x3f1b1d=>_0x3f1b1d?.[_0x1ed4f3(0x19d)]);return typeof _0x2ffba1?.[_0x1ed4f3(0x19d)]==='string'&&_0x2ffba1[_0x1ed4f3(0x19d)][_0x1ed4f3(0x194)]()?_0x2ffba1[_0x1ed4f3(0x19d)][_0x1ed4f3(0x194)]():undefined;}export function readScopedConfig(_0x4aa97b){const _0x591194=a73_0x5926b1,_0x1b0555=_0x4aa97b[_0x591194(0x19f)]?_0x591194(0x19f):_0x591194(0x189);return readConfigFile(resolveWriteConfigPath(_0x1b0555));}export function writeScopedConfig(_0x3298d9,_0x371739){const _0x5a45e1=a73_0x5926b1,_0x5164fb=_0x371739[_0x5a45e1(0x19f)]?_0x5a45e1(0x19f):'project';writeConfigFile(resolveWriteConfigPath(_0x5164fb),_0x3298d9);}export async function initGlobalEnvironment(_0x19ccbe){const _0x1d5136=a73_0x5926b1,{initEnv:_0x1b2539}=await import('./constant/env.js');_0x1b2539(_0x19ccbe[_0x1d5136(0x1af)]);const {initDomains:_0x3b5276}=await import(_0x1d5136(0x199));_0x3b5276({'apiDomain':_0x19ccbe['raw'][_0x1d5136(0x17c)]||_0x19ccbe[_0x1d5136(0x191)]['host']||undefined,'userDomain':_0x19ccbe[_0x1d5136(0x191)][_0x1d5136(0x1a6)]||undefined,'runtimeDomain':_0x19ccbe[_0x1d5136(0x191)][_0x1d5136(0x1a2)]||undefined,'skillHubDomain':_0x19ccbe[_0x1d5136(0x191)][_0x1d5136(0x1b9)]||undefined});}export function getProjectConfigPath(){const _0x1052b9=a73_0x5926b1;return resolveConfigPath(process[_0x1052b9(0x1b5)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0xdddd1c){const _0x5b3113=a73_0x5926b1;if(!existsSync(_0xdddd1c))return{'status':_0x5b3113(0x1a5)};try{const _0x2930b2=readFileSync(_0xdddd1c,{'encoding':_0x5b3113(0x1ad)});if(!_0x2930b2?.[_0x5b3113(0x194)]())return{'status':_0x5b3113(0x1b3)};const _0x12e5d7=JSON[_0x5b3113(0x17a)](_0x2930b2);return{'status':'ok','data':_0x12e5d7};}catch(_0x154606){return{'status':_0x5b3113(0x17d),'message':_0x154606 instanceof Error?_0x154606[_0x5b3113(0x17e)]:String(_0x154606)};}}export function loadRawConfigLayers(_0x464bb5){const _0x19a3fd=a73_0x5926b1;let _0x3b61b9={},_0x52727b={},_0x1e05f3,_0x3096e4;try{_0x1e05f3=resolveConfigPath(homedir());if(_0x1e05f3){const _0x21189c=readFileSync(_0x1e05f3,{'encoding':_0x19a3fd(0x1ad)});if(_0x21189c)_0x3b61b9=JSON['parse'](_0x21189c);}}catch{}try{const _0x5ca07a=_0x464bb5||process[_0x19a3fd(0x1b5)]();_0x3096e4=resolveConfigPath(_0x5ca07a);if(_0x3096e4){const _0x5e300d=readFileSync(_0x3096e4,{'encoding':_0x19a3fd(0x1ad)});if(_0x5e300d)_0x52727b=JSON[_0x19a3fd(0x17a)](_0x5e300d);}}catch{}return{'globalPath':_0x1e05f3,'projectPath':_0x3096e4,'globalConfig':_0x3b61b9,'projectConfig':_0x52727b};}function mergeRawConfigLayers(_0x224653){const _0x2bd79a=a73_0x5926b1,{globalConfig:_0x5f0eee,projectConfig:_0x54cd51}=_0x224653;if(_0x54cd51['inherit']===![]){const _0x4041c4={..._0x54cd51};return delete _0x4041c4[_0x2bd79a(0x1aa)],_0x4041c4;}const _0x6ec688={..._0x5f0eee,..._0x54cd51};if(_0x2bd79a(0x1b7)in _0x54cd51)_0x6ec688[_0x2bd79a(0x1b7)]=_0x54cd51[_0x2bd79a(0x1b7)];else _0x5f0eee[_0x2bd79a(0x1b7)]&&(_0x6ec688['defaultApp']=_0x5f0eee[_0x2bd79a(0x1b7)]);return _0x6ec688;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x534f06){return mergeRawConfigLayers(loadRawConfigLayers(_0x534f06));}export function readRawConfigWithLayers(_0x329d12){const _0x3f5e42=loadRawConfigLayers(_0x329d12);return{'config':mergeRawConfigLayers(_0x3f5e42),'layers':_0x3f5e42};}export function resolveDefaultAppSource(_0x59344c){const _0x60983a=a73_0x5926b1;if(_0x60983a(0x1b7)in _0x59344c[_0x60983a(0x1bd)])return _0x60983a(0x189);if(_0x59344c[_0x60983a(0x1bd)][_0x60983a(0x1aa)]===![])return null;if(_0x59344c['globalConfig'][_0x60983a(0x1b7)])return _0x60983a(0x19f);return null;}function buildConfig(_0x567592,_0x4cc644){const _0x37d65d=a73_0x5926b1,_0x1a5c55=_0x567592[_0x37d65d(0x1b7)]||undefined,_0x17ac21=_0x4cc644['app']||env(_0x37d65d(0x195))||undefined,_0x31217e=_0x17ac21||_0x1a5c55||undefined,_0x181cc8=env(_0x37d65d(0x185))||_0x567592['accessKey']||undefined,_0x1df34e=_0x4cc644['env']||env('ENV')||_0x567592[_0x37d65d(0x1af)]||DEFAULT_CONFIG_VALUES[_0x37d65d(0x1af)],_0xbd22f8=normalizeEnv(String(_0x1df34e)),_0x58b1e6=isDaily(_0xbd22f8)?_0x37d65d(0x1a8):isDev(_0xbd22f8)?_0x37d65d(0x1bb):_0x37d65d(0x1ba),_0x3e6cbe=typeof _0x4cc644['appcode']==='string'?_0x4cc644['appcode']:undefined,_0x3ab94b=env('APPCODE'),_0x3a55af=_0x17ac21?undefined:_0x567592[_0x37d65d(0x19d)]||_0x567592[_0x37d65d(0x197)]||undefined,_0x44d75f=_0x17ac21||(_0x3a55af?undefined:_0x1a5c55),_0x41c755=resolveLocalAppAliasCode(_0x567592,_0x44d75f),_0x4e7b22=resolveCachedAppCode(_0x44d75f,_0x58b1e6,_0x181cc8),_0x3cf9fc=_0x3e6cbe||_0x3ab94b||_0x3a55af||_0x41c755||_0x4e7b22||undefined,_0x5d39ec=_0x3e6cbe?_0x37d65d(0x178):_0x3ab94b?_0x37d65d(0x1af):_0x3a55af?'top-level':_0x41c755?_0x37d65d(0x190):_0x4e7b22?_0x37d65d(0x19b):undefined,_0x3e6f71=_0x567592[_0x37d65d(0x19e)]||DEFAULT_CONFIG_VALUES['locale'],_0x504b1c=undefined,_0x296de0=_0x4cc644[_0x37d65d(0x193)]||env(_0x37d65d(0x175))||_0x567592['format'],_0x443d39=normalizeLegacyOutputFormat(_0x296de0),_0x54771a=env(_0x37d65d(0x176))||_0x567592['pageSize'],_0x462d3e=_0x54771a?Number(_0x54771a)||undefined:undefined,_0x41f449=_0x567592[_0x37d65d(0x18a)]||_0x567592[_0x37d65d(0x183)],_0x3707b7=_0x41f449==='read'||_0x41f449===_0x37d65d(0x18d)||_0x41f449===_0x37d65d(0x1a3)?_0x41f449:DEFAULT_CONFIG_VALUES[_0x37d65d(0x18a)],_0x369709=env(_0x37d65d(0x181)),_0x14bef2=_0x369709==='1'||_0x369709==='true';return{'appCode':typeof _0x3cf9fc===_0x37d65d(0x1bc)&&_0x3cf9fc[_0x37d65d(0x194)]()?_0x3cf9fc['trim']():undefined,'appCodeSource':_0x5d39ec,'env':_0x58b1e6,'locale':_0x3e6f71,'cookie':_0x504b1c,'accessKey':_0x181cc8,'format':_0x443d39,'pageSize':_0x462d3e,'riskLevel':_0x3707b7,'verbose':_0x14bef2,'defaultApp':_0x1a5c55,'currentApp':typeof _0x31217e===_0x37d65d(0x1bc)?_0x31217e:undefined,'raw':_0x567592};}function env(_0x10716f){return productEnv(_0x10716f);}async function buildAuth(_0x51bd8f){const _0x5a20c4=a73_0x5926b1,_0x1af31d='',_0x39e34c=!!_0x51bd8f[_0x5a20c4(0x174)];return{'cookie':_0x1af31d,'isLoggedIn':_0x39e34c,async 'getOrLogin'(){const _0x4799e0=_0x5a20c4;if(_0x39e34c)return _0x1af31d;throw CliErrors[_0x4799e0(0x184)]();}};}
|
|
1
|
+
const a73_0x3ca18b=a73_0x1e8d;(function(_0x37d6a9,_0x5c139a){const _0x21726=a73_0x1e8d,_0x5cdeb2=_0x37d6a9();while(!![]){try{const _0x209433=parseInt(_0x21726(0x7b))/0x1+parseInt(_0x21726(0x9d))/0x2*(-parseInt(_0x21726(0xaa))/0x3)+parseInt(_0x21726(0xa9))/0x4*(parseInt(_0x21726(0x6c))/0x5)+-parseInt(_0x21726(0x93))/0x6*(parseInt(_0x21726(0x8c))/0x7)+-parseInt(_0x21726(0xac))/0x8*(-parseInt(_0x21726(0xa6))/0x9)+parseInt(_0x21726(0x6a))/0xa+-parseInt(_0x21726(0xa7))/0xb;if(_0x209433===_0x5c139a)break;else _0x5cdeb2['push'](_0x5cdeb2['shift']());}catch(_0x55a22d){_0x5cdeb2['push'](_0x5cdeb2['shift']());}}}(a73_0x5e9a,0x52716));import{readFileSync,existsSync,mkdirSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvNames}from'./constant/product.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily,isDev}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';import{resolveCachedAppCode}from'./commands/app/cache.js';export{AUTH_MODE,isAuthMode}from'./constant/auth-mode.js';const CONFIG_NAMES=PRODUCT_CONFIG['configFileNames'];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a73_0x3ca18b(0x94)];function resolveConfigPath(_0x3f1279){for(const _0x336a45 of CONFIG_NAMES){const _0x3efe6b=resolve(_0x3f1279,_0x336a45);if(existsSync(_0x3efe6b))return _0x3efe6b;}return undefined;}export function resolveWriteConfigPath(_0x20668c){const _0x2b87b0=a73_0x3ca18b,_0x2b5ce2=_0x20668c===_0x2b87b0(0x71)?process[_0x2b87b0(0x79)]():homedir(),_0x5ddc6f=resolveConfigPath(_0x2b5ce2);return _0x5ddc6f??resolve(_0x2b5ce2,NEW_CONFIG_NAME);}export function readConfigFile(_0x190b35){const _0x253290=a73_0x3ca18b;try{if(existsSync(_0x190b35)){const _0xb65c47=readFileSync(_0x190b35,{'encoding':_0x253290(0x83)});if(_0xb65c47){const _0x15bac4=JSON[_0x253290(0x9c)](_0xb65c47);return migrateOnlineEnv(_0x190b35,_0x15bac4),_0x15bac4;}}}catch{}return{};}function migrateOnlineEnv(_0x6e7f2,_0x2c1c0a){const _0x559a42=a73_0x3ca18b;let _0x56328f=![];_0x2c1c0a['env']===_0x559a42(0x7c)&&(_0x2c1c0a[_0x559a42(0x91)]=_0x559a42(0xa5),_0x56328f=!![]);if(_0x2c1c0a['apps']&&typeof _0x2c1c0a[_0x559a42(0xa1)]===_0x559a42(0x7d))for(const _0x576280 of Object[_0x559a42(0xab)](_0x2c1c0a[_0x559a42(0xa1)])){_0x576280&&_0x576280['env']===_0x559a42(0x7c)&&(_0x576280[_0x559a42(0x91)]='production',_0x56328f=!![]);}if(_0x56328f)try{writeConfigFile(_0x6e7f2,_0x2c1c0a);}catch{}}export function writeConfigFile(_0x40bdf3,_0xfb8bda){const _0x4d1564=a73_0x3ca18b,_0x246287=dirname(_0x40bdf3);!existsSync(_0x246287)&&mkdirSync(_0x246287,{'recursive':!![]});const _0x8904c=_0x40bdf3+'.tmp';try{writeFileSync(_0x8904c,JSON['stringify'](_0xfb8bda,null,0x2)+'\x0a',{'encoding':_0x4d1564(0x83),'mode':0x180});try{renameSync(_0x8904c,_0x40bdf3);}catch(_0x30dba6){if(_0x30dba6['code']===_0x4d1564(0x9f)||_0x30dba6['code']===_0x4d1564(0x76)||_0x30dba6['code']===_0x4d1564(0x7a)){writeFileSync(_0x40bdf3,JSON['stringify'](_0xfb8bda,null,0x2)+'\x0a',{'encoding':_0x4d1564(0x83)});try{unlinkSync(_0x8904c);}catch{}}else throw _0x30dba6;}}catch(_0x172c8a){try{unlinkSync(_0x8904c);}catch{}throw _0x172c8a;}}export function isNonInteractiveMode(_0x805e12){const _0x46f396=a73_0x3ca18b;return!!(_0x805e12['nonInteractive']||_0x805e12['ci']||productEnvNames('CI')[_0x46f396(0x6f)](_0x59d583=>process.env[_0x59d583]===_0x46f396(0x96))||process.env.CI===_0x46f396(0x96)||!process['stdout']['isTTY']||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x1d9af7=a73_0x3ca18b;if(!process[_0x1d9af7(0x90)][_0x1d9af7(0x80)])return![];try{const _0x38c9c0=process[_0x1d9af7(0x90)]['isRaw'];return process['stdin'][_0x1d9af7(0x99)](!![]),process[_0x1d9af7(0x90)]['setRawMode'](_0x38c9c0??![]),!![];}catch{return![];}}export async function createContext(_0x328095){const _0x34e4da=a73_0x3ca18b,_0x1365e8=readRawConfig(),_0x2bbd31=buildConfig(_0x1365e8,_0x328095);await initGlobalEnvironment(_0x2bbd31);const {getUserDomain:_0x3d02ed,getApiDomain:_0xb3dd6d}=await import(_0x34e4da(0x98)),_0x545d82={'apiDomain':_0xb3dd6d(),'userDomain':_0x3d02ed()},_0x5d1e18=await buildAuth(_0x2bbd31);logger[_0x34e4da(0x88)](process['cwd']());const _0x2f8380=(CLI_BIN_NAME+'\x20'+process['argv']['slice'](0x2)['join']('\x20'))[_0x34e4da(0x9b)]();logger[_0x34e4da(0x95)](_0x2f8380);const _0x46b036=isNonInteractiveMode(_0x328095);return{'config':_0x2bbd31,'auth':_0x5d1e18,'logger':logger,'env':_0x545d82,'nonInteractive':_0x46b036};}export function buildConfigFromFlags(_0x5585dd){return buildConfig(readRawConfig(),_0x5585dd);}function a73_0x5e9a(){const _0x41a3f8=['defaultApp','production','9BLcNiW','9991586YDdLtd','userDomain','16RYHVgK','249jIXKMc','values','3817864bOUqHn','globalConfig','3325830YTzoxQ','string','403890zXRmaD','ENV','raw','some','APP','project','read','ACCESS_KEY','maxRisk','global','EXDEV','inherit','appcode','cwd','EACCES','665747KmjVWh','online','object','error','./constant/env.js','isTTY','accessKey','PAGE_SIZE','utf8','missing','top-level','projectConfig','high-risk-write','setLogPath','apiDomain','find','app','168xZeWdL','write','locale','host','stdin','env','local-alias','6258QAFITX','newConfigFileName','setRawCommand','true','riskLevel','./constant/domain.js','setRawMode','authRequired','trim','parse','12714FTYFKR','FORMAT','EPERM','development','apps','daily','explicit'];a73_0x5e9a=function(){return _0x41a3f8;};return a73_0x5e9a();}export function getLocalAppAliases(_0x393790){const _0x573273=a73_0x3ca18b;return _0x393790[_0x573273(0xa1)]&&typeof _0x393790[_0x573273(0xa1)]===_0x573273(0x7d)?_0x393790[_0x573273(0xa1)]:{};}export function resolveLocalAppAliasCode(_0xcf76b2,_0x4a3f34){const _0x207b71=a73_0x3ca18b;if(!_0x4a3f34)return undefined;const _0x3e5404=getLocalAppAliases(_0xcf76b2)[_0x4a3f34],_0x394998=_0x3e5404?.[_0x207b71(0x78)];return typeof _0x394998===_0x207b71(0x6b)&&_0x394998[_0x207b71(0x9b)]()?_0x394998['trim']():undefined;}export function readAppCodeFromConfig(){const _0xce77b7=a73_0x3ca18b,_0xd8998f=readRawConfig(),_0x2d7b36=_0xd8998f[_0xce77b7(0x78)]??_0xd8998f[_0xce77b7(0x8b)];if(typeof _0x2d7b36==='string'&&_0x2d7b36[_0xce77b7(0x9b)]())return _0x2d7b36[_0xce77b7(0x9b)]();const _0x64c274=resolveLocalAppAliasCode(_0xd8998f,typeof _0xd8998f[_0xce77b7(0xa4)]===_0xce77b7(0x6b)?_0xd8998f[_0xce77b7(0xa4)]:undefined);if(_0x64c274)return _0x64c274;const _0x4cc439=normalizeEnv(String(_0xd8998f[_0xce77b7(0x91)]||_0xce77b7(0xa5))),_0x853ff9=isDaily(_0x4cc439)?'daily':isDev(_0x4cc439)?_0xce77b7(0xa0):'production',_0x2857c8=resolveCachedAppCode(typeof _0xd8998f[_0xce77b7(0xa4)]===_0xce77b7(0x6b)?_0xd8998f['defaultApp']:undefined,_0x853ff9,typeof _0xd8998f[_0xce77b7(0x81)]===_0xce77b7(0x6b)?_0xd8998f[_0xce77b7(0x81)]:undefined);if(_0x2857c8)return _0x2857c8;const _0x5ac338=Object['values'](getLocalAppAliases(_0xd8998f))[_0xce77b7(0x8a)](_0x5975ef=>_0x5975ef?.['appcode']);return typeof _0x5ac338?.[_0xce77b7(0x78)]===_0xce77b7(0x6b)&&_0x5ac338[_0xce77b7(0x78)]['trim']()?_0x5ac338[_0xce77b7(0x78)][_0xce77b7(0x9b)]():undefined;}export function readScopedConfig(_0x259edc){const _0x22eb4d=a73_0x3ca18b,_0xe29a5a=_0x259edc[_0x22eb4d(0x75)]?_0x22eb4d(0x75):_0x22eb4d(0x71);return readConfigFile(resolveWriteConfigPath(_0xe29a5a));}export function writeScopedConfig(_0x2153aa,_0x25b5f7){const _0x453ecb=a73_0x3ca18b,_0x363403=_0x25b5f7[_0x453ecb(0x75)]?_0x453ecb(0x75):_0x453ecb(0x71);writeConfigFile(resolveWriteConfigPath(_0x363403),_0x2153aa);}function a73_0x1e8d(_0xe919d3,_0x2a48a6){_0xe919d3=_0xe919d3-0x6a;const _0x5e9af1=a73_0x5e9a();let _0x1e8d63=_0x5e9af1[_0xe919d3];return _0x1e8d63;}export async function initGlobalEnvironment(_0x3078fb){const _0x852412=a73_0x3ca18b,{initEnv:_0x2d014a}=await import(_0x852412(0x7f));_0x2d014a(_0x3078fb[_0x852412(0x91)]);const {initDomains:_0x15aa8c}=await import('./constant/domain.js');_0x15aa8c({'apiDomain':_0x3078fb[_0x852412(0x6e)][_0x852412(0x89)]||_0x3078fb[_0x852412(0x6e)][_0x852412(0x8f)]||undefined,'userDomain':_0x3078fb[_0x852412(0x6e)][_0x852412(0xa8)]||undefined,'runtimeDomain':_0x3078fb[_0x852412(0x6e)]['runtimeDomain']||undefined,'skillHubDomain':_0x3078fb[_0x852412(0x6e)]['skillHubDomain']||undefined});}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x5b6b1e){const _0x1fe23f=a73_0x3ca18b;if(!existsSync(_0x5b6b1e))return{'status':_0x1fe23f(0x84)};try{const _0x4ed5e8=readFileSync(_0x5b6b1e,{'encoding':_0x1fe23f(0x83)});if(!_0x4ed5e8?.['trim']())return{'status':'empty'};const _0x415114=JSON[_0x1fe23f(0x9c)](_0x4ed5e8);return{'status':'ok','data':_0x415114};}catch(_0x52f6a6){return{'status':_0x1fe23f(0x7e),'message':_0x52f6a6 instanceof Error?_0x52f6a6['message']:String(_0x52f6a6)};}}export function loadRawConfigLayers(_0x12326a){const _0x336720=a73_0x3ca18b;let _0xe3f0cb={},_0x455800={},_0x33b788,_0x3183d1;try{_0x33b788=resolveConfigPath(homedir());if(_0x33b788){const _0x1edb9d=readFileSync(_0x33b788,{'encoding':'utf8'});if(_0x1edb9d)_0xe3f0cb=JSON[_0x336720(0x9c)](_0x1edb9d);}}catch{}try{const _0x5b879a=_0x12326a||process[_0x336720(0x79)]();_0x3183d1=resolveConfigPath(_0x5b879a);if(_0x3183d1){const _0x4dec75=readFileSync(_0x3183d1,{'encoding':_0x336720(0x83)});if(_0x4dec75)_0x455800=JSON['parse'](_0x4dec75);}}catch{}return{'globalPath':_0x33b788,'projectPath':_0x3183d1,'globalConfig':_0xe3f0cb,'projectConfig':_0x455800};}function mergeRawConfigLayers(_0x1fa265){const _0x3b8db6=a73_0x3ca18b,{globalConfig:_0x4563f6,projectConfig:_0x1a6c96}=_0x1fa265;if(_0x1a6c96['inherit']===![]){const _0x359c1d={..._0x1a6c96};return delete _0x359c1d[_0x3b8db6(0x77)],_0x359c1d;}const _0x398ac2={..._0x4563f6,..._0x1a6c96};if(_0x3b8db6(0xa4)in _0x1a6c96)_0x398ac2[_0x3b8db6(0xa4)]=_0x1a6c96['defaultApp'];else _0x4563f6['defaultApp']&&(_0x398ac2[_0x3b8db6(0xa4)]=_0x4563f6[_0x3b8db6(0xa4)]);return _0x398ac2;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0xe87396){return mergeRawConfigLayers(loadRawConfigLayers(_0xe87396));}export function readRawConfigWithLayers(_0x25f4d9){const _0x11652b=loadRawConfigLayers(_0x25f4d9);return{'config':mergeRawConfigLayers(_0x11652b),'layers':_0x11652b};}export function resolveDefaultAppSource(_0x33ee6e){const _0x5e4cd8=a73_0x3ca18b;if('defaultApp'in _0x33ee6e[_0x5e4cd8(0x86)])return _0x5e4cd8(0x71);if(_0x33ee6e[_0x5e4cd8(0x86)]['inherit']===![])return null;if(_0x33ee6e[_0x5e4cd8(0xad)][_0x5e4cd8(0xa4)])return _0x5e4cd8(0x75);return null;}function buildConfig(_0x1d9ee2,_0x1d787f){const _0x1a2d2b=a73_0x3ca18b,_0x1e0168=_0x1d9ee2[_0x1a2d2b(0xa4)]||undefined,_0xdca351=_0x1d787f['app']||env(_0x1a2d2b(0x70))||undefined,_0x49c7b1=_0xdca351||_0x1e0168||undefined,_0x12fe32=env(_0x1a2d2b(0x73))||_0x1d9ee2[_0x1a2d2b(0x81)]||undefined,_0x5bd5cd=_0x1d787f[_0x1a2d2b(0x91)]||env(_0x1a2d2b(0x6d))||_0x1d9ee2[_0x1a2d2b(0x91)]||DEFAULT_CONFIG_VALUES['env'],_0x5bd0d8=normalizeEnv(String(_0x5bd5cd)),_0x44daf4=isDaily(_0x5bd0d8)?_0x1a2d2b(0xa2):isDev(_0x5bd0d8)?_0x1a2d2b(0xa0):_0x1a2d2b(0xa5),_0x2da24e=typeof _0x1d787f[_0x1a2d2b(0x78)]===_0x1a2d2b(0x6b)?_0x1d787f[_0x1a2d2b(0x78)]:undefined,_0x3f2701=env('APPCODE'),_0x11f004=_0xdca351?undefined:_0x1d9ee2[_0x1a2d2b(0x78)]||_0x1d9ee2[_0x1a2d2b(0x8b)]||undefined,_0x17431c=_0xdca351||(_0x11f004?undefined:_0x1e0168),_0x508528=resolveLocalAppAliasCode(_0x1d9ee2,_0x17431c),_0x58025e=resolveCachedAppCode(_0x17431c,_0x44daf4,_0x12fe32),_0x2f2128=_0x2da24e||_0x3f2701||_0x11f004||_0x508528||_0x58025e||undefined,_0x244406=_0x2da24e?_0x1a2d2b(0xa3):_0x3f2701?_0x1a2d2b(0x91):_0x11f004?_0x1a2d2b(0x85):_0x508528?_0x1a2d2b(0x92):_0x58025e?'cache':undefined,_0x2dacf7=_0x1d9ee2['locale']||DEFAULT_CONFIG_VALUES[_0x1a2d2b(0x8e)],_0xacb135=undefined,_0x78082f=_0x1d787f['format']||env(_0x1a2d2b(0x9e))||_0x1d9ee2['format'],_0x4cd682=normalizeLegacyOutputFormat(_0x78082f),_0xb86c56=env(_0x1a2d2b(0x82))||_0x1d9ee2['pageSize'],_0x47422f=_0xb86c56?Number(_0xb86c56)||undefined:undefined,_0x251c2e=_0x1d9ee2[_0x1a2d2b(0x97)]||_0x1d9ee2[_0x1a2d2b(0x74)],_0x56a717=_0x251c2e===_0x1a2d2b(0x72)||_0x251c2e===_0x1a2d2b(0x8d)||_0x251c2e===_0x1a2d2b(0x87)?_0x251c2e:DEFAULT_CONFIG_VALUES['riskLevel'],_0x47ffe0=env('VERBOSE'),_0x3c0a3f=_0x47ffe0==='1'||_0x47ffe0==='true';return{'appCode':typeof _0x2f2128===_0x1a2d2b(0x6b)&&_0x2f2128[_0x1a2d2b(0x9b)]()?_0x2f2128[_0x1a2d2b(0x9b)]():undefined,'appCodeSource':_0x244406,'env':_0x44daf4,'locale':_0x2dacf7,'cookie':_0xacb135,'accessKey':_0x12fe32,'format':_0x4cd682,'pageSize':_0x47422f,'riskLevel':_0x56a717,'verbose':_0x3c0a3f,'defaultApp':_0x1e0168,'currentApp':typeof _0x49c7b1==='string'?_0x49c7b1:undefined,'raw':_0x1d9ee2};}function env(_0x5c0e38){return productEnv(_0x5c0e38);}async function buildAuth(_0x57e7ca){const _0x4d16a4='',_0x147627=!!_0x57e7ca['accessKey'];return{'cookie':_0x4d16a4,'isLoggedIn':_0x147627,async 'getOrLogin'(){const _0x2cdea2=a73_0x1e8d;if(_0x147627)return _0x4d16a4;throw CliErrors[_0x2cdea2(0x9a)]();}};}
|