@lovrabet/lovrabet-cli 2.1.18 → 2.1.19-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/README.md +7 -0
  2. package/lib/cli.js +1 -1
  3. package/lib/commands/api-doc/index.js +1 -1
  4. package/lib/commands/app/cache.js +1 -1
  5. package/lib/commands/app/definitions.js +1 -1
  6. package/lib/commands/app/eligibility.js +1 -1
  7. package/lib/commands/app/mock-loader.js +1 -1
  8. package/lib/commands/app/remote-source.js +1 -1
  9. package/lib/commands/app/shared.js +1 -1
  10. package/lib/commands/app-config/get.js +1 -1
  11. package/lib/commands/app-config/index.js +1 -1
  12. package/lib/commands/artifact/index.js +1 -1
  13. package/lib/commands/auth/device.js +1 -1
  14. package/lib/commands/auth/index.js +1 -1
  15. package/lib/commands/auth/prompt.js +1 -1
  16. package/lib/commands/bff/detail.js +1 -1
  17. package/lib/commands/bff/exec.js +1 -1
  18. package/lib/commands/bff/index.js +1 -1
  19. package/lib/commands/cli-skill/index.js +1 -1
  20. package/lib/commands/common/config-policy.js +1 -1
  21. package/lib/commands/common/constraints.js +1 -1
  22. package/lib/commands/common/flags.js +1 -1
  23. package/lib/commands/common/local-file.js +1 -1
  24. package/lib/commands/config/definitions.js +1 -1
  25. package/lib/commands/config/shared.js +1 -1
  26. package/lib/commands/data/index.js +1 -1
  27. package/lib/commands/dataset/detail.js +1 -1
  28. package/lib/commands/dataset/index.js +1 -1
  29. package/lib/commands/dataset/list.js +1 -1
  30. package/lib/commands/dataset/sdk-doc.js +1 -1
  31. package/lib/commands/doctor.js +1 -1
  32. package/lib/commands/file/index.js +1 -1
  33. package/lib/commands/init.js +1 -1
  34. package/lib/commands/kb/index.js +1 -1
  35. package/lib/commands/logs/index.js +1 -1
  36. package/lib/commands/ocr/index.js +1 -1
  37. package/lib/commands/personal-bff/index.js +1 -1
  38. package/lib/commands/registry.js +1 -1
  39. package/lib/commands/schedule/index.js +1 -1
  40. package/lib/commands/schema.js +1 -1
  41. package/lib/commands/service/dynamic.js +1 -1
  42. package/lib/commands/service/function-name-adapter.js +1 -1
  43. package/lib/commands/service/index.js +1 -1
  44. package/lib/commands/service/registry.js +1 -1
  45. package/lib/commands/skill/commands/create.js +1 -1
  46. package/lib/commands/skill/commands/install.js +1 -1
  47. package/lib/commands/skill/commands/list.js +1 -1
  48. package/lib/commands/skill/commands/push.js +1 -1
  49. package/lib/commands/skill/commands/validate.js +1 -1
  50. package/lib/commands/skill/flags.d.ts +1 -0
  51. package/lib/commands/skill/flags.js +1 -1
  52. package/lib/commands/skill/index.js +1 -1
  53. package/lib/commands/skill/manifest-helpers.js +1 -1
  54. package/lib/commands/skill/push-execute.js +1 -1
  55. package/lib/commands/skill/push-flow-helpers.js +1 -1
  56. package/lib/commands/skill/push-retarget.js +1 -1
  57. package/lib/commands/skill/scopes.js +1 -1
  58. package/lib/commands/skill/summary.js +1 -1
  59. package/lib/commands/skill/templates.js +1 -1
  60. package/lib/commands/skill/validate.js +1 -1
  61. package/lib/commands/sql/detail.js +1 -1
  62. package/lib/commands/sql/exec.js +1 -1
  63. package/lib/commands/sql/index.js +1 -1
  64. package/lib/commands/update.js +1 -1
  65. package/lib/commands/workspace/index.js +1 -1
  66. package/lib/config/schema.js +1 -1
  67. package/lib/constant/app.js +1 -1
  68. package/lib/constant/auth-mode.js +1 -1
  69. package/lib/constant/cli.js +1 -1
  70. package/lib/constant/defaults.js +1 -1
  71. package/lib/constant/distribution.js +1 -1
  72. package/lib/constant/domain.js +1 -1
  73. package/lib/constant/env.js +1 -1
  74. package/lib/constant/output.js +1 -1
  75. package/lib/constant/product.js +1 -1
  76. package/lib/constant/risk.js +1 -1
  77. package/lib/constant/url.js +1 -1
  78. package/lib/context.js +1 -1
  79. package/lib/core/api-client.js +1 -1
  80. package/lib/core/db-resolver.js +1 -1
  81. package/lib/core/sdk-client.js +1 -1
  82. package/lib/errors.js +1 -1
  83. package/lib/framework/build-all-flags.js +1 -1
  84. package/lib/framework/dryrun.js +1 -1
  85. package/lib/framework/flags.js +1 -1
  86. package/lib/framework/help.js +1 -1
  87. package/lib/framework/index.js +1 -1
  88. package/lib/framework/output.js +1 -1
  89. package/lib/framework/preparse.js +1 -1
  90. package/lib/framework/rate-limit.js +1 -1
  91. package/lib/framework/response.js +1 -1
  92. package/lib/framework/runner-confirmation.js +1 -1
  93. package/lib/framework/runner-error.js +1 -1
  94. package/lib/framework/runner.js +1 -1
  95. package/lib/framework/schema-export.js +1 -1
  96. package/lib/framework/service-order.js +1 -1
  97. package/lib/framework/types.js +1 -1
  98. package/lib/generated/build-info.d.ts +4 -4
  99. package/lib/generated/build-info.js +1 -1
  100. package/lib/help.js +1 -1
  101. package/lib/runtime/event.js +1 -1
  102. package/lib/runtime/index.js +1 -1
  103. package/lib/runtime/queue.js +1 -1
  104. package/lib/runtime/resolve.js +1 -1
  105. package/lib/skills/npx-skills-add.js +1 -1
  106. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  107. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  108. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  109. package/lib/skills/runtime-skill-sync/install-target.d.ts +9 -0
  110. package/lib/skills/runtime-skill-sync/install-target.js +1 -0
  111. package/lib/skills/runtime-skill-sync/links.d.ts +5 -4
  112. package/lib/skills/runtime-skill-sync/links.js +1 -1
  113. package/lib/skills/runtime-skill-sync/list-local.d.ts +2 -2
  114. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  115. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  116. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  117. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  118. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  119. package/lib/skills/runtime-skill-sync/push.js +1 -1
  120. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  121. package/lib/skills/runtime-skill-sync/types.d.ts +17 -0
  122. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  123. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  124. package/lib/skills/runtime-skill-sync.d.ts +2 -1
  125. package/lib/skills/runtime-skill-sync.js +1 -1
  126. package/lib/utils/apply-jq-filter.js +1 -1
  127. package/lib/utils/logger.js +1 -1
  128. package/lib/utils/lossless-json.js +1 -1
  129. package/lib/utils/params.js +1 -1
  130. package/lib/utils/platform.js +1 -1
  131. package/lib/utils/update-notice.js +1 -1
  132. package/lib/utils/version.js +1 -1
  133. package/lib/utils/write-cli-side-channel.js +1 -1
  134. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ const a106_0x9cf320=a106_0x3cae;(function(_0x5027c9,_0x42d481){const _0xc52897=a106_0x3cae,_0xac3f8e=_0x5027c9();while(!![]){try{const _0x5300a0=parseInt(_0xc52897(0x8f))/0x1+parseInt(_0xc52897(0x82))/0x2+parseInt(_0xc52897(0x8d))/0x3+-parseInt(_0xc52897(0x81))/0x4*(parseInt(_0xc52897(0x8b))/0x5)+parseInt(_0xc52897(0x88))/0x6*(-parseInt(_0xc52897(0x92))/0x7)+-parseInt(_0xc52897(0x85))/0x8*(-parseInt(_0xc52897(0x8a))/0x9)+-parseInt(_0xc52897(0x90))/0xa*(parseInt(_0xc52897(0x86))/0xb);if(_0x5300a0===_0x42d481)break;else _0xac3f8e['push'](_0xac3f8e['shift']());}catch(_0x294bcf){_0xac3f8e['push'](_0xac3f8e['shift']());}}}(a106_0x25b0,0x54349));import{resolve}from'node:path';function a106_0x25b0(){const _0x9b4a12=['28378sNzRRQ','73252vGkmRL','907206nuNZaC','global','freeze','824cuBlfL','66DZxJvU','project','114DNYJuu','skills','43110yzHgbA','125raDGzT','.agents','174003hcDiaT','cwd','674546CPqcio','1332940yTBBye','managedRoot'];a106_0x25b0=function(){return _0x9b4a12;};return a106_0x25b0();}function a106_0x3cae(_0xa97f0f,_0x19d1ca){_0xa97f0f=_0xa97f0f-0x81;const _0x25b0f6=a106_0x25b0();let _0x3cae3a=_0x25b0f6[_0xa97f0f];return _0x3cae3a;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x52e625,_0x3addb0=a106_0x9cf320(0x83),_0x5b9fd6={}){const _0x2eaf3a=a106_0x9cf320,_0x53b26e=resolveSkillSyncPaths(_0x5b9fd6),_0x2ee502=safePathSegment(_0x52e625,'appCode'),_0x34e9c3=_0x3addb0===_0x2eaf3a(0x87)?[resolve(_0x5b9fd6['cwd']??process[_0x2eaf3a(0x8e)](),_0x2eaf3a(0x8c),_0x2eaf3a(0x89))]:runtimeAgentSkillRoots(_0x53b26e);return Object['freeze']({'scope':_0x3addb0,'appCode':_0x2ee502,'skillRoots':Object[_0x2eaf3a(0x84)](_0x34e9c3),'managedRoot':_0x53b26e[_0x2eaf3a(0x91)]});}
@@ -1,8 +1,8 @@
1
- import type { GlobalRuntimeSkillLinkResult, LinkRuntimeSkillResult, MaterializedRuntimeSkill, PruneRuntimeSkillResult, RuntimeSkillScope, SkillSyncPathsOptions } from "./types.js";
1
+ import type { GlobalRuntimeSkillLinkResult, LinkRuntimeSkillResult, MaterializedRuntimeSkill, PruneRuntimeSkillResult, RuntimeSkillInstallTarget, RuntimeSkillScope, SkillSyncPathsOptions } from "./types.js";
2
2
  /** Links the effective runtime Skill version into each agent Skill root. */
3
- export declare function linkEffectiveRuntimeSkills(materialized: MaterializedRuntimeSkill[], appCode: string, options?: SkillSyncPathsOptions): LinkRuntimeSkillResult[];
4
- /** Removes managed app Skill links that no longer point to active Skill codes. */
5
- export declare function pruneStaleRuntimeSkillLinks(appCode: string, activeSkillCodes: Iterable<string>, options?: SkillSyncPathsOptions, pruneSkillCodes?: Iterable<string>): PruneRuntimeSkillResult[];
3
+ export declare function linkEffectiveRuntimeSkills(materialized: MaterializedRuntimeSkill[], target: RuntimeSkillInstallTarget): LinkRuntimeSkillResult[];
4
+ /** Removes managed target Skill links that no longer point to active Skill codes. */
5
+ export declare function pruneStaleRuntimeSkillLinks(target: RuntimeSkillInstallTarget, activeSkillCodes: Iterable<string>, pruneSkillCodes?: Iterable<string>): PruneRuntimeSkillResult[];
6
6
  /** Removes stale managed cache directories whose metadata still matches the app. */
7
7
  export declare function pruneStaleRuntimeSkillCache(input: {
8
8
  env: "production" | "development" | "daily";
@@ -11,6 +11,7 @@ export declare function pruneStaleRuntimeSkillCache(input: {
11
11
  activeSkillCodes: Iterable<string>;
12
12
  pruneSkillCodes?: Iterable<string>;
13
13
  scopes?: Array<Extract<RuntimeSkillScope, "personal" | "company">>;
14
+ protectedLinkRoots?: readonly string[];
14
15
  }, options?: SkillSyncPathsOptions): PruneRuntimeSkillResult[];
15
16
  /** Copies builtin Skills into the global agent Skill root as real directories. */
16
17
  export declare function linkGlobalRuntimeSkills(materialized: MaterializedRuntimeSkill[], options?: SkillSyncPathsOptions): GlobalRuntimeSkillLinkResult[];
@@ -1 +1 @@
1
- (function(_0x3c5245,_0x222e92){const _0x594bf9=a106_0x31b2,_0x496381=_0x3c5245();while(!![]){try{const _0x12d90c=-parseInt(_0x594bf9(0xba))/0x1*(parseInt(_0x594bf9(0xab))/0x2)+parseInt(_0x594bf9(0xd1))/0x3+-parseInt(_0x594bf9(0xd2))/0x4*(parseInt(_0x594bf9(0xcf))/0x5)+-parseInt(_0x594bf9(0xae))/0x6+parseInt(_0x594bf9(0xb4))/0x7+-parseInt(_0x594bf9(0xc1))/0x8+parseInt(_0x594bf9(0xac))/0x9;if(_0x12d90c===_0x222e92)break;else _0x496381['push'](_0x496381['shift']());}catch(_0x31af23){_0x496381['push'](_0x496381['shift']());}}}(a106_0x3b5e,0xb1dac));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a106_0x486737 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';function a106_0x31b2(_0x476948,_0x3451d2){_0x476948=_0x476948-0xab;const _0x3b5e0f=a106_0x3b5e();let _0x31b202=_0x3b5e0f[_0x476948];return _0x31b202;}import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a106_0x486737;export function linkEffectiveRuntimeSkills(_0x2248db,_0x3dd3aa,_0x36281d={}){const _0x1383c9=a106_0x31b2,_0x25b86e=new Map();for(const _0x233d0a of _0x2248db){const _0x5f376f=_0x233d0a[_0x1383c9(0xd6)]['skillCode'];if(!_0x5f376f)continue;const _0x1b7001=_0x25b86e[_0x1383c9(0xb9)](_0x5f376f);(!_0x1b7001||_0x233d0a['scope']===_0x1383c9(0xb8))&&_0x25b86e['set'](_0x5f376f,_0x233d0a);}const _0x2b605a=[],_0xf05429=resolveSkillSyncPaths(_0x36281d);for(const _0x30a925 of _0x25b86e[_0x1383c9(0xbb)]()){const _0x161486=requireSkillCode(_0x30a925['skill']),_0x28ffbb=_0x3dd3aa+'--'+_0x161486;for(const _0x151c58 of runtimeAgentSkillRoots(_0xf05429)){_0x2b605a[_0x1383c9(0xbd)](ensureManagedSymlink(resolve(_0x151c58,_0x28ffbb),_0x30a925[_0x1383c9(0xb7)],_0xf05429[_0x1383c9(0xc8)]));}}return _0x2b605a;}export function pruneStaleRuntimeSkillLinks(_0x501bb5,_0x26fd4a,_0x396e06={},_0x25ec9b){const _0x2affb9=a106_0x31b2,_0x2e7591=resolveSkillSyncPaths(_0x396e06),_0x271923=new Set([..._0x26fd4a][_0x2affb9(0xc4)](_0xdd2d37=>_0xdd2d37[_0x2affb9(0xbc)]())[_0x2affb9(0xcc)](Boolean)),_0x527d70=_0x25ec9b?new Set([..._0x25ec9b]['map'](_0x34eb5e=>_0x34eb5e[_0x2affb9(0xbc)]())['filter'](Boolean)):undefined,_0x6c4e66=[];for(const _0x235601 of runtimeAgentSkillRoots(_0x2e7591)){for(const _0xaca952 of managedAppSkillLinkPaths(_0x235601,_0x501bb5)){const _0x2da1ac=basename(_0xaca952)['slice']((_0x501bb5+'--')['length']);if(_0x527d70&&!_0x527d70[_0x2affb9(0xcd)](_0x2da1ac))continue;if(_0x271923['has'](_0x2da1ac))continue;_0x6c4e66[_0x2affb9(0xbd)](removeManagedSkillLink(_0xaca952,_0x2e7591[_0x2affb9(0xc8)]));}}return _0x6c4e66;}export function pruneStaleRuntimeSkillCache(_0x489ef1,_0x2f375b={}){const _0x4edea8=a106_0x31b2,_0x398ca4=new Set([..._0x489ef1['activeSkillCodes']][_0x4edea8(0xc4)](_0x5b8577=>_0x5b8577[_0x4edea8(0xbc)]())['filter'](Boolean)),_0x4a741b=_0x489ef1[_0x4edea8(0xb3)]?new Set([..._0x489ef1[_0x4edea8(0xb3)]]['map'](_0x26e22d=>_0x26e22d[_0x4edea8(0xbc)]())[_0x4edea8(0xcc)](Boolean)):undefined,_0x57dbef=_0x489ef1[_0x4edea8(0xb6)]??[_0x4edea8(0xb8),'company'],_0x2dbe49=resolve(getRuntimeSkillCacheRoot(_0x489ef1[_0x4edea8(0xb1)],_0x489ef1[_0x4edea8(0xd4)],_0x2f375b),safePathSegment(_0x489ef1[_0x4edea8(0xad)],_0x4edea8(0xad))),_0x18d334=[];for(const _0x4df708 of _0x57dbef){const _0xd789b7=resolve(_0x2dbe49,_0x4df708);if(!existsSync(_0xd789b7))continue;for(const _0x58273e of readdirSync(_0xd789b7,{'withFileTypes':!![]})){if(!_0x58273e[_0x4edea8(0xc6)]())continue;const _0x3d0392=_0x58273e[_0x4edea8(0xca)];if(_0x4a741b&&!_0x4a741b[_0x4edea8(0xcd)](_0x3d0392))continue;if(_0x398ca4['has'](_0x3d0392))continue;const _0x141ea5=resolve(_0xd789b7,_0x3d0392),_0x17349a=readMetadataIfPresent(resolve(_0x141ea5,METADATA_FILE));if(_0x17349a?.[_0x4edea8(0xad)]!==_0x489ef1[_0x4edea8(0xad)]||_0x17349a[_0x4edea8(0xc7)]!==_0x4df708||_0x17349a[_0x4edea8(0xd3)]!==_0x3d0392){_0x18d334['push']({'path':_0x141ea5,'action':'skipped','reason':'metadata-mismatch'});continue;}removeSync(_0x141ea5),_0x18d334[_0x4edea8(0xbd)]({'path':_0x141ea5,'action':_0x4edea8(0xd0)});}}return _0x18d334;}function a106_0x3b5e(){const _0x8828f3=['Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','name','external-symlink','filter','has','skipped','135uEsmuf','removed','2814423CDFFYE','20108RKCtuO','skillCode','accessKey','builtin','skill','22ClCwhw','14834592FHiLZP','appCode','3930420ziCpdp','agentsSkillsDir','startsWith','env','isSymbolicLink','pruneSkillCodes','9298394CobgCh','created','scopes','dir','personal','get','104329atxgFy','values','trim','push','updated','unchanged','contentHash','9982888itndAZ','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','validation','map','not-managed-symlink','isDirectory','scope','managedRoot'];a106_0x3b5e=function(){return _0x8828f3;};return a106_0x3b5e();}export function linkGlobalRuntimeSkills(_0x5096df,_0xdd1120={}){const _0xa5ddc5=a106_0x31b2,_0x30ddd9=resolveSkillSyncPaths(_0xdd1120),_0x1a1c86=[];for(const _0x234f96 of _0x5096df){if(_0x234f96[_0xa5ddc5(0xc7)]!==_0xa5ddc5(0xd5))throw CliErrors['validation']('Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20'+_0x234f96[_0xa5ddc5(0xc7)]);const _0x1b0c14=requireSkillCode(_0x234f96['skill']),_0x4569ff=copyManagedSkillDirectory(_0x234f96[_0xa5ddc5(0xb7)],resolve(_0x30ddd9[_0xa5ddc5(0xaf)],_0x1b0c14));_0x1a1c86[_0xa5ddc5(0xbd)]({..._0x4569ff,'contentHash':_0x234f96[_0xa5ddc5(0xc0)]});}return _0x1a1c86;}function ensureManagedSymlink(_0x4c5bcb,_0x28272d,_0x271efa){const _0x1c9ac4=a106_0x31b2;mkdirSync(dirname(_0x4c5bcb),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x4c5bcb)||isDanglingSymlink(_0x4c5bcb)){const _0x5e4d0f=lstatSync(_0x4c5bcb);if(!_0x5e4d0f[_0x1c9ac4(0xb2)]())throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x4c5bcb);const _0x5aecdb=resolveSymlinkTarget(_0x4c5bcb);if(!isPathInside(realOrResolved(_0x5aecdb),realOrResolved(_0x271efa)))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0x4c5bcb);if(realOrResolved(_0x5aecdb)===realOrResolved(_0x28272d))return{'path':_0x4c5bcb,'target':_0x28272d,'action':_0x1c9ac4(0xbf)};return unlinkSync(_0x4c5bcb),symlinkSync(_0x28272d,_0x4c5bcb,'dir'),{'path':_0x4c5bcb,'target':_0x28272d,'action':'updated'};}return symlinkSync(_0x28272d,_0x4c5bcb,'dir'),{'path':_0x4c5bcb,'target':_0x28272d,'action':_0x1c9ac4(0xb5)};}function managedAppSkillLinkPaths(_0x20da42,_0xb6881e){const _0x51ee90=a106_0x31b2;if(!existsSync(_0x20da42))return[];const _0x44eb27=_0xb6881e+'--';return readdirSync(_0x20da42,{'withFileTypes':!![]})[_0x51ee90(0xcc)](_0x2e78ce=>_0x2e78ce['name'][_0x51ee90(0xb0)](_0x44eb27))[_0x51ee90(0xc4)](_0x291612=>resolve(_0x20da42,_0x291612[_0x51ee90(0xca)]));}function removeManagedSkillLink(_0xbbadc8,_0x3f3b2a){const _0x27345e=a106_0x31b2,_0x545b79=lstatIfPresent(_0xbbadc8);if(!_0x545b79?.['isSymbolicLink']())return{'path':_0xbbadc8,'action':_0x27345e(0xce),'reason':_0x27345e(0xc5)};const _0x30633e=resolveSymlinkTarget(_0xbbadc8);if(!isPathInside(realOrResolved(_0x30633e),realOrResolved(_0x3f3b2a)))return{'path':_0xbbadc8,'action':_0x27345e(0xce),'reason':_0x27345e(0xcb)};return unlinkSync(_0xbbadc8),{'path':_0xbbadc8,'action':_0x27345e(0xd0)};}export function copyManagedSkillDirectory(_0x56a4e3,_0x32ab0d){const _0x2113ec=a106_0x31b2,_0x36b11c=resolve(_0x32ab0d,METADATA_FILE),_0xb46514=existsSync(_0x32ab0d);if(_0xb46514){const _0x41a9a4=lstatSync(_0x32ab0d);if(_0x41a9a4['isSymbolicLink']())throw CliErrors[_0x2113ec(0xc3)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x32ab0d);if(!_0x41a9a4[_0x2113ec(0xc6)]())throw CliErrors[_0x2113ec(0xc3)](_0x2113ec(0xc2)+_0x32ab0d);const _0xa4d783=readMetadataIfPresent(_0x36b11c);if(_0xa4d783?.[_0x2113ec(0xc7)]!==_0x2113ec(0xd5))throw CliErrors[_0x2113ec(0xc3)](_0x2113ec(0xc9)+_0x32ab0d);}ensureDirSync(dirname(_0x32ab0d));const _0x3c57e7=_0xb46514?readMetadataIfPresent(_0x36b11c)?.[_0x2113ec(0xc0)]:undefined,_0x290bd7=readMetadataIfPresent(resolve(_0x56a4e3,METADATA_FILE))?.[_0x2113ec(0xc0)];return _0xb46514&&removeSync(_0x32ab0d),copySkillDirectory(_0x56a4e3,_0x32ab0d),{'path':_0x32ab0d,'target':_0x56a4e3,'action':!_0xb46514?_0x2113ec(0xb5):_0x3c57e7===_0x290bd7?_0x2113ec(0xbf):_0x2113ec(0xbe)};}function copySkillDirectory(_0x2c9c4e,_0x580773){copySync(_0x2c9c4e,_0x580773,{'dereference':![],'overwrite':!![],'filter'(_0x45976e){const _0x17f52a=a106_0x31b2;if(lstatSync(_0x45976e)['isSymbolicLink']())throw CliErrors[_0x17f52a(0xc3)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0x45976e);return!![];}});}
1
+ const a107_0x4eaa7b=a107_0x1f17;(function(_0x1089f8,_0x3937a0){const _0x41f8e0=a107_0x1f17,_0x482144=_0x1089f8();while(!![]){try{const _0x3fdd08=parseInt(_0x41f8e0(0x138))/0x1*(parseInt(_0x41f8e0(0x130))/0x2)+parseInt(_0x41f8e0(0x148))/0x3+-parseInt(_0x41f8e0(0x13a))/0x4+parseInt(_0x41f8e0(0x13e))/0x5*(parseInt(_0x41f8e0(0x166))/0x6)+parseInt(_0x41f8e0(0x15c))/0x7+parseInt(_0x41f8e0(0x13b))/0x8*(parseInt(_0x41f8e0(0x133))/0x9)+-parseInt(_0x41f8e0(0x150))/0xa;if(_0x3fdd08===_0x3937a0)break;else _0x482144['push'](_0x482144['shift']());}catch(_0x1816ae){_0x482144['push'](_0x482144['shift']());}}}(a107_0x4a3b,0x46f38));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a107_0x4eb13d from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';function a107_0x1f17(_0xf2c26,_0x1491f5){_0xf2c26=_0xf2c26-0x130;const _0x4a3bef=a107_0x4a3b();let _0x1f1781=_0x4a3bef[_0xf2c26];return _0x1f1781;}import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a107_0x4eb13d,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a107_0x4eaa7b(0x155),a107_0x4eaa7b(0x164)]);export function linkEffectiveRuntimeSkills(_0x369df4,_0x74b129){const _0xc8c654=a107_0x4eaa7b,_0x3e2f3f=new Map();for(const _0x1ca593 of _0x369df4){const _0x55e951=_0x1ca593[_0xc8c654(0x160)][_0xc8c654(0x157)];if(!_0x55e951)continue;const _0x526d62=_0x3e2f3f[_0xc8c654(0x143)](_0x55e951);(!_0x526d62||_0x1ca593[_0xc8c654(0x140)]===_0xc8c654(0x145))&&_0x3e2f3f['set'](_0x55e951,_0x1ca593);}const _0x5a050d=[];for(const _0x4550a1 of _0x3e2f3f[_0xc8c654(0x159)]()){const _0x59eb42=requireSkillCode(_0x4550a1[_0xc8c654(0x160)]),_0x888397=readMetadataIfPresent(_0x4550a1[_0xc8c654(0x14f)]);if(_0x888397?.[_0xc8c654(0x14a)]!==_0x74b129['appCode']||_0x888397['skillCode']!==_0x59eb42)throw CliErrors[_0xc8c654(0x158)](_0xc8c654(0x14d)+_0x74b129['appCode']+':\x20'+_0x4550a1[_0xc8c654(0x14f)]);const _0x3279e2=runtimeSkillLinkName(_0x74b129,_0x59eb42);for(const _0x1aa6ce of _0x74b129['skillRoots']){_0x5a050d['push'](ensureManagedSymlink(resolve(_0x1aa6ce,_0x3279e2),_0x4550a1['dir'],_0x74b129,_0x59eb42));}}return _0x5a050d;}export function pruneStaleRuntimeSkillLinks(_0x3ccd4f,_0x4ebf79,_0x104443){const _0x203bf8=a107_0x4eaa7b,_0x3b71a4=new Set([..._0x4ebf79][_0x203bf8(0x13d)](_0x3e523b=>_0x3e523b[_0x203bf8(0x15f)]())[_0x203bf8(0x132)](Boolean)),_0x5e1c28=_0x104443?new Set([..._0x104443][_0x203bf8(0x13d)](_0x1b496d=>_0x1b496d[_0x203bf8(0x15f)]())[_0x203bf8(0x132)](Boolean)):undefined,_0x3cdcfb=[];for(const _0x5cc07e of _0x3ccd4f[_0x203bf8(0x142)]){for(const _0x4fb024 of managedTargetSkillLinkPaths(_0x5cc07e,_0x3ccd4f)){const _0x347819=runtimeSkillCodeFromLink(_0x3ccd4f,_0x4fb024);if(_0x5e1c28&&!_0x5e1c28['has'](_0x347819))continue;if(_0x3b71a4[_0x203bf8(0x139)](_0x347819))continue;_0x3cdcfb[_0x203bf8(0x15e)](removeManagedSkillLink(_0x4fb024,_0x3ccd4f,_0x347819));}}return _0x3cdcfb;}function a107_0x4a3b(){const _0x13d0fa=['accessKey','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','metadataPath','6023370UPWXGp','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','skipped','unchanged','runtime-observe','project','skillCode','validation','values','not-managed-symlink','name','2736335IjwMgR','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','push','trim','skill','startsWith','managedRoot','builtin','secret-retriever','external-symlink','255738GeOKQc','2KelGnJ','dir','filter','18UcObyV','length','removed','isDirectory','protectedLinkRoots','444707ItBwDS','has','854660rnkvqd','583096cnKzRU','updated','map','5OoxJaE','contentHash','scope','created','skillRoots','get','slice','personal','metadata-mismatch','agentsSkillsDir','247827mdzknX','isSymbolicLink','appCode'];a107_0x4a3b=function(){return _0x13d0fa;};return a107_0x4a3b();}export function pruneStaleRuntimeSkillCache(_0x561d0f,_0x4c32d6={}){const _0x44cce1=a107_0x4eaa7b,_0x3b9bc4=new Set([..._0x561d0f['activeSkillCodes']][_0x44cce1(0x13d)](_0x19bcd9=>_0x19bcd9['trim']())[_0x44cce1(0x132)](Boolean)),_0x266c84=_0x561d0f['pruneSkillCodes']?new Set([..._0x561d0f['pruneSkillCodes']]['map'](_0x2bddc2=>_0x2bddc2['trim']())[_0x44cce1(0x132)](Boolean)):undefined,_0xa9851=_0x561d0f['scopes']??[_0x44cce1(0x145),'company'],_0x29ce9f=resolve(getRuntimeSkillCacheRoot(_0x561d0f['env'],_0x561d0f[_0x44cce1(0x14b)],_0x4c32d6),safePathSegment(_0x561d0f[_0x44cce1(0x14a)],_0x44cce1(0x14a))),_0x1403f9=[];for(const _0x755ccf of _0xa9851){const _0x2f67f5=resolve(_0x29ce9f,_0x755ccf);if(!existsSync(_0x2f67f5))continue;for(const _0x2a0526 of readdirSync(_0x2f67f5,{'withFileTypes':!![]})){if(!_0x2a0526[_0x44cce1(0x136)]())continue;const _0x50b937=_0x2a0526['name'];if(_0x266c84&&!_0x266c84[_0x44cce1(0x139)](_0x50b937))continue;if(_0x3b9bc4['has'](_0x50b937))continue;const _0x3fdf56=resolve(_0x2f67f5,_0x50b937),_0x181f75=readMetadataIfPresent(resolve(_0x3fdf56,METADATA_FILE));if(_0x181f75?.[_0x44cce1(0x14a)]!==_0x561d0f[_0x44cce1(0x14a)]||_0x181f75[_0x44cce1(0x140)]!==_0x755ccf||_0x181f75['skillCode']!==_0x50b937){_0x1403f9[_0x44cce1(0x15e)]({'path':_0x3fdf56,'action':'skipped','reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x3fdf56,_0x561d0f[_0x44cce1(0x137)]??[])){_0x1403f9[_0x44cce1(0x15e)]({'path':_0x3fdf56,'action':_0x44cce1(0x153),'reason':'linked-from-protected-root'});continue;}removeSync(_0x3fdf56),_0x1403f9[_0x44cce1(0x15e)]({'path':_0x3fdf56,'action':_0x44cce1(0x135)});}}return _0x1403f9;}export function linkGlobalRuntimeSkills(_0x40ffc5,_0x3667ca={}){const _0xfeed8c=a107_0x4eaa7b,_0x12d1c5=resolveSkillSyncPaths(_0x3667ca),_0xec0d83=[];for(const _0x444511 of _0x40ffc5){if(_0x444511['scope']!==_0xfeed8c(0x163))throw CliErrors[_0xfeed8c(0x158)](_0xfeed8c(0x14e)+_0x444511[_0xfeed8c(0x140)]);const _0x472f1f=requireSkillCode(_0x444511['skill']),_0x509a67=copyManagedSkillDirectory(_0x444511['dir'],resolve(_0x12d1c5[_0xfeed8c(0x147)],_0x472f1f));_0xec0d83[_0xfeed8c(0x15e)]({..._0x509a67,'contentHash':_0x444511[_0xfeed8c(0x13f)]});}return _0xec0d83;}function ensureManagedSymlink(_0x11c72c,_0x382d82,_0xff1c3,_0xaaecee){const _0x41e268=a107_0x4eaa7b;mkdirSync(dirname(_0x11c72c),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x11c72c)||isDanglingSymlink(_0x11c72c)){const _0x66384f=lstatSync(_0x11c72c);if(!_0x66384f[_0x41e268(0x149)]())throw CliErrors[_0x41e268(0x158)](_0x41e268(0x151)+_0x11c72c);const _0x183eb1=resolveSymlinkTarget(_0x11c72c);if(!isPathInside(realOrResolved(_0x183eb1),realOrResolved(_0xff1c3['managedRoot'])))throw CliErrors[_0x41e268(0x158)](_0x41e268(0x152)+_0x11c72c);if(realOrResolved(_0x183eb1)===realOrResolved(_0x382d82))return{'path':_0x11c72c,'target':_0x382d82,'action':_0x41e268(0x154)};const _0x5799df=readMetadataIfPresent(resolve(_0x183eb1,METADATA_FILE));if(_0xff1c3['scope']===_0x41e268(0x156)&&(_0x5799df?.[_0x41e268(0x14a)]!==_0xff1c3[_0x41e268(0x14a)]||_0x5799df[_0x41e268(0x157)]!==_0xaaecee))throw CliErrors[_0x41e268(0x158)](_0x41e268(0x15d)+_0x11c72c);return unlinkSync(_0x11c72c),symlinkSync(_0x382d82,_0x11c72c,'dir'),{'path':_0x11c72c,'target':_0x382d82,'action':_0x41e268(0x13c)};}return symlinkSync(_0x382d82,_0x11c72c,_0x41e268(0x131)),{'path':_0x11c72c,'target':_0x382d82,'action':_0x41e268(0x141)};}function managedTargetSkillLinkPaths(_0x54e567,_0x1133ee){const _0x18c9f7=a107_0x4eaa7b;if(!existsSync(_0x54e567))return[];const _0xaa65f8=_0x1133ee[_0x18c9f7(0x14a)]+'--';return readdirSync(_0x54e567,{'withFileTypes':!![]})['filter'](_0x166bb6=>_0x1133ee[_0x18c9f7(0x140)]===_0x18c9f7(0x156)||_0x166bb6[_0x18c9f7(0x15b)][_0x18c9f7(0x161)](_0xaa65f8))[_0x18c9f7(0x13d)](_0x56c226=>resolve(_0x54e567,_0x56c226[_0x18c9f7(0x15b)]));}function removeManagedSkillLink(_0x364379,_0x34b53d,_0x52e2c7){const _0x7dceb1=a107_0x4eaa7b,_0x546ae7=lstatIfPresent(_0x364379);if(!_0x546ae7?.[_0x7dceb1(0x149)]())return{'path':_0x364379,'action':_0x7dceb1(0x153),'reason':_0x7dceb1(0x15a)};const _0x5e93c1=resolveSymlinkTarget(_0x364379);if(!isPathInside(realOrResolved(_0x5e93c1),realOrResolved(_0x34b53d[_0x7dceb1(0x162)])))return{'path':_0x364379,'action':_0x7dceb1(0x153),'reason':_0x7dceb1(0x165)};const _0xe1a942=readMetadataIfPresent(resolve(_0x5e93c1,METADATA_FILE));if(_0x34b53d[_0x7dceb1(0x140)]===_0x7dceb1(0x156)&&(_0xe1a942?.[_0x7dceb1(0x14a)]!==_0x34b53d[_0x7dceb1(0x14a)]||_0xe1a942[_0x7dceb1(0x157)]!==_0x52e2c7))return{'path':_0x364379,'action':'skipped','reason':_0x7dceb1(0x146)};return unlinkSync(_0x364379),{'path':_0x364379,'action':'removed'};}function isLinkedFromAnyRoot(_0x2033b9,_0xecdaab){const _0x5716fe=a107_0x4eaa7b,_0x48ed06=realOrResolved(_0x2033b9);for(const _0x19c1fb of _0xecdaab){if(!existsSync(_0x19c1fb))continue;for(const _0x277998 of readdirSync(_0x19c1fb,{'withFileTypes':!![]})){if(!_0x277998[_0x5716fe(0x149)]())continue;const _0x21eeab=resolve(_0x19c1fb,_0x277998[_0x5716fe(0x15b)]);if(realOrResolved(resolveSymlinkTarget(_0x21eeab))===_0x48ed06)return!![];}}return![];}function runtimeSkillLinkName(_0x1a8d84,_0x289dea){const _0x60e31e=a107_0x4eaa7b,_0x5a607f=safePathSegment(_0x289dea,_0x60e31e(0x157));if(_0x1a8d84[_0x60e31e(0x140)]===_0x60e31e(0x156)&&RESERVED_PROJECT_SKILL_CODES[_0x60e31e(0x139)](_0x5a607f))throw CliErrors[_0x60e31e(0x158)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x5a607f);return _0x1a8d84[_0x60e31e(0x140)]===_0x60e31e(0x156)?_0x5a607f:_0x1a8d84[_0x60e31e(0x14a)]+'--'+_0x5a607f;}function runtimeSkillCodeFromLink(_0x211900,_0x487120){const _0x44843e=a107_0x4eaa7b,_0x1cd97f=basename(_0x487120);return _0x211900[_0x44843e(0x140)]===_0x44843e(0x156)?_0x1cd97f:_0x1cd97f[_0x44843e(0x144)]((_0x211900['appCode']+'--')[_0x44843e(0x134)]);}export function copyManagedSkillDirectory(_0xef84f,_0x4596ab){const _0x4d94f6=a107_0x4eaa7b,_0x5f110c=resolve(_0x4596ab,METADATA_FILE),_0x502c80=existsSync(_0x4596ab);if(_0x502c80){const _0x1198d7=lstatSync(_0x4596ab);if(_0x1198d7[_0x4d94f6(0x149)]())throw CliErrors[_0x4d94f6(0x158)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x4596ab);if(!_0x1198d7[_0x4d94f6(0x136)]())throw CliErrors[_0x4d94f6(0x158)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x4596ab);const _0x5e0556=readMetadataIfPresent(_0x5f110c);if(_0x5e0556?.[_0x4d94f6(0x140)]!==_0x4d94f6(0x163))throw CliErrors[_0x4d94f6(0x158)](_0x4d94f6(0x14c)+_0x4596ab);}ensureDirSync(dirname(_0x4596ab));const _0x6cab0f=_0x502c80?readMetadataIfPresent(_0x5f110c)?.[_0x4d94f6(0x13f)]:undefined,_0x471c5b=readMetadataIfPresent(resolve(_0xef84f,METADATA_FILE))?.[_0x4d94f6(0x13f)];return _0x502c80&&removeSync(_0x4596ab),copySkillDirectory(_0xef84f,_0x4596ab),{'path':_0x4596ab,'target':_0xef84f,'action':!_0x502c80?_0x4d94f6(0x141):_0x6cab0f===_0x471c5b?'unchanged':_0x4d94f6(0x13c)};}function copySkillDirectory(_0x4a7b23,_0x13f348){copySync(_0x4a7b23,_0x13f348,{'dereference':![],'overwrite':!![],'filter'(_0x49edcc){const _0x3330d1=a107_0x1f17;if(lstatSync(_0x49edcc)[_0x3330d1(0x149)]())throw CliErrors[_0x3330d1(0x158)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0x49edcc);return!![];}});}
@@ -1,3 +1,3 @@
1
- import type { LocalRuntimeSkillItem, LocalRuntimeSkillListInput, SkillSyncPathsOptions } from "./types.js";
1
+ import type { LocalRuntimeSkillItem, LocalRuntimeSkillListInput, RuntimeSkillInstallTarget, SkillSyncPathsOptions } from "./types.js";
2
2
  /** Lists locally cached and linked runtime Skills for one app context. */
3
- export declare function listLocalRuntimeSkills(input: LocalRuntimeSkillListInput, options?: SkillSyncPathsOptions): LocalRuntimeSkillItem[];
3
+ export declare function listLocalRuntimeSkills(input: LocalRuntimeSkillListInput, target: RuntimeSkillInstallTarget, options?: SkillSyncPathsOptions): LocalRuntimeSkillItem[];
@@ -1 +1 @@
1
- (function(_0x3b0880,_0x550236){const _0x5f3a8f=a107_0x24fd,_0xd10823=_0x3b0880();while(!![]){try{const _0x5bdd19=parseInt(_0x5f3a8f(0xc2))/0x1+-parseInt(_0x5f3a8f(0xdd))/0x2*(parseInt(_0x5f3a8f(0xcd))/0x3)+parseInt(_0x5f3a8f(0xca))/0x4+-parseInt(_0x5f3a8f(0xe6))/0x5*(parseInt(_0x5f3a8f(0xe5))/0x6)+parseInt(_0x5f3a8f(0xd0))/0x7+parseInt(_0x5f3a8f(0xcb))/0x8+parseInt(_0x5f3a8f(0xe4))/0x9*(-parseInt(_0x5f3a8f(0xd1))/0xa);if(_0x5bdd19===_0x550236)break;else _0xd10823['push'](_0xd10823['shift']());}catch(_0x291055){_0xd10823['push'](_0xd10823['shift']());}}}(a107_0x25c4,0xda81b));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x359125,_0x26d8de={}){const _0x54eee9=a107_0x24fd,_0x3825f4=safePathSegment(_0x359125[_0x54eee9(0xdb)],_0x54eee9(0xdb)),_0x33c6cc=normalizeRuntimeSkillScopes(_0x359125[_0x54eee9(0xc6)]),_0x3dc0ae=new Set(_0x33c6cc),_0x38eeed=_0x359125[_0x54eee9(0xc4)]?.[_0x54eee9(0xe0)](),_0x5db078=new Map(),_0x1e78be=resolve(getRuntimeSkillCacheRoot(_0x359125['env'],_0x359125[_0x54eee9(0xd3)],_0x26d8de),_0x3825f4);for(const _0x5149b0 of _0x33c6cc){for(const _0x2dc4f7 of localSkillEntryDirs(resolve(_0x1e78be,_0x5149b0))){collectLocalRuntimeSkill(_0x5db078,_0x2dc4f7,{'appCode':_0x3825f4,'scopes':_0x3dc0ae,'code':_0x38eeed,'source':_0x54eee9(0xde)});}}const _0x2f9d67=resolveSkillSyncPaths(_0x26d8de);for(const _0x4ccd0e of runtimeAgentSkillRoots(_0x2f9d67)){for(const _0x2ca668 of localSkillLinkCandidates(_0x4ccd0e,_0x3825f4,_0x3dc0ae)){collectLocalRuntimeSkill(_0x5db078,_0x2ca668,{'appCode':_0x3825f4,'scopes':_0x3dc0ae,'code':_0x38eeed,'source':_0x54eee9(0xe8),'linkedPath':_0x2ca668});}}return Array['from'](_0x5db078[_0x54eee9(0xcf)]())[_0x54eee9(0xc0)](compareLocalRuntimeSkills);}function a107_0x24fd(_0x2543ae,_0x5ed4ba){_0x2543ae=_0x2543ae-0xc0;const _0x25c46f=a107_0x25c4();let _0x24fd5f=_0x25c46f[_0x2543ae];return _0x24fd5f;}function localSkillEntryDirs(_0x1dcd51){const _0xd9e42b=a107_0x24fd;if(!existsSync(_0x1dcd51))return[];return readdirSync(_0x1dcd51,{'withFileTypes':!![]})[_0xd9e42b(0xdf)](_0x134d54=>_0x134d54['isDirectory']()||_0x134d54[_0xd9e42b(0xe7)]())[_0xd9e42b(0xc8)](_0x447dc0=>resolve(_0x1dcd51,_0x447dc0[_0xd9e42b(0xd2)]));}function localSkillLinkCandidates(_0x26d84c,_0x1fe6bc,_0xd368c4){const _0x3c00dc=a107_0x24fd;if(!existsSync(_0x26d84c))return[];const _0x142920=_0x1fe6bc+'--';return readdirSync(_0x26d84c,{'withFileTypes':!![]})[_0x3c00dc(0xdf)](_0x2de038=>_0x2de038['isDirectory']()||_0x2de038['isSymbolicLink']())[_0x3c00dc(0xdf)](_0x316cd2=>_0x316cd2['name'][_0x3c00dc(0xcc)](_0x142920)||_0xd368c4['has'](_0x3c00dc(0xc5)))[_0x3c00dc(0xc8)](_0x5aa5d4=>resolve(_0x26d84c,_0x5aa5d4[_0x3c00dc(0xd2)]));}function collectLocalRuntimeSkill(_0xdacecd,_0x2b6124,_0x4df0ab){const _0xf401f3=a107_0x24fd,_0x4bae00=resolve(_0x2b6124,METADATA_FILE),_0x33daae=readMetadataIfPresent(_0x4bae00);if(!_0x33daae)return;if(_0x33daae[_0xf401f3(0xdb)]!==_0x4df0ab[_0xf401f3(0xdb)])return;if(!isRuntimeSkillScope(_0x33daae[_0xf401f3(0xd4)])||!_0x4df0ab[_0xf401f3(0xc6)][_0xf401f3(0xc9)](_0x33daae[_0xf401f3(0xd4)]))return;const _0x506553=_0x33daae[_0xf401f3(0xd9)]?.[_0xf401f3(0xe0)]();if(!_0x506553)return;if(_0x4df0ab[_0xf401f3(0xc4)]&&_0x506553!==_0x4df0ab[_0xf401f3(0xc4)])return;const _0x1103ce=_0x33daae[_0xf401f3(0xd4)]+':'+_0x506553,_0x2f1a71=_0x4df0ab[_0xf401f3(0xd7)]?[_0x4df0ab['linkedPath']]:[],_0x471657=_0xdacecd['get'](_0x1103ce);if(_0x471657){_0x4df0ab['source']===_0xf401f3(0xde)&&(_0x471657[_0xf401f3(0xe1)]=_0x2b6124,_0x471657['cacheDir']=_0x2b6124,_0x471657[_0xf401f3(0xe2)]=resolve(_0x2b6124,SKILL_FILE),_0x471657[_0xf401f3(0xdc)]=_0x4bae00);for(const _0x420fc4 of _0x2f1a71){!_0x471657[_0xf401f3(0xd5)][_0xf401f3(0xda)](_0x420fc4)&&_0x471657['linkedPaths'][_0xf401f3(0xd8)](_0x420fc4);}_0x471657['linkedPaths']['sort']();return;}_0xdacecd[_0xf401f3(0xc1)](_0x1103ce,{..._0x33daae,'tags':Array[_0xf401f3(0xe3)](_0x33daae[_0xf401f3(0xce)])?_0x33daae[_0xf401f3(0xce)]:[],'scope':_0x33daae['scope'],'source':_0xf401f3(0xd6),'dir':_0x2b6124,'cacheDir':_0x4df0ab[_0xf401f3(0xc7)]==='cache'?_0x2b6124:undefined,'skillMdPath':resolve(_0x2b6124,SKILL_FILE),'metadataPath':_0x4bae00,'linkedPaths':_0x2f1a71});}function compareLocalRuntimeSkills(_0x47a3c2,_0x3148d3){const _0x5f3851=a107_0x24fd,_0x585035={'personal':0x0,'company':0x1,'builtin':0x2};return _0x585035[_0x47a3c2['scope']]-_0x585035[_0x3148d3[_0x5f3851(0xd4)]]||_0x47a3c2[_0x5f3851(0xd9)][_0x5f3851(0xc3)](_0x3148d3['skillCode'])||_0x47a3c2[_0x5f3851(0xe1)][_0x5f3851(0xc3)](_0x3148d3[_0x5f3851(0xe1)]);}function a107_0x25c4(){const _0x1e8245=['3ZoUykL','tags','values','8722588OYWzah','3123070pAnKTv','name','accessKey','scope','linkedPaths','local','linkedPath','push','skillCode','includes','appCode','metadataPath','1188344LfgkEY','cache','filter','trim','dir','skillMdPath','isArray','81zRUJAX','565074PbTFfn','20dUyLoP','isSymbolicLink','link','sort','set','1716441BokAFD','localeCompare','code','builtin','scopes','source','map','has','3250556uiOAjI','7211920GpCAjN','startsWith'];a107_0x25c4=function(){return _0x1e8245;};return a107_0x25c4();}
1
+ (function(_0x417542,_0x655384){const _0x2ce265=a108_0x40fa,_0x174a09=_0x417542();while(!![]){try{const _0x14219a=parseInt(_0x2ce265(0x10e))/0x1+parseInt(_0x2ce265(0xff))/0x2*(parseInt(_0x2ce265(0x10c))/0x3)+parseInt(_0x2ce265(0xf1))/0x4*(parseInt(_0x2ce265(0xf7))/0x5)+parseInt(_0x2ce265(0xf8))/0x6+-parseInt(_0x2ce265(0x107))/0x7+parseInt(_0x2ce265(0xea))/0x8+parseInt(_0x2ce265(0x106))/0x9*(-parseInt(_0x2ce265(0xe9))/0xa);if(_0x14219a===_0x655384)break;else _0x174a09['push'](_0x174a09['shift']());}catch(_0xc6f2f1){_0x174a09['push'](_0x174a09['shift']());}}}(a108_0x2f63,0xe48eb));function a108_0x2f63(){const _0x42f577=['2GPESKS','scope','linkedPath','values','isSymbolicLink','local','isArray','5021073XJrSHD','3843357saeYuY','from','sort','dir','env','1783437knqicG','push','31717Hbehhh','trim','source','get','code','linkedPaths','\x20!=\x20','50LABUfl','13613520dIWASm','appCode','cacheDir','map','validation','includes','scopes','4NFpMaf','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','skillCode','set','builtin','tags','5509555KICJLE','5069460uKKrue','name','filter','project','cache','skillRoots','has'];a108_0x2f63=function(){return _0x42f577;};return a108_0x2f63();}import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x40a02c,_0x349b5c,_0x561e1f={}){const _0x388a3c=a108_0x40fa,_0x7d526d=safePathSegment(_0x40a02c[_0x388a3c(0xeb)],_0x388a3c(0xeb));if(_0x349b5c[_0x388a3c(0xeb)]!==_0x7d526d)throw CliErrors[_0x388a3c(0xee)](_0x388a3c(0xf2)+_0x349b5c['appCode']+_0x388a3c(0x114)+_0x7d526d);const _0x5b3b0c=normalizeRuntimeSkillScopes(_0x40a02c[_0x388a3c(0xf0)]),_0xbf2304=new Set(_0x5b3b0c),_0x34ef28=_0x40a02c[_0x388a3c(0x112)]?.[_0x388a3c(0x10f)](),_0x582536=new Map(),_0x5ce0e2=resolve(getRuntimeSkillCacheRoot(_0x40a02c[_0x388a3c(0x10b)],_0x40a02c['accessKey'],_0x561e1f),_0x7d526d);for(const _0x52bf86 of _0x5b3b0c){for(const _0x51ca77 of localSkillEntryDirs(resolve(_0x5ce0e2,_0x52bf86))){collectLocalRuntimeSkill(_0x582536,_0x51ca77,{'appCode':_0x7d526d,'scopes':_0xbf2304,'code':_0x34ef28,'source':_0x388a3c(0xfc)});}}for(const _0x3eb390 of _0x349b5c[_0x388a3c(0xfd)]){for(const _0x286693 of localSkillLinkCandidates(_0x3eb390,_0x349b5c,_0xbf2304)){collectLocalRuntimeSkill(_0x582536,_0x286693,{'appCode':_0x7d526d,'scopes':_0xbf2304,'code':_0x34ef28,'source':'link','linkedPath':_0x286693});}}return Array[_0x388a3c(0x108)](_0x582536[_0x388a3c(0x102)]())[_0x388a3c(0x109)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0xb56d50){const _0x424d32=a108_0x40fa;if(!existsSync(_0xb56d50))return[];return readdirSync(_0xb56d50,{'withFileTypes':!![]})[_0x424d32(0xfa)](_0x245e7e=>_0x245e7e['isDirectory']()||_0x245e7e[_0x424d32(0x103)]())[_0x424d32(0xed)](_0x2cc244=>resolve(_0xb56d50,_0x2cc244[_0x424d32(0xf9)]));}function localSkillLinkCandidates(_0x33a2cb,_0x42194c,_0x447889){const _0x4fbc7d=a108_0x40fa;if(!existsSync(_0x33a2cb))return[];const _0x561d38=_0x42194c['appCode']+'--';return readdirSync(_0x33a2cb,{'withFileTypes':!![]})[_0x4fbc7d(0xfa)](_0x45452b=>_0x45452b['isDirectory']()||_0x45452b[_0x4fbc7d(0x103)]())[_0x4fbc7d(0xfa)](_0x1166ba=>_0x42194c[_0x4fbc7d(0x100)]===_0x4fbc7d(0xfb)||_0x1166ba[_0x4fbc7d(0xf9)]['startsWith'](_0x561d38)||_0x447889[_0x4fbc7d(0xfe)](_0x4fbc7d(0xf5)))['map'](_0xd1917e=>resolve(_0x33a2cb,_0xd1917e[_0x4fbc7d(0xf9)]));}function collectLocalRuntimeSkill(_0x4d1611,_0x1408a8,_0x5973ea){const _0x51a45d=a108_0x40fa,_0x61cbe5=resolve(_0x1408a8,METADATA_FILE),_0x590899=readMetadataIfPresent(_0x61cbe5);if(!_0x590899)return;if(_0x590899['appCode']!==_0x5973ea[_0x51a45d(0xeb)])return;if(!isRuntimeSkillScope(_0x590899[_0x51a45d(0x100)])||!_0x5973ea[_0x51a45d(0xf0)][_0x51a45d(0xfe)](_0x590899['scope']))return;const _0x31743e=_0x590899['skillCode']?.['trim']();if(!_0x31743e)return;if(_0x5973ea[_0x51a45d(0x112)]&&_0x31743e!==_0x5973ea['code'])return;const _0x827ddd=_0x590899['scope']+':'+_0x31743e,_0x25ba23=_0x5973ea[_0x51a45d(0x101)]?[_0x5973ea[_0x51a45d(0x101)]]:[],_0x286439=_0x4d1611[_0x51a45d(0x111)](_0x827ddd);if(_0x286439){_0x5973ea[_0x51a45d(0x110)]===_0x51a45d(0xfc)&&(_0x286439[_0x51a45d(0x10a)]=_0x1408a8,_0x286439[_0x51a45d(0xec)]=_0x1408a8,_0x286439['skillMdPath']=resolve(_0x1408a8,SKILL_FILE),_0x286439['metadataPath']=_0x61cbe5);for(const _0x38edf2 of _0x25ba23){!_0x286439[_0x51a45d(0x113)][_0x51a45d(0xef)](_0x38edf2)&&_0x286439[_0x51a45d(0x113)][_0x51a45d(0x10d)](_0x38edf2);}_0x286439['linkedPaths'][_0x51a45d(0x109)]();return;}_0x4d1611[_0x51a45d(0xf4)](_0x827ddd,{..._0x590899,'tags':Array[_0x51a45d(0x105)](_0x590899[_0x51a45d(0xf6)])?_0x590899[_0x51a45d(0xf6)]:[],'scope':_0x590899['scope'],'source':_0x51a45d(0x104),'dir':_0x1408a8,'cacheDir':_0x5973ea[_0x51a45d(0x110)]===_0x51a45d(0xfc)?_0x1408a8:undefined,'skillMdPath':resolve(_0x1408a8,SKILL_FILE),'metadataPath':_0x61cbe5,'linkedPaths':_0x25ba23});}function a108_0x40fa(_0x5e77bf,_0x29953c){_0x5e77bf=_0x5e77bf-0xe9;const _0x2f63c7=a108_0x2f63();let _0x40fa41=_0x2f63c7[_0x5e77bf];return _0x40fa41;}function compareLocalRuntimeSkills(_0x206527,_0x2cb6fd){const _0x2d6562=a108_0x40fa,_0x103044={'personal':0x0,'company':0x1,'builtin':0x2};return _0x103044[_0x206527[_0x2d6562(0x100)]]-_0x103044[_0x2cb6fd[_0x2d6562(0x100)]]||_0x206527[_0x2d6562(0xf3)]['localeCompare'](_0x2cb6fd[_0x2d6562(0xf3)])||_0x206527[_0x2d6562(0x10a)]['localeCompare'](_0x2cb6fd[_0x2d6562(0x10a)]);}
@@ -1 +1 @@
1
- (function(_0xa78d66,_0x47b129){const _0x394427=a108_0x46c8,_0x5a6b8d=_0xa78d66();while(!![]){try{const _0x1545dc=-parseInt(_0x394427(0x116))/0x1*(-parseInt(_0x394427(0x13b))/0x2)+parseInt(_0x394427(0x12e))/0x3+parseInt(_0x394427(0x135))/0x4*(parseInt(_0x394427(0x125))/0x5)+parseInt(_0x394427(0x118))/0x6+-parseInt(_0x394427(0x11b))/0x7*(parseInt(_0x394427(0x11f))/0x8)+-parseInt(_0x394427(0x11d))/0x9+parseInt(_0x394427(0x132))/0xa;if(_0x1545dc===_0x47b129)break;else _0x5a6b8d['push'](_0x5a6b8d['shift']());}catch(_0x21657d){_0x5a6b8d['push'](_0x5a6b8d['shift']());}}}(a108_0x36df,0xbf193));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';function a108_0x46c8(_0x76be25,_0x37ac8e){_0x76be25=_0x76be25-0x114;const _0x36df8c=a108_0x36df();let _0x46c80d=_0x36df8c[_0x76be25];return _0x46c80d;}export function fileContent(_0x4f407d){const _0x431802=a108_0x46c8;return _0x4f407d[_0x431802(0x13d)]??Buffer[_0x431802(0x123)](_0x4f407d[_0x431802(0x12a)]??'',_0x431802(0x139));}export function fileText(_0xa1fa04){const _0x27dcf4=a108_0x46c8;return fileContent(_0xa1fa04)['toString'](_0x27dcf4(0x139));}export function normalizeLocalFiles(_0x27874e){const _0x71f129=a108_0x46c8;if(!Array['isArray'](_0x27874e)||_0x27874e[_0x71f129(0x13a)]===0x0)return[];const _0xae58d=new Map();for(const _0x17430c of _0x27874e){if(!_0x17430c||typeof _0x17430c!=='object'||typeof _0x17430c[_0x71f129(0x126)]!==_0x71f129(0x13f))throw CliErrors[_0x71f129(0x121)](_0x71f129(0x128));const _0x73bfad=normalizeSkillRelativePath(_0x17430c[_0x71f129(0x126)]);if(_0xae58d[_0x71f129(0x11a)](_0x73bfad))throw CliErrors[_0x71f129(0x121)](_0x71f129(0x127)+_0x73bfad);if(_0x17430c[_0x71f129(0x13d)]!==undefined&&!Buffer[_0x71f129(0x12d)](_0x17430c[_0x71f129(0x13d)]))throw CliErrors[_0x71f129(0x121)](_0x71f129(0x11e)+_0x73bfad);if(_0x17430c[_0x71f129(0x13d)]===undefined&&typeof _0x17430c['content']!==_0x71f129(0x13f))throw CliErrors[_0x71f129(0x121)](_0x71f129(0x131)+_0x73bfad);const _0x548c25=fileContent(_0x17430c);_0xae58d[_0x71f129(0x119)](_0x73bfad,{'path':_0x73bfad,'bytes':_0x548c25});}return Array[_0x71f129(0x123)](_0xae58d['values']())[_0x71f129(0x133)](compareSkillFiles);}export function normalizeManifestFiles(_0x493727){const _0x32b98f=a108_0x46c8;if(!Array[_0x32b98f(0x11c)](_0x493727)||_0x493727['length']===0x0)return[];const _0x43b076=new Map();for(const _0x202b75 of _0x493727){if(!_0x202b75||typeof _0x202b75!==_0x32b98f(0x13e)||typeof _0x202b75['path']!==_0x32b98f(0x13f))throw CliErrors[_0x32b98f(0x121)](_0x32b98f(0x128));const _0x18372b=normalizeSkillRelativePath(_0x202b75[_0x32b98f(0x126)]);if(_0x43b076['has'](_0x18372b))throw CliErrors['validation'](_0x32b98f(0x127)+_0x18372b);if(!isSha256Hex(_0x202b75[_0x32b98f(0x120)]))throw CliErrors[_0x32b98f(0x121)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x18372b);if(!Number[_0x32b98f(0x124)](_0x202b75[_0x32b98f(0x12c)])||_0x202b75['size']<0x0)throw CliErrors[_0x32b98f(0x121)](_0x32b98f(0x12b)+_0x18372b);_0x43b076[_0x32b98f(0x119)](_0x18372b,{'path':_0x18372b,'sha256':_0x202b75[_0x32b98f(0x120)]['toLowerCase'](),'size':_0x202b75[_0x32b98f(0x12c)]});}return Array[_0x32b98f(0x123)](_0x43b076['values']())[_0x32b98f(0x133)](compareSkillFiles);}export function scanSkillDirectory(_0x4679f7){const _0x5bbd16=realpathSync(_0x4679f7),_0x49ce3b=[];function _0x456d3e(_0x3fb0f7){const _0x1d59e5=a108_0x46c8,_0x30f794=readdirSync(_0x3fb0f7,{'withFileTypes':!![]})[_0x1d59e5(0x133)]((_0x5ef8c9,_0x1106eb)=>_0x5ef8c9[_0x1d59e5(0x137)][_0x1d59e5(0x129)](_0x1106eb[_0x1d59e5(0x137)]));for(const _0x2a4801 of _0x30f794){if(_0x2a4801[_0x1d59e5(0x115)]()&&IGNORED_DIR_NAMES['has'](_0x2a4801[_0x1d59e5(0x137)]))continue;if(IGNORED_FILE_NAMES[_0x1d59e5(0x11a)](_0x2a4801['name']))continue;const _0x1887c7=resolve(_0x3fb0f7,_0x2a4801[_0x1d59e5(0x137)]);if(_0x2a4801['isSymbolicLink']())throw CliErrors[_0x1d59e5(0x121)]('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x1887c7);const _0x3ebd47=toPosixPath(relative(_0x5bbd16,_0x1887c7));if(_0x2a4801[_0x1d59e5(0x115)]()){_0x456d3e(_0x1887c7);continue;}if(!_0x2a4801[_0x1d59e5(0x12f)]())continue;validateSkillRelativePath(_0x3ebd47);const _0x1bdc7a=readFileSync(_0x1887c7);_0x49ce3b[_0x1d59e5(0x114)]({'path':_0x3ebd47,'bytes':_0x1bdc7a});}}return _0x456d3e(_0x5bbd16),normalizeLocalFiles(_0x49ce3b);}export function compareSkillFiles(_0x4148f1,_0x2a278e){const _0x127bc6=a108_0x46c8;if(_0x4148f1[_0x127bc6(0x126)]===SKILL_FILE)return _0x2a278e[_0x127bc6(0x126)]===SKILL_FILE?0x0:-0x1;if(_0x2a278e[_0x127bc6(0x126)]===SKILL_FILE)return 0x1;return Buffer[_0x127bc6(0x136)](Buffer['from'](_0x4148f1[_0x127bc6(0x126)],_0x127bc6(0x139)),Buffer[_0x127bc6(0x123)](_0x2a278e[_0x127bc6(0x126)],_0x127bc6(0x139)));}function a108_0x36df(){const _0x238369=['1048004sScsuQ','compare','name','test','utf8','length','4QlLsKc','Unsafe\x20Skill\x20file\x20path:\x20','bytes','object','string','push','isDirectory','424574RzlnAj','startsWith','411276ejAYXe','set','has','756JNaGDX','isArray','12360663jiCSxm','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','90712KCzxiF','sha256','validation','includes','from','isSafeInteger','20anVBdg','path','Duplicate\x20Skill\x20file\x20path:\x20','Skill\x20file\x20path\x20must\x20be\x20text.','localeCompare','content','Skill\x20file\x20size\x20is\x20invalid:\x20','size','isBuffer','3038385RXfRwf','isFile','replace','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','4022650IqqMMo','sort','trim'];a108_0x36df=function(){return _0x238369;};return a108_0x36df();}export function normalizeSkillRelativePath(_0x310e72){const _0x36fee9=a108_0x46c8,_0xbe267a=toPosixPath(_0x310e72[_0x36fee9(0x134)]());return validateSkillRelativePath(_0xbe267a),_0xbe267a;}export function validateSkillRelativePath(_0x419f99){const _0x24064c=a108_0x46c8;if(!_0x419f99||_0x419f99[_0x24064c(0x117)]('/')||_0x419f99[_0x24064c(0x122)]('//'))throw CliErrors[_0x24064c(0x121)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x419f99);for(const _0x55848a of _0x419f99['split']('/')){if(!_0x55848a||_0x55848a==='.'||_0x55848a==='..')throw CliErrors[_0x24064c(0x121)](_0x24064c(0x13c)+_0x419f99);}}export function toPosixPath(_0xdede8d){const _0x3b9111=a108_0x46c8;return _0xdede8d[_0x3b9111(0x130)](/\\/g,'/');}export function isSha256Hex(_0x211c2a){const _0x3e44a2=a108_0x46c8;return typeof _0x211c2a==='string'&&/^[a-fA-F0-9]{64}$/[_0x3e44a2(0x138)](_0x211c2a);}
1
+ (function(_0x1020e2,_0x2a1cc1){const _0x134481=a109_0x38db,_0xd47aee=_0x1020e2();while(!![]){try{const _0x358bc6=parseInt(_0x134481(0x14d))/0x1*(parseInt(_0x134481(0x15b))/0x2)+-parseInt(_0x134481(0x15a))/0x3+parseInt(_0x134481(0x16d))/0x4+parseInt(_0x134481(0x16f))/0x5+-parseInt(_0x134481(0x16e))/0x6*(-parseInt(_0x134481(0x16b))/0x7)+-parseInt(_0x134481(0x165))/0x8*(parseInt(_0x134481(0x162))/0x9)+-parseInt(_0x134481(0x150))/0xa*(parseInt(_0x134481(0x166))/0xb);if(_0x358bc6===_0x2a1cc1)break;else _0xd47aee['push'](_0xd47aee['shift']());}catch(_0x46e7d9){_0xd47aee['push'](_0xd47aee['shift']());}}}(a109_0x4c02,0x83741));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(_0x42204c){const _0xcab7da=a109_0x38db;return _0x42204c[_0xcab7da(0x151)]??Buffer['from'](_0x42204c['content']??'','utf8');}function a109_0x38db(_0x4c30ce,_0x566ef1){_0x4c30ce=_0x4c30ce-0x14a;const _0x4c021a=a109_0x4c02();let _0x38db00=_0x4c021a[_0x4c30ce];return _0x38db00;}function a109_0x4c02(){const _0x4483fd=['validation','sort','80LQkObT','99MNUGxg','push','Skill\x20file\x20path\x20must\x20be\x20text.','length','values','42ZzKEUI','set','2795932CrqTqC','658062teamtn','1447705hIZJXv','size','string','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','isBuffer','test','has','utf8','isSafeInteger','localeCompare','startsWith','1543ECDPWZ','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','from','938970XFEpJJ','bytes','path','object','isDirectory','toLowerCase','isSymbolicLink','name','includes','replace','1671033MOiNfL','454hVwedo','toString','sha256','Duplicate\x20Skill\x20file\x20path:\x20','compare','trim','Skill\x20file\x20size\x20is\x20invalid:\x20','50697yDxAUj'];a109_0x4c02=function(){return _0x4483fd;};return a109_0x4c02();}export function fileText(_0x35465b){const _0x126a9d=a109_0x38db;return fileContent(_0x35465b)[_0x126a9d(0x15c)](_0x126a9d(0x176));}export function normalizeLocalFiles(_0x2c89ec){const _0x20c4bb=a109_0x38db;if(!Array['isArray'](_0x2c89ec)||_0x2c89ec[_0x20c4bb(0x169)]===0x0)return[];const _0x5e4386=new Map();for(const _0x55f9bb of _0x2c89ec){if(!_0x55f9bb||typeof _0x55f9bb!=='object'||typeof _0x55f9bb[_0x20c4bb(0x152)]!=='string')throw CliErrors['validation']('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x2ef40d=normalizeSkillRelativePath(_0x55f9bb[_0x20c4bb(0x152)]);if(_0x5e4386[_0x20c4bb(0x175)](_0x2ef40d))throw CliErrors[_0x20c4bb(0x163)](_0x20c4bb(0x15e)+_0x2ef40d);if(_0x55f9bb['bytes']!==undefined&&!Buffer[_0x20c4bb(0x173)](_0x55f9bb[_0x20c4bb(0x151)]))throw CliErrors[_0x20c4bb(0x163)](_0x20c4bb(0x14e)+_0x2ef40d);if(_0x55f9bb[_0x20c4bb(0x151)]===undefined&&typeof _0x55f9bb['content']!==_0x20c4bb(0x171))throw CliErrors['validation'](_0x20c4bb(0x172)+_0x2ef40d);const _0x4cbc51=fileContent(_0x55f9bb);_0x5e4386[_0x20c4bb(0x16c)](_0x2ef40d,{'path':_0x2ef40d,'bytes':_0x4cbc51});}return Array[_0x20c4bb(0x14f)](_0x5e4386['values']())[_0x20c4bb(0x164)](compareSkillFiles);}export function normalizeManifestFiles(_0x2b4325){const _0x46f56d=a109_0x38db;if(!Array['isArray'](_0x2b4325)||_0x2b4325['length']===0x0)return[];const _0x38c69c=new Map();for(const _0x48d7b7 of _0x2b4325){if(!_0x48d7b7||typeof _0x48d7b7!==_0x46f56d(0x153)||typeof _0x48d7b7['path']!=='string')throw CliErrors[_0x46f56d(0x163)](_0x46f56d(0x168));const _0x324753=normalizeSkillRelativePath(_0x48d7b7[_0x46f56d(0x152)]);if(_0x38c69c[_0x46f56d(0x175)](_0x324753))throw CliErrors[_0x46f56d(0x163)](_0x46f56d(0x15e)+_0x324753);if(!isSha256Hex(_0x48d7b7['sha256']))throw CliErrors['validation']('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x324753);if(!Number[_0x46f56d(0x14a)](_0x48d7b7['size'])||_0x48d7b7[_0x46f56d(0x170)]<0x0)throw CliErrors[_0x46f56d(0x163)](_0x46f56d(0x161)+_0x324753);_0x38c69c[_0x46f56d(0x16c)](_0x324753,{'path':_0x324753,'sha256':_0x48d7b7[_0x46f56d(0x15d)][_0x46f56d(0x155)](),'size':_0x48d7b7[_0x46f56d(0x170)]});}return Array[_0x46f56d(0x14f)](_0x38c69c[_0x46f56d(0x16a)]())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0x4f239d){const _0x3a5b08=realpathSync(_0x4f239d),_0xd18481=[];function _0x28b9af(_0x5f2181){const _0x2f3e5f=a109_0x38db,_0xa6ebde=readdirSync(_0x5f2181,{'withFileTypes':!![]})['sort']((_0x93d093,_0x23dcda)=>_0x93d093['name'][_0x2f3e5f(0x14b)](_0x23dcda[_0x2f3e5f(0x157)]));for(const _0x448c4f of _0xa6ebde){if(_0x448c4f[_0x2f3e5f(0x154)]()&&IGNORED_DIR_NAMES[_0x2f3e5f(0x175)](_0x448c4f['name']))continue;if(IGNORED_FILE_NAMES[_0x2f3e5f(0x175)](_0x448c4f[_0x2f3e5f(0x157)]))continue;const _0x3ad16=resolve(_0x5f2181,_0x448c4f['name']);if(_0x448c4f[_0x2f3e5f(0x156)]())throw CliErrors[_0x2f3e5f(0x163)]('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x3ad16);const _0x353f96=toPosixPath(relative(_0x3a5b08,_0x3ad16));if(_0x448c4f[_0x2f3e5f(0x154)]()){_0x28b9af(_0x3ad16);continue;}if(!_0x448c4f['isFile']())continue;validateSkillRelativePath(_0x353f96);const _0x3f43ce=readFileSync(_0x3ad16);_0xd18481[_0x2f3e5f(0x167)]({'path':_0x353f96,'bytes':_0x3f43ce});}}return _0x28b9af(_0x3a5b08),normalizeLocalFiles(_0xd18481);}export function compareSkillFiles(_0x1308d6,_0x5316af){const _0x555e34=a109_0x38db;if(_0x1308d6['path']===SKILL_FILE)return _0x5316af[_0x555e34(0x152)]===SKILL_FILE?0x0:-0x1;if(_0x5316af[_0x555e34(0x152)]===SKILL_FILE)return 0x1;return Buffer[_0x555e34(0x15f)](Buffer[_0x555e34(0x14f)](_0x1308d6[_0x555e34(0x152)],_0x555e34(0x176)),Buffer[_0x555e34(0x14f)](_0x5316af[_0x555e34(0x152)],_0x555e34(0x176)));}export function normalizeSkillRelativePath(_0x38cac1){const _0x356d46=a109_0x38db,_0x5922ae=toPosixPath(_0x38cac1[_0x356d46(0x160)]());return validateSkillRelativePath(_0x5922ae),_0x5922ae;}export function validateSkillRelativePath(_0x5caf1a){const _0x223417=a109_0x38db;if(!_0x5caf1a||_0x5caf1a[_0x223417(0x14c)]('/')||_0x5caf1a[_0x223417(0x158)]('//'))throw CliErrors[_0x223417(0x163)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x5caf1a);for(const _0x54fb1d of _0x5caf1a['split']('/')){if(!_0x54fb1d||_0x54fb1d==='.'||_0x54fb1d==='..')throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x5caf1a);}}export function toPosixPath(_0x52f75c){const _0x4999be=a109_0x38db;return _0x52f75c[_0x4999be(0x159)](/\\/g,'/');}export function isSha256Hex(_0x3f7cfb){const _0x2df532=a109_0x38db;return typeof _0x3f7cfb==='string'&&/^[a-fA-F0-9]{64}$/[_0x2df532(0x174)](_0x3f7cfb);}
@@ -1 +1 @@
1
- (function(_0x38309b,_0x277de1){const _0xf8046a=a109_0x108f,_0x51c555=_0x38309b();while(!![]){try{const _0x6584e0=parseInt(_0xf8046a(0x106))/0x1+parseInt(_0xf8046a(0xdb))/0x2*(parseInt(_0xf8046a(0x103))/0x3)+-parseInt(_0xf8046a(0xdc))/0x4+parseInt(_0xf8046a(0xe1))/0x5+-parseInt(_0xf8046a(0x104))/0x6*(-parseInt(_0xf8046a(0xdd))/0x7)+parseInt(_0xf8046a(0xf9))/0x8*(parseInt(_0xf8046a(0x107))/0x9)+-parseInt(_0xf8046a(0xfc))/0xa;if(_0x6584e0===_0x277de1)break;else _0x51c555['push'](_0x51c555['shift']());}catch(_0x36681b){_0x51c555['push'](_0x51c555['shift']());}}}(a109_0x2565,0x85767));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0xea769,_0x3ad14f,_0x28a677){const _0x21d5c4=a109_0x108f,_0x355b12=requireSkillCode(_0xea769),_0x56210b=requirePackageBytes(_0x355b12,_0x28a677[_0x21d5c4(0xd6)]),_0x3ffc00=extractDownloadedPackage(_0x56210b),_0x182e2e=_0x3ffc00[_0x21d5c4(0xe4)](_0x21b0cf=>_0x21b0cf[_0x21d5c4(0xec)]===SKILL_FILE);if(!_0x182e2e)throw CliErrors[_0x21d5c4(0xe6)](_0x21d5c4(0x108)+SKILL_FILE+':\x20'+_0x355b12);const _0x324ac7=withMaterializedSkillFrontmatter(_0x3ffc00,_0xea769,_0x355b12),_0xf28beb=_0x324ac7[_0x21d5c4(0xe4)](_0x3639b9=>_0x3639b9[_0x21d5c4(0xec)]===SKILL_FILE),_0x32304c=fileText(_0xf28beb),_0x56b2d4=getRuntimeSkillDir(_0x28a677[_0x21d5c4(0xfb)],_0x28a677[_0x21d5c4(0xdf)],_0x28a677['appCode'],_0x3ad14f,_0x355b12,_0x28a677[_0x21d5c4(0xf1)]),_0x5548ae=resolve(_0x56b2d4,SKILL_FILE),_0x104f3d=resolve(_0x56b2d4,METADATA_FILE),_0x4dbcbd=contentHash(_0x32304c),_0x25a3d5=readMetadataIfPresent(_0x104f3d)?.[_0x21d5c4(0xfa)];ensurePulledFilesCanBeOverwritten(_0x56b2d4,_0x104f3d,_0x324ac7,_0x28a677['force']===!![]),mkdirSync(_0x56b2d4,{'recursive':!![],'mode':0x1c0});const _0x49811c=existsSync(_0x5548ae)?readFileSync(_0x5548ae,_0x21d5c4(0xe0)):undefined;return materializeFiles(_0x56b2d4,_0x324ac7),removeStaleManagedFiles(_0x56b2d4,_0x25a3d5,_0x324ac7),writeJsonAtomic(_0x104f3d,buildMetadata(_0xea769,_0x3ad14f,_0x28a677[_0x21d5c4(0xfd)],_0x4dbcbd,_0x28a677['pulledAt'],_0x324ac7,_0x56210b)),{'skill':_0xea769,'scope':_0x3ad14f,'dir':_0x56b2d4,'skillMdPath':_0x5548ae,'metadataPath':_0x104f3d,'contentHash':_0x4dbcbd,'changed':_0x49811c!==_0x32304c};}function withMaterializedSkillFrontmatter(_0x4afb54,_0x4d1a56,_0x1afa6b){const _0x1cebd1=a109_0x108f,_0xad6a6e=skillDisplayName(_0x4d1a56,_0x1afa6b),_0x45f42f=_0x4d1a56['description']?.[_0x1cebd1(0xd7)]()||_0xad6a6e||_0x1afa6b;return normalizeLocalFiles(_0x4afb54)[_0x1cebd1(0xf2)](_0x36860a=>{const _0x3c21be=_0x1cebd1,_0x5a97d7=fileText(_0x36860a);if(_0x36860a[_0x3c21be(0xec)]!==SKILL_FILE)return _0x36860a;if(hasYamlFrontmatter(_0x5a97d7))return{'path':_0x36860a[_0x3c21be(0xec)],'content':withSyncedDisplayName(_0x5a97d7,_0xad6a6e)};return{'path':_0x36860a[_0x3c21be(0xec)],'content':prependSkillFrontmatter(_0x5a97d7,{'name':_0x1afa6b,'displayName':_0xad6a6e,'description':_0x45f42f})};});}function hasYamlFrontmatter(_0x48ecbd){const _0x1c7f52=a109_0x108f;return/^\uFEFF?---\s*\r?\n/[_0x1c7f52(0xf6)](_0x48ecbd);}function prependSkillFrontmatter(_0x5287df,_0xe6d10a){const _0x3b2fc4=a109_0x108f,_0x4f1ecb=_0x5287df[_0x3b2fc4(0xef)](/^\uFEFF/,'');return['---',_0x3b2fc4(0xde)+yamlString(_0xe6d10a[_0x3b2fc4(0xf5)]),_0xe6d10a['displayName']?'displayName:\x20'+yamlString(_0xe6d10a[_0x3b2fc4(0xe9)]):undefined,_0x3b2fc4(0xf0)+yamlString(_0xe6d10a['description']),'---','',_0x4f1ecb]['filter'](_0xa5cab4=>_0xa5cab4!==undefined)['join']('\x0a');}function a109_0x108f(_0x9fec8e,_0x2bfee5){_0x9fec8e=_0x9fec8e-0xd4;const _0x2565d6=a109_0x2565();let _0x108f0d=_0x2565d6[_0x9fec8e];return _0x108f0d;}function yamlString(_0x59cd3a){const _0x2e52e9=a109_0x108f;return JSON[_0x2e52e9(0xfe)](_0x59cd3a[_0x2e52e9(0xef)](/\r/g,'')['trim']());}function skillDisplayName(_0x1f696d,_0x47d0fd){const _0x1210ca=a109_0x108f,_0x3941ad=_0x1f696d[_0x1210ca(0xf8)]?.[_0x1210ca(0xd7)]();return _0x3941ad||_0x47d0fd;}function withSyncedDisplayName(_0x3cf78a,_0x2af7b8){const _0x5a3e2f=a109_0x108f,_0x133e81=_0x3cf78a['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x133e81)return _0x3cf78a;const _0x55960b=_0x133e81[0x1]??'',_0x4c433b=_0x133e81[0x2]??'',_0x3942f2=parseDocument(_0x4c433b);if(_0x3942f2['errors'][_0x5a3e2f(0x105)]>0x0||!isMap(_0x3942f2[_0x5a3e2f(0xe3)]))return _0x3cf78a;if(_0x2af7b8)_0x3942f2[_0x5a3e2f(0xda)]('displayName',_0x2af7b8);else{if(_0x3942f2[_0x5a3e2f(0xd4)]('displayName'))_0x3942f2[_0x5a3e2f(0xf3)](_0x5a3e2f(0xe9));else return _0x3cf78a;}forceBlockCollections(_0x3942f2[_0x5a3e2f(0xe3)]);const _0x5a8509=_0x3942f2[_0x5a3e2f(0xd8)]({'lineWidth':0x0})[_0x5a3e2f(0xe2)](),_0x4e9667=_0x3cf78a[_0x5a3e2f(0xee)](_0x133e81[0x0][_0x5a3e2f(0x105)])['replace'](/^\r?\n/,'');return _0x55960b+_0x5a3e2f(0xf7)+_0x5a8509+_0x5a3e2f(0xd9)+_0x4e9667;}function forceBlockCollections(_0x9f0f66){if(!isNode(_0x9f0f66))return;visit(_0x9f0f66,(_0x49c104,_0x1e8330)=>{const _0x66e06=a109_0x108f;isCollection(_0x1e8330)&&(_0x1e8330[_0x66e06(0xe5)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x40652b,_0x105866,_0xd7afa3,_0x23786e){const _0x5427bb=a109_0x108f;if(_0x23786e||!existsSync(_0x105866))return;const _0x2161ae=readMetadataIfPresent(_0x105866);if(!_0x2161ae)return;const _0x29807f=_0x2161ae[_0x5427bb(0xfa)]&&Object[_0x5427bb(0xf4)](_0x2161ae[_0x5427bb(0xfa)])[_0x5427bb(0x105)]>0x0?_0x2161ae[_0x5427bb(0xfa)]:undefined;if(_0x29807f)for(const [_0x11587f,_0x2dd2c4]of Object[_0x5427bb(0xeb)](_0x29807f)){const _0x6164bd=resolveManagedFilePath(_0x40652b,_0x11587f);if(!existsSync(_0x6164bd))throw CliErrors[_0x5427bb(0xe6)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x40652b,_0x5427bb(0x100)+_0x11587f);const _0x1ed11d=lstatSync(_0x6164bd);if(!_0x1ed11d[_0x5427bb(0xff)]())throw CliErrors[_0x5427bb(0xe6)](_0x5427bb(0xea)+_0x40652b,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x11587f);const _0x310da8=bufferSha256(readFileSync(_0x6164bd));if(_0x310da8!==_0x2dd2c4)throw CliErrors['validation'](_0x5427bb(0xea)+_0x40652b+_0x5427bb(0xe7)+_0x11587f,_0x5427bb(0x102)+_0x11587f);}else{const _0x2aae96=resolve(_0x40652b,SKILL_FILE);if(existsSync(_0x2aae96)&&_0x2161ae[_0x5427bb(0x101)]){const _0x2f4232=contentHash(readFileSync(_0x2aae96,_0x5427bb(0xe0)));if(_0x2f4232!==_0x2161ae['contentHash'])throw CliErrors[_0x5427bb(0xe6)](_0x5427bb(0xd5)+_0x2aae96,_0x5427bb(0xed));}}for(const _0x1dac0f of normalizeLocalFiles(_0xd7afa3)){if(_0x29807f?.[_0x1dac0f['path']])continue;if(!_0x29807f&&_0x1dac0f[_0x5427bb(0xec)]===SKILL_FILE)continue;const _0x57cc84=resolveManagedFilePath(_0x40652b,_0x1dac0f[_0x5427bb(0xec)]);if(!existsSync(_0x57cc84))continue;const _0x116c96=lstatSync(_0x57cc84);if(!_0x116c96['isFile']())throw CliErrors[_0x5427bb(0xe6)](_0x5427bb(0xea)+_0x40652b,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x1dac0f[_0x5427bb(0xec)]);const _0x47151c=bufferSha256(readFileSync(_0x57cc84));if(_0x47151c!==fileHash(_0x1dac0f))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x40652b,_0x5427bb(0xe8)+_0x1dac0f[_0x5427bb(0xec)]);}}function materializeFiles(_0x4f60bf,_0x3f4ceb){const _0x24f068=a109_0x108f;for(const _0x124084 of normalizeLocalFiles(_0x3f4ceb)){const _0x233c52=resolveManagedFilePath(_0x4f60bf,_0x124084[_0x24f068(0xec)]);mkdirSync(dirname(_0x233c52),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x233c52,fileContent(_0x124084),0x180);}}function removeStaleManagedFiles(_0x530976,_0x580ac9,_0x59e2b6){const _0x50ed62=a109_0x108f;if(!_0x580ac9)return;const _0x2e40f0=new Set(normalizeLocalFiles(_0x59e2b6)['map'](_0x5507df=>_0x5507df[_0x50ed62(0xec)]));for(const _0x4eee9a of Object[_0x50ed62(0xf4)](_0x580ac9)){if(_0x2e40f0[_0x50ed62(0xd4)](_0x4eee9a))continue;const _0x34c0d8=resolveManagedFilePath(_0x530976,_0x4eee9a);existsSync(_0x34c0d8)&&lstatSync(_0x34c0d8)[_0x50ed62(0xff)]()&&rmSync(_0x34c0d8,{'force':!![]});}}function a109_0x2565(){const _0x4e875f=['Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','slice','replace','description:\x20','paths','map','delete','keys','name','test','---\x0a','skillName','4376UKDwps','fileHashes','env','25711210ezpmsr','appCode','stringify','isFile','Managed\x20file\x20was\x20removed\x20locally:\x20','contentHash','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','150825dxYFKC','341832NqoiGG','length','420828ZGjgcW','17127RBVROZ','Runtime\x20Skill\x20package\x20is\x20missing\x20','has','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','packageBytes','trim','toString','\x0a---\x0a\x0a','set','14QbiCQT','631500KihxjM','77gVLOjt','name:\x20','accessKey','utf8','4176365WGFFFn','trimEnd','contents','find','flow','validation','.\x20Changed\x20file:\x20','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','displayName','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','entries','path'];a109_0x2565=function(){return _0x4e875f;};return a109_0x2565();}
1
+ (function(_0x56efb7,_0x3bb725){const _0x46b475=a110_0x596e,_0x3073aa=_0x56efb7();while(!![]){try{const _0x566243=parseInt(_0x46b475(0x11c))/0x1*(-parseInt(_0x46b475(0x11e))/0x2)+parseInt(_0x46b475(0xf8))/0x3*(-parseInt(_0x46b475(0x10e))/0x4)+-parseInt(_0x46b475(0x100))/0x5*(parseInt(_0x46b475(0x129))/0x6)+-parseInt(_0x46b475(0x101))/0x7*(-parseInt(_0x46b475(0x103))/0x8)+parseInt(_0x46b475(0x124))/0x9+parseInt(_0x46b475(0x11f))/0xa*(parseInt(_0x46b475(0x105))/0xb)+parseInt(_0x46b475(0xfb))/0xc;if(_0x566243===_0x3bb725)break;else _0x3073aa['push'](_0x3073aa['shift']());}catch(_0x33a405){_0x3073aa['push'](_0x3073aa['shift']());}}}(a110_0x53d2,0xf00dd));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 a110_0x596e(_0x30be2e,_0x7dee3c){_0x30be2e=_0x30be2e-0xf7;const _0x53d22c=a110_0x53d2();let _0x596e2c=_0x53d22c[_0x30be2e];return _0x596e2c;}export function materializeRuntimeSkill(_0x55f154,_0x3e7a89,_0x3eca47){const _0x5ad38c=a110_0x596e,_0x5b578d=requireSkillCode(_0x55f154),_0x549f0a=requirePackageBytes(_0x5b578d,_0x3eca47['packageBytes']),_0x366611=extractDownloadedPackage(_0x549f0a),_0x1ffd6a=_0x366611['find'](_0x172599=>_0x172599[_0x5ad38c(0x12b)]===SKILL_FILE);if(!_0x1ffd6a)throw CliErrors[_0x5ad38c(0xf7)](_0x5ad38c(0x128)+SKILL_FILE+':\x20'+_0x5b578d);const _0x115975=withMaterializedSkillFrontmatter(_0x366611,_0x55f154,_0x5b578d),_0x22ad29=_0x115975[_0x5ad38c(0x107)](_0x37d9fd=>_0x37d9fd['path']===SKILL_FILE),_0x894dd3=fileText(_0x22ad29),_0x56448a=getRuntimeSkillDir(_0x3eca47['env'],_0x3eca47[_0x5ad38c(0x12c)],_0x3eca47[_0x5ad38c(0x108)],_0x3e7a89,_0x5b578d,_0x3eca47[_0x5ad38c(0x122)]),_0xfc5073=resolve(_0x56448a,SKILL_FILE),_0x34567c=resolve(_0x56448a,METADATA_FILE),_0xbaadf4=contentHash(_0x894dd3),_0x579973=readMetadataIfPresent(_0x34567c)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x56448a,_0x34567c,_0x115975,_0x3eca47['force']===!![]),mkdirSync(_0x56448a,{'recursive':!![],'mode':0x1c0});const _0x33b3e0=existsSync(_0xfc5073)?readFileSync(_0xfc5073,_0x5ad38c(0x10f)):undefined;return materializeFiles(_0x56448a,_0x115975),removeStaleManagedFiles(_0x56448a,_0x579973,_0x115975),writeJsonAtomic(_0x34567c,buildMetadata(_0x55f154,_0x3e7a89,_0x3eca47['appCode'],_0xbaadf4,_0x3eca47[_0x5ad38c(0x104)],_0x115975,_0x549f0a)),{'skill':_0x55f154,'scope':_0x3e7a89,'dir':_0x56448a,'skillMdPath':_0xfc5073,'metadataPath':_0x34567c,'contentHash':_0xbaadf4,'changed':_0x33b3e0!==_0x894dd3};}function withMaterializedSkillFrontmatter(_0x514fe1,_0x26cdab,_0x5b1b32){const _0x174a15=skillDisplayName(_0x26cdab,_0x5b1b32),_0x328a24=_0x26cdab['description']?.['trim']()||_0x174a15||_0x5b1b32;return normalizeLocalFiles(_0x514fe1)['map'](_0x2a2d51=>{const _0x5cc3ba=a110_0x596e,_0x5c937d=fileText(_0x2a2d51);if(_0x2a2d51[_0x5cc3ba(0x12b)]!==SKILL_FILE)return _0x2a2d51;if(hasYamlFrontmatter(_0x5c937d))return{'path':_0x2a2d51[_0x5cc3ba(0x12b)],'content':withSyncedDisplayName(_0x5c937d,_0x174a15)};return{'path':_0x2a2d51[_0x5cc3ba(0x12b)],'content':prependSkillFrontmatter(_0x5c937d,{'name':_0x5b1b32,'displayName':_0x174a15,'description':_0x328a24})};});}function hasYamlFrontmatter(_0x2ed50d){const _0xe50d2=a110_0x596e;return/^\uFEFF?---\s*\r?\n/[_0xe50d2(0x115)](_0x2ed50d);}function prependSkillFrontmatter(_0x571eb,_0x58f6dd){const _0x51ccd6=a110_0x596e,_0x2d9505=_0x571eb['replace'](/^\uFEFF/,'');return['---',_0x51ccd6(0x10a)+yamlString(_0x58f6dd[_0x51ccd6(0x117)]),_0x58f6dd[_0x51ccd6(0xfa)]?_0x51ccd6(0x118)+yamlString(_0x58f6dd[_0x51ccd6(0xfa)]):undefined,'description:\x20'+yamlString(_0x58f6dd['description']),_0x51ccd6(0x12a),'',_0x2d9505]['filter'](_0x4e0703=>_0x4e0703!==undefined)[_0x51ccd6(0x116)]('\x0a');}function yamlString(_0x3abbd8){const _0x5a0094=a110_0x596e;return JSON[_0x5a0094(0x114)](_0x3abbd8[_0x5a0094(0x110)](/\r/g,'')[_0x5a0094(0x11a)]());}function skillDisplayName(_0x473b6f,_0x5f1078){const _0xeb642f=a110_0x596e,_0x4db8fc=_0x473b6f[_0xeb642f(0x125)]?.[_0xeb642f(0x11a)]();return _0x4db8fc||_0x5f1078;}function withSyncedDisplayName(_0x7a0adb,_0x573f4f){const _0x319e3f=a110_0x596e,_0x146d4f=_0x7a0adb[_0x319e3f(0x11d)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x146d4f)return _0x7a0adb;const _0x493745=_0x146d4f[0x1]??'',_0x7ecaee=_0x146d4f[0x2]??'',_0x16271e=parseDocument(_0x7ecaee);if(_0x16271e[_0x319e3f(0x10b)]['length']>0x0||!isMap(_0x16271e[_0x319e3f(0x126)]))return _0x7a0adb;if(_0x573f4f)_0x16271e[_0x319e3f(0x123)]('displayName',_0x573f4f);else{if(_0x16271e['has'](_0x319e3f(0xfa)))_0x16271e[_0x319e3f(0xfe)](_0x319e3f(0xfa));else return _0x7a0adb;}forceBlockCollections(_0x16271e[_0x319e3f(0x126)]);const _0x203a52=_0x16271e[_0x319e3f(0xf9)]({'lineWidth':0x0})[_0x319e3f(0x102)](),_0x541b6e=_0x7a0adb[_0x319e3f(0xff)](_0x146d4f[0x0][_0x319e3f(0x121)])[_0x319e3f(0x110)](/^\r?\n/,'');return _0x493745+_0x319e3f(0x10c)+_0x203a52+_0x319e3f(0x120)+_0x541b6e;}function forceBlockCollections(_0x13c742){if(!isNode(_0x13c742))return;visit(_0x13c742,(_0x4a3d97,_0x124fc)=>{const _0x57145f=a110_0x596e;isCollection(_0x124fc)&&(_0x124fc[_0x57145f(0x113)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x33abdb,_0x56247f,_0x1d8a6e,_0x3e3a91){const _0xf7dcfe=a110_0x596e;if(_0x3e3a91||!existsSync(_0x56247f))return;const _0x51a57b=readMetadataIfPresent(_0x56247f);if(!_0x51a57b)return;const _0x4e465e=_0x51a57b[_0xf7dcfe(0x10d)]&&Object[_0xf7dcfe(0x127)](_0x51a57b[_0xf7dcfe(0x10d)])['length']>0x0?_0x51a57b['fileHashes']:undefined;if(_0x4e465e)for(const [_0x2ed35e,_0x3784ac]of Object[_0xf7dcfe(0x12d)](_0x4e465e)){const _0x243744=resolveManagedFilePath(_0x33abdb,_0x2ed35e);if(!existsSync(_0x243744))throw CliErrors[_0xf7dcfe(0xf7)](_0xf7dcfe(0x119)+_0x33abdb,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x2ed35e);const _0x4e4843=lstatSync(_0x243744);if(!_0x4e4843[_0xf7dcfe(0x11b)]())throw CliErrors[_0xf7dcfe(0xf7)](_0xf7dcfe(0x119)+_0x33abdb,_0xf7dcfe(0x109)+_0x2ed35e);const _0x50bdec=bufferSha256(readFileSync(_0x243744));if(_0x50bdec!==_0x3784ac)throw CliErrors[_0xf7dcfe(0xf7)](_0xf7dcfe(0x119)+_0x33abdb+_0xf7dcfe(0x112)+_0x2ed35e,_0xf7dcfe(0x111)+_0x2ed35e);}else{const _0xa1190d=resolve(_0x33abdb,SKILL_FILE);if(existsSync(_0xa1190d)&&_0x51a57b[_0xf7dcfe(0x106)]){const _0xb41d57=contentHash(readFileSync(_0xa1190d,_0xf7dcfe(0x10f)));if(_0xb41d57!==_0x51a57b[_0xf7dcfe(0x106)])throw CliErrors['validation']('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0xa1190d,_0xf7dcfe(0xfc));}}for(const _0x12aa86 of normalizeLocalFiles(_0x1d8a6e)){if(_0x4e465e?.[_0x12aa86[_0xf7dcfe(0x12b)]])continue;if(!_0x4e465e&&_0x12aa86[_0xf7dcfe(0x12b)]===SKILL_FILE)continue;const _0x243f16=resolveManagedFilePath(_0x33abdb,_0x12aa86[_0xf7dcfe(0x12b)]);if(!existsSync(_0x243f16))continue;const _0x2d32ea=lstatSync(_0x243f16);if(!_0x2d32ea[_0xf7dcfe(0x11b)]())throw CliErrors[_0xf7dcfe(0xf7)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x33abdb,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x12aa86['path']);const _0x106d69=bufferSha256(readFileSync(_0x243f16));if(_0x106d69!==fileHash(_0x12aa86))throw CliErrors[_0xf7dcfe(0xf7)](_0xf7dcfe(0x119)+_0x33abdb,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x12aa86['path']);}}function a110_0x53d2(){const _0x48a80d=['contentHash','find','appCode','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','name:\x20','errors','---\x0a','fileHashes','13252wxOCBY','utf8','replace','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','.\x20Changed\x20file:\x20','flow','stringify','test','join','name','displayName:\x20','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','trim','isFile','564WxSMzB','match','3176kMwouR','10tzQzSO','\x0a---\x0a\x0a','length','paths','set','4997637fAfuqc','skillName','contents','keys','Runtime\x20Skill\x20package\x20is\x20missing\x20','7358466FWHHxf','---','path','accessKey','entries','validation','87XGuQLd','toString','displayName','8742276oYTdPs','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','map','delete','slice','5wYJqbN','84588axbxbW','trimEnd','800zBbpTP','pulledAt','7800815tLmblT'];a110_0x53d2=function(){return _0x48a80d;};return a110_0x53d2();}function materializeFiles(_0x15d46f,_0xf71cd0){const _0x26a62e=a110_0x596e;for(const _0x691f2f of normalizeLocalFiles(_0xf71cd0)){const _0x2c1e08=resolveManagedFilePath(_0x15d46f,_0x691f2f[_0x26a62e(0x12b)]);mkdirSync(dirname(_0x2c1e08),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x2c1e08,fileContent(_0x691f2f),0x180);}}function removeStaleManagedFiles(_0x37c22c,_0x5e54be,_0x302d97){const _0x7de0d5=a110_0x596e;if(!_0x5e54be)return;const _0x6da218=new Set(normalizeLocalFiles(_0x302d97)[_0x7de0d5(0xfd)](_0x506911=>_0x506911['path']));for(const _0x3ffc6d of Object[_0x7de0d5(0x127)](_0x5e54be)){if(_0x6da218['has'](_0x3ffc6d))continue;const _0x5697e1=resolveManagedFilePath(_0x37c22c,_0x3ffc6d);existsSync(_0x5697e1)&&lstatSync(_0x5697e1)['isFile']()&&rmSync(_0x5697e1,{'force':!![]});}}
@@ -1 +1 @@
1
- function a110_0x4887(){const _0x4f62a8=['tags','readonly','858565DDUcHW','3762424tzOTfp','2AAWYPZ','version','length','trim','map','5cXcRGG','3256491BLShRf','sourceSessionId','6541926FmdfnP','forkedFromSkillId','object','tenantCode','manifest','Invalid\x20','703584YEYusx','path','userId','33DfwRWF','fromEntries','forkedFromVersion','isArray','validation','4569550ERUNmo','string','parse','7SzxWOg','zipSha256','description','6833348NgtFSP','toISOString','skillCode','personal','status'];a110_0x4887=function(){return _0x4f62a8;};return a110_0x4887();}(function(_0x2abbce,_0x394abc){const _0x2d0751=a110_0x1105,_0x1e4d6a=_0x2abbce();while(!![]){try{const _0xa307e1=parseInt(_0x2d0751(0x1af))/0x1+-parseInt(_0x2d0751(0x1b1))/0x2*(parseInt(_0x2d0751(0x1b7))/0x3)+-parseInt(_0x2d0751(0x1cd))/0x4*(parseInt(_0x2d0751(0x1b6))/0x5)+parseInt(_0x2d0751(0x1b9))/0x6+parseInt(_0x2d0751(0x1ca))/0x7*(parseInt(_0x2d0751(0x1b0))/0x8)+-parseInt(_0x2d0751(0x1bf))/0x9+parseInt(_0x2d0751(0x1c7))/0xa*(parseInt(_0x2d0751(0x1c2))/0xb);if(_0xa307e1===_0x394abc)break;else _0x1e4d6a['push'](_0x1e4d6a['shift']());}catch(_0x56f330){_0x1e4d6a['push'](_0x1e4d6a['shift']());}}}(a110_0x4887,0xe021c));import{existsSync,readFileSync}from'node:fs';function a110_0x1105(_0x375e4f,_0x3f290c){_0x375e4f=_0x375e4f-0x1ac;const _0x4887f6=a110_0x4887();let _0x1105ca=_0x4887f6[_0x375e4f];return _0x1105ca;}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(_0x1770f6,_0x4d9547,_0x31f046,_0x51963d,_0x4d1405,_0x2e555a,_0x3167fb){const _0x14ae58=a110_0x1105,_0xfe6310=_0x2e555a?normalizeLocalFiles(_0x2e555a):[],_0x5f1b56=!_0x3167fb&&_0xfe6310[_0x14ae58(0x1b3)]>0x0?buildSkillPackage(_0xfe6310):undefined,_0x2353db=_0x3167fb?bufferSha256(_0x3167fb):_0x5f1b56?.[_0x14ae58(0x1bd)][_0x14ae58(0x1cb)],_0x43d03e=_0x3167fb?.['length']??_0x5f1b56?.[_0x14ae58(0x1bd)]['zipSize'],_0x528870=_0xfe6310[_0x14ae58(0x1b3)]>0x0?Object[_0x14ae58(0x1c3)](_0xfe6310[_0x14ae58(0x1b5)](_0x623c97=>[_0x623c97['path'],fileHash(_0x623c97)])):undefined;return{'schemaVersion':_0xfe6310[_0x14ae58(0x1b3)]>0x0?0x2:0x1,'id':_0x1770f6['id'],'appCode':_0x31f046,'skillCode':requireSkillCode(_0x1770f6),'skillName':_0x1770f6['skillName'],'description':_0x1770f6[_0x14ae58(0x1cc)],'scope':_0x4d9547,'readonly':_0x4d9547!==_0x14ae58(0x1d0)||_0x1770f6[_0x14ae58(0x1ae)]===!![],'tenantCode':_0x1770f6[_0x14ae58(0x1bc)],'userId':_0x1770f6[_0x14ae58(0x1c1)],'version':_0x1770f6[_0x14ae58(0x1b2)],'status':_0x1770f6[_0x14ae58(0x1ac)],'tags':Array[_0x14ae58(0x1c5)](_0x1770f6[_0x14ae58(0x1ad)])?_0x1770f6['tags']:[],'hasUpstreamUpdate':_0x1770f6['hasUpstreamUpdate'],'forkedFromSkillId':_0x1770f6[_0x14ae58(0x1ba)],'forkedFromVersion':_0x1770f6[_0x14ae58(0x1c4)],'sourceSessionId':_0x1770f6[_0x14ae58(0x1b8)],'contentHash':_0x51963d,'fileHashes':_0x528870,'treeHash':_0xfe6310[_0x14ae58(0x1b3)]>0x0?fileTreeHash(localFilesToManifestFiles(_0xfe6310)):undefined,'ossPath':remoteManifestOssPath(_0x1770f6['files']),'zipSha256':_0x2353db,'zipSize':_0x43d03e,'files':_0xfe6310[_0x14ae58(0x1b3)]>0x0?_0xfe6310['map'](_0xe2db35=>({'path':_0xe2db35[_0x14ae58(0x1c0)],'hash':fileHash(_0xe2db35),'size':fileContent(_0xe2db35)[_0x14ae58(0x1b3)]})):undefined,'pulledAt':_0x4d1405??new Date()[_0x14ae58(0x1ce)]()};}export function requireSkillCode(_0x1a3f87){const _0x5ee134=a110_0x1105,_0x464c85=_0x1a3f87[_0x5ee134(0x1cf)]?.[_0x5ee134(0x1b4)]();if(!_0x464c85)throw CliErrors[_0x5ee134(0x1c6)]('Runtime\x20Skill\x20is\x20missing\x20skillCode.');return _0x464c85;}export function readMetadataIfPresent(_0x2097cd){const _0x1d4c3a=a110_0x1105;if(!existsSync(_0x2097cd))return undefined;try{const _0x46786d=JSON[_0x1d4c3a(0x1c9)](readFileSync(_0x2097cd,'utf8'));return _0x46786d;}catch{throw CliErrors[_0x1d4c3a(0x1c6)](_0x1d4c3a(0x1be)+METADATA_FILE+':\x20'+_0x2097cd);}}function remoteManifestOssPath(_0x2a15a0){const _0x1fcd79=a110_0x1105;if(!_0x2a15a0||typeof _0x2a15a0!==_0x1fcd79(0x1bb)||Array['isArray'](_0x2a15a0))return undefined;const _0x3af167=_0x2a15a0['ossPath'];return typeof _0x3af167===_0x1fcd79(0x1c8)&&_0x3af167['trim']()?_0x3af167[_0x1fcd79(0x1b4)]():undefined;}
1
+ (function(_0xc2e73c,_0x3d6125){const _0x11788b=a111_0x3b2a,_0x2055ed=_0xc2e73c();while(!![]){try{const _0x44b85c=parseInt(_0x11788b(0xae))/0x1+parseInt(_0x11788b(0xb8))/0x2*(-parseInt(_0x11788b(0xb0))/0x3)+-parseInt(_0x11788b(0xbb))/0x4+parseInt(_0x11788b(0xb3))/0x5*(parseInt(_0x11788b(0xb9))/0x6)+parseInt(_0x11788b(0xaf))/0x7*(-parseInt(_0x11788b(0xc5))/0x8)+parseInt(_0x11788b(0xc4))/0x9+parseInt(_0x11788b(0xb5))/0xa;if(_0x44b85c===_0x3d6125)break;else _0x2055ed['push'](_0x2055ed['shift']());}catch(_0x516c9e){_0x2055ed['push'](_0x2055ed['shift']());}}}(a111_0x4be6,0x9d702));function a111_0x3b2a(_0x2e8186,_0x55a668){_0x2e8186=_0x2e8186-0xab;const _0x4be6c4=a111_0x4be6();let _0x3b2ad6=_0x4be6c4[_0x2e8186];return _0x3b2ad6;}import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';function a111_0x4be6(){const _0x45ab61=['path','files','7167348maRxVL','40roFPqB','sourceSessionId','isArray','status','tags','skillName','zipSha256','forkedFromVersion','description','Runtime\x20Skill\x20is\x20missing\x20skillCode.','74694cvFMgd','1782375ctpJog','3TPlEZM','length','trim','45HXHlJZ','string','23826710HTRNPe','skillCode','manifest','906954DhxxGr','170172xfUDaL','readonly','4550108sNtwfE','userId','version','object','hasUpstreamUpdate','parse','validation'];a111_0x4be6=function(){return _0x45ab61;};return a111_0x4be6();}export function buildMetadata(_0x3bb54f,_0x2fd449,_0x157f1d,_0x81e26,_0x4803da,_0x5d86e1,_0x563e20){const _0x500f89=a111_0x3b2a,_0x500700=_0x5d86e1?normalizeLocalFiles(_0x5d86e1):[],_0x25955c=!_0x563e20&&_0x500700[_0x500f89(0xb1)]>0x0?buildSkillPackage(_0x500700):undefined,_0x5ee8e2=_0x563e20?bufferSha256(_0x563e20):_0x25955c?.[_0x500f89(0xb7)][_0x500f89(0xcb)],_0x131e08=_0x563e20?.[_0x500f89(0xb1)]??_0x25955c?.['manifest']['zipSize'],_0x50ffee=_0x500700[_0x500f89(0xb1)]>0x0?Object['fromEntries'](_0x500700['map'](_0x258068=>[_0x258068[_0x500f89(0xc2)],fileHash(_0x258068)])):undefined;return{'schemaVersion':_0x500700[_0x500f89(0xb1)]>0x0?0x2:0x1,'id':_0x3bb54f['id'],'appCode':_0x157f1d,'skillCode':requireSkillCode(_0x3bb54f),'skillName':_0x3bb54f[_0x500f89(0xca)],'description':_0x3bb54f[_0x500f89(0xac)],'scope':_0x2fd449,'readonly':_0x2fd449!=='personal'||_0x3bb54f[_0x500f89(0xba)]===!![],'tenantCode':_0x3bb54f['tenantCode'],'userId':_0x3bb54f[_0x500f89(0xbc)],'version':_0x3bb54f[_0x500f89(0xbd)],'status':_0x3bb54f[_0x500f89(0xc8)],'tags':Array[_0x500f89(0xc7)](_0x3bb54f[_0x500f89(0xc9)])?_0x3bb54f[_0x500f89(0xc9)]:[],'hasUpstreamUpdate':_0x3bb54f[_0x500f89(0xbf)],'forkedFromSkillId':_0x3bb54f['forkedFromSkillId'],'forkedFromVersion':_0x3bb54f[_0x500f89(0xab)],'sourceSessionId':_0x3bb54f[_0x500f89(0xc6)],'contentHash':_0x81e26,'fileHashes':_0x50ffee,'treeHash':_0x500700[_0x500f89(0xb1)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x500700)):undefined,'ossPath':remoteManifestOssPath(_0x3bb54f[_0x500f89(0xc3)]),'zipSha256':_0x5ee8e2,'zipSize':_0x131e08,'files':_0x500700[_0x500f89(0xb1)]>0x0?_0x500700['map'](_0x240618=>({'path':_0x240618[_0x500f89(0xc2)],'hash':fileHash(_0x240618),'size':fileContent(_0x240618)[_0x500f89(0xb1)]})):undefined,'pulledAt':_0x4803da??new Date()['toISOString']()};}export function requireSkillCode(_0x3ecfc9){const _0x58321e=a111_0x3b2a,_0x1bf28a=_0x3ecfc9[_0x58321e(0xb6)]?.[_0x58321e(0xb2)]();if(!_0x1bf28a)throw CliErrors[_0x58321e(0xc1)](_0x58321e(0xad));return _0x1bf28a;}export function readMetadataIfPresent(_0x29bce2){const _0x5ad12a=a111_0x3b2a;if(!existsSync(_0x29bce2))return undefined;try{const _0x1e2af2=JSON[_0x5ad12a(0xc0)](readFileSync(_0x29bce2,'utf8'));return _0x1e2af2;}catch{throw CliErrors[_0x5ad12a(0xc1)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x29bce2);}}function remoteManifestOssPath(_0x1197f9){const _0x32be36=a111_0x3b2a;if(!_0x1197f9||typeof _0x1197f9!==_0x32be36(0xbe)||Array[_0x32be36(0xc7)](_0x1197f9))return undefined;const _0x40787d=_0x1197f9['ossPath'];return typeof _0x40787d===_0x32be36(0xb4)&&_0x40787d[_0x32be36(0xb2)]()?_0x40787d[_0x32be36(0xb2)]():undefined;}
@@ -1 +1 @@
1
- (function(_0x19cd70,_0x3ad456){const _0x47415f=a111_0x93b3,_0x2d5982=_0x19cd70();while(!![]){try{const _0x3f2f85=parseInt(_0x47415f(0xf9))/0x1*(parseInt(_0x47415f(0xe6))/0x2)+-parseInt(_0x47415f(0xf3))/0x3*(parseInt(_0x47415f(0xf8))/0x4)+-parseInt(_0x47415f(0xfb))/0x5*(-parseInt(_0x47415f(0xeb))/0x6)+parseInt(_0x47415f(0xfc))/0x7+-parseInt(_0x47415f(0xfa))/0x8+-parseInt(_0x47415f(0xf6))/0x9+parseInt(_0x47415f(0xf5))/0xa;if(_0x3f2f85===_0x3ad456)break;else _0x2d5982['push'](_0x2d5982['shift']());}catch(_0x205fb6){_0x2d5982['push'](_0x2d5982['shift']());}}}(a111_0x36b9,0x6a2a0));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';function a111_0x36b9(){const _0x504988=['cacheRoot','996RerQAv','homeDirName','workbuddySkillsDir','CLAUDE_SKILL_ROOT','.claude','trim','claudeSkillsDir','validation','1618653RJEtJN','SKILL_ROOT','12491760EhFYjx','5351922ZHHgQt','.agents','4gLxEFF','15712aBLsal','159264iKBjAH','8530PAUusS','66199Hisuod','appCode','includes','\x20for\x20local\x20path:\x20','homeDir','agentsSkillsDir','cache','.workbuddy','6xBIcbf','filter','skills','skillCode'];a111_0x36b9=function(){return _0x504988;};return a111_0x36b9();}import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x3e9493={}){const _0x4b1107=a111_0x93b3,_0x1e0fd0=_0x3e9493[_0x4b1107(0xe2)]??homedir(),_0x6bd1ea=resolve(_0x1e0fd0,PRODUCT_CONFIG['homeDirName'],_0x4b1107(0xe4)),_0x2ff5d9=trimmedEnv(_0x4b1107(0xf4)),_0x4c6630=trimmedEnv(_0x4b1107(0xee)),_0x1b5618=resolve(_0x1e0fd0,_0x4b1107(0xe5)),_0x11ac5b=_0x3e9493['workbuddySkillsDir']??(existsSync(_0x1b5618)?resolve(_0x1b5618,_0x4b1107(0xe8)):undefined);return{'homeDir':_0x1e0fd0,'cacheRoot':_0x6bd1ea,'managedRoot':resolve(_0x1e0fd0,PRODUCT_CONFIG[_0x4b1107(0xec)]),'agentsSkillsDir':_0x3e9493[_0x4b1107(0xe3)]??_0x2ff5d9??resolve(_0x1e0fd0,_0x4b1107(0xf7),_0x4b1107(0xe8)),'claudeSkillsDir':_0x3e9493[_0x4b1107(0xf1)]??_0x4c6630??resolve(_0x1e0fd0,_0x4b1107(0xef),_0x4b1107(0xe8)),'workbuddySkillsDir':_0x11ac5b};}export function runtimeAgentSkillRoots(_0x16f334){const _0x2b7081=a111_0x93b3;return[_0x16f334[_0x2b7081(0xe3)],_0x16f334['claudeSkillsDir'],_0x16f334[_0x2b7081(0xed)]][_0x2b7081(0xe7)](_0x5b74d7=>Boolean(_0x5b74d7));}export function getRuntimeSkillCacheRoot(_0x530606,_0x51e781,_0x2934f2={}){const _0x16de4a=a111_0x93b3,_0x5b33e=resolveSkillSyncPaths(_0x2934f2);return resolve(_0x5b33e[_0x16de4a(0xea)],_0x530606,fingerprintAccessKey(_0x51e781),'skills');}export function getRuntimeSkillDir(_0xf2255f,_0x1a0a5a,_0x5ba9eb,_0x1bb961,_0x59cfb0,_0x4170f8={}){const _0x246eb7=a111_0x93b3;return resolve(getRuntimeSkillCacheRoot(_0xf2255f,_0x1a0a5a,_0x4170f8),safePathSegment(_0x5ba9eb,_0x246eb7(0xfd)),_0x1bb961,safePathSegment(_0x59cfb0,_0x246eb7(0xe9)));}function a111_0x93b3(_0x1f62ed,_0x10cd8e){_0x1f62ed=_0x1f62ed-0xe2;const _0x36b972=a111_0x36b9();let _0x93b317=_0x36b972[_0x1f62ed];return _0x93b317;}export function safePathSegment(_0x500655,_0x36a318='path\x20segment'){const _0x5e1d18=a111_0x93b3;if(!_0x500655||_0x500655[_0x5e1d18(0xfe)]('/')||_0x500655[_0x5e1d18(0xfe)]('\x5c')||_0x500655['includes']('..'))throw CliErrors[_0x5e1d18(0xf2)]('Unsafe\x20'+_0x36a318+_0x5e1d18(0xff)+_0x500655);return _0x500655;}function trimmedEnv(_0x5e19d6){const _0x490ddc=a111_0x93b3,_0x4945ef=productEnv(_0x5e19d6)?.[_0x490ddc(0xf0)]();return _0x4945ef?_0x4945ef:undefined;}
1
+ (function(_0x1550c1,_0x9eee2){const _0x3fb58c=a112_0x2cf1,_0x1763bf=_0x1550c1();while(!![]){try{const _0x11b62f=-parseInt(_0x3fb58c(0xdf))/0x1+parseInt(_0x3fb58c(0xed))/0x2*(-parseInt(_0x3fb58c(0xdc))/0x3)+parseInt(_0x3fb58c(0xd3))/0x4+parseInt(_0x3fb58c(0xd5))/0x5+-parseInt(_0x3fb58c(0xe2))/0x6*(parseInt(_0x3fb58c(0xd1))/0x7)+parseInt(_0x3fb58c(0xd4))/0x8+parseInt(_0x3fb58c(0xe3))/0x9*(parseInt(_0x3fb58c(0xea))/0xa);if(_0x11b62f===_0x9eee2)break;else _0x1763bf['push'](_0x1763bf['shift']());}catch(_0xdb6029){_0x1763bf['push'](_0x1763bf['shift']());}}}(a112_0x541b,0x2c5e1));import{existsSync}from'node:fs';import{homedir}from'node:os';function a112_0x541b(){const _0x1d2d81=['Unsafe\x20','cacheRoot','1847442KCYGut','2412FAOgqX','\x20for\x20local\x20path:\x20','.agents','appCode','cache','trim','includes','10080deXOMQ','skills','homeDirName','4178NmcjAs','SKILL_ROOT','7CASobn','filter','1398220styIhC','913800TYZeQt','9335UbqvBR','claudeSkillsDir','.claude','skillCode','validation','CLAUDE_SKILL_ROOT','agentsSkillsDir','141rDwVII','.workbuddy','workbuddySkillsDir','147972HbZoSj'];a112_0x541b=function(){return _0x1d2d81;};return a112_0x541b();}import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x3398c6={}){const _0x225054=a112_0x2cf1,_0x34c2d1=_0x3398c6['homeDir']??homedir(),_0x272d57=resolve(_0x34c2d1,PRODUCT_CONFIG[_0x225054(0xec)],_0x225054(0xe7)),_0x504feb=trimmedEnv(_0x225054(0xd0)),_0x2adacd=trimmedEnv(_0x225054(0xda)),_0x144001=resolve(_0x34c2d1,_0x225054(0xdd)),_0x8a37a8=_0x3398c6[_0x225054(0xde)]??(existsSync(_0x144001)?resolve(_0x144001,_0x225054(0xeb)):undefined);return{'homeDir':_0x34c2d1,'cacheRoot':_0x272d57,'managedRoot':resolve(_0x34c2d1,PRODUCT_CONFIG[_0x225054(0xec)]),'agentsSkillsDir':_0x3398c6['agentsSkillsDir']??_0x504feb??resolve(_0x34c2d1,_0x225054(0xe5),_0x225054(0xeb)),'claudeSkillsDir':_0x3398c6[_0x225054(0xd6)]??_0x2adacd??resolve(_0x34c2d1,_0x225054(0xd7),_0x225054(0xeb)),'workbuddySkillsDir':_0x8a37a8};}export function runtimeAgentSkillRoots(_0x28bbbd){const _0xcc23ce=a112_0x2cf1;return[_0x28bbbd[_0xcc23ce(0xdb)],_0x28bbbd[_0xcc23ce(0xd6)],_0x28bbbd[_0xcc23ce(0xde)]][_0xcc23ce(0xd2)](_0x212c89=>Boolean(_0x212c89));}function a112_0x2cf1(_0x138dfa,_0xb23438){_0x138dfa=_0x138dfa-0xd0;const _0x541bec=a112_0x541b();let _0x2cf15b=_0x541bec[_0x138dfa];return _0x2cf15b;}export function getRuntimeSkillCacheRoot(_0x7cf66f,_0xeda472,_0x44d3c2={}){const _0x57d9ea=a112_0x2cf1,_0x24d235=resolveSkillSyncPaths(_0x44d3c2);return resolve(_0x24d235[_0x57d9ea(0xe1)],_0x7cf66f,fingerprintAccessKey(_0xeda472),'skills');}export function getRuntimeSkillDir(_0x1811ab,_0x2bbd32,_0x2eb479,_0x48fd31,_0x143742,_0x6df4dc={}){const _0x4aa1aa=a112_0x2cf1;return resolve(getRuntimeSkillCacheRoot(_0x1811ab,_0x2bbd32,_0x6df4dc),safePathSegment(_0x2eb479,_0x4aa1aa(0xe6)),_0x48fd31,safePathSegment(_0x143742,_0x4aa1aa(0xd8)));}export function safePathSegment(_0x46a40a,_0x1562d4='path\x20segment'){const _0x1ba823=a112_0x2cf1;if(!_0x46a40a||_0x46a40a['includes']('/')||_0x46a40a['includes']('\x5c')||_0x46a40a[_0x1ba823(0xe9)]('..'))throw CliErrors[_0x1ba823(0xd9)](_0x1ba823(0xe0)+_0x1562d4+_0x1ba823(0xe4)+_0x46a40a);return _0x46a40a;}function trimmedEnv(_0x2c5286){const _0x5e5488=a112_0x2cf1,_0x284db7=productEnv(_0x2c5286)?.[_0x5e5488(0xe8)]();return _0x284db7?_0x284db7:undefined;}
@@ -1 +1 @@
1
- (function(_0x962f88,_0x16c713){const _0x330d2b=a112_0xc03e,_0x51d092=_0x962f88();while(!![]){try{const _0x14b86d=parseInt(_0x330d2b(0x191))/0x1*(parseInt(_0x330d2b(0x1b5))/0x2)+parseInt(_0x330d2b(0x192))/0x3+-parseInt(_0x330d2b(0x1bc))/0x4+parseInt(_0x330d2b(0x1a1))/0x5+-parseInt(_0x330d2b(0x1a7))/0x6*(-parseInt(_0x330d2b(0x187))/0x7)+-parseInt(_0x330d2b(0x18e))/0x8+parseInt(_0x330d2b(0x19f))/0x9*(-parseInt(_0x330d2b(0x1aa))/0xa);if(_0x14b86d===_0x16c713)break;else _0x51d092['push'](_0x51d092['shift']());}catch(_0x14a647){_0x51d092['push'](_0x51d092['shift']());}}}(a112_0x29ab,0x1d54e));function a112_0xc03e(_0x49efb1,_0x112c3b){_0x49efb1=_0x49efb1-0x181;const _0x29ab07=a112_0x29ab();let _0xc03ed=_0x29ab07[_0x49efb1];return _0xc03ed;}function a112_0x29ab(){const _0x20f174=['path','36BCjTMB','personal','slice','9950AKIsuK','scope','validation','displayName','Skill\x20metadata\x20appCode\x20\x22','isSymbolicLink','\x20name\x20for\x20SkillHub\x20slug\x20generation.','allowAppCodeRetarget','skillCode','sourceSessionId','tags','58iwOcDV','ignoreMetadataForPayload','builtin','content','match','object','ignoreMetadataScope','496832GpqPSG','Missing\x20','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','replace','\x20has\x20unsupported\x20scope\x20\x22','Remote\x20Skill\x20','dir','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','utf8','123571wzsCmN','trim','Invalid\x20','filter','isFile','\x20has\x20scope=\x22','some','989912GEgdYl','startsWith','Unable\x20to\x20resolve\x20skillCode\x20from\x20','605gOxpmf','671526uxUStT','targetScope','ignoreInvalidMetadata','refreshedAt','length','Skill\x20directory\x20not\x20found:\x20','ignoreMetadataSkillCode','isDirectory','company','string','appCode','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','isArray','153JOJYKX','files','188495RQFCJW','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','version','metadata','skillName'];a112_0x29ab=function(){return _0x20f174;};return a112_0x29ab();}import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a112_0x24bd92}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(_0x3173c1,_0x5e2d65,_0x48778a={}){const _0x6b5723=a112_0xc03e,_0xc97415=resolvePushDirectoryRoot(_0x3173c1),_0x18e2a5=readPushMetadataIfPresent(resolve(_0xc97415,METADATA_FILE),{'ignoreInvalidMetadata':_0x48778a['ignoreInvalidMetadata']});if(_0x18e2a5?.['appCode']&&_0x18e2a5[_0x6b5723(0x19c)]!==_0x5e2d65&&!_0x48778a[_0x6b5723(0x1b1)]&&!_0x48778a['ignoreMetadataAppCodeMismatch'])throw CliErrors[_0x6b5723(0x1ac)](_0x6b5723(0x1ae)+_0x18e2a5[_0x6b5723(0x19c)]+_0x6b5723(0x19d)+_0x5e2d65+'\x22.');const _0x10ce10=resolvePushSkillCode(_0xc97415,_0x5e2d65,_0x18e2a5,_0x48778a);if(!_0x10ce10)throw CliErrors[_0x6b5723(0x1ac)](_0x6b5723(0x190)+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0xc97415,'skillCode':_0x10ce10,'metadata':_0x18e2a5};}export function readPushDirectory(_0x3b4b53,_0x44f5f3,_0x43d854={}){const _0xd1f486=a112_0xc03e,_0xd6c02c=resolvePushDirectoryIdentity(_0x3b4b53,_0x44f5f3,_0x43d854),_0x29c9d4=_0xd6c02c[_0xd1f486(0x184)],_0x1b5cf0=resolve(_0x29c9d4,SKILL_FILE);if(!existsSync(_0x1b5cf0)||!lstatSync(_0x1b5cf0)[_0xd1f486(0x18b)]())throw CliErrors[_0xd1f486(0x1ac)](_0xd1f486(0x1bd)+SKILL_FILE+':\x20'+_0x1b5cf0);const _0x183962=_0xd6c02c[_0xd1f486(0x1a4)],_0x383fcb=_0x43d854[_0xd1f486(0x193)]??'personal';if(!_0x43d854[_0xd1f486(0x1bb)]&&_0x183962?.[_0xd1f486(0x1ab)]===_0xd1f486(0x1b7))throw CliErrors[_0xd1f486(0x1ac)](_0xd1f486(0x1a2)+METADATA_FILE+_0xd1f486(0x18c)+_0x183962['scope']+'\x22.');if(!_0x43d854[_0xd1f486(0x1bb)]&&_0x383fcb===_0xd1f486(0x1a8)&&_0x183962?.[_0xd1f486(0x1ab)]&&_0x183962[_0xd1f486(0x1ab)]!==_0xd1f486(0x1a8))throw CliErrors[_0xd1f486(0x1ac)]('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0xd1f486(0x18c)+_0x183962[_0xd1f486(0x1ab)]+'\x22.',_0xd1f486(0x185)+_0x29c9d4+_0xd1f486(0x1be));const _0x18caaf=scanSkillDirectory(_0x29c9d4),_0x1c94ef=buildSkillPackage(_0x18caaf),_0xd1cb28=readFileSync(_0x1b5cf0,'utf8'),_0x2e2bb2=_0xd6c02c[_0xd1f486(0x1b2)],_0x2ab32d=_0x43d854[_0xd1f486(0x1b6)]?undefined:_0x183962,_0xb6bd7b=readSkillDisplayName(_0xd1cb28);return{'skillCode':_0x2e2bb2,'metadata':_0x183962,'frontmatterDisplayName':_0xb6bd7b,'input':{'skillCode':_0x2e2bb2,'skillName':_0xb6bd7b??_0x2ab32d?.[_0xd1f486(0x1a5)],'description':_0x2ab32d?.['description'],'content':_0xd1cb28,'files':_0x1c94ef['manifest'],'packageBase64':_0x1c94ef['packageBase64'],'tags':_0x2ab32d?.[_0xd1f486(0x1b4)],'version':_0x2ab32d?.[_0xd1f486(0x1a3)],'sourceSessionId':_0x2ab32d?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x14df49,_0x1bf964,_0x32a2d8,_0x59b966={}){const _0x4c9714=a112_0xc03e,_0x1d6186=resolvePushDirectoryRoot(_0x14df49),_0x5104cd=readPushMetadataIfPresent(resolve(_0x1d6186,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x26a2cd=requireRemoteScope(_0x1bf964),_0x15ae9f=readLocalSkillContent(_0x1d6186),_0x21af55={..._0x1bf964,'appCode':_0x1bf964['appCode']??_0x32a2d8,'skillName':_0x1bf964[_0x4c9714(0x1a5)]??_0x5104cd?.['skillName'],'description':_0x1bf964['description']??_0x5104cd?.['description'],'tags':Array[_0x4c9714(0x19e)](_0x1bf964[_0x4c9714(0x1b4)])?_0x1bf964[_0x4c9714(0x1b4)]:_0x5104cd?.[_0x4c9714(0x1b4)],'sourceSessionId':_0x1bf964[_0x4c9714(0x1b3)]??_0x5104cd?.['sourceSessionId'],'content':_0x1bf964['content']??_0x15ae9f},_0x16ab33=buildMetadata(_0x21af55,_0x26a2cd,_0x32a2d8,contentHash(_0x15ae9f),_0x59b966[_0x4c9714(0x195)]);writeJsonAtomic(resolve(_0x1d6186,METADATA_FILE),_0x16ab33);}export function recordPushedRuntimeSkill(_0x4a25c7,_0x49e5d6,_0x30655c,_0x2749b7={}){const _0x171ff4=a112_0xc03e,_0x5c9f8f=resolvePushDirectoryRoot(_0x4a25c7),_0x2bc505=scanSkillDirectory(_0x5c9f8f),_0x5cbdb6=_0x2bc505['find'](_0x2585bd=>_0x2585bd['path']===SKILL_FILE),_0x445c7c=_0x5cbdb6?fileText(_0x5cbdb6):'',_0x31648c=tryNormalizePackageManifest(_0x49e5d6[_0x171ff4(0x1a0)]),_0x210b43={..._0x49e5d6,'content':_0x49e5d6[_0x171ff4(0x1b8)]??_0x445c7c,'files':_0x31648c},_0x369236=_0x31648c?normalizeLocalFiles(_0x2bc505)[_0x171ff4(0x18a)](_0x55c210=>_0x31648c[_0x171ff4(0x1a0)][_0x171ff4(0x18d)](_0x50f254=>_0x50f254[_0x171ff4(0x1a6)]===_0x55c210[_0x171ff4(0x1a6)])):undefined,_0x1f702f=buildMetadata(_0x210b43,_0x2749b7[_0x171ff4(0x1ab)]??_0x171ff4(0x1a8),_0x30655c,contentHash(_0x210b43['content']??''),_0x2749b7['pushedAt'],_0x369236);writeJsonAtomic(resolve(_0x5c9f8f,METADATA_FILE),_0x1f702f);}export function deriveSkillCodeFromDirectory(_0x1cad57,_0x3bb2fd){const _0x498137=a112_0xc03e,_0x156379=basename(resolve(_0x1cad57)),_0x83bd85=_0x3bb2fd+'--';return _0x156379[_0x498137(0x18f)](_0x83bd85)?_0x156379[_0x498137(0x1a9)](_0x83bd85[_0x498137(0x196)]):_0x156379;}function resolvePushSkillCode(_0x13f2ee,_0x7c8d2b,_0x315019,_0x2b166b){const _0x5f25eb=a112_0xc03e,_0x2bdeb0=deriveSkillCodeFromSkillFile(_0x13f2ee)||deriveSkillCodeFromDirectory(_0x13f2ee,_0x7c8d2b);if(_0x2b166b[_0x5f25eb(0x198)])return _0x2bdeb0;return _0x315019?.[_0x5f25eb(0x1b2)]?.[_0x5f25eb(0x188)]()||_0x2bdeb0;}function deriveSkillCodeFromSkillFile(_0x350b96){const _0x4cd742=a112_0xc03e,_0x3c31e8=resolve(_0x350b96,SKILL_FILE);if(!existsSync(_0x3c31e8)||!lstatSync(_0x3c31e8)[_0x4cd742(0x18b)]())return undefined;const _0x29ff6c=readFileSync(_0x3c31e8,_0x4cd742(0x186)),_0x1542bc=_0x29ff6c[_0x4cd742(0x1b9)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1542bc)return undefined;const _0x4186c9=parseFrontmatterObject(_0x1542bc[0x1]??''),_0x2f622f=scalarToString(_0x4186c9?.['name']);return _0x2f622f?slugifySkillName(_0x2f622f):undefined;}function readSkillDisplayName(_0x321f96){const _0x492687=a112_0xc03e,_0x875c3d=_0x321f96['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x875c3d)return undefined;const _0x37a74a=parseFrontmatterObject(_0x875c3d[0x1]??'');return scalarToString(_0x37a74a?.[_0x492687(0x1ad)]);}function slugifySkillName(_0x3b2372){const _0x30e742=a112_0xc03e,_0x2e782c=_0x3b2372[_0x30e742(0x188)]()['toLowerCase']()[_0x30e742(0x181)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x30e742(0x181)](/^-+/,'')[_0x30e742(0x181)](/-+$/,'')[_0x30e742(0x181)](/-{2,}/g,'-');if(!_0x2e782c)throw CliErrors[_0x30e742(0x1ac)](_0x30e742(0x189)+SKILL_FILE+_0x30e742(0x1b0));return _0x2e782c;}function parseFrontmatterObject(_0x4bb345){const _0x4875da=a112_0xc03e;try{const _0x2951d4=a112_0x24bd92(_0x4bb345);return _0x2951d4&&typeof _0x2951d4===_0x4875da(0x1ba)&&!Array[_0x4875da(0x19e)](_0x2951d4)?_0x2951d4:undefined;}catch{return undefined;}}function scalarToString(_0x595955){const _0x3ac472=a112_0xc03e;if(typeof _0x595955===_0x3ac472(0x19b))return _0x595955[_0x3ac472(0x188)]();if(typeof _0x595955==='number'||typeof _0x595955==='boolean')return String(_0x595955);return undefined;}function resolvePushDirectoryRoot(_0x2698a4){const _0x4c0009=a112_0xc03e,_0x46b52f=resolve(_0x2698a4);if(!existsSync(_0x46b52f))throw CliErrors[_0x4c0009(0x1ac)](_0x4c0009(0x197)+_0x2698a4);const _0x5a5e22=lstatSync(_0x46b52f);if(_0x5a5e22['isDirectory']())return _0x46b52f;if(_0x5a5e22[_0x4c0009(0x1af)]()){const _0x3160a8=realpathSync(_0x46b52f);if(lstatSync(_0x3160a8)[_0x4c0009(0x199)]())return _0x3160a8;}throw CliErrors[_0x4c0009(0x1ac)](_0x4c0009(0x197)+_0x2698a4);}function requireRemoteScope(_0x14d96b){const _0x5c552c=a112_0xc03e;if(_0x14d96b[_0x5c552c(0x1ab)]==='personal'||_0x14d96b[_0x5c552c(0x1ab)]===_0x5c552c(0x19a)||_0x14d96b[_0x5c552c(0x1ab)]===_0x5c552c(0x1b7))return _0x14d96b['scope'];throw CliErrors[_0x5c552c(0x1ac)](_0x5c552c(0x183)+(_0x14d96b[_0x5c552c(0x1b2)]||'(unknown)')+_0x5c552c(0x182)+(_0x14d96b['scope']??'unknown')+'\x22.');}function readLocalSkillContent(_0xc33e17){const _0x28f7b0=a112_0xc03e,_0x4b433e=resolve(_0xc33e17,SKILL_FILE);return existsSync(_0x4b433e)&&lstatSync(_0x4b433e)[_0x28f7b0(0x18b)]()?readFileSync(_0x4b433e,_0x28f7b0(0x186)):'';}function readPushMetadataIfPresent(_0x29e8f4,_0x11a40c={}){const _0x4b6017=a112_0xc03e;try{return readMetadataIfPresent(_0x29e8f4);}catch(_0x3df6bb){if(_0x11a40c[_0x4b6017(0x194)])return undefined;throw _0x3df6bb;}}
1
+ (function(_0x48889c,_0x1ffce1){const _0x5208a7=a113_0x4b73,_0x431f50=_0x48889c();while(!![]){try{const _0x1fac26=parseInt(_0x5208a7(0x141))/0x1*(parseInt(_0x5208a7(0x144))/0x2)+-parseInt(_0x5208a7(0x13b))/0x3+-parseInt(_0x5208a7(0x148))/0x4*(parseInt(_0x5208a7(0x163))/0x5)+-parseInt(_0x5208a7(0x14c))/0x6+parseInt(_0x5208a7(0x138))/0x7+parseInt(_0x5208a7(0x16b))/0x8*(-parseInt(_0x5208a7(0x151))/0x9)+parseInt(_0x5208a7(0x14a))/0xa*(parseInt(_0x5208a7(0x134))/0xb);if(_0x1fac26===_0x1ffce1)break;else _0x431f50['push'](_0x431f50['shift']());}catch(_0x5bc656){_0x431f50['push'](_0x431f50['shift']());}}}(a113_0x4c61,0x4e30a));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';function a113_0x4b73(_0x12f1eb,_0x5dfa8e){_0x12f1eb=_0x12f1eb-0x130;const _0x4c6179=a113_0x4c61();let _0x4b731f=_0x4c6179[_0x12f1eb];return _0x4b731f;}import{parse as a113_0x3170b0}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';function a113_0x4c61(){const _0xa757fb=['packageBase64','length','39915wUaBbc','pushedAt','skillCode','ignoreMetadataSkillCode','replace','dir','Skill\x20directory\x20not\x20found:\x20','scope','object','tags','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','string','Unable\x20to\x20resolve\x20skillCode\x20from\x20','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','description','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','metadata','Invalid\x20','421165WncpIa','some','content','utf8','personal','manifest','number','displayName','616JBxrTG','skillName','sourceSessionId','appCode','isArray','ignoreInvalidMetadata','66TFhJiB','isFile','allowAppCodeRetarget','path','2498062VAbPlM','isDirectory','Missing\x20','334797sHyxuN','validation','builtin','trim','files','filter','277YwzbTd','boolean','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','1270JSEPeV','\x20has\x20scope=\x22','match','\x20has\x20unsupported\x20scope\x20\x22','12hNAtrx','targetScope','1121100RrGIgl','toLowerCase','1076172fcVNQZ','find','refreshedAt'];a113_0x4c61=function(){return _0xa757fb;};return a113_0x4c61();}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(_0xa34f70,_0x44d3ee,_0x418a9c={}){const _0x12306e=a113_0x4b73,_0x392a76=resolvePushDirectoryRoot(_0xa34f70),_0x1e106a=readPushMetadataIfPresent(resolve(_0x392a76,METADATA_FILE),{'ignoreInvalidMetadata':_0x418a9c[_0x12306e(0x133)]});if(_0x1e106a?.[_0x12306e(0x131)]&&_0x1e106a['appCode']!==_0x44d3ee&&!_0x418a9c[_0x12306e(0x136)]&&!_0x418a9c['ignoreMetadataAppCodeMismatch'])throw CliErrors[_0x12306e(0x13c)]('Skill\x20metadata\x20appCode\x20\x22'+_0x1e106a[_0x12306e(0x131)]+_0x12306e(0x160)+_0x44d3ee+'\x22.');const _0x3b4d3e=resolvePushSkillCode(_0x392a76,_0x44d3ee,_0x1e106a,_0x418a9c);if(!_0x3b4d3e)throw CliErrors[_0x12306e(0x13c)](_0x12306e(0x15d)+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0x392a76,'skillCode':_0x3b4d3e,'metadata':_0x1e106a};}export function readPushDirectory(_0xd0eb1,_0x193703,_0x5f4105={}){const _0x3259f=a113_0x4b73,_0x29461f=resolvePushDirectoryIdentity(_0xd0eb1,_0x193703,_0x5f4105),_0x40a4d1=_0x29461f[_0x3259f(0x156)],_0x2e775c=resolve(_0x40a4d1,SKILL_FILE);if(!existsSync(_0x2e775c)||!lstatSync(_0x2e775c)[_0x3259f(0x135)]())throw CliErrors[_0x3259f(0x13c)](_0x3259f(0x13a)+SKILL_FILE+':\x20'+_0x2e775c);const _0x35a6fe=_0x29461f[_0x3259f(0x161)],_0x110caa=_0x5f4105[_0x3259f(0x149)]??_0x3259f(0x167);if(!_0x5f4105['ignoreMetadataScope']&&_0x35a6fe?.[_0x3259f(0x158)]===_0x3259f(0x13d))throw CliErrors[_0x3259f(0x13c)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x3259f(0x145)+_0x35a6fe['scope']+'\x22.');if(!_0x5f4105['ignoreMetadataScope']&&_0x110caa==='personal'&&_0x35a6fe?.['scope']&&_0x35a6fe[_0x3259f(0x158)]!==_0x3259f(0x167))throw CliErrors[_0x3259f(0x13c)](_0x3259f(0x15b)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x35a6fe[_0x3259f(0x158)]+'\x22.',_0x3259f(0x143)+_0x40a4d1+_0x3259f(0x15e));const _0x24aa86=scanSkillDirectory(_0x40a4d1),_0x374d19=buildSkillPackage(_0x24aa86),_0x2bf6e3=readFileSync(_0x2e775c,_0x3259f(0x166)),_0xa2be51=_0x29461f[_0x3259f(0x153)],_0x401983=_0x5f4105['ignoreMetadataForPayload']?undefined:_0x35a6fe,_0x1d8d02=readSkillDisplayName(_0x2bf6e3);return{'skillCode':_0xa2be51,'metadata':_0x35a6fe,'frontmatterDisplayName':_0x1d8d02,'input':{'skillCode':_0xa2be51,'skillName':_0x1d8d02??_0x401983?.[_0x3259f(0x16c)],'description':_0x401983?.[_0x3259f(0x15f)],'content':_0x2bf6e3,'files':_0x374d19[_0x3259f(0x168)],'packageBase64':_0x374d19[_0x3259f(0x14f)],'tags':_0x401983?.[_0x3259f(0x15a)],'version':_0x401983?.['version'],'sourceSessionId':_0x401983?.[_0x3259f(0x130)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x491048,_0x1e485d,_0x1849e5,_0x42f235={}){const _0x1c6883=a113_0x4b73,_0x31d4b2=resolvePushDirectoryRoot(_0x491048),_0x28c8d9=readPushMetadataIfPresent(resolve(_0x31d4b2,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x1670be=requireRemoteScope(_0x1e485d),_0x4fb38b=readLocalSkillContent(_0x31d4b2),_0x2f968e={..._0x1e485d,'appCode':_0x1e485d[_0x1c6883(0x131)]??_0x1849e5,'skillName':_0x1e485d[_0x1c6883(0x16c)]??_0x28c8d9?.[_0x1c6883(0x16c)],'description':_0x1e485d['description']??_0x28c8d9?.[_0x1c6883(0x15f)],'tags':Array[_0x1c6883(0x132)](_0x1e485d[_0x1c6883(0x15a)])?_0x1e485d[_0x1c6883(0x15a)]:_0x28c8d9?.[_0x1c6883(0x15a)],'sourceSessionId':_0x1e485d[_0x1c6883(0x130)]??_0x28c8d9?.[_0x1c6883(0x130)],'content':_0x1e485d[_0x1c6883(0x165)]??_0x4fb38b},_0x506069=buildMetadata(_0x2f968e,_0x1670be,_0x1849e5,contentHash(_0x4fb38b),_0x42f235[_0x1c6883(0x14e)]);writeJsonAtomic(resolve(_0x31d4b2,METADATA_FILE),_0x506069);}export function recordPushedRuntimeSkill(_0x1f6022,_0x25af65,_0x391305,_0x17b078={}){const _0x39f138=a113_0x4b73,_0x126feb=resolvePushDirectoryRoot(_0x1f6022),_0x378555=scanSkillDirectory(_0x126feb),_0x1c34a5=_0x378555[_0x39f138(0x14d)](_0x582877=>_0x582877[_0x39f138(0x137)]===SKILL_FILE),_0x31a24a=_0x1c34a5?fileText(_0x1c34a5):'',_0x3f800f=tryNormalizePackageManifest(_0x25af65[_0x39f138(0x13f)]),_0x466468={..._0x25af65,'content':_0x25af65[_0x39f138(0x165)]??_0x31a24a,'files':_0x3f800f},_0xc9c838=_0x3f800f?normalizeLocalFiles(_0x378555)[_0x39f138(0x140)](_0x5a34a9=>_0x3f800f[_0x39f138(0x13f)][_0x39f138(0x164)](_0x3532bb=>_0x3532bb[_0x39f138(0x137)]===_0x5a34a9[_0x39f138(0x137)])):undefined,_0x22eb53=buildMetadata(_0x466468,_0x17b078['scope']??'personal',_0x391305,contentHash(_0x466468[_0x39f138(0x165)]??''),_0x17b078[_0x39f138(0x152)],_0xc9c838);writeJsonAtomic(resolve(_0x126feb,METADATA_FILE),_0x22eb53);}export function deriveSkillCodeFromDirectory(_0x40f2c1,_0x17ee25){const _0x3a3fac=a113_0x4b73,_0x4313ea=basename(resolve(_0x40f2c1)),_0x5c30e2=_0x17ee25+'--';return _0x4313ea['startsWith'](_0x5c30e2)?_0x4313ea['slice'](_0x5c30e2[_0x3a3fac(0x150)]):_0x4313ea;}function resolvePushSkillCode(_0x5ee196,_0x18b9aa,_0x33271a,_0x4d2d69){const _0x476043=a113_0x4b73,_0x2b01ea=deriveSkillCodeFromSkillFile(_0x5ee196)||deriveSkillCodeFromDirectory(_0x5ee196,_0x18b9aa);if(_0x4d2d69[_0x476043(0x154)])return _0x2b01ea;return _0x33271a?.[_0x476043(0x153)]?.['trim']()||_0x2b01ea;}function deriveSkillCodeFromSkillFile(_0x68b405){const _0x3bdeff=a113_0x4b73,_0x3bfdbe=resolve(_0x68b405,SKILL_FILE);if(!existsSync(_0x3bfdbe)||!lstatSync(_0x3bfdbe)[_0x3bdeff(0x135)]())return undefined;const _0xc82e68=readFileSync(_0x3bfdbe,_0x3bdeff(0x166)),_0xc51291=_0xc82e68['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0xc51291)return undefined;const _0x57e1c2=parseFrontmatterObject(_0xc51291[0x1]??''),_0x367a3f=scalarToString(_0x57e1c2?.['name']);return _0x367a3f?slugifySkillName(_0x367a3f):undefined;}function readSkillDisplayName(_0x2a8bef){const _0x4b952d=a113_0x4b73,_0x47a4aa=_0x2a8bef[_0x4b952d(0x146)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x47a4aa)return undefined;const _0x35742f=parseFrontmatterObject(_0x47a4aa[0x1]??'');return scalarToString(_0x35742f?.[_0x4b952d(0x16a)]);}function slugifySkillName(_0x905262){const _0x1b9f0a=a113_0x4b73,_0x4d3775=_0x905262['trim']()[_0x1b9f0a(0x14b)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x1b9f0a(0x155)](/^-+/,'')[_0x1b9f0a(0x155)](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x4d3775)throw CliErrors[_0x1b9f0a(0x13c)](_0x1b9f0a(0x162)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x4d3775;}function parseFrontmatterObject(_0x1fe6f1){const _0x23740f=a113_0x4b73;try{const _0x5ee561=a113_0x3170b0(_0x1fe6f1);return _0x5ee561&&typeof _0x5ee561===_0x23740f(0x159)&&!Array[_0x23740f(0x132)](_0x5ee561)?_0x5ee561:undefined;}catch{return undefined;}}function scalarToString(_0x3d3d68){const _0x8190ff=a113_0x4b73;if(typeof _0x3d3d68===_0x8190ff(0x15c))return _0x3d3d68[_0x8190ff(0x13e)]();if(typeof _0x3d3d68===_0x8190ff(0x169)||typeof _0x3d3d68===_0x8190ff(0x142))return String(_0x3d3d68);return undefined;}function resolvePushDirectoryRoot(_0x7e7405){const _0x2445a3=a113_0x4b73,_0x4440ea=resolve(_0x7e7405);if(!existsSync(_0x4440ea))throw CliErrors[_0x2445a3(0x13c)](_0x2445a3(0x157)+_0x7e7405);const _0x420608=lstatSync(_0x4440ea);if(_0x420608['isDirectory']())return _0x4440ea;if(_0x420608['isSymbolicLink']()){const _0x3569cd=realpathSync(_0x4440ea);if(lstatSync(_0x3569cd)[_0x2445a3(0x139)]())return _0x3569cd;}throw CliErrors[_0x2445a3(0x13c)]('Skill\x20directory\x20not\x20found:\x20'+_0x7e7405);}function requireRemoteScope(_0xb91208){const _0x3fbcb4=a113_0x4b73;if(_0xb91208[_0x3fbcb4(0x158)]===_0x3fbcb4(0x167)||_0xb91208['scope']==='company'||_0xb91208[_0x3fbcb4(0x158)]===_0x3fbcb4(0x13d))return _0xb91208[_0x3fbcb4(0x158)];throw CliErrors[_0x3fbcb4(0x13c)]('Remote\x20Skill\x20'+(_0xb91208[_0x3fbcb4(0x153)]||'(unknown)')+_0x3fbcb4(0x147)+(_0xb91208[_0x3fbcb4(0x158)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x166eb5){const _0x5461b5=a113_0x4b73,_0x1c7076=resolve(_0x166eb5,SKILL_FILE);return existsSync(_0x1c7076)&&lstatSync(_0x1c7076)[_0x5461b5(0x135)]()?readFileSync(_0x1c7076,_0x5461b5(0x166)):'';}function readPushMetadataIfPresent(_0x599486,_0x570c35={}){try{return readMetadataIfPresent(_0x599486);}catch(_0x3250b9){if(_0x570c35['ignoreInvalidMetadata'])return undefined;throw _0x3250b9;}}
@@ -1 +1 @@
1
- (function(_0x277692,_0x43950b){const _0x45e6fb=a113_0x120f,_0x48fc06=_0x277692();while(!![]){try{const _0x40c58a=-parseInt(_0x45e6fb(0xa6))/0x1*(parseInt(_0x45e6fb(0x9e))/0x2)+-parseInt(_0x45e6fb(0x9b))/0x3*(parseInt(_0x45e6fb(0x99))/0x4)+-parseInt(_0x45e6fb(0xa2))/0x5+-parseInt(_0x45e6fb(0xa4))/0x6*(-parseInt(_0x45e6fb(0x9f))/0x7)+-parseInt(_0x45e6fb(0xa9))/0x8+-parseInt(_0x45e6fb(0xa8))/0x9*(parseInt(_0x45e6fb(0xa7))/0xa)+parseInt(_0x45e6fb(0x98))/0xb;if(_0x40c58a===_0x43950b)break;else _0x48fc06['push'](_0x48fc06['shift']());}catch(_0x1b588d){_0x48fc06['push'](_0x48fc06['shift']());}}}(a113_0x15bb,0xd54e8));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x2f7442){const _0x5ef2fb=a113_0x120f,_0x4e3119=_0x2f7442&&_0x2f7442[_0x5ef2fb(0x9d)]>0x0?_0x2f7442:[_0x5ef2fb(0x9a),'company',_0x5ef2fb(0xa0)],_0x570d69=[];for(const _0x29ec1e of _0x4e3119){if(!isRuntimeSkillScope(_0x29ec1e))throw CliErrors[_0x5ef2fb(0x9c)]('Unsupported\x20runtime\x20Skill\x20scope:\x20'+_0x29ec1e);!_0x570d69[_0x5ef2fb(0xa3)](_0x29ec1e)&&_0x570d69[_0x5ef2fb(0xa5)](_0x29ec1e);}return _0x570d69;}function a113_0x120f(_0x19bb60,_0x2a0317){_0x19bb60=_0x19bb60-0x98;const _0x15bb81=a113_0x15bb();let _0x120f26=_0x15bb81[_0x19bb60];return _0x120f26;}export function isRuntimeSkillScope(_0x5a1150){const _0x3b2243=a113_0x120f;return _0x5a1150==='personal'||_0x5a1150===_0x3b2243(0xa1)||_0x5a1150===_0x3b2243(0xa0);}function a113_0x15bb(){const _0xb0d568=['510759ETXsZt','2806768IykqTm','53815267jeLeIQ','1656pJqsWm','personal','8997ZfRdIh','validation','length','2nquEAJ','3767743gccteY','builtin','company','5581980WZQAlF','includes','6zbNulM','push','883247BMXPQV','170JFPLoL'];a113_0x15bb=function(){return _0xb0d568;};return a113_0x15bb();}
1
+ function a114_0x4bdf(_0x4a8567,_0x3f9c74){_0x4a8567=_0x4a8567-0x1c8;const _0x126828=a114_0x1268();let _0x4bdf8e=_0x126828[_0x4a8567];return _0x4bdf8e;}(function(_0x1c306e,_0x5db681){const _0x9a291e=a114_0x4bdf,_0x47d8e2=_0x1c306e();while(!![]){try{const _0x866146=-parseInt(_0x9a291e(0x1cf))/0x1*(-parseInt(_0x9a291e(0x1d7))/0x2)+parseInt(_0x9a291e(0x1c9))/0x3+parseInt(_0x9a291e(0x1d6))/0x4+parseInt(_0x9a291e(0x1d4))/0x5*(parseInt(_0x9a291e(0x1c8))/0x6)+parseInt(_0x9a291e(0x1cb))/0x7+parseInt(_0x9a291e(0x1d5))/0x8*(-parseInt(_0x9a291e(0x1cd))/0x9)+-parseInt(_0x9a291e(0x1ce))/0xa;if(_0x866146===_0x5db681)break;else _0x47d8e2['push'](_0x47d8e2['shift']());}catch(_0xe14124){_0x47d8e2['push'](_0x47d8e2['shift']());}}}(a114_0x1268,0x8c323));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x1f1fc9){const _0x396470=a114_0x4bdf,_0x44152b=_0x1f1fc9&&_0x1f1fc9['length']>0x0?_0x1f1fc9:[_0x396470(0x1d1),_0x396470(0x1d2),_0x396470(0x1d0)],_0x30bae8=[];for(const _0x354302 of _0x44152b){if(!isRuntimeSkillScope(_0x354302))throw CliErrors['validation'](_0x396470(0x1cc)+_0x354302);!_0x30bae8[_0x396470(0x1ca)](_0x354302)&&_0x30bae8[_0x396470(0x1d3)](_0x354302);}return _0x30bae8;}export function isRuntimeSkillScope(_0x50211b){const _0x2a01a6=a114_0x4bdf;return _0x50211b===_0x2a01a6(0x1d1)||_0x50211b===_0x2a01a6(0x1d2)||_0x50211b===_0x2a01a6(0x1d0);}function a114_0x1268(){const _0x12e985=['7895Gbmeux','1330544EaslNR','665108yZCmuD','368642WyIkne','1254VlTjMR','2260614NDDBzI','includes','2475326RwpASZ','Unsupported\x20runtime\x20Skill\x20scope:\x20','45IlCkmt','5662530hlLTRj','2aNdKmy','builtin','personal','company','push'];a114_0x1268=function(){return _0x12e985;};return a114_0x1268();}
@@ -6,6 +6,23 @@ export interface SkillSyncPathsOptions {
6
6
  claudeSkillsDir?: string;
7
7
  workbuddySkillsDir?: string;
8
8
  }
9
+ export type RuntimeSkillInstallScope = "project" | "global";
10
+ export interface RuntimeSkillInstallTargetOptions extends SkillSyncPathsOptions {
11
+ /** Project directory that owns `.agents/skills`; defaults to the current working directory. */
12
+ cwd?: string;
13
+ }
14
+ /**
15
+ * Resolved installation target for effective runtime Skill links.
16
+ *
17
+ * Callers choose only project or global scope. Root selection, link naming, and
18
+ * managed-cache ownership remain implementation details of runtime-skill-sync.
19
+ */
20
+ export interface RuntimeSkillInstallTarget {
21
+ scope: RuntimeSkillInstallScope;
22
+ appCode: string;
23
+ skillRoots: readonly string[];
24
+ managedRoot: string;
25
+ }
9
26
  export interface SkillSyncPaths {
10
27
  homeDir: string;
11
28
  cacheRoot: string;
@@ -1 +1 @@
1
- const a115_0x1eb6ad=a115_0x1785;(function(_0x475a9f,_0x41b045){const _0x229438=a115_0x1785,_0x2da757=_0x475a9f();while(!![]){try{const _0x595cb3=-parseInt(_0x229438(0xdd))/0x1*(parseInt(_0x229438(0xcd))/0x2)+parseInt(_0x229438(0xca))/0x3+-parseInt(_0x229438(0xd8))/0x4+parseInt(_0x229438(0xde))/0x5+-parseInt(_0x229438(0xd7))/0x6+parseInt(_0x229438(0xd5))/0x7*(-parseInt(_0x229438(0xc9))/0x8)+parseInt(_0x229438(0xd1))/0x9;if(_0x595cb3===_0x41b045)break;else _0x2da757['push'](_0x2da757['shift']());}catch(_0x2bca63){_0x2da757['push'](_0x2da757['shift']());}}}(a115_0x4a2e,0xeef6e));import{unzipSync,zipSync}from'fflate';function a115_0x1785(_0x3e3073,_0xd974cf){_0x3e3073=_0x3e3073-0xc9;const _0x4a2e0c=a115_0x4a2e();let _0x1785dd=_0x4a2e0c[_0x3e3073];return _0x1785dd;}import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a115_0x1eb6ad(0xcc));function a115_0x4a2e(){const _0x53120e=['sort','35317134aKiyTU','name','endsWith','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','2541ayQcxP','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','1681314aTMYNo','5636084UNipMZ','object','length','entries','validation','23853XnCrZe','7252495cOIBAI','37640cRZAxS','2156232UWsrKo','from','1980-01-01T00:00:00.000Z','144smVYPM','code','validation_error'];a115_0x4a2e=function(){return _0x53120e;};return a115_0x4a2e();}export function createDeterministicZipPackage(_0x261ca1){const _0x4b2e7b=a115_0x1eb6ad,_0x18be98={};for(const _0x17a3a1 of normalizeLocalFiles(_0x261ca1)){_0x18be98[_0x17a3a1['path']]=fileContent(_0x17a3a1);}return Buffer[_0x4b2e7b(0xcb)](zipSync(_0x18be98,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x355db9){const _0x44e2c8=a115_0x1eb6ad;if(_0x355db9[_0x44e2c8(0xda)]<0x16)throw CliErrors[_0x44e2c8(0xdc)](_0x44e2c8(0xd6));let _0x2d7cc3;try{_0x2d7cc3=unzipSync(_0x355db9,{'filter'(_0x49288){const _0x2f99b3=_0x44e2c8,_0x55aabb=normalizeSkillRelativePath(_0x49288[_0x2f99b3(0xd2)]);if(_0x55aabb[_0x2f99b3(0xd3)]('/'))throw CliErrors[_0x2f99b3(0xdc)](_0x2f99b3(0xd4)+_0x55aabb);return!![];}});}catch(_0x3c60b8){if(isRuntimeSkillValidationError(_0x3c60b8))throw _0x3c60b8;throw CliErrors[_0x44e2c8(0xdc)](_0x44e2c8(0xd6));}return Object[_0x44e2c8(0xdb)](_0x2d7cc3)['map'](([_0x155bc1,_0x33429e])=>({'path':normalizeSkillRelativePath(_0x155bc1),'bytes':Buffer[_0x44e2c8(0xcb)](_0x33429e)}))[_0x44e2c8(0xd0)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x1ad2a5){const _0x48eb88=a115_0x1eb6ad;return typeof _0x1ad2a5===_0x48eb88(0xd9)&&_0x1ad2a5!==null&&_0x48eb88(0xce)in _0x1ad2a5&&_0x1ad2a5[_0x48eb88(0xce)]===_0x48eb88(0xcf);}
1
+ const a116_0x337530=a116_0x2a0a;function a116_0x3f3f(){const _0x48421d=['code','sort','map','endsWith','validation','from','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','object','11695gIDuYH','path','293783fIgXkE','1980-01-01T00:00:00.000Z','validation_error','length','2ZBNdbo','648LDnIhR','322426FzpSZX','830brIynX','5377702AODkoV','1383357woVpyd','4poryFs','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','26694czAJZu','7bLebee','1644ZbijjN','name','2699624nGOPHL','entries'];a116_0x3f3f=function(){return _0x48421d;};return a116_0x3f3f();}(function(_0x56e0f5,_0x7600c2){const _0x4b9a49=a116_0x2a0a,_0x2573e1=_0x56e0f5();while(!![]){try{const _0x21043f=parseInt(_0x4b9a49(0xb8))/0x1*(parseInt(_0x4b9a49(0xbc))/0x2)+parseInt(_0x4b9a49(0xc1))/0x3*(parseInt(_0x4b9a49(0xc2))/0x4)+parseInt(_0x4b9a49(0xd2))/0x5*(-parseInt(_0x4b9a49(0xc6))/0x6)+-parseInt(_0x4b9a49(0xc5))/0x7*(parseInt(_0x4b9a49(0xc8))/0x8)+parseInt(_0x4b9a49(0xc4))/0x9*(-parseInt(_0x4b9a49(0xbf))/0xa)+-parseInt(_0x4b9a49(0xc0))/0xb+-parseInt(_0x4b9a49(0xbd))/0xc*(-parseInt(_0x4b9a49(0xbe))/0xd);if(_0x21043f===_0x7600c2)break;else _0x2573e1['push'](_0x2573e1['shift']());}catch(_0x11a595){_0x2573e1['push'](_0x2573e1['shift']());}}}(a116_0x3f3f,0x5cf8b));function a116_0x2a0a(_0x1b6c49,_0x1776b0){_0x1b6c49=_0x1b6c49-0xb8;const _0x3f3ffe=a116_0x3f3f();let _0x2a0a47=_0x3f3ffe[_0x1b6c49];return _0x2a0a47;}import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a116_0x337530(0xb9));export function createDeterministicZipPackage(_0x4486c8){const _0x268747=a116_0x337530,_0x549196={};for(const _0x4285a9 of normalizeLocalFiles(_0x4486c8)){_0x549196[_0x4285a9[_0x268747(0xd3)]]=fileContent(_0x4285a9);}return Buffer[_0x268747(0xcf)](zipSync(_0x549196,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x3994da){const _0x95b012=a116_0x337530;if(_0x3994da[_0x95b012(0xbb)]<0x16)throw CliErrors[_0x95b012(0xce)](_0x95b012(0xd0));let _0x5184b1;try{_0x5184b1=unzipSync(_0x3994da,{'filter'(_0x2d030a){const _0x408efe=_0x95b012,_0x42cd14=normalizeSkillRelativePath(_0x2d030a[_0x408efe(0xc7)]);if(_0x42cd14[_0x408efe(0xcd)]('/'))throw CliErrors[_0x408efe(0xce)](_0x408efe(0xc3)+_0x42cd14);return!![];}});}catch(_0x3bef06){if(isRuntimeSkillValidationError(_0x3bef06))throw _0x3bef06;throw CliErrors[_0x95b012(0xce)](_0x95b012(0xd0));}return Object[_0x95b012(0xc9)](_0x5184b1)[_0x95b012(0xcc)](([_0x387c5a,_0x493dd3])=>({'path':normalizeSkillRelativePath(_0x387c5a),'bytes':Buffer[_0x95b012(0xcf)](_0x493dd3)}))[_0x95b012(0xcb)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x3c1bbd){const _0x3bd16c=a116_0x337530;return typeof _0x3c1bbd===_0x3bd16c(0xd1)&&_0x3c1bbd!==null&&'code'in _0x3c1bbd&&_0x3c1bbd[_0x3bd16c(0xca)]===_0x3bd16c(0xba);}
@@ -1 +1 @@
1
- (function(_0x290ffa,_0x39c234){const _0x4cec2c=a116_0x55c8,_0x24ea2d=_0x290ffa();while(!![]){try{const _0x247315=parseInt(_0x4cec2c(0x1b7))/0x1*(-parseInt(_0x4cec2c(0x1b1))/0x2)+-parseInt(_0x4cec2c(0x1a8))/0x3+-parseInt(_0x4cec2c(0x18c))/0x4+-parseInt(_0x4cec2c(0x18f))/0x5*(-parseInt(_0x4cec2c(0x1a3))/0x6)+parseInt(_0x4cec2c(0x1a9))/0x7*(-parseInt(_0x4cec2c(0x198))/0x8)+parseInt(_0x4cec2c(0x192))/0x9+parseInt(_0x4cec2c(0x18e))/0xa;if(_0x247315===_0x39c234)break;else _0x24ea2d['push'](_0x24ea2d['shift']());}catch(_0x3f57b9){_0x24ea2d['push'](_0x24ea2d['shift']());}}}(a116_0x3acb,0x85948));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';function a116_0x55c8(_0x1ffc0b,_0x57477c){_0x1ffc0b=_0x1ffc0b-0x188;const _0x3acbf5=a116_0x3acb();let _0x55c802=_0x3acbf5[_0x1ffc0b];return _0x55c802;}export function buildSkillPackage(_0x5c753c){const _0x2d4a06=a116_0x55c8,_0x2e496f=normalizeLocalFiles(_0x5c753c);if(!_0x2e496f[_0x2d4a06(0x19f)](_0x5ee8ea=>_0x5ee8ea[_0x2d4a06(0x189)]===SKILL_FILE))throw CliErrors[_0x2d4a06(0x1ad)]('Missing\x20'+SKILL_FILE+_0x2d4a06(0x1ab));const _0x1c943b=localFilesToManifestFiles(_0x2e496f),_0x150f43=createDeterministicZipPackage(_0x2e496f);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x1c943b),'zipSha256':bufferSha256(_0x150f43),'zipSize':_0x150f43[_0x2d4a06(0x19d)],'files':_0x1c943b},'packageBytes':_0x150f43,'packageBase64':_0x150f43[_0x2d4a06(0x194)](_0x2d4a06(0x195))};}export function verifyRuntimeSkillPackage(_0x545f3d,_0xf242ba){const _0x49ec4e=a116_0x55c8,_0x290b36=normalizePackageManifest(_0x545f3d,{'requireOssPath':![]});if(!_0x290b36)throw CliErrors[_0x49ec4e(0x1ad)](_0x49ec4e(0x1b4));return extractAndVerifyPackage(_0x290b36,_0xf242ba);}export function verifyRuntimeSkillBundle(_0x47c7e9,_0x2a825e){const _0x39d436=normalizePackageManifest(_0x47c7e9,{'requireOssPath':![]});if(!_0x39d436)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackageFiles(_0x39d436,_0x2a825e);}export function tryNormalizePackageManifest(_0x3148ef){return normalizePackageManifest(_0x3148ef,{'requireOssPath':![]});}export function requirePackageBytes(_0x4b74fd,_0x123dfa){const _0x510a9f=a116_0x55c8;if(!_0x123dfa||_0x123dfa['length']===0x0)throw CliErrors[_0x510a9f(0x1ad)](_0x510a9f(0x199)+_0x4b74fd);return _0x123dfa;}export function extractDownloadedPackage(_0x145fc1){const _0x1d9308=a116_0x55c8,_0xadad3f=parseZipPackage(_0x145fc1)['map'](_0x178012=>({'path':_0x178012[_0x1d9308(0x189)],'bytes':_0x178012[_0x1d9308(0x1b5)]}));if(!_0xadad3f[_0x1d9308(0x19f)](_0x26a7ae=>_0x26a7ae[_0x1d9308(0x189)]===SKILL_FILE))throw CliErrors[_0x1d9308(0x1ad)](_0x1d9308(0x188)+SKILL_FILE+'.');return normalizeLocalFiles(_0xadad3f);}export function localFilesToManifestFiles(_0xae64ab){const _0x501d2b=a116_0x55c8;return normalizeLocalFiles(_0xae64ab)[_0x501d2b(0x1b6)](_0x384567=>({'path':_0x384567['path'],'sha256':fileHash(_0x384567),'size':fileContent(_0x384567)[_0x501d2b(0x19d)]}));}function normalizePackageManifest(_0x1a84cd,_0x50b324){const _0x33326e=a116_0x55c8;if(!_0x1a84cd||typeof _0x1a84cd!==_0x33326e(0x1a1)||Array['isArray'](_0x1a84cd))return undefined;const _0x4f7bfe=_0x1a84cd,_0x220a13=typeof _0x4f7bfe[_0x33326e(0x190)]==='string'?_0x4f7bfe['ossPath'][_0x33326e(0x1a0)]():undefined;if(_0x50b324[_0x33326e(0x1ae)]&&!_0x220a13)return undefined;if(!Array[_0x33326e(0x1aa)](_0x4f7bfe[_0x33326e(0x1a4)])||_0x4f7bfe[_0x33326e(0x1a4)][_0x33326e(0x19d)]===0x0)return undefined;if(!isSha256Hex(_0x4f7bfe[_0x33326e(0x197)]))throw CliErrors[_0x33326e(0x1ad)](_0x33326e(0x1af));if(!isSha256Hex(_0x4f7bfe[_0x33326e(0x1a6)]))throw CliErrors['validation']('Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.');if(!Number[_0x33326e(0x1a2)](_0x4f7bfe['zipSize'])||_0x4f7bfe[_0x33326e(0x1b0)]<0x0)throw CliErrors['validation'](_0x33326e(0x18d));const _0x4750f9=normalizeManifestFiles(_0x4f7bfe[_0x33326e(0x1a4)]);if(!_0x4750f9[_0x33326e(0x19f)](_0x5ac338=>_0x5ac338[_0x33326e(0x189)]===SKILL_FILE))throw CliErrors[_0x33326e(0x1ad)](_0x33326e(0x1a5)+SKILL_FILE+'.');const _0x1448f5=fileTreeHash(_0x4750f9);if(_0x1448f5!==_0x4f7bfe['treeSha256'][_0x33326e(0x196)]())throw CliErrors[_0x33326e(0x1ad)](_0x33326e(0x19c));return{'schemaVersion':Number[_0x33326e(0x1a2)](_0x4f7bfe[_0x33326e(0x19b)])?_0x4f7bfe[_0x33326e(0x19b)]:0x2,'ossPath':_0x220a13,'treeSha256':_0x1448f5,'zipSha256':_0x4f7bfe['zipSha256'][_0x33326e(0x196)](),'zipSize':_0x4f7bfe[_0x33326e(0x1b0)],'files':_0x4750f9};}function extractAndVerifyPackage(_0x2a4d2c,_0x5e7615){const _0x360d0b=a116_0x55c8,_0x372dcf=normalizePackageManifest(_0x2a4d2c,{'requireOssPath':![]});if(!_0x372dcf)throw CliErrors[_0x360d0b(0x1ad)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x5e7615[_0x360d0b(0x19d)]!==_0x372dcf[_0x360d0b(0x1b0)])throw CliErrors[_0x360d0b(0x1ad)](_0x360d0b(0x1b3));const _0x22be2f=bufferSha256(_0x5e7615);if(_0x22be2f!==_0x372dcf[_0x360d0b(0x1a6)])throw CliErrors['validation'](_0x360d0b(0x191));return extractAndVerifyPackageFiles(_0x372dcf,_0x5e7615);}function a116_0x3acb(){const _0x577c58=['some','trim','object','isSafeInteger','72pGxGPx','files','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','zipSha256','sha256','951918igroUP','6541619taUiPr','isArray','\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','validation','requireOssPath','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','zipSize','8QhMwFp','has','Runtime\x20Skill\x20package\x20size\x20mismatch.','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','bytes','map','133755GVZMzD','Runtime\x20Skill\x20package\x20is\x20missing\x20','path','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','1438956yIOXFF','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','18838300YvXDUD','133745kjPJqH','ossPath','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','4400172hRvXQj','set','toString','base64','toLowerCase','treeSha256','8qjaFBT','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','size','schemaVersion','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','length','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.'];a116_0x3acb=function(){return _0x577c58;};return a116_0x3acb();}function extractAndVerifyPackageFiles(_0x1549d0,_0x1fc1be){const _0x4a7d71=a116_0x55c8,_0x254d8a=parseZipPackage(_0x1fc1be);if(_0x254d8a[_0x4a7d71(0x19d)]!==_0x1549d0['files'][_0x4a7d71(0x19d)])throw CliErrors[_0x4a7d71(0x1ad)](_0x4a7d71(0x19e));const _0x2ca4ff=new Map();for(const _0x3eefbc of _0x254d8a){if(_0x2ca4ff[_0x4a7d71(0x1b2)](_0x3eefbc[_0x4a7d71(0x189)]))throw CliErrors['validation']('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x3eefbc['path']);_0x2ca4ff[_0x4a7d71(0x193)](_0x3eefbc['path'],_0x3eefbc);}const _0x13b094=[];for(const _0x3d8496 of _0x1549d0['files']){const _0x3e55ae=_0x2ca4ff['get'](_0x3d8496[_0x4a7d71(0x189)]);if(!_0x3e55ae)throw CliErrors['validation'](_0x4a7d71(0x18a)+_0x3d8496[_0x4a7d71(0x189)]);if(_0x3e55ae[_0x4a7d71(0x1b5)][_0x4a7d71(0x19d)]!==_0x3d8496[_0x4a7d71(0x19a)])throw CliErrors[_0x4a7d71(0x1ad)](_0x4a7d71(0x1ac)+_0x3d8496[_0x4a7d71(0x189)]);const _0x2d6d9e=bufferSha256(_0x3e55ae[_0x4a7d71(0x1b5)]);if(_0x2d6d9e!==_0x3d8496[_0x4a7d71(0x1a7)])throw CliErrors[_0x4a7d71(0x1ad)](_0x4a7d71(0x18b)+_0x3d8496[_0x4a7d71(0x189)]);_0x13b094['push']({'path':_0x3d8496[_0x4a7d71(0x189)],'bytes':_0x3e55ae['bytes']});}return normalizeLocalFiles(_0x13b094);}
1
+ (function(_0x470e3e,_0x328c78){const _0x27dc59=a117_0xf4bb,_0x5288c3=_0x470e3e();while(!![]){try{const _0x1fab6e=parseInt(_0x27dc59(0x125))/0x1*(-parseInt(_0x27dc59(0x136))/0x2)+-parseInt(_0x27dc59(0x132))/0x3+-parseInt(_0x27dc59(0x12b))/0x4*(-parseInt(_0x27dc59(0x131))/0x5)+parseInt(_0x27dc59(0x144))/0x6+parseInt(_0x27dc59(0x142))/0x7*(-parseInt(_0x27dc59(0x146))/0x8)+-parseInt(_0x27dc59(0x12c))/0x9+-parseInt(_0x27dc59(0x133))/0xa*(-parseInt(_0x27dc59(0x13f))/0xb);if(_0x1fab6e===_0x328c78)break;else _0x5288c3['push'](_0x5288c3['shift']());}catch(_0x228f6f){_0x5288c3['push'](_0x5288c3['shift']());}}}(a117_0x19bb,0x7e175));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';function a117_0x19bb(){const _0xa1138b=['6202oqMbuH','Runtime\x20Skill\x20package\x20size\x20mismatch.','3066840bGJHhV','treeSha256','8224AxxJYs','get','path','some','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','has','length','files','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','zipSize','size','trim','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','isSafeInteger','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','sha256','2pyxEqx','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','object','push','ossPath','4eGCZPm','463806plWemw','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','bytes','validation','Missing\x20','1534105MqgZJC','458712fKNpeG','1700teTRHY','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','schemaVersion','711146oiPQjm','zipSha256','Runtime\x20Skill\x20package\x20is\x20missing\x20','isArray','toLowerCase','\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','map','base64','98670xFxPCn','string','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.'];a117_0x19bb=function(){return _0xa1138b;};return a117_0x19bb();}import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';function a117_0xf4bb(_0x52001d,_0x4b88c5){_0x52001d=_0x52001d-0x121;const _0x19bb04=a117_0x19bb();let _0xf4bbdf=_0x19bb04[_0x52001d];return _0xf4bbdf;}import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x25e608){const _0x4d166e=a117_0xf4bb,_0x1b32cc=normalizeLocalFiles(_0x25e608);if(!_0x1b32cc[_0x4d166e(0x149)](_0x1e5d75=>_0x1e5d75[_0x4d166e(0x148)]===SKILL_FILE))throw CliErrors[_0x4d166e(0x12f)](_0x4d166e(0x130)+SKILL_FILE+_0x4d166e(0x13b));const _0xfd1f88=localFilesToManifestFiles(_0x1b32cc),_0x5461df=createDeterministicZipPackage(_0x1b32cc);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0xfd1f88),'zipSha256':bufferSha256(_0x5461df),'zipSize':_0x5461df[_0x4d166e(0x14c)],'files':_0xfd1f88},'packageBytes':_0x5461df,'packageBase64':_0x5461df['toString'](_0x4d166e(0x13e))};}export function verifyRuntimeSkillPackage(_0x1e21cc,_0x2ac975){const _0x2fec96=a117_0xf4bb,_0x1bf233=normalizePackageManifest(_0x1e21cc,{'requireOssPath':![]});if(!_0x1bf233)throw CliErrors['validation'](_0x2fec96(0x141));return extractAndVerifyPackage(_0x1bf233,_0x2ac975);}export function verifyRuntimeSkillBundle(_0x19552c,_0x2f4261){const _0x5bdfe1=a117_0xf4bb,_0x3f3e12=normalizePackageManifest(_0x19552c,{'requireOssPath':![]});if(!_0x3f3e12)throw CliErrors[_0x5bdfe1(0x12f)](_0x5bdfe1(0x141));return extractAndVerifyPackageFiles(_0x3f3e12,_0x2f4261);}export function tryNormalizePackageManifest(_0x315f21){return normalizePackageManifest(_0x315f21,{'requireOssPath':![]});}export function requirePackageBytes(_0x590520,_0x3fee8c){const _0x2f8e8a=a117_0xf4bb;if(!_0x3fee8c||_0x3fee8c[_0x2f8e8a(0x14c)]===0x0)throw CliErrors[_0x2f8e8a(0x12f)](_0x2f8e8a(0x121)+_0x590520);return _0x3fee8c;}export function extractDownloadedPackage(_0xb9f5e1){const _0x42c41f=a117_0xf4bb,_0x2cac90=parseZipPackage(_0xb9f5e1)['map'](_0x55a4bc=>({'path':_0x55a4bc['path'],'bytes':_0x55a4bc[_0x42c41f(0x12e)]}));if(!_0x2cac90[_0x42c41f(0x149)](_0x476d5f=>_0x476d5f[_0x42c41f(0x148)]===SKILL_FILE))throw CliErrors[_0x42c41f(0x12f)](_0x42c41f(0x138)+SKILL_FILE+'.');return normalizeLocalFiles(_0x2cac90);}export function localFilesToManifestFiles(_0x12230a){const _0x4e64a8=a117_0xf4bb;return normalizeLocalFiles(_0x12230a)[_0x4e64a8(0x13d)](_0x50d165=>({'path':_0x50d165[_0x4e64a8(0x148)],'sha256':fileHash(_0x50d165),'size':fileContent(_0x50d165)[_0x4e64a8(0x14c)]}));}function normalizePackageManifest(_0x57a65b,_0x15bcc0){const _0x44d4c2=a117_0xf4bb;if(!_0x57a65b||typeof _0x57a65b!==_0x44d4c2(0x128)||Array[_0x44d4c2(0x139)](_0x57a65b))return undefined;const _0x182703=_0x57a65b,_0x56ebf0=typeof _0x182703[_0x44d4c2(0x12a)]===_0x44d4c2(0x140)?_0x182703[_0x44d4c2(0x12a)][_0x44d4c2(0x151)]():undefined;if(_0x15bcc0['requireOssPath']&&!_0x56ebf0)return undefined;if(!Array[_0x44d4c2(0x139)](_0x182703[_0x44d4c2(0x14d)])||_0x182703[_0x44d4c2(0x14d)][_0x44d4c2(0x14c)]===0x0)return undefined;if(!isSha256Hex(_0x182703[_0x44d4c2(0x145)]))throw CliErrors[_0x44d4c2(0x12f)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.');if(!isSha256Hex(_0x182703['zipSha256']))throw CliErrors[_0x44d4c2(0x12f)](_0x44d4c2(0x13c));if(!Number[_0x44d4c2(0x122)](_0x182703[_0x44d4c2(0x14f)])||_0x182703[_0x44d4c2(0x14f)]<0x0)throw CliErrors[_0x44d4c2(0x12f)](_0x44d4c2(0x123));const _0x4f5283=normalizeManifestFiles(_0x182703['files']);if(!_0x4f5283['some'](_0x2334f4=>_0x2334f4[_0x44d4c2(0x148)]===SKILL_FILE))throw CliErrors['validation']('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x350bb0=fileTreeHash(_0x4f5283);if(_0x350bb0!==_0x182703[_0x44d4c2(0x145)][_0x44d4c2(0x13a)]())throw CliErrors['validation'](_0x44d4c2(0x126));return{'schemaVersion':Number[_0x44d4c2(0x122)](_0x182703[_0x44d4c2(0x135)])?_0x182703[_0x44d4c2(0x135)]:0x2,'ossPath':_0x56ebf0,'treeSha256':_0x350bb0,'zipSha256':_0x182703[_0x44d4c2(0x137)][_0x44d4c2(0x13a)](),'zipSize':_0x182703[_0x44d4c2(0x14f)],'files':_0x4f5283};}function extractAndVerifyPackage(_0x4cff20,_0x5575c9){const _0x16cf6e=a117_0xf4bb,_0x2be214=normalizePackageManifest(_0x4cff20,{'requireOssPath':![]});if(!_0x2be214)throw CliErrors[_0x16cf6e(0x12f)](_0x16cf6e(0x141));if(_0x5575c9['length']!==_0x2be214[_0x16cf6e(0x14f)])throw CliErrors['validation'](_0x16cf6e(0x143));const _0x10c596=bufferSha256(_0x5575c9);if(_0x10c596!==_0x2be214[_0x16cf6e(0x137)])throw CliErrors[_0x16cf6e(0x12f)](_0x16cf6e(0x14e));return extractAndVerifyPackageFiles(_0x2be214,_0x5575c9);}function extractAndVerifyPackageFiles(_0x26987f,_0x2ff0b7){const _0x55463f=a117_0xf4bb,_0x5a1b46=parseZipPackage(_0x2ff0b7);if(_0x5a1b46['length']!==_0x26987f[_0x55463f(0x14d)][_0x55463f(0x14c)])throw CliErrors[_0x55463f(0x12f)](_0x55463f(0x14a));const _0x319cc4=new Map();for(const _0x29cbd8 of _0x5a1b46){if(_0x319cc4[_0x55463f(0x14b)](_0x29cbd8['path']))throw CliErrors[_0x55463f(0x12f)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x29cbd8[_0x55463f(0x148)]);_0x319cc4['set'](_0x29cbd8['path'],_0x29cbd8);}const _0x16ce53=[];for(const _0x3cc4c4 of _0x26987f[_0x55463f(0x14d)]){const _0x16eb6a=_0x319cc4[_0x55463f(0x147)](_0x3cc4c4[_0x55463f(0x148)]);if(!_0x16eb6a)throw CliErrors[_0x55463f(0x12f)](_0x55463f(0x134)+_0x3cc4c4[_0x55463f(0x148)]);if(_0x16eb6a[_0x55463f(0x12e)][_0x55463f(0x14c)]!==_0x3cc4c4[_0x55463f(0x150)])throw CliErrors['validation'](_0x55463f(0x12d)+_0x3cc4c4[_0x55463f(0x148)]);const _0x58a74d=bufferSha256(_0x16eb6a[_0x55463f(0x12e)]);if(_0x58a74d!==_0x3cc4c4[_0x55463f(0x124)])throw CliErrors[_0x55463f(0x12f)](_0x55463f(0x127)+_0x3cc4c4[_0x55463f(0x148)]);_0x16ce53[_0x55463f(0x129)]({'path':_0x3cc4c4[_0x55463f(0x148)],'bytes':_0x16eb6a[_0x55463f(0x12e)]});}return normalizeLocalFiles(_0x16ce53);}
@@ -6,10 +6,11 @@
6
6
  */
7
7
  export { contentHash, fileTreeHash, } from "./runtime-skill-sync/hashing.js";
8
8
  export { linkEffectiveRuntimeSkills, linkGlobalRuntimeSkills, pruneStaleRuntimeSkillCache, pruneStaleRuntimeSkillLinks, } from "./runtime-skill-sync/links.js";
9
+ export { resolveRuntimeSkillInstallTarget } from "./runtime-skill-sync/install-target.js";
9
10
  export { listLocalRuntimeSkills } from "./runtime-skill-sync/list-local.js";
10
11
  export { materializeRuntimeSkill } from "./runtime-skill-sync/materialize.js";
11
12
  export { readMetadataIfPresent } from "./runtime-skill-sync/metadata.js";
12
13
  export { getRuntimeSkillCacheRoot, getRuntimeSkillDir, resolveSkillSyncPaths, runtimeAgentSkillRoots, } from "./runtime-skill-sync/paths.js";
13
14
  export { deriveSkillCodeFromDirectory, readPushDirectory, refreshPushDirectoryMetadataFromRemote, recordPushedRuntimeSkill, resolvePushDirectoryIdentity, } from "./runtime-skill-sync/push.js";
14
- export type { BuiltSkillPackage, GlobalRuntimeSkillLinkResult, LinkRuntimeSkillResult, LocalRuntimeSkillItem, LocalRuntimeSkillListInput, LocalSkillFile, MaterializedRuntimeSkill, PruneRuntimeSkillResult, PushDirectoryPayload, RuntimeSkillFile, RuntimeSkillFilesManifest, RuntimeSkillItem, RuntimeSkillMetadata, RuntimeSkillScope, SkillSyncPaths, SkillSyncPathsOptions, } from "./runtime-skill-sync/types.js";
15
+ export type { BuiltSkillPackage, GlobalRuntimeSkillLinkResult, LinkRuntimeSkillResult, LocalRuntimeSkillItem, LocalRuntimeSkillListInput, LocalSkillFile, MaterializedRuntimeSkill, PruneRuntimeSkillResult, PushDirectoryPayload, RuntimeSkillFile, RuntimeSkillFilesManifest, RuntimeSkillItem, RuntimeSkillInstallScope, RuntimeSkillInstallTarget, RuntimeSkillInstallTargetOptions, RuntimeSkillMetadata, RuntimeSkillScope, SkillSyncPaths, SkillSyncPathsOptions, } from "./runtime-skill-sync/types.js";
15
16
  export { buildSkillPackage, verifyRuntimeSkillBundle, verifyRuntimeSkillPackage, } from "./runtime-skill-sync/zip-package.js";
@@ -1 +1 @@
1
- (function(_0x40975a,_0x1de850){var _0x6a229f=a117_0x52b6,_0x5467c1=_0x40975a();while(!![]){try{var _0x4056e4=parseInt(_0x6a229f(0x1c9))/0x1*(parseInt(_0x6a229f(0x1ce))/0x2)+parseInt(_0x6a229f(0x1c6))/0x3+parseInt(_0x6a229f(0x1cc))/0x4*(-parseInt(_0x6a229f(0x1ca))/0x5)+-parseInt(_0x6a229f(0x1c8))/0x6+-parseInt(_0x6a229f(0x1c5))/0x7+parseInt(_0x6a229f(0x1c7))/0x8+parseInt(_0x6a229f(0x1cb))/0x9*(parseInt(_0x6a229f(0x1cd))/0xa);if(_0x4056e4===_0x1de850)break;else _0x5467c1['push'](_0x5467c1['shift']());}catch(_0x47091f){_0x5467c1['push'](_0x5467c1['shift']());}}}(a117_0x2571,0x34667));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';function a117_0x2571(){var _0x51afc2=['1202873FcLIiJ','1136010IWsYPl','2287616nGFoLb','2334924IbNuTX','319604CxgGzN','3625oMEkww','6687NAVikN','1196zachuu','110xWtcvE','2YbzBho'];a117_0x2571=function(){return _0x51afc2;};return a117_0x2571();}export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';function a117_0x52b6(_0x64196f,_0x50f38d){_0x64196f=_0x64196f-0x1c5;var _0x257112=a117_0x2571();var _0x52b6dc=_0x257112[_0x64196f];return _0x52b6dc;}export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
1
+ function a118_0x4b19(_0x1ebcc,_0x2f5237){_0x1ebcc=_0x1ebcc-0x11f;var _0x53ce72=a118_0x53ce();var _0x4b19c0=_0x53ce72[_0x1ebcc];return _0x4b19c0;}function a118_0x53ce(){var _0x4f0307=['8TEmuVW','192544VyxqDa','78114Clusnd','110YulScy','515316NhNsRJ','3AOFPKA','2399904LithBr','5025366Yarrnf','1239165ItIwak','28GNrCjx','772360nTZdGt'];a118_0x53ce=function(){return _0x4f0307;};return a118_0x53ce();}(function(_0xd27c5f,_0x12fe47){var _0x4ad00e=a118_0x4b19,_0x177394=_0xd27c5f();while(!![]){try{var _0x4ce78c=-parseInt(_0x4ad00e(0x11f))/0x1+-parseInt(_0x4ad00e(0x129))/0x2*(parseInt(_0x4ad00e(0x122))/0x3)+-parseInt(_0x4ad00e(0x123))/0x4+parseInt(_0x4ad00e(0x125))/0x5+parseInt(_0x4ad00e(0x121))/0x6*(-parseInt(_0x4ad00e(0x126))/0x7)+-parseInt(_0x4ad00e(0x128))/0x8*(-parseInt(_0x4ad00e(0x124))/0x9)+parseInt(_0x4ad00e(0x127))/0xa*(parseInt(_0x4ad00e(0x120))/0xb);if(_0x4ce78c===_0x12fe47)break;else _0x177394['push'](_0x177394['shift']());}catch(_0x267463){_0x177394['push'](_0x177394['shift']());}}}(a118_0x53ce,0x70775));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}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
@@ -1 +1 @@
1
- (function(_0x5151c5,_0x2fbd6a){const _0x38ad10=a118_0x1f80,_0x5a0e60=_0x5151c5();while(!![]){try{const _0x185006=-parseInt(_0x38ad10(0x19b))/0x1*(parseInt(_0x38ad10(0x1a0))/0x2)+-parseInt(_0x38ad10(0x1a4))/0x3+parseInt(_0x38ad10(0x1a3))/0x4*(parseInt(_0x38ad10(0x19d))/0x5)+parseInt(_0x38ad10(0x1a1))/0x6+parseInt(_0x38ad10(0x1a2))/0x7*(-parseInt(_0x38ad10(0x19c))/0x8)+-parseInt(_0x38ad10(0x19a))/0x9+-parseInt(_0x38ad10(0x19e))/0xa*(-parseInt(_0x38ad10(0x19f))/0xb);if(_0x185006===_0x2fbd6a)break;else _0x5a0e60['push'](_0x5a0e60['shift']());}catch(_0x1fb597){_0x5a0e60['push'](_0x5a0e60['shift']());}}}(a118_0x37d4,0xba6d2));function a118_0x37d4(){const _0x591a79=['4992516qRpHeA','14099lDVGaC','10626200tDXZyf','30865aKxdoA','308190QzmBSu','1331efkHvY','212SuJOWJ','5820138tDOkOh','7mmwtvA','108ElXcDk','2174094kbuKUd'];a118_0x37d4=function(){return _0x591a79;};return a118_0x37d4();}import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a118_0x1f80(_0x152151,_0x1b7c0d){_0x152151=_0x152151-0x19a;const _0x37d489=a118_0x37d4();let _0x1f8090=_0x37d489[_0x152151];return _0x1f8090;}import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
1
+ (function(_0x4e4ad6,_0x7711dc){const _0x5f4c89=a119_0x3557,_0x35d6cf=_0x4e4ad6();while(!![]){try{const _0x5362a0=parseInt(_0x5f4c89(0x1ec))/0x1*(-parseInt(_0x5f4c89(0x1ef))/0x2)+parseInt(_0x5f4c89(0x1ea))/0x3+-parseInt(_0x5f4c89(0x1ed))/0x4+-parseInt(_0x5f4c89(0x1f2))/0x5*(parseInt(_0x5f4c89(0x1f1))/0x6)+parseInt(_0x5f4c89(0x1f0))/0x7*(parseInt(_0x5f4c89(0x1e9))/0x8)+-parseInt(_0x5f4c89(0x1eb))/0x9+-parseInt(_0x5f4c89(0x1f3))/0xa*(-parseInt(_0x5f4c89(0x1ee))/0xb);if(_0x5362a0===_0x7711dc)break;else _0x35d6cf['push'](_0x35d6cf['shift']());}catch(_0x3a65e7){_0x35d6cf['push'](_0x35d6cf['shift']());}}}(a119_0x1782,0x8ae99));function a119_0x3557(_0x3790c0,_0x23f806){_0x3790c0=_0x3790c0-0x1e9;const _0x17828f=a119_0x1782();let _0x35576f=_0x17828f[_0x3790c0];return _0x35576f;}function a119_0x1782(){const _0x301a14=['6meAjfM','1106295XvlcIQ','2347120WIMJGy','1336dAKaIP','2490438zcOFNA','4901490CTVpKF','1CoAdqe','2322828DJsEGQ','44RZPIBB','828772HJepew','23513aZOudN'];a119_0x1782=function(){return _0x301a14;};return a119_0x1782();}import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});