@lovrabet/lovrabet-cli 2.3.1-beta.2 → 2.3.1-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -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/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.d.ts +2 -0
- 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.d.ts +2 -0
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/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.d.ts +33 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.d.ts +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.d.ts +3 -3
- 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.d.ts +0 -51
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.d.ts +3 -5
- 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 +16 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.d.ts +0 -2
- 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.d.ts +59 -0
- package/lib/generated/official-routing.js +1 -0
- package/lib/generated/routing-contract.d.ts +9 -0
- package/lib/generated/routing-contract.js +1 -0
- 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/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/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -1
- package/skills/lovrabet/SKILL.md +4 -4
- package/skills/lovrabet/guides/troubleshooting.md +3 -5
- package/skills/lovrabet/references/lovrabet-config-commands.md +33 -10
- package/skills/lovrabet/references/lovrabet-config.md +8 -20
- package/skills/lovrabet/references/lovrabet-doctor.md +0 -2
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +1 -3
- package/skills/lovrabet.manifest.json +3 -3
- package/lib/core/kb-search-client.d.ts +0 -30
- package/lib/core/kb-search-client.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a136_0x2159d4=a136_0x5325;(function(_0x54cd0d,_0x17090a){const _0x1b9bfe=a136_0x5325,_0x9ec9bd=_0x54cd0d();while(!![]){try{const _0x449853=-parseInt(_0x1b9bfe(0x1de))/0x1*(-parseInt(_0x1b9bfe(0x1dd))/0x2)+parseInt(_0x1b9bfe(0x1df))/0x3+parseInt(_0x1b9bfe(0x1ea))/0x4*(-parseInt(_0x1b9bfe(0x1ee))/0x5)+-parseInt(_0x1b9bfe(0x1e7))/0x6+-parseInt(_0x1b9bfe(0x1e5))/0x7+-parseInt(_0x1b9bfe(0x1ec))/0x8+-parseInt(_0x1b9bfe(0x1e3))/0x9*(-parseInt(_0x1b9bfe(0x1e0))/0xa);if(_0x449853===_0x17090a)break;else _0x9ec9bd['push'](_0x9ec9bd['shift']());}catch(_0x25d510){_0x9ec9bd['push'](_0x9ec9bd['shift']());}}}(a136_0x5bf6,0x35114));export const METADATA_FILE=a136_0x2159d4(0x1e2);export const SKILL_FILE=a136_0x2159d4(0x1e6);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a136_0x2159d4(0x1eb)]);function a136_0x5bf6(){const _0x3d054f=['443256CDwoYA','.git','5FMOxkK','build','node_modules','4jAVScV','129007YRnbvK','751455HQfCty','3110djAcZf','.hg','lovrabet.skill.json','1494xWKPQg','.turbo','949886zRgAeX','SKILL.md','507834WvzMRd','dist','.svn','268068ANWNNY','.DS_Store'];a136_0x5bf6=function(){return _0x3d054f;};return a136_0x5bf6();}function a136_0x5325(_0x287631,_0x28ebd1){_0x287631=_0x287631-0x1dd;const _0x5bf62d=a136_0x5bf6();let _0x5325d0=_0x5bf62d[_0x287631];return _0x5325d0;}export const IGNORED_DIR_NAMES=new Set([a136_0x2159d4(0x1ed),a136_0x2159d4(0x1e1),a136_0x2159d4(0x1e9),a136_0x2159d4(0x1f0),'.next',a136_0x2159d4(0x1e8),a136_0x2159d4(0x1ef),'coverage',a136_0x2159d4(0x1e4),'.cache']);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x939756,_0xd1d8de){const _0x3ec3bf=a137_0xaf6a,_0x4ac626=_0x939756();while(!![]){try{const _0x59a6c6=-parseInt(_0x3ec3bf(0x1fa))/0x1*(-parseInt(_0x3ec3bf(0x200))/0x2)+-parseInt(_0x3ec3bf(0x1f7))/0x3+parseInt(_0x3ec3bf(0x1f3))/0x4+parseInt(_0x3ec3bf(0x1f0))/0x5+-parseInt(_0x3ec3bf(0x1fe))/0x6+-parseInt(_0x3ec3bf(0x1fd))/0x7+parseInt(_0x3ec3bf(0x1f8))/0x8;if(_0x59a6c6===_0xd1d8de)break;else _0x4ac626['push'](_0x4ac626['shift']());}catch(_0x4b5f37){_0x4ac626['push'](_0x4ac626['shift']());}}}(a137_0xa65a,0x4f90e));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';function a137_0xa65a(){const _0x377100=['.tmp','validation','442528BHJgvX','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','startsWith','utf8','727569ggnquV','5718384fTdVDe','endsWith','1986GrlGvK','isSymbolicLink','Unsafe\x20Skill\x20file\x20path:\x20','3995320QdsrTS','3539304XtcZTA','split','420aGDpML','2432895YZQNYZ'];a137_0xa65a=function(){return _0x377100;};return a137_0xa65a();}import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x4bebcf,_0x2cbc4b){const _0x6ff2c2=a137_0xaf6a,_0x120645=normalizeSkillRelativePath(_0x2cbc4b),_0x659b10=realOrResolved(_0x4bebcf),_0x26816d=resolve(_0x659b10,..._0x120645[_0x6ff2c2(0x1ff)]('/'));if(!isPathInside(_0x26816d,_0x659b10))throw CliErrors[_0x6ff2c2(0x1f2)](_0x6ff2c2(0x1fc)+_0x2cbc4b);return ensureNoSymlinkInManagedPath(_0x659b10,_0x120645),_0x26816d;}export function ensureNoSymlinkInManagedPath(_0x52a1f7,_0x1d277c){const _0x568482=a137_0xaf6a;let _0x1b354b=_0x52a1f7;for(const _0x1d4bb4 of _0x1d277c['split']('/')){_0x1b354b=resolve(_0x1b354b,_0x1d4bb4);const _0x52adc4=lstatIfPresent(_0x1b354b);if(_0x52adc4?.[_0x568482(0x1fb)]())throw CliErrors['validation'](_0x568482(0x1f4)+_0x1d277c);}}export function isDanglingSymlink(_0x4e9241){try{return lstatSync(_0x4e9241)['isSymbolicLink']();}catch{return![];}}export function resolveSymlinkTarget(_0x256efa){const _0x161e09=readlinkSync(_0x256efa);return isAbsolute(_0x161e09)?_0x161e09:resolve(dirname(_0x256efa),_0x161e09);}export function isPathInside(_0xcef081,_0x325303){const _0x2f4051=a137_0xaf6a,_0x10f218=_0xcef081[_0x2f4051(0x1f9)](sep)?_0xcef081:''+_0xcef081+sep,_0x48a834=_0x325303[_0x2f4051(0x1f9)](sep)?_0x325303:''+_0x325303+sep;return _0xcef081===_0x325303||_0x10f218[_0x2f4051(0x1f5)](_0x48a834);}export function realOrResolved(_0x1bc185){try{return realpathSync(_0x1bc185);}catch{return resolve(_0x1bc185);}}export function lstatIfPresent(_0x2a0621){try{return lstatSync(_0x2a0621);}catch{return undefined;}}function a137_0xaf6a(_0x18be2f,_0x222594){_0x18be2f=_0x18be2f-0x1f0;const _0xa65a4=a137_0xa65a();let _0xaf6a1b=_0xa65a4[_0x18be2f];return _0xaf6a1b;}export function writeTextAtomic(_0x12d864,_0x43e13c,_0xb48251){const _0x1458c8=a137_0xaf6a;writeBytesAtomic(_0x12d864,Buffer['from'](_0x43e13c,_0x1458c8(0x1f6)),_0xb48251);}export function writeBytesAtomic(_0x2bfe39,_0x445629,_0x292369){const _0x5c18c8=a137_0xaf6a,_0x35069a=_0x2bfe39+_0x5c18c8(0x1f1);try{writeFileSync(_0x35069a,_0x445629,{'mode':_0x292369}),renameSync(_0x35069a,_0x2bfe39);}catch(_0x2d7d39){try{rmSync(_0x35069a,{'force':!![]});}catch{}throw _0x2d7d39;}}export function writeJsonAtomic(_0x3d53fe,_0x17c6d0){writeTextAtomic(_0x3d53fe,JSON['stringify'](_0x17c6d0,null,0x2)+'\x0a',0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4977cc,_0x3e4068){const _0x574166=a138_0x73d5,_0x19f6ee=_0x4977cc();while(!![]){try{const _0x39614e=parseInt(_0x574166(0x91))/0x1+-parseInt(_0x574166(0x8c))/0x2+-parseInt(_0x574166(0x8e))/0x3*(-parseInt(_0x574166(0x88))/0x4)+parseInt(_0x574166(0x8f))/0x5+-parseInt(_0x574166(0x89))/0x6+-parseInt(_0x574166(0x92))/0x7+parseInt(_0x574166(0x90))/0x8;if(_0x39614e===_0x3e4068)break;else _0x19f6ee['push'](_0x19f6ee['shift']());}catch(_0x2030fb){_0x19f6ee['push'](_0x19f6ee['shift']());}}}(a138_0x50d5,0x75bf6));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x4c186c){const _0x5cdde9=a138_0x73d5;return createHash(_0x5cdde9(0x87))[_0x5cdde9(0x8a)](_0x4c186c)[_0x5cdde9(0x8b)](_0x5cdde9(0x86));}function a138_0x50d5(){const _0x1a716b=['586330SLpoIx','3447626jxbebB','hex','sha256','8RpLESP','1399902kZMLyh','update','digest','1296276SXSQXq','size','741495WsuwMj','1009125yQphaP','4590256HDEsMe'];a138_0x50d5=function(){return _0x1a716b;};return a138_0x50d5();}export function fileHash(_0x43fbb0){return bufferSha256(fileContent(_0x43fbb0));}function a138_0x73d5(_0x2c60d0,_0x190208){_0x2c60d0=_0x2c60d0-0x86;const _0x50d52b=a138_0x50d5();let _0x73d549=_0x50d52b[_0x2c60d0];return _0x73d549;}export function bufferSha256(_0x3cb1d7){const _0x53f095=a138_0x73d5;return createHash(_0x53f095(0x87))[_0x53f095(0x8a)](_0x3cb1d7)[_0x53f095(0x8b)](_0x53f095(0x86));}export function fileTreeHash(_0x4c38d8){const _0x579f35=a138_0x73d5,_0x27627a=createHash('sha256');for(const _0x5dec66 of normalizeManifestFiles(_0x4c38d8)){_0x27627a['update'](_0x5dec66['path']),_0x27627a[_0x579f35(0x8a)]('\x00'),_0x27627a[_0x579f35(0x8a)](_0x5dec66[_0x579f35(0x87)]),_0x27627a['update']('\x00'),_0x27627a[_0x579f35(0x8a)](String(_0x5dec66[_0x579f35(0x8d)])),_0x27627a[_0x579f35(0x8a)]('\x00');}return _0x27627a[_0x579f35(0x8b)]('hex');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a139_0x1bfb(_0x911604,_0x3f72d7){_0x911604=_0x911604-0x1b4;const _0x42585b=a139_0x4258();let _0x1bfb71=_0x42585b[_0x911604];return _0x1bfb71;}const a139_0x4a080b=a139_0x1bfb;(function(_0x44aa2a,_0x68b969){const _0x30dcd5=a139_0x1bfb,_0xdc8b1a=_0x44aa2a();while(!![]){try{const _0x29614f=-parseInt(_0x30dcd5(0x1c0))/0x1*(-parseInt(_0x30dcd5(0x1c3))/0x2)+-parseInt(_0x30dcd5(0x1b9))/0x3+-parseInt(_0x30dcd5(0x1bb))/0x4*(parseInt(_0x30dcd5(0x1c4))/0x5)+parseInt(_0x30dcd5(0x1c1))/0x6+parseInt(_0x30dcd5(0x1be))/0x7*(-parseInt(_0x30dcd5(0x1ba))/0x8)+parseInt(_0x30dcd5(0x1b8))/0x9+parseInt(_0x30dcd5(0x1b5))/0xa*(parseInt(_0x30dcd5(0x1bc))/0xb);if(_0x29614f===_0x68b969)break;else _0xdc8b1a['push'](_0xdc8b1a['shift']());}catch(_0x1fca0d){_0xdc8b1a['push'](_0xdc8b1a['shift']());}}}(a139_0x4258,0xd9448));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x4b451,_0x40c5fb=a139_0x4a080b(0x1b6),_0x1e1204={}){const _0x159f02=a139_0x4a080b,_0x591479=resolveSkillSyncPaths(_0x1e1204),_0x58e9b9=safePathSegment(_0x4b451,_0x159f02(0x1bd)),_0x1d4741=_0x40c5fb==='project'?[resolve(_0x1e1204[_0x159f02(0x1c2)]??process[_0x159f02(0x1c2)](),_0x159f02(0x1b7),_0x159f02(0x1b4))]:runtimeAgentSkillRoots(_0x591479);return Object[_0x159f02(0x1bf)]({'scope':_0x40c5fb,'appCode':_0x58e9b9,'skillRoots':Object['freeze'](_0x1d4741),'managedRoot':_0x591479['managedRoot']});}function a139_0x4258(){const _0x39b19f=['1425778cRhoXE','120qLnkio','skills','5060EFVqQH','global','.agents','221796FTqCTA','745104pZZnCs','8RqvVrk','258376ljVNxi','33704tDuZKI','appCode','9212609TvkdLs','freeze','2agBOUI','6022998wHLTDl','cwd'];a139_0x4258=function(){return _0x39b19f;};return a139_0x4258();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a139_0x1a26(_0x4654c5,_0x374f6c){_0x4654c5=_0x4654c5-0x1ab;const _0x4c18b8=a139_0x4c18();let _0x1a261e=_0x4c18b8[_0x4654c5];return _0x1a261e;}const a139_0x4ef4ee=a139_0x1a26;(function(_0x4bef12,_0x5da48d){const _0x431d5c=a139_0x1a26,_0x3152be=_0x4bef12();while(!![]){try{const _0x4c2c65=-parseInt(_0x431d5c(0x1dc))/0x1+-parseInt(_0x431d5c(0x1c0))/0x2+parseInt(_0x431d5c(0x1d2))/0x3*(-parseInt(_0x431d5c(0x1b1))/0x4)+parseInt(_0x431d5c(0x1c5))/0x5*(-parseInt(_0x431d5c(0x1df))/0x6)+-parseInt(_0x431d5c(0x1d8))/0x7+-parseInt(_0x431d5c(0x1e3))/0x8+parseInt(_0x431d5c(0x1b5))/0x9*(parseInt(_0x431d5c(0x1d7))/0xa);if(_0x4c2c65===_0x5da48d)break;else _0x3152be['push'](_0x3152be['shift']());}catch(_0x871580){_0x3152be['push'](_0x3152be['shift']());}}}(a139_0x4c18,0x3bed1));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a139_0x78174f from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';function a139_0x4c18(){const _0xd176fd=['126VhmNuG','appCode','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','updated','name','scopes','length','runtime-observe','removed','isSymbolicLink','filter','146236FdnWmj','external-symlink','linked-from-protected-root','contentHash','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','2288345SBpiKv','startsWith','skill','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','slice','project','skillRoots','map','has','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','created','get','pruneSkillCodes','5259aCwLMT','lovrabet','managedRoot','skillCode','values','1282390bujJAj','2207926IOEXzB','metadata-mismatch','builtin','dir','194525gECAUr','set','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','6hZRhDw','personal','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','isDirectory','1254448vmjEgq','scope','secret-retriever','skipped','validation','agentsSkillsDir','env','metadataPath','804LYMCZQ','activeSkillCodes','push','trim'];a139_0x4c18=function(){return _0xd176fd;};return a139_0x4c18();}import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a139_0x78174f,RESERVED_PROJECT_SKILL_CODES=new Set([a139_0x4ef4ee(0x1d3),a139_0x4ef4ee(0x1bc),a139_0x4ef4ee(0x1ab)]);export function linkEffectiveRuntimeSkills(_0x274eff,_0x7eec09){const _0x1a4333=a139_0x4ef4ee,_0x12f1f3=new Map();for(const _0xc37a8b of _0x274eff){const _0x1ed883=_0xc37a8b[_0x1a4333(0x1c7)]['skillCode'];if(!_0x1ed883)continue;const _0x24906a=_0x12f1f3[_0x1a4333(0x1d0)](_0x1ed883);(!_0x24906a||_0xc37a8b[_0x1a4333(0x1e4)]===_0x1a4333(0x1e0))&&_0x12f1f3[_0x1a4333(0x1dd)](_0x1ed883,_0xc37a8b);}const _0x3534a2=[];for(const _0x2d10d7 of _0x12f1f3[_0x1a4333(0x1d6)]()){const _0x10f23a=requireSkillCode(_0x2d10d7[_0x1a4333(0x1c7)]),_0x2ebf24=readMetadataIfPresent(_0x2d10d7[_0x1a4333(0x1b0)]);if(_0x2ebf24?.[_0x1a4333(0x1b6)]!==_0x7eec09[_0x1a4333(0x1b6)]||_0x2ebf24[_0x1a4333(0x1d5)]!==_0x10f23a)throw CliErrors['validation']('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x7eec09['appCode']+':\x20'+_0x2d10d7[_0x1a4333(0x1b0)]);const _0x4e2e56=runtimeSkillLinkName(_0x7eec09,_0x10f23a);for(const _0x3a6567 of _0x7eec09[_0x1a4333(0x1cb)]){_0x3534a2['push'](ensureManagedSymlink(resolve(_0x3a6567,_0x4e2e56),_0x2d10d7['dir'],_0x7eec09,_0x10f23a));}}return _0x3534a2;}export function pruneStaleRuntimeSkillLinks(_0x402787,_0x45e6d2,_0x3b2fcf){const _0x19ead2=a139_0x4ef4ee,_0x5c7c97=new Set([..._0x45e6d2][_0x19ead2(0x1cc)](_0x29814c=>_0x29814c[_0x19ead2(0x1b4)]())['filter'](Boolean)),_0x534696=_0x3b2fcf?new Set([..._0x3b2fcf][_0x19ead2(0x1cc)](_0xf44d49=>_0xf44d49[_0x19ead2(0x1b4)]())[_0x19ead2(0x1bf)](Boolean)):undefined,_0x22a7ce=[];for(const _0x49eb0d of _0x402787[_0x19ead2(0x1cb)]){for(const _0x31d993 of managedTargetSkillLinkPaths(_0x49eb0d,_0x402787)){const _0x39689d=runtimeSkillCodeFromLink(_0x402787,_0x31d993);if(_0x534696&&!_0x534696[_0x19ead2(0x1cd)](_0x39689d))continue;if(_0x5c7c97[_0x19ead2(0x1cd)](_0x39689d))continue;_0x22a7ce[_0x19ead2(0x1b3)](removeManagedSkillLink(_0x31d993,_0x402787,_0x39689d));}}return _0x22a7ce;}export function pruneStaleRuntimeSkillCache(_0x3048f6,_0x324877={}){const _0x18f2e9=a139_0x4ef4ee,_0x58315e=new Set([..._0x3048f6[_0x18f2e9(0x1b2)]]['map'](_0x2a341f=>_0x2a341f['trim']())[_0x18f2e9(0x1bf)](Boolean)),_0x1ae0e4=_0x3048f6[_0x18f2e9(0x1d1)]?new Set([..._0x3048f6[_0x18f2e9(0x1d1)]]['map'](_0x25771d=>_0x25771d['trim']())[_0x18f2e9(0x1bf)](Boolean)):undefined,_0xf543cc=_0x3048f6[_0x18f2e9(0x1ba)]??['personal','company'],_0x29039a=resolve(getRuntimeSkillCacheRoot(_0x3048f6[_0x18f2e9(0x1af)],_0x3048f6['accessKey'],_0x324877),safePathSegment(_0x3048f6[_0x18f2e9(0x1b6)],'appCode')),_0x385222=[];for(const _0x2ec034 of _0xf543cc){const _0x1444ee=resolve(_0x29039a,_0x2ec034);if(!existsSync(_0x1444ee))continue;for(const _0x486915 of readdirSync(_0x1444ee,{'withFileTypes':!![]})){if(!_0x486915[_0x18f2e9(0x1e2)]())continue;const _0x3c9687=_0x486915['name'];if(_0x1ae0e4&&!_0x1ae0e4['has'](_0x3c9687))continue;if(_0x58315e[_0x18f2e9(0x1cd)](_0x3c9687))continue;const _0x4bec0a=resolve(_0x1444ee,_0x3c9687),_0x5d5315=readMetadataIfPresent(resolve(_0x4bec0a,METADATA_FILE));if(_0x5d5315?.[_0x18f2e9(0x1b6)]!==_0x3048f6[_0x18f2e9(0x1b6)]||_0x5d5315[_0x18f2e9(0x1e4)]!==_0x2ec034||_0x5d5315[_0x18f2e9(0x1d5)]!==_0x3c9687){_0x385222[_0x18f2e9(0x1b3)]({'path':_0x4bec0a,'action':_0x18f2e9(0x1ac),'reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x4bec0a,_0x3048f6['protectedLinkRoots']??[])){_0x385222[_0x18f2e9(0x1b3)]({'path':_0x4bec0a,'action':'skipped','reason':_0x18f2e9(0x1c2)});continue;}removeSync(_0x4bec0a),_0x385222[_0x18f2e9(0x1b3)]({'path':_0x4bec0a,'action':_0x18f2e9(0x1bd)});}}return _0x385222;}export function linkGlobalRuntimeSkills(_0x5df022,_0x2cbb9f={}){const _0x3f88c4=a139_0x4ef4ee,_0x26bdf5=resolveSkillSyncPaths(_0x2cbb9f),_0x1e1723=[];for(const _0x592721 of _0x5df022){if(_0x592721[_0x3f88c4(0x1e4)]!==_0x3f88c4(0x1da))throw CliErrors[_0x3f88c4(0x1ad)](_0x3f88c4(0x1ce)+_0x592721[_0x3f88c4(0x1e4)]);const _0x59e3e6=requireSkillCode(_0x592721['skill']),_0x2dc181=copyManagedSkillDirectory(_0x592721['dir'],resolve(_0x26bdf5[_0x3f88c4(0x1ae)],_0x59e3e6));_0x1e1723[_0x3f88c4(0x1b3)]({..._0x2dc181,'contentHash':_0x592721['contentHash']});}return _0x1e1723;}function ensureManagedSymlink(_0x25476e,_0x1f12ad,_0x4bc7da,_0x39eaf0){const _0x55098b=a139_0x4ef4ee;mkdirSync(dirname(_0x25476e),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x25476e)||isDanglingSymlink(_0x25476e)){const _0x3a021e=lstatSync(_0x25476e);if(!_0x3a021e['isSymbolicLink']())throw CliErrors[_0x55098b(0x1ad)]('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x25476e);const _0x15b907=resolveSymlinkTarget(_0x25476e);if(!isPathInside(realOrResolved(_0x15b907),realOrResolved(_0x4bc7da['managedRoot'])))throw CliErrors[_0x55098b(0x1ad)](_0x55098b(0x1c8)+_0x25476e);if(realOrResolved(_0x15b907)===realOrResolved(_0x1f12ad))return{'path':_0x25476e,'target':_0x1f12ad,'action':'unchanged'};const _0x29aea0=readMetadataIfPresent(resolve(_0x15b907,METADATA_FILE));if(_0x4bc7da[_0x55098b(0x1e4)]==='project'&&(_0x29aea0?.['appCode']!==_0x4bc7da[_0x55098b(0x1b6)]||_0x29aea0[_0x55098b(0x1d5)]!==_0x39eaf0))throw CliErrors[_0x55098b(0x1ad)](_0x55098b(0x1c4)+_0x25476e);return unlinkSync(_0x25476e),symlinkSync(_0x1f12ad,_0x25476e,_0x55098b(0x1db)),{'path':_0x25476e,'target':_0x1f12ad,'action':_0x55098b(0x1b8)};}return symlinkSync(_0x1f12ad,_0x25476e,'dir'),{'path':_0x25476e,'target':_0x1f12ad,'action':_0x55098b(0x1cf)};}function managedTargetSkillLinkPaths(_0x3b1fbe,_0x120d09){const _0x50e19c=a139_0x4ef4ee;if(!existsSync(_0x3b1fbe))return[];const _0x3be13a=_0x120d09[_0x50e19c(0x1b6)]+'--';return readdirSync(_0x3b1fbe,{'withFileTypes':!![]})[_0x50e19c(0x1bf)](_0xe379b8=>_0x120d09[_0x50e19c(0x1e4)]===_0x50e19c(0x1ca)||_0xe379b8[_0x50e19c(0x1b9)][_0x50e19c(0x1c6)](_0x3be13a))['map'](_0x4df9bd=>resolve(_0x3b1fbe,_0x4df9bd[_0x50e19c(0x1b9)]));}function removeManagedSkillLink(_0x1f3c2e,_0x263220,_0x4afbb9){const _0x1162b4=a139_0x4ef4ee,_0x22063a=lstatIfPresent(_0x1f3c2e);if(!_0x22063a?.[_0x1162b4(0x1be)]())return{'path':_0x1f3c2e,'action':_0x1162b4(0x1ac),'reason':'not-managed-symlink'};const _0x54f14e=resolveSymlinkTarget(_0x1f3c2e);if(!isPathInside(realOrResolved(_0x54f14e),realOrResolved(_0x263220[_0x1162b4(0x1d4)])))return{'path':_0x1f3c2e,'action':_0x1162b4(0x1ac),'reason':_0x1162b4(0x1c1)};const _0x34b608=readMetadataIfPresent(resolve(_0x54f14e,METADATA_FILE));if(_0x263220['scope']===_0x1162b4(0x1ca)&&(_0x34b608?.[_0x1162b4(0x1b6)]!==_0x263220[_0x1162b4(0x1b6)]||_0x34b608[_0x1162b4(0x1d5)]!==_0x4afbb9))return{'path':_0x1f3c2e,'action':_0x1162b4(0x1ac),'reason':_0x1162b4(0x1d9)};return unlinkSync(_0x1f3c2e),{'path':_0x1f3c2e,'action':'removed'};}function isLinkedFromAnyRoot(_0x4d124a,_0x3f65c9){const _0x29da5d=a139_0x4ef4ee,_0x59eebb=realOrResolved(_0x4d124a);for(const _0x2cd66b of _0x3f65c9){if(!existsSync(_0x2cd66b))continue;for(const _0x27f7a4 of readdirSync(_0x2cd66b,{'withFileTypes':!![]})){if(!_0x27f7a4['isSymbolicLink']())continue;const _0x330c11=resolve(_0x2cd66b,_0x27f7a4[_0x29da5d(0x1b9)]);if(realOrResolved(resolveSymlinkTarget(_0x330c11))===_0x59eebb)return!![];}}return![];}function runtimeSkillLinkName(_0x3d16dd,_0x5dbc7b){const _0xbd8a2=a139_0x4ef4ee,_0x3e31ea=safePathSegment(_0x5dbc7b,_0xbd8a2(0x1d5));if(_0x3d16dd[_0xbd8a2(0x1e4)]===_0xbd8a2(0x1ca)&&RESERVED_PROJECT_SKILL_CODES[_0xbd8a2(0x1cd)](_0x3e31ea))throw CliErrors[_0xbd8a2(0x1ad)](_0xbd8a2(0x1e1)+_0x3e31ea);return _0x3d16dd['scope']===_0xbd8a2(0x1ca)?_0x3e31ea:_0x3d16dd[_0xbd8a2(0x1b6)]+'--'+_0x3e31ea;}function runtimeSkillCodeFromLink(_0x507a4b,_0x3bc3a8){const _0xcdc251=a139_0x4ef4ee,_0x2bebda=basename(_0x3bc3a8);return _0x507a4b[_0xcdc251(0x1e4)]===_0xcdc251(0x1ca)?_0x2bebda:_0x2bebda[_0xcdc251(0x1c9)]((_0x507a4b['appCode']+'--')[_0xcdc251(0x1bb)]);}export function copyManagedSkillDirectory(_0x1012e4,_0x19e0eb){const _0x50da5e=a139_0x4ef4ee,_0x408c11=resolve(_0x19e0eb,METADATA_FILE),_0x4f836e=existsSync(_0x19e0eb);if(_0x4f836e){const _0x180a83=lstatSync(_0x19e0eb);if(_0x180a83[_0x50da5e(0x1be)]())throw CliErrors[_0x50da5e(0x1ad)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x19e0eb);if(!_0x180a83[_0x50da5e(0x1e2)]())throw CliErrors[_0x50da5e(0x1ad)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x19e0eb);const _0x1eb76c=readMetadataIfPresent(_0x408c11);if(_0x1eb76c?.[_0x50da5e(0x1e4)]!==_0x50da5e(0x1da))throw CliErrors[_0x50da5e(0x1ad)](_0x50da5e(0x1de)+_0x19e0eb);}ensureDirSync(dirname(_0x19e0eb));const _0x3ff873=_0x4f836e?readMetadataIfPresent(_0x408c11)?.[_0x50da5e(0x1c3)]:undefined,_0x45edee=readMetadataIfPresent(resolve(_0x1012e4,METADATA_FILE))?.['contentHash'];return _0x4f836e&&removeSync(_0x19e0eb),copySkillDirectory(_0x1012e4,_0x19e0eb),{'path':_0x19e0eb,'target':_0x1012e4,'action':!_0x4f836e?_0x50da5e(0x1cf):_0x3ff873===_0x45edee?'unchanged':_0x50da5e(0x1b8)};}function copySkillDirectory(_0x1f558f,_0x33767c){copySync(_0x1f558f,_0x33767c,{'dereference':![],'overwrite':!![],'filter'(_0x2094a6){const _0x3fcce7=a139_0x1a26;if(lstatSync(_0x2094a6)['isSymbolicLink']())throw CliErrors[_0x3fcce7(0x1ad)](_0x3fcce7(0x1b7)+_0x2094a6);return!![];}});}
|
|
1
|
+
function a140_0x5773(){const _0x4ab839=['13089310FxouNs','activeSkillCodes','isDirectory','managedRoot','metadata-mismatch','push','trim','141142AyqDrq','name','pruneSkillCodes','metadataPath','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','not-managed-symlink','11aBtOrP','secret-retriever','skillCode','linked-from-protected-root','skill','filter','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','146464ZgoNib','appCode','builtin','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','set','10GCtULx','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','created','length','117yHKSLP','6262417IBrprG','company','skipped','scope','validation','dir','get','map','458274VbcyWP','removed','418852iTHYrK','skillRoots','12vnnAaq','isSymbolicLink','contentHash','personal','has','project','values','821829Kwwgnn','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','slice','unchanged','external-symlink'];a140_0x5773=function(){return _0x4ab839;};return a140_0x5773();}const a140_0x11cc3a=a140_0x189a;(function(_0x1bc98c,_0x21ba2){const _0x415940=a140_0x189a,_0x1606ee=_0x1bc98c();while(!![]){try{const _0x443bc4=parseInt(_0x415940(0x185))/0x1*(parseInt(_0x415940(0x1a9))/0x2)+-parseInt(_0x415940(0x1b0))/0x3+-parseInt(_0x415940(0x1a7))/0x4+parseInt(_0x415940(0x198))/0x5*(-parseInt(_0x415940(0x1a5))/0x6)+-parseInt(_0x415940(0x19d))/0x7+parseInt(_0x415940(0x193))/0x8*(-parseInt(_0x415940(0x19c))/0x9)+parseInt(_0x415940(0x17e))/0xa*(parseInt(_0x415940(0x18c))/0xb);if(_0x443bc4===_0x21ba2)break;else _0x1606ee['push'](_0x1606ee['shift']());}catch(_0x52b15b){_0x1606ee['push'](_0x1606ee['shift']());}}}(a140_0x5773,0x780d6));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a140_0x52866b from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a140_0x52866b,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet','runtime-observe',a140_0x11cc3a(0x18d)]);export function linkEffectiveRuntimeSkills(_0x58bc19,_0x50e926){const _0xa7f383=a140_0x11cc3a,_0x5dbf9d=new Map();for(const _0x34f3ef of _0x58bc19){const _0x3bc625=_0x34f3ef[_0xa7f383(0x190)]['skillCode'];if(!_0x3bc625)continue;const _0x130fa8=_0x5dbf9d[_0xa7f383(0x1a3)](_0x3bc625);(!_0x130fa8||_0x34f3ef['scope']===_0xa7f383(0x1ac))&&_0x5dbf9d[_0xa7f383(0x197)](_0x3bc625,_0x34f3ef);}const _0x814ba0=[];for(const _0x5a0562 of _0x5dbf9d[_0xa7f383(0x1af)]()){const _0x4b3fc0=requireSkillCode(_0x5a0562[_0xa7f383(0x190)]),_0x31752d=readMetadataIfPresent(_0x5a0562['metadataPath']);if(_0x31752d?.['appCode']!==_0x50e926[_0xa7f383(0x194)]||_0x31752d[_0xa7f383(0x18e)]!==_0x4b3fc0)throw CliErrors[_0xa7f383(0x1a1)](_0xa7f383(0x199)+_0x50e926[_0xa7f383(0x194)]+':\x20'+_0x5a0562[_0xa7f383(0x188)]);const _0x4dc293=runtimeSkillLinkName(_0x50e926,_0x4b3fc0);for(const _0x372213 of _0x50e926[_0xa7f383(0x1a8)]){_0x814ba0[_0xa7f383(0x183)](ensureManagedSymlink(resolve(_0x372213,_0x4dc293),_0x5a0562[_0xa7f383(0x1a2)],_0x50e926,_0x4b3fc0));}}return _0x814ba0;}export function pruneStaleRuntimeSkillLinks(_0x11ab9c,_0x5deba4,_0x2fcdc5){const _0x59672b=a140_0x11cc3a,_0x55c14b=new Set([..._0x5deba4]['map'](_0x19d31f=>_0x19d31f[_0x59672b(0x184)]())['filter'](Boolean)),_0x1c7939=_0x2fcdc5?new Set([..._0x2fcdc5][_0x59672b(0x1a4)](_0x20dd42=>_0x20dd42['trim']())[_0x59672b(0x191)](Boolean)):undefined,_0x1bb2aa=[];for(const _0x51a8a5 of _0x11ab9c[_0x59672b(0x1a8)]){for(const _0x257b8d of managedTargetSkillLinkPaths(_0x51a8a5,_0x11ab9c)){const _0x5aba72=runtimeSkillCodeFromLink(_0x11ab9c,_0x257b8d);if(_0x1c7939&&!_0x1c7939[_0x59672b(0x1ad)](_0x5aba72))continue;if(_0x55c14b['has'](_0x5aba72))continue;_0x1bb2aa[_0x59672b(0x183)](removeManagedSkillLink(_0x257b8d,_0x11ab9c,_0x5aba72));}}return _0x1bb2aa;}export function pruneStaleRuntimeSkillCache(_0x4c02d1,_0x1104ee={}){const _0x228f9d=a140_0x11cc3a,_0x4e3741=new Set([..._0x4c02d1[_0x228f9d(0x17f)]][_0x228f9d(0x1a4)](_0x661d7c=>_0x661d7c[_0x228f9d(0x184)]())[_0x228f9d(0x191)](Boolean)),_0x3a648a=_0x4c02d1[_0x228f9d(0x187)]?new Set([..._0x4c02d1[_0x228f9d(0x187)]][_0x228f9d(0x1a4)](_0x35d086=>_0x35d086[_0x228f9d(0x184)]())[_0x228f9d(0x191)](Boolean)):undefined,_0x535947=_0x4c02d1['scopes']??[_0x228f9d(0x1ac),_0x228f9d(0x19e)],_0x4ea3b1=resolve(getRuntimeSkillCacheRoot(_0x4c02d1['env'],_0x4c02d1['accessKey'],_0x1104ee),safePathSegment(_0x4c02d1[_0x228f9d(0x194)],_0x228f9d(0x194))),_0xdd7cce=[];for(const _0x1a27b6 of _0x535947){const _0x5aefd2=resolve(_0x4ea3b1,_0x1a27b6);if(!existsSync(_0x5aefd2))continue;for(const _0x1609d of readdirSync(_0x5aefd2,{'withFileTypes':!![]})){if(!_0x1609d[_0x228f9d(0x180)]())continue;const _0x4141f6=_0x1609d['name'];if(_0x3a648a&&!_0x3a648a[_0x228f9d(0x1ad)](_0x4141f6))continue;if(_0x4e3741['has'](_0x4141f6))continue;const _0x21d84e=resolve(_0x5aefd2,_0x4141f6),_0x478f51=readMetadataIfPresent(resolve(_0x21d84e,METADATA_FILE));if(_0x478f51?.[_0x228f9d(0x194)]!==_0x4c02d1[_0x228f9d(0x194)]||_0x478f51['scope']!==_0x1a27b6||_0x478f51[_0x228f9d(0x18e)]!==_0x4141f6){_0xdd7cce[_0x228f9d(0x183)]({'path':_0x21d84e,'action':_0x228f9d(0x19f),'reason':_0x228f9d(0x182)});continue;}if(isLinkedFromAnyRoot(_0x21d84e,_0x4c02d1['protectedLinkRoots']??[])){_0xdd7cce[_0x228f9d(0x183)]({'path':_0x21d84e,'action':_0x228f9d(0x19f),'reason':_0x228f9d(0x18f)});continue;}removeSync(_0x21d84e),_0xdd7cce[_0x228f9d(0x183)]({'path':_0x21d84e,'action':_0x228f9d(0x1a6)});}}return _0xdd7cce;}export function linkGlobalRuntimeSkills(_0x15c3e5,_0x5e0404={}){const _0x42c0d4=a140_0x11cc3a,_0x2d4b90=resolveSkillSyncPaths(_0x5e0404),_0x17a050=[];for(const _0x26abcb of _0x15c3e5){if(_0x26abcb[_0x42c0d4(0x1a0)]!=='builtin')throw CliErrors['validation']('Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20'+_0x26abcb[_0x42c0d4(0x1a0)]);const _0x260c35=requireSkillCode(_0x26abcb[_0x42c0d4(0x190)]),_0x495992=copyManagedSkillDirectory(_0x26abcb[_0x42c0d4(0x1a2)],resolve(_0x2d4b90['agentsSkillsDir'],_0x260c35));_0x17a050['push']({..._0x495992,'contentHash':_0x26abcb[_0x42c0d4(0x1ab)]});}return _0x17a050;}function a140_0x189a(_0x1d5bea,_0x3eb30e){_0x1d5bea=_0x1d5bea-0x17e;const _0x577305=a140_0x5773();let _0x189a2f=_0x577305[_0x1d5bea];return _0x189a2f;}function ensureManagedSymlink(_0x4890c1,_0x2c0d2d,_0xa895aa,_0x2763f1){const _0xbb4f22=a140_0x11cc3a;mkdirSync(dirname(_0x4890c1),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x4890c1)||isDanglingSymlink(_0x4890c1)){const _0x3428a0=lstatSync(_0x4890c1);if(!_0x3428a0[_0xbb4f22(0x1aa)]())throw CliErrors[_0xbb4f22(0x1a1)](_0xbb4f22(0x18a)+_0x4890c1);const _0x2fddf7=resolveSymlinkTarget(_0x4890c1);if(!isPathInside(realOrResolved(_0x2fddf7),realOrResolved(_0xa895aa[_0xbb4f22(0x181)])))throw CliErrors['validation'](_0xbb4f22(0x189)+_0x4890c1);if(realOrResolved(_0x2fddf7)===realOrResolved(_0x2c0d2d))return{'path':_0x4890c1,'target':_0x2c0d2d,'action':_0xbb4f22(0x1b3)};const _0xbe0e57=readMetadataIfPresent(resolve(_0x2fddf7,METADATA_FILE));if(_0xa895aa['scope']==='project'&&(_0xbe0e57?.[_0xbb4f22(0x194)]!==_0xa895aa[_0xbb4f22(0x194)]||_0xbe0e57[_0xbb4f22(0x18e)]!==_0x2763f1))throw CliErrors[_0xbb4f22(0x1a1)](_0xbb4f22(0x196)+_0x4890c1);return unlinkSync(_0x4890c1),symlinkSync(_0x2c0d2d,_0x4890c1,_0xbb4f22(0x1a2)),{'path':_0x4890c1,'target':_0x2c0d2d,'action':'updated'};}return symlinkSync(_0x2c0d2d,_0x4890c1,_0xbb4f22(0x1a2)),{'path':_0x4890c1,'target':_0x2c0d2d,'action':_0xbb4f22(0x19a)};}function managedTargetSkillLinkPaths(_0x3de35c,_0x3aa971){const _0x277835=a140_0x11cc3a;if(!existsSync(_0x3de35c))return[];const _0x141165=_0x3aa971['appCode']+'--';return readdirSync(_0x3de35c,{'withFileTypes':!![]})[_0x277835(0x191)](_0x2a5aff=>_0x3aa971[_0x277835(0x1a0)]===_0x277835(0x1ae)||_0x2a5aff[_0x277835(0x186)]['startsWith'](_0x141165))[_0x277835(0x1a4)](_0x4a7c88=>resolve(_0x3de35c,_0x4a7c88['name']));}function removeManagedSkillLink(_0x4b3767,_0x17b56a,_0x51a57b){const _0x55b56d=a140_0x11cc3a,_0x24496c=lstatIfPresent(_0x4b3767);if(!_0x24496c?.[_0x55b56d(0x1aa)]())return{'path':_0x4b3767,'action':_0x55b56d(0x19f),'reason':_0x55b56d(0x18b)};const _0x4fbb49=resolveSymlinkTarget(_0x4b3767);if(!isPathInside(realOrResolved(_0x4fbb49),realOrResolved(_0x17b56a[_0x55b56d(0x181)])))return{'path':_0x4b3767,'action':_0x55b56d(0x19f),'reason':_0x55b56d(0x1b4)};const _0x2ed007=readMetadataIfPresent(resolve(_0x4fbb49,METADATA_FILE));if(_0x17b56a[_0x55b56d(0x1a0)]===_0x55b56d(0x1ae)&&(_0x2ed007?.[_0x55b56d(0x194)]!==_0x17b56a[_0x55b56d(0x194)]||_0x2ed007[_0x55b56d(0x18e)]!==_0x51a57b))return{'path':_0x4b3767,'action':_0x55b56d(0x19f),'reason':_0x55b56d(0x182)};return unlinkSync(_0x4b3767),{'path':_0x4b3767,'action':'removed'};}function isLinkedFromAnyRoot(_0x340f7c,_0x1e293a){const _0x20020c=a140_0x11cc3a,_0x263e87=realOrResolved(_0x340f7c);for(const _0x36c852 of _0x1e293a){if(!existsSync(_0x36c852))continue;for(const _0x412413 of readdirSync(_0x36c852,{'withFileTypes':!![]})){if(!_0x412413[_0x20020c(0x1aa)]())continue;const _0x2d0f4e=resolve(_0x36c852,_0x412413[_0x20020c(0x186)]);if(realOrResolved(resolveSymlinkTarget(_0x2d0f4e))===_0x263e87)return!![];}}return![];}function runtimeSkillLinkName(_0x5daba3,_0x34c5cd){const _0x2f64ff=a140_0x11cc3a,_0x561026=safePathSegment(_0x34c5cd,_0x2f64ff(0x18e));if(_0x5daba3[_0x2f64ff(0x1a0)]===_0x2f64ff(0x1ae)&&RESERVED_PROJECT_SKILL_CODES[_0x2f64ff(0x1ad)](_0x561026))throw CliErrors[_0x2f64ff(0x1a1)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x561026);return _0x5daba3['scope']===_0x2f64ff(0x1ae)?_0x561026:_0x5daba3[_0x2f64ff(0x194)]+'--'+_0x561026;}function runtimeSkillCodeFromLink(_0x144d77,_0x1c65d2){const _0x401f86=a140_0x11cc3a,_0x503ac2=basename(_0x1c65d2);return _0x144d77['scope']===_0x401f86(0x1ae)?_0x503ac2:_0x503ac2[_0x401f86(0x1b2)]((_0x144d77['appCode']+'--')[_0x401f86(0x19b)]);}export function copyManagedSkillDirectory(_0x4aff14,_0x27e99c){const _0x57e64c=a140_0x11cc3a,_0x59e237=resolve(_0x27e99c,METADATA_FILE),_0x2ffadc=existsSync(_0x27e99c);if(_0x2ffadc){const _0x2737fb=lstatSync(_0x27e99c);if(_0x2737fb[_0x57e64c(0x1aa)]())throw CliErrors[_0x57e64c(0x1a1)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x27e99c);if(!_0x2737fb[_0x57e64c(0x180)]())throw CliErrors[_0x57e64c(0x1a1)](_0x57e64c(0x1b1)+_0x27e99c);const _0x997749=readMetadataIfPresent(_0x59e237);if(_0x997749?.['scope']!==_0x57e64c(0x195))throw CliErrors[_0x57e64c(0x1a1)]('Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'+_0x27e99c);}ensureDirSync(dirname(_0x27e99c));const _0x56414f=_0x2ffadc?readMetadataIfPresent(_0x59e237)?.[_0x57e64c(0x1ab)]:undefined,_0x256a3e=readMetadataIfPresent(resolve(_0x4aff14,METADATA_FILE))?.['contentHash'];return _0x2ffadc&&removeSync(_0x27e99c),copySkillDirectory(_0x4aff14,_0x27e99c),{'path':_0x27e99c,'target':_0x4aff14,'action':!_0x2ffadc?_0x57e64c(0x19a):_0x56414f===_0x256a3e?_0x57e64c(0x1b3):'updated'};}function copySkillDirectory(_0xb9eef3,_0x4542e8){copySync(_0xb9eef3,_0x4542e8,{'dereference':![],'overwrite':!![],'filter'(_0xd0e4eb){const _0x52f27b=a140_0x189a;if(lstatSync(_0xd0e4eb)[_0x52f27b(0x1aa)]())throw CliErrors[_0x52f27b(0x1a1)](_0x52f27b(0x192)+_0xd0e4eb);return!![];}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x21333d,_0x5421ac){const _0x420d47=a141_0x5980,_0x51528f=_0x21333d();while(!![]){try{const _0x4e583e=parseInt(_0x420d47(0x7c))/0x1*(-parseInt(_0x420d47(0x6f))/0x2)+parseInt(_0x420d47(0x94))/0x3*(parseInt(_0x420d47(0x80))/0x4)+-parseInt(_0x420d47(0x87))/0x5*(parseInt(_0x420d47(0x92))/0x6)+parseInt(_0x420d47(0x90))/0x7*(parseInt(_0x420d47(0x7b))/0x8)+-parseInt(_0x420d47(0x8a))/0x9*(parseInt(_0x420d47(0x91))/0xa)+-parseInt(_0x420d47(0x6d))/0xb+parseInt(_0x420d47(0x79))/0xc;if(_0x4e583e===_0x5421ac)break;else _0x51528f['push'](_0x51528f['shift']());}catch(_0x39db0c){_0x51528f['push'](_0x51528f['shift']());}}}(a141_0x3332,0x7fa75));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';function a141_0x5980(_0x1ee451,_0x200fec){_0x1ee451=_0x1ee451-0x6a;const _0x33325a=a141_0x3332();let _0x598044=_0x33325a[_0x1ee451];return _0x598044;}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x347aa5,_0x198cfa,_0x38f9f4={}){const _0x1fdf4e=a141_0x5980,_0xfdceea=safePathSegment(_0x347aa5[_0x1fdf4e(0x9b)],_0x1fdf4e(0x9b));if(_0x198cfa['appCode']!==_0xfdceea)throw CliErrors[_0x1fdf4e(0x84)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x198cfa[_0x1fdf4e(0x9b)]+_0x1fdf4e(0x7f)+_0xfdceea);const _0x57bafe=normalizeRuntimeSkillScopes(_0x347aa5[_0x1fdf4e(0x93)]),_0x21bde1=new Set(_0x57bafe),_0x339889=_0x347aa5[_0x1fdf4e(0x78)]?.[_0x1fdf4e(0x7e)](),_0x1870f8=new Map(),_0xa64d7f=resolve(getRuntimeSkillCacheRoot(_0x347aa5[_0x1fdf4e(0x72)],_0x347aa5[_0x1fdf4e(0x6c)],_0x38f9f4),_0xfdceea);for(const _0x5d1771 of _0x57bafe){for(const _0x4266df of localSkillEntryDirs(resolve(_0xa64d7f,_0x5d1771))){collectLocalRuntimeSkill(_0x1870f8,_0x4266df,{'appCode':_0xfdceea,'scopes':_0x21bde1,'code':_0x339889,'source':'cache'});}}for(const _0x45e592 of _0x198cfa[_0x1fdf4e(0x73)]){for(const _0x3e4c9e of localSkillLinkCandidates(_0x45e592,_0x198cfa,_0x21bde1)){collectLocalRuntimeSkill(_0x1870f8,_0x3e4c9e,{'appCode':_0xfdceea,'scopes':_0x21bde1,'code':_0x339889,'source':_0x1fdf4e(0x99),'linkedPath':_0x3e4c9e});}}return Array[_0x1fdf4e(0x7a)](_0x1870f8[_0x1fdf4e(0x85)]())[_0x1fdf4e(0x8f)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x5a5d9b){const _0x19eb01=a141_0x5980;if(!existsSync(_0x5a5d9b))return[];return readdirSync(_0x5a5d9b,{'withFileTypes':!![]})[_0x19eb01(0x8e)](_0x28707d=>_0x28707d['isDirectory']()||_0x28707d['isSymbolicLink']())['map'](_0x1df047=>resolve(_0x5a5d9b,_0x1df047[_0x19eb01(0x70)]));}function localSkillLinkCandidates(_0x10f12f,_0x447fb7,_0x452d52){const _0x1f2505=a141_0x5980;if(!existsSync(_0x10f12f))return[];const _0x55ded3=_0x447fb7[_0x1f2505(0x9b)]+'--';return readdirSync(_0x10f12f,{'withFileTypes':!![]})['filter'](_0x522257=>_0x522257[_0x1f2505(0x89)]()||_0x522257[_0x1f2505(0x77)]())[_0x1f2505(0x8e)](_0x1b0ab9=>_0x447fb7[_0x1f2505(0x86)]==='project'||_0x1b0ab9[_0x1f2505(0x70)][_0x1f2505(0x8d)](_0x55ded3)||_0x452d52[_0x1f2505(0x9a)](_0x1f2505(0x7d)))[_0x1f2505(0x6b)](_0x2ad762=>resolve(_0x10f12f,_0x2ad762[_0x1f2505(0x70)]));}function a141_0x3332(){const _0x5b2d72=['21951252yImUNW','from','8rznKFZ','384743RgMQwx','builtin','trim','\x20!=\x20','72824saEEHh','skillCode','metadataPath','local','validation','values','scope','4261030ORppiY','linkedPath','isDirectory','27WGDhxU','tags','linkedPaths','startsWith','filter','sort','5540815VVbMif','595970oVkNZI','6tUBlIW','scopes','33AxoSie','cacheDir','set','source','localeCompare','link','has','appCode','includes','map','accessKey','9707203snOUaY','skillMdPath','2BxHIrt','name','dir','env','skillRoots','cache','push','get','isSymbolicLink','code'];a141_0x3332=function(){return _0x5b2d72;};return a141_0x3332();}function collectLocalRuntimeSkill(_0xeab89,_0x3485da,_0x44b5f1){const _0x180594=a141_0x5980,_0x31681f=resolve(_0x3485da,METADATA_FILE),_0x3aefef=readMetadataIfPresent(_0x31681f);if(!_0x3aefef)return;if(_0x3aefef[_0x180594(0x9b)]!==_0x44b5f1[_0x180594(0x9b)])return;if(!isRuntimeSkillScope(_0x3aefef[_0x180594(0x86)])||!_0x44b5f1[_0x180594(0x93)][_0x180594(0x9a)](_0x3aefef[_0x180594(0x86)]))return;const _0x2c7f74=_0x3aefef['skillCode']?.[_0x180594(0x7e)]();if(!_0x2c7f74)return;if(_0x44b5f1[_0x180594(0x78)]&&_0x2c7f74!==_0x44b5f1['code'])return;const _0x6cad2e=_0x3aefef[_0x180594(0x86)]+':'+_0x2c7f74,_0x46c7bf=_0x44b5f1[_0x180594(0x88)]?[_0x44b5f1[_0x180594(0x88)]]:[],_0x201724=_0xeab89[_0x180594(0x76)](_0x6cad2e);if(_0x201724){_0x44b5f1[_0x180594(0x97)]==='cache'&&(_0x201724[_0x180594(0x71)]=_0x3485da,_0x201724[_0x180594(0x95)]=_0x3485da,_0x201724[_0x180594(0x6e)]=resolve(_0x3485da,SKILL_FILE),_0x201724[_0x180594(0x82)]=_0x31681f);for(const _0x4c61c0 of _0x46c7bf){!_0x201724[_0x180594(0x8c)][_0x180594(0x6a)](_0x4c61c0)&&_0x201724[_0x180594(0x8c)][_0x180594(0x75)](_0x4c61c0);}_0x201724[_0x180594(0x8c)][_0x180594(0x8f)]();return;}_0xeab89[_0x180594(0x96)](_0x6cad2e,{..._0x3aefef,'tags':Array['isArray'](_0x3aefef[_0x180594(0x8b)])?_0x3aefef[_0x180594(0x8b)]:[],'scope':_0x3aefef['scope'],'source':_0x180594(0x83),'dir':_0x3485da,'cacheDir':_0x44b5f1[_0x180594(0x97)]===_0x180594(0x74)?_0x3485da:undefined,'skillMdPath':resolve(_0x3485da,SKILL_FILE),'metadataPath':_0x31681f,'linkedPaths':_0x46c7bf});}function compareLocalRuntimeSkills(_0x3ba0bc,_0x51a720){const _0x1b929b=a141_0x5980,_0xe41f08={'personal':0x0,'company':0x1,'builtin':0x2};return _0xe41f08[_0x3ba0bc['scope']]-_0xe41f08[_0x51a720['scope']]||_0x3ba0bc[_0x1b929b(0x81)][_0x1b929b(0x98)](_0x51a720[_0x1b929b(0x81)])||_0x3ba0bc[_0x1b929b(0x71)][_0x1b929b(0x98)](_0x51a720[_0x1b929b(0x71)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5c3268,_0x2d251f){const _0x4c655b=a142_0x4f27,_0x3f9e7d=_0x5c3268();while(!![]){try{const _0x2de99d=parseInt(_0x4c655b(0xe7))/0x1+-parseInt(_0x4c655b(0x106))/0x2+parseInt(_0x4c655b(0xeb))/0x3+-parseInt(_0x4c655b(0x103))/0x4*(parseInt(_0x4c655b(0x101))/0x5)+parseInt(_0x4c655b(0xde))/0x6+parseInt(_0x4c655b(0xdd))/0x7*(parseInt(_0x4c655b(0xdf))/0x8)+parseInt(_0x4c655b(0xf8))/0x9;if(_0x2de99d===_0x2d251f)break;else _0x3f9e7d['push'](_0x3f9e7d['shift']());}catch(_0x3a0388){_0x3f9e7d['push'](_0x3f9e7d['shift']());}}}(a142_0x3f4f,0x5894b));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(_0x1530b3){const _0x595276=a142_0x4f27;return _0x1530b3['bytes']??Buffer['from'](_0x1530b3[_0x595276(0xed)]??'','utf8');}export function fileText(_0x1321c0){const _0x303019=a142_0x4f27;return fileContent(_0x1321c0)['toString'](_0x303019(0x10c));}export function normalizeLocalFiles(_0x41f5c5){const _0x25f9e6=a142_0x4f27;if(!Array[_0x25f9e6(0xec)](_0x41f5c5)||_0x41f5c5[_0x25f9e6(0x107)]===0x0)return[];const _0x442b26=new Map();for(const _0x299dba of _0x41f5c5){if(!_0x299dba||typeof _0x299dba!=='object'||typeof _0x299dba['path']!=='string')throw CliErrors[_0x25f9e6(0x104)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0xe5f872=normalizeSkillRelativePath(_0x299dba[_0x25f9e6(0xe0)]);if(_0x442b26[_0x25f9e6(0x102)](_0xe5f872))throw CliErrors[_0x25f9e6(0x104)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0xe5f872);if(_0x299dba[_0x25f9e6(0xfa)]!==undefined&&!Buffer[_0x25f9e6(0x10b)](_0x299dba['bytes']))throw CliErrors[_0x25f9e6(0x104)](_0x25f9e6(0xe4)+_0xe5f872);if(_0x299dba[_0x25f9e6(0xfa)]===undefined&&typeof _0x299dba['content']!==_0x25f9e6(0xf6))throw CliErrors[_0x25f9e6(0x104)](_0x25f9e6(0xe9)+_0xe5f872);const _0x1f6c9e=fileContent(_0x299dba);_0x442b26[_0x25f9e6(0xe3)](_0xe5f872,{'path':_0xe5f872,'bytes':_0x1f6c9e});}return Array[_0x25f9e6(0xf9)](_0x442b26[_0x25f9e6(0xf4)]())[_0x25f9e6(0xfc)](compareSkillFiles);}export function normalizeManifestFiles(_0x532ca7){const _0x43b259=a142_0x4f27;if(!Array['isArray'](_0x532ca7)||_0x532ca7[_0x43b259(0x107)]===0x0)return[];const _0x173fe0=new Map();for(const _0x19272a of _0x532ca7){if(!_0x19272a||typeof _0x19272a!=='object'||typeof _0x19272a['path']!==_0x43b259(0xf6))throw CliErrors[_0x43b259(0x104)](_0x43b259(0xff));const _0x353a3d=normalizeSkillRelativePath(_0x19272a['path']);if(_0x173fe0[_0x43b259(0x102)](_0x353a3d))throw CliErrors[_0x43b259(0x104)](_0x43b259(0xe6)+_0x353a3d);if(!isSha256Hex(_0x19272a[_0x43b259(0x105)]))throw CliErrors[_0x43b259(0x104)](_0x43b259(0xea)+_0x353a3d);if(!Number['isSafeInteger'](_0x19272a[_0x43b259(0xe2)])||_0x19272a[_0x43b259(0xe2)]<0x0)throw CliErrors['validation']('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x353a3d);_0x173fe0[_0x43b259(0xe3)](_0x353a3d,{'path':_0x353a3d,'sha256':_0x19272a['sha256'][_0x43b259(0x108)](),'size':_0x19272a[_0x43b259(0xe2)]});}return Array[_0x43b259(0xf9)](_0x173fe0['values']())[_0x43b259(0xfc)](compareSkillFiles);}function a142_0x3f4f(){const _0x32481d=['1833222fyLnnZ','16QOvEGY','path','push','size','set','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','replace','Duplicate\x20Skill\x20file\x20path:\x20','318299bqJjEt','split','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','Skill\x20file\x20sha256\x20is\x20invalid:\x20','846468VDQkcr','isArray','content','isFile','excludedFilePaths','Unsafe\x20Skill\x20file\x20path:\x20','isDirectory','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','isSymbolicLink','values','localeCompare','string','compare','3486231YhBtnC','from','bytes','add','sort','startsWith','trim','Skill\x20file\x20path\x20must\x20be\x20text.','includes','5khuVjT','has','1720000DLpBlx','validation','sha256','1397760DLnSdt','length','toLowerCase','name','test','isBuffer','utf8','694246ChwtLA'];a142_0x3f4f=function(){return _0x32481d;};return a142_0x3f4f();}export function scanSkillDirectory(_0x206236,_0x472812={}){const _0x5a6c84=a142_0x4f27,_0x319789=realpathSync(_0x206236),_0x3bbdeb=canonicalExcludedFilePaths(_0x472812[_0x5a6c84(0xef)]),_0x2d081=[];function _0x523304(_0x5f5118){const _0x3db192=_0x5a6c84,_0x1fd44a=readdirSync(_0x5f5118,{'withFileTypes':!![]})[_0x3db192(0xfc)]((_0x18a059,_0x2b0b20)=>_0x18a059[_0x3db192(0x109)][_0x3db192(0xf5)](_0x2b0b20[_0x3db192(0x109)]));for(const _0x399806 of _0x1fd44a){if(_0x399806[_0x3db192(0xf1)]()&&IGNORED_DIR_NAMES[_0x3db192(0x102)](_0x399806[_0x3db192(0x109)]))continue;if(IGNORED_FILE_NAMES[_0x3db192(0x102)](_0x399806[_0x3db192(0x109)]))continue;const _0x48424b=resolve(_0x5f5118,_0x399806[_0x3db192(0x109)]);if(isExcludedFilePath(_0x48424b,_0x3bbdeb))continue;if(_0x399806[_0x3db192(0xf3)]())throw CliErrors[_0x3db192(0x104)](_0x3db192(0xf2)+_0x48424b);const _0x1d8792=toPosixPath(relative(_0x319789,_0x48424b));if(_0x399806['isDirectory']()){_0x523304(_0x48424b);continue;}if(!_0x399806[_0x3db192(0xee)]())continue;validateSkillRelativePath(_0x1d8792);const _0x381add=readFileSync(_0x48424b);_0x2d081[_0x3db192(0xe1)]({'path':_0x1d8792,'bytes':_0x381add});}}return _0x523304(_0x319789),normalizeLocalFiles(_0x2d081);}function a142_0x4f27(_0x443a6b,_0x1553b0){_0x443a6b=_0x443a6b-0xdd;const _0x3f4ff2=a142_0x3f4f();let _0x4f27b9=_0x3f4ff2[_0x443a6b];return _0x4f27b9;}function canonicalExcludedFilePaths(_0x1b6e82){const _0x46ee27=a142_0x4f27,_0x46a1ec=new Set();for(const _0x22301f of _0x1b6e82??[]){const _0x50ac16=resolve(_0x22301f);_0x46a1ec[_0x46ee27(0xfb)](_0x50ac16);try{_0x46a1ec['add'](realpathSync(_0x50ac16));}catch{}}return _0x46a1ec;}function isExcludedFilePath(_0x7d6669,_0x1c3493){const _0x35508f=a142_0x4f27;if(_0x1c3493[_0x35508f(0x102)](_0x7d6669))return!![];if(_0x1c3493[_0x35508f(0xe2)]===0x0)return![];try{return _0x1c3493[_0x35508f(0x102)](realpathSync(_0x7d6669));}catch{return![];}}export function compareSkillFiles(_0x11b9fb,_0x501ed1){const _0x458208=a142_0x4f27;if(_0x11b9fb[_0x458208(0xe0)]===SKILL_FILE)return _0x501ed1[_0x458208(0xe0)]===SKILL_FILE?0x0:-0x1;if(_0x501ed1[_0x458208(0xe0)]===SKILL_FILE)return 0x1;return Buffer[_0x458208(0xf7)](Buffer['from'](_0x11b9fb['path'],_0x458208(0x10c)),Buffer[_0x458208(0xf9)](_0x501ed1[_0x458208(0xe0)],_0x458208(0x10c)));}export function normalizeSkillRelativePath(_0x44d55a){const _0x4260ff=a142_0x4f27,_0x46b156=toPosixPath(_0x44d55a[_0x4260ff(0xfe)]());return validateSkillRelativePath(_0x46b156),_0x46b156;}export function validateSkillRelativePath(_0x3f265a){const _0x73eea9=a142_0x4f27;if(!_0x3f265a||_0x3f265a[_0x73eea9(0xfd)]('/')||_0x3f265a[_0x73eea9(0x100)]('//'))throw CliErrors[_0x73eea9(0x104)](_0x73eea9(0xf0)+_0x3f265a);for(const _0x1d2e4b of _0x3f265a[_0x73eea9(0xe8)]('/')){if(!_0x1d2e4b||_0x1d2e4b==='.'||_0x1d2e4b==='..')throw CliErrors['validation'](_0x73eea9(0xf0)+_0x3f265a);}}export function toPosixPath(_0xdcd6ff){const _0x2a0ea2=a142_0x4f27;return _0xdcd6ff[_0x2a0ea2(0xe5)](/\\/g,'/');}export function isSha256Hex(_0x42c1f1){const _0x2d88b2=a142_0x4f27;return typeof _0x42c1f1===_0x2d88b2(0xf6)&&/^[a-fA-F0-9]{64}$/[_0x2d88b2(0x10a)](_0x42c1f1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x51a438,_0x3cad60){const _0x590690=a142_0x27d9,_0x25f6f5=_0x51a438();while(!![]){try{const _0x36e955=parseInt(_0x590690(0x106))/0x1*(-parseInt(_0x590690(0xda))/0x2)+parseInt(_0x590690(0x113))/0x3*(parseInt(_0x590690(0x10d))/0x4)+parseInt(_0x590690(0x108))/0x5+parseInt(_0x590690(0xe3))/0x6+parseInt(_0x590690(0x115))/0x7*(parseInt(_0x590690(0xf4))/0x8)+-parseInt(_0x590690(0xe5))/0x9*(-parseInt(_0x590690(0xe0))/0xa)+parseInt(_0x590690(0xe2))/0xb*(-parseInt(_0x590690(0xfe))/0xc);if(_0x36e955===_0x3cad60)break;else _0x25f6f5['push'](_0x25f6f5['shift']());}catch(_0x4739f0){_0x25f6f5['push'](_0x25f6f5['shift']());}}}(a142_0x40ad,0x9b5c3));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';function a142_0x27d9(_0x2cb164,_0x387c3f){_0x2cb164=_0x2cb164-0xda;const _0x40ad78=a142_0x40ad();let _0x27d9d5=_0x40ad78[_0x2cb164];return _0x27d9d5;}export function materializeRuntimeSkill(_0x398f40,_0x21bdda,_0x2b6a8a){const _0x22f2f4=a142_0x27d9,_0x291deb=requireSkillCode(_0x398f40),_0xbf76e=requirePackageBytes(_0x291deb,_0x2b6a8a['packageBytes']),_0x2f1b03=extractDownloadedPackage(_0xbf76e),_0x57a6ef=_0x2f1b03[_0x22f2f4(0x10c)](_0x2586ba=>_0x2586ba[_0x22f2f4(0x104)]===SKILL_FILE);if(!_0x57a6ef)throw CliErrors[_0x22f2f4(0xdd)](_0x22f2f4(0xfd)+SKILL_FILE+':\x20'+_0x291deb);const _0xd7e59d=withMaterializedSkillFrontmatter(_0x2f1b03,_0x398f40,_0x291deb),_0x3635ad=_0xd7e59d[_0x22f2f4(0x10c)](_0x2ffb16=>_0x2ffb16[_0x22f2f4(0x104)]===SKILL_FILE),_0xa7f1b0=fileText(_0x3635ad),_0x507e0d=getRuntimeSkillDir(_0x2b6a8a[_0x22f2f4(0xf6)],_0x2b6a8a[_0x22f2f4(0xe4)],_0x2b6a8a[_0x22f2f4(0xf2)],_0x21bdda,_0x291deb,_0x2b6a8a[_0x22f2f4(0xf0)]),_0x4e336f=resolve(_0x507e0d,SKILL_FILE),_0x3e2857=resolve(_0x507e0d,METADATA_FILE),_0xb76cb4=contentHash(_0xa7f1b0),_0x3481c9=readMetadataIfPresent(_0x3e2857)?.[_0x22f2f4(0xf3)];ensurePulledFilesCanBeOverwritten(_0x507e0d,_0x3e2857,_0xd7e59d,_0x2b6a8a[_0x22f2f4(0xdf)]===!![]),mkdirSync(_0x507e0d,{'recursive':!![],'mode':0x1c0});const _0x177139=existsSync(_0x4e336f)?readFileSync(_0x4e336f,'utf8'):undefined;return materializeFiles(_0x507e0d,_0xd7e59d),removeStaleManagedFiles(_0x507e0d,_0x3481c9,_0xd7e59d),writeJsonAtomic(_0x3e2857,buildMetadata(_0x398f40,_0x21bdda,_0x2b6a8a[_0x22f2f4(0xf2)],_0xb76cb4,_0x2b6a8a[_0x22f2f4(0x114)],_0xd7e59d,_0xbf76e)),{'skill':_0x398f40,'scope':_0x21bdda,'dir':_0x507e0d,'skillMdPath':_0x4e336f,'metadataPath':_0x3e2857,'contentHash':_0xb76cb4,'changed':_0x177139!==_0xa7f1b0};}export function reuseMaterializedRuntimeSkill(_0x21cc0c,_0x19574b,_0x4b6ab3){const _0x50500b=a142_0x27d9,_0x5ea8cc=_0x21cc0c[_0x50500b(0xfa)]?.[_0x50500b(0x105)]();if(!_0x5ea8cc)return undefined;const _0x1bfdb4=requireSkillCode(_0x21cc0c),_0x156d4a=getRuntimeSkillDir(_0x4b6ab3['env'],_0x4b6ab3['accessKey'],_0x4b6ab3[_0x50500b(0xf2)],_0x19574b,_0x1bfdb4,_0x4b6ab3[_0x50500b(0xf0)]),_0x2de8a9=resolve(_0x156d4a,SKILL_FILE),_0x560424=resolve(_0x156d4a,METADATA_FILE),_0x1c39e3=readMetadataIfPresent(_0x560424);if(!_0x1c39e3||_0x1c39e3[_0x50500b(0xeb)]!==0x2||_0x1c39e3[_0x50500b(0xf2)]!==_0x4b6ab3[_0x50500b(0xf2)]||_0x1c39e3[_0x50500b(0x101)]!==_0x19574b||_0x1c39e3['skillCode']!==_0x1bfdb4||_0x1c39e3[_0x50500b(0xfa)]!==_0x5ea8cc||_0x1c39e3['id']!==_0x21cc0c['id']||_0x1c39e3[_0x50500b(0x112)]!==_0x21cc0c[_0x50500b(0x112)]||_0x1c39e3[_0x50500b(0xe7)]!==_0x21cc0c[_0x50500b(0xe7)]||_0x1c39e3[_0x50500b(0x103)]!==_0x21cc0c[_0x50500b(0x103)]||_0x1c39e3[_0x50500b(0xdb)]!==_0x21cc0c[_0x50500b(0xdb)]||!_0x1c39e3['contentHash']||!_0x1c39e3[_0x50500b(0xf3)]||!Object[_0x50500b(0xe9)](_0x1c39e3[_0x50500b(0xf3)],SKILL_FILE))return undefined;for(const [_0x3eaf94,_0x412488]of Object[_0x50500b(0xf8)](_0x1c39e3[_0x50500b(0xf3)])){if(!/^[a-f0-9]{64}$/[_0x50500b(0xea)](_0x412488))return undefined;const _0x58ac54=resolveManagedFilePath(_0x156d4a,_0x3eaf94);if(!existsSync(_0x58ac54)||!lstatSync(_0x58ac54)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x58ac54))!==_0x412488)return undefined;}return{'skill':_0x21cc0c,'scope':_0x19574b,'dir':_0x156d4a,'skillMdPath':_0x2de8a9,'metadataPath':_0x560424,'contentHash':_0x1c39e3[_0x50500b(0xfc)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4505ff,_0x206534,_0x3135e7){const _0x2ae901=a142_0x27d9,_0xd98e99=skillDisplayName(_0x206534,_0x3135e7),_0x41570f=_0x206534[_0x2ae901(0xe7)]?.[_0x2ae901(0x105)]()||_0xd98e99||_0x3135e7;return normalizeLocalFiles(_0x4505ff)[_0x2ae901(0xe6)](_0x9afd1e=>{const _0x54733b=_0x2ae901,_0x49ec89=fileText(_0x9afd1e);if(_0x9afd1e[_0x54733b(0x104)]!==SKILL_FILE)return _0x9afd1e;if(hasYamlFrontmatter(_0x49ec89))return{'path':_0x9afd1e[_0x54733b(0x104)],'content':withSyncedDisplayName(_0x49ec89,_0xd98e99)};return{'path':_0x9afd1e[_0x54733b(0x104)],'content':prependSkillFrontmatter(_0x49ec89,{'name':_0x3135e7,'displayName':_0xd98e99,'description':_0x41570f})};});}function hasYamlFrontmatter(_0x58a905){return/^\uFEFF?---\s*\r?\n/['test'](_0x58a905);}function prependSkillFrontmatter(_0x56f6cc,_0x1ec5c5){const _0x366ae5=a142_0x27d9,_0x5c5d82=_0x56f6cc[_0x366ae5(0x102)](/^\uFEFF/,'');return[_0x366ae5(0xee),_0x366ae5(0xec)+yamlString(_0x1ec5c5[_0x366ae5(0x107)]),_0x1ec5c5[_0x366ae5(0xef)]?_0x366ae5(0xdc)+yamlString(_0x1ec5c5[_0x366ae5(0xef)]):undefined,'description:\x20'+yamlString(_0x1ec5c5['description']),_0x366ae5(0xee),'',_0x5c5d82][_0x366ae5(0xe1)](_0x26d792=>_0x26d792!==undefined)['join']('\x0a');}function yamlString(_0x1df7a1){const _0x154f73=a142_0x27d9;return JSON[_0x154f73(0xf7)](_0x1df7a1[_0x154f73(0x102)](/\r/g,'')[_0x154f73(0x105)]());}function skillDisplayName(_0x5c3405,_0x542208){const _0x3170c6=a142_0x27d9,_0xcb34f4=_0x5c3405[_0x3170c6(0x112)]?.[_0x3170c6(0x105)]();return _0xcb34f4||_0x542208;}function withSyncedDisplayName(_0x27b498,_0x5b95a1){const _0x4926bd=a142_0x27d9,_0x508f64=_0x27b498['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x508f64)return _0x27b498;const _0x541ecc=_0x508f64[0x1]??'',_0x5bc467=_0x508f64[0x2]??'',_0x46f8e8=parseDocument(_0x5bc467);if(_0x46f8e8[_0x4926bd(0xe8)][_0x4926bd(0x100)]>0x0||!isMap(_0x46f8e8['contents']))return _0x27b498;if(_0x5b95a1)_0x46f8e8['set'](_0x4926bd(0xef),_0x5b95a1);else{if(_0x46f8e8[_0x4926bd(0x10a)]('displayName'))_0x46f8e8['delete']('displayName');else return _0x27b498;}forceBlockCollections(_0x46f8e8[_0x4926bd(0x116)]);const _0x193e52=_0x46f8e8[_0x4926bd(0x10b)]({'lineWidth':0x0})['trimEnd'](),_0x3019af=_0x27b498[_0x4926bd(0xf9)](_0x508f64[0x0][_0x4926bd(0x100)])[_0x4926bd(0x102)](/^\r?\n/,'');return _0x541ecc+_0x4926bd(0xf5)+_0x193e52+_0x4926bd(0x109)+_0x3019af;}function forceBlockCollections(_0x55aae3){if(!isNode(_0x55aae3))return;visit(_0x55aae3,(_0x183257,_0x243944)=>{isCollection(_0x243944)&&(_0x243944['flow']=![]);});}function a142_0x40ad(){const _0x29f8fe=['Runtime\x20Skill\x20package\x20is\x20missing\x20','5277396unuvSd','keys','length','scope','replace','example','path','trim','10yTzTOv','name','399640rcGCET','\x0a---\x0a\x0a','has','toString','find','208ezxOLh','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','utf8','skillName','1281ZeVOQa','pulledAt','1363621XvRNfE','contents','95676iNmNch','status','displayName:\x20','validation','Managed\x20file\x20was\x20removed\x20locally:\x20','force','120zDSFQV','filter','11gEkAmq','4057056UIdqDj','accessKey','289953CKRGKU','map','description','errors','hasOwn','test','schemaVersion','name:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','---','displayName','paths','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','appCode','fileHashes','16PQYdgl','---\x0a','env','stringify','entries','slice','version','isFile','contentHash'];a142_0x40ad=function(){return _0x29f8fe;};return a142_0x40ad();}function ensurePulledFilesCanBeOverwritten(_0x4ae25a,_0x119c97,_0xc84087,_0x1148ed){const _0x1ce1cd=a142_0x27d9;if(_0x1148ed||!existsSync(_0x119c97))return;const _0x2d2a93=readMetadataIfPresent(_0x119c97);if(!_0x2d2a93)return;const _0x5ea323=_0x2d2a93[_0x1ce1cd(0xf3)]&&Object[_0x1ce1cd(0xff)](_0x2d2a93[_0x1ce1cd(0xf3)])[_0x1ce1cd(0x100)]>0x0?_0x2d2a93[_0x1ce1cd(0xf3)]:undefined;if(_0x5ea323)for(const [_0x2d4126,_0x2291ff]of Object[_0x1ce1cd(0xf8)](_0x5ea323)){const _0x12eaae=resolveManagedFilePath(_0x4ae25a,_0x2d4126);if(!existsSync(_0x12eaae))throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xf1)+_0x4ae25a,_0x1ce1cd(0xde)+_0x2d4126);const _0x564ecf=lstatSync(_0x12eaae);if(!_0x564ecf['isFile']())throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xf1)+_0x4ae25a,_0x1ce1cd(0x110)+_0x2d4126);const _0x1d25c8=bufferSha256(readFileSync(_0x12eaae));if(_0x1d25c8!==_0x2291ff)throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xf1)+_0x4ae25a+'.\x20Changed\x20file:\x20'+_0x2d4126,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x2d4126);}else{const _0x4e49a2=resolve(_0x4ae25a,SKILL_FILE);if(existsSync(_0x4e49a2)&&_0x2d2a93[_0x1ce1cd(0xfc)]){const _0x410185=contentHash(readFileSync(_0x4e49a2,_0x1ce1cd(0x111)));if(_0x410185!==_0x2d2a93[_0x1ce1cd(0xfc)])throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xed)+_0x4e49a2,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x3df962 of normalizeLocalFiles(_0xc84087)){if(_0x5ea323?.[_0x3df962[_0x1ce1cd(0x104)]])continue;if(!_0x5ea323&&_0x3df962[_0x1ce1cd(0x104)]===SKILL_FILE)continue;const _0x8bc919=resolveManagedFilePath(_0x4ae25a,_0x3df962[_0x1ce1cd(0x104)]);if(!existsSync(_0x8bc919))continue;const _0x562fd3=lstatSync(_0x8bc919);if(!_0x562fd3[_0x1ce1cd(0xfb)]())throw CliErrors[_0x1ce1cd(0xdd)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x4ae25a,_0x1ce1cd(0x10f)+_0x3df962[_0x1ce1cd(0x104)]);const _0x303f4a=bufferSha256(readFileSync(_0x8bc919));if(_0x303f4a!==fileHash(_0x3df962))throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xf1)+_0x4ae25a,_0x1ce1cd(0x10e)+_0x3df962[_0x1ce1cd(0x104)]);}}function materializeFiles(_0x57a553,_0x43bfd6){const _0x45dce0=a142_0x27d9;for(const _0x4c03f0 of normalizeLocalFiles(_0x43bfd6)){const _0x19fe5f=resolveManagedFilePath(_0x57a553,_0x4c03f0[_0x45dce0(0x104)]);mkdirSync(dirname(_0x19fe5f),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x19fe5f,fileContent(_0x4c03f0),0x180);}}function removeStaleManagedFiles(_0x5dc173,_0x1f880c,_0x35a51a){const _0x5e3268=a142_0x27d9;if(!_0x1f880c)return;const _0x316bf2=new Set(normalizeLocalFiles(_0x35a51a)[_0x5e3268(0xe6)](_0x48333a=>_0x48333a[_0x5e3268(0x104)]));for(const _0x475091 of Object[_0x5e3268(0xff)](_0x1f880c)){if(_0x316bf2[_0x5e3268(0x10a)](_0x475091))continue;const _0x5413db=resolveManagedFilePath(_0x5dc173,_0x475091);existsSync(_0x5413db)&&lstatSync(_0x5413db)['isFile']()&&rmSync(_0x5413db,{'force':!![]});}}
|
|
1
|
+
(function(_0x35ae23,_0x5a38b6){const _0x1e5e0d=a143_0x12c9,_0x154a70=_0x35ae23();while(!![]){try{const _0x2ffa4f=parseInt(_0x1e5e0d(0xfc))/0x1*(-parseInt(_0x1e5e0d(0x133))/0x2)+parseInt(_0x1e5e0d(0x101))/0x3+parseInt(_0x1e5e0d(0x12f))/0x4+-parseInt(_0x1e5e0d(0x130))/0x5+parseInt(_0x1e5e0d(0x125))/0x6*(-parseInt(_0x1e5e0d(0x12e))/0x7)+parseInt(_0x1e5e0d(0x10d))/0x8*(-parseInt(_0x1e5e0d(0x10b))/0x9)+parseInt(_0x1e5e0d(0x109))/0xa;if(_0x2ffa4f===_0x5a38b6)break;else _0x154a70['push'](_0x154a70['shift']());}catch(_0x1f1c06){_0x154a70['push'](_0x154a70['shift']());}}}(a143_0x45cf,0x8ebaf));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';function a143_0x45cf(){const _0x3850a9=['keys','utf8','1157556qkbJUP','trim','Managed\x20file\x20was\x20removed\x20locally:\x20','delete','has','example','Runtime\x20Skill\x20package\x20is\x20missing\x20','force','28569590gVnJOt','match','27JzqIBo','hasOwn','1180072RNPNki','contents','name','env','isFile','entries','scope','.\x20Changed\x20file:\x20','test','accessKey','fileHashes','description:\x20','skillCode','contentHash','paths','map','appCode','description','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','slice','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','pulledAt','trimEnd','set','12756QIjnMD','find','length','skillName','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','schemaVersion','filter','validation','name:\x20','3794WXSbwx','1648112CrWKHU','2768775kaqnII','displayName','status','614428nzkPKj','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','join','path','---','flow','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','3JXjhyB','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','version'];a143_0x45cf=function(){return _0x3850a9;};return a143_0x45cf();}import{getRuntimeSkillDir}from'./paths.js';function a143_0x12c9(_0x4f5332,_0x386b4c){_0x4f5332=_0x4f5332-0xfc;const _0x45cfe8=a143_0x45cf();let _0x12c987=_0x45cfe8[_0x4f5332];return _0x12c987;}import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x4680cf,_0x295e04,_0x57f65a){const _0x5ad887=a143_0x12c9,_0xe53b79=requireSkillCode(_0x4680cf),_0x35487f=requirePackageBytes(_0xe53b79,_0x57f65a['packageBytes']),_0x144ff3=extractDownloadedPackage(_0x35487f),_0x36ed0d=_0x144ff3[_0x5ad887(0x126)](_0x39750d=>_0x39750d[_0x5ad887(0x137)]===SKILL_FILE);if(!_0x36ed0d)throw CliErrors['validation'](_0x5ad887(0x107)+SKILL_FILE+':\x20'+_0xe53b79);const _0x140cbb=withMaterializedSkillFrontmatter(_0x144ff3,_0x4680cf,_0xe53b79),_0x5054b0=_0x140cbb[_0x5ad887(0x126)](_0x3b6609=>_0x3b6609[_0x5ad887(0x137)]===SKILL_FILE),_0x343c5e=fileText(_0x5054b0),_0x142824=getRuntimeSkillDir(_0x57f65a[_0x5ad887(0x110)],_0x57f65a[_0x5ad887(0x116)],_0x57f65a['appCode'],_0x295e04,_0xe53b79,_0x57f65a[_0x5ad887(0x11b)]),_0x2bc7e1=resolve(_0x142824,SKILL_FILE),_0x310cea=resolve(_0x142824,METADATA_FILE),_0x3a9c14=contentHash(_0x343c5e),_0x57df71=readMetadataIfPresent(_0x310cea)?.[_0x5ad887(0x117)];ensurePulledFilesCanBeOverwritten(_0x142824,_0x310cea,_0x140cbb,_0x57f65a[_0x5ad887(0x108)]===!![]),mkdirSync(_0x142824,{'recursive':!![],'mode':0x1c0});const _0x6bac47=existsSync(_0x2bc7e1)?readFileSync(_0x2bc7e1,'utf8'):undefined;return materializeFiles(_0x142824,_0x140cbb),removeStaleManagedFiles(_0x142824,_0x57df71,_0x140cbb),writeJsonAtomic(_0x310cea,buildMetadata(_0x4680cf,_0x295e04,_0x57f65a[_0x5ad887(0x11d)],_0x3a9c14,_0x57f65a[_0x5ad887(0x122)],_0x140cbb,_0x35487f)),{'skill':_0x4680cf,'scope':_0x295e04,'dir':_0x142824,'skillMdPath':_0x2bc7e1,'metadataPath':_0x310cea,'contentHash':_0x3a9c14,'changed':_0x6bac47!==_0x343c5e};}export function reuseMaterializedRuntimeSkill(_0x5a6f36,_0x484349,_0xb4224e){const _0x1653b8=a143_0x12c9,_0x22a4ca=_0x5a6f36[_0x1653b8(0xfe)]?.[_0x1653b8(0x102)]();if(!_0x22a4ca)return undefined;const _0x3a84c0=requireSkillCode(_0x5a6f36),_0x4a3975=getRuntimeSkillDir(_0xb4224e[_0x1653b8(0x110)],_0xb4224e[_0x1653b8(0x116)],_0xb4224e[_0x1653b8(0x11d)],_0x484349,_0x3a84c0,_0xb4224e[_0x1653b8(0x11b)]),_0x435108=resolve(_0x4a3975,SKILL_FILE),_0x12737f=resolve(_0x4a3975,METADATA_FILE),_0x29d565=readMetadataIfPresent(_0x12737f);if(!_0x29d565||_0x29d565[_0x1653b8(0x12a)]!==0x2||_0x29d565[_0x1653b8(0x11d)]!==_0xb4224e[_0x1653b8(0x11d)]||_0x29d565[_0x1653b8(0x113)]!==_0x484349||_0x29d565[_0x1653b8(0x119)]!==_0x3a84c0||_0x29d565['version']!==_0x22a4ca||_0x29d565['id']!==_0x5a6f36['id']||_0x29d565['skillName']!==_0x5a6f36['skillName']||_0x29d565['description']!==_0x5a6f36[_0x1653b8(0x11e)]||_0x29d565['example']!==_0x5a6f36[_0x1653b8(0x106)]||_0x29d565[_0x1653b8(0x132)]!==_0x5a6f36[_0x1653b8(0x132)]||!_0x29d565[_0x1653b8(0x11a)]||!_0x29d565[_0x1653b8(0x117)]||!Object[_0x1653b8(0x10c)](_0x29d565['fileHashes'],SKILL_FILE))return undefined;for(const [_0x1aa102,_0x5f25a6]of Object[_0x1653b8(0x112)](_0x29d565[_0x1653b8(0x117)])){if(!/^[a-f0-9]{64}$/['test'](_0x5f25a6))return undefined;const _0x44b683=resolveManagedFilePath(_0x4a3975,_0x1aa102);if(!existsSync(_0x44b683)||!lstatSync(_0x44b683)[_0x1653b8(0x111)]())return undefined;if(bufferSha256(readFileSync(_0x44b683))!==_0x5f25a6)return undefined;}return{'skill':_0x5a6f36,'scope':_0x484349,'dir':_0x4a3975,'skillMdPath':_0x435108,'metadataPath':_0x12737f,'contentHash':_0x29d565['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x47ca05,_0x1fdead,_0x5e53e3){const _0x56696e=a143_0x12c9,_0x476a9f=skillDisplayName(_0x1fdead,_0x5e53e3),_0x394e58=_0x1fdead['description']?.['trim']()||_0x476a9f||_0x5e53e3;return normalizeLocalFiles(_0x47ca05)[_0x56696e(0x11c)](_0x56bf3d=>{const _0x40a72c=_0x56696e,_0x3dbc34=fileText(_0x56bf3d);if(_0x56bf3d[_0x40a72c(0x137)]!==SKILL_FILE)return _0x56bf3d;if(hasYamlFrontmatter(_0x3dbc34))return{'path':_0x56bf3d['path'],'content':withSyncedDisplayName(_0x3dbc34,_0x476a9f)};return{'path':_0x56bf3d[_0x40a72c(0x137)],'content':prependSkillFrontmatter(_0x3dbc34,{'name':_0x5e53e3,'displayName':_0x476a9f,'description':_0x394e58})};});}function hasYamlFrontmatter(_0x54a956){const _0x44ca2b=a143_0x12c9;return/^\uFEFF?---\s*\r?\n/[_0x44ca2b(0x115)](_0x54a956);}function prependSkillFrontmatter(_0x4d8ac7,_0x129607){const _0x29720e=a143_0x12c9,_0x4ed92c=_0x4d8ac7['replace'](/^\uFEFF/,'');return[_0x29720e(0x138),_0x29720e(0x12d)+yamlString(_0x129607[_0x29720e(0x10f)]),_0x129607[_0x29720e(0x131)]?'displayName:\x20'+yamlString(_0x129607['displayName']):undefined,_0x29720e(0x118)+yamlString(_0x129607['description']),_0x29720e(0x138),'',_0x4ed92c][_0x29720e(0x12b)](_0x4ef373=>_0x4ef373!==undefined)[_0x29720e(0x136)]('\x0a');}function yamlString(_0x1dd621){const _0x46dfdf=a143_0x12c9;return JSON['stringify'](_0x1dd621['replace'](/\r/g,'')[_0x46dfdf(0x102)]());}function skillDisplayName(_0x2bbba5,_0x1acf47){const _0x4fa560=a143_0x12c9,_0xe18513=_0x2bbba5[_0x4fa560(0x128)]?.[_0x4fa560(0x102)]();return _0xe18513||_0x1acf47;}function withSyncedDisplayName(_0x41bf2e,_0x1469b2){const _0x4f36ed=a143_0x12c9,_0x33cd55=_0x41bf2e[_0x4f36ed(0x10a)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x33cd55)return _0x41bf2e;const _0x14bc87=_0x33cd55[0x1]??'',_0x42fdf8=_0x33cd55[0x2]??'',_0x581f80=parseDocument(_0x42fdf8);if(_0x581f80['errors'][_0x4f36ed(0x127)]>0x0||!isMap(_0x581f80['contents']))return _0x41bf2e;if(_0x1469b2)_0x581f80[_0x4f36ed(0x124)]('displayName',_0x1469b2);else{if(_0x581f80[_0x4f36ed(0x105)](_0x4f36ed(0x131)))_0x581f80[_0x4f36ed(0x104)](_0x4f36ed(0x131));else return _0x41bf2e;}forceBlockCollections(_0x581f80[_0x4f36ed(0x10e)]);const _0x5df537=_0x581f80['toString']({'lineWidth':0x0})[_0x4f36ed(0x123)](),_0x418f51=_0x41bf2e[_0x4f36ed(0x120)](_0x33cd55[0x0][_0x4f36ed(0x127)])['replace'](/^\r?\n/,'');return _0x14bc87+'---\x0a'+_0x5df537+'\x0a---\x0a\x0a'+_0x418f51;}function forceBlockCollections(_0x376a4b){if(!isNode(_0x376a4b))return;visit(_0x376a4b,(_0x87dbbf,_0x3d20cf)=>{const _0x495d89=a143_0x12c9;isCollection(_0x3d20cf)&&(_0x3d20cf[_0x495d89(0x139)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x123890,_0x54871d,_0x5b9080,_0x402afb){const _0x150655=a143_0x12c9;if(_0x402afb||!existsSync(_0x54871d))return;const _0x404007=readMetadataIfPresent(_0x54871d);if(!_0x404007)return;const _0xce488d=_0x404007['fileHashes']&&Object['keys'](_0x404007[_0x150655(0x117)])[_0x150655(0x127)]>0x0?_0x404007[_0x150655(0x117)]:undefined;if(_0xce488d)for(const [_0x1c431b,_0x49e4fc]of Object[_0x150655(0x112)](_0xce488d)){const _0x3de1c0=resolveManagedFilePath(_0x123890,_0x1c431b);if(!existsSync(_0x3de1c0))throw CliErrors[_0x150655(0x12c)](_0x150655(0x13a)+_0x123890,_0x150655(0x103)+_0x1c431b);const _0x2eea58=lstatSync(_0x3de1c0);if(!_0x2eea58[_0x150655(0x111)]())throw CliErrors['validation'](_0x150655(0x13a)+_0x123890,_0x150655(0x121)+_0x1c431b);const _0xc087d7=bufferSha256(readFileSync(_0x3de1c0));if(_0xc087d7!==_0x49e4fc)throw CliErrors[_0x150655(0x12c)](_0x150655(0x13a)+_0x123890+_0x150655(0x114)+_0x1c431b,_0x150655(0x129)+_0x1c431b);}else{const _0x282277=resolve(_0x123890,SKILL_FILE);if(existsSync(_0x282277)&&_0x404007[_0x150655(0x11a)]){const _0x2c21f4=contentHash(readFileSync(_0x282277,_0x150655(0x100)));if(_0x2c21f4!==_0x404007[_0x150655(0x11a)])throw CliErrors[_0x150655(0x12c)](_0x150655(0x11f)+_0x282277,_0x150655(0xfd));}}for(const _0xfdeec1 of normalizeLocalFiles(_0x5b9080)){if(_0xce488d?.[_0xfdeec1[_0x150655(0x137)]])continue;if(!_0xce488d&&_0xfdeec1[_0x150655(0x137)]===SKILL_FILE)continue;const _0x2030ab=resolveManagedFilePath(_0x123890,_0xfdeec1[_0x150655(0x137)]);if(!existsSync(_0x2030ab))continue;const _0x583988=lstatSync(_0x2030ab);if(!_0x583988[_0x150655(0x111)]())throw CliErrors[_0x150655(0x12c)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x123890,_0x150655(0x135)+_0xfdeec1[_0x150655(0x137)]);const _0x550216=bufferSha256(readFileSync(_0x2030ab));if(_0x550216!==fileHash(_0xfdeec1))throw CliErrors['validation'](_0x150655(0x13a)+_0x123890,_0x150655(0x134)+_0xfdeec1[_0x150655(0x137)]);}}function materializeFiles(_0x519351,_0x12f63d){const _0x50ef09=a143_0x12c9;for(const _0x5da510 of normalizeLocalFiles(_0x12f63d)){const _0x4bab81=resolveManagedFilePath(_0x519351,_0x5da510[_0x50ef09(0x137)]);mkdirSync(dirname(_0x4bab81),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x4bab81,fileContent(_0x5da510),0x180);}}function removeStaleManagedFiles(_0x569926,_0xd64cfd,_0x395de7){const _0x12bad5=a143_0x12c9;if(!_0xd64cfd)return;const _0x42cc7d=new Set(normalizeLocalFiles(_0x395de7)[_0x12bad5(0x11c)](_0x5681a9=>_0x5681a9[_0x12bad5(0x137)]));for(const _0x35a364 of Object[_0x12bad5(0xff)](_0xd64cfd)){if(_0x42cc7d[_0x12bad5(0x105)](_0x35a364))continue;const _0x314317=resolveManagedFilePath(_0x569926,_0x35a364);existsSync(_0x314317)&&lstatSync(_0x314317)['isFile']()&&rmSync(_0x314317,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x2ca7a9,_0x2eb9b7){const _0x518af3=a144_0x4781,_0x4d2212=_0x2ca7a9();while(!![]){try{const _0x49e23a=parseInt(_0x518af3(0x105))/0x1+-parseInt(_0x518af3(0xf5))/0x2*(parseInt(_0x518af3(0x109))/0x3)+-parseInt(_0x518af3(0xf1))/0x4+parseInt(_0x518af3(0x104))/0x5+-parseInt(_0x518af3(0x10b))/0x6*(-parseInt(_0x518af3(0x102))/0x7)+-parseInt(_0x518af3(0x10c))/0x8+parseInt(_0x518af3(0xeb))/0x9;if(_0x49e23a===_0x2eb9b7)break;else _0x4d2212['push'](_0x4d2212['shift']());}catch(_0x39d6d4){_0x4d2212['push'](_0x4d2212['shift']());}}}(a144_0x1ced,0xe7672));import{existsSync,readFileSync}from'node:fs';function a144_0x1ced(){const _0x128ea2=['Invalid\x20','2781756ypIgss','string','parse','hasUpstreamUpdate','6OstwCr','tags','object','skillName','Runtime\x20Skill\x20is\x20missing\x20skillCode.','forkedFromVersion','utf8','ossPath','version','map','toISOString','forkedFromSkillId','length','21UTMbJk','trim','8365635HDEHPI','674947xhZAZI','isArray','path','example','1423503YtdKeB','tenantCode','2522598LsUaNu','6540816yUHKJE','sourceSessionId','status','validation','2474973AfUaYJ','files','zipSha256','userId','personal'];a144_0x1ced=function(){return _0x128ea2;};return a144_0x1ced();}function a144_0x4781(_0x162ca8,_0x42f196){_0x162ca8=_0x162ca8-0xea;const _0x1ced66=a144_0x1ced();let _0x478112=_0x1ced66[_0x162ca8];return _0x478112;}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';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x5056cd,_0x5b670b,_0x44d096,_0x1b7299,_0x3b7136,_0x411cd6,_0x5df874){const _0x3eadb1=a144_0x4781,_0x6d809c=_0x411cd6?normalizeLocalFiles(_0x411cd6):[],_0x23b56b=!_0x5df874&&_0x6d809c[_0x3eadb1(0x101)]>0x0?buildSkillPackage(_0x6d809c):undefined,_0x23917d=_0x5df874?bufferSha256(_0x5df874):_0x23b56b?.['manifest'][_0x3eadb1(0xed)],_0x2f6462=_0x5df874?.[_0x3eadb1(0x101)]??_0x23b56b?.['manifest']['zipSize'],_0x1e70c1=_0x6d809c['length']>0x0?Object['fromEntries'](_0x6d809c[_0x3eadb1(0xfe)](_0x1b9ba=>[_0x1b9ba[_0x3eadb1(0x107)],fileHash(_0x1b9ba)])):undefined;return{'schemaVersion':_0x6d809c[_0x3eadb1(0x101)]>0x0?0x2:0x1,'id':_0x5056cd['id'],'appCode':_0x44d096,'skillCode':requireSkillCode(_0x5056cd),'skillName':_0x5056cd[_0x3eadb1(0xf8)],'description':_0x5056cd['description'],'example':_0x5056cd[_0x3eadb1(0x108)],'scope':_0x5b670b,'readonly':_0x5b670b!==_0x3eadb1(0xef)||_0x5056cd['readonly']===!![],'tenantCode':_0x5056cd[_0x3eadb1(0x10a)],'userId':_0x5056cd[_0x3eadb1(0xee)],'version':_0x5056cd[_0x3eadb1(0xfd)],'status':_0x5056cd[_0x3eadb1(0x10e)],'tags':Array[_0x3eadb1(0x106)](_0x5056cd[_0x3eadb1(0xf6)])?_0x5056cd[_0x3eadb1(0xf6)]:[],'hasUpstreamUpdate':_0x5056cd[_0x3eadb1(0xf4)],'forkedFromSkillId':_0x5056cd[_0x3eadb1(0x100)],'forkedFromVersion':_0x5056cd[_0x3eadb1(0xfa)],'sourceSessionId':_0x5056cd[_0x3eadb1(0x10d)],'contentHash':_0x1b7299,'fileHashes':_0x1e70c1,'treeHash':_0x6d809c[_0x3eadb1(0x101)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x6d809c)):undefined,'ossPath':remoteManifestOssPath(_0x5056cd[_0x3eadb1(0xec)]),'zipSha256':_0x23917d,'zipSize':_0x2f6462,'files':_0x6d809c[_0x3eadb1(0x101)]>0x0?_0x6d809c[_0x3eadb1(0xfe)](_0x2f33a9=>({'path':_0x2f33a9[_0x3eadb1(0x107)],'hash':fileHash(_0x2f33a9),'size':fileContent(_0x2f33a9)[_0x3eadb1(0x101)]})):undefined,'pulledAt':_0x3b7136??new Date()[_0x3eadb1(0xff)]()};}export function requireSkillCode(_0x30d597){const _0x2f0f26=a144_0x4781,_0x336e00=_0x30d597['skillCode']?.[_0x2f0f26(0x103)]();if(!_0x336e00)throw CliErrors['validation'](_0x2f0f26(0xf9));return _0x336e00;}export function readMetadataIfPresent(_0x31b1af){const _0x11e1e5=a144_0x4781;if(!existsSync(_0x31b1af))return undefined;try{const _0x5ee3c2=JSON[_0x11e1e5(0xf3)](readFileSync(_0x31b1af,_0x11e1e5(0xfb)));return _0x5ee3c2;}catch{throw CliErrors[_0x11e1e5(0xea)](_0x11e1e5(0xf0)+METADATA_FILE+':\x20'+_0x31b1af);}}function remoteManifestOssPath(_0x5d54e2){const _0x44a570=a144_0x4781;if(!_0x5d54e2||typeof _0x5d54e2!==_0x44a570(0xf7)||Array[_0x44a570(0x106)](_0x5d54e2))return undefined;const _0x57da4c=_0x5d54e2[_0x44a570(0xfc)];return typeof _0x57da4c===_0x44a570(0xf2)&&_0x57da4c[_0x44a570(0x103)]()?_0x57da4c[_0x44a570(0x103)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a145_0x3d4b96=a145_0x56fc;(function(_0x53247a,_0x11c2a8){const _0x441a80=a145_0x56fc,_0x5f3fa8=_0x53247a();while(!![]){try{const _0x581506=parseInt(_0x441a80(0x90))/0x1+parseInt(_0x441a80(0x89))/0x2*(parseInt(_0x441a80(0x95))/0x3)+-parseInt(_0x441a80(0x9d))/0x4+parseInt(_0x441a80(0x8b))/0x5+-parseInt(_0x441a80(0x96))/0x6*(parseInt(_0x441a80(0x9c))/0x7)+parseInt(_0x441a80(0x8a))/0x8+-parseInt(_0x441a80(0xa1))/0x9*(parseInt(_0x441a80(0x8d))/0xa);if(_0x581506===_0x11c2a8)break;else _0x5f3fa8['push'](_0x5f3fa8['shift']());}catch(_0xe127d2){_0x5f3fa8['push'](_0x5f3fa8['shift']());}}}(a145_0x4c26,0x38d7a));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 a145_0x4c26(){const _0x2a9adc=['agentsSkillsDir','cacheRoot','cache','2MCLDmS','3518952OGvvZa','472120vrikxM','trim','170rdOEMD','.claude','skillCode','179882qznzVg','Unsafe\x20','homeDir','claudeSkillsDir','validation','1068888GrCBuM','3018xymYCi','skills','workbuddySkillsDir','SKILL_ROOT','\x20for\x20local\x20path:\x20','CLAUDE_SKILL_ROOT','1197cHySLg','1178552GWgffu','homeDirName','.agents','path\x20segment','241938pIWuMI','appCode','includes'];a145_0x4c26=function(){return _0x2a9adc;};return a145_0x4c26();}export function resolveSkillSyncPaths(_0x1c198c={}){const _0x52fdce=a145_0x56fc,_0x385a4b=_0x1c198c[_0x52fdce(0x92)]??homedir(),_0xd98191=resolve(_0x385a4b,PRODUCT_CONFIG[_0x52fdce(0x9e)],_0x52fdce(0x88)),_0x1dd8a2=trimmedEnv(_0x52fdce(0x99)),_0x2e8650=trimmedEnv(_0x52fdce(0x9b)),_0x41e93d=resolve(_0x385a4b,'.workbuddy'),_0x4ba4a9=_0x1c198c[_0x52fdce(0x98)]??(existsSync(_0x41e93d)?resolve(_0x41e93d,_0x52fdce(0x97)):undefined);return{'homeDir':_0x385a4b,'cacheRoot':_0xd98191,'managedRoot':resolve(_0x385a4b,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x1c198c[_0x52fdce(0xa4)]??_0x1dd8a2??resolve(_0x385a4b,_0x52fdce(0x9f),_0x52fdce(0x97)),'claudeSkillsDir':_0x1c198c[_0x52fdce(0x93)]??_0x2e8650??resolve(_0x385a4b,_0x52fdce(0x8e),_0x52fdce(0x97)),'workbuddySkillsDir':_0x4ba4a9};}export function runtimeAgentSkillRoots(_0x3245e7){const _0x484df0=a145_0x56fc;return[_0x3245e7[_0x484df0(0xa4)],_0x3245e7[_0x484df0(0x93)],_0x3245e7[_0x484df0(0x98)]]['filter'](_0x5c2a28=>Boolean(_0x5c2a28));}export function getRuntimeSkillCacheRoot(_0x11dfff,_0x4b2be0,_0x358687={}){const _0x794e80=a145_0x56fc,_0x41ebf1=resolveSkillSyncPaths(_0x358687);return resolve(_0x41ebf1[_0x794e80(0x87)],_0x11dfff,fingerprintAccessKey(_0x4b2be0),_0x794e80(0x97));}function a145_0x56fc(_0x1f6e1d,_0x30cbf9){_0x1f6e1d=_0x1f6e1d-0x87;const _0x4c2646=a145_0x4c26();let _0x56fc74=_0x4c2646[_0x1f6e1d];return _0x56fc74;}export function getRuntimeSkillDir(_0x51d3ac,_0x3b2a64,_0x5ba01d,_0x14178e,_0x94d887,_0x1734fd={}){const _0x4104d3=a145_0x56fc;return resolve(getRuntimeSkillCacheRoot(_0x51d3ac,_0x3b2a64,_0x1734fd),safePathSegment(_0x5ba01d,_0x4104d3(0xa2)),_0x14178e,safePathSegment(_0x94d887,_0x4104d3(0x8f)));}export function safePathSegment(_0x598de3,_0x529a03=a145_0x3d4b96(0xa0)){const _0x52ba5d=a145_0x3d4b96;if(!_0x598de3||_0x598de3[_0x52ba5d(0xa3)]('/')||_0x598de3[_0x52ba5d(0xa3)]('\x5c')||_0x598de3['includes']('..'))throw CliErrors[_0x52ba5d(0x94)](_0x52ba5d(0x91)+_0x529a03+_0x52ba5d(0x9a)+_0x598de3);return _0x598de3;}function trimmedEnv(_0xc30a8d){const _0x30faa6=a145_0x3d4b96,_0x2c32d0=productEnv(_0xc30a8d)?.[_0x30faa6(0x8c)]();return _0x2c32d0?_0x2c32d0:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1c5b94,_0x52b2a0){const _0x58e66a=a145_0x3ecc,_0x271ebb=_0x1c5b94();while(!![]){try{const _0x2e991c=-parseInt(_0x58e66a(0x210))/0x1+parseInt(_0x58e66a(0x205))/0x2+-parseInt(_0x58e66a(0x21e))/0x3+-parseInt(_0x58e66a(0x21a))/0x4*(parseInt(_0x58e66a(0x1fb))/0x5)+-parseInt(_0x58e66a(0x202))/0x6*(-parseInt(_0x58e66a(0x1fa))/0x7)+parseInt(_0x58e66a(0x1f6))/0x8+-parseInt(_0x58e66a(0x21c))/0x9;if(_0x2e991c===_0x52b2a0)break;else _0x271ebb['push'](_0x271ebb['shift']());}catch(_0x2d8560){_0x271ebb['push'](_0x271ebb['shift']());}}}(a145_0x16a0,0x5ea00));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a145_0x58cd9b}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(_0x483845,_0x3efe97,_0x43b71f={}){const _0x5728fb=a145_0x3ecc,_0x1a7686=resolvePushDirectoryRoot(_0x483845),_0x42f56b=readPushMetadataIfPresent(resolve(_0x1a7686,METADATA_FILE),{'ignoreInvalidMetadata':_0x43b71f[_0x5728fb(0x1f8)]});if(_0x42f56b?.[_0x5728fb(0x211)]&&_0x42f56b[_0x5728fb(0x211)]!==_0x3efe97&&!_0x43b71f[_0x5728fb(0x223)]&&!_0x43b71f['ignoreMetadataAppCodeMismatch'])throw CliErrors['validation'](_0x5728fb(0x1f7)+_0x42f56b[_0x5728fb(0x211)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x3efe97+'\x22.');const _0x1f0600=resolvePushSkillCode(_0x1a7686,_0x3efe97,_0x42f56b,_0x43b71f);if(!_0x1f0600)throw CliErrors[_0x5728fb(0x20b)](_0x5728fb(0x1ea)+SKILL_FILE+',\x20'+METADATA_FILE+_0x5728fb(0x215));return{'dir':_0x1a7686,'skillCode':_0x1f0600,'metadata':_0x42f56b};}export function readPushDirectory(_0x3c5cd2,_0x1e9e6b,_0x3de903={}){const _0x55a0e6=a145_0x3ecc,_0x10a45e=resolvePushDirectoryIdentity(_0x3c5cd2,_0x1e9e6b,_0x3de903),_0x47d57e=_0x10a45e[_0x55a0e6(0x20d)],_0x7a7bed=resolve(_0x47d57e,SKILL_FILE);if(!existsSync(_0x7a7bed)||!lstatSync(_0x7a7bed)['isFile']())throw CliErrors['validation'](_0x55a0e6(0x204)+SKILL_FILE+':\x20'+_0x7a7bed);const _0x1e91e8=_0x10a45e[_0x55a0e6(0x1ff)],_0x1e456a=_0x3de903[_0x55a0e6(0x21b)]??_0x55a0e6(0x1e9);if(!_0x3de903[_0x55a0e6(0x1f5)]&&_0x1e91e8?.[_0x55a0e6(0x1f3)]===_0x55a0e6(0x217))throw CliErrors[_0x55a0e6(0x20b)](_0x55a0e6(0x1fd)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x1e91e8[_0x55a0e6(0x1f3)]+'\x22.');if(!_0x3de903[_0x55a0e6(0x1f5)]&&_0x1e456a===_0x55a0e6(0x1e9)&&_0x1e91e8?.[_0x55a0e6(0x1f3)]&&_0x1e91e8[_0x55a0e6(0x1f3)]!==_0x55a0e6(0x1e9))throw CliErrors[_0x55a0e6(0x20b)](_0x55a0e6(0x1eb)+METADATA_FILE+_0x55a0e6(0x1fe)+_0x1e91e8[_0x55a0e6(0x1f3)]+'\x22.',_0x55a0e6(0x221)+_0x47d57e+_0x55a0e6(0x207));const _0x353891=scanSkillDirectory(_0x47d57e,{'excludedFilePaths':_0x3de903['excludedFilePaths']}),_0x538e7e=buildSkillPackage(_0x353891),_0x54a649=readFileSync(_0x7a7bed,_0x55a0e6(0x1ec)),_0xcb47ee=_0x10a45e[_0x55a0e6(0x219)],_0x4df830=_0x3de903[_0x55a0e6(0x214)]?undefined:_0x1e91e8,_0x334170=readSkillDisplayName(_0x54a649);return{'skillCode':_0xcb47ee,'metadata':_0x1e91e8,'frontmatterDisplayName':_0x334170,'input':{'skillCode':_0xcb47ee,'skillName':_0x334170??_0x4df830?.[_0x55a0e6(0x1f1)],'description':_0x4df830?.[_0x55a0e6(0x216)],'content':_0x54a649,'files':_0x538e7e[_0x55a0e6(0x1ef)],'packageBase64':_0x538e7e[_0x55a0e6(0x201)],'tags':_0x4df830?.[_0x55a0e6(0x206)],'version':_0x4df830?.[_0x55a0e6(0x220)],'sourceSessionId':_0x4df830?.['sourceSessionId']}};}function a145_0x16a0(){const _0x2c1a0c=['Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','displayName','allowAppCodeRetarget','match','isArray','slice','startsWith','\x20name\x20for\x20SkillHub\x20slug\x20generation.','trim','personal','Unable\x20to\x20resolve\x20skillCode\x20from\x20','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','utf8','string','filter','manifest','boolean','skillName','length','scope','toLowerCase','ignoreMetadataScope','3988912ANCqPG','Skill\x20metadata\x20appCode\x20\x22','ignoreInvalidMetadata','isFile','3356185LDYjvK','13660WCtmsV','pushedAt','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','\x20has\x20scope=\x22','metadata','name','packageBase64','6PreKjp','ignoreMetadataSkillCode','Missing\x20','1428762LYFRnV','tags','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','path','replace','sourceSessionId','validation','number','dir','isDirectory','Remote\x20Skill\x20','640714yQxwSp','appCode','files','example','ignoreMetadataForPayload',',\x20or\x20directory\x20name.','description','builtin','isSymbolicLink','skillCode','500zBYHwf','targetScope','2404620LSdSGg','Skill\x20directory\x20not\x20found:\x20','166416ZIFDPa','content','version'];a145_0x16a0=function(){return _0x2c1a0c;};return a145_0x16a0();}export function refreshPushDirectoryMetadataFromRemote(_0x57e699,_0x3adb10,_0x3af6dd,_0x45d43c={}){const _0x178320=a145_0x3ecc,_0x4a0e3b=resolvePushDirectoryRoot(_0x57e699),_0x4ce70c=readPushMetadataIfPresent(resolve(_0x4a0e3b,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x1474b5=requireRemoteScope(_0x3adb10),_0x574f6f=readLocalSkillContent(_0x4a0e3b),_0xd08ae9={..._0x3adb10,'appCode':_0x3adb10[_0x178320(0x211)]??_0x3af6dd,'skillName':_0x3adb10['skillName']??_0x4ce70c?.['skillName'],'description':_0x3adb10[_0x178320(0x216)]??_0x4ce70c?.[_0x178320(0x216)],'example':_0x3adb10[_0x178320(0x213)]??_0x4ce70c?.[_0x178320(0x213)],'tags':Array[_0x178320(0x1e4)](_0x3adb10[_0x178320(0x206)])?_0x3adb10[_0x178320(0x206)]:_0x4ce70c?.[_0x178320(0x206)],'sourceSessionId':_0x3adb10[_0x178320(0x20a)]??_0x4ce70c?.[_0x178320(0x20a)],'content':_0x3adb10[_0x178320(0x21f)]??_0x574f6f},_0x2dfd67=buildMetadata(_0xd08ae9,_0x1474b5,_0x3af6dd,contentHash(_0x574f6f),_0x45d43c['refreshedAt']);writeJsonAtomic(resolve(_0x4a0e3b,METADATA_FILE),_0x2dfd67);}export function recordPushedRuntimeSkill(_0x451be5,_0x2b6bd8,_0x4529c8,_0x3022b7={}){const _0x23f9ee=a145_0x3ecc,_0x49e2ce=resolvePushDirectoryRoot(_0x451be5),_0x3095eb=scanSkillDirectory(_0x49e2ce),_0xde0e61=_0x3095eb['find'](_0x3a4df6=>_0x3a4df6[_0x23f9ee(0x208)]===SKILL_FILE),_0x1ef455=_0xde0e61?fileText(_0xde0e61):'',_0x7fc6a3=tryNormalizePackageManifest(_0x2b6bd8[_0x23f9ee(0x212)]),_0x1be5c5={..._0x2b6bd8,'content':_0x2b6bd8['content']??_0x1ef455,'files':_0x7fc6a3},_0x472671=_0x7fc6a3?normalizeLocalFiles(_0x3095eb)[_0x23f9ee(0x1ee)](_0x14dcf4=>_0x7fc6a3[_0x23f9ee(0x212)]['some'](_0xe00400=>_0xe00400[_0x23f9ee(0x208)]===_0x14dcf4[_0x23f9ee(0x208)])):undefined,_0xc38606=buildMetadata(_0x1be5c5,_0x3022b7[_0x23f9ee(0x1f3)]??_0x23f9ee(0x1e9),_0x4529c8,contentHash(_0x1be5c5[_0x23f9ee(0x21f)]??''),_0x3022b7[_0x23f9ee(0x1fc)],_0x472671);writeJsonAtomic(resolve(_0x49e2ce,METADATA_FILE),_0xc38606);}export function deriveSkillCodeFromDirectory(_0x4bfaf2,_0x2c0f06){const _0x1f9021=a145_0x3ecc,_0x1efefd=basename(resolve(_0x4bfaf2)),_0x396ef9=_0x2c0f06+'--';return _0x1efefd[_0x1f9021(0x1e6)](_0x396ef9)?_0x1efefd[_0x1f9021(0x1e5)](_0x396ef9[_0x1f9021(0x1f2)]):_0x1efefd;}function resolvePushSkillCode(_0x1c8667,_0x58cd2d,_0x5829ce,_0x1cc4f1){const _0x14cc6e=a145_0x3ecc,_0x7482ec=deriveSkillCodeFromSkillFile(_0x1c8667)||deriveSkillCodeFromDirectory(_0x1c8667,_0x58cd2d);if(_0x1cc4f1[_0x14cc6e(0x203)])return _0x7482ec;return _0x5829ce?.['skillCode']?.[_0x14cc6e(0x1e8)]()||_0x7482ec;}function deriveSkillCodeFromSkillFile(_0x565d6b){const _0x3a85f5=a145_0x3ecc,_0x18030f=resolve(_0x565d6b,SKILL_FILE);if(!existsSync(_0x18030f)||!lstatSync(_0x18030f)[_0x3a85f5(0x1f9)]())return undefined;const _0x505518=readFileSync(_0x18030f,_0x3a85f5(0x1ec)),_0x3fc279=_0x505518['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3fc279)return undefined;const _0x11252b=parseFrontmatterObject(_0x3fc279[0x1]??''),_0x57f7e5=scalarToString(_0x11252b?.[_0x3a85f5(0x200)]);return _0x57f7e5?slugifySkillName(_0x57f7e5):undefined;}function readSkillDisplayName(_0x425885){const _0x212df7=a145_0x3ecc,_0x2c89a5=_0x425885[_0x212df7(0x1e3)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2c89a5)return undefined;const _0x2800c2=parseFrontmatterObject(_0x2c89a5[0x1]??'');return scalarToString(_0x2800c2?.[_0x212df7(0x222)]);}function slugifySkillName(_0x11e4e8){const _0x1f31c1=a145_0x3ecc,_0x5462fd=_0x11e4e8[_0x1f31c1(0x1e8)]()[_0x1f31c1(0x1f4)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x1f31c1(0x209)](/^-+/,'')[_0x1f31c1(0x209)](/-+$/,'')[_0x1f31c1(0x209)](/-{2,}/g,'-');if(!_0x5462fd)throw CliErrors[_0x1f31c1(0x20b)]('Invalid\x20'+SKILL_FILE+_0x1f31c1(0x1e7));return _0x5462fd;}function parseFrontmatterObject(_0x146897){try{const _0x3e3560=a145_0x58cd9b(_0x146897);return _0x3e3560&&typeof _0x3e3560==='object'&&!Array['isArray'](_0x3e3560)?_0x3e3560:undefined;}catch{return undefined;}}function scalarToString(_0x401931){const _0x642abf=a145_0x3ecc;if(typeof _0x401931===_0x642abf(0x1ed))return _0x401931[_0x642abf(0x1e8)]();if(typeof _0x401931===_0x642abf(0x20c)||typeof _0x401931===_0x642abf(0x1f0))return String(_0x401931);return undefined;}function resolvePushDirectoryRoot(_0x148e35){const _0x17277c=a145_0x3ecc,_0x3e8e1f=resolve(_0x148e35);if(!existsSync(_0x3e8e1f))throw CliErrors[_0x17277c(0x20b)](_0x17277c(0x21d)+_0x148e35);const _0x59e8f8=lstatSync(_0x3e8e1f);if(_0x59e8f8[_0x17277c(0x20e)]())return _0x3e8e1f;if(_0x59e8f8[_0x17277c(0x218)]()){const _0x554601=realpathSync(_0x3e8e1f);if(lstatSync(_0x554601)[_0x17277c(0x20e)]())return _0x554601;}throw CliErrors[_0x17277c(0x20b)]('Skill\x20directory\x20not\x20found:\x20'+_0x148e35);}function a145_0x3ecc(_0x1863c8,_0x3c3965){_0x1863c8=_0x1863c8-0x1e3;const _0x16a014=a145_0x16a0();let _0x3ecc34=_0x16a014[_0x1863c8];return _0x3ecc34;}function requireRemoteScope(_0x40492f){const _0x319361=a145_0x3ecc;if(_0x40492f['scope']===_0x319361(0x1e9)||_0x40492f['scope']==='company'||_0x40492f[_0x319361(0x1f3)]===_0x319361(0x217))return _0x40492f[_0x319361(0x1f3)];throw CliErrors[_0x319361(0x20b)](_0x319361(0x20f)+(_0x40492f[_0x319361(0x219)]||'(unknown)')+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x40492f[_0x319361(0x1f3)]??'unknown')+'\x22.');}function readLocalSkillContent(_0xe0e0cd){const _0x28e3eb=a145_0x3ecc,_0x3e3fcb=resolve(_0xe0e0cd,SKILL_FILE);return existsSync(_0x3e3fcb)&&lstatSync(_0x3e3fcb)[_0x28e3eb(0x1f9)]()?readFileSync(_0x3e3fcb,_0x28e3eb(0x1ec)):'';}function readPushMetadataIfPresent(_0x470fa9,_0x38c9c2={}){const _0x51a83e=a145_0x3ecc;try{return readMetadataIfPresent(_0x470fa9);}catch(_0x67d050){if(_0x38c9c2[_0x51a83e(0x1f8)])return undefined;throw _0x67d050;}}
|
|
1
|
+
(function(_0x29ba27,_0xf1f522){const _0x1e36f4=a146_0x5cd8,_0x38534b=_0x29ba27();while(!![]){try{const _0x211efb=parseInt(_0x1e36f4(0x21b))/0x1+-parseInt(_0x1e36f4(0x20f))/0x2*(-parseInt(_0x1e36f4(0x205))/0x3)+parseInt(_0x1e36f4(0x1ea))/0x4+-parseInt(_0x1e36f4(0x210))/0x5*(parseInt(_0x1e36f4(0x20b))/0x6)+parseInt(_0x1e36f4(0x1e6))/0x7+-parseInt(_0x1e36f4(0x206))/0x8+-parseInt(_0x1e36f4(0x1fa))/0x9;if(_0x211efb===_0xf1f522)break;else _0x38534b['push'](_0x38534b['shift']());}catch(_0x49a0be){_0x38534b['push'](_0x38534b['shift']());}}}(a146_0x3ece,0xa3b59));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a146_0x3c7fce}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';function a146_0x3ece(){const _0x1aabe5=['3wYFEZU','2364280neqDtX','Missing\x20','slice','isArray','appCode','18QhebkH','Invalid\x20','files','allowAppCodeRetarget','1779826oOVOJP','2094175TFERYY','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','example','ignoreMetadataSkillCode','path','name','Skill\x20metadata\x20appCode\x20\x22','version','Unable\x20to\x20resolve\x20skillCode\x20from\x20','sourceSessionId','\x20has\x20scope=\x22','587502GdgCPR','skillCode','match','number','ignoreMetadataAppCodeMismatch','personal','scope','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','pushedAt','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','validation','packageBase64','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','tags','toLowerCase','3579954tvfcsW','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','displayName','length','3596008DZALZq','builtin','skillName','metadata','ignoreInvalidMetadata','Remote\x20Skill\x20','some','object','isDirectory','utf8','Skill\x20directory\x20not\x20found:\x20','find','string','isSymbolicLink','\x20has\x20unsupported\x20scope\x20\x22','unknown','5987214tycFiJ','excludedFilePaths','isFile','content','refreshedAt','description','ignoreMetadataForPayload','replace','\x20name\x20for\x20SkillHub\x20slug\x20generation.','company','startsWith'];a146_0x3ece=function(){return _0x1aabe5;};return a146_0x3ece();}import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x4fa3c3,_0x391ed4,_0x27b709={}){const _0x41dbb3=a146_0x5cd8,_0xaa9b6f=resolvePushDirectoryRoot(_0x4fa3c3),_0x27ed92=readPushMetadataIfPresent(resolve(_0xaa9b6f,METADATA_FILE),{'ignoreInvalidMetadata':_0x27b709[_0x41dbb3(0x1ee)]});if(_0x27ed92?.['appCode']&&_0x27ed92[_0x41dbb3(0x20a)]!==_0x391ed4&&!_0x27b709[_0x41dbb3(0x20e)]&&!_0x27b709[_0x41dbb3(0x21f)])throw CliErrors[_0x41dbb3(0x225)](_0x41dbb3(0x216)+_0x27ed92['appCode']+_0x41dbb3(0x222)+_0x391ed4+'\x22.');const _0x56b5d6=resolvePushSkillCode(_0xaa9b6f,_0x391ed4,_0x27ed92,_0x27b709);if(!_0x56b5d6)throw CliErrors[_0x41dbb3(0x225)](_0x41dbb3(0x218)+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0xaa9b6f,'skillCode':_0x56b5d6,'metadata':_0x27ed92};}export function readPushDirectory(_0x37498d,_0x2f9a70,_0x12dcc4={}){const _0x4854ab=a146_0x5cd8,_0x3855e5=resolvePushDirectoryIdentity(_0x37498d,_0x2f9a70,_0x12dcc4),_0x37e5dc=_0x3855e5['dir'],_0x15782c=resolve(_0x37e5dc,SKILL_FILE);if(!existsSync(_0x15782c)||!lstatSync(_0x15782c)[_0x4854ab(0x1fc)]())throw CliErrors[_0x4854ab(0x225)](_0x4854ab(0x207)+SKILL_FILE+':\x20'+_0x15782c);const _0x1f9167=_0x3855e5[_0x4854ab(0x1ed)],_0x2210d6=_0x12dcc4['targetScope']??_0x4854ab(0x220);if(!_0x12dcc4['ignoreMetadataScope']&&_0x1f9167?.[_0x4854ab(0x221)]===_0x4854ab(0x1eb))throw CliErrors['validation'](_0x4854ab(0x1e3)+METADATA_FILE+_0x4854ab(0x21a)+_0x1f9167[_0x4854ab(0x221)]+'\x22.');if(!_0x12dcc4['ignoreMetadataScope']&&_0x2210d6===_0x4854ab(0x220)&&_0x1f9167?.[_0x4854ab(0x221)]&&_0x1f9167[_0x4854ab(0x221)]!==_0x4854ab(0x220))throw CliErrors['validation'](_0x4854ab(0x224)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x1f9167[_0x4854ab(0x221)]+'\x22.',_0x4854ab(0x1e7)+_0x37e5dc+_0x4854ab(0x211));const _0x3ad14a=scanSkillDirectory(_0x37e5dc,{'excludedFilePaths':_0x12dcc4[_0x4854ab(0x1fb)]}),_0x13f5b1=buildSkillPackage(_0x3ad14a),_0x2a36b8=readFileSync(_0x15782c,_0x4854ab(0x1f3)),_0x23f9dd=_0x3855e5[_0x4854ab(0x21c)],_0x584283=_0x12dcc4[_0x4854ab(0x200)]?undefined:_0x1f9167,_0x2cf7ff=readSkillDisplayName(_0x2a36b8);return{'skillCode':_0x23f9dd,'metadata':_0x1f9167,'frontmatterDisplayName':_0x2cf7ff,'input':{'skillCode':_0x23f9dd,'skillName':_0x2cf7ff??_0x584283?.[_0x4854ab(0x1ec)],'description':_0x584283?.[_0x4854ab(0x1ff)],'content':_0x2a36b8,'files':_0x13f5b1['manifest'],'packageBase64':_0x13f5b1[_0x4854ab(0x226)],'tags':_0x584283?.[_0x4854ab(0x1e4)],'version':_0x584283?.[_0x4854ab(0x217)],'sourceSessionId':_0x584283?.[_0x4854ab(0x219)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x56266f,_0x3b92a0,_0x41f2a0,_0x4cc3c9={}){const _0x3a34a6=a146_0x5cd8,_0x3ecb0c=resolvePushDirectoryRoot(_0x56266f),_0x487f5c=readPushMetadataIfPresent(resolve(_0x3ecb0c,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x537406=requireRemoteScope(_0x3b92a0),_0x53b4af=readLocalSkillContent(_0x3ecb0c),_0x3b512b={..._0x3b92a0,'appCode':_0x3b92a0['appCode']??_0x41f2a0,'skillName':_0x3b92a0[_0x3a34a6(0x1ec)]??_0x487f5c?.['skillName'],'description':_0x3b92a0[_0x3a34a6(0x1ff)]??_0x487f5c?.[_0x3a34a6(0x1ff)],'example':_0x3b92a0[_0x3a34a6(0x212)]??_0x487f5c?.[_0x3a34a6(0x212)],'tags':Array[_0x3a34a6(0x209)](_0x3b92a0[_0x3a34a6(0x1e4)])?_0x3b92a0[_0x3a34a6(0x1e4)]:_0x487f5c?.[_0x3a34a6(0x1e4)],'sourceSessionId':_0x3b92a0[_0x3a34a6(0x219)]??_0x487f5c?.[_0x3a34a6(0x219)],'content':_0x3b92a0[_0x3a34a6(0x1fd)]??_0x53b4af},_0x594958=buildMetadata(_0x3b512b,_0x537406,_0x41f2a0,contentHash(_0x53b4af),_0x4cc3c9[_0x3a34a6(0x1fe)]);writeJsonAtomic(resolve(_0x3ecb0c,METADATA_FILE),_0x594958);}export function recordPushedRuntimeSkill(_0x4ff9d3,_0x5f2533,_0x366666,_0xde91ce={}){const _0x5601cc=a146_0x5cd8,_0x126ed2=resolvePushDirectoryRoot(_0x4ff9d3),_0x307ead=scanSkillDirectory(_0x126ed2),_0x214e6f=_0x307ead[_0x5601cc(0x1f5)](_0x19dac0=>_0x19dac0[_0x5601cc(0x214)]===SKILL_FILE),_0x23a4e0=_0x214e6f?fileText(_0x214e6f):'',_0x3107d4=tryNormalizePackageManifest(_0x5f2533[_0x5601cc(0x20d)]),_0x3f6854={..._0x5f2533,'content':_0x5f2533[_0x5601cc(0x1fd)]??_0x23a4e0,'files':_0x3107d4},_0xb7a3b1=_0x3107d4?normalizeLocalFiles(_0x307ead)['filter'](_0x2d3a2f=>_0x3107d4['files'][_0x5601cc(0x1f0)](_0x3ced7a=>_0x3ced7a[_0x5601cc(0x214)]===_0x2d3a2f[_0x5601cc(0x214)])):undefined,_0x3c1024=buildMetadata(_0x3f6854,_0xde91ce['scope']??'personal',_0x366666,contentHash(_0x3f6854[_0x5601cc(0x1fd)]??''),_0xde91ce[_0x5601cc(0x223)],_0xb7a3b1);writeJsonAtomic(resolve(_0x126ed2,METADATA_FILE),_0x3c1024);}export function deriveSkillCodeFromDirectory(_0xa29ff1,_0x4a77fc){const _0xacef5a=a146_0x5cd8,_0x3a96d5=basename(resolve(_0xa29ff1)),_0x3cad0c=_0x4a77fc+'--';return _0x3a96d5[_0xacef5a(0x204)](_0x3cad0c)?_0x3a96d5[_0xacef5a(0x208)](_0x3cad0c[_0xacef5a(0x1e9)]):_0x3a96d5;}function a146_0x5cd8(_0x4c5f56,_0x52a132){_0x4c5f56=_0x4c5f56-0x1e3;const _0x3ecedb=a146_0x3ece();let _0x5cd818=_0x3ecedb[_0x4c5f56];return _0x5cd818;}function resolvePushSkillCode(_0x3480b7,_0x80dc99,_0x25d6b9,_0xda61a9){const _0x3e4d2c=a146_0x5cd8,_0x5d6dad=deriveSkillCodeFromSkillFile(_0x3480b7)||deriveSkillCodeFromDirectory(_0x3480b7,_0x80dc99);if(_0xda61a9[_0x3e4d2c(0x213)])return _0x5d6dad;return _0x25d6b9?.['skillCode']?.['trim']()||_0x5d6dad;}function deriveSkillCodeFromSkillFile(_0x3ad159){const _0xd709d1=a146_0x5cd8,_0x6a10c8=resolve(_0x3ad159,SKILL_FILE);if(!existsSync(_0x6a10c8)||!lstatSync(_0x6a10c8)['isFile']())return undefined;const _0x53df1e=readFileSync(_0x6a10c8,_0xd709d1(0x1f3)),_0x3f79c8=_0x53df1e[_0xd709d1(0x21d)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3f79c8)return undefined;const _0x5c7672=parseFrontmatterObject(_0x3f79c8[0x1]??''),_0x1a722a=scalarToString(_0x5c7672?.[_0xd709d1(0x215)]);return _0x1a722a?slugifySkillName(_0x1a722a):undefined;}function readSkillDisplayName(_0x4478f1){const _0x42a301=a146_0x5cd8,_0x51c5d2=_0x4478f1[_0x42a301(0x21d)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x51c5d2)return undefined;const _0x1f5c60=parseFrontmatterObject(_0x51c5d2[0x1]??'');return scalarToString(_0x1f5c60?.[_0x42a301(0x1e8)]);}function slugifySkillName(_0x5b3bca){const _0x3765eb=a146_0x5cd8,_0x4321df=_0x5b3bca['trim']()[_0x3765eb(0x1e5)]()[_0x3765eb(0x201)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x3765eb(0x201)](/^-+/,'')[_0x3765eb(0x201)](/-+$/,'')[_0x3765eb(0x201)](/-{2,}/g,'-');if(!_0x4321df)throw CliErrors[_0x3765eb(0x225)](_0x3765eb(0x20c)+SKILL_FILE+_0x3765eb(0x202));return _0x4321df;}function parseFrontmatterObject(_0x305614){const _0x3a170c=a146_0x5cd8;try{const _0x3f7709=a146_0x3c7fce(_0x305614);return _0x3f7709&&typeof _0x3f7709===_0x3a170c(0x1f1)&&!Array[_0x3a170c(0x209)](_0x3f7709)?_0x3f7709:undefined;}catch{return undefined;}}function scalarToString(_0x125bae){const _0x657873=a146_0x5cd8;if(typeof _0x125bae===_0x657873(0x1f6))return _0x125bae['trim']();if(typeof _0x125bae===_0x657873(0x21e)||typeof _0x125bae==='boolean')return String(_0x125bae);return undefined;}function resolvePushDirectoryRoot(_0x244821){const _0x492c2a=a146_0x5cd8,_0x46ddb6=resolve(_0x244821);if(!existsSync(_0x46ddb6))throw CliErrors[_0x492c2a(0x225)](_0x492c2a(0x1f4)+_0x244821);const _0x297cd4=lstatSync(_0x46ddb6);if(_0x297cd4[_0x492c2a(0x1f2)]())return _0x46ddb6;if(_0x297cd4[_0x492c2a(0x1f7)]()){const _0xd6cc44=realpathSync(_0x46ddb6);if(lstatSync(_0xd6cc44)['isDirectory']())return _0xd6cc44;}throw CliErrors[_0x492c2a(0x225)]('Skill\x20directory\x20not\x20found:\x20'+_0x244821);}function requireRemoteScope(_0x14cb20){const _0x214642=a146_0x5cd8;if(_0x14cb20[_0x214642(0x221)]==='personal'||_0x14cb20['scope']===_0x214642(0x203)||_0x14cb20[_0x214642(0x221)]===_0x214642(0x1eb))return _0x14cb20[_0x214642(0x221)];throw CliErrors[_0x214642(0x225)](_0x214642(0x1ef)+(_0x14cb20[_0x214642(0x21c)]||'(unknown)')+_0x214642(0x1f8)+(_0x14cb20['scope']??_0x214642(0x1f9))+'\x22.');}function readLocalSkillContent(_0x47e61b){const _0x555faf=a146_0x5cd8,_0x458e38=resolve(_0x47e61b,SKILL_FILE);return existsSync(_0x458e38)&&lstatSync(_0x458e38)[_0x555faf(0x1fc)]()?readFileSync(_0x458e38,_0x555faf(0x1f3)):'';}function readPushMetadataIfPresent(_0x7dc826,_0x2d6253={}){const _0x45c6d0=a146_0x5cd8;try{return readMetadataIfPresent(_0x7dc826);}catch(_0x3aa759){if(_0x2d6253[_0x45c6d0(0x1ee)])return undefined;throw _0x3aa759;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1a4b4d,_0x99be1a){const _0xcbf5df=a147_0x1a9d,_0x1baf6b=_0x1a4b4d();while(!![]){try{const _0xb50e56=-parseInt(_0xcbf5df(0x7d))/0x1*(parseInt(_0xcbf5df(0x83))/0x2)+parseInt(_0xcbf5df(0x78))/0x3+parseInt(_0xcbf5df(0x82))/0x4*(-parseInt(_0xcbf5df(0x79))/0x5)+parseInt(_0xcbf5df(0x7a))/0x6+parseInt(_0xcbf5df(0x77))/0x7*(-parseInt(_0xcbf5df(0x80))/0x8)+-parseInt(_0xcbf5df(0x76))/0x9*(parseInt(_0xcbf5df(0x87))/0xa)+parseInt(_0xcbf5df(0x85))/0xb*(parseInt(_0xcbf5df(0x75))/0xc);if(_0xb50e56===_0x99be1a)break;else _0x1baf6b['push'](_0x1baf6b['shift']());}catch(_0x14dd46){_0x1baf6b['push'](_0x1baf6b['shift']());}}}(a147_0x1b8d,0x9aa96));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x1d8e31){const _0xdbd686=a147_0x1a9d,_0x25d7fb=_0x1d8e31&&_0x1d8e31[_0xdbd686(0x7e)]>0x0?_0x1d8e31:[_0xdbd686(0x81),'company',_0xdbd686(0x7f)],_0x5030f6=[];for(const _0x34a6f8 of _0x25d7fb){if(!isRuntimeSkillScope(_0x34a6f8))throw CliErrors[_0xdbd686(0x84)](_0xdbd686(0x7b)+_0x34a6f8);!_0x5030f6[_0xdbd686(0x86)](_0x34a6f8)&&_0x5030f6['push'](_0x34a6f8);}return _0x5030f6;}function a147_0x1a9d(_0x23e9e2,_0x48f6e4){_0x23e9e2=_0x23e9e2-0x75;const _0x1b8d96=a147_0x1b8d();let _0x1a9d6b=_0x1b8d96[_0x23e9e2];return _0x1a9d6b;}function a147_0x1b8d(){const _0x157389=['15avfqrY','1213320Dpobbt','Unsupported\x20runtime\x20Skill\x20scope:\x20','company','1CHoHlY','length','builtin','928Ojlrvk','personal','17308VfzUil','1903878LXleBq','validation','3387703DtWdrU','includes','29110uPtxVs','60Kuhqck','909BjBbva','52493QpDslY','3060672gcMbwD'];a147_0x1b8d=function(){return _0x157389;};return a147_0x1b8d();}export function isRuntimeSkillScope(_0x3cc6b8){const _0x4ffa24=a147_0x1a9d;return _0x3cc6b8===_0x4ffa24(0x81)||_0x3cc6b8===_0x4ffa24(0x7c)||_0x3cc6b8===_0x4ffa24(0x7f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a149_0x7c58af=a149_0x6251;(function(_0x49e809,_0x3eccf4){const _0x2e67a7=a149_0x6251,_0x47d17e=_0x49e809();while(!![]){try{const _0x1f33c2=parseInt(_0x2e67a7(0x1fe))/0x1*(-parseInt(_0x2e67a7(0x1fc))/0x2)+-parseInt(_0x2e67a7(0x1ec))/0x3*(-parseInt(_0x2e67a7(0x1f0))/0x4)+parseInt(_0x2e67a7(0x1eb))/0x5*(parseInt(_0x2e67a7(0x1fb))/0x6)+-parseInt(_0x2e67a7(0x1f6))/0x7*(parseInt(_0x2e67a7(0x1f7))/0x8)+parseInt(_0x2e67a7(0x1f3))/0x9+-parseInt(_0x2e67a7(0x1f2))/0xa+-parseInt(_0x2e67a7(0x1f8))/0xb*(-parseInt(_0x2e67a7(0x1f1))/0xc);if(_0x1f33c2===_0x3eccf4)break;else _0x47d17e['push'](_0x47d17e['shift']());}catch(_0x322393){_0x47d17e['push'](_0x47d17e['shift']());}}}(a149_0x3891,0x74f51));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a149_0x7c58af(0x1f5));function a149_0x6251(_0x28ad10,_0x24adc7){_0x28ad10=_0x28ad10-0x1e8;const _0x389148=a149_0x3891();let _0x6251=_0x389148[_0x28ad10];return _0x6251;}function a149_0x3891(){const _0x4f6b03=['895433BHtQQY','endsWith','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','78mWqwBz','931492XcAalV','name','2vOvkIl','validation_error','code','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','341870bpgDmJ','225RkpMbV','from','object','validation','15896ymUQdd','72BDRaIT','4704630ebARPE','6912801olHdQv','path','1980-01-01T00:00:00.000Z','1312283VlksLy','24jxrtbN'];a149_0x3891=function(){return _0x4f6b03;};return a149_0x3891();}export function createDeterministicZipPackage(_0x3edbca){const _0x462d6d=a149_0x7c58af,_0x1060f2={};for(const _0x16c816 of normalizeLocalFiles(_0x3edbca)){_0x1060f2[_0x16c816[_0x462d6d(0x1f4)]]=fileContent(_0x16c816);}return Buffer[_0x462d6d(0x1ed)](zipSync(_0x1060f2,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x5bcb10){const _0x55bb4f=a149_0x7c58af;if(_0x5bcb10['length']<0x16)throw CliErrors[_0x55bb4f(0x1ef)](_0x55bb4f(0x1ea));let _0x1b1cf9;try{_0x1b1cf9=unzipSync(_0x5bcb10,{'filter'(_0x4e8ba5){const _0x49c1aa=_0x55bb4f,_0x4feb54=normalizeSkillRelativePath(_0x4e8ba5[_0x49c1aa(0x1fd)]);if(_0x4feb54[_0x49c1aa(0x1f9)]('/'))throw CliErrors[_0x49c1aa(0x1ef)](_0x49c1aa(0x1fa)+_0x4feb54);return!![];}});}catch(_0x455466){if(isRuntimeSkillValidationError(_0x455466))throw _0x455466;throw CliErrors[_0x55bb4f(0x1ef)](_0x55bb4f(0x1ea));}return Object['entries'](_0x1b1cf9)['map'](([_0x516930,_0x1640b8])=>({'path':normalizeSkillRelativePath(_0x516930),'bytes':Buffer[_0x55bb4f(0x1ed)](_0x1640b8)}))['sort'](compareSkillFiles);}function isRuntimeSkillValidationError(_0x275ce6){const _0x4d7ccd=a149_0x7c58af;return typeof _0x275ce6===_0x4d7ccd(0x1ee)&&_0x275ce6!==null&&_0x4d7ccd(0x1e9)in _0x275ce6&&_0x275ce6['code']===_0x4d7ccd(0x1e8);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ad092,_0x3e376f){const _0x560435=a150_0x2dc7,_0x2d5ebc=_0x3ad092();while(!![]){try{const _0x2ccf91=-parseInt(_0x560435(0x9a))/0x1*(-parseInt(_0x560435(0x7f))/0x2)+-parseInt(_0x560435(0x97))/0x3*(parseInt(_0x560435(0x84))/0x4)+-parseInt(_0x560435(0x7b))/0x5*(-parseInt(_0x560435(0xa4))/0x6)+parseInt(_0x560435(0xa6))/0x7+-parseInt(_0x560435(0x9c))/0x8+parseInt(_0x560435(0x8d))/0x9+-parseInt(_0x560435(0x90))/0xa;if(_0x2ccf91===_0x3e376f)break;else _0x2d5ebc['push'](_0x2d5ebc['shift']());}catch(_0x1bc305){_0x2d5ebc['push'](_0x2d5ebc['shift']());}}}(a150_0x1ee9,0x8c697));function a150_0x2dc7(_0x28ff07,_0x45fd87){_0x28ff07=_0x28ff07-0x79;const _0x1ee9eb=a150_0x1ee9();let _0x2dc764=_0x1ee9eb[_0x28ff07];return _0x2dc764;}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(_0x1a33bb){const _0xbbd938=a150_0x2dc7,_0x592bce=normalizeLocalFiles(_0x1a33bb);if(!_0x592bce['some'](_0x5d700f=>_0x5d700f[_0xbbd938(0xa1)]===SKILL_FILE))throw CliErrors[_0xbbd938(0x95)]('Missing\x20'+SKILL_FILE+_0xbbd938(0x99));const _0x4d9a2a=localFilesToManifestFiles(_0x592bce),_0x2d44bf=createDeterministicZipPackage(_0x592bce);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x4d9a2a),'zipSha256':bufferSha256(_0x2d44bf),'zipSize':_0x2d44bf[_0xbbd938(0x94)],'files':_0x4d9a2a},'packageBytes':_0x2d44bf,'packageBase64':_0x2d44bf[_0xbbd938(0x86)](_0xbbd938(0x88))};}export function verifyRuntimeSkillPackage(_0x4c8f86,_0x2dd8c5){const _0x107ff4=a150_0x2dc7,_0x35b7c9=normalizePackageManifest(_0x4c8f86,{'requireOssPath':![]});if(!_0x35b7c9)throw CliErrors[_0x107ff4(0x95)](_0x107ff4(0x98));return extractAndVerifyPackage(_0x35b7c9,_0x2dd8c5);}function a150_0x1ee9(){const _0x2aa8a2=['5507568uimDyd','files','treeSha256','some','sha256','path','zipSize','Duplicate\x20Skill\x20package\x20entry:\x20','6aVqyZU','trim','6159251FzSbUP','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','set','isArray','4676965tYUPBS','get','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','has','7166wsUdYY','size','ossPath','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','string','4QMMTRo','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','toString','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','base64','zipSha256','push','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','requireOssPath','6042132CMzkid','Runtime\x20Skill\x20package\x20is\x20missing\x20','toLowerCase','11209420oOAiGR','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','bytes','schemaVersion','length','validation','map','2391663uYWMNy','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','\x20in\x20Skill\x20file\x20package.','194wzWTEE','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.'];a150_0x1ee9=function(){return _0x2aa8a2;};return a150_0x1ee9();}export function verifyRuntimeSkillBundle(_0x33610c,_0x5b2c79){const _0x2ed411=normalizePackageManifest(_0x33610c,{'requireOssPath':![]});if(!_0x2ed411)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackageFiles(_0x2ed411,_0x5b2c79);}export function tryNormalizePackageManifest(_0x19d674){return normalizePackageManifest(_0x19d674,{'requireOssPath':![]});}export function requirePackageBytes(_0x154174,_0x115400){const _0x3dc0f9=a150_0x2dc7;if(!_0x115400||_0x115400[_0x3dc0f9(0x94)]===0x0)throw CliErrors[_0x3dc0f9(0x95)](_0x3dc0f9(0xa7)+_0x154174);return _0x115400;}export function extractDownloadedPackage(_0x55da2e){const _0x9e2ffb=a150_0x2dc7,_0x25b2a7=parseZipPackage(_0x55da2e)[_0x9e2ffb(0x96)](_0x2459dc=>({'path':_0x2459dc[_0x9e2ffb(0xa1)],'bytes':_0x2459dc[_0x9e2ffb(0x92)]}));if(!_0x25b2a7['some'](_0x2a5272=>_0x2a5272['path']===SKILL_FILE))throw CliErrors[_0x9e2ffb(0x95)](_0x9e2ffb(0x8e)+SKILL_FILE+'.');return normalizeLocalFiles(_0x25b2a7);}export function localFilesToManifestFiles(_0x2ffa82){const _0x122561=a150_0x2dc7;return normalizeLocalFiles(_0x2ffa82)[_0x122561(0x96)](_0x3ccb8b=>({'path':_0x3ccb8b[_0x122561(0xa1)],'sha256':fileHash(_0x3ccb8b),'size':fileContent(_0x3ccb8b)[_0x122561(0x94)]}));}function normalizePackageManifest(_0x32ff5e,_0x2255d2){const _0x4ecad4=a150_0x2dc7;if(!_0x32ff5e||typeof _0x32ff5e!=='object'||Array[_0x4ecad4(0x7a)](_0x32ff5e))return undefined;const _0x353f3b=_0x32ff5e,_0x445831=typeof _0x353f3b[_0x4ecad4(0x81)]===_0x4ecad4(0x83)?_0x353f3b['ossPath'][_0x4ecad4(0xa5)]():undefined;if(_0x2255d2[_0x4ecad4(0x8c)]&&!_0x445831)return undefined;if(!Array[_0x4ecad4(0x7a)](_0x353f3b[_0x4ecad4(0x9d)])||_0x353f3b['files'][_0x4ecad4(0x94)]===0x0)return undefined;if(!isSha256Hex(_0x353f3b['treeSha256']))throw CliErrors[_0x4ecad4(0x95)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.');if(!isSha256Hex(_0x353f3b['zipSha256']))throw CliErrors[_0x4ecad4(0x95)]('Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.');if(!Number['isSafeInteger'](_0x353f3b[_0x4ecad4(0xa2)])||_0x353f3b[_0x4ecad4(0xa2)]<0x0)throw CliErrors[_0x4ecad4(0x95)](_0x4ecad4(0x85));const _0x1151d9=normalizeManifestFiles(_0x353f3b[_0x4ecad4(0x9d)]);if(!_0x1151d9[_0x4ecad4(0x9f)](_0x25e6ea=>_0x25e6ea[_0x4ecad4(0xa1)]===SKILL_FILE))throw CliErrors[_0x4ecad4(0x95)](_0x4ecad4(0x87)+SKILL_FILE+'.');const _0x20324f=fileTreeHash(_0x1151d9);if(_0x20324f!==_0x353f3b[_0x4ecad4(0x9e)][_0x4ecad4(0x8f)]())throw CliErrors['validation'](_0x4ecad4(0x9b));return{'schemaVersion':Number['isSafeInteger'](_0x353f3b[_0x4ecad4(0x93)])?_0x353f3b[_0x4ecad4(0x93)]:0x2,'ossPath':_0x445831,'treeSha256':_0x20324f,'zipSha256':_0x353f3b[_0x4ecad4(0x89)][_0x4ecad4(0x8f)](),'zipSize':_0x353f3b[_0x4ecad4(0xa2)],'files':_0x1151d9};}function extractAndVerifyPackage(_0x523f63,_0x1dfd44){const _0x59a627=a150_0x2dc7,_0x2bf157=normalizePackageManifest(_0x523f63,{'requireOssPath':![]});if(!_0x2bf157)throw CliErrors[_0x59a627(0x95)](_0x59a627(0x98));if(_0x1dfd44[_0x59a627(0x94)]!==_0x2bf157[_0x59a627(0xa2)])throw CliErrors[_0x59a627(0x95)]('Runtime\x20Skill\x20package\x20size\x20mismatch.');const _0x111b58=bufferSha256(_0x1dfd44);if(_0x111b58!==_0x2bf157[_0x59a627(0x89)])throw CliErrors['validation'](_0x59a627(0x7d));return extractAndVerifyPackageFiles(_0x2bf157,_0x1dfd44);}function extractAndVerifyPackageFiles(_0xe95031,_0x1c7fa1){const _0xed35f8=a150_0x2dc7,_0x4230f4=parseZipPackage(_0x1c7fa1);if(_0x4230f4[_0xed35f8(0x94)]!==_0xe95031['files'][_0xed35f8(0x94)])throw CliErrors[_0xed35f8(0x95)](_0xed35f8(0x91));const _0x2f37aa=new Map();for(const _0x320c97 of _0x4230f4){if(_0x2f37aa[_0xed35f8(0x7e)](_0x320c97[_0xed35f8(0xa1)]))throw CliErrors[_0xed35f8(0x95)](_0xed35f8(0xa3)+_0x320c97['path']);_0x2f37aa[_0xed35f8(0x79)](_0x320c97[_0xed35f8(0xa1)],_0x320c97);}const _0x2264fc=[];for(const _0x11cf7c of _0xe95031[_0xed35f8(0x9d)]){const _0x3ca81f=_0x2f37aa[_0xed35f8(0x7c)](_0x11cf7c[_0xed35f8(0xa1)]);if(!_0x3ca81f)throw CliErrors[_0xed35f8(0x95)](_0xed35f8(0x82)+_0x11cf7c[_0xed35f8(0xa1)]);if(_0x3ca81f[_0xed35f8(0x92)][_0xed35f8(0x94)]!==_0x11cf7c[_0xed35f8(0x80)])throw CliErrors['validation'](_0xed35f8(0x8b)+_0x11cf7c[_0xed35f8(0xa1)]);const _0x486c96=bufferSha256(_0x3ca81f[_0xed35f8(0x92)]);if(_0x486c96!==_0x11cf7c[_0xed35f8(0xa0)])throw CliErrors[_0xed35f8(0x95)]('Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20'+_0x11cf7c[_0xed35f8(0xa1)]);_0x2264fc[_0xed35f8(0x8a)]({'path':_0x11cf7c[_0xed35f8(0xa1)],'bytes':_0x3ca81f['bytes']});}return normalizeLocalFiles(_0x2264fc);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3c234b,_0x1b99a5){var _0x29029e=a151_0x839b,_0x5b4c94=_0x3c234b();while(!![]){try{var _0x4a9921=parseInt(_0x29029e(0x1b3))/0x1*(parseInt(_0x29029e(0x1b6))/0x2)+parseInt(_0x29029e(0x1b0))/0x3+parseInt(_0x29029e(0x1b4))/0x4*(-parseInt(_0x29029e(0x1b8))/0x5)+parseInt(_0x29029e(0x1b7))/0x6*(parseInt(_0x29029e(0x1ba))/0x7)+parseInt(_0x29029e(0x1b1))/0x8+parseInt(_0x29029e(0x1b5))/0x9*(-parseInt(_0x29029e(0x1b2))/0xa)+-parseInt(_0x29029e(0x1b9))/0xb*(parseInt(_0x29029e(0x1af))/0xc);if(_0x4a9921===_0x1b99a5)break;else _0x5b4c94['push'](_0x5b4c94['shift']());}catch(_0x4f6180){_0x5b4c94['push'](_0x5b4c94['shift']());}}}(a151_0x4023,0x1b38c));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';function a151_0x839b(_0x20689d,_0x5e8c2e){_0x20689d=_0x20689d-0x1af;var _0x402376=a151_0x4023();var _0x839be0=_0x402376[_0x20689d];return _0x839be0;}export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';function a151_0x4023(){var _0x235ecf=['1057926PxPhDw','5zLrOoh','11skndIP','7RCXmCI','2878068kmVffs','207183VREpBI','1034912Gtzruc','3370xiuXZK','3vicGjV','389900ArebRz','3582GWjbyp','138796UEWZOR'];a151_0x4023=function(){return _0x235ecf;};return a151_0x4023();}export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
|