@lovrabet/lovrabet-cli 2.3.6-beta.1 → 2.3.6-beta.3
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 +33 -2
- 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.d.ts +3 -3
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/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.d.ts +7 -6
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.d.ts +17 -0
- package/lib/core/kb-management-client.js +1 -0
- 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/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +5 -3
- package/skills/lovrabet/guides/app-resolution.md +2 -0
- package/skills/lovrabet/guides/dataset-and-data-workflow.md +10 -1
- package/skills/lovrabet/references/dataset-discovery-workflow.md +14 -1
- package/skills/lovrabet/references/instant-api-workflow.md +2 -0
- package/skills/lovrabet/references/lovrabet-app.md +2 -0
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +7 -3
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x17b248,_0x539082){const _0x2f08e9=a156_0x15ca,_0x5164de=_0x17b248();while(!![]){try{const _0x3cce1d=parseInt(_0x2f08e9(0xb7))/0x1*(-parseInt(_0x2f08e9(0xc5))/0x2)+-parseInt(_0x2f08e9(0xa8))/0x3*(-parseInt(_0x2f08e9(0xaf))/0x4)+-parseInt(_0x2f08e9(0xbb))/0x5+-parseInt(_0x2f08e9(0xab))/0x6+parseInt(_0x2f08e9(0xd6))/0x7+parseInt(_0x2f08e9(0xd3))/0x8*(parseInt(_0x2f08e9(0xbe))/0x9)+-parseInt(_0x2f08e9(0xcd))/0xa*(-parseInt(_0x2f08e9(0xc4))/0xb);if(_0x3cce1d===_0x539082)break;else _0x5164de['push'](_0x5164de['shift']());}catch(_0x53fa9f){_0x5164de['push'](_0x5164de['shift']());}}}(a156_0x4cd1,0xe8f29));function a156_0x4cd1(){const _0x19d5fc=['appCode','displayName','join','keys','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','name:\x20','name','accessKey','---','replace','toString','slice','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','798ugMIMr','status','schemaVersion','8621076nLtTuE','example','.\x20Changed\x20file:\x20','flow','10932RITqpT','validation','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','trimEnd','map','paths','description','isFile','1gNskas','force','hasOwn','length','5220975NDSjQy','skillCode','contentHash','860193lZjAbn','test','set','packageBytes','path','contents','517tOAdsV','2069338fVwbTZ','match','displayName:\x20','find','skillName','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','has','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','132670ffLLEF','stringify','entries','Managed\x20file\x20was\x20removed\x20locally:\x20','fileHashes','filter','120OrAKlx','pulledAt','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','11799767JzpRQM','trim','scope','Runtime\x20Skill\x20package\x20is\x20missing\x20','env'];a156_0x4cd1=function(){return _0x19d5fc;};return a156_0x4cd1();}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 a156_0x15ca(_0x4833ff,_0x35bac1){_0x4833ff=_0x4833ff-0xa7;const _0x4cd1c8=a156_0x4cd1();let _0x15ca9c=_0x4cd1c8[_0x4833ff];return _0x15ca9c;}import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x23845c,_0x3dd9d2,_0x5e6479){const _0x25a6d2=a156_0x15ca,_0x568d15=requireSkillCode(_0x23845c),_0x610ef3=requirePackageBytes(_0x568d15,_0x5e6479[_0x25a6d2(0xc1)]),_0x43441a=extractDownloadedPackage(_0x610ef3),_0x302201=_0x43441a[_0x25a6d2(0xc8)](_0x958fd6=>_0x958fd6[_0x25a6d2(0xc2)]===SKILL_FILE);if(!_0x302201)throw CliErrors[_0x25a6d2(0xb0)](_0x25a6d2(0xd9)+SKILL_FILE+':\x20'+_0x568d15);const _0xec96c4=withMaterializedSkillFrontmatter(_0x43441a,_0x23845c,_0x568d15),_0x4a796d=_0xec96c4[_0x25a6d2(0xc8)](_0x22deb1=>_0x22deb1['path']===SKILL_FILE),_0x4a2073=fileText(_0x4a796d),_0x4d9383=getRuntimeSkillDir(_0x5e6479['env'],_0x5e6479[_0x25a6d2(0xe2)],_0x5e6479['appCode'],_0x3dd9d2,_0x568d15,_0x5e6479[_0x25a6d2(0xb4)]),_0x2c3420=resolve(_0x4d9383,SKILL_FILE),_0x1d89ec=resolve(_0x4d9383,METADATA_FILE),_0x7f0b8c=contentHash(_0x4a2073),_0x482996=readMetadataIfPresent(_0x1d89ec)?.[_0x25a6d2(0xd1)];ensurePulledFilesCanBeOverwritten(_0x4d9383,_0x1d89ec,_0xec96c4,_0x5e6479[_0x25a6d2(0xb8)]===!![]),mkdirSync(_0x4d9383,{'recursive':!![],'mode':0x1c0});const _0x23dd68=existsSync(_0x2c3420)?readFileSync(_0x2c3420,'utf8'):undefined;return materializeFiles(_0x4d9383,_0xec96c4),removeStaleManagedFiles(_0x4d9383,_0x482996,_0xec96c4),writeJsonAtomic(_0x1d89ec,buildMetadata(_0x23845c,_0x3dd9d2,_0x5e6479['appCode'],_0x7f0b8c,_0x5e6479[_0x25a6d2(0xd4)],_0xec96c4,_0x610ef3)),{'skill':_0x23845c,'scope':_0x3dd9d2,'dir':_0x4d9383,'skillMdPath':_0x2c3420,'metadataPath':_0x1d89ec,'contentHash':_0x7f0b8c,'changed':_0x23dd68!==_0x4a2073};}export function reuseMaterializedRuntimeSkill(_0x31447a,_0x5b6960,_0x349e4b){const _0x1d3e44=a156_0x15ca,_0x499aba=_0x31447a['version']?.['trim']();if(!_0x499aba)return undefined;const _0x43e380=requireSkillCode(_0x31447a),_0x2879d0=getRuntimeSkillDir(_0x349e4b[_0x1d3e44(0xda)],_0x349e4b[_0x1d3e44(0xe2)],_0x349e4b['appCode'],_0x5b6960,_0x43e380,_0x349e4b['paths']),_0x2cf032=resolve(_0x2879d0,SKILL_FILE),_0x59ccd0=resolve(_0x2879d0,METADATA_FILE),_0x4a6bd4=readMetadataIfPresent(_0x59ccd0);if(!_0x4a6bd4||_0x4a6bd4[_0x1d3e44(0xaa)]!==0x2||_0x4a6bd4['appCode']!==_0x349e4b[_0x1d3e44(0xdb)]||_0x4a6bd4[_0x1d3e44(0xd8)]!==_0x5b6960||_0x4a6bd4[_0x1d3e44(0xbc)]!==_0x43e380||_0x4a6bd4['version']!==_0x499aba||_0x4a6bd4['id']!==_0x31447a['id']||_0x4a6bd4['skillName']!==_0x31447a['skillName']||_0x4a6bd4[_0x1d3e44(0xb5)]!==_0x31447a[_0x1d3e44(0xb5)]||_0x4a6bd4[_0x1d3e44(0xac)]!==_0x31447a['example']||_0x4a6bd4[_0x1d3e44(0xa9)]!==_0x31447a[_0x1d3e44(0xa9)]||!_0x4a6bd4[_0x1d3e44(0xbd)]||!_0x4a6bd4[_0x1d3e44(0xd1)]||!Object[_0x1d3e44(0xb9)](_0x4a6bd4[_0x1d3e44(0xd1)],SKILL_FILE))return undefined;for(const [_0x240b39,_0x29de40]of Object[_0x1d3e44(0xcf)](_0x4a6bd4[_0x1d3e44(0xd1)])){if(!/^[a-f0-9]{64}$/[_0x1d3e44(0xbf)](_0x29de40))return undefined;const _0x547c2b=resolveManagedFilePath(_0x2879d0,_0x240b39);if(!existsSync(_0x547c2b)||!lstatSync(_0x547c2b)[_0x1d3e44(0xb6)]())return undefined;if(bufferSha256(readFileSync(_0x547c2b))!==_0x29de40)return undefined;}return{'skill':_0x31447a,'scope':_0x5b6960,'dir':_0x2879d0,'skillMdPath':_0x2cf032,'metadataPath':_0x59ccd0,'contentHash':_0x4a6bd4[_0x1d3e44(0xbd)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x39e686,_0x30495a,_0x45277c){const _0x2c49cf=a156_0x15ca,_0x592630=skillDisplayName(_0x30495a,_0x45277c),_0x5368b7=_0x30495a[_0x2c49cf(0xb5)]?.[_0x2c49cf(0xd7)]()||_0x592630||_0x45277c;return normalizeLocalFiles(_0x39e686)[_0x2c49cf(0xb3)](_0x1f765d=>{const _0x217dbc=_0x2c49cf,_0x389895=fileText(_0x1f765d);if(_0x1f765d[_0x217dbc(0xc2)]!==SKILL_FILE)return _0x1f765d;if(hasYamlFrontmatter(_0x389895))return{'path':_0x1f765d['path'],'content':withSyncedDisplayName(_0x389895,_0x592630)};return{'path':_0x1f765d[_0x217dbc(0xc2)],'content':prependSkillFrontmatter(_0x389895,{'name':_0x45277c,'displayName':_0x592630,'description':_0x5368b7})};});}function hasYamlFrontmatter(_0x2a9c8a){const _0x518f2c=a156_0x15ca;return/^\uFEFF?---\s*\r?\n/[_0x518f2c(0xbf)](_0x2a9c8a);}function prependSkillFrontmatter(_0x1ddc40,_0xac208f){const _0x1ec6e4=a156_0x15ca,_0x438b29=_0x1ddc40[_0x1ec6e4(0xe4)](/^\uFEFF/,'');return[_0x1ec6e4(0xe3),_0x1ec6e4(0xe0)+yamlString(_0xac208f[_0x1ec6e4(0xe1)]),_0xac208f['displayName']?_0x1ec6e4(0xc7)+yamlString(_0xac208f[_0x1ec6e4(0xdc)]):undefined,'description:\x20'+yamlString(_0xac208f[_0x1ec6e4(0xb5)]),_0x1ec6e4(0xe3),'',_0x438b29][_0x1ec6e4(0xd2)](_0x3285d7=>_0x3285d7!==undefined)[_0x1ec6e4(0xdd)]('\x0a');}function yamlString(_0x58306f){const _0xe943dd=a156_0x15ca;return JSON[_0xe943dd(0xce)](_0x58306f[_0xe943dd(0xe4)](/\r/g,'')[_0xe943dd(0xd7)]());}function skillDisplayName(_0x380765,_0x5c6bc5){const _0x443112=a156_0x15ca,_0x47b7b0=_0x380765[_0x443112(0xc9)]?.['trim']();return _0x47b7b0||_0x5c6bc5;}function withSyncedDisplayName(_0x3cb360,_0x48a4aa){const _0x523a65=a156_0x15ca,_0x5202c0=_0x3cb360[_0x523a65(0xc6)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5202c0)return _0x3cb360;const _0x3aa49b=_0x5202c0[0x1]??'',_0x1fa895=_0x5202c0[0x2]??'',_0x1da62d=parseDocument(_0x1fa895);if(_0x1da62d['errors'][_0x523a65(0xba)]>0x0||!isMap(_0x1da62d[_0x523a65(0xc3)]))return _0x3cb360;if(_0x48a4aa)_0x1da62d[_0x523a65(0xc0)](_0x523a65(0xdc),_0x48a4aa);else{if(_0x1da62d['has'](_0x523a65(0xdc)))_0x1da62d['delete']('displayName');else return _0x3cb360;}forceBlockCollections(_0x1da62d[_0x523a65(0xc3)]);const _0x49ca28=_0x1da62d[_0x523a65(0xe5)]({'lineWidth':0x0})[_0x523a65(0xb2)](),_0x2116c9=_0x3cb360[_0x523a65(0xe6)](_0x5202c0[0x0][_0x523a65(0xba)])[_0x523a65(0xe4)](/^\r?\n/,'');return _0x3aa49b+'---\x0a'+_0x49ca28+'\x0a---\x0a\x0a'+_0x2116c9;}function forceBlockCollections(_0x4f271f){if(!isNode(_0x4f271f))return;visit(_0x4f271f,(_0x4b3baa,_0x243139)=>{const _0x2d4697=a156_0x15ca;isCollection(_0x243139)&&(_0x243139[_0x2d4697(0xae)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x1d8fdb,_0x477c0e,_0x5cb99c,_0x146414){const _0x154965=a156_0x15ca;if(_0x146414||!existsSync(_0x477c0e))return;const _0xd3d91=readMetadataIfPresent(_0x477c0e);if(!_0xd3d91)return;const _0x2dbd50=_0xd3d91[_0x154965(0xd1)]&&Object[_0x154965(0xde)](_0xd3d91[_0x154965(0xd1)])[_0x154965(0xba)]>0x0?_0xd3d91[_0x154965(0xd1)]:undefined;if(_0x2dbd50)for(const [_0x4fea05,_0x577879]of Object[_0x154965(0xcf)](_0x2dbd50)){const _0x3f69d2=resolveManagedFilePath(_0x1d8fdb,_0x4fea05);if(!existsSync(_0x3f69d2))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x1d8fdb,_0x154965(0xd0)+_0x4fea05);const _0x2ab7bc=lstatSync(_0x3f69d2);if(!_0x2ab7bc[_0x154965(0xb6)]())throw CliErrors[_0x154965(0xb0)](_0x154965(0xd5)+_0x1d8fdb,_0x154965(0xdf)+_0x4fea05);const _0xfcdf71=bufferSha256(readFileSync(_0x3f69d2));if(_0xfcdf71!==_0x577879)throw CliErrors[_0x154965(0xb0)](_0x154965(0xd5)+_0x1d8fdb+_0x154965(0xad)+_0x4fea05,_0x154965(0xa7)+_0x4fea05);}else{const _0x4df8aa=resolve(_0x1d8fdb,SKILL_FILE);if(existsSync(_0x4df8aa)&&_0xd3d91[_0x154965(0xbd)]){const _0x1e5c61=contentHash(readFileSync(_0x4df8aa,'utf8'));if(_0x1e5c61!==_0xd3d91[_0x154965(0xbd)])throw CliErrors['validation'](_0x154965(0xb1)+_0x4df8aa,_0x154965(0xca));}}for(const _0x160c35 of normalizeLocalFiles(_0x5cb99c)){if(_0x2dbd50?.[_0x160c35['path']])continue;if(!_0x2dbd50&&_0x160c35[_0x154965(0xc2)]===SKILL_FILE)continue;const _0xf7492c=resolveManagedFilePath(_0x1d8fdb,_0x160c35['path']);if(!existsSync(_0xf7492c))continue;const _0x524927=lstatSync(_0xf7492c);if(!_0x524927[_0x154965(0xb6)]())throw CliErrors[_0x154965(0xb0)](_0x154965(0xd5)+_0x1d8fdb,_0x154965(0xcc)+_0x160c35[_0x154965(0xc2)]);const _0x372117=bufferSha256(readFileSync(_0xf7492c));if(_0x372117!==fileHash(_0x160c35))throw CliErrors[_0x154965(0xb0)](_0x154965(0xd5)+_0x1d8fdb,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x160c35[_0x154965(0xc2)]);}}function materializeFiles(_0x217442,_0x264d9b){const _0x356d86=a156_0x15ca;for(const _0x1e9ab2 of normalizeLocalFiles(_0x264d9b)){const _0x2d72ee=resolveManagedFilePath(_0x217442,_0x1e9ab2[_0x356d86(0xc2)]);mkdirSync(dirname(_0x2d72ee),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x2d72ee,fileContent(_0x1e9ab2),0x180);}}function removeStaleManagedFiles(_0x242803,_0x18d906,_0x61f0a8){const _0x4bee9f=a156_0x15ca;if(!_0x18d906)return;const _0x38fbbd=new Set(normalizeLocalFiles(_0x61f0a8)[_0x4bee9f(0xb3)](_0x32c8e1=>_0x32c8e1[_0x4bee9f(0xc2)]));for(const _0x1efd08 of Object[_0x4bee9f(0xde)](_0x18d906)){if(_0x38fbbd[_0x4bee9f(0xcb)](_0x1efd08))continue;const _0x1d7f2b=resolveManagedFilePath(_0x242803,_0x1efd08);existsSync(_0x1d7f2b)&&lstatSync(_0x1d7f2b)['isFile']()&&rmSync(_0x1d7f2b,{'force':!![]});}}
|
|
1
|
+
(function(_0x13fe32,_0x464234){const _0xfced55=a157_0x482f,_0x19818b=_0x13fe32();while(!![]){try{const _0x2b2c27=-parseInt(_0xfced55(0x97))/0x1+parseInt(_0xfced55(0xa0))/0x2+-parseInt(_0xfced55(0x79))/0x3+parseInt(_0xfced55(0x7f))/0x4+parseInt(_0xfced55(0x8e))/0x5*(parseInt(_0xfced55(0x88))/0x6)+parseInt(_0xfced55(0xa7))/0x7*(-parseInt(_0xfced55(0xa2))/0x8)+parseInt(_0xfced55(0x8a))/0x9*(parseInt(_0xfced55(0x96))/0xa);if(_0x2b2c27===_0x464234)break;else _0x19818b['push'](_0x19818b['shift']());}catch(_0xfbe954){_0x19818b['push'](_0x19818b['shift']());}}}(a157_0x29bd,0x57eba));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';function a157_0x482f(_0x5abea9,_0x3ac3c3){_0x5abea9=_0x5abea9-0x72;const _0x29bdf1=a157_0x29bd();let _0x482fde=_0x29bdf1[_0x5abea9];return _0x482fde;}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';function a157_0x29bd(){const _0x23ac5c=['displayName','936XvTPcz','map','trim','displayName:\x20','schemaVersion','28007woEAkX','has','flow','.\x20Changed\x20file:\x20','skillCode','paths','validation','description','hasOwn','trimEnd','contents','path','1781907sSIetc','set','toString','appCode','length','name','2488640BdSHOb','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','description:\x20','Runtime\x20Skill\x20package\x20is\x20missing\x20','delete','contentHash','isFile','utf8','1051692LxapkI','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','9fvWggq','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','\x0a---\x0a\x0a','skillName','5EzkUqS','env','errors','keys','packageBytes','filter','find','join','6266710hPRxyL','585215iKmRHI','version','example','pulledAt','scope','fileHashes','status','entries','---','1166620ASBMPI'];a157_0x29bd=function(){return _0x23ac5c;};return a157_0x29bd();}export function materializeRuntimeSkill(_0x580078,_0x816b62,_0x45a53c){const _0x3f9d80=a157_0x482f,_0x417c72=requireSkillCode(_0x580078),_0x26515e=requirePackageBytes(_0x417c72,_0x45a53c[_0x3f9d80(0x92)]),_0x400325=extractDownloadedPackage(_0x26515e),_0x1f8f60=_0x400325[_0x3f9d80(0x94)](_0x270160=>_0x270160[_0x3f9d80(0x78)]===SKILL_FILE);if(!_0x1f8f60)throw CliErrors[_0x3f9d80(0x73)](_0x3f9d80(0x83)+SKILL_FILE+':\x20'+_0x417c72);const _0x7eb0e=withMaterializedSkillFrontmatter(_0x400325,_0x580078,_0x417c72),_0x20aace=_0x7eb0e['find'](_0x467889=>_0x467889[_0x3f9d80(0x78)]===SKILL_FILE),_0x385682=fileText(_0x20aace),_0x10a959=getRuntimeSkillDir(_0x45a53c[_0x3f9d80(0x8f)],_0x45a53c['accessKey'],_0x45a53c['appCode'],_0x816b62,_0x417c72,_0x45a53c['paths']),_0x43f324=resolve(_0x10a959,SKILL_FILE),_0x56a550=resolve(_0x10a959,METADATA_FILE),_0xfd98e6=contentHash(_0x385682),_0x32f1e7=readMetadataIfPresent(_0x56a550)?.[_0x3f9d80(0x9c)];ensurePulledFilesCanBeOverwritten(_0x10a959,_0x56a550,_0x7eb0e,_0x45a53c['force']===!![]),mkdirSync(_0x10a959,{'recursive':!![],'mode':0x1c0});const _0x3f10c=existsSync(_0x43f324)?readFileSync(_0x43f324,_0x3f9d80(0x87)):undefined;return materializeFiles(_0x10a959,_0x7eb0e),removeStaleManagedFiles(_0x10a959,_0x32f1e7,_0x7eb0e),writeJsonAtomic(_0x56a550,buildMetadata(_0x580078,_0x816b62,_0x45a53c[_0x3f9d80(0x7c)],_0xfd98e6,_0x45a53c[_0x3f9d80(0x9a)],_0x7eb0e,_0x26515e)),{'skill':_0x580078,'scope':_0x816b62,'dir':_0x10a959,'skillMdPath':_0x43f324,'metadataPath':_0x56a550,'contentHash':_0xfd98e6,'changed':_0x3f10c!==_0x385682};}export function reuseMaterializedRuntimeSkill(_0x2635d2,_0x383221,_0x5561b6){const _0x1ed846=a157_0x482f,_0x1dbc8d=_0x2635d2[_0x1ed846(0x98)]?.[_0x1ed846(0xa4)]();if(!_0x1dbc8d)return undefined;const _0x24c9f0=requireSkillCode(_0x2635d2),_0x8c3e37=getRuntimeSkillDir(_0x5561b6[_0x1ed846(0x8f)],_0x5561b6['accessKey'],_0x5561b6[_0x1ed846(0x7c)],_0x383221,_0x24c9f0,_0x5561b6[_0x1ed846(0x72)]),_0x57b02e=resolve(_0x8c3e37,SKILL_FILE),_0xb99b17=resolve(_0x8c3e37,METADATA_FILE),_0x1713f6=readMetadataIfPresent(_0xb99b17);if(!_0x1713f6||_0x1713f6[_0x1ed846(0xa6)]!==0x2||_0x1713f6[_0x1ed846(0x7c)]!==_0x5561b6['appCode']||_0x1713f6[_0x1ed846(0x9b)]!==_0x383221||_0x1713f6[_0x1ed846(0xab)]!==_0x24c9f0||_0x1713f6[_0x1ed846(0x98)]!==_0x1dbc8d||_0x1713f6['id']!==_0x2635d2['id']||_0x1713f6[_0x1ed846(0x8d)]!==_0x2635d2['skillName']||_0x1713f6[_0x1ed846(0x74)]!==_0x2635d2['description']||_0x1713f6[_0x1ed846(0x99)]!==_0x2635d2[_0x1ed846(0x99)]||_0x1713f6[_0x1ed846(0x9d)]!==_0x2635d2['status']||!_0x1713f6[_0x1ed846(0x85)]||!_0x1713f6[_0x1ed846(0x9c)]||!Object[_0x1ed846(0x75)](_0x1713f6['fileHashes'],SKILL_FILE))return undefined;for(const [_0x169369,_0xbf5757]of Object['entries'](_0x1713f6[_0x1ed846(0x9c)])){if(!/^[a-f0-9]{64}$/['test'](_0xbf5757))return undefined;const _0x483864=resolveManagedFilePath(_0x8c3e37,_0x169369);if(!existsSync(_0x483864)||!lstatSync(_0x483864)[_0x1ed846(0x86)]())return undefined;if(bufferSha256(readFileSync(_0x483864))!==_0xbf5757)return undefined;}return{'skill':_0x2635d2,'scope':_0x383221,'dir':_0x8c3e37,'skillMdPath':_0x57b02e,'metadataPath':_0xb99b17,'contentHash':_0x1713f6['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4307fe,_0x489535,_0x4acc06){const _0xa477ac=a157_0x482f,_0x5e99db=skillDisplayName(_0x489535,_0x4acc06),_0x4061f7=_0x489535[_0xa477ac(0x74)]?.['trim']()||_0x5e99db||_0x4acc06;return normalizeLocalFiles(_0x4307fe)['map'](_0x30f86f=>{const _0x848609=_0xa477ac,_0x20dc34=fileText(_0x30f86f);if(_0x30f86f['path']!==SKILL_FILE)return _0x30f86f;if(hasYamlFrontmatter(_0x20dc34))return{'path':_0x30f86f[_0x848609(0x78)],'content':withSyncedDisplayName(_0x20dc34,_0x5e99db)};return{'path':_0x30f86f[_0x848609(0x78)],'content':prependSkillFrontmatter(_0x20dc34,{'name':_0x4acc06,'displayName':_0x5e99db,'description':_0x4061f7})};});}function hasYamlFrontmatter(_0x3061b2){return/^\uFEFF?---\s*\r?\n/['test'](_0x3061b2);}function prependSkillFrontmatter(_0x1a2fee,_0x2a221d){const _0x3d131d=a157_0x482f,_0x13e24f=_0x1a2fee['replace'](/^\uFEFF/,'');return[_0x3d131d(0x9f),'name:\x20'+yamlString(_0x2a221d[_0x3d131d(0x7e)]),_0x2a221d[_0x3d131d(0xa1)]?_0x3d131d(0xa5)+yamlString(_0x2a221d[_0x3d131d(0xa1)]):undefined,_0x3d131d(0x82)+yamlString(_0x2a221d[_0x3d131d(0x74)]),'---','',_0x13e24f][_0x3d131d(0x93)](_0x9709c5=>_0x9709c5!==undefined)[_0x3d131d(0x95)]('\x0a');}function yamlString(_0x495d71){return JSON['stringify'](_0x495d71['replace'](/\r/g,'')['trim']());}function skillDisplayName(_0x28dd60,_0x8a8e3d){const _0x2ca564=_0x28dd60['skillName']?.['trim']();return _0x2ca564||_0x8a8e3d;}function withSyncedDisplayName(_0x1f27c3,_0x1ca207){const _0x260e38=a157_0x482f,_0x184c9f=_0x1f27c3['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x184c9f)return _0x1f27c3;const _0x2341a0=_0x184c9f[0x1]??'',_0x5ccef0=_0x184c9f[0x2]??'',_0x192574=parseDocument(_0x5ccef0);if(_0x192574[_0x260e38(0x90)][_0x260e38(0x7d)]>0x0||!isMap(_0x192574[_0x260e38(0x77)]))return _0x1f27c3;if(_0x1ca207)_0x192574[_0x260e38(0x7a)](_0x260e38(0xa1),_0x1ca207);else{if(_0x192574[_0x260e38(0xa8)](_0x260e38(0xa1)))_0x192574[_0x260e38(0x84)]('displayName');else return _0x1f27c3;}forceBlockCollections(_0x192574['contents']);const _0x4612a7=_0x192574[_0x260e38(0x7b)]({'lineWidth':0x0})[_0x260e38(0x76)](),_0x56b0e8=_0x1f27c3['slice'](_0x184c9f[0x0][_0x260e38(0x7d)])['replace'](/^\r?\n/,'');return _0x2341a0+'---\x0a'+_0x4612a7+_0x260e38(0x8c)+_0x56b0e8;}function forceBlockCollections(_0x381ee6){if(!isNode(_0x381ee6))return;visit(_0x381ee6,(_0x1d30ef,_0x2c137a)=>{const _0x3ebdb7=a157_0x482f;isCollection(_0x2c137a)&&(_0x2c137a[_0x3ebdb7(0xa9)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x14afde,_0x344aeb,_0x4305da,_0x2976f8){const _0x44344b=a157_0x482f;if(_0x2976f8||!existsSync(_0x344aeb))return;const _0x42e39d=readMetadataIfPresent(_0x344aeb);if(!_0x42e39d)return;const _0x20f56d=_0x42e39d[_0x44344b(0x9c)]&&Object[_0x44344b(0x91)](_0x42e39d['fileHashes'])['length']>0x0?_0x42e39d[_0x44344b(0x9c)]:undefined;if(_0x20f56d)for(const [_0x23657f,_0x483ee9]of Object[_0x44344b(0x9e)](_0x20f56d)){const _0x20de67=resolveManagedFilePath(_0x14afde,_0x23657f);if(!existsSync(_0x20de67))throw CliErrors[_0x44344b(0x73)](_0x44344b(0x8b)+_0x14afde,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x23657f);const _0x4c5bdc=lstatSync(_0x20de67);if(!_0x4c5bdc[_0x44344b(0x86)]())throw CliErrors[_0x44344b(0x73)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x14afde,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x23657f);const _0x546364=bufferSha256(readFileSync(_0x20de67));if(_0x546364!==_0x483ee9)throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x14afde+_0x44344b(0xaa)+_0x23657f,_0x44344b(0x81)+_0x23657f);}else{const _0x5a3ec1=resolve(_0x14afde,SKILL_FILE);if(existsSync(_0x5a3ec1)&&_0x42e39d[_0x44344b(0x85)]){const _0x575a40=contentHash(readFileSync(_0x5a3ec1,_0x44344b(0x87)));if(_0x575a40!==_0x42e39d[_0x44344b(0x85)])throw CliErrors[_0x44344b(0x73)](_0x44344b(0x80)+_0x5a3ec1,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x30c093 of normalizeLocalFiles(_0x4305da)){if(_0x20f56d?.[_0x30c093[_0x44344b(0x78)]])continue;if(!_0x20f56d&&_0x30c093[_0x44344b(0x78)]===SKILL_FILE)continue;const _0x4fec02=resolveManagedFilePath(_0x14afde,_0x30c093[_0x44344b(0x78)]);if(!existsSync(_0x4fec02))continue;const _0x6a64a0=lstatSync(_0x4fec02);if(!_0x6a64a0['isFile']())throw CliErrors['validation'](_0x44344b(0x8b)+_0x14afde,_0x44344b(0x89)+_0x30c093[_0x44344b(0x78)]);const _0x1050ee=bufferSha256(readFileSync(_0x4fec02));if(_0x1050ee!==fileHash(_0x30c093))throw CliErrors[_0x44344b(0x73)](_0x44344b(0x8b)+_0x14afde,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x30c093[_0x44344b(0x78)]);}}function materializeFiles(_0x206afa,_0x4cc908){const _0x44be1d=a157_0x482f;for(const _0x341df5 of normalizeLocalFiles(_0x4cc908)){const _0x567631=resolveManagedFilePath(_0x206afa,_0x341df5[_0x44be1d(0x78)]);mkdirSync(dirname(_0x567631),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x567631,fileContent(_0x341df5),0x180);}}function removeStaleManagedFiles(_0x184027,_0x3175e4,_0xdee6e9){const _0x5e0080=a157_0x482f;if(!_0x3175e4)return;const _0x3f631a=new Set(normalizeLocalFiles(_0xdee6e9)[_0x5e0080(0xa3)](_0x3dab6d=>_0x3dab6d[_0x5e0080(0x78)]));for(const _0xd0a7ff of Object['keys'](_0x3175e4)){if(_0x3f631a['has'](_0xd0a7ff))continue;const _0x9fa248=resolveManagedFilePath(_0x184027,_0xd0a7ff);existsSync(_0x9fa248)&&lstatSync(_0x9fa248)['isFile']()&&rmSync(_0x9fa248,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ffa4f,_0x49baba){const _0x554152=a158_0xbbc2,_0xb22440=_0x3ffa4f();while(!![]){try{const _0x489778=-parseInt(_0x554152(0x131))/0x1+parseInt(_0x554152(0x11a))/0x2*(-parseInt(_0x554152(0x125))/0x3)+parseInt(_0x554152(0x12f))/0x4+-parseInt(_0x554152(0x129))/0x5+-parseInt(_0x554152(0x122))/0x6+parseInt(_0x554152(0x12c))/0x7+parseInt(_0x554152(0x116))/0x8;if(_0x489778===_0x49baba)break;else _0xb22440['push'](_0xb22440['shift']());}catch(_0x1bec13){_0xb22440['push'](_0xb22440['shift']());}}}(a158_0x4cd6,0xc4076));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a158_0xbbc2(_0x2b9bb3,_0x363073){_0x2b9bb3=_0x2b9bb3-0x116;const _0x4cd65b=a158_0x4cd6();let _0xbbc26b=_0x4cd65b[_0x2b9bb3];return _0xbbc26b;}import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x1b65c7,_0x2aa448,_0x12d63a,_0x5760f7,_0x3058d4,_0x347ab5,_0x18aa00){const _0x778e6a=a158_0xbbc2,_0x536c6a=_0x347ab5?normalizeLocalFiles(_0x347ab5):[],_0xc6a67e=!_0x18aa00&&_0x536c6a[_0x778e6a(0x132)]>0x0?buildSkillPackage(_0x536c6a):undefined,_0x3a7385=_0x18aa00?bufferSha256(_0x18aa00):_0xc6a67e?.[_0x778e6a(0x11d)][_0x778e6a(0x119)],_0x37180f=_0x18aa00?.[_0x778e6a(0x132)]??_0xc6a67e?.['manifest']['zipSize'],_0x4b4040=_0x536c6a[_0x778e6a(0x132)]>0x0?Object['fromEntries'](_0x536c6a[_0x778e6a(0x12e)](_0x163ab9=>[_0x163ab9['path'],fileHash(_0x163ab9)])):undefined;return{'schemaVersion':_0x536c6a[_0x778e6a(0x132)]>0x0?0x2:0x1,'id':_0x1b65c7['id'],'appCode':_0x12d63a,'skillCode':requireSkillCode(_0x1b65c7),'skillName':_0x1b65c7['skillName'],'description':_0x1b65c7['description'],'example':_0x1b65c7[_0x778e6a(0x11b)],'scope':_0x2aa448,'readonly':_0x2aa448!=='personal'||_0x1b65c7[_0x778e6a(0x126)]===!![],'tenantCode':_0x1b65c7[_0x778e6a(0x117)],'userId':_0x1b65c7[_0x778e6a(0x11f)],'version':_0x1b65c7['version'],'status':_0x1b65c7['status'],'tags':Array[_0x778e6a(0x133)](_0x1b65c7[_0x778e6a(0x12a)])?_0x1b65c7['tags']:[],'hasUpstreamUpdate':_0x1b65c7[_0x778e6a(0x123)],'forkedFromSkillId':_0x1b65c7['forkedFromSkillId'],'forkedFromVersion':_0x1b65c7[_0x778e6a(0x118)],'sourceSessionId':_0x1b65c7[_0x778e6a(0x11e)],'contentHash':_0x5760f7,'fileHashes':_0x4b4040,'treeHash':_0x536c6a[_0x778e6a(0x132)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x536c6a)):undefined,'ossPath':remoteManifestOssPath(_0x1b65c7['files']),'zipSha256':_0x3a7385,'zipSize':_0x37180f,'files':_0x536c6a[_0x778e6a(0x132)]>0x0?_0x536c6a[_0x778e6a(0x12e)](_0x1f500f=>({'path':_0x1f500f[_0x778e6a(0x121)],'hash':fileHash(_0x1f500f),'size':fileContent(_0x1f500f)['length']})):undefined,'pulledAt':_0x3058d4??new Date()[_0x778e6a(0x130)]()};}export function requireSkillCode(_0x168e02){const _0x417d51=a158_0xbbc2,_0xdef41d=_0x168e02[_0x417d51(0x11c)]?.[_0x417d51(0x135)]();if(!_0xdef41d)throw CliErrors[_0x417d51(0x124)](_0x417d51(0x134));return _0xdef41d;}function a158_0x4cd6(){const _0x1a8dc9=['ossPath','path','5266308xfMxJF','hasUpstreamUpdate','validation','3TgFoeK','readonly','utf8','object','5471350JJOsBH','tags','parse','1474977RQuFpA','string','map','4946252LrKJka','toISOString','623280WpDDxP','length','isArray','Runtime\x20Skill\x20is\x20missing\x20skillCode.','trim','16624088LxXWAS','tenantCode','forkedFromVersion','zipSha256','254166NsQWRr','example','skillCode','manifest','sourceSessionId','userId'];a158_0x4cd6=function(){return _0x1a8dc9;};return a158_0x4cd6();}export function readMetadataIfPresent(_0x1581b0){const _0x4111dc=a158_0xbbc2;if(!existsSync(_0x1581b0))return undefined;try{const _0xeb4bb9=JSON[_0x4111dc(0x12b)](readFileSync(_0x1581b0,_0x4111dc(0x127)));return _0xeb4bb9;}catch{throw CliErrors[_0x4111dc(0x124)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x1581b0);}}function remoteManifestOssPath(_0x77b9fc){const _0x2bd6bf=a158_0xbbc2;if(!_0x77b9fc||typeof _0x77b9fc!==_0x2bd6bf(0x128)||Array['isArray'](_0x77b9fc))return undefined;const _0x1d1389=_0x77b9fc[_0x2bd6bf(0x120)];return typeof _0x1d1389===_0x2bd6bf(0x12d)&&_0x1d1389[_0x2bd6bf(0x135)]()?_0x1d1389[_0x2bd6bf(0x135)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a159_0x2aa850=a159_0x3d32;(function(_0x40572d,_0x34bcda){const _0x290a89=a159_0x3d32,_0x4007b1=_0x40572d();while(!![]){try{const _0x4c8bf4=parseInt(_0x290a89(0x184))/0x1*(-parseInt(_0x290a89(0x18d))/0x2)+parseInt(_0x290a89(0x189))/0x3+-parseInt(_0x290a89(0x186))/0x4+parseInt(_0x290a89(0x195))/0x5+parseInt(_0x290a89(0x192))/0x6+-parseInt(_0x290a89(0x18e))/0x7+parseInt(_0x290a89(0x19b))/0x8*(parseInt(_0x290a89(0x191))/0x9);if(_0x4c8bf4===_0x34bcda)break;else _0x4007b1['push'](_0x4007b1['shift']());}catch(_0x2f0c98){_0x4007b1['push'](_0x4007b1['shift']());}}}(a159_0x2024,0xade2b));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x313724={}){const _0xd23c70=a159_0x3d32,_0x42030d=_0x313724[_0xd23c70(0x199)]??homedir(),_0x3e7d83=resolve(_0x42030d,PRODUCT_CONFIG[_0xd23c70(0x193)],_0xd23c70(0x185)),_0xaff057=trimmedEnv(_0xd23c70(0x18c)),_0x24b84c=trimmedEnv(_0xd23c70(0x18b)),_0x26423b=resolve(_0x42030d,_0xd23c70(0x198)),_0x2aebf2=_0x313724[_0xd23c70(0x18a)]??(existsSync(_0x26423b)?resolve(_0x26423b,'skills'):undefined);return{'homeDir':_0x42030d,'cacheRoot':_0x3e7d83,'managedRoot':resolve(_0x42030d,PRODUCT_CONFIG[_0xd23c70(0x193)]),'agentsSkillsDir':_0x313724[_0xd23c70(0x19d)]??_0xaff057??resolve(_0x42030d,_0xd23c70(0x190),'skills'),'claudeSkillsDir':_0x313724[_0xd23c70(0x187)]??_0x24b84c??resolve(_0x42030d,_0xd23c70(0x194),_0xd23c70(0x18f)),'workbuddySkillsDir':_0x2aebf2};}function a159_0x2024(){const _0x1c9837=['filter','3171270OjsamD','workbuddySkillsDir','CLAUDE_SKILL_ROOT','SKILL_ROOT','2DEpQHM','8360884GkDhZv','skills','.agents','5328ejIENA','3716766EcNjmS','homeDirName','.claude','1404550tAwgyH','\x20for\x20local\x20path:\x20','skillCode','.workbuddy','homeDir','Unsafe\x20','13096RZVojR','path\x20segment','agentsSkillsDir','validation','927683RtFpWR','cache','368940LkvHss','claudeSkillsDir'];a159_0x2024=function(){return _0x1c9837;};return a159_0x2024();}function a159_0x3d32(_0x1f3a93,_0x329bef){_0x1f3a93=_0x1f3a93-0x183;const _0x202454=a159_0x2024();let _0x3d3249=_0x202454[_0x1f3a93];return _0x3d3249;}export function runtimeAgentSkillRoots(_0x21a6eb){const _0x144372=a159_0x3d32;return[_0x21a6eb[_0x144372(0x19d)],_0x21a6eb[_0x144372(0x187)],_0x21a6eb['workbuddySkillsDir']][_0x144372(0x188)](_0x28cffd=>Boolean(_0x28cffd));}export function getRuntimeSkillCacheRoot(_0xdb480c,_0x42083c,_0x13ab36={}){const _0x563783=a159_0x3d32,_0x1334ef=resolveSkillSyncPaths(_0x13ab36);return resolve(_0x1334ef['cacheRoot'],_0xdb480c,fingerprintAccessKey(_0x42083c),_0x563783(0x18f));}export function getRuntimeSkillDir(_0x37b15f,_0x5bb966,_0xf31ece,_0xa2bf71,_0x257ad6,_0x586e84={}){const _0x500547=a159_0x3d32;return resolve(getRuntimeSkillCacheRoot(_0x37b15f,_0x5bb966,_0x586e84),safePathSegment(_0xf31ece,'appCode'),_0xa2bf71,safePathSegment(_0x257ad6,_0x500547(0x197)));}export function safePathSegment(_0x377688,_0x45a052=a159_0x2aa850(0x19c)){const _0x536baf=a159_0x2aa850;if(!_0x377688||_0x377688['includes']('/')||_0x377688['includes']('\x5c')||_0x377688['includes']('..'))throw CliErrors[_0x536baf(0x183)](_0x536baf(0x19a)+_0x45a052+_0x536baf(0x196)+_0x377688);return _0x377688;}function trimmedEnv(_0x1ad7cc){const _0x416880=productEnv(_0x1ad7cc)?.['trim']();return _0x416880?_0x416880:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xf09fa5,_0x199e55){const _0x39e474=a159_0x3db2,_0x3d83cf=_0xf09fa5();while(!![]){try{const _0x347f1f=parseInt(_0x39e474(0x1df))/0x1*(parseInt(_0x39e474(0x1da))/0x2)+-parseInt(_0x39e474(0x1c4))/0x3*(parseInt(_0x39e474(0x1d0))/0x4)+-parseInt(_0x39e474(0x1d3))/0x5+parseInt(_0x39e474(0x1d6))/0x6+-parseInt(_0x39e474(0x1bf))/0x7+parseInt(_0x39e474(0x1b4))/0x8+parseInt(_0x39e474(0x1a6))/0x9*(parseInt(_0x39e474(0x1e1))/0xa);if(_0x347f1f===_0x199e55)break;else _0x3d83cf['push'](_0x3d83cf['shift']());}catch(_0x5b809a){_0x3d83cf['push'](_0x3d83cf['shift']());}}}(a159_0x5987,0xc4596));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a159_0x5b8564}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';function a159_0x5987(){const _0x59dad8=['Skill\x20directory\x20not\x20found:\x20','\x20has\x20scope=\x22','skillCode','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','scope','skillName','pushedAt','32lacHIL','content','\x20has\x20unsupported\x20scope\x20\x22','1478500hBkxZF','version','trim','1558224XZLtfx','startsWith','isFile','ignoreMetadataSkillCode','15362sakjZj','boolean','dir','object','displayName','209YZahRE','personal','627130cmbFXE','some','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','(unknown)','Remote\x20Skill\x20','toLowerCase','153HwPArg','number','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','sourceSessionId','company','excludedFilePaths','metadata','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','targetScope','utf8','\x20name\x20for\x20SkillHub\x20slug\x20generation.','replace','validation','string','7782728jXEBaT','ignoreMetadataForPayload','isSymbolicLink','manifest','refreshedAt','example','tags','appCode','allowAppCodeRetarget','Invalid\x20','ignoreMetadataScope','8784727iUpzUC','Missing\x20','name','find','description','580908nZGwoI','files','ignoreInvalidMetadata','match','path'];a159_0x5987=function(){return _0x59dad8;};return a159_0x5987();}export function resolvePushDirectoryIdentity(_0x53892a,_0x33d234,_0x246664={}){const _0x1bc9ed=a159_0x3db2,_0x1d5303=resolvePushDirectoryRoot(_0x53892a),_0x5bca6d=readPushMetadataIfPresent(resolve(_0x1d5303,METADATA_FILE),{'ignoreInvalidMetadata':_0x246664[_0x1bc9ed(0x1c6)]});if(_0x5bca6d?.[_0x1bc9ed(0x1bb)]&&_0x5bca6d[_0x1bc9ed(0x1bb)]!==_0x33d234&&!_0x246664[_0x1bc9ed(0x1bc)]&&!_0x246664['ignoreMetadataAppCodeMismatch'])throw CliErrors['validation']('Skill\x20metadata\x20appCode\x20\x22'+_0x5bca6d[_0x1bc9ed(0x1bb)]+_0x1bc9ed(0x1a8)+_0x33d234+'\x22.');const _0x445e2b=resolvePushSkillCode(_0x1d5303,_0x33d234,_0x5bca6d,_0x246664);if(!_0x445e2b)throw CliErrors[_0x1bc9ed(0x1b2)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0x1d5303,'skillCode':_0x445e2b,'metadata':_0x5bca6d};}export function readPushDirectory(_0xed1380,_0xb3af8d,_0x1ea1e2={}){const _0x3f27b1=a159_0x3db2,_0x3b3186=resolvePushDirectoryIdentity(_0xed1380,_0xb3af8d,_0x1ea1e2),_0x391109=_0x3b3186[_0x3f27b1(0x1dc)],_0x5c6a63=resolve(_0x391109,SKILL_FILE);if(!existsSync(_0x5c6a63)||!lstatSync(_0x5c6a63)[_0x3f27b1(0x1d8)]())throw CliErrors[_0x3f27b1(0x1b2)](_0x3f27b1(0x1c0)+SKILL_FILE+':\x20'+_0x5c6a63);const _0x426e80=_0x3b3186[_0x3f27b1(0x1ac)],_0x836e36=_0x1ea1e2[_0x3f27b1(0x1ae)]??_0x3f27b1(0x1e0);if(!_0x1ea1e2[_0x3f27b1(0x1be)]&&_0x426e80?.[_0x3f27b1(0x1cd)]==='builtin')throw CliErrors['validation']('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x3f27b1(0x1ca)+_0x426e80[_0x3f27b1(0x1cd)]+'\x22.');if(!_0x1ea1e2[_0x3f27b1(0x1be)]&&_0x836e36==='personal'&&_0x426e80?.['scope']&&_0x426e80[_0x3f27b1(0x1cd)]!==_0x3f27b1(0x1e0))throw CliErrors[_0x3f27b1(0x1b2)](_0x3f27b1(0x1cc)+METADATA_FILE+_0x3f27b1(0x1ca)+_0x426e80['scope']+'\x22.',_0x3f27b1(0x1ad)+_0x391109+_0x3f27b1(0x1e3));const _0x548df3=scanSkillDirectory(_0x391109,{'excludedFilePaths':_0x1ea1e2[_0x3f27b1(0x1ab)]}),_0x43d6c1=buildSkillPackage(_0x548df3),_0x8b54b9=readFileSync(_0x5c6a63,'utf8'),_0x16ba01=_0x3b3186[_0x3f27b1(0x1cb)],_0x498d52=_0x1ea1e2[_0x3f27b1(0x1b5)]?undefined:_0x426e80,_0x514a34=readSkillDisplayName(_0x8b54b9);return{'skillCode':_0x16ba01,'metadata':_0x426e80,'frontmatterDisplayName':_0x514a34,'input':{'skillCode':_0x16ba01,'skillName':_0x514a34??_0x498d52?.[_0x3f27b1(0x1ce)],'description':_0x498d52?.['description'],'content':_0x8b54b9,'files':_0x43d6c1[_0x3f27b1(0x1b7)],'packageBase64':_0x43d6c1['packageBase64'],'tags':_0x498d52?.[_0x3f27b1(0x1ba)],'version':_0x498d52?.[_0x3f27b1(0x1d4)],'sourceSessionId':_0x498d52?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x1b362d,_0x500e02,_0xf3954a,_0x126f50={}){const _0x976c2c=a159_0x3db2,_0x1c8065=resolvePushDirectoryRoot(_0x1b362d),_0x42d6b8=readPushMetadataIfPresent(resolve(_0x1c8065,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x429122=requireRemoteScope(_0x500e02),_0x4fc4fb=readLocalSkillContent(_0x1c8065),_0x1124e2={..._0x500e02,'appCode':_0x500e02[_0x976c2c(0x1bb)]??_0xf3954a,'skillName':_0x500e02[_0x976c2c(0x1ce)]??_0x42d6b8?.[_0x976c2c(0x1ce)],'description':_0x500e02[_0x976c2c(0x1c3)]??_0x42d6b8?.[_0x976c2c(0x1c3)],'example':_0x500e02[_0x976c2c(0x1b9)]??_0x42d6b8?.['example'],'tags':Array['isArray'](_0x500e02[_0x976c2c(0x1ba)])?_0x500e02[_0x976c2c(0x1ba)]:_0x42d6b8?.[_0x976c2c(0x1ba)],'sourceSessionId':_0x500e02[_0x976c2c(0x1a9)]??_0x42d6b8?.[_0x976c2c(0x1a9)],'content':_0x500e02[_0x976c2c(0x1d1)]??_0x4fc4fb},_0x4cd892=buildMetadata(_0x1124e2,_0x429122,_0xf3954a,contentHash(_0x4fc4fb),_0x126f50[_0x976c2c(0x1b8)]);writeJsonAtomic(resolve(_0x1c8065,METADATA_FILE),_0x4cd892);}export function recordPushedRuntimeSkill(_0x21d929,_0x5adea4,_0x381681,_0x2088c1={}){const _0x11d677=a159_0x3db2,_0x533e84=resolvePushDirectoryRoot(_0x21d929),_0x52695d=scanSkillDirectory(_0x533e84),_0x4807be=_0x52695d[_0x11d677(0x1c2)](_0x4fe4c6=>_0x4fe4c6['path']===SKILL_FILE),_0x4d5667=_0x4807be?fileText(_0x4807be):'',_0x43a7ba=tryNormalizePackageManifest(_0x5adea4['files']),_0x154136={..._0x5adea4,'content':_0x5adea4['content']??_0x4d5667,'files':_0x43a7ba},_0x579848=_0x43a7ba?normalizeLocalFiles(_0x52695d)['filter'](_0x2dda08=>_0x43a7ba[_0x11d677(0x1c5)][_0x11d677(0x1e2)](_0x3b050a=>_0x3b050a['path']===_0x2dda08[_0x11d677(0x1c8)])):undefined,_0x4e1e09=buildMetadata(_0x154136,_0x2088c1[_0x11d677(0x1cd)]??_0x11d677(0x1e0),_0x381681,contentHash(_0x154136[_0x11d677(0x1d1)]??''),_0x2088c1[_0x11d677(0x1cf)],_0x579848);writeJsonAtomic(resolve(_0x533e84,METADATA_FILE),_0x4e1e09);}export function deriveSkillCodeFromDirectory(_0x4170b3,_0x35fb81){const _0x3d2cc6=a159_0x3db2,_0x80697d=basename(resolve(_0x4170b3)),_0x47fedb=_0x35fb81+'--';return _0x80697d[_0x3d2cc6(0x1d7)](_0x47fedb)?_0x80697d['slice'](_0x47fedb['length']):_0x80697d;}function resolvePushSkillCode(_0x4b6a4a,_0x47a9dc,_0x4185a1,_0x9ace86){const _0x28b588=a159_0x3db2,_0x46ec99=deriveSkillCodeFromSkillFile(_0x4b6a4a)||deriveSkillCodeFromDirectory(_0x4b6a4a,_0x47a9dc);if(_0x9ace86[_0x28b588(0x1d9)])return _0x46ec99;return _0x4185a1?.[_0x28b588(0x1cb)]?.[_0x28b588(0x1d5)]()||_0x46ec99;}function deriveSkillCodeFromSkillFile(_0x607a4c){const _0x35134d=a159_0x3db2,_0xca3e9b=resolve(_0x607a4c,SKILL_FILE);if(!existsSync(_0xca3e9b)||!lstatSync(_0xca3e9b)[_0x35134d(0x1d8)]())return undefined;const _0x1856ed=readFileSync(_0xca3e9b,_0x35134d(0x1af)),_0x5f270c=_0x1856ed[_0x35134d(0x1c7)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5f270c)return undefined;const _0x4d256b=parseFrontmatterObject(_0x5f270c[0x1]??''),_0x10969f=scalarToString(_0x4d256b?.[_0x35134d(0x1c1)]);return _0x10969f?slugifySkillName(_0x10969f):undefined;}function readSkillDisplayName(_0x1f62a4){const _0x36aa0e=a159_0x3db2,_0x459253=_0x1f62a4[_0x36aa0e(0x1c7)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x459253)return undefined;const _0x2a097f=parseFrontmatterObject(_0x459253[0x1]??'');return scalarToString(_0x2a097f?.[_0x36aa0e(0x1de)]);}function slugifySkillName(_0x2ad0f7){const _0x14147b=a159_0x3db2,_0x409fa4=_0x2ad0f7['trim']()[_0x14147b(0x1a5)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x14147b(0x1b1)](/^-+/,'')[_0x14147b(0x1b1)](/-+$/,'')[_0x14147b(0x1b1)](/-{2,}/g,'-');if(!_0x409fa4)throw CliErrors[_0x14147b(0x1b2)](_0x14147b(0x1bd)+SKILL_FILE+_0x14147b(0x1b0));return _0x409fa4;}function a159_0x3db2(_0x46a313,_0x25d0da){_0x46a313=_0x46a313-0x1a4;const _0x59875b=a159_0x5987();let _0x3db241=_0x59875b[_0x46a313];return _0x3db241;}function parseFrontmatterObject(_0x84817f){const _0x2beec5=a159_0x3db2;try{const _0x43e041=a159_0x5b8564(_0x84817f);return _0x43e041&&typeof _0x43e041===_0x2beec5(0x1dd)&&!Array['isArray'](_0x43e041)?_0x43e041:undefined;}catch{return undefined;}}function scalarToString(_0x200919){const _0x4246a6=a159_0x3db2;if(typeof _0x200919===_0x4246a6(0x1b3))return _0x200919[_0x4246a6(0x1d5)]();if(typeof _0x200919===_0x4246a6(0x1a7)||typeof _0x200919===_0x4246a6(0x1db))return String(_0x200919);return undefined;}function resolvePushDirectoryRoot(_0x3d22b2){const _0xec9085=a159_0x3db2,_0x474eab=resolve(_0x3d22b2);if(!existsSync(_0x474eab))throw CliErrors['validation'](_0xec9085(0x1c9)+_0x3d22b2);const _0x2d6dfc=lstatSync(_0x474eab);if(_0x2d6dfc['isDirectory']())return _0x474eab;if(_0x2d6dfc[_0xec9085(0x1b6)]()){const _0x5b9b93=realpathSync(_0x474eab);if(lstatSync(_0x5b9b93)['isDirectory']())return _0x5b9b93;}throw CliErrors[_0xec9085(0x1b2)](_0xec9085(0x1c9)+_0x3d22b2);}function requireRemoteScope(_0x428d0e){const _0x18ded4=a159_0x3db2;if(_0x428d0e[_0x18ded4(0x1cd)]===_0x18ded4(0x1e0)||_0x428d0e['scope']===_0x18ded4(0x1aa)||_0x428d0e['scope']==='builtin')return _0x428d0e[_0x18ded4(0x1cd)];throw CliErrors[_0x18ded4(0x1b2)](_0x18ded4(0x1a4)+(_0x428d0e[_0x18ded4(0x1cb)]||_0x18ded4(0x1e4))+_0x18ded4(0x1d2)+(_0x428d0e['scope']??'unknown')+'\x22.');}function readLocalSkillContent(_0x3428eb){const _0x6e12d8=a159_0x3db2,_0x2f07f5=resolve(_0x3428eb,SKILL_FILE);return existsSync(_0x2f07f5)&&lstatSync(_0x2f07f5)[_0x6e12d8(0x1d8)]()?readFileSync(_0x2f07f5,_0x6e12d8(0x1af)):'';}function readPushMetadataIfPresent(_0x1975e0,_0x3f3f50={}){const _0x5dce54=a159_0x3db2;try{return readMetadataIfPresent(_0x1975e0);}catch(_0x12db9f){if(_0x3f3f50[_0x5dce54(0x1c6)])return undefined;throw _0x12db9f;}}
|
|
1
|
+
(function(_0x519097,_0x3128e4){const _0x4618dd=a160_0x5b09,_0x136c30=_0x519097();while(!![]){try{const _0x5aafbd=-parseInt(_0x4618dd(0x1cb))/0x1*(parseInt(_0x4618dd(0x1f0))/0x2)+parseInt(_0x4618dd(0x1e3))/0x3*(parseInt(_0x4618dd(0x1c8))/0x4)+parseInt(_0x4618dd(0x1db))/0x5+-parseInt(_0x4618dd(0x1bd))/0x6+parseInt(_0x4618dd(0x1f9))/0x7+parseInt(_0x4618dd(0x1eb))/0x8+parseInt(_0x4618dd(0x1ed))/0x9;if(_0x5aafbd===_0x3128e4)break;else _0x136c30['push'](_0x136c30['shift']());}catch(_0x20377b){_0x136c30['push'](_0x136c30['shift']());}}}(a160_0x5cda,0x93727));function a160_0x5b09(_0x1fe1d7,_0x704082){_0x1fe1d7=_0x1fe1d7-0x1bd;const _0x5cda91=a160_0x5cda();let _0x5b09db=_0x5cda91[_0x1fe1d7];return _0x5b09db;}import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a160_0x4bfce9}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a160_0x5cda(){const _0x2eedf3=['string','targetScope','name','1267288oAzLKt','number','3143286xHMBVw','ignoreInvalidMetadata','builtin','46ZDzDZX','sourceSessionId','ignoreMetadataForPayload','personal','skillName','path','example','pushedAt','\x20name\x20for\x20SkillHub\x20slug\x20generation.','2607801zZAWZl','toLowerCase','boolean','5108718PZXBTZ','some','isFile','validation','packageBase64','ignoreMetadataScope','dir','replace','object','ignoreMetadataSkillCode','(unknown)','4SmuBrG','isSymbolicLink','utf8','39646KbnNJk','Remote\x20Skill\x20','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','Skill\x20directory\x20not\x20found:\x20','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','displayName','ignoreMetadataAppCodeMismatch','match','description','isDirectory','Unable\x20to\x20resolve\x20skillCode\x20from\x20','Missing\x20','find','\x20has\x20unsupported\x20scope\x20\x22','scope','trim','3259295NClCHP','tags','slice','length','isArray','skillCode','unknown',',\x20or\x20directory\x20name.','2505561tKwYRy','startsWith','appCode','content','files'];a160_0x5cda=function(){return _0x2eedf3;};return a160_0x5cda();}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(_0x71e2fe,_0x5d9aae,_0x5d4568={}){const _0x5b4630=a160_0x5b09,_0x5263a7=resolvePushDirectoryRoot(_0x71e2fe),_0x3c499f=readPushMetadataIfPresent(resolve(_0x5263a7,METADATA_FILE),{'ignoreInvalidMetadata':_0x5d4568[_0x5b4630(0x1ee)]});if(_0x3c499f?.[_0x5b4630(0x1e5)]&&_0x3c499f[_0x5b4630(0x1e5)]!==_0x5d9aae&&!_0x5d4568['allowAppCodeRetarget']&&!_0x5d4568[_0x5b4630(0x1d1)])throw CliErrors['validation']('Skill\x20metadata\x20appCode\x20\x22'+_0x3c499f['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x5d9aae+'\x22.');const _0x36ef46=resolvePushSkillCode(_0x5263a7,_0x5d9aae,_0x3c499f,_0x5d4568);if(!_0x36ef46)throw CliErrors['validation'](_0x5b4630(0x1d5)+SKILL_FILE+',\x20'+METADATA_FILE+_0x5b4630(0x1e2));return{'dir':_0x5263a7,'skillCode':_0x36ef46,'metadata':_0x3c499f};}export function readPushDirectory(_0x52d0d8,_0x55db40,_0x30b84f={}){const _0x252771=a160_0x5b09,_0x2968a5=resolvePushDirectoryIdentity(_0x52d0d8,_0x55db40,_0x30b84f),_0x488571=_0x2968a5[_0x252771(0x1c3)],_0x1dcc72=resolve(_0x488571,SKILL_FILE);if(!existsSync(_0x1dcc72)||!lstatSync(_0x1dcc72)[_0x252771(0x1bf)]())throw CliErrors[_0x252771(0x1c0)](_0x252771(0x1d6)+SKILL_FILE+':\x20'+_0x1dcc72);const _0xdc79bc=_0x2968a5['metadata'],_0x120df0=_0x30b84f[_0x252771(0x1e9)]??_0x252771(0x1f3);if(!_0x30b84f[_0x252771(0x1c2)]&&_0xdc79bc?.['scope']===_0x252771(0x1ef))throw CliErrors[_0x252771(0x1c0)](_0x252771(0x1cf)+METADATA_FILE+'\x20has\x20scope=\x22'+_0xdc79bc[_0x252771(0x1d9)]+'\x22.');if(!_0x30b84f[_0x252771(0x1c2)]&&_0x120df0===_0x252771(0x1f3)&&_0xdc79bc?.['scope']&&_0xdc79bc[_0x252771(0x1d9)]!==_0x252771(0x1f3))throw CliErrors[_0x252771(0x1c0)](_0x252771(0x1cd)+METADATA_FILE+'\x20has\x20scope=\x22'+_0xdc79bc['scope']+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x488571+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x3a8df3=scanSkillDirectory(_0x488571,{'excludedFilePaths':_0x30b84f['excludedFilePaths']}),_0x2e8c49=buildSkillPackage(_0x3a8df3),_0xd49a49=readFileSync(_0x1dcc72,'utf8'),_0x1cc794=_0x2968a5[_0x252771(0x1e0)],_0xd5d2f6=_0x30b84f[_0x252771(0x1f2)]?undefined:_0xdc79bc,_0x509f60=readSkillDisplayName(_0xd49a49);return{'skillCode':_0x1cc794,'metadata':_0xdc79bc,'frontmatterDisplayName':_0x509f60,'input':{'skillCode':_0x1cc794,'skillName':_0x509f60??_0xd5d2f6?.['skillName'],'description':_0xd5d2f6?.[_0x252771(0x1d3)],'content':_0xd49a49,'files':_0x2e8c49['manifest'],'packageBase64':_0x2e8c49[_0x252771(0x1c1)],'tags':_0xd5d2f6?.['tags'],'version':_0xd5d2f6?.['version'],'sourceSessionId':_0xd5d2f6?.[_0x252771(0x1f1)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x5a620d,_0x5f4160,_0x2f21b2,_0x183c92={}){const _0x598f06=a160_0x5b09,_0x7a9b61=resolvePushDirectoryRoot(_0x5a620d),_0x296ffa=readPushMetadataIfPresent(resolve(_0x7a9b61,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x119803=requireRemoteScope(_0x5f4160),_0x44f5e1=readLocalSkillContent(_0x7a9b61),_0x98b50a={..._0x5f4160,'appCode':_0x5f4160['appCode']??_0x2f21b2,'skillName':_0x5f4160[_0x598f06(0x1f4)]??_0x296ffa?.[_0x598f06(0x1f4)],'description':_0x5f4160[_0x598f06(0x1d3)]??_0x296ffa?.[_0x598f06(0x1d3)],'example':_0x5f4160['example']??_0x296ffa?.[_0x598f06(0x1f6)],'tags':Array[_0x598f06(0x1df)](_0x5f4160[_0x598f06(0x1dc)])?_0x5f4160[_0x598f06(0x1dc)]:_0x296ffa?.['tags'],'sourceSessionId':_0x5f4160['sourceSessionId']??_0x296ffa?.[_0x598f06(0x1f1)],'content':_0x5f4160[_0x598f06(0x1e6)]??_0x44f5e1},_0x3a39a1=buildMetadata(_0x98b50a,_0x119803,_0x2f21b2,contentHash(_0x44f5e1),_0x183c92['refreshedAt']);writeJsonAtomic(resolve(_0x7a9b61,METADATA_FILE),_0x3a39a1);}export function recordPushedRuntimeSkill(_0x793179,_0x566e44,_0x5d093e,_0x15fd8d={}){const _0x909a62=a160_0x5b09,_0x18020e=resolvePushDirectoryRoot(_0x793179),_0xc6067f=scanSkillDirectory(_0x18020e),_0x3a9ce0=_0xc6067f[_0x909a62(0x1d7)](_0x5f109f=>_0x5f109f[_0x909a62(0x1f5)]===SKILL_FILE),_0xea6a8a=_0x3a9ce0?fileText(_0x3a9ce0):'',_0x2f97d3=tryNormalizePackageManifest(_0x566e44[_0x909a62(0x1e7)]),_0xd8e5e9={..._0x566e44,'content':_0x566e44[_0x909a62(0x1e6)]??_0xea6a8a,'files':_0x2f97d3},_0x52ed02=_0x2f97d3?normalizeLocalFiles(_0xc6067f)['filter'](_0x26d9ae=>_0x2f97d3[_0x909a62(0x1e7)][_0x909a62(0x1be)](_0x431697=>_0x431697['path']===_0x26d9ae['path'])):undefined,_0x3fe55f=buildMetadata(_0xd8e5e9,_0x15fd8d[_0x909a62(0x1d9)]??'personal',_0x5d093e,contentHash(_0xd8e5e9['content']??''),_0x15fd8d[_0x909a62(0x1f7)],_0x52ed02);writeJsonAtomic(resolve(_0x18020e,METADATA_FILE),_0x3fe55f);}export function deriveSkillCodeFromDirectory(_0x461f51,_0xd0a6ef){const _0x4d4f3f=a160_0x5b09,_0x189731=basename(resolve(_0x461f51)),_0x437180=_0xd0a6ef+'--';return _0x189731[_0x4d4f3f(0x1e4)](_0x437180)?_0x189731[_0x4d4f3f(0x1dd)](_0x437180[_0x4d4f3f(0x1de)]):_0x189731;}function resolvePushSkillCode(_0x47c8e6,_0x1d85c2,_0x3127be,_0x2d170d){const _0x50d038=a160_0x5b09,_0xbb28bd=deriveSkillCodeFromSkillFile(_0x47c8e6)||deriveSkillCodeFromDirectory(_0x47c8e6,_0x1d85c2);if(_0x2d170d[_0x50d038(0x1c6)])return _0xbb28bd;return _0x3127be?.['skillCode']?.[_0x50d038(0x1da)]()||_0xbb28bd;}function deriveSkillCodeFromSkillFile(_0x2c3cd4){const _0x2bc3e6=a160_0x5b09,_0x44aea7=resolve(_0x2c3cd4,SKILL_FILE);if(!existsSync(_0x44aea7)||!lstatSync(_0x44aea7)[_0x2bc3e6(0x1bf)]())return undefined;const _0x261c87=readFileSync(_0x44aea7,_0x2bc3e6(0x1ca)),_0x31d26a=_0x261c87[_0x2bc3e6(0x1d2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x31d26a)return undefined;const _0x574f0a=parseFrontmatterObject(_0x31d26a[0x1]??''),_0x477a21=scalarToString(_0x574f0a?.[_0x2bc3e6(0x1ea)]);return _0x477a21?slugifySkillName(_0x477a21):undefined;}function readSkillDisplayName(_0x4ad7cd){const _0x4ea083=a160_0x5b09,_0x10f8d8=_0x4ad7cd[_0x4ea083(0x1d2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x10f8d8)return undefined;const _0x1e20bf=parseFrontmatterObject(_0x10f8d8[0x1]??'');return scalarToString(_0x1e20bf?.[_0x4ea083(0x1d0)]);}function slugifySkillName(_0x343f13){const _0x3f368d=a160_0x5b09,_0x5ee0e3=_0x343f13[_0x3f368d(0x1da)]()[_0x3f368d(0x1fa)]()[_0x3f368d(0x1c4)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x3f368d(0x1c4)](/^-+/,'')['replace'](/-+$/,'')[_0x3f368d(0x1c4)](/-{2,}/g,'-');if(!_0x5ee0e3)throw CliErrors[_0x3f368d(0x1c0)]('Invalid\x20'+SKILL_FILE+_0x3f368d(0x1f8));return _0x5ee0e3;}function parseFrontmatterObject(_0x4b507a){const _0x3e0440=a160_0x5b09;try{const _0x33dd27=a160_0x4bfce9(_0x4b507a);return _0x33dd27&&typeof _0x33dd27===_0x3e0440(0x1c5)&&!Array[_0x3e0440(0x1df)](_0x33dd27)?_0x33dd27:undefined;}catch{return undefined;}}function scalarToString(_0x390be1){const _0x5b7039=a160_0x5b09;if(typeof _0x390be1===_0x5b7039(0x1e8))return _0x390be1[_0x5b7039(0x1da)]();if(typeof _0x390be1===_0x5b7039(0x1ec)||typeof _0x390be1===_0x5b7039(0x1fb))return String(_0x390be1);return undefined;}function resolvePushDirectoryRoot(_0x2aec4c){const _0x208ca5=a160_0x5b09,_0x48b9fa=resolve(_0x2aec4c);if(!existsSync(_0x48b9fa))throw CliErrors['validation'](_0x208ca5(0x1ce)+_0x2aec4c);const _0x5eac01=lstatSync(_0x48b9fa);if(_0x5eac01[_0x208ca5(0x1d4)]())return _0x48b9fa;if(_0x5eac01[_0x208ca5(0x1c9)]()){const _0x177dda=realpathSync(_0x48b9fa);if(lstatSync(_0x177dda)[_0x208ca5(0x1d4)]())return _0x177dda;}throw CliErrors[_0x208ca5(0x1c0)]('Skill\x20directory\x20not\x20found:\x20'+_0x2aec4c);}function requireRemoteScope(_0x3ba88c){const _0x13213b=a160_0x5b09;if(_0x3ba88c[_0x13213b(0x1d9)]==='personal'||_0x3ba88c[_0x13213b(0x1d9)]==='company'||_0x3ba88c[_0x13213b(0x1d9)]==='builtin')return _0x3ba88c[_0x13213b(0x1d9)];throw CliErrors[_0x13213b(0x1c0)](_0x13213b(0x1cc)+(_0x3ba88c[_0x13213b(0x1e0)]||_0x13213b(0x1c7))+_0x13213b(0x1d8)+(_0x3ba88c['scope']??_0x13213b(0x1e1))+'\x22.');}function readLocalSkillContent(_0x4f2901){const _0x10db26=a160_0x5b09,_0x7996f6=resolve(_0x4f2901,SKILL_FILE);return existsSync(_0x7996f6)&&lstatSync(_0x7996f6)['isFile']()?readFileSync(_0x7996f6,_0x10db26(0x1ca)):'';}function readPushMetadataIfPresent(_0x2da55e,_0xc6c4ab={}){try{return readMetadataIfPresent(_0x2da55e);}catch(_0x137b09){if(_0xc6c4ab['ignoreInvalidMetadata'])return undefined;throw _0x137b09;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a161_0x3d27(){const _0x13c160=['552008PBCQgY','validation','3wPBIEm','27CZxVrX','personal','Unsupported\x20runtime\x20Skill\x20scope:\x20','2382335YcgJjK','includes','1duQeeM','306355oJIREw','3577892KbHFIG','4165554XxSuaX','12898336ICFUBN','push','477290TyyHXd','company','length'];a161_0x3d27=function(){return _0x13c160;};return a161_0x3d27();}(function(_0x3ed027,_0x59ead8){const _0x3a3b3a=a161_0x38f1,_0x1efc31=_0x3ed027();while(!![]){try{const _0x34f945=-parseInt(_0x3a3b3a(0x158))/0x1*(-parseInt(_0x3a3b3a(0x150))/0x2)+-parseInt(_0x3a3b3a(0x152))/0x3*(-parseInt(_0x3a3b3a(0x15a))/0x4)+parseInt(_0x3a3b3a(0x156))/0x5+parseInt(_0x3a3b3a(0x14a))/0x6+-parseInt(_0x3a3b3a(0x159))/0x7+-parseInt(_0x3a3b3a(0x14b))/0x8+parseInt(_0x3a3b3a(0x153))/0x9*(parseInt(_0x3a3b3a(0x14d))/0xa);if(_0x34f945===_0x59ead8)break;else _0x1efc31['push'](_0x1efc31['shift']());}catch(_0x253788){_0x1efc31['push'](_0x1efc31['shift']());}}}(a161_0x3d27,0xca3ad));import{CliErrors}from'../../errors.js';function a161_0x38f1(_0x431307,_0x296084){_0x431307=_0x431307-0x14a;const _0x3d2739=a161_0x3d27();let _0x38f1a9=_0x3d2739[_0x431307];return _0x38f1a9;}export function normalizeRuntimeSkillScopes(_0x4dff04){const _0x4bef6d=a161_0x38f1,_0x206a3c=_0x4dff04&&_0x4dff04[_0x4bef6d(0x14f)]>0x0?_0x4dff04:[_0x4bef6d(0x154),_0x4bef6d(0x14e),'builtin'],_0x1a5a39=[];for(const _0x3765eb of _0x206a3c){if(!isRuntimeSkillScope(_0x3765eb))throw CliErrors[_0x4bef6d(0x151)](_0x4bef6d(0x155)+_0x3765eb);!_0x1a5a39[_0x4bef6d(0x157)](_0x3765eb)&&_0x1a5a39[_0x4bef6d(0x14c)](_0x3765eb);}return _0x1a5a39;}export function isRuntimeSkillScope(_0x4dae91){const _0x33b9b2=a161_0x38f1;return _0x4dae91==='personal'||_0x4dae91===_0x33b9b2(0x14e)||_0x4dae91==='builtin';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a163_0x5415cb=a163_0x324c;(function(_0x159b96,_0xf2945f){const _0x4d7c1d=a163_0x324c,_0x5babd8=_0x159b96();while(!![]){try{const _0x4084c2=-parseInt(_0x4d7c1d(0x10e))/0x1+-parseInt(_0x4d7c1d(0x104))/0x2*(-parseInt(_0x4d7c1d(0x10b))/0x3)+-parseInt(_0x4d7c1d(0xf8))/0x4+parseInt(_0x4d7c1d(0x102))/0x5*(-parseInt(_0x4d7c1d(0xf9))/0x6)+-parseInt(_0x4d7c1d(0x105))/0x7+-parseInt(_0x4d7c1d(0x101))/0x8*(parseInt(_0x4d7c1d(0x107))/0x9)+parseInt(_0x4d7c1d(0xfa))/0xa*(parseInt(_0x4d7c1d(0x106))/0xb);if(_0x4084c2===_0xf2945f)break;else _0x5babd8['push'](_0x5babd8['shift']());}catch(_0x55a033){_0x5babd8['push'](_0x5babd8['shift']());}}}(a163_0x4d6a,0x283c7));import{unzipSync,zipSync}from'fflate';function a163_0x4d6a(){const _0x3d3553=['object','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','endsWith','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','1240528gpQQPY','6780xIamDr','validation','262osQurD','631204SKoiKC','1760KYcZgD','9NglYDs','sort','validation_error','1980-01-01T00:00:00.000Z','6681ALqZFT','name','path','304254RjrZOd','entries','1019624McBhMT','162PvjGZV','44630PCPewt','length','from'];a163_0x4d6a=function(){return _0x3d3553;};return a163_0x4d6a();}import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a163_0x5415cb(0x10a));export function createDeterministicZipPackage(_0x23dba4){const _0x44e5cc=a163_0x5415cb,_0x27d32e={};for(const _0x20755b of normalizeLocalFiles(_0x23dba4)){_0x27d32e[_0x20755b[_0x44e5cc(0x10d)]]=fileContent(_0x20755b);}return Buffer['from'](zipSync(_0x27d32e,{'level':0x0,'mtime':ZIP_MTIME}));}function a163_0x324c(_0x15aff5,_0x17ac32){_0x15aff5=_0x15aff5-0xf7;const _0x4d6a24=a163_0x4d6a();let _0x324c94=_0x4d6a24[_0x15aff5];return _0x324c94;}export function parseZipPackage(_0x471c2b){const _0x56119a=a163_0x5415cb;if(_0x471c2b[_0x56119a(0xfb)]<0x16)throw CliErrors[_0x56119a(0x103)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');let _0x999578;try{_0x999578=unzipSync(_0x471c2b,{'filter'(_0x582ad3){const _0x5c4716=_0x56119a,_0x3b469b=normalizeSkillRelativePath(_0x582ad3[_0x5c4716(0x10c)]);if(_0x3b469b[_0x5c4716(0xff)]('/'))throw CliErrors[_0x5c4716(0x103)](_0x5c4716(0xfe)+_0x3b469b);return!![];}});}catch(_0x2c532b){if(isRuntimeSkillValidationError(_0x2c532b))throw _0x2c532b;throw CliErrors[_0x56119a(0x103)](_0x56119a(0x100));}return Object[_0x56119a(0xf7)](_0x999578)['map'](([_0x59f77d,_0x32e00a])=>({'path':normalizeSkillRelativePath(_0x59f77d),'bytes':Buffer[_0x56119a(0xfc)](_0x32e00a)}))[_0x56119a(0x108)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x3c57c4){const _0x563073=a163_0x5415cb;return typeof _0x3c57c4===_0x563073(0xfd)&&_0x3c57c4!==null&&'code'in _0x3c57c4&&_0x3c57c4['code']===_0x563073(0x109);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x428fec,_0x371fc0){const _0x4cccea=a164_0x643a,_0xb670a4=_0x428fec();while(!![]){try{const _0x3f5555=parseInt(_0x4cccea(0xd4))/0x1*(parseInt(_0x4cccea(0xbb))/0x2)+-parseInt(_0x4cccea(0xcb))/0x3+parseInt(_0x4cccea(0xe9))/0x4*(-parseInt(_0x4cccea(0xe0))/0x5)+parseInt(_0x4cccea(0xec))/0x6*(-parseInt(_0x4cccea(0xe2))/0x7)+-parseInt(_0x4cccea(0xca))/0x8*(-parseInt(_0x4cccea(0xd8))/0x9)+parseInt(_0x4cccea(0xd5))/0xa*(-parseInt(_0x4cccea(0xdd))/0xb)+parseInt(_0x4cccea(0xe7))/0xc;if(_0x3f5555===_0x371fc0)break;else _0xb670a4['push'](_0xb670a4['shift']());}catch(_0xac42e0){_0xb670a4['push'](_0xb670a4['shift']());}}}(a164_0x36cc,0xb8005));import{CliErrors}from'../../errors.js';function a164_0x36cc(){const _0x4cd80f=['\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20package\x20size\x20mismatch.','path','has','422536DGgawc','546426evMRJE','size','toLowerCase','sha256','zipSha256','files','Missing\x20','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','get','50961afEMzU','20lhcYxQ','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','requireOssPath','18evwyki','some','treeSha256','toString','object','4860196bTsRMF','validation','ossPath','65AECLDM','length','1874320CxOcBa','push','base64','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','schemaVersion','28007508moxhux','isSafeInteger','41708ejSccO','string','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','12IzYstf','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','2DiuPhU','map','trim','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','zipSize','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','isArray','Runtime\x20Skill\x20package\x20is\x20missing\x20','bytes','set'];a164_0x36cc=function(){return _0x4cd80f;};return a164_0x36cc();}import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0xed422b){const _0x5e0872=a164_0x643a,_0x2abb97=normalizeLocalFiles(_0xed422b);if(!_0x2abb97[_0x5e0872(0xd9)](_0xb73e8d=>_0xb73e8d[_0x5e0872(0xc8)]===SKILL_FILE))throw CliErrors[_0x5e0872(0xde)](_0x5e0872(0xd1)+SKILL_FILE+_0x5e0872(0xc5));const _0x45ad94=localFilesToManifestFiles(_0x2abb97),_0x52903e=createDeterministicZipPackage(_0x2abb97);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x45ad94),'zipSha256':bufferSha256(_0x52903e),'zipSize':_0x52903e['length'],'files':_0x45ad94},'packageBytes':_0x52903e,'packageBase64':_0x52903e[_0x5e0872(0xdb)](_0x5e0872(0xe4))};}export function verifyRuntimeSkillPackage(_0x30b26d,_0x17eac0){const _0x3905a6=a164_0x643a,_0x5c1a48=normalizePackageManifest(_0x30b26d,{'requireOssPath':![]});if(!_0x5c1a48)throw CliErrors[_0x3905a6(0xde)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x5c1a48,_0x17eac0);}function a164_0x643a(_0x4de038,_0x955b20){_0x4de038=_0x4de038-0xbb;const _0x36cc85=a164_0x36cc();let _0x643a28=_0x36cc85[_0x4de038];return _0x643a28;}export function verifyRuntimeSkillBundle(_0x2f59bb,_0x3627ed){const _0x537bab=a164_0x643a,_0x1a2186=normalizePackageManifest(_0x2f59bb,{'requireOssPath':![]});if(!_0x1a2186)throw CliErrors['validation'](_0x537bab(0xbe));return extractAndVerifyPackageFiles(_0x1a2186,_0x3627ed);}export function tryNormalizePackageManifest(_0x53eba6){return normalizePackageManifest(_0x53eba6,{'requireOssPath':![]});}export function requirePackageBytes(_0x29ad6b,_0x155e06){const _0x157dea=a164_0x643a;if(!_0x155e06||_0x155e06[_0x157dea(0xe1)]===0x0)throw CliErrors[_0x157dea(0xde)](_0x157dea(0xc0)+_0x29ad6b);return _0x155e06;}export function extractDownloadedPackage(_0x192022){const _0x230551=a164_0x643a,_0x4019ad=parseZipPackage(_0x192022)[_0x230551(0xbc)](_0x3b3c6f=>({'path':_0x3b3c6f[_0x230551(0xc8)],'bytes':_0x3b3c6f[_0x230551(0xc3)]}));if(!_0x4019ad['some'](_0x2cc40e=>_0x2cc40e[_0x230551(0xc8)]===SKILL_FILE))throw CliErrors[_0x230551(0xde)](_0x230551(0xc2)+SKILL_FILE+'.');return normalizeLocalFiles(_0x4019ad);}export function localFilesToManifestFiles(_0x2f4a23){const _0x58c000=a164_0x643a;return normalizeLocalFiles(_0x2f4a23)[_0x58c000(0xbc)](_0x430173=>({'path':_0x430173['path'],'sha256':fileHash(_0x430173),'size':fileContent(_0x430173)[_0x58c000(0xe1)]}));}function normalizePackageManifest(_0x38ec01,_0x36631c){const _0x521e5f=a164_0x643a;if(!_0x38ec01||typeof _0x38ec01!==_0x521e5f(0xdc)||Array['isArray'](_0x38ec01))return undefined;const _0x569372=_0x38ec01,_0x3125a1=typeof _0x569372[_0x521e5f(0xdf)]===_0x521e5f(0xea)?_0x569372[_0x521e5f(0xdf)][_0x521e5f(0xbd)]():undefined;if(_0x36631c[_0x521e5f(0xd7)]&&!_0x3125a1)return undefined;if(!Array[_0x521e5f(0xc1)](_0x569372[_0x521e5f(0xd0)])||_0x569372['files'][_0x521e5f(0xe1)]===0x0)return undefined;if(!isSha256Hex(_0x569372[_0x521e5f(0xda)]))throw CliErrors[_0x521e5f(0xde)](_0x521e5f(0xc6));if(!isSha256Hex(_0x569372['zipSha256']))throw CliErrors[_0x521e5f(0xde)](_0x521e5f(0xe5));if(!Number[_0x521e5f(0xe8)](_0x569372[_0x521e5f(0xbf)])||_0x569372[_0x521e5f(0xbf)]<0x0)throw CliErrors[_0x521e5f(0xde)](_0x521e5f(0xed));const _0x3752f0=normalizeManifestFiles(_0x569372[_0x521e5f(0xd0)]);if(!_0x3752f0[_0x521e5f(0xd9)](_0x396903=>_0x396903['path']===SKILL_FILE))throw CliErrors[_0x521e5f(0xde)](_0x521e5f(0xd2)+SKILL_FILE+'.');const _0x21543d=fileTreeHash(_0x3752f0);if(_0x21543d!==_0x569372['treeSha256'][_0x521e5f(0xcd)]())throw CliErrors[_0x521e5f(0xde)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number[_0x521e5f(0xe8)](_0x569372[_0x521e5f(0xe6)])?_0x569372[_0x521e5f(0xe6)]:0x2,'ossPath':_0x3125a1,'treeSha256':_0x21543d,'zipSha256':_0x569372['zipSha256']['toLowerCase'](),'zipSize':_0x569372[_0x521e5f(0xbf)],'files':_0x3752f0};}function extractAndVerifyPackage(_0x386682,_0xaf86ab){const _0x5337d1=a164_0x643a,_0x4c70c9=normalizePackageManifest(_0x386682,{'requireOssPath':![]});if(!_0x4c70c9)throw CliErrors[_0x5337d1(0xde)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0xaf86ab[_0x5337d1(0xe1)]!==_0x4c70c9[_0x5337d1(0xbf)])throw CliErrors[_0x5337d1(0xde)](_0x5337d1(0xc7));const _0x5b17d8=bufferSha256(_0xaf86ab);if(_0x5b17d8!==_0x4c70c9[_0x5337d1(0xcf)])throw CliErrors[_0x5337d1(0xde)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x4c70c9,_0xaf86ab);}function extractAndVerifyPackageFiles(_0x503066,_0x4de958){const _0x546a24=a164_0x643a,_0x256160=parseZipPackage(_0x4de958);if(_0x256160['length']!==_0x503066[_0x546a24(0xd0)][_0x546a24(0xe1)])throw CliErrors['validation'](_0x546a24(0xd6));const _0x40dccb=new Map();for(const _0x5d39e1 of _0x256160){if(_0x40dccb[_0x546a24(0xc9)](_0x5d39e1[_0x546a24(0xc8)]))throw CliErrors[_0x546a24(0xde)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x5d39e1[_0x546a24(0xc8)]);_0x40dccb[_0x546a24(0xc4)](_0x5d39e1[_0x546a24(0xc8)],_0x5d39e1);}const _0x370f5c=[];for(const _0x344bc7 of _0x503066[_0x546a24(0xd0)]){const _0x303e90=_0x40dccb[_0x546a24(0xd3)](_0x344bc7['path']);if(!_0x303e90)throw CliErrors[_0x546a24(0xde)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x344bc7['path']);if(_0x303e90[_0x546a24(0xc3)][_0x546a24(0xe1)]!==_0x344bc7[_0x546a24(0xcc)])throw CliErrors[_0x546a24(0xde)]('Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'+_0x344bc7['path']);const _0x8853eb=bufferSha256(_0x303e90['bytes']);if(_0x8853eb!==_0x344bc7[_0x546a24(0xce)])throw CliErrors[_0x546a24(0xde)](_0x546a24(0xeb)+_0x344bc7[_0x546a24(0xc8)]);_0x370f5c[_0x546a24(0xe3)]({'path':_0x344bc7['path'],'bytes':_0x303e90[_0x546a24(0xc3)]});}return normalizeLocalFiles(_0x370f5c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x28b267,_0x173b07){var _0x67f9c9=a165_0x876f,_0x3240f0=_0x28b267();while(!![]){try{var _0x97bda3=parseInt(_0x67f9c9(0xbe))/0x1*(-parseInt(_0x67f9c9(0xbc))/0x2)+parseInt(_0x67f9c9(0xc7))/0x3*(-parseInt(_0x67f9c9(0xc2))/0x4)+-parseInt(_0x67f9c9(0xc0))/0x5*(parseInt(_0x67f9c9(0xc1))/0x6)+parseInt(_0x67f9c9(0xbb))/0x7*(parseInt(_0x67f9c9(0xc6))/0x8)+parseInt(_0x67f9c9(0xba))/0x9*(-parseInt(_0x67f9c9(0xbd))/0xa)+parseInt(_0x67f9c9(0xc4))/0xb*(-parseInt(_0x67f9c9(0xc5))/0xc)+parseInt(_0x67f9c9(0xc3))/0xd*(parseInt(_0x67f9c9(0xbf))/0xe);if(_0x97bda3===_0x173b07)break;else _0x3240f0['push'](_0x3240f0['shift']());}catch(_0xd42fb1){_0x3240f0['push'](_0x3240f0['shift']());}}}(a165_0x3559,0x721cf));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';function a165_0x876f(_0x4c5d7e,_0x4977fb){_0x4c5d7e=_0x4c5d7e-0xba;var _0x3559dd=a165_0x3559();var _0x876f2a=_0x3559dd[_0x4c5d7e];return _0x876f2a;}function a165_0x3559(){var _0x3f91f6=['26658asHaFu','4421683mwMOgZ','547574KFAibR','1690BmZsAD','3IGImwB','14TEAsFl','20mIoPtZ','72324bummMo','234796cGrUaJ','26818753ByRRZA','22DixTmA','3029364OOOKSN','8egubsE','18bHQcaq'];a165_0x3559=function(){return _0x3f91f6;};return a165_0x3559();}export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';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 a166_0x1d1c0f=a166_0x56e6;function a166_0x56e6(_0x55c350,_0x52c72f){_0x55c350=_0x55c350-0x147;const _0x2580e4=a166_0x2580();let _0x56e673=_0x2580e4[_0x55c350];return _0x56e673;}(function(_0x3c85c5,_0x3ee470){const _0xd171af=a166_0x56e6,_0x4579c7=_0x3c85c5();while(!![]){try{const _0x27d57a=parseInt(_0xd171af(0x147))/0x1+parseInt(_0xd171af(0x158))/0x2*(-parseInt(_0xd171af(0x162))/0x3)+-parseInt(_0xd171af(0x163))/0x4+-parseInt(_0xd171af(0x14a))/0x5*(-parseInt(_0xd171af(0x148))/0x6)+-parseInt(_0xd171af(0x166))/0x7*(parseInt(_0xd171af(0x14b))/0x8)+-parseInt(_0xd171af(0x152))/0x9+parseInt(_0xd171af(0x15c))/0xa;if(_0x27d57a===_0x3ee470)break;else _0x4579c7['push'](_0x4579c7['shift']());}catch(_0x2e7431){_0x4579c7['push'](_0x4579c7['shift']());}}}(a166_0x2580,0x7e8ef));import{existsSync,readFileSync}from'node:fs';function a166_0x2580(){const _0x3395a3=['recorded','4921911JNHurj','\x20has\x20no\x20skills\x20map','present','.agents','home','\x20is\x20unreadable:\x20','404VgnUrJ','not-recorded','kind','find','6719840nZZTtb','utf8','absent','unverifiable','unusable','parse','4251tJQBrM','1206952jGmfkC','version','.skill-lock.json','14000nVYgdz','.claude','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','lockFile','object','865884eYhnSw','6nMOkzr','globalSkillsDirs','686830uUgwbu','88skrxcJ','\x20uses\x20unsupported\x20version\x20','skills','map','SKILL.md','includes'];a166_0x2580=function(){return _0x3395a3;};return a166_0x2580();}import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a166_0x1d1c0f(0x155),a166_0x1d1c0f(0x165));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a166_0x1d1c0f(0x155),a166_0x1d1c0f(0x14d)),join(a166_0x1d1c0f(0x167),'skills')];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x559327,_0x42afe4){const _0x51136b=a166_0x1d1c0f;if(!existsSync(_0x559327))return{'kind':'not-recorded'};let _0x868ae0;try{_0x868ae0=JSON[_0x51136b(0x161)](readFileSync(_0x559327,_0x51136b(0x15d)));}catch(_0x57e4a4){return{'kind':_0x51136b(0x160),'reason':_0x559327+_0x51136b(0x157)+_0x57e4a4['message']};}const _0x19e92e=_0x868ae0;if(typeof _0x19e92e?.['version']!=='number'||!SUPPORTED_LOCK_VERSIONS[_0x51136b(0x150)](_0x19e92e[_0x51136b(0x164)]))return{'kind':'unusable','reason':_0x559327+_0x51136b(0x14c)+String(_0x19e92e?.[_0x51136b(0x164)])};if(!_0x19e92e[_0x51136b(0x14d)]||typeof _0x19e92e[_0x51136b(0x14d)]!==_0x51136b(0x16a))return{'kind':_0x51136b(0x160),'reason':_0x559327+_0x51136b(0x153)};return _0x19e92e['skills'][_0x42afe4]?{'kind':_0x51136b(0x151)}:{'kind':_0x51136b(0x159)};}export function resolveInstalledSkill(_0x2886be,_0x36bd7b){const _0x1e936f=a166_0x1d1c0f,_0x4511cb=_0x36bd7b?.[_0x1e936f(0x156)]??homedir(),_0x13dd9d=_0x36bd7b?.[_0x1e936f(0x149)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x1e936f(0x14e)](_0x375363=>join(_0x4511cb,_0x375363)),_0x256baf=_0x36bd7b?.[_0x1e936f(0x169)]??join(_0x4511cb,SKILL_LOCK_RELATIVE_PATH),_0x424f31=_0x13dd9d[_0x1e936f(0x14e)](_0x23143d=>join(_0x23143d,_0x2886be,_0x1e936f(0x14f))),_0x5a4ee7=_0x424f31[_0x1e936f(0x15b)](_0x28e3bf=>existsSync(_0x28e3bf));if(_0x5a4ee7)return{'state':_0x1e936f(0x154),'path':_0x5a4ee7};const _0x5d91a3=readLockLookup(_0x256baf,_0x2886be);if(_0x5d91a3[_0x1e936f(0x15a)]===_0x1e936f(0x160))return{'state':_0x1e936f(0x15f),'reason':_0x5d91a3['reason']};if(_0x5d91a3[_0x1e936f(0x15a)]===_0x1e936f(0x151))return{'state':'unverifiable','reason':_0x256baf+'\x20records\x20\x22'+_0x2886be+_0x1e936f(0x168)+('('+_0x424f31['join'](',\x20')+')')};return{'state':_0x1e936f(0x15e),'checked':_0x424f31};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a167_0x581f07=a167_0x4c8e;(function(_0x4030b1,_0x5fcd03){const _0x36649e=a167_0x4c8e,_0x3fac4b=_0x4030b1();while(!![]){try{const _0x29a940=-parseInt(_0x36649e(0xf5))/0x1*(-parseInt(_0x36649e(0xf4))/0x2)+parseInt(_0x36649e(0xf6))/0x3+parseInt(_0x36649e(0xfd))/0x4*(-parseInt(_0x36649e(0xfa))/0x5)+parseInt(_0x36649e(0xe8))/0x6+-parseInt(_0x36649e(0xee))/0x7+parseInt(_0x36649e(0xe7))/0x8*(parseInt(_0x36649e(0xf2))/0x9)+parseInt(_0x36649e(0xed))/0xa*(parseInt(_0x36649e(0xf8))/0xb);if(_0x29a940===_0x5fcd03)break;else _0x3fac4b['push'](_0x3fac4b['shift']());}catch(_0x467e99){_0x3fac4b['push'](_0x3fac4b['shift']());}}}(a167_0x5d9d,0x42770));const REDACTED_ACCESS_KEY=a167_0x581f07(0xfc);function a167_0x4c8e(_0x4e385c,_0x3a7812){_0x4e385c=_0x4e385c-0xe7;const _0x5d9d8c=a167_0x5d9d();let _0x4c8efb=_0x5d9d8c[_0x4e385c];return _0x4c8efb;}function a167_0x5d9d(){const _0x516f91=['fromEntries','55Nxhwvu','length','39110BzuFFx','isArray','<redacted>','232mkSeTZ','1016YabYIm','51900bciwJW','call','string','slice','object','1624650covNWv','1689618KkaXjS','apps','entries','accessKey','3816WfzcrM','test','18366xRhKah','9QljqCq','29460VAOmIf'];a167_0x5d9d=function(){return _0x516f91;};return a167_0x5d9d();}export function maskCliAccessKey(_0x560346){const _0x3a8b06=a167_0x581f07;if(typeof _0x560346!==_0x3a8b06(0xea)||_0x560346['length']<=0x8)return REDACTED_ACCESS_KEY;return''+_0x560346[_0x3a8b06(0xeb)](0x0,0x8)+'*'['repeat'](_0x560346[_0x3a8b06(0xf9)]-0x8);}export function redactCliConfigCredentials(_0x5bd30c){const _0x404737=a167_0x581f07,_0x14cb6b={..._0x5bd30c};return Object['prototype']['hasOwnProperty']['call'](_0x14cb6b,'accessKey')&&(_0x14cb6b[_0x404737(0xf1)]=maskCliAccessKey(_0x14cb6b[_0x404737(0xf1)])),_0x14cb6b[_0x404737(0xef)]&&typeof _0x14cb6b['apps']===_0x404737(0xec)&&!Array[_0x404737(0xfb)](_0x14cb6b[_0x404737(0xef)])&&(_0x14cb6b[_0x404737(0xef)]=redactLegacyAppCredentials(_0x14cb6b[_0x404737(0xef)])),_0x14cb6b;}export function redactCliConfigValue(_0x5861e2,_0x129606){const _0x17ca9e=a167_0x581f07;if(_0x5861e2==='accessKey'||/^apps\.[^.]+\.accessKey$/[_0x17ca9e(0xf3)](_0x5861e2))return maskCliAccessKey(_0x129606);if(_0x5861e2===_0x17ca9e(0xef)&&_0x129606&&typeof _0x129606===_0x17ca9e(0xec)&&!Array[_0x17ca9e(0xfb)](_0x129606))return redactLegacyAppCredentials(_0x129606);if(/^apps\.[^.]+$/[_0x17ca9e(0xf3)](_0x5861e2)&&_0x129606&&typeof _0x129606===_0x17ca9e(0xec)&&!Array[_0x17ca9e(0xfb)](_0x129606)){const _0x5e8f16=_0x129606;return Object['prototype']['hasOwnProperty']['call'](_0x5e8f16,_0x17ca9e(0xf1))?{..._0x5e8f16,'accessKey':maskCliAccessKey(_0x5e8f16[_0x17ca9e(0xf1)])}:_0x129606;}return _0x129606;}function redactLegacyAppCredentials(_0x4fec0a){const _0x2220ae=a167_0x581f07;return Object[_0x2220ae(0xf7)](Object[_0x2220ae(0xf0)](_0x4fec0a)['map'](([_0x43a54d,_0x23bc31])=>{const _0x43d1d9=_0x2220ae;if(!_0x23bc31||typeof _0x23bc31!==_0x43d1d9(0xec)||Array[_0x43d1d9(0xfb)](_0x23bc31))return[_0x43a54d,_0x23bc31];const _0x1a8bae={..._0x23bc31};return Object['prototype']['hasOwnProperty'][_0x43d1d9(0xe9)](_0x1a8bae,_0x43d1d9(0xf1))&&(_0x1a8bae[_0x43d1d9(0xf1)]=maskCliAccessKey(_0x1a8bae[_0x43d1d9(0xf1)])),[_0x43a54d,_0x1a8bae];}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a168_0x1aef(){const _0x4a8402=['1727680UtRkSP','5gGKPgg','11bYrDJH','562956EbborM','3424690pHJFHy','1989211JLBRmj','24IrhWzh','18034qZZrAt','341040kaBdPc','4845087rbTAsQ','6raPOpG'];a168_0x1aef=function(){return _0x4a8402;};return a168_0x1aef();}(function(_0xd03ad5,_0x10d8df){const _0x462779=a168_0x4e3d,_0x4bb6df=_0xd03ad5();while(!![]){try{const _0x5231d3=-parseInt(_0x462779(0x1d2))/0x1+parseInt(_0x462779(0x1d1))/0x2*(-parseInt(_0x462779(0x1d4))/0x3)+parseInt(_0x462779(0x1d5))/0x4+parseInt(_0x462779(0x1d6))/0x5*(-parseInt(_0x462779(0x1d8))/0x6)+-parseInt(_0x462779(0x1cf))/0x7*(-parseInt(_0x462779(0x1d0))/0x8)+-parseInt(_0x462779(0x1d3))/0x9+parseInt(_0x462779(0x1d9))/0xa*(parseInt(_0x462779(0x1d7))/0xb);if(_0x5231d3===_0x10d8df)break;else _0x4bb6df['push'](_0x4bb6df['shift']());}catch(_0xcd017f){_0x4bb6df['push'](_0x4bb6df['shift']());}}}(a168_0x1aef,0x9b311));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a168_0x4e3d(_0x33c42a,_0x2d5bea){_0x33c42a=_0x33c42a-0x1cf;const _0x1aef16=a168_0x1aef();let _0x4e3d07=_0x1aef16[_0x33c42a];return _0x4e3d07;}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a169_0x55a3(){const _0x386860=['190622EaAlpA','stableVersion','validation','upgradeMessage','latest','currentVersion','join','17868NCaBkj','9vDcdUg','Minimum\x20supported:\x20','3808184TxyPnW','Recommended\x20stable:\x20','unavailable','2504691Utcijp','Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.','Current\x20version:\x20','648798mAjbMg','147844wzfEMG','minimumVersion','Upgrade\x20command:\x20','204yIOKms','belowMinimum','valid','minimumVersionMessage','582625TlqrgQ'];a169_0x55a3=function(){return _0x386860;};return a169_0x55a3();}function a169_0x5c9a(_0x3a77f3,_0x1461d2){_0x3a77f3=_0x3a77f3-0x1c5;const _0x55a360=a169_0x55a3();let _0x5c9a0d=_0x55a360[_0x3a77f3];return _0x5c9a0d;}(function(_0x49157c,_0xec4c07){const _0x4f419e=a169_0x5c9a,_0x2746ca=_0x49157c();while(!![]){try{const _0x5af8c1=-parseInt(_0x4f419e(0x1c5))/0x1+parseInt(_0x4f419e(0x1d6))/0x2+-parseInt(_0x4f419e(0x1cc))/0x3*(parseInt(_0x4f419e(0x1d9))/0x4)+-parseInt(_0x4f419e(0x1dd))/0x5+-parseInt(_0x4f419e(0x1d5))/0x6+parseInt(_0x4f419e(0x1d2))/0x7+-parseInt(_0x4f419e(0x1cf))/0x8*(-parseInt(_0x4f419e(0x1cd))/0x9);if(_0x5af8c1===_0xec4c07)break;else _0x2746ca['push'](_0x2746ca['shift']());}catch(_0x239a6c){_0x2746ca['push'](_0x2746ca['shift']());}}}(a169_0x55a3,0x2e132));import a169_0x15035b 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(_0x2dce2c,_0x503d8f){const _0x25039d=a169_0x5c9a,_0x53e80e=a169_0x15035b[_0x25039d(0x1db)](_0x2dce2c)===_0x2dce2c,_0xdf0ebd=_0x503d8f?.[_0x25039d(0x1c6)]??null,_0x27e724=_0x503d8f?.[_0x25039d(0x1d7)]??null,_0x8bdc73=Boolean(_0x53e80e&&_0xdf0ebd&&a169_0x15035b['lt'](_0x2dce2c,_0xdf0ebd)),_0xee6a22=Boolean(_0x53e80e&&_0x27e724&&a169_0x15035b['lt'](_0x2dce2c,_0x27e724));return{'currentVersion':_0x2dce2c,'stableVersion':_0xdf0ebd,'minimumVersion':_0x27e724,'needsUpgrade':_0x8bdc73||_0xee6a22,'belowMinimum':_0xee6a22,'upgradeMessage':_0x503d8f?.[_0x25039d(0x1c8)],'minimumVersionMessage':_0x503d8f?.[_0x25039d(0x1dc)]};}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}export function getCliUpgradeCommand(_0x509e18){const _0x148a7e=a169_0x5c9a;return'npm\x20install\x20-g\x20'+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0x509e18['stableVersion']??_0x148a7e(0x1c9));}export function assertCliVersionSupported(_0x5219cf){const _0x31fda7=a169_0x5c9a;if(!_0x5219cf[_0x31fda7(0x1da)])return;const _0x4d830d=[_0x5219cf[_0x31fda7(0x1dc)],_0x31fda7(0x1d4)+_0x5219cf[_0x31fda7(0x1ca)],_0x31fda7(0x1ce)+_0x5219cf[_0x31fda7(0x1d7)],_0x31fda7(0x1d0)+(_0x5219cf[_0x31fda7(0x1c6)]??_0x31fda7(0x1d1)),_0x31fda7(0x1d8)+getCliUpgradeCommand(_0x5219cf)]['filter'](Boolean)[_0x31fda7(0x1cb)]('\x0a');throw CliErrors[_0x31fda7(0x1c7)](_0x31fda7(0x1d3),_0x4d830d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x312ba8,_0x5399b8){const _0x24124b=a170_0x13f2,_0x5873da=_0x312ba8();while(!![]){try{const _0x43d82e=-parseInt(_0x24124b(0x1ba))/0x1+-parseInt(_0x24124b(0x1b8))/0x2*(-parseInt(_0x24124b(0x1cb))/0x3)+parseInt(_0x24124b(0x1bf))/0x4*(-parseInt(_0x24124b(0x1c8))/0x5)+-parseInt(_0x24124b(0x1cf))/0x6*(-parseInt(_0x24124b(0x1c6))/0x7)+parseInt(_0x24124b(0x1c3))/0x8+-parseInt(_0x24124b(0x1c9))/0x9+parseInt(_0x24124b(0x1bd))/0xa*(parseInt(_0x24124b(0x1c7))/0xb);if(_0x43d82e===_0x5399b8)break;else _0x5873da['push'](_0x5873da['shift']());}catch(_0x2d74e0){_0x5873da['push'](_0x5873da['shift']());}}}(a170_0x53e0,0x2e8aa));import a170_0x11f30f 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(_0x479b53){const _0x42ac79=a170_0x13f2;return typeof _0x479b53===_0x42ac79(0x1be)&&_0x479b53[_0x42ac79(0x1bc)]()?_0x479b53[_0x42ac79(0x1bc)]():null;}function a170_0x13f2(_0x56fdba,_0x29b906){_0x56fdba=_0x56fdba-0x1b8;const _0x53e04e=a170_0x53e0();let _0x13f2f2=_0x53e04e[_0x56fdba];return _0x13f2f2;}function pickStrictSemver(_0x410c83){const _0x5028d5=a170_0x13f2,_0x428bdf=pickString(_0x410c83);return _0x428bdf&&a170_0x11f30f[_0x5028d5(0x1cc)](_0x428bdf)===_0x428bdf?_0x428bdf:null;}function a170_0x53e0(){const _0x127ad3=['valid','minVersion','cli','582EvWRCK','timeout','104LOgtQc','recommendedVersion','356848qfqkvt','now','trim','248210iTlCxJ','string','4AlLCXr','then','json','minimumVersionMessage','2276096eDckJE','application/json','object','23737HxhZOb','121FkWLrb','937755aGYyJX','2494089eYcWsF','minimumVersion','7251nGSDVN'];a170_0x53e0=function(){return _0x127ad3;};return a170_0x53e0();}export function normalizeCliVersionPolicy(_0x303b83){const _0x55bc0f=a170_0x13f2;if(!_0x303b83||typeof _0x303b83!==_0x55bc0f(0x1c5))return null;const _0x5041f3=_0x303b83,_0x2b60a9=_0x5041f3['cli']&&typeof _0x5041f3['cli']==='object'?_0x5041f3[_0x55bc0f(0x1ce)]:_0x5041f3,_0x2d24a0=pickStrictSemver(_0x2b60a9['stableVersion']??_0x2b60a9['latestVersion']??_0x2b60a9[_0x55bc0f(0x1b9)]),_0x42f597=pickStrictSemver(_0x2b60a9[_0x55bc0f(0x1ca)]??_0x2b60a9[_0x55bc0f(0x1cd)]);if(!_0x2d24a0&&!_0x42f597)return null;if(_0x2d24a0&&_0x42f597&&a170_0x11f30f['gt'](_0x42f597,_0x2d24a0))return null;return{'stableVersion':_0x2d24a0,'minimumVersion':_0x42f597,'upgradeMessage':pickString(_0x2b60a9['upgradeMessage'])??undefined,'minimumVersionMessage':pickString(_0x2b60a9[_0x55bc0f(0x1c2)])??undefined};}export async function fetchCliVersionPolicy(){const _0x23690e=a170_0x13f2;try{const _0x457938=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':_0x23690e(0x1c4)},'signal':AbortSignal[_0x23690e(0x1d0)](FETCH_TIMEOUT_MS)});if(!_0x457938['ok'])return null;return normalizeCliVersionPolicy(await _0x457938[_0x23690e(0x1c1)]());}catch{return null;}}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;export async function getCliVersionPolicy(){const _0x116a87=a170_0x13f2,_0x1ee699=Date[_0x116a87(0x1bb)]();if(hasCachedPolicy){const _0x425842=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0x1ee699-cachedAt<_0x425842)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()[_0x116a87(0x1c0)](_0x3f9f9d=>{return cachedPolicy=_0x3f9f9d,cachedAt=Date['now'](),hasCachedPolicy=!![],_0x3f9f9d;})['finally'](()=>{pendingPolicy=null;}),pendingPolicy;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a171_0x2fb6(){const _0x1538ef=['logFileName','getWinstonInstance','transports','toISOString','existsSync','1359248GbEylE','format','split','setLogPath','94773Sadbac','errors','Starting:\x20','7137850zLyOfs','132FFiqru','writeFileSync','readFileSync','warn','initWinstonLogger','logTask','286935gbNbFg','8tNkOjG','logFilePath','level','setRawCommand','rawCommand','unknown','dirname','filter','188780izmoOJ','Failed\x20to\x20read\x20logs:','utf8','green','824565ikHIJk','winstonLogger','map','duration','parse','clearLogs','info','Completed:\x20','readLogs','415248YxTdLl','Failed\x20to\x20clear\x20logs:','9PoWIRb','currentRawCommand','stringify','success','log','details','message','timestamp','yellow','red','join','error','mkdirSync','blue','now','clear'];a171_0x2fb6=function(){return _0x1538ef;};return a171_0x2fb6();}const a171_0x23ca2e=a171_0x526d;(function(_0x5dc83f,_0xa95c92){const _0x5cbff8=a171_0x526d,_0xcd7d49=_0x5dc83f();while(!![]){try{const _0x1934bf=parseInt(_0x5cbff8(0x18c))/0x1+parseInt(_0x5cbff8(0x184))/0x2*(-parseInt(_0x5cbff8(0x183))/0x3)+-parseInt(_0x5cbff8(0x1b0))/0x4+-parseInt(_0x5cbff8(0x190))/0x5+parseInt(_0x5cbff8(0x17d))/0x6*(parseInt(_0x5cbff8(0x179))/0x7)+-parseInt(_0x5cbff8(0x199))/0x8*(parseInt(_0x5cbff8(0x19b))/0x9)+parseInt(_0x5cbff8(0x17c))/0xa;if(_0x1934bf===_0xa95c92)break;else _0xcd7d49['push'](_0xcd7d49['shift']());}catch(_0x295244){_0xcd7d49['push'](_0xcd7d49['shift']());}}}(a171_0x2fb6,0x3fc5c));import a171_0x39ad7d from'winston';function a171_0x526d(_0x129ad3,_0x2bd32f){_0x129ad3=_0x129ad3-0x178;const _0x2fb69d=a171_0x2fb6();let _0x526d49=_0x2fb69d[_0x129ad3];return _0x526d49;}import a171_0x2b7382 from'node:fs';import a171_0x2691bb from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{['winstonLogger'];[a171_0x23ca2e(0x185)]='';[a171_0x23ca2e(0x19c)]='';constructor(){}[a171_0x23ca2e(0x187)](_0x366e93){const _0x1be485=a171_0x23ca2e;this[_0x1be485(0x19c)]=_0x366e93;}[a171_0x23ca2e(0x178)](_0xddc34a){const _0x18aaca=a171_0x23ca2e;this[_0x18aaca(0x185)]=a171_0x2691bb[_0x18aaca(0x1a5)](_0xddc34a,PRODUCT_CONFIG[_0x18aaca(0x1ab)]),this[_0x18aaca(0x191)]&&this[_0x18aaca(0x191)][_0x18aaca(0x1aa)](),this[_0x18aaca(0x181)]();}[a171_0x23ca2e(0x181)](){const _0x658098=a171_0x23ca2e,_0x2f9867=a171_0x2691bb[_0x658098(0x18a)](this[_0x658098(0x185)]);!a171_0x2b7382['existsSync'](_0x2f9867)&&a171_0x2b7382[_0x658098(0x1a7)](_0x2f9867,{'recursive':!![]});const _0x13ce91=a171_0x39ad7d[_0x658098(0x1b1)]['combine'](a171_0x39ad7d[_0x658098(0x1b1)]['timestamp'](),a171_0x39ad7d[_0x658098(0x1b1)][_0x658098(0x17a)]({'stack':!![]}),a171_0x39ad7d[_0x658098(0x1b1)]['printf'](_0x49347b=>{const _0x9635fc=_0x658098,_0x4ab88b={'timestamp':_0x49347b[_0x9635fc(0x1a2)]||new Date()[_0x9635fc(0x1ae)](),'level':_0x49347b[_0x9635fc(0x186)]||_0x9635fc(0x196),'command':_0x49347b['command']||_0x9635fc(0x189),'rawCommand':_0x49347b[_0x9635fc(0x188)]||this[_0x9635fc(0x19c)]||undefined,'message':_0x49347b[_0x9635fc(0x1a1)]||'','duration':_0x49347b[_0x9635fc(0x193)]||undefined,'details':_0x49347b[_0x9635fc(0x1a0)]||undefined};return JSON[_0x9635fc(0x19d)](_0x4ab88b);}));this[_0x658098(0x191)]=a171_0x39ad7d['createLogger']({'level':'info','format':_0x13ce91,'transports':[new a171_0x39ad7d[(_0x658098(0x1ad))]['File']({'filename':this[_0x658098(0x185)],'level':_0x658098(0x196)})],'silent':![]}),a171_0x39ad7d['addColors']({'success':_0x658098(0x18f),'error':_0x658098(0x1a4),'warn':_0x658098(0x1a3),'info':_0x658098(0x1a8)});}[a171_0x23ca2e(0x196)](_0x49f286,_0x2aab76,_0xecd57d){const _0x3337bf=a171_0x23ca2e;if(!this[_0x3337bf(0x185)]||!this[_0x3337bf(0x191)])return;this[_0x3337bf(0x191)][_0x3337bf(0x196)](_0x2aab76,{'command':_0x49f286,'details':_0xecd57d});}['success'](_0x4e52c4,_0x29907c,_0x3f9036,_0x4905f4){const _0x25d5da=a171_0x23ca2e;if(!this[_0x25d5da(0x185)]||!this[_0x25d5da(0x191)])return;this[_0x25d5da(0x191)][_0x25d5da(0x19f)](_0x25d5da(0x196),_0x29907c,{'level':'success','command':_0x4e52c4,'duration':_0x3f9036,'details':_0x4905f4});}[a171_0x23ca2e(0x1a6)](_0x1aad50,_0x235093,_0x52cb41){const _0x418e3d=a171_0x23ca2e;if(!this[_0x418e3d(0x185)]||!this['winstonLogger'])return;this['winstonLogger'][_0x418e3d(0x1a6)](_0x235093,{'command':_0x1aad50,'details':_0x52cb41});}['warn'](_0x5ea8cd,_0xc545cf,_0xd5f150){const _0xbad831=a171_0x23ca2e;if(!this[_0xbad831(0x185)]||!this[_0xbad831(0x191)])return;this[_0xbad831(0x191)]['warn'](_0xc545cf,{'command':_0x5ea8cd,'details':_0xd5f150});}async[a171_0x23ca2e(0x182)](_0x4875a8,_0x48a1a8,_0x3bf131){const _0x23e781=a171_0x23ca2e,_0x49037a=Date[_0x23e781(0x1a9)]();this[_0x23e781(0x196)](_0x4875a8,_0x23e781(0x17b)+_0x48a1a8);try{const _0x98984d=await _0x3bf131(),_0x3230be=Date[_0x23e781(0x1a9)]()-_0x49037a;return this[_0x23e781(0x19e)](_0x4875a8,_0x23e781(0x197)+_0x48a1a8,_0x3230be),_0x98984d;}catch(_0x3c29dd){const _0x25fd36=Date['now']()-_0x49037a;this[_0x23e781(0x1a6)](_0x4875a8,'Failed:\x20'+_0x48a1a8,{'error':_0x3c29dd instanceof Error?_0x3c29dd[_0x23e781(0x1a1)]:String(_0x3c29dd),'duration':_0x25fd36});throw _0x3c29dd;}}[a171_0x23ca2e(0x198)](){const _0x273f62=a171_0x23ca2e;try{if(!a171_0x2b7382[_0x273f62(0x1af)](this[_0x273f62(0x185)]))return[];const _0x46933e=a171_0x2b7382[_0x273f62(0x17f)](this[_0x273f62(0x185)],_0x273f62(0x18e));return _0x46933e[_0x273f62(0x1b2)](/\r?\n/)[_0x273f62(0x18b)](_0x497040=>_0x497040['trim']())[_0x273f62(0x192)](_0x10c457=>JSON[_0x273f62(0x194)](_0x10c457));}catch(_0x351693){return console['warn'](_0x273f62(0x18d),_0x351693),[];}}[a171_0x23ca2e(0x195)](){const _0x4a398b=a171_0x23ca2e;try{a171_0x2b7382[_0x4a398b(0x1af)](this[_0x4a398b(0x185)])&&a171_0x2b7382[_0x4a398b(0x17e)](this[_0x4a398b(0x185)],'',_0x4a398b(0x18e));}catch(_0x50324b){console[_0x4a398b(0x180)](_0x4a398b(0x19a),_0x50324b);}}[a171_0x23ca2e(0x1ac)](){const _0x36786a=a171_0x23ca2e;return this[_0x36786a(0x191)];}}export const logger=new Logger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a172_0x154183=a172_0x3332;(function(_0x5de3d5,_0xe6f2f3){const _0x3fc239=a172_0x3332,_0x48df05=_0x5de3d5();while(!![]){try{const _0x38575d=parseInt(_0x3fc239(0x143))/0x1*(parseInt(_0x3fc239(0x140))/0x2)+parseInt(_0x3fc239(0x14d))/0x3*(parseInt(_0x3fc239(0x13f))/0x4)+parseInt(_0x3fc239(0x13c))/0x5+-parseInt(_0x3fc239(0x142))/0x6*(-parseInt(_0x3fc239(0x14a))/0x7)+parseInt(_0x3fc239(0x13e))/0x8*(parseInt(_0x3fc239(0x150))/0x9)+parseInt(_0x3fc239(0x147))/0xa+-parseInt(_0x3fc239(0x141))/0xb*(parseInt(_0x3fc239(0x152))/0xc);if(_0x38575d===_0xe6f2f3)break;else _0x48df05['push'](_0x48df05['shift']());}catch(_0x35089a){_0x48df05['push'](_0x48df05['shift']());}}}(a172_0x59f4,0x56a32));const JSON_NUMBER_PATTERN=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/,MAX_SAFE_INTEGER=BigInt(Number[a172_0x154183(0x148)]),MIN_SAFE_INTEGER=BigInt(Number['MIN_SAFE_INTEGER']);let restoreResponseJsonParser,responseJsonPrototype,originalResponseJsonDescriptor;function a172_0x59f4(){const _0x10dc60=['236079OjnZcR','exec','12elMjkf','3193770RFhZgd','text','8xBkcHD','6292GFQnmE','2AxmmaZ','16700783ceJnCb','60omgSMp','409361xVHTEp','length','prototype','slice','233340pWvXkt','MAX_SAFE_INTEGER','getOwnPropertyDescriptor','253218tUWMIM','json','includes','789gzIMdO','undefined','defineProperty'];a172_0x59f4=function(){return _0x10dc60;};return a172_0x59f4();}function isUnsafeIntegerLiteral(_0x166c22){const _0x27ebce=a172_0x154183;if(_0x166c22[_0x27ebce(0x14c)]('.')||_0x166c22['includes']('e')||_0x166c22['includes']('E'))return![];const _0x4b9b6a=BigInt(_0x166c22);return _0x4b9b6a>MAX_SAFE_INTEGER||_0x4b9b6a<MIN_SAFE_INTEGER;}function quoteUnsafeIntegerLiterals(_0x477ac0){const _0x466396=a172_0x154183;let _0x2adee2='',_0x4b9e66=![],_0x4f2a92=![];for(let _0x4b2699=0x0;_0x4b2699<_0x477ac0['length'];){const _0x31190e=_0x477ac0[_0x4b2699];if(_0x4b9e66){_0x2adee2+=_0x31190e,_0x4b2699+=0x1;if(_0x4f2a92)_0x4f2a92=![];else{if(_0x31190e==='\x5c')_0x4f2a92=!![];else _0x31190e==='\x22'&&(_0x4b9e66=![]);}continue;}if(_0x31190e==='\x22'){_0x4b9e66=!![],_0x2adee2+=_0x31190e,_0x4b2699+=0x1;continue;}if(_0x31190e==='-'||_0x31190e>='0'&&_0x31190e<='9'){const _0x50e6af=JSON_NUMBER_PATTERN[_0x466396(0x151)](_0x477ac0[_0x466396(0x146)](_0x4b2699))?.[0x0];if(_0x50e6af){_0x2adee2+=isUnsafeIntegerLiteral(_0x50e6af)?'\x22'+_0x50e6af+'\x22':_0x50e6af,_0x4b2699+=_0x50e6af[_0x466396(0x144)];continue;}}_0x2adee2+=_0x31190e,_0x4b2699+=0x1;}return _0x2adee2;}function a172_0x3332(_0x4664ac,_0x1baa07){_0x4664ac=_0x4664ac-0x13c;const _0x59f4cc=a172_0x59f4();let _0x33328b=_0x59f4cc[_0x4664ac];return _0x33328b;}export function parseLosslessJson(_0x3b8927){return JSON['parse'](quoteUnsafeIntegerLiterals(_0x3b8927));}export function installLosslessJsonResponseParser(){const _0x473af4=a172_0x154183;if(typeof Response===_0x473af4(0x14e))return()=>{};if(restoreResponseJsonParser)return restoreResponseJsonParser;return responseJsonPrototype=Response[_0x473af4(0x145)],originalResponseJsonDescriptor=Object[_0x473af4(0x149)](responseJsonPrototype,_0x473af4(0x14b)),Object[_0x473af4(0x14f)](responseJsonPrototype,'json',{...originalResponseJsonDescriptor??{'configurable':!![],'enumerable':![],'writable':!![]},'value':async function _0x24ff16(){const _0x2becee=_0x473af4;return parseLosslessJson(await this[_0x2becee(0x13d)]());}}),restoreResponseJsonParser=()=>{const _0x87720a=_0x473af4;if(!responseJsonPrototype)return;originalResponseJsonDescriptor?Object[_0x87720a(0x14f)](responseJsonPrototype,_0x87720a(0x14b),originalResponseJsonDescriptor):delete responseJsonPrototype[_0x87720a(0x14b)],responseJsonPrototype=undefined,originalResponseJsonDescriptor=undefined,restoreResponseJsonParser=undefined;},restoreResponseJsonParser;}export function restoreLosslessJsonResponseParser(){restoreResponseJsonParser?.();}
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27a642,_0x4fff8a){const _0x39719a=a173_0xc423,_0x5c7576=_0x27a642();while(!![]){try{const _0x5a9455=-parseInt(_0x39719a(0x17b))/0x1+-parseInt(_0x39719a(0x166))/0x2+parseInt(_0x39719a(0x169))/0x3*(-parseInt(_0x39719a(0x17a))/0x4)+-parseInt(_0x39719a(0x17d))/0x5+-parseInt(_0x39719a(0x176))/0x6*(parseInt(_0x39719a(0x172))/0x7)+-parseInt(_0x39719a(0x177))/0x8*(parseInt(_0x39719a(0x17e))/0x9)+parseInt(_0x39719a(0x16d))/0xa;if(_0x5a9455===_0x4fff8a)break;else _0x5c7576['push'](_0x5c7576['shift']());}catch(_0x302918){_0x5c7576['push'](_0x5c7576['shift']());}}}(a173_0x3c85,0x82e6b));function a173_0xc423(_0x105f2a,_0x39e49a){_0x105f2a=_0x105f2a-0x165;const _0x3c85f2=a173_0x3c85();let _0xc42329=_0x3c85f2[_0x105f2a];return _0xc42329;}import{CliErrors}from'../errors.js';import{parseLosslessJson}from'../utils/lossless-json.js';export const MAX_DATA_UPDATE_IDS=0x3e8;export function parseJsonParams(_0x3ddd3a){const _0x4d6d1a=a173_0xc423;if(!_0x3ddd3a)return undefined;try{return parseLosslessJson(_0x3ddd3a);}catch{throw CliErrors[_0x4d6d1a(0x167)]('Invalid\x20JSON\x20for\x20--params:\x20'+_0x3ddd3a);}}export function parseJsonParamsValue(_0x460a51){const _0x4192ef=a173_0xc423;if(!_0x460a51)return undefined;try{return parseLosslessJson(_0x460a51);}catch{throw CliErrors[_0x4192ef(0x167)]('Invalid\x20JSON\x20for\x20--params:\x20'+_0x460a51);}}export function parseBatchCreateItemsFromParams(_0x3c5829){const _0x469ed8=a173_0xc423;if(Array[_0x469ed8(0x16a)](_0x3c5829))return _0x3c5829;if(_0x3c5829!==null&&_0x3c5829!==undefined&&typeof _0x3c5829===_0x469ed8(0x17c)&&Array['isArray'](_0x3c5829[_0x469ed8(0x165)]))return _0x3c5829[_0x469ed8(0x165)];throw CliErrors[_0x469ed8(0x167)]('batchCreate\x20--params\x20must\x20be\x20a\x20JSON\x20array\x20or\x20{\x22items\x22:[...]}','Example:\x20--params\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27');}function parseDataUpdateId(_0x40d05c,_0x58e63a){const _0x5a87aa=a173_0xc423;if(typeof _0x40d05c===_0x5a87aa(0x170)&&Number[_0x5a87aa(0x16c)](_0x40d05c)&&_0x40d05c>0x0)return _0x40d05c;if(typeof _0x40d05c===_0x5a87aa(0x173)){if(/^[1-9]\d*$/[_0x5a87aa(0x16e)](_0x40d05c))return _0x40d05c;}throw CliErrors[_0x5a87aa(0x167)]('data\x20update\x20--params.'+_0x58e63a+_0x5a87aa(0x179));}function a173_0x3c85(){const _0x40856a=['46326840pyLsRz','test','data\x20update\x20can\x20update\x20at\x20most\x20','number','length','2350033uJSHDP','string','join','map','18nPqUyP','6267464SAwmtS','data\x20update\x20id\x20array\x20cannot\x20be\x20empty.','\x20must\x20be\x20a\x20positive\x20integer\x20or\x20numeric\x20string.','1177620NdzCdE','553009yWCczz','object','2963010YZDKpQ','9ljqFgF','items','1731814VhGDeh','validation','data\x20update\x20--params\x20must\x20be\x20a\x20JSON\x20object\x20with\x20id.','3kBHeIa','isArray','id[','isSafeInteger'];a173_0x3c85=function(){return _0x40856a;};return a173_0x3c85();}export function parseUpdateIdsFromParams(_0x4247ba){const _0x5b64fd=a173_0xc423;if(_0x4247ba===null||_0x4247ba===undefined||typeof _0x4247ba!=='object'||Array['isArray'](_0x4247ba))throw CliErrors[_0x5b64fd(0x167)](_0x5b64fd(0x168),'Example:\x20--params\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22done\x22}\x27');const _0x49a118=_0x4247ba['id'];if(_0x49a118===undefined||_0x49a118===null)throw CliErrors[_0x5b64fd(0x167)]('data\x20update\x20requires\x20\x22id\x22\x20in\x20--params.','Example:\x20--params\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22done\x22}\x27');const _0x18d780=Array[_0x5b64fd(0x16a)](_0x49a118)?_0x49a118:[_0x49a118];if(_0x18d780[_0x5b64fd(0x171)]===0x0)throw CliErrors[_0x5b64fd(0x167)](_0x5b64fd(0x178));if(_0x18d780[_0x5b64fd(0x171)]>MAX_DATA_UPDATE_IDS)throw CliErrors['validation'](_0x5b64fd(0x16f)+MAX_DATA_UPDATE_IDS+'\x20records\x20per\x20call;\x20received\x20'+_0x18d780[_0x5b64fd(0x171)]+'.');return _0x18d780[_0x5b64fd(0x175)]((_0x5206f0,_0x4968de)=>parseDataUpdateId(_0x5206f0,Array[_0x5b64fd(0x16a)](_0x49a118)?_0x5b64fd(0x16b)+_0x4968de+']':'id'));}export function normalizeUpdateParamsForRuntime(_0x58393c,_0x3501bb){const _0x3a7c9a=a173_0xc423;if(Array[_0x3a7c9a(0x16a)](_0x58393c['id'])&&_0x3501bb['length']>0x1)return{..._0x58393c,'id':_0x3501bb[_0x3a7c9a(0x174)](',')};return _0x58393c;}
|