@lovrabet/lovrabet-cli 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/artifact/index.js +1 -1
  10. package/lib/commands/auth/index.js +1 -1
  11. package/lib/commands/auth/prompt.js +1 -1
  12. package/lib/commands/bff/detail.js +1 -1
  13. package/lib/commands/bff/exec.js +1 -1
  14. package/lib/commands/bff/index.js +1 -1
  15. package/lib/commands/cli-skill/index.js +1 -1
  16. package/lib/commands/common/config-policy.js +1 -1
  17. package/lib/commands/common/constraints.js +1 -1
  18. package/lib/commands/common/flags.js +1 -1
  19. package/lib/commands/config/definitions.js +1 -1
  20. package/lib/commands/config/shared.js +1 -1
  21. package/lib/commands/data/index.js +1 -1
  22. package/lib/commands/dataset/detail.js +1 -1
  23. package/lib/commands/dataset/index.js +1 -1
  24. package/lib/commands/dataset/list.js +1 -1
  25. package/lib/commands/dataset/sdk-doc.js +1 -1
  26. package/lib/commands/doctor.js +1 -1
  27. package/lib/commands/init.js +1 -1
  28. package/lib/commands/kb/index.js +1 -1
  29. package/lib/commands/logs/index.js +1 -1
  30. package/lib/commands/personal-bff/index.js +1 -1
  31. package/lib/commands/registry.js +1 -1
  32. package/lib/commands/schema.js +1 -1
  33. package/lib/commands/service/dynamic.js +1 -1
  34. package/lib/commands/service/index.js +1 -1
  35. package/lib/commands/service/registry.js +1 -1
  36. package/lib/commands/skill/commands/create.js +1 -0
  37. package/lib/commands/skill/commands/install.js +1 -0
  38. package/lib/commands/skill/commands/list.js +1 -0
  39. package/lib/commands/skill/commands/push.js +1 -0
  40. package/lib/commands/skill/commands/validate.js +1 -0
  41. package/lib/commands/skill/flags.js +1 -0
  42. package/lib/commands/skill/index.js +1 -1
  43. package/lib/commands/skill/manifest-helpers.js +1 -0
  44. package/lib/commands/skill/scopes.js +1 -0
  45. package/lib/commands/skill/summary.js +1 -0
  46. package/lib/commands/skill/templates.js +1 -1
  47. package/lib/commands/skill/validate.js +1 -1
  48. package/lib/commands/sql/detail.js +1 -1
  49. package/lib/commands/sql/exec.js +1 -1
  50. package/lib/commands/sql/index.js +1 -1
  51. package/lib/commands/update.js +1 -1
  52. package/lib/commands/workspace/index.js +1 -1
  53. package/lib/config/schema.js +1 -1
  54. package/lib/constant/app.js +1 -1
  55. package/lib/constant/auth-mode.js +1 -1
  56. package/lib/constant/cli.js +1 -1
  57. package/lib/constant/defaults.js +1 -1
  58. package/lib/constant/distribution.js +1 -1
  59. package/lib/constant/domain.js +1 -1
  60. package/lib/constant/env.js +1 -1
  61. package/lib/constant/output.js +1 -1
  62. package/lib/constant/product.js +1 -1
  63. package/lib/constant/risk.js +1 -1
  64. package/lib/constant/url.js +1 -1
  65. package/lib/context.js +1 -1
  66. package/lib/core/api-client.js +1 -1
  67. package/lib/core/db-resolver.js +1 -1
  68. package/lib/core/sdk-client.js +1 -1
  69. package/lib/errors.js +1 -1
  70. package/lib/framework/build-all-flags.js +1 -1
  71. package/lib/framework/dryrun.js +1 -1
  72. package/lib/framework/flags.js +1 -1
  73. package/lib/framework/help.js +1 -1
  74. package/lib/framework/index.js +1 -1
  75. package/lib/framework/output.js +1 -1
  76. package/lib/framework/preparse.js +1 -1
  77. package/lib/framework/response.js +1 -1
  78. package/lib/framework/runner-confirmation.js +1 -1
  79. package/lib/framework/runner-error.js +1 -1
  80. package/lib/framework/runner.js +1 -1
  81. package/lib/framework/schema-export.js +1 -1
  82. package/lib/framework/types.js +1 -1
  83. package/lib/generated/build-info.js +1 -1
  84. package/lib/help.js +1 -1
  85. package/lib/skills/npx-skills-add.js +1 -1
  86. package/lib/skills/runtime-skill-sync/constants.js +1 -0
  87. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -0
  88. package/lib/skills/runtime-skill-sync/hashing.js +1 -0
  89. package/lib/skills/runtime-skill-sync/links.js +1 -0
  90. package/lib/skills/runtime-skill-sync/list-local.js +1 -0
  91. package/lib/skills/runtime-skill-sync/local-files.js +1 -0
  92. package/lib/skills/runtime-skill-sync/materialize.js +1 -0
  93. package/lib/skills/runtime-skill-sync/metadata.js +1 -0
  94. package/lib/skills/runtime-skill-sync/paths.js +1 -0
  95. package/lib/skills/runtime-skill-sync/push.js +1 -0
  96. package/lib/skills/runtime-skill-sync/scopes.js +1 -0
  97. package/lib/skills/runtime-skill-sync/types.js +1 -0
  98. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -0
  99. package/lib/skills/runtime-skill-sync/zip-package.js +1 -0
  100. package/lib/skills/runtime-skill-sync.js +1 -1
  101. package/lib/utils/apply-jq-filter.js +1 -1
  102. package/lib/utils/logger.js +1 -1
  103. package/lib/utils/params.js +1 -1
  104. package/lib/utils/platform.js +1 -1
  105. package/lib/utils/update-notice.js +1 -1
  106. package/lib/utils/version.js +1 -1
  107. package/lib/utils/write-cli-side-channel.js +1 -1
  108. package/package.json +4 -1
@@ -1 +1 @@
1
- function a72_0x2600(){var _0x46b512=['9XOmfHt','533240GOymoE','22MlHSEF','355mXTZhF','3354687qXpNRe','795980KonFvm','3jtboyM','3546uXGdTN','632762mnkKRX','211890nrAjll','4734744KdtkTW'];a72_0x2600=function(){return _0x46b512;};return a72_0x2600();}function a72_0x272c(_0x381514,_0x95f72a){_0x381514=_0x381514-0xfe;var _0x260037=a72_0x2600();var _0x272cb1=_0x260037[_0x381514];return _0x272cb1;}(function(_0x22b799,_0x23472d){var _0x4fe9b0=a72_0x272c,_0x4c5664=_0x22b799();while(!![]){try{var _0x255cc2=-parseInt(_0x4fe9b0(0x108))/0x1+parseInt(_0x4fe9b0(0x107))/0x2+parseInt(_0x4fe9b0(0x105))/0x3*(parseInt(_0x4fe9b0(0x104))/0x4)+parseInt(_0x4fe9b0(0x102))/0x5*(parseInt(_0x4fe9b0(0x106))/0x6)+parseInt(_0x4fe9b0(0x103))/0x7+parseInt(_0x4fe9b0(0xfe))/0x8*(-parseInt(_0x4fe9b0(0xff))/0x9)+-parseInt(_0x4fe9b0(0x100))/0xa*(-parseInt(_0x4fe9b0(0x101))/0xb);if(_0x255cc2===_0x23472d)break;else _0x4c5664['push'](_0x4c5664['shift']());}catch(_0xfd38c7){_0x4c5664['push'](_0x4c5664['shift']());}}}(a72_0x2600,0x52e25));export{riskLevelOrder,normalizeLegacyOutputFormat,isValidFormat}from'@lovrabet/cli-framework';
1
+ function a81_0x5b95(_0x9620f,_0x2751aa){_0x9620f=_0x9620f-0x171;var _0x4d9a00=a81_0x4d9a();var _0x5b95ed=_0x4d9a00[_0x9620f];return _0x5b95ed;}(function(_0x2b7130,_0xabad05){var _0x57f95e=a81_0x5b95,_0xc56ad7=_0x2b7130();while(!![]){try{var _0x6d868b=parseInt(_0x57f95e(0x171))/0x1+parseInt(_0x57f95e(0x179))/0x2*(parseInt(_0x57f95e(0x176))/0x3)+parseInt(_0x57f95e(0x172))/0x4+-parseInt(_0x57f95e(0x177))/0x5+parseInt(_0x57f95e(0x175))/0x6+-parseInt(_0x57f95e(0x173))/0x7+-parseInt(_0x57f95e(0x174))/0x8*(parseInt(_0x57f95e(0x178))/0x9);if(_0x6d868b===_0xabad05)break;else _0xc56ad7['push'](_0xc56ad7['shift']());}catch(_0x31d38c){_0xc56ad7['push'](_0xc56ad7['shift']());}}}(a81_0x4d9a,0xc7939));export{riskLevelOrder,normalizeLegacyOutputFormat,isValidFormat}from'@lovrabet/cli-framework';function a81_0x4d9a(){var _0x4cc934=['1866REwLBI','2182785BYXqKi','9upGjrx','3976mNAuZo','620569vqzugI','4526748UsZstF','2535547aRzrcw','11112232lvGQZo','98880JdRCjc'];a81_0x4d9a=function(){return _0x4cc934;};return a81_0x4d9a();}
@@ -1 +1 @@
1
- const a73_0x280333=a73_0x19a4;(function(_0x34e02a,_0x40050f){const _0x1af7e=a73_0x19a4,_0x3bfc4=_0x34e02a();while(!![]){try{const _0x1c1ccb=-parseInt(_0x1af7e(0x122))/0x1*(-parseInt(_0x1af7e(0x123))/0x2)+-parseInt(_0x1af7e(0x125))/0x3*(-parseInt(_0x1af7e(0x12a))/0x4)+parseInt(_0x1af7e(0x126))/0x5*(-parseInt(_0x1af7e(0x128))/0x6)+-parseInt(_0x1af7e(0x121))/0x7*(-parseInt(_0x1af7e(0x12b))/0x8)+parseInt(_0x1af7e(0x124))/0x9+parseInt(_0x1af7e(0x127))/0xa+-parseInt(_0x1af7e(0x11f))/0xb;if(_0x1c1ccb===_0x40050f)break;else _0x3bfc4['push'](_0x3bfc4['shift']());}catch(_0x4a2bb8){_0x3bfc4['push'](_0x3bfc4['shift']());}}}(a73_0x43ba,0xd34b3));export const VERSION=a73_0x280333(0x129);function a73_0x19a4(_0x502b87,_0x54decd){_0x502b87=_0x502b87-0x11f;const _0x43ba87=a73_0x43ba();let _0x19a427=_0x43ba87[_0x502b87];return _0x19a427;}export const GIT_TAG='v2.1.2-beta.1';function a73_0x43ba(){const _0x1e99c4=['105834SaNiDR','2.1.2','56klENtz','1807176zOMCgK','22535381LwLODZ','aedada9','42zXYsHL','20601HNLefF','2WcWeWC','11002023WVlfPi','168228IoVfEg','470kbjuTy','11887020ZpXveP'];a73_0x43ba=function(){return _0x1e99c4;};return a73_0x43ba();}export const GIT_COMMIT=a73_0x280333(0x120);export const BUILD_TIME='2026-07-03T12:48:21.855Z';
1
+ const a82_0x12313f=a82_0x1c1f;(function(_0x2ada65,_0x1173f7){const _0x57ca52=a82_0x1c1f,_0x4a373f=_0x2ada65();while(!![]){try{const _0xfb9a8b=-parseInt(_0x57ca52(0x156))/0x1+-parseInt(_0x57ca52(0x153))/0x2*(parseInt(_0x57ca52(0x158))/0x3)+-parseInt(_0x57ca52(0x155))/0x4*(-parseInt(_0x57ca52(0x157))/0x5)+-parseInt(_0x57ca52(0x15a))/0x6+-parseInt(_0x57ca52(0x154))/0x7+-parseInt(_0x57ca52(0x15c))/0x8*(parseInt(_0x57ca52(0x15b))/0x9)+-parseInt(_0x57ca52(0x159))/0xa*(-parseInt(_0x57ca52(0x151))/0xb);if(_0xfb9a8b===_0x1173f7)break;else _0x4a373f['push'](_0x4a373f['shift']());}catch(_0x4184f8){_0x4a373f['push'](_0x4a373f['shift']());}}}(a82_0x333d,0x854fe));export const VERSION='2.1.3';export const GIT_TAG='v2.1.3-beta.1';function a82_0x333d(){const _0xb7a98a=['7337Mprjum','0dfd4b3','1340302YPryfW','5932500Lujohs','2995180NPWlnr','1082318hoWbPr','5bwJGMd','3NOESpk','55420LtnmNw','2810238arhSZU','325143OshMom','184sBfrMJ'];a82_0x333d=function(){return _0xb7a98a;};return a82_0x333d();}export const GIT_COMMIT=a82_0x12313f(0x152);function a82_0x1c1f(_0x46825b,_0x49dbff){_0x46825b=_0x46825b-0x151;const _0x333d70=a82_0x333d();let _0x1c1f82=_0x333d70[_0x46825b];return _0x1c1f82;}export const BUILD_TIME='2026-07-04T02:25:09.955Z';
package/lib/help.js CHANGED
@@ -1 +1 @@
1
- function a74_0x514b(){const _0x485ee7=['10694816mBQIuD','\x20--help','\x20\x20Use\x20','3372873mykiuU','column','4yNRjjS','2694235dvbqzr','green','562129EQCyDS','1080524WbIWGL','3331914iKcWZA','1559451iGvjRX'];a74_0x514b=function(){return _0x485ee7;};return a74_0x514b();}(function(_0x4d97b0,_0x460f11){const _0x436761=a74_0x4707,_0x3af072=_0x4d97b0();while(!![]){try{const _0x364f54=-parseInt(_0x436761(0x1b4))/0x1+parseInt(_0x436761(0x1b5))/0x2+-parseInt(_0x436761(0x1b7))/0x3*(parseInt(_0x436761(0x1b1))/0x4)+parseInt(_0x436761(0x1b2))/0x5+-parseInt(_0x436761(0x1b6))/0x6+-parseInt(_0x436761(0x1bb))/0x7+parseInt(_0x436761(0x1b8))/0x8;if(_0x364f54===_0x460f11)break;else _0x3af072['push'](_0x3af072['shift']());}catch(_0x5b0fd3){_0x3af072['push'](_0x3af072['shift']());}}}(a74_0x514b,0x48799));import{jsx as a74_0x2c2aed,jsxs as a74_0x3728cc}from'react/jsx-runtime';function a74_0x4707(_0x21a6bc,_0x2db7a6){_0x21a6bc=_0x21a6bc-0x1b1;const _0x514b4c=a74_0x514b();let _0x47075d=_0x514b4c[_0x21a6bc];return _0x47075d;}import{useEffect}from'react';import{Box,Text,useApp}from'ink';import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'./constant/cli.js';export function Help(){const _0x3ac9ce=a74_0x4707,{exit:_0x3857d5}=useApp();return useEffect(()=>{_0x3857d5();},[_0x3857d5]),a74_0x3728cc(Box,{'flexDirection':_0x3ac9ce(0x1bc),'marginTop':0x1,'marginBottom':0x1,'children':[a74_0x2c2aed(Box,{'children':a74_0x2c2aed(Text,{'bold':!![],'color':_0x3ac9ce(0x1b3),'children':'\x20\x20'+CLI_DISPLAY_NAME})}),a74_0x3728cc(Box,{'marginTop':0x1,'children':[a74_0x2c2aed(Text,{'dimColor':!![],'children':_0x3ac9ce(0x1ba)}),a74_0x2c2aed(Text,{'bold':!![],'color':_0x3ac9ce(0x1b3),'children':CLI_BIN_NAME+_0x3ac9ce(0x1b9)}),a74_0x2c2aed(Text,{'dimColor':!![],'children':'\x20to\x20view\x20available\x20commands.'})]})]});}
1
+ function a83_0x4423(_0x18ce37,_0x12a8d2){_0x18ce37=_0x18ce37-0xee;const _0x3d2034=a83_0x3d20();let _0x442341=_0x3d2034[_0x18ce37];return _0x442341;}(function(_0x42ace5,_0x15213f){const _0x5d8255=a83_0x4423,_0x266616=_0x42ace5();while(!![]){try{const _0x222799=parseInt(_0x5d8255(0xf3))/0x1+parseInt(_0x5d8255(0xf6))/0x2+-parseInt(_0x5d8255(0xf0))/0x3+-parseInt(_0x5d8255(0xf2))/0x4*(-parseInt(_0x5d8255(0xf8))/0x5)+parseInt(_0x5d8255(0xf5))/0x6*(-parseInt(_0x5d8255(0xf1))/0x7)+-parseInt(_0x5d8255(0xef))/0x8+-parseInt(_0x5d8255(0xf7))/0x9;if(_0x222799===_0x15213f)break;else _0x266616['push'](_0x266616['shift']());}catch(_0x79b0c3){_0x266616['push'](_0x266616['shift']());}}}(a83_0x3d20,0x73a16));import{jsx as a83_0x5f0031,jsxs as a83_0x581713}from'react/jsx-runtime';import{useEffect}from'react';function a83_0x3d20(){const _0x1a4875=['10269naewhw','1799996zNINPz','486000QwbTHp','green','2286uDHQPX','1812120pDFEGD','2030193MOtXFo','10SljrwR','\x20\x20Use\x20','5820968owKrbG','918933DHKmbL'];a83_0x3d20=function(){return _0x1a4875;};return a83_0x3d20();}import{Box,Text,useApp}from'ink';import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'./constant/cli.js';export function Help(){const _0x214872=a83_0x4423,{exit:_0x2ff5cd}=useApp();return useEffect(()=>{_0x2ff5cd();},[_0x2ff5cd]),a83_0x581713(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a83_0x5f0031(Box,{'children':a83_0x5f0031(Text,{'bold':!![],'color':_0x214872(0xf4),'children':'\x20\x20'+CLI_DISPLAY_NAME})}),a83_0x581713(Box,{'marginTop':0x1,'children':[a83_0x5f0031(Text,{'dimColor':!![],'children':_0x214872(0xee)}),a83_0x5f0031(Text,{'bold':!![],'color':'green','children':CLI_BIN_NAME+'\x20--help'}),a83_0x5f0031(Text,{'dimColor':!![],'children':'\x20to\x20view\x20available\x20commands.'})]})]});}
@@ -1 +1 @@
1
- const a75_0x18d61e=a75_0x5123;(function(_0x4d2e73,_0x442a70){const _0x5d6ba3=a75_0x5123,_0x4a6522=_0x4d2e73();while(!![]){try{const _0xd08de6=parseInt(_0x5d6ba3(0x79))/0x1+-parseInt(_0x5d6ba3(0x83))/0x2+-parseInt(_0x5d6ba3(0x86))/0x3*(-parseInt(_0x5d6ba3(0x84))/0x4)+-parseInt(_0x5d6ba3(0x7b))/0x5+parseInt(_0x5d6ba3(0x88))/0x6+parseInt(_0x5d6ba3(0x73))/0x7+-parseInt(_0x5d6ba3(0x80))/0x8;if(_0xd08de6===_0x442a70)break;else _0x4a6522['push'](_0x4a6522['shift']());}catch(_0x412158){_0x4a6522['push'](_0x4a6522['shift']());}}}(a75_0x5c0c,0x4c8a2));import{spawnSync}from'node:child_process';function a75_0x5123(_0x28c7fc,_0x5d292a){_0x28c7fc=_0x28c7fc-0x73;const _0x5c0c1a=a75_0x5c0c();let _0x5123ed=_0x5c0c1a[_0x28c7fc];return _0x5123ed;}import{resolveNpmBin}from'../utils/platform.js';import{LOVRABET_SKILL_SOURCE as a75_0x5e5b81}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';export const LOVRABET_SKILL_SOURCE=a75_0x5e5b81;function a75_0x5c0c(){const _0x53c5ed=['log','unknown','251388ctszCJ','244oFkMlh','stderr','14322aNqDPq','trim','268038QzVUoR','2576294CMflrs','stdout','join','pipe','stdio','npx','599369bpchFc','toString','1706705bbdvnf','exit\x20','skills','skipNpxSkillsEnvSuffix','inherit','4182056XlrAOB'];a75_0x5c0c=function(){return _0x53c5ed;};return a75_0x5c0c();}export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a75_0x18d61e(0x7e)]);export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x57e5e8,_0x561c5c=LOVRABET_SKILL_SOURCE,_0x3acc47){const _0x5d6226=a75_0x18d61e;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x41c792=_0x3acc47?.[_0x5d6226(0x77)]??_0x5d6226(0x7f),_0x2e569d=resolveNpmBin(_0x5d6226(0x78)),_0x6aa93a=[_0x5d6226(0x7d),'add',_0x561c5c,'-g','-y'],_0x288218=[_0x2e569d,..._0x6aa93a][_0x5d6226(0x75)]('\x20');console[_0x5d6226(0x81)]('*\x20'+_0x288218);const _0x5db215=spawnSync(_0x2e569d,_0x6aa93a,{'cwd':_0x57e5e8,'stdio':_0x41c792,'env':process.env,'shell':![]});if(_0x5db215['status']===0x0)return{'ok':!![],'status':0x0};let _0x5c37dc=_0x5d6226(0x7c)+(_0x5db215['status']??_0x5d6226(0x82));if(_0x41c792===_0x5d6226(0x76)){const _0x53daa5=_0x5db215[_0x5d6226(0x85)]?_0x5db215[_0x5d6226(0x85)][_0x5d6226(0x7a)]()[_0x5d6226(0x87)]():'',_0x316283=_0x5db215[_0x5d6226(0x74)]?_0x5db215[_0x5d6226(0x74)]['toString']()['trim']():'';if(_0x53daa5)_0x5c37dc=_0x53daa5;else{if(_0x316283)_0x5c37dc=_0x316283;}}return{'ok':![],'status':_0x5db215['status']??null,'error':_0x5c37dc};}
1
+ const a84_0x16e668=a84_0x53ff;(function(_0xc91d9e,_0x57d047){const _0x2e5d08=a84_0x53ff,_0xe484b2=_0xc91d9e();while(!![]){try{const _0x3e0a8f=-parseInt(_0x2e5d08(0x107))/0x1+-parseInt(_0x2e5d08(0x10f))/0x2*(-parseInt(_0x2e5d08(0x116))/0x3)+parseInt(_0x2e5d08(0x10c))/0x4*(-parseInt(_0x2e5d08(0x108))/0x5)+parseInt(_0x2e5d08(0x11b))/0x6*(-parseInt(_0x2e5d08(0x11c))/0x7)+-parseInt(_0x2e5d08(0x110))/0x8+-parseInt(_0x2e5d08(0x117))/0x9+-parseInt(_0x2e5d08(0x10a))/0xa*(-parseInt(_0x2e5d08(0x11a))/0xb);if(_0x3e0a8f===_0x57d047)break;else _0xe484b2['push'](_0xe484b2['shift']());}catch(_0x586444){_0xe484b2['push'](_0xe484b2['shift']());}}}(a84_0x56ef,0xd9721));function a84_0x53ff(_0x14e94e,_0x2719b6){_0x14e94e=_0x14e94e-0x107;const _0x56ef4b=a84_0x56ef();let _0x53ff39=_0x56ef4b[_0x14e94e];return _0x53ff39;}import{spawnSync}from'node:child_process';import{resolveNpmBin}from'../utils/platform.js';import{LOVRABET_SKILL_SOURCE as a84_0x1c1d2f}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';export const LOVRABET_SKILL_SOURCE=a84_0x1c1d2f;export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a84_0x16e668(0x119)]);export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}function a84_0x56ef(){const _0x229291=['6052716yWRXuw','toString','skipNpxSkillsEnvSuffix','1001SSKRns','1833576zQZouN','14TCrqmi','1421112rVOVkQ','5gjhPbj','add','383950zvitbJ','unknown','105220olVsmM','join','stderr','2aahtEe','2866672FntQoU','pipe','stdout','trim','status','skills','1458537yDlYXp'];a84_0x56ef=function(){return _0x229291;};return a84_0x56ef();}export function runNpxSkillsAddGlobal(_0x38aeef,_0x3fb50e=LOVRABET_SKILL_SOURCE,_0x2e9d91){const _0x5b82b0=a84_0x16e668;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x3567dc=_0x2e9d91?.['stdio']??'inherit',_0x37ea99=resolveNpmBin('npx'),_0x58f98a=[_0x5b82b0(0x115),_0x5b82b0(0x109),_0x3fb50e,'-g','-y'],_0x2f38fd=[_0x37ea99,..._0x58f98a][_0x5b82b0(0x10d)]('\x20');console['log']('*\x20'+_0x2f38fd);const _0x5cd663=spawnSync(_0x37ea99,_0x58f98a,{'cwd':_0x38aeef,'stdio':_0x3567dc,'env':process.env,'shell':![]});if(_0x5cd663['status']===0x0)return{'ok':!![],'status':0x0};let _0x2f2859='exit\x20'+(_0x5cd663[_0x5b82b0(0x114)]??_0x5b82b0(0x10b));if(_0x3567dc===_0x5b82b0(0x111)){const _0x5dde20=_0x5cd663[_0x5b82b0(0x10e)]?_0x5cd663[_0x5b82b0(0x10e)][_0x5b82b0(0x118)]()[_0x5b82b0(0x113)]():'',_0x56387e=_0x5cd663[_0x5b82b0(0x112)]?_0x5cd663[_0x5b82b0(0x112)][_0x5b82b0(0x118)]()['trim']():'';if(_0x5dde20)_0x2f2859=_0x5dde20;else{if(_0x56387e)_0x2f2859=_0x56387e;}}return{'ok':![],'status':_0x5cd663[_0x5b82b0(0x114)]??null,'error':_0x2f2859};}
@@ -0,0 +1 @@
1
+ const a85_0x3d5148=a85_0x38e0;(function(_0x3fccdc,_0x2c57cb){const _0x40832f=a85_0x38e0,_0x26d60a=_0x3fccdc();while(!![]){try{const _0x3be17f=-parseInt(_0x40832f(0x73))/0x1*(-parseInt(_0x40832f(0x85))/0x2)+-parseInt(_0x40832f(0x75))/0x3+-parseInt(_0x40832f(0x83))/0x4+parseInt(_0x40832f(0x7d))/0x5*(-parseInt(_0x40832f(0x7f))/0x6)+-parseInt(_0x40832f(0x84))/0x7+parseInt(_0x40832f(0x7a))/0x8*(-parseInt(_0x40832f(0x7b))/0x9)+-parseInt(_0x40832f(0x7c))/0xa*(-parseInt(_0x40832f(0x86))/0xb);if(_0x3be17f===_0x2c57cb)break;else _0x26d60a['push'](_0x26d60a['shift']());}catch(_0x353205){_0x26d60a['push'](_0x26d60a['shift']());}}}(a85_0xcc57,0x5d3f5));export const METADATA_FILE=a85_0x3d5148(0x77);export const SKILL_FILE='SKILL.md';export const MAX_SKILL_FILE_COUNT=0xc8;export const MAX_SKILL_FILE_BYTES=0x100*0x400;export const MAX_SKILL_TOTAL_BYTES=0x2*0x400*0x400;export const MAX_SKILL_PACKAGE_BYTES=0x4*0x400*0x400;export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,'.DS_Store']);function a85_0x38e0(_0x56567b,_0x2f8a52){_0x56567b=_0x56567b-0x73;const _0xcc5733=a85_0xcc57();let _0x38e0c0=_0xcc5733[_0x56567b];return _0x38e0c0;}function a85_0xcc57(){const _0x5c9c86=['.next','.svn','1116240qcXmIW','4578903oXVqgi','52724LvhDMZ','18822056WCzLUv','1cXdsDj','dist','2168268glmRIn','.git','lovrabet.skill.json','build','.turbo','232RAcqSm','219501ChIgwh','20vcjckj','5seAKjI','.cache','4220322HikVCt','node_modules'];a85_0xcc57=function(){return _0x5c9c86;};return a85_0xcc57();}export const IGNORED_DIR_NAMES=new Set([a85_0x3d5148(0x76),'.hg',a85_0x3d5148(0x82),a85_0x3d5148(0x80),a85_0x3d5148(0x81),a85_0x3d5148(0x74),a85_0x3d5148(0x78),'coverage',a85_0x3d5148(0x79),a85_0x3d5148(0x7e)]);
@@ -0,0 +1 @@
1
+ (function(_0x20a5ee,_0x1d1b73){const _0xf80eb1=a86_0x244e,_0x2c6a99=_0x20a5ee();while(!![]){try{const _0x2d561f=parseInt(_0xf80eb1(0x98))/0x1+-parseInt(_0xf80eb1(0x92))/0x2*(parseInt(_0xf80eb1(0x9e))/0x3)+-parseInt(_0xf80eb1(0x9b))/0x4+-parseInt(_0xf80eb1(0x93))/0x5*(-parseInt(_0xf80eb1(0xa0))/0x6)+-parseInt(_0xf80eb1(0x9f))/0x7*(parseInt(_0xf80eb1(0x99))/0x8)+-parseInt(_0xf80eb1(0xa3))/0x9*(parseInt(_0xf80eb1(0x97))/0xa)+parseInt(_0xf80eb1(0xa6))/0xb;if(_0x2d561f===_0x1d1b73)break;else _0x2c6a99['push'](_0x2c6a99['shift']());}catch(_0x13a8ee){_0x2c6a99['push'](_0x2c6a99['shift']());}}}(a86_0x5721,0x71064));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';function a86_0x5721(){const _0x1eb3b5=['split','endsWith','64570jFaOeW','352315yLdZYj','8CCkTIG','.tmp','891488RxjQCy','from','utf8','90714mdSKCN','2958347NooKHn','6LiXvEf','isSymbolicLink','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','873YtiEVo','startsWith','Unsafe\x20Skill\x20file\x20path:\x20','22594836cjLYsR','stringify','60YwxCIh','1177595WqeSGX','validation'];a86_0x5721=function(){return _0x1eb3b5;};return a86_0x5721();}import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x2b5c4a,_0x412a05){const _0x36c7ea=a86_0x244e,_0x46a72a=normalizeSkillRelativePath(_0x412a05),_0x77a0a3=realOrResolved(_0x2b5c4a),_0x84eb58=resolve(_0x77a0a3,..._0x46a72a[_0x36c7ea(0x95)]('/'));if(!isPathInside(_0x84eb58,_0x77a0a3))throw CliErrors['validation'](_0x36c7ea(0xa5)+_0x412a05);return ensureNoSymlinkInManagedPath(_0x77a0a3,_0x46a72a),_0x84eb58;}export function ensureNoSymlinkInManagedPath(_0xdaebbb,_0x531d43){const _0x220124=a86_0x244e;let _0x59b9d4=_0xdaebbb;for(const _0x4c427a of _0x531d43['split']('/')){_0x59b9d4=resolve(_0x59b9d4,_0x4c427a);const _0x4d1a83=lstatIfPresent(_0x59b9d4);if(_0x4d1a83?.[_0x220124(0xa1)]())throw CliErrors[_0x220124(0x94)](_0x220124(0xa2)+_0x531d43);}}export function isDanglingSymlink(_0x5871f2){try{return lstatSync(_0x5871f2)['isSymbolicLink']();}catch{return![];}}function a86_0x244e(_0x5f0622,_0x155f51){_0x5f0622=_0x5f0622-0x92;const _0x572119=a86_0x5721();let _0x244ea4=_0x572119[_0x5f0622];return _0x244ea4;}export function resolveSymlinkTarget(_0xbaca3e){const _0x3a5dd2=readlinkSync(_0xbaca3e);return isAbsolute(_0x3a5dd2)?_0x3a5dd2:resolve(dirname(_0xbaca3e),_0x3a5dd2);}export function isPathInside(_0xf405b,_0xd8c2fe){const _0x1fa34d=a86_0x244e,_0x33835d=_0xf405b['endsWith'](sep)?_0xf405b:''+_0xf405b+sep,_0x3d797c=_0xd8c2fe[_0x1fa34d(0x96)](sep)?_0xd8c2fe:''+_0xd8c2fe+sep;return _0xf405b===_0xd8c2fe||_0x33835d[_0x1fa34d(0xa4)](_0x3d797c);}export function realOrResolved(_0x1975e3){try{return realpathSync(_0x1975e3);}catch{return resolve(_0x1975e3);}}export function lstatIfPresent(_0xe7deff){try{return lstatSync(_0xe7deff);}catch{return undefined;}}export function writeTextAtomic(_0x3cebb5,_0x5e0835,_0x5682a1){const _0xa44109=a86_0x244e;writeBytesAtomic(_0x3cebb5,Buffer[_0xa44109(0x9c)](_0x5e0835,_0xa44109(0x9d)),_0x5682a1);}export function writeBytesAtomic(_0xd9527,_0x82d0d1,_0x124017){const _0x558344=a86_0x244e,_0x8df0cb=_0xd9527+_0x558344(0x9a);try{writeFileSync(_0x8df0cb,_0x82d0d1,{'mode':_0x124017}),renameSync(_0x8df0cb,_0xd9527);}catch(_0x5512c4){try{rmSync(_0x8df0cb,{'force':!![]});}catch{}throw _0x5512c4;}}export function writeJsonAtomic(_0x54b616,_0x31ce94){const _0x36ecec=a86_0x244e;writeTextAtomic(_0x54b616,JSON[_0x36ecec(0xa7)](_0x31ce94,null,0x2)+'\x0a',0x180);}
@@ -0,0 +1 @@
1
+ (function(_0x13cf77,_0x3db525){const _0x6fbfb3=a87_0x4b6a,_0x5498d6=_0x13cf77();while(!![]){try{const _0x22dad2=-parseInt(_0x6fbfb3(0x13a))/0x1+-parseInt(_0x6fbfb3(0x12f))/0x2+-parseInt(_0x6fbfb3(0x138))/0x3+parseInt(_0x6fbfb3(0x130))/0x4+parseInt(_0x6fbfb3(0x139))/0x5+parseInt(_0x6fbfb3(0x133))/0x6+-parseInt(_0x6fbfb3(0x134))/0x7;if(_0x22dad2===_0x3db525)break;else _0x5498d6['push'](_0x5498d6['shift']());}catch(_0x3c975f){_0x5498d6['push'](_0x5498d6['shift']());}}}(a87_0x3ee8,0x977ac));function a87_0x3ee8(){const _0x1711ce=['update','51366PhiStT','4651625eYMhib','80190DXPbev','digest','447736PxsXOF','216328aHBbPN','hex','size','6326088ApRbEN','7679805rzNKAb','sha256','path'];a87_0x3ee8=function(){return _0x1711ce;};return a87_0x3ee8();}import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';function a87_0x4b6a(_0x4b90f9,_0x5832d5){_0x4b90f9=_0x4b90f9-0x12e;const _0x3ee889=a87_0x3ee8();let _0x4b6a05=_0x3ee889[_0x4b90f9];return _0x4b6a05;}export function contentHash(_0x303889){const _0x4af1d4=a87_0x4b6a;return createHash(_0x4af1d4(0x135))[_0x4af1d4(0x137)](_0x303889)[_0x4af1d4(0x12e)](_0x4af1d4(0x131));}export function fileHash(_0x4a7350){return bufferSha256(fileContent(_0x4a7350));}export function bufferSha256(_0x24f198){const _0x5b1167=a87_0x4b6a;return createHash('sha256')[_0x5b1167(0x137)](_0x24f198)[_0x5b1167(0x12e)](_0x5b1167(0x131));}export function fileTreeHash(_0xff313a){const _0x401cb4=a87_0x4b6a,_0x4470a5=createHash('sha256');for(const _0xd26201 of normalizeManifestFiles(_0xff313a)){_0x4470a5[_0x401cb4(0x137)](_0xd26201[_0x401cb4(0x136)]),_0x4470a5['update']('\x00'),_0x4470a5[_0x401cb4(0x137)](_0xd26201[_0x401cb4(0x135)]),_0x4470a5[_0x401cb4(0x137)]('\x00'),_0x4470a5[_0x401cb4(0x137)](String(_0xd26201[_0x401cb4(0x132)])),_0x4470a5['update']('\x00');}return _0x4470a5[_0x401cb4(0x12e)](_0x401cb4(0x131));}
@@ -0,0 +1 @@
1
+ (function(_0x5a14b9,_0xcd21df){const _0x234f2a=a88_0x27d8,_0x204b47=_0x5a14b9();while(!![]){try{const _0x24b863=parseInt(_0x234f2a(0x90))/0x1*(-parseInt(_0x234f2a(0xa8))/0x2)+parseInt(_0x234f2a(0xb7))/0x3*(-parseInt(_0x234f2a(0x9b))/0x4)+-parseInt(_0x234f2a(0xa1))/0x5+parseInt(_0x234f2a(0x8f))/0x6+-parseInt(_0x234f2a(0x98))/0x7*(parseInt(_0x234f2a(0xaa))/0x8)+-parseInt(_0x234f2a(0xa7))/0x9*(-parseInt(_0x234f2a(0x8a))/0xa)+parseInt(_0x234f2a(0xa2))/0xb*(parseInt(_0x234f2a(0xa3))/0xc);if(_0x24b863===_0xcd21df)break;else _0x204b47['push'](_0x204b47['shift']());}catch(_0x1f4dc1){_0x204b47['push'](_0x204b47['shift']());}}}(a88_0x3dc1,0xbfdc6));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import{copySync,ensureDirSync,removeSync}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 a88_0x27d8(_0x3baccb,_0x4411e6){_0x3baccb=_0x3baccb-0x8a;const _0x3dc1d6=a88_0x3dc1();let _0x27d88e=_0x3dc1d6[_0x3baccb];return _0x27d88e;}import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';export function linkEffectiveRuntimeSkills(_0x1507d2,_0x4efa6c,_0x12db20={}){const _0x3a071e=a88_0x27d8,_0x12c89c=new Map();for(const _0x439f22 of _0x1507d2){const _0x236e09=_0x439f22['skill'][_0x3a071e(0x9f)];if(!_0x236e09)continue;const _0x1c0b4f=_0x12c89c[_0x3a071e(0x91)](_0x236e09);(!_0x1c0b4f||_0x439f22[_0x3a071e(0x95)]===_0x3a071e(0x9c))&&_0x12c89c[_0x3a071e(0xb8)](_0x236e09,_0x439f22);}const _0x476de9=[],_0x121e18=resolveSkillSyncPaths(_0x12db20);for(const _0x1e296a of _0x12c89c[_0x3a071e(0xa0)]()){const _0x4abb70=requireSkillCode(_0x1e296a[_0x3a071e(0xa6)]),_0x19bcf5=_0x4efa6c+'--'+_0x4abb70;for(const _0x273f18 of[_0x121e18[_0x3a071e(0x8b)],_0x121e18[_0x3a071e(0xa4)]]){_0x476de9[_0x3a071e(0xb5)](ensureManagedSymlink(resolve(_0x273f18,_0x19bcf5),_0x1e296a['dir'],_0x121e18[_0x3a071e(0xb9)]));}}return _0x476de9;}export function pruneStaleRuntimeSkillLinks(_0x2e75cc,_0x4dc1f6,_0x54b692={},_0x51d774){const _0x7d78a9=a88_0x27d8,_0x1ac309=resolveSkillSyncPaths(_0x54b692),_0x4da470=new Set([..._0x4dc1f6][_0x7d78a9(0x94)](_0x595909=>_0x595909[_0x7d78a9(0xbc)]())[_0x7d78a9(0xbf)](Boolean)),_0x2157bb=_0x51d774?new Set([..._0x51d774]['map'](_0x10d7d6=>_0x10d7d6[_0x7d78a9(0xbc)]())[_0x7d78a9(0xbf)](Boolean)):undefined,_0x693b97=[];for(const _0x77ce9 of[_0x1ac309[_0x7d78a9(0x8b)],_0x1ac309[_0x7d78a9(0xa4)]]){for(const _0x10365b of managedAppSkillLinkPaths(_0x77ce9,_0x2e75cc)){const _0x15c6d6=basename(_0x10365b)['slice']((_0x2e75cc+'--')[_0x7d78a9(0x92)]);if(_0x2157bb&&!_0x2157bb[_0x7d78a9(0x9a)](_0x15c6d6))continue;if(_0x4da470[_0x7d78a9(0x9a)](_0x15c6d6))continue;_0x693b97['push'](removeManagedSkillLink(_0x10365b,_0x1ac309[_0x7d78a9(0xb9)]));}}return _0x693b97;}export function pruneStaleRuntimeSkillCache(_0x1fdc26,_0xd8468a={}){const _0x2691f3=a88_0x27d8,_0x2f70b3=new Set([..._0x1fdc26[_0x2691f3(0xba)]][_0x2691f3(0x94)](_0x2ff5d9=>_0x2ff5d9[_0x2691f3(0xbc)]())[_0x2691f3(0xbf)](Boolean)),_0x3ce148=_0x1fdc26[_0x2691f3(0xac)]?new Set([..._0x1fdc26['pruneSkillCodes']][_0x2691f3(0x94)](_0x41f43c=>_0x41f43c['trim']())[_0x2691f3(0xbf)](Boolean)):undefined,_0x42cc54=_0x1fdc26[_0x2691f3(0x9e)]??[_0x2691f3(0x9c),_0x2691f3(0xad)],_0x275662=resolve(getRuntimeSkillCacheRoot(_0x1fdc26[_0x2691f3(0x8e)],_0x1fdc26[_0x2691f3(0x97)],_0xd8468a),safePathSegment(_0x1fdc26['appCode'],_0x2691f3(0xb4))),_0x263dbc=[];for(const _0x8a7b72 of _0x42cc54){const _0x120639=resolve(_0x275662,_0x8a7b72);if(!existsSync(_0x120639))continue;for(const _0x4e9a06 of readdirSync(_0x120639,{'withFileTypes':!![]})){if(!_0x4e9a06[_0x2691f3(0x93)]())continue;const _0x3008b4=_0x4e9a06[_0x2691f3(0xaf)];if(_0x3ce148&&!_0x3ce148[_0x2691f3(0x9a)](_0x3008b4))continue;if(_0x2f70b3[_0x2691f3(0x9a)](_0x3008b4))continue;const _0x3d0981=resolve(_0x120639,_0x3008b4),_0x338d9f=readMetadataIfPresent(resolve(_0x3d0981,METADATA_FILE));if(_0x338d9f?.[_0x2691f3(0xb4)]!==_0x1fdc26[_0x2691f3(0xb4)]||_0x338d9f[_0x2691f3(0x95)]!==_0x8a7b72||_0x338d9f[_0x2691f3(0x9f)]!==_0x3008b4){_0x263dbc[_0x2691f3(0xb5)]({'path':_0x3d0981,'action':_0x2691f3(0xa9),'reason':_0x2691f3(0xab)});continue;}removeSync(_0x3d0981),_0x263dbc['push']({'path':_0x3d0981,'action':_0x2691f3(0x8d)});}}return _0x263dbc;}function a88_0x3dc1(){const _0x4778ea=['Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','name','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','not-managed-symlink','created','isSymbolicLink','appCode','push','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','6fjCFro','set','managedRoot','activeSkillCodes','unchanged','trim','dir','validation','filter','830AMBcTa','agentsSkillsDir','external-symlink','removed','env','7913976Opfqef','9214saNZRc','get','length','isDirectory','map','scope','startsWith','accessKey','28658BaSfOJ','builtin','has','3012668RAWyJU','personal','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','scopes','skillCode','values','1056270mYxtLu','19686216Xrrxzf','12LkQOxd','claudeSkillsDir','updated','skill','93654qlNShb','142MNFzyr','skipped','1592JYYMOT','metadata-mismatch','pruneSkillCodes','company'];a88_0x3dc1=function(){return _0x4778ea;};return a88_0x3dc1();}export function linkGlobalRuntimeSkills(_0xcbf66c,_0x8261e0={}){const _0x49bc30=a88_0x27d8,_0x2da1ee=resolveSkillSyncPaths(_0x8261e0),_0x5e66cf=[];for(const _0x109438 of _0xcbf66c){if(_0x109438['scope']!==_0x49bc30(0x99))throw CliErrors[_0x49bc30(0xbe)]('Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20'+_0x109438[_0x49bc30(0x95)]);const _0xdd0a2c=requireSkillCode(_0x109438[_0x49bc30(0xa6)]),_0x250fb1=copyManagedSkillDirectory(_0x109438['dir'],resolve(_0x2da1ee[_0x49bc30(0x8b)],_0xdd0a2c));_0x5e66cf[_0x49bc30(0xb5)]({..._0x250fb1,'contentHash':_0x109438['contentHash']});}return _0x5e66cf;}function ensureManagedSymlink(_0x1ba8eb,_0xfeb477,_0x5cf6a4){const _0x2822d1=a88_0x27d8;mkdirSync(dirname(_0x1ba8eb),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x1ba8eb)||isDanglingSymlink(_0x1ba8eb)){const _0x20a680=lstatSync(_0x1ba8eb);if(!_0x20a680[_0x2822d1(0xb3)]())throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x1ba8eb);const _0x148fb4=resolveSymlinkTarget(_0x1ba8eb);if(!isPathInside(realOrResolved(_0x148fb4),realOrResolved(_0x5cf6a4)))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0x1ba8eb);if(realOrResolved(_0x148fb4)===realOrResolved(_0xfeb477))return{'path':_0x1ba8eb,'target':_0xfeb477,'action':_0x2822d1(0xbb)};return unlinkSync(_0x1ba8eb),symlinkSync(_0xfeb477,_0x1ba8eb,_0x2822d1(0xbd)),{'path':_0x1ba8eb,'target':_0xfeb477,'action':_0x2822d1(0xa5)};}return symlinkSync(_0xfeb477,_0x1ba8eb,_0x2822d1(0xbd)),{'path':_0x1ba8eb,'target':_0xfeb477,'action':_0x2822d1(0xb2)};}function managedAppSkillLinkPaths(_0x17b28d,_0x5ccb96){const _0x3b98c3=a88_0x27d8;if(!existsSync(_0x17b28d))return[];const _0x3af5fb=_0x5ccb96+'--';return readdirSync(_0x17b28d,{'withFileTypes':!![]})[_0x3b98c3(0xbf)](_0x32b50c=>_0x32b50c[_0x3b98c3(0xaf)][_0x3b98c3(0x96)](_0x3af5fb))['map'](_0x4ccaba=>resolve(_0x17b28d,_0x4ccaba['name']));}function removeManagedSkillLink(_0x44cc52,_0x426732){const _0x33dfce=a88_0x27d8,_0x40fe9f=lstatIfPresent(_0x44cc52);if(!_0x40fe9f?.[_0x33dfce(0xb3)]())return{'path':_0x44cc52,'action':_0x33dfce(0xa9),'reason':_0x33dfce(0xb1)};const _0x398b04=resolveSymlinkTarget(_0x44cc52);if(!isPathInside(realOrResolved(_0x398b04),realOrResolved(_0x426732)))return{'path':_0x44cc52,'action':_0x33dfce(0xa9),'reason':_0x33dfce(0x8c)};return unlinkSync(_0x44cc52),{'path':_0x44cc52,'action':_0x33dfce(0x8d)};}export function copyManagedSkillDirectory(_0xe59877,_0x203c5b){const _0x18cac1=a88_0x27d8,_0x6b446a=resolve(_0x203c5b,METADATA_FILE),_0x43531=existsSync(_0x203c5b);if(_0x43531){const _0x346309=lstatSync(_0x203c5b);if(_0x346309[_0x18cac1(0xb3)]())throw CliErrors['validation'](_0x18cac1(0xb6)+_0x203c5b);if(!_0x346309[_0x18cac1(0x93)]())throw CliErrors[_0x18cac1(0xbe)](_0x18cac1(0xb0)+_0x203c5b);const _0x4f118e=readMetadataIfPresent(_0x6b446a);if(_0x4f118e?.[_0x18cac1(0x95)]!==_0x18cac1(0x99))throw CliErrors[_0x18cac1(0xbe)](_0x18cac1(0xae)+_0x203c5b);}ensureDirSync(dirname(_0x203c5b));const _0x23fa38=_0x43531?readMetadataIfPresent(_0x6b446a)?.['contentHash']:undefined,_0x19faef=readMetadataIfPresent(resolve(_0xe59877,METADATA_FILE))?.['contentHash'];return _0x43531&&removeSync(_0x203c5b),copySkillDirectory(_0xe59877,_0x203c5b),{'path':_0x203c5b,'target':_0xe59877,'action':!_0x43531?_0x18cac1(0xb2):_0x23fa38===_0x19faef?_0x18cac1(0xbb):_0x18cac1(0xa5)};}function copySkillDirectory(_0x218042,_0x18b666){copySync(_0x218042,_0x18b666,{'dereference':![],'overwrite':!![],'filter'(_0x2c26e1){const _0xf55bbc=a88_0x27d8;if(lstatSync(_0x2c26e1)[_0xf55bbc(0xb3)]())throw CliErrors[_0xf55bbc(0xbe)](_0xf55bbc(0x9d)+_0x2c26e1);return!![];}});}
@@ -0,0 +1 @@
1
+ (function(_0x4511b1,_0x517abf){const _0x84d79a=a89_0x43ff,_0x519f2f=_0x4511b1();while(!![]){try{const _0x20be8f=parseInt(_0x84d79a(0x91))/0x1*(parseInt(_0x84d79a(0x9e))/0x2)+parseInt(_0x84d79a(0x9f))/0x3*(parseInt(_0x84d79a(0x94))/0x4)+parseInt(_0x84d79a(0x7e))/0x5*(parseInt(_0x84d79a(0x9c))/0x6)+parseInt(_0x84d79a(0x96))/0x7+-parseInt(_0x84d79a(0x9a))/0x8+-parseInt(_0x84d79a(0x79))/0x9+parseInt(_0x84d79a(0x98))/0xa;if(_0x20be8f===_0x517abf)break;else _0x519f2f['push'](_0x519f2f['shift']());}catch(_0x1e2400){_0x519f2f['push'](_0x519f2f['shift']());}}}(a89_0x289c,0x51368));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';function a89_0x289c(){const _0x31307b=['name','map','cache','4bAjRXy','tags','isSymbolicLink','451148LuBctG','scope','372799oNtFaP','values','5873780aZlmOL','claudeSkillsDir','3531712RsEjju','linkedPaths','6102ovZIBr','push','97346yTPHlA','3arydFw','local','get','dir','4412601tvqktH','has','includes','builtin','appCode','1555HsvOCB','scopes','from','accessKey','filter','trim','sort','link','source','skillCode','set','cacheDir','code','localeCompare','linkedPath','env'];a89_0x289c=function(){return _0x31307b;};return a89_0x289c();}function a89_0x43ff(_0x543451,_0x24e855){_0x543451=_0x543451-0x79;const _0x289cd7=a89_0x289c();let _0x43ff73=_0x289cd7[_0x543451];return _0x43ff73;}import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x321340,_0x14b0c9={}){const _0x24ec99=a89_0x43ff,_0x417275=safePathSegment(_0x321340[_0x24ec99(0x7d)],_0x24ec99(0x7d)),_0x444f9c=normalizeRuntimeSkillScopes(_0x321340[_0x24ec99(0x7f)]),_0x65c349=new Set(_0x444f9c),_0x52778c=_0x321340[_0x24ec99(0x8a)]?.[_0x24ec99(0x83)](),_0x5ed618=new Map(),_0x5f2108=resolve(getRuntimeSkillCacheRoot(_0x321340[_0x24ec99(0x8d)],_0x321340[_0x24ec99(0x81)],_0x14b0c9),_0x417275);for(const _0x38062d of _0x444f9c){for(const _0x5f1264 of localSkillEntryDirs(resolve(_0x5f2108,_0x38062d))){collectLocalRuntimeSkill(_0x5ed618,_0x5f1264,{'appCode':_0x417275,'scopes':_0x65c349,'code':_0x52778c,'source':_0x24ec99(0x90)});}}const _0x569054=resolveSkillSyncPaths(_0x14b0c9);for(const _0x5cc82b of[_0x569054['agentsSkillsDir'],_0x569054[_0x24ec99(0x99)]]){for(const _0x4cc093 of localSkillLinkCandidates(_0x5cc82b,_0x417275,_0x65c349)){collectLocalRuntimeSkill(_0x5ed618,_0x4cc093,{'appCode':_0x417275,'scopes':_0x65c349,'code':_0x52778c,'source':_0x24ec99(0x85),'linkedPath':_0x4cc093});}}return Array[_0x24ec99(0x80)](_0x5ed618[_0x24ec99(0x97)]())[_0x24ec99(0x84)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x20cb65){const _0x3e5333=a89_0x43ff;if(!existsSync(_0x20cb65))return[];return readdirSync(_0x20cb65,{'withFileTypes':!![]})[_0x3e5333(0x82)](_0x167396=>_0x167396['isDirectory']()||_0x167396[_0x3e5333(0x93)]())[_0x3e5333(0x8f)](_0xd8616e=>resolve(_0x20cb65,_0xd8616e[_0x3e5333(0x8e)]));}function localSkillLinkCandidates(_0x4fbbdd,_0x5b73e5,_0x966c5e){const _0x52f520=a89_0x43ff;if(!existsSync(_0x4fbbdd))return[];const _0x363627=_0x5b73e5+'--';return readdirSync(_0x4fbbdd,{'withFileTypes':!![]})[_0x52f520(0x82)](_0x33ff8c=>_0x33ff8c['isDirectory']()||_0x33ff8c[_0x52f520(0x93)]())[_0x52f520(0x82)](_0x4c5ec0=>_0x4c5ec0['name']['startsWith'](_0x363627)||_0x966c5e[_0x52f520(0x7a)](_0x52f520(0x7c)))[_0x52f520(0x8f)](_0x255aa6=>resolve(_0x4fbbdd,_0x255aa6[_0x52f520(0x8e)]));}function collectLocalRuntimeSkill(_0x2ace37,_0x434011,_0x31bba9){const _0x25cc84=a89_0x43ff,_0x66858e=resolve(_0x434011,METADATA_FILE),_0xef8970=readMetadataIfPresent(_0x66858e);if(!_0xef8970)return;if(_0xef8970[_0x25cc84(0x7d)]!==_0x31bba9[_0x25cc84(0x7d)])return;if(!isRuntimeSkillScope(_0xef8970[_0x25cc84(0x95)])||!_0x31bba9[_0x25cc84(0x7f)][_0x25cc84(0x7a)](_0xef8970['scope']))return;const _0x481449=_0xef8970[_0x25cc84(0x87)]?.[_0x25cc84(0x83)]();if(!_0x481449)return;if(_0x31bba9['code']&&_0x481449!==_0x31bba9[_0x25cc84(0x8a)])return;const _0x4a225b=_0xef8970[_0x25cc84(0x95)]+':'+_0x481449,_0x45ddb8=_0x31bba9[_0x25cc84(0x8c)]?[_0x31bba9[_0x25cc84(0x8c)]]:[],_0x13bc95=_0x2ace37[_0x25cc84(0xa1)](_0x4a225b);if(_0x13bc95){_0x31bba9[_0x25cc84(0x86)]===_0x25cc84(0x90)&&(_0x13bc95[_0x25cc84(0xa2)]=_0x434011,_0x13bc95[_0x25cc84(0x89)]=_0x434011,_0x13bc95['skillMdPath']=resolve(_0x434011,SKILL_FILE),_0x13bc95['metadataPath']=_0x66858e);for(const _0x45325d of _0x45ddb8){!_0x13bc95['linkedPaths'][_0x25cc84(0x7b)](_0x45325d)&&_0x13bc95['linkedPaths'][_0x25cc84(0x9d)](_0x45325d);}_0x13bc95[_0x25cc84(0x9b)][_0x25cc84(0x84)]();return;}_0x2ace37[_0x25cc84(0x88)](_0x4a225b,{..._0xef8970,'tags':Array['isArray'](_0xef8970[_0x25cc84(0x92)])?_0xef8970[_0x25cc84(0x92)]:[],'scope':_0xef8970[_0x25cc84(0x95)],'source':_0x25cc84(0xa0),'dir':_0x434011,'cacheDir':_0x31bba9[_0x25cc84(0x86)]===_0x25cc84(0x90)?_0x434011:undefined,'skillMdPath':resolve(_0x434011,SKILL_FILE),'metadataPath':_0x66858e,'linkedPaths':_0x45ddb8});}function compareLocalRuntimeSkills(_0x4d4330,_0x1acbb9){const _0x100c25=a89_0x43ff,_0x39cabb={'personal':0x0,'company':0x1,'builtin':0x2};return _0x39cabb[_0x4d4330[_0x100c25(0x95)]]-_0x39cabb[_0x1acbb9['scope']]||_0x4d4330[_0x100c25(0x87)][_0x100c25(0x8b)](_0x1acbb9[_0x100c25(0x87)])||_0x4d4330['dir'][_0x100c25(0x8b)](_0x1acbb9[_0x100c25(0xa2)]);}
@@ -0,0 +1 @@
1
+ (function(_0x47a134,_0x2e2fb6){const _0x196031=a90_0x4298,_0x2d06a6=_0x47a134();while(!![]){try{const _0x56c319=parseInt(_0x196031(0x1f1))/0x1*(parseInt(_0x196031(0x203))/0x2)+parseInt(_0x196031(0x1db))/0x3*(-parseInt(_0x196031(0x1e0))/0x4)+-parseInt(_0x196031(0x1f4))/0x5+parseInt(_0x196031(0x201))/0x6+parseInt(_0x196031(0x202))/0x7*(parseInt(_0x196031(0x1ef))/0x8)+parseInt(_0x196031(0x1e2))/0x9+-parseInt(_0x196031(0x1e1))/0xa;if(_0x56c319===_0x2e2fb6)break;else _0x2d06a6['push'](_0x2d06a6['shift']());}catch(_0x234481){_0x2d06a6['push'](_0x2d06a6['shift']());}}}(a90_0xe766,0x83655));function a90_0xe766(){const _0x1f0877=['Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','431775btbqqG','path','push','isBuffer','validation','from','toLowerCase','Skill\x20directory\x20exceeds\x20total\x20file\x20size\x20limit.','object','values','sort','isArray','size','1752012oznCTy','7jtdnRK','30uiklPq','content','name','isSafeInteger','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','length','toString','compare','6375nHSrzg','localeCompare','Duplicate\x20Skill\x20file\x20path:\x20','utf8','Unsafe\x20Skill\x20file\x20path:\x20','536WpbksY','6515500HzAACY','3697029BemINc','Skill\x20file\x20exceeds\x20size\x20limit:\x20','has','bytes','replace','isFile','includes','Skill\x20directory\x20exceeds\x20file\x20count\x20limit.','Skill\x20file\x20size\x20is\x20invalid:\x20','set','sha256','string','Skill\x20file\x20sha256\x20is\x20invalid:\x20','1389912TutZdA','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','45622BITCmN','isDirectory'];a90_0xe766=function(){return _0x1f0877;};return a90_0xe766();}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,MAX_SKILL_FILE_BYTES,MAX_SKILL_FILE_COUNT,MAX_SKILL_TOTAL_BYTES,SKILL_FILE}from'./constants.js';export function fileContent(_0x36a55e){const _0xe3386e=a90_0x4298;return _0x36a55e[_0xe3386e(0x1e5)]??Buffer[_0xe3386e(0x1f9)](_0x36a55e[_0xe3386e(0x204)]??'',_0xe3386e(0x1de));}function a90_0x4298(_0x287aff,_0x225f2b){_0x287aff=_0x287aff-0x1d8;const _0xe76698=a90_0xe766();let _0x42987e=_0xe76698[_0x287aff];return _0x42987e;}export function fileText(_0x39dd29){const _0x16d6ad=a90_0x4298;return fileContent(_0x39dd29)[_0x16d6ad(0x1d9)](_0x16d6ad(0x1de));}export function normalizeLocalFiles(_0x3c6165){const _0x5f322e=a90_0x4298;if(!Array['isArray'](_0x3c6165)||_0x3c6165[_0x5f322e(0x1d8)]===0x0)return[];if(_0x3c6165[_0x5f322e(0x1d8)]>MAX_SKILL_FILE_COUNT)throw CliErrors[_0x5f322e(0x1f8)](_0x5f322e(0x1e9));const _0xaa98f4=new Map();let _0x4b6fab=0x0;for(const _0x69a236 of _0x3c6165){if(!_0x69a236||typeof _0x69a236!==_0x5f322e(0x1fc)||typeof _0x69a236['path']!==_0x5f322e(0x1ed))throw CliErrors[_0x5f322e(0x1f8)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x2299ee=normalizeSkillRelativePath(_0x69a236['path']);if(_0xaa98f4[_0x5f322e(0x1e4)](_0x2299ee))throw CliErrors[_0x5f322e(0x1f8)](_0x5f322e(0x1dd)+_0x2299ee);if(_0x69a236['bytes']!==undefined&&!Buffer[_0x5f322e(0x1f7)](_0x69a236[_0x5f322e(0x1e5)]))throw CliErrors[_0x5f322e(0x1f8)](_0x5f322e(0x1f0)+_0x2299ee);if(_0x69a236[_0x5f322e(0x1e5)]===undefined&&typeof _0x69a236[_0x5f322e(0x204)]!==_0x5f322e(0x1ed))throw CliErrors[_0x5f322e(0x1f8)](_0x5f322e(0x207)+_0x2299ee);const _0x4053e0=fileContent(_0x69a236),_0x9c0648=_0x4053e0['length'];if(_0x9c0648>MAX_SKILL_FILE_BYTES)throw CliErrors['validation'](_0x5f322e(0x1e3)+_0x2299ee);_0x4b6fab+=_0x9c0648;if(_0x4b6fab>MAX_SKILL_TOTAL_BYTES)throw CliErrors['validation']('Skill\x20directory\x20exceeds\x20total\x20file\x20size\x20limit.');_0xaa98f4[_0x5f322e(0x1eb)](_0x2299ee,{'path':_0x2299ee,'bytes':_0x4053e0});}return Array[_0x5f322e(0x1f9)](_0xaa98f4[_0x5f322e(0x1fd)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x3b9bd3){const _0x479c31=a90_0x4298;if(!Array[_0x479c31(0x1ff)](_0x3b9bd3)||_0x3b9bd3[_0x479c31(0x1d8)]===0x0)return[];if(_0x3b9bd3['length']>MAX_SKILL_FILE_COUNT)throw CliErrors[_0x479c31(0x1f8)](_0x479c31(0x1e9));const _0x6de7e0=new Map();let _0x2822fb=0x0;for(const _0x35e4b2 of _0x3b9bd3){if(!_0x35e4b2||typeof _0x35e4b2!==_0x479c31(0x1fc)||typeof _0x35e4b2[_0x479c31(0x1f5)]!==_0x479c31(0x1ed))throw CliErrors[_0x479c31(0x1f8)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x3cc710=normalizeSkillRelativePath(_0x35e4b2[_0x479c31(0x1f5)]);if(_0x6de7e0[_0x479c31(0x1e4)](_0x3cc710))throw CliErrors['validation'](_0x479c31(0x1dd)+_0x3cc710);if(!isSha256Hex(_0x35e4b2[_0x479c31(0x1ec)]))throw CliErrors['validation'](_0x479c31(0x1ee)+_0x3cc710);if(!Number[_0x479c31(0x206)](_0x35e4b2['size'])||_0x35e4b2[_0x479c31(0x200)]<0x0)throw CliErrors[_0x479c31(0x1f8)](_0x479c31(0x1ea)+_0x3cc710);if(_0x35e4b2[_0x479c31(0x200)]>MAX_SKILL_FILE_BYTES)throw CliErrors[_0x479c31(0x1f8)](_0x479c31(0x1e3)+_0x3cc710);_0x2822fb+=_0x35e4b2[_0x479c31(0x200)];if(_0x2822fb>MAX_SKILL_TOTAL_BYTES)throw CliErrors[_0x479c31(0x1f8)](_0x479c31(0x1fb));_0x6de7e0[_0x479c31(0x1eb)](_0x3cc710,{'path':_0x3cc710,'sha256':_0x35e4b2['sha256'][_0x479c31(0x1fa)](),'size':_0x35e4b2[_0x479c31(0x200)]});}return Array[_0x479c31(0x1f9)](_0x6de7e0[_0x479c31(0x1fd)]())[_0x479c31(0x1fe)](compareSkillFiles);}export function scanSkillDirectory(_0x1c9650){const _0x44a557=realpathSync(_0x1c9650),_0x3bec42=[];let _0x3c0222=0x0;function _0x2e216c(_0x1f2c64){const _0x55d672=a90_0x4298,_0x4bd2a3=readdirSync(_0x1f2c64,{'withFileTypes':!![]})[_0x55d672(0x1fe)]((_0x59081b,_0x51b2e0)=>_0x59081b[_0x55d672(0x205)][_0x55d672(0x1dc)](_0x51b2e0[_0x55d672(0x205)]));for(const _0x15e30b of _0x4bd2a3){if(_0x15e30b['isDirectory']()&&IGNORED_DIR_NAMES[_0x55d672(0x1e4)](_0x15e30b['name']))continue;if(IGNORED_FILE_NAMES[_0x55d672(0x1e4)](_0x15e30b[_0x55d672(0x205)]))continue;const _0x452f08=resolve(_0x1f2c64,_0x15e30b[_0x55d672(0x205)]);if(_0x15e30b['isSymbolicLink']())throw CliErrors[_0x55d672(0x1f8)](_0x55d672(0x1f3)+_0x452f08);const _0x2178db=toPosixPath(relative(_0x44a557,_0x452f08));if(_0x15e30b[_0x55d672(0x1f2)]()){_0x2e216c(_0x452f08);continue;}if(!_0x15e30b[_0x55d672(0x1e7)]())continue;validateSkillRelativePath(_0x2178db);const _0x4d4064=readFileSync(_0x452f08);if(_0x4d4064['length']>MAX_SKILL_FILE_BYTES)throw CliErrors[_0x55d672(0x1f8)]('Skill\x20file\x20exceeds\x20size\x20limit:\x20'+_0x2178db);_0x3c0222+=_0x4d4064['length'];if(_0x3c0222>MAX_SKILL_TOTAL_BYTES)throw CliErrors[_0x55d672(0x1f8)](_0x55d672(0x1fb));_0x3bec42[_0x55d672(0x1f6)]({'path':_0x2178db,'bytes':_0x4d4064});if(_0x3bec42['length']>MAX_SKILL_FILE_COUNT)throw CliErrors[_0x55d672(0x1f8)]('Skill\x20directory\x20exceeds\x20file\x20count\x20limit.');}}return _0x2e216c(_0x44a557),normalizeLocalFiles(_0x3bec42);}export function compareSkillFiles(_0x2ea785,_0x47731d){const _0x31ba2a=a90_0x4298;if(_0x2ea785[_0x31ba2a(0x1f5)]===SKILL_FILE)return _0x47731d[_0x31ba2a(0x1f5)]===SKILL_FILE?0x0:-0x1;if(_0x47731d[_0x31ba2a(0x1f5)]===SKILL_FILE)return 0x1;return Buffer[_0x31ba2a(0x1da)](Buffer['from'](_0x2ea785[_0x31ba2a(0x1f5)],_0x31ba2a(0x1de)),Buffer['from'](_0x47731d[_0x31ba2a(0x1f5)],_0x31ba2a(0x1de)));}export function normalizeSkillRelativePath(_0x284472){const _0x28d3b8=toPosixPath(_0x284472['trim']());return validateSkillRelativePath(_0x28d3b8),_0x28d3b8;}export function validateSkillRelativePath(_0x47d190){const _0x4e3250=a90_0x4298;if(!_0x47d190||_0x47d190['startsWith']('/')||_0x47d190[_0x4e3250(0x1e8)]('//'))throw CliErrors[_0x4e3250(0x1f8)](_0x4e3250(0x1df)+_0x47d190);for(const _0x3e0957 of _0x47d190['split']('/')){if(!_0x3e0957||_0x3e0957==='.'||_0x3e0957==='..')throw CliErrors['validation'](_0x4e3250(0x1df)+_0x47d190);}}export function toPosixPath(_0x2a97bf){const _0x1ed19e=a90_0x4298;return _0x2a97bf[_0x1ed19e(0x1e6)](/\\/g,'/');}export function isSha256Hex(_0x3cefcc){const _0x2b9df5=a90_0x4298;return typeof _0x3cefcc===_0x2b9df5(0x1ed)&&/^[a-fA-F0-9]{64}$/['test'](_0x3cefcc);}
@@ -0,0 +1 @@
1
+ (function(_0x29c4ba,_0x43294a){const _0x2bc844=a91_0x1651,_0x4de718=_0x29c4ba();while(!![]){try{const _0x1ada38=parseInt(_0x2bc844(0x18b))/0x1*(-parseInt(_0x2bc844(0x17f))/0x2)+parseInt(_0x2bc844(0x19a))/0x3*(parseInt(_0x2bc844(0x196))/0x4)+-parseInt(_0x2bc844(0x191))/0x5*(parseInt(_0x2bc844(0x184))/0x6)+-parseInt(_0x2bc844(0x178))/0x7+parseInt(_0x2bc844(0x181))/0x8+parseInt(_0x2bc844(0x17d))/0x9*(parseInt(_0x2bc844(0x193))/0xa)+parseInt(_0x2bc844(0x185))/0xb;if(_0x1ada38===_0x43294a)break;else _0x4de718['push'](_0x4de718['shift']());}catch(_0x1d75f6){_0x4de718['push'](_0x4de718['shift']());}}}(a91_0x4c81,0x31633));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';function a91_0x1651(_0x2fc2b0,_0x37a44b){_0x2fc2b0=_0x2fc2b0-0x177;const _0x4c819e=a91_0x4c81();let _0x16519c=_0x4c819e[_0x2fc2b0];return _0x16519c;}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(_0x388e58,_0x4841e2,_0x56bf3f){const _0x509d6e=a91_0x1651,_0x458ff8=requireSkillCode(_0x388e58),_0x4c940b=requirePackageBytes(_0x458ff8,_0x56bf3f[_0x509d6e(0x186)]),_0x3557ef=extractDownloadedPackage(_0x4c940b),_0xc1e0f2=_0x3557ef[_0x509d6e(0x189)](_0x9efdd4=>_0x9efdd4['path']===SKILL_FILE);if(!_0xc1e0f2)throw CliErrors['validation'](_0x509d6e(0x19f)+SKILL_FILE+':\x20'+_0x458ff8);const _0x1f0d36=withMaterializedSkillFrontmatter(_0x3557ef,_0x388e58,_0x458ff8),_0x50639e=_0x1f0d36[_0x509d6e(0x189)](_0x4d0259=>_0x4d0259[_0x509d6e(0x18f)]===SKILL_FILE),_0x26a5ab=fileText(_0x50639e),_0x125537=getRuntimeSkillDir(_0x56bf3f[_0x509d6e(0x18e)],_0x56bf3f[_0x509d6e(0x19c)],_0x56bf3f[_0x509d6e(0x188)],_0x4841e2,_0x458ff8,_0x56bf3f[_0x509d6e(0x187)]),_0x3d83d9=resolve(_0x125537,SKILL_FILE),_0x47aca8=resolve(_0x125537,METADATA_FILE),_0xb5bd76=contentHash(_0x26a5ab),_0x79ae64=readMetadataIfPresent(_0x47aca8)?.[_0x509d6e(0x1a2)];ensurePulledFilesCanBeOverwritten(_0x125537,_0x47aca8,_0x1f0d36,_0x56bf3f[_0x509d6e(0x17c)]===!![]),mkdirSync(_0x125537,{'recursive':!![],'mode':0x1c0});const _0x1557a5=existsSync(_0x3d83d9)?readFileSync(_0x3d83d9,_0x509d6e(0x198)):undefined;return materializeFiles(_0x125537,_0x1f0d36),removeStaleManagedFiles(_0x125537,_0x79ae64,_0x1f0d36),writeJsonAtomic(_0x47aca8,buildMetadata(_0x388e58,_0x4841e2,_0x56bf3f['appCode'],_0xb5bd76,_0x56bf3f[_0x509d6e(0x192)],_0x1f0d36,_0x4c940b)),{'skill':_0x388e58,'scope':_0x4841e2,'dir':_0x125537,'skillMdPath':_0x3d83d9,'metadataPath':_0x47aca8,'contentHash':_0xb5bd76,'changed':_0x1557a5!==_0x26a5ab};}function withMaterializedSkillFrontmatter(_0x1d7afa,_0x43b3ef,_0x38d861){const _0xcaf512=a91_0x1651;return normalizeLocalFiles(_0x1d7afa)[_0xcaf512(0x179)](_0x5e2c29=>{const _0x12c89a=_0xcaf512,_0x2dd4bd=fileText(_0x5e2c29);if(_0x5e2c29['path']!==SKILL_FILE||hasYamlFrontmatter(_0x2dd4bd))return _0x5e2c29;return{'path':_0x5e2c29[_0x12c89a(0x18f)],'content':prependSkillFrontmatter(_0x2dd4bd,{'name':_0x38d861,'description':_0x43b3ef[_0x12c89a(0x17b)]?.[_0x12c89a(0x19d)]()||_0x43b3ef[_0x12c89a(0x18d)]?.[_0x12c89a(0x19d)]()||_0x38d861})};});}function hasYamlFrontmatter(_0x24a603){return/^\uFEFF?---\s*\r?\n/['test'](_0x24a603);}function prependSkillFrontmatter(_0x4284c5,_0x51ac22){const _0x23c098=a91_0x1651,_0x5a9d68=_0x4284c5[_0x23c098(0x1a3)](/^\uFEFF/,'');return['---',_0x23c098(0x19b)+yamlString(_0x51ac22[_0x23c098(0x195)]),'description:\x20'+yamlString(_0x51ac22[_0x23c098(0x17b)]),_0x23c098(0x183),'',_0x5a9d68][_0x23c098(0x190)]('\x0a');}function yamlString(_0x2d4c7c){const _0x2a7626=a91_0x1651;return JSON[_0x2a7626(0x17e)](_0x2d4c7c[_0x2a7626(0x1a3)](/\r/g,'')[_0x2a7626(0x19d)]());}function ensurePulledFilesCanBeOverwritten(_0x519404,_0x457d98,_0x17d689,_0x4949b7){const _0x4d5e62=a91_0x1651;if(_0x4949b7||!existsSync(_0x457d98))return;const _0x1a8d15=readMetadataIfPresent(_0x457d98);if(!_0x1a8d15)return;const _0x55a2df=_0x1a8d15[_0x4d5e62(0x1a2)]&&Object[_0x4d5e62(0x199)](_0x1a8d15[_0x4d5e62(0x1a2)])[_0x4d5e62(0x18a)]>0x0?_0x1a8d15[_0x4d5e62(0x1a2)]:undefined;if(_0x55a2df)for(const [_0x2cb91c,_0x2ecba6]of Object[_0x4d5e62(0x17a)](_0x55a2df)){const _0x2129a9=resolveManagedFilePath(_0x519404,_0x2cb91c);if(!existsSync(_0x2129a9))throw CliErrors[_0x4d5e62(0x180)](_0x4d5e62(0x1a1)+_0x519404,_0x4d5e62(0x1a0)+_0x2cb91c);const _0x5bef56=lstatSync(_0x2129a9);if(!_0x5bef56[_0x4d5e62(0x197)]())throw CliErrors[_0x4d5e62(0x180)](_0x4d5e62(0x1a1)+_0x519404,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x2cb91c);const _0x34a3a2=bufferSha256(readFileSync(_0x2129a9));if(_0x34a3a2!==_0x2ecba6)throw CliErrors[_0x4d5e62(0x180)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x519404+_0x4d5e62(0x1a4)+_0x2cb91c,_0x4d5e62(0x177)+_0x2cb91c);}else{const _0xb0c7ab=resolve(_0x519404,SKILL_FILE);if(existsSync(_0xb0c7ab)&&_0x1a8d15['contentHash']){const _0x2f4686=contentHash(readFileSync(_0xb0c7ab,_0x4d5e62(0x198)));if(_0x2f4686!==_0x1a8d15[_0x4d5e62(0x19e)])throw CliErrors[_0x4d5e62(0x180)](_0x4d5e62(0x182)+_0xb0c7ab,_0x4d5e62(0x18c));}}for(const _0x240aa4 of normalizeLocalFiles(_0x17d689)){if(_0x55a2df?.[_0x240aa4['path']])continue;if(!_0x55a2df&&_0x240aa4[_0x4d5e62(0x18f)]===SKILL_FILE)continue;const _0x2e4c90=resolveManagedFilePath(_0x519404,_0x240aa4[_0x4d5e62(0x18f)]);if(!existsSync(_0x2e4c90))continue;const _0x46343d=lstatSync(_0x2e4c90);if(!_0x46343d['isFile']())throw CliErrors['validation'](_0x4d5e62(0x1a1)+_0x519404,_0x4d5e62(0x194)+_0x240aa4[_0x4d5e62(0x18f)]);const _0x1c5847=bufferSha256(readFileSync(_0x2e4c90));if(_0x1c5847!==fileHash(_0x240aa4))throw CliErrors[_0x4d5e62(0x180)](_0x4d5e62(0x1a1)+_0x519404,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x240aa4[_0x4d5e62(0x18f)]);}}function materializeFiles(_0x531f17,_0x573b9f){const _0x416b62=a91_0x1651;for(const _0x2f24b7 of normalizeLocalFiles(_0x573b9f)){const _0x48bdf2=resolveManagedFilePath(_0x531f17,_0x2f24b7[_0x416b62(0x18f)]);mkdirSync(dirname(_0x48bdf2),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x48bdf2,fileContent(_0x2f24b7),0x180);}}function a91_0x4c81(){const _0x267e95=['utf8','keys','135wUPteu','name:\x20','accessKey','trim','contentHash','Runtime\x20Skill\x20package\x20is\x20missing\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','fileHashes','replace','.\x20Changed\x20file:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','2489767JFxJFt','map','entries','description','force','75996pfStKC','stringify','4410aoNamU','validation','298176sCiShw','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','---','150gRpamB','8474191sLwHlj','packageBytes','paths','appCode','find','length','53xFGxMg','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','skillName','env','path','join','73985QVyNED','pulledAt','110sqTCqP','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','name','12820jsnFyK','isFile'];a91_0x4c81=function(){return _0x267e95;};return a91_0x4c81();}function removeStaleManagedFiles(_0x597e37,_0xebfe36,_0x3d6166){const _0x46787f=a91_0x1651;if(!_0xebfe36)return;const _0x5cdfb1=new Set(normalizeLocalFiles(_0x3d6166)[_0x46787f(0x179)](_0x5640bc=>_0x5640bc[_0x46787f(0x18f)]));for(const _0x36b4e5 of Object[_0x46787f(0x199)](_0xebfe36)){if(_0x5cdfb1['has'](_0x36b4e5))continue;const _0x5c405d=resolveManagedFilePath(_0x597e37,_0x36b4e5);existsSync(_0x5c405d)&&lstatSync(_0x5c405d)[_0x46787f(0x197)]()&&rmSync(_0x5c405d,{'force':!![]});}}
@@ -0,0 +1 @@
1
+ (function(_0x492094,_0x57a87d){const _0x33d476=a92_0x15c2,_0x3922db=_0x492094();while(!![]){try{const _0x183159=-parseInt(_0x33d476(0x124))/0x1*(-parseInt(_0x33d476(0x12c))/0x2)+-parseInt(_0x33d476(0x112))/0x3+-parseInt(_0x33d476(0x116))/0x4*(parseInt(_0x33d476(0x11a))/0x5)+-parseInt(_0x33d476(0x121))/0x6+-parseInt(_0x33d476(0x127))/0x7+parseInt(_0x33d476(0x125))/0x8*(parseInt(_0x33d476(0x113))/0x9)+parseInt(_0x33d476(0x119))/0xa;if(_0x183159===_0x57a87d)break;else _0x3922db['push'](_0x3922db['shift']());}catch(_0x2d6cd1){_0x3922db['push'](_0x3922db['shift']());}}}(a92_0x435d,0xbd35e));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a92_0x15c2(_0x369689,_0x3bdd36){_0x369689=_0x369689-0x112;const _0x435d4d=a92_0x435d();let _0x15c2dc=_0x435d4d[_0x369689];return _0x15c2dc;}import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';function a92_0x435d(){const _0x180342=['length','string','1101366wctKhc','387ZNthJR','fromEntries','parse','12Liewmy','files','tags','17196720PdoEwj','2140870kRWUrX','toISOString','manifest','Runtime\x20Skill\x20is\x20missing\x20skillCode.','utf8','forkedFromSkillId','map','7961274zryKno','skillName','trim','1099XEQyka','216488rWlZWm','sourceSessionId','1062852WzHfAV','forkedFromVersion','path','status','validation','1860sfxVsm','isArray','personal','userId','object','tenantCode'];a92_0x435d=function(){return _0x180342;};return a92_0x435d();}import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x42792a,_0xc6a262,_0xab83d3,_0x4c095a,_0x77114c,_0x46a90a,_0x354748){const _0x2ee90c=a92_0x15c2,_0xc30a0a=_0x46a90a?normalizeLocalFiles(_0x46a90a):[],_0x231641=!_0x354748&&_0xc30a0a[_0x2ee90c(0x132)]>0x0?buildSkillPackage(_0xc30a0a):undefined,_0x138d37=_0x354748?bufferSha256(_0x354748):_0x231641?.[_0x2ee90c(0x11c)]['zipSha256'],_0x4d7ad7=_0x354748?.[_0x2ee90c(0x132)]??_0x231641?.[_0x2ee90c(0x11c)]['zipSize'],_0x25a763=_0xc30a0a[_0x2ee90c(0x132)]>0x0?Object[_0x2ee90c(0x114)](_0xc30a0a['map'](_0x3d2d70=>[_0x3d2d70[_0x2ee90c(0x129)],fileHash(_0x3d2d70)])):undefined;return{'schemaVersion':_0xc30a0a[_0x2ee90c(0x132)]>0x0?0x2:0x1,'id':_0x42792a['id'],'appCode':_0xab83d3,'skillCode':requireSkillCode(_0x42792a),'skillName':_0x42792a[_0x2ee90c(0x122)],'description':_0x42792a['description'],'scope':_0xc6a262,'readonly':_0xc6a262!==_0x2ee90c(0x12e)||_0x42792a['readonly']===!![],'tenantCode':_0x42792a[_0x2ee90c(0x131)],'userId':_0x42792a[_0x2ee90c(0x12f)],'version':_0x42792a['version'],'status':_0x42792a[_0x2ee90c(0x12a)],'tags':Array['isArray'](_0x42792a[_0x2ee90c(0x118)])?_0x42792a[_0x2ee90c(0x118)]:[],'hasUpstreamUpdate':_0x42792a['hasUpstreamUpdate'],'forkedFromSkillId':_0x42792a[_0x2ee90c(0x11f)],'forkedFromVersion':_0x42792a[_0x2ee90c(0x128)],'sourceSessionId':_0x42792a[_0x2ee90c(0x126)],'contentHash':_0x4c095a,'fileHashes':_0x25a763,'treeHash':_0xc30a0a[_0x2ee90c(0x132)]>0x0?fileTreeHash(localFilesToManifestFiles(_0xc30a0a)):undefined,'ossPath':remoteManifestOssPath(_0x42792a[_0x2ee90c(0x117)]),'zipSha256':_0x138d37,'zipSize':_0x4d7ad7,'files':_0xc30a0a[_0x2ee90c(0x132)]>0x0?_0xc30a0a[_0x2ee90c(0x120)](_0x3effd0=>({'path':_0x3effd0[_0x2ee90c(0x129)],'hash':fileHash(_0x3effd0),'size':fileContent(_0x3effd0)[_0x2ee90c(0x132)]})):undefined,'pulledAt':_0x77114c??new Date()[_0x2ee90c(0x11b)]()};}export function requireSkillCode(_0x32e95b){const _0x833cb=a92_0x15c2,_0x4138f8=_0x32e95b['skillCode']?.[_0x833cb(0x123)]();if(!_0x4138f8)throw CliErrors[_0x833cb(0x12b)](_0x833cb(0x11d));return _0x4138f8;}export function readMetadataIfPresent(_0x32f23e){const _0x3344c6=a92_0x15c2;if(!existsSync(_0x32f23e))return undefined;try{const _0x524716=JSON[_0x3344c6(0x115)](readFileSync(_0x32f23e,_0x3344c6(0x11e)));return _0x524716;}catch{throw CliErrors[_0x3344c6(0x12b)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x32f23e);}}function remoteManifestOssPath(_0x506c6f){const _0xc3b965=a92_0x15c2;if(!_0x506c6f||typeof _0x506c6f!==_0xc3b965(0x130)||Array[_0xc3b965(0x12d)](_0x506c6f))return undefined;const _0x58aa11=_0x506c6f['ossPath'];return typeof _0x58aa11===_0xc3b965(0x133)&&_0x58aa11['trim']()?_0x58aa11[_0xc3b965(0x123)]():undefined;}
@@ -0,0 +1 @@
1
+ const a93_0x402e67=a93_0x1386;(function(_0x4962d6,_0x2139ea){const _0x35e1fb=a93_0x1386,_0x38fb3e=_0x4962d6();while(!![]){try{const _0x176d46=-parseInt(_0x35e1fb(0xba))/0x1*(-parseInt(_0x35e1fb(0xae))/0x2)+parseInt(_0x35e1fb(0xb2))/0x3*(parseInt(_0x35e1fb(0xb3))/0x4)+-parseInt(_0x35e1fb(0xab))/0x5*(-parseInt(_0x35e1fb(0xa3))/0x6)+-parseInt(_0x35e1fb(0xb0))/0x7*(-parseInt(_0x35e1fb(0xaa))/0x8)+-parseInt(_0x35e1fb(0xb6))/0x9+-parseInt(_0x35e1fb(0xa4))/0xa+-parseInt(_0x35e1fb(0xa9))/0xb*(parseInt(_0x35e1fb(0xa8))/0xc);if(_0x176d46===_0x2139ea)break;else _0x38fb3e['push'](_0x38fb3e['shift']());}catch(_0x154c16){_0x38fb3e['push'](_0x38fb3e['shift']());}}}(a93_0x3548,0xb145a));import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';function a93_0x3548(){const _0x472915=['6aRJPqs','8396240fnOWQb','SKILL_ROOT','homeDir','skills','12uLISqX','7761314RHlPTf','24LUBmcS','2006205VxKkfI','agentsSkillsDir','includes','10688tJcfay','.agents','1023743KVVyqV','validation','1155tOEYcH','12948HVnBNl','claudeSkillsDir','appCode','1652985xnGOLV','homeDirName','path\x20segment','skillCode','69lFqSxo','CLAUDE_SKILL_ROOT','.claude'];a93_0x3548=function(){return _0x472915;};return a93_0x3548();}function a93_0x1386(_0x594a00,_0x4174d1){_0x594a00=_0x594a00-0xa1;const _0x3548f6=a93_0x3548();let _0x1386cf=_0x3548f6[_0x594a00];return _0x1386cf;}export function resolveSkillSyncPaths(_0x3a879f={}){const _0x2a6811=a93_0x1386,_0x10d60e=_0x3a879f[_0x2a6811(0xa6)]??homedir(),_0x45533d=resolve(_0x10d60e,PRODUCT_CONFIG[_0x2a6811(0xb7)],'cache'),_0xef4c0d=trimmedEnv(_0x2a6811(0xa5)),_0x4ffd20=trimmedEnv(_0x2a6811(0xa1));return{'homeDir':_0x10d60e,'cacheRoot':_0x45533d,'managedRoot':resolve(_0x10d60e,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x3a879f[_0x2a6811(0xac)]??_0xef4c0d??resolve(_0x10d60e,_0x2a6811(0xaf),_0x2a6811(0xa7)),'claudeSkillsDir':_0x3a879f[_0x2a6811(0xb4)]??_0x4ffd20??resolve(_0x10d60e,_0x2a6811(0xa2),'skills')};}export function getRuntimeSkillCacheRoot(_0xa34563,_0x1c84c3,_0x5a568f={}){const _0x146ae9=a93_0x1386,_0x3ad61b=resolveSkillSyncPaths(_0x5a568f);return resolve(_0x3ad61b['cacheRoot'],_0xa34563,fingerprintAccessKey(_0x1c84c3),_0x146ae9(0xa7));}export function getRuntimeSkillDir(_0x38d6d9,_0x596ddd,_0x225aa0,_0x1d4d5c,_0x337e0e,_0x3cd732={}){const _0x2f3fa0=a93_0x1386;return resolve(getRuntimeSkillCacheRoot(_0x38d6d9,_0x596ddd,_0x3cd732),safePathSegment(_0x225aa0,_0x2f3fa0(0xb5)),_0x1d4d5c,safePathSegment(_0x337e0e,_0x2f3fa0(0xb9)));}export function safePathSegment(_0x4a7626,_0x111ee1=a93_0x402e67(0xb8)){const _0x1e7baa=a93_0x402e67;if(!_0x4a7626||_0x4a7626[_0x1e7baa(0xad)]('/')||_0x4a7626[_0x1e7baa(0xad)]('\x5c')||_0x4a7626[_0x1e7baa(0xad)]('..'))throw CliErrors[_0x1e7baa(0xb1)]('Unsafe\x20'+_0x111ee1+'\x20for\x20local\x20path:\x20'+_0x4a7626);return _0x4a7626;}function trimmedEnv(_0x4e61fb){const _0x5177dd=productEnv(_0x4e61fb)?.['trim']();return _0x5177dd?_0x5177dd:undefined;}
@@ -0,0 +1 @@
1
+ (function(_0x294bf6,_0x2325b9){const _0x3f0b68=a94_0x4f39,_0xbe1ac1=_0x294bf6();while(!![]){try{const _0x188259=-parseInt(_0x3f0b68(0x91))/0x1*(-parseInt(_0x3f0b68(0xa0))/0x2)+parseInt(_0x3f0b68(0x8e))/0x3*(-parseInt(_0x3f0b68(0x87))/0x4)+parseInt(_0x3f0b68(0x9d))/0x5*(parseInt(_0x3f0b68(0x8f))/0x6)+parseInt(_0x3f0b68(0x9f))/0x7+-parseInt(_0x3f0b68(0x9c))/0x8+parseInt(_0x3f0b68(0x9a))/0x9+-parseInt(_0x3f0b68(0xa3))/0xa;if(_0x188259===_0x2325b9)break;else _0xbe1ac1['push'](_0xbe1ac1['shift']());}catch(_0x54c906){_0xbe1ac1['push'](_0xbe1ac1['shift']());}}}(a94_0x23a2,0x8810c));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a94_0x23a2(){const _0x2c2e92=['8826327Tdlfvp','pushedAt','3748816hQUXTJ','10195uDQqeo','scope','6796811oMuuSw','2hUFtEK','Skill\x20metadata\x20appCode\x20\x22','validation','14353450wyrNYq','skillCode','slice','manifest','description','appCode','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','412uhMPTU','tags','packageBase64','personal','Skill\x20directory\x20not\x20found:\x20','skillName','files','20595tzwpbt','606hsxhnH','isSymbolicLink','1010751sEWDXp','\x20or\x20directory\x20name.','isFile','isDirectory','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','find','Unable\x20to\x20resolve\x20skillCode\x20from\x20','path','content'];a94_0x23a2=function(){return _0x2c2e92;};return a94_0x23a2();}import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';function a94_0x4f39(_0x16c44f,_0xe5f796){_0x16c44f=_0x16c44f-0x87;const _0x23a25d=a94_0x23a2();let _0x4f395e=_0x23a25d[_0x16c44f];return _0x4f395e;}export function readPushDirectory(_0x1fc182,_0x502695){const _0x2dc4fb=a94_0x4f39,_0x33226e=resolvePushDirectoryRoot(_0x1fc182),_0x2cce56=resolve(_0x33226e,SKILL_FILE);if(!existsSync(_0x2cce56)||!lstatSync(_0x2cce56)[_0x2dc4fb(0x93)]())throw CliErrors[_0x2dc4fb(0xa2)]('Missing\x20'+SKILL_FILE+':\x20'+_0x2cce56);const _0x5bd97f=readMetadataIfPresent(resolve(_0x33226e,METADATA_FILE));if(_0x5bd97f?.[_0x2dc4fb(0x9e)]&&_0x5bd97f[_0x2dc4fb(0x9e)]!==_0x2dc4fb(0x8a))throw CliErrors[_0x2dc4fb(0xa2)](_0x2dc4fb(0x95)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x5bd97f[_0x2dc4fb(0x9e)]+'\x22.');if(_0x5bd97f?.[_0x2dc4fb(0xa8)]&&_0x5bd97f[_0x2dc4fb(0xa8)]!==_0x502695)throw CliErrors['validation'](_0x2dc4fb(0xa1)+_0x5bd97f[_0x2dc4fb(0xa8)]+_0x2dc4fb(0xa9)+_0x502695+'\x22.');const _0x48194a=scanSkillDirectory(_0x33226e),_0x403910=buildSkillPackage(_0x48194a),_0x45ae8d=readFileSync(_0x2cce56,'utf8'),_0x3ebe0f=_0x5bd97f?.[_0x2dc4fb(0xa4)]??deriveSkillCodeFromDirectory(_0x33226e,_0x502695);if(!_0x3ebe0f)throw CliErrors[_0x2dc4fb(0xa2)](_0x2dc4fb(0x97)+METADATA_FILE+_0x2dc4fb(0x92));return{'skillCode':_0x3ebe0f,'metadata':_0x5bd97f,'input':{'skillCode':_0x3ebe0f,'skillName':_0x5bd97f?.[_0x2dc4fb(0x8c)],'description':_0x5bd97f?.[_0x2dc4fb(0xa7)],'content':_0x45ae8d,'files':_0x403910[_0x2dc4fb(0xa6)],'packageBase64':_0x403910[_0x2dc4fb(0x89)],'tags':_0x5bd97f?.[_0x2dc4fb(0x88)],'version':_0x5bd97f?.['version'],'sourceSessionId':_0x5bd97f?.['sourceSessionId']}};}export function recordPushedRuntimeSkill(_0x5049f5,_0x4bbc66,_0x52b307,_0x901526={}){const _0x231235=a94_0x4f39,_0x394ded=resolvePushDirectoryRoot(_0x5049f5),_0x61a78c=scanSkillDirectory(_0x394ded),_0x2ce00d=_0x61a78c[_0x231235(0x96)](_0x22b8ea=>_0x22b8ea[_0x231235(0x98)]===SKILL_FILE),_0x5eeb9a=_0x2ce00d?fileText(_0x2ce00d):'',_0x4a7ee3=tryNormalizePackageManifest(_0x4bbc66[_0x231235(0x8d)]),_0x140c41={..._0x4bbc66,'content':_0x4bbc66['content']??_0x5eeb9a,'files':_0x4a7ee3},_0x3736cc=_0x4a7ee3?normalizeLocalFiles(_0x61a78c)['filter'](_0x3b8023=>_0x4a7ee3['files']['some'](_0x2027e7=>_0x2027e7[_0x231235(0x98)]===_0x3b8023['path'])):undefined,_0x1f0133=buildMetadata(_0x140c41,_0x901526[_0x231235(0x9e)]??_0x231235(0x8a),_0x52b307,contentHash(_0x140c41[_0x231235(0x99)]??''),_0x901526[_0x231235(0x9b)],_0x3736cc);writeJsonAtomic(resolve(_0x394ded,METADATA_FILE),_0x1f0133);}export function deriveSkillCodeFromDirectory(_0x404c32,_0x391b6b){const _0x1e8fef=a94_0x4f39,_0x4d45cb=basename(resolve(_0x404c32)),_0x430315=_0x391b6b+'--';return _0x4d45cb['startsWith'](_0x430315)?_0x4d45cb[_0x1e8fef(0xa5)](_0x430315['length']):_0x4d45cb;}function resolvePushDirectoryRoot(_0xb1fb0){const _0x39ac30=a94_0x4f39,_0x29143b=resolve(_0xb1fb0);if(!existsSync(_0x29143b))throw CliErrors['validation'](_0x39ac30(0x8b)+_0xb1fb0);const _0x1efed3=lstatSync(_0x29143b);if(_0x1efed3[_0x39ac30(0x94)]())return _0x29143b;if(_0x1efed3[_0x39ac30(0x90)]()){const _0xaa03e=realpathSync(_0x29143b);if(lstatSync(_0xaa03e)[_0x39ac30(0x94)]())return _0xaa03e;}throw CliErrors['validation'](_0x39ac30(0x8b)+_0xb1fb0);}
@@ -0,0 +1 @@
1
+ function a95_0x3427(_0x168597,_0x5ab215){_0x168597=_0x168597-0xe3;const _0x7df5c3=a95_0x7df5();let _0x342734=_0x7df5c3[_0x168597];return _0x342734;}(function(_0x485317,_0x43452e){const _0x61aba8=a95_0x3427,_0x41deb4=_0x485317();while(!![]){try{const _0x51942b=-parseInt(_0x61aba8(0xeb))/0x1+-parseInt(_0x61aba8(0xea))/0x2+parseInt(_0x61aba8(0xe4))/0x3+-parseInt(_0x61aba8(0xe3))/0x4+parseInt(_0x61aba8(0xe5))/0x5*(parseInt(_0x61aba8(0xe7))/0x6)+-parseInt(_0x61aba8(0xf1))/0x7+parseInt(_0x61aba8(0xee))/0x8*(parseInt(_0x61aba8(0xe9))/0x9);if(_0x51942b===_0x43452e)break;else _0x41deb4['push'](_0x41deb4['shift']());}catch(_0x1482a5){_0x41deb4['push'](_0x41deb4['shift']());}}}(a95_0x7df5,0x60bab));function a95_0x7df5(){const _0x19fb58=['140517IJvTGQ','425010cNngzk','771730sBTPvo','length','includes','936YeHMWM','Unsupported\x20runtime\x20Skill\x20scope:\x20','validation','4728787AyZyXm','company','2459592XQfVeQ','1473978qDXFdu','58805VrhcKn','builtin','180eGhbsr','personal'];a95_0x7df5=function(){return _0x19fb58;};return a95_0x7df5();}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x4bdb98){const _0x364749=a95_0x3427,_0x13bf60=_0x4bdb98&&_0x4bdb98[_0x364749(0xec)]>0x0?_0x4bdb98:[_0x364749(0xe8),_0x364749(0xf2),_0x364749(0xe6)],_0x5a15e3=[];for(const _0x1ffb8f of _0x13bf60){if(!isRuntimeSkillScope(_0x1ffb8f))throw CliErrors[_0x364749(0xf0)](_0x364749(0xef)+_0x1ffb8f);!_0x5a15e3[_0x364749(0xed)](_0x1ffb8f)&&_0x5a15e3['push'](_0x1ffb8f);}return _0x5a15e3;}export function isRuntimeSkillScope(_0x2f4681){const _0x323f94=a95_0x3427;return _0x2f4681===_0x323f94(0xe8)||_0x2f4681===_0x323f94(0xf2)||_0x2f4681===_0x323f94(0xe6);}
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1 @@
1
+ (function(_0x5bda8b,_0x4cd097){const _0x1c5b1c=a97_0x3734,_0x5c9615=_0x5bda8b();while(!![]){try{const _0x233e1d=-parseInt(_0x1c5b1c(0x1b2))/0x1*(-parseInt(_0x1c5b1c(0x1b5))/0x2)+parseInt(_0x1c5b1c(0x19d))/0x3+-parseInt(_0x1c5b1c(0x1b0))/0x4*(parseInt(_0x1c5b1c(0x1a4))/0x5)+parseInt(_0x1c5b1c(0x19e))/0x6+-parseInt(_0x1c5b1c(0x1ac))/0x7*(parseInt(_0x1c5b1c(0x1a9))/0x8)+-parseInt(_0x1c5b1c(0x1a5))/0x9*(-parseInt(_0x1c5b1c(0x1ad))/0xa)+parseInt(_0x1c5b1c(0x1b1))/0xb*(-parseInt(_0x1c5b1c(0x1b6))/0xc);if(_0x233e1d===_0x4cd097)break;else _0x5c9615['push'](_0x5c9615['shift']());}catch(_0x405d3b){_0x5c9615['push'](_0x5c9615['shift']());}}}(a97_0x1166,0x5e6a0));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{MAX_SKILL_FILE_BYTES,MAX_SKILL_FILE_COUNT,MAX_SKILL_PACKAGE_BYTES,MAX_SKILL_TOTAL_BYTES}from'./constants.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date('1980-01-01T00:00:00.000Z');function a97_0x3734(_0x54573f,_0x2fbf6f){_0x54573f=_0x54573f-0x19a;const _0x11662d=a97_0x1166();let _0x37346e=_0x11662d[_0x54573f];return _0x37346e;}function a97_0x1166(){const _0x56e344=['entries','object','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','map','validation','1948910tjIyEP','142290kDJslp','validation_error','code','path','208uzndUP','length','endsWith','129913jMSqdI','470aatmsU','sort','originalSize','4cNAALJ','77891wWDFyt','1qHEjbG','Runtime\x20Skill\x20package\x20exceeds\x20total\x20file\x20size\x20limit.','Runtime\x20Skill\x20package\x20exceeds\x20file\x20count\x20limit.','722798FNUuro','1608IrYAEQ','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','Skill\x20package\x20exceeds\x20size\x20limit.','from','1590405bAeYRf','3439716LlVXww'];a97_0x1166=function(){return _0x56e344;};return a97_0x1166();}export function createDeterministicZipPackage(_0x46a3a1){const _0x2a0d7e=a97_0x3734,_0x546be1={};for(const _0x4bbe5b of normalizeLocalFiles(_0x46a3a1)){_0x546be1[_0x4bbe5b[_0x2a0d7e(0x1a8)]]=fileContent(_0x4bbe5b);}const _0x4a97ff=Buffer[_0x2a0d7e(0x19c)](zipSync(_0x546be1,{'level':0x0,'mtime':ZIP_MTIME}));if(_0x4a97ff[_0x2a0d7e(0x1aa)]>MAX_SKILL_PACKAGE_BYTES)throw CliErrors[_0x2a0d7e(0x1a3)](_0x2a0d7e(0x19b));return _0x4a97ff;}export function parseZipPackage(_0x2e1baf){const _0x5bdf03=a97_0x3734;if(_0x2e1baf[_0x5bdf03(0x1aa)]<0x16)throw CliErrors[_0x5bdf03(0x1a3)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');if(_0x2e1baf[_0x5bdf03(0x1aa)]>MAX_SKILL_PACKAGE_BYTES)throw CliErrors[_0x5bdf03(0x1a3)]('Runtime\x20Skill\x20package\x20exceeds\x20size\x20limit.');let _0xf6ad7b=0x0,_0x2423be=0x0,_0x5b94aa;try{_0x5b94aa=unzipSync(_0x2e1baf,{'filter'(_0x49866c){const _0x9a1cab=_0x5bdf03,_0x4f3913=normalizeSkillRelativePath(_0x49866c['name']);if(_0x4f3913[_0x9a1cab(0x1ab)]('/'))throw CliErrors[_0x9a1cab(0x1a3)](_0x9a1cab(0x1a1)+_0x4f3913);if(_0x49866c[_0x9a1cab(0x1af)]>MAX_SKILL_FILE_BYTES)throw CliErrors[_0x9a1cab(0x1a3)]('Runtime\x20Skill\x20package\x20file\x20exceeds\x20size\x20limit:\x20'+_0x4f3913);_0xf6ad7b+=0x1;if(_0xf6ad7b>MAX_SKILL_FILE_COUNT)throw CliErrors[_0x9a1cab(0x1a3)](_0x9a1cab(0x1b4));_0x2423be+=_0x49866c[_0x9a1cab(0x1af)];if(_0x2423be>MAX_SKILL_TOTAL_BYTES)throw CliErrors[_0x9a1cab(0x1a3)](_0x9a1cab(0x1b3));return!![];}});}catch(_0xc04a07){if(isRuntimeSkillValidationError(_0xc04a07))throw _0xc04a07;throw CliErrors[_0x5bdf03(0x1a3)](_0x5bdf03(0x19a));}return Object[_0x5bdf03(0x19f)](_0x5b94aa)[_0x5bdf03(0x1a2)](([_0x1f80dc,_0x4c0cdf])=>({'path':normalizeSkillRelativePath(_0x1f80dc),'bytes':Buffer[_0x5bdf03(0x19c)](_0x4c0cdf)}))[_0x5bdf03(0x1ae)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x42b405){const _0x31efed=a97_0x3734;return typeof _0x42b405===_0x31efed(0x1a0)&&_0x42b405!==null&&_0x31efed(0x1a7)in _0x42b405&&_0x42b405['code']===_0x31efed(0x1a6);}
@@ -0,0 +1 @@
1
+ (function(_0x12746b,_0x544cf9){const _0xa750a=a98_0x6abb,_0x177304=_0x12746b();while(!![]){try{const _0x2377a7=parseInt(_0xa750a(0xc1))/0x1+parseInt(_0xa750a(0xa8))/0x2+-parseInt(_0xa750a(0xb2))/0x3*(parseInt(_0xa750a(0xa6))/0x4)+-parseInt(_0xa750a(0xbd))/0x5+-parseInt(_0xa750a(0xaf))/0x6+-parseInt(_0xa750a(0xca))/0x7*(parseInt(_0xa750a(0xc3))/0x8)+parseInt(_0xa750a(0xc5))/0x9*(parseInt(_0xa750a(0xd4))/0xa);if(_0x2377a7===_0x544cf9)break;else _0x177304['push'](_0x177304['shift']());}catch(_0x10eb5a){_0x177304['push'](_0x177304['shift']());}}}(a98_0x4990,0xca450));function a98_0x6abb(_0x3c7a32,_0x4f7b19){_0x3c7a32=_0x3c7a32-0xa5;const _0x4990a8=a98_0x4990();let _0x6abb39=_0x4990a8[_0x3c7a32];return _0x6abb39;}import{CliErrors}from'../../errors.js';import{MAX_SKILL_PACKAGE_BYTES,SKILL_FILE}from'./constants.js';function a98_0x4990(){const _0x388fa2=['toString','get','length','ossPath','4OGGmrb','sha256','707298MMKoKe','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','Runtime\x20Skill\x20package\x20exceeds\x20size\x20limit:\x20','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','files','schemaVersion','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','5480856TfcTHf','zipSize','string','3148521zJtPpB','some','set','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','Runtime\x20Skill\x20package\x20exceeds\x20size\x20limit.','object','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','treeSha256','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','bytes','map','321640YWTGyW','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','zipSha256','1349042kCRThz','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','7443496piUvqX','size','18751977JSsGHn','validation','trim','Runtime\x20Skill\x20package\x20is\x20missing\x20','Missing\x20','7ELLwyB','isSafeInteger','toLowerCase','has','path','base64','requireOssPath','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','Runtime\x20Skill\x20package\x20size\x20mismatch.','push','10UEPJWO','isArray'];a98_0x4990=function(){return _0x388fa2;};return a98_0x4990();}import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x28d9ee){const _0x5bb288=a98_0x6abb,_0x14e72a=normalizeLocalFiles(_0x28d9ee);if(!_0x14e72a[_0x5bb288(0xb3)](_0x3fa985=>_0x3fa985[_0x5bb288(0xce)]===SKILL_FILE))throw CliErrors[_0x5bb288(0xc6)](_0x5bb288(0xc9)+SKILL_FILE+'\x20in\x20Skill\x20file\x20package.');const _0x4a5bb7=localFilesToManifestFiles(_0x14e72a),_0x5a6614=createDeterministicZipPackage(_0x14e72a);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x4a5bb7),'zipSha256':bufferSha256(_0x5a6614),'zipSize':_0x5a6614['length'],'files':_0x4a5bb7},'packageBytes':_0x5a6614,'packageBase64':_0x5a6614[_0x5bb288(0xd6)](_0x5bb288(0xcf))};}export function verifyRuntimeSkillPackage(_0x4ce4fc,_0x727c39){const _0x1a3d32=a98_0x6abb,_0x19029f=normalizePackageManifest(_0x4ce4fc,{'requireOssPath':![]});if(!_0x19029f)throw CliErrors[_0x1a3d32(0xc6)](_0x1a3d32(0xbe));return extractAndVerifyPackage(_0x19029f,_0x727c39);}export function verifyRuntimeSkillBundle(_0x1608d3,_0x5b0875){const _0x54180d=a98_0x6abb,_0x1169b4=normalizePackageManifest(_0x1608d3,{'requireOssPath':![]});if(!_0x1169b4)throw CliErrors['validation'](_0x54180d(0xbe));if(_0x5b0875[_0x54180d(0xd8)]>MAX_SKILL_PACKAGE_BYTES)throw CliErrors[_0x54180d(0xc6)]('Runtime\x20Skill\x20package\x20exceeds\x20size\x20limit.');return extractAndVerifyPackageFiles(_0x1169b4,_0x5b0875);}export function tryNormalizePackageManifest(_0x5ff369){return normalizePackageManifest(_0x5ff369,{'requireOssPath':![]});}export function requirePackageBytes(_0x2adbb5,_0x38ea34){const _0x43cfe1=a98_0x6abb;if(!_0x38ea34||_0x38ea34[_0x43cfe1(0xd8)]===0x0)throw CliErrors['validation'](_0x43cfe1(0xd1)+_0x2adbb5);if(_0x38ea34[_0x43cfe1(0xd8)]>MAX_SKILL_PACKAGE_BYTES)throw CliErrors[_0x43cfe1(0xc6)](_0x43cfe1(0xaa)+_0x2adbb5);return _0x38ea34;}export function extractDownloadedPackage(_0x21e376){const _0x116fc4=a98_0x6abb,_0x1f8b24=parseZipPackage(_0x21e376)[_0x116fc4(0xbc)](_0x2eaf61=>({'path':_0x2eaf61[_0x116fc4(0xce)],'bytes':_0x2eaf61['bytes']}));if(!_0x1f8b24[_0x116fc4(0xb3)](_0x1e5b37=>_0x1e5b37[_0x116fc4(0xce)]===SKILL_FILE))throw CliErrors[_0x116fc4(0xc6)](_0x116fc4(0xc8)+SKILL_FILE+'.');return normalizeLocalFiles(_0x1f8b24);}export function localFilesToManifestFiles(_0x46d648){const _0x1c152d=a98_0x6abb;return normalizeLocalFiles(_0x46d648)[_0x1c152d(0xbc)](_0x3a0df4=>({'path':_0x3a0df4['path'],'sha256':fileHash(_0x3a0df4),'size':fileContent(_0x3a0df4)[_0x1c152d(0xd8)]}));}function normalizePackageManifest(_0x23cb56,_0x306afd){const _0x150ee2=a98_0x6abb;if(!_0x23cb56||typeof _0x23cb56!==_0x150ee2(0xb7)||Array[_0x150ee2(0xd5)](_0x23cb56))return undefined;const _0x5b63c7=_0x23cb56,_0x5cab75=typeof _0x5b63c7[_0x150ee2(0xa5)]===_0x150ee2(0xb1)?_0x5b63c7['ossPath'][_0x150ee2(0xc7)]():undefined;if(_0x306afd[_0x150ee2(0xd0)]&&!_0x5cab75)return undefined;if(!Array['isArray'](_0x5b63c7[_0x150ee2(0xac)])||_0x5b63c7['files'][_0x150ee2(0xd8)]===0x0)return undefined;if(!isSha256Hex(_0x5b63c7['treeSha256']))throw CliErrors[_0x150ee2(0xc6)](_0x150ee2(0xb8));if(!isSha256Hex(_0x5b63c7[_0x150ee2(0xc0)]))throw CliErrors[_0x150ee2(0xc6)](_0x150ee2(0xae));if(!Number[_0x150ee2(0xcb)](_0x5b63c7[_0x150ee2(0xb0)])||_0x5b63c7[_0x150ee2(0xb0)]<0x0)throw CliErrors[_0x150ee2(0xc6)](_0x150ee2(0xb5));if(_0x5b63c7[_0x150ee2(0xb0)]>MAX_SKILL_PACKAGE_BYTES)throw CliErrors[_0x150ee2(0xc6)](_0x150ee2(0xb6));const _0x72eae9=normalizeManifestFiles(_0x5b63c7['files']);if(!_0x72eae9['some'](_0x4b722e=>_0x4b722e[_0x150ee2(0xce)]===SKILL_FILE))throw CliErrors[_0x150ee2(0xc6)]('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x4605b9=fileTreeHash(_0x72eae9);if(_0x4605b9!==_0x5b63c7[_0x150ee2(0xb9)]['toLowerCase']())throw CliErrors[_0x150ee2(0xc6)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number['isSafeInteger'](_0x5b63c7[_0x150ee2(0xad)])?_0x5b63c7[_0x150ee2(0xad)]:0x2,'ossPath':_0x5cab75,'treeSha256':_0x4605b9,'zipSha256':_0x5b63c7[_0x150ee2(0xc0)][_0x150ee2(0xcc)](),'zipSize':_0x5b63c7[_0x150ee2(0xb0)],'files':_0x72eae9};}function extractAndVerifyPackage(_0x563978,_0x51a971){const _0x533287=a98_0x6abb,_0x35949f=normalizePackageManifest(_0x563978,{'requireOssPath':![]});if(!_0x35949f)throw CliErrors[_0x533287(0xc6)](_0x533287(0xbe));if(_0x51a971[_0x533287(0xd8)]!==_0x35949f[_0x533287(0xb0)])throw CliErrors['validation'](_0x533287(0xd2));const _0x208610=bufferSha256(_0x51a971);if(_0x208610!==_0x35949f[_0x533287(0xc0)])throw CliErrors[_0x533287(0xc6)](_0x533287(0xc2));return extractAndVerifyPackageFiles(_0x35949f,_0x51a971);}function extractAndVerifyPackageFiles(_0x16fca1,_0x2dbd4b){const _0x1eac36=a98_0x6abb,_0x185861=parseZipPackage(_0x2dbd4b);if(_0x185861[_0x1eac36(0xd8)]!==_0x16fca1[_0x1eac36(0xac)][_0x1eac36(0xd8)])throw CliErrors['validation'](_0x1eac36(0xab));const _0x3dbc68=new Map();for(const _0x430fb9 of _0x185861){if(_0x3dbc68[_0x1eac36(0xcd)](_0x430fb9[_0x1eac36(0xce)]))throw CliErrors[_0x1eac36(0xc6)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x430fb9[_0x1eac36(0xce)]);_0x3dbc68[_0x1eac36(0xb4)](_0x430fb9[_0x1eac36(0xce)],_0x430fb9);}const _0x572269=[];for(const _0x21ddf4 of _0x16fca1['files']){const _0x2e31e3=_0x3dbc68[_0x1eac36(0xd7)](_0x21ddf4[_0x1eac36(0xce)]);if(!_0x2e31e3)throw CliErrors[_0x1eac36(0xc6)](_0x1eac36(0xa9)+_0x21ddf4[_0x1eac36(0xce)]);if(_0x2e31e3[_0x1eac36(0xbb)]['length']!==_0x21ddf4[_0x1eac36(0xc4)])throw CliErrors[_0x1eac36(0xc6)](_0x1eac36(0xbf)+_0x21ddf4[_0x1eac36(0xce)]);const _0x2aefc1=bufferSha256(_0x2e31e3[_0x1eac36(0xbb)]);if(_0x2aefc1!==_0x21ddf4[_0x1eac36(0xa7)])throw CliErrors['validation'](_0x1eac36(0xba)+_0x21ddf4[_0x1eac36(0xce)]);_0x572269[_0x1eac36(0xd3)]({'path':_0x21ddf4['path'],'bytes':_0x2e31e3['bytes']});}return normalizeLocalFiles(_0x572269);}
@@ -1 +1 @@
1
- const a76_0x19070f=a76_0x30dc;(function(_0x13243a,_0x3d5e5c){const _0x164902=a76_0x30dc,_0x1e8a93=_0x13243a();while(!![]){try{const _0x74b48a=parseInt(_0x164902(0x18c))/0x1+-parseInt(_0x164902(0x131))/0x2+parseInt(_0x164902(0x182))/0x3+-parseInt(_0x164902(0x178))/0x4+-parseInt(_0x164902(0x185))/0x5*(-parseInt(_0x164902(0x1c6))/0x6)+parseInt(_0x164902(0x141))/0x7*(parseInt(_0x164902(0x1c8))/0x8)+-parseInt(_0x164902(0x15d))/0x9*(parseInt(_0x164902(0x1b9))/0xa);if(_0x74b48a===_0x3d5e5c)break;else _0x1e8a93['push'](_0x1e8a93['shift']());}catch(_0x28ae6a){_0x1e8a93['push'](_0x1e8a93['shift']());}}}(a76_0x8c76,0x85d6f));import{createHash}from'node:crypto';import{inflateRawSync}from'node:zlib';import{existsSync,lstatSync,mkdirSync,readdirSync,readFileSync,readlinkSync,realpathSync,renameSync,rmSync,symlinkSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{basename,dirname,isAbsolute,relative,resolve,sep}from'node:path';import{fingerprintAccessKey}from'../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../constant/product.js';import{CliErrors}from'../errors.js';const METADATA_FILE='lovrabet.skill.json',SKILL_FILE=a76_0x19070f(0x135),MAX_SKILL_FILE_COUNT=0xc8,MAX_SKILL_FILE_BYTES=0x100*0x400,MAX_SKILL_TOTAL_BYTES=0x2*0x400*0x400,MAX_SKILL_PACKAGE_BYTES=0x4*0x400*0x400,IGNORED_FILE_NAMES=new Set([METADATA_FILE,a76_0x19070f(0x1b8)]),IGNORED_DIR_NAMES=new Set([a76_0x19070f(0x1e1),a76_0x19070f(0x1e3),'.svn','node_modules',a76_0x19070f(0x179),a76_0x19070f(0x14d),a76_0x19070f(0x1b1),a76_0x19070f(0x144),'.turbo','.cache']),ZIP_LOCAL_FILE_HEADER_SIGNATURE=0x4034b50,ZIP_CENTRAL_DIRECTORY_SIGNATURE=0x2014b50,ZIP_END_OF_CENTRAL_DIRECTORY_SIGNATURE=0x6054b50,ZIP_GENERAL_PURPOSE_UTF8=0x800,ZIP_METHOD_STORE=0x0,ZIP_METHOD_DEFLATE=0x8,ZIP_FIXED_DOS_TIME=0x0,ZIP_FIXED_DOS_DATE=0x21,CRC32_TABLE=createCrc32Table();export function resolveSkillSyncPaths(_0x584a92={}){const _0x565021=a76_0x19070f,_0x5f2223=_0x584a92[_0x565021(0x16f)]??homedir(),_0xf54495=resolve(_0x5f2223,PRODUCT_CONFIG[_0x565021(0x14e)],'cache'),_0x41de57=trimmedEnv(_0x565021(0x1a1)),_0x16a292=trimmedEnv(_0x565021(0x125));return{'homeDir':_0x5f2223,'cacheRoot':_0xf54495,'managedRoot':resolve(_0x5f2223,PRODUCT_CONFIG[_0x565021(0x14e)]),'agentsSkillsDir':_0x584a92[_0x565021(0x1b4)]??_0x41de57??resolve(_0x5f2223,_0x565021(0x14c),'skills'),'claudeSkillsDir':_0x584a92[_0x565021(0x190)]??_0x16a292??resolve(_0x5f2223,'.claude',_0x565021(0x1a9))};}export function getRuntimeSkillCacheRoot(_0x587e43,_0x531387,_0x527e5d={}){const _0x334710=a76_0x19070f,_0x37bdf2=resolveSkillSyncPaths(_0x527e5d);return resolve(_0x37bdf2[_0x334710(0x195)],_0x587e43,fingerprintAccessKey(_0x531387),_0x334710(0x1a9));}export function getRuntimeSkillDir(_0x243177,_0x10e28c,_0xc5f2e1,_0x45b493,_0x27d3db,_0x10a9ab={}){const _0x310646=a76_0x19070f;return resolve(getRuntimeSkillCacheRoot(_0x243177,_0x10e28c,_0x10a9ab),safePathSegment(_0xc5f2e1,'appCode'),_0x45b493,safePathSegment(_0x27d3db,_0x310646(0x143)));}export function listLocalRuntimeSkills(_0x3c1766,_0x58dee1={}){const _0xa4546a=a76_0x19070f,_0x129e8b=safePathSegment(_0x3c1766['appCode'],_0xa4546a(0x1ce)),_0x4ed618=normalizeRuntimeSkillScopes(_0x3c1766[_0xa4546a(0x171)]),_0x87a0a6=new Set(_0x4ed618),_0x3c973e=_0x3c1766[_0xa4546a(0x157)]?.[_0xa4546a(0x12d)](),_0x177481=new Map(),_0x110fbd=resolve(getRuntimeSkillCacheRoot(_0x3c1766[_0xa4546a(0x1d4)],_0x3c1766[_0xa4546a(0x1c5)],_0x58dee1),_0x129e8b);for(const _0x4b3007 of _0x4ed618){for(const _0x348d64 of localSkillEntryDirs(resolve(_0x110fbd,_0x4b3007))){collectLocalRuntimeSkill(_0x177481,_0x348d64,{'appCode':_0x129e8b,'scopes':_0x87a0a6,'code':_0x3c973e,'source':_0xa4546a(0x13d)});}}const _0x4a3974=resolveSkillSyncPaths(_0x58dee1);for(const _0x5eb2c1 of[_0x4a3974[_0xa4546a(0x1b4)],_0x4a3974[_0xa4546a(0x190)]]){for(const _0x31c10e of localSkillLinkCandidates(_0x5eb2c1,_0x129e8b,_0x87a0a6)){collectLocalRuntimeSkill(_0x177481,_0x31c10e,{'appCode':_0x129e8b,'scopes':_0x87a0a6,'code':_0x3c973e,'source':_0xa4546a(0x1d7),'linkedPath':_0x31c10e});}}return Array['from'](_0x177481[_0xa4546a(0x16d)]())[_0xa4546a(0x134)](compareLocalRuntimeSkills);}export function contentHash(_0x1c8cdf){const _0x5356a7=a76_0x19070f;return createHash('sha256')[_0x5356a7(0x196)](_0x1c8cdf)[_0x5356a7(0x14f)]('hex');}function fileContent(_0x9281ed){const _0x166eb9=a76_0x19070f;return _0x9281ed[_0x166eb9(0x1d6)]??Buffer[_0x166eb9(0x180)](_0x9281ed[_0x166eb9(0x1ad)]??'',_0x166eb9(0x16e));}function fileText(_0x5d1868){const _0x49dc19=a76_0x19070f;return fileContent(_0x5d1868)[_0x49dc19(0x13a)](_0x49dc19(0x16e));}function fileHash(_0xb7538){return bufferSha256(fileContent(_0xb7538));}function bufferSha256(_0x1c533c){const _0x973c32=a76_0x19070f;return createHash('sha256')[_0x973c32(0x196)](_0x1c533c)[_0x973c32(0x14f)](_0x973c32(0x146));}export function fileTreeHash(_0x348bf5){const _0x4216e9=a76_0x19070f,_0x3e06c6=createHash(_0x4216e9(0x11e));for(const _0x629ba5 of normalizeManifestFiles(_0x348bf5)){_0x3e06c6[_0x4216e9(0x196)](_0x629ba5['path']),_0x3e06c6['update']('\x00'),_0x3e06c6[_0x4216e9(0x196)](_0x629ba5['sha256']),_0x3e06c6['update']('\x00'),_0x3e06c6[_0x4216e9(0x196)](String(_0x629ba5[_0x4216e9(0x136)])),_0x3e06c6['update']('\x00');}return _0x3e06c6[_0x4216e9(0x14f)](_0x4216e9(0x146));}export function buildSkillPackage(_0x253a1b){const _0x117e67=a76_0x19070f,_0x389d69=normalizeLocalFiles(_0x253a1b);if(!_0x389d69[_0x117e67(0x1b2)](_0x5b5b84=>_0x5b5b84['path']===SKILL_FILE))throw CliErrors[_0x117e67(0x194)](_0x117e67(0x133)+SKILL_FILE+_0x117e67(0x137));const _0x199d29=localFilesToManifestFiles(_0x389d69),_0x3c381b=createDeterministicZipPackage(_0x389d69);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x199d29),'zipSha256':bufferSha256(_0x3c381b),'zipSize':_0x3c381b[_0x117e67(0x1dc)],'files':_0x199d29},'packageBytes':_0x3c381b,'packageBase64':_0x3c381b[_0x117e67(0x13a)](_0x117e67(0x199))};}export function verifyRuntimeSkillPackage(_0x50104d,_0xaeeb60){const _0x43759f=a76_0x19070f,_0x2ee81d=normalizePackageManifest(_0x50104d,{'requireOssPath':![]});if(!_0x2ee81d)throw CliErrors[_0x43759f(0x194)](_0x43759f(0x115));return extractAndVerifyPackage(_0x2ee81d,_0xaeeb60);}export function verifyRuntimeSkillBundle(_0x7c3e69,_0x2d03e3){const _0x5c666d=a76_0x19070f,_0x507090=normalizePackageManifest(_0x7c3e69,{'requireOssPath':![]});if(!_0x507090)throw CliErrors[_0x5c666d(0x194)](_0x5c666d(0x115));if(_0x2d03e3[_0x5c666d(0x1dc)]>MAX_SKILL_PACKAGE_BYTES)throw CliErrors[_0x5c666d(0x194)]('Runtime\x20Skill\x20package\x20exceeds\x20size\x20limit.');return extractAndVerifyPackageFiles(_0x507090,_0x2d03e3);}export function materializeRuntimeSkill(_0x518aab,_0x3405dc,_0x326b5c){const _0xd4bce8=a76_0x19070f,_0x346109=requireSkillCode(_0x518aab),_0x12280c=normalizeRemoteManifest(_0x518aab[_0xd4bce8(0x16c)]),_0x4c59f6=_0x12280c!==undefined,_0x32275a=_0x4c59f6?requirePackageBytes(_0x346109,_0x326b5c[_0xd4bce8(0x11f)]):undefined,_0x555f19=_0x4c59f6?extractAndVerifyPackage(_0x12280c,_0x32275a):[{'path':SKILL_FILE,'content':_0x518aab[_0xd4bce8(0x1ad)]??''}],_0x2d11ec=_0x555f19['find'](_0xd52a96=>_0xd52a96[_0xd4bce8(0x1e2)]===SKILL_FILE);if(!_0x2d11ec)throw CliErrors[_0xd4bce8(0x194)](_0xd4bce8(0x139)+SKILL_FILE+':\x20'+_0x346109);const _0x151d5b=fileText(_0x2d11ec);if(_0x4c59f6&&_0x518aab['content']!==undefined&&_0x518aab[_0xd4bce8(0x1ad)]!==_0x151d5b)throw CliErrors[_0xd4bce8(0x194)](_0xd4bce8(0x181)+SKILL_FILE+_0xd4bce8(0x114)+_0x346109);const _0x1b6282=withMaterializedSkillFrontmatter(_0x555f19,_0x518aab,_0x346109),_0x4ed342=_0x1b6282[_0xd4bce8(0x120)](_0x43e557=>_0x43e557[_0xd4bce8(0x1e2)]===SKILL_FILE),_0x328ff3=fileText(_0x4ed342),_0x315132=getRuntimeSkillDir(_0x326b5c[_0xd4bce8(0x1d4)],_0x326b5c[_0xd4bce8(0x1c5)],_0x326b5c[_0xd4bce8(0x1ce)],_0x3405dc,_0x346109,_0x326b5c[_0xd4bce8(0x153)]),_0x1f807c=resolve(_0x315132,SKILL_FILE),_0x393250=resolve(_0x315132,METADATA_FILE),_0x426089=contentHash(_0x328ff3),_0x55e595=readMetadataIfPresent(_0x393250)?.[_0xd4bce8(0x159)];ensurePulledFilesCanBeOverwritten(_0x315132,_0x393250,_0x1b6282,_0x326b5c[_0xd4bce8(0x1c0)]===!![]),mkdirSync(_0x315132,{'recursive':!![],'mode':0x1c0});const _0x198a3b=existsSync(_0x1f807c)?readFileSync(_0x1f807c,_0xd4bce8(0x16e)):undefined;return materializeFiles(_0x315132,_0x1b6282),_0x4c59f6&&removeStaleManagedFiles(_0x315132,_0x55e595,_0x1b6282),writeJsonAtomic(_0x393250,buildMetadata(_0x518aab,_0x3405dc,_0x326b5c[_0xd4bce8(0x1ce)],_0x426089,_0x326b5c[_0xd4bce8(0x1c4)],_0x4c59f6?_0x1b6282:undefined)),{'skill':_0x518aab,'scope':_0x3405dc,'dir':_0x315132,'skillMdPath':_0x1f807c,'metadataPath':_0x393250,'contentHash':_0x426089,'changed':_0x198a3b!==_0x328ff3};}function withMaterializedSkillFrontmatter(_0x3c9835,_0x290f30,_0x1ed3ff){const _0x4d6792=a76_0x19070f;return normalizeLocalFiles(_0x3c9835)[_0x4d6792(0x1c7)](_0x4c6914=>{const _0x5ab37b=_0x4d6792,_0x2b590a=fileText(_0x4c6914);if(_0x4c6914[_0x5ab37b(0x1e2)]!==SKILL_FILE||hasYamlFrontmatter(_0x2b590a))return _0x4c6914;return{'path':_0x4c6914['path'],'content':prependSkillFrontmatter(_0x2b590a,{'name':_0x1ed3ff,'description':_0x290f30[_0x5ab37b(0x1c3)]?.[_0x5ab37b(0x12d)]()||_0x290f30[_0x5ab37b(0x14b)]?.[_0x5ab37b(0x12d)]()||_0x1ed3ff})};});}function hasYamlFrontmatter(_0x4c84be){const _0x1c3d8f=a76_0x19070f;return/^\uFEFF?---\s*\r?\n/[_0x1c3d8f(0x1d3)](_0x4c84be);}function prependSkillFrontmatter(_0x144dd1,_0x1c960a){const _0x10765c=a76_0x19070f,_0x4b2ae6=_0x144dd1[_0x10765c(0x1db)](/^\uFEFF/,'');return['---',_0x10765c(0x18e)+yamlString(_0x1c960a[_0x10765c(0x1b3)]),_0x10765c(0x130)+yamlString(_0x1c960a[_0x10765c(0x1c3)]),_0x10765c(0x15f),'',_0x4b2ae6][_0x10765c(0x160)]('\x0a');}function yamlString(_0x3c3519){const _0x483e76=a76_0x19070f;return JSON[_0x483e76(0x173)](_0x3c3519[_0x483e76(0x1db)](/\r/g,'')['trim']());}function a76_0x30dc(_0x3a9eb7,_0x49796b){_0x3a9eb7=_0x3a9eb7-0x114;const _0x8c76a1=a76_0x8c76();let _0x30dc28=_0x8c76a1[_0x3a9eb7];return _0x30dc28;}export function linkEffectiveRuntimeSkills(_0x24738b,_0x46ff38,_0x1d4a9f={}){const _0x4f75a3=a76_0x19070f,_0x2c903f=new Map();for(const _0x53e331 of _0x24738b){const _0x4df7ba=_0x53e331[_0x4f75a3(0x118)]['skillCode'];if(!_0x4df7ba)continue;const _0x2a5b4c=_0x2c903f[_0x4f75a3(0x17c)](_0x4df7ba);(!_0x2a5b4c||_0x53e331['scope']===_0x4f75a3(0x1bf))&&_0x2c903f[_0x4f75a3(0x167)](_0x4df7ba,_0x53e331);}const _0x11a14e=[],_0xb31ecb=resolveSkillSyncPaths(_0x1d4a9f);for(const _0x4e4050 of _0x2c903f['values']()){const _0x2257b0=requireSkillCode(_0x4e4050[_0x4f75a3(0x118)]),_0x6eb880=_0x46ff38+'--'+_0x2257b0;for(const _0x2e0d2a of[_0xb31ecb['agentsSkillsDir'],_0xb31ecb['claudeSkillsDir']]){_0x11a14e[_0x4f75a3(0x1ca)](ensureManagedSymlink(resolve(_0x2e0d2a,_0x6eb880),_0x4e4050[_0x4f75a3(0x15c)],_0xb31ecb['managedRoot']));}}return _0x11a14e;}export function pruneStaleRuntimeSkillLinks(_0x2d2ba3,_0x149166,_0x399adc={},_0x377878){const _0x30e330=a76_0x19070f,_0x22d6b9=resolveSkillSyncPaths(_0x399adc),_0x562429=new Set([..._0x149166][_0x30e330(0x1c7)](_0x490652=>_0x490652[_0x30e330(0x12d)]())['filter'](Boolean)),_0x46a21b=_0x377878?new Set([..._0x377878][_0x30e330(0x1c7)](_0x379513=>_0x379513[_0x30e330(0x12d)]())[_0x30e330(0x1a6)](Boolean)):undefined,_0x2d6391=[];for(const _0x1d08bc of[_0x22d6b9['agentsSkillsDir'],_0x22d6b9[_0x30e330(0x190)]]){for(const _0xac7079 of managedAppSkillLinkPaths(_0x1d08bc,_0x2d2ba3)){const _0x4b58af=basename(_0xac7079)[_0x30e330(0x13e)]((_0x2d2ba3+'--')[_0x30e330(0x1dc)]);if(_0x46a21b&&!_0x46a21b[_0x30e330(0x117)](_0x4b58af))continue;if(_0x562429[_0x30e330(0x117)](_0x4b58af))continue;_0x2d6391[_0x30e330(0x1ca)](removeManagedSkillLink(_0xac7079,_0x22d6b9[_0x30e330(0x12f)]));}}return _0x2d6391;}export function pruneStaleRuntimeSkillCache(_0x2eb9e7,_0x49c059={}){const _0x115072=a76_0x19070f,_0x404ba8=new Set([..._0x2eb9e7[_0x115072(0x151)]][_0x115072(0x1c7)](_0x185afb=>_0x185afb[_0x115072(0x12d)]())['filter'](Boolean)),_0xf2eb1f=_0x2eb9e7['pruneSkillCodes']?new Set([..._0x2eb9e7['pruneSkillCodes']]['map'](_0x12a86e=>_0x12a86e['trim']())['filter'](Boolean)):undefined,_0x4f06de=_0x2eb9e7['scopes']??[_0x115072(0x1bf),'company'],_0x8b075e=resolve(getRuntimeSkillCacheRoot(_0x2eb9e7[_0x115072(0x1d4)],_0x2eb9e7['accessKey'],_0x49c059),safePathSegment(_0x2eb9e7[_0x115072(0x1ce)],_0x115072(0x1ce))),_0x1677b9=[];for(const _0x323f4e of _0x4f06de){const _0x3a0765=resolve(_0x8b075e,_0x323f4e);if(!existsSync(_0x3a0765))continue;for(const _0xcd0eef of readdirSync(_0x3a0765,{'withFileTypes':!![]})){if(!_0xcd0eef[_0x115072(0x156)]())continue;const _0x6b8a29=_0xcd0eef[_0x115072(0x1b3)];if(_0xf2eb1f&&!_0xf2eb1f['has'](_0x6b8a29))continue;if(_0x404ba8[_0x115072(0x117)](_0x6b8a29))continue;const _0x5a10aa=resolve(_0x3a0765,_0x6b8a29),_0x5df4eb=readMetadataIfPresent(resolve(_0x5a10aa,METADATA_FILE));if(_0x5df4eb?.[_0x115072(0x1ce)]!==_0x2eb9e7[_0x115072(0x1ce)]||_0x5df4eb[_0x115072(0x19c)]!==_0x323f4e||_0x5df4eb[_0x115072(0x143)]!==_0x6b8a29){_0x1677b9[_0x115072(0x1ca)]({'path':_0x5a10aa,'action':'skipped','reason':_0x115072(0x1d0)});continue;}rmSync(_0x5a10aa,{'recursive':!![],'force':!![]}),_0x1677b9['push']({'path':_0x5a10aa,'action':_0x115072(0x119)});}}return _0x1677b9;}export function linkGlobalRuntimeSkills(_0x4fb3cc,_0x593660={}){const _0x54e3f1=a76_0x19070f,_0xc2ef70=resolveSkillSyncPaths(_0x593660),_0x5bac36=[];for(const _0x4eb19f of _0x4fb3cc){if(_0x4eb19f[_0x54e3f1(0x19c)]!==_0x54e3f1(0x142))throw CliErrors[_0x54e3f1(0x194)](_0x54e3f1(0x15a)+_0x4eb19f['scope']);const _0x227f41=requireSkillCode(_0x4eb19f['skill']),_0x4b413d=copyManagedSkillDirectory(_0x4eb19f[_0x54e3f1(0x15c)],resolve(_0xc2ef70['agentsSkillsDir'],_0x227f41));_0x5bac36[_0x54e3f1(0x1ca)]({..._0x4b413d,'contentHash':_0x4eb19f['contentHash']});}return _0x5bac36;}export function readPushDirectory(_0x26034d,_0x762135){const _0x3c36ea=a76_0x19070f,_0x3bb42c=resolvePushDirectoryRoot(_0x26034d),_0x65a7b3=resolve(_0x3bb42c,SKILL_FILE);if(!existsSync(_0x65a7b3)||!lstatSync(_0x65a7b3)['isFile']())throw CliErrors[_0x3c36ea(0x194)](_0x3c36ea(0x133)+SKILL_FILE+':\x20'+_0x65a7b3);const _0x122593=readMetadataIfPresent(resolve(_0x3bb42c,METADATA_FILE));if(_0x122593?.[_0x3c36ea(0x19c)]&&_0x122593[_0x3c36ea(0x19c)]!=='personal')throw CliErrors[_0x3c36ea(0x194)](_0x3c36ea(0x19e)+METADATA_FILE+_0x3c36ea(0x148)+_0x122593[_0x3c36ea(0x19c)]+'\x22.');if(_0x122593?.[_0x3c36ea(0x1ce)]&&_0x122593[_0x3c36ea(0x1ce)]!==_0x762135)throw CliErrors['validation'](_0x3c36ea(0x1d1)+_0x122593[_0x3c36ea(0x1ce)]+_0x3c36ea(0x175)+_0x762135+'\x22.');const _0x15f99e=scanSkillDirectory(_0x3bb42c),_0x149669=buildSkillPackage(_0x15f99e),_0x428b33=readFileSync(_0x65a7b3,_0x3c36ea(0x16e)),_0x3e8ded=_0x122593?.[_0x3c36ea(0x143)]??deriveSkillCodeFromDirectory(_0x3bb42c,_0x762135);if(!_0x3e8ded)throw CliErrors[_0x3c36ea(0x194)](_0x3c36ea(0x176)+METADATA_FILE+_0x3c36ea(0x1d5));return{'skillCode':_0x3e8ded,'metadata':_0x122593,'input':{'skillCode':_0x3e8ded,'skillName':_0x122593?.[_0x3c36ea(0x14b)],'description':_0x122593?.['description'],'content':_0x428b33,'files':_0x149669[_0x3c36ea(0x1a4)],'packageBase64':_0x149669[_0x3c36ea(0x172)],'tags':_0x122593?.[_0x3c36ea(0x187)],'version':_0x122593?.['version'],'sourceSessionId':_0x122593?.[_0x3c36ea(0x1bb)]}};}function resolvePushDirectoryRoot(_0x208a46){const _0x2f82f8=a76_0x19070f,_0xf57041=resolve(_0x208a46);if(!existsSync(_0xf57041))throw CliErrors[_0x2f82f8(0x194)](_0x2f82f8(0x126)+_0x208a46);const _0x11b102=lstatSync(_0xf57041);if(_0x11b102[_0x2f82f8(0x156)]())return _0xf57041;if(_0x11b102[_0x2f82f8(0x138)]()){const _0x3acab0=realpathSync(_0xf57041);if(lstatSync(_0x3acab0)[_0x2f82f8(0x156)]())return _0x3acab0;}throw CliErrors[_0x2f82f8(0x194)](_0x2f82f8(0x126)+_0x208a46);}export function recordPushedRuntimeSkill(_0x24866c,_0x4d29af,_0x1f7760,_0x50b187={}){const _0x55299f=a76_0x19070f,_0x1356a3=resolvePushDirectoryRoot(_0x24866c),_0x590872=scanSkillDirectory(_0x1356a3),_0xf7fcaf=_0x590872[_0x55299f(0x120)](_0x2d370d=>_0x2d370d['path']===SKILL_FILE),_0x449634=_0xf7fcaf?fileText(_0xf7fcaf):'',_0x139d9c=tryNormalizePackageManifest(_0x4d29af[_0x55299f(0x16c)]),_0x3f4bc8={..._0x4d29af,'content':_0x4d29af['content']??_0x449634,'files':_0x139d9c},_0x597055=_0x139d9c?normalizeLocalFiles(_0x590872)[_0x55299f(0x1a6)](_0x296519=>_0x139d9c['files'][_0x55299f(0x1b2)](_0x344152=>_0x344152[_0x55299f(0x1e2)]===_0x296519['path'])):undefined,_0x38c7ae=buildMetadata(_0x3f4bc8,_0x50b187['scope']??_0x55299f(0x1bf),_0x1f7760,contentHash(_0x3f4bc8[_0x55299f(0x1ad)]??''),_0x50b187[_0x55299f(0x13c)],_0x597055);writeJsonAtomic(resolve(_0x1356a3,METADATA_FILE),_0x38c7ae);}export function deriveSkillCodeFromDirectory(_0x459ee8,_0xec2654){const _0x1d7b01=a76_0x19070f,_0x499f6e=basename(resolve(_0x459ee8)),_0x12a8a4=_0xec2654+'--';return _0x499f6e[_0x1d7b01(0x1e0)](_0x12a8a4)?_0x499f6e[_0x1d7b01(0x13e)](_0x12a8a4[_0x1d7b01(0x1dc)]):_0x499f6e;}export function readMetadataIfPresent(_0x48ae14){const _0x1b207c=a76_0x19070f;if(!existsSync(_0x48ae14))return undefined;try{const _0x50f3c4=JSON[_0x1b207c(0x16a)](readFileSync(_0x48ae14,_0x1b207c(0x16e)));return _0x50f3c4;}catch{throw CliErrors[_0x1b207c(0x194)](_0x1b207c(0x189)+METADATA_FILE+':\x20'+_0x48ae14);}}function normalizeRuntimeSkillScopes(_0x18545f){const _0x18b7db=a76_0x19070f,_0x528484=_0x18545f&&_0x18545f[_0x18b7db(0x1dc)]>0x0?_0x18545f:['personal',_0x18b7db(0x1c9),_0x18b7db(0x142)],_0x979b0c=[];for(const _0x14d992 of _0x528484){if(!isRuntimeSkillScope(_0x14d992))throw CliErrors[_0x18b7db(0x194)](_0x18b7db(0x128)+_0x14d992);!_0x979b0c['includes'](_0x14d992)&&_0x979b0c[_0x18b7db(0x1ca)](_0x14d992);}return _0x979b0c;}function isRuntimeSkillScope(_0x3c29f9){const _0x33e32c=a76_0x19070f;return _0x3c29f9===_0x33e32c(0x1bf)||_0x3c29f9===_0x33e32c(0x1c9)||_0x3c29f9===_0x33e32c(0x142);}function localSkillEntryDirs(_0x59aef5){const _0x50dafe=a76_0x19070f;if(!existsSync(_0x59aef5))return[];return readdirSync(_0x59aef5,{'withFileTypes':!![]})[_0x50dafe(0x1a6)](_0x52c18d=>_0x52c18d[_0x50dafe(0x156)]()||_0x52c18d[_0x50dafe(0x138)]())[_0x50dafe(0x1c7)](_0x24a3ec=>resolve(_0x59aef5,_0x24a3ec['name']));}function localSkillLinkCandidates(_0x320192,_0x3f93f2,_0x231301){const _0x1fa9be=a76_0x19070f;if(!existsSync(_0x320192))return[];const _0x51b868=_0x3f93f2+'--';return readdirSync(_0x320192,{'withFileTypes':!![]})[_0x1fa9be(0x1a6)](_0x24a517=>_0x24a517[_0x1fa9be(0x156)]()||_0x24a517[_0x1fa9be(0x138)]())[_0x1fa9be(0x1a6)](_0x452828=>_0x452828[_0x1fa9be(0x1b3)][_0x1fa9be(0x1e0)](_0x51b868)||_0x231301[_0x1fa9be(0x117)]('builtin'))[_0x1fa9be(0x1c7)](_0x531a99=>resolve(_0x320192,_0x531a99[_0x1fa9be(0x1b3)]));}function collectLocalRuntimeSkill(_0x180373,_0xc376c0,_0x213d22){const _0x193d89=a76_0x19070f,_0x43ff10=resolve(_0xc376c0,METADATA_FILE),_0x17ec58=readMetadataIfPresent(_0x43ff10);if(!_0x17ec58)return;if(_0x17ec58['appCode']!==_0x213d22[_0x193d89(0x1ce)])return;if(!isRuntimeSkillScope(_0x17ec58[_0x193d89(0x19c)])||!_0x213d22[_0x193d89(0x171)][_0x193d89(0x117)](_0x17ec58[_0x193d89(0x19c)]))return;const _0x5dc380=_0x17ec58[_0x193d89(0x143)]?.[_0x193d89(0x12d)]();if(!_0x5dc380)return;if(_0x213d22[_0x193d89(0x157)]&&_0x5dc380!==_0x213d22[_0x193d89(0x157)])return;const _0x1b7a8f=_0x17ec58[_0x193d89(0x19c)]+':'+_0x5dc380,_0x2ca886=_0x213d22[_0x193d89(0x1aa)]?[_0x213d22[_0x193d89(0x1aa)]]:[],_0x47791b=_0x180373[_0x193d89(0x17c)](_0x1b7a8f);if(_0x47791b){_0x213d22[_0x193d89(0x1a8)]===_0x193d89(0x13d)&&(_0x47791b[_0x193d89(0x15c)]=_0xc376c0,_0x47791b['cacheDir']=_0xc376c0,_0x47791b[_0x193d89(0x1df)]=resolve(_0xc376c0,SKILL_FILE),_0x47791b[_0x193d89(0x168)]=_0x43ff10);for(const _0x53c3fb of _0x2ca886){!_0x47791b[_0x193d89(0x1d2)]['includes'](_0x53c3fb)&&_0x47791b[_0x193d89(0x1d2)][_0x193d89(0x1ca)](_0x53c3fb);}_0x47791b['linkedPaths'][_0x193d89(0x134)]();return;}_0x180373[_0x193d89(0x167)](_0x1b7a8f,{..._0x17ec58,'tags':Array[_0x193d89(0x155)](_0x17ec58[_0x193d89(0x187)])?_0x17ec58[_0x193d89(0x187)]:[],'scope':_0x17ec58[_0x193d89(0x19c)],'source':_0x193d89(0x1c2),'dir':_0xc376c0,'cacheDir':_0x213d22[_0x193d89(0x1a8)]==='cache'?_0xc376c0:undefined,'skillMdPath':resolve(_0xc376c0,SKILL_FILE),'metadataPath':_0x43ff10,'linkedPaths':_0x2ca886});}function compareLocalRuntimeSkills(_0x472801,_0x43d979){const _0x342146=a76_0x19070f,_0x17e282={'personal':0x0,'company':0x1,'builtin':0x2};return _0x17e282[_0x472801[_0x342146(0x19c)]]-_0x17e282[_0x43d979['scope']]||_0x472801['skillCode']['localeCompare'](_0x43d979['skillCode'])||_0x472801[_0x342146(0x15c)]['localeCompare'](_0x43d979[_0x342146(0x15c)]);}function buildMetadata(_0x22abff,_0x2aae3c,_0x18ad33,_0x2cac92,_0x30cc11,_0x308052){const _0x1085ca=a76_0x19070f,_0x20d058=_0x308052?normalizeLocalFiles(_0x308052):[],_0x242127=normalizePackageManifest(_0x22abff[_0x1085ca(0x16c)],{'requireOssPath':![]}),_0x4aae32=_0x20d058[_0x1085ca(0x1dc)]>0x0?Object[_0x1085ca(0x1ae)](_0x20d058[_0x1085ca(0x1c7)](_0x27ee36=>[_0x27ee36['path'],fileHash(_0x27ee36)])):undefined;return{'schemaVersion':_0x20d058[_0x1085ca(0x1dc)]>0x0?0x2:0x1,'id':_0x22abff['id'],'appCode':_0x18ad33,'skillCode':requireSkillCode(_0x22abff),'skillName':_0x22abff['skillName'],'description':_0x22abff[_0x1085ca(0x1c3)],'scope':_0x2aae3c,'readonly':_0x2aae3c!==_0x1085ca(0x1bf)||_0x22abff['readonly']===!![],'tenantCode':_0x22abff[_0x1085ca(0x174)],'userId':_0x22abff[_0x1085ca(0x145)],'version':_0x22abff[_0x1085ca(0x11a)],'status':_0x22abff[_0x1085ca(0x1de)],'tags':Array[_0x1085ca(0x155)](_0x22abff[_0x1085ca(0x187)])?_0x22abff[_0x1085ca(0x187)]:[],'hasUpstreamUpdate':_0x22abff['hasUpstreamUpdate'],'forkedFromSkillId':_0x22abff[_0x1085ca(0x17d)],'forkedFromVersion':_0x22abff['forkedFromVersion'],'sourceSessionId':_0x22abff['sourceSessionId'],'contentHash':_0x2cac92,'fileHashes':_0x4aae32,'treeHash':_0x20d058[_0x1085ca(0x1dc)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x20d058)):_0x242127?.[_0x1085ca(0x11b)],'ossPath':_0x242127?.[_0x1085ca(0x11d)],'zipSha256':_0x242127?.[_0x1085ca(0x116)],'zipSize':_0x242127?.[_0x1085ca(0x165)],'files':_0x20d058[_0x1085ca(0x1dc)]>0x0?_0x20d058['map'](_0x16e147=>({'path':_0x16e147[_0x1085ca(0x1e2)],'hash':fileHash(_0x16e147),'size':fileContent(_0x16e147)['length']})):undefined,'pulledAt':_0x30cc11??new Date()['toISOString']()};}function requireSkillCode(_0x5db22a){const _0x16b9ac=a76_0x19070f,_0x16210b=_0x5db22a[_0x16b9ac(0x143)]?.[_0x16b9ac(0x12d)]();if(!_0x16210b)throw CliErrors[_0x16b9ac(0x194)](_0x16b9ac(0x1bc));return _0x16210b;}function trimmedEnv(_0x504917){const _0x550344=a76_0x19070f,_0x21b76a=productEnv(_0x504917)?.[_0x550344(0x12d)]();return _0x21b76a?_0x21b76a:undefined;}function safePathSegment(_0x5036c0,_0x225c85=a76_0x19070f(0x1cf)){const _0x239318=a76_0x19070f;if(!_0x5036c0||_0x5036c0[_0x239318(0x19a)]('/')||_0x5036c0['includes']('\x5c')||_0x5036c0[_0x239318(0x19a)]('..'))throw CliErrors[_0x239318(0x194)](_0x239318(0x197)+_0x225c85+'\x20for\x20local\x20path:\x20'+_0x5036c0);return _0x5036c0;}function ensurePulledFilesCanBeOverwritten(_0x52744f,_0x4add2f,_0x56fbfd,_0x4cb77b){const _0x545ae0=a76_0x19070f;if(_0x4cb77b||!existsSync(_0x4add2f))return;const _0x3c9d7b=readMetadataIfPresent(_0x4add2f);if(!_0x3c9d7b)return;const _0x1fe802=_0x3c9d7b['fileHashes']&&Object[_0x545ae0(0x150)](_0x3c9d7b[_0x545ae0(0x159)])['length']>0x0?_0x3c9d7b[_0x545ae0(0x159)]:undefined;if(_0x1fe802)for(const [_0x1beb5e,_0x5326d7]of Object[_0x545ae0(0x12e)](_0x1fe802)){const _0x25570f=resolveManagedFilePath(_0x52744f,_0x1beb5e);if(!existsSync(_0x25570f))throw CliErrors[_0x545ae0(0x194)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x52744f,_0x545ae0(0x140)+_0x1beb5e);const _0x24a2f2=lstatSync(_0x25570f);if(!_0x24a2f2['isFile']())throw CliErrors['validation'](_0x545ae0(0x149)+_0x52744f,_0x545ae0(0x1a7)+_0x1beb5e);const _0x45ff0d=bufferSha256(readFileSync(_0x25570f));if(_0x45ff0d!==_0x5326d7)throw CliErrors[_0x545ae0(0x194)](_0x545ae0(0x149)+_0x52744f+_0x545ae0(0x1ba)+_0x1beb5e,_0x545ae0(0x1c1)+_0x1beb5e);}else{const _0x54afee=resolve(_0x52744f,SKILL_FILE);if(existsSync(_0x54afee)&&_0x3c9d7b[_0x545ae0(0x15b)]){const _0x3c70ed=contentHash(readFileSync(_0x54afee,_0x545ae0(0x16e)));if(_0x3c70ed!==_0x3c9d7b['contentHash'])throw CliErrors['validation'](_0x545ae0(0x1cc)+_0x54afee,_0x545ae0(0x1ab));}}for(const _0x3bdeee of normalizeLocalFiles(_0x56fbfd)){if(_0x1fe802?.[_0x3bdeee[_0x545ae0(0x1e2)]])continue;if(!_0x1fe802&&_0x3bdeee[_0x545ae0(0x1e2)]===SKILL_FILE)continue;const _0x1da354=resolveManagedFilePath(_0x52744f,_0x3bdeee[_0x545ae0(0x1e2)]);if(!existsSync(_0x1da354))continue;const _0x48372d=lstatSync(_0x1da354);if(!_0x48372d[_0x545ae0(0x18b)]())throw CliErrors[_0x545ae0(0x194)](_0x545ae0(0x149)+_0x52744f,_0x545ae0(0x15e)+_0x3bdeee[_0x545ae0(0x1e2)]);const _0x499364=bufferSha256(readFileSync(_0x1da354));if(_0x499364!==fileHash(_0x3bdeee))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x52744f,_0x545ae0(0x17b)+_0x3bdeee[_0x545ae0(0x1e2)]);}}function scanSkillDirectory(_0x5555c2){const _0xb59cb8=realOrResolved(_0x5555c2),_0x1e6eb1=[];let _0x238fa1=0x0;function _0x5f0c7c(_0x5b213c){const _0x2d6fbe=a76_0x30dc,_0x242120=readdirSync(_0x5b213c,{'withFileTypes':!![]})[_0x2d6fbe(0x134)]((_0x3451bf,_0x1fa94e)=>_0x3451bf[_0x2d6fbe(0x1b3)]['localeCompare'](_0x1fa94e['name']));for(const _0x2ebf38 of _0x242120){if(_0x2ebf38[_0x2d6fbe(0x156)]()&&IGNORED_DIR_NAMES[_0x2d6fbe(0x117)](_0x2ebf38[_0x2d6fbe(0x1b3)]))continue;if(IGNORED_FILE_NAMES['has'](_0x2ebf38[_0x2d6fbe(0x1b3)]))continue;const _0x523d1b=resolve(_0x5b213c,_0x2ebf38[_0x2d6fbe(0x1b3)]);if(_0x2ebf38['isSymbolicLink']())throw CliErrors['validation'](_0x2d6fbe(0x124)+_0x523d1b);const _0x22fc94=toPosixPath(relative(_0xb59cb8,_0x523d1b));if(_0x2ebf38[_0x2d6fbe(0x156)]()){_0x5f0c7c(_0x523d1b);continue;}if(!_0x2ebf38['isFile']())continue;validateSkillRelativePath(_0x22fc94);const _0x3f861f=readFileSync(_0x523d1b);if(_0x3f861f[_0x2d6fbe(0x1dc)]>MAX_SKILL_FILE_BYTES)throw CliErrors[_0x2d6fbe(0x194)](_0x2d6fbe(0x1dd)+_0x22fc94);_0x238fa1+=_0x3f861f[_0x2d6fbe(0x1dc)];if(_0x238fa1>MAX_SKILL_TOTAL_BYTES)throw CliErrors[_0x2d6fbe(0x194)](_0x2d6fbe(0x127));_0x1e6eb1[_0x2d6fbe(0x1ca)]({'path':_0x22fc94,'bytes':_0x3f861f});if(_0x1e6eb1['length']>MAX_SKILL_FILE_COUNT)throw CliErrors[_0x2d6fbe(0x194)](_0x2d6fbe(0x161));}}return _0x5f0c7c(_0xb59cb8),normalizeLocalFiles(_0x1e6eb1);}function normalizeLocalFiles(_0xe39cae){const _0x28e700=a76_0x19070f;if(!Array[_0x28e700(0x155)](_0xe39cae)||_0xe39cae[_0x28e700(0x1dc)]===0x0)return[];if(_0xe39cae[_0x28e700(0x1dc)]>MAX_SKILL_FILE_COUNT)throw CliErrors[_0x28e700(0x194)]('Skill\x20directory\x20exceeds\x20file\x20count\x20limit.');const _0x11fcb1=new Map();let _0x2e7976=0x0;for(const _0x4d447a of _0xe39cae){if(!_0x4d447a||typeof _0x4d447a!==_0x28e700(0x1cd)||typeof _0x4d447a[_0x28e700(0x1e2)]!=='string')throw CliErrors[_0x28e700(0x194)](_0x28e700(0x123));const _0x3d520a=normalizeSkillRelativePath(_0x4d447a[_0x28e700(0x1e2)]);if(_0x11fcb1[_0x28e700(0x117)](_0x3d520a))throw CliErrors[_0x28e700(0x194)](_0x28e700(0x1b5)+_0x3d520a);if(_0x4d447a[_0x28e700(0x1d6)]!==undefined&&!Buffer['isBuffer'](_0x4d447a['bytes']))throw CliErrors[_0x28e700(0x194)](_0x28e700(0x1a0)+_0x3d520a);if(_0x4d447a['bytes']===undefined&&typeof _0x4d447a['content']!==_0x28e700(0x191))throw CliErrors[_0x28e700(0x194)](_0x28e700(0x1af)+_0x3d520a);const _0x3a11c6=fileContent(_0x4d447a),_0x47df48=_0x3a11c6['length'];if(_0x47df48>MAX_SKILL_FILE_BYTES)throw CliErrors['validation'](_0x28e700(0x1dd)+_0x3d520a);_0x2e7976+=_0x47df48;if(_0x2e7976>MAX_SKILL_TOTAL_BYTES)throw CliErrors['validation'](_0x28e700(0x127));_0x11fcb1[_0x28e700(0x167)](_0x3d520a,{'path':_0x3d520a,'bytes':_0x3a11c6});}return Array[_0x28e700(0x180)](_0x11fcb1[_0x28e700(0x16d)]())[_0x28e700(0x134)](compareSkillFiles);}function normalizeManifestFiles(_0x4d6882){const _0x31070e=a76_0x19070f;if(!Array[_0x31070e(0x155)](_0x4d6882)||_0x4d6882['length']===0x0)return[];if(_0x4d6882[_0x31070e(0x1dc)]>MAX_SKILL_FILE_COUNT)throw CliErrors[_0x31070e(0x194)]('Skill\x20directory\x20exceeds\x20file\x20count\x20limit.');const _0x38723e=new Map();let _0x2eaf7c=0x0;for(const _0x3062e6 of _0x4d6882){if(!_0x3062e6||typeof _0x3062e6!=='object'||typeof _0x3062e6['path']!==_0x31070e(0x191))throw CliErrors[_0x31070e(0x194)](_0x31070e(0x123));const _0x1176a8=normalizeSkillRelativePath(_0x3062e6[_0x31070e(0x1e2)]);if(_0x38723e[_0x31070e(0x117)](_0x1176a8))throw CliErrors[_0x31070e(0x194)](_0x31070e(0x1b5)+_0x1176a8);if(!isSha256Hex(_0x3062e6['sha256']))throw CliErrors[_0x31070e(0x194)](_0x31070e(0x177)+_0x1176a8);if(!Number[_0x31070e(0x129)](_0x3062e6[_0x31070e(0x136)])||_0x3062e6[_0x31070e(0x136)]<0x0)throw CliErrors[_0x31070e(0x194)](_0x31070e(0x13f)+_0x1176a8);if(_0x3062e6['size']>MAX_SKILL_FILE_BYTES)throw CliErrors[_0x31070e(0x194)](_0x31070e(0x1dd)+_0x1176a8);_0x2eaf7c+=_0x3062e6[_0x31070e(0x136)];if(_0x2eaf7c>MAX_SKILL_TOTAL_BYTES)throw CliErrors['validation'](_0x31070e(0x127));_0x38723e[_0x31070e(0x167)](_0x1176a8,{'path':_0x1176a8,'sha256':_0x3062e6[_0x31070e(0x11e)][_0x31070e(0x158)](),'size':_0x3062e6[_0x31070e(0x136)]});}return Array[_0x31070e(0x180)](_0x38723e[_0x31070e(0x16d)]())[_0x31070e(0x134)](compareSkillFiles);}function normalizeRemoteManifest(_0x4052dd){return normalizePackageManifest(_0x4052dd,{'requireOssPath':!![]});}function normalizePackageManifest(_0x411fc8,_0x333224){const _0x479bd0=a76_0x19070f;if(!_0x411fc8||typeof _0x411fc8!==_0x479bd0(0x1cd)||Array[_0x479bd0(0x155)](_0x411fc8))return undefined;const _0x244344=_0x411fc8,_0x464274=typeof _0x244344[_0x479bd0(0x11d)]===_0x479bd0(0x191)?_0x244344[_0x479bd0(0x11d)]['trim']():undefined;if(_0x333224[_0x479bd0(0x1ac)]&&!_0x464274)return undefined;if(!Array[_0x479bd0(0x155)](_0x244344[_0x479bd0(0x16c)])||_0x244344['files']['length']===0x0)return undefined;if(!isSha256Hex(_0x244344['treeSha256']))throw CliErrors[_0x479bd0(0x194)](_0x479bd0(0x12b));if(!isSha256Hex(_0x244344[_0x479bd0(0x116)]))throw CliErrors[_0x479bd0(0x194)]('Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.');if(!Number[_0x479bd0(0x129)](_0x244344['zipSize'])||_0x244344['zipSize']<0x0)throw CliErrors[_0x479bd0(0x194)]('Runtime\x20Skill\x20package\x20size\x20is\x20invalid.');if(_0x244344[_0x479bd0(0x165)]>MAX_SKILL_PACKAGE_BYTES)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20exceeds\x20size\x20limit.');const _0x52f30a=normalizeManifestFiles(_0x244344[_0x479bd0(0x16c)]);if(!_0x52f30a[_0x479bd0(0x1b2)](_0x22a38b=>_0x22a38b[_0x479bd0(0x1e2)]===SKILL_FILE))throw CliErrors[_0x479bd0(0x194)]('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x28ff79=fileTreeHash(_0x52f30a);if(_0x28ff79!==_0x244344['treeSha256'][_0x479bd0(0x158)]())throw CliErrors[_0x479bd0(0x194)](_0x479bd0(0x12a));return{'schemaVersion':Number[_0x479bd0(0x129)](_0x244344[_0x479bd0(0x19b)])?_0x244344['schemaVersion']:0x2,'ossPath':_0x464274,'treeSha256':_0x28ff79,'zipSha256':_0x244344[_0x479bd0(0x116)][_0x479bd0(0x158)](),'zipSize':_0x244344[_0x479bd0(0x165)],'files':_0x52f30a};}function tryNormalizeRemoteManifest(_0x2df75b){return normalizeRemoteManifest(_0x2df75b);}function tryNormalizePackageManifest(_0x5d2071){return normalizePackageManifest(_0x5d2071,{'requireOssPath':![]});}function requirePackageBytes(_0x2cc506,_0x2dee63){const _0x31af26=a76_0x19070f;if(!_0x2dee63||_0x2dee63[_0x31af26(0x1dc)]===0x0)throw CliErrors[_0x31af26(0x194)]('Runtime\x20Skill\x20package\x20is\x20required\x20for\x20package-backed\x20Skill:\x20'+_0x2cc506);if(_0x2dee63[_0x31af26(0x1dc)]>MAX_SKILL_PACKAGE_BYTES)throw CliErrors[_0x31af26(0x194)](_0x31af26(0x1b6)+_0x2cc506);return _0x2dee63;}function localFilesToManifestFiles(_0x54a695){const _0xae7634=a76_0x19070f;return normalizeLocalFiles(_0x54a695)[_0xae7634(0x1c7)](_0x215b02=>({'path':_0x215b02['path'],'sha256':fileHash(_0x215b02),'size':fileContent(_0x215b02)[_0xae7634(0x1dc)]}));}function isSha256Hex(_0x4ce6c7){const _0x43ac81=a76_0x19070f;return typeof _0x4ce6c7===_0x43ac81(0x191)&&/^[a-fA-F0-9]{64}$/[_0x43ac81(0x1d3)](_0x4ce6c7);}function extractAndVerifyPackage(_0x56d161,_0x3939c5){const _0x396006=a76_0x19070f,_0x18788b=normalizePackageManifest(_0x56d161,{'requireOssPath':![]});if(!_0x18788b)throw CliErrors[_0x396006(0x194)](_0x396006(0x115));if(_0x3939c5[_0x396006(0x1dc)]!==_0x18788b[_0x396006(0x165)])throw CliErrors[_0x396006(0x194)](_0x396006(0x163));const _0x94a5f0=bufferSha256(_0x3939c5);if(_0x94a5f0!==_0x18788b['zipSha256'])throw CliErrors[_0x396006(0x194)](_0x396006(0x18d));return extractAndVerifyPackageFiles(_0x18788b,_0x3939c5);}function extractAndVerifyPackageFiles(_0x5d7063,_0x1e5c34){const _0x3fcc67=a76_0x19070f,_0x4791d3=parseZipPackage(_0x1e5c34);if(_0x4791d3[_0x3fcc67(0x1dc)]!==_0x5d7063[_0x3fcc67(0x16c)][_0x3fcc67(0x1dc)])throw CliErrors[_0x3fcc67(0x194)](_0x3fcc67(0x17e));const _0x19b549=new Map();for(const _0x2805d3 of _0x4791d3){if(_0x19b549[_0x3fcc67(0x117)](_0x2805d3['path']))throw CliErrors['validation'](_0x3fcc67(0x193)+_0x2805d3[_0x3fcc67(0x1e2)]);_0x19b549[_0x3fcc67(0x167)](_0x2805d3[_0x3fcc67(0x1e2)],_0x2805d3);}const _0x2cd17a=[];for(const _0x25ae79 of _0x5d7063[_0x3fcc67(0x16c)]){const _0x2a5d6b=_0x19b549[_0x3fcc67(0x17c)](_0x25ae79['path']);if(!_0x2a5d6b)throw CliErrors[_0x3fcc67(0x194)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x25ae79[_0x3fcc67(0x1e2)]);if(_0x2a5d6b[_0x3fcc67(0x1d6)][_0x3fcc67(0x1dc)]!==_0x25ae79[_0x3fcc67(0x136)])throw CliErrors[_0x3fcc67(0x194)]('Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'+_0x25ae79['path']);const _0x495199=bufferSha256(_0x2a5d6b[_0x3fcc67(0x1d6)]);if(_0x495199!==_0x25ae79[_0x3fcc67(0x11e)])throw CliErrors[_0x3fcc67(0x194)](_0x3fcc67(0x17a)+_0x25ae79[_0x3fcc67(0x1e2)]);_0x2cd17a[_0x3fcc67(0x1ca)]({'path':_0x25ae79[_0x3fcc67(0x1e2)],'bytes':_0x2a5d6b[_0x3fcc67(0x1d6)]});}return normalizeLocalFiles(_0x2cd17a);}function createDeterministicZipPackage(_0x45877e){const _0x4ca98e=a76_0x19070f,_0xa03dc7=normalizeLocalFiles(_0x45877e),_0x563e01=[],_0x531ef1=[];let _0x37f22c=0x0;for(const _0x23c977 of _0xa03dc7){const _0x4859ba=Buffer['from'](_0x23c977['path'],'utf8'),_0x17fa96=fileContent(_0x23c977),_0x4f989f=crc32(_0x17fa96),_0x236cf8=Buffer[_0x4ca98e(0x1b7)](0x1e+_0x4859ba['length']);_0x236cf8['writeUInt32LE'](ZIP_LOCAL_FILE_HEADER_SIGNATURE,0x0),_0x236cf8[_0x4ca98e(0x184)](0x14,0x4),_0x236cf8[_0x4ca98e(0x184)](ZIP_GENERAL_PURPOSE_UTF8,0x6),_0x236cf8[_0x4ca98e(0x184)](ZIP_METHOD_STORE,0x8),_0x236cf8['writeUInt16LE'](ZIP_FIXED_DOS_TIME,0xa),_0x236cf8[_0x4ca98e(0x184)](ZIP_FIXED_DOS_DATE,0xc),_0x236cf8[_0x4ca98e(0x1bd)](_0x4f989f,0xe),_0x236cf8['writeUInt32LE'](_0x17fa96[_0x4ca98e(0x1dc)],0x12),_0x236cf8[_0x4ca98e(0x1bd)](_0x17fa96[_0x4ca98e(0x1dc)],0x16),_0x236cf8['writeUInt16LE'](_0x4859ba[_0x4ca98e(0x1dc)],0x1a),_0x236cf8[_0x4ca98e(0x184)](0x0,0x1c),_0x4859ba['copy'](_0x236cf8,0x1e),_0x563e01[_0x4ca98e(0x1ca)](_0x236cf8,_0x17fa96);const _0x43f6f9=Buffer[_0x4ca98e(0x1b7)](0x2e+_0x4859ba[_0x4ca98e(0x1dc)]);_0x43f6f9['writeUInt32LE'](ZIP_CENTRAL_DIRECTORY_SIGNATURE,0x0),_0x43f6f9[_0x4ca98e(0x184)](0x14,0x4),_0x43f6f9[_0x4ca98e(0x184)](0x14,0x6),_0x43f6f9[_0x4ca98e(0x184)](ZIP_GENERAL_PURPOSE_UTF8,0x8),_0x43f6f9[_0x4ca98e(0x184)](ZIP_METHOD_STORE,0xa),_0x43f6f9['writeUInt16LE'](ZIP_FIXED_DOS_TIME,0xc),_0x43f6f9['writeUInt16LE'](ZIP_FIXED_DOS_DATE,0xe),_0x43f6f9[_0x4ca98e(0x1bd)](_0x4f989f,0x10),_0x43f6f9['writeUInt32LE'](_0x17fa96[_0x4ca98e(0x1dc)],0x14),_0x43f6f9[_0x4ca98e(0x1bd)](_0x17fa96[_0x4ca98e(0x1dc)],0x18),_0x43f6f9[_0x4ca98e(0x184)](_0x4859ba[_0x4ca98e(0x1dc)],0x1c),_0x43f6f9[_0x4ca98e(0x184)](0x0,0x1e),_0x43f6f9[_0x4ca98e(0x184)](0x0,0x20),_0x43f6f9[_0x4ca98e(0x184)](0x0,0x22),_0x43f6f9['writeUInt16LE'](0x0,0x24),_0x43f6f9[_0x4ca98e(0x1bd)](0x0,0x26),_0x43f6f9['writeUInt32LE'](_0x37f22c,0x2a),_0x4859ba['copy'](_0x43f6f9,0x2e),_0x531ef1['push'](_0x43f6f9),_0x37f22c+=_0x236cf8[_0x4ca98e(0x1dc)]+_0x17fa96[_0x4ca98e(0x1dc)];}const _0x3ee513=Buffer[_0x4ca98e(0x152)](_0x531ef1),_0x4adf1e=_0x37f22c,_0x9e15ee=_0x3ee513[_0x4ca98e(0x1dc)],_0x41a38c=Buffer[_0x4ca98e(0x1b7)](0x16);_0x41a38c[_0x4ca98e(0x1bd)](ZIP_END_OF_CENTRAL_DIRECTORY_SIGNATURE,0x0),_0x41a38c[_0x4ca98e(0x184)](0x0,0x4),_0x41a38c[_0x4ca98e(0x184)](0x0,0x6),_0x41a38c[_0x4ca98e(0x184)](_0xa03dc7[_0x4ca98e(0x1dc)],0x8),_0x41a38c[_0x4ca98e(0x184)](_0xa03dc7[_0x4ca98e(0x1dc)],0xa),_0x41a38c[_0x4ca98e(0x1bd)](_0x9e15ee,0xc),_0x41a38c[_0x4ca98e(0x1bd)](_0x4adf1e,0x10),_0x41a38c[_0x4ca98e(0x184)](0x0,0x14);const _0x5edfb1=Buffer[_0x4ca98e(0x152)]([..._0x563e01,_0x3ee513,_0x41a38c]);if(_0x5edfb1['length']>MAX_SKILL_PACKAGE_BYTES)throw CliErrors[_0x4ca98e(0x194)]('Skill\x20package\x20exceeds\x20size\x20limit.');return _0x5edfb1;}function parseZipPackage(_0x2517bd){const _0x466987=a76_0x19070f;if(_0x2517bd['length']<0x16)throw CliErrors[_0x466987(0x194)](_0x466987(0x14a));const _0x1d9ed4=findEndOfCentralDirectory(_0x2517bd);if(_0x1d9ed4<0x0)throw CliErrors[_0x466987(0x194)](_0x466987(0x162));const _0x4a75a3=_0x2517bd['readUInt16LE'](_0x1d9ed4+0x4),_0x1a3ea5=_0x2517bd[_0x466987(0x1a2)](_0x1d9ed4+0x6),_0x1409a7=_0x2517bd[_0x466987(0x1a2)](_0x1d9ed4+0xa),_0x545926=_0x2517bd['readUInt32LE'](_0x1d9ed4+0xc),_0x4818b6=_0x2517bd[_0x466987(0x122)](_0x1d9ed4+0x10);if(_0x4a75a3!==0x0||_0x1a3ea5!==0x0)throw CliErrors[_0x466987(0x194)](_0x466987(0x1be));if(_0x1409a7>MAX_SKILL_FILE_COUNT)throw CliErrors['validation'](_0x466987(0x154));if(_0x4818b6+_0x545926>_0x1d9ed4||_0x4818b6>=_0x2517bd[_0x466987(0x1dc)])throw CliErrors[_0x466987(0x194)](_0x466987(0x17f));const _0x3c81d3=[];let _0x25fe9e=0x0,_0x1fcd05=_0x4818b6;for(let _0x3fef6c=0x0;_0x3fef6c<_0x1409a7;_0x3fef6c+=0x1){if(_0x1fcd05+0x2e>_0x2517bd[_0x466987(0x1dc)])throw CliErrors[_0x466987(0x194)](_0x466987(0x16b));if(_0x2517bd[_0x466987(0x122)](_0x1fcd05)!==ZIP_CENTRAL_DIRECTORY_SIGNATURE)throw CliErrors[_0x466987(0x194)](_0x466987(0x192));const _0x5e85d3=_0x2517bd[_0x466987(0x1a2)](_0x1fcd05+0x8),_0x3da30f=_0x2517bd[_0x466987(0x1a2)](_0x1fcd05+0xa),_0x154c55=_0x2517bd[_0x466987(0x122)](_0x1fcd05+0x10),_0x47f4d9=_0x2517bd[_0x466987(0x122)](_0x1fcd05+0x14),_0x5e6d58=_0x2517bd[_0x466987(0x122)](_0x1fcd05+0x18),_0x5c50a2=_0x2517bd[_0x466987(0x1a2)](_0x1fcd05+0x1c),_0x3dfa6d=_0x2517bd[_0x466987(0x1a2)](_0x1fcd05+0x1e),_0x3d45f1=_0x2517bd['readUInt16LE'](_0x1fcd05+0x20),_0x19303a=_0x2517bd[_0x466987(0x122)](_0x1fcd05+0x2a),_0x4d4860=_0x1fcd05+0x2e,_0x59e686=_0x4d4860+_0x5c50a2;if(_0x59e686>_0x2517bd['length'])throw CliErrors[_0x466987(0x194)](_0x466987(0x132));if((_0x5e85d3&0x1)!==0x0)throw CliErrors[_0x466987(0x194)](_0x466987(0x19d));if(_0x3da30f!==ZIP_METHOD_STORE&&_0x3da30f!==ZIP_METHOD_DEFLATE)throw CliErrors['validation'](_0x466987(0x164));const _0x547758=normalizeSkillRelativePath(_0x2517bd[_0x466987(0x18f)](_0x4d4860,_0x59e686)['toString'](_0x466987(0x16e)));if(_0x547758[_0x466987(0x188)]('/'))throw CliErrors['validation']('Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'+_0x547758);if(_0x5e6d58>MAX_SKILL_FILE_BYTES)throw CliErrors[_0x466987(0x194)](_0x466987(0x11c)+_0x547758);_0x25fe9e+=_0x5e6d58;if(_0x25fe9e>MAX_SKILL_TOTAL_BYTES)throw CliErrors[_0x466987(0x194)](_0x466987(0x183));const _0x3252c9=readZipEntryData(_0x2517bd,_0x19303a,_0x547758,_0x47f4d9),_0x19b8a2=_0x3da30f===ZIP_METHOD_STORE?_0x3252c9:inflateRawSync(_0x3252c9);if(_0x19b8a2['length']!==_0x5e6d58)throw CliErrors['validation'](_0x466987(0x12c)+_0x547758);if(crc32(_0x19b8a2)!==_0x154c55)throw CliErrors[_0x466987(0x194)](_0x466987(0x18a)+_0x547758);_0x3c81d3[_0x466987(0x1ca)]({'path':_0x547758,'bytes':_0x19b8a2}),_0x1fcd05=_0x59e686+_0x3dfa6d+_0x3d45f1;}if(_0x1fcd05!==_0x4818b6+_0x545926)throw CliErrors[_0x466987(0x194)](_0x466987(0x170));return _0x3c81d3[_0x466987(0x134)](compareSkillFiles);}function readZipEntryData(_0x21eec5,_0x446c90,_0x417096,_0x4d75a9){const _0x49f299=a76_0x19070f;if(_0x446c90+0x1e>_0x21eec5[_0x49f299(0x1dc)])throw CliErrors[_0x49f299(0x194)]('Runtime\x20Skill\x20package\x20has\x20truncated\x20local\x20header:\x20'+_0x417096);if(_0x21eec5[_0x49f299(0x122)](_0x446c90)!==ZIP_LOCAL_FILE_HEADER_SIGNATURE)throw CliErrors[_0x49f299(0x194)]('Runtime\x20Skill\x20package\x20local\x20header\x20mismatch:\x20'+_0x417096);const _0x5b4536=_0x21eec5[_0x49f299(0x1a2)](_0x446c90+0x1a),_0x5d9489=_0x21eec5['readUInt16LE'](_0x446c90+0x1c),_0x391558=_0x446c90+0x1e,_0x44aab1=_0x391558+_0x5b4536,_0x4e0471=_0x44aab1+_0x5d9489,_0x488655=_0x4e0471+_0x4d75a9;if(_0x44aab1>_0x21eec5['length']||_0x488655>_0x21eec5[_0x49f299(0x1dc)])throw CliErrors['validation'](_0x49f299(0x1d9)+_0x417096);const _0xb6b2d8=normalizeSkillRelativePath(_0x21eec5[_0x49f299(0x18f)](_0x391558,_0x44aab1)[_0x49f299(0x13a)](_0x49f299(0x16e)));if(_0xb6b2d8!==_0x417096)throw CliErrors['validation'](_0x49f299(0x1da)+_0x417096);return _0x21eec5[_0x49f299(0x18f)](_0x4e0471,_0x488655);}function findEndOfCentralDirectory(_0x188d8b){const _0x139f02=a76_0x19070f,_0x40e05d=Math[_0x139f02(0x121)](0x0,_0x188d8b[_0x139f02(0x1dc)]-0x16-0xffff);for(let _0x3dcf0b=_0x188d8b[_0x139f02(0x1dc)]-0x16;_0x3dcf0b>=_0x40e05d;_0x3dcf0b-=0x1){if(_0x188d8b[_0x139f02(0x122)](_0x3dcf0b)===ZIP_END_OF_CENTRAL_DIRECTORY_SIGNATURE){const _0x434173=_0x188d8b[_0x139f02(0x1a2)](_0x3dcf0b+0x14);if(_0x3dcf0b+0x16+_0x434173===_0x188d8b['length'])return _0x3dcf0b;}}return-0x1;}function createCrc32Table(){const _0x59a40f=new Uint32Array(0x100);for(let _0x6c17b2=0x0;_0x6c17b2<0x100;_0x6c17b2+=0x1){let _0x59754b=_0x6c17b2;for(let _0x3f16b2=0x0;_0x3f16b2<0x8;_0x3f16b2+=0x1){_0x59754b=(_0x59754b&0x1)!==0x0?0xedb88320^_0x59754b>>>0x1:_0x59754b>>>0x1;}_0x59a40f[_0x6c17b2]=_0x59754b>>>0x0;}return _0x59a40f;}function crc32(_0x36b20a){let _0x4e7a9b=0xffffffff;for(const _0x16996b of _0x36b20a){_0x4e7a9b=CRC32_TABLE[(_0x4e7a9b^_0x16996b)&0xff]^_0x4e7a9b>>>0x8;}return(_0x4e7a9b^0xffffffff)>>>0x0;}function compareSkillFiles(_0xcaa722,_0x26beaf){const _0x5bd187=a76_0x19070f;if(_0xcaa722[_0x5bd187(0x1e2)]===SKILL_FILE)return _0x26beaf[_0x5bd187(0x1e2)]===SKILL_FILE?0x0:-0x1;if(_0x26beaf[_0x5bd187(0x1e2)]===SKILL_FILE)return 0x1;return Buffer[_0x5bd187(0x1d8)](Buffer[_0x5bd187(0x180)](_0xcaa722[_0x5bd187(0x1e2)],_0x5bd187(0x16e)),Buffer[_0x5bd187(0x180)](_0x26beaf[_0x5bd187(0x1e2)],_0x5bd187(0x16e)));}function materializeFiles(_0x2ff58c,_0xe26d4d){const _0xbe07a=a76_0x19070f;for(const _0x1ed7b6 of normalizeLocalFiles(_0xe26d4d)){const _0x4ca898=resolveManagedFilePath(_0x2ff58c,_0x1ed7b6[_0xbe07a(0x1e2)]);mkdirSync(dirname(_0x4ca898),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x4ca898,fileContent(_0x1ed7b6),0x180);}}function removeStaleManagedFiles(_0x5772f1,_0x29957f,_0x1a7b44){const _0x3f7080=a76_0x19070f;if(!_0x29957f)return;const _0x551028=new Set(normalizeLocalFiles(_0x1a7b44)[_0x3f7080(0x1c7)](_0x47d929=>_0x47d929[_0x3f7080(0x1e2)]));for(const _0x165307 of Object[_0x3f7080(0x150)](_0x29957f)){if(_0x551028['has'](_0x165307))continue;const _0x518c81=resolveManagedFilePath(_0x5772f1,_0x165307);existsSync(_0x518c81)&&lstatSync(_0x518c81)['isFile']()&&rmSync(_0x518c81,{'force':!![]});}}function resolveManagedFilePath(_0x1e02e7,_0x517a10){const _0xd23d91=a76_0x19070f,_0x1b4c83=normalizeSkillRelativePath(_0x517a10),_0x28c75f=realOrResolved(_0x1e02e7),_0x1dd133=resolve(_0x28c75f,..._0x1b4c83[_0xd23d91(0x13b)]('/'));if(!isPathInside(_0x1dd133,_0x28c75f))throw CliErrors[_0xd23d91(0x194)](_0xd23d91(0x1b0)+_0x517a10);return ensureNoSymlinkInManagedPath(_0x28c75f,_0x1b4c83),_0x1dd133;}function ensureNoSymlinkInManagedPath(_0x27865a,_0x4a2345){const _0x5822e9=a76_0x19070f;let _0x13001d=_0x27865a;for(const _0x32d246 of _0x4a2345[_0x5822e9(0x13b)]('/')){_0x13001d=resolve(_0x13001d,_0x32d246);const _0x2b81a3=lstatIfPresent(_0x13001d);if(_0x2b81a3?.[_0x5822e9(0x138)]())throw CliErrors['validation']('Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20'+_0x4a2345);}}function normalizeSkillRelativePath(_0x43a780){const _0x2d50a3=a76_0x19070f,_0x5bb09a=toPosixPath(_0x43a780[_0x2d50a3(0x12d)]());return validateSkillRelativePath(_0x5bb09a),_0x5bb09a;}function a76_0x8c76(){const _0x3f71dd=['tags','endsWith','Invalid\x20','Runtime\x20Skill\x20package\x20CRC\x20mismatch:\x20','isFile','475371CICZXF','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','name:\x20','subarray','claudeSkillsDir','string','Runtime\x20Skill\x20package\x20has\x20invalid\x20central\x20directory\x20entry.','Duplicate\x20Skill\x20package\x20entry:\x20','validation','cacheRoot','update','Unsafe\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','base64','includes','schemaVersion','scope','Runtime\x20Skill\x20package\x20contains\x20encrypted\x20entries.','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','SKILL_ROOT','readUInt16LE','external-symlink','manifest','unchanged','filter','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','source','skills','linkedPath','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','requireOssPath','content','fromEntries','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','Unsafe\x20Skill\x20file\x20path:\x20','build','some','name','agentsSkillsDir','Duplicate\x20Skill\x20file\x20path:\x20','Runtime\x20Skill\x20package\x20exceeds\x20size\x20limit:\x20','alloc','.DS_Store','20KsyLQJ','.\x20Changed\x20file:\x20','sourceSessionId','Runtime\x20Skill\x20is\x20missing\x20skillCode.','writeUInt32LE','Runtime\x20Skill\x20package\x20uses\x20unsupported\x20multi-disk\x20zip\x20format.','personal','force','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','local','description','pulledAt','accessKey','18ufkhRL','map','4280DyoOXk','company','push','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','object','appCode','path\x20segment','metadata-mismatch','Skill\x20metadata\x20appCode\x20\x22','linkedPaths','test','env','\x20or\x20directory\x20name.','bytes','link','compare','Runtime\x20Skill\x20package\x20has\x20truncated\x20entry\x20data:\x20','Runtime\x20Skill\x20package\x20local\x20path\x20mismatch:\x20','replace','length','Skill\x20file\x20exceeds\x20size\x20limit:\x20','status','skillMdPath','startsWith','.git','path','.hg','\x20does\x20not\x20match\x20backend\x20content:\x20','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','zipSha256','has','skill','removed','version','treeSha256','Runtime\x20Skill\x20package\x20file\x20exceeds\x20size\x20limit:\x20','ossPath','sha256','packageBytes','find','max','readUInt32LE','Skill\x20file\x20path\x20must\x20be\x20text.','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','CLAUDE_SKILL_ROOT','Skill\x20directory\x20not\x20found:\x20','Skill\x20directory\x20exceeds\x20total\x20file\x20size\x20limit.','Unsupported\x20runtime\x20Skill\x20scope:\x20','isSafeInteger','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20package\x20uncompressed\x20size\x20mismatch:\x20','trim','entries','managedRoot','description:\x20','2019294eqmPOL','Runtime\x20Skill\x20package\x20has\x20truncated\x20entry\x20name.','Missing\x20','sort','SKILL.md','size','\x20in\x20Skill\x20file\x20package.','isSymbolicLink','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','toString','split','pushedAt','cache','slice','Skill\x20file\x20size\x20is\x20invalid:\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','13363NmDXDM','builtin','skillCode','coverage','userId','hex','skipped','\x20has\x20scope=\x22','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','skillName','.agents','dist','homeDirName','digest','keys','activeSkillCodes','concat','paths','Runtime\x20Skill\x20package\x20exceeds\x20file\x20count\x20limit.','isArray','isDirectory','code','toLowerCase','fileHashes','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','contentHash','dir','5917356HgamDl','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','---','join','Skill\x20directory\x20exceeds\x20file\x20count\x20limit.','Runtime\x20Skill\x20package\x20is\x20missing\x20zip\x20central\x20directory.','Runtime\x20Skill\x20package\x20size\x20mismatch.','Runtime\x20Skill\x20package\x20contains\x20unsupported\x20compression\x20method.','zipSize','not-managed-symlink','set','metadataPath','.tmp','parse','Runtime\x20Skill\x20package\x20has\x20truncated\x20central\x20directory.','files','values','utf8','homeDir','Runtime\x20Skill\x20package\x20central\x20directory\x20size\x20mismatch.','scopes','packageBase64','stringify','tenantCode','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','Unable\x20to\x20resolve\x20skillCode\x20from\x20','Skill\x20file\x20sha256\x20is\x20invalid:\x20','497064aSlrWG','.next','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','get','forkedFromSkillId','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','Runtime\x20Skill\x20package\x20has\x20invalid\x20central\x20directory\x20offsets.','from','Runtime\x20Skill\x20package\x20','2097468VDfmcY','Runtime\x20Skill\x20package\x20exceeds\x20total\x20file\x20size\x20limit.','writeUInt16LE','1335410gbdxvl','updated'];a76_0x8c76=function(){return _0x3f71dd;};return a76_0x8c76();}function validateSkillRelativePath(_0x3280e0){const _0x4677ec=a76_0x19070f;if(!_0x3280e0||_0x3280e0['startsWith']('/')||_0x3280e0[_0x4677ec(0x19a)]('//'))throw CliErrors[_0x4677ec(0x194)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x3280e0);for(const _0x4da1f1 of _0x3280e0[_0x4677ec(0x13b)]('/')){if(!_0x4da1f1||_0x4da1f1==='.'||_0x4da1f1==='..')throw CliErrors[_0x4677ec(0x194)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x3280e0);}}function toPosixPath(_0x5365f1){const _0x23a784=a76_0x19070f;return _0x5365f1[_0x23a784(0x1db)](/\\/g,'/');}function ensureManagedSymlink(_0x4c99ba,_0x32ceb0,_0x34c2c0){const _0x2daaac=a76_0x19070f;mkdirSync(dirname(_0x4c99ba),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x4c99ba)||isDanglingSymlink(_0x4c99ba)){const _0x4dd557=lstatSync(_0x4c99ba);if(!_0x4dd557[_0x2daaac(0x138)]())throw CliErrors[_0x2daaac(0x194)](_0x2daaac(0x198)+_0x4c99ba);const _0x511aaa=resolveSymlinkTarget(_0x4c99ba);if(!isPathInside(realOrResolved(_0x511aaa),realOrResolved(_0x34c2c0)))throw CliErrors[_0x2daaac(0x194)]('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0x4c99ba);if(realOrResolved(_0x511aaa)===realOrResolved(_0x32ceb0))return{'path':_0x4c99ba,'target':_0x32ceb0,'action':_0x2daaac(0x1a5)};return unlinkSync(_0x4c99ba),symlinkSync(_0x32ceb0,_0x4c99ba,_0x2daaac(0x15c)),{'path':_0x4c99ba,'target':_0x32ceb0,'action':_0x2daaac(0x186)};}return symlinkSync(_0x32ceb0,_0x4c99ba,_0x2daaac(0x15c)),{'path':_0x4c99ba,'target':_0x32ceb0,'action':'created'};}function managedAppSkillLinkPaths(_0x57ffca,_0x478df2){const _0x300dc9=a76_0x19070f;if(!existsSync(_0x57ffca))return[];const _0xec17cd=_0x478df2+'--';return readdirSync(_0x57ffca,{'withFileTypes':!![]})[_0x300dc9(0x1a6)](_0x3cb693=>_0x3cb693[_0x300dc9(0x1b3)][_0x300dc9(0x1e0)](_0xec17cd))[_0x300dc9(0x1c7)](_0x27b63a=>resolve(_0x57ffca,_0x27b63a[_0x300dc9(0x1b3)]));}function removeManagedSkillLink(_0x1e5c66,_0x12cf30){const _0x37a965=a76_0x19070f,_0x1aa3aa=lstatIfPresent(_0x1e5c66);if(!_0x1aa3aa?.[_0x37a965(0x138)]())return{'path':_0x1e5c66,'action':_0x37a965(0x147),'reason':_0x37a965(0x166)};const _0x9a15d=resolveSymlinkTarget(_0x1e5c66);if(!isPathInside(realOrResolved(_0x9a15d),realOrResolved(_0x12cf30)))return{'path':_0x1e5c66,'action':_0x37a965(0x147),'reason':_0x37a965(0x1a3)};return unlinkSync(_0x1e5c66),{'path':_0x1e5c66,'action':_0x37a965(0x119)};}function copyManagedSkillDirectory(_0x3f0f71,_0x81a184){const _0x1a60b1=a76_0x19070f,_0x1e9919=resolve(_0x81a184,METADATA_FILE),_0x2eb72c=existsSync(_0x81a184);if(_0x2eb72c){const _0x26f482=lstatSync(_0x81a184);if(_0x26f482[_0x1a60b1(0x138)]())throw CliErrors[_0x1a60b1(0x194)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x81a184);if(!_0x26f482[_0x1a60b1(0x156)]())throw CliErrors[_0x1a60b1(0x194)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x81a184);const _0x1d8465=readMetadataIfPresent(_0x1e9919);if(_0x1d8465?.[_0x1a60b1(0x19c)]!==_0x1a60b1(0x142))throw CliErrors[_0x1a60b1(0x194)](_0x1a60b1(0x1cb)+_0x81a184);}mkdirSync(dirname(_0x81a184),{'recursive':!![],'mode':0x1c0});const _0x5dda04=_0x2eb72c?readMetadataIfPresent(_0x1e9919)?.[_0x1a60b1(0x15b)]:undefined,_0x10c2e2=readMetadataIfPresent(resolve(_0x3f0f71,METADATA_FILE))?.[_0x1a60b1(0x15b)];return _0x2eb72c&&rmSync(_0x81a184,{'recursive':!![],'force':!![]}),copySkillDirectory(_0x3f0f71,_0x81a184),{'path':_0x81a184,'target':_0x3f0f71,'action':!_0x2eb72c?'created':_0x5dda04===_0x10c2e2?_0x1a60b1(0x1a5):_0x1a60b1(0x186)};}function copySkillDirectory(_0x34c279,_0x29baeb){const _0x11e1d9=a76_0x19070f;mkdirSync(_0x29baeb,{'recursive':!![],'mode':0x1c0});for(const _0x1e092f of readdirSync(_0x34c279,{'withFileTypes':!![]})){const _0x464261=resolve(_0x34c279,_0x1e092f[_0x11e1d9(0x1b3)]),_0x56ec22=resolve(_0x29baeb,_0x1e092f[_0x11e1d9(0x1b3)]);if(_0x1e092f[_0x11e1d9(0x138)]())throw CliErrors[_0x11e1d9(0x194)](_0x11e1d9(0x19f)+_0x464261);if(_0x1e092f[_0x11e1d9(0x156)]()){copySkillDirectory(_0x464261,_0x56ec22);continue;}_0x1e092f[_0x11e1d9(0x18b)]()&&writeFileSync(_0x56ec22,readFileSync(_0x464261));}}function isDanglingSymlink(_0x39c4cf){try{return lstatSync(_0x39c4cf)['isSymbolicLink']();}catch{return![];}}function resolveSymlinkTarget(_0x163b40){const _0x21ba0c=readlinkSync(_0x163b40);return isAbsolute(_0x21ba0c)?_0x21ba0c:resolve(dirname(_0x163b40),_0x21ba0c);}function isPathInside(_0x2f93dd,_0x4c2f40){const _0x5e2517=a76_0x19070f,_0x2e073b=_0x2f93dd['endsWith'](sep)?_0x2f93dd:''+_0x2f93dd+sep,_0x328eef=_0x4c2f40[_0x5e2517(0x188)](sep)?_0x4c2f40:''+_0x4c2f40+sep;return _0x2f93dd===_0x4c2f40||_0x2e073b['startsWith'](_0x328eef);}function realOrResolved(_0x228bb3){try{return realpathSync(_0x228bb3);}catch{return resolve(_0x228bb3);}}function lstatIfPresent(_0x3ddf78){try{return lstatSync(_0x3ddf78);}catch{return undefined;}}function writeTextAtomic(_0x5dc016,_0x1c6794,_0x1f4fab){const _0x1eb61e=a76_0x19070f;writeBytesAtomic(_0x5dc016,Buffer[_0x1eb61e(0x180)](_0x1c6794,'utf8'),_0x1f4fab);}function writeBytesAtomic(_0x442400,_0x313a7e,_0x5d3e98){const _0x15415b=a76_0x19070f,_0x26e876=_0x442400+_0x15415b(0x169);try{writeFileSync(_0x26e876,_0x313a7e,{'mode':_0x5d3e98}),renameSync(_0x26e876,_0x442400);}catch(_0x2a42b5){try{rmSync(_0x26e876,{'force':!![]});}catch{}throw _0x2a42b5;}}function writeJsonAtomic(_0x1da984,_0x497d14){const _0x5422b9=a76_0x19070f;writeTextAtomic(_0x1da984,JSON[_0x5422b9(0x173)](_0x497d14,null,0x2)+'\x0a',0x180);}
1
+ (function(_0x44f7a3,_0x548981){var _0x395cc6=a99_0x2823,_0xd12a1e=_0x44f7a3();while(!![]){try{var _0x345d0b=-parseInt(_0x395cc6(0x194))/0x1*(parseInt(_0x395cc6(0x19a))/0x2)+parseInt(_0x395cc6(0x193))/0x3*(parseInt(_0x395cc6(0x192))/0x4)+-parseInt(_0x395cc6(0x195))/0x5+parseInt(_0x395cc6(0x198))/0x6+-parseInt(_0x395cc6(0x197))/0x7+parseInt(_0x395cc6(0x196))/0x8+parseInt(_0x395cc6(0x199))/0x9;if(_0x345d0b===_0x548981)break;else _0xd12a1e['push'](_0xd12a1e['shift']());}catch(_0x4d5b69){_0xd12a1e['push'](_0xd12a1e['shift']());}}}(a99_0x4e88,0x735bd));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.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}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,recordPushedRuntimeSkill}from'./runtime-skill-sync/push.js';function a99_0x2823(_0x17c9a8,_0x3998c6){_0x17c9a8=_0x17c9a8-0x192;var _0x4e889b=a99_0x4e88();var _0x282326=_0x4e889b[_0x17c9a8];return _0x282326;}function a99_0x4e88(){var _0x14521a=['695616tzoDoe','227297QrVsot','3026364ZiWady','611928CFGHFp','132798uEEBBO','388964dvXcwW','15JGgQjg','2yWpHhw','2538825BXIlOg'];a99_0x4e88=function(){return _0x14521a;};return a99_0x4e88();}export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
@@ -1 +1 @@
1
- function a77_0x268f(){const _0x7a2e65=['141zfPbpp','7704WoSRKe','1343728BLwaeD','11iPhEQo','17131vsHmKD','3073670bGEOjM','826698fpXgUN','9JsLete','909695QumIPR','807800gwwtRs','22LsuLdo'];a77_0x268f=function(){return _0x7a2e65;};return a77_0x268f();}(function(_0x5e256a,_0x4fa456){const _0x42f42e=a77_0x5191,_0x33f0e6=_0x5e256a();while(!![]){try{const _0x340cf9=-parseInt(_0x42f42e(0x77))/0x1*(-parseInt(_0x42f42e(0x72))/0x2)+parseInt(_0x42f42e(0x73))/0x3*(-parseInt(_0x42f42e(0x74))/0x4)+parseInt(_0x42f42e(0x7b))/0x5+-parseInt(_0x42f42e(0x79))/0x6+parseInt(_0x42f42e(0x71))/0x7+-parseInt(_0x42f42e(0x75))/0x8*(-parseInt(_0x42f42e(0x7a))/0x9)+-parseInt(_0x42f42e(0x78))/0xa*(parseInt(_0x42f42e(0x76))/0xb);if(_0x340cf9===_0x4fa456)break;else _0x33f0e6['push'](_0x33f0e6['shift']());}catch(_0x79bce7){_0x33f0e6['push'](_0x33f0e6['shift']());}}}(a77_0x268f,0x1cd3a));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a77_0x5191(_0x22a876,_0x6b81e6){_0x22a876=_0x22a876-0x71;const _0x268f7f=a77_0x268f();let _0x5191ad=_0x268f7f[_0x22a876];return _0x5191ad;}import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
1
+ (function(_0x282edd,_0x3f6e01){const _0x223692=a100_0xdca6,_0x22e598=_0x282edd();while(!![]){try{const _0x54aea3=-parseInt(_0x223692(0x1ea))/0x1*(parseInt(_0x223692(0x1ed))/0x2)+-parseInt(_0x223692(0x1e9))/0x3*(-parseInt(_0x223692(0x1ef))/0x4)+-parseInt(_0x223692(0x1e8))/0x5+-parseInt(_0x223692(0x1f0))/0x6+parseInt(_0x223692(0x1ee))/0x7*(parseInt(_0x223692(0x1eb))/0x8)+parseInt(_0x223692(0x1f1))/0x9*(-parseInt(_0x223692(0x1f2))/0xa)+parseInt(_0x223692(0x1ec))/0xb;if(_0x54aea3===_0x3f6e01)break;else _0x22e598['push'](_0x22e598['shift']());}catch(_0x5d520f){_0x22e598['push'](_0x22e598['shift']());}}}(a100_0x57a0,0xb0646));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a100_0x57a0(){const _0xf14130=['4314594hAToNA','123831CvghOM','300TfdnAK','5699440hRajVP','190389GLDDIT','10641PWPQmx','4744bfYymu','24602710sShzXN','50Kvjjac','2345ehdvSQ','52kwuPaA'];a100_0x57a0=function(){return _0xf14130;};return a100_0x57a0();}import{CliErrors}from'../errors.js';function a100_0xdca6(_0x13b831,_0x237a9a){_0x13b831=_0x13b831-0x1e8;const _0x57a0fa=a100_0x57a0();let _0xdca6cf=_0x57a0fa[_0x13b831];return _0xdca6cf;}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
@@ -1 +1 @@
1
- const a78_0x5cee34=a78_0x3a7c;(function(_0x35926c,_0x5c263e){const _0x2d847c=a78_0x3a7c,_0x2be498=_0x35926c();while(!![]){try{const _0x1d372f=parseInt(_0x2d847c(0x20c))/0x1*(-parseInt(_0x2d847c(0x1f8))/0x2)+-parseInt(_0x2d847c(0x20f))/0x3+-parseInt(_0x2d847c(0x1e7))/0x4*(-parseInt(_0x2d847c(0x1f3))/0x5)+-parseInt(_0x2d847c(0x205))/0x6*(parseInt(_0x2d847c(0x203))/0x7)+-parseInt(_0x2d847c(0x209))/0x8*(parseInt(_0x2d847c(0x1ea))/0x9)+-parseInt(_0x2d847c(0x1de))/0xa+-parseInt(_0x2d847c(0x201))/0xb*(-parseInt(_0x2d847c(0x1e5))/0xc);if(_0x1d372f===_0x5c263e)break;else _0x2be498['push'](_0x2be498['shift']());}catch(_0x49d9ff){_0x2be498['push'](_0x2be498['shift']());}}}(a78_0x5a7c,0xdeb96));import a78_0x1476cf from'winston';function a78_0x5a7c(){const _0x1aa342=['1024DzsSXC','timestamp','info','380437gxQJvR','logFileName','utf8','1915821EUFmxs','warn','combine','rawCommand','command','setLogPath','errors','error','mkdirSync','details','5956030SfpQdf','clearLogs','blue','unknown','addColors','getWinstonInstance','currentRawCommand','52496004olhRLW','writeFileSync','3948248HPrlRN','winstonLogger','readFileSync','124137kmdEFc','File','Failed\x20to\x20read\x20logs:','initWinstonLogger','green','level','transports','clear','trim','5LoTwcV','message','success','Failed\x20to\x20clear\x20logs:','now','2CYDVYZ','existsSync','log','printf','red','filter','parse','stringify','setRawCommand','11mFQSXN','format','7fOvCHU','Starting:\x20','6415800BdCPRa','createLogger','toISOString','logFilePath'];a78_0x5a7c=function(){return _0x1aa342;};return a78_0x5a7c();}import a78_0x135d09 from'node:fs';import a78_0x117fe1 from'node:path';function a78_0x3a7c(_0x113c23,_0x4e67ba){_0x113c23=_0x113c23-0x1db;const _0x5a7cb2=a78_0x5a7c();let _0x3a7c40=_0x5a7cb2[_0x113c23];return _0x3a7c40;}import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{[a78_0x5cee34(0x1e8)];[a78_0x5cee34(0x208)]='';[a78_0x5cee34(0x1e4)]='';constructor(){}[a78_0x5cee34(0x200)](_0x54c7c5){const _0x4d946d=a78_0x5cee34;this[_0x4d946d(0x1e4)]=_0x54c7c5;}[a78_0x5cee34(0x214)](_0x14fdd2){const _0x78272e=a78_0x5cee34;this['logFilePath']=a78_0x117fe1['join'](_0x14fdd2,PRODUCT_CONFIG[_0x78272e(0x20d)]),this[_0x78272e(0x1e8)]&&this[_0x78272e(0x1e8)][_0x78272e(0x1f1)](),this[_0x78272e(0x1ed)]();}[a78_0x5cee34(0x1ed)](){const _0x1a2212=a78_0x5cee34,_0x4578bd=a78_0x117fe1['dirname'](this[_0x1a2212(0x208)]);!a78_0x135d09[_0x1a2212(0x1f9)](_0x4578bd)&&a78_0x135d09[_0x1a2212(0x1dc)](_0x4578bd,{'recursive':!![]});const _0x34c692=a78_0x1476cf[_0x1a2212(0x202)][_0x1a2212(0x211)](a78_0x1476cf[_0x1a2212(0x202)][_0x1a2212(0x20a)](),a78_0x1476cf[_0x1a2212(0x202)][_0x1a2212(0x215)]({'stack':!![]}),a78_0x1476cf[_0x1a2212(0x202)][_0x1a2212(0x1fb)](_0x10f4c9=>{const _0x115c10=_0x1a2212,_0x1620b1={'timestamp':_0x10f4c9['timestamp']||new Date()[_0x115c10(0x207)](),'level':_0x10f4c9[_0x115c10(0x1ef)]||_0x115c10(0x20b),'command':_0x10f4c9[_0x115c10(0x213)]||_0x115c10(0x1e1),'rawCommand':_0x10f4c9[_0x115c10(0x212)]||this[_0x115c10(0x1e4)]||undefined,'message':_0x10f4c9[_0x115c10(0x1f4)]||'','duration':_0x10f4c9['duration']||undefined,'details':_0x10f4c9[_0x115c10(0x1dd)]||undefined};return JSON[_0x115c10(0x1ff)](_0x1620b1);}));this['winstonLogger']=a78_0x1476cf[_0x1a2212(0x206)]({'level':_0x1a2212(0x20b),'format':_0x34c692,'transports':[new a78_0x1476cf[(_0x1a2212(0x1f0))][(_0x1a2212(0x1eb))]({'filename':this[_0x1a2212(0x208)],'level':_0x1a2212(0x20b)})],'silent':![]}),a78_0x1476cf[_0x1a2212(0x1e2)]({'success':_0x1a2212(0x1ee),'error':_0x1a2212(0x1fc),'warn':'yellow','info':_0x1a2212(0x1e0)});}[a78_0x5cee34(0x20b)](_0x3fcb04,_0x20e3d9,_0x4a6d27){const _0x282214=a78_0x5cee34;if(!this[_0x282214(0x208)]||!this[_0x282214(0x1e8)])return;this[_0x282214(0x1e8)][_0x282214(0x20b)](_0x20e3d9,{'command':_0x3fcb04,'details':_0x4a6d27});}[a78_0x5cee34(0x1f5)](_0x15a759,_0x219e67,_0xf84d86,_0x150ccd){const _0xf512ca=a78_0x5cee34;if(!this['logFilePath']||!this[_0xf512ca(0x1e8)])return;this['winstonLogger'][_0xf512ca(0x1fa)](_0xf512ca(0x20b),_0x219e67,{'level':_0xf512ca(0x1f5),'command':_0x15a759,'duration':_0xf84d86,'details':_0x150ccd});}['error'](_0xaf86cb,_0x4b915c,_0x6fcc05){const _0x4f8793=a78_0x5cee34;if(!this['logFilePath']||!this[_0x4f8793(0x1e8)])return;this[_0x4f8793(0x1e8)]['error'](_0x4b915c,{'command':_0xaf86cb,'details':_0x6fcc05});}['warn'](_0x22e34b,_0x539645,_0x1dbb84){const _0x20cf16=a78_0x5cee34;if(!this[_0x20cf16(0x208)]||!this[_0x20cf16(0x1e8)])return;this['winstonLogger'][_0x20cf16(0x210)](_0x539645,{'command':_0x22e34b,'details':_0x1dbb84});}async['logTask'](_0x1f4ae3,_0x2dba3d,_0x544a0b){const _0x1cc003=a78_0x5cee34,_0x2de641=Date['now']();this[_0x1cc003(0x20b)](_0x1f4ae3,_0x1cc003(0x204)+_0x2dba3d);try{const _0x3d6dfc=await _0x544a0b(),_0x4781c3=Date[_0x1cc003(0x1f7)]()-_0x2de641;return this[_0x1cc003(0x1f5)](_0x1f4ae3,'Completed:\x20'+_0x2dba3d,_0x4781c3),_0x3d6dfc;}catch(_0x455d38){const _0x64a370=Date['now']()-_0x2de641;this[_0x1cc003(0x1db)](_0x1f4ae3,'Failed:\x20'+_0x2dba3d,{'error':_0x455d38 instanceof Error?_0x455d38[_0x1cc003(0x1f4)]:String(_0x455d38),'duration':_0x64a370});throw _0x455d38;}}['readLogs'](){const _0x2cfd76=a78_0x5cee34;try{if(!a78_0x135d09[_0x2cfd76(0x1f9)](this[_0x2cfd76(0x208)]))return[];const _0x191623=a78_0x135d09[_0x2cfd76(0x1e9)](this['logFilePath'],_0x2cfd76(0x20e));return _0x191623['split'](/\r?\n/)[_0x2cfd76(0x1fd)](_0x497ea3=>_0x497ea3[_0x2cfd76(0x1f2)]())['map'](_0x1beb80=>JSON[_0x2cfd76(0x1fe)](_0x1beb80));}catch(_0x1ed141){return console['warn'](_0x2cfd76(0x1ec),_0x1ed141),[];}}[a78_0x5cee34(0x1df)](){const _0xc0f82e=a78_0x5cee34;try{a78_0x135d09['existsSync'](this['logFilePath'])&&a78_0x135d09[_0xc0f82e(0x1e6)](this['logFilePath'],'',_0xc0f82e(0x20e));}catch(_0x35a634){console[_0xc0f82e(0x210)](_0xc0f82e(0x1f6),_0x35a634);}}[a78_0x5cee34(0x1e3)](){const _0x5707b5=a78_0x5cee34;return this[_0x5707b5(0x1e8)];}}export const logger=new Logger();
1
+ const a101_0x33fed1=a101_0x4364;function a101_0x4364(_0x12fcae,_0xbecf6c){_0x12fcae=_0x12fcae-0x169;const _0x1b259a=a101_0x1b25();let _0x436440=_0x1b259a[_0x12fcae];return _0x436440;}function a101_0x1b25(){const _0x4bc006=['6720438CHdEjh','logFilePath','createLogger','now','blue','setLogPath','6129560IZjRsL','level','yellow','currentRawCommand','parse','error','green','4rNrjxL','Completed:\x20','Starting:\x20','clearLogs','getWinstonInstance','dirname','command','warn','winstonLogger','utf8','success','3097944KdJNmq','printf','duration','toISOString','addColors','timestamp','4402655kejcqT','setRawCommand','4ChhOSd','format','mkdirSync','unknown','7dtunXd','File','readFileSync','info','logTask','initWinstonLogger','join','filter','1483440waiaPX','transports','39617590SeHCbG','stringify','combine','message','Failed\x20to\x20clear\x20logs:','logFileName','existsSync','663135CAqTnb','11Cjkrbd'];a101_0x1b25=function(){return _0x4bc006;};return a101_0x1b25();}(function(_0x2877c9,_0x219ccf){const _0x75d371=a101_0x4364,_0x4919d2=_0x2877c9();while(!![]){try{const _0x58ace7=-parseInt(_0x75d371(0x179))/0x1*(parseInt(_0x75d371(0x19b))/0x2)+parseInt(_0x75d371(0x170))/0x3+-parseInt(_0x75d371(0x188))/0x4*(parseInt(_0x75d371(0x199))/0x5)+parseInt(_0x75d371(0x17b))/0x6*(-parseInt(_0x75d371(0x19f))/0x7)+-parseInt(_0x75d371(0x181))/0x8+parseInt(_0x75d371(0x193))/0x9+-parseInt(_0x75d371(0x172))/0xa*(-parseInt(_0x75d371(0x17a))/0xb);if(_0x58ace7===_0x219ccf)break;else _0x4919d2['push'](_0x4919d2['shift']());}catch(_0x40242b){_0x4919d2['push'](_0x4919d2['shift']());}}}(a101_0x1b25,0xacb3a));import a101_0x4eee37 from'winston';import a101_0x55c1b5 from'node:fs';import a101_0x2d8be9 from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{[a101_0x33fed1(0x190)];[a101_0x33fed1(0x17c)]='';['currentRawCommand']='';constructor(){}[a101_0x33fed1(0x19a)](_0x57143d){const _0x3e7c30=a101_0x33fed1;this[_0x3e7c30(0x184)]=_0x57143d;}[a101_0x33fed1(0x180)](_0x4132fa){const _0x51e0e9=a101_0x33fed1;this['logFilePath']=a101_0x2d8be9[_0x51e0e9(0x16e)](_0x4132fa,PRODUCT_CONFIG[_0x51e0e9(0x177)]),this['winstonLogger']&&this[_0x51e0e9(0x190)]['clear'](),this[_0x51e0e9(0x16d)]();}[a101_0x33fed1(0x16d)](){const _0x1b1411=a101_0x33fed1,_0x1fd80d=a101_0x2d8be9[_0x1b1411(0x18d)](this[_0x1b1411(0x17c)]);!a101_0x55c1b5[_0x1b1411(0x178)](_0x1fd80d)&&a101_0x55c1b5[_0x1b1411(0x19d)](_0x1fd80d,{'recursive':!![]});const _0x1ae74f=a101_0x4eee37[_0x1b1411(0x19c)][_0x1b1411(0x174)](a101_0x4eee37['format']['timestamp'](),a101_0x4eee37[_0x1b1411(0x19c)]['errors']({'stack':!![]}),a101_0x4eee37[_0x1b1411(0x19c)][_0x1b1411(0x194)](_0xa37dd3=>{const _0xfaf7b6=_0x1b1411,_0xcb0412={'timestamp':_0xa37dd3[_0xfaf7b6(0x198)]||new Date()[_0xfaf7b6(0x196)](),'level':_0xa37dd3[_0xfaf7b6(0x182)]||_0xfaf7b6(0x16b),'command':_0xa37dd3[_0xfaf7b6(0x18e)]||_0xfaf7b6(0x19e),'rawCommand':_0xa37dd3['rawCommand']||this[_0xfaf7b6(0x184)]||undefined,'message':_0xa37dd3[_0xfaf7b6(0x175)]||'','duration':_0xa37dd3[_0xfaf7b6(0x195)]||undefined,'details':_0xa37dd3['details']||undefined};return JSON[_0xfaf7b6(0x173)](_0xcb0412);}));this[_0x1b1411(0x190)]=a101_0x4eee37[_0x1b1411(0x17d)]({'level':'info','format':_0x1ae74f,'transports':[new a101_0x4eee37[(_0x1b1411(0x171))][(_0x1b1411(0x169))]({'filename':this['logFilePath'],'level':_0x1b1411(0x16b)})],'silent':![]}),a101_0x4eee37[_0x1b1411(0x197)]({'success':_0x1b1411(0x187),'error':'red','warn':_0x1b1411(0x183),'info':_0x1b1411(0x17f)});}[a101_0x33fed1(0x16b)](_0x4d051e,_0x271642,_0x432281){const _0x1dcb9a=a101_0x33fed1;if(!this[_0x1dcb9a(0x17c)]||!this[_0x1dcb9a(0x190)])return;this[_0x1dcb9a(0x190)]['info'](_0x271642,{'command':_0x4d051e,'details':_0x432281});}[a101_0x33fed1(0x192)](_0x18c8c1,_0x5bac34,_0x27147c,_0x65c268){const _0x8726a5=a101_0x33fed1;if(!this[_0x8726a5(0x17c)]||!this[_0x8726a5(0x190)])return;this[_0x8726a5(0x190)]['log'](_0x8726a5(0x16b),_0x5bac34,{'level':_0x8726a5(0x192),'command':_0x18c8c1,'duration':_0x27147c,'details':_0x65c268});}[a101_0x33fed1(0x186)](_0x499439,_0x26ef5c,_0x1393b7){const _0x3bef85=a101_0x33fed1;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x3bef85(0x190)]['error'](_0x26ef5c,{'command':_0x499439,'details':_0x1393b7});}[a101_0x33fed1(0x18f)](_0x4983e0,_0x34774e,_0x1791b6){const _0x51f738=a101_0x33fed1;if(!this[_0x51f738(0x17c)]||!this[_0x51f738(0x190)])return;this[_0x51f738(0x190)][_0x51f738(0x18f)](_0x34774e,{'command':_0x4983e0,'details':_0x1791b6});}async[a101_0x33fed1(0x16c)](_0x530cc9,_0x2fb0dc,_0x383354){const _0x43164e=a101_0x33fed1,_0x3bbe5e=Date[_0x43164e(0x17e)]();this[_0x43164e(0x16b)](_0x530cc9,_0x43164e(0x18a)+_0x2fb0dc);try{const _0x164790=await _0x383354(),_0x1cfeaf=Date[_0x43164e(0x17e)]()-_0x3bbe5e;return this[_0x43164e(0x192)](_0x530cc9,_0x43164e(0x189)+_0x2fb0dc,_0x1cfeaf),_0x164790;}catch(_0x521eed){const _0x1334ea=Date['now']()-_0x3bbe5e;this[_0x43164e(0x186)](_0x530cc9,'Failed:\x20'+_0x2fb0dc,{'error':_0x521eed instanceof Error?_0x521eed[_0x43164e(0x175)]:String(_0x521eed),'duration':_0x1334ea});throw _0x521eed;}}['readLogs'](){const _0x4667f3=a101_0x33fed1;try{if(!a101_0x55c1b5['existsSync'](this[_0x4667f3(0x17c)]))return[];const _0x1f6fe9=a101_0x55c1b5[_0x4667f3(0x16a)](this['logFilePath'],'utf8');return _0x1f6fe9['split'](/\r?\n/)[_0x4667f3(0x16f)](_0x3bc685=>_0x3bc685['trim']())['map'](_0x5f3038=>JSON[_0x4667f3(0x185)](_0x5f3038));}catch(_0x247176){return console[_0x4667f3(0x18f)]('Failed\x20to\x20read\x20logs:',_0x247176),[];}}[a101_0x33fed1(0x18b)](){const _0x38da3c=a101_0x33fed1;try{a101_0x55c1b5[_0x38da3c(0x178)](this[_0x38da3c(0x17c)])&&a101_0x55c1b5['writeFileSync'](this[_0x38da3c(0x17c)],'',_0x38da3c(0x191));}catch(_0x5e23c6){console[_0x38da3c(0x18f)](_0x38da3c(0x176),_0x5e23c6);}}[a101_0x33fed1(0x18c)](){const _0x4e5c9c=a101_0x33fed1;return this[_0x4e5c9c(0x190)];}}export const logger=new Logger();
@@ -1 +1 @@
1
- (function(_0x35f2ad,_0x105b99){var _0x5cf02a=a79_0x2d04,_0x26f79f=_0x35f2ad();while(!![]){try{var _0x112a14=-parseInt(_0x5cf02a(0xed))/0x1*(-parseInt(_0x5cf02a(0xec))/0x2)+parseInt(_0x5cf02a(0xe8))/0x3+parseInt(_0x5cf02a(0xeb))/0x4+parseInt(_0x5cf02a(0xea))/0x5+-parseInt(_0x5cf02a(0xf3))/0x6+parseInt(_0x5cf02a(0xf0))/0x7*(-parseInt(_0x5cf02a(0xef))/0x8)+-parseInt(_0x5cf02a(0xe6))/0x9;if(_0x112a14===_0x105b99)break;else _0x26f79f['push'](_0x26f79f['shift']());}catch(_0x5deea3){_0x26f79f['push'](_0x26f79f['shift']());}}}(a79_0x4581,0x9d65f));function a79_0x2d04(_0x2e0851,_0x191590){_0x2e0851=_0x2e0851-0xe6;var _0x458151=a79_0x4581();var _0x2d0467=_0x458151[_0x2e0851];return _0x2d0467;}import{CliErrors}from'../errors.js';export function parseJsonParams(_0x3b2a61){var _0x27d00e=a79_0x2d04;if(!_0x3b2a61)return undefined;try{return JSON[_0x27d00e(0xf5)](_0x3b2a61);}catch{throw CliErrors[_0x27d00e(0xe7)](_0x27d00e(0xee)+_0x3b2a61);}}export function parseJsonParamsValue(_0x135486){var _0x52e791=a79_0x2d04;if(!_0x135486)return undefined;try{return JSON['parse'](_0x135486);}catch{throw CliErrors[_0x52e791(0xe7)]('Invalid\x20JSON\x20for\x20--params:\x20'+_0x135486);}}function a79_0x4581(){var _0x3aef9a=['1506376lmZoGg','7tHWITF','batchCreate\x20--params\x20must\x20be\x20a\x20JSON\x20array\x20or\x20{\x22items\x22:[...]}','isArray','1137600GIxGxZ','Example:\x20--params\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','parse','21003588pASzOE','validation','3283953LfGXKB','items','4494315ojgKim','4417896HEGnSO','172RdEArQ','3004QmnWGe','Invalid\x20JSON\x20for\x20--params:\x20'];a79_0x4581=function(){return _0x3aef9a;};return a79_0x4581();}export function parseBatchCreateItemsFromParams(_0xa40be7){var _0x4e8c8d=a79_0x2d04;if(Array[_0x4e8c8d(0xf2)](_0xa40be7))return _0xa40be7;if(_0xa40be7!==null&&_0xa40be7!==undefined&&typeof _0xa40be7==='object'&&Array['isArray'](_0xa40be7['items']))return _0xa40be7[_0x4e8c8d(0xe9)];throw CliErrors[_0x4e8c8d(0xe7)](_0x4e8c8d(0xf1),_0x4e8c8d(0xf4));}
1
+ (function(_0x370633,_0x20f1b1){var _0x5059aa=a102_0x7891,_0x28afa2=_0x370633();while(!![]){try{var _0x282e07=parseInt(_0x5059aa(0x12c))/0x1*(parseInt(_0x5059aa(0x133))/0x2)+-parseInt(_0x5059aa(0x12f))/0x3+parseInt(_0x5059aa(0x12e))/0x4+parseInt(_0x5059aa(0x123))/0x5*(-parseInt(_0x5059aa(0x132))/0x6)+parseInt(_0x5059aa(0x129))/0x7*(-parseInt(_0x5059aa(0x12a))/0x8)+parseInt(_0x5059aa(0x131))/0x9*(-parseInt(_0x5059aa(0x134))/0xa)+parseInt(_0x5059aa(0x124))/0xb;if(_0x282e07===_0x20f1b1)break;else _0x28afa2['push'](_0x28afa2['shift']());}catch(_0x5e74eb){_0x28afa2['push'](_0x28afa2['shift']());}}}(a102_0x5a82,0x69aa9));function a102_0x7891(_0xe3d655,_0x1681a2){_0xe3d655=_0xe3d655-0x123;var _0x5a829b=a102_0x5a82();var _0x789130=_0x5a829b[_0xe3d655];return _0x789130;}import{CliErrors}from'../errors.js';export function parseJsonParams(_0x2de999){var _0x4fe260=a102_0x7891;if(!_0x2de999)return undefined;try{return JSON[_0x4fe260(0x12b)](_0x2de999);}catch{throw CliErrors[_0x4fe260(0x130)](_0x4fe260(0x125)+_0x2de999);}}export function parseJsonParamsValue(_0xe68351){var _0x353316=a102_0x7891;if(!_0xe68351)return undefined;try{return JSON[_0x353316(0x12b)](_0xe68351);}catch{throw CliErrors[_0x353316(0x130)](_0x353316(0x125)+_0xe68351);}}function a102_0x5a82(){var _0x5cf315=['parse','11PXUvqG','items','3087680pGsuIH','1959651OFyqNN','validation','74097dShFyQ','894GCwiSK','143240ZQzKQH','320szJpfj','28540nWhNSy','12526437FCIiGy','Invalid\x20JSON\x20for\x20--params:\x20','Example:\x20--params\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','isArray','batchCreate\x20--params\x20must\x20be\x20a\x20JSON\x20array\x20or\x20{\x22items\x22:[...]}','7socadK','3988264kvkqgC'];a102_0x5a82=function(){return _0x5cf315;};return a102_0x5a82();}export function parseBatchCreateItemsFromParams(_0x590dee){var _0x2f0ad0=a102_0x7891;if(Array[_0x2f0ad0(0x127)](_0x590dee))return _0x590dee;if(_0x590dee!==null&&_0x590dee!==undefined&&typeof _0x590dee==='object'&&Array[_0x2f0ad0(0x127)](_0x590dee['items']))return _0x590dee[_0x2f0ad0(0x12d)];throw CliErrors[_0x2f0ad0(0x130)](_0x2f0ad0(0x128),_0x2f0ad0(0x126));}
@@ -1 +1 @@
1
- function a80_0x43d8(_0x45c2b9,_0x1107f2){_0x45c2b9=_0x45c2b9-0xcd;const _0x593d0e=a80_0x593d();let _0x43d888=_0x593d0e[_0x45c2b9];return _0x43d888;}const a80_0x4cb91f=a80_0x43d8;(function(_0x7af7c,_0x5bec76){const _0x15dbbe=a80_0x43d8,_0x1f1c29=_0x7af7c();while(!![]){try{const _0x915187=parseInt(_0x15dbbe(0xcf))/0x1+parseInt(_0x15dbbe(0xd6))/0x2*(parseInt(_0x15dbbe(0xd0))/0x3)+-parseInt(_0x15dbbe(0xd3))/0x4+-parseInt(_0x15dbbe(0xce))/0x5+-parseInt(_0x15dbbe(0xd4))/0x6+parseInt(_0x15dbbe(0xd5))/0x7+parseInt(_0x15dbbe(0xd1))/0x8;if(_0x915187===_0x5bec76)break;else _0x1f1c29['push'](_0x1f1c29['shift']());}catch(_0x23cea1){_0x1f1c29['push'](_0x1f1c29['shift']());}}}(a80_0x593d,0x1e33f));function a80_0x593d(){const _0x34413c=['258siFwvS','784216vXpBnh','win32','636424ZBJhpa','229500CHfSfB','682185EJTvRK','3890bCYGda','.cmd','747660qSGbwa','107847cHKiaW'];a80_0x593d=function(){return _0x34413c;};return a80_0x593d();}export const isWindows=process['platform']===a80_0x4cb91f(0xd2);export function resolveNpmBin(_0x4cc9c7){const _0x4e7ad9=a80_0x4cb91f;return isWindows?_0x4cc9c7+_0x4e7ad9(0xcd):_0x4cc9c7;}
1
+ function a103_0x55f9(){const _0x5e891a=['8mmaoBo','932lbdlcj','2885319dzqHlJ','2469zxbCZB','139010FaeclW','3908pNjqFR','.cmd','win32','9804744WxjFrL','6pIPzNr','platform','1500445pxGzhE','296REXVZl','2706256vpKgeO','99FzxDni'];a103_0x55f9=function(){return _0x5e891a;};return a103_0x55f9();}const a103_0x1ce9d4=a103_0x5f29;(function(_0x2596b2,_0x47faea){const _0x24aeef=a103_0x5f29,_0x14461a=_0x2596b2();while(!![]){try{const _0x1b8770=-parseInt(_0x24aeef(0xc7))/0x1*(-parseInt(_0x24aeef(0xc0))/0x2)+-parseInt(_0x24aeef(0xbe))/0x3*(parseInt(_0x24aeef(0xcb))/0x4)+-parseInt(_0x24aeef(0xc6))/0x5+-parseInt(_0x24aeef(0xc4))/0x6*(parseInt(_0x24aeef(0xc8))/0x7)+parseInt(_0x24aeef(0xca))/0x8*(-parseInt(_0x24aeef(0xbd))/0x9)+-parseInt(_0x24aeef(0xbf))/0xa*(-parseInt(_0x24aeef(0xc9))/0xb)+parseInt(_0x24aeef(0xc3))/0xc;if(_0x1b8770===_0x47faea)break;else _0x14461a['push'](_0x14461a['shift']());}catch(_0x174bf8){_0x14461a['push'](_0x14461a['shift']());}}}(a103_0x55f9,0x4e7e4));export const isWindows=process[a103_0x1ce9d4(0xc5)]===a103_0x1ce9d4(0xc2);function a103_0x5f29(_0x10a830,_0x20da05){_0x10a830=_0x10a830-0xbd;const _0x55f99c=a103_0x55f9();let _0x5f299e=_0x55f99c[_0x10a830];return _0x5f299e;}export function resolveNpmBin(_0x1e29a2){const _0x3d4935=a103_0x1ce9d4;return isWindows?_0x1e29a2+_0x3d4935(0xc1):_0x1e29a2;}
@@ -1 +1 @@
1
- (function(_0x55b2bb,_0xb20f2a){const _0x276411=a81_0x3951,_0x5455fd=_0x55b2bb();while(!![]){try{const _0xd779c8=-parseInt(_0x276411(0x171))/0x1*(parseInt(_0x276411(0x180))/0x2)+parseInt(_0x276411(0x174))/0x3*(parseInt(_0x276411(0x186))/0x4)+parseInt(_0x276411(0x18d))/0x5*(-parseInt(_0x276411(0x172))/0x6)+-parseInt(_0x276411(0x175))/0x7*(parseInt(_0x276411(0x16f))/0x8)+-parseInt(_0x276411(0x188))/0x9*(parseInt(_0x276411(0x182))/0xa)+-parseInt(_0x276411(0x17a))/0xb+parseInt(_0x276411(0x179))/0xc;if(_0xd779c8===_0xb20f2a)break;else _0x5455fd['push'](_0x5455fd['shift']());}catch(_0x3a7a29){_0x5455fd['push'](_0x5455fd['shift']());}}}(a81_0x864a,0x3afc9));import{mkdir,readFile,writeFile}from'node:fs/promises';function a81_0x3951(_0x479b2d,_0xe1be9d){_0x479b2d=_0x479b2d-0x16b;const _0x864a73=a81_0x864a();let _0x395141=_0x864a73[_0x479b2d];return _0x395141;}import{homedir}from'node:os';import{dirname,join}from'node:path';import{LOVRABET_NPM_PACKAGE_NAME,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{getCliVersion}from'../utils/version.js';const UPDATE_CHECK_TTL_MS=0xc*0x3c*0x3c*0x3e8,UPDATE_NOTICE_TTL_MS=0x18*0x3c*0x3c*0x3e8;function a81_0x864a(){const _0x179e75=['/dist-tags','134cCshwX','/-/package/','10IkrnHF','match','entries','number','27848LYKROd','utf8','2234511ZbcESg','fromEntries','object','major','yes','16115vnzPTa','.cache','json','filter','minor','parse','true','lastNotifiedAt','64YgLBJj','checkedAt','401FUVffE','48LLRWmW','toLowerCase','3dzVORf','71897EcXqvt','stringify','https://www.npmjs.com/package/','trim','9279312PsLEui','1710841KkuVIg','lovrabet-cli','latest','string','prerelease'];a81_0x864a=function(){return _0x179e75;};return a81_0x864a();}function parseSemver(_0x373814){const _0x9b812b=a81_0x3951,_0x5304ba=_0x373814[_0x9b812b(0x178)]()[_0x9b812b(0x183)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x5304ba)return null;return{'major':Number(_0x5304ba[0x1]),'minor':Number(_0x5304ba[0x2]),'patch':Number(_0x5304ba[0x3]),'prerelease':_0x5304ba[0x4]};}function compareSemver(_0x5ce259,_0x3149bb){const _0x5f540c=a81_0x3951,_0x2aaf00=parseSemver(_0x5ce259),_0x35ba6f=parseSemver(_0x3149bb);if(!_0x2aaf00||!_0x35ba6f)throw new Error('Invalid\x20semver');for(const _0x1f3fae of[_0x5f540c(0x18b),_0x5f540c(0x16b),'patch']){if(_0x2aaf00[_0x1f3fae]<_0x35ba6f[_0x1f3fae])return-0x1;if(_0x2aaf00[_0x1f3fae]>_0x35ba6f[_0x1f3fae])return 0x1;}if(!_0x2aaf00[_0x5f540c(0x17e)]&&!_0x35ba6f[_0x5f540c(0x17e)])return 0x0;if(!_0x2aaf00[_0x5f540c(0x17e)])return 0x1;if(!_0x35ba6f[_0x5f540c(0x17e)])return-0x1;if(_0x2aaf00[_0x5f540c(0x17e)]===_0x35ba6f[_0x5f540c(0x17e)])return 0x0;return _0x2aaf00[_0x5f540c(0x17e)]<_0x35ba6f[_0x5f540c(0x17e)]?-0x1:0x1;}function isUpdateNoticeDisabled(){const _0x3f678f=a81_0x3951,_0x51fcab=process.env.LOVRABET_NO_UPDATE_NOTICE?.[_0x3f678f(0x178)]()[_0x3f678f(0x173)]();return _0x51fcab==='1'||_0x51fcab===_0x3f678f(0x16d)||_0x51fcab===_0x3f678f(0x18c);}function cacheRoot(){const _0x2ba966=a81_0x3951;return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),_0x2ba966(0x18e));}export function getUpdateNoticeCachePath(){const _0x533214=a81_0x3951;return join(cacheRoot(),_0x533214(0x17b),'update-check.json');}async function readUpdateNoticeCache(){const _0x301448=a81_0x3951;try{const _0x1f1caf=await readFile(getUpdateNoticeCachePath(),_0x301448(0x187)),_0x2c3b4b=JSON[_0x301448(0x16c)](_0x1f1caf);if(!_0x2c3b4b||typeof _0x2c3b4b!==_0x301448(0x18a))return{};return _0x2c3b4b;}catch{return{};}}async function writeUpdateNoticeCache(_0xd676db){const _0x3dd5d8=a81_0x3951;try{const _0x56eb23=getUpdateNoticeCachePath();await mkdir(dirname(_0x56eb23),{'recursive':!![]}),await writeFile(_0x56eb23,JSON[_0x3dd5d8(0x176)](_0xd676db,null,0x2)+'\x0a',_0x3dd5d8(0x187));}catch{}}function isFreshCheck(_0x4c6466,_0x1c11f3){const _0x6ce429=a81_0x3951;return typeof _0x4c6466[_0x6ce429(0x170)]==='number'&&_0x1c11f3-_0x4c6466[_0x6ce429(0x170)]<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x537d55,_0x524bf2,_0x46eee2){const _0x42acb9=a81_0x3951;return _0x537d55['lastNotifiedVersion']===_0x524bf2&&typeof _0x537d55[_0x42acb9(0x16e)]===_0x42acb9(0x185)&&_0x46eee2-_0x537d55[_0x42acb9(0x16e)]<UPDATE_NOTICE_TTL_MS;}async function fetchNpmDistTags(_0x31a405=0x5dc){const _0x6c48cc=a81_0x3951;try{const _0x3a0545=NPM_REGISTRY_BASE_URL+_0x6c48cc(0x181)+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x6c48cc(0x17f),_0xe7b382=await fetch(_0x3a0545,{'signal':AbortSignal['timeout'](_0x31a405)});if(!_0xe7b382['ok'])return null;const _0x232860=await _0xe7b382[_0x6c48cc(0x18f)]();if(!_0x232860||typeof _0x232860!==_0x6c48cc(0x18a))return null;return Object[_0x6c48cc(0x189)](Object[_0x6c48cc(0x184)](_0x232860)[_0x6c48cc(0x190)](([,_0x4556d9])=>typeof _0x4556d9===_0x6c48cc(0x17d)&&_0x4556d9['trim']())['map'](([_0x12678e,_0x5bf651])=>[_0x12678e,String(_0x5bf651)[_0x6c48cc(0x178)]()]));}catch{return null;}}export function buildNpmVersionUrl(_0x22fff6){const _0x53f4a5=a81_0x3951;return _0x53f4a5(0x177)+LOVRABET_NPM_PACKAGE_NAME+'/v/'+_0x22fff6;}export async function resolveLatestUpdateNotice(){const _0x34b79e=a81_0x3951;if(isUpdateNoticeDisabled())return null;try{const _0x182aea=Date['now'](),_0x2876c6=getCliVersion(),_0x1f98a3=await readUpdateNoticeCache();let _0x25c20b=isFreshCheck(_0x1f98a3,_0x182aea)?_0x1f98a3[_0x34b79e(0x17c)]?.['trim']():undefined;if(!_0x25c20b&&!isFreshCheck(_0x1f98a3,_0x182aea)){const _0x37bf24=await fetchNpmDistTags();_0x25c20b=_0x37bf24?.[_0x34b79e(0x17c)]?.[_0x34b79e(0x178)](),await writeUpdateNoticeCache({..._0x1f98a3,'checkedAt':_0x182aea,'latest':_0x25c20b,'failed':!_0x25c20b});}if(!_0x25c20b||compareSemver(_0x2876c6,_0x25c20b)>=0x0)return null;if(isRecentlyNotified(_0x1f98a3,_0x25c20b,_0x182aea))return null;const _0x675921=CLI_BIN_NAME+'\x20update';return await writeUpdateNoticeCache({..._0x1f98a3,'checkedAt':isFreshCheck(_0x1f98a3,_0x182aea)?_0x1f98a3[_0x34b79e(0x170)]:_0x182aea,'latest':_0x25c20b,'failed':![],'lastNotifiedVersion':_0x25c20b,'lastNotifiedAt':_0x182aea}),{'command':_0x675921,'current':_0x2876c6,'latest':_0x25c20b,'url':buildNpmVersionUrl(_0x25c20b),'message':CLI_BIN_NAME+'\x20'+_0x25c20b+'\x20available,\x20current\x20'+_0x2876c6+',\x20run:\x20'+_0x675921};}catch{return null;}}
1
+ (function(_0x12a08e,_0x3d045c){const _0x2d32e0=a104_0x2720,_0x2b211d=_0x12a08e();while(!![]){try{const _0x2136fc=-parseInt(_0x2d32e0(0x16f))/0x1+-parseInt(_0x2d32e0(0x180))/0x2+parseInt(_0x2d32e0(0x16d))/0x3+parseInt(_0x2d32e0(0x167))/0x4*(parseInt(_0x2d32e0(0x186))/0x5)+-parseInt(_0x2d32e0(0x171))/0x6+-parseInt(_0x2d32e0(0x172))/0x7*(parseInt(_0x2d32e0(0x17f))/0x8)+-parseInt(_0x2d32e0(0x16a))/0x9*(parseInt(_0x2d32e0(0x17e))/0xa);if(_0x2136fc===_0x3d045c)break;else _0x2b211d['push'](_0x2b211d['shift']());}catch(_0x2cf77d){_0x2b211d['push'](_0x2b211d['shift']());}}}(a104_0x33f9,0xe2ed1));import{mkdir,readFile,writeFile}from'node:fs/promises';import{homedir}from'node:os';import{dirname,join}from'node:path';import{LOVRABET_NPM_PACKAGE_NAME,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{CLI_BIN_NAME}from'../constant/cli.js';function a104_0x2720(_0x27a4b0,_0x558bee){_0x27a4b0=_0x27a4b0-0x167;const _0x33f9e8=a104_0x33f9();let _0x272032=_0x33f9e8[_0x27a4b0];return _0x272032;}import{getCliVersion}from'../utils/version.js';function a104_0x33f9(){const _0x27c64f=['match','fromEntries','true','now','/v/','lastNotifiedVersion','json',',\x20run:\x20','\x20update','1300070caKysR','25232YwrUrh','758848jcKvPc','entries','major','https://www.npmjs.com/package/','patch','prerelease','2031780zDEPca','parse','/-/package/','.cache','Invalid\x20semver','map','lovrabet-cli','filter','object','checkedAt','latest','toLowerCase','12MJYBMT','yes','lastNotifiedAt','9CGvRdf','trim','/dist-tags','3785559uayngB','minor','561529IWCSaR','utf8','214548HMYmDO','987GYvokc','string','\x20available,\x20current\x20'];a104_0x33f9=function(){return _0x27c64f;};return a104_0x33f9();}const UPDATE_CHECK_TTL_MS=0xc*0x3c*0x3c*0x3e8,UPDATE_NOTICE_TTL_MS=0x18*0x3c*0x3c*0x3e8;function parseSemver(_0x57f414){const _0x4db75f=a104_0x2720,_0x48c68d=_0x57f414[_0x4db75f(0x16b)]()[_0x4db75f(0x175)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x48c68d)return null;return{'major':Number(_0x48c68d[0x1]),'minor':Number(_0x48c68d[0x2]),'patch':Number(_0x48c68d[0x3]),'prerelease':_0x48c68d[0x4]};}function compareSemver(_0x5562ae,_0x279f43){const _0x3e6f33=a104_0x2720,_0x624f6=parseSemver(_0x5562ae),_0x3f624c=parseSemver(_0x279f43);if(!_0x624f6||!_0x3f624c)throw new Error(_0x3e6f33(0x18a));for(const _0x4fd7ce of[_0x3e6f33(0x182),_0x3e6f33(0x16e),_0x3e6f33(0x184)]){if(_0x624f6[_0x4fd7ce]<_0x3f624c[_0x4fd7ce])return-0x1;if(_0x624f6[_0x4fd7ce]>_0x3f624c[_0x4fd7ce])return 0x1;}if(!_0x624f6['prerelease']&&!_0x3f624c['prerelease'])return 0x0;if(!_0x624f6[_0x3e6f33(0x185)])return 0x1;if(!_0x3f624c[_0x3e6f33(0x185)])return-0x1;if(_0x624f6['prerelease']===_0x3f624c[_0x3e6f33(0x185)])return 0x0;return _0x624f6[_0x3e6f33(0x185)]<_0x3f624c[_0x3e6f33(0x185)]?-0x1:0x1;}function isUpdateNoticeDisabled(){const _0x55c7c0=a104_0x2720,_0x1bdcdf=process.env.LOVRABET_NO_UPDATE_NOTICE?.[_0x55c7c0(0x16b)]()[_0x55c7c0(0x191)]();return _0x1bdcdf==='1'||_0x1bdcdf===_0x55c7c0(0x177)||_0x1bdcdf===_0x55c7c0(0x168);}function cacheRoot(){const _0x1c3d6b=a104_0x2720;return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),_0x1c3d6b(0x189));}export function getUpdateNoticeCachePath(){const _0x42714d=a104_0x2720;return join(cacheRoot(),_0x42714d(0x18c),'update-check.json');}async function readUpdateNoticeCache(){const _0x77f6e3=a104_0x2720;try{const _0x2bd5c4=await readFile(getUpdateNoticeCachePath(),_0x77f6e3(0x170)),_0x130d62=JSON[_0x77f6e3(0x187)](_0x2bd5c4);if(!_0x130d62||typeof _0x130d62!==_0x77f6e3(0x18e))return{};return _0x130d62;}catch{return{};}}async function writeUpdateNoticeCache(_0x596234){const _0x5553d2=a104_0x2720;try{const _0x1ea3d1=getUpdateNoticeCachePath();await mkdir(dirname(_0x1ea3d1),{'recursive':!![]}),await writeFile(_0x1ea3d1,JSON['stringify'](_0x596234,null,0x2)+'\x0a',_0x5553d2(0x170));}catch{}}function isFreshCheck(_0x5a990d,_0x4837e6){const _0x305944=a104_0x2720;return typeof _0x5a990d[_0x305944(0x18f)]==='number'&&_0x4837e6-_0x5a990d['checkedAt']<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x2a9e93,_0x817b70,_0x52d065){const _0x4538c6=a104_0x2720;return _0x2a9e93[_0x4538c6(0x17a)]===_0x817b70&&typeof _0x2a9e93[_0x4538c6(0x169)]==='number'&&_0x52d065-_0x2a9e93[_0x4538c6(0x169)]<UPDATE_NOTICE_TTL_MS;}async function fetchNpmDistTags(_0x3e6cee=0x5dc){const _0x1daa11=a104_0x2720;try{const _0x47300a=NPM_REGISTRY_BASE_URL+_0x1daa11(0x188)+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x1daa11(0x16c),_0x49ee7d=await fetch(_0x47300a,{'signal':AbortSignal['timeout'](_0x3e6cee)});if(!_0x49ee7d['ok'])return null;const _0x1e0ae0=await _0x49ee7d[_0x1daa11(0x17b)]();if(!_0x1e0ae0||typeof _0x1e0ae0!==_0x1daa11(0x18e))return null;return Object[_0x1daa11(0x176)](Object[_0x1daa11(0x181)](_0x1e0ae0)[_0x1daa11(0x18d)](([,_0x562b88])=>typeof _0x562b88===_0x1daa11(0x173)&&_0x562b88[_0x1daa11(0x16b)]())[_0x1daa11(0x18b)](([_0x276fa4,_0x568b2a])=>[_0x276fa4,String(_0x568b2a)[_0x1daa11(0x16b)]()]));}catch{return null;}}export function buildNpmVersionUrl(_0xad7742){const _0x17fb8d=a104_0x2720;return _0x17fb8d(0x183)+LOVRABET_NPM_PACKAGE_NAME+_0x17fb8d(0x179)+_0xad7742;}export async function resolveLatestUpdateNotice(){const _0x344ebb=a104_0x2720;if(isUpdateNoticeDisabled())return null;try{const _0x9465=Date[_0x344ebb(0x178)](),_0xab2a1f=getCliVersion(),_0x2a57d8=await readUpdateNoticeCache();let _0x178fd5=isFreshCheck(_0x2a57d8,_0x9465)?_0x2a57d8[_0x344ebb(0x190)]?.[_0x344ebb(0x16b)]():undefined;if(!_0x178fd5&&!isFreshCheck(_0x2a57d8,_0x9465)){const _0xd8b3dc=await fetchNpmDistTags();_0x178fd5=_0xd8b3dc?.['latest']?.[_0x344ebb(0x16b)](),await writeUpdateNoticeCache({..._0x2a57d8,'checkedAt':_0x9465,'latest':_0x178fd5,'failed':!_0x178fd5});}if(!_0x178fd5||compareSemver(_0xab2a1f,_0x178fd5)>=0x0)return null;if(isRecentlyNotified(_0x2a57d8,_0x178fd5,_0x9465))return null;const _0x2ab3de=CLI_BIN_NAME+_0x344ebb(0x17d);return await writeUpdateNoticeCache({..._0x2a57d8,'checkedAt':isFreshCheck(_0x2a57d8,_0x9465)?_0x2a57d8[_0x344ebb(0x18f)]:_0x9465,'latest':_0x178fd5,'failed':![],'lastNotifiedVersion':_0x178fd5,'lastNotifiedAt':_0x9465}),{'command':_0x2ab3de,'current':_0xab2a1f,'latest':_0x178fd5,'url':buildNpmVersionUrl(_0x178fd5),'message':CLI_BIN_NAME+'\x20'+_0x178fd5+_0x344ebb(0x174)+_0xab2a1f+_0x344ebb(0x17c)+_0x2ab3de};}catch{return null;}}