@lovrabet/lovrabet-cli 2.1.8 → 2.1.9-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/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
|
-
(function(_0x3243a1,_0x4e5ab9){const _0x21288a=a104_0x4c3f,_0x50ca7b=_0x3243a1();while(!![]){try{const _0x2b6d39=parseInt(_0x21288a(0xac))/0x1+parseInt(_0x21288a(0xa6))/0x2+parseInt(_0x21288a(0x7a))/0x3+-parseInt(_0x21288a(0x88))/0x4+parseInt(_0x21288a(0x89))/0x5*(-parseInt(_0x21288a(0xa7))/0x6)+parseInt(_0x21288a(0x8a))/0x7*(-parseInt(_0x21288a(0xb6))/0x8)+parseInt(_0x21288a(0xba))/0x9;if(_0x2b6d39===_0x4e5ab9)break;else _0x50ca7b['push'](_0x50ca7b['shift']());}catch(_0x3b06c5){_0x50ca7b['push'](_0x50ca7b['shift']());}}}(a104_0xd8fa,0xb85ee));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a104_0x30dbdf}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';function a104_0xd8fa(){const _0x1a9a7c=['ignoreMetadataSkillCode','string','refreshedAt','startsWith','some','skillName','ignoreMetadataScope','8MOqZcY','Invalid\x20','version','trim','4222386iOJMDj','ignoreInvalidMetadata','595338vLuKvE','find','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','description','replace','sourceSessionId','validation','object','company','slice','toLowerCase','ignoreMetadataAppCodeMismatch','content','\x20has\x20scope=\x22','2473984oRYVAS','1139955NdDRJk','6975255zIHflA','boolean','Skill\x20metadata\x20appCode\x20\x22','filter','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','\x20has\x20unsupported\x20scope\x20\x22','scope','isArray','displayName','skillCode','match','ignoreMetadataForPayload','\x20name\x20for\x20SkillHub\x20slug\x20generation.','isSymbolicLink','path','unknown','metadata','dir','name','allowAppCodeRetarget','Missing\x20','builtin','Remote\x20Skill\x20','appCode','personal','tags','Skill\x20directory\x20not\x20found:\x20','files','2889330PzHmui','12AfDfjM','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','utf8','number',',\x20or\x20directory\x20name.','713860WifGWc','targetScope','isFile'];a104_0xd8fa=function(){return _0x1a9a7c;};return a104_0xd8fa();}import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x28b57f,_0x34472a,_0x271008={}){const _0x466d91=a104_0x4c3f,_0x8123aa=resolvePushDirectoryRoot(_0x28b57f),_0x1435dd=readPushMetadataIfPresent(resolve(_0x8123aa,METADATA_FILE),{'ignoreInvalidMetadata':_0x271008[_0x466d91(0xbb)]});if(_0x1435dd?.[_0x466d91(0xa1)]&&_0x1435dd['appCode']!==_0x34472a&&!_0x271008[_0x466d91(0x9d)]&&!_0x271008[_0x466d91(0x85)])throw CliErrors[_0x466d91(0x80)](_0x466d91(0x8c)+_0x1435dd[_0x466d91(0xa1)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x34472a+'\x22.');const _0x29e543=resolvePushSkillCode(_0x8123aa,_0x34472a,_0x1435dd,_0x271008);if(!_0x29e543)throw CliErrors[_0x466d91(0x80)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x466d91(0xab));return{'dir':_0x8123aa,'skillCode':_0x29e543,'metadata':_0x1435dd};}export function readPushDirectory(_0x1e23de,_0x587443,_0x5e2501={}){const _0x485df3=a104_0x4c3f,_0x4b5b7c=resolvePushDirectoryIdentity(_0x1e23de,_0x587443,_0x5e2501),_0x5f0117=_0x4b5b7c[_0x485df3(0x9b)],_0x224759=resolve(_0x5f0117,SKILL_FILE);if(!existsSync(_0x224759)||!lstatSync(_0x224759)[_0x485df3(0xae)]())throw CliErrors[_0x485df3(0x80)](_0x485df3(0x9e)+SKILL_FILE+':\x20'+_0x224759);const _0x50b50d=_0x4b5b7c[_0x485df3(0x9a)],_0x193550=_0x5e2501[_0x485df3(0xad)]??'personal';if(!_0x5e2501[_0x485df3(0xb5)]&&_0x50b50d?.[_0x485df3(0x90)]===_0x485df3(0x9f))throw CliErrors[_0x485df3(0x80)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x485df3(0x87)+_0x50b50d[_0x485df3(0x90)]+'\x22.');if(!_0x5e2501['ignoreMetadataScope']&&_0x193550===_0x485df3(0xa2)&&_0x50b50d?.[_0x485df3(0x90)]&&_0x50b50d['scope']!=='personal')throw CliErrors[_0x485df3(0x80)](_0x485df3(0xa8)+METADATA_FILE+_0x485df3(0x87)+_0x50b50d[_0x485df3(0x90)]+'\x22.',_0x485df3(0x8e)+_0x5f0117+_0x485df3(0x7c));const _0x3d7a1f=scanSkillDirectory(_0x5f0117),_0x5c306d=buildSkillPackage(_0x3d7a1f),_0x511934=readFileSync(_0x224759,_0x485df3(0xa9)),_0x2261e8=_0x4b5b7c[_0x485df3(0x93)],_0x2a7c04=_0x5e2501[_0x485df3(0x95)]?undefined:_0x50b50d,_0x5876c7=readSkillDisplayName(_0x511934);return{'skillCode':_0x2261e8,'metadata':_0x50b50d,'frontmatterDisplayName':_0x5876c7,'input':{'skillCode':_0x2261e8,'skillName':_0x5876c7??_0x2a7c04?.[_0x485df3(0xb4)],'description':_0x2a7c04?.[_0x485df3(0x7d)],'content':_0x511934,'files':_0x5c306d['manifest'],'packageBase64':_0x5c306d['packageBase64'],'tags':_0x2a7c04?.[_0x485df3(0xa3)],'version':_0x2a7c04?.[_0x485df3(0xb8)],'sourceSessionId':_0x2a7c04?.[_0x485df3(0x7f)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x4e9238,_0x27bca5,_0x4254fe,_0x5a1276={}){const _0x2477c8=a104_0x4c3f,_0x358b2c=resolvePushDirectoryRoot(_0x4e9238),_0x455d58=readPushMetadataIfPresent(resolve(_0x358b2c,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x35d69a=requireRemoteScope(_0x27bca5),_0x30d480=readLocalSkillContent(_0x358b2c),_0x1d8ac2={..._0x27bca5,'appCode':_0x27bca5[_0x2477c8(0xa1)]??_0x4254fe,'skillName':_0x27bca5[_0x2477c8(0xb4)]??_0x455d58?.[_0x2477c8(0xb4)],'description':_0x27bca5[_0x2477c8(0x7d)]??_0x455d58?.[_0x2477c8(0x7d)],'tags':Array[_0x2477c8(0x91)](_0x27bca5['tags'])?_0x27bca5[_0x2477c8(0xa3)]:_0x455d58?.[_0x2477c8(0xa3)],'sourceSessionId':_0x27bca5[_0x2477c8(0x7f)]??_0x455d58?.[_0x2477c8(0x7f)],'content':_0x27bca5[_0x2477c8(0x86)]??_0x30d480},_0x4253ef=buildMetadata(_0x1d8ac2,_0x35d69a,_0x4254fe,contentHash(_0x30d480),_0x5a1276[_0x2477c8(0xb1)]);writeJsonAtomic(resolve(_0x358b2c,METADATA_FILE),_0x4253ef);}export function recordPushedRuntimeSkill(_0x25bffd,_0x5d9de2,_0x3c3f45,_0xf89bc9={}){const _0x14dea5=a104_0x4c3f,_0x5b9e8c=resolvePushDirectoryRoot(_0x25bffd),_0x1eabb7=scanSkillDirectory(_0x5b9e8c),_0x27e626=_0x1eabb7[_0x14dea5(0x7b)](_0x4cf596=>_0x4cf596[_0x14dea5(0x98)]===SKILL_FILE),_0x6392d7=_0x27e626?fileText(_0x27e626):'',_0x386ac1=tryNormalizePackageManifest(_0x5d9de2[_0x14dea5(0xa5)]),_0x4590c6={..._0x5d9de2,'content':_0x5d9de2[_0x14dea5(0x86)]??_0x6392d7,'files':_0x386ac1},_0x1018c7=_0x386ac1?normalizeLocalFiles(_0x1eabb7)[_0x14dea5(0x8d)](_0xf7e7a6=>_0x386ac1[_0x14dea5(0xa5)][_0x14dea5(0xb3)](_0x4a2ddc=>_0x4a2ddc['path']===_0xf7e7a6[_0x14dea5(0x98)])):undefined,_0x47c4bb=buildMetadata(_0x4590c6,_0xf89bc9['scope']??_0x14dea5(0xa2),_0x3c3f45,contentHash(_0x4590c6['content']??''),_0xf89bc9['pushedAt'],_0x1018c7);writeJsonAtomic(resolve(_0x5b9e8c,METADATA_FILE),_0x47c4bb);}function a104_0x4c3f(_0x2cd1dc,_0x71a22){_0x2cd1dc=_0x2cd1dc-0x7a;const _0xd8faef=a104_0xd8fa();let _0x4c3f36=_0xd8faef[_0x2cd1dc];return _0x4c3f36;}export function deriveSkillCodeFromDirectory(_0xe5f48a,_0x54d469){const _0x12d1ea=a104_0x4c3f,_0x53be8e=basename(resolve(_0xe5f48a)),_0x1edb7a=_0x54d469+'--';return _0x53be8e[_0x12d1ea(0xb2)](_0x1edb7a)?_0x53be8e[_0x12d1ea(0x83)](_0x1edb7a['length']):_0x53be8e;}function resolvePushSkillCode(_0x265916,_0x3a0257,_0x592d4f,_0x5b44d0){const _0x374f19=a104_0x4c3f,_0x125a7a=deriveSkillCodeFromSkillFile(_0x265916)||deriveSkillCodeFromDirectory(_0x265916,_0x3a0257);if(_0x5b44d0[_0x374f19(0xaf)])return _0x125a7a;return _0x592d4f?.[_0x374f19(0x93)]?.[_0x374f19(0xb9)]()||_0x125a7a;}function deriveSkillCodeFromSkillFile(_0x512cf2){const _0x15ef38=a104_0x4c3f,_0x4aafba=resolve(_0x512cf2,SKILL_FILE);if(!existsSync(_0x4aafba)||!lstatSync(_0x4aafba)[_0x15ef38(0xae)]())return undefined;const _0x1572ee=readFileSync(_0x4aafba,_0x15ef38(0xa9)),_0x422297=_0x1572ee[_0x15ef38(0x94)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x422297)return undefined;const _0x4002e2=parseFrontmatterObject(_0x422297[0x1]??''),_0xf12b1=scalarToString(_0x4002e2?.[_0x15ef38(0x9c)]);return _0xf12b1?slugifySkillName(_0xf12b1):undefined;}function readSkillDisplayName(_0x256fc1){const _0x16d0b2=a104_0x4c3f,_0x5ade5d=_0x256fc1[_0x16d0b2(0x94)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5ade5d)return undefined;const _0x5e24bf=parseFrontmatterObject(_0x5ade5d[0x1]??'');return scalarToString(_0x5e24bf?.[_0x16d0b2(0x92)]);}function slugifySkillName(_0x1e92e7){const _0x143707=a104_0x4c3f,_0x34c568=_0x1e92e7[_0x143707(0xb9)]()[_0x143707(0x84)]()[_0x143707(0x7e)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0x143707(0x7e)](/-+$/,'')[_0x143707(0x7e)](/-{2,}/g,'-');if(!_0x34c568)throw CliErrors['validation'](_0x143707(0xb7)+SKILL_FILE+_0x143707(0x96));return _0x34c568;}function parseFrontmatterObject(_0x1b9827){const _0x1b49ee=a104_0x4c3f;try{const _0x1128a9=a104_0x30dbdf(_0x1b9827);return _0x1128a9&&typeof _0x1128a9===_0x1b49ee(0x81)&&!Array['isArray'](_0x1128a9)?_0x1128a9:undefined;}catch{return undefined;}}function scalarToString(_0x5cc496){const _0x17c3a2=a104_0x4c3f;if(typeof _0x5cc496===_0x17c3a2(0xb0))return _0x5cc496[_0x17c3a2(0xb9)]();if(typeof _0x5cc496===_0x17c3a2(0xaa)||typeof _0x5cc496===_0x17c3a2(0x8b))return String(_0x5cc496);return undefined;}function resolvePushDirectoryRoot(_0x653b97){const _0x4d31f3=a104_0x4c3f,_0x2155d6=resolve(_0x653b97);if(!existsSync(_0x2155d6))throw CliErrors['validation'](_0x4d31f3(0xa4)+_0x653b97);const _0x438768=lstatSync(_0x2155d6);if(_0x438768['isDirectory']())return _0x2155d6;if(_0x438768[_0x4d31f3(0x97)]()){const _0x14fd04=realpathSync(_0x2155d6);if(lstatSync(_0x14fd04)['isDirectory']())return _0x14fd04;}throw CliErrors[_0x4d31f3(0x80)](_0x4d31f3(0xa4)+_0x653b97);}function requireRemoteScope(_0x306f64){const _0x477ca6=a104_0x4c3f;if(_0x306f64[_0x477ca6(0x90)]==='personal'||_0x306f64[_0x477ca6(0x90)]===_0x477ca6(0x82)||_0x306f64[_0x477ca6(0x90)]===_0x477ca6(0x9f))return _0x306f64[_0x477ca6(0x90)];throw CliErrors[_0x477ca6(0x80)](_0x477ca6(0xa0)+(_0x306f64['skillCode']||'(unknown)')+_0x477ca6(0x8f)+(_0x306f64[_0x477ca6(0x90)]??_0x477ca6(0x99))+'\x22.');}function readLocalSkillContent(_0x876abc){const _0x388d8e=a104_0x4c3f,_0x2f6859=resolve(_0x876abc,SKILL_FILE);return existsSync(_0x2f6859)&&lstatSync(_0x2f6859)[_0x388d8e(0xae)]()?readFileSync(_0x2f6859,_0x388d8e(0xa9)):'';}function readPushMetadataIfPresent(_0x750983,_0x5db845={}){try{return readMetadataIfPresent(_0x750983);}catch(_0x85a681){if(_0x5db845['ignoreInvalidMetadata'])return undefined;throw _0x85a681;}}
|
|
1
|
+
(function(_0x48d3a6,_0x5dbae1){const _0x4e6639=a104_0x6a9d,_0x55d355=_0x48d3a6();while(!![]){try{const _0x342a4f=parseInt(_0x4e6639(0xea))/0x1*(parseInt(_0x4e6639(0x101))/0x2)+parseInt(_0x4e6639(0x108))/0x3*(-parseInt(_0x4e6639(0x10b))/0x4)+parseInt(_0x4e6639(0x123))/0x5*(parseInt(_0x4e6639(0x103))/0x6)+-parseInt(_0x4e6639(0xeb))/0x7+-parseInt(_0x4e6639(0xf0))/0x8+-parseInt(_0x4e6639(0x122))/0x9+parseInt(_0x4e6639(0x11a))/0xa*(parseInt(_0x4e6639(0x11f))/0xb);if(_0x342a4f===_0x5dbae1)break;else _0x55d355['push'](_0x55d355['shift']());}catch(_0x4df905){_0x55d355['push'](_0x55d355['shift']());}}}(a104_0x55ba,0x4570c));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a104_0x49be84}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';function a104_0x6a9d(_0x4eeacd,_0x8fa6c1){_0x4eeacd=_0x4eeacd-0xe7;const _0x55bab6=a104_0x55ba();let _0x6a9dfc=_0x55bab6[_0x4eeacd];return _0x6a9dfc;}export function resolvePushDirectoryIdentity(_0x27ac44,_0x52ee92,_0x14e299={}){const _0x2d8b9c=a104_0x6a9d,_0x3543f7=resolvePushDirectoryRoot(_0x27ac44),_0x1f0694=readPushMetadataIfPresent(resolve(_0x3543f7,METADATA_FILE),{'ignoreInvalidMetadata':_0x14e299[_0x2d8b9c(0x125)]});if(_0x1f0694?.[_0x2d8b9c(0x116)]&&_0x1f0694[_0x2d8b9c(0x116)]!==_0x52ee92&&!_0x14e299[_0x2d8b9c(0xf2)]&&!_0x14e299[_0x2d8b9c(0x11c)])throw CliErrors[_0x2d8b9c(0x102)]('Skill\x20metadata\x20appCode\x20\x22'+_0x1f0694[_0x2d8b9c(0x116)]+_0x2d8b9c(0x10f)+_0x52ee92+'\x22.');const _0x2c74fa=resolvePushSkillCode(_0x3543f7,_0x52ee92,_0x1f0694,_0x14e299);if(!_0x2c74fa)throw CliErrors[_0x2d8b9c(0x102)](_0x2d8b9c(0xf7)+SKILL_FILE+',\x20'+METADATA_FILE+_0x2d8b9c(0xf1));return{'dir':_0x3543f7,'skillCode':_0x2c74fa,'metadata':_0x1f0694};}export function readPushDirectory(_0x5688f2,_0x244eb4,_0x5398a9={}){const _0x1d420a=a104_0x6a9d,_0x272502=resolvePushDirectoryIdentity(_0x5688f2,_0x244eb4,_0x5398a9),_0x167f07=_0x272502['dir'],_0x2b79a9=resolve(_0x167f07,SKILL_FILE);if(!existsSync(_0x2b79a9)||!lstatSync(_0x2b79a9)[_0x1d420a(0xfd)]())throw CliErrors[_0x1d420a(0x102)](_0x1d420a(0x10c)+SKILL_FILE+':\x20'+_0x2b79a9);const _0xdc5c2d=_0x272502[_0x1d420a(0x119)],_0x1fe307=_0x5398a9[_0x1d420a(0xf6)]??_0x1d420a(0xe9);if(!_0x5398a9['ignoreMetadataScope']&&_0xdc5c2d?.[_0x1d420a(0xf3)]===_0x1d420a(0x107))throw CliErrors[_0x1d420a(0x102)](_0x1d420a(0xed)+METADATA_FILE+_0x1d420a(0xfb)+_0xdc5c2d[_0x1d420a(0xf3)]+'\x22.');if(!_0x5398a9[_0x1d420a(0x105)]&&_0x1fe307==='personal'&&_0xdc5c2d?.['scope']&&_0xdc5c2d[_0x1d420a(0xf3)]!==_0x1d420a(0xe9))throw CliErrors[_0x1d420a(0x102)](_0x1d420a(0xff)+METADATA_FILE+'\x20has\x20scope=\x22'+_0xdc5c2d[_0x1d420a(0xf3)]+'\x22.',_0x1d420a(0x104)+_0x167f07+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x4bfbad=scanSkillDirectory(_0x167f07),_0x274886=buildSkillPackage(_0x4bfbad),_0x164256=readFileSync(_0x2b79a9,_0x1d420a(0xee)),_0x32d8fc=_0x272502[_0x1d420a(0xef)],_0x5e568f=_0x5398a9['ignoreMetadataForPayload']?undefined:_0xdc5c2d,_0x123e42=readSkillDisplayName(_0x164256);return{'skillCode':_0x32d8fc,'metadata':_0xdc5c2d,'frontmatterDisplayName':_0x123e42,'input':{'skillCode':_0x32d8fc,'skillName':_0x123e42??_0x5e568f?.[_0x1d420a(0x124)],'description':_0x5e568f?.[_0x1d420a(0xe7)],'content':_0x164256,'files':_0x274886['manifest'],'packageBase64':_0x274886['packageBase64'],'tags':_0x5e568f?.[_0x1d420a(0x118)],'version':_0x5e568f?.[_0x1d420a(0x100)],'sourceSessionId':_0x5e568f?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x32e2fa,_0x206de3,_0xcf30bd,_0x43efb0={}){const _0x282a22=a104_0x6a9d,_0x19602c=resolvePushDirectoryRoot(_0x32e2fa),_0x1ac3ee=readPushMetadataIfPresent(resolve(_0x19602c,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x12904e=requireRemoteScope(_0x206de3),_0x7f1323=readLocalSkillContent(_0x19602c),_0x1a4f1b={..._0x206de3,'appCode':_0x206de3['appCode']??_0xcf30bd,'skillName':_0x206de3[_0x282a22(0x124)]??_0x1ac3ee?.[_0x282a22(0x124)],'description':_0x206de3[_0x282a22(0xe7)]??_0x1ac3ee?.['description'],'tags':Array[_0x282a22(0x106)](_0x206de3[_0x282a22(0x118)])?_0x206de3[_0x282a22(0x118)]:_0x1ac3ee?.[_0x282a22(0x118)],'sourceSessionId':_0x206de3[_0x282a22(0x10e)]??_0x1ac3ee?.[_0x282a22(0x10e)],'content':_0x206de3['content']??_0x7f1323},_0x3759ad=buildMetadata(_0x1a4f1b,_0x12904e,_0xcf30bd,contentHash(_0x7f1323),_0x43efb0[_0x282a22(0xfc)]);writeJsonAtomic(resolve(_0x19602c,METADATA_FILE),_0x3759ad);}function a104_0x55ba(){const _0x425897=['object','sourceSessionId','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','files','find','company','isDirectory','ignoreMetadataSkillCode','(unknown)','appCode','toLowerCase','tags','metadata','650DxwPhd','Skill\x20directory\x20not\x20found:\x20','ignoreMetadataAppCodeMismatch','slice','string','214247Bnfffw','trim','displayName','3511575WBqgLH','181115Szbrrp','skillName','ignoreInvalidMetadata','description','Remote\x20Skill\x20','personal','1nfTYvr','1062894qvzdQc','some','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','utf8','skillCode','3460448RsOPvq',',\x20or\x20directory\x20name.','allowAppCodeRetarget','scope','\x20has\x20unsupported\x20scope\x20\x22','isSymbolicLink','targetScope','Unable\x20to\x20resolve\x20skillCode\x20from\x20','number','name','Invalid\x20','\x20has\x20scope=\x22','refreshedAt','isFile','path','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','version','249898LtQNbi','validation','18xsOxLu','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','ignoreMetadataScope','isArray','builtin','11643wjwbBe','replace','length','248XenJrf','Missing\x20'];a104_0x55ba=function(){return _0x425897;};return a104_0x55ba();}export function recordPushedRuntimeSkill(_0x2d9fc3,_0x2bfe0b,_0x1c4187,_0x515d80={}){const _0x39cb19=a104_0x6a9d,_0x27dfab=resolvePushDirectoryRoot(_0x2d9fc3),_0x42beac=scanSkillDirectory(_0x27dfab),_0x5bb92f=_0x42beac[_0x39cb19(0x111)](_0x1f2c45=>_0x1f2c45['path']===SKILL_FILE),_0x25d350=_0x5bb92f?fileText(_0x5bb92f):'',_0xf93fe6=tryNormalizePackageManifest(_0x2bfe0b[_0x39cb19(0x110)]),_0x1dc6cc={..._0x2bfe0b,'content':_0x2bfe0b['content']??_0x25d350,'files':_0xf93fe6},_0x4acc92=_0xf93fe6?normalizeLocalFiles(_0x42beac)['filter'](_0x1270b6=>_0xf93fe6[_0x39cb19(0x110)][_0x39cb19(0xec)](_0x1f4f34=>_0x1f4f34['path']===_0x1270b6[_0x39cb19(0xfe)])):undefined,_0x551e6a=buildMetadata(_0x1dc6cc,_0x515d80[_0x39cb19(0xf3)]??_0x39cb19(0xe9),_0x1c4187,contentHash(_0x1dc6cc['content']??''),_0x515d80['pushedAt'],_0x4acc92);writeJsonAtomic(resolve(_0x27dfab,METADATA_FILE),_0x551e6a);}export function deriveSkillCodeFromDirectory(_0x37e888,_0xc07c05){const _0x4e0891=a104_0x6a9d,_0x35a1c0=basename(resolve(_0x37e888)),_0x5bed5f=_0xc07c05+'--';return _0x35a1c0['startsWith'](_0x5bed5f)?_0x35a1c0[_0x4e0891(0x11d)](_0x5bed5f[_0x4e0891(0x10a)]):_0x35a1c0;}function resolvePushSkillCode(_0x1e9021,_0x591dbb,_0x2a14e7,_0x3be5b1){const _0x2d8983=a104_0x6a9d,_0x48e1c9=deriveSkillCodeFromSkillFile(_0x1e9021)||deriveSkillCodeFromDirectory(_0x1e9021,_0x591dbb);if(_0x3be5b1[_0x2d8983(0x114)])return _0x48e1c9;return _0x2a14e7?.[_0x2d8983(0xef)]?.[_0x2d8983(0x120)]()||_0x48e1c9;}function deriveSkillCodeFromSkillFile(_0x5b680a){const _0x4f4f4f=a104_0x6a9d,_0x528f31=resolve(_0x5b680a,SKILL_FILE);if(!existsSync(_0x528f31)||!lstatSync(_0x528f31)['isFile']())return undefined;const _0xd976fc=readFileSync(_0x528f31,_0x4f4f4f(0xee)),_0x1c1e80=_0xd976fc['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1c1e80)return undefined;const _0x357931=parseFrontmatterObject(_0x1c1e80[0x1]??''),_0xc8991c=scalarToString(_0x357931?.[_0x4f4f4f(0xf9)]);return _0xc8991c?slugifySkillName(_0xc8991c):undefined;}function readSkillDisplayName(_0x38948e){const _0x4faa9e=a104_0x6a9d,_0x1b3068=_0x38948e['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1b3068)return undefined;const _0x4b2dee=parseFrontmatterObject(_0x1b3068[0x1]??'');return scalarToString(_0x4b2dee?.[_0x4faa9e(0x121)]);}function slugifySkillName(_0x5a1abf){const _0x172342=a104_0x6a9d,_0x4f50ee=_0x5a1abf[_0x172342(0x120)]()[_0x172342(0x117)]()[_0x172342(0x109)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')['replace'](/-+$/,'')[_0x172342(0x109)](/-{2,}/g,'-');if(!_0x4f50ee)throw CliErrors['validation'](_0x172342(0xfa)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x4f50ee;}function parseFrontmatterObject(_0x2518d2){const _0xa09ac5=a104_0x6a9d;try{const _0x5608b7=a104_0x49be84(_0x2518d2);return _0x5608b7&&typeof _0x5608b7===_0xa09ac5(0x10d)&&!Array['isArray'](_0x5608b7)?_0x5608b7:undefined;}catch{return undefined;}}function scalarToString(_0x4db04f){const _0x5f566c=a104_0x6a9d;if(typeof _0x4db04f===_0x5f566c(0x11e))return _0x4db04f['trim']();if(typeof _0x4db04f===_0x5f566c(0xf8)||typeof _0x4db04f==='boolean')return String(_0x4db04f);return undefined;}function resolvePushDirectoryRoot(_0x128a3f){const _0x5e5984=a104_0x6a9d,_0xb806d1=resolve(_0x128a3f);if(!existsSync(_0xb806d1))throw CliErrors['validation'](_0x5e5984(0x11b)+_0x128a3f);const _0x5ebe22=lstatSync(_0xb806d1);if(_0x5ebe22[_0x5e5984(0x113)]())return _0xb806d1;if(_0x5ebe22[_0x5e5984(0xf5)]()){const _0x1aa312=realpathSync(_0xb806d1);if(lstatSync(_0x1aa312)[_0x5e5984(0x113)]())return _0x1aa312;}throw CliErrors[_0x5e5984(0x102)](_0x5e5984(0x11b)+_0x128a3f);}function requireRemoteScope(_0x20976d){const _0xa2679=a104_0x6a9d;if(_0x20976d[_0xa2679(0xf3)]===_0xa2679(0xe9)||_0x20976d['scope']===_0xa2679(0x112)||_0x20976d[_0xa2679(0xf3)]===_0xa2679(0x107))return _0x20976d[_0xa2679(0xf3)];throw CliErrors[_0xa2679(0x102)](_0xa2679(0xe8)+(_0x20976d[_0xa2679(0xef)]||_0xa2679(0x115))+_0xa2679(0xf4)+(_0x20976d['scope']??'unknown')+'\x22.');}function readLocalSkillContent(_0x504a4b){const _0x14802d=a104_0x6a9d,_0x3a55e0=resolve(_0x504a4b,SKILL_FILE);return existsSync(_0x3a55e0)&&lstatSync(_0x3a55e0)['isFile']()?readFileSync(_0x3a55e0,_0x14802d(0xee)):'';}function readPushMetadataIfPresent(_0x20aa32,_0x50bf8f={}){const _0x5f57ba=a104_0x6a9d;try{return readMetadataIfPresent(_0x20aa32);}catch(_0x4f8d5b){if(_0x50bf8f[_0x5f57ba(0x125)])return undefined;throw _0x4f8d5b;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a105_0x54ed(_0x36700b,_0x1a2f0a){_0x36700b=_0x36700b-0xf8;const _0x25901d=a105_0x2590();let _0x54edd6=_0x25901d[_0x36700b];return _0x54edd6;}(function(_0x50b795,_0x5a6d07){const _0x1d8bc7=a105_0x54ed,_0x5a4278=_0x50b795();while(!![]){try{const _0x41a21a=parseInt(_0x1d8bc7(0xfa))/0x1*(-parseInt(_0x1d8bc7(0x104))/0x2)+parseInt(_0x1d8bc7(0x105))/0x3+-parseInt(_0x1d8bc7(0xfe))/0x4+-parseInt(_0x1d8bc7(0xf9))/0x5*(-parseInt(_0x1d8bc7(0xfd))/0x6)+-parseInt(_0x1d8bc7(0x107))/0x7*(parseInt(_0x1d8bc7(0x106))/0x8)+parseInt(_0x1d8bc7(0x103))/0x9*(-parseInt(_0x1d8bc7(0x100))/0xa)+-parseInt(_0x1d8bc7(0x102))/0xb*(-parseInt(_0x1d8bc7(0xfc))/0xc);if(_0x41a21a===_0x5a6d07)break;else _0x5a4278['push'](_0x5a4278['shift']());}catch(_0xe076bd){_0x5a4278['push'](_0x5a4278['shift']());}}}(a105_0x2590,0x45052));import{CliErrors}from'../../errors.js';function a105_0x2590(){const _0x28cb9a=['7QdqHir','push','validation','personal','398590cAvAwX','37dZQwQu','company','12aKTQGY','6tufcDg','390284paUOPs','Unsupported\x20runtime\x20Skill\x20scope:\x20','210HDsoCs','length','13193081AReHmQ','76698TGeGjB','20220DdOvQu','403413bmfuCE','3842008cGBeGU'];a105_0x2590=function(){return _0x28cb9a;};return a105_0x2590();}export function normalizeRuntimeSkillScopes(_0x4fe211){const _0x54f06c=a105_0x54ed,_0x333194=_0x4fe211&&_0x4fe211[_0x54f06c(0x101)]>0x0?_0x4fe211:[_0x54f06c(0xf8),'company','builtin'],_0x2e0f94=[];for(const _0x223556 of _0x333194){if(!isRuntimeSkillScope(_0x223556))throw CliErrors[_0x54f06c(0x109)](_0x54f06c(0xff)+_0x223556);!_0x2e0f94['includes'](_0x223556)&&_0x2e0f94[_0x54f06c(0x108)](_0x223556);}return _0x2e0f94;}export function isRuntimeSkillScope(_0xcd8c4b){const _0x4ef2f8=a105_0x54ed;return _0xcd8c4b===_0x4ef2f8(0xf8)||_0xcd8c4b===_0x4ef2f8(0xfb)||_0xcd8c4b==='builtin';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a107_0x1e6e73=a107_0x1f13;function a107_0x1f13(_0x2bb9a5,_0x5809b5){_0x2bb9a5=_0x2bb9a5-0xc5;const _0x5ae215=a107_0x5ae2();let _0x1f1326=_0x5ae215[_0x2bb9a5];return _0x1f1326;}(function(_0x52f659,_0x2d55ce){const _0x478c00=a107_0x1f13,_0x4e8841=_0x52f659();while(!![]){try{const _0x823a01=parseInt(_0x478c00(0xcc))/0x1*(-parseInt(_0x478c00(0xd2))/0x2)+-parseInt(_0x478c00(0xcb))/0x3*(parseInt(_0x478c00(0xc8))/0x4)+-parseInt(_0x478c00(0xca))/0x5*(-parseInt(_0x478c00(0xd1))/0x6)+-parseInt(_0x478c00(0xd9))/0x7*(parseInt(_0x478c00(0xc6))/0x8)+-parseInt(_0x478c00(0xd3))/0x9+-parseInt(_0x478c00(0xd8))/0xa+parseInt(_0x478c00(0xda))/0xb;if(_0x823a01===_0x2d55ce)break;else _0x4e8841['push'](_0x4e8841['shift']());}catch(_0x494a48){_0x4e8841['push'](_0x4e8841['shift']());}}}(a107_0x5ae2,0x7ffc8));function a107_0x5ae2(){const _0x428946=['408326vWHbGH','1007244PadRJM','object','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','endsWith','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','1508110jQKJsB','1495697gBNTuu','21071182WpUbbL','sort','8RQyERE','entries','4TfoQyc','validation','16475vHTatK','2202645CTtZSR','4NzawOI','from','path','1980-01-01T00:00:00.000Z','code','1158FOxlVo'];a107_0x5ae2=function(){return _0x428946;};return a107_0x5ae2();}import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a107_0x1e6e73(0xcf));export function createDeterministicZipPackage(_0x165372){const _0x493ba9=a107_0x1e6e73,_0x2b5b4f={};for(const _0x2844cd of normalizeLocalFiles(_0x165372)){_0x2b5b4f[_0x2844cd[_0x493ba9(0xce)]]=fileContent(_0x2844cd);}return Buffer['from'](zipSync(_0x2b5b4f,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0xae6705){const _0x1dd5f3=a107_0x1e6e73;if(_0xae6705['length']<0x16)throw CliErrors[_0x1dd5f3(0xc9)](_0x1dd5f3(0xd7));let _0x426157;try{_0x426157=unzipSync(_0xae6705,{'filter'(_0x40447f){const _0x404898=_0x1dd5f3,_0x305a2c=normalizeSkillRelativePath(_0x40447f['name']);if(_0x305a2c[_0x404898(0xd6)]('/'))throw CliErrors[_0x404898(0xc9)](_0x404898(0xd5)+_0x305a2c);return!![];}});}catch(_0x4cb117){if(isRuntimeSkillValidationError(_0x4cb117))throw _0x4cb117;throw CliErrors[_0x1dd5f3(0xc9)](_0x1dd5f3(0xd7));}return Object[_0x1dd5f3(0xc7)](_0x426157)['map'](([_0x418041,_0x17fba5])=>({'path':normalizeSkillRelativePath(_0x418041),'bytes':Buffer[_0x1dd5f3(0xcd)](_0x17fba5)}))[_0x1dd5f3(0xc5)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x53b336){const _0x22c225=a107_0x1e6e73;return typeof _0x53b336===_0x22c225(0xd4)&&_0x53b336!==null&&_0x22c225(0xd0)in _0x53b336&&_0x53b336['code']==='validation_error';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x441f66,_0x77ae51){const _0x10939b=a108_0x10d2,_0x10817a=_0x441f66();while(!![]){try{const _0x191414=-parseInt(_0x10939b(0x166))/0x1*(parseInt(_0x10939b(0x174))/0x2)+-parseInt(_0x10939b(0x17c))/0x3*(parseInt(_0x10939b(0x15d))/0x4)+parseInt(_0x10939b(0x186))/0x5*(parseInt(_0x10939b(0x161))/0x6)+parseInt(_0x10939b(0x17b))/0x7+parseInt(_0x10939b(0x180))/0x8+parseInt(_0x10939b(0x182))/0x9+parseInt(_0x10939b(0x183))/0xa;if(_0x191414===_0x77ae51)break;else _0x10817a['push'](_0x10817a['shift']());}catch(_0x266234){_0x10817a['push'](_0x10817a['shift']());}}}(a108_0x2eb0,0x343f2));function a108_0x2eb0(){const _0x50fdd2=['6jiKmuL','Runtime\x20Skill\x20package\x20is\x20missing\x20','some','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','schemaVersion','409051iMzWOO','size','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','isArray','validation','length','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','trim','base64','map','string','requireOssPath','has','2APAYzB','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','toLowerCase','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','zipSha256','treeSha256','2722846oqAKCX','3freVBF','zipSize','isSafeInteger','files','1673224hPTOkL','object','1464669mPPrbu','1780020SYxQZe','Missing\x20','path','528115hkAWyT','Duplicate\x20Skill\x20package\x20entry:\x20','sha256','1685776ckwDYz','toString','set','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20'];a108_0x2eb0=function(){return _0x50fdd2;};return a108_0x2eb0();}import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0xea544d){const _0x406f36=a108_0x10d2,_0x2a23e6=normalizeLocalFiles(_0xea544d);if(!_0x2a23e6[_0x406f36(0x163)](_0xbb7310=>_0xbb7310[_0x406f36(0x185)]===SKILL_FILE))throw CliErrors[_0x406f36(0x16b)](_0x406f36(0x184)+SKILL_FILE+'\x20in\x20Skill\x20file\x20package.');const _0x3414f9=localFilesToManifestFiles(_0x2a23e6),_0x5551d4=createDeterministicZipPackage(_0x2a23e6);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x3414f9),'zipSha256':bufferSha256(_0x5551d4),'zipSize':_0x5551d4['length'],'files':_0x3414f9},'packageBytes':_0x5551d4,'packageBase64':_0x5551d4[_0x406f36(0x15e)](_0x406f36(0x16f))};}export function verifyRuntimeSkillPackage(_0x2a4fb4,_0x2c96a5){const _0x2a2d83=a108_0x10d2,_0x1406a9=normalizePackageManifest(_0x2a4fb4,{'requireOssPath':![]});if(!_0x1406a9)throw CliErrors['validation'](_0x2a2d83(0x178));return extractAndVerifyPackage(_0x1406a9,_0x2c96a5);}export function verifyRuntimeSkillBundle(_0x461eeb,_0x109ab1){const _0x1b730a=a108_0x10d2,_0x18527b=normalizePackageManifest(_0x461eeb,{'requireOssPath':![]});if(!_0x18527b)throw CliErrors[_0x1b730a(0x16b)](_0x1b730a(0x178));return extractAndVerifyPackageFiles(_0x18527b,_0x109ab1);}function a108_0x10d2(_0x1ad41b,_0x3b777b){_0x1ad41b=_0x1ad41b-0x15c;const _0x2eb0bf=a108_0x2eb0();let _0x10d2ef=_0x2eb0bf[_0x1ad41b];return _0x10d2ef;}export function tryNormalizePackageManifest(_0x518a1c){return normalizePackageManifest(_0x518a1c,{'requireOssPath':![]});}export function requirePackageBytes(_0x45e5dc,_0x5784bc){const _0x2fe2c7=a108_0x10d2;if(!_0x5784bc||_0x5784bc['length']===0x0)throw CliErrors[_0x2fe2c7(0x16b)](_0x2fe2c7(0x160)+_0x45e5dc);return _0x5784bc;}export function extractDownloadedPackage(_0x4cd8cd){const _0x46697f=a108_0x10d2,_0x1cb0f2=parseZipPackage(_0x4cd8cd)[_0x46697f(0x170)](_0x108906=>({'path':_0x108906[_0x46697f(0x185)],'bytes':_0x108906['bytes']}));if(!_0x1cb0f2['some'](_0x42fe14=>_0x42fe14[_0x46697f(0x185)]===SKILL_FILE))throw CliErrors[_0x46697f(0x16b)](_0x46697f(0x162)+SKILL_FILE+'.');return normalizeLocalFiles(_0x1cb0f2);}export function localFilesToManifestFiles(_0x2f3302){return normalizeLocalFiles(_0x2f3302)['map'](_0x375a79=>({'path':_0x375a79['path'],'sha256':fileHash(_0x375a79),'size':fileContent(_0x375a79)['length']}));}function normalizePackageManifest(_0x14870e,_0x4fd91e){const _0x4a5075=a108_0x10d2;if(!_0x14870e||typeof _0x14870e!==_0x4a5075(0x181)||Array['isArray'](_0x14870e))return undefined;const _0x208406=_0x14870e,_0x37b214=typeof _0x208406['ossPath']===_0x4a5075(0x171)?_0x208406['ossPath'][_0x4a5075(0x16e)]():undefined;if(_0x4fd91e[_0x4a5075(0x172)]&&!_0x37b214)return undefined;if(!Array[_0x4a5075(0x16a)](_0x208406[_0x4a5075(0x17f)])||_0x208406[_0x4a5075(0x17f)][_0x4a5075(0x16c)]===0x0)return undefined;if(!isSha256Hex(_0x208406[_0x4a5075(0x17a)]))throw CliErrors[_0x4a5075(0x16b)](_0x4a5075(0x169));if(!isSha256Hex(_0x208406[_0x4a5075(0x179)]))throw CliErrors[_0x4a5075(0x16b)](_0x4a5075(0x164));if(!Number[_0x4a5075(0x17e)](_0x208406[_0x4a5075(0x17d)])||_0x208406['zipSize']<0x0)throw CliErrors['validation'](_0x4a5075(0x16d));const _0x4a7b20=normalizeManifestFiles(_0x208406[_0x4a5075(0x17f)]);if(!_0x4a7b20[_0x4a5075(0x163)](_0x28f0c7=>_0x28f0c7[_0x4a5075(0x185)]===SKILL_FILE))throw CliErrors['validation']('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x35f67b=fileTreeHash(_0x4a7b20);if(_0x35f67b!==_0x208406[_0x4a5075(0x17a)]['toLowerCase']())throw CliErrors[_0x4a5075(0x16b)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number[_0x4a5075(0x17e)](_0x208406[_0x4a5075(0x165)])?_0x208406['schemaVersion']:0x2,'ossPath':_0x37b214,'treeSha256':_0x35f67b,'zipSha256':_0x208406[_0x4a5075(0x179)][_0x4a5075(0x176)](),'zipSize':_0x208406[_0x4a5075(0x17d)],'files':_0x4a7b20};}function extractAndVerifyPackage(_0x4d6445,_0x45e5b4){const _0x29f1d=a108_0x10d2,_0xc0ea96=normalizePackageManifest(_0x4d6445,{'requireOssPath':![]});if(!_0xc0ea96)throw CliErrors[_0x29f1d(0x16b)](_0x29f1d(0x178));if(_0x45e5b4[_0x29f1d(0x16c)]!==_0xc0ea96[_0x29f1d(0x17d)])throw CliErrors['validation']('Runtime\x20Skill\x20package\x20size\x20mismatch.');const _0x1818a2=bufferSha256(_0x45e5b4);if(_0x1818a2!==_0xc0ea96[_0x29f1d(0x179)])throw CliErrors[_0x29f1d(0x16b)](_0x29f1d(0x168));return extractAndVerifyPackageFiles(_0xc0ea96,_0x45e5b4);}function extractAndVerifyPackageFiles(_0x5a8907,_0x1ab082){const _0x13a82b=a108_0x10d2,_0x47deb9=parseZipPackage(_0x1ab082);if(_0x47deb9[_0x13a82b(0x16c)]!==_0x5a8907['files']['length'])throw CliErrors['validation']('Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.');const _0x392759=new Map();for(const _0x5b256d of _0x47deb9){if(_0x392759[_0x13a82b(0x173)](_0x5b256d[_0x13a82b(0x185)]))throw CliErrors['validation'](_0x13a82b(0x187)+_0x5b256d[_0x13a82b(0x185)]);_0x392759[_0x13a82b(0x15f)](_0x5b256d[_0x13a82b(0x185)],_0x5b256d);}const _0x3ef802=[];for(const _0x21267b of _0x5a8907[_0x13a82b(0x17f)]){const _0x2e308f=_0x392759['get'](_0x21267b[_0x13a82b(0x185)]);if(!_0x2e308f)throw CliErrors[_0x13a82b(0x16b)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x21267b[_0x13a82b(0x185)]);if(_0x2e308f['bytes']['length']!==_0x21267b[_0x13a82b(0x167)])throw CliErrors[_0x13a82b(0x16b)](_0x13a82b(0x177)+_0x21267b['path']);const _0x41d825=bufferSha256(_0x2e308f['bytes']);if(_0x41d825!==_0x21267b[_0x13a82b(0x15c)])throw CliErrors['validation'](_0x13a82b(0x175)+_0x21267b['path']);_0x3ef802['push']({'path':_0x21267b[_0x13a82b(0x185)],'bytes':_0x2e308f['bytes']});}return normalizeLocalFiles(_0x3ef802);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a109_0x4a8e(_0x4b4cc3,_0x5d4377){_0x4b4cc3=_0x4b4cc3-0x1a3;var _0x35e11a=a109_0x35e1();var _0x4a8eba=_0x35e11a[_0x4b4cc3];return _0x4a8eba;}function a109_0x35e1(){var _0x2cf736=['772023OuecBh','41874DsDYfi','4vPbkaF','594yjOIYB','45432NDEjjE','1016yukmSB','10704870pdXeco','884610OFvSRw','4147550BJKeky','2191986NDuVmZ'];a109_0x35e1=function(){return _0x2cf736;};return a109_0x35e1();}(function(_0x3380ca,_0x177955){var _0x5291ae=a109_0x4a8e,_0x243879=_0x3380ca();while(!![]){try{var _0x75bc08=-parseInt(_0x5291ae(0x1a4))/0x1+-parseInt(_0x5291ae(0x1ab))/0x2+parseInt(_0x5291ae(0x1a3))/0x3*(parseInt(_0x5291ae(0x1a6))/0x4)+parseInt(_0x5291ae(0x1ac))/0x5+parseInt(_0x5291ae(0x1a7))/0x6*(parseInt(_0x5291ae(0x1a5))/0x7)+-parseInt(_0x5291ae(0x1a9))/0x8*(-parseInt(_0x5291ae(0x1a8))/0x9)+-parseInt(_0x5291ae(0x1aa))/0xa;if(_0x75bc08===_0x177955)break;else _0x243879['push'](_0x243879['shift']());}catch(_0x5689b6){_0x243879['push'](_0x243879['shift']());}}}(a109_0x35e1,0x7c2ff));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xfbea80,_0x3dbfc8){const _0x3d313e=a110_0x1670,_0x4ce21d=_0xfbea80();while(!![]){try{const _0x1fabe4=-parseInt(_0x3d313e(0x8e))/0x1*(parseInt(_0x3d313e(0x96))/0x2)+-parseInt(_0x3d313e(0x94))/0x3*(-parseInt(_0x3d313e(0x95))/0x4)+parseInt(_0x3d313e(0x92))/0x5+parseInt(_0x3d313e(0x93))/0x6+-parseInt(_0x3d313e(0x8f))/0x7*(parseInt(_0x3d313e(0x90))/0x8)+-parseInt(_0x3d313e(0x91))/0x9*(-parseInt(_0x3d313e(0x8c))/0xa)+-parseInt(_0x3d313e(0x8d))/0xb;if(_0x1fabe4===_0x3dbfc8)break;else _0x4ce21d['push'](_0x4ce21d['shift']());}catch(_0x412762){_0x4ce21d['push'](_0x4ce21d['shift']());}}}(a110_0x2f2f,0x7356c));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});function a110_0x1670(_0x56bfd3,_0x323d89){_0x56bfd3=_0x56bfd3-0x8c;const _0x2f2f42=a110_0x2f2f();let _0x167050=_0x2f2f42[_0x56bfd3];return _0x167050;}function a110_0x2f2f(){const _0x10a08d=['12001nXEJFb','27041cKffEe','304qjkSXG','27wQcWOs','1389850hSdfJv','4491426WtBMFZ','33tiewYl','208748CweUPZ','38ahsxLe','2583550CFAKEX','16812642WgpPBr'];a110_0x2f2f=function(){return _0x10a08d;};return a110_0x2f2f();}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a111_0x159dbe=a111_0x1ddb;(function(_0x3a66e7,_0x107a75){const _0x57d723=a111_0x1ddb,_0x24ff23=_0x3a66e7();while(!![]){try{const _0x5b3b61=-parseInt(_0x57d723(0x139))/0x1+parseInt(_0x57d723(0x145))/0x2*(parseInt(_0x57d723(0x15e))/0x3)+-parseInt(_0x57d723(0x13d))/0x4+-parseInt(_0x57d723(0x13c))/0x5*(parseInt(_0x57d723(0x155))/0x6)+parseInt(_0x57d723(0x163))/0x7+-parseInt(_0x57d723(0x138))/0x8*(parseInt(_0x57d723(0x151))/0x9)+parseInt(_0x57d723(0x13e))/0xa;if(_0x5b3b61===_0x107a75)break;else _0x24ff23['push'](_0x24ff23['shift']());}catch(_0x14b15f){_0x24ff23['push'](_0x24ff23['shift']());}}}(a111_0x5538,0xbdaa1));import a111_0x241900 from'winston';import a111_0x550f93 from'node:fs';import a111_0x3eed8a from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{[a111_0x159dbe(0x14f)];[a111_0x159dbe(0x150)]='';[a111_0x159dbe(0x14e)]='';constructor(){}['setRawCommand'](_0x5b072c){const _0xdee408=a111_0x159dbe;this[_0xdee408(0x14e)]=_0x5b072c;}['setLogPath'](_0x40cd1a){const _0x214300=a111_0x159dbe;this['logFilePath']=a111_0x3eed8a[_0x214300(0x153)](_0x40cd1a,PRODUCT_CONFIG[_0x214300(0x161)]),this[_0x214300(0x14f)]&&this[_0x214300(0x14f)]['clear'](),this['initWinstonLogger']();}['initWinstonLogger'](){const _0x5553b6=a111_0x159dbe,_0x350c42=a111_0x3eed8a['dirname'](this['logFilePath']);!a111_0x550f93['existsSync'](_0x350c42)&&a111_0x550f93[_0x5553b6(0x149)](_0x350c42,{'recursive':!![]});const _0x11c136=a111_0x241900[_0x5553b6(0x166)]['combine'](a111_0x241900[_0x5553b6(0x166)][_0x5553b6(0x13f)](),a111_0x241900[_0x5553b6(0x166)][_0x5553b6(0x165)]({'stack':!![]}),a111_0x241900[_0x5553b6(0x166)]['printf'](_0x4c8f05=>{const _0x27bad8=_0x5553b6,_0x520ee5={'timestamp':_0x4c8f05[_0x27bad8(0x13f)]||new Date()['toISOString'](),'level':_0x4c8f05[_0x27bad8(0x147)]||'info','command':_0x4c8f05[_0x27bad8(0x167)]||_0x27bad8(0x14a),'rawCommand':_0x4c8f05[_0x27bad8(0x160)]||this[_0x27bad8(0x14e)]||undefined,'message':_0x4c8f05[_0x27bad8(0x152)]||'','duration':_0x4c8f05[_0x27bad8(0x13b)]||undefined,'details':_0x4c8f05[_0x27bad8(0x141)]||undefined};return JSON[_0x27bad8(0x157)](_0x520ee5);}));this[_0x5553b6(0x14f)]=a111_0x241900[_0x5553b6(0x158)]({'level':'info','format':_0x11c136,'transports':[new a111_0x241900[(_0x5553b6(0x154))]['File']({'filename':this[_0x5553b6(0x150)],'level':_0x5553b6(0x142)})],'silent':![]}),a111_0x241900['addColors']({'success':_0x5553b6(0x148),'error':'red','warn':_0x5553b6(0x159),'info':_0x5553b6(0x143)});}['info'](_0x4b5d1e,_0x33e2b7,_0x48f643){const _0x838db9=a111_0x159dbe;if(!this[_0x838db9(0x150)]||!this[_0x838db9(0x14f)])return;this[_0x838db9(0x14f)][_0x838db9(0x142)](_0x33e2b7,{'command':_0x4b5d1e,'details':_0x48f643});}[a111_0x159dbe(0x168)](_0x52c9e6,_0x265c34,_0x3d7343,_0x1f9dd7){const _0x5e9e08=a111_0x159dbe;if(!this[_0x5e9e08(0x150)]||!this['winstonLogger'])return;this[_0x5e9e08(0x14f)][_0x5e9e08(0x13a)]('info',_0x265c34,{'level':_0x5e9e08(0x168),'command':_0x52c9e6,'duration':_0x3d7343,'details':_0x1f9dd7});}[a111_0x159dbe(0x144)](_0x402b51,_0x42f133,_0x1f391f){const _0x31e7ec=a111_0x159dbe;if(!this[_0x31e7ec(0x150)]||!this[_0x31e7ec(0x14f)])return;this['winstonLogger']['error'](_0x42f133,{'command':_0x402b51,'details':_0x1f391f});}[a111_0x159dbe(0x146)](_0x1c7064,_0x3876e6,_0x2f2521){const _0x371178=a111_0x159dbe;if(!this[_0x371178(0x150)]||!this[_0x371178(0x14f)])return;this[_0x371178(0x14f)][_0x371178(0x146)](_0x3876e6,{'command':_0x1c7064,'details':_0x2f2521});}async['logTask'](_0x1f9893,_0x335f47,_0x552234){const _0x4a4c52=a111_0x159dbe,_0x56618f=Date[_0x4a4c52(0x164)]();this['info'](_0x1f9893,_0x4a4c52(0x14d)+_0x335f47);try{const _0x399ab5=await _0x552234(),_0x26dad7=Date['now']()-_0x56618f;return this['success'](_0x1f9893,_0x4a4c52(0x15d)+_0x335f47,_0x26dad7),_0x399ab5;}catch(_0x515049){const _0x342265=Date[_0x4a4c52(0x164)]()-_0x56618f;this[_0x4a4c52(0x144)](_0x1f9893,'Failed:\x20'+_0x335f47,{'error':_0x515049 instanceof Error?_0x515049['message']:String(_0x515049),'duration':_0x342265});throw _0x515049;}}['readLogs'](){const _0x171397=a111_0x159dbe;try{if(!a111_0x550f93[_0x171397(0x14b)](this['logFilePath']))return[];const _0x5d9083=a111_0x550f93[_0x171397(0x15b)](this[_0x171397(0x150)],_0x171397(0x15a));return _0x5d9083[_0x171397(0x15f)](/\r?\n/)[_0x171397(0x162)](_0x47357a=>_0x47357a[_0x171397(0x156)]())['map'](_0x562987=>JSON[_0x171397(0x14c)](_0x562987));}catch(_0x534dae){return console[_0x171397(0x146)]('Failed\x20to\x20read\x20logs:',_0x534dae),[];}}['clearLogs'](){const _0x5ad96b=a111_0x159dbe;try{a111_0x550f93['existsSync'](this['logFilePath'])&&a111_0x550f93['writeFileSync'](this['logFilePath'],'','utf8');}catch(_0x4885f5){console[_0x5ad96b(0x146)](_0x5ad96b(0x15c),_0x4885f5);}}[a111_0x159dbe(0x140)](){const _0x52ca3f=a111_0x159dbe;return this[_0x52ca3f(0x14f)];}}function a111_0x5538(){const _0xbc499a=['currentRawCommand','winstonLogger','logFilePath','48501iJsldT','message','join','transports','1344342mhTSed','trim','stringify','createLogger','yellow','utf8','readFileSync','Failed\x20to\x20clear\x20logs:','Completed:\x20','21891VYJxUN','split','rawCommand','logFileName','filter','4318391KiWXYD','now','errors','format','command','success','2000HZTzbZ','1366814QUYLud','log','duration','25ZlrAMD','3102192dkPZvi','34053100HWBOto','timestamp','getWinstonInstance','details','info','blue','error','374BADsyt','warn','level','green','mkdirSync','unknown','existsSync','parse','Starting:\x20'];a111_0x5538=function(){return _0xbc499a;};return a111_0x5538();}function a111_0x1ddb(_0x286e54,_0x13c6a3){_0x286e54=_0x286e54-0x138;const _0x5538e6=a111_0x5538();let _0x1ddb3e=_0x5538e6[_0x286e54];return _0x1ddb3e;}export const logger=new Logger();
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a112_0x28a6(_0x54c14c,_0x2d1bce){_0x54c14c=_0x54c14c-0x9a;const _0x4de4f4=a112_0x4de4();let _0x28a626=_0x4de4f4[_0x54c14c];return _0x28a626;}(function(_0x45fe91,_0x2b9156){const _0x4130e3=a112_0x28a6,_0x1f1487=_0x45fe91();while(!![]){try{const _0xf5650b=-parseInt(_0x4130e3(0xae))/0x1+parseInt(_0x4130e3(0xa8))/0x2*(parseInt(_0x4130e3(0x9b))/0x3)+parseInt(_0x4130e3(0x9c))/0x4*(parseInt(_0x4130e3(0x9a))/0x5)+parseInt(_0x4130e3(0xb1))/0x6+parseInt(_0x4130e3(0x9e))/0x7+parseInt(_0x4130e3(0xad))/0x8+-parseInt(_0x4130e3(0xb2))/0x9;if(_0xf5650b===_0x2b9156)break;else _0x1f1487['push'](_0x1f1487['shift']());}catch(_0x5be7da){_0x1f1487['push'](_0x1f1487['shift']());}}}(a112_0x4de4,0x80038));function a112_0x4de4(){const _0xfe39e6=['items','object','\x20records\x20per\x20call;\x20received\x20','8002408jjMaTc','975107QkCFsm','number','data\x20update\x20--params\x20must\x20be\x20a\x20JSON\x20object\x20with\x20id.','759288RAgUZq','8358813DZVgDs','Example:\x20--params\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22done\x22}\x27','batchCreate\x20--params\x20must\x20be\x20a\x20JSON\x20array\x20or\x20{\x22items\x22:[...]}','parse','string','test','142700eWghDG','9426HhZkUO','72MVJAhY','data\x20update\x20--params.','4083863WBFPXD','length','validation','Invalid\x20JSON\x20for\x20--params:\x20','isSafeInteger','data\x20update\x20can\x20update\x20at\x20most\x20','isArray','Example:\x20--params\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20must\x20be\x20a\x20positive\x20integer\x20or\x20numeric\x20string.','map','130TYIWCw','id['];a112_0x4de4=function(){return _0xfe39e6;};return a112_0x4de4();}import{CliErrors}from'../errors.js';export const MAX_DATA_UPDATE_IDS=0x3e8;export function parseJsonParams(_0x245ecb){const _0x3ffaf0=a112_0x28a6;if(!_0x245ecb)return undefined;try{return JSON[_0x3ffaf0(0xb5)](_0x245ecb);}catch{throw CliErrors[_0x3ffaf0(0xa0)](_0x3ffaf0(0xa1)+_0x245ecb);}}export function parseJsonParamsValue(_0x392eac){const _0x2f5843=a112_0x28a6;if(!_0x392eac)return undefined;try{return JSON[_0x2f5843(0xb5)](_0x392eac);}catch{throw CliErrors[_0x2f5843(0xa0)](_0x2f5843(0xa1)+_0x392eac);}}export function parseBatchCreateItemsFromParams(_0x4cbc03){const _0x57d132=a112_0x28a6;if(Array[_0x57d132(0xa4)](_0x4cbc03))return _0x4cbc03;if(_0x4cbc03!==null&&_0x4cbc03!==undefined&&typeof _0x4cbc03===_0x57d132(0xab)&&Array['isArray'](_0x4cbc03[_0x57d132(0xaa)]))return _0x4cbc03[_0x57d132(0xaa)];throw CliErrors[_0x57d132(0xa0)](_0x57d132(0xb4),_0x57d132(0xa5));}function parseDataUpdateId(_0x4dbfc4,_0x1989d6){const _0x2c5f62=a112_0x28a6;if(typeof _0x4dbfc4===_0x2c5f62(0xaf)&&Number[_0x2c5f62(0xa2)](_0x4dbfc4)&&_0x4dbfc4>0x0)return _0x4dbfc4;if(typeof _0x4dbfc4===_0x2c5f62(0xb6)){if(/^[1-9]\d*$/[_0x2c5f62(0xb7)](_0x4dbfc4))return _0x4dbfc4;}throw CliErrors[_0x2c5f62(0xa0)](_0x2c5f62(0x9d)+_0x1989d6+_0x2c5f62(0xa6));}export function parseUpdateIdsFromParams(_0x129ce8){const _0x1f1322=a112_0x28a6;if(_0x129ce8===null||_0x129ce8===undefined||typeof _0x129ce8!==_0x1f1322(0xab)||Array[_0x1f1322(0xa4)](_0x129ce8))throw CliErrors[_0x1f1322(0xa0)](_0x1f1322(0xb0),_0x1f1322(0xb3));const _0x4dc7a8=_0x129ce8['id'];if(_0x4dc7a8===undefined||_0x4dc7a8===null)throw CliErrors[_0x1f1322(0xa0)]('data\x20update\x20requires\x20\x22id\x22\x20in\x20--params.','Example:\x20--params\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22done\x22}\x27');const _0x1bf2ea=Array[_0x1f1322(0xa4)](_0x4dc7a8)?_0x4dc7a8:[_0x4dc7a8];if(_0x1bf2ea[_0x1f1322(0x9f)]===0x0)throw CliErrors[_0x1f1322(0xa0)]('data\x20update\x20id\x20array\x20cannot\x20be\x20empty.');if(_0x1bf2ea[_0x1f1322(0x9f)]>MAX_DATA_UPDATE_IDS)throw CliErrors['validation'](_0x1f1322(0xa3)+MAX_DATA_UPDATE_IDS+_0x1f1322(0xac)+_0x1bf2ea[_0x1f1322(0x9f)]+'.');return _0x1bf2ea[_0x1f1322(0xa7)]((_0x38a45c,_0x35f3f4)=>parseDataUpdateId(_0x38a45c,Array['isArray'](_0x4dc7a8)?_0x1f1322(0xa9)+_0x35f3f4+']':'id'));}export function normalizeUpdateParamsForRuntime(_0x37f695,_0x1ac99d){const _0x4b0ca7=a112_0x28a6;if(Array[_0x4b0ca7(0xa4)](_0x37f695['id'])&&_0x1ac99d['length']>0x1)return{..._0x37f695,'id':_0x1ac99d['join'](',')};return _0x37f695;}
|
package/lib/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a113_0x32f01f=a113_0xf9d2;(function(_0x187f96,_0x3a0a66){const _0x5f4d0a=a113_0xf9d2,_0x59c354=_0x187f96();while(!![]){try{const _0x18bbf9=parseInt(_0x5f4d0a(0xb0))/0x1+-parseInt(_0x5f4d0a(0xab))/0x2+parseInt(_0x5f4d0a(0xb1))/0x3+-parseInt(_0x5f4d0a(0xaf))/0x4*(parseInt(_0x5f4d0a(0xb3))/0x5)+parseInt(_0x5f4d0a(0xb5))/0x6+parseInt(_0x5f4d0a(0xae))/0x7*(-parseInt(_0x5f4d0a(0xb6))/0x8)+parseInt(_0x5f4d0a(0xad))/0x9*(parseInt(_0x5f4d0a(0xb4))/0xa);if(_0x18bbf9===_0x3a0a66)break;else _0x59c354['push'](_0x59c354['shift']());}catch(_0x3b307d){_0x59c354['push'](_0x59c354['shift']());}}}(a113_0xe96b,0x81c51));function a113_0xe96b(){const _0x534dd1=['5BDOSdM','3788160BOIZxe','5762388qnFmub','848CMOaPZ','175108JBWSzU','win32','9QQBIJj','22071SHTznV','2315812NwQhPx','1997grTMqK','573153IgRmGu','.cmd'];a113_0xe96b=function(){return _0x534dd1;};return a113_0xe96b();}function a113_0xf9d2(_0x3d0971,_0x3488ae){_0x3d0971=_0x3d0971-0xab;const _0xe96b17=a113_0xe96b();let _0xf9d272=_0xe96b17[_0x3d0971];return _0xf9d272;}export const isWindows=process['platform']===a113_0x32f01f(0xac);export function resolveNpmBin(_0x42faf7){const _0x419b39=a113_0x32f01f;return isWindows?_0x42faf7+_0x419b39(0xb2):_0x42faf7;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2b13d5,_0xf00a){const _0x40fe00=a114_0x2a7c,_0x14998b=_0x2b13d5();while(!![]){try{const _0x55ac1f=parseInt(_0x40fe00(0xce))/0x1+parseInt(_0x40fe00(0xb2))/0x2*(parseInt(_0x40fe00(0xbe))/0x3)+-parseInt(_0x40fe00(0xc3))/0x4*(parseInt(_0x40fe00(0xb5))/0x5)+parseInt(_0x40fe00(0xd9))/0x6*(-parseInt(_0x40fe00(0xd8))/0x7)+-parseInt(_0x40fe00(0xb4))/0x8+-parseInt(_0x40fe00(0xdc))/0x9+-parseInt(_0x40fe00(0xc6))/0xa*(-parseInt(_0x40fe00(0xc0))/0xb);if(_0x55ac1f===_0xf00a)break;else _0x14998b['push'](_0x14998b['shift']());}catch(_0x24b4b2){_0x14998b['push'](_0x14998b['shift']());}}}(a114_0x2778,0xb6f85));import{mkdir,readFile,writeFile}from'node:fs/promises';import{homedir}from'node:os';import{dirname,join}from'node:path';import{LOVRABET_NPM_PACKAGE_NAME,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{getCliVersion}from'../utils/version.js';const UPDATE_CHECK_TTL_MS=0xc*0x3c*0x3c*0x3e8,UPDATE_NOTICE_TTL_MS=0x18*0x3c*0x3c*0x3e8;function parseSemver(_0x2b826c){const _0x2971ef=a114_0x2a7c,_0xb2f88b=_0x2b826c[_0x2971ef(0xbc)]()[_0x2971ef(0xb7)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0xb2f88b)return null;return{'major':Number(_0xb2f88b[0x1]),'minor':Number(_0xb2f88b[0x2]),'patch':Number(_0xb2f88b[0x3]),'prerelease':_0xb2f88b[0x4]};}function compareSemver(_0x5a0460,_0x25d86f){const _0x3cb5ee=a114_0x2a7c,_0x59932c=parseSemver(_0x5a0460),_0x4f9ff9=parseSemver(_0x25d86f);if(!_0x59932c||!_0x4f9ff9)throw new Error('Invalid\x20semver');for(const _0x55c012 of[_0x3cb5ee(0xc7),_0x3cb5ee(0xd7),_0x3cb5ee(0xbb)]){if(_0x59932c[_0x55c012]<_0x4f9ff9[_0x55c012])return-0x1;if(_0x59932c[_0x55c012]>_0x4f9ff9[_0x55c012])return 0x1;}if(!_0x59932c[_0x3cb5ee(0xc4)]&&!_0x4f9ff9[_0x3cb5ee(0xc4)])return 0x0;if(!_0x59932c['prerelease'])return 0x1;if(!_0x4f9ff9['prerelease'])return-0x1;if(_0x59932c[_0x3cb5ee(0xc4)]===_0x4f9ff9['prerelease'])return 0x0;return _0x59932c['prerelease']<_0x4f9ff9['prerelease']?-0x1:0x1;}function isUpdateNoticeDisabled(){const _0x4bf07d=a114_0x2a7c,_0x441105=process.env.LOVRABET_NO_UPDATE_NOTICE?.['trim']()[_0x4bf07d(0xda)]();return _0x441105==='1'||_0x441105===_0x4bf07d(0xd0)||_0x441105===_0x4bf07d(0xcd);}function cacheRoot(){const _0x401101=a114_0x2a7c;return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),_0x401101(0xdb));}function a114_0x2a7c(_0x3f3505,_0x558579){_0x3f3505=_0x3f3505-0xb2;const _0x277854=a114_0x2778();let _0x2a7c7b=_0x277854[_0x3f3505];return _0x2a7c7b;}export function getUpdateNoticeCachePath(){const _0x3826db=a114_0x2a7c;return join(cacheRoot(),'lovrabet-cli',_0x3826db(0xbd));}async function readUpdateNoticeCache(){const _0x50c217=a114_0x2a7c;try{const _0x191731=await readFile(getUpdateNoticeCachePath(),'utf8'),_0x4fda41=JSON[_0x50c217(0xd5)](_0x191731);if(!_0x4fda41||typeof _0x4fda41!=='object')return{};return _0x4fda41;}catch{return{};}}async function writeUpdateNoticeCache(_0x19ef0e){const _0x5e6df1=a114_0x2a7c;try{const _0xe936a=getUpdateNoticeCachePath();await mkdir(dirname(_0xe936a),{'recursive':!![]}),await writeFile(_0xe936a,JSON[_0x5e6df1(0xcf)](_0x19ef0e,null,0x2)+'\x0a',_0x5e6df1(0xcc));}catch{}}function isFreshCheck(_0x7b41b3,_0x56d5df){const _0xcfc852=a114_0x2a7c;return typeof _0x7b41b3[_0xcfc852(0xc5)]===_0xcfc852(0xdd)&&_0x56d5df-_0x7b41b3[_0xcfc852(0xc5)]<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x1b08f1,_0x18871d,_0x362677){const _0x58f3b6=a114_0x2a7c;return _0x1b08f1['lastNotifiedVersion']===_0x18871d&&typeof _0x1b08f1['lastNotifiedAt']===_0x58f3b6(0xdd)&&_0x362677-_0x1b08f1[_0x58f3b6(0xb8)]<UPDATE_NOTICE_TTL_MS;}async function fetchNpmDistTags(_0x9be628=0x5dc){const _0x4772c2=a114_0x2a7c;try{const _0x33a485=NPM_REGISTRY_BASE_URL+'/-/package/'+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x4772c2(0xd1),_0x1ab307=await fetch(_0x33a485,{'signal':AbortSignal[_0x4772c2(0xc8)](_0x9be628)});if(!_0x1ab307['ok'])return null;const _0xc6248f=await _0x1ab307[_0x4772c2(0xcb)]();if(!_0xc6248f||typeof _0xc6248f!==_0x4772c2(0xb9))return null;return Object[_0x4772c2(0xd3)](Object[_0x4772c2(0xd4)](_0xc6248f)[_0x4772c2(0xc2)](([,_0x1beb73])=>typeof _0x1beb73===_0x4772c2(0xca)&&_0x1beb73['trim']())[_0x4772c2(0xba)](([_0x205268,_0x505d6e])=>[_0x205268,String(_0x505d6e)[_0x4772c2(0xbc)]()]));}catch{return null;}}export function buildNpmVersionUrl(_0x49ef6d){const _0x5d4d60=a114_0x2a7c;return _0x5d4d60(0xb6)+LOVRABET_NPM_PACKAGE_NAME+_0x5d4d60(0xd2)+_0x49ef6d;}function a114_0x2778(){const _0x5e1c42=['match','lastNotifiedAt','object','map','patch','trim','update-check.json','199431PaJlXS','\x20available,\x20current\x20','37629416ifecCF',',\x20run:\x20','filter','964VTxrdH','prerelease','checkedAt','10eJFvnm','major','timeout','latest','string','json','utf8','yes','553541sIrkpZ','stringify','true','/dist-tags','/v/','fromEntries','entries','parse','\x20update','minor','7vahQaN','5850318wBPtBY','toLowerCase','.cache','8709183gJVEWU','number','2AKEXEJ','now','1074320bACfHR','25195njZhfu','https://www.npmjs.com/package/'];a114_0x2778=function(){return _0x5e1c42;};return a114_0x2778();}export async function resolveLatestUpdateNotice(){const _0x572f95=a114_0x2a7c;if(isUpdateNoticeDisabled())return null;try{const _0xcfbd64=Date[_0x572f95(0xb3)](),_0x5f409b=getCliVersion(),_0x2fec99=await readUpdateNoticeCache();let _0x470b15=isFreshCheck(_0x2fec99,_0xcfbd64)?_0x2fec99[_0x572f95(0xc9)]?.[_0x572f95(0xbc)]():undefined;if(!_0x470b15&&!isFreshCheck(_0x2fec99,_0xcfbd64)){const _0x111d6f=await fetchNpmDistTags();_0x470b15=_0x111d6f?.[_0x572f95(0xc9)]?.['trim'](),await writeUpdateNoticeCache({..._0x2fec99,'checkedAt':_0xcfbd64,'latest':_0x470b15,'failed':!_0x470b15});}if(!_0x470b15||compareSemver(_0x5f409b,_0x470b15)>=0x0)return null;if(isRecentlyNotified(_0x2fec99,_0x470b15,_0xcfbd64))return null;const _0x2fbf5c=CLI_BIN_NAME+_0x572f95(0xd6);return await writeUpdateNoticeCache({..._0x2fec99,'checkedAt':isFreshCheck(_0x2fec99,_0xcfbd64)?_0x2fec99[_0x572f95(0xc5)]:_0xcfbd64,'latest':_0x470b15,'failed':![],'lastNotifiedVersion':_0x470b15,'lastNotifiedAt':_0xcfbd64}),{'command':_0x2fbf5c,'current':_0x5f409b,'latest':_0x470b15,'url':buildNpmVersionUrl(_0x470b15),'message':CLI_BIN_NAME+'\x20'+_0x470b15+_0x572f95(0xbf)+_0x5f409b+_0x572f95(0xc1)+_0x2fbf5c};}catch{return null;}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a115_0x3c77(){const _0x26da02=['1344gUWmUz','2149973ZwWuPR','6bEkzMr','10ABQoqL','4083720BzfplQ','307069wpGOlr','8281719abPpkg','2194060daoFto','3633vaKGIX','1091874fZSXsH','slice'];a115_0x3c77=function(){return _0x26da02;};return a115_0x3c77();}(function(_0x3536e4,_0x242b97){const _0x3e80c2=a115_0xe974,_0x50d69e=_0x3536e4();while(!![]){try{const _0xfad1a6=-parseInt(_0x3e80c2(0xfd))/0x1+parseInt(_0x3e80c2(0x101))/0x2+-parseInt(_0x3e80c2(0x100))/0x3*(-parseInt(_0x3e80c2(0x103))/0x4)+-parseInt(_0x3e80c2(0xff))/0x5+parseInt(_0x3e80c2(0x105))/0x6*(-parseInt(_0x3e80c2(0x104))/0x7)+-parseInt(_0x3e80c2(0xfc))/0x8+-parseInt(_0x3e80c2(0xfe))/0x9*(-parseInt(_0x3e80c2(0xfb))/0xa);if(_0xfad1a6===_0x242b97)break;else _0x50d69e['push'](_0x50d69e['shift']());}catch(_0x50f814){_0x50d69e['push'](_0x50d69e['shift']());}}}(a115_0x3c77,0x4b923));import{BUILD_TIME,GIT_COMMIT,VERSION}from'../generated/build-info.js';function a115_0xe974(_0x1ba53d,_0x40d40a){_0x1ba53d=_0x1ba53d-0xfb;const _0x3c7703=a115_0x3c77();let _0xe97487=_0x3c7703[_0x1ba53d];return _0xe97487;}export function getCliVersion(){return VERSION;}export function getCliGitCommit(){const _0x2c5509=String(GIT_COMMIT);return _0x2c5509&&_0x2c5509!=='unknown'?_0x2c5509:'';}export function getCliVersionDisplay(){const _0x4dc2d5=a115_0xe974,_0x4dbb94=getCliGitCommit(),_0x39d54d=BUILD_TIME[_0x4dc2d5(0x102)](0x0,0xa);if(!_0x4dbb94||!_0x39d54d)return VERSION;return VERSION+'\x20('+_0x4dbb94+',\x20'+_0x39d54d+')';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x13efcb,_0x36fa94){var _0x7c20db=a116_0xddce,_0x1cbeda=_0x13efcb();while(!![]){try{var _0x50b6cd=parseInt(_0x7c20db(0x79))/0x1+-parseInt(_0x7c20db(0x77))/0x2+parseInt(_0x7c20db(0x74))/0x3+-parseInt(_0x7c20db(0x78))/0x4+parseInt(_0x7c20db(0x7b))/0x5*(-parseInt(_0x7c20db(0x73))/0x6)+-parseInt(_0x7c20db(0x75))/0x7+parseInt(_0x7c20db(0x7d))/0x8*(parseInt(_0x7c20db(0x7c))/0x9);if(_0x50b6cd===_0x36fa94)break;else _0x1cbeda['push'](_0x1cbeda['shift']());}catch(_0xbe920a){_0x1cbeda['push'](_0x1cbeda['shift']());}}}(a116_0x5817,0xca28f));function a116_0x5817(){var _0x56c75d=['5uDyamO','7533171FuCINC','8OUdKlh','4666680yMAKxT','2618709toNNLN','440251fzTzXA','stderr','873418cQyQyf','1270352hSyBzy','713095LVenEx','write'];a116_0x5817=function(){return _0x56c75d;};return a116_0x5817();}function a116_0xddce(_0x1923fa,_0x5499ac){_0x1923fa=_0x1923fa-0x73;var _0x581725=a116_0x5817();var _0xddce33=_0x581725[_0x1923fa];return _0xddce33;}export function writeCliSideChannelLine(_0x431f5d){var _0xad9bb=a116_0xddce;process[_0xad9bb(0x76)][_0xad9bb(0x7a)](_0x431f5d+'\x0a');}
|