@lovrabet/lovrabet-cli 2.1.8-beta.1 → 2.1.8-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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_0xed23a2=a55_0x527c;(function(_0x47f940,_0x2f5217){const _0x2c36be=a55_0x527c,_0x86cd2e=_0x47f940();while(!![]){try{const _0x3cf389=parseInt(_0x2c36be(0x133))/0x1*(parseInt(_0x2c36be(0x12a))/0x2)+parseInt(_0x2c36be(0x106))/0x3*(parseInt(_0x2c36be(0x127))/0x4)+-parseInt(_0x2c36be(0x128))/0x5+-parseInt(_0x2c36be(0x13f))/0x6+parseInt(_0x2c36be(0x124))/0x7*(parseInt(_0x2c36be(0x100))/0x8)+-parseInt(_0x2c36be(0x117))/0x9*(-parseInt(_0x2c36be(0x118))/0xa)+-parseInt(_0x2c36be(0x126))/0xb;if(_0x3cf389===_0x2f5217)break;else _0x86cd2e['push'](_0x86cd2e['shift']());}catch(_0x31b6fb){_0x86cd2e['push'](_0x86cd2e['shift']());}}}(a55_0xa75b,0x38649));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{resolve}from'node:path';import{parse as a55_0x4affea}from'yaml';import{CliErrors}from'../../errors.js';import{fileText,scanSkillDirectory}from'../../skills/runtime-skill-sync/local-files.js';const SKILL_FILE=a55_0xed23a2(0xf9),SUPPORTED_SKILL_TYPES=new Set(['write',a55_0xed23a2(0x102),a55_0xed23a2(0x121)]),TEXT_SKILL_FILE_PATTERN=/(?:^SKILL\.md$|\.(?:md|mdx|txt|json|ya?ml|js|mjs|cjs|ts|tsx|sh|sql))$/i;function a55_0x527c(_0x4162ca,_0x129e82){_0x4162ca=_0x4162ca-0xeb;const _0xa75b3=a55_0xa75b();let _0x527c64=_0xa75b3[_0x4162ca];return _0x527c64;}export function validateSkillDirectory(_0x46196c,_0x16d4fb={}){const _0x126609=a55_0xed23a2,_0x52825e=resolveSkillDirectoryRoot(_0x46196c),_0x5fb263=[],_0x27981e=loadRequiredSkillFile(_0x52825e,_0x5fb263),_0x26d8ec=_0x27981e?parseFrontmatter(_0x27981e[_0x126609(0x11f)]):{'hasFrontmatter':![]};_0x27981e&&validateFrontmatter(_0x27981e[_0x126609(0x11d)],_0x26d8ec,_0x5fb263);validateRuntimeCliReferences(_0x52825e,_0x5fb263);const _0x3defc2=_0x5fb263[_0x126609(0xf5)](_0x55f95a=>_0x55f95a[_0x126609(0xfb)]===_0x126609(0xf3)),_0x285cf5=_0x5fb263[_0x126609(0xf5)](_0x33b0a9=>_0x33b0a9[_0x126609(0xfb)]===_0x126609(0xf7));return{'ok':_0x3defc2[_0x126609(0x13a)]===0x0,'dir':_0x52825e,'type':_0x26d8ec[_0x126609(0x12f)],'errors':_0x3defc2,'warnings':_0x285cf5};}function resolveSkillDirectoryRoot(_0x57f2ac){const _0xa5f54b=a55_0xed23a2,_0x39f26d=resolve(_0x57f2ac);if(!existsSync(_0x39f26d))throw CliErrors['validation'](_0xa5f54b(0x130)+_0x57f2ac);const _0x101c6b=lstatSync(_0x39f26d);if(_0x101c6b[_0xa5f54b(0x111)]())return _0x39f26d;if(_0x101c6b[_0xa5f54b(0x12e)]()){const _0x47e99b=realpathSync(_0x39f26d);if(lstatSync(_0x47e99b)['isDirectory']())return _0x47e99b;}throw CliErrors[_0xa5f54b(0x141)](_0xa5f54b(0x130)+_0x57f2ac);}export function throwIfSkillValidationFailed(_0x551d4f,_0x514cbe=![]){const _0xa5c37c=a55_0xed23a2;if(_0x551d4f['ok'])return;const _0x1c4859=_0x551d4f[_0xa5c37c(0xf4)][_0xa5c37c(0x112)](_0x48ac71=>{const _0x2cdb77=_0xa5c37c,_0x26411c=_0x48ac71[_0x2cdb77(0x11c)]?'#'+_0x48ac71[_0x2cdb77(0x11c)]:'';return _0x48ac71[_0x2cdb77(0xfb)]['toUpperCase']()+'\x20'+_0x48ac71[_0x2cdb77(0xfe)]+'\x20'+_0x48ac71[_0x2cdb77(0xf1)]+_0x26411c+':\x20'+_0x48ac71['message']+'\x20Fix:\x20'+_0x48ac71[_0x2cdb77(0x137)];});throw CliErrors['validation'](_0xa5c37c(0x129)+_0x1c4859[_0xa5c37c(0x125)]('\x0a'),'Fix\x20the\x20Skill\x20metadata\x20before\x20running\x20skill\x20push.');}function loadRequiredSkillFile(_0x74ba61,_0x167b65){const _0x1f4db8=a55_0xed23a2,_0x3a10f7=resolve(_0x74ba61,SKILL_FILE);if(!existsSync(_0x3a10f7))return _0x167b65['push'](issue('error',_0x1f4db8(0xfa),SKILL_FILE,_0x1f4db8(0xeb),_0x1f4db8(0x136))),undefined;const _0xc31f5c=lstatSync(_0x3a10f7);if(_0xc31f5c[_0x1f4db8(0x12e)]())return _0x167b65[_0x1f4db8(0xf0)](issue(_0x1f4db8(0xf3),_0x1f4db8(0xfa),SKILL_FILE,_0x1f4db8(0xff),_0x1f4db8(0x12d))),undefined;if(!_0xc31f5c[_0x1f4db8(0x142)]())return _0x167b65[_0x1f4db8(0xf0)](issue(_0x1f4db8(0xf3),_0x1f4db8(0xfa),SKILL_FILE,_0x1f4db8(0xed),_0x1f4db8(0x132))),undefined;return{'path':SKILL_FILE,'content':readFileSync(_0x3a10f7,'utf8')};}function validateFrontmatter(_0x238f29,_0x1587d7,_0x5e7701){const _0x1f20e4=a55_0xed23a2;if(!_0x1587d7[_0x1f20e4(0x116)]){_0x5e7701[_0x1f20e4(0xf0)](issue(_0x1f20e4(0xf3),'frontmatter-required',_0x238f29,'SKILL.md\x20must\x20start\x20with\x20frontmatter.',_0x1f20e4(0xfd)));return;}!_0x1587d7['name']?.[_0x1f20e4(0x12c)]()&&_0x5e7701[_0x1f20e4(0xf0)](issue(_0x1f20e4(0xf3),_0x1f20e4(0x10a),_0x238f29,_0x1f20e4(0x131),_0x1f20e4(0x134))),!_0x1587d7[_0x1f20e4(0x104)]?.[_0x1f20e4(0x12c)]()&&_0x5e7701['push'](issue('error',_0x1f20e4(0x12b),_0x238f29,_0x1f20e4(0x122),_0x1f20e4(0xf6))),_0x1587d7[_0x1f20e4(0x109)]===!![]&&_0x5e7701[_0x1f20e4(0xf0)](issue(_0x1f20e4(0xf3),_0x1f20e4(0x13e),_0x238f29,_0x1f20e4(0x10c),'Remove\x20metadata.internal\x20or\x20set\x20it\x20to\x20false\x20before\x20running\x20skill\x20push.')),_0x1587d7[_0x1f20e4(0x12f)]?.[_0x1f20e4(0x12c)]()&&!SUPPORTED_SKILL_TYPES[_0x1f20e4(0x110)](_0x1587d7[_0x1f20e4(0x12f)])&&_0x5e7701[_0x1f20e4(0xf0)](issue(_0x1f20e4(0xf3),'frontmatter-required',_0x238f29,_0x1f20e4(0x107),_0x1f20e4(0xec)));}function validateRuntimeCliReferences(_0x2a234f,_0x469ec5){const _0x4bbe11=a55_0xed23a2;for(const _0x2251b3 of findRabetbaseCliInvocations(_0x2a234f)){_0x469ec5['push'](issue(_0x4bbe11(0xf7),'rabetbase-cli-reference',_0x2251b3[_0x4bbe11(0xf1)],_0x4bbe11(0xf8),_0x4bbe11(0x13b),'L'+_0x2251b3[_0x4bbe11(0xfc)]));}}function findRabetbaseCliInvocations(_0x4ceb0f){const _0xbb8e=a55_0xed23a2;return scanSkillDirectory(_0x4ceb0f)[_0xbb8e(0xf5)](_0x126f24=>TEXT_SKILL_FILE_PATTERN[_0xbb8e(0xee)](_0x126f24['path']))[_0xbb8e(0x13d)](_0x123902=>{const _0x555232=_0xbb8e,_0x266711=fileText(_0x123902);return _0x266711[_0x555232(0x10b)](/\r?\n/)[_0x555232(0x112)]((_0x57ebc1,_0x270a15)=>({'file':_0x123902[_0x555232(0x11d)],'line':_0x270a15+0x1,'text':_0x57ebc1}))[_0x555232(0xf5)](({text:_0x1d5ac1})=>isRabetbaseCliInvocation(_0x1d5ac1))['map'](({file:_0x113007,line:_0x1b1d67})=>({'file':_0x113007,'line':_0x1b1d67}));});}const RABETBASE_SUBCOMMANDS=[a55_0xed23a2(0x10f),a55_0xed23a2(0x138),a55_0xed23a2(0x11e),a55_0xed23a2(0x11b),'project',a55_0xed23a2(0xef),a55_0xed23a2(0x119),'service',a55_0xed23a2(0x101),'kb',a55_0xed23a2(0x103),a55_0xed23a2(0x13c),a55_0xed23a2(0x139),'auth','logs',a55_0xed23a2(0x115)],RABETBASE_INVOCATION=new RegExp(String[a55_0xed23a2(0x114)]`\brabetbase\s+(?:${RABETBASE_SUBCOMMANDS[a55_0xed23a2(0x125)]('|')})\b`+String[a55_0xed23a2(0x114)]`(?:\s+[a-z][\w-]*){0,2}\s+(?:--?[a-z]|[\w.-]+=)`,'i');function isRabetbaseCliInvocation(_0x2ed7e7){const _0x385015=a55_0xed23a2,_0x57e84a=_0x2ed7e7[_0x385015(0x123)](/\brabetbase\b/i);if(_0x57e84a<0x0)return![];const _0x3605c8=_0x2ed7e7[_0x385015(0x10e)](_0x57e84a)['split'](/\blovrabet\b/i)[0x0]??'';return RABETBASE_INVOCATION[_0x385015(0xee)](_0x3605c8);}function parseFrontmatter(_0x32b318){const _0x1caa91=a55_0xed23a2,_0x361e33=_0x32b318[_0x1caa91(0x105)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x361e33)return{'hasFrontmatter':![]};const _0x3ee600=_0x361e33[0x1]??'',_0x41e455={'hasFrontmatter':!![]};let _0x1eb34b;try{_0x1eb34b=a55_0x4affea(_0x3ee600);}catch{return _0x41e455;}const _0x331a5d=asRecord(_0x1eb34b);if(!_0x331a5d)return _0x41e455;_0x41e455[_0x1caa91(0x120)]=scalarToString(_0x331a5d[_0x1caa91(0x120)]),_0x41e455[_0x1caa91(0x104)]=scalarToString(_0x331a5d[_0x1caa91(0x104)]);const _0x5df6f4=asRecord(_0x331a5d[_0x1caa91(0x108)]);return _0x5df6f4&&(_0x41e455[_0x1caa91(0x12f)]=scalarToString(_0x5df6f4[_0x1caa91(0x12f)]),_0x41e455['internal']=scalarToBoolean(_0x5df6f4[_0x1caa91(0x109)])),_0x41e455;}function asRecord(_0x4ec9ec){const _0x51ffc3=a55_0xed23a2;if(_0x4ec9ec&&typeof _0x4ec9ec==='object'&&!Array[_0x51ffc3(0x11a)](_0x4ec9ec))return _0x4ec9ec;return undefined;}function a55_0xa75b(){const _0x35cf0f=['Add\x20SKILL.md\x20at\x20the\x20Skill\x20directory\x20root.','suggestion','sql','data','length','If\x20this\x20is\x20a\x20runtime\x20step,\x20replace\x20it\x20with\x20the\x20equivalent\x20lovrabet\x20command.\x20Dev-time\x20discovery\x20or\x20handoff\x20notes\x20can\x20stay.','workspace','flatMap','internal-skill','342690cWfLvQ','true','validation','isFile','Missing\x20SKILL.md.','Set\x20metadata.type\x20to\x20write,\x20read,\x20or\x20trainer.','SKILL.md\x20is\x20not\x20a\x20file.','test','app','push','file','toLowerCase','error','errors','filter','填写模型触发语义:用户在什么场景应使用本\x20Skill、不要使用的边界和关键词。','warning','This\x20line\x20invokes\x20the\x20rabetbase\x20CLI.\x20rabetbase\x20is\x20a\x20dev-time\x20tool;\x20runtime\x20Skills\x20should\x20drive\x20runtime\x20work\x20through\x20lovrabet\x20commands.','SKILL.md','structure-complete','level','line','Add\x20frontmatter\x20with\x20name\x20and\x20description.','ruleId','SKILL.md\x20must\x20be\x20a\x20regular\x20file.','216apkGUe','artifact','read','config','description','match','60QsiRzS','metadata.type\x20must\x20be\x20one\x20of\x20write,\x20read,\x20or\x20trainer.','metadata','internal','frontmatter-required','split','metadata.internal=true\x20Skills\x20cannot\x20be\x20uploaded.','string','slice','dataset','has','isDirectory','map','false','raw','registry','hasFrontmatter','43461YSSipd','740bPtMGJ','schema','isArray','page','section','path','bff','content','name','trainer','Frontmatter\x20description\x20is\x20empty.','search','33873wMIWBy','join','2711159MIhIfd','24256BAJeQa','752435fpZvFL','Skill\x20validation\x20failed:\x0a','58tGKUYH','description-required','trim','Replace\x20the\x20symlink\x20with\x20a\x20regular\x20SKILL.md\x20file\x20inside\x20the\x20Skill\x20directory.','isSymbolicLink','type','Skill\x20directory\x20not\x20found:\x20','Frontmatter\x20name\x20is\x20missing.','Add\x20SKILL.md\x20as\x20a\x20regular\x20file\x20at\x20the\x20Skill\x20directory\x20root.','2613PGfgTb','Set\x20name\x20to\x20the\x20Skill\x20directory\x20code.','boolean'];a55_0xa75b=function(){return _0x35cf0f;};return a55_0xa75b();}function scalarToString(_0x53c4d1){const _0x28632d=a55_0xed23a2;if(typeof _0x53c4d1==='string')return _0x53c4d1[_0x28632d(0x12c)]();if(typeof _0x53c4d1==='number'||typeof _0x53c4d1===_0x28632d(0x135))return String(_0x53c4d1);return undefined;}function scalarToBoolean(_0x7016de){const _0x1e62a3=a55_0xed23a2;if(typeof _0x7016de===_0x1e62a3(0x135))return _0x7016de;if(typeof _0x7016de===_0x1e62a3(0x10d))return cleanBoolean(_0x7016de);return undefined;}function cleanBoolean(_0x34c813){const _0x2143c0=a55_0xed23a2,_0x468197=_0x34c813[_0x2143c0(0x12c)]()[_0x2143c0(0xf2)]();if(_0x468197===_0x2143c0(0x140))return!![];if(_0x468197===_0x2143c0(0x113))return![];return undefined;}function issue(_0x20d354,_0x5e97cd,_0x4826d4,_0x388efe,_0x26a62,_0x507336){return{'level':_0x20d354,'ruleId':_0x5e97cd,'file':_0x4826d4,'section':_0x507336,'message':_0x388efe,'suggestion':_0x26a62};}
|
|
1
|
+
const a55_0xe32659=a55_0x4061;(function(_0x4d2ed3,_0x22b72c){const _0x1c3423=a55_0x4061,_0x2ceb52=_0x4d2ed3();while(!![]){try{const _0xc1898f=parseInt(_0x1c3423(0x106))/0x1+-parseInt(_0x1c3423(0x130))/0x2*(-parseInt(_0x1c3423(0x12c))/0x3)+-parseInt(_0x1c3423(0x126))/0x4+parseInt(_0x1c3423(0x101))/0x5+-parseInt(_0x1c3423(0x11f))/0x6+-parseInt(_0x1c3423(0x105))/0x7*(parseInt(_0x1c3423(0xfd))/0x8)+-parseInt(_0x1c3423(0x104))/0x9;if(_0xc1898f===_0x22b72c)break;else _0x2ceb52['push'](_0x2ceb52['shift']());}catch(_0x2f0982){_0x2ceb52['push'](_0x2ceb52['shift']());}}}(a55_0x2ffc,0x63bfa));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{resolve}from'node:path';import{parse as a55_0x1f7417}from'yaml';import{CliErrors}from'../../errors.js';import{fileText,scanSkillDirectory}from'../../skills/runtime-skill-sync/local-files.js';function a55_0x4061(_0x24dab7,_0x37ebde){_0x24dab7=_0x24dab7-0xf9;const _0x2ffc1e=a55_0x2ffc();let _0x4061c3=_0x2ffc1e[_0x24dab7];return _0x4061c3;}const SKILL_FILE=a55_0xe32659(0xfe),SUPPORTED_SKILL_TYPES=new Set([a55_0xe32659(0x12a),a55_0xe32659(0x12f),a55_0xe32659(0x133)]),TEXT_SKILL_FILE_PATTERN=/(?:^SKILL\.md$|\.(?:md|mdx|txt|json|ya?ml|js|mjs|cjs|ts|tsx|sh|sql))$/i;function a55_0x2ffc(){const _0x4443cc=['metadata.internal=true\x20Skills\x20cannot\x20be\x20uploaded.','filter','section','validation','description','trim','registry','ruleId','flatMap','internal','raw','填写模型触发语义:用户在什么场景应使用本\x20Skill、不要使用的边界和关键词。','toUpperCase','sql','isDirectory','Frontmatter\x20description\x20is\x20empty.','page','string','join','SKILL.md\x20must\x20start\x20with\x20frontmatter.','false','description-required','isFile','name','path','service','144NOmRRm','SKILL.md','workspace','app','1857200ArJdMi','slice','number','3142926MtQscC','101234NbnWYZ','153442hyGJaF','SKILL.md\x20is\x20not\x20a\x20file.','test','errors','Set\x20metadata.type\x20to\x20write,\x20read,\x20or\x20trainer.','has','push','message','rabetbase-cli-reference','Skill\x20validation\x20failed:\x0a','search','structure-complete','data','error','Missing\x20SKILL.md.','boolean','project','Skill\x20directory\x20not\x20found:\x20','config','utf8','isSymbolicLink','frontmatter-required','dataset','map','file','284916uTjiLH','metadata','warning','toLowerCase','Replace\x20the\x20symlink\x20with\x20a\x20regular\x20SKILL.md\x20file\x20inside\x20the\x20Skill\x20directory.','content','split','484960FAirQg','object','isArray','bff','write','Add\x20frontmatter\x20with\x20name\x20and\x20description.','12zBueoD','Add\x20SKILL.md\x20as\x20a\x20regular\x20file\x20at\x20the\x20Skill\x20directory\x20root.','level','read','330972qnSyPu','Fix\x20the\x20Skill\x20metadata\x20before\x20running\x20skill\x20push.','artifact','trainer','hasFrontmatter','true','type'];a55_0x2ffc=function(){return _0x4443cc;};return a55_0x2ffc();}export function validateSkillDirectory(_0x4c774b,_0x4babca={}){const _0x33fb4b=a55_0xe32659,_0x385dc7=resolveSkillDirectoryRoot(_0x4c774b),_0x443d34=[],_0x10fc6b=loadRequiredSkillFile(_0x385dc7,_0x443d34),_0x16c88a=_0x10fc6b?parseFrontmatter(_0x10fc6b[_0x33fb4b(0x124)]):{'hasFrontmatter':![]};_0x10fc6b&&validateFrontmatter(_0x10fc6b['path'],_0x16c88a,_0x443d34);validateRuntimeCliReferences(_0x385dc7,_0x443d34);const _0x3bfbbe=_0x443d34['filter'](_0x44f240=>_0x44f240[_0x33fb4b(0x12e)]===_0x33fb4b(0x113)),_0x253a4d=_0x443d34[_0x33fb4b(0x138)](_0x3945c5=>_0x3945c5['level']===_0x33fb4b(0x121));return{'ok':_0x3bfbbe['length']===0x0,'dir':_0x385dc7,'type':_0x16c88a[_0x33fb4b(0x136)],'errors':_0x3bfbbe,'warnings':_0x253a4d};}function resolveSkillDirectoryRoot(_0x333254){const _0x1f6084=a55_0xe32659,_0x20b3ca=resolve(_0x333254);if(!existsSync(_0x20b3ca))throw CliErrors['validation'](_0x1f6084(0x117)+_0x333254);const _0x42c00b=lstatSync(_0x20b3ca);if(_0x42c00b[_0x1f6084(0x145)]())return _0x20b3ca;if(_0x42c00b[_0x1f6084(0x11a)]()){const _0xab05fd=realpathSync(_0x20b3ca);if(lstatSync(_0xab05fd)[_0x1f6084(0x145)]())return _0xab05fd;}throw CliErrors[_0x1f6084(0x13a)](_0x1f6084(0x117)+_0x333254);}export function throwIfSkillValidationFailed(_0x2456f6,_0x5cc221=![]){const _0x2da2bc=a55_0xe32659;if(_0x2456f6['ok'])return;const _0x25b861=_0x2456f6[_0x2da2bc(0x109)]['map'](_0x2bb9a7=>{const _0x4df8c4=_0x2da2bc,_0x45b445=_0x2bb9a7[_0x4df8c4(0x139)]?'#'+_0x2bb9a7[_0x4df8c4(0x139)]:'';return _0x2bb9a7[_0x4df8c4(0x12e)][_0x4df8c4(0x143)]()+'\x20'+_0x2bb9a7[_0x4df8c4(0x13e)]+'\x20'+_0x2bb9a7[_0x4df8c4(0x11e)]+_0x45b445+':\x20'+_0x2bb9a7[_0x4df8c4(0x10d)]+'\x20Fix:\x20'+_0x2bb9a7['suggestion'];});throw CliErrors[_0x2da2bc(0x13a)](_0x2da2bc(0x10f)+_0x25b861[_0x2da2bc(0x149)]('\x0a'),_0x2da2bc(0x131));}function loadRequiredSkillFile(_0x42cfc0,_0x4799c1){const _0x1a04dc=a55_0xe32659,_0x4420d1=resolve(_0x42cfc0,SKILL_FILE);if(!existsSync(_0x4420d1))return _0x4799c1[_0x1a04dc(0x10c)](issue('error','structure-complete',SKILL_FILE,_0x1a04dc(0x114),'Add\x20SKILL.md\x20at\x20the\x20Skill\x20directory\x20root.')),undefined;const _0x15184d=lstatSync(_0x4420d1);if(_0x15184d[_0x1a04dc(0x11a)]())return _0x4799c1[_0x1a04dc(0x10c)](issue(_0x1a04dc(0x113),_0x1a04dc(0x111),SKILL_FILE,'SKILL.md\x20must\x20be\x20a\x20regular\x20file.',_0x1a04dc(0x123))),undefined;if(!_0x15184d[_0x1a04dc(0xf9)]())return _0x4799c1[_0x1a04dc(0x10c)](issue(_0x1a04dc(0x113),_0x1a04dc(0x111),SKILL_FILE,_0x1a04dc(0x107),_0x1a04dc(0x12d))),undefined;return{'path':SKILL_FILE,'content':readFileSync(_0x4420d1,_0x1a04dc(0x119))};}function validateFrontmatter(_0x25fde6,_0x45d2da,_0x53f4cb){const _0x137e70=a55_0xe32659;if(!_0x45d2da[_0x137e70(0x134)]){_0x53f4cb[_0x137e70(0x10c)](issue(_0x137e70(0x113),_0x137e70(0x11b),_0x25fde6,_0x137e70(0x14a),_0x137e70(0x12b)));return;}!_0x45d2da[_0x137e70(0xfa)]?.[_0x137e70(0x13c)]()&&_0x53f4cb['push'](issue(_0x137e70(0x113),_0x137e70(0x11b),_0x25fde6,'Frontmatter\x20name\x20is\x20missing.','Set\x20name\x20to\x20the\x20Skill\x20directory\x20code.')),!_0x45d2da[_0x137e70(0x13b)]?.[_0x137e70(0x13c)]()&&_0x53f4cb[_0x137e70(0x10c)](issue(_0x137e70(0x113),_0x137e70(0x14c),_0x25fde6,_0x137e70(0x146),_0x137e70(0x142))),_0x45d2da[_0x137e70(0x140)]===!![]&&_0x53f4cb[_0x137e70(0x10c)](issue(_0x137e70(0x113),'internal-skill',_0x25fde6,_0x137e70(0x137),'Remove\x20metadata.internal\x20or\x20set\x20it\x20to\x20false\x20before\x20running\x20skill\x20push.')),_0x45d2da[_0x137e70(0x136)]?.['trim']()&&!SUPPORTED_SKILL_TYPES[_0x137e70(0x10b)](_0x45d2da[_0x137e70(0x136)])&&_0x53f4cb[_0x137e70(0x10c)](issue(_0x137e70(0x113),_0x137e70(0x11b),_0x25fde6,'metadata.type\x20must\x20be\x20one\x20of\x20write,\x20read,\x20or\x20trainer.',_0x137e70(0x10a)));}function validateRuntimeCliReferences(_0x2cf006,_0x371eb3){const _0x506486=a55_0xe32659;for(const _0xd31a8 of findRabetbaseCliInvocations(_0x2cf006)){_0x371eb3[_0x506486(0x10c)](issue(_0x506486(0x121),_0x506486(0x10e),_0xd31a8[_0x506486(0x11e)],'This\x20line\x20invokes\x20the\x20rabetbase\x20CLI.\x20rabetbase\x20is\x20a\x20dev-time\x20tool;\x20runtime\x20Skills\x20should\x20drive\x20runtime\x20work\x20through\x20lovrabet\x20commands.','If\x20this\x20is\x20a\x20runtime\x20step,\x20replace\x20it\x20with\x20the\x20equivalent\x20lovrabet\x20command.\x20Dev-time\x20discovery\x20or\x20handoff\x20notes\x20can\x20stay.','L'+_0xd31a8['line']));}}function findRabetbaseCliInvocations(_0x4f6521){const _0x1b14cb=a55_0xe32659;return scanSkillDirectory(_0x4f6521)[_0x1b14cb(0x138)](_0x1232b2=>TEXT_SKILL_FILE_PATTERN['test'](_0x1232b2[_0x1b14cb(0xfb)]))[_0x1b14cb(0x13f)](_0x40b80b=>{const _0x4f2b9a=_0x1b14cb,_0x3de0cf=fileText(_0x40b80b);return _0x3de0cf[_0x4f2b9a(0x125)](/\r?\n/)[_0x4f2b9a(0x11d)]((_0x436dde,_0x5b4b35)=>({'file':_0x40b80b[_0x4f2b9a(0xfb)],'line':_0x5b4b35+0x1,'text':_0x436dde}))['filter'](({text:_0x525048})=>isRabetbaseCliInvocation(_0x525048))[_0x4f2b9a(0x11d)](({file:_0x51bb1d,line:_0x21fc04})=>({'file':_0x51bb1d,'line':_0x21fc04}));});}const RABETBASE_SUBCOMMANDS=[a55_0xe32659(0x11c),a55_0xe32659(0x144),a55_0xe32659(0x129),a55_0xe32659(0x147),a55_0xe32659(0x116),a55_0xe32659(0x100),'schema',a55_0xe32659(0xfc),a55_0xe32659(0x132),'kb',a55_0xe32659(0x118),a55_0xe32659(0xff),a55_0xe32659(0x112),'auth','logs',a55_0xe32659(0x13d)],RABETBASE_INVOCATION=new RegExp(String[a55_0xe32659(0x141)]`\brabetbase\s+(?:${RABETBASE_SUBCOMMANDS['join']('|')})\b`+String[a55_0xe32659(0x141)]`(?:\s+[a-z][\w-]*){0,2}\s+(?:--?[a-z]|[\w.-]+=)`,'i');function isRabetbaseCliInvocation(_0x8d4dac){const _0xb7ee61=a55_0xe32659,_0x21abac=_0x8d4dac[_0xb7ee61(0x110)](/\brabetbase\b/i);if(_0x21abac<0x0)return![];const _0x33dbdc=_0x8d4dac[_0xb7ee61(0x102)](_0x21abac)[_0xb7ee61(0x125)](/\blovrabet\b/i)[0x0]??'';return RABETBASE_INVOCATION[_0xb7ee61(0x108)](_0x33dbdc);}function parseFrontmatter(_0x34d415){const _0x53e5a6=a55_0xe32659,_0x5e15d4=_0x34d415['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5e15d4)return{'hasFrontmatter':![]};const _0x4e8d35=_0x5e15d4[0x1]??'',_0x3d8ba8={'hasFrontmatter':!![]};let _0x4d1bfd;try{_0x4d1bfd=a55_0x1f7417(_0x4e8d35);}catch{return _0x3d8ba8;}const _0x106117=asRecord(_0x4d1bfd);if(!_0x106117)return _0x3d8ba8;_0x3d8ba8[_0x53e5a6(0xfa)]=scalarToString(_0x106117[_0x53e5a6(0xfa)]),_0x3d8ba8['description']=scalarToString(_0x106117[_0x53e5a6(0x13b)]);const _0x3a9d17=asRecord(_0x106117[_0x53e5a6(0x120)]);return _0x3a9d17&&(_0x3d8ba8['type']=scalarToString(_0x3a9d17['type']),_0x3d8ba8['internal']=scalarToBoolean(_0x3a9d17[_0x53e5a6(0x140)])),_0x3d8ba8;}function asRecord(_0x1380f4){const _0x26c45c=a55_0xe32659;if(_0x1380f4&&typeof _0x1380f4===_0x26c45c(0x127)&&!Array[_0x26c45c(0x128)](_0x1380f4))return _0x1380f4;return undefined;}function scalarToString(_0x8c4c98){const _0x2ede64=a55_0xe32659;if(typeof _0x8c4c98===_0x2ede64(0x148))return _0x8c4c98[_0x2ede64(0x13c)]();if(typeof _0x8c4c98===_0x2ede64(0x103)||typeof _0x8c4c98===_0x2ede64(0x115))return String(_0x8c4c98);return undefined;}function scalarToBoolean(_0x3fc4c6){if(typeof _0x3fc4c6==='boolean')return _0x3fc4c6;if(typeof _0x3fc4c6==='string')return cleanBoolean(_0x3fc4c6);return undefined;}function cleanBoolean(_0x16946a){const _0x2434d4=a55_0xe32659,_0x279df5=_0x16946a['trim']()[_0x2434d4(0x122)]();if(_0x279df5===_0x2434d4(0x135))return!![];if(_0x279df5===_0x2434d4(0x14b))return![];return undefined;}function issue(_0x37faa1,_0x14b65d,_0x8ddcf1,_0x1ebab3,_0x1c92f3,_0x29e626){return{'level':_0x37faa1,'ruleId':_0x14b65d,'file':_0x8ddcf1,'section':_0x29e626,'message':_0x1ebab3,'suggestion':_0x1c92f3};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a56_0x4aa5(){const _0x369c29=['12PhTybZ','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','description','25850vQHeoy','verbose','sqlName','read','detail','553iLvgcw','1487580aGEadd','sqlContent','2484LJLALh','4483HwOnDs','bool','sqlCode','28064FLeBRz','77795FaYcgW','850RJaqQj','124ueXwPA','30ulzUEi','15641964qzViBt','sql','dbId','564jVrDAv','appCode'];a56_0x4aa5=function(){return _0x369c29;};return a56_0x4aa5();}const a56_0x1bc461=a56_0x25b3;(function(_0x474b46,_0x39c609){const _0xedb224=a56_0x25b3,_0x3a4039=_0x474b46();while(!![]){try{const _0x4dcc36=parseInt(_0xedb224(0xa5))/0x1*(parseInt(_0xedb224(0xac))/0x2)+-parseInt(_0xedb224(0xa2))/0x3+parseInt(_0xedb224(0xab))/0x4*(parseInt(_0xedb224(0xa9))/0x5)+parseInt(_0xedb224(0xb0))/0x6*(parseInt(_0xedb224(0xa1))/0x7)+parseInt(_0xedb224(0xa8))/0x8*(-parseInt(_0xedb224(0xa4))/0x9)+-parseInt(_0xedb224(0xaa))/0xa*(-parseInt(_0xedb224(0xb5))/0xb)+parseInt(_0xedb224(0xb2))/0xc*(parseInt(_0xedb224(0xad))/0xd);if(_0x4dcc36===_0x39c609)break;else _0x3a4039['push'](_0x3a4039['shift']());}catch(_0x38be1b){_0x3a4039['push'](_0x3a4039['shift']());}}}(a56_0x4aa5,0x79126));import{getSqlQueryInfo}from'../../core/api-client.js';function a56_0x25b3(_0x2eae34,_0x30d8ee){_0x2eae34=_0x2eae34-0xa1;const _0x4aa5f1=a56_0x4aa5();let _0x25b369=_0x4aa5f1[_0x2eae34];return _0x25b369;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a56_0x1bc461(0xae),'command':a56_0x1bc461(0xb9),'description':a56_0x1bc461(0xb3),'risk':a56_0x1bc461(0xb8),'flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x4e87e0){const _0x352c89=a56_0x1bc461,_0x18194b=await getSqlQueryInfo(_0x4e87e0[_0x352c89(0xb1)],_0x4e87e0['str']('sqlcode')),_0x2aee24=_0x4e87e0[_0x352c89(0xa6)](_0x352c89(0xb6));if(_0x2aee24)return{'ok':!![],'data':_0x18194b};const _0x5969dd=_0x18194b[_0x352c89(0xaf)]?await getDbName(_0x4e87e0['appCode'],_0x18194b[_0x352c89(0xaf)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x18194b[_0x352c89(0xa7)],'sqlName':_0x18194b[_0x352c89(0xb7)],'db':_0x5969dd?_0x5969dd+'\x20('+_0x18194b[_0x352c89(0xaf)]+')':_0x18194b[_0x352c89(0xaf)]??'','description':_0x18194b[_0x352c89(0xb4)]??'','sqlContent':_0x18194b[_0x352c89(0xa3)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a57_0x3c03(_0x54e196,_0x5b4797){_0x54e196=_0x54e196-0x101;const _0x364512=a57_0x3645();let _0x3c03ab=_0x364512[_0x54e196];return _0x3c03ab;}const a57_0x69d26a=a57_0x3c03;(function(_0x4d3859,_0x31521c){const _0x56834c=a57_0x3c03,_0x94c18a=_0x4d3859();while(!![]){try{const _0x43df9f=-parseInt(_0x56834c(0x10e))/0x1*(parseInt(_0x56834c(0x109))/0x2)+parseInt(_0x56834c(0x10b))/0x3+parseInt(_0x56834c(0x10a))/0x4*(-parseInt(_0x56834c(0x103))/0x5)+-parseInt(_0x56834c(0x107))/0x6+-parseInt(_0x56834c(0x108))/0x7+-parseInt(_0x56834c(0x116))/0x8*(-parseInt(_0x56834c(0x10c))/0x9)+-parseInt(_0x56834c(0x102))/0xa*(-parseInt(_0x56834c(0x106))/0xb);if(_0x43df9f===_0x31521c)break;else _0x94c18a['push'](_0x94c18a['shift']());}catch(_0x16918a){_0x94c18a['push'](_0x94c18a['shift']());}}}(a57_0x3645,0xde4a4));import{executeSdkSql}from'../../core/sdk-client.js';function a57_0x3645(){const _0x1e9008=['sql','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','exec','execError','5288jijmUH','sqlcode','isArray','execSuccess','38670XrnbGS','9795MdIYnr','Returned\x20','SQL\x20execution\x20failed','5115TjYqNY','3223872VRMPMF','3319582pyZBXK','2239726zVxexY','428jHAnRQ','2143083jEahAw','10062OMLufh','now','1WSVCrc','read','length','str'];a57_0x3645=function(){return _0x1e9008;};return a57_0x3645();}import{SQLCODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a57_0x69d26a(0x112),'command':a57_0x69d26a(0x114),'description':a57_0x69d26a(0x113),'risk':a57_0x69d26a(0x10f),'flags':[SQLCODE_FLAG,PARAMS_FLAG],async 'execute'(_0x242c08){const _0x480294=a57_0x69d26a,_0x4141e2=parseJsonParams(_0x242c08[_0x480294(0x111)]('params')),_0x267f36=Date[_0x480294(0x10d)](),_0x430bef=await executeSdkSql(_0x242c08[_0x480294(0x111)](_0x480294(0x117)),_0x4141e2),_0x7e3d11=Date[_0x480294(0x10d)]()-_0x267f36,_0x148a07=_0x430bef?.['execResult']??_0x430bef,_0x1c23c4=_0x430bef?.[_0x480294(0x101)]??!![];if(!_0x1c23c4)return{'ok':![],'data':{'error':_0x430bef?.[_0x480294(0x115)]||_0x480294(0x105),'elapsed':_0x7e3d11},'message':_0x480294(0x105)};const _0x23f8b0=Array[_0x480294(0x118)](_0x148a07)?_0x148a07:[];return{'ok':!![],'data':{'rows':_0x23f8b0,'rowCount':_0x23f8b0['length'],'elapsed':_0x7e3d11},'message':_0x480294(0x104)+_0x23f8b0[_0x480294(0x110)]+'\x20row(s)\x20in\x20'+_0x7e3d11+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a58_0x3328(_0x4716fb,_0x4f11b0){_0x4716fb=_0x4716fb-0x1f2;const _0x3b08b0=a58_0x3b08();let _0x332848=_0x3b08b0[_0x4716fb];return _0x332848;}(function(_0x2558a3,_0x575cab){const _0x4ab589=a58_0x3328,_0x21795f=_0x2558a3();while(!![]){try{const _0x3d95b4=-parseInt(_0x4ab589(0x1f2))/0x1*(-parseInt(_0x4ab589(0x1f5))/0x2)+parseInt(_0x4ab589(0x1fb))/0x3+parseInt(_0x4ab589(0x1f9))/0x4+parseInt(_0x4ab589(0x1fa))/0x5*(parseInt(_0x4ab589(0x1f8))/0x6)+parseInt(_0x4ab589(0x1f6))/0x7+parseInt(_0x4ab589(0x1fc))/0x8*(-parseInt(_0x4ab589(0x1f7))/0x9)+-parseInt(_0x4ab589(0x1f4))/0xa*(parseInt(_0x4ab589(0x1f3))/0xb);if(_0x3d95b4===_0x575cab)break;else _0x21795f['push'](_0x21795f['shift']());}catch(_0x39d0bf){_0x21795f['push'](_0x21795f['shift']());}}}(a58_0x3b08,0xa85db));import{sqlDetail}from'../../commands/sql/detail.js';function a58_0x3b08(){const _0x2d6185=['480ngrouw','2356974gminky','7192XcKajO','39209iQTiDK','18049933qDEuqo','10nuolfl','4OaYPoH','4732161RpweHq','10161gCBbDs','49746AgerIo','4037864dpRotI'];a58_0x3b08=function(){return _0x2d6185;};return a58_0x3b08();}import{sqlExec}from'../../commands/sql/exec.js';export const sqlDefinitions=[sqlDetail,sqlExec];
|
package/lib/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a59_0x5d6a85=a59_0x212f;(function(_0x323458,_0x206d89){const _0x5c23c4=a59_0x212f,_0x1c0139=_0x323458();while(!![]){try{const _0x1a9ffe=-parseInt(_0x5c23c4(0x1dc))/0x1+parseInt(_0x5c23c4(0x1cc))/0x2+-parseInt(_0x5c23c4(0x1c4))/0x3+-parseInt(_0x5c23c4(0x1b9))/0x4+parseInt(_0x5c23c4(0x1dd))/0x5*(parseInt(_0x5c23c4(0x1cd))/0x6)+parseInt(_0x5c23c4(0x1cf))/0x7*(-parseInt(_0x5c23c4(0x1be))/0x8)+parseInt(_0x5c23c4(0x1c0))/0x9;if(_0x1a9ffe===_0x206d89)break;else _0x1c0139['push'](_0x1c0139['shift']());}catch(_0x4bbc08){_0x1c0139['push'](_0x1c0139['shift']());}}}(a59_0x2a63,0xd8bfa));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';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':'latest','type':'boolean','description':a59_0x5d6a85(0x1b5),'default':![]},{'name':'beta','type':'boolean','description':a59_0x5d6a85(0x1b0),'default':![]},{'name':a59_0x5d6a85(0x1e7),'type':a59_0x5d6a85(0x1a5),'description':a59_0x5d6a85(0x1da)},{'name':a59_0x5d6a85(0x1d2),'type':a59_0x5d6a85(0x1bb),'description':'Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','default':![]},{'name':a59_0x5d6a85(0x1cb),'type':a59_0x5d6a85(0x1bb),'description':'Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','default':!![],'hidden':!![]}];function parseSemver(_0x23b365){const _0x941de5=a59_0x5d6a85,_0x27e517=_0x23b365[_0x941de5(0x1b1)]()[_0x941de5(0x1c8)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x27e517)return null;return{'major':Number(_0x27e517[0x1]),'minor':Number(_0x27e517[0x2]),'patch':Number(_0x27e517[0x3]),'prerelease':_0x27e517[0x4]};}function compareSemver(_0x3ba9da,_0x7f4c14){const _0x1b86a9=a59_0x5d6a85,_0x300be6=parseSemver(_0x3ba9da),_0xab97ec=parseSemver(_0x7f4c14);if(!_0x300be6||!_0xab97ec)throw CliErrors[_0x1b86a9(0x1b6)](_0x1b86a9(0x1df),_0x1b86a9(0x1b3));for(const _0x40ebe3 of[_0x1b86a9(0x1d3),_0x1b86a9(0x1c1),'patch']){if(_0x300be6[_0x40ebe3]<_0xab97ec[_0x40ebe3])return-0x1;if(_0x300be6[_0x40ebe3]>_0xab97ec[_0x40ebe3])return 0x1;}if(!_0x300be6[_0x1b86a9(0x1c2)]&&!_0xab97ec[_0x1b86a9(0x1c2)])return 0x0;if(!_0x300be6[_0x1b86a9(0x1c2)])return 0x1;if(!_0xab97ec['prerelease'])return-0x1;if(_0x300be6[_0x1b86a9(0x1c2)]===_0xab97ec[_0x1b86a9(0x1c2)])return 0x0;return _0x300be6[_0x1b86a9(0x1c2)]<_0xab97ec[_0x1b86a9(0x1c2)]?-0x1:0x1;}function a59_0x212f(_0xf5ad4f,_0x44304d){_0xf5ad4f=_0xf5ad4f-0x19d;const _0x2a63d6=a59_0x2a63();let _0x212f17=_0x2a63d6[_0xf5ad4f];return _0x212f17;}function a59_0x2a63(){const _0x390640=['minor','prerelease','status','2132310boPJHn','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','timeout','log','match','Invalid\x20version:\x20','Update\x20failed:\x20','skills','1029516CJvskJ','12kcrZYU','length','5523sLbXxd','toString','source','no-skills','major','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(','skipped','join','Checking\x20npm\x20dist-tags...','bool','filter','Install\x20a\x20specific\x20CLI\x20version','fromEntries','1184324GxsiVj','3420620aOIEvS','inherit','Version\x20comparison\x20failed.','cwd','\x20CLI\x20from\x20npm','error','\x20version\x20from\x20npm.','run','write','unknown','version','json','stdout','stderr','pipe','map','Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.','\x20->\x20','flag','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','string','nonInteractive','/dist-tags','message','Checking\x20CLI\x20Built-in\x20Skill...','/-/package/','\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','Already\x20up\x20to\x20date\x20(v','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','entries','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','trim','install','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','=1).','Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','validation','exit\x20','--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','4131956afrUTA','beta','boolean','npm','latest','13032cizsUk','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','28963440yLFxVI'];a59_0x2a63=function(){return _0x390640;};return a59_0x2a63();}function getRequestedVersion(_0x1478e0){const _0x45876c=a59_0x5d6a85,_0xd96a20=_0x1478e0['str']('version')[_0x45876c(0x1b1)]();if(_0xd96a20)return _0xd96a20;return String(_0x1478e0['args']?.[0x0]??'')[_0x45876c(0x1b1)]();}function shouldSkipCliBuiltInSkill(_0x10be23){const _0x5dc118=a59_0x5d6a85;return _0x10be23[_0x5dc118(0x1d8)](_0x5dc118(0x1d2))||_0x10be23[_0x5dc118(0x1a3)](_0x5dc118(0x1cb))===![];}async function validateUpdateFlags(_0xf8042b){const _0x2455f1=a59_0x5d6a85,_0x3ac07d=getRequestedVersion(_0xf8042b),_0x16ec03=[_0xf8042b[_0x2455f1(0x1d8)]('latest')?'latest':'',_0xf8042b[_0x2455f1(0x1d8)](_0x2455f1(0x1ba))?_0x2455f1(0x1ba):'',_0x3ac07d?_0x2455f1(0x1e7):''][_0x2455f1(0x1d9)](Boolean);if(_0x16ec03[_0x2455f1(0x1ce)]>0x1)throw CliErrors['validation'](_0x2455f1(0x1b8),_0x2455f1(0x1a1));if(_0x3ac07d&&!parseSemver(_0x3ac07d))throw CliErrors[_0x2455f1(0x1b6)](_0x2455f1(0x1c9)+_0x3ac07d,'Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.');}async function fetchNpmDistTags(){const _0x39b844=a59_0x5d6a85;try{const _0x58c3db=NPM_REGISTRY_BASE_URL+_0x39b844(0x1aa)+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x39b844(0x1a7),_0x263486=await fetch(_0x58c3db,{'signal':AbortSignal[_0x39b844(0x1c6)](0x2710)});if(!_0x263486['ok'])return null;const _0x194035=await _0x263486[_0x39b844(0x1e8)]();if(!_0x194035||typeof _0x194035!=='object')return null;return Object[_0x39b844(0x1db)](Object[_0x39b844(0x1af)](_0x194035)['filter'](([,_0x458be1])=>typeof _0x458be1===_0x39b844(0x1a5)&&_0x458be1[_0x39b844(0x1b1)]())[_0x39b844(0x1a0)](([_0xb657ae,_0x19618b])=>[_0xb657ae,String(_0x19618b)['trim']()]));}catch{return null;}}async function resolveTargetVersion(_0x35b5da){const _0x59824c=a59_0x5d6a85,_0x11bbd8=getRequestedVersion(_0x35b5da);if(_0x11bbd8)return{'version':_0x11bbd8,'source':_0x59824c(0x1e7)};const _0x17b220=_0x35b5da['bool']('beta')?_0x59824c(0x1ba):'latest',_0xd33dd3=await fetchNpmDistTags(),_0xe44888=_0xd33dd3?.[_0x17b220];if(!_0xe44888)return null;return{'version':_0xe44888,'source':_0x17b220};}function shouldInstallTarget(_0x5724a5,_0x17c542){const _0xfa6759=a59_0x5d6a85,_0x5cb810=compareSemver(_0x5724a5,_0x17c542[_0xfa6759(0x1e7)]);if(_0x17c542['source']===_0xfa6759(0x1e7))return _0x5cb810!==0x0;return _0x5cb810<0x0;}function installCliPackage(_0x4bb51b,_0x1ba42f){const _0xb519ea=a59_0x5d6a85,_0xf3dbb3=resolveNpmBin(_0xb519ea(0x1bc)),_0xb2e79b=[_0xb519ea(0x1b2),'-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x4bb51b];console[_0xb519ea(0x1c7)]('*\x20'+[_0xf3dbb3,..._0xb2e79b][_0xb519ea(0x1d6)]('\x20'));const _0x219c1e=spawnSync(_0xf3dbb3,_0xb2e79b,{'cwd':process[_0xb519ea(0x1e0)](),'stdio':_0x1ba42f?_0xb519ea(0x19f):_0xb519ea(0x1de),'env':process.env,'shell':![]});if(_0x219c1e[_0xb519ea(0x1c3)]===0x0)return{'ok':!![]};let _0x39ca74=_0x219c1e[_0xb519ea(0x1e2)]?.[_0xb519ea(0x1a8)]||_0xb519ea(0x1b7)+(_0x219c1e['status']??'unknown');if(_0x1ba42f){const _0x22bdd7=_0x219c1e[_0xb519ea(0x19e)]?_0x219c1e[_0xb519ea(0x19e)][_0xb519ea(0x1d0)]()['trim']():'',_0x555df4=_0x219c1e[_0xb519ea(0x19d)]?_0x219c1e[_0xb519ea(0x19d)]['toString']()[_0xb519ea(0x1b1)]():'';if(_0x22bdd7)_0x39ca74=_0x22bdd7;else{if(_0x555df4)_0x39ca74=_0x555df4;}}return{'ok':![],'error':_0x39ca74};}async function installCliBuiltInSkill(_0xc886ff){const _0x262c79=a59_0x5d6a85;console['log'](_0x262c79(0x1a9));const _0x33afe4=runNpxSkillsAddGlobal(process[_0x262c79(0x1e0)](),LOVRABET_SKILL_SOURCE,{'stdio':_0xc886ff?_0x262c79(0x19f):_0x262c79(0x1de)});if(_0x33afe4[_0x262c79(0x1d5)]){console[_0x262c79(0x1c7)](_0x262c79(0x1d4)+LOVRABET_SKIP_NPX_SKILLS_ENV+_0x262c79(0x1b4));return;}if(_0x33afe4['ok']){console[_0x262c79(0x1c7)](_0x262c79(0x1a4));return;}console['warn'](_0x262c79(0x1c5)+(_0x33afe4[_0x262c79(0x1e2)]||_0x262c79(0x1e6))),console[_0x262c79(0x1c7)]('\x20\x20Run\x20manually:\x20lovrabet\x20cli-skill\x20install');}async function execute(_0x4ac270){const _0x419dd6=a59_0x5d6a85;await validateUpdateFlags(_0x4ac270);const _0x2e1188=getCliVersion();console[_0x419dd6(0x1c7)]('Current\x20version:\x20'+_0x2e1188),console[_0x419dd6(0x1c7)](_0x419dd6(0x1d7));const _0x595832=await resolveTargetVersion(_0x4ac270);if(!_0x595832){const _0x4a9586=_0x4ac270[_0x419dd6(0x1d8)](_0x419dd6(0x1ba))?_0x419dd6(0x1ba):_0x419dd6(0x1bd),_0x7dad5b='Unable\x20to\x20resolve\x20'+_0x4a9586+_0x419dd6(0x1e3);return console['warn'](_0x7dad5b),console[_0x419dd6(0x1c7)](_0x419dd6(0x1bf)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x4a9586),{'ok':![]};}if(!shouldInstallTarget(_0x2e1188,_0x595832)){const _0x24881d=_0x595832[_0x419dd6(0x1d1)]===_0x419dd6(0x1e7)?'Already\x20on\x20requested\x20version\x20(v'+_0x595832[_0x419dd6(0x1e7)]+').':_0x419dd6(0x1ad)+_0x595832[_0x419dd6(0x1e7)]+').';return console[_0x419dd6(0x1c7)](_0x24881d),shouldSkipCliBuiltInSkill(_0x4ac270)?console['log'](_0x419dd6(0x1ae)):await installCliBuiltInSkill(_0x4ac270[_0x419dd6(0x1a6)]),{'ok':!![]};}console[_0x419dd6(0x1c7)]('Updating\x20'+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x2e1188+_0x419dd6(0x1a2)+_0x595832['version']);const _0x2e15d0=installCliPackage(_0x595832[_0x419dd6(0x1e7)],_0x4ac270[_0x419dd6(0x1a6)]);if(!_0x2e15d0['ok']){const _0x1d8900=_0x419dd6(0x1ca)+(_0x2e15d0[_0x419dd6(0x1e2)]||_0x419dd6(0x1e6));return console['error'](_0x1d8900),console[_0x419dd6(0x1c7)](_0x419dd6(0x1ab)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x595832[_0x419dd6(0x1e7)]),{'ok':![]};}return console[_0x419dd6(0x1c7)]('Updated\x20to\x20v'+_0x595832['version']+'.'),console[_0x419dd6(0x1c7)](_0x419dd6(0x1ac)),shouldSkipCliBuiltInSkill(_0x4ac270)?console['log'](_0x419dd6(0x1ae)):await installCliBuiltInSkill(_0x4ac270[_0x419dd6(0x1a6)]),{'ok':!![]};}export const updateDefinition={'service':'update','command':a59_0x5d6a85(0x1e4),'description':'Update\x20'+CLI_BIN_NAME+a59_0x5d6a85(0x1e1),'risk':a59_0x5d6a85(0x1e5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a59_0x9d1f70=a59_0x4628;(function(_0x37d7f7,_0x266c30){const _0x282adc=a59_0x4628,_0x5af306=_0x37d7f7();while(!![]){try{const _0x11bd0c=-parseInt(_0x282adc(0x21c))/0x1*(-parseInt(_0x282adc(0x1ee))/0x2)+-parseInt(_0x282adc(0x1e6))/0x3*(-parseInt(_0x282adc(0x1d9))/0x4)+-parseInt(_0x282adc(0x1e7))/0x5+-parseInt(_0x282adc(0x1fe))/0x6*(-parseInt(_0x282adc(0x20b))/0x7)+parseInt(_0x282adc(0x201))/0x8+parseInt(_0x282adc(0x210))/0x9+-parseInt(_0x282adc(0x21a))/0xa;if(_0x11bd0c===_0x266c30)break;else _0x5af306['push'](_0x5af306['shift']());}catch(_0x4b7e57){_0x5af306['push'](_0x5af306['shift']());}}}(a59_0x41b2,0x4ac7d));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';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';function a59_0x4628(_0x39b69f,_0x964ae1){_0x39b69f=_0x39b69f-0x1cf;const _0x41b200=a59_0x41b2();let _0x462860=_0x41b200[_0x39b69f];return _0x462860;}const updateFlags=[{'name':a59_0x9d1f70(0x205),'type':'boolean','description':a59_0x9d1f70(0x1e0),'default':![]},{'name':a59_0x9d1f70(0x204),'type':'boolean','description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':a59_0x9d1f70(0x1db),'type':a59_0x9d1f70(0x1e4),'description':a59_0x9d1f70(0x216)},{'name':a59_0x9d1f70(0x1ea),'type':a59_0x9d1f70(0x20c),'description':a59_0x9d1f70(0x21b),'default':![]},{'name':'skills','type':a59_0x9d1f70(0x20c),'description':a59_0x9d1f70(0x1d0),'default':!![],'hidden':!![]}];function parseSemver(_0x204a91){const _0x4c8635=a59_0x9d1f70,_0x4d66f2=_0x204a91[_0x4c8635(0x1d1)]()[_0x4c8635(0x1e9)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x4d66f2)return null;return{'major':Number(_0x4d66f2[0x1]),'minor':Number(_0x4d66f2[0x2]),'patch':Number(_0x4d66f2[0x3]),'prerelease':_0x4d66f2[0x4]};}function compareSemver(_0x4173a2,_0x3eac24){const _0xce4035=a59_0x9d1f70,_0x2f6385=parseSemver(_0x4173a2),_0xfe7ac1=parseSemver(_0x3eac24);if(!_0x2f6385||!_0xfe7ac1)throw CliErrors[_0xce4035(0x1df)](_0xce4035(0x1d2),'Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.');for(const _0x2d663c of[_0xce4035(0x1f2),_0xce4035(0x203),_0xce4035(0x208)]){if(_0x2f6385[_0x2d663c]<_0xfe7ac1[_0x2d663c])return-0x1;if(_0x2f6385[_0x2d663c]>_0xfe7ac1[_0x2d663c])return 0x1;}if(!_0x2f6385[_0xce4035(0x1f0)]&&!_0xfe7ac1[_0xce4035(0x1f0)])return 0x0;if(!_0x2f6385[_0xce4035(0x1f0)])return 0x1;if(!_0xfe7ac1['prerelease'])return-0x1;if(_0x2f6385['prerelease']===_0xfe7ac1[_0xce4035(0x1f0)])return 0x0;return _0x2f6385['prerelease']<_0xfe7ac1[_0xce4035(0x1f0)]?-0x1:0x1;}function getRequestedVersion(_0x4d0128){const _0xb12b35=a59_0x9d1f70,_0x5485e0=_0x4d0128[_0xb12b35(0x1fc)](_0xb12b35(0x1db))[_0xb12b35(0x1d1)]();if(_0x5485e0)return _0x5485e0;return String(_0x4d0128['args']?.[0x0]??'')[_0xb12b35(0x1d1)]();}function shouldSkipCliBuiltInSkill(_0x15522c){const _0x286b51=a59_0x9d1f70;return _0x15522c['bool']('no-skills')||_0x15522c[_0x286b51(0x1d8)](_0x286b51(0x1e5))===![];}async function validateUpdateFlags(_0xe21c1){const _0x1350de=a59_0x9d1f70,_0x3e356a=getRequestedVersion(_0xe21c1),_0x534bb6=[_0xe21c1[_0x1350de(0x215)](_0x1350de(0x205))?'latest':'',_0xe21c1[_0x1350de(0x215)](_0x1350de(0x204))?_0x1350de(0x204):'',_0x3e356a?_0x1350de(0x1db):'']['filter'](Boolean);if(_0x534bb6[_0x1350de(0x1f4)]>0x1)throw CliErrors[_0x1350de(0x1df)](_0x1350de(0x20f),'Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.');if(_0x3e356a&&!parseSemver(_0x3e356a))throw CliErrors[_0x1350de(0x1df)](_0x1350de(0x212)+_0x3e356a,'Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.');}async function fetchNpmDistTags(){const _0x524855=a59_0x9d1f70;try{const _0x4c514e=NPM_REGISTRY_BASE_URL+_0x524855(0x20a)+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x524855(0x1f6),_0xaf7587=await fetch(_0x4c514e,{'signal':AbortSignal['timeout'](0x2710)});if(!_0xaf7587['ok'])return null;const _0xfd7a9c=await _0xaf7587['json']();if(!_0xfd7a9c||typeof _0xfd7a9c!=='object')return null;return Object[_0x524855(0x1f5)](Object[_0x524855(0x1d4)](_0xfd7a9c)[_0x524855(0x1e8)](([,_0x115e4b])=>typeof _0x115e4b===_0x524855(0x1e4)&&_0x115e4b[_0x524855(0x1d1)]())[_0x524855(0x1e3)](([_0x30bd1f,_0x4ac279])=>[_0x30bd1f,String(_0x4ac279)[_0x524855(0x1d1)]()]));}catch{return null;}}async function resolveTargetVersion(_0x297f9e){const _0x34fdf3=a59_0x9d1f70,_0x359698=getRequestedVersion(_0x297f9e);if(_0x359698)return{'version':_0x359698,'source':_0x34fdf3(0x1db)};const _0x1e83f3=_0x297f9e['bool'](_0x34fdf3(0x204))?_0x34fdf3(0x204):_0x34fdf3(0x205),_0x136682=await fetchNpmDistTags(),_0x368257=_0x136682?.[_0x1e83f3];if(!_0x368257)return null;return{'version':_0x368257,'source':_0x1e83f3};}function shouldInstallTarget(_0x515c73,_0x50f2d4){const _0x7b9d88=a59_0x9d1f70,_0x5d2f9b=compareSemver(_0x515c73,_0x50f2d4[_0x7b9d88(0x1db)]);if(_0x50f2d4[_0x7b9d88(0x1f1)]===_0x7b9d88(0x1db))return _0x5d2f9b!==0x0;return _0x5d2f9b<0x0;}function installCliPackage(_0x416833,_0x529bcb){const _0x317e73=a59_0x9d1f70,_0x32bf06=resolveNpmBin(_0x317e73(0x1e2)),_0x3f5d5e=[_0x317e73(0x211),'-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x416833];console[_0x317e73(0x200)]('*\x20'+[_0x32bf06,..._0x3f5d5e][_0x317e73(0x1ef)]('\x20'));const _0x4bb6a9=spawnSync(_0x32bf06,_0x3f5d5e,{'cwd':process['cwd'](),'stdio':_0x529bcb?_0x317e73(0x1d7):_0x317e73(0x218),'env':process.env,'shell':![]});if(_0x4bb6a9[_0x317e73(0x1cf)]===0x0)return{'ok':!![]};let _0x3614a2=_0x4bb6a9[_0x317e73(0x1fa)]?.[_0x317e73(0x1fd)]||_0x317e73(0x209)+(_0x4bb6a9[_0x317e73(0x1cf)]??_0x317e73(0x1da));if(_0x529bcb){const _0x297bc4=_0x4bb6a9[_0x317e73(0x20e)]?_0x4bb6a9[_0x317e73(0x20e)][_0x317e73(0x1d6)]()[_0x317e73(0x1d1)]():'',_0x167fb5=_0x4bb6a9[_0x317e73(0x207)]?_0x4bb6a9[_0x317e73(0x207)][_0x317e73(0x1d6)]()['trim']():'';if(_0x297bc4)_0x3614a2=_0x297bc4;else{if(_0x167fb5)_0x3614a2=_0x167fb5;}}return{'ok':![],'error':_0x3614a2};}async function installCliBuiltInSkill(_0x102cea){const _0x111a7d=a59_0x9d1f70;console[_0x111a7d(0x200)]('Checking\x20CLI\x20Built-in\x20Skill...');const _0x29df0e=runNpxSkillsAddGlobal(process[_0x111a7d(0x1f3)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x102cea?_0x111a7d(0x1d7):_0x111a7d(0x218)});if(_0x29df0e[_0x111a7d(0x1eb)]){console[_0x111a7d(0x200)](_0x111a7d(0x202)+LOVRABET_SKIP_NPX_SKILLS_ENV+'=1).');return;}if(_0x29df0e['ok']){console[_0x111a7d(0x200)](_0x111a7d(0x1e1));return;}console[_0x111a7d(0x1f9)]('\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20'+(_0x29df0e['error']||_0x111a7d(0x1da))),console[_0x111a7d(0x200)](_0x111a7d(0x213));}async function execute(_0x32acde){const _0x5be3ee=a59_0x9d1f70;await validateUpdateFlags(_0x32acde);const _0x206773=getCliVersion();console['log']('Current\x20version:\x20'+_0x206773),console['log']('Checking\x20npm\x20dist-tags...');const _0x10c1e7=await resolveTargetVersion(_0x32acde);if(!_0x10c1e7){const _0x21f86f=_0x32acde['bool'](_0x5be3ee(0x204))?_0x5be3ee(0x204):_0x5be3ee(0x205),_0x4436af=_0x5be3ee(0x1dc)+_0x21f86f+_0x5be3ee(0x1dd);return console[_0x5be3ee(0x1f9)](_0x4436af),console['log']('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x21f86f),{'ok':![]};}if(!shouldInstallTarget(_0x206773,_0x10c1e7)){const _0x28806c=_0x10c1e7['source']===_0x5be3ee(0x1db)?_0x5be3ee(0x1f8)+_0x10c1e7[_0x5be3ee(0x1db)]+').':_0x5be3ee(0x1d5)+_0x10c1e7[_0x5be3ee(0x1db)]+').';return console[_0x5be3ee(0x200)](_0x28806c),shouldSkipCliBuiltInSkill(_0x32acde)?console[_0x5be3ee(0x200)](_0x5be3ee(0x1ec)):await installCliBuiltInSkill(_0x32acde['nonInteractive']),{'ok':!![]};}console[_0x5be3ee(0x200)](_0x5be3ee(0x1ff)+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x206773+_0x5be3ee(0x1d3)+_0x10c1e7['version']);const _0x2efd14=installCliPackage(_0x10c1e7['version'],_0x32acde[_0x5be3ee(0x214)]);if(!_0x2efd14['ok']){const _0x41d22f=_0x5be3ee(0x1ed)+(_0x2efd14[_0x5be3ee(0x1fa)]||'unknown');return console[_0x5be3ee(0x1fa)](_0x41d22f),console[_0x5be3ee(0x200)](_0x5be3ee(0x219)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x10c1e7[_0x5be3ee(0x1db)]),{'ok':![]};}return console[_0x5be3ee(0x200)](_0x5be3ee(0x1f7)+_0x10c1e7[_0x5be3ee(0x1db)]+'.'),console[_0x5be3ee(0x200)](_0x5be3ee(0x1fb)),shouldSkipCliBuiltInSkill(_0x32acde)?console[_0x5be3ee(0x200)](_0x5be3ee(0x1ec)):await installCliBuiltInSkill(_0x32acde[_0x5be3ee(0x214)]),{'ok':!![]};}function a59_0x41b2(){const _0x16b93c=['match','no-skills','skipped','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','Update\x20failed:\x20','2acKIpJ','join','prerelease','source','major','cwd','length','fromEntries','/dist-tags','Updated\x20to\x20v','Already\x20on\x20requested\x20version\x20(v','warn','error','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','str','message','6BHbfZY','Updating\x20','log','2278456ovayug','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(','minor','beta','latest','update','stdout','patch','exit\x20','/-/package/','2275196ngPTfK','boolean','Update\x20','stderr','--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','5071212YzKpwA','install','Invalid\x20version:\x20','\x20\x20Run\x20manually:\x20lovrabet\x20cli-skill\x20install','nonInteractive','bool','Install\x20a\x20specific\x20CLI\x20version','write','inherit','\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20','12957380xKXfBu','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','408214enqBih','status','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','trim','Version\x20comparison\x20failed.','\x20->\x20','entries','Already\x20up\x20to\x20date\x20(v','toString','pipe','flag','160148QWBCwT','unknown','version','Unable\x20to\x20resolve\x20','\x20version\x20from\x20npm.','run','validation','Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','npm','map','string','skills','18enCYNY','1098500NsZtgY','filter'];a59_0x41b2=function(){return _0x16b93c;};return a59_0x41b2();}export const updateDefinition={'service':a59_0x9d1f70(0x206),'command':a59_0x9d1f70(0x1de),'description':a59_0x9d1f70(0x20d)+CLI_BIN_NAME+'\x20CLI\x20from\x20npm','risk':a59_0x9d1f70(0x217),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a60_0x4317ff=a60_0x2752;(function(_0x552ffe,_0x3386b9){const _0x5762a7=a60_0x2752,_0x1ea39d=_0x552ffe();while(!![]){try{const _0x111fbd=parseInt(_0x5762a7(0x1eb))/0x1+-parseInt(_0x5762a7(0x1e3))/0x2*(parseInt(_0x5762a7(0x1cb))/0x3)+parseInt(_0x5762a7(0x1f4))/0x4*(-parseInt(_0x5762a7(0x1d5))/0x5)+-parseInt(_0x5762a7(0x1d0))/0x6+-parseInt(_0x5762a7(0x1dc))/0x7+-parseInt(_0x5762a7(0x1ef))/0x8+parseInt(_0x5762a7(0x1e1))/0x9;if(_0x111fbd===_0x3386b9)break;else _0x1ea39d['push'](_0x1ea39d['shift']());}catch(_0x356825){_0x1ea39d['push'](_0x1ea39d['shift']());}}}(a60_0x55d0,0x28061));import{CLI_BIN_NAME}from'../../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../../constant/env.js';function a60_0x2752(_0x526e7f,_0x15e32d){_0x526e7f=_0x526e7f-0x1c1;const _0x55d06b=a60_0x55d0();let _0x275220=_0x55d06b[_0x526e7f];return _0x275220;}function a60_0x55d0(){const _0x2ca649=['write','\x20workspace\x20','project','env','196070jMRhyT','\x0aDefault\x20app:\x20','defaultApp','items','764912OVmqnU','appCode','appcode','Workspace\x20configured.\x0aConfig\x20file:\x20','init','12fnxjrC','Initialize\x20app\x20context\x20for\x20the\x20current\x20workspace','\x20--appcode\x20<code>\x20[--env\x20daily]','\x22\x20not\x20found.','join','Available\x20apps:\x20','shouldWriteEnv','Run\x20`','appName','\x0aEnv:\x20','yes','Resolving\x20--app\x20requires\x20accessKey.\x20Pass\x20--appcode\x20directly,\x20or\x20set\x20accessKey\x20before\x20running\x20','accessKey','Set\x20app\x20context\x20for\x20the\x20current\x20workspace','3rHoSfE','map','\x0aAccessKey:\x20not\x20written','string','envName','401106rgPjZc','from','App\x20name\x20to\x20bind\x20as\x20the\x20current\x20workspace\x20default','workspace','object','527925vjFdum','apps','app','use','Usage:\x20','validation','../../core/api-client.js','32984byMTeX','trim','App\x20\x22','length','App\x20code\x20to\x20bind\x20directly','5568813PIehDd','Invalid\x20env\x20\x22','333916nPsnJX','str','workspace\x20','\x22.\x20Allowed:\x20'];a60_0x55d0=function(){return _0x2ca649;};return a60_0x55d0();}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':'app','type':a60_0x4317ff(0x1ce),'description':a60_0x4317ff(0x1d2)},{'name':a60_0x4317ff(0x1f1),'type':a60_0x4317ff(0x1ce),'description':a60_0x4317ff(0x1e0)},{'name':a60_0x4317ff(0x1ea),'type':'string','description':'Target\x20environment','enum':[...RUNTIME_ENV_VALUES]},{'name':a60_0x4317ff(0x1c7),'type':'boolean','description':'Compatibility\x20flag;\x20workspace\x20config\x20updates\x20are\x20non-interactive','default':![]}];async function executeWorkspaceUse(_0x2e4faa,_0x584861){const _0x4ec4b4=a60_0x4317ff,_0x159739=_0x2e4faa[_0x4ec4b4(0x1e4)](_0x4ec4b4(0x1d7))[_0x4ec4b4(0x1dd)](),_0x887613=_0x2e4faa['str'](_0x4ec4b4(0x1f1))['trim'](),_0x1f30af=_0x2e4faa[_0x4ec4b4(0x1e4)](_0x4ec4b4(0x1ea))[_0x4ec4b4(0x1dd)](),_0x333971=resolveWorkspaceEnv(_0x1f30af||_0x2e4faa[_0x4ec4b4(0x1cf)]||DEFAULT_CONFIG_VALUES[_0x4ec4b4(0x1ea)]);if(!_0x159739&&!_0x887613)throw CliErrors[_0x4ec4b4(0x1da)]('Missing\x20workspace\x20app\x20selector.',_0x4ec4b4(0x1d9)+CLI_BIN_NAME+_0x4ec4b4(0x1e8)+_0x584861+'\x20--app\x20<name>\x20[--env\x20daily]\x20or\x20'+CLI_BIN_NAME+_0x4ec4b4(0x1e8)+_0x584861+_0x4ec4b4(0x1f6));const _0x50cc19=_0x887613||await resolveRemoteAppCode({'command':_0x584861,'appName':_0x159739,'env':_0x333971,'accessKey':_0x2e4faa[_0x4ec4b4(0x1c9)]}),_0x10fe3b=writeWorkspaceConfig({'command':_0x584861,'appName':_0x159739,'appcode':_0x50cc19,'env':_0x333971,'shouldWriteEnv':!!_0x1f30af,'accessKey':_0x2e4faa[_0x4ec4b4(0x1c9)]});return{'ok':!![],'data':{'configPath':_0x10fe3b,'app':_0x159739||null,'appcode':_0x50cc19,'env':_0x1f30af?_0x333971:null,'accessKeyWritten':![],'command':_0x4ec4b4(0x1e5)+_0x584861},'message':buildWorkspaceMessage(_0x10fe3b,_0x159739,_0x50cc19,_0x1f30af?_0x333971:undefined)};}async function resolveRemoteAppCode(_0x45119a){const _0x376e99=a60_0x4317ff;if(!_0x45119a[_0x376e99(0x1c9)])throw CliErrors['authRequired'](_0x376e99(0x1c8)+CLI_BIN_NAME+_0x376e99(0x1e8)+_0x45119a['command']+'.');const {setActiveAK:_0x3c4b77}=await import(_0x376e99(0x1db)),{getRemoteAppList:_0x287b47}=await import('../../commands/app/remote-source.js');_0x3c4b77(_0x45119a[_0x376e99(0x1c9)]);const _0x3bf0a1=await _0x287b47({'env':_0x45119a[_0x376e99(0x1ea)],'accessKey':_0x45119a[_0x376e99(0x1c9)],'noCache':![]}),_0x3e806a=findAppByName(_0x3bf0a1[_0x376e99(0x1ee)],_0x45119a['appName']);if(_0x3e806a&&!isRuntimeAccessibleApp(_0x3e806a))throw runtimeInaccessibleAppError(_0x3e806a,'\x22'+_0x45119a[_0x376e99(0x1c5)]+'\x22');const _0x52a6a1=_0x3e806a?.[_0x376e99(0x1f0)]?.[_0x376e99(0x1dd)]();if(_0x52a6a1)return _0x52a6a1;const _0x199462=_0x3bf0a1[_0x376e99(0x1ee)][_0x376e99(0x1cc)](_0x9cc589=>_0x9cc589[_0x376e99(0x1c5)])['filter'](Boolean),_0x12cd3b=_0x199462[_0x376e99(0x1df)]?_0x376e99(0x1c2)+Array[_0x376e99(0x1d1)](new Set(_0x199462))['join'](',\x20')+'.':_0x376e99(0x1c4)+CLI_BIN_NAME+'\x20app\x20list\x20--no-cache`\x20to\x20refresh\x20available\x20apps,\x20or\x20pass\x20--appcode\x20directly.';throw CliErrors[_0x376e99(0x1da)](_0x376e99(0x1de)+_0x45119a[_0x376e99(0x1c5)]+_0x376e99(0x1f7),_0x12cd3b);}function writeWorkspaceConfig(_0x3fe114){const _0x937e08=a60_0x4317ff,_0x5beb0d=resolveWriteConfigPath(_0x937e08(0x1e9)),_0x4a2694=readConfigFile(_0x5beb0d);_0x3fe114[_0x937e08(0x1c3)]&&(_0x4a2694[_0x937e08(0x1ea)]=_0x3fe114['env']);if(_0x3fe114[_0x937e08(0x1c5)]){const _0x156a4b=isRecord(_0x4a2694['apps'])?{..._0x4a2694[_0x937e08(0x1d6)]}:{},_0x2e1f7e=isRecord(_0x156a4b[_0x3fe114[_0x937e08(0x1c5)]])?_0x156a4b[_0x3fe114[_0x937e08(0x1c5)]]:{};_0x156a4b[_0x3fe114[_0x937e08(0x1c5)]]={..._0x2e1f7e,'appcode':_0x3fe114['appcode']},_0x4a2694[_0x937e08(0x1d6)]=_0x156a4b,_0x4a2694[_0x937e08(0x1ed)]=_0x3fe114[_0x937e08(0x1c5)];if(_0x4a2694[_0x937e08(0x1d7)])delete _0x4a2694[_0x937e08(0x1d7)];return writeAndReturn(_0x5beb0d,_0x4a2694);}_0x4a2694['appcode']=_0x3fe114['appcode'];if(_0x4a2694[_0x937e08(0x1d7)])delete _0x4a2694[_0x937e08(0x1d7)];return writeAndReturn(_0x5beb0d,_0x4a2694);}function writeAndReturn(_0x5c6431,_0x4548a3){return writeConfigFile(_0x5c6431,_0x4548a3),_0x5c6431;}function resolveWorkspaceEnv(_0x200597){const _0x147844=a60_0x4317ff;if(RUNTIME_ENV_VALUES['includes'](_0x200597))return _0x200597;throw CliErrors[_0x147844(0x1da)](_0x147844(0x1e2)+_0x200597+_0x147844(0x1e6)+RUNTIME_ENV_VALUES[_0x147844(0x1c1)](',\x20'));}function buildWorkspaceMessage(_0x4dc276,_0x385adc,_0x293eff,_0x180281){const _0x36a840=a60_0x4317ff,_0x22d45a=_0x385adc?_0x385adc+'\x20('+_0x293eff+')':_0x293eff,_0x574c50=_0x180281?_0x36a840(0x1c6)+_0x180281:'';return _0x36a840(0x1f2)+_0x4dc276+_0x36a840(0x1ec)+_0x22d45a+_0x574c50+_0x36a840(0x1cd);}function isRecord(_0x1c5d09){const _0x2cb080=a60_0x4317ff;return typeof _0x1c5d09===_0x2cb080(0x1d4)&&_0x1c5d09!==null&&!Array['isArray'](_0x1c5d09);}function makeWorkspaceCommand(_0x5dcecf){const _0x4d0ac5=a60_0x4317ff;return{'service':_0x4d0ac5(0x1d3),'command':_0x5dcecf,'description':_0x5dcecf==='init'?_0x4d0ac5(0x1f5):_0x4d0ac5(0x1ca),'risk':_0x4d0ac5(0x1e7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':WORKSPACE_USE_FLAGS,async 'execute'(_0x4fa3f9){return executeWorkspaceUse(_0x4fa3f9,_0x5dcecf);}};}export const workspaceDefinitions=[makeWorkspaceCommand(a60_0x4317ff(0x1f3)),makeWorkspaceCommand(a60_0x4317ff(0x1d8))];
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a61_0x3358(){const _0xd0f703=['entries','2071448LwzVdc','Target\x20environment','cliSettableTopLevel','133gneXgo','filter','1822350QAWDWT','648932TGPGgt','legacyCompatOnly','enumValues','join','format','986346RxpRuO','193668wBrzvD','map','riskLevel',';\x20local\x20alias:\x20apps.<alias>.appcode','Default\x20page\x20size','Override\x20API\x20domain','Override\x20SkillHub\x20domain','fromEntries','importable','has','171hFaTaT','defaultValue','Locale','Override\x20runtime\x20domain','Config\x20key.\x20Top-level:\x20','3544605eApFqA','785320mwXNek','env','Override\x20user\x20domain'];a61_0x3358=function(){return _0xd0f703;};return a61_0x3358();}const a61_0x5736b8=a61_0x2a5e;(function(_0x9ad25d,_0x15e140){const _0x337d69=a61_0x2a5e,_0x381648=_0x9ad25d();while(!![]){try{const _0x3f1f4c=-parseInt(_0x337d69(0xd5))/0x1+-parseInt(_0x337d69(0xda))/0x2+-parseInt(_0x337d69(0xd4))/0x3+parseInt(_0x337d69(0xcf))/0x4+-parseInt(_0x337d69(0xca))/0x5+-parseInt(_0x337d69(0xdb))/0x6*(-parseInt(_0x337d69(0xd2))/0x7)+parseInt(_0x337d69(0xcb))/0x8*(parseInt(_0x337d69(0xe5))/0x9);if(_0x3f1f4c===_0x15e140)break;else _0x381648['push'](_0x381648['shift']());}catch(_0x2417b3){_0x381648['push'](_0x381648['shift']());}}}(a61_0x3358,0x834cb));function a61_0x2a5e(_0x113c6a,_0x5a3c73){_0x113c6a=_0x113c6a-0xc9;const _0x3358eb=a61_0x3358();let _0x2a5eb2=_0x3358eb[_0x113c6a];return _0x2a5eb2;}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':a61_0x5736b8(0xd0),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':RUNTIME_ENV_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a61_0x5736b8(0xcc)],'importable':!![]},'format':{'description':'Default\x20output\x20format','topLevel':!![],'cliSettableTopLevel':!![],'enumValues':OUTPUT_FORMAT_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a61_0x5736b8(0xd9)],'importable':!![]},'pageSize':{'description':a61_0x5736b8(0xdf),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'apiDomain':{'description':a61_0x5736b8(0xe0),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'userDomain':{'description':a61_0x5736b8(0xcd),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'runtimeDomain':{'description':a61_0x5736b8(0xe8),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'skillHubDomain':{'description':a61_0x5736b8(0xe1),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'accessKey':{'description':'Access\x20key\x20(client-ak\x20auth)','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'riskLevel':{'description':'Risk\x20level','topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a61_0x5736b8(0xdd)],'importable':!![]},'locale':{'description':a61_0x5736b8(0xe7),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES['locale'],'importable':!![],'legacyCompatOnly':!![]}};export const TOP_LEVEL_CONFIG_KEYS=new Set(Object[a61_0x5736b8(0xce)](CONFIG_FIELD_SCHEMAS)[a61_0x5736b8(0xd3)](([,_0x2e387b])=>_0x2e387b[a61_0x5736b8(0xd1)])[a61_0x5736b8(0xdc)](([_0x49abd1])=>_0x49abd1));export const CONFIG_ENUM_VALUES=Object[a61_0x5736b8(0xe2)](Object[a61_0x5736b8(0xce)](CONFIG_FIELD_SCHEMAS)[a61_0x5736b8(0xd3)](([,_0x4e8a38])=>_0x4e8a38[a61_0x5736b8(0xd7)])[a61_0x5736b8(0xdc)](([_0x3266f4,_0x25061e])=>[_0x3266f4,[..._0x25061e['enumValues']||[]]]));export const IMPORTABLE_RUNTIME_CONFIG_KEYS=Object[a61_0x5736b8(0xce)](CONFIG_FIELD_SCHEMAS)[a61_0x5736b8(0xd3)](([,_0x2483a4])=>_0x2483a4[a61_0x5736b8(0xe3)])[a61_0x5736b8(0xdc)](([_0x3dd84])=>_0x3dd84);export function getConfigFieldSchema(_0x7fbded){return CONFIG_FIELD_SCHEMAS[_0x7fbded];}export function getConfigEnumValues(_0x3fb3b2){const _0x1019d7=a61_0x5736b8;return getConfigFieldSchema(_0x3fb3b2)?.[_0x1019d7(0xd7)];}export function getConfigDefaultValue(_0x5a9c59){const _0xf9584a=a61_0x5736b8;return getConfigFieldSchema(_0x5a9c59)?.[_0xf9584a(0xe6)];}export function isTopLevelConfigKey(_0x1e1226){const _0x19ddb6=a61_0x5736b8;return TOP_LEVEL_CONFIG_KEYS[_0x19ddb6(0xe4)](_0x1e1226);}export function isLegacyCompatConfigKey(_0x184498){const _0x27b52a=a61_0x5736b8;return getConfigFieldSchema(_0x184498)?.[_0x27b52a(0xd6)]===!![];}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function formatConfigKeyList(_0x452a84){const _0x2c7d15=a61_0x5736b8;return[..._0x452a84][_0x2c7d15(0xd8)](',\x20');}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x14674=a61_0x5736b8;return _0x14674(0xc9)+getTopLevelConfigKeySummary()+_0x14674(0xde);}export function buildAppProfileListFields(_0x5ca2ba){return{'env':_0x5ca2ba,'hasAccessKey':![],'format':null,'pageSize':null,'riskLevel':null,'locale':null};}
|
package/lib/constant/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a62_0x268898=a62_0xb24d;(function(_0x5652f6,_0x486fc4){const _0x18a0a2=a62_0xb24d,_0x136973=_0x5652f6();while(!![]){try{const _0x305527=parseInt(_0x18a0a2(0x123))/0x1+parseInt(_0x18a0a2(0x11d))/0x2+-parseInt(_0x18a0a2(0x11c))/0x3+parseInt(_0x18a0a2(0x119))/0x4*(-parseInt(_0x18a0a2(0x117))/0x5)+parseInt(_0x18a0a2(0x11f))/0x6*(-parseInt(_0x18a0a2(0x11a))/0x7)+parseInt(_0x18a0a2(0x124))/0x8*(parseInt(_0x18a0a2(0x11e))/0x9)+-parseInt(_0x18a0a2(0x120))/0xa*(-parseInt(_0x18a0a2(0x118))/0xb);if(_0x305527===_0x486fc4)break;else _0x136973['push'](_0x136973['shift']());}catch(_0x521757){_0x136973['push'](_0x136973['shift']());}}}(a62_0x2ca4,0x426a9));export const APP_PUBLISH_STATUS={'Published':a62_0x268898(0x122),'Unpublished':a62_0x268898(0x121)};function a62_0xb24d(_0x496b8f,_0x4c0af8){_0x496b8f=_0x496b8f-0x117;const _0x2ca428=a62_0x2ca4();let _0xb24db9=_0x2ca428[_0x496b8f];return _0xb24db9;}function a62_0x2ca4(){const _0x479618=['758886FbTVzX','37062BqbPdP','30918UiFhAf','5063920hNTnsE','UNPUBLISH','PUBLISHED','306141HLFKWI','16PIJibm','5HRrYul','11kHKTEj','1527208AnthBF','133zBvOfU','Published','1345386PfcLSV'];a62_0x2ca4=function(){return _0x479618;};return a62_0x2ca4();}export const RUNTIME_ACCESSIBLE_APP_STATUS=APP_PUBLISH_STATUS[a62_0x268898(0x11b)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a63_0x1abe20=a63_0x435e;(function(_0x463148,_0x2e956a){const _0x12a2a4=a63_0x435e,_0x2769f8=_0x463148();while(!![]){try{const _0x597afb=parseInt(_0x12a2a4(0x13f))/0x1+-parseInt(_0x12a2a4(0x13d))/0x2*(parseInt(_0x12a2a4(0x13c))/0x3)+parseInt(_0x12a2a4(0x139))/0x4*(parseInt(_0x12a2a4(0x137))/0x5)+-parseInt(_0x12a2a4(0x136))/0x6+parseInt(_0x12a2a4(0x13a))/0x7*(parseInt(_0x12a2a4(0x13e))/0x8)+-parseInt(_0x12a2a4(0x138))/0x9+parseInt(_0x12a2a4(0x140))/0xa;if(_0x597afb===_0x2e956a)break;else _0x2769f8['push'](_0x2769f8['shift']());}catch(_0x291967){_0x2769f8['push'](_0x2769f8['shift']());}}}(a63_0x2614,0x52791));export const AUTH_MODE={'ClientAk':a63_0x1abe20(0x13b)};function a63_0x435e(_0x2ca9f9,_0x5a8df9){_0x2ca9f9=_0x2ca9f9-0x136;const _0x26146b=a63_0x2614();let _0x435e29=_0x26146b[_0x2ca9f9];return _0x435e29;}export function isAuthMode(_0x2898ea){return _0x2898ea===AUTH_MODE['ClientAk'];}function a63_0x2614(){const _0x16b26e=['412kryaYs','63pwgDwy','client-ak','3LNcjgu','1306210IjVySu','372200DTMOLY','565076XoNvIk','4730110pCDMyD','2725158BpfJxJ','10555folgla','2062242CHryju'];a63_0x2614=function(){return _0x16b26e;};return a63_0x2614();}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a64_0x1ff9(){const _0x210127=['<name>','Alias\x20for\x20--non-interactive','64qyGlnT','Environment','JSON\x20params\x20for\x20execute\x20commands','map','sqlcode','3786NTAdMF','447574iwKWAJ','Record\x20ID','boolean','verbose','clear','name','params','382697HyumQE','Verbose\x20output','112398HjQusq','help','format','4622662kCJywp','Clear\x20output','377421XdJiKE','env','dry-run','type','Use\x20global\x20config\x20scope','2857617rkTPaX','Show\x20help','meowKey','non-interactive','Name\x20filter','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20implies\x20--format\x20json\x20when\x20current\x20format\x20is\x20pretty)','4EkxfTX','app','Force\x20non-interactive\x20mode\x20(CI)','appcode','yes','dryRun','10QGqZGq','production\x20|\x20development\x20|\x20daily','4195ZWcikI','Preview\x20operation\x20without\x20executing','string','<code>','global','json\x20|\x20pretty\x20|\x20compress'];a64_0x1ff9=function(){return _0x210127;};return a64_0x1ff9();}const a64_0x2b56d2=a64_0x97f6;function a64_0x97f6(_0x38ac37,_0x241034){_0x38ac37=_0x38ac37-0x10c;const _0x1ff94c=a64_0x1ff9();let _0x97f626=_0x1ff94c[_0x38ac37];return _0x97f626;}(function(_0x6b6f8d,_0x3937e2){const _0x45e513=a64_0x97f6,_0x3e156a=_0x6b6f8d();while(!![]){try{const _0x38073f=parseInt(_0x45e513(0x10f))/0x1+-parseInt(_0x45e513(0x118))/0x2+-parseInt(_0x45e513(0x11d))/0x3*(-parseInt(_0x45e513(0x128))/0x4)+parseInt(_0x45e513(0x130))/0x5*(-parseInt(_0x45e513(0x10e))/0x6)+-parseInt(_0x45e513(0x116))/0x7*(parseInt(_0x45e513(0x138))/0x8)+parseInt(_0x45e513(0x122))/0x9+-parseInt(_0x45e513(0x12e))/0xa*(-parseInt(_0x45e513(0x11b))/0xb);if(_0x38073f===_0x3937e2)break;else _0x3e156a['push'](_0x3e156a['shift']());}catch(_0x352219){_0x3e156a['push'](_0x3e156a['shift']());}}}(a64_0x1ff9,0x465a0));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['cliDisplayName'];export const NPM_PACKAGE_NAME=LOVRABET_NPM_PACKAGE_NAME;export const GLOBAL_FLAGS=[{'name':a64_0x2b56d2(0x12b),'meowKey':a64_0x2b56d2(0x12b),'type':'string','description':'Override\x20appcode','hint':a64_0x2b56d2(0x133)},{'name':a64_0x2b56d2(0x129),'meowKey':'app','type':'string','description':'Select\x20app\x20profile\x20by\x20name','hint':a64_0x2b56d2(0x136)},{'name':'env','meowKey':a64_0x2b56d2(0x11e),'type':a64_0x2b56d2(0x132),'description':a64_0x2b56d2(0x139),'hint':a64_0x2b56d2(0x12f)},{'name':a64_0x2b56d2(0x11a),'meowKey':a64_0x2b56d2(0x11a),'type':a64_0x2b56d2(0x132),'description':'Output\x20format','hint':a64_0x2b56d2(0x135)},{'name':'jq','meowKey':'jq','type':a64_0x2b56d2(0x132),'description':a64_0x2b56d2(0x127),'hint':'<expr>'},{'name':a64_0x2b56d2(0x11f),'meowKey':a64_0x2b56d2(0x12d),'type':a64_0x2b56d2(0x111),'description':a64_0x2b56d2(0x131)},{'name':'yes','meowKey':a64_0x2b56d2(0x12c),'type':a64_0x2b56d2(0x111),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a64_0x2b56d2(0x125),'meowKey':'nonInteractive','type':'boolean','description':a64_0x2b56d2(0x12a)},{'name':a64_0x2b56d2(0x134),'meowKey':a64_0x2b56d2(0x134),'type':'boolean','description':a64_0x2b56d2(0x121)},{'name':'ci','meowKey':'ci','type':'boolean','description':a64_0x2b56d2(0x137),'hidden':!![]},{'name':'help','meowKey':a64_0x2b56d2(0x119),'type':'boolean','description':a64_0x2b56d2(0x123)},{'name':'id','meowKey':'id','type':a64_0x2b56d2(0x132),'description':a64_0x2b56d2(0x110),'hidden':!![]},{'name':a64_0x2b56d2(0x114),'meowKey':'name','type':a64_0x2b56d2(0x132),'description':a64_0x2b56d2(0x126),'hidden':!![]},{'name':'sqlcode','meowKey':a64_0x2b56d2(0x10d),'type':a64_0x2b56d2(0x132),'description':'SQL\x20query\x20code','hidden':!![]},{'name':a64_0x2b56d2(0x115),'meowKey':'params','type':'string','description':a64_0x2b56d2(0x13a),'hidden':!![]},{'name':a64_0x2b56d2(0x112),'meowKey':a64_0x2b56d2(0x112),'type':a64_0x2b56d2(0x111),'description':a64_0x2b56d2(0x117),'hidden':!![]},{'name':a64_0x2b56d2(0x113),'meowKey':a64_0x2b56d2(0x113),'type':a64_0x2b56d2(0x111),'description':a64_0x2b56d2(0x11c),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a64_0x2b56d2(0x12b),a64_0x2b56d2(0x129),a64_0x2b56d2(0x11e),a64_0x2b56d2(0x11a),'jq',a64_0x2b56d2(0x11f),a64_0x2b56d2(0x12c),'non-interactive','ci']);export function buildMeowFlags(){const _0x915263=a64_0x2b56d2;return Object['fromEntries'](GLOBAL_FLAGS[_0x915263(0x10c)](_0x592dfd=>[_0x592dfd[_0x915263(0x124)],{'type':_0x592dfd[_0x915263(0x120)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a65_0x1b3a(_0x1b520b,_0x138558){_0x1b520b=_0x1b520b-0x1f1;const _0xac54d6=a65_0xac54();let _0x1b3a4c=_0xac54d6[_0x1b520b];return _0x1b3a4c;}const a65_0x39323e=a65_0x1b3a;(function(_0x74bf41,_0x185971){const _0x4bd8f2=a65_0x1b3a,_0xdab0f9=_0x74bf41();while(!![]){try{const _0x4453d0=parseInt(_0x4bd8f2(0x1fe))/0x1*(parseInt(_0x4bd8f2(0x1f3))/0x2)+parseInt(_0x4bd8f2(0x1fc))/0x3*(parseInt(_0x4bd8f2(0x1f1))/0x4)+parseInt(_0x4bd8f2(0x1fb))/0x5+-parseInt(_0x4bd8f2(0x1f7))/0x6*(parseInt(_0x4bd8f2(0x1f8))/0x7)+-parseInt(_0x4bd8f2(0x1fd))/0x8+-parseInt(_0x4bd8f2(0x200))/0x9*(-parseInt(_0x4bd8f2(0x1f2))/0xa)+parseInt(_0x4bd8f2(0x201))/0xb*(-parseInt(_0x4bd8f2(0x1f6))/0xc);if(_0x4453d0===_0x185971)break;else _0xdab0f9['push'](_0xdab0f9['shift']());}catch(_0x5b2539){_0xdab0f9['push'](_0xdab0f9['shift']());}}}(a65_0xac54,0xc7c7a));export const DEFAULT_APP_PROFILE_NAME=a65_0x39323e(0x1f5);function a65_0xac54(){const _0x3bd670=['1hxosTL','en-US','54UMZFkJ','22CgONqv','27556TsPlTl','2152210NxGFlS','1175026QlHTKF','production','main','4878084PMYhpX','230184UeEFWP','119PxfPkY','compress','write','7456820JTohIs','3ZDoAcz','8748736JwOYVu'];a65_0xac54=function(){return _0x3bd670;};return a65_0xac54();}export const DEFAULT_CONFIG_VALUES={'env':a65_0x39323e(0x1f4),'format':a65_0x39323e(0x1f9),'locale':a65_0x39323e(0x1ff),'riskLevel':a65_0x39323e(0x1fa)};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a65_0x39323e(0x1f9);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a66_0x3f78(){const _0x409f61=['189iVgAMk','36940owJiSx','136623Jcubye','78THyPCs','1177fTyOWL','48uqqqBY','npmPackageName','32392OxXfkV','26905rETpYs','560802ybBfWv','96zWIBHt','12960NyGyBW','npmRegistryBaseUrl'];a66_0x3f78=function(){return _0x409f61;};return a66_0x3f78();}const a66_0x1295c1=a66_0x2a6b;(function(_0x167351,_0x2db634){const _0x550b67=a66_0x2a6b,_0x4e68ba=_0x167351();while(!![]){try{const _0x383133=-parseInt(_0x550b67(0xe5))/0x1+parseInt(_0x550b67(0xe6))/0x2*(parseInt(_0x550b67(0xe0))/0x3)+parseInt(_0x550b67(0xe8))/0x4*(parseInt(_0x550b67(0xeb))/0x5)+-parseInt(_0x550b67(0xec))/0x6+parseInt(_0x550b67(0xe3))/0x7*(-parseInt(_0x550b67(0xea))/0x8)+-parseInt(_0x550b67(0xe1))/0x9+parseInt(_0x550b67(0xe4))/0xa*(parseInt(_0x550b67(0xe7))/0xb);if(_0x383133===_0x2db634)break;else _0x4e68ba['push'](_0x4e68ba['shift']());}catch(_0x226e49){_0x4e68ba['push'](_0x4e68ba['shift']());}}}(a66_0x3f78,0x1d5a1));import{PRODUCT_CONFIG}from'../constant/product.js';export const LOVRABET_NPM_PACKAGE_NAME=PRODUCT_CONFIG[a66_0x1295c1(0xe9)];export const LOVRABET_SKILL_SOURCE=PRODUCT_CONFIG['skillSource'];function a66_0x2a6b(_0x109d4e,_0x421e91){_0x109d4e=_0x109d4e-0xe0;const _0x3f783f=a66_0x3f78();let _0x2a6b29=_0x3f783f[_0x109d4e];return _0x2a6b29;}export const NPM_REGISTRY_BASE_URL=PRODUCT_CONFIG[a66_0x1295c1(0xe2)];
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a67_0x195007=a67_0x3d0a;(function(_0x34b635,_0x1c8701){const _0xef4d8e=a67_0x3d0a,_0x458296=_0x34b635();while(!![]){try{const _0x2b2b81=-parseInt(_0xef4d8e(0x84))/0x1+parseInt(_0xef4d8e(0x7e))/0x2+-parseInt(_0xef4d8e(0x8d))/0x3+-parseInt(_0xef4d8e(0x89))/0x4*(parseInt(_0xef4d8e(0x8f))/0x5)+parseInt(_0xef4d8e(0x88))/0x6*(-parseInt(_0xef4d8e(0x8a))/0x7)+-parseInt(_0xef4d8e(0x7d))/0x8*(-parseInt(_0xef4d8e(0x82))/0x9)+parseInt(_0xef4d8e(0x8e))/0xa;if(_0x2b2b81===_0x1c8701)break;else _0x458296['push'](_0x458296['shift']());}catch(_0x596579){_0x458296['push'](_0x458296['shift']());}}}(a67_0x1049,0x53957));import{getEnv,isProduction}from'../constant/env.js';import{PRODUCT_CONFIG}from'../constant/product.js';function a67_0x1049(){const _0x48af03=['6288DVweUK','248860QQQkTF','runtime','userDomain','runtimeDomain','6597PVKoTS','user','350171fnqxyQ','production','skillhub','domains','138BmRzxR','407768HDagGX','90174QtkwiH','nonProduction','apiDomain','991170rcTQbe','12302900KFgCRw','30JSiIug','api'];a67_0x1049=function(){return _0x48af03;};return a67_0x1049();}let customApiDomain,customUserDomain,customRuntimeDomain,customSkillHubDomain;export function initDomains(_0x2fb4d7){const _0x5355e0=a67_0x3d0a;customApiDomain=_0x2fb4d7?.[_0x5355e0(0x8c)],customUserDomain=_0x2fb4d7?.[_0x5355e0(0x80)],customRuntimeDomain=_0x2fb4d7?.[_0x5355e0(0x81)],customSkillHubDomain=_0x2fb4d7?.['skillHubDomain'];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a67_0x195007(0x87)]['production']['user']:PRODUCT_CONFIG['domains'][a67_0x195007(0x8b)][a67_0x195007(0x83)]);export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?PRODUCT_CONFIG['domains'][a67_0x195007(0x85)][a67_0x195007(0x7c)]:PRODUCT_CONFIG[a67_0x195007(0x87)]['nonProduction'][a67_0x195007(0x7c)]);export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?PRODUCT_CONFIG['domains'][a67_0x195007(0x85)][a67_0x195007(0x7f)]:PRODUCT_CONFIG['domains'][a67_0x195007(0x8b)][a67_0x195007(0x7f)]);function a67_0x3d0a(_0x49d9e1,_0x4ae483){_0x49d9e1=_0x49d9e1-0x7c;const _0x104958=a67_0x1049();let _0x3d0ac5=_0x104958[_0x49d9e1];return _0x3d0ac5;}export const getSkillHubDomain=()=>customSkillHubDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a67_0x195007(0x87)][a67_0x195007(0x85)][a67_0x195007(0x86)]:PRODUCT_CONFIG['domains']['nonProduction']['skillhub']);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a68_0xc37aa4=a68_0x3a19;(function(_0x4e231e,_0x1c1fb5){const _0x24d0c3=a68_0x3a19,_0x12277a=_0x4e231e();while(!![]){try{const _0x4dfdc5=-parseInt(_0x24d0c3(0x1d0))/0x1*(-parseInt(_0x24d0c3(0x1d9))/0x2)+-parseInt(_0x24d0c3(0x1ce))/0x3+-parseInt(_0x24d0c3(0x1d2))/0x4*(parseInt(_0x24d0c3(0x1dc))/0x5)+parseInt(_0x24d0c3(0x1d5))/0x6*(parseInt(_0x24d0c3(0x1d3))/0x7)+-parseInt(_0x24d0c3(0x1d4))/0x8+parseInt(_0x24d0c3(0x1d1))/0x9*(parseInt(_0x24d0c3(0x1d8))/0xa)+parseInt(_0x24d0c3(0x1d7))/0xb*(parseInt(_0x24d0c3(0x1cc))/0xc);if(_0x4dfdc5===_0x1c1fb5)break;else _0x12277a['push'](_0x12277a['shift']());}catch(_0x2cf64f){_0x12277a['push'](_0x12277a['shift']());}}}(a68_0x2524,0x70cc1));import{productEnv}from'../constant/product.js';export const RUNTIME_ENV_VALUES=['production',a68_0xc37aa4(0x1da),a68_0xc37aa4(0x1d6)];export function normalizeEnv(_0x4993e1){const _0x1243b7=a68_0xc37aa4;return _0x4993e1===_0x1243b7(0x1db)?'production':_0x4993e1;}export function isProduction(_0x268026){const _0x5a151c=a68_0xc37aa4;return normalizeEnv(_0x268026)===_0x5a151c(0x1cf);}function a68_0x2524(){const _0x26a716=['160898SBcmIH','development','online','10eMptON','115200Pjlwdn','ENV','2563413gljxMS','production','3pDDpBT','36BtPiTT','1638292SfMhgu','410291AgUqTZ','629872CgrRoC','6SnKJvE','daily','1661BSJprE','1162020iAmqOf'];a68_0x2524=function(){return _0x26a716;};return a68_0x2524();}function a68_0x3a19(_0x5b7951,_0x598ca2){_0x5b7951=_0x5b7951-0x1cc;const _0x252470=a68_0x2524();let _0x3a1979=_0x252470[_0x5b7951];return _0x3a1979;}export function isDaily(_0xc20de6){const _0x4a4723=a68_0xc37aa4;return normalizeEnv(_0xc20de6)===_0x4a4723(0x1d6);}export function isDev(_0x1067c1){const _0x5b43f4=a68_0xc37aa4,_0x57a030=normalizeEnv(_0x1067c1);return _0x57a030===_0x5b43f4(0x1da)||_0x57a030==='dev';}let env=normalizeEnv(productEnv(a68_0xc37aa4(0x1cd))||'production');export function getEnv(){return env;}export function initEnv(_0x21db5e){env=normalizeEnv(_0x21db5e);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a69_0x393e(_0x1d6338,_0x423f31){_0x1d6338=_0x1d6338-0x121;const _0x40e05d=a69_0x40e0();let _0x393e58=_0x40e05d[_0x1d6338];return _0x393e58;}const a69_0x571ce2=a69_0x393e;(function(_0x4abfa4,_0xfe952f){const _0xa716e6=a69_0x393e,_0x134878=_0x4abfa4();while(!![]){try{const _0x366e47=-parseInt(_0xa716e6(0x122))/0x1*(-parseInt(_0xa716e6(0x129))/0x2)+-parseInt(_0xa716e6(0x124))/0x3+-parseInt(_0xa716e6(0x12d))/0x4*(-parseInt(_0xa716e6(0x12c))/0x5)+-parseInt(_0xa716e6(0x123))/0x6+-parseInt(_0xa716e6(0x128))/0x7+-parseInt(_0xa716e6(0x12b))/0x8*(-parseInt(_0xa716e6(0x12a))/0x9)+parseInt(_0xa716e6(0x127))/0xa*(parseInt(_0xa716e6(0x125))/0xb);if(_0x366e47===_0xfe952f)break;else _0x134878['push'](_0x134878['shift']());}catch(_0x163639){_0x134878['push'](_0x134878['shift']());}}}(a69_0x40e0,0xa626b));export const OUTPUT_FORMAT_VALUES=[a69_0x571ce2(0x121),a69_0x571ce2(0x126),a69_0x571ce2(0x12e)];function a69_0x40e0(){const _0x5985ed=['3951cdwClF','16920OjJTPj','75ySUrnH','132340ZnLlCI','compress','json','60KfOiYO','1193346nLgjju','3668370nfrcBS','2167iXmser','pretty','37230wHFzHC','6320405ITNNQB','28232bCuGcG'];a69_0x40e0=function(){return _0x5985ed;};return a69_0x40e0();}
|
package/lib/constant/product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a70_0x44d5cc=a70_0x144f;function a70_0x144f(_0x3c6898,_0x4a4552){_0x3c6898=_0x3c6898-0x15a;const _0x2ac612=a70_0x2ac6();let _0x144f25=_0x2ac612[_0x3c6898];return _0x144f25;}(function(_0x21bf84,_0x3a62a0){const _0x1ff8be=a70_0x144f,_0x284099=_0x21bf84();while(!![]){try{const _0x2c377c=parseInt(_0x1ff8be(0x175))/0x1*(parseInt(_0x1ff8be(0x15c))/0x2)+parseInt(_0x1ff8be(0x173))/0x3*(parseInt(_0x1ff8be(0x16a))/0x4)+parseInt(_0x1ff8be(0x161))/0x5+parseInt(_0x1ff8be(0x162))/0x6+parseInt(_0x1ff8be(0x167))/0x7*(parseInt(_0x1ff8be(0x177))/0x8)+-parseInt(_0x1ff8be(0x164))/0x9*(parseInt(_0x1ff8be(0x16e))/0xa)+-parseInt(_0x1ff8be(0x16c))/0xb*(parseInt(_0x1ff8be(0x176))/0xc);if(_0x2c377c===_0x3a62a0)break;else _0x284099['push'](_0x284099['shift']());}catch(_0x965ac8){_0x284099['push'](_0x284099['shift']());}}}(a70_0x2ac6,0x7bdeb));export const PRODUCT_CONFIG={'cliBinName':a70_0x44d5cc(0x15f),'cliDisplayName':'Lovrabet\x20Runtime\x20CLI','npmPackageName':'@lovrabet/lovrabet-cli','skillSource':a70_0x44d5cc(0x166),'npmRegistryBaseUrl':a70_0x44d5cc(0x16d),'envPrefix':a70_0x44d5cc(0x169),'legacyEnvPrefixes':[a70_0x44d5cc(0x172)],'configFileNames':['.lovrabet.json',a70_0x44d5cc(0x171)],'newConfigFileName':a70_0x44d5cc(0x170),'homeDirName':a70_0x44d5cc(0x15e),'logFileName':'.lovrabet-runtime.log','invokeSource':a70_0x44d5cc(0x160),'userCenterDisplayName':'Lovrabet\x20User\x20Center','skipNpxSkillsEnvSuffix':a70_0x44d5cc(0x15a),'domains':{'production':{'user':a70_0x44d5cc(0x16b),'api':'https://api.lovrabet.com','runtime':a70_0x44d5cc(0x174),'skillhub':'https://skills.lovrabet.com'},'nonProduction':{'user':a70_0x44d5cc(0x15b),'api':'https://daily-api.lovrabet.com','runtime':a70_0x44d5cc(0x163),'skillhub':a70_0x44d5cc(0x16f)}},'accessKeyCreatePath':a70_0x44d5cc(0x15d)};function a70_0x2ac6(){const _0x5167a4=['envPrefix','LOVRABET','14696jbkkSI','https://user.lovrabet.com','11YeglKk','https://registry.npmjs.org','1200BeqUNe','https://skills-daily.lovrabet.com','.lovrabet.json','.lovrabetrc','RABETBASE','123NoJGnZ','https://runtime.lovrabet.com','519cOczbh','8600052HvaDQH','8OcHTnU','SKIP_NPX_SKILLS','https://user-daily.lovrabet.com','208RRVmKI','/user/ak','.lovrabet','lovrabet','cli:lovrabet-runtime','3917830ICLVZU','2235288uxxONd','https://daily-runtime.lovrabet.com','71271ODUyio','legacyEnvPrefixes','lovrabet/lovrabet-cli','5695186BQrbhy'];a70_0x2ac6=function(){return _0x5167a4;};return a70_0x2ac6();}export function productEnvName(_0x1d46e7){const _0x5c6add=a70_0x44d5cc;return PRODUCT_CONFIG[_0x5c6add(0x168)]+'_'+_0x1d46e7;}export function productEnvNames(_0x421e03){const _0x2d19ef=a70_0x44d5cc;return[productEnvName(_0x421e03),...PRODUCT_CONFIG[_0x2d19ef(0x165)]['map'](_0x41ca0c=>_0x41ca0c+'_'+_0x421e03)];}export function productEnv(_0x505769){for(const _0x1ec928 of productEnvNames(_0x505769)){const _0xf1930f=process.env[_0x1ec928];if(_0xf1930f!==undefined)return _0xf1930f;}return undefined;}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a71_0x42b8(){const _0x147a37=['1526268gQudwJ','read','44kfkJcg','write','283125CFnhjL','202697pOjBwI','542WIVgYA','70OAhmiW','high-risk-write','4202784EEptkH','879tPylBF','64500tbKGfh','20qRyvwQ','326584KmNNdS'];a71_0x42b8=function(){return _0x147a37;};return a71_0x42b8();}function a71_0x4e0a(_0x346b3f,_0x3a3dee){_0x346b3f=_0x346b3f-0x172;const _0x42b851=a71_0x42b8();let _0x4e0a09=_0x42b851[_0x346b3f];return _0x4e0a09;}const a71_0x33ed65=a71_0x4e0a;(function(_0x46c27e,_0x34080c){const _0x27767b=a71_0x4e0a,_0xa35164=_0x46c27e();while(!![]){try{const _0x41d991=-parseInt(_0x27767b(0x17a))/0x1+parseInt(_0x27767b(0x17b))/0x2*(parseInt(_0x27767b(0x17f))/0x3)+-parseInt(_0x27767b(0x173))/0x4*(parseInt(_0x27767b(0x179))/0x5)+-parseInt(_0x27767b(0x175))/0x6+-parseInt(_0x27767b(0x17c))/0x7*(-parseInt(_0x27767b(0x174))/0x8)+parseInt(_0x27767b(0x17e))/0x9+parseInt(_0x27767b(0x172))/0xa*(parseInt(_0x27767b(0x177))/0xb);if(_0x41d991===_0x34080c)break;else _0xa35164['push'](_0xa35164['shift']());}catch(_0x450a2c){_0xa35164['push'](_0xa35164['shift']());}}}(a71_0x42b8,0x3aa51));export const RISK_LEVEL_VALUES=[a71_0x33ed65(0x176),a71_0x33ed65(0x178),a71_0x33ed65(0x17d)];
|
package/lib/constant/url.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a72_0x28153a=a72_0x4e2d;(function(_0xf4da62,_0x3f9d22){const _0x2b7e81=a72_0x4e2d,_0x208f5f=_0xf4da62();while(!![]){try{const _0x2d60ad=-parseInt(_0x2b7e81(0x195))/0x1*(-parseInt(_0x2b7e81(0x18d))/0x2)+-parseInt(_0x2b7e81(0x18c))/0x3+-parseInt(_0x2b7e81(0x190))/0x4+-parseInt(_0x2b7e81(0x198))/0x5+parseInt(_0x2b7e81(0x193))/0x6*(parseInt(_0x2b7e81(0x18e))/0x7)+parseInt(_0x2b7e81(0x191))/0x8*(-parseInt(_0x2b7e81(0x192))/0x9)+parseInt(_0x2b7e81(0x18b))/0xa*(parseInt(_0x2b7e81(0x18f))/0xb);if(_0x2d60ad===_0x3f9d22)break;else _0x208f5f['push'](_0x208f5f['shift']());}catch(_0x2ca05c){_0x208f5f['push'](_0x208f5f['shift']());}}}(a72_0x2b40,0xde922));function a72_0x4e2d(_0x11d4c9,_0x5e7ae3){_0x11d4c9=_0x11d4c9-0x18b;const _0x2b40a2=a72_0x2b40();let _0x4e2dd3=_0x2b40a2[_0x11d4c9];return _0x4e2dd3;}import{PRODUCT_CONFIG}from'../constant/product.js';export const USER_ACCESS_KEY_CREATE_URL=''+PRODUCT_CONFIG[a72_0x28153a(0x199)][a72_0x28153a(0x196)][a72_0x28153a(0x194)]+PRODUCT_CONFIG[a72_0x28153a(0x197)];function a72_0x2b40(){const _0x5d24a5=['5944885RmxFOr','domains','9145180IfsivT','3930921SLfjBC','4AqEwdT','14pZnVTs','44vguYCZ','3086472uFAEAu','5517728lMBqov','9AmArlV','2851620QDcFJQ','user','131828CriOXG','production','accessKeyCreatePath'];a72_0x2b40=function(){return _0x5d24a5;};return a72_0x2b40();}
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a73_0x535910=a73_0x3099;(function(_0x313973,_0x1b3db1){const _0x6dff9e=a73_0x3099,_0x1680bc=_0x313973();while(!![]){try{const _0x263a36=-parseInt(_0x6dff9e(0x127))/0x1*(-parseInt(_0x6dff9e(0xf5))/0x2)+-parseInt(_0x6dff9e(0x11f))/0x3*(parseInt(_0x6dff9e(0xfd))/0x4)+-parseInt(_0x6dff9e(0x125))/0x5*(-parseInt(_0x6dff9e(0x134))/0x6)+-parseInt(_0x6dff9e(0x114))/0x7*(-parseInt(_0x6dff9e(0xf9))/0x8)+-parseInt(_0x6dff9e(0x13b))/0x9+-parseInt(_0x6dff9e(0xfb))/0xa*(-parseInt(_0x6dff9e(0x11e))/0xb)+parseInt(_0x6dff9e(0xf4))/0xc*(-parseInt(_0x6dff9e(0x126))/0xd);if(_0x263a36===_0x1b3db1)break;else _0x1680bc['push'](_0x1680bc['shift']());}catch(_0x2d5de9){_0x1680bc['push'](_0x1680bc['shift']());}}}(a73_0x3f8d,0xba0bb));import{readFileSync,existsSync,mkdirSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{resolve,dirname}from'node:path';function a73_0x3099(_0x491f69,_0x3a76aa){_0x491f69=_0x491f69-0xef;const _0x3f8dfb=a73_0x3f8d();let _0x309984=_0x3f8dfb[_0x491f69];return _0x309984;}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[a73_0x535910(0xf7)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a73_0x535910(0x128)];function resolveConfigPath(_0x42632a){for(const _0x14426e of CONFIG_NAMES){const _0x4ab350=resolve(_0x42632a,_0x14426e);if(existsSync(_0x4ab350))return _0x4ab350;}return undefined;}export function resolveWriteConfigPath(_0x994d2b){const _0x308b27=a73_0x535910,_0x15e0c8=_0x994d2b==='project'?process[_0x308b27(0x118)]():homedir(),_0x48879a=resolveConfigPath(_0x15e0c8);return _0x48879a??resolve(_0x15e0c8,NEW_CONFIG_NAME);}export function readConfigFile(_0x5ef608){const _0x11a494=a73_0x535910;try{if(existsSync(_0x5ef608)){const _0x390885=readFileSync(_0x5ef608,{'encoding':_0x11a494(0x10d)});if(_0x390885){const _0x35ecdd=JSON['parse'](_0x390885);return migrateOnlineEnv(_0x5ef608,_0x35ecdd),_0x35ecdd;}}}catch{}return{};}function migrateOnlineEnv(_0x5d82cd,_0x3c5861){const _0x2ccdd3=a73_0x535910;let _0x54e1f5=![];_0x3c5861[_0x2ccdd3(0x135)]===_0x2ccdd3(0xff)&&(_0x3c5861[_0x2ccdd3(0x135)]=_0x2ccdd3(0xf3),_0x54e1f5=!![]);if(_0x3c5861[_0x2ccdd3(0xfc)]&&typeof _0x3c5861[_0x2ccdd3(0xfc)]==='object')for(const _0x653987 of Object[_0x2ccdd3(0x136)](_0x3c5861[_0x2ccdd3(0xfc)])){_0x653987&&_0x653987['env']===_0x2ccdd3(0xff)&&(_0x653987[_0x2ccdd3(0x135)]=_0x2ccdd3(0xf3),_0x54e1f5=!![]);}if(_0x54e1f5)try{writeConfigFile(_0x5d82cd,_0x3c5861);}catch{}}export function writeConfigFile(_0xb4850f,_0x34f863){const _0xdaae22=a73_0x535910,_0x376cae=dirname(_0xb4850f);!existsSync(_0x376cae)&&mkdirSync(_0x376cae,{'recursive':!![]});const _0x445fab=_0xb4850f+_0xdaae22(0xf2);try{writeFileSync(_0x445fab,JSON[_0xdaae22(0x10a)](_0x34f863,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180});try{renameSync(_0x445fab,_0xb4850f);}catch(_0x5437dd){if(_0x5437dd[_0xdaae22(0xf1)]==='EPERM'||_0x5437dd[_0xdaae22(0xf1)]===_0xdaae22(0x13a)||_0x5437dd[_0xdaae22(0xf1)]==='EACCES'){writeFileSync(_0xb4850f,JSON[_0xdaae22(0x10a)](_0x34f863,null,0x2)+'\x0a',{'encoding':_0xdaae22(0x10d)});try{unlinkSync(_0x445fab);}catch{}}else throw _0x5437dd;}}catch(_0x2b7f84){try{unlinkSync(_0x445fab);}catch{}throw _0x2b7f84;}}export function isNonInteractiveMode(_0x3b3f16){const _0x5b1b0d=a73_0x535910;return!!(_0x3b3f16[_0x5b1b0d(0x129)]||_0x3b3f16['ci']||productEnvNames('CI')[_0x5b1b0d(0x110)](_0x285850=>process.env[_0x285850]===_0x5b1b0d(0x101))||process.env.CI===_0x5b1b0d(0x101)||!process['stdout']['isTTY']||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x1d0712=a73_0x535910;if(!process[_0x1d0712(0xfa)][_0x1d0712(0x103)])return![];try{const _0x1a103f=process[_0x1d0712(0xfa)][_0x1d0712(0x102)];return process[_0x1d0712(0xfa)][_0x1d0712(0xf6)](!![]),process['stdin'][_0x1d0712(0xf6)](_0x1a103f??![]),!![];}catch{return![];}}export async function createContext(_0x2e923a){const _0x25941e=a73_0x535910,_0x146bd3=readRawConfig(),_0x5b3666=buildConfig(_0x146bd3,_0x2e923a);await initGlobalEnvironment(_0x5b3666);const {getUserDomain:_0x7948be,getApiDomain:_0x3c95fb}=await import(_0x25941e(0xfe)),_0x307d77={'apiDomain':_0x3c95fb(),'userDomain':_0x7948be()},_0x515226=await buildAuth(_0x5b3666);logger[_0x25941e(0x12a)](process[_0x25941e(0x118)]());const _0x51b079=(CLI_BIN_NAME+'\x20'+process[_0x25941e(0x108)][_0x25941e(0x133)](0x2)[_0x25941e(0x10c)]('\x20'))[_0x25941e(0xf8)]();logger[_0x25941e(0x138)](_0x51b079);const _0x3a7554=isNonInteractiveMode(_0x2e923a);return{'config':_0x5b3666,'auth':_0x515226,'logger':logger,'env':_0x307d77,'nonInteractive':_0x3a7554};}export function buildConfigFromFlags(_0x185af3){return buildConfig(readRawConfig(),_0x185af3);}export function getLocalAppAliases(_0x46abac){const _0x3e6b0b=a73_0x535910;return _0x46abac[_0x3e6b0b(0xfc)]&&typeof _0x46abac['apps']===_0x3e6b0b(0x12b)?_0x46abac[_0x3e6b0b(0xfc)]:{};}export function resolveLocalAppAliasCode(_0xdc81fe,_0x5ce9cb){const _0x1ca7fc=a73_0x535910;if(!_0x5ce9cb)return undefined;const _0x110044=getLocalAppAliases(_0xdc81fe)[_0x5ce9cb],_0x63644b=_0x110044?.['appcode'];return typeof _0x63644b===_0x1ca7fc(0x11b)&&_0x63644b[_0x1ca7fc(0xf8)]()?_0x63644b['trim']():undefined;}export function readAppCodeFromConfig(){const _0x43099b=a73_0x535910,_0x3e9c32=readRawConfig(),_0x29c9b5=_0x3e9c32[_0x43099b(0x130)]??_0x3e9c32['app'];if(typeof _0x29c9b5==='string'&&_0x29c9b5['trim']())return _0x29c9b5[_0x43099b(0xf8)]();const _0x40fbf7=resolveLocalAppAliasCode(_0x3e9c32,typeof _0x3e9c32[_0x43099b(0x113)]===_0x43099b(0x11b)?_0x3e9c32['defaultApp']:undefined);if(_0x40fbf7)return _0x40fbf7;const _0x4c9fc2=normalizeEnv(String(_0x3e9c32[_0x43099b(0x135)]||_0x43099b(0xf3))),_0x8302b7=isDaily(_0x4c9fc2)?_0x43099b(0x124):isDev(_0x4c9fc2)?_0x43099b(0x121):'production',_0x110e2a=resolveCachedAppCode(typeof _0x3e9c32[_0x43099b(0x113)]===_0x43099b(0x11b)?_0x3e9c32['defaultApp']:undefined,_0x8302b7,typeof _0x3e9c32[_0x43099b(0x10b)]===_0x43099b(0x11b)?_0x3e9c32[_0x43099b(0x10b)]:undefined);if(_0x110e2a)return _0x110e2a;const _0x4e9cc0=Object['values'](getLocalAppAliases(_0x3e9c32))[_0x43099b(0x123)](_0x494eab=>_0x494eab?.[_0x43099b(0x130)]);return typeof _0x4e9cc0?.[_0x43099b(0x130)]===_0x43099b(0x11b)&&_0x4e9cc0[_0x43099b(0x130)]['trim']()?_0x4e9cc0[_0x43099b(0x130)]['trim']():undefined;}export function readScopedConfig(_0x8e1734){const _0x553026=a73_0x535910,_0x5a6929=_0x8e1734['global']?'global':_0x553026(0x120);return readConfigFile(resolveWriteConfigPath(_0x5a6929));}export function writeScopedConfig(_0x328e4d,_0x2712c9){const _0x4d668b=a73_0x535910,_0x41916f=_0x2712c9[_0x4d668b(0x117)]?_0x4d668b(0x117):_0x4d668b(0x120);writeConfigFile(resolveWriteConfigPath(_0x41916f),_0x328e4d);}export async function initGlobalEnvironment(_0x4b0544){const _0xbe3a5d=a73_0x535910,{initEnv:_0x330132}=await import(_0xbe3a5d(0x13d));_0x330132(_0x4b0544['env']);const {initDomains:_0x3599f5}=await import(_0xbe3a5d(0xfe));_0x3599f5({'apiDomain':_0x4b0544[_0xbe3a5d(0x111)][_0xbe3a5d(0x105)]||_0x4b0544[_0xbe3a5d(0x111)]['host']||undefined,'userDomain':_0x4b0544[_0xbe3a5d(0x111)][_0xbe3a5d(0xef)]||undefined,'runtimeDomain':_0x4b0544['raw']['runtimeDomain']||undefined,'skillHubDomain':_0x4b0544['raw'][_0xbe3a5d(0x12f)]||undefined});}export function getProjectConfigPath(){const _0x416bff=a73_0x535910;return resolveConfigPath(process[_0x416bff(0x118)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x357eb9){const _0x3237e1=a73_0x535910;if(!existsSync(_0x357eb9))return{'status':_0x3237e1(0x10f)};try{const _0x721b59=readFileSync(_0x357eb9,{'encoding':_0x3237e1(0x10d)});if(!_0x721b59?.[_0x3237e1(0xf8)]())return{'status':_0x3237e1(0x116)};const _0x43aa27=JSON[_0x3237e1(0x109)](_0x721b59);return{'status':'ok','data':_0x43aa27};}catch(_0x3c7a64){return{'status':_0x3237e1(0x11c),'message':_0x3c7a64 instanceof Error?_0x3c7a64[_0x3237e1(0x112)]:String(_0x3c7a64)};}}export function loadRawConfigLayers(_0x542a09){const _0x13475e=a73_0x535910;let _0x182175={},_0x1fdace={},_0x2efc7f,_0x473b09;try{_0x2efc7f=resolveConfigPath(homedir());if(_0x2efc7f){const _0x56b6f6=readFileSync(_0x2efc7f,{'encoding':'utf8'});if(_0x56b6f6)_0x182175=JSON[_0x13475e(0x109)](_0x56b6f6);}}catch{}try{const _0x5d7dad=_0x542a09||process[_0x13475e(0x118)]();_0x473b09=resolveConfigPath(_0x5d7dad);if(_0x473b09){const _0x11fb66=readFileSync(_0x473b09,{'encoding':'utf8'});if(_0x11fb66)_0x1fdace=JSON[_0x13475e(0x109)](_0x11fb66);}}catch{}return{'globalPath':_0x2efc7f,'projectPath':_0x473b09,'globalConfig':_0x182175,'projectConfig':_0x1fdace};}function mergeRawConfigLayers(_0x2b21c6){const _0x2b093f=a73_0x535910,{globalConfig:_0x9fd4a3,projectConfig:_0x2f6926}=_0x2b21c6;if(_0x2f6926['inherit']===![]){const _0x5ec580={..._0x2f6926};return delete _0x5ec580[_0x2b093f(0x137)],_0x5ec580;}const _0x5dac2d={..._0x9fd4a3,..._0x2f6926};if('defaultApp'in _0x2f6926)_0x5dac2d[_0x2b093f(0x113)]=_0x2f6926[_0x2b093f(0x113)];else _0x9fd4a3['defaultApp']&&(_0x5dac2d['defaultApp']=_0x9fd4a3['defaultApp']);return _0x5dac2d;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x14ca8a){return mergeRawConfigLayers(loadRawConfigLayers(_0x14ca8a));}export function readRawConfigWithLayers(_0xe7e12c){const _0x34ed8a=loadRawConfigLayers(_0xe7e12c);return{'config':mergeRawConfigLayers(_0x34ed8a),'layers':_0x34ed8a};}function a73_0x3f8d(){const _0x13af8b=['globalConfig','slice','1044612ffyXLL','env','values','inherit','setRawCommand','FORMAT','EXDEV','11261826shViCq','pageSize','./constant/env.js','read','explicit','userDomain','locale','code','.tmp','production','15275100Tiuuor','2748862sxuoLc','setRawMode','configFileNames','trim','616008AQqbvQ','stdin','9383270UwZSAg','apps','2188CMfuZS','./constant/domain.js','online','APPCODE','true','isRaw','isTTY','top-level','apiDomain','maxRisk','riskLevel','argv','parse','stringify','accessKey','join','utf8','authRequired','missing','some','raw','message','defaultApp','77CEhNXN','write','empty','global','cwd','projectConfig','app','string','error','ACCESS_KEY','11fsGANT','261YcFMMM','project','development','VERBOSE','find','daily','5ReYaNg','13WXIxlx','1AiAbsk','newConfigFileName','nonInteractive','setLogPath','object','format','local-alias','ENV','skillHubDomain','appcode','cache'];a73_0x3f8d=function(){return _0x13af8b;};return a73_0x3f8d();}export function resolveDefaultAppSource(_0x141566){const _0x40ac8e=a73_0x535910;if(_0x40ac8e(0x113)in _0x141566[_0x40ac8e(0x119)])return _0x40ac8e(0x120);if(_0x141566[_0x40ac8e(0x119)]['inherit']===![])return null;if(_0x141566[_0x40ac8e(0x132)][_0x40ac8e(0x113)])return _0x40ac8e(0x117);return null;}function buildConfig(_0x2b30e4,_0x174c6f){const _0x4350cb=a73_0x535910,_0x98db4d=_0x2b30e4['defaultApp']||undefined,_0x3a8bea=_0x174c6f[_0x4350cb(0x11a)]||env('APP')||undefined,_0x4eeeac=_0x3a8bea||_0x98db4d||undefined,_0x181707=env(_0x4350cb(0x11d))||_0x2b30e4[_0x4350cb(0x10b)]||undefined,_0x29ffc2=_0x174c6f[_0x4350cb(0x135)]||env(_0x4350cb(0x12e))||_0x2b30e4[_0x4350cb(0x135)]||DEFAULT_CONFIG_VALUES[_0x4350cb(0x135)],_0xb3f584=normalizeEnv(String(_0x29ffc2)),_0x1eb71c=isDaily(_0xb3f584)?'daily':isDev(_0xb3f584)?_0x4350cb(0x121):_0x4350cb(0xf3),_0x4bb0e1=typeof _0x174c6f[_0x4350cb(0x130)]===_0x4350cb(0x11b)?_0x174c6f[_0x4350cb(0x130)]:undefined,_0x12793e=env(_0x4350cb(0x100)),_0x7f9b19=_0x3a8bea?undefined:_0x2b30e4[_0x4350cb(0x130)]||_0x2b30e4[_0x4350cb(0x11a)]||undefined,_0x27ea0a=_0x3a8bea||(_0x7f9b19?undefined:_0x98db4d),_0x55589a=resolveLocalAppAliasCode(_0x2b30e4,_0x27ea0a),_0x3576f4=resolveCachedAppCode(_0x27ea0a,_0x1eb71c,_0x181707),_0x51ee66=_0x4bb0e1||_0x12793e||_0x7f9b19||_0x55589a||_0x3576f4||undefined,_0x15d853=_0x4bb0e1?_0x4350cb(0x13f):_0x12793e?_0x4350cb(0x135):_0x7f9b19?_0x4350cb(0x104):_0x55589a?_0x4350cb(0x12d):_0x3576f4?_0x4350cb(0x131):undefined,_0x12f235=_0x2b30e4[_0x4350cb(0xf0)]||DEFAULT_CONFIG_VALUES[_0x4350cb(0xf0)],_0x5a2f72=undefined,_0x19009d=_0x174c6f[_0x4350cb(0x12c)]||env(_0x4350cb(0x139))||_0x2b30e4[_0x4350cb(0x12c)],_0x32aa4b=normalizeLegacyOutputFormat(_0x19009d),_0x172ca3=env('PAGE_SIZE')||_0x2b30e4[_0x4350cb(0x13c)],_0x25eeb4=_0x172ca3?Number(_0x172ca3)||undefined:undefined,_0x2a1b99=_0x2b30e4[_0x4350cb(0x107)]||_0x2b30e4[_0x4350cb(0x106)],_0xb45118=_0x2a1b99===_0x4350cb(0x13e)||_0x2a1b99===_0x4350cb(0x115)||_0x2a1b99==='high-risk-write'?_0x2a1b99:DEFAULT_CONFIG_VALUES[_0x4350cb(0x107)],_0x1f27ed=env(_0x4350cb(0x122)),_0x27cef8=_0x1f27ed==='1'||_0x1f27ed===_0x4350cb(0x101);return{'appCode':typeof _0x51ee66==='string'&&_0x51ee66[_0x4350cb(0xf8)]()?_0x51ee66[_0x4350cb(0xf8)]():undefined,'appCodeSource':_0x15d853,'env':_0x1eb71c,'locale':_0x12f235,'cookie':_0x5a2f72,'accessKey':_0x181707,'format':_0x32aa4b,'pageSize':_0x25eeb4,'riskLevel':_0xb45118,'verbose':_0x27cef8,'defaultApp':_0x98db4d,'currentApp':typeof _0x4eeeac==='string'?_0x4eeeac:undefined,'raw':_0x2b30e4};}function env(_0x5ef295){return productEnv(_0x5ef295);}async function buildAuth(_0x318e01){const _0x1d1f69='',_0x30f76e=!!_0x318e01['accessKey'];return{'cookie':_0x1d1f69,'isLoggedIn':_0x30f76e,async 'getOrLogin'(){const _0x43483f=a73_0x3099;if(_0x30f76e)return _0x1d1f69;throw CliErrors[_0x43483f(0x10e)]();}};}
|
|
1
|
+
const a73_0x3543cd=a73_0x3982;(function(_0x290555,_0x4bd804){const _0x1c12c5=a73_0x3982,_0x50ebf0=_0x290555();while(!![]){try{const _0x9dccb8=parseInt(_0x1c12c5(0x17f))/0x1*(-parseInt(_0x1c12c5(0x167))/0x2)+-parseInt(_0x1c12c5(0x153))/0x3*(-parseInt(_0x1c12c5(0x155))/0x4)+parseInt(_0x1c12c5(0x183))/0x5+parseInt(_0x1c12c5(0x171))/0x6+parseInt(_0x1c12c5(0x16a))/0x7+parseInt(_0x1c12c5(0x17c))/0x8+-parseInt(_0x1c12c5(0x15e))/0x9*(parseInt(_0x1c12c5(0x158))/0xa);if(_0x9dccb8===_0x4bd804)break;else _0x50ebf0['push'](_0x50ebf0['shift']());}catch(_0x373aa1){_0x50ebf0['push'](_0x50ebf0['shift']());}}}(a73_0x1415,0x65aea));import{readFileSync,existsSync,mkdirSync,renameSync,unlinkSync,writeFileSync}from'node:fs';function a73_0x1415(){const _0x2726d7=['some','1397965rBmZaw','configFileNames','raw','.tmp','daily','nonInteractive','true','./constant/domain.js','format','join','PAGE_SIZE','top-level','FORMAT','runtimeDomain','stdout','read','defaultApp','inherit','stringify','argv','object','online','cache','find','userDomain','3513IWNgPB','setLogPath','1064FOBFwZ','empty','riskLevel','6426020jmRgYk','apps','APP','EPERM','stdin','trim','27lnLRNL','global','globalConfig','local-alias','string','appcode','newConfigFileName','authRequired','apiDomain','4314pmQcBy','parse','values','3946775KYfglu','project','utf8','env','isTTY','APPCODE','ACCESS_KEY','4678068RoQCaI','setRawMode','isRaw','cwd','pageSize','message','slice','locale','development','skillHubDomain','projectConfig','6193976toakLC','accessKey','production','169TisdbR','code','app'];a73_0x1415=function(){return _0x2726d7;};return a73_0x1415();}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';function a73_0x3982(_0x29468e,_0x229a37){_0x29468e=_0x29468e-0x13c;const _0x141506=a73_0x1415();let _0x3982fb=_0x141506[_0x29468e];return _0x3982fb;}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_0x3543cd(0x184)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a73_0x3543cd(0x164)];function resolveConfigPath(_0x4f1876){for(const _0x1c6521 of CONFIG_NAMES){const _0x3e2086=resolve(_0x4f1876,_0x1c6521);if(existsSync(_0x3e2086))return _0x3e2086;}return undefined;}export function resolveWriteConfigPath(_0x1e7041){const _0x32b42c=a73_0x3543cd,_0x417c2c=_0x1e7041===_0x32b42c(0x16b)?process[_0x32b42c(0x174)]():homedir(),_0x137824=resolveConfigPath(_0x417c2c);return _0x137824??resolve(_0x417c2c,NEW_CONFIG_NAME);}export function readConfigFile(_0x2ba26a){const _0x49fad2=a73_0x3543cd;try{if(existsSync(_0x2ba26a)){const _0x4d4319=readFileSync(_0x2ba26a,{'encoding':_0x49fad2(0x16c)});if(_0x4d4319){const _0x4a2709=JSON[_0x49fad2(0x168)](_0x4d4319);return migrateOnlineEnv(_0x2ba26a,_0x4a2709),_0x4a2709;}}}catch{}return{};}function migrateOnlineEnv(_0x53249e,_0x1827b6){const _0x326b93=a73_0x3543cd;let _0x953122=![];_0x1827b6[_0x326b93(0x16d)]===_0x326b93(0x14f)&&(_0x1827b6[_0x326b93(0x16d)]=_0x326b93(0x17e),_0x953122=!![]);if(_0x1827b6['apps']&&typeof _0x1827b6[_0x326b93(0x159)]===_0x326b93(0x14e))for(const _0x9b6838 of Object[_0x326b93(0x169)](_0x1827b6[_0x326b93(0x159)])){_0x9b6838&&_0x9b6838[_0x326b93(0x16d)]===_0x326b93(0x14f)&&(_0x9b6838['env']='production',_0x953122=!![]);}if(_0x953122)try{writeConfigFile(_0x53249e,_0x1827b6);}catch{}}export function writeConfigFile(_0x1bc378,_0x58e01d){const _0x508086=a73_0x3543cd,_0x2c6700=dirname(_0x1bc378);!existsSync(_0x2c6700)&&mkdirSync(_0x2c6700,{'recursive':!![]});const _0x397af2=_0x1bc378+_0x508086(0x13d);try{writeFileSync(_0x397af2,JSON[_0x508086(0x14c)](_0x58e01d,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180});try{renameSync(_0x397af2,_0x1bc378);}catch(_0xe98bff){if(_0xe98bff[_0x508086(0x180)]===_0x508086(0x15b)||_0xe98bff['code']==='EXDEV'||_0xe98bff[_0x508086(0x180)]==='EACCES'){writeFileSync(_0x1bc378,JSON['stringify'](_0x58e01d,null,0x2)+'\x0a',{'encoding':_0x508086(0x16c)});try{unlinkSync(_0x397af2);}catch{}}else throw _0xe98bff;}}catch(_0x1a8bca){try{unlinkSync(_0x397af2);}catch{}throw _0x1a8bca;}}export function isNonInteractiveMode(_0x46d4d3){const _0x5b52d7=a73_0x3543cd;return!!(_0x46d4d3[_0x5b52d7(0x13f)]||_0x46d4d3['ci']||productEnvNames('CI')[_0x5b52d7(0x182)](_0x1b8289=>process.env[_0x1b8289]===_0x5b52d7(0x140))||process.env.CI===_0x5b52d7(0x140)||!process[_0x5b52d7(0x148)]['isTTY']||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x52e220=a73_0x3543cd;if(!process[_0x52e220(0x15c)][_0x52e220(0x16e)])return![];try{const _0xc26fd5=process[_0x52e220(0x15c)][_0x52e220(0x173)];return process[_0x52e220(0x15c)][_0x52e220(0x172)](!![]),process[_0x52e220(0x15c)][_0x52e220(0x172)](_0xc26fd5??![]),!![];}catch{return![];}}export async function createContext(_0x4492a4){const _0x28648f=a73_0x3543cd,_0x36cf54=readRawConfig(),_0xb3e807=buildConfig(_0x36cf54,_0x4492a4);await initGlobalEnvironment(_0xb3e807);const {getUserDomain:_0x20bc7b,getApiDomain:_0x4e7a32}=await import(_0x28648f(0x141)),_0x4c86e0={'apiDomain':_0x4e7a32(),'userDomain':_0x20bc7b()},_0x284efb=await buildAuth(_0xb3e807);logger[_0x28648f(0x154)](process[_0x28648f(0x174)]());const _0x5919d0=(CLI_BIN_NAME+'\x20'+process[_0x28648f(0x14d)][_0x28648f(0x177)](0x2)[_0x28648f(0x143)]('\x20'))[_0x28648f(0x15d)]();logger['setRawCommand'](_0x5919d0);const _0x437e12=isNonInteractiveMode(_0x4492a4);return{'config':_0xb3e807,'auth':_0x284efb,'logger':logger,'env':_0x4c86e0,'nonInteractive':_0x437e12};}export function buildConfigFromFlags(_0x1af480){return buildConfig(readRawConfig(),_0x1af480);}export function getLocalAppAliases(_0x11d4b0){const _0x1d0535=a73_0x3543cd;return _0x11d4b0[_0x1d0535(0x159)]&&typeof _0x11d4b0[_0x1d0535(0x159)]===_0x1d0535(0x14e)?_0x11d4b0[_0x1d0535(0x159)]:{};}export function resolveLocalAppAliasCode(_0x9928a1,_0x4943bc){const _0x420392=a73_0x3543cd;if(!_0x4943bc)return undefined;const _0x195980=getLocalAppAliases(_0x9928a1)[_0x4943bc],_0x28a930=_0x195980?.[_0x420392(0x163)];return typeof _0x28a930===_0x420392(0x162)&&_0x28a930[_0x420392(0x15d)]()?_0x28a930[_0x420392(0x15d)]():undefined;}export function readAppCodeFromConfig(){const _0x420624=a73_0x3543cd,_0xb74475=readRawConfig(),_0x485e9a=_0xb74475[_0x420624(0x163)]??_0xb74475[_0x420624(0x181)];if(typeof _0x485e9a===_0x420624(0x162)&&_0x485e9a[_0x420624(0x15d)]())return _0x485e9a[_0x420624(0x15d)]();const _0xed741b=resolveLocalAppAliasCode(_0xb74475,typeof _0xb74475[_0x420624(0x14a)]==='string'?_0xb74475[_0x420624(0x14a)]:undefined);if(_0xed741b)return _0xed741b;const _0x474d64=normalizeEnv(String(_0xb74475[_0x420624(0x16d)]||_0x420624(0x17e))),_0x4c93b3=isDaily(_0x474d64)?_0x420624(0x13e):isDev(_0x474d64)?_0x420624(0x179):_0x420624(0x17e),_0x282565=resolveCachedAppCode(typeof _0xb74475[_0x420624(0x14a)]===_0x420624(0x162)?_0xb74475['defaultApp']:undefined,_0x4c93b3,typeof _0xb74475['accessKey']===_0x420624(0x162)?_0xb74475[_0x420624(0x17d)]:undefined);if(_0x282565)return _0x282565;const _0x814ce1=Object[_0x420624(0x169)](getLocalAppAliases(_0xb74475))[_0x420624(0x151)](_0x30f271=>_0x30f271?.[_0x420624(0x163)]);return typeof _0x814ce1?.[_0x420624(0x163)]==='string'&&_0x814ce1[_0x420624(0x163)]['trim']()?_0x814ce1['appcode']['trim']():undefined;}export function readScopedConfig(_0x2e6847){const _0x19a634=a73_0x3543cd,_0x3e5d1d=_0x2e6847[_0x19a634(0x15f)]?_0x19a634(0x15f):_0x19a634(0x16b);return readConfigFile(resolveWriteConfigPath(_0x3e5d1d));}export function writeScopedConfig(_0x3fdcfc,_0xdd6059){const _0x46f698=a73_0x3543cd,_0x39b75d=_0xdd6059[_0x46f698(0x15f)]?_0x46f698(0x15f):_0x46f698(0x16b);writeConfigFile(resolveWriteConfigPath(_0x39b75d),_0x3fdcfc);}export async function initGlobalEnvironment(_0x3e4732){const _0x5020d7=a73_0x3543cd,{initEnv:_0x24d94c}=await import('./constant/env.js');_0x24d94c(_0x3e4732['env']);const {initDomains:_0x42b121}=await import(_0x5020d7(0x141));_0x42b121({'apiDomain':_0x3e4732[_0x5020d7(0x13c)][_0x5020d7(0x166)]||_0x3e4732[_0x5020d7(0x13c)]['host']||undefined,'userDomain':_0x3e4732[_0x5020d7(0x13c)][_0x5020d7(0x152)]||undefined,'runtimeDomain':_0x3e4732[_0x5020d7(0x13c)][_0x5020d7(0x147)]||undefined,'skillHubDomain':_0x3e4732[_0x5020d7(0x13c)][_0x5020d7(0x17a)]||undefined});}export function getProjectConfigPath(){const _0x7641e8=a73_0x3543cd;return resolveConfigPath(process[_0x7641e8(0x174)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x1b1ba5){const _0x4e70e8=a73_0x3543cd;if(!existsSync(_0x1b1ba5))return{'status':'missing'};try{const _0x2c02a0=readFileSync(_0x1b1ba5,{'encoding':_0x4e70e8(0x16c)});if(!_0x2c02a0?.[_0x4e70e8(0x15d)]())return{'status':_0x4e70e8(0x156)};const _0x3da03b=JSON[_0x4e70e8(0x168)](_0x2c02a0);return{'status':'ok','data':_0x3da03b};}catch(_0x155f4b){return{'status':'error','message':_0x155f4b instanceof Error?_0x155f4b[_0x4e70e8(0x176)]:String(_0x155f4b)};}}export function loadRawConfigLayers(_0x466571){const _0x4b8b4a=a73_0x3543cd;let _0x57b330={},_0x10e926={},_0xbac666,_0x54d4d5;try{_0xbac666=resolveConfigPath(homedir());if(_0xbac666){const _0x5af06f=readFileSync(_0xbac666,{'encoding':_0x4b8b4a(0x16c)});if(_0x5af06f)_0x57b330=JSON[_0x4b8b4a(0x168)](_0x5af06f);}}catch{}try{const _0x434b5c=_0x466571||process[_0x4b8b4a(0x174)]();_0x54d4d5=resolveConfigPath(_0x434b5c);if(_0x54d4d5){const _0x4367b3=readFileSync(_0x54d4d5,{'encoding':_0x4b8b4a(0x16c)});if(_0x4367b3)_0x10e926=JSON['parse'](_0x4367b3);}}catch{}return{'globalPath':_0xbac666,'projectPath':_0x54d4d5,'globalConfig':_0x57b330,'projectConfig':_0x10e926};}function mergeRawConfigLayers(_0x571bf3){const _0x39f011=a73_0x3543cd,{globalConfig:_0x47591c,projectConfig:_0x464424}=_0x571bf3;if(_0x464424[_0x39f011(0x14b)]===![]){const _0xce73a4={..._0x464424};return delete _0xce73a4[_0x39f011(0x14b)],_0xce73a4;}const _0x5b4cd6={..._0x47591c,..._0x464424};if(_0x39f011(0x14a)in _0x464424)_0x5b4cd6[_0x39f011(0x14a)]=_0x464424[_0x39f011(0x14a)];else _0x47591c[_0x39f011(0x14a)]&&(_0x5b4cd6['defaultApp']=_0x47591c[_0x39f011(0x14a)]);return _0x5b4cd6;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x5712a7){return mergeRawConfigLayers(loadRawConfigLayers(_0x5712a7));}export function readRawConfigWithLayers(_0x197809){const _0x130731=loadRawConfigLayers(_0x197809);return{'config':mergeRawConfigLayers(_0x130731),'layers':_0x130731};}export function resolveDefaultAppSource(_0x43d391){const _0x35df74=a73_0x3543cd;if(_0x35df74(0x14a)in _0x43d391[_0x35df74(0x17b)])return _0x35df74(0x16b);if(_0x43d391['projectConfig'][_0x35df74(0x14b)]===![])return null;if(_0x43d391[_0x35df74(0x160)][_0x35df74(0x14a)])return'global';return null;}function buildConfig(_0x177111,_0x5b2f9f){const _0x3d4b32=a73_0x3543cd,_0x246a17=_0x177111[_0x3d4b32(0x14a)]||undefined,_0x5b5485=_0x5b2f9f['app']||env(_0x3d4b32(0x15a))||undefined,_0x1bc32a=_0x5b5485||_0x246a17||undefined,_0x377567=env(_0x3d4b32(0x170))||_0x177111[_0x3d4b32(0x17d)]||undefined,_0x50cf13=_0x5b2f9f['env']||env('ENV')||_0x177111[_0x3d4b32(0x16d)]||DEFAULT_CONFIG_VALUES[_0x3d4b32(0x16d)],_0x44bb85=normalizeEnv(String(_0x50cf13)),_0xcbd2b0=isDaily(_0x44bb85)?_0x3d4b32(0x13e):isDev(_0x44bb85)?_0x3d4b32(0x179):_0x3d4b32(0x17e),_0x2b81f9=typeof _0x5b2f9f[_0x3d4b32(0x163)]===_0x3d4b32(0x162)?_0x5b2f9f[_0x3d4b32(0x163)]:undefined,_0x4fc96d=env(_0x3d4b32(0x16f)),_0xd7a40e=_0x5b5485?undefined:_0x177111[_0x3d4b32(0x163)]||_0x177111['app']||undefined,_0x44502b=_0x5b5485||(_0xd7a40e?undefined:_0x246a17),_0x24876c=resolveLocalAppAliasCode(_0x177111,_0x44502b),_0x229bc4=resolveCachedAppCode(_0x44502b,_0xcbd2b0,_0x377567),_0x2f67df=_0x2b81f9||_0x4fc96d||_0xd7a40e||_0x24876c||_0x229bc4||undefined,_0x616cbd=_0x2b81f9?'explicit':_0x4fc96d?_0x3d4b32(0x16d):_0xd7a40e?_0x3d4b32(0x145):_0x24876c?_0x3d4b32(0x161):_0x229bc4?_0x3d4b32(0x150):undefined,_0x5e102e=_0x177111[_0x3d4b32(0x178)]||DEFAULT_CONFIG_VALUES[_0x3d4b32(0x178)],_0x306059=undefined,_0x1bcbdc=_0x5b2f9f[_0x3d4b32(0x142)]||env(_0x3d4b32(0x146))||_0x177111[_0x3d4b32(0x142)],_0x54e8d2=normalizeLegacyOutputFormat(_0x1bcbdc),_0x3ee851=env(_0x3d4b32(0x144))||_0x177111[_0x3d4b32(0x175)],_0x57f11d=_0x3ee851?Number(_0x3ee851)||undefined:undefined,_0x3c7a5e=_0x177111[_0x3d4b32(0x157)]||_0x177111['maxRisk'],_0x272e7f=_0x3c7a5e===_0x3d4b32(0x149)||_0x3c7a5e==='write'||_0x3c7a5e==='high-risk-write'?_0x3c7a5e:DEFAULT_CONFIG_VALUES['riskLevel'],_0x19117a=env('VERBOSE'),_0x59ff4c=_0x19117a==='1'||_0x19117a===_0x3d4b32(0x140);return{'appCode':typeof _0x2f67df==='string'&&_0x2f67df[_0x3d4b32(0x15d)]()?_0x2f67df['trim']():undefined,'appCodeSource':_0x616cbd,'env':_0xcbd2b0,'locale':_0x5e102e,'cookie':_0x306059,'accessKey':_0x377567,'format':_0x54e8d2,'pageSize':_0x57f11d,'riskLevel':_0x272e7f,'verbose':_0x59ff4c,'defaultApp':_0x246a17,'currentApp':typeof _0x1bc32a===_0x3d4b32(0x162)?_0x1bc32a:undefined,'raw':_0x177111};}function env(_0x4fbe87){return productEnv(_0x4fbe87);}async function buildAuth(_0x252a14){const _0x5b0406=a73_0x3543cd,_0x2d7ee2='',_0x35322f=!!_0x252a14[_0x5b0406(0x17d)];return{'cookie':_0x2d7ee2,'isLoggedIn':_0x35322f,async 'getOrLogin'(){const _0x14ce9f=_0x5b0406;if(_0x35322f)return _0x2d7ee2;throw CliErrors[_0x14ce9f(0x165)]();}};}
|