@lovrabet/lovrabet-cli 2.3.4 → 2.3.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -1
- 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.d.ts +2 -0
- package/lib/commands/data/import-excel.js +1 -0
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/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 +21 -5
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.d.ts +1 -0
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.d.ts +5 -0
- package/lib/framework/access-error.js +1 -0
- 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.d.ts +2 -17
- 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.d.ts +25 -0
- package/lib/services/dataset-import/auto-id-runner.js +1 -0
- package/lib/services/dataset-import/excel-reader.d.ts +3 -0
- package/lib/services/dataset-import/excel-reader.js +1 -0
- package/lib/services/dataset-import/metadata.d.ts +2 -0
- package/lib/services/dataset-import/metadata.js +1 -0
- package/lib/services/dataset-import/preview.d.ts +4 -0
- package/lib/services/dataset-import/preview.js +1 -0
- package/lib/services/dataset-import/runner.d.ts +63 -0
- package/lib/services/dataset-import/runner.js +1 -0
- package/lib/services/dataset-import/types.d.ts +33 -0
- package/lib/services/dataset-import/types.js +1 -0
- 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 +8 -3
- package/skills/lovrabet/SKILL.md +10 -5
- package/skills/lovrabet/guides/dataset-and-data-workflow.md +4 -2
- package/skills/lovrabet/guides/role-and-permission-workflow.md +14 -0
- package/skills/lovrabet/guides/sql-and-bff-workflow.md +1 -1
- package/skills/lovrabet/guides/troubleshooting.md +7 -1
- package/skills/lovrabet/references/instant-api-workflow.md +6 -2
- package/skills/lovrabet/references/lovrabet-approval-workflow.md +16 -2
- package/skills/lovrabet/references/lovrabet-bff-workflow.md +9 -0
- package/skills/lovrabet/references/lovrabet-db-table-excel-import.md +113 -0
- package/skills/lovrabet/references/lovrabet-excel-import.md +31 -0
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +1 -1
- package/skills/lovrabet/references/lovrabet-personal-bff-workflow.md +2 -0
- package/skills/lovrabet.manifest.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xaf4997,_0x32a7d3){const _0x20529a=a151_0x5501,_0x3760a0=_0xaf4997();while(!![]){try{const _0x58dc9=parseInt(_0x20529a(0xaf))/0x1*(parseInt(_0x20529a(0xa1))/0x2)+-parseInt(_0x20529a(0xb4))/0x3+-parseInt(_0x20529a(0xc0))/0x4+parseInt(_0x20529a(0xbd))/0x5+parseInt(_0x20529a(0xa4))/0x6*(-parseInt(_0x20529a(0xa5))/0x7)+parseInt(_0x20529a(0x9f))/0x8+parseInt(_0x20529a(0xab))/0x9;if(_0x58dc9===_0x32a7d3)break;else _0x3760a0['push'](_0x3760a0['shift']());}catch(_0x4dcb6b){_0x3760a0['push'](_0x3760a0['shift']());}}}(a151_0x5419,0xbc0d7));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';function a151_0x5419(){const _0x5b4137=['isArray','link','code','dir','validation','from','2093250lPEyCj','localeCompare','skillCode','1359812lEEmjB','isDirectory','cacheDir','sort','startsWith','has','env','linkedPaths','project','values','3698448ranlBv','scopes','1495174OpmVIz','filter','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','1077486kbNTNr','49bhAzSW','appCode','get','isSymbolicLink','scope','name','20202507kMstHg','linkedPath','local','skillMdPath','1ReKzPm','trim','cache','source','map','4517949KkyJbJ','tags','accessKey'];a151_0x5419=function(){return _0x5b4137;};return a151_0x5419();}function a151_0x5501(_0x14e6c4,_0x5c6bad){_0x14e6c4=_0x14e6c4-0x9c;const _0x5419ba=a151_0x5419();let _0x5501ef=_0x5419ba[_0x14e6c4];return _0x5501ef;}export function listLocalRuntimeSkills(_0xf13914,_0x1bbee2,_0x112489={}){const _0x86ff5=a151_0x5501,_0x42b0f1=safePathSegment(_0xf13914[_0x86ff5(0xa6)],_0x86ff5(0xa6));if(_0x1bbee2[_0x86ff5(0xa6)]!==_0x42b0f1)throw CliErrors[_0x86ff5(0xbb)](_0x86ff5(0xa3)+_0x1bbee2[_0x86ff5(0xa6)]+'\x20!=\x20'+_0x42b0f1);const _0x182bc6=normalizeRuntimeSkillScopes(_0xf13914[_0x86ff5(0xa0)]),_0x591694=new Set(_0x182bc6),_0x3faf8c=_0xf13914[_0x86ff5(0xb9)]?.[_0x86ff5(0xb0)](),_0x473688=new Map(),_0x42683f=resolve(getRuntimeSkillCacheRoot(_0xf13914[_0x86ff5(0xc6)],_0xf13914[_0x86ff5(0xb6)],_0x112489),_0x42b0f1);for(const _0x248981 of _0x182bc6){for(const _0x4ee8d4 of localSkillEntryDirs(resolve(_0x42683f,_0x248981))){collectLocalRuntimeSkill(_0x473688,_0x4ee8d4,{'appCode':_0x42b0f1,'scopes':_0x591694,'code':_0x3faf8c,'source':_0x86ff5(0xb1)});}}for(const _0x5385d4 of _0x1bbee2['skillRoots']){for(const _0x392a13 of localSkillLinkCandidates(_0x5385d4,_0x1bbee2,_0x591694)){collectLocalRuntimeSkill(_0x473688,_0x392a13,{'appCode':_0x42b0f1,'scopes':_0x591694,'code':_0x3faf8c,'source':_0x86ff5(0xb8),'linkedPath':_0x392a13});}}return Array[_0x86ff5(0xbc)](_0x473688[_0x86ff5(0x9e)]())['sort'](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x318e0f){const _0x23f9a3=a151_0x5501;if(!existsSync(_0x318e0f))return[];return readdirSync(_0x318e0f,{'withFileTypes':!![]})[_0x23f9a3(0xa2)](_0x135b28=>_0x135b28[_0x23f9a3(0xc1)]()||_0x135b28['isSymbolicLink']())[_0x23f9a3(0xb3)](_0x188626=>resolve(_0x318e0f,_0x188626[_0x23f9a3(0xaa)]));}function localSkillLinkCandidates(_0x5ab3ed,_0x5399c3,_0x386863){const _0x14fd1d=a151_0x5501;if(!existsSync(_0x5ab3ed))return[];const _0x59161e=_0x5399c3['appCode']+'--';return readdirSync(_0x5ab3ed,{'withFileTypes':!![]})[_0x14fd1d(0xa2)](_0x5f092f=>_0x5f092f[_0x14fd1d(0xc1)]()||_0x5f092f[_0x14fd1d(0xa8)]())['filter'](_0x1c2cda=>_0x5399c3[_0x14fd1d(0xa9)]===_0x14fd1d(0x9d)||_0x1c2cda[_0x14fd1d(0xaa)][_0x14fd1d(0xc4)](_0x59161e)||_0x386863['has']('builtin'))[_0x14fd1d(0xb3)](_0xde15e9=>resolve(_0x5ab3ed,_0xde15e9['name']));}function collectLocalRuntimeSkill(_0x344458,_0x2e99f0,_0x1f4863){const _0x1f2e97=a151_0x5501,_0x54ed84=resolve(_0x2e99f0,METADATA_FILE),_0x2dbf5c=readMetadataIfPresent(_0x54ed84);if(!_0x2dbf5c)return;if(_0x2dbf5c['appCode']!==_0x1f4863[_0x1f2e97(0xa6)])return;if(!isRuntimeSkillScope(_0x2dbf5c[_0x1f2e97(0xa9)])||!_0x1f4863[_0x1f2e97(0xa0)][_0x1f2e97(0xc5)](_0x2dbf5c[_0x1f2e97(0xa9)]))return;const _0x5c289a=_0x2dbf5c[_0x1f2e97(0xbf)]?.[_0x1f2e97(0xb0)]();if(!_0x5c289a)return;if(_0x1f4863['code']&&_0x5c289a!==_0x1f4863[_0x1f2e97(0xb9)])return;const _0x2f377d=_0x2dbf5c[_0x1f2e97(0xa9)]+':'+_0x5c289a,_0x1b49f9=_0x1f4863[_0x1f2e97(0xac)]?[_0x1f4863[_0x1f2e97(0xac)]]:[],_0x548c41=_0x344458[_0x1f2e97(0xa7)](_0x2f377d);if(_0x548c41){_0x1f4863[_0x1f2e97(0xb2)]===_0x1f2e97(0xb1)&&(_0x548c41[_0x1f2e97(0xba)]=_0x2e99f0,_0x548c41[_0x1f2e97(0xc2)]=_0x2e99f0,_0x548c41[_0x1f2e97(0xae)]=resolve(_0x2e99f0,SKILL_FILE),_0x548c41['metadataPath']=_0x54ed84);for(const _0x1dbdaf of _0x1b49f9){!_0x548c41[_0x1f2e97(0x9c)]['includes'](_0x1dbdaf)&&_0x548c41[_0x1f2e97(0x9c)]['push'](_0x1dbdaf);}_0x548c41[_0x1f2e97(0x9c)][_0x1f2e97(0xc3)]();return;}_0x344458['set'](_0x2f377d,{..._0x2dbf5c,'tags':Array[_0x1f2e97(0xb7)](_0x2dbf5c[_0x1f2e97(0xb5)])?_0x2dbf5c[_0x1f2e97(0xb5)]:[],'scope':_0x2dbf5c[_0x1f2e97(0xa9)],'source':_0x1f2e97(0xad),'dir':_0x2e99f0,'cacheDir':_0x1f4863[_0x1f2e97(0xb2)]===_0x1f2e97(0xb1)?_0x2e99f0:undefined,'skillMdPath':resolve(_0x2e99f0,SKILL_FILE),'metadataPath':_0x54ed84,'linkedPaths':_0x1b49f9});}function compareLocalRuntimeSkills(_0x1df308,_0x555a1a){const _0x158184=a151_0x5501,_0x2e0572={'personal':0x0,'company':0x1,'builtin':0x2};return _0x2e0572[_0x1df308[_0x158184(0xa9)]]-_0x2e0572[_0x555a1a[_0x158184(0xa9)]]||_0x1df308[_0x158184(0xbf)][_0x158184(0xbe)](_0x555a1a['skillCode'])||_0x1df308['dir'][_0x158184(0xbe)](_0x555a1a[_0x158184(0xba)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a152_0x52b3(){const _0x36e851=['3126140pBzKpt','3966JRBVyl','localeCompare','isSafeInteger','7663130hmzXab','isFile','string','validation','Skill\x20file\x20path\x20must\x20be\x20text.','length','utf8','Skill\x20file\x20sha256\x20is\x20invalid:\x20','from','26728DelBwX','420YmpYov','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','compare','toString','includes','path','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','42vERpfc','object','has','isDirectory','content','name','test','replace','isArray','258404ZWTHXA','Unsafe\x20Skill\x20file\x20path:\x20','Duplicate\x20Skill\x20file\x20path:\x20','trim','isBuffer','17989mCGnNs','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','add','sha256','push','set','1935SrZZvj','855gWUgal','excludedFilePaths','sort','bytes','size'];a152_0x52b3=function(){return _0x36e851;};return a152_0x52b3();}(function(_0x55b199,_0x1772df){const _0x4adb6f=a152_0x121e,_0x4c8333=_0x55b199();while(!![]){try{const _0x5b2a48=parseInt(_0x4adb6f(0xf4))/0x1*(-parseInt(_0x4adb6f(0xe6))/0x2)+parseInt(_0x4adb6f(0xfb))/0x3+-parseInt(_0x4adb6f(0xef))/0x4+-parseInt(_0x4adb6f(0x100))/0x5+parseInt(_0x4adb6f(0x101))/0x6*(-parseInt(_0x4adb6f(0xdf))/0x7)+parseInt(_0x4adb6f(0xde))/0x8*(parseInt(_0x4adb6f(0xfa))/0x9)+parseInt(_0x4adb6f(0x104))/0xa;if(_0x5b2a48===_0x1772df)break;else _0x4c8333['push'](_0x4c8333['shift']());}catch(_0x3f2a62){_0x4c8333['push'](_0x4c8333['shift']());}}}(a152_0x52b3,0x5c337));function a152_0x121e(_0x320dea,_0x3f4b4a){_0x320dea=_0x320dea-0xd7;const _0x52b3c7=a152_0x52b3();let _0x121e35=_0x52b3c7[_0x320dea];return _0x121e35;}import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x48b26c){const _0x4e8d9b=a152_0x121e;return _0x48b26c[_0x4e8d9b(0xfe)]??Buffer['from'](_0x48b26c[_0x4e8d9b(0xea)]??'','utf8');}export function fileText(_0x3a6bb5){const _0x2905f5=a152_0x121e;return fileContent(_0x3a6bb5)[_0x2905f5(0xe2)](_0x2905f5(0xdb));}export function normalizeLocalFiles(_0x294cd7){const _0x4c2865=a152_0x121e;if(!Array[_0x4c2865(0xee)](_0x294cd7)||_0x294cd7[_0x4c2865(0xda)]===0x0)return[];const _0x4f4808=new Map();for(const _0x2f2b50 of _0x294cd7){if(!_0x2f2b50||typeof _0x2f2b50!=='object'||typeof _0x2f2b50[_0x4c2865(0xe4)]!=='string')throw CliErrors[_0x4c2865(0xd8)](_0x4c2865(0xd9));const _0x16c2bb=normalizeSkillRelativePath(_0x2f2b50['path']);if(_0x4f4808[_0x4c2865(0xe8)](_0x16c2bb))throw CliErrors[_0x4c2865(0xd8)](_0x4c2865(0xf1)+_0x16c2bb);if(_0x2f2b50[_0x4c2865(0xfe)]!==undefined&&!Buffer[_0x4c2865(0xf3)](_0x2f2b50[_0x4c2865(0xfe)]))throw CliErrors['validation'](_0x4c2865(0xe5)+_0x16c2bb);if(_0x2f2b50[_0x4c2865(0xfe)]===undefined&&typeof _0x2f2b50[_0x4c2865(0xea)]!==_0x4c2865(0xd7))throw CliErrors[_0x4c2865(0xd8)](_0x4c2865(0xf5)+_0x16c2bb);const _0x25eeec=fileContent(_0x2f2b50);_0x4f4808[_0x4c2865(0xf9)](_0x16c2bb,{'path':_0x16c2bb,'bytes':_0x25eeec});}return Array[_0x4c2865(0xdd)](_0x4f4808['values']())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x5317bc){const _0x5d77ea=a152_0x121e;if(!Array[_0x5d77ea(0xee)](_0x5317bc)||_0x5317bc[_0x5d77ea(0xda)]===0x0)return[];const _0x3edefd=new Map();for(const _0x3eed73 of _0x5317bc){if(!_0x3eed73||typeof _0x3eed73!==_0x5d77ea(0xe7)||typeof _0x3eed73['path']!==_0x5d77ea(0xd7))throw CliErrors[_0x5d77ea(0xd8)](_0x5d77ea(0xd9));const _0x193dc3=normalizeSkillRelativePath(_0x3eed73[_0x5d77ea(0xe4)]);if(_0x3edefd[_0x5d77ea(0xe8)](_0x193dc3))throw CliErrors[_0x5d77ea(0xd8)](_0x5d77ea(0xf1)+_0x193dc3);if(!isSha256Hex(_0x3eed73[_0x5d77ea(0xf7)]))throw CliErrors[_0x5d77ea(0xd8)](_0x5d77ea(0xdc)+_0x193dc3);if(!Number[_0x5d77ea(0x103)](_0x3eed73[_0x5d77ea(0xff)])||_0x3eed73[_0x5d77ea(0xff)]<0x0)throw CliErrors[_0x5d77ea(0xd8)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x193dc3);_0x3edefd[_0x5d77ea(0xf9)](_0x193dc3,{'path':_0x193dc3,'sha256':_0x3eed73[_0x5d77ea(0xf7)]['toLowerCase'](),'size':_0x3eed73[_0x5d77ea(0xff)]});}return Array[_0x5d77ea(0xdd)](_0x3edefd['values']())[_0x5d77ea(0xfd)](compareSkillFiles);}export function scanSkillDirectory(_0x5cb862,_0x57810f={}){const _0x2999ac=a152_0x121e,_0x39b442=realpathSync(_0x5cb862),_0x244e97=canonicalExcludedFilePaths(_0x57810f[_0x2999ac(0xfc)]),_0x23da41=[];function _0x109eb7(_0x42cc9f){const _0x49f3fb=_0x2999ac,_0x4323d0=readdirSync(_0x42cc9f,{'withFileTypes':!![]})[_0x49f3fb(0xfd)]((_0x600099,_0x5517e4)=>_0x600099[_0x49f3fb(0xeb)][_0x49f3fb(0x102)](_0x5517e4[_0x49f3fb(0xeb)]));for(const _0x409de3 of _0x4323d0){if(_0x409de3[_0x49f3fb(0xe9)]()&&IGNORED_DIR_NAMES[_0x49f3fb(0xe8)](_0x409de3[_0x49f3fb(0xeb)]))continue;if(IGNORED_FILE_NAMES[_0x49f3fb(0xe8)](_0x409de3['name']))continue;const _0x3e5e03=resolve(_0x42cc9f,_0x409de3[_0x49f3fb(0xeb)]);if(isExcludedFilePath(_0x3e5e03,_0x244e97))continue;if(_0x409de3['isSymbolicLink']())throw CliErrors[_0x49f3fb(0xd8)](_0x49f3fb(0xe0)+_0x3e5e03);const _0xb56167=toPosixPath(relative(_0x39b442,_0x3e5e03));if(_0x409de3['isDirectory']()){_0x109eb7(_0x3e5e03);continue;}if(!_0x409de3[_0x49f3fb(0x105)]())continue;validateSkillRelativePath(_0xb56167);const _0x3a3978=readFileSync(_0x3e5e03);_0x23da41[_0x49f3fb(0xf8)]({'path':_0xb56167,'bytes':_0x3a3978});}}return _0x109eb7(_0x39b442),normalizeLocalFiles(_0x23da41);}function canonicalExcludedFilePaths(_0x2a9a17){const _0x17fe92=a152_0x121e,_0x30616a=new Set();for(const _0x1e444f of _0x2a9a17??[]){const _0x2ac5a8=resolve(_0x1e444f);_0x30616a[_0x17fe92(0xf6)](_0x2ac5a8);try{_0x30616a[_0x17fe92(0xf6)](realpathSync(_0x2ac5a8));}catch{}}return _0x30616a;}function isExcludedFilePath(_0x3e03dd,_0x51616a){const _0x3accf6=a152_0x121e;if(_0x51616a['has'](_0x3e03dd))return!![];if(_0x51616a[_0x3accf6(0xff)]===0x0)return![];try{return _0x51616a[_0x3accf6(0xe8)](realpathSync(_0x3e03dd));}catch{return![];}}export function compareSkillFiles(_0x37945a,_0x2c3fd1){const _0x4b430e=a152_0x121e;if(_0x37945a[_0x4b430e(0xe4)]===SKILL_FILE)return _0x2c3fd1['path']===SKILL_FILE?0x0:-0x1;if(_0x2c3fd1[_0x4b430e(0xe4)]===SKILL_FILE)return 0x1;return Buffer[_0x4b430e(0xe1)](Buffer[_0x4b430e(0xdd)](_0x37945a[_0x4b430e(0xe4)],_0x4b430e(0xdb)),Buffer[_0x4b430e(0xdd)](_0x2c3fd1[_0x4b430e(0xe4)],_0x4b430e(0xdb)));}export function normalizeSkillRelativePath(_0x106960){const _0x5b290f=a152_0x121e,_0x26f98b=toPosixPath(_0x106960[_0x5b290f(0xf2)]());return validateSkillRelativePath(_0x26f98b),_0x26f98b;}export function validateSkillRelativePath(_0x2d8155){const _0x640513=a152_0x121e;if(!_0x2d8155||_0x2d8155['startsWith']('/')||_0x2d8155[_0x640513(0xe3)]('//'))throw CliErrors['validation'](_0x640513(0xf0)+_0x2d8155);for(const _0x2e3613 of _0x2d8155['split']('/')){if(!_0x2e3613||_0x2e3613==='.'||_0x2e3613==='..')throw CliErrors[_0x640513(0xd8)](_0x640513(0xf0)+_0x2d8155);}}export function toPosixPath(_0x11c8d4){const _0x1b66ac=a152_0x121e;return _0x11c8d4[_0x1b66ac(0xed)](/\\/g,'/');}export function isSha256Hex(_0x192f27){const _0x5a9864=a152_0x121e;return typeof _0x192f27==='string'&&/^[a-fA-F0-9]{64}$/[_0x5a9864(0xec)](_0x192f27);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x52d492,_0x59de35){const _0x2f9fc1=a145_0x5519,_0x5de6f5=_0x52d492();while(!![]){try{const _0x4f99ec=parseInt(_0x2f9fc1(0x8f))/0x1*(parseInt(_0x2f9fc1(0xb4))/0x2)+parseInt(_0x2f9fc1(0xa3))/0x3*(-parseInt(_0x2f9fc1(0xb9))/0x4)+-parseInt(_0x2f9fc1(0x9b))/0x5+parseInt(_0x2f9fc1(0x9c))/0x6*(-parseInt(_0x2f9fc1(0x98))/0x7)+-parseInt(_0x2f9fc1(0x81))/0x8*(-parseInt(_0x2f9fc1(0xa0))/0x9)+-parseInt(_0x2f9fc1(0xab))/0xa+-parseInt(_0x2f9fc1(0x89))/0xb*(-parseInt(_0x2f9fc1(0xaf))/0xc);if(_0x4f99ec===_0x59de35)break;else _0x5de6f5['push'](_0x5de6f5['shift']());}catch(_0x5e776d){_0x5de6f5['push'](_0x5de6f5['shift']());}}}(a145_0x503a,0x33fc7));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';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x8e6f31,_0xed00ac,_0x1a6e77){const _0xaa81=a145_0x5519,_0x2a0a18=requireSkillCode(_0x8e6f31),_0x4257de=requirePackageBytes(_0x2a0a18,_0x1a6e77[_0xaa81(0xaa)]),_0x55ac0d=extractDownloadedPackage(_0x4257de),_0x4505ce=_0x55ac0d[_0xaa81(0x92)](_0x5bf6be=>_0x5bf6be[_0xaa81(0x9f)]===SKILL_FILE);if(!_0x4505ce)throw CliErrors[_0xaa81(0xa7)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x2a0a18);const _0x38d723=withMaterializedSkillFrontmatter(_0x55ac0d,_0x8e6f31,_0x2a0a18),_0xd006a7=_0x38d723['find'](_0x541020=>_0x541020[_0xaa81(0x9f)]===SKILL_FILE),_0x1b14f5=fileText(_0xd006a7),_0x31297c=getRuntimeSkillDir(_0x1a6e77[_0xaa81(0x84)],_0x1a6e77[_0xaa81(0x91)],_0x1a6e77[_0xaa81(0x8e)],_0xed00ac,_0x2a0a18,_0x1a6e77[_0xaa81(0xa4)]),_0x3ca553=resolve(_0x31297c,SKILL_FILE),_0x5cc3ec=resolve(_0x31297c,METADATA_FILE),_0x2d6a94=contentHash(_0x1b14f5),_0x2ad28b=readMetadataIfPresent(_0x5cc3ec)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x31297c,_0x5cc3ec,_0x38d723,_0x1a6e77[_0xaa81(0x8b)]===!![]),mkdirSync(_0x31297c,{'recursive':!![],'mode':0x1c0});const _0x2fb602=existsSync(_0x3ca553)?readFileSync(_0x3ca553,_0xaa81(0x88)):undefined;return materializeFiles(_0x31297c,_0x38d723),removeStaleManagedFiles(_0x31297c,_0x2ad28b,_0x38d723),writeJsonAtomic(_0x5cc3ec,buildMetadata(_0x8e6f31,_0xed00ac,_0x1a6e77[_0xaa81(0x8e)],_0x2d6a94,_0x1a6e77[_0xaa81(0xb5)],_0x38d723,_0x4257de)),{'skill':_0x8e6f31,'scope':_0xed00ac,'dir':_0x31297c,'skillMdPath':_0x3ca553,'metadataPath':_0x5cc3ec,'contentHash':_0x2d6a94,'changed':_0x2fb602!==_0x1b14f5};}export function reuseMaterializedRuntimeSkill(_0x5ace4d,_0x3e0bb2,_0x433e8c){const _0x8a4613=a145_0x5519,_0x13826f=_0x5ace4d[_0x8a4613(0xbd)]?.['trim']();if(!_0x13826f)return undefined;const _0x53d7d5=requireSkillCode(_0x5ace4d),_0x1da9d7=getRuntimeSkillDir(_0x433e8c[_0x8a4613(0x84)],_0x433e8c[_0x8a4613(0x91)],_0x433e8c['appCode'],_0x3e0bb2,_0x53d7d5,_0x433e8c[_0x8a4613(0xa4)]),_0x240b68=resolve(_0x1da9d7,SKILL_FILE),_0xd8794c=resolve(_0x1da9d7,METADATA_FILE),_0x49d0f0=readMetadataIfPresent(_0xd8794c);if(!_0x49d0f0||_0x49d0f0[_0x8a4613(0xbe)]!==0x2||_0x49d0f0[_0x8a4613(0x8e)]!==_0x433e8c[_0x8a4613(0x8e)]||_0x49d0f0[_0x8a4613(0x80)]!==_0x3e0bb2||_0x49d0f0[_0x8a4613(0xb1)]!==_0x53d7d5||_0x49d0f0['version']!==_0x13826f||_0x49d0f0['id']!==_0x5ace4d['id']||_0x49d0f0['skillName']!==_0x5ace4d[_0x8a4613(0x83)]||_0x49d0f0[_0x8a4613(0x9a)]!==_0x5ace4d[_0x8a4613(0x9a)]||_0x49d0f0[_0x8a4613(0x8a)]!==_0x5ace4d[_0x8a4613(0x8a)]||_0x49d0f0[_0x8a4613(0x99)]!==_0x5ace4d[_0x8a4613(0x99)]||!_0x49d0f0['contentHash']||!_0x49d0f0[_0x8a4613(0x9e)]||!Object[_0x8a4613(0xa5)](_0x49d0f0[_0x8a4613(0x9e)],SKILL_FILE))return undefined;for(const [_0x320432,_0x47586b]of Object[_0x8a4613(0xac)](_0x49d0f0['fileHashes'])){if(!/^[a-f0-9]{64}$/[_0x8a4613(0xa2)](_0x47586b))return undefined;const _0x7b0945=resolveManagedFilePath(_0x1da9d7,_0x320432);if(!existsSync(_0x7b0945)||!lstatSync(_0x7b0945)[_0x8a4613(0x90)]())return undefined;if(bufferSha256(readFileSync(_0x7b0945))!==_0x47586b)return undefined;}return{'skill':_0x5ace4d,'scope':_0x3e0bb2,'dir':_0x1da9d7,'skillMdPath':_0x240b68,'metadataPath':_0xd8794c,'contentHash':_0x49d0f0[_0x8a4613(0x93)],'changed':![]};}function a145_0x503a(){const _0x250c92=['errors','skillName','env','displayName:\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','length','utf8','11PQfwiK','example','force','join','name:\x20','appCode','329486GfrpkW','isFile','accessKey','find','contentHash','contents','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','replace','21gABfHq','status','description','1735520SMPreY','247446HTlxUs','.\x20Changed\x20file:\x20','fileHashes','path','4239hEubwQ','\x0a---\x0a\x0a','test','9987kmTFpR','paths','hasOwn','stringify','validation','slice','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','packageBytes','902780zxFMyR','entries','trimEnd','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','5521044rUckWI','filter','skillCode','displayName','keys','2xOeTAX','pulledAt','trim','delete','match','352UKzdsn','---','toString','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','version','schemaVersion','has','---\x0a','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','scope','4712FgRPsi'];a145_0x503a=function(){return _0x250c92;};return a145_0x503a();}function withMaterializedSkillFrontmatter(_0xe9ad81,_0x1951b5,_0x40b3c5){const _0x535dda=a145_0x5519,_0x4cad3a=skillDisplayName(_0x1951b5,_0x40b3c5),_0x4d88e6=_0x1951b5[_0x535dda(0x9a)]?.[_0x535dda(0xb6)]()||_0x4cad3a||_0x40b3c5;return normalizeLocalFiles(_0xe9ad81)['map'](_0x268c14=>{const _0x5a9a6d=_0x535dda,_0x5e09d7=fileText(_0x268c14);if(_0x268c14[_0x5a9a6d(0x9f)]!==SKILL_FILE)return _0x268c14;if(hasYamlFrontmatter(_0x5e09d7))return{'path':_0x268c14[_0x5a9a6d(0x9f)],'content':withSyncedDisplayName(_0x5e09d7,_0x4cad3a)};return{'path':_0x268c14[_0x5a9a6d(0x9f)],'content':prependSkillFrontmatter(_0x5e09d7,{'name':_0x40b3c5,'displayName':_0x4cad3a,'description':_0x4d88e6})};});}function hasYamlFrontmatter(_0x33fca3){return/^\uFEFF?---\s*\r?\n/['test'](_0x33fca3);}function prependSkillFrontmatter(_0x1a74b8,_0x3ba3bb){const _0x502ae7=a145_0x5519,_0x573944=_0x1a74b8[_0x502ae7(0x97)](/^\uFEFF/,'');return['---',_0x502ae7(0x8d)+yamlString(_0x3ba3bb['name']),_0x3ba3bb[_0x502ae7(0xb2)]?_0x502ae7(0x85)+yamlString(_0x3ba3bb[_0x502ae7(0xb2)]):undefined,'description:\x20'+yamlString(_0x3ba3bb[_0x502ae7(0x9a)]),_0x502ae7(0xba),'',_0x573944][_0x502ae7(0xb0)](_0x25aa07=>_0x25aa07!==undefined)[_0x502ae7(0x8c)]('\x0a');}function yamlString(_0x560eee){const _0x4565d3=a145_0x5519;return JSON[_0x4565d3(0xa6)](_0x560eee[_0x4565d3(0x97)](/\r/g,'')[_0x4565d3(0xb6)]());}function skillDisplayName(_0x4a1bc5,_0x4f59a6){const _0x56a703=a145_0x5519,_0x4bae77=_0x4a1bc5[_0x56a703(0x83)]?.[_0x56a703(0xb6)]();return _0x4bae77||_0x4f59a6;}function withSyncedDisplayName(_0x19b71b,_0x592948){const _0x3cdcda=a145_0x5519,_0x3a8e29=_0x19b71b[_0x3cdcda(0xb8)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3a8e29)return _0x19b71b;const _0x14d730=_0x3a8e29[0x1]??'',_0x48d1db=_0x3a8e29[0x2]??'',_0x47331a=parseDocument(_0x48d1db);if(_0x47331a[_0x3cdcda(0x82)][_0x3cdcda(0x87)]>0x0||!isMap(_0x47331a[_0x3cdcda(0x94)]))return _0x19b71b;if(_0x592948)_0x47331a['set']('displayName',_0x592948);else{if(_0x47331a[_0x3cdcda(0x7d)]('displayName'))_0x47331a[_0x3cdcda(0xb7)](_0x3cdcda(0xb2));else return _0x19b71b;}forceBlockCollections(_0x47331a[_0x3cdcda(0x94)]);const _0x4ed91d=_0x47331a[_0x3cdcda(0xbb)]({'lineWidth':0x0})[_0x3cdcda(0xad)](),_0x2f7de0=_0x19b71b[_0x3cdcda(0xa8)](_0x3a8e29[0x0][_0x3cdcda(0x87)])[_0x3cdcda(0x97)](/^\r?\n/,'');return _0x14d730+_0x3cdcda(0x7e)+_0x4ed91d+_0x3cdcda(0xa1)+_0x2f7de0;}function forceBlockCollections(_0xfe4a1b){if(!isNode(_0xfe4a1b))return;visit(_0xfe4a1b,(_0x19bf9e,_0x2cbb4e)=>{isCollection(_0x2cbb4e)&&(_0x2cbb4e['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x524cc5,_0x14cf2e,_0x3c362e,_0x1dbb54){const _0x150029=a145_0x5519;if(_0x1dbb54||!existsSync(_0x14cf2e))return;const _0x2d9d0e=readMetadataIfPresent(_0x14cf2e);if(!_0x2d9d0e)return;const _0x13d169=_0x2d9d0e[_0x150029(0x9e)]&&Object[_0x150029(0xb3)](_0x2d9d0e[_0x150029(0x9e)])[_0x150029(0x87)]>0x0?_0x2d9d0e['fileHashes']:undefined;if(_0x13d169)for(const [_0x38c0bb,_0x4de4cb]of Object[_0x150029(0xac)](_0x13d169)){const _0x3eb575=resolveManagedFilePath(_0x524cc5,_0x38c0bb);if(!existsSync(_0x3eb575))throw CliErrors[_0x150029(0xa7)](_0x150029(0x7f)+_0x524cc5,_0x150029(0x86)+_0x38c0bb);const _0x55ef81=lstatSync(_0x3eb575);if(!_0x55ef81['isFile']())throw CliErrors[_0x150029(0xa7)](_0x150029(0x7f)+_0x524cc5,_0x150029(0xa9)+_0x38c0bb);const _0x58a2f8=bufferSha256(readFileSync(_0x3eb575));if(_0x58a2f8!==_0x4de4cb)throw CliErrors[_0x150029(0xa7)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x524cc5+_0x150029(0x9d)+_0x38c0bb,_0x150029(0xbc)+_0x38c0bb);}else{const _0x4eb44a=resolve(_0x524cc5,SKILL_FILE);if(existsSync(_0x4eb44a)&&_0x2d9d0e[_0x150029(0x93)]){const _0x5cdd2c=contentHash(readFileSync(_0x4eb44a,_0x150029(0x88)));if(_0x5cdd2c!==_0x2d9d0e['contentHash'])throw CliErrors[_0x150029(0xa7)](_0x150029(0x95)+_0x4eb44a,_0x150029(0x96));}}for(const _0x2ea53 of normalizeLocalFiles(_0x3c362e)){if(_0x13d169?.[_0x2ea53[_0x150029(0x9f)]])continue;if(!_0x13d169&&_0x2ea53[_0x150029(0x9f)]===SKILL_FILE)continue;const _0x30bbc8=resolveManagedFilePath(_0x524cc5,_0x2ea53['path']);if(!existsSync(_0x30bbc8))continue;const _0x5e587b=lstatSync(_0x30bbc8);if(!_0x5e587b[_0x150029(0x90)]())throw CliErrors[_0x150029(0xa7)](_0x150029(0x7f)+_0x524cc5,_0x150029(0xae)+_0x2ea53['path']);const _0x4fe3ca=bufferSha256(readFileSync(_0x30bbc8));if(_0x4fe3ca!==fileHash(_0x2ea53))throw CliErrors[_0x150029(0xa7)](_0x150029(0x7f)+_0x524cc5,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x2ea53['path']);}}function a145_0x5519(_0x1b9f52,_0x190b9a){_0x1b9f52=_0x1b9f52-0x7d;const _0x503a6f=a145_0x503a();let _0x5519b4=_0x503a6f[_0x1b9f52];return _0x5519b4;}function materializeFiles(_0x588b58,_0x4f1ebb){const _0x527552=a145_0x5519;for(const _0x3e583a of normalizeLocalFiles(_0x4f1ebb)){const _0x2ac1f7=resolveManagedFilePath(_0x588b58,_0x3e583a[_0x527552(0x9f)]);mkdirSync(dirname(_0x2ac1f7),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x2ac1f7,fileContent(_0x3e583a),0x180);}}function removeStaleManagedFiles(_0x52e881,_0x3ca849,_0x24b139){const _0x9a9b72=a145_0x5519;if(!_0x3ca849)return;const _0x1e711f=new Set(normalizeLocalFiles(_0x24b139)['map'](_0x2b4d27=>_0x2b4d27[_0x9a9b72(0x9f)]));for(const _0x276d20 of Object[_0x9a9b72(0xb3)](_0x3ca849)){if(_0x1e711f[_0x9a9b72(0x7d)](_0x276d20))continue;const _0x4ff9f1=resolveManagedFilePath(_0x52e881,_0x276d20);existsSync(_0x4ff9f1)&&lstatSync(_0x4ff9f1)[_0x9a9b72(0x90)]()&&rmSync(_0x4ff9f1,{'force':!![]});}}
|
|
1
|
+
(function(_0xea2750,_0xd68719){const _0x404dc6=a153_0x4eb2,_0x3e1dd3=_0xea2750();while(!![]){try{const _0x39b2b8=-parseInt(_0x404dc6(0x120))/0x1+parseInt(_0x404dc6(0x153))/0x2+parseInt(_0x404dc6(0x155))/0x3*(-parseInt(_0x404dc6(0x124))/0x4)+parseInt(_0x404dc6(0x11a))/0x5*(-parseInt(_0x404dc6(0x14b))/0x6)+parseInt(_0x404dc6(0x149))/0x7+parseInt(_0x404dc6(0x139))/0x8*(-parseInt(_0x404dc6(0x143))/0x9)+parseInt(_0x404dc6(0x11f))/0xa*(parseInt(_0x404dc6(0x14f))/0xb);if(_0x39b2b8===_0xd68719)break;else _0x3e1dd3['push'](_0x3e1dd3['shift']());}catch(_0x13f76c){_0x3e1dd3['push'](_0x3e1dd3['shift']());}}}(a153_0xbfba,0x75748));function a153_0x4eb2(_0x5fb2bd,_0x4f11d7){_0x5fb2bd=_0x5fb2bd-0x118;const _0xbfba2c=a153_0xbfba();let _0x4eb27b=_0xbfba2c[_0x5fb2bd];return _0x4eb27b;}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';function a153_0xbfba(){const _0x1b0673=['---','has','4800607RREjzb','utf8','74130IXAkIa','paths','slice','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','165XMXGuI','env','force','status','193828VspcZS','scope','30ygdBSe','example','skillCode','displayName:\x20','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','.\x20Changed\x20file:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','map','25SNBHPv','pulledAt','filter','length','appCode','808150kqqOUO','289069hEolsl','hasOwn','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','skillName','123724tbsIHD','trimEnd','name','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','join','accessKey','entries','match','replace','version','displayName','description:\x20','delete','path','fileHashes','set','schemaVersion','packageBytes','---\x0a','errors','validation','6829520fhoSEb','contentHash','keys','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','isFile','test','trim','stringify','flow','find','9RKwoUb','\x0a---\x0a\x0a','contents','description'];a153_0xbfba=function(){return _0x1b0673;};return a153_0xbfba();}import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0xe1c3d4,_0x5cabc7,_0x2f3ea6){const _0x1ce67c=a153_0x4eb2,_0x18a012=requireSkillCode(_0xe1c3d4),_0x17e8a4=requirePackageBytes(_0x18a012,_0x2f3ea6[_0x1ce67c(0x135)]),_0x3b5a38=extractDownloadedPackage(_0x17e8a4),_0x383e4d=_0x3b5a38[_0x1ce67c(0x142)](_0x204a30=>_0x204a30[_0x1ce67c(0x131)]===SKILL_FILE);if(!_0x383e4d)throw CliErrors[_0x1ce67c(0x138)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x18a012);const _0x5c3d6b=withMaterializedSkillFrontmatter(_0x3b5a38,_0xe1c3d4,_0x18a012),_0x233de3=_0x5c3d6b[_0x1ce67c(0x142)](_0x4ad228=>_0x4ad228[_0x1ce67c(0x131)]===SKILL_FILE),_0x38715e=fileText(_0x233de3),_0xf1fd61=getRuntimeSkillDir(_0x2f3ea6['env'],_0x2f3ea6[_0x1ce67c(0x129)],_0x2f3ea6[_0x1ce67c(0x11e)],_0x5cabc7,_0x18a012,_0x2f3ea6['paths']),_0x50b2a0=resolve(_0xf1fd61,SKILL_FILE),_0x40285e=resolve(_0xf1fd61,METADATA_FILE),_0x1fa755=contentHash(_0x38715e),_0x2a62dd=readMetadataIfPresent(_0x40285e)?.[_0x1ce67c(0x132)];ensurePulledFilesCanBeOverwritten(_0xf1fd61,_0x40285e,_0x5c3d6b,_0x2f3ea6[_0x1ce67c(0x151)]===!![]),mkdirSync(_0xf1fd61,{'recursive':!![],'mode':0x1c0});const _0x72af07=existsSync(_0x50b2a0)?readFileSync(_0x50b2a0,'utf8'):undefined;return materializeFiles(_0xf1fd61,_0x5c3d6b),removeStaleManagedFiles(_0xf1fd61,_0x2a62dd,_0x5c3d6b),writeJsonAtomic(_0x40285e,buildMetadata(_0xe1c3d4,_0x5cabc7,_0x2f3ea6[_0x1ce67c(0x11e)],_0x1fa755,_0x2f3ea6[_0x1ce67c(0x11b)],_0x5c3d6b,_0x17e8a4)),{'skill':_0xe1c3d4,'scope':_0x5cabc7,'dir':_0xf1fd61,'skillMdPath':_0x50b2a0,'metadataPath':_0x40285e,'contentHash':_0x1fa755,'changed':_0x72af07!==_0x38715e};}export function reuseMaterializedRuntimeSkill(_0x4cef15,_0xf8870d,_0x2fb37f){const _0x39926a=a153_0x4eb2,_0xbf7808=_0x4cef15['version']?.[_0x39926a(0x13f)]();if(!_0xbf7808)return undefined;const _0x1c9d48=requireSkillCode(_0x4cef15),_0x1a9497=getRuntimeSkillDir(_0x2fb37f[_0x39926a(0x150)],_0x2fb37f[_0x39926a(0x129)],_0x2fb37f[_0x39926a(0x11e)],_0xf8870d,_0x1c9d48,_0x2fb37f[_0x39926a(0x14c)]),_0x3d22df=resolve(_0x1a9497,SKILL_FILE),_0x44afa9=resolve(_0x1a9497,METADATA_FILE),_0x3fde93=readMetadataIfPresent(_0x44afa9);if(!_0x3fde93||_0x3fde93[_0x39926a(0x134)]!==0x2||_0x3fde93[_0x39926a(0x11e)]!==_0x2fb37f[_0x39926a(0x11e)]||_0x3fde93[_0x39926a(0x154)]!==_0xf8870d||_0x3fde93[_0x39926a(0x157)]!==_0x1c9d48||_0x3fde93[_0x39926a(0x12d)]!==_0xbf7808||_0x3fde93['id']!==_0x4cef15['id']||_0x3fde93[_0x39926a(0x123)]!==_0x4cef15['skillName']||_0x3fde93[_0x39926a(0x146)]!==_0x4cef15[_0x39926a(0x146)]||_0x3fde93[_0x39926a(0x156)]!==_0x4cef15[_0x39926a(0x156)]||_0x3fde93[_0x39926a(0x152)]!==_0x4cef15[_0x39926a(0x152)]||!_0x3fde93[_0x39926a(0x13a)]||!_0x3fde93['fileHashes']||!Object[_0x39926a(0x121)](_0x3fde93['fileHashes'],SKILL_FILE))return undefined;for(const [_0x4f81dc,_0x23618d]of Object[_0x39926a(0x12a)](_0x3fde93[_0x39926a(0x132)])){if(!/^[a-f0-9]{64}$/['test'](_0x23618d))return undefined;const _0x57ec47=resolveManagedFilePath(_0x1a9497,_0x4f81dc);if(!existsSync(_0x57ec47)||!lstatSync(_0x57ec47)[_0x39926a(0x13d)]())return undefined;if(bufferSha256(readFileSync(_0x57ec47))!==_0x23618d)return undefined;}return{'skill':_0x4cef15,'scope':_0xf8870d,'dir':_0x1a9497,'skillMdPath':_0x3d22df,'metadataPath':_0x44afa9,'contentHash':_0x3fde93[_0x39926a(0x13a)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x16b45d,_0x550d11,_0x5b6fa3){const _0x548b4d=a153_0x4eb2,_0x316232=skillDisplayName(_0x550d11,_0x5b6fa3),_0x30c67d=_0x550d11[_0x548b4d(0x146)]?.['trim']()||_0x316232||_0x5b6fa3;return normalizeLocalFiles(_0x16b45d)[_0x548b4d(0x119)](_0x887a08=>{const _0x13a0d6=_0x548b4d,_0x52bdfb=fileText(_0x887a08);if(_0x887a08[_0x13a0d6(0x131)]!==SKILL_FILE)return _0x887a08;if(hasYamlFrontmatter(_0x52bdfb))return{'path':_0x887a08['path'],'content':withSyncedDisplayName(_0x52bdfb,_0x316232)};return{'path':_0x887a08[_0x13a0d6(0x131)],'content':prependSkillFrontmatter(_0x52bdfb,{'name':_0x5b6fa3,'displayName':_0x316232,'description':_0x30c67d})};});}function hasYamlFrontmatter(_0x12bbc){const _0x4bf3b7=a153_0x4eb2;return/^\uFEFF?---\s*\r?\n/[_0x4bf3b7(0x13e)](_0x12bbc);}function prependSkillFrontmatter(_0x75841f,_0x5cacfa){const _0x508b75=a153_0x4eb2,_0x1b71ab=_0x75841f[_0x508b75(0x12c)](/^\uFEFF/,'');return['---','name:\x20'+yamlString(_0x5cacfa[_0x508b75(0x126)]),_0x5cacfa[_0x508b75(0x12e)]?_0x508b75(0x158)+yamlString(_0x5cacfa[_0x508b75(0x12e)]):undefined,_0x508b75(0x12f)+yamlString(_0x5cacfa[_0x508b75(0x146)]),_0x508b75(0x147),'',_0x1b71ab][_0x508b75(0x11c)](_0x5dc249=>_0x5dc249!==undefined)[_0x508b75(0x128)]('\x0a');}function yamlString(_0x1f359c){const _0x1dfa6e=a153_0x4eb2;return JSON[_0x1dfa6e(0x140)](_0x1f359c[_0x1dfa6e(0x12c)](/\r/g,'')[_0x1dfa6e(0x13f)]());}function skillDisplayName(_0x388adb,_0x15891a){const _0x2028ef=_0x388adb['skillName']?.['trim']();return _0x2028ef||_0x15891a;}function withSyncedDisplayName(_0x4e1cff,_0xce287f){const _0x1ed1a2=a153_0x4eb2,_0x11848c=_0x4e1cff[_0x1ed1a2(0x12b)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x11848c)return _0x4e1cff;const _0x417793=_0x11848c[0x1]??'',_0x45b387=_0x11848c[0x2]??'',_0x562ad5=parseDocument(_0x45b387);if(_0x562ad5[_0x1ed1a2(0x137)][_0x1ed1a2(0x11d)]>0x0||!isMap(_0x562ad5['contents']))return _0x4e1cff;if(_0xce287f)_0x562ad5[_0x1ed1a2(0x133)](_0x1ed1a2(0x12e),_0xce287f);else{if(_0x562ad5[_0x1ed1a2(0x148)](_0x1ed1a2(0x12e)))_0x562ad5[_0x1ed1a2(0x130)]('displayName');else return _0x4e1cff;}forceBlockCollections(_0x562ad5[_0x1ed1a2(0x145)]);const _0x213724=_0x562ad5['toString']({'lineWidth':0x0})[_0x1ed1a2(0x125)](),_0x44b1f4=_0x4e1cff[_0x1ed1a2(0x14d)](_0x11848c[0x0][_0x1ed1a2(0x11d)])[_0x1ed1a2(0x12c)](/^\r?\n/,'');return _0x417793+_0x1ed1a2(0x136)+_0x213724+_0x1ed1a2(0x144)+_0x44b1f4;}function forceBlockCollections(_0x368bba){if(!isNode(_0x368bba))return;visit(_0x368bba,(_0x453df4,_0x32651d)=>{const _0x4ade92=a153_0x4eb2;isCollection(_0x32651d)&&(_0x32651d[_0x4ade92(0x141)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x215c5b,_0x2cdce0,_0x54313f,_0x31f7d1){const _0x26001b=a153_0x4eb2;if(_0x31f7d1||!existsSync(_0x2cdce0))return;const _0x1752e8=readMetadataIfPresent(_0x2cdce0);if(!_0x1752e8)return;const _0x2b7ea3=_0x1752e8['fileHashes']&&Object[_0x26001b(0x13b)](_0x1752e8[_0x26001b(0x132)])[_0x26001b(0x11d)]>0x0?_0x1752e8['fileHashes']:undefined;if(_0x2b7ea3)for(const [_0x242184,_0x328612]of Object[_0x26001b(0x12a)](_0x2b7ea3)){const _0x21b191=resolveManagedFilePath(_0x215c5b,_0x242184);if(!existsSync(_0x21b191))throw CliErrors[_0x26001b(0x138)](_0x26001b(0x159)+_0x215c5b,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x242184);const _0x3addf8=lstatSync(_0x21b191);if(!_0x3addf8[_0x26001b(0x13d)]())throw CliErrors[_0x26001b(0x138)](_0x26001b(0x159)+_0x215c5b,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x242184);const _0x448d3c=bufferSha256(readFileSync(_0x21b191));if(_0x448d3c!==_0x328612)throw CliErrors[_0x26001b(0x138)](_0x26001b(0x159)+_0x215c5b+_0x26001b(0x15a)+_0x242184,_0x26001b(0x127)+_0x242184);}else{const _0x2b5bd5=resolve(_0x215c5b,SKILL_FILE);if(existsSync(_0x2b5bd5)&&_0x1752e8['contentHash']){const _0x43f87b=contentHash(readFileSync(_0x2b5bd5,_0x26001b(0x14a)));if(_0x43f87b!==_0x1752e8[_0x26001b(0x13a)])throw CliErrors['validation'](_0x26001b(0x118)+_0x2b5bd5,_0x26001b(0x122));}}for(const _0x1e2b1a of normalizeLocalFiles(_0x54313f)){if(_0x2b7ea3?.[_0x1e2b1a['path']])continue;if(!_0x2b7ea3&&_0x1e2b1a[_0x26001b(0x131)]===SKILL_FILE)continue;const _0x38bc3d=resolveManagedFilePath(_0x215c5b,_0x1e2b1a[_0x26001b(0x131)]);if(!existsSync(_0x38bc3d))continue;const _0xf4bdd8=lstatSync(_0x38bc3d);if(!_0xf4bdd8[_0x26001b(0x13d)]())throw CliErrors['validation'](_0x26001b(0x159)+_0x215c5b,_0x26001b(0x13c)+_0x1e2b1a['path']);const _0x31c924=bufferSha256(readFileSync(_0x38bc3d));if(_0x31c924!==fileHash(_0x1e2b1a))throw CliErrors[_0x26001b(0x138)](_0x26001b(0x159)+_0x215c5b,_0x26001b(0x14e)+_0x1e2b1a[_0x26001b(0x131)]);}}function materializeFiles(_0x2f6ebe,_0x4ab20d){const _0x3eb682=a153_0x4eb2;for(const _0x2ba57f of normalizeLocalFiles(_0x4ab20d)){const _0x280089=resolveManagedFilePath(_0x2f6ebe,_0x2ba57f[_0x3eb682(0x131)]);mkdirSync(dirname(_0x280089),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x280089,fileContent(_0x2ba57f),0x180);}}function removeStaleManagedFiles(_0x3476c6,_0x436667,_0x57bd4a){const _0x49b146=a153_0x4eb2;if(!_0x436667)return;const _0x9a7004=new Set(normalizeLocalFiles(_0x57bd4a)['map'](_0x31cf6c=>_0x31cf6c[_0x49b146(0x131)]));for(const _0x308dfb of Object[_0x49b146(0x13b)](_0x436667)){if(_0x9a7004['has'](_0x308dfb))continue;const _0x1c175c=resolveManagedFilePath(_0x3476c6,_0x308dfb);existsSync(_0x1c175c)&&lstatSync(_0x1c175c)['isFile']()&&rmSync(_0x1c175c,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x268a50,_0x5d0b84){const _0x37eaf8=a154_0x31fc,_0x22e1b6=_0x268a50();while(!![]){try{const _0x5b2e4d=parseInt(_0x37eaf8(0x17d))/0x1+-parseInt(_0x37eaf8(0x166))/0x2*(-parseInt(_0x37eaf8(0x170))/0x3)+-parseInt(_0x37eaf8(0x163))/0x4*(parseInt(_0x37eaf8(0x182))/0x5)+parseInt(_0x37eaf8(0x162))/0x6*(-parseInt(_0x37eaf8(0x184))/0x7)+-parseInt(_0x37eaf8(0x164))/0x8+-parseInt(_0x37eaf8(0x165))/0x9*(parseInt(_0x37eaf8(0x17b))/0xa)+parseInt(_0x37eaf8(0x161))/0xb;if(_0x5b2e4d===_0x5d0b84)break;else _0x22e1b6['push'](_0x22e1b6['shift']());}catch(_0x2c29ea){_0x22e1b6['push'](_0x22e1b6['shift']());}}}(a154_0x5eca,0xc3103));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';function a154_0x5eca(){const _0xa301b7=['length','forkedFromVersion','map','ossPath','description','path','zipSize','skillName','Invalid\x20','1960RTitnK','readonly','861459spZwuO','forkedFromSkillId','object','hasUpstreamUpdate','validation','103685gxABcP','files','344281RDfcYF','utf8','15778136xcJppO','6gjcLzg','124cjUWNF','6420696ZuHHtT','612REyzWi','2Wnefth','personal','tags','sourceSessionId','Runtime\x20Skill\x20is\x20missing\x20skillCode.','isArray','manifest','trim','userId','status','33267QXuvVM','string'];a154_0x5eca=function(){return _0xa301b7;};return a154_0x5eca();}import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';function a154_0x31fc(_0x45329a,_0x2934a3){_0x45329a=_0x45329a-0x161;const _0x5ecaf0=a154_0x5eca();let _0x31fcbd=_0x5ecaf0[_0x45329a];return _0x31fcbd;}export function buildMetadata(_0x13ccd9,_0x13a640,_0x20a304,_0x150ca0,_0x1ebd34,_0x45cebd,_0x5719bf){const _0x20e1f8=a154_0x31fc,_0x4b5b5a=_0x45cebd?normalizeLocalFiles(_0x45cebd):[],_0x54f225=!_0x5719bf&&_0x4b5b5a[_0x20e1f8(0x172)]>0x0?buildSkillPackage(_0x4b5b5a):undefined,_0x402734=_0x5719bf?bufferSha256(_0x5719bf):_0x54f225?.[_0x20e1f8(0x16c)]['zipSha256'],_0x48d192=_0x5719bf?.[_0x20e1f8(0x172)]??_0x54f225?.[_0x20e1f8(0x16c)][_0x20e1f8(0x178)],_0x3c613b=_0x4b5b5a[_0x20e1f8(0x172)]>0x0?Object['fromEntries'](_0x4b5b5a[_0x20e1f8(0x174)](_0xd6cfd3=>[_0xd6cfd3['path'],fileHash(_0xd6cfd3)])):undefined;return{'schemaVersion':_0x4b5b5a[_0x20e1f8(0x172)]>0x0?0x2:0x1,'id':_0x13ccd9['id'],'appCode':_0x20a304,'skillCode':requireSkillCode(_0x13ccd9),'skillName':_0x13ccd9[_0x20e1f8(0x179)],'description':_0x13ccd9[_0x20e1f8(0x176)],'example':_0x13ccd9['example'],'scope':_0x13a640,'readonly':_0x13a640!==_0x20e1f8(0x167)||_0x13ccd9[_0x20e1f8(0x17c)]===!![],'tenantCode':_0x13ccd9['tenantCode'],'userId':_0x13ccd9[_0x20e1f8(0x16e)],'version':_0x13ccd9['version'],'status':_0x13ccd9[_0x20e1f8(0x16f)],'tags':Array[_0x20e1f8(0x16b)](_0x13ccd9['tags'])?_0x13ccd9[_0x20e1f8(0x168)]:[],'hasUpstreamUpdate':_0x13ccd9[_0x20e1f8(0x180)],'forkedFromSkillId':_0x13ccd9[_0x20e1f8(0x17e)],'forkedFromVersion':_0x13ccd9[_0x20e1f8(0x173)],'sourceSessionId':_0x13ccd9[_0x20e1f8(0x169)],'contentHash':_0x150ca0,'fileHashes':_0x3c613b,'treeHash':_0x4b5b5a[_0x20e1f8(0x172)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x4b5b5a)):undefined,'ossPath':remoteManifestOssPath(_0x13ccd9[_0x20e1f8(0x183)]),'zipSha256':_0x402734,'zipSize':_0x48d192,'files':_0x4b5b5a[_0x20e1f8(0x172)]>0x0?_0x4b5b5a[_0x20e1f8(0x174)](_0x2c303c=>({'path':_0x2c303c[_0x20e1f8(0x177)],'hash':fileHash(_0x2c303c),'size':fileContent(_0x2c303c)[_0x20e1f8(0x172)]})):undefined,'pulledAt':_0x1ebd34??new Date()['toISOString']()};}export function requireSkillCode(_0x24d65f){const _0x3aabae=a154_0x31fc,_0x1b6240=_0x24d65f['skillCode']?.[_0x3aabae(0x16d)]();if(!_0x1b6240)throw CliErrors['validation'](_0x3aabae(0x16a));return _0x1b6240;}export function readMetadataIfPresent(_0x2b9616){const _0xaeeaec=a154_0x31fc;if(!existsSync(_0x2b9616))return undefined;try{const _0x1f1b09=JSON['parse'](readFileSync(_0x2b9616,_0xaeeaec(0x185)));return _0x1f1b09;}catch{throw CliErrors[_0xaeeaec(0x181)](_0xaeeaec(0x17a)+METADATA_FILE+':\x20'+_0x2b9616);}}function remoteManifestOssPath(_0x6b0b4e){const _0x5752da=a154_0x31fc;if(!_0x6b0b4e||typeof _0x6b0b4e!==_0x5752da(0x17f)||Array[_0x5752da(0x16b)](_0x6b0b4e))return undefined;const _0x438c19=_0x6b0b4e[_0x5752da(0x175)];return typeof _0x438c19===_0x5752da(0x171)&&_0x438c19['trim']()?_0x438c19[_0x5752da(0x16d)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a155_0x148c26=a155_0xa35d;(function(_0xc4beb1,_0x2d1b3d){const _0x472661=a155_0xa35d,_0x46ae1b=_0xc4beb1();while(!![]){try{const _0x1ab0a0=parseInt(_0x472661(0x191))/0x1*(parseInt(_0x472661(0x18c))/0x2)+parseInt(_0x472661(0x193))/0x3+parseInt(_0x472661(0x192))/0x4*(-parseInt(_0x472661(0x198))/0x5)+-parseInt(_0x472661(0x195))/0x6+-parseInt(_0x472661(0x18f))/0x7*(-parseInt(_0x472661(0x19d))/0x8)+-parseInt(_0x472661(0x18d))/0x9*(-parseInt(_0x472661(0x19c))/0xa)+-parseInt(_0x472661(0x1a9))/0xb;if(_0x1ab0a0===_0x2d1b3d)break;else _0x46ae1b['push'](_0x46ae1b['shift']());}catch(_0x17cce5){_0x46ae1b['push'](_0x46ae1b['shift']());}}}(a155_0x319d,0x96ed6));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';function a155_0xa35d(_0x409542,_0x4cb5d0){_0x409542=_0x409542-0x18c;const _0x319df4=a155_0x319d();let _0xa35df9=_0x319df4[_0x409542];return _0xa35df9;}export function resolveSkillSyncPaths(_0x1b3840={}){const _0x17b05a=a155_0xa35d,_0x305748=_0x1b3840[_0x17b05a(0x1a8)]??homedir(),_0x325e7a=resolve(_0x305748,PRODUCT_CONFIG[_0x17b05a(0x18e)],_0x17b05a(0x19b)),_0x1d46bf=trimmedEnv('SKILL_ROOT'),_0x288b9f=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x3ba810=resolve(_0x305748,_0x17b05a(0x1a3)),_0x4aa0df=_0x1b3840[_0x17b05a(0x19f)]??(existsSync(_0x3ba810)?resolve(_0x3ba810,_0x17b05a(0x1a0)):undefined);return{'homeDir':_0x305748,'cacheRoot':_0x325e7a,'managedRoot':resolve(_0x305748,PRODUCT_CONFIG[_0x17b05a(0x18e)]),'agentsSkillsDir':_0x1b3840[_0x17b05a(0x1a2)]??_0x1d46bf??resolve(_0x305748,_0x17b05a(0x196),_0x17b05a(0x1a0)),'claudeSkillsDir':_0x1b3840['claudeSkillsDir']??_0x288b9f??resolve(_0x305748,_0x17b05a(0x199),_0x17b05a(0x1a0)),'workbuddySkillsDir':_0x4aa0df};}export function runtimeAgentSkillRoots(_0x2e90ca){const _0x20d13b=a155_0xa35d;return[_0x2e90ca[_0x20d13b(0x1a2)],_0x2e90ca[_0x20d13b(0x19e)],_0x2e90ca[_0x20d13b(0x19f)]][_0x20d13b(0x197)](_0x356360=>Boolean(_0x356360));}export function getRuntimeSkillCacheRoot(_0x225e82,_0x43edf9,_0x2b25a7={}){const _0x122a7c=a155_0xa35d,_0x1ee356=resolveSkillSyncPaths(_0x2b25a7);return resolve(_0x1ee356['cacheRoot'],_0x225e82,fingerprintAccessKey(_0x43edf9),_0x122a7c(0x1a0));}export function getRuntimeSkillDir(_0x270323,_0x3814fc,_0x59c449,_0xbebf9b,_0xcfd778,_0x5094cd={}){const _0x1c8cde=a155_0xa35d;return resolve(getRuntimeSkillCacheRoot(_0x270323,_0x3814fc,_0x5094cd),safePathSegment(_0x59c449,_0x1c8cde(0x19a)),_0xbebf9b,safePathSegment(_0xcfd778,_0x1c8cde(0x1a7)));}function a155_0x319d(){const _0x37ebe3=['1SQzgCw','72egvXyb','3245517ziWznn','path\x20segment','2030922wfTknq','.agents','filter','266510crpFHX','.claude','appCode','cache','1936010bYzKtp','40UzUAuB','claudeSkillsDir','workbuddySkillsDir','skills','validation','agentsSkillsDir','.workbuddy','Unsafe\x20','includes','trim','skillCode','homeDir','8821703ixeafT','1595486EWQguS','18oXFNFk','homeDirName','631834qZptsa','\x20for\x20local\x20path:\x20'];a155_0x319d=function(){return _0x37ebe3;};return a155_0x319d();}export function safePathSegment(_0x5c1a95,_0x17337e=a155_0x148c26(0x194)){const _0x273e32=a155_0x148c26;if(!_0x5c1a95||_0x5c1a95['includes']('/')||_0x5c1a95[_0x273e32(0x1a5)]('\x5c')||_0x5c1a95[_0x273e32(0x1a5)]('..'))throw CliErrors[_0x273e32(0x1a1)](_0x273e32(0x1a4)+_0x17337e+_0x273e32(0x190)+_0x5c1a95);return _0x5c1a95;}function trimmedEnv(_0xab3e91){const _0x52a7cf=a155_0x148c26,_0x2e54d5=productEnv(_0xab3e91)?.[_0x52a7cf(0x1a6)]();return _0x2e54d5?_0x2e54d5:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xef48c7,_0x556818){const _0x2d124d=a148_0x1c7b,_0xbda199=_0xef48c7();while(!![]){try{const _0x10c259=parseInt(_0x2d124d(0x1d0))/0x1*(-parseInt(_0x2d124d(0x208))/0x2)+-parseInt(_0x2d124d(0x1fb))/0x3+parseInt(_0x2d124d(0x1d6))/0x4*(-parseInt(_0x2d124d(0x214))/0x5)+-parseInt(_0x2d124d(0x1ea))/0x6*(-parseInt(_0x2d124d(0x1de))/0x7)+parseInt(_0x2d124d(0x1e3))/0x8*(-parseInt(_0x2d124d(0x1dd))/0x9)+parseInt(_0x2d124d(0x20f))/0xa*(-parseInt(_0x2d124d(0x200))/0xb)+parseInt(_0x2d124d(0x205))/0xc;if(_0x10c259===_0x556818)break;else _0xbda199['push'](_0xbda199['shift']());}catch(_0x9369cc){_0xbda199['push'](_0xbda199['shift']());}}}(a148_0x825f,0xa16d2));function a148_0x825f(){const _0x5c2c7a=['metadata','scope','skillName','match','955101LPajTV','find','some','object','utf8','88pJShVH','\x20has\x20scope=\x22','content','validation','startsWith','41021592OYRExw','length','boolean','2mcFmsx','targetScope','excludedFilePaths','(unknown)','trim','description','unknown','1639810XCGwBL','name','ignoreInvalidMetadata','files','\x20has\x20unsupported\x20scope\x20\x22','1700QdkrWv','isArray','950734sNUQBN','example','appCode','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','toLowerCase','company','11212cmrgOm','dir','replace','\x20name\x20for\x20SkillHub\x20slug\x20generation.','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','path','skillCode','594XJzPua','7WkYTjb','ignoreMetadataAppCodeMismatch','manifest','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','Invalid\x20','32008sRENGz','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','slice','Missing\x20','isDirectory','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','pushedAt','6244626myqTis','Skill\x20metadata\x20appCode\x20\x22','sourceSessionId','Remote\x20Skill\x20','string','personal','tags','Skill\x20directory\x20not\x20found:\x20','builtin','ignoreMetadataSkillCode','isFile','isSymbolicLink','ignoreMetadataScope'];a148_0x825f=function(){return _0x5c2c7a;};return a148_0x825f();}import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a148_0x17b955}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x3f343e,_0x5b69d0,_0xd5a8f0={}){const _0x267218=a148_0x1c7b,_0x23b8c6=resolvePushDirectoryRoot(_0x3f343e),_0x206aa5=readPushMetadataIfPresent(resolve(_0x23b8c6,METADATA_FILE),{'ignoreInvalidMetadata':_0xd5a8f0[_0x267218(0x211)]});if(_0x206aa5?.[_0x267218(0x1d2)]&&_0x206aa5[_0x267218(0x1d2)]!==_0x5b69d0&&!_0xd5a8f0['allowAppCodeRetarget']&&!_0xd5a8f0[_0x267218(0x1df)])throw CliErrors[_0x267218(0x203)](_0x267218(0x1eb)+_0x206aa5[_0x267218(0x1d2)]+_0x267218(0x1da)+_0x5b69d0+'\x22.');const _0x1c8315=resolvePushSkillCode(_0x23b8c6,_0x5b69d0,_0x206aa5,_0xd5a8f0);if(!_0x1c8315)throw CliErrors[_0x267218(0x203)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0x23b8c6,'skillCode':_0x1c8315,'metadata':_0x206aa5};}export function readPushDirectory(_0x3251c5,_0x25cab7,_0x4eee16={}){const _0x52fa81=a148_0x1c7b,_0x58a0be=resolvePushDirectoryIdentity(_0x3251c5,_0x25cab7,_0x4eee16),_0x227e33=_0x58a0be[_0x52fa81(0x1d7)],_0x505bff=resolve(_0x227e33,SKILL_FILE);if(!existsSync(_0x505bff)||!lstatSync(_0x505bff)[_0x52fa81(0x1f4)]())throw CliErrors['validation'](_0x52fa81(0x1e6)+SKILL_FILE+':\x20'+_0x505bff);const _0x1c9a0=_0x58a0be[_0x52fa81(0x1f7)],_0x177cd6=_0x4eee16[_0x52fa81(0x209)]??'personal';if(!_0x4eee16[_0x52fa81(0x1f6)]&&_0x1c9a0?.[_0x52fa81(0x1f8)]===_0x52fa81(0x1f2))throw CliErrors[_0x52fa81(0x203)](_0x52fa81(0x1e8)+METADATA_FILE+_0x52fa81(0x201)+_0x1c9a0[_0x52fa81(0x1f8)]+'\x22.');if(!_0x4eee16[_0x52fa81(0x1f6)]&&_0x177cd6===_0x52fa81(0x1ef)&&_0x1c9a0?.[_0x52fa81(0x1f8)]&&_0x1c9a0[_0x52fa81(0x1f8)]!=='personal')throw CliErrors[_0x52fa81(0x203)](_0x52fa81(0x1d3)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x1c9a0[_0x52fa81(0x1f8)]+'\x22.',_0x52fa81(0x1e1)+_0x227e33+_0x52fa81(0x1e4));const _0x5e1f75=scanSkillDirectory(_0x227e33,{'excludedFilePaths':_0x4eee16[_0x52fa81(0x20a)]}),_0x4db66a=buildSkillPackage(_0x5e1f75),_0x261e7c=readFileSync(_0x505bff,_0x52fa81(0x1ff)),_0x4284ab=_0x58a0be[_0x52fa81(0x1dc)],_0x1c80f9=_0x4eee16['ignoreMetadataForPayload']?undefined:_0x1c9a0,_0x230dcb=readSkillDisplayName(_0x261e7c);return{'skillCode':_0x4284ab,'metadata':_0x1c9a0,'frontmatterDisplayName':_0x230dcb,'input':{'skillCode':_0x4284ab,'skillName':_0x230dcb??_0x1c80f9?.[_0x52fa81(0x1f9)],'description':_0x1c80f9?.['description'],'content':_0x261e7c,'files':_0x4db66a[_0x52fa81(0x1e0)],'packageBase64':_0x4db66a['packageBase64'],'tags':_0x1c80f9?.[_0x52fa81(0x1f0)],'version':_0x1c80f9?.['version'],'sourceSessionId':_0x1c80f9?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x1f70d1,_0xbf9c35,_0x25e87f,_0x30323d={}){const _0x550a3b=a148_0x1c7b,_0x52a80f=resolvePushDirectoryRoot(_0x1f70d1),_0x353e81=readPushMetadataIfPresent(resolve(_0x52a80f,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x49f380=requireRemoteScope(_0xbf9c35),_0x492ebe=readLocalSkillContent(_0x52a80f),_0x3b39e9={..._0xbf9c35,'appCode':_0xbf9c35[_0x550a3b(0x1d2)]??_0x25e87f,'skillName':_0xbf9c35[_0x550a3b(0x1f9)]??_0x353e81?.[_0x550a3b(0x1f9)],'description':_0xbf9c35[_0x550a3b(0x20d)]??_0x353e81?.[_0x550a3b(0x20d)],'example':_0xbf9c35[_0x550a3b(0x1d1)]??_0x353e81?.[_0x550a3b(0x1d1)],'tags':Array[_0x550a3b(0x215)](_0xbf9c35['tags'])?_0xbf9c35['tags']:_0x353e81?.[_0x550a3b(0x1f0)],'sourceSessionId':_0xbf9c35[_0x550a3b(0x1ec)]??_0x353e81?.[_0x550a3b(0x1ec)],'content':_0xbf9c35[_0x550a3b(0x202)]??_0x492ebe},_0x93083f=buildMetadata(_0x3b39e9,_0x49f380,_0x25e87f,contentHash(_0x492ebe),_0x30323d['refreshedAt']);writeJsonAtomic(resolve(_0x52a80f,METADATA_FILE),_0x93083f);}export function recordPushedRuntimeSkill(_0x3680db,_0x2ebddf,_0x1914b7,_0x2e4d32={}){const _0x3c5e50=a148_0x1c7b,_0x58d0e5=resolvePushDirectoryRoot(_0x3680db),_0x3cbe25=scanSkillDirectory(_0x58d0e5),_0x534fce=_0x3cbe25[_0x3c5e50(0x1fc)](_0xa751d6=>_0xa751d6[_0x3c5e50(0x1db)]===SKILL_FILE),_0x404175=_0x534fce?fileText(_0x534fce):'',_0x2223a0=tryNormalizePackageManifest(_0x2ebddf[_0x3c5e50(0x212)]),_0x56ac34={..._0x2ebddf,'content':_0x2ebddf[_0x3c5e50(0x202)]??_0x404175,'files':_0x2223a0},_0xa14c4=_0x2223a0?normalizeLocalFiles(_0x3cbe25)['filter'](_0x59e7af=>_0x2223a0['files'][_0x3c5e50(0x1fd)](_0x13f8a4=>_0x13f8a4[_0x3c5e50(0x1db)]===_0x59e7af[_0x3c5e50(0x1db)])):undefined,_0x18ed53=buildMetadata(_0x56ac34,_0x2e4d32[_0x3c5e50(0x1f8)]??'personal',_0x1914b7,contentHash(_0x56ac34[_0x3c5e50(0x202)]??''),_0x2e4d32[_0x3c5e50(0x1e9)],_0xa14c4);writeJsonAtomic(resolve(_0x58d0e5,METADATA_FILE),_0x18ed53);}export function deriveSkillCodeFromDirectory(_0x107a63,_0x118287){const _0x40505d=a148_0x1c7b,_0x4653f9=basename(resolve(_0x107a63)),_0x33faaa=_0x118287+'--';return _0x4653f9[_0x40505d(0x204)](_0x33faaa)?_0x4653f9[_0x40505d(0x1e5)](_0x33faaa[_0x40505d(0x206)]):_0x4653f9;}function resolvePushSkillCode(_0x44f9ee,_0xcf1323,_0x1e1b2d,_0x623460){const _0x329200=a148_0x1c7b,_0x3bc32b=deriveSkillCodeFromSkillFile(_0x44f9ee)||deriveSkillCodeFromDirectory(_0x44f9ee,_0xcf1323);if(_0x623460[_0x329200(0x1f3)])return _0x3bc32b;return _0x1e1b2d?.[_0x329200(0x1dc)]?.[_0x329200(0x20c)]()||_0x3bc32b;}function deriveSkillCodeFromSkillFile(_0x2de6a5){const _0x14f2f9=a148_0x1c7b,_0x4b646b=resolve(_0x2de6a5,SKILL_FILE);if(!existsSync(_0x4b646b)||!lstatSync(_0x4b646b)[_0x14f2f9(0x1f4)]())return undefined;const _0x1fb5fd=readFileSync(_0x4b646b,_0x14f2f9(0x1ff)),_0x3cdd2f=_0x1fb5fd[_0x14f2f9(0x1fa)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3cdd2f)return undefined;const _0x26e00f=parseFrontmatterObject(_0x3cdd2f[0x1]??''),_0x5eee6c=scalarToString(_0x26e00f?.[_0x14f2f9(0x210)]);return _0x5eee6c?slugifySkillName(_0x5eee6c):undefined;}function readSkillDisplayName(_0x5352f){const _0x47a727=_0x5352f['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x47a727)return undefined;const _0x242378=parseFrontmatterObject(_0x47a727[0x1]??'');return scalarToString(_0x242378?.['displayName']);}function slugifySkillName(_0x55ca38){const _0x107d3a=a148_0x1c7b,_0x10e518=_0x55ca38[_0x107d3a(0x20c)]()[_0x107d3a(0x1d4)]()[_0x107d3a(0x1d8)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x107d3a(0x1d8)](/^-+/,'')[_0x107d3a(0x1d8)](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x10e518)throw CliErrors[_0x107d3a(0x203)](_0x107d3a(0x1e2)+SKILL_FILE+_0x107d3a(0x1d9));return _0x10e518;}function parseFrontmatterObject(_0x500e66){const _0x3b5328=a148_0x1c7b;try{const _0x36c95f=a148_0x17b955(_0x500e66);return _0x36c95f&&typeof _0x36c95f===_0x3b5328(0x1fe)&&!Array[_0x3b5328(0x215)](_0x36c95f)?_0x36c95f:undefined;}catch{return undefined;}}function scalarToString(_0x5ec374){const _0x271fc5=a148_0x1c7b;if(typeof _0x5ec374===_0x271fc5(0x1ee))return _0x5ec374[_0x271fc5(0x20c)]();if(typeof _0x5ec374==='number'||typeof _0x5ec374===_0x271fc5(0x207))return String(_0x5ec374);return undefined;}function resolvePushDirectoryRoot(_0x1a651b){const _0x5a03d9=a148_0x1c7b,_0x1b0100=resolve(_0x1a651b);if(!existsSync(_0x1b0100))throw CliErrors[_0x5a03d9(0x203)](_0x5a03d9(0x1f1)+_0x1a651b);const _0xf72e5d=lstatSync(_0x1b0100);if(_0xf72e5d[_0x5a03d9(0x1e7)]())return _0x1b0100;if(_0xf72e5d[_0x5a03d9(0x1f5)]()){const _0x64c3a8=realpathSync(_0x1b0100);if(lstatSync(_0x64c3a8)[_0x5a03d9(0x1e7)]())return _0x64c3a8;}throw CliErrors['validation'](_0x5a03d9(0x1f1)+_0x1a651b);}function requireRemoteScope(_0x7b7061){const _0x1ee7c4=a148_0x1c7b;if(_0x7b7061[_0x1ee7c4(0x1f8)]===_0x1ee7c4(0x1ef)||_0x7b7061[_0x1ee7c4(0x1f8)]===_0x1ee7c4(0x1d5)||_0x7b7061[_0x1ee7c4(0x1f8)]==='builtin')return _0x7b7061[_0x1ee7c4(0x1f8)];throw CliErrors['validation'](_0x1ee7c4(0x1ed)+(_0x7b7061[_0x1ee7c4(0x1dc)]||_0x1ee7c4(0x20b))+_0x1ee7c4(0x213)+(_0x7b7061['scope']??_0x1ee7c4(0x20e))+'\x22.');}function readLocalSkillContent(_0x3972ce){const _0x2606a1=a148_0x1c7b,_0x3b6d29=resolve(_0x3972ce,SKILL_FILE);return existsSync(_0x3b6d29)&&lstatSync(_0x3b6d29)[_0x2606a1(0x1f4)]()?readFileSync(_0x3b6d29,_0x2606a1(0x1ff)):'';}function a148_0x1c7b(_0x4796d5,_0x4d7b63){_0x4796d5=_0x4796d5-0x1d0;const _0x825f65=a148_0x825f();let _0x1c7b81=_0x825f65[_0x4796d5];return _0x1c7b81;}function readPushMetadataIfPresent(_0x2cc3f9,_0x4daa7c={}){try{return readMetadataIfPresent(_0x2cc3f9);}catch(_0x4761af){if(_0x4daa7c['ignoreInvalidMetadata'])return undefined;throw _0x4761af;}}
|
|
1
|
+
(function(_0x1f8231,_0x153d6e){const _0x42e55=a156_0x42ef,_0x3dbbc4=_0x1f8231();while(!![]){try{const _0x4f15d8=-parseInt(_0x42e55(0xc3))/0x1*(-parseInt(_0x42e55(0xcc))/0x2)+parseInt(_0x42e55(0xe7))/0x3+parseInt(_0x42e55(0xc8))/0x4+parseInt(_0x42e55(0xd3))/0x5+-parseInt(_0x42e55(0xe4))/0x6+-parseInt(_0x42e55(0xf3))/0x7*(parseInt(_0x42e55(0xcf))/0x8)+-parseInt(_0x42e55(0xd6))/0x9;if(_0x4f15d8===_0x153d6e)break;else _0x3dbbc4['push'](_0x3dbbc4['shift']());}catch(_0x46edd8){_0x3dbbc4['push'](_0x3dbbc4['shift']());}}}(a156_0x35cc,0x5be1a));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';function a156_0x35cc(){const _0x57f6e7=['56wvHNub','some','(unknown)','trim','3085095zSwxta','startsWith','path','8739072usRyFZ','builtin','toLowerCase','tags','\x20has\x20unsupported\x20scope\x20\x22','ignoreMetadataSkillCode','unknown','isSymbolicLink','isFile','boolean','ignoreMetadataForPayload','allowAppCodeRetarget','packageBase64','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','2893386mIYOQp','isDirectory','files','77904yqAgQl','ignoreMetadataAppCodeMismatch','Invalid\x20','length','\x20has\x20scope=\x22','Remote\x20Skill\x20','version','sourceSessionId','content','Skill\x20directory\x20not\x20found:\x20','isArray','description','279902OBZrRU','dir','example',',\x20or\x20directory\x20name.','Missing\x20','Skill\x20metadata\x20appCode\x20\x22','company','skillName','pushedAt','refreshedAt','appCode','targetScope','scope','utf8','filter','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','ignoreInvalidMetadata','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','2mgtDTz','manifest','find','Unable\x20to\x20resolve\x20skillCode\x20from\x20','name','2983888uHweua','match','replace','validation','720528HoKgok','personal','skillCode'];a156_0x35cc=function(){return _0x57f6e7;};return a156_0x35cc();}import{parse as a156_0x43217a}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x24c7ae,_0x129d36,_0x272f62={}){const _0xe57726=a156_0x42ef,_0x5179fb=resolvePushDirectoryRoot(_0x24c7ae),_0x533b1b=readPushMetadataIfPresent(resolve(_0x5179fb,METADATA_FILE),{'ignoreInvalidMetadata':_0x272f62[_0xe57726(0xc1)]});if(_0x533b1b?.[_0xe57726(0xba)]&&_0x533b1b[_0xe57726(0xba)]!==_0x129d36&&!_0x272f62[_0xe57726(0xe1)]&&!_0x272f62[_0xe57726(0xe8)])throw CliErrors[_0xe57726(0xcb)](_0xe57726(0xf8)+_0x533b1b[_0xe57726(0xba)]+_0xe57726(0xbf)+_0x129d36+'\x22.');const _0x2c925c=resolvePushSkillCode(_0x5179fb,_0x129d36,_0x533b1b,_0x272f62);if(!_0x2c925c)throw CliErrors[_0xe57726(0xcb)](_0xe57726(0xc6)+SKILL_FILE+',\x20'+METADATA_FILE+_0xe57726(0xf6));return{'dir':_0x5179fb,'skillCode':_0x2c925c,'metadata':_0x533b1b};}export function readPushDirectory(_0x8ac207,_0x2882b5,_0x25e563={}){const _0x1c13ad=a156_0x42ef,_0x282457=resolvePushDirectoryIdentity(_0x8ac207,_0x2882b5,_0x25e563),_0x26a5af=_0x282457[_0x1c13ad(0xf4)],_0x415560=resolve(_0x26a5af,SKILL_FILE);if(!existsSync(_0x415560)||!lstatSync(_0x415560)[_0x1c13ad(0xde)]())throw CliErrors[_0x1c13ad(0xcb)](_0x1c13ad(0xf7)+SKILL_FILE+':\x20'+_0x415560);const _0xe4d4e1=_0x282457['metadata'],_0x5e9534=_0x25e563[_0x1c13ad(0xbb)]??'personal';if(!_0x25e563['ignoreMetadataScope']&&_0xe4d4e1?.[_0x1c13ad(0xbc)]===_0x1c13ad(0xd7))throw CliErrors[_0x1c13ad(0xcb)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x1c13ad(0xeb)+_0xe4d4e1['scope']+'\x22.');if(!_0x25e563['ignoreMetadataScope']&&_0x5e9534===_0x1c13ad(0xcd)&&_0xe4d4e1?.[_0x1c13ad(0xbc)]&&_0xe4d4e1['scope']!==_0x1c13ad(0xcd))throw CliErrors['validation'](_0x1c13ad(0xe3)+METADATA_FILE+'\x20has\x20scope=\x22'+_0xe4d4e1[_0x1c13ad(0xbc)]+'\x22.',_0x1c13ad(0xc0)+_0x26a5af+_0x1c13ad(0xc2));const _0x128f01=scanSkillDirectory(_0x26a5af,{'excludedFilePaths':_0x25e563['excludedFilePaths']}),_0x3be618=buildSkillPackage(_0x128f01),_0x12835e=readFileSync(_0x415560,_0x1c13ad(0xbd)),_0x3714dd=_0x282457['skillCode'],_0x28ac05=_0x25e563[_0x1c13ad(0xe0)]?undefined:_0xe4d4e1,_0x3ea223=readSkillDisplayName(_0x12835e);return{'skillCode':_0x3714dd,'metadata':_0xe4d4e1,'frontmatterDisplayName':_0x3ea223,'input':{'skillCode':_0x3714dd,'skillName':_0x3ea223??_0x28ac05?.[_0x1c13ad(0xb7)],'description':_0x28ac05?.['description'],'content':_0x12835e,'files':_0x3be618[_0x1c13ad(0xc4)],'packageBase64':_0x3be618[_0x1c13ad(0xe2)],'tags':_0x28ac05?.[_0x1c13ad(0xd9)],'version':_0x28ac05?.[_0x1c13ad(0xed)],'sourceSessionId':_0x28ac05?.[_0x1c13ad(0xee)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x1b2004,_0x54ac04,_0x2d0684,_0x12f58b={}){const _0x3385ac=a156_0x42ef,_0x1e331b=resolvePushDirectoryRoot(_0x1b2004),_0x42f74d=readPushMetadataIfPresent(resolve(_0x1e331b,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x2e139d=requireRemoteScope(_0x54ac04),_0x58287e=readLocalSkillContent(_0x1e331b),_0x1f0766={..._0x54ac04,'appCode':_0x54ac04[_0x3385ac(0xba)]??_0x2d0684,'skillName':_0x54ac04[_0x3385ac(0xb7)]??_0x42f74d?.['skillName'],'description':_0x54ac04[_0x3385ac(0xf2)]??_0x42f74d?.[_0x3385ac(0xf2)],'example':_0x54ac04[_0x3385ac(0xf5)]??_0x42f74d?.['example'],'tags':Array['isArray'](_0x54ac04['tags'])?_0x54ac04[_0x3385ac(0xd9)]:_0x42f74d?.[_0x3385ac(0xd9)],'sourceSessionId':_0x54ac04[_0x3385ac(0xee)]??_0x42f74d?.[_0x3385ac(0xee)],'content':_0x54ac04[_0x3385ac(0xef)]??_0x58287e},_0x3523e8=buildMetadata(_0x1f0766,_0x2e139d,_0x2d0684,contentHash(_0x58287e),_0x12f58b[_0x3385ac(0xb9)]);writeJsonAtomic(resolve(_0x1e331b,METADATA_FILE),_0x3523e8);}export function recordPushedRuntimeSkill(_0x588787,_0x3ca2d0,_0x385159,_0x24a3fa={}){const _0x43c58b=a156_0x42ef,_0x3f59a8=resolvePushDirectoryRoot(_0x588787),_0x3a5576=scanSkillDirectory(_0x3f59a8),_0x3162fa=_0x3a5576[_0x43c58b(0xc5)](_0x236e46=>_0x236e46[_0x43c58b(0xd5)]===SKILL_FILE),_0x350aec=_0x3162fa?fileText(_0x3162fa):'',_0x5c2447=tryNormalizePackageManifest(_0x3ca2d0[_0x43c58b(0xe6)]),_0x426809={..._0x3ca2d0,'content':_0x3ca2d0[_0x43c58b(0xef)]??_0x350aec,'files':_0x5c2447},_0x1c214b=_0x5c2447?normalizeLocalFiles(_0x3a5576)[_0x43c58b(0xbe)](_0x5a41ca=>_0x5c2447[_0x43c58b(0xe6)][_0x43c58b(0xd0)](_0x3bf07b=>_0x3bf07b[_0x43c58b(0xd5)]===_0x5a41ca['path'])):undefined,_0x10474c=buildMetadata(_0x426809,_0x24a3fa[_0x43c58b(0xbc)]??_0x43c58b(0xcd),_0x385159,contentHash(_0x426809[_0x43c58b(0xef)]??''),_0x24a3fa[_0x43c58b(0xb8)],_0x1c214b);writeJsonAtomic(resolve(_0x3f59a8,METADATA_FILE),_0x10474c);}export function deriveSkillCodeFromDirectory(_0x27974a,_0xb2cc4d){const _0x1c5987=a156_0x42ef,_0x485922=basename(resolve(_0x27974a)),_0xcd01bd=_0xb2cc4d+'--';return _0x485922[_0x1c5987(0xd4)](_0xcd01bd)?_0x485922['slice'](_0xcd01bd[_0x1c5987(0xea)]):_0x485922;}function resolvePushSkillCode(_0x3addd6,_0x11b039,_0x7ffeaf,_0x3f84d1){const _0x50865a=a156_0x42ef,_0x4b6b10=deriveSkillCodeFromSkillFile(_0x3addd6)||deriveSkillCodeFromDirectory(_0x3addd6,_0x11b039);if(_0x3f84d1[_0x50865a(0xdb)])return _0x4b6b10;return _0x7ffeaf?.[_0x50865a(0xce)]?.['trim']()||_0x4b6b10;}function deriveSkillCodeFromSkillFile(_0x477b5d){const _0x209409=a156_0x42ef,_0x43175a=resolve(_0x477b5d,SKILL_FILE);if(!existsSync(_0x43175a)||!lstatSync(_0x43175a)[_0x209409(0xde)]())return undefined;const _0x1458d2=readFileSync(_0x43175a,_0x209409(0xbd)),_0x39c1c8=_0x1458d2['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x39c1c8)return undefined;const _0x3b796c=parseFrontmatterObject(_0x39c1c8[0x1]??''),_0x9c4be4=scalarToString(_0x3b796c?.[_0x209409(0xc7)]);return _0x9c4be4?slugifySkillName(_0x9c4be4):undefined;}function readSkillDisplayName(_0x532c08){const _0x4c754b=a156_0x42ef,_0x3d0833=_0x532c08[_0x4c754b(0xc9)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3d0833)return undefined;const _0x7e0395=parseFrontmatterObject(_0x3d0833[0x1]??'');return scalarToString(_0x7e0395?.['displayName']);}function slugifySkillName(_0x59566c){const _0x14d784=a156_0x42ef,_0x221eba=_0x59566c[_0x14d784(0xd2)]()[_0x14d784(0xd8)]()[_0x14d784(0xca)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x14d784(0xca)](/^-+/,'')[_0x14d784(0xca)](/-+$/,'')[_0x14d784(0xca)](/-{2,}/g,'-');if(!_0x221eba)throw CliErrors[_0x14d784(0xcb)](_0x14d784(0xe9)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x221eba;}function parseFrontmatterObject(_0x33c28a){const _0xdb584e=a156_0x42ef;try{const _0x5a3e79=a156_0x43217a(_0x33c28a);return _0x5a3e79&&typeof _0x5a3e79==='object'&&!Array[_0xdb584e(0xf1)](_0x5a3e79)?_0x5a3e79:undefined;}catch{return undefined;}}function scalarToString(_0x3e572a){const _0x4c2c0c=a156_0x42ef;if(typeof _0x3e572a==='string')return _0x3e572a[_0x4c2c0c(0xd2)]();if(typeof _0x3e572a==='number'||typeof _0x3e572a===_0x4c2c0c(0xdf))return String(_0x3e572a);return undefined;}function resolvePushDirectoryRoot(_0x474db0){const _0x513b80=a156_0x42ef,_0x5b4dd8=resolve(_0x474db0);if(!existsSync(_0x5b4dd8))throw CliErrors['validation'](_0x513b80(0xf0)+_0x474db0);const _0x2cff28=lstatSync(_0x5b4dd8);if(_0x2cff28['isDirectory']())return _0x5b4dd8;if(_0x2cff28[_0x513b80(0xdd)]()){const _0x5cb3c7=realpathSync(_0x5b4dd8);if(lstatSync(_0x5cb3c7)[_0x513b80(0xe5)]())return _0x5cb3c7;}throw CliErrors[_0x513b80(0xcb)](_0x513b80(0xf0)+_0x474db0);}function a156_0x42ef(_0x6c4599,_0x5de2b8){_0x6c4599=_0x6c4599-0xb7;const _0x35cc24=a156_0x35cc();let _0x42ef13=_0x35cc24[_0x6c4599];return _0x42ef13;}function requireRemoteScope(_0x2553cc){const _0x2e6478=a156_0x42ef;if(_0x2553cc[_0x2e6478(0xbc)]===_0x2e6478(0xcd)||_0x2553cc[_0x2e6478(0xbc)]===_0x2e6478(0xf9)||_0x2553cc[_0x2e6478(0xbc)]===_0x2e6478(0xd7))return _0x2553cc[_0x2e6478(0xbc)];throw CliErrors[_0x2e6478(0xcb)](_0x2e6478(0xec)+(_0x2553cc[_0x2e6478(0xce)]||_0x2e6478(0xd1))+_0x2e6478(0xda)+(_0x2553cc[_0x2e6478(0xbc)]??_0x2e6478(0xdc))+'\x22.');}function readLocalSkillContent(_0x395aaa){const _0xd01e28=a156_0x42ef,_0x5dcfbe=resolve(_0x395aaa,SKILL_FILE);return existsSync(_0x5dcfbe)&&lstatSync(_0x5dcfbe)[_0xd01e28(0xde)]()?readFileSync(_0x5dcfbe,_0xd01e28(0xbd)):'';}function readPushMetadataIfPresent(_0x2a1955,_0x4af8a6={}){try{return readMetadataIfPresent(_0x2a1955);}catch(_0x47a517){if(_0x4af8a6['ignoreInvalidMetadata'])return undefined;throw _0x47a517;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xd1119c,_0x22f285){const _0x5c4e1a=a157_0x436b,_0x242c44=_0xd1119c();while(!![]){try{const _0x3e986e=-parseInt(_0x5c4e1a(0x1f6))/0x1*(-parseInt(_0x5c4e1a(0x1e8))/0x2)+-parseInt(_0x5c4e1a(0x1ec))/0x3*(parseInt(_0x5c4e1a(0x1f8))/0x4)+parseInt(_0x5c4e1a(0x1f1))/0x5*(parseInt(_0x5c4e1a(0x1f3))/0x6)+parseInt(_0x5c4e1a(0x1ef))/0x7*(parseInt(_0x5c4e1a(0x1ee))/0x8)+-parseInt(_0x5c4e1a(0x1f7))/0x9*(-parseInt(_0x5c4e1a(0x1eb))/0xa)+parseInt(_0x5c4e1a(0x1f2))/0xb*(-parseInt(_0x5c4e1a(0x1f9))/0xc)+-parseInt(_0x5c4e1a(0x1f5))/0xd*(parseInt(_0x5c4e1a(0x1ed))/0xe);if(_0x3e986e===_0x22f285)break;else _0x242c44['push'](_0x242c44['shift']());}catch(_0x21c76d){_0x242c44['push'](_0x242c44['shift']());}}}(a157_0x3916,0x9871c));function a157_0x3916(){const _0x11b508=['2108915qMTXNw','11BJUKYd','12PMbAzz','push','2408887mEyPic','471091NDRQnK','492543dkTEYK','12yUdcCs','7190604TYomIF','2IOvTuO','company','includes','130KRNBow','850551bbXHgS','56VRGrxb','8UEbamy','5524876thwAKx','validation'];a157_0x3916=function(){return _0x11b508;};return a157_0x3916();}import{CliErrors}from'../../errors.js';function a157_0x436b(_0x4cb503,_0x5d887f){_0x4cb503=_0x4cb503-0x1e8;const _0x3916ae=a157_0x3916();let _0x436b36=_0x3916ae[_0x4cb503];return _0x436b36;}export function normalizeRuntimeSkillScopes(_0xb01e29){const _0x281a50=a157_0x436b,_0x3769a1=_0xb01e29&&_0xb01e29['length']>0x0?_0xb01e29:['personal',_0x281a50(0x1e9),'builtin'],_0x1dd749=[];for(const _0x10dc38 of _0x3769a1){if(!isRuntimeSkillScope(_0x10dc38))throw CliErrors[_0x281a50(0x1f0)]('Unsupported\x20runtime\x20Skill\x20scope:\x20'+_0x10dc38);!_0x1dd749[_0x281a50(0x1ea)](_0x10dc38)&&_0x1dd749[_0x281a50(0x1f4)](_0x10dc38);}return _0x1dd749;}export function isRuntimeSkillScope(_0x48595f){const _0x4f3892=a157_0x436b;return _0x48595f==='personal'||_0x48595f===_0x4f3892(0x1e9)||_0x48595f==='builtin';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a159_0x1fbbd7=a159_0x7603;function a159_0x1d08(){const _0x1adb06=['length','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','5260614uiSWUm','936315ZygiJQ','from','3230217HSDyFV','1980-01-01T00:00:00.000Z','endsWith','427KsQyJq','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','path','object','map','1596588mPKctn','10epqwic','13565241MMCarn','name','code','55064bEpXsa','validation','4WGJcxs','752985oOROuE','entries'];a159_0x1d08=function(){return _0x1adb06;};return a159_0x1d08();}(function(_0x271622,_0x53e6e1){const _0x30ccec=a159_0x7603,_0x398c98=_0x271622();while(!![]){try{const _0x419ebe=parseInt(_0x30ccec(0x1df))/0x1+-parseInt(_0x30ccec(0x1d7))/0x2+-parseInt(_0x30ccec(0x1e6))/0x3*(-parseInt(_0x30ccec(0x1de))/0x4)+-parseInt(_0x30ccec(0x1e4))/0x5+parseInt(_0x30ccec(0x1e3))/0x6+-parseInt(_0x30ccec(0x1d2))/0x7*(-parseInt(_0x30ccec(0x1dc))/0x8)+-parseInt(_0x30ccec(0x1d9))/0x9*(parseInt(_0x30ccec(0x1d8))/0xa);if(_0x419ebe===_0x53e6e1)break;else _0x398c98['push'](_0x398c98['shift']());}catch(_0x55b00b){_0x398c98['push'](_0x398c98['shift']());}}}(a159_0x1d08,0x9aace));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a159_0x1fbbd7(0x1e7));export function createDeterministicZipPackage(_0x3e197b){const _0x422689=a159_0x1fbbd7,_0x5987e4={};for(const _0x241f13 of normalizeLocalFiles(_0x3e197b)){_0x5987e4[_0x241f13[_0x422689(0x1d4)]]=fileContent(_0x241f13);}return Buffer[_0x422689(0x1e5)](zipSync(_0x5987e4,{'level':0x0,'mtime':ZIP_MTIME}));}function a159_0x7603(_0x18bef6,_0x508692){_0x18bef6=_0x18bef6-0x1d2;const _0x1d08e7=a159_0x1d08();let _0x76039e=_0x1d08e7[_0x18bef6];return _0x76039e;}export function parseZipPackage(_0x4696dc){const _0x920610=a159_0x1fbbd7;if(_0x4696dc[_0x920610(0x1e1)]<0x16)throw CliErrors[_0x920610(0x1dd)](_0x920610(0x1d3));let _0x4edc6b;try{_0x4edc6b=unzipSync(_0x4696dc,{'filter'(_0x4a4d3a){const _0x34d183=_0x920610,_0x7e06ff=normalizeSkillRelativePath(_0x4a4d3a[_0x34d183(0x1da)]);if(_0x7e06ff[_0x34d183(0x1e8)]('/'))throw CliErrors['validation'](_0x34d183(0x1e2)+_0x7e06ff);return!![];}});}catch(_0x2db5dc){if(isRuntimeSkillValidationError(_0x2db5dc))throw _0x2db5dc;throw CliErrors[_0x920610(0x1dd)](_0x920610(0x1d3));}return Object[_0x920610(0x1e0)](_0x4edc6b)[_0x920610(0x1d6)](([_0x194729,_0xd6ec1e])=>({'path':normalizeSkillRelativePath(_0x194729),'bytes':Buffer[_0x920610(0x1e5)](_0xd6ec1e)}))['sort'](compareSkillFiles);}function isRuntimeSkillValidationError(_0x50a2c1){const _0x1161df=a159_0x1fbbd7;return typeof _0x50a2c1===_0x1161df(0x1d5)&&_0x50a2c1!==null&&_0x1161df(0x1db)in _0x50a2c1&&_0x50a2c1[_0x1161df(0x1db)]==='validation_error';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x966861,_0x1725e5){const _0x6dceda=a160_0x4ea2,_0x5bcf87=_0x966861();while(!![]){try{const _0x2aa50a=parseInt(_0x6dceda(0x96))/0x1*(-parseInt(_0x6dceda(0xb1))/0x2)+-parseInt(_0x6dceda(0x9d))/0x3*(parseInt(_0x6dceda(0xbb))/0x4)+-parseInt(_0x6dceda(0x91))/0x5+parseInt(_0x6dceda(0xab))/0x6+-parseInt(_0x6dceda(0xbd))/0x7+-parseInt(_0x6dceda(0xa4))/0x8*(parseInt(_0x6dceda(0xa9))/0x9)+parseInt(_0x6dceda(0x98))/0xa*(parseInt(_0x6dceda(0x93))/0xb);if(_0x2aa50a===_0x1725e5)break;else _0x5bcf87['push'](_0x5bcf87['shift']());}catch(_0x3ac85d){_0x5bcf87['push'](_0x5bcf87['shift']());}}}(a160_0x3863,0xea3bb));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x222ef9){const _0x3818b1=a160_0x4ea2,_0x37cfd9=normalizeLocalFiles(_0x222ef9);if(!_0x37cfd9[_0x3818b1(0xb9)](_0x481a43=>_0x481a43[_0x3818b1(0xb7)]===SKILL_FILE))throw CliErrors[_0x3818b1(0xb5)](_0x3818b1(0xb2)+SKILL_FILE+_0x3818b1(0xb3));const _0x1ca393=localFilesToManifestFiles(_0x37cfd9),_0x478d8d=createDeterministicZipPackage(_0x37cfd9);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x1ca393),'zipSha256':bufferSha256(_0x478d8d),'zipSize':_0x478d8d[_0x3818b1(0xae)],'files':_0x1ca393},'packageBytes':_0x478d8d,'packageBase64':_0x478d8d[_0x3818b1(0xa0)]('base64')};}export function verifyRuntimeSkillPackage(_0x59ee5a,_0x62451b){const _0x17becd=a160_0x4ea2,_0xe63b3c=normalizePackageManifest(_0x59ee5a,{'requireOssPath':![]});if(!_0xe63b3c)throw CliErrors[_0x17becd(0xb5)](_0x17becd(0x95));return extractAndVerifyPackage(_0xe63b3c,_0x62451b);}export function verifyRuntimeSkillBundle(_0x27d5d1,_0x3b862b){const _0x4736a8=a160_0x4ea2,_0x3a8624=normalizePackageManifest(_0x27d5d1,{'requireOssPath':![]});if(!_0x3a8624)throw CliErrors[_0x4736a8(0xb5)](_0x4736a8(0x95));return extractAndVerifyPackageFiles(_0x3a8624,_0x3b862b);}function a160_0x3863(){const _0x583ad3=['Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','22wkpIUt','Duplicate\x20Skill\x20package\x20entry:\x20','10lxxIkD','treeSha256','bytes','ossPath','schemaVersion','201QphsQi','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','zipSize','toString','sha256','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','toLowerCase','32enMYbt','isArray','map','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','requireOssPath','1787580UbwBLz','size','6742998pfXYVR','zipSha256','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','length','isSafeInteger','files','109542CcEKlA','Missing\x20','\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','validation','Runtime\x20Skill\x20package\x20is\x20missing\x20','path','get','some','Runtime\x20Skill\x20package\x20size\x20mismatch.','65072ipSCDN','trim','10174318ExkIck','string','24745dFaIlK','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','48217477votKxU'];a160_0x3863=function(){return _0x583ad3;};return a160_0x3863();}export function tryNormalizePackageManifest(_0x19aea3){return normalizePackageManifest(_0x19aea3,{'requireOssPath':![]});}function a160_0x4ea2(_0x37c8e5,_0xf79bf1){_0x37c8e5=_0x37c8e5-0x91;const _0x386368=a160_0x3863();let _0x4ea2f7=_0x386368[_0x37c8e5];return _0x4ea2f7;}export function requirePackageBytes(_0x1e7530,_0x48d425){const _0x132705=a160_0x4ea2;if(!_0x48d425||_0x48d425[_0x132705(0xae)]===0x0)throw CliErrors[_0x132705(0xb5)]('Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20'+_0x1e7530);return _0x48d425;}export function extractDownloadedPackage(_0x3ff682){const _0x466e8c=a160_0x4ea2,_0x100d36=parseZipPackage(_0x3ff682)[_0x466e8c(0xa6)](_0x5a2985=>({'path':_0x5a2985['path'],'bytes':_0x5a2985[_0x466e8c(0x9a)]}));if(!_0x100d36[_0x466e8c(0xb9)](_0x443197=>_0x443197[_0x466e8c(0xb7)]===SKILL_FILE))throw CliErrors[_0x466e8c(0xb5)](_0x466e8c(0xb6)+SKILL_FILE+'.');return normalizeLocalFiles(_0x100d36);}export function localFilesToManifestFiles(_0x39f4b3){const _0x2d2df7=a160_0x4ea2;return normalizeLocalFiles(_0x39f4b3)[_0x2d2df7(0xa6)](_0x50a842=>({'path':_0x50a842[_0x2d2df7(0xb7)],'sha256':fileHash(_0x50a842),'size':fileContent(_0x50a842)[_0x2d2df7(0xae)]}));}function normalizePackageManifest(_0x578855,_0x5dd201){const _0x35ff31=a160_0x4ea2;if(!_0x578855||typeof _0x578855!=='object'||Array[_0x35ff31(0xa5)](_0x578855))return undefined;const _0x351094=_0x578855,_0x306270=typeof _0x351094['ossPath']===_0x35ff31(0xbe)?_0x351094[_0x35ff31(0x9b)][_0x35ff31(0xbc)]():undefined;if(_0x5dd201[_0x35ff31(0xa8)]&&!_0x306270)return undefined;if(!Array[_0x35ff31(0xa5)](_0x351094[_0x35ff31(0xb0)])||_0x351094[_0x35ff31(0xb0)]['length']===0x0)return undefined;if(!isSha256Hex(_0x351094[_0x35ff31(0x99)]))throw CliErrors[_0x35ff31(0xb5)](_0x35ff31(0xa2));if(!isSha256Hex(_0x351094['zipSha256']))throw CliErrors[_0x35ff31(0xb5)]('Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.');if(!Number['isSafeInteger'](_0x351094[_0x35ff31(0x9f)])||_0x351094[_0x35ff31(0x9f)]<0x0)throw CliErrors[_0x35ff31(0xb5)]('Runtime\x20Skill\x20package\x20size\x20is\x20invalid.');const _0xb5c406=normalizeManifestFiles(_0x351094['files']);if(!_0xb5c406[_0x35ff31(0xb9)](_0x5676a5=>_0x5676a5[_0x35ff31(0xb7)]===SKILL_FILE))throw CliErrors[_0x35ff31(0xb5)](_0x35ff31(0xb4)+SKILL_FILE+'.');const _0x59be19=fileTreeHash(_0xb5c406);if(_0x59be19!==_0x351094[_0x35ff31(0x99)][_0x35ff31(0xa3)]())throw CliErrors[_0x35ff31(0xb5)](_0x35ff31(0xad));return{'schemaVersion':Number[_0x35ff31(0xaf)](_0x351094[_0x35ff31(0x9c)])?_0x351094[_0x35ff31(0x9c)]:0x2,'ossPath':_0x306270,'treeSha256':_0x59be19,'zipSha256':_0x351094[_0x35ff31(0xac)][_0x35ff31(0xa3)](),'zipSize':_0x351094[_0x35ff31(0x9f)],'files':_0xb5c406};}function extractAndVerifyPackage(_0x5d8850,_0x22f37b){const _0x28fd13=a160_0x4ea2,_0x5b9911=normalizePackageManifest(_0x5d8850,{'requireOssPath':![]});if(!_0x5b9911)throw CliErrors['validation'](_0x28fd13(0x95));if(_0x22f37b['length']!==_0x5b9911[_0x28fd13(0x9f)])throw CliErrors['validation'](_0x28fd13(0xba));const _0xba7962=bufferSha256(_0x22f37b);if(_0xba7962!==_0x5b9911[_0x28fd13(0xac)])throw CliErrors[_0x28fd13(0xb5)](_0x28fd13(0xa7));return extractAndVerifyPackageFiles(_0x5b9911,_0x22f37b);}function extractAndVerifyPackageFiles(_0x48bf95,_0x375d09){const _0x16d3c6=a160_0x4ea2,_0x9de1fa=parseZipPackage(_0x375d09);if(_0x9de1fa[_0x16d3c6(0xae)]!==_0x48bf95[_0x16d3c6(0xb0)][_0x16d3c6(0xae)])throw CliErrors[_0x16d3c6(0xb5)](_0x16d3c6(0x92));const _0x4578e2=new Map();for(const _0x14a2d2 of _0x9de1fa){if(_0x4578e2['has'](_0x14a2d2[_0x16d3c6(0xb7)]))throw CliErrors[_0x16d3c6(0xb5)](_0x16d3c6(0x97)+_0x14a2d2[_0x16d3c6(0xb7)]);_0x4578e2['set'](_0x14a2d2[_0x16d3c6(0xb7)],_0x14a2d2);}const _0x47062d=[];for(const _0x3d775c of _0x48bf95[_0x16d3c6(0xb0)]){const _0x171003=_0x4578e2[_0x16d3c6(0xb8)](_0x3d775c[_0x16d3c6(0xb7)]);if(!_0x171003)throw CliErrors[_0x16d3c6(0xb5)](_0x16d3c6(0x94)+_0x3d775c[_0x16d3c6(0xb7)]);if(_0x171003[_0x16d3c6(0x9a)]['length']!==_0x3d775c[_0x16d3c6(0xaa)])throw CliErrors[_0x16d3c6(0xb5)]('Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'+_0x3d775c['path']);const _0x513279=bufferSha256(_0x171003['bytes']);if(_0x513279!==_0x3d775c[_0x16d3c6(0xa1)])throw CliErrors[_0x16d3c6(0xb5)](_0x16d3c6(0x9e)+_0x3d775c[_0x16d3c6(0xb7)]);_0x47062d['push']({'path':_0x3d775c['path'],'bytes':_0x171003[_0x16d3c6(0x9a)]});}return normalizeLocalFiles(_0x47062d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38c582,_0x236c8d){var _0x313ebd=a161_0x58d8,_0x5d4a96=_0x38c582();while(!![]){try{var _0x267de3=-parseInt(_0x313ebd(0xeb))/0x1+parseInt(_0x313ebd(0xe9))/0x2*(-parseInt(_0x313ebd(0xea))/0x3)+parseInt(_0x313ebd(0xe8))/0x4+parseInt(_0x313ebd(0xec))/0x5+-parseInt(_0x313ebd(0xe5))/0x6*(parseInt(_0x313ebd(0xed))/0x7)+parseInt(_0x313ebd(0xe7))/0x8+-parseInt(_0x313ebd(0xe6))/0x9*(-parseInt(_0x313ebd(0xee))/0xa);if(_0x267de3===_0x236c8d)break;else _0x5d4a96['push'](_0x5d4a96['shift']());}catch(_0x25f91d){_0x5d4a96['push'](_0x5d4a96['shift']());}}}(a161_0x1434,0x5750d));function a161_0x1434(){var _0x3ea0c0=['3400092ltYYbS','4548392xZdKtm','550160CrJPWw','122sRoLhY','9eqZrFc','534471OLyDOf','476525LZkYuL','4557kqVbXp','20xyQTjg','6126NAbSrT'];a161_0x1434=function(){return _0x3ea0c0;};return a161_0x1434();}export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';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';function a161_0x58d8(_0x33ab57,_0x12b8ba){_0x33ab57=_0x33ab57-0xe5;var _0x14344e=a161_0x1434();var _0x58d8ec=_0x14344e[_0x33ab57];return _0x58d8ec;}export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a162_0x4fbdcf=a162_0x457e;(function(_0x2f04ab,_0x1c0a42){const _0x23f4aa=a162_0x457e,_0x2f0a8d=_0x2f04ab();while(!![]){try{const _0x30eaae=parseInt(_0x23f4aa(0x1a3))/0x1+-parseInt(_0x23f4aa(0x1bc))/0x2*(-parseInt(_0x23f4aa(0x1ac))/0x3)+-parseInt(_0x23f4aa(0x1c0))/0x4+-parseInt(_0x23f4aa(0x1b2))/0x5+parseInt(_0x23f4aa(0x1a9))/0x6+-parseInt(_0x23f4aa(0x1aa))/0x7+-parseInt(_0x23f4aa(0x1b5))/0x8*(-parseInt(_0x23f4aa(0x1bb))/0x9);if(_0x30eaae===_0x1c0a42)break;else _0x2f0a8d['push'](_0x2f0a8d['shift']());}catch(_0x1c5718){_0x2f0a8d['push'](_0x2f0a8d['shift']());}}}(a162_0x495a,0x82a68));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';function a162_0x457e(_0x26119f,_0x54f1ec){_0x26119f=_0x26119f-0x1a1;const _0x495aa1=a162_0x495a();let _0x457ef0=_0x495aa1[_0x26119f];return _0x457ef0;}import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a162_0x4fbdcf(0x1b0),a162_0x4fbdcf(0x1a6));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a162_0x4fbdcf(0x1b0),a162_0x4fbdcf(0x1a2)),join(a162_0x4fbdcf(0x1c1),a162_0x4fbdcf(0x1a2))];const SUPPORTED_LOCK_VERSIONS=[0x3];function a162_0x495a(){const _0x26f733=['recorded','1752LdaABI','map','unverifiable','home','\x20is\x20unreadable:\x20','parse','49311oWApZe','62GoqMiA','\x20has\x20no\x20skills\x20map','reason','not-recorded','3728948irobuk','.claude','find','absent','skills','157855VQBXnW','message','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','.skill-lock.json','unusable','object','2129424VDkPNe','3281033hNiljp','version','54861SqDzcy','join','present','\x20records\x20\x22','.agents','kind','1717285CNifSt','includes'];a162_0x495a=function(){return _0x26f733;};return a162_0x495a();}function readLockLookup(_0x2a863a,_0x5ed651){const _0x385212=a162_0x4fbdcf;if(!existsSync(_0x2a863a))return{'kind':_0x385212(0x1bf)};let _0x2f6290;try{_0x2f6290=JSON[_0x385212(0x1ba)](readFileSync(_0x2a863a,'utf8'));}catch(_0xfabb77){return{'kind':_0x385212(0x1a7),'reason':_0x2a863a+_0x385212(0x1b9)+_0xfabb77[_0x385212(0x1a4)]};}const _0x15f880=_0x2f6290;if(typeof _0x15f880?.[_0x385212(0x1ab)]!=='number'||!SUPPORTED_LOCK_VERSIONS[_0x385212(0x1b3)](_0x15f880[_0x385212(0x1ab)]))return{'kind':_0x385212(0x1a7),'reason':_0x2a863a+'\x20uses\x20unsupported\x20version\x20'+String(_0x15f880?.[_0x385212(0x1ab)])};if(!_0x15f880['skills']||typeof _0x15f880[_0x385212(0x1a2)]!==_0x385212(0x1a8))return{'kind':'unusable','reason':_0x2a863a+_0x385212(0x1bd)};return _0x15f880[_0x385212(0x1a2)][_0x5ed651]?{'kind':_0x385212(0x1b4)}:{'kind':_0x385212(0x1bf)};}export function resolveInstalledSkill(_0x2da45a,_0x433deb){const _0x3d8e5d=a162_0x4fbdcf,_0x29c4a5=_0x433deb?.[_0x3d8e5d(0x1b8)]??homedir(),_0x49e2d1=_0x433deb?.['globalSkillsDirs']??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x3d8e5d(0x1b6)](_0x3f95d6=>join(_0x29c4a5,_0x3f95d6)),_0x3e39c2=_0x433deb?.['lockFile']??join(_0x29c4a5,SKILL_LOCK_RELATIVE_PATH),_0x59f93e=_0x49e2d1['map'](_0x4858a6=>join(_0x4858a6,_0x2da45a,'SKILL.md')),_0x57fdfe=_0x59f93e[_0x3d8e5d(0x1c2)](_0x5df859=>existsSync(_0x5df859));if(_0x57fdfe)return{'state':_0x3d8e5d(0x1ae),'path':_0x57fdfe};const _0x543cc1=readLockLookup(_0x3e39c2,_0x2da45a);if(_0x543cc1[_0x3d8e5d(0x1b1)]===_0x3d8e5d(0x1a7))return{'state':_0x3d8e5d(0x1b7),'reason':_0x543cc1[_0x3d8e5d(0x1be)]};if(_0x543cc1[_0x3d8e5d(0x1b1)]==='recorded')return{'state':_0x3d8e5d(0x1b7),'reason':_0x3e39c2+_0x3d8e5d(0x1af)+_0x2da45a+_0x3d8e5d(0x1a5)+('('+_0x59f93e[_0x3d8e5d(0x1ad)](',\x20')+')')};return{'state':_0x3d8e5d(0x1a1),'checked':_0x59f93e};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a163_0x2da62d=a163_0x49d6;(function(_0x3df349,_0x4748f4){const _0x4bdecc=a163_0x49d6,_0x3a37b0=_0x3df349();while(!![]){try{const _0x332327=-parseInt(_0x4bdecc(0x181))/0x1*(-parseInt(_0x4bdecc(0x17b))/0x2)+-parseInt(_0x4bdecc(0x17a))/0x3*(-parseInt(_0x4bdecc(0x177))/0x4)+parseInt(_0x4bdecc(0x188))/0x5*(-parseInt(_0x4bdecc(0x18e))/0x6)+-parseInt(_0x4bdecc(0x182))/0x7+-parseInt(_0x4bdecc(0x183))/0x8*(-parseInt(_0x4bdecc(0x187))/0x9)+-parseInt(_0x4bdecc(0x180))/0xa+parseInt(_0x4bdecc(0x179))/0xb;if(_0x332327===_0x4748f4)break;else _0x3a37b0['push'](_0x3a37b0['shift']());}catch(_0x22340b){_0x3a37b0['push'](_0x3a37b0['shift']());}}}(a163_0x1f04,0xc932c));function a163_0x49d6(_0xd450c2,_0x15ca99){_0xd450c2=_0xd450c2-0x177;const _0x1f0465=a163_0x1f04();let _0x49d66f=_0x1f0465[_0xd450c2];return _0x49d66f;}const REDACTED_ACCESS_KEY=a163_0x2da62d(0x18b);export function maskCliAccessKey(_0x34dd8a){const _0x5e53d1=a163_0x2da62d;if(typeof _0x34dd8a!=='string'||_0x34dd8a[_0x5e53d1(0x17c)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x34dd8a['slice'](0x0,0x8)+'*'[_0x5e53d1(0x17d)](_0x34dd8a[_0x5e53d1(0x17c)]-0x8);}export function redactCliConfigCredentials(_0x78a72){const _0x5da276=a163_0x2da62d,_0x1e7fb2={..._0x78a72};return Object['prototype'][_0x5da276(0x18f)][_0x5da276(0x18c)](_0x1e7fb2,_0x5da276(0x17e))&&(_0x1e7fb2['accessKey']=maskCliAccessKey(_0x1e7fb2[_0x5da276(0x17e)])),_0x1e7fb2[_0x5da276(0x18d)]&&typeof _0x1e7fb2[_0x5da276(0x18d)]==='object'&&!Array[_0x5da276(0x186)](_0x1e7fb2[_0x5da276(0x18d)])&&(_0x1e7fb2[_0x5da276(0x18d)]=redactLegacyAppCredentials(_0x1e7fb2[_0x5da276(0x18d)])),_0x1e7fb2;}export function redactCliConfigValue(_0x284c3b,_0xbebb84){const _0x180d42=a163_0x2da62d;if(_0x284c3b===_0x180d42(0x17e)||/^apps\.[^.]+\.accessKey$/[_0x180d42(0x17f)](_0x284c3b))return maskCliAccessKey(_0xbebb84);if(_0x284c3b==='apps'&&_0xbebb84&&typeof _0xbebb84===_0x180d42(0x178)&&!Array['isArray'](_0xbebb84))return redactLegacyAppCredentials(_0xbebb84);if(/^apps\.[^.]+$/['test'](_0x284c3b)&&_0xbebb84&&typeof _0xbebb84===_0x180d42(0x178)&&!Array['isArray'](_0xbebb84)){const _0x370952=_0xbebb84;return Object[_0x180d42(0x18a)][_0x180d42(0x18f)][_0x180d42(0x18c)](_0x370952,_0x180d42(0x17e))?{..._0x370952,'accessKey':maskCliAccessKey(_0x370952[_0x180d42(0x17e)])}:_0xbebb84;}return _0xbebb84;}function a163_0x1f04(){const _0xc084f2=['prototype','<redacted>','call','apps','1788396cGNhLg','hasOwnProperty','82120IJqwpA','object','27763846nGkDtH','48UstjBc','2lwEcfU','length','repeat','accessKey','test','13222280BshLkw','1312969ALckvQ','8189685MQhIpO','394576TZhJNW','map','fromEntries','isArray','117kvkaqO','25rBpcQv','entries'];a163_0x1f04=function(){return _0xc084f2;};return a163_0x1f04();}function redactLegacyAppCredentials(_0x2bf64d){const _0x18d434=a163_0x2da62d;return Object[_0x18d434(0x185)](Object[_0x18d434(0x189)](_0x2bf64d)[_0x18d434(0x184)](([_0x101d59,_0x4e6790])=>{const _0x5a31c0=_0x18d434;if(!_0x4e6790||typeof _0x4e6790!==_0x5a31c0(0x178)||Array['isArray'](_0x4e6790))return[_0x101d59,_0x4e6790];const _0x56d875={..._0x4e6790};return Object['prototype'][_0x5a31c0(0x18f)][_0x5a31c0(0x18c)](_0x56d875,'accessKey')&&(_0x56d875[_0x5a31c0(0x17e)]=maskCliAccessKey(_0x56d875[_0x5a31c0(0x17e)])),[_0x101d59,_0x56d875];}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x22565f,_0x3ef579){const _0x48acbf=a164_0x11d4,_0x507d45=_0x22565f();while(!![]){try{const _0x5d3041=parseInt(_0x48acbf(0x1ed))/0x1*(-parseInt(_0x48acbf(0x1ea))/0x2)+parseInt(_0x48acbf(0x1ef))/0x3*(-parseInt(_0x48acbf(0x1f5))/0x4)+-parseInt(_0x48acbf(0x1f1))/0x5*(parseInt(_0x48acbf(0x1eb))/0x6)+parseInt(_0x48acbf(0x1f0))/0x7*(-parseInt(_0x48acbf(0x1f2))/0x8)+parseInt(_0x48acbf(0x1f4))/0x9+-parseInt(_0x48acbf(0x1ee))/0xa*(parseInt(_0x48acbf(0x1f3))/0xb)+parseInt(_0x48acbf(0x1ec))/0xc;if(_0x5d3041===_0x3ef579)break;else _0x507d45['push'](_0x507d45['shift']());}catch(_0xd40a19){_0x507d45['push'](_0x507d45['shift']());}}}(a164_0x2237,0x893b1));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a164_0x11d4(_0x3a05f1,_0x1972f1){_0x3a05f1=_0x3a05f1-0x1ea;const _0x2237b7=a164_0x2237();let _0x11d443=_0x2237b7[_0x3a05f1];return _0x11d443;}function a164_0x2237(){const _0x130f2f=['3386FhMzxV','1590wjbLQO','30498612hsGThE','577IMmmjc','1160470DpmssO','3HowuNC','4557pDkAce','10055SdsizZ','5816PUJrpp','44GUDMcg','4220352MbzZEy','4564OhhLTj'];a164_0x2237=function(){return _0x130f2f;};return a164_0x2237();}import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a165_0x3aaf(_0x4caaf8,_0x5f30fc){_0x4caaf8=_0x4caaf8-0x79;const _0x170de1=a165_0x170d();let _0x3aafc9=_0x170de1[_0x4caaf8];return _0x3aafc9;}(function(_0x321a49,_0x13db00){const _0x38a575=a165_0x3aaf,_0x35e41a=_0x321a49();while(!![]){try{const _0x1cf4e5=-parseInt(_0x38a575(0x87))/0x1+parseInt(_0x38a575(0x7d))/0x2*(parseInt(_0x38a575(0x8f))/0x3)+parseInt(_0x38a575(0x7b))/0x4+parseInt(_0x38a575(0x7e))/0x5*(-parseInt(_0x38a575(0x7f))/0x6)+parseInt(_0x38a575(0x8c))/0x7+-parseInt(_0x38a575(0x7a))/0x8+parseInt(_0x38a575(0x89))/0x9;if(_0x1cf4e5===_0x13db00)break;else _0x35e41a['push'](_0x35e41a['shift']());}catch(_0x2010c0){_0x35e41a['push'](_0x35e41a['shift']());}}}(a165_0x170d,0xe2f9d));function a165_0x170d(){const _0x393988=['join','currentVersion','Recommended\x20stable:\x20','npm\x20install\x20-g\x20','belowMinimum','unavailable','minimumVersionMessage','1228172WYyPMD','valid','19420875TMGFYy','Upgrade\x20command:\x20','Current\x20version:\x20','2755928DeGewb','stableVersion','minimumVersion','3wdvaUR','Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.','11416232eoOblK','5376468YsHSKX','upgradeMessage','2392396RxSsKE','6875rJzYkB','6576bAAHKY'];a165_0x170d=function(){return _0x393988;};return a165_0x170d();}import a165_0x406e2a 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(_0x83390f,_0x51158e){const _0x54921d=a165_0x3aaf,_0x3fb186=a165_0x406e2a[_0x54921d(0x88)](_0x83390f)===_0x83390f,_0x27911e=_0x51158e?.[_0x54921d(0x8d)]??null,_0x3b04a3=_0x51158e?.[_0x54921d(0x8e)]??null,_0x22dde8=Boolean(_0x3fb186&&_0x27911e&&a165_0x406e2a['lt'](_0x83390f,_0x27911e)),_0x2fc096=Boolean(_0x3fb186&&_0x3b04a3&&a165_0x406e2a['lt'](_0x83390f,_0x3b04a3));return{'currentVersion':_0x83390f,'stableVersion':_0x27911e,'minimumVersion':_0x3b04a3,'needsUpgrade':_0x22dde8||_0x2fc096,'belowMinimum':_0x2fc096,'upgradeMessage':_0x51158e?.[_0x54921d(0x7c)],'minimumVersionMessage':_0x51158e?.[_0x54921d(0x86)]};}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}export function getCliUpgradeCommand(_0x2f6f0c){const _0xd2b83f=a165_0x3aaf;return _0xd2b83f(0x83)+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0x2f6f0c[_0xd2b83f(0x8d)]??'latest');}export function assertCliVersionSupported(_0x119014){const _0x368ec3=a165_0x3aaf;if(!_0x119014[_0x368ec3(0x84)])return;const _0x1e9c66=[_0x119014[_0x368ec3(0x86)],_0x368ec3(0x8b)+_0x119014[_0x368ec3(0x81)],'Minimum\x20supported:\x20'+_0x119014['minimumVersion'],_0x368ec3(0x82)+(_0x119014[_0x368ec3(0x8d)]??_0x368ec3(0x85)),_0x368ec3(0x8a)+getCliUpgradeCommand(_0x119014)]['filter'](Boolean)[_0x368ec3(0x80)]('\x0a');throw CliErrors['validation'](_0x368ec3(0x79),_0x1e9c66);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a166_0x4e8a(){const _0x13e70a=['string','84nVtxly','now','minimumVersionMessage','2052404gxxxsk','recommendedVersion','2565195ebBeQO','18162FihFCt','finally','then','294liLjzZ','json','3694800kzRvCm','5SDMkkP','valid','2359885uXivRO','minimumVersion','4174YJtHef','cli','trim','217luRaxo','49398lQRvqc','timeout','object','upgradeMessage','6460mqwlKM'];a166_0x4e8a=function(){return _0x13e70a;};return a166_0x4e8a();}(function(_0x52d70e,_0x5b382f){const _0x1b697e=a166_0x2fd8,_0x14beae=_0x52d70e();while(!![]){try{const _0x1eeb2a=-parseInt(_0x1b697e(0x87))/0x1*(-parseInt(_0x1b697e(0x8e))/0x2)+parseInt(_0x1b697e(0x9d))/0x3+parseInt(_0x1b697e(0x9b))/0x4*(-parseInt(_0x1b697e(0x8a))/0x5)+-parseInt(_0x1b697e(0x92))/0x6*(parseInt(_0x1b697e(0x91))/0x7)+parseInt(_0x1b697e(0x89))/0x8+-parseInt(_0x1b697e(0x9e))/0x9*(-parseInt(_0x1b697e(0x96))/0xa)+-parseInt(_0x1b697e(0x8c))/0xb*(parseInt(_0x1b697e(0x98))/0xc);if(_0x1eeb2a===_0x5b382f)break;else _0x14beae['push'](_0x14beae['shift']());}catch(_0x511f15){_0x14beae['push'](_0x14beae['shift']());}}}(a166_0x4e8a,0xeb5d4));import a166_0x4d238a 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(_0x109737){const _0x59b74a=a166_0x2fd8;return typeof _0x109737===_0x59b74a(0x97)&&_0x109737['trim']()?_0x109737[_0x59b74a(0x90)]():null;}function a166_0x2fd8(_0x1f74b0,_0x14c17b){_0x1f74b0=_0x1f74b0-0x85;const _0x4e8abd=a166_0x4e8a();let _0x2fd887=_0x4e8abd[_0x1f74b0];return _0x2fd887;}function pickStrictSemver(_0x33efd1){const _0x228b29=a166_0x2fd8,_0x866e60=pickString(_0x33efd1);return _0x866e60&&a166_0x4d238a[_0x228b29(0x8b)](_0x866e60)===_0x866e60?_0x866e60:null;}export function normalizeCliVersionPolicy(_0x16bfd6){const _0x459947=a166_0x2fd8;if(!_0x16bfd6||typeof _0x16bfd6!==_0x459947(0x94))return null;const _0x22e3d1=_0x16bfd6,_0xc17a32=_0x22e3d1[_0x459947(0x8f)]&&typeof _0x22e3d1[_0x459947(0x8f)]==='object'?_0x22e3d1['cli']:_0x22e3d1,_0x5c9b6e=pickStrictSemver(_0xc17a32['stableVersion']??_0xc17a32['latestVersion']??_0xc17a32[_0x459947(0x9c)]),_0x12da7b=pickStrictSemver(_0xc17a32[_0x459947(0x8d)]??_0xc17a32['minVersion']);if(!_0x5c9b6e&&!_0x12da7b)return null;if(_0x5c9b6e&&_0x12da7b&&a166_0x4d238a['gt'](_0x12da7b,_0x5c9b6e))return null;return{'stableVersion':_0x5c9b6e,'minimumVersion':_0x12da7b,'upgradeMessage':pickString(_0xc17a32[_0x459947(0x95)])??undefined,'minimumVersionMessage':pickString(_0xc17a32[_0x459947(0x9a)])??undefined};}export async function fetchCliVersionPolicy(){const _0x425965=a166_0x2fd8;try{const _0xcbd06=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':'application/json'},'signal':AbortSignal[_0x425965(0x93)](FETCH_TIMEOUT_MS)});if(!_0xcbd06['ok'])return null;return normalizeCliVersionPolicy(await _0xcbd06[_0x425965(0x88)]());}catch{return null;}}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;export async function getCliVersionPolicy(){const _0x37ad48=a166_0x2fd8,_0x3c1113=Date['now']();if(hasCachedPolicy){const _0x116623=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0x3c1113-cachedAt<_0x116623)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()[_0x37ad48(0x86)](_0x373aea=>{const _0x41ff68=_0x37ad48;return cachedPolicy=_0x373aea,cachedAt=Date[_0x41ff68(0x99)](),hasCachedPolicy=!![],_0x373aea;})[_0x37ad48(0x85)](()=>{pendingPolicy=null;}),pendingPolicy;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}
|