@lovrabet/lovrabet-cli 2.3.8-beta.4 → 2.3.8-beta.6
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/README.md +12 -0
- 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/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.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/issue/context.d.ts +3 -0
- package/lib/commands/issue/context.js +1 -0
- package/lib/commands/issue/index.d.ts +2 -0
- package/lib/commands/issue/index.js +1 -0
- package/lib/commands/issue/report.d.ts +2 -0
- package/lib/commands/issue/report.js +1 -0
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.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/region.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/kb-management-client.js +1 -1
- package/lib/core/kb-sdk-errors.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-import/auto-id-runner.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/image-bytes.js +1 -1
- package/lib/services/dataset-import/image-ooxml.js +1 -1
- package/lib/services/dataset-import/image-runner.js +1 -1
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/runtime-user-id.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 +2 -2
- package/skills/lovrabet/SKILL.md +12 -2
- package/skills/lovrabet/guides/development-intent-handoff.md +58 -0
- package/skills/lovrabet/references/lovrabet-issue-report.md +24 -0
- package/skills/lovrabet.manifest.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2f8e34,_0x563318){const _0x2df6f5=a158_0x3777,_0x166697=_0x2f8e34();while(!![]){try{const _0x11f5b0=parseInt(_0x2df6f5(0x14d))/0x1*(-parseInt(_0x2df6f5(0x166))/0x2)+parseInt(_0x2df6f5(0x15c))/0x3*(-parseInt(_0x2df6f5(0x154))/0x4)+-parseInt(_0x2df6f5(0x17b))/0x5*(parseInt(_0x2df6f5(0x14b))/0x6)+parseInt(_0x2df6f5(0x17d))/0x7*(-parseInt(_0x2df6f5(0x16d))/0x8)+parseInt(_0x2df6f5(0x179))/0x9*(-parseInt(_0x2df6f5(0x17e))/0xa)+parseInt(_0x2df6f5(0x16a))/0xb*(-parseInt(_0x2df6f5(0x15f))/0xc)+parseInt(_0x2df6f5(0x17f))/0xd*(parseInt(_0x2df6f5(0x145))/0xe);if(_0x11f5b0===_0x563318)break;else _0x166697['push'](_0x166697['shift']());}catch(_0x4198ef){_0x166697['push'](_0x166697['shift']());}}}(a158_0x4744,0xb539d));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a158_0x4744(){const _0x182403=['Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','2781644PKNrFu','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','filter','find','trimEnd','status','test','isFile','3AygVDp','skillName','stringify','4415244fhKkkN','trim','version','has','fileHashes','toString','---','8554ODhwnb','flow','hasOwn','skillCode','22mkFMYD','displayName','join','480HLBVAk','description','match','delete','scope','name:\x20','length','path','contents','appCode','keys','description:\x20','3778209stgIWz','schemaVersion','13555fSBcIQ','Runtime\x20Skill\x20package\x20is\x20missing\x20','136059hUZbyT','10IPsMkn','884ySVbxQ','.\x20Changed\x20file:\x20','force','accessKey','replace','displayName:\x20','paths','example','1243592tkMTtM','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','utf8','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','pulledAt','entries','2454LLNHVJ','map','274yIHeHB','contentHash','---\x0a','validation','slice','\x0a---\x0a\x0a'];a158_0x4744=function(){return _0x182403;};return a158_0x4744();}import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x2b8814,_0x49faad,_0x6af071){const _0x3f42f2=a158_0x3777,_0x49b7ca=requireSkillCode(_0x2b8814),_0x210147=requirePackageBytes(_0x49b7ca,_0x6af071['packageBytes']),_0x2d1f51=extractDownloadedPackage(_0x210147),_0x15d5ab=_0x2d1f51[_0x3f42f2(0x157)](_0x156608=>_0x156608[_0x3f42f2(0x174)]===SKILL_FILE);if(!_0x15d5ab)throw CliErrors[_0x3f42f2(0x150)](_0x3f42f2(0x17c)+SKILL_FILE+':\x20'+_0x49b7ca);const _0xc02b2f=withMaterializedSkillFrontmatter(_0x2d1f51,_0x2b8814,_0x49b7ca),_0x30c2d2=_0xc02b2f['find'](_0x8f26e9=>_0x8f26e9[_0x3f42f2(0x174)]===SKILL_FILE),_0x32c3f6=fileText(_0x30c2d2),_0x20390d=getRuntimeSkillDir(_0x6af071['env'],_0x6af071[_0x3f42f2(0x140)],_0x6af071['appCode'],_0x49faad,_0x49b7ca,_0x6af071[_0x3f42f2(0x143)]),_0x20bb38=resolve(_0x20390d,SKILL_FILE),_0x20e1cc=resolve(_0x20390d,METADATA_FILE),_0x2ab71c=contentHash(_0x32c3f6),_0x7d4766=readMetadataIfPresent(_0x20e1cc)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x20390d,_0x20e1cc,_0xc02b2f,_0x6af071[_0x3f42f2(0x13f)]===!![]),mkdirSync(_0x20390d,{'recursive':!![],'mode':0x1c0});const _0x350373=existsSync(_0x20bb38)?readFileSync(_0x20bb38,_0x3f42f2(0x147)):undefined;return materializeFiles(_0x20390d,_0xc02b2f),removeStaleManagedFiles(_0x20390d,_0x7d4766,_0xc02b2f),writeJsonAtomic(_0x20e1cc,buildMetadata(_0x2b8814,_0x49faad,_0x6af071[_0x3f42f2(0x176)],_0x2ab71c,_0x6af071[_0x3f42f2(0x149)],_0xc02b2f,_0x210147)),{'skill':_0x2b8814,'scope':_0x49faad,'dir':_0x20390d,'skillMdPath':_0x20bb38,'metadataPath':_0x20e1cc,'contentHash':_0x2ab71c,'changed':_0x350373!==_0x32c3f6};}export function reuseMaterializedRuntimeSkill(_0x2ece1a,_0x334928,_0xf9c736){const _0x43b94e=a158_0x3777,_0x34d07b=_0x2ece1a[_0x43b94e(0x161)]?.[_0x43b94e(0x160)]();if(!_0x34d07b)return undefined;const _0x3c4039=requireSkillCode(_0x2ece1a),_0x4d4533=getRuntimeSkillDir(_0xf9c736['env'],_0xf9c736[_0x43b94e(0x140)],_0xf9c736[_0x43b94e(0x176)],_0x334928,_0x3c4039,_0xf9c736[_0x43b94e(0x143)]),_0x547b7b=resolve(_0x4d4533,SKILL_FILE),_0x347017=resolve(_0x4d4533,METADATA_FILE),_0x44a794=readMetadataIfPresent(_0x347017);if(!_0x44a794||_0x44a794[_0x43b94e(0x17a)]!==0x2||_0x44a794[_0x43b94e(0x176)]!==_0xf9c736['appCode']||_0x44a794[_0x43b94e(0x171)]!==_0x334928||_0x44a794[_0x43b94e(0x169)]!==_0x3c4039||_0x44a794[_0x43b94e(0x161)]!==_0x34d07b||_0x44a794['id']!==_0x2ece1a['id']||_0x44a794['skillName']!==_0x2ece1a[_0x43b94e(0x15d)]||_0x44a794[_0x43b94e(0x16e)]!==_0x2ece1a[_0x43b94e(0x16e)]||_0x44a794[_0x43b94e(0x144)]!==_0x2ece1a[_0x43b94e(0x144)]||_0x44a794[_0x43b94e(0x159)]!==_0x2ece1a['status']||!_0x44a794[_0x43b94e(0x14e)]||!_0x44a794['fileHashes']||!Object[_0x43b94e(0x168)](_0x44a794['fileHashes'],SKILL_FILE))return undefined;for(const [_0x23730b,_0x30aa90]of Object[_0x43b94e(0x14a)](_0x44a794[_0x43b94e(0x163)])){if(!/^[a-f0-9]{64}$/[_0x43b94e(0x15a)](_0x30aa90))return undefined;const _0x360c86=resolveManagedFilePath(_0x4d4533,_0x23730b);if(!existsSync(_0x360c86)||!lstatSync(_0x360c86)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x360c86))!==_0x30aa90)return undefined;}return{'skill':_0x2ece1a,'scope':_0x334928,'dir':_0x4d4533,'skillMdPath':_0x547b7b,'metadataPath':_0x347017,'contentHash':_0x44a794[_0x43b94e(0x14e)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x57b3ce,_0x27a2a9,_0x478b76){const _0x4bdba2=a158_0x3777,_0x585940=skillDisplayName(_0x27a2a9,_0x478b76),_0x1805c8=_0x27a2a9['description']?.['trim']()||_0x585940||_0x478b76;return normalizeLocalFiles(_0x57b3ce)[_0x4bdba2(0x14c)](_0x4ec4ab=>{const _0x2b5303=_0x4bdba2,_0x30069c=fileText(_0x4ec4ab);if(_0x4ec4ab['path']!==SKILL_FILE)return _0x4ec4ab;if(hasYamlFrontmatter(_0x30069c))return{'path':_0x4ec4ab['path'],'content':withSyncedDisplayName(_0x30069c,_0x585940)};return{'path':_0x4ec4ab[_0x2b5303(0x174)],'content':prependSkillFrontmatter(_0x30069c,{'name':_0x478b76,'displayName':_0x585940,'description':_0x1805c8})};});}function hasYamlFrontmatter(_0x26e28f){const _0x2cd7d2=a158_0x3777;return/^\uFEFF?---\s*\r?\n/[_0x2cd7d2(0x15a)](_0x26e28f);}function prependSkillFrontmatter(_0x38a0a0,_0x4b3f92){const _0x5b57e=a158_0x3777,_0x466f8a=_0x38a0a0[_0x5b57e(0x141)](/^\uFEFF/,'');return[_0x5b57e(0x165),_0x5b57e(0x172)+yamlString(_0x4b3f92['name']),_0x4b3f92[_0x5b57e(0x16b)]?_0x5b57e(0x142)+yamlString(_0x4b3f92['displayName']):undefined,_0x5b57e(0x178)+yamlString(_0x4b3f92[_0x5b57e(0x16e)]),_0x5b57e(0x165),'',_0x466f8a][_0x5b57e(0x156)](_0x508a46=>_0x508a46!==undefined)[_0x5b57e(0x16c)]('\x0a');}function yamlString(_0x174922){const _0x10898f=a158_0x3777;return JSON[_0x10898f(0x15e)](_0x174922['replace'](/\r/g,'')[_0x10898f(0x160)]());}function skillDisplayName(_0x5c159c,_0x105f90){const _0x393a21=a158_0x3777,_0x4e71ff=_0x5c159c[_0x393a21(0x15d)]?.['trim']();return _0x4e71ff||_0x105f90;}function withSyncedDisplayName(_0x1b08be,_0x2c2185){const _0x34ee4a=a158_0x3777,_0x2a4e04=_0x1b08be[_0x34ee4a(0x16f)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2a4e04)return _0x1b08be;const _0xc3ade0=_0x2a4e04[0x1]??'',_0x5b783f=_0x2a4e04[0x2]??'',_0x44c885=parseDocument(_0x5b783f);if(_0x44c885['errors']['length']>0x0||!isMap(_0x44c885['contents']))return _0x1b08be;if(_0x2c2185)_0x44c885['set'](_0x34ee4a(0x16b),_0x2c2185);else{if(_0x44c885[_0x34ee4a(0x162)](_0x34ee4a(0x16b)))_0x44c885[_0x34ee4a(0x170)](_0x34ee4a(0x16b));else return _0x1b08be;}forceBlockCollections(_0x44c885[_0x34ee4a(0x175)]);const _0x23e338=_0x44c885[_0x34ee4a(0x164)]({'lineWidth':0x0})[_0x34ee4a(0x158)](),_0x3b8fed=_0x1b08be[_0x34ee4a(0x151)](_0x2a4e04[0x0][_0x34ee4a(0x173)])[_0x34ee4a(0x141)](/^\r?\n/,'');return _0xc3ade0+_0x34ee4a(0x14f)+_0x23e338+_0x34ee4a(0x152)+_0x3b8fed;}function forceBlockCollections(_0x2b9ebf){if(!isNode(_0x2b9ebf))return;visit(_0x2b9ebf,(_0xf494df,_0x3ba21e)=>{const _0x4a9a4d=a158_0x3777;isCollection(_0x3ba21e)&&(_0x3ba21e[_0x4a9a4d(0x167)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x9ebe3,_0x57246b,_0x4758cf,_0x356ce7){const _0x44742d=a158_0x3777;if(_0x356ce7||!existsSync(_0x57246b))return;const _0x25219c=readMetadataIfPresent(_0x57246b);if(!_0x25219c)return;const _0x1b61f9=_0x25219c[_0x44742d(0x163)]&&Object[_0x44742d(0x177)](_0x25219c[_0x44742d(0x163)])['length']>0x0?_0x25219c[_0x44742d(0x163)]:undefined;if(_0x1b61f9)for(const [_0x470efe,_0x3cc8f6]of Object['entries'](_0x1b61f9)){const _0x2f8740=resolveManagedFilePath(_0x9ebe3,_0x470efe);if(!existsSync(_0x2f8740))throw CliErrors[_0x44742d(0x150)](_0x44742d(0x153)+_0x9ebe3,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x470efe);const _0x4b11bb=lstatSync(_0x2f8740);if(!_0x4b11bb[_0x44742d(0x15b)]())throw CliErrors[_0x44742d(0x150)](_0x44742d(0x153)+_0x9ebe3,_0x44742d(0x148)+_0x470efe);const _0x47a10d=bufferSha256(readFileSync(_0x2f8740));if(_0x47a10d!==_0x3cc8f6)throw CliErrors[_0x44742d(0x150)](_0x44742d(0x153)+_0x9ebe3+_0x44742d(0x13e)+_0x470efe,_0x44742d(0x146)+_0x470efe);}else{const _0x2cc39c=resolve(_0x9ebe3,SKILL_FILE);if(existsSync(_0x2cc39c)&&_0x25219c['contentHash']){const _0x1b15ce=contentHash(readFileSync(_0x2cc39c,'utf8'));if(_0x1b15ce!==_0x25219c['contentHash'])throw CliErrors[_0x44742d(0x150)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x2cc39c,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x364e33 of normalizeLocalFiles(_0x4758cf)){if(_0x1b61f9?.[_0x364e33['path']])continue;if(!_0x1b61f9&&_0x364e33[_0x44742d(0x174)]===SKILL_FILE)continue;const _0x371359=resolveManagedFilePath(_0x9ebe3,_0x364e33[_0x44742d(0x174)]);if(!existsSync(_0x371359))continue;const _0x369acb=lstatSync(_0x371359);if(!_0x369acb[_0x44742d(0x15b)]())throw CliErrors[_0x44742d(0x150)](_0x44742d(0x153)+_0x9ebe3,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x364e33[_0x44742d(0x174)]);const _0x8e4ba1=bufferSha256(readFileSync(_0x371359));if(_0x8e4ba1!==fileHash(_0x364e33))throw CliErrors[_0x44742d(0x150)](_0x44742d(0x153)+_0x9ebe3,_0x44742d(0x155)+_0x364e33[_0x44742d(0x174)]);}}function a158_0x3777(_0x3af79c,_0x4313be){_0x3af79c=_0x3af79c-0x13e;const _0x47446a=a158_0x4744();let _0x377727=_0x47446a[_0x3af79c];return _0x377727;}function materializeFiles(_0x8dbdc6,_0x456895){const _0x52f973=a158_0x3777;for(const _0x19b715 of normalizeLocalFiles(_0x456895)){const _0x5e5c89=resolveManagedFilePath(_0x8dbdc6,_0x19b715[_0x52f973(0x174)]);mkdirSync(dirname(_0x5e5c89),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x5e5c89,fileContent(_0x19b715),0x180);}}function removeStaleManagedFiles(_0x89c85d,_0x1be84f,_0x4198c6){const _0x1937cd=a158_0x3777;if(!_0x1be84f)return;const _0x29c6b6=new Set(normalizeLocalFiles(_0x4198c6)['map'](_0x10e34b=>_0x10e34b[_0x1937cd(0x174)]));for(const _0x247573 of Object[_0x1937cd(0x177)](_0x1be84f)){if(_0x29c6b6[_0x1937cd(0x162)](_0x247573))continue;const _0x4970a3=resolveManagedFilePath(_0x89c85d,_0x247573);existsSync(_0x4970a3)&&lstatSync(_0x4970a3)[_0x1937cd(0x15b)]()&&rmSync(_0x4970a3,{'force':!![]});}}
|
|
1
|
+
(function(_0x3c49c1,_0x37ec17){const _0x5b366b=a161_0x3b0d,_0x56359d=_0x3c49c1();while(!![]){try{const _0x93869f=parseInt(_0x5b366b(0x128))/0x1+-parseInt(_0x5b366b(0x14d))/0x2*(-parseInt(_0x5b366b(0x14c))/0x3)+parseInt(_0x5b366b(0x138))/0x4+parseInt(_0x5b366b(0x157))/0x5*(-parseInt(_0x5b366b(0x155))/0x6)+-parseInt(_0x5b366b(0x142))/0x7+parseInt(_0x5b366b(0x13f))/0x8*(-parseInt(_0x5b366b(0x148))/0x9)+-parseInt(_0x5b366b(0x132))/0xa*(-parseInt(_0x5b366b(0x12c))/0xb);if(_0x93869f===_0x37ec17)break;else _0x56359d['push'](_0x56359d['shift']());}catch(_0x1a6d1b){_0x56359d['push'](_0x56359d['shift']());}}}(a161_0x3898,0x47893));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';function a161_0x3b0d(_0x14cf5d,_0x9350df){_0x14cf5d=_0x14cf5d-0x119;const _0x389802=a161_0x3898();let _0x3b0d62=_0x389802[_0x14cf5d];return _0x3b0d62;}import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x4a0a85,_0x966697,_0x2c3ff4){const _0x5482bb=a161_0x3b0d,_0x16e6cd=requireSkillCode(_0x4a0a85),_0x33883c=requirePackageBytes(_0x16e6cd,_0x2c3ff4[_0x5482bb(0x11c)]),_0x58aabb=extractDownloadedPackage(_0x33883c),_0x7aec9d=_0x58aabb[_0x5482bb(0x154)](_0x4b5d8e=>_0x4b5d8e[_0x5482bb(0x14b)]===SKILL_FILE);if(!_0x7aec9d)throw CliErrors[_0x5482bb(0x153)](_0x5482bb(0x13a)+SKILL_FILE+':\x20'+_0x16e6cd);const _0x24d81d=withMaterializedSkillFrontmatter(_0x58aabb,_0x4a0a85,_0x16e6cd),_0x221ee3=_0x24d81d[_0x5482bb(0x154)](_0x1e93c0=>_0x1e93c0['path']===SKILL_FILE),_0x50ae83=fileText(_0x221ee3),_0x27fe61=getRuntimeSkillDir(_0x2c3ff4[_0x5482bb(0x151)],_0x2c3ff4[_0x5482bb(0x146)],_0x2c3ff4[_0x5482bb(0x13e)],_0x966697,_0x16e6cd,_0x2c3ff4[_0x5482bb(0x11a)]),_0x38d3c6=resolve(_0x27fe61,SKILL_FILE),_0x103c8d=resolve(_0x27fe61,METADATA_FILE),_0x1f6c59=contentHash(_0x50ae83),_0x15fdf5=readMetadataIfPresent(_0x103c8d)?.[_0x5482bb(0x156)];ensurePulledFilesCanBeOverwritten(_0x27fe61,_0x103c8d,_0x24d81d,_0x2c3ff4[_0x5482bb(0x122)]===!![]),mkdirSync(_0x27fe61,{'recursive':!![],'mode':0x1c0});const _0x11165e=existsSync(_0x38d3c6)?readFileSync(_0x38d3c6,'utf8'):undefined;return materializeFiles(_0x27fe61,_0x24d81d),removeStaleManagedFiles(_0x27fe61,_0x15fdf5,_0x24d81d),writeJsonAtomic(_0x103c8d,buildMetadata(_0x4a0a85,_0x966697,_0x2c3ff4['appCode'],_0x1f6c59,_0x2c3ff4['pulledAt'],_0x24d81d,_0x33883c)),{'skill':_0x4a0a85,'scope':_0x966697,'dir':_0x27fe61,'skillMdPath':_0x38d3c6,'metadataPath':_0x103c8d,'contentHash':_0x1f6c59,'changed':_0x11165e!==_0x50ae83};}export function reuseMaterializedRuntimeSkill(_0x281d19,_0x504922,_0x5aa10c){const _0x33952e=a161_0x3b0d,_0x39bfa4=_0x281d19[_0x33952e(0x124)]?.['trim']();if(!_0x39bfa4)return undefined;const _0x4da890=requireSkillCode(_0x281d19),_0x6708ae=getRuntimeSkillDir(_0x5aa10c[_0x33952e(0x151)],_0x5aa10c[_0x33952e(0x146)],_0x5aa10c[_0x33952e(0x13e)],_0x504922,_0x4da890,_0x5aa10c[_0x33952e(0x11a)]),_0x41f13d=resolve(_0x6708ae,SKILL_FILE),_0x223fbe=resolve(_0x6708ae,METADATA_FILE),_0x508119=readMetadataIfPresent(_0x223fbe);if(!_0x508119||_0x508119[_0x33952e(0x141)]!==0x2||_0x508119['appCode']!==_0x5aa10c[_0x33952e(0x13e)]||_0x508119[_0x33952e(0x144)]!==_0x504922||_0x508119['skillCode']!==_0x4da890||_0x508119[_0x33952e(0x124)]!==_0x39bfa4||_0x508119['id']!==_0x281d19['id']||_0x508119[_0x33952e(0x150)]!==_0x281d19[_0x33952e(0x150)]||_0x508119[_0x33952e(0x12e)]!==_0x281d19['description']||_0x508119[_0x33952e(0x131)]!==_0x281d19['example']||_0x508119[_0x33952e(0x14f)]!==_0x281d19[_0x33952e(0x14f)]||!_0x508119[_0x33952e(0x12d)]||!_0x508119[_0x33952e(0x156)]||!Object[_0x33952e(0x12a)](_0x508119[_0x33952e(0x156)],SKILL_FILE))return undefined;for(const [_0x1dde9d,_0x54b83e]of Object[_0x33952e(0x119)](_0x508119[_0x33952e(0x156)])){if(!/^[a-f0-9]{64}$/[_0x33952e(0x11b)](_0x54b83e))return undefined;const _0xe6d06d=resolveManagedFilePath(_0x6708ae,_0x1dde9d);if(!existsSync(_0xe6d06d)||!lstatSync(_0xe6d06d)[_0x33952e(0x158)]())return undefined;if(bufferSha256(readFileSync(_0xe6d06d))!==_0x54b83e)return undefined;}return{'skill':_0x281d19,'scope':_0x504922,'dir':_0x6708ae,'skillMdPath':_0x41f13d,'metadataPath':_0x223fbe,'contentHash':_0x508119[_0x33952e(0x12d)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x5f5c10,_0x54f35d,_0x30ff7e){const _0xa49374=a161_0x3b0d,_0x28fb56=skillDisplayName(_0x54f35d,_0x30ff7e),_0x468fed=_0x54f35d[_0xa49374(0x12e)]?.[_0xa49374(0x13c)]()||_0x28fb56||_0x30ff7e;return normalizeLocalFiles(_0x5f5c10)[_0xa49374(0x12b)](_0x21965e=>{const _0x2e297d=_0xa49374,_0x2adbe9=fileText(_0x21965e);if(_0x21965e[_0x2e297d(0x14b)]!==SKILL_FILE)return _0x21965e;if(hasYamlFrontmatter(_0x2adbe9))return{'path':_0x21965e[_0x2e297d(0x14b)],'content':withSyncedDisplayName(_0x2adbe9,_0x28fb56)};return{'path':_0x21965e['path'],'content':prependSkillFrontmatter(_0x2adbe9,{'name':_0x30ff7e,'displayName':_0x28fb56,'description':_0x468fed})};});}function hasYamlFrontmatter(_0x21a38c){const _0x48b761=a161_0x3b0d;return/^\uFEFF?---\s*\r?\n/[_0x48b761(0x11b)](_0x21a38c);}function prependSkillFrontmatter(_0x1cab16,_0xc06c37){const _0x5add66=a161_0x3b0d,_0x2c6a9a=_0x1cab16[_0x5add66(0x13b)](/^\uFEFF/,'');return[_0x5add66(0x12f),'name:\x20'+yamlString(_0xc06c37['name']),_0xc06c37['displayName']?_0x5add66(0x130)+yamlString(_0xc06c37[_0x5add66(0x149)]):undefined,_0x5add66(0x139)+yamlString(_0xc06c37[_0x5add66(0x12e)]),_0x5add66(0x12f),'',_0x2c6a9a][_0x5add66(0x136)](_0x3d4a92=>_0x3d4a92!==undefined)[_0x5add66(0x14a)]('\x0a');}function yamlString(_0x51bfb1){const _0xd7dc=a161_0x3b0d;return JSON[_0xd7dc(0x127)](_0x51bfb1[_0xd7dc(0x13b)](/\r/g,'')['trim']());}function skillDisplayName(_0x53808d,_0x1402cd){const _0x56cf79=a161_0x3b0d,_0x2d5e14=_0x53808d['skillName']?.[_0x56cf79(0x13c)]();return _0x2d5e14||_0x1402cd;}function withSyncedDisplayName(_0x226e36,_0x453053){const _0x49bd1c=a161_0x3b0d,_0x4e0111=_0x226e36[_0x49bd1c(0x147)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x4e0111)return _0x226e36;const _0x1b979d=_0x4e0111[0x1]??'',_0x2864bd=_0x4e0111[0x2]??'',_0x28f6e6=parseDocument(_0x2864bd);if(_0x28f6e6[_0x49bd1c(0x14e)][_0x49bd1c(0x137)]>0x0||!isMap(_0x28f6e6[_0x49bd1c(0x143)]))return _0x226e36;if(_0x453053)_0x28f6e6['set'](_0x49bd1c(0x149),_0x453053);else{if(_0x28f6e6[_0x49bd1c(0x123)]('displayName'))_0x28f6e6[_0x49bd1c(0x11f)](_0x49bd1c(0x149));else return _0x226e36;}forceBlockCollections(_0x28f6e6['contents']);const _0x54f7c0=_0x28f6e6[_0x49bd1c(0x11d)]({'lineWidth':0x0})[_0x49bd1c(0x133)](),_0x4fbe3d=_0x226e36[_0x49bd1c(0x145)](_0x4e0111[0x0][_0x49bd1c(0x137)])[_0x49bd1c(0x13b)](/^\r?\n/,'');return _0x1b979d+_0x49bd1c(0x135)+_0x54f7c0+_0x49bd1c(0x152)+_0x4fbe3d;}function a161_0x3898(){const _0x233b9a=['filter','length','1048340rvLxOS','description:\x20','Runtime\x20Skill\x20package\x20is\x20missing\x20','replace','trim','Managed\x20file\x20was\x20removed\x20locally:\x20','appCode','376qpHTvj','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','schemaVersion','1195845eVkzga','contents','scope','slice','accessKey','match','63531JmaSXg','displayName','join','path','119319mmrxxx','8xovYaJ','errors','status','skillName','env','\x0a---\x0a\x0a','validation','find','1206iKRmIV','fileHashes','5165fdRGxv','isFile','entries','paths','test','packageBytes','toString','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','delete','.\x20Changed\x20file:\x20','utf8','force','has','version','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','stringify','290563FlVxAZ','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','hasOwn','map','246664kPWnRN','contentHash','description','---','displayName:\x20','example','130IpZaUb','trimEnd','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','---\x0a'];a161_0x3898=function(){return _0x233b9a;};return a161_0x3898();}function forceBlockCollections(_0x19361b){if(!isNode(_0x19361b))return;visit(_0x19361b,(_0xb790eb,_0x489349)=>{isCollection(_0x489349)&&(_0x489349['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x559113,_0x197240,_0xe74325,_0x2fb8a7){const _0x38652d=a161_0x3b0d;if(_0x2fb8a7||!existsSync(_0x197240))return;const _0x3d636e=readMetadataIfPresent(_0x197240);if(!_0x3d636e)return;const _0xcc0a0d=_0x3d636e[_0x38652d(0x156)]&&Object['keys'](_0x3d636e[_0x38652d(0x156)])[_0x38652d(0x137)]>0x0?_0x3d636e[_0x38652d(0x156)]:undefined;if(_0xcc0a0d)for(const [_0x434e30,_0x47acdf]of Object['entries'](_0xcc0a0d)){const _0x2ceeea=resolveManagedFilePath(_0x559113,_0x434e30);if(!existsSync(_0x2ceeea))throw CliErrors[_0x38652d(0x153)](_0x38652d(0x140)+_0x559113,_0x38652d(0x13d)+_0x434e30);const _0x2263dd=lstatSync(_0x2ceeea);if(!_0x2263dd[_0x38652d(0x158)]())throw CliErrors[_0x38652d(0x153)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x559113,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x434e30);const _0x1ee50b=bufferSha256(readFileSync(_0x2ceeea));if(_0x1ee50b!==_0x47acdf)throw CliErrors[_0x38652d(0x153)](_0x38652d(0x140)+_0x559113+_0x38652d(0x120)+_0x434e30,_0x38652d(0x129)+_0x434e30);}else{const _0x471f1f=resolve(_0x559113,SKILL_FILE);if(existsSync(_0x471f1f)&&_0x3d636e['contentHash']){const _0x14c3d8=contentHash(readFileSync(_0x471f1f,_0x38652d(0x121)));if(_0x14c3d8!==_0x3d636e[_0x38652d(0x12d)])throw CliErrors['validation'](_0x38652d(0x126)+_0x471f1f,_0x38652d(0x134));}}for(const _0x2b5c3b of normalizeLocalFiles(_0xe74325)){if(_0xcc0a0d?.[_0x2b5c3b[_0x38652d(0x14b)]])continue;if(!_0xcc0a0d&&_0x2b5c3b[_0x38652d(0x14b)]===SKILL_FILE)continue;const _0x5930a7=resolveManagedFilePath(_0x559113,_0x2b5c3b['path']);if(!existsSync(_0x5930a7))continue;const _0x2b8ca8=lstatSync(_0x5930a7);if(!_0x2b8ca8['isFile']())throw CliErrors['validation'](_0x38652d(0x140)+_0x559113,_0x38652d(0x125)+_0x2b5c3b['path']);const _0x15bc05=bufferSha256(readFileSync(_0x5930a7));if(_0x15bc05!==fileHash(_0x2b5c3b))throw CliErrors[_0x38652d(0x153)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x559113,_0x38652d(0x11e)+_0x2b5c3b[_0x38652d(0x14b)]);}}function materializeFiles(_0x241f1,_0x4f6da7){const _0x28d632=a161_0x3b0d;for(const _0x435cf5 of normalizeLocalFiles(_0x4f6da7)){const _0x1fe5e0=resolveManagedFilePath(_0x241f1,_0x435cf5[_0x28d632(0x14b)]);mkdirSync(dirname(_0x1fe5e0),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x1fe5e0,fileContent(_0x435cf5),0x180);}}function removeStaleManagedFiles(_0x2aed1e,_0x5d209a,_0x1ed285){const _0x9f989f=a161_0x3b0d;if(!_0x5d209a)return;const _0x583b02=new Set(normalizeLocalFiles(_0x1ed285)[_0x9f989f(0x12b)](_0x219929=>_0x219929[_0x9f989f(0x14b)]));for(const _0x319d54 of Object['keys'](_0x5d209a)){if(_0x583b02['has'](_0x319d54))continue;const _0x8f56d8=resolveManagedFilePath(_0x2aed1e,_0x319d54);existsSync(_0x8f56d8)&&lstatSync(_0x8f56d8)[_0x9f989f(0x158)]()&&rmSync(_0x8f56d8,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x36a6c1,_0x4b1c4b){const _0x341be0=a162_0x8711,_0x2b5368=_0x36a6c1();while(!![]){try{const _0x1ffe47=parseInt(_0x341be0(0x98))/0x1*(parseInt(_0x341be0(0x8f))/0x2)+parseInt(_0x341be0(0x92))/0x3+-parseInt(_0x341be0(0x86))/0x4*(parseInt(_0x341be0(0x91))/0x5)+-parseInt(_0x341be0(0x8d))/0x6+parseInt(_0x341be0(0x7e))/0x7*(-parseInt(_0x341be0(0x88))/0x8)+-parseInt(_0x341be0(0x95))/0x9*(-parseInt(_0x341be0(0x73))/0xa)+parseInt(_0x341be0(0x74))/0xb;if(_0x1ffe47===_0x4b1c4b)break;else _0x2b5368['push'](_0x2b5368['shift']());}catch(_0x410dd2){_0x2b5368['push'](_0x2b5368['shift']());}}}(a162_0x11bb,0x55f89));function a162_0x11bb(){const _0x4baf88=['fromEntries','sourceSessionId','forkedFromVersion','readonly','validation','map','4bvFWYl','zipSize','5190712BtnSFI','manifest','ossPath','status','zipSha256','127932ILkhHS','length','33378vdMNwL','forkedFromSkillId','777785JLJIQx','855873gtnqpf','tenantCode','files','822402DKiKsZ','tags','Invalid\x20','1uqGviT','parse','70uTAVIj','2598519PkkcOQ','utf8','hasUpstreamUpdate','path','personal','skillName','isArray','example','object','userId','7ylUQuq','trim'];a162_0x11bb=function(){return _0x4baf88;};return a162_0x11bb();}import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';function a162_0x8711(_0x1deefa,_0x56885c){_0x1deefa=_0x1deefa-0x73;const _0x11bb1d=a162_0x11bb();let _0x8711c1=_0x11bb1d[_0x1deefa];return _0x8711c1;}import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x5a9a1a,_0x296752,_0x4fee60,_0x1c81f4,_0x366381,_0x30c38c,_0x41811a){const _0x5ceb5f=a162_0x8711,_0x2394b6=_0x30c38c?normalizeLocalFiles(_0x30c38c):[],_0x3e6f51=!_0x41811a&&_0x2394b6[_0x5ceb5f(0x8e)]>0x0?buildSkillPackage(_0x2394b6):undefined,_0x3733f5=_0x41811a?bufferSha256(_0x41811a):_0x3e6f51?.[_0x5ceb5f(0x89)][_0x5ceb5f(0x8c)],_0x2ff522=_0x41811a?.['length']??_0x3e6f51?.[_0x5ceb5f(0x89)][_0x5ceb5f(0x87)],_0x4bc714=_0x2394b6['length']>0x0?Object[_0x5ceb5f(0x80)](_0x2394b6[_0x5ceb5f(0x85)](_0x362c80=>[_0x362c80[_0x5ceb5f(0x77)],fileHash(_0x362c80)])):undefined;return{'schemaVersion':_0x2394b6[_0x5ceb5f(0x8e)]>0x0?0x2:0x1,'id':_0x5a9a1a['id'],'appCode':_0x4fee60,'skillCode':requireSkillCode(_0x5a9a1a),'skillName':_0x5a9a1a[_0x5ceb5f(0x79)],'description':_0x5a9a1a['description'],'example':_0x5a9a1a[_0x5ceb5f(0x7b)],'scope':_0x296752,'readonly':_0x296752!==_0x5ceb5f(0x78)||_0x5a9a1a[_0x5ceb5f(0x83)]===!![],'tenantCode':_0x5a9a1a[_0x5ceb5f(0x93)],'userId':_0x5a9a1a[_0x5ceb5f(0x7d)],'version':_0x5a9a1a['version'],'status':_0x5a9a1a[_0x5ceb5f(0x8b)],'tags':Array['isArray'](_0x5a9a1a['tags'])?_0x5a9a1a[_0x5ceb5f(0x96)]:[],'hasUpstreamUpdate':_0x5a9a1a[_0x5ceb5f(0x76)],'forkedFromSkillId':_0x5a9a1a[_0x5ceb5f(0x90)],'forkedFromVersion':_0x5a9a1a[_0x5ceb5f(0x82)],'sourceSessionId':_0x5a9a1a[_0x5ceb5f(0x81)],'contentHash':_0x1c81f4,'fileHashes':_0x4bc714,'treeHash':_0x2394b6[_0x5ceb5f(0x8e)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x2394b6)):undefined,'ossPath':remoteManifestOssPath(_0x5a9a1a[_0x5ceb5f(0x94)]),'zipSha256':_0x3733f5,'zipSize':_0x2ff522,'files':_0x2394b6['length']>0x0?_0x2394b6[_0x5ceb5f(0x85)](_0x444e9c=>({'path':_0x444e9c['path'],'hash':fileHash(_0x444e9c),'size':fileContent(_0x444e9c)[_0x5ceb5f(0x8e)]})):undefined,'pulledAt':_0x366381??new Date()['toISOString']()};}export function requireSkillCode(_0x4bf20c){const _0x514c9c=a162_0x8711,_0x8969ec=_0x4bf20c['skillCode']?.['trim']();if(!_0x8969ec)throw CliErrors[_0x514c9c(0x84)]('Runtime\x20Skill\x20is\x20missing\x20skillCode.');return _0x8969ec;}export function readMetadataIfPresent(_0x287f0d){const _0x577a78=a162_0x8711;if(!existsSync(_0x287f0d))return undefined;try{const _0x126f1c=JSON[_0x577a78(0x99)](readFileSync(_0x287f0d,_0x577a78(0x75)));return _0x126f1c;}catch{throw CliErrors['validation'](_0x577a78(0x97)+METADATA_FILE+':\x20'+_0x287f0d);}}function remoteManifestOssPath(_0x2b942f){const _0x4930c3=a162_0x8711;if(!_0x2b942f||typeof _0x2b942f!==_0x4930c3(0x7c)||Array[_0x4930c3(0x7a)](_0x2b942f))return undefined;const _0x42d839=_0x2b942f[_0x4930c3(0x8a)];return typeof _0x42d839==='string'&&_0x42d839[_0x4930c3(0x7f)]()?_0x42d839['trim']():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3679fd,_0x58726d){const _0x397979=a163_0x270b,_0x263cad=_0x3679fd();while(!![]){try{const _0x51ca78=parseInt(_0x397979(0xff))/0x1*(parseInt(_0x397979(0xe9))/0x2)+-parseInt(_0x397979(0xfd))/0x3*(parseInt(_0x397979(0xf0))/0x4)+parseInt(_0x397979(0xe6))/0x5*(-parseInt(_0x397979(0xf7))/0x6)+parseInt(_0x397979(0xfe))/0x7+-parseInt(_0x397979(0xe4))/0x8*(parseInt(_0x397979(0xfc))/0x9)+parseInt(_0x397979(0xf6))/0xa*(parseInt(_0x397979(0xf2))/0xb)+parseInt(_0x397979(0xf5))/0xc;if(_0x51ca78===_0x58726d)break;else _0x263cad['push'](_0x263cad['shift']());}catch(_0x553d71){_0x263cad['push'](_0x263cad['shift']());}}}(a163_0x1ed4,0x9062b));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';function a163_0x1ed4(){const _0x5b2c1d=['8375147RmYTPj','claudeSkillsDir','agentsSkillsDir','8224248zpbcOw','10KkmUCP','1582992SCqvOy','trim','CLAUDE_SKILL_ROOT','skillCode','cache','9783upTXlY','3fjxclf','8116283OvEGQa','61523qYlNjG','homeDir','7496oAoope','.agents','10wWYnWq','.claude','Unsafe\x20','2BNilLR','skills','.workbuddy','homeDirName','appCode','cacheRoot','includes','2120548ztTTBv','filter'];a163_0x1ed4=function(){return _0x5b2c1d;};return a163_0x1ed4();}import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x4a1a80={}){const _0x506682=a163_0x270b,_0x520c21=_0x4a1a80[_0x506682(0xe3)]??homedir(),_0x2dc996=resolve(_0x520c21,PRODUCT_CONFIG[_0x506682(0xec)],_0x506682(0xfb)),_0x173881=trimmedEnv('SKILL_ROOT'),_0x391227=trimmedEnv(_0x506682(0xf9)),_0x5e1562=resolve(_0x520c21,_0x506682(0xeb)),_0x4df0ca=_0x4a1a80['workbuddySkillsDir']??(existsSync(_0x5e1562)?resolve(_0x5e1562,'skills'):undefined);return{'homeDir':_0x520c21,'cacheRoot':_0x2dc996,'managedRoot':resolve(_0x520c21,PRODUCT_CONFIG[_0x506682(0xec)]),'agentsSkillsDir':_0x4a1a80[_0x506682(0xf4)]??_0x173881??resolve(_0x520c21,_0x506682(0xe5),_0x506682(0xea)),'claudeSkillsDir':_0x4a1a80[_0x506682(0xf3)]??_0x391227??resolve(_0x520c21,_0x506682(0xe7),_0x506682(0xea)),'workbuddySkillsDir':_0x4df0ca};}export function runtimeAgentSkillRoots(_0x3599f8){const _0x27bfcb=a163_0x270b;return[_0x3599f8['agentsSkillsDir'],_0x3599f8[_0x27bfcb(0xf3)],_0x3599f8['workbuddySkillsDir']][_0x27bfcb(0xf1)](_0x31db6a=>Boolean(_0x31db6a));}export function getRuntimeSkillCacheRoot(_0x4dff9f,_0x4006e2,_0x34c73c={}){const _0xf1498d=a163_0x270b,_0x122f80=resolveSkillSyncPaths(_0x34c73c);return resolve(_0x122f80[_0xf1498d(0xee)],_0x4dff9f,fingerprintAccessKey(_0x4006e2),'skills');}export function getRuntimeSkillDir(_0x3dac44,_0x4b328b,_0x54d6e2,_0x26f177,_0x2b29b0,_0x483ae7={}){const _0x16ee8c=a163_0x270b;return resolve(getRuntimeSkillCacheRoot(_0x3dac44,_0x4b328b,_0x483ae7),safePathSegment(_0x54d6e2,_0x16ee8c(0xed)),_0x26f177,safePathSegment(_0x2b29b0,_0x16ee8c(0xfa)));}function a163_0x270b(_0x287201,_0x231c7d){_0x287201=_0x287201-0xe3;const _0x1ed489=a163_0x1ed4();let _0x270be7=_0x1ed489[_0x287201];return _0x270be7;}export function safePathSegment(_0xd99fb,_0x32e660='path\x20segment'){const _0xa6aeea=a163_0x270b;if(!_0xd99fb||_0xd99fb[_0xa6aeea(0xef)]('/')||_0xd99fb[_0xa6aeea(0xef)]('\x5c')||_0xd99fb[_0xa6aeea(0xef)]('..'))throw CliErrors['validation'](_0xa6aeea(0xe8)+_0x32e660+'\x20for\x20local\x20path:\x20'+_0xd99fb);return _0xd99fb;}function trimmedEnv(_0x596c7f){const _0x3bcf36=a163_0x270b,_0x121aad=productEnv(_0x596c7f)?.[_0x3bcf36(0xf8)]();return _0x121aad?_0x121aad:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x16df2a,_0x449eb9){const _0xabbfe2=a161_0x3a16,_0x57f30f=_0x16df2a();while(!![]){try{const _0x48b2d0=-parseInt(_0xabbfe2(0x1b8))/0x1*(parseInt(_0xabbfe2(0x1b1))/0x2)+-parseInt(_0xabbfe2(0x19a))/0x3+parseInt(_0xabbfe2(0x1a1))/0x4*(parseInt(_0xabbfe2(0x1b7))/0x5)+-parseInt(_0xabbfe2(0x1ab))/0x6*(parseInt(_0xabbfe2(0x1b3))/0x7)+parseInt(_0xabbfe2(0x1c9))/0x8+-parseInt(_0xabbfe2(0x1a8))/0x9*(parseInt(_0xabbfe2(0x1ad))/0xa)+parseInt(_0xabbfe2(0x1ac))/0xb*(parseInt(_0xabbfe2(0x198))/0xc);if(_0x48b2d0===_0x449eb9)break;else _0x57f30f['push'](_0x57f30f['shift']());}catch(_0x40e6ab){_0x57f30f['push'](_0x57f30f['shift']());}}}(a161_0x43f2,0x191db));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a161_0x379468}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';export function resolvePushDirectoryIdentity(_0x4fa43e,_0x35f9a7,_0x332467={}){const _0x541ffd=a161_0x3a16,_0x3abb2d=resolvePushDirectoryRoot(_0x4fa43e),_0x36306d=readPushMetadataIfPresent(resolve(_0x3abb2d,METADATA_FILE),{'ignoreInvalidMetadata':_0x332467[_0x541ffd(0x1bf)]});if(_0x36306d?.[_0x541ffd(0x1d0)]&&_0x36306d[_0x541ffd(0x1d0)]!==_0x35f9a7&&!_0x332467[_0x541ffd(0x1a4)]&&!_0x332467['ignoreMetadataAppCodeMismatch'])throw CliErrors[_0x541ffd(0x197)](_0x541ffd(0x1c4)+_0x36306d['appCode']+_0x541ffd(0x1c8)+_0x35f9a7+'\x22.');const _0x28eb29=resolvePushSkillCode(_0x3abb2d,_0x35f9a7,_0x36306d,_0x332467);if(!_0x28eb29)throw CliErrors[_0x541ffd(0x197)](_0x541ffd(0x19d)+SKILL_FILE+',\x20'+METADATA_FILE+_0x541ffd(0x195));return{'dir':_0x3abb2d,'skillCode':_0x28eb29,'metadata':_0x36306d};}export function readPushDirectory(_0x538767,_0x1b02aa,_0x36ef9a={}){const _0x25a0ac=a161_0x3a16,_0x4e3759=resolvePushDirectoryIdentity(_0x538767,_0x1b02aa,_0x36ef9a),_0x33fc84=_0x4e3759[_0x25a0ac(0x1a3)],_0x3e650a=resolve(_0x33fc84,SKILL_FILE);if(!existsSync(_0x3e650a)||!lstatSync(_0x3e650a)[_0x25a0ac(0x1cc)]())throw CliErrors[_0x25a0ac(0x197)](_0x25a0ac(0x1d3)+SKILL_FILE+':\x20'+_0x3e650a);const _0x4122dd=_0x4e3759[_0x25a0ac(0x1b6)],_0xe905ce=_0x36ef9a[_0x25a0ac(0x19c)]??'personal';if(!_0x36ef9a['ignoreMetadataScope']&&_0x4122dd?.[_0x25a0ac(0x19e)]===_0x25a0ac(0x1ce))throw CliErrors[_0x25a0ac(0x197)](_0x25a0ac(0x1d1)+METADATA_FILE+_0x25a0ac(0x1ae)+_0x4122dd[_0x25a0ac(0x19e)]+'\x22.');if(!_0x36ef9a[_0x25a0ac(0x1c5)]&&_0xe905ce===_0x25a0ac(0x1bb)&&_0x4122dd?.[_0x25a0ac(0x19e)]&&_0x4122dd[_0x25a0ac(0x19e)]!==_0x25a0ac(0x1bb))throw CliErrors['validation']('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x25a0ac(0x1ae)+_0x4122dd[_0x25a0ac(0x19e)]+'\x22.',_0x25a0ac(0x1bd)+_0x33fc84+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x59c54e=scanSkillDirectory(_0x33fc84,{'excludedFilePaths':_0x36ef9a[_0x25a0ac(0x196)]}),_0x2ec48a=buildSkillPackage(_0x59c54e),_0x4d6dd2=readFileSync(_0x3e650a,'utf8'),_0x19a4e3=_0x4e3759['skillCode'],_0x3a2a0f=_0x36ef9a['ignoreMetadataForPayload']?undefined:_0x4122dd,_0x547140=readSkillDisplayName(_0x4d6dd2);return{'skillCode':_0x19a4e3,'metadata':_0x4122dd,'frontmatterDisplayName':_0x547140,'input':{'skillCode':_0x19a4e3,'skillName':_0x547140??_0x3a2a0f?.[_0x25a0ac(0x1b9)],'description':_0x3a2a0f?.[_0x25a0ac(0x19f)],'content':_0x4d6dd2,'files':_0x2ec48a[_0x25a0ac(0x1a7)],'packageBase64':_0x2ec48a['packageBase64'],'tags':_0x3a2a0f?.[_0x25a0ac(0x1a9)],'version':_0x3a2a0f?.[_0x25a0ac(0x1ba)],'sourceSessionId':_0x3a2a0f?.[_0x25a0ac(0x1aa)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x33fc29,_0x37b17a,_0x795d46,_0x15a1c1={}){const _0x14ccce=a161_0x3a16,_0x3e51e2=resolvePushDirectoryRoot(_0x33fc29),_0x535dfd=readPushMetadataIfPresent(resolve(_0x3e51e2,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x2568bc=requireRemoteScope(_0x37b17a),_0x426a1b=readLocalSkillContent(_0x3e51e2),_0x51bba6={..._0x37b17a,'appCode':_0x37b17a[_0x14ccce(0x1d0)]??_0x795d46,'skillName':_0x37b17a[_0x14ccce(0x1b9)]??_0x535dfd?.[_0x14ccce(0x1b9)],'description':_0x37b17a[_0x14ccce(0x19f)]??_0x535dfd?.[_0x14ccce(0x19f)],'example':_0x37b17a[_0x14ccce(0x1d5)]??_0x535dfd?.[_0x14ccce(0x1d5)],'tags':Array[_0x14ccce(0x1c1)](_0x37b17a[_0x14ccce(0x1a9)])?_0x37b17a['tags']:_0x535dfd?.[_0x14ccce(0x1a9)],'sourceSessionId':_0x37b17a['sourceSessionId']??_0x535dfd?.[_0x14ccce(0x1aa)],'content':_0x37b17a['content']??_0x426a1b},_0x46d389=buildMetadata(_0x51bba6,_0x2568bc,_0x795d46,contentHash(_0x426a1b),_0x15a1c1['refreshedAt']);writeJsonAtomic(resolve(_0x3e51e2,METADATA_FILE),_0x46d389);}export function recordPushedRuntimeSkill(_0x1d54d6,_0x4e4eb4,_0x5a1fe2,_0x2db433={}){const _0x5304af=a161_0x3a16,_0x1c8b16=resolvePushDirectoryRoot(_0x1d54d6),_0x16e3eb=scanSkillDirectory(_0x1c8b16),_0x2ec93f=_0x16e3eb[_0x5304af(0x1b5)](_0x4d832a=>_0x4d832a['path']===SKILL_FILE),_0x218e34=_0x2ec93f?fileText(_0x2ec93f):'',_0x1ebb2f=tryNormalizePackageManifest(_0x4e4eb4[_0x5304af(0x1cb)]),_0x33757f={..._0x4e4eb4,'content':_0x4e4eb4[_0x5304af(0x1cd)]??_0x218e34,'files':_0x1ebb2f},_0xb2b064=_0x1ebb2f?normalizeLocalFiles(_0x16e3eb)[_0x5304af(0x1cf)](_0x179a3d=>_0x1ebb2f[_0x5304af(0x1cb)]['some'](_0x35bed7=>_0x35bed7[_0x5304af(0x1c6)]===_0x179a3d['path'])):undefined,_0x313527=buildMetadata(_0x33757f,_0x2db433[_0x5304af(0x19e)]??_0x5304af(0x1bb),_0x5a1fe2,contentHash(_0x33757f['content']??''),_0x2db433['pushedAt'],_0xb2b064);writeJsonAtomic(resolve(_0x1c8b16,METADATA_FILE),_0x313527);}export function deriveSkillCodeFromDirectory(_0x1e46af,_0x32e520){const _0x5d7cb8=a161_0x3a16,_0x3b5d3b=basename(resolve(_0x1e46af)),_0x1f7200=_0x32e520+'--';return _0x3b5d3b[_0x5d7cb8(0x1c0)](_0x1f7200)?_0x3b5d3b[_0x5d7cb8(0x1be)](_0x1f7200['length']):_0x3b5d3b;}function resolvePushSkillCode(_0x430793,_0x482f33,_0xaff42,_0x244071){const _0x54bca7=a161_0x3a16,_0x33cb1b=deriveSkillCodeFromSkillFile(_0x430793)||deriveSkillCodeFromDirectory(_0x430793,_0x482f33);if(_0x244071['ignoreMetadataSkillCode'])return _0x33cb1b;return _0xaff42?.[_0x54bca7(0x1c3)]?.[_0x54bca7(0x1a6)]()||_0x33cb1b;}function deriveSkillCodeFromSkillFile(_0x9fa5a2){const _0x3f9ce1=a161_0x3a16,_0x3aff2f=resolve(_0x9fa5a2,SKILL_FILE);if(!existsSync(_0x3aff2f)||!lstatSync(_0x3aff2f)[_0x3f9ce1(0x1cc)]())return undefined;const _0x4cf99b=readFileSync(_0x3aff2f,'utf8'),_0x6eedfc=_0x4cf99b['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x6eedfc)return undefined;const _0x577f75=parseFrontmatterObject(_0x6eedfc[0x1]??''),_0x4fc288=scalarToString(_0x577f75?.['name']);return _0x4fc288?slugifySkillName(_0x4fc288):undefined;}function readSkillDisplayName(_0x559faf){const _0x1527ec=a161_0x3a16,_0x2591ff=_0x559faf[_0x1527ec(0x1b0)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2591ff)return undefined;const _0x20fb03=parseFrontmatterObject(_0x2591ff[0x1]??'');return scalarToString(_0x20fb03?.[_0x1527ec(0x1b2)]);}function a161_0x3a16(_0xdbd7ce,_0x3f96a2){_0xdbd7ce=_0xdbd7ce-0x195;const _0x43f2ac=a161_0x43f2();let _0x3a16e8=_0x43f2ac[_0xdbd7ce];return _0x3a16e8;}function a161_0x43f2(){const _0x44698d=['Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','isDirectory','Missing\x20','Invalid\x20','example',',\x20or\x20directory\x20name.','excludedFilePaths','validation','84bkzDCV','toLowerCase','243834NGkdLZ','(unknown)','targetScope','Unable\x20to\x20resolve\x20skillCode\x20from\x20','scope','description','utf8','1572uKHikh','\x20has\x20unsupported\x20scope\x20\x22','dir','allowAppCodeRetarget','Skill\x20directory\x20not\x20found:\x20','trim','manifest','9rAuQXK','tags','sourceSessionId','77046ggFYPg','134717dbIMyq','1448980aayZQs','\x20has\x20scope=\x22','object','match','3466JZElJV','displayName','7nnRoUN','replace','find','metadata','1585FTWLdu','11CAAtZQ','skillName','version','personal','number','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','slice','ignoreInvalidMetadata','startsWith','isArray','company','skillCode','Skill\x20metadata\x20appCode\x20\x22','ignoreMetadataScope','path','\x20name\x20for\x20SkillHub\x20slug\x20generation.','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','1205160IAQMTJ','isSymbolicLink','files','isFile','content','builtin','filter','appCode'];a161_0x43f2=function(){return _0x44698d;};return a161_0x43f2();}function slugifySkillName(_0x306cbf){const _0x369be1=a161_0x3a16,_0x3ae505=_0x306cbf['trim']()[_0x369be1(0x199)]()[_0x369be1(0x1b4)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0x369be1(0x1b4)](/-+$/,'')[_0x369be1(0x1b4)](/-{2,}/g,'-');if(!_0x3ae505)throw CliErrors[_0x369be1(0x197)](_0x369be1(0x1d4)+SKILL_FILE+_0x369be1(0x1c7));return _0x3ae505;}function parseFrontmatterObject(_0x44d8eb){const _0x2d5507=a161_0x3a16;try{const _0x24545f=a161_0x379468(_0x44d8eb);return _0x24545f&&typeof _0x24545f===_0x2d5507(0x1af)&&!Array[_0x2d5507(0x1c1)](_0x24545f)?_0x24545f:undefined;}catch{return undefined;}}function scalarToString(_0x110d37){const _0x26d6a4=a161_0x3a16;if(typeof _0x110d37==='string')return _0x110d37[_0x26d6a4(0x1a6)]();if(typeof _0x110d37===_0x26d6a4(0x1bc)||typeof _0x110d37==='boolean')return String(_0x110d37);return undefined;}function resolvePushDirectoryRoot(_0x2a1c83){const _0x1ce3ae=a161_0x3a16,_0x5797a4=resolve(_0x2a1c83);if(!existsSync(_0x5797a4))throw CliErrors[_0x1ce3ae(0x197)](_0x1ce3ae(0x1a5)+_0x2a1c83);const _0x22208d=lstatSync(_0x5797a4);if(_0x22208d['isDirectory']())return _0x5797a4;if(_0x22208d[_0x1ce3ae(0x1ca)]()){const _0x293088=realpathSync(_0x5797a4);if(lstatSync(_0x293088)[_0x1ce3ae(0x1d2)]())return _0x293088;}throw CliErrors['validation'](_0x1ce3ae(0x1a5)+_0x2a1c83);}function requireRemoteScope(_0x2e2fac){const _0x1d228d=a161_0x3a16;if(_0x2e2fac[_0x1d228d(0x19e)]==='personal'||_0x2e2fac[_0x1d228d(0x19e)]===_0x1d228d(0x1c2)||_0x2e2fac[_0x1d228d(0x19e)]==='builtin')return _0x2e2fac[_0x1d228d(0x19e)];throw CliErrors[_0x1d228d(0x197)]('Remote\x20Skill\x20'+(_0x2e2fac['skillCode']||_0x1d228d(0x19b))+_0x1d228d(0x1a2)+(_0x2e2fac[_0x1d228d(0x19e)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x463247){const _0x2b009f=a161_0x3a16,_0x616135=resolve(_0x463247,SKILL_FILE);return existsSync(_0x616135)&&lstatSync(_0x616135)['isFile']()?readFileSync(_0x616135,_0x2b009f(0x1a0)):'';}function readPushMetadataIfPresent(_0x248ae7,_0x1bc7d0={}){try{return readMetadataIfPresent(_0x248ae7);}catch(_0x25a14b){if(_0x1bc7d0['ignoreInvalidMetadata'])return undefined;throw _0x25a14b;}}
|
|
1
|
+
(function(_0x4673af,_0x3205d7){const _0x5a9ffd=a164_0x581e,_0x12573d=_0x4673af();while(!![]){try{const _0x2ee611=parseInt(_0x5a9ffd(0xcf))/0x1*(-parseInt(_0x5a9ffd(0x94))/0x2)+-parseInt(_0x5a9ffd(0xb6))/0x3+parseInt(_0x5a9ffd(0x96))/0x4*(parseInt(_0x5a9ffd(0xa3))/0x5)+parseInt(_0x5a9ffd(0xce))/0x6*(parseInt(_0x5a9ffd(0xad))/0x7)+parseInt(_0x5a9ffd(0xb9))/0x8*(-parseInt(_0x5a9ffd(0x90))/0x9)+parseInt(_0x5a9ffd(0xc3))/0xa+-parseInt(_0x5a9ffd(0xb0))/0xb*(parseInt(_0x5a9ffd(0xc9))/0xc);if(_0x2ee611===_0x3205d7)break;else _0x12573d['push'](_0x12573d['shift']());}catch(_0x457192){_0x12573d['push'](_0x12573d['shift']());}}}(a164_0x17c6,0x79e9f));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a164_0x3b39d5}from'yaml';import{CliErrors}from'../../errors.js';function a164_0x17c6(){const _0x527cc0=['(unknown)','toLowerCase','9gprbIs','object','sourceSessionId','tags','464lxEqFx','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','255052wtJory','ignoreMetadataScope','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','isSymbolicLink','ignoreMetadataForPayload','some','skillCode','excludedFilePaths','validation','string','Missing\x20','version','content','25fssRzP','ignoreMetadataAppCodeMismatch','isFile','trim','Remote\x20Skill\x20','dir','find','packageBase64','displayName','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','14xaNVip','utf8','skillName','2234441IMbYlF','refreshedAt','pushedAt','startsWith','length','slice','1259649NsbHKp','Skill\x20directory\x20not\x20found:\x20','builtin','6335072LdCqNh','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','Skill\x20metadata\x20appCode\x20\x22','match','ignoreInvalidMetadata','\x20has\x20scope=\x22','metadata','Invalid\x20','replace','scope','8413220MqEtcU','example','isArray','boolean','number','appCode','12KCzhJZ','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','path','isDirectory','targetScope','2323608zGtyfl','88WIfNpM','personal','description'];a164_0x17c6=function(){return _0x527cc0;};return a164_0x17c6();}import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a164_0x581e(_0x5d9ffb,_0x155f30){_0x5d9ffb=_0x5d9ffb-0x8f;const _0x17c6e6=a164_0x17c6();let _0x581eda=_0x17c6e6[_0x5d9ffb];return _0x581eda;}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';export function resolvePushDirectoryIdentity(_0x84a14e,_0x14b7f4,_0x2e718c={}){const _0x1fb210=a164_0x581e,_0x4a5b52=resolvePushDirectoryRoot(_0x84a14e),_0x47ff08=readPushMetadataIfPresent(resolve(_0x4a5b52,METADATA_FILE),{'ignoreInvalidMetadata':_0x2e718c[_0x1fb210(0xbd)]});if(_0x47ff08?.[_0x1fb210(0xc8)]&&_0x47ff08[_0x1fb210(0xc8)]!==_0x14b7f4&&!_0x2e718c['allowAppCodeRetarget']&&!_0x2e718c[_0x1fb210(0xa4)])throw CliErrors['validation'](_0x1fb210(0xbb)+_0x47ff08[_0x1fb210(0xc8)]+_0x1fb210(0xca)+_0x14b7f4+'\x22.');const _0xaf1269=resolvePushSkillCode(_0x4a5b52,_0x14b7f4,_0x47ff08,_0x2e718c);if(!_0xaf1269)throw CliErrors['validation']('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0x4a5b52,'skillCode':_0xaf1269,'metadata':_0x47ff08};}export function readPushDirectory(_0x2c02a4,_0x50bd71,_0x4a2f9b={}){const _0x1df922=a164_0x581e,_0x2b2ce4=resolvePushDirectoryIdentity(_0x2c02a4,_0x50bd71,_0x4a2f9b),_0x27236b=_0x2b2ce4[_0x1df922(0xa8)],_0x329cd3=resolve(_0x27236b,SKILL_FILE);if(!existsSync(_0x329cd3)||!lstatSync(_0x329cd3)[_0x1df922(0xa5)]())throw CliErrors[_0x1df922(0x9e)](_0x1df922(0xa0)+SKILL_FILE+':\x20'+_0x329cd3);const _0x598cd9=_0x2b2ce4[_0x1df922(0xbf)],_0x47e84d=_0x4a2f9b[_0x1df922(0xcd)]??_0x1df922(0xd0);if(!_0x4a2f9b[_0x1df922(0x97)]&&_0x598cd9?.[_0x1df922(0xc2)]===_0x1df922(0xb8))throw CliErrors[_0x1df922(0x9e)](_0x1df922(0xba)+METADATA_FILE+_0x1df922(0xbe)+_0x598cd9[_0x1df922(0xc2)]+'\x22.');if(!_0x4a2f9b[_0x1df922(0x97)]&&_0x47e84d===_0x1df922(0xd0)&&_0x598cd9?.[_0x1df922(0xc2)]&&_0x598cd9[_0x1df922(0xc2)]!==_0x1df922(0xd0))throw CliErrors[_0x1df922(0x9e)](_0x1df922(0x95)+METADATA_FILE+_0x1df922(0xbe)+_0x598cd9['scope']+'\x22.',_0x1df922(0xac)+_0x27236b+_0x1df922(0x98));const _0x4f9766=scanSkillDirectory(_0x27236b,{'excludedFilePaths':_0x4a2f9b[_0x1df922(0x9d)]}),_0x4fa528=buildSkillPackage(_0x4f9766),_0x262a96=readFileSync(_0x329cd3,_0x1df922(0xae)),_0x44cdc9=_0x2b2ce4[_0x1df922(0x9c)],_0x2a4cd9=_0x4a2f9b[_0x1df922(0x9a)]?undefined:_0x598cd9,_0x463097=readSkillDisplayName(_0x262a96);return{'skillCode':_0x44cdc9,'metadata':_0x598cd9,'frontmatterDisplayName':_0x463097,'input':{'skillCode':_0x44cdc9,'skillName':_0x463097??_0x2a4cd9?.[_0x1df922(0xaf)],'description':_0x2a4cd9?.[_0x1df922(0xd1)],'content':_0x262a96,'files':_0x4fa528['manifest'],'packageBase64':_0x4fa528[_0x1df922(0xaa)],'tags':_0x2a4cd9?.[_0x1df922(0x93)],'version':_0x2a4cd9?.[_0x1df922(0xa1)],'sourceSessionId':_0x2a4cd9?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x5dc448,_0x217384,_0x1f8cc0,_0x79432a={}){const _0x20b97b=a164_0x581e,_0x50bc54=resolvePushDirectoryRoot(_0x5dc448),_0x6bb963=readPushMetadataIfPresent(resolve(_0x50bc54,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x572ad4=requireRemoteScope(_0x217384),_0x2568ce=readLocalSkillContent(_0x50bc54),_0x5986d2={..._0x217384,'appCode':_0x217384[_0x20b97b(0xc8)]??_0x1f8cc0,'skillName':_0x217384[_0x20b97b(0xaf)]??_0x6bb963?.[_0x20b97b(0xaf)],'description':_0x217384['description']??_0x6bb963?.[_0x20b97b(0xd1)],'example':_0x217384[_0x20b97b(0xc4)]??_0x6bb963?.[_0x20b97b(0xc4)],'tags':Array[_0x20b97b(0xc5)](_0x217384['tags'])?_0x217384['tags']:_0x6bb963?.[_0x20b97b(0x93)],'sourceSessionId':_0x217384['sourceSessionId']??_0x6bb963?.[_0x20b97b(0x92)],'content':_0x217384[_0x20b97b(0xa2)]??_0x2568ce},_0x10ed5c=buildMetadata(_0x5986d2,_0x572ad4,_0x1f8cc0,contentHash(_0x2568ce),_0x79432a[_0x20b97b(0xb1)]);writeJsonAtomic(resolve(_0x50bc54,METADATA_FILE),_0x10ed5c);}export function recordPushedRuntimeSkill(_0x3eef1f,_0x317750,_0x4b24c5,_0x5674e4={}){const _0x5b378b=a164_0x581e,_0x57590e=resolvePushDirectoryRoot(_0x3eef1f),_0xbff53=scanSkillDirectory(_0x57590e),_0x1f2873=_0xbff53[_0x5b378b(0xa9)](_0x39d174=>_0x39d174[_0x5b378b(0xcb)]===SKILL_FILE),_0x3b6b62=_0x1f2873?fileText(_0x1f2873):'',_0x17b4d8=tryNormalizePackageManifest(_0x317750['files']),_0x22dbc8={..._0x317750,'content':_0x317750[_0x5b378b(0xa2)]??_0x3b6b62,'files':_0x17b4d8},_0x9347ee=_0x17b4d8?normalizeLocalFiles(_0xbff53)['filter'](_0x17a86b=>_0x17b4d8['files'][_0x5b378b(0x9b)](_0x136c45=>_0x136c45['path']===_0x17a86b['path'])):undefined,_0x2f9bc6=buildMetadata(_0x22dbc8,_0x5674e4[_0x5b378b(0xc2)]??_0x5b378b(0xd0),_0x4b24c5,contentHash(_0x22dbc8['content']??''),_0x5674e4[_0x5b378b(0xb2)],_0x9347ee);writeJsonAtomic(resolve(_0x57590e,METADATA_FILE),_0x2f9bc6);}export function deriveSkillCodeFromDirectory(_0x142ed1,_0xaecc6a){const _0x21b26b=a164_0x581e,_0x58ecdc=basename(resolve(_0x142ed1)),_0x2c2c4d=_0xaecc6a+'--';return _0x58ecdc[_0x21b26b(0xb3)](_0x2c2c4d)?_0x58ecdc[_0x21b26b(0xb5)](_0x2c2c4d[_0x21b26b(0xb4)]):_0x58ecdc;}function resolvePushSkillCode(_0x576d2a,_0x3b6df9,_0x10bb37,_0x8df2b9){const _0x1928e1=a164_0x581e,_0x57416f=deriveSkillCodeFromSkillFile(_0x576d2a)||deriveSkillCodeFromDirectory(_0x576d2a,_0x3b6df9);if(_0x8df2b9['ignoreMetadataSkillCode'])return _0x57416f;return _0x10bb37?.[_0x1928e1(0x9c)]?.[_0x1928e1(0xa6)]()||_0x57416f;}function deriveSkillCodeFromSkillFile(_0x59a189){const _0x353e96=a164_0x581e,_0x45d4f5=resolve(_0x59a189,SKILL_FILE);if(!existsSync(_0x45d4f5)||!lstatSync(_0x45d4f5)[_0x353e96(0xa5)]())return undefined;const _0x1d6a50=readFileSync(_0x45d4f5,_0x353e96(0xae)),_0x8bcd31=_0x1d6a50[_0x353e96(0xbc)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x8bcd31)return undefined;const _0x555162=parseFrontmatterObject(_0x8bcd31[0x1]??''),_0x172b21=scalarToString(_0x555162?.['name']);return _0x172b21?slugifySkillName(_0x172b21):undefined;}function readSkillDisplayName(_0x238557){const _0x48bd9e=a164_0x581e,_0x2b4b6b=_0x238557[_0x48bd9e(0xbc)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2b4b6b)return undefined;const _0x57230c=parseFrontmatterObject(_0x2b4b6b[0x1]??'');return scalarToString(_0x57230c?.[_0x48bd9e(0xab)]);}function slugifySkillName(_0x569cd3){const _0x1f289f=a164_0x581e,_0x5e9f4b=_0x569cd3[_0x1f289f(0xa6)]()[_0x1f289f(0x8f)]()[_0x1f289f(0xc1)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x1f289f(0xc1)](/^-+/,'')[_0x1f289f(0xc1)](/-+$/,'')[_0x1f289f(0xc1)](/-{2,}/g,'-');if(!_0x5e9f4b)throw CliErrors['validation'](_0x1f289f(0xc0)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x5e9f4b;}function parseFrontmatterObject(_0x4f90b3){const _0x19532a=a164_0x581e;try{const _0x269d3c=a164_0x3b39d5(_0x4f90b3);return _0x269d3c&&typeof _0x269d3c===_0x19532a(0x91)&&!Array[_0x19532a(0xc5)](_0x269d3c)?_0x269d3c:undefined;}catch{return undefined;}}function scalarToString(_0x4dee68){const _0x585776=a164_0x581e;if(typeof _0x4dee68===_0x585776(0x9f))return _0x4dee68[_0x585776(0xa6)]();if(typeof _0x4dee68===_0x585776(0xc7)||typeof _0x4dee68===_0x585776(0xc6))return String(_0x4dee68);return undefined;}function resolvePushDirectoryRoot(_0x1ab38f){const _0x17183a=a164_0x581e,_0x3803ba=resolve(_0x1ab38f);if(!existsSync(_0x3803ba))throw CliErrors['validation'](_0x17183a(0xb7)+_0x1ab38f);const _0x14884f=lstatSync(_0x3803ba);if(_0x14884f[_0x17183a(0xcc)]())return _0x3803ba;if(_0x14884f[_0x17183a(0x99)]()){const _0x1e30b9=realpathSync(_0x3803ba);if(lstatSync(_0x1e30b9)[_0x17183a(0xcc)]())return _0x1e30b9;}throw CliErrors[_0x17183a(0x9e)](_0x17183a(0xb7)+_0x1ab38f);}function requireRemoteScope(_0x5a0125){const _0x3e967b=a164_0x581e;if(_0x5a0125[_0x3e967b(0xc2)]==='personal'||_0x5a0125[_0x3e967b(0xc2)]==='company'||_0x5a0125['scope']===_0x3e967b(0xb8))return _0x5a0125[_0x3e967b(0xc2)];throw CliErrors[_0x3e967b(0x9e)](_0x3e967b(0xa7)+(_0x5a0125[_0x3e967b(0x9c)]||_0x3e967b(0xd2))+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x5a0125[_0x3e967b(0xc2)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x5f099c){const _0xdf973a=a164_0x581e,_0x3ea18e=resolve(_0x5f099c,SKILL_FILE);return existsSync(_0x3ea18e)&&lstatSync(_0x3ea18e)['isFile']()?readFileSync(_0x3ea18e,_0xdf973a(0xae)):'';}function readPushMetadataIfPresent(_0x30bc59,_0x466a10={}){const _0x41cd9d=a164_0x581e;try{return readMetadataIfPresent(_0x30bc59);}catch(_0x557be7){if(_0x466a10[_0x41cd9d(0xbd)])return undefined;throw _0x557be7;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2ddc16,_0x56657c){const _0xad8f40=a165_0x54b6,_0x2aecdd=_0x2ddc16();while(!![]){try{const _0x457025=-parseInt(_0xad8f40(0x13c))/0x1*(-parseInt(_0xad8f40(0x13a))/0x2)+parseInt(_0xad8f40(0x140))/0x3+-parseInt(_0xad8f40(0x139))/0x4+-parseInt(_0xad8f40(0x13f))/0x5*(parseInt(_0xad8f40(0x13d))/0x6)+-parseInt(_0xad8f40(0x141))/0x7+-parseInt(_0xad8f40(0x142))/0x8*(-parseInt(_0xad8f40(0x136))/0x9)+parseInt(_0xad8f40(0x13b))/0xa*(parseInt(_0xad8f40(0x134))/0xb);if(_0x457025===_0x56657c)break;else _0x2aecdd['push'](_0x2aecdd['shift']());}catch(_0x54e3f8){_0x2aecdd['push'](_0x2aecdd['shift']());}}}(a165_0x53f3,0x42874));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x5023a8){const _0x57a870=a165_0x54b6,_0x11819a=_0x5023a8&&_0x5023a8['length']>0x0?_0x5023a8:[_0x57a870(0x143),_0x57a870(0x135),'builtin'],_0x2a448d=[];for(const _0x248741 of _0x11819a){if(!isRuntimeSkillScope(_0x248741))throw CliErrors[_0x57a870(0x138)](_0x57a870(0x137)+_0x248741);!_0x2a448d[_0x57a870(0x133)](_0x248741)&&_0x2a448d[_0x57a870(0x13e)](_0x248741);}return _0x2a448d;}function a165_0x53f3(){const _0x56cb39=['validation','352452LAqEwx','12tTwUPi','1830DEUGzI','7679wOnBkh','138CKhYLQ','push','33305ZjbKAd','1011531RooybI','2732856aZrHhu','3135664OhLFAz','personal','builtin','includes','7755ggMhhl','company','9gWJRYE','Unsupported\x20runtime\x20Skill\x20scope:\x20'];a165_0x53f3=function(){return _0x56cb39;};return a165_0x53f3();}function a165_0x54b6(_0x106b7f,_0x428fc3){_0x106b7f=_0x106b7f-0x132;const _0x53f385=a165_0x53f3();let _0x54b611=_0x53f385[_0x106b7f];return _0x54b611;}export function isRuntimeSkillScope(_0x3791f3){const _0x2d4bb0=a165_0x54b6;return _0x3791f3===_0x2d4bb0(0x143)||_0x3791f3==='company'||_0x3791f3===_0x2d4bb0(0x132);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a167_0x1bb3b2=a167_0x287a;function a167_0x287a(_0x706f10,_0x294902){_0x706f10=_0x706f10-0xe4;const _0x5d912e=a167_0x5d91();let _0x287a4d=_0x5d912e[_0x706f10];return _0x287a4d;}(function(_0x5021f4,_0x3aa117){const _0x2fe481=a167_0x287a,_0x2d115c=_0x5021f4();while(!![]){try{const _0x57f9c5=parseInt(_0x2fe481(0xf0))/0x1+parseInt(_0x2fe481(0xf2))/0x2*(-parseInt(_0x2fe481(0xfd))/0x3)+parseInt(_0x2fe481(0xe7))/0x4*(parseInt(_0x2fe481(0xf8))/0x5)+-parseInt(_0x2fe481(0xee))/0x6*(-parseInt(_0x2fe481(0xec))/0x7)+parseInt(_0x2fe481(0xf5))/0x8*(-parseInt(_0x2fe481(0xfa))/0x9)+-parseInt(_0x2fe481(0xe5))/0xa*(-parseInt(_0x2fe481(0xf1))/0xb)+parseInt(_0x2fe481(0xf3))/0xc*(-parseInt(_0x2fe481(0xf4))/0xd);if(_0x57f9c5===_0x3aa117)break;else _0x2d115c['push'](_0x2d115c['shift']());}catch(_0x26a7f3){_0x2d115c['push'](_0x2d115c['shift']());}}}(a167_0x5d91,0xb6b6a));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';function a167_0x5d91(){const _0x40bf9f=['993iBYYQx','sort','305770pFaxqU','length','4llxvqb','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','validation','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','map','91994oMjLJV','entries','498dAKWYc','from','1060225nOuQMj','121MHTvLs','1682eatFJZ','24pXdmkH','11788491fcmYJu','89384wOeMQj','code','object','3999705OBymYO','1980-01-01T00:00:00.000Z','360CdJnYI','endsWith','name'];a167_0x5d91=function(){return _0x40bf9f;};return a167_0x5d91();}import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a167_0x1bb3b2(0xf9));export function createDeterministicZipPackage(_0x2338b1){const _0x3dccf6=a167_0x1bb3b2,_0xe42379={};for(const _0x36127a of normalizeLocalFiles(_0x2338b1)){_0xe42379[_0x36127a['path']]=fileContent(_0x36127a);}return Buffer[_0x3dccf6(0xef)](zipSync(_0xe42379,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x651421){const _0x4e2e87=a167_0x1bb3b2;if(_0x651421[_0x4e2e87(0xe6)]<0x16)throw CliErrors[_0x4e2e87(0xe9)](_0x4e2e87(0xea));let _0x43f0fb;try{_0x43f0fb=unzipSync(_0x651421,{'filter'(_0x1a8301){const _0x45eeae=_0x4e2e87,_0x21a9c9=normalizeSkillRelativePath(_0x1a8301[_0x45eeae(0xfc)]);if(_0x21a9c9[_0x45eeae(0xfb)]('/'))throw CliErrors[_0x45eeae(0xe9)](_0x45eeae(0xe8)+_0x21a9c9);return!![];}});}catch(_0x1cd0e1){if(isRuntimeSkillValidationError(_0x1cd0e1))throw _0x1cd0e1;throw CliErrors['validation'](_0x4e2e87(0xea));}return Object[_0x4e2e87(0xed)](_0x43f0fb)[_0x4e2e87(0xeb)](([_0x34975f,_0x476517])=>({'path':normalizeSkillRelativePath(_0x34975f),'bytes':Buffer['from'](_0x476517)}))[_0x4e2e87(0xe4)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x1efad0){const _0x5b8cf1=a167_0x1bb3b2;return typeof _0x1efad0===_0x5b8cf1(0xf7)&&_0x1efad0!==null&&_0x5b8cf1(0xf6)in _0x1efad0&&_0x1efad0[_0x5b8cf1(0xf6)]==='validation_error';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e5ada,_0x222036){const _0x2c8b06=a168_0x2cee,_0x1af657=_0x4e5ada();while(!![]){try{const _0x38caad=parseInt(_0x2c8b06(0x148))/0x1+-parseInt(_0x2c8b06(0x14c))/0x2*(parseInt(_0x2c8b06(0x157))/0x3)+parseInt(_0x2c8b06(0x152))/0x4+parseInt(_0x2c8b06(0x15d))/0x5+-parseInt(_0x2c8b06(0x153))/0x6*(-parseInt(_0x2c8b06(0x139))/0x7)+parseInt(_0x2c8b06(0x13a))/0x8*(parseInt(_0x2c8b06(0x140))/0x9)+-parseInt(_0x2c8b06(0x154))/0xa*(parseInt(_0x2c8b06(0x14e))/0xb);if(_0x38caad===_0x222036)break;else _0x1af657['push'](_0x1af657['shift']());}catch(_0x5e125b){_0x1af657['push'](_0x1af657['shift']());}}}(a168_0x4631,0x77223));function a168_0x2cee(_0x517ea5,_0x49c676){_0x517ea5=_0x517ea5-0x12c;const _0x46318e=a168_0x4631();let _0x2ceed5=_0x46318e[_0x517ea5];return _0x2ceed5;}import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';function a168_0x4631(){const _0x2a0886=['some','Runtime\x20Skill\x20package\x20size\x20mismatch.','isArray','has','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','211127UNbCgK','344Bvnaaz','zipSha256','schemaVersion','object','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','size','120537AFroCT','push','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','isSafeInteger','get','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','Missing\x20','450601bQommh','\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20package\x20is\x20missing\x20','string','1658274KPBSLy','validation','209mQAmJG','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','length','758248YrCaBA','12mhJbYE','157870LSKvsm','trim','zipSize','3dsbmPY','requireOssPath','toString','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','Duplicate\x20Skill\x20package\x20entry:\x20','1703385elJCUm','map','files','path','toLowerCase','bytes','treeSha256','base64','ossPath'];a168_0x4631=function(){return _0x2a0886;};return a168_0x4631();}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(_0x53f316){const _0x1c1907=a168_0x2cee,_0x2b2906=normalizeLocalFiles(_0x53f316);if(!_0x2b2906[_0x1c1907(0x134)](_0x5e7db7=>_0x5e7db7[_0x1c1907(0x12e)]===SKILL_FILE))throw CliErrors['validation'](_0x1c1907(0x147)+SKILL_FILE+_0x1c1907(0x149));const _0x3770a1=localFilesToManifestFiles(_0x2b2906),_0x30c235=createDeterministicZipPackage(_0x2b2906);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x3770a1),'zipSha256':bufferSha256(_0x30c235),'zipSize':_0x30c235[_0x1c1907(0x151)],'files':_0x3770a1},'packageBytes':_0x30c235,'packageBase64':_0x30c235[_0x1c1907(0x159)](_0x1c1907(0x132))};}export function verifyRuntimeSkillPackage(_0x1a41c7,_0x4d719d){const _0x1b15eb=a168_0x2cee,_0x4ba21a=normalizePackageManifest(_0x1a41c7,{'requireOssPath':![]});if(!_0x4ba21a)throw CliErrors[_0x1b15eb(0x14d)](_0x1b15eb(0x142));return extractAndVerifyPackage(_0x4ba21a,_0x4d719d);}export function verifyRuntimeSkillBundle(_0x4c8290,_0x199003){const _0x2a463e=a168_0x2cee,_0x2745ec=normalizePackageManifest(_0x4c8290,{'requireOssPath':![]});if(!_0x2745ec)throw CliErrors['validation'](_0x2a463e(0x142));return extractAndVerifyPackageFiles(_0x2745ec,_0x199003);}export function tryNormalizePackageManifest(_0x592478){return normalizePackageManifest(_0x592478,{'requireOssPath':![]});}export function requirePackageBytes(_0x35779e,_0x12fa43){const _0x2e80e6=a168_0x2cee;if(!_0x12fa43||_0x12fa43[_0x2e80e6(0x151)]===0x0)throw CliErrors[_0x2e80e6(0x14d)](_0x2e80e6(0x13e)+_0x35779e);return _0x12fa43;}export function extractDownloadedPackage(_0x5d3824){const _0x49f536=a168_0x2cee,_0x15dbc7=parseZipPackage(_0x5d3824)[_0x49f536(0x12c)](_0x5ad886=>({'path':_0x5ad886[_0x49f536(0x12e)],'bytes':_0x5ad886[_0x49f536(0x130)]}));if(!_0x15dbc7[_0x49f536(0x134)](_0x188c00=>_0x188c00[_0x49f536(0x12e)]===SKILL_FILE))throw CliErrors[_0x49f536(0x14d)](_0x49f536(0x14a)+SKILL_FILE+'.');return normalizeLocalFiles(_0x15dbc7);}export function localFilesToManifestFiles(_0x1477d7){const _0x1182c2=a168_0x2cee;return normalizeLocalFiles(_0x1477d7)[_0x1182c2(0x12c)](_0x50b772=>({'path':_0x50b772[_0x1182c2(0x12e)],'sha256':fileHash(_0x50b772),'size':fileContent(_0x50b772)[_0x1182c2(0x151)]}));}function normalizePackageManifest(_0x675ba9,_0x480d97){const _0x5d4b50=a168_0x2cee;if(!_0x675ba9||typeof _0x675ba9!==_0x5d4b50(0x13d)||Array['isArray'](_0x675ba9))return undefined;const _0x3340ea=_0x675ba9,_0x25c45c=typeof _0x3340ea['ossPath']===_0x5d4b50(0x14b)?_0x3340ea[_0x5d4b50(0x133)][_0x5d4b50(0x155)]():undefined;if(_0x480d97[_0x5d4b50(0x158)]&&!_0x25c45c)return undefined;if(!Array[_0x5d4b50(0x136)](_0x3340ea['files'])||_0x3340ea[_0x5d4b50(0x12d)]['length']===0x0)return undefined;if(!isSha256Hex(_0x3340ea[_0x5d4b50(0x131)]))throw CliErrors[_0x5d4b50(0x14d)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.');if(!isSha256Hex(_0x3340ea[_0x5d4b50(0x13b)]))throw CliErrors[_0x5d4b50(0x14d)](_0x5d4b50(0x146));if(!Number['isSafeInteger'](_0x3340ea['zipSize'])||_0x3340ea[_0x5d4b50(0x156)]<0x0)throw CliErrors[_0x5d4b50(0x14d)](_0x5d4b50(0x15b));const _0x1f1980=normalizeManifestFiles(_0x3340ea[_0x5d4b50(0x12d)]);if(!_0x1f1980[_0x5d4b50(0x134)](_0x55f938=>_0x55f938[_0x5d4b50(0x12e)]===SKILL_FILE))throw CliErrors[_0x5d4b50(0x14d)](_0x5d4b50(0x15a)+SKILL_FILE+'.');const _0x3baad4=fileTreeHash(_0x1f1980);if(_0x3baad4!==_0x3340ea[_0x5d4b50(0x131)][_0x5d4b50(0x12f)]())throw CliErrors[_0x5d4b50(0x14d)](_0x5d4b50(0x150));return{'schemaVersion':Number[_0x5d4b50(0x144)](_0x3340ea['schemaVersion'])?_0x3340ea[_0x5d4b50(0x13c)]:0x2,'ossPath':_0x25c45c,'treeSha256':_0x3baad4,'zipSha256':_0x3340ea['zipSha256'][_0x5d4b50(0x12f)](),'zipSize':_0x3340ea[_0x5d4b50(0x156)],'files':_0x1f1980};}function extractAndVerifyPackage(_0x374a5c,_0x2c15f0){const _0x58eeea=a168_0x2cee,_0x430c58=normalizePackageManifest(_0x374a5c,{'requireOssPath':![]});if(!_0x430c58)throw CliErrors[_0x58eeea(0x14d)](_0x58eeea(0x142));if(_0x2c15f0[_0x58eeea(0x151)]!==_0x430c58[_0x58eeea(0x156)])throw CliErrors['validation'](_0x58eeea(0x135));const _0x1f74a8=bufferSha256(_0x2c15f0);if(_0x1f74a8!==_0x430c58[_0x58eeea(0x13b)])throw CliErrors[_0x58eeea(0x14d)](_0x58eeea(0x14f));return extractAndVerifyPackageFiles(_0x430c58,_0x2c15f0);}function extractAndVerifyPackageFiles(_0x1bd43c,_0x39764d){const _0x856916=a168_0x2cee,_0x4e27a6=parseZipPackage(_0x39764d);if(_0x4e27a6[_0x856916(0x151)]!==_0x1bd43c['files'][_0x856916(0x151)])throw CliErrors[_0x856916(0x14d)]('Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.');const _0x4f9d4b=new Map();for(const _0x17140e of _0x4e27a6){if(_0x4f9d4b[_0x856916(0x137)](_0x17140e[_0x856916(0x12e)]))throw CliErrors[_0x856916(0x14d)](_0x856916(0x15c)+_0x17140e[_0x856916(0x12e)]);_0x4f9d4b['set'](_0x17140e[_0x856916(0x12e)],_0x17140e);}const _0x35728a=[];for(const _0x92c130 of _0x1bd43c[_0x856916(0x12d)]){const _0xf4aee3=_0x4f9d4b[_0x856916(0x145)](_0x92c130[_0x856916(0x12e)]);if(!_0xf4aee3)throw CliErrors['validation'](_0x856916(0x143)+_0x92c130[_0x856916(0x12e)]);if(_0xf4aee3['bytes'][_0x856916(0x151)]!==_0x92c130[_0x856916(0x13f)])throw CliErrors[_0x856916(0x14d)](_0x856916(0x138)+_0x92c130['path']);const _0x5944f9=bufferSha256(_0xf4aee3[_0x856916(0x130)]);if(_0x5944f9!==_0x92c130['sha256'])throw CliErrors[_0x856916(0x14d)]('Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20'+_0x92c130['path']);_0x35728a[_0x856916(0x141)]({'path':_0x92c130['path'],'bytes':_0xf4aee3[_0x856916(0x130)]});}return normalizeLocalFiles(_0x35728a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x36d50c,_0x58943c){var _0x2a8416=a169_0x3dd6,_0x47632e=_0x36d50c();while(!![]){try{var _0x1a7ab7=parseInt(_0x2a8416(0x6c))/0x1*(parseInt(_0x2a8416(0x6e))/0x2)+parseInt(_0x2a8416(0x74))/0x3*(-parseInt(_0x2a8416(0x6d))/0x4)+-parseInt(_0x2a8416(0x75))/0x5+parseInt(_0x2a8416(0x76))/0x6*(parseInt(_0x2a8416(0x72))/0x7)+-parseInt(_0x2a8416(0x73))/0x8*(-parseInt(_0x2a8416(0x77))/0x9)+-parseInt(_0x2a8416(0x70))/0xa*(parseInt(_0x2a8416(0x6f))/0xb)+-parseInt(_0x2a8416(0x71))/0xc*(-parseInt(_0x2a8416(0x78))/0xd);if(_0x1a7ab7===_0x58943c)break;else _0x47632e['push'](_0x47632e['shift']());}catch(_0x167d67){_0x47632e['push'](_0x47632e['shift']());}}}(a169_0x10f3,0x8fda8));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';function a169_0x3dd6(_0x57c66d,_0x39a687){_0x57c66d=_0x57c66d-0x6c;var _0x10f386=a169_0x10f3();var _0x3dd69a=_0x10f386[_0x57c66d];return _0x3dd69a;}function a169_0x10f3(){var _0x4a5208=['6268197xMGNUw','12pTSqKp','4302224gntCNc','40444uHhORr','5562238hcbfhe','20tSYZCB','24yowNmh','266jaErpf','6868792tkrHvx','3hbFUjs','2521935IFQVbP','176034XFlhpr','9vPEgJG'];a169_0x10f3=function(){return _0x4a5208;};return a169_0x10f3();}export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}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
|
-
const
|
|
1
|
+
const a170_0x24a265=a170_0x1c5c;function a170_0x2f42(){const _0x8e5f5a=['\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','SKILL.md','version','114172SfEJQM','utf8','number','3593520MoUovc','\x20uses\x20unsupported\x20version\x20','.skill-lock.json','4yCdfEa','unverifiable','reason','\x20has\x20no\x20skills\x20map','15504BauGkc','object','10pHrUwF','message','2338960uQvhRc','absent','lockFile','21502932pQPkdr','present','.agents','.claude','727341qPAflX','2673wkKxIg','recorded','map','4596438nkcRyD','parse','not-recorded','home','includes','2DFqdMN','skills','unusable','kind','globalSkillsDirs'];a170_0x2f42=function(){return _0x8e5f5a;};return a170_0x2f42();}(function(_0x30642b,_0x15cab9){const _0xdd0cb8=a170_0x1c5c,_0x9bfabe=_0x30642b();while(!![]){try{const _0x5a9d12=parseInt(_0xdd0cb8(0x1b8))/0x1*(parseInt(_0xdd0cb8(0x1b0))/0x2)+parseInt(_0xdd0cb8(0x1cd))/0x3*(-parseInt(_0xdd0cb8(0x1be))/0x4)+-parseInt(_0xdd0cb8(0x1c6))/0x5+-parseInt(_0xdd0cb8(0x1ab))/0x6+parseInt(_0xdd0cb8(0x1bb))/0x7+parseInt(_0xdd0cb8(0x1c2))/0x8*(-parseInt(_0xdd0cb8(0x1ce))/0x9)+parseInt(_0xdd0cb8(0x1c4))/0xa*(parseInt(_0xdd0cb8(0x1c9))/0xb);if(_0x5a9d12===_0x15cab9)break;else _0x9bfabe['push'](_0x9bfabe['shift']());}catch(_0x377158){_0x9bfabe['push'](_0x9bfabe['shift']());}}}(a170_0x2f42,0x8180e));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a170_0x24a265(0x1cb),a170_0x24a265(0x1bd));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a170_0x24a265(0x1cb),a170_0x24a265(0x1b1)),join(a170_0x24a265(0x1cc),'skills')];const SUPPORTED_LOCK_VERSIONS=[0x3];function a170_0x1c5c(_0x56383a,_0xc36d7){_0x56383a=_0x56383a-0x1ab;const _0x2f421e=a170_0x2f42();let _0x1c5c4a=_0x2f421e[_0x56383a];return _0x1c5c4a;}function readLockLookup(_0xafb55a,_0x41f069){const _0x278d22=a170_0x24a265;if(!existsSync(_0xafb55a))return{'kind':_0x278d22(0x1ad)};let _0x264b5a;try{_0x264b5a=JSON[_0x278d22(0x1ac)](readFileSync(_0xafb55a,_0x278d22(0x1b9)));}catch(_0x461451){return{'kind':_0x278d22(0x1b2),'reason':_0xafb55a+'\x20is\x20unreadable:\x20'+_0x461451[_0x278d22(0x1c5)]};}const _0x5792cb=_0x264b5a;if(typeof _0x5792cb?.[_0x278d22(0x1b7)]!==_0x278d22(0x1ba)||!SUPPORTED_LOCK_VERSIONS[_0x278d22(0x1af)](_0x5792cb['version']))return{'kind':_0x278d22(0x1b2),'reason':_0xafb55a+_0x278d22(0x1bc)+String(_0x5792cb?.[_0x278d22(0x1b7)])};if(!_0x5792cb['skills']||typeof _0x5792cb[_0x278d22(0x1b1)]!==_0x278d22(0x1c3))return{'kind':_0x278d22(0x1b2),'reason':_0xafb55a+_0x278d22(0x1c1)};return _0x5792cb[_0x278d22(0x1b1)][_0x41f069]?{'kind':_0x278d22(0x1cf)}:{'kind':'not-recorded'};}export function resolveInstalledSkill(_0x2470e3,_0x194e26){const _0x24727d=a170_0x24a265,_0x4e7cbb=_0x194e26?.[_0x24727d(0x1ae)]??homedir(),_0x1476f9=_0x194e26?.[_0x24727d(0x1b4)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x24727d(0x1d0)](_0x3be30b=>join(_0x4e7cbb,_0x3be30b)),_0x9352e8=_0x194e26?.[_0x24727d(0x1c8)]??join(_0x4e7cbb,SKILL_LOCK_RELATIVE_PATH),_0x4c4143=_0x1476f9[_0x24727d(0x1d0)](_0x58a4cd=>join(_0x58a4cd,_0x2470e3,_0x24727d(0x1b6))),_0x2e2def=_0x4c4143['find'](_0x642194=>existsSync(_0x642194));if(_0x2e2def)return{'state':_0x24727d(0x1ca),'path':_0x2e2def};const _0x593eeb=readLockLookup(_0x9352e8,_0x2470e3);if(_0x593eeb[_0x24727d(0x1b3)]===_0x24727d(0x1b2))return{'state':'unverifiable','reason':_0x593eeb[_0x24727d(0x1c0)]};if(_0x593eeb[_0x24727d(0x1b3)]==='recorded')return{'state':_0x24727d(0x1bf),'reason':_0x9352e8+'\x20records\x20\x22'+_0x2470e3+_0x24727d(0x1b5)+('('+_0x4c4143['join'](',\x20')+')')};return{'state':_0x24727d(0x1c7),'checked':_0x4c4143};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a171_0x5de9c4=a171_0x572a;function a171_0x572a(_0x576d2e,_0x39fd99){_0x576d2e=_0x576d2e-0xfe;const _0x1734c1=a171_0x1734();let _0x572a64=_0x1734c1[_0x576d2e];return _0x572a64;}(function(_0x326e6c,_0x32a1c9){const _0x4462f5=a171_0x572a,_0x35ccfe=_0x326e6c();while(!![]){try{const _0xff6142=-parseInt(_0x4462f5(0x112))/0x1*(-parseInt(_0x4462f5(0x105))/0x2)+parseInt(_0x4462f5(0xff))/0x3+parseInt(_0x4462f5(0x10d))/0x4+-parseInt(_0x4462f5(0x114))/0x5+parseInt(_0x4462f5(0x110))/0x6*(-parseInt(_0x4462f5(0x106))/0x7)+-parseInt(_0x4462f5(0x113))/0x8+-parseInt(_0x4462f5(0x100))/0x9*(parseInt(_0x4462f5(0x116))/0xa);if(_0xff6142===_0x32a1c9)break;else _0x35ccfe['push'](_0x35ccfe['shift']());}catch(_0x22cafa){_0x35ccfe['push'](_0x35ccfe['shift']());}}}(a171_0x1734,0xe937d));function a171_0x1734(){const _0x1d23be=['1179800uJGwBF','fromEntries','616650Pmnxwl','apps','isArray','4598178vVVwiK','279XPSEaO','length','entries','hasOwnProperty','test','465642sLOsHI','4151cQlRUw','prototype','string','accessKey','slice','<redacted>','object','5457452pCgsPg','repeat','call','4962xppnyG','map','7seSzmy','7468712aRtuCZ'];a171_0x1734=function(){return _0x1d23be;};return a171_0x1734();}const REDACTED_ACCESS_KEY=a171_0x5de9c4(0x10b);export function maskCliAccessKey(_0x26cfff){const _0x4d2b48=a171_0x5de9c4;if(typeof _0x26cfff!==_0x4d2b48(0x108)||_0x26cfff[_0x4d2b48(0x101)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x26cfff[_0x4d2b48(0x10a)](0x0,0x8)+'*'[_0x4d2b48(0x10e)](_0x26cfff['length']-0x8);}export function redactCliConfigCredentials(_0x545eaf){const _0x694441=a171_0x5de9c4,_0x45a5f4={..._0x545eaf};return Object[_0x694441(0x107)][_0x694441(0x103)][_0x694441(0x10f)](_0x45a5f4,_0x694441(0x109))&&(_0x45a5f4[_0x694441(0x109)]=maskCliAccessKey(_0x45a5f4[_0x694441(0x109)])),_0x45a5f4[_0x694441(0x117)]&&typeof _0x45a5f4[_0x694441(0x117)]==='object'&&!Array['isArray'](_0x45a5f4['apps'])&&(_0x45a5f4[_0x694441(0x117)]=redactLegacyAppCredentials(_0x45a5f4['apps'])),_0x45a5f4;}export function redactCliConfigValue(_0x57c2c2,_0x819d00){const _0x460443=a171_0x5de9c4;if(_0x57c2c2==='accessKey'||/^apps\.[^.]+\.accessKey$/[_0x460443(0x104)](_0x57c2c2))return maskCliAccessKey(_0x819d00);if(_0x57c2c2===_0x460443(0x117)&&_0x819d00&&typeof _0x819d00===_0x460443(0x10c)&&!Array[_0x460443(0xfe)](_0x819d00))return redactLegacyAppCredentials(_0x819d00);if(/^apps\.[^.]+$/['test'](_0x57c2c2)&&_0x819d00&&typeof _0x819d00===_0x460443(0x10c)&&!Array[_0x460443(0xfe)](_0x819d00)){const _0x2a0ea0=_0x819d00;return Object[_0x460443(0x107)][_0x460443(0x103)][_0x460443(0x10f)](_0x2a0ea0,_0x460443(0x109))?{..._0x2a0ea0,'accessKey':maskCliAccessKey(_0x2a0ea0['accessKey'])}:_0x819d00;}return _0x819d00;}function redactLegacyAppCredentials(_0x525d6c){const _0x506105=a171_0x5de9c4;return Object[_0x506105(0x115)](Object[_0x506105(0x102)](_0x525d6c)[_0x506105(0x111)](([_0x51c0bb,_0x428d25])=>{const _0x2f5d38=_0x506105;if(!_0x428d25||typeof _0x428d25!==_0x2f5d38(0x10c)||Array['isArray'](_0x428d25))return[_0x51c0bb,_0x428d25];const _0x1859a7={..._0x428d25};return Object[_0x2f5d38(0x107)][_0x2f5d38(0x103)]['call'](_0x1859a7,_0x2f5d38(0x109))&&(_0x1859a7['accessKey']=maskCliAccessKey(_0x1859a7['accessKey'])),[_0x51c0bb,_0x1859a7];}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a172_0x1583(){const _0x2ba4cf=['3437700UccQkE','510702QEKjiM','8821888CixECe','6275fyktBM','211540VUgbHW','208935oZfNsH','1724adZKTi','1136616egcQoN'];a172_0x1583=function(){return _0x2ba4cf;};return a172_0x1583();}(function(_0x313f3f,_0x3008b0){const _0x44cbe4=a172_0x4ea8,_0x5e8531=_0x313f3f();while(!![]){try{const _0x5d384e=parseInt(_0x44cbe4(0x74))/0x1+-parseInt(_0x44cbe4(0x71))/0x2+parseInt(_0x44cbe4(0x75))/0x3+-parseInt(_0x44cbe4(0x76))/0x4*(parseInt(_0x44cbe4(0x73))/0x5)+parseInt(_0x44cbe4(0x77))/0x6+-parseInt(_0x44cbe4(0x78))/0x7+parseInt(_0x44cbe4(0x72))/0x8;if(_0x5d384e===_0x3008b0)break;else _0x5e8531['push'](_0x5e8531['shift']());}catch(_0x2484e6){_0x5e8531['push'](_0x5e8531['shift']());}}}(a172_0x1583,0x45d31));function a172_0x4ea8(_0x273d51,_0x47f961){_0x273d51=_0x273d51-0x71;const _0x158365=a172_0x1583();let _0x4ea8cd=_0x158365[_0x273d51];return _0x4ea8cd;}import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a173_0x5872(_0x31f52a,_0x4c8008){_0x31f52a=_0x31f52a-0xcb;const _0x56b77e=a173_0x56b7();let _0x58725b=_0x56b77e[_0x31f52a];return _0x58725b;}(function(_0x25500b,_0x3332f0){const _0x3e50ed=a173_0x5872,_0x3c7b76=_0x25500b();while(!![]){try{const _0xf0b7d=parseInt(_0x3e50ed(0xe1))/0x1*(parseInt(_0x3e50ed(0xd0))/0x2)+-parseInt(_0x3e50ed(0xd4))/0x3+parseInt(_0x3e50ed(0xcf))/0x4+-parseInt(_0x3e50ed(0xd2))/0x5+-parseInt(_0x3e50ed(0xce))/0x6*(parseInt(_0x3e50ed(0xcd))/0x7)+parseInt(_0x3e50ed(0xd5))/0x8+-parseInt(_0x3e50ed(0xde))/0x9*(-parseInt(_0x3e50ed(0xe0))/0xa);if(_0xf0b7d===_0x3332f0)break;else _0x3c7b76['push'](_0x3c7b76['shift']());}catch(_0x59ec2b){_0x3c7b76['push'](_0x3c7b76['shift']());}}}(a173_0x56b7,0x50cb8));import a173_0x3a4ca2 from'semver';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';import{CliErrors}from'../errors.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{getCliVersion}from'../utils/version.js';export function evaluateCliVersionPolicy(_0x259f9e,_0x1a7ca8){const _0x5c144e=a173_0x5872,_0x238b59=a173_0x3a4ca2['valid'](_0x259f9e)===_0x259f9e,_0x144449=_0x1a7ca8?.[_0x5c144e(0xda)]??null,_0x4d75d0=_0x1a7ca8?.[_0x5c144e(0xdb)]??null,_0x405133=Boolean(_0x238b59&&_0x144449&&a173_0x3a4ca2['lt'](_0x259f9e,_0x144449)),_0x4af502=Boolean(_0x238b59&&_0x4d75d0&&a173_0x3a4ca2['lt'](_0x259f9e,_0x4d75d0));return{'currentVersion':_0x259f9e,'stableVersion':_0x144449,'minimumVersion':_0x4d75d0,'needsUpgrade':_0x405133||_0x4af502,'belowMinimum':_0x4af502,'upgradeMessage':_0x1a7ca8?.[_0x5c144e(0xdf)],'minimumVersionMessage':_0x1a7ca8?.['minimumVersionMessage']};}function a173_0x56b7(){const _0x313af1=['stableVersion','minimumVersion','Upgrade\x20command:\x20','npm\x20install\x20-g\x20','138321aqkvKN','upgradeMessage','30tFhNef','113468kkfWsf','Current\x20version:\x20','minimumVersionMessage','filter','1288994ZFVOFC','18cYwVvG','2414088uOvyFX','4UjBQxk','latest','656650KzCoIZ','belowMinimum','1451919Xqozsq','4976800cqTJSo','join','validation','unavailable','Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.'];a173_0x56b7=function(){return _0x313af1;};return a173_0x56b7();}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}export function getCliUpgradeCommand(_0x24987e){const _0x2b1365=a173_0x5872;return _0x2b1365(0xdd)+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0x24987e[_0x2b1365(0xda)]??_0x2b1365(0xd1));}export function assertCliVersionSupported(_0x4d448e){const _0x50ae94=a173_0x5872;if(!_0x4d448e[_0x50ae94(0xd3)])return;const _0x1a0b2b=[_0x4d448e[_0x50ae94(0xcb)],_0x50ae94(0xe2)+_0x4d448e['currentVersion'],'Minimum\x20supported:\x20'+_0x4d448e[_0x50ae94(0xdb)],'Recommended\x20stable:\x20'+(_0x4d448e[_0x50ae94(0xda)]??_0x50ae94(0xd8)),_0x50ae94(0xdc)+getCliUpgradeCommand(_0x4d448e)][_0x50ae94(0xcc)](Boolean)[_0x50ae94(0xd6)]('\x0a');throw CliErrors[_0x50ae94(0xd7)](_0x50ae94(0xd9),_0x1a0b2b);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1f03de,_0xbedf21){const _0x106ef6=a174_0x1bf7,_0x431d1c=_0x1f03de();while(!![]){try{const _0x3e0d84=parseInt(_0x106ef6(0x1b2))/0x1*(-parseInt(_0x106ef6(0x1aa))/0x2)+-parseInt(_0x106ef6(0x1ac))/0x3+-parseInt(_0x106ef6(0x19e))/0x4+-parseInt(_0x106ef6(0x1b0))/0x5*(parseInt(_0x106ef6(0x1b3))/0x6)+-parseInt(_0x106ef6(0x1a0))/0x7*(-parseInt(_0x106ef6(0x19d))/0x8)+-parseInt(_0x106ef6(0x19c))/0x9+parseInt(_0x106ef6(0x1b1))/0xa*(parseInt(_0x106ef6(0x1ad))/0xb);if(_0x3e0d84===_0xbedf21)break;else _0x431d1c['push'](_0x431d1c['shift']());}catch(_0x1a904c){_0x431d1c['push'](_0x431d1c['shift']());}}}(a174_0x6fa8,0x411d5));function a174_0x6fa8(){const _0x229f56=['finally','application/json','32122pkGiPJ','timeout','494436hcyYhm','22XAWpRP','minimumVersionMessage','json','102205uOXBbp','5546050sVsPJO','21vsvSgy','78sIMrIe','upgradeMessage','cli','valid','1117593uwrjqQ','16RtwiTD','1464064KTJfrC','string','1454313YyHMpz','recommendedVersion','now','latestVersion','then','minimumVersion','object','stableVersion'];a174_0x6fa8=function(){return _0x229f56;};return a174_0x6fa8();}import a174_0x1f1e1a from'semver';import{LOVRABET_CLI_VERSION_POLICY_URL}from'../constant/distribution.js';const SUCCESS_CACHE_TTL_MS=0x5*0x3c*0x3e8,FAILURE_CACHE_TTL_MS=0x3c*0x3e8,FETCH_TIMEOUT_MS=0x5dc;function pickString(_0x33f253){const _0xcc3bc=a174_0x1bf7;return typeof _0x33f253===_0xcc3bc(0x19f)&&_0x33f253['trim']()?_0x33f253['trim']():null;}function pickStrictSemver(_0xd9f36c){const _0x40d5d3=a174_0x1bf7,_0x314dae=pickString(_0xd9f36c);return _0x314dae&&a174_0x1f1e1a[_0x40d5d3(0x19b)](_0x314dae)===_0x314dae?_0x314dae:null;}export function normalizeCliVersionPolicy(_0x258e32){const _0x73007b=a174_0x1bf7;if(!_0x258e32||typeof _0x258e32!==_0x73007b(0x1a6))return null;const _0x1d95de=_0x258e32,_0x528ccf=_0x1d95de[_0x73007b(0x19a)]&&typeof _0x1d95de['cli']===_0x73007b(0x1a6)?_0x1d95de[_0x73007b(0x19a)]:_0x1d95de,_0x3daf5a=pickStrictSemver(_0x528ccf[_0x73007b(0x1a7)]??_0x528ccf[_0x73007b(0x1a3)]??_0x528ccf[_0x73007b(0x1a1)]),_0x1ae0e0=pickStrictSemver(_0x528ccf[_0x73007b(0x1a5)]??_0x528ccf['minVersion']);if(!_0x3daf5a&&!_0x1ae0e0)return null;if(_0x3daf5a&&_0x1ae0e0&&a174_0x1f1e1a['gt'](_0x1ae0e0,_0x3daf5a))return null;return{'stableVersion':_0x3daf5a,'minimumVersion':_0x1ae0e0,'upgradeMessage':pickString(_0x528ccf[_0x73007b(0x199)])??undefined,'minimumVersionMessage':pickString(_0x528ccf[_0x73007b(0x1ae)])??undefined};}export async function fetchCliVersionPolicy(){const _0x2c9e7d=a174_0x1bf7;try{const _0x1cb253=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':_0x2c9e7d(0x1a9)},'signal':AbortSignal[_0x2c9e7d(0x1ab)](FETCH_TIMEOUT_MS)});if(!_0x1cb253['ok'])return null;return normalizeCliVersionPolicy(await _0x1cb253[_0x2c9e7d(0x1af)]());}catch{return null;}}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;function a174_0x1bf7(_0x5ef443,_0x159d1d){_0x5ef443=_0x5ef443-0x199;const _0x6fa879=a174_0x6fa8();let _0x1bf7bc=_0x6fa879[_0x5ef443];return _0x1bf7bc;}export async function getCliVersionPolicy(){const _0x250276=a174_0x1bf7,_0x1fa9ad=Date[_0x250276(0x1a2)]();if(hasCachedPolicy){const _0x13b800=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0x1fa9ad-cachedAt<_0x13b800)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()[_0x250276(0x1a4)](_0x4fb8c9=>{const _0x3abaed=_0x250276;return cachedPolicy=_0x4fb8c9,cachedAt=Date[_0x3abaed(0x1a2)](),hasCachedPolicy=!![],_0x4fb8c9;})[_0x250276(0x1a8)](()=>{pendingPolicy=null;}),pendingPolicy;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a175_0x55d0c0=a175_0x13a6;(function(_0x39ad78,_0x4f84fa){const _0x18fb04=a175_0x13a6,_0x215c0e=_0x39ad78();while(!![]){try{const _0x59e297=-parseInt(_0x18fb04(0x132))/0x1*(-parseInt(_0x18fb04(0x124))/0x2)+-parseInt(_0x18fb04(0x13e))/0x3*(-parseInt(_0x18fb04(0x10c))/0x4)+-parseInt(_0x18fb04(0x11c))/0x5*(parseInt(_0x18fb04(0x113))/0x6)+-parseInt(_0x18fb04(0x111))/0x7*(parseInt(_0x18fb04(0x12f))/0x8)+parseInt(_0x18fb04(0x112))/0x9+parseInt(_0x18fb04(0x11a))/0xa+-parseInt(_0x18fb04(0x12b))/0xb;if(_0x59e297===_0x4f84fa)break;else _0x215c0e['push'](_0x215c0e['shift']());}catch(_0x37d784){_0x215c0e['push'](_0x215c0e['shift']());}}}(a175_0x16f5,0xad59f));function a175_0x16f5(){const _0x17d123=['error','14cRCoxP','5549238DisSIV','12XYeUNk','details','stringify','level','Completed:\x20','errors','Failed\x20to\x20clear\x20logs:','10475780RDMlkD','transports','929485AStOrd','toISOString','clearLogs','command','dirname','Failed:\x20','readFileSync','warn','2422AiyrkS','printf','split','currentRawCommand','now','success','initWinstonLogger','14602918UrlBam','red','getWinstonInstance','utf8','2404640AWNLwi','filter','message','1028pzbOaU','format','info','existsSync','logFilePath','Failed\x20to\x20read\x20logs:','timestamp','Starting:\x20','writeFileSync','winstonLogger','setLogPath','setRawCommand','87eXwOUG','unknown','13996KFxuKG','mkdirSync','clear','combine'];a175_0x16f5=function(){return _0x17d123;};return a175_0x16f5();}function a175_0x13a6(_0x1319cc,_0x275626){_0x1319cc=_0x1319cc-0x10b;const _0x16f5f=a175_0x16f5();let _0x13a69d=_0x16f5f[_0x1319cc];return _0x13a69d;}import a175_0x28e935 from'winston';import a175_0x3ddd3e from'node:fs';import a175_0x2f41c4 from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{['winstonLogger'];[a175_0x55d0c0(0x136)]='';[a175_0x55d0c0(0x127)]='';constructor(){}[a175_0x55d0c0(0x13d)](_0x534ff1){const _0xaae1c6=a175_0x55d0c0;this[_0xaae1c6(0x127)]=_0x534ff1;}[a175_0x55d0c0(0x13c)](_0x408241){const _0x41e18f=a175_0x55d0c0;this[_0x41e18f(0x136)]=a175_0x2f41c4['join'](_0x408241,PRODUCT_CONFIG['logFileName']),this[_0x41e18f(0x13b)]&&this[_0x41e18f(0x13b)][_0x41e18f(0x10e)](),this[_0x41e18f(0x12a)]();}[a175_0x55d0c0(0x12a)](){const _0x28c7ac=a175_0x55d0c0,_0x139978=a175_0x2f41c4[_0x28c7ac(0x120)](this['logFilePath']);!a175_0x3ddd3e[_0x28c7ac(0x135)](_0x139978)&&a175_0x3ddd3e[_0x28c7ac(0x10d)](_0x139978,{'recursive':!![]});const _0x9ed80=a175_0x28e935[_0x28c7ac(0x133)][_0x28c7ac(0x10f)](a175_0x28e935[_0x28c7ac(0x133)][_0x28c7ac(0x138)](),a175_0x28e935[_0x28c7ac(0x133)][_0x28c7ac(0x118)]({'stack':!![]}),a175_0x28e935[_0x28c7ac(0x133)][_0x28c7ac(0x125)](_0x39fe57=>{const _0x2b5094=_0x28c7ac,_0x5570c3={'timestamp':_0x39fe57[_0x2b5094(0x138)]||new Date()[_0x2b5094(0x11d)](),'level':_0x39fe57[_0x2b5094(0x116)]||'info','command':_0x39fe57[_0x2b5094(0x11f)]||_0x2b5094(0x10b),'rawCommand':_0x39fe57['rawCommand']||this[_0x2b5094(0x127)]||undefined,'message':_0x39fe57[_0x2b5094(0x131)]||'','duration':_0x39fe57['duration']||undefined,'details':_0x39fe57[_0x2b5094(0x114)]||undefined};return JSON[_0x2b5094(0x115)](_0x5570c3);}));this[_0x28c7ac(0x13b)]=a175_0x28e935['createLogger']({'level':_0x28c7ac(0x134),'format':_0x9ed80,'transports':[new a175_0x28e935[(_0x28c7ac(0x11b))]['File']({'filename':this[_0x28c7ac(0x136)],'level':_0x28c7ac(0x134)})],'silent':![]}),a175_0x28e935['addColors']({'success':'green','error':_0x28c7ac(0x12c),'warn':'yellow','info':'blue'});}[a175_0x55d0c0(0x134)](_0x288f4a,_0x13229b,_0x4a89ae){const _0x53e3b0=a175_0x55d0c0;if(!this[_0x53e3b0(0x136)]||!this[_0x53e3b0(0x13b)])return;this[_0x53e3b0(0x13b)][_0x53e3b0(0x134)](_0x13229b,{'command':_0x288f4a,'details':_0x4a89ae});}[a175_0x55d0c0(0x129)](_0x130dab,_0x32b152,_0xcfe336,_0x57ff2c){const _0x463290=a175_0x55d0c0;if(!this[_0x463290(0x136)]||!this[_0x463290(0x13b)])return;this[_0x463290(0x13b)]['log']('info',_0x32b152,{'level':_0x463290(0x129),'command':_0x130dab,'duration':_0xcfe336,'details':_0x57ff2c});}[a175_0x55d0c0(0x110)](_0x4539a2,_0x50add3,_0x1fe487){const _0x72618a=a175_0x55d0c0;if(!this[_0x72618a(0x136)]||!this[_0x72618a(0x13b)])return;this[_0x72618a(0x13b)][_0x72618a(0x110)](_0x50add3,{'command':_0x4539a2,'details':_0x1fe487});}[a175_0x55d0c0(0x123)](_0x5d7da1,_0x538132,_0x4a30d5){const _0x57c8dd=a175_0x55d0c0;if(!this[_0x57c8dd(0x136)]||!this[_0x57c8dd(0x13b)])return;this[_0x57c8dd(0x13b)]['warn'](_0x538132,{'command':_0x5d7da1,'details':_0x4a30d5});}async['logTask'](_0x1c827c,_0x1e1ef1,_0x3477d7){const _0x5ed96f=a175_0x55d0c0,_0x599bf1=Date[_0x5ed96f(0x128)]();this['info'](_0x1c827c,_0x5ed96f(0x139)+_0x1e1ef1);try{const _0x33b342=await _0x3477d7(),_0x556d2e=Date['now']()-_0x599bf1;return this[_0x5ed96f(0x129)](_0x1c827c,_0x5ed96f(0x117)+_0x1e1ef1,_0x556d2e),_0x33b342;}catch(_0x8d13f4){const _0x3cb2e3=Date['now']()-_0x599bf1;this[_0x5ed96f(0x110)](_0x1c827c,_0x5ed96f(0x121)+_0x1e1ef1,{'error':_0x8d13f4 instanceof Error?_0x8d13f4[_0x5ed96f(0x131)]:String(_0x8d13f4),'duration':_0x3cb2e3});throw _0x8d13f4;}}['readLogs'](){const _0x1fb5b9=a175_0x55d0c0;try{if(!a175_0x3ddd3e[_0x1fb5b9(0x135)](this[_0x1fb5b9(0x136)]))return[];const _0x242c76=a175_0x3ddd3e[_0x1fb5b9(0x122)](this[_0x1fb5b9(0x136)],_0x1fb5b9(0x12e));return _0x242c76[_0x1fb5b9(0x126)](/\r?\n/)[_0x1fb5b9(0x130)](_0x539db2=>_0x539db2['trim']())['map'](_0x445c75=>JSON['parse'](_0x445c75));}catch(_0x1922f4){return console['warn'](_0x1fb5b9(0x137),_0x1922f4),[];}}[a175_0x55d0c0(0x11e)](){const _0x147058=a175_0x55d0c0;try{a175_0x3ddd3e[_0x147058(0x135)](this[_0x147058(0x136)])&&a175_0x3ddd3e[_0x147058(0x13a)](this[_0x147058(0x136)],'',_0x147058(0x12e));}catch(_0xe6df82){console[_0x147058(0x123)](_0x147058(0x119),_0xe6df82);}}[a175_0x55d0c0(0x12d)](){const _0x10fe97=a175_0x55d0c0;return this[_0x10fe97(0x13b)];}}export const logger=new Logger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a176_0x248c69=a176_0x4b58;function a176_0x1157(){const _0x2b5be6=['386847KUZIlC','2385096FrgxkQ','prototype','2252UgFliW','length','1290574uKkrgt','439950cHbKha','9905EedtYf','json','MAX_SAFE_INTEGER','151839RbKdtT','6197752ubYaBd','exec','includes','parse','getOwnPropertyDescriptor'];a176_0x1157=function(){return _0x2b5be6;};return a176_0x1157();}(function(_0x3ddb85,_0x5cd72d){const _0x85792a=a176_0x4b58,_0x4dc454=_0x3ddb85();while(!![]){try{const _0x513655=parseInt(_0x85792a(0x1ef))/0x1+-parseInt(_0x85792a(0x1ea))/0x2+-parseInt(_0x85792a(0x1e5))/0x3+parseInt(_0x85792a(0x1e8))/0x4*(parseInt(_0x85792a(0x1ec))/0x5)+-parseInt(_0x85792a(0x1e6))/0x6+-parseInt(_0x85792a(0x1eb))/0x7+parseInt(_0x85792a(0x1f0))/0x8;if(_0x513655===_0x5cd72d)break;else _0x4dc454['push'](_0x4dc454['shift']());}catch(_0x3f49a0){_0x4dc454['push'](_0x4dc454['shift']());}}}(a176_0x1157,0xc515b));const JSON_NUMBER_PATTERN=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/,MAX_SAFE_INTEGER=BigInt(Number[a176_0x248c69(0x1ee)]),MIN_SAFE_INTEGER=BigInt(Number['MIN_SAFE_INTEGER']);let restoreResponseJsonParser,responseJsonPrototype,originalResponseJsonDescriptor;function isUnsafeIntegerLiteral(_0x594d06){const _0x100a6d=a176_0x248c69;if(_0x594d06['includes']('.')||_0x594d06['includes']('e')||_0x594d06[_0x100a6d(0x1f2)]('E'))return![];const _0x6ec1d0=BigInt(_0x594d06);return _0x6ec1d0>MAX_SAFE_INTEGER||_0x6ec1d0<MIN_SAFE_INTEGER;}function quoteUnsafeIntegerLiterals(_0x243c30){const _0x2ce08f=a176_0x248c69;let _0x521d9f='',_0x225599=![],_0x452774=![];for(let _0x766088=0x0;_0x766088<_0x243c30[_0x2ce08f(0x1e9)];){const _0x2ca783=_0x243c30[_0x766088];if(_0x225599){_0x521d9f+=_0x2ca783,_0x766088+=0x1;if(_0x452774)_0x452774=![];else{if(_0x2ca783==='\x5c')_0x452774=!![];else _0x2ca783==='\x22'&&(_0x225599=![]);}continue;}if(_0x2ca783==='\x22'){_0x225599=!![],_0x521d9f+=_0x2ca783,_0x766088+=0x1;continue;}if(_0x2ca783==='-'||_0x2ca783>='0'&&_0x2ca783<='9'){const _0x1db23b=JSON_NUMBER_PATTERN[_0x2ce08f(0x1f1)](_0x243c30['slice'](_0x766088))?.[0x0];if(_0x1db23b){_0x521d9f+=isUnsafeIntegerLiteral(_0x1db23b)?'\x22'+_0x1db23b+'\x22':_0x1db23b,_0x766088+=_0x1db23b['length'];continue;}}_0x521d9f+=_0x2ca783,_0x766088+=0x1;}return _0x521d9f;}export function parseLosslessJson(_0x178781){const _0x467eac=a176_0x248c69;return JSON[_0x467eac(0x1e3)](quoteUnsafeIntegerLiterals(_0x178781));}function a176_0x4b58(_0x7b3f6e,_0x3a364a){_0x7b3f6e=_0x7b3f6e-0x1e3;const _0x115796=a176_0x1157();let _0x4b5831=_0x115796[_0x7b3f6e];return _0x4b5831;}export function installLosslessJsonResponseParser(){const _0x9e57c5=a176_0x248c69;if(typeof Response==='undefined')return()=>{};if(restoreResponseJsonParser)return restoreResponseJsonParser;return responseJsonPrototype=Response[_0x9e57c5(0x1e7)],originalResponseJsonDescriptor=Object[_0x9e57c5(0x1e4)](responseJsonPrototype,'json'),Object['defineProperty'](responseJsonPrototype,'json',{...originalResponseJsonDescriptor??{'configurable':!![],'enumerable':![],'writable':!![]},'value':async function _0x2183de(){return parseLosslessJson(await this['text']());}}),restoreResponseJsonParser=()=>{const _0x433519=_0x9e57c5;if(!responseJsonPrototype)return;originalResponseJsonDescriptor?Object['defineProperty'](responseJsonPrototype,'json',originalResponseJsonDescriptor):delete responseJsonPrototype[_0x433519(0x1ed)],responseJsonPrototype=undefined,originalResponseJsonDescriptor=undefined,restoreResponseJsonParser=undefined;},restoreResponseJsonParser;}export function restoreLosslessJsonResponseParser(){restoreResponseJsonParser?.();}
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x432077,_0x507665){const _0x43b6a6=a177_0x4493,_0x2e7557=_0x432077();while(!![]){try{const _0x299597=parseInt(_0x43b6a6(0x177))/0x1+parseInt(_0x43b6a6(0x17c))/0x2+parseInt(_0x43b6a6(0x184))/0x3*(-parseInt(_0x43b6a6(0x17b))/0x4)+-parseInt(_0x43b6a6(0x192))/0x5+-parseInt(_0x43b6a6(0x18c))/0x6*(-parseInt(_0x43b6a6(0x185))/0x7)+parseInt(_0x43b6a6(0x188))/0x8*(-parseInt(_0x43b6a6(0x18b))/0x9)+-parseInt(_0x43b6a6(0x17e))/0xa*(-parseInt(_0x43b6a6(0x17a))/0xb);if(_0x299597===_0x507665)break;else _0x2e7557['push'](_0x2e7557['shift']());}catch(_0x5bf54b){_0x2e7557['push'](_0x2e7557['shift']());}}}(a177_0x186b,0x9ad0e));import{CliErrors}from'../errors.js';import{parseLosslessJson}from'../utils/lossless-json.js';export const MAX_DATA_UPDATE_IDS=0x3e8;export function parseJsonParams(_0x2ac169){const _0x2edfc5=a177_0x4493;if(!_0x2ac169)return undefined;try{return parseLosslessJson(_0x2ac169);}catch{throw CliErrors['validation'](_0x2edfc5(0x187)+_0x2ac169);}}export function parseJsonParamsValue(_0x4f9435){const _0x24f562=a177_0x4493;if(!_0x4f9435)return undefined;try{return parseLosslessJson(_0x4f9435);}catch{throw CliErrors[_0x24f562(0x18d)](_0x24f562(0x187)+_0x4f9435);}}function a177_0x4493(_0x28c12d,_0x4f904e){_0x28c12d=_0x28c12d-0x177;const _0x186b47=a177_0x186b();let _0x449377=_0x186b47[_0x28c12d];return _0x449377;}export function parseBatchCreateItemsFromParams(_0x319724){const _0x244b96=a177_0x4493;if(Array['isArray'](_0x319724))return _0x319724;if(_0x319724!==null&&_0x319724!==undefined&&typeof _0x319724===_0x244b96(0x182)&&Array[_0x244b96(0x180)](_0x319724['items']))return _0x319724[_0x244b96(0x18e)];throw CliErrors[_0x244b96(0x18d)](_0x244b96(0x178),_0x244b96(0x190));}function parseDataUpdateId(_0x310ff8,_0x1270e2){const _0x2809fc=a177_0x4493;if(typeof _0x310ff8===_0x2809fc(0x186)&&Number[_0x2809fc(0x193)](_0x310ff8)&&_0x310ff8>0x0)return _0x310ff8;if(typeof _0x310ff8===_0x2809fc(0x18f)){if(/^[1-9]\d*$/[_0x2809fc(0x191)](_0x310ff8))return _0x310ff8;}throw CliErrors['validation']('data\x20update\x20--params.'+_0x1270e2+_0x2809fc(0x17d));}export function parseUpdateIdsFromParams(_0x32350e){const _0x56223c=a177_0x4493;if(_0x32350e===null||_0x32350e===undefined||typeof _0x32350e!==_0x56223c(0x182)||Array[_0x56223c(0x180)](_0x32350e))throw CliErrors[_0x56223c(0x18d)](_0x56223c(0x197),'Example:\x20--params\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22done\x22}\x27');const _0x345c64=_0x32350e['id'];if(_0x345c64===undefined||_0x345c64===null)throw CliErrors[_0x56223c(0x18d)](_0x56223c(0x196),_0x56223c(0x18a));const _0x434dae=Array['isArray'](_0x345c64)?_0x345c64:[_0x345c64];if(_0x434dae[_0x56223c(0x17f)]===0x0)throw CliErrors[_0x56223c(0x18d)](_0x56223c(0x195));if(_0x434dae[_0x56223c(0x17f)]>MAX_DATA_UPDATE_IDS)throw CliErrors['validation'](_0x56223c(0x183)+MAX_DATA_UPDATE_IDS+_0x56223c(0x194)+_0x434dae['length']+'.');return _0x434dae[_0x56223c(0x179)]((_0x6a50a0,_0x2862dd)=>parseDataUpdateId(_0x6a50a0,Array['isArray'](_0x345c64)?_0x56223c(0x181)+_0x2862dd+']':'id'));}export function normalizeUpdateParamsForRuntime(_0x3207a6,_0x379f58){const _0x395b80=a177_0x4493;if(Array[_0x395b80(0x180)](_0x3207a6['id'])&&_0x379f58[_0x395b80(0x17f)]>0x1)return{..._0x3207a6,'id':_0x379f58[_0x395b80(0x189)](',')};return _0x3207a6;}function a177_0x186b(){const _0x4b4dfc=['validation','items','string','Example:\x20--params\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','test','3446365iTGsLf','isSafeInteger','\x20records\x20per\x20call;\x20received\x20','data\x20update\x20id\x20array\x20cannot\x20be\x20empty.','data\x20update\x20requires\x20\x22id\x22\x20in\x20--params.','data\x20update\x20--params\x20must\x20be\x20a\x20JSON\x20object\x20with\x20id.','309535Qakfsr','batchCreate\x20--params\x20must\x20be\x20a\x20JSON\x20array\x20or\x20{\x22items\x22:[...]}','map','33BEBkNp','8JyGxLV','446208NKBWVN','\x20must\x20be\x20a\x20positive\x20integer\x20or\x20numeric\x20string.','7308460moykLy','length','isArray','id[','object','data\x20update\x20can\x20update\x20at\x20most\x20','554352GGmxRb','178906rBdKzB','number','Invalid\x20JSON\x20for\x20--params:\x20','9075536vFQbXb','join','Example:\x20--params\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22done\x22}\x27','9mWpKWb','24SSTjRZ'];a177_0x186b=function(){return _0x4b4dfc;};return a177_0x186b();}
|