@lovrabet/lovrabet-cli 2.1.2-beta.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x16ec13,_0x2680ae){const _0xa932c0=a68_0x134c,_0x17b860=_0x16ec13();while(!![]){try{const _0x56dca4=-parseInt(_0xa932c0(0xbe))/0x1*(-parseInt(_0xa932c0(0xc9))/0x2)+-parseInt(_0xa932c0(0xb9))/0x3+parseInt(_0xa932c0(0xbd))/0x4+-parseInt(_0xa932c0(0xbc))/0x5*(-parseInt(_0xa932c0(0xba))/0x6)+parseInt(_0xa932c0(0xb8))/0x7+-parseInt(_0xa932c0(0xc7))/0x8+-parseInt(_0xa932c0(0xc0))/0x9*(parseInt(_0xa932c0(0xbb))/0xa);if(_0x56dca4===_0x2680ae)break;else _0x17b860['push'](_0x17b860['shift']());}catch(_0x1a96fb){_0x17b860['push'](_0x17b860['shift']());}}}(a68_0x5a31,0x5709b));import{CLI_BIN_NAME}from'../constant/cli.js';export function buildConfirmationLines(_0x540e24,_0x86855a,_0x3f4df8){const _0x2b4441=a68_0x134c,_0x2349f3=buildConfirmationContext(_0x540e24,_0x86855a,_0x3f4df8),_0x31527a=['⚠\x20\x20High-risk\x20operation:\x20'+_0x2349f3[_0x2b4441(0xd1)]];return _0x2349f3[_0x2b4441(0xc3)]&&_0x31527a[_0x2b4441(0xbf)](_0x2b4441(0xd2)+_0x2349f3[_0x2b4441(0xc3)]),_0x2349f3[_0x2b4441(0xce)]&&_0x31527a[_0x2b4441(0xbf)](_0x2b4441(0xcd)+_0x2349f3[_0x2b4441(0xce)]),_0x31527a[_0x2b4441(0xbf)](_0x2b4441(0xcf)),_0x31527a;}function a68_0x134c(_0x5e61f9,_0xa3f3bb){_0x5e61f9=_0x5e61f9-0xb7;const _0x5a31bc=a68_0x5a31();let _0x134cdb=_0x5a31bc[_0x5e61f9];return _0x134cdb;}export function reconstructCommandArgv(_0x45a7ea,_0x33d610){const _0x3943ae=a68_0x134c,_0xb854b3=[CLI_BIN_NAME,_0x45a7ea[_0x3943ae(0xcb)],_0x45a7ea[_0x3943ae(0xc6)]];for(const [_0x2fc903,_0x2b6777]of Object['entries'](_0x33d610)){if(_0x2b6777===!![])_0xb854b3[_0x3943ae(0xbf)]('--'+_0x2fc903);else _0x2b6777!==![]&&_0x2b6777!==undefined&&_0x2b6777!==''&&_0xb854b3[_0x3943ae(0xbf)]('--'+_0x2fc903+'\x20'+JSON[_0x3943ae(0xcc)](_0x2b6777));}return _0xb854b3[_0x3943ae(0xbf)]('--yes'),_0xb854b3[_0x3943ae(0xd0)]('\x20');}function a68_0x5a31(){const _0x260e8b=['109SrUxuR','push','1088307LJbrZL','id=','code=','description','params','code','command','4519360kyRNmY','name','8226NpcXKc','name=','service','stringify','\x20\x20\x20Affected:\x20','affectedRecords','\x20\x20\x20Continue?\x20[y/N]\x20','join','commandLabel','\x20\x20\x20','length','1761655HXeApx','957999RgpVvp','61914EAbYMD','10JrNVPa','5nCDMwC','2605528SsIEtO'];a68_0x5a31=function(){return _0x260e8b;};return a68_0x5a31();}function buildConfirmationContext(_0x43da21,_0x3869e4,_0x2a6cd9){const _0x528af4=extractAffectedRecords(_0x2a6cd9);return{'commandLabel':_0x3869e4,'description':_0x43da21['description'],'affectedRecords':_0x528af4};}function extractAffectedRecords(_0x191fe4){const _0x3936c6=a68_0x134c,_0x54ef91=[];if(_0x191fe4[_0x3936c6(0xc5)])_0x54ef91['push'](_0x3936c6(0xc2)+_0x191fe4['code']);if(_0x191fe4['id'])_0x54ef91[_0x3936c6(0xbf)](_0x3936c6(0xc1)+_0x191fe4['id']);if(_0x191fe4[_0x3936c6(0xc8)])_0x54ef91[_0x3936c6(0xbf)](_0x3936c6(0xca)+_0x191fe4[_0x3936c6(0xc8)]);if(_0x191fe4[_0x3936c6(0xc4)])_0x54ef91['push']('params='+_0x191fe4[_0x3936c6(0xc4)]);return _0x54ef91[_0x3936c6(0xb7)]>0x0?_0x54ef91['join'](',\x20'):undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x10bd99,_0x1a5593){const _0x33070c=a69_0x43f0,_0x57c6f8=_0x10bd99();while(!![]){try{const _0x4e4d7b=parseInt(_0x33070c(0xff))/0x1+-parseInt(_0x33070c(0x105))/0x2+-parseInt(_0x33070c(0xf8))/0x3+parseInt(_0x33070c(0xfc))/0x4+parseInt(_0x33070c(0xf9))/0x5+-parseInt(_0x33070c(0xfe))/0x6*(parseInt(_0x33070c(0xfb))/0x7)+parseInt(_0x33070c(0x101))/0x8*(-parseInt(_0x33070c(0x104))/0x9);if(_0x4e4d7b===_0x1a5593)break;else _0x57c6f8['push'](_0x57c6f8['shift']());}catch(_0x4540e5){_0x57c6f8['push'](_0x57c6f8['shift']());}}}(a69_0x21bf,0x50b58));function a69_0x21bf(){const _0x555a2b=['128992SvPTgA','222987igNvAt','1747465kXGLct','string','12089agpBFa','1482296sCJjlj','trim','444KfRxoZ','161434FeAFEU','description','16OityVO','message','stringify','1279323uPMcia'];a69_0x21bf=function(){return _0x555a2b;};return a69_0x21bf();}import{LovrabetError}from'@lovrabet/sdk';function a69_0x43f0(_0x349c19,_0x5d223f){_0x349c19=_0x349c19-0xf8;const _0x21bf90=a69_0x21bf();let _0x43f0e2=_0x21bf90[_0x349c19];return _0x43f0e2;}import{CliErrors}from'../errors.js';export function mapUserFacingExecuteError(_0xe0e409){if(_0xe0e409 instanceof LovrabetError)return CliErrors['validation'](userFacingLovrabetMessage(_0xe0e409));return _0xe0e409;}function userFacingLovrabetMessage(_0x1dbc64){const _0x2a8ea0=a69_0x43f0,_0x570668=_0x1dbc64[_0x2a8ea0(0x100)];if(_0x570668!==undefined&&_0x570668!==null){if(typeof _0x570668===_0x2a8ea0(0xfa)&&_0x570668[_0x2a8ea0(0xfd)]())return _0x570668[_0x2a8ea0(0xfd)]();try{return JSON[_0x2a8ea0(0x103)](_0x570668);}catch{}}return _0x1dbc64[_0x2a8ea0(0x102)];}
|
package/lib/framework/runner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a70_0x41961a=a70_0x32c7;(function(_0x2082cf,_0x4f570e){const _0x474e8d=a70_0x32c7,_0x305d30=_0x2082cf();while(!![]){try{const _0x59dd28=-parseInt(_0x474e8d(0xe0))/0x1+parseInt(_0x474e8d(0xf1))/0x2+-parseInt(_0x474e8d(0xf0))/0x3*(parseInt(_0x474e8d(0xd3))/0x4)+-parseInt(_0x474e8d(0xf4))/0x5+parseInt(_0x474e8d(0xfb))/0x6+-parseInt(_0x474e8d(0x101))/0x7+parseInt(_0x474e8d(0xff))/0x8;if(_0x59dd28===_0x4f570e)break;else _0x305d30['push'](_0x305d30['shift']());}catch(_0x569c8d){_0x305d30['push'](_0x305d30['shift']());}}}(a70_0x357a,0xb3091));import{runCommandWithAdapter,requireConfirmationPrompt}from'@lovrabet/cli-framework';import{formatOutput}from'../framework/output.js';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME,GLOBAL_FLAGS,PIPELINE_FLAG_NAMES}from'../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../constant/product.js';import{isNonInteractiveMode,readAppCodeFromConfig}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{getApiDomain}from'../constant/domain.js';import{buildConfirmationLines,reconstructCommandArgv}from'../framework/runner-confirmation.js';import{mapUserFacingExecuteError}from'../framework/runner-error.js';import{resolveLatestUpdateNotice}from'../utils/update-notice.js';import{findAppByCode,findAppByName,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../commands/app/eligibility.js';export function resolveAuthMode(_0xd66002){const _0x3f8004=a70_0x32c7;return void _0xd66002,AUTH_MODE[_0x3f8004(0x100)];}export function createPipelineEnv(_0x4f370f,_0x28ef8c){const _0x201ca3=a70_0x32c7,_0x4c4a91=typeof _0x28ef8c[_0x201ca3(0xec)]===_0x201ca3(0xdc)&&_0x28ef8c[_0x201ca3(0xec)]['trim']();return{'rawFlags':_0x28ef8c,'appCode':_0x4f370f[_0x201ca3(0xd7)]||productEnv(_0x201ca3(0xdf))||(_0x4c4a91?undefined:readAppCodeFromConfig()),'appCodeSource':_0x4f370f[_0x201ca3(0xd4)],'apiDomain':getApiDomain(),'isNonInteractive':isNonInteractiveMode(_0x28ef8c),'defaultFormat':_0x4f370f[_0x201ca3(0xe1)],'defaultPageSize':_0x4f370f['pageSize'],'defaultVerbose':_0x4f370f['verbose'],'riskLevel':_0x4f370f['riskLevel'],'accessKey':_0x4f370f[_0x201ca3(0xf7)],'env':_0x4f370f[_0x201ca3(0xcc)],'mergedCli':{'defaultApp':_0x4f370f[_0x201ca3(0xf2)],'currentApp':_0x4f370f[_0x201ca3(0xe8)],'appCode':_0x4f370f[_0x201ca3(0xd7)]}};}const runnerAdapter={'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS[a70_0x41961a(0xc9)](_0x2a039a=>PIPELINE_FLAG_NAMES[a70_0x41961a(0xf5)](_0x2a039a['name']))[a70_0x41961a(0xe5)](({name:_0x214e07,type:_0x4f4961,description:_0xa90073})=>({'name':_0x214e07,'type':_0x4f4961,'description':_0xa90073})),'formatOutput':formatOutput,'getCommandLabel'(_0x53707c){const _0x2ea2a1=a70_0x41961a;return CLI_BIN_NAME+'\x20'+_0x53707c[_0x2ea2a1(0xf8)]+'\x20'+_0x53707c[_0x2ea2a1(0xda)];},'riskPolicy':{'onViolation'(_0x9f02c8){console['error'](_0x9f02c8);},'createError'(_0x514d13){const _0x5d0b82=a70_0x41961a;return CliErrors[_0x5d0b82(0xee)](_0x514d13);}},async 'prepare'(_0xe3ef4e,_0x59e8b3){const _0x22ab77=a70_0x41961a,_0x3105f1=resolveAuthMode(_0x59e8b3);if(_0xe3ef4e[_0x22ab77(0xdd)]!==![]){if(!_0x59e8b3['accessKey'])throw CliErrors['authRequired'](_0x22ab77(0xe2)+PRODUCT_CONFIG['newConfigFileName']+_0x22ab77(0xe6)+productEnvName('ACCESS_KEY')+'.');const {setActiveAK:_0x1af36a}=await import('../core/api-client.js');_0x1af36a(_0x59e8b3[_0x22ab77(0xf7)]);}let _0x4cbe8f='';if(_0xe3ef4e[_0x22ab77(0xeb)]!==![]){_0x4cbe8f=_0x59e8b3[_0x22ab77(0xd7)]??'',_0x4cbe8f=await resolveExplicitAppName(_0xe3ef4e,_0x59e8b3,_0x4cbe8f);if(!_0x4cbe8f){await assertSelectedAppNameIsRuntimeAccessible(_0xe3ef4e,_0x59e8b3);throw CliErrors[_0x22ab77(0xd2)]('Set\x20appcode\x20via\x20--appcode\x20or\x20in\x20'+PRODUCT_CONFIG[_0x22ab77(0xef)]+'.');}await assertAppCodeIsRuntimeAccessible(_0xe3ef4e,_0x59e8b3,_0x4cbe8f);}if(_0x4cbe8f){const {initSdkClient:_0x564b58}=await import(_0x22ab77(0xea));_0x564b58({'appCode':_0x4cbe8f,'env':_0x59e8b3['env']??'production','accessKey':_0x59e8b3[_0x22ab77(0xf7)],'authMode':_0x3105f1});}return{'defaults':{'booleans':{'verbose':_0x59e8b3[_0x22ab77(0xd0)]},'numbers':{'pagesize':_0x59e8b3[_0x22ab77(0xdb)]}},'extras':{'appCode':_0x4cbe8f,'cookie':'','apiDomain':_0x59e8b3['apiDomain'],'apiDir':'','accessKey':_0x59e8b3[_0x22ab77(0xf7)],'envName':_0x59e8b3[_0x22ab77(0xcc)],'mergedCli':_0x59e8b3[_0x22ab77(0xcf)]}};},async 'confirmHighRisk'({def:_0x472aef,env:_0x2283b0,flags:_0xbcd7cd,commandLabel:_0x3f8187}){const _0x1e484c=a70_0x41961a;if(_0x2283b0[_0x1e484c(0xcd)]){const _0x52d68a=reconstructCommandArgv(_0x472aef,_0xbcd7cd);throw CliErrors['validation']('High-risk\x20operation\x20`'+_0x3f8187+_0x1e484c(0xe9)+(_0x1e484c(0xf9)+_0x52d68a));}await requireConfirmationPrompt({'lines':buildConfirmationLines(_0x472aef,_0x3f8187,_0xbcd7cd),'createCancelledError':_0x6461bc=>CliErrors[_0x1e484c(0xee)](_0x6461bc)});},'mapDryRunError'(_0x230b3e){return mapUserFacingExecuteError(_0x230b3e);},'mapExecuteError'(_0xd9bfa1){return mapUserFacingExecuteError(_0xd9bfa1);},async 'finalize'(){const _0x54ed4e=a70_0x41961a,{clearActiveAK:_0x2aab67}=await import(_0x54ed4e(0xd1));_0x2aab67();}};async function resolveExplicitAppName(_0x81e819,_0x5af1fd,_0x5211d6){const _0x253ca1=a70_0x41961a;if(_0x81e819[_0x253ca1(0xeb)]===![])return _0x5211d6;const _0x5d80ac=typeof _0x5af1fd[_0x253ca1(0xfd)][_0x253ca1(0xec)]===_0x253ca1(0xdc)?_0x5af1fd[_0x253ca1(0xfd)][_0x253ca1(0xec)][_0x253ca1(0xce)]():'';if(!_0x5d80ac)return _0x5211d6;const _0xc0b63c=typeof _0x5af1fd['rawFlags']['appcode']===_0x253ca1(0xdc)&&_0x5af1fd[_0x253ca1(0xfd)][_0x253ca1(0xd8)][_0x253ca1(0xce)]()||productEnv(_0x253ca1(0xdf));if(_0xc0b63c||_0x5af1fd['appCodeSource']==='local-alias')return _0x5211d6;const {getRemoteAppList:_0x42d0d8}=await import(_0x253ca1(0xd6)),_0x3f68f8=await _0x42d0d8({'env':_0x5af1fd[_0x253ca1(0xcc)]??'production','accessKey':_0x5af1fd[_0x253ca1(0xf7)]}),_0x54dbaf=findAppByName(_0x3f68f8[_0x253ca1(0xde)],_0x5d80ac);if(_0x54dbaf&&!isRuntimeAccessibleApp(_0x54dbaf))throw runtimeInaccessibleAppError(_0x54dbaf,'\x22'+_0x5d80ac+'\x22');const _0x12a795=_0x54dbaf?.[_0x253ca1(0xd7)]?.[_0x253ca1(0xce)]();if(_0x12a795)return _0x12a795;throw CliErrors['validation'](_0x253ca1(0xc8)+_0x5d80ac,'Run\x20`'+CLI_BIN_NAME+_0x253ca1(0xf6)+_0x5d80ac+_0x253ca1(0xf3)+PRODUCT_CONFIG[_0x253ca1(0xef)]+'.');}async function assertSelectedAppNameIsRuntimeAccessible(_0x370100,_0x2e8259){const _0x22cf58=a70_0x41961a;if(_0x370100['requiresAppCode']===![]||!_0x2e8259[_0x22cf58(0xf7)])return;const _0xcbcabb=(typeof _0x2e8259[_0x22cf58(0xfd)][_0x22cf58(0xec)]===_0x22cf58(0xdc)&&_0x2e8259['rawFlags'][_0x22cf58(0xec)]['trim']()?_0x2e8259[_0x22cf58(0xfd)][_0x22cf58(0xec)]:_0x2e8259[_0x22cf58(0xcf)]?.[_0x22cf58(0xe8)]??_0x2e8259[_0x22cf58(0xcf)]?.[_0x22cf58(0xf2)])?.[_0x22cf58(0xce)]();if(!_0xcbcabb)return;const {getRemoteAppList:_0x1e6366}=await import('../commands/app/remote-source.js'),_0x564b22=await _0x1e6366({'env':_0x2e8259['env']??'production','accessKey':_0x2e8259['accessKey']}),_0x4efcad=findAppByName(_0x564b22['items'],_0xcbcabb);if(_0x4efcad&&!isRuntimeAccessibleApp(_0x4efcad))throw runtimeInaccessibleAppError(_0x4efcad,'\x22'+_0xcbcabb+'\x22');}async function assertAppCodeIsRuntimeAccessible(_0x2e308e,_0x446ec5,_0x3de92c){const _0x9bf2ac=a70_0x41961a;if(_0x2e308e['requiresAppCode']===![]||!_0x446ec5[_0x9bf2ac(0xf7)])return;const {getRemoteAppList:_0xdfc6dd}=await import('../commands/app/remote-source.js'),_0x2d542f=await _0xdfc6dd({'env':_0x446ec5[_0x9bf2ac(0xcc)]??_0x9bf2ac(0xd5),'accessKey':_0x446ec5[_0x9bf2ac(0xf7)]}),_0x2899f7=findAppByCode(_0x2d542f[_0x9bf2ac(0xde)],_0x3de92c);if(_0x2899f7&&!isRuntimeAccessibleApp(_0x2899f7))throw runtimeInaccessibleAppError(_0x2899f7,'appcode\x20\x22'+_0x3de92c+'\x22');}export async function runCommand(_0x1705c4,_0x16b682){await runCommandWithAdapter(shouldAttachUpdateNotice(_0x1705c4)?withUpdateNotice(_0x1705c4):_0x1705c4,_0x16b682,runnerAdapter);}function a70_0x32c7(_0x4c0050,_0x2827e9){_0x4c0050=_0x4c0050-0xc7;const _0x357a47=a70_0x357a();let _0x32c76f=_0x357a47[_0x4c0050];return _0x32c76f;}function shouldAttachUpdateNotice(_0x47cd4c){const _0x301bda=a70_0x41961a;return![_0x301bda(0xfc),_0x301bda(0xe4),_0x301bda(0xe3)][_0x301bda(0xe7)](_0x47cd4c[_0x301bda(0xf8)]);}function withUpdateNotice(_0x6f1f57){return{..._0x6f1f57,async 'execute'(_0x442ca5){const _0x53cce8=a70_0x32c7,_0x3e10af=shouldResolveUpdateNotice(_0x442ca5)?resolveLatestUpdateNotice()[_0x53cce8(0xed)](()=>null):Promise[_0x53cce8(0xd9)](null),_0x111f5c=await _0x6f1f57[_0x53cce8(0xcb)](_0x442ca5);return attachUpdateNotice(_0x111f5c,await _0x3e10af);}};}function a70_0x357a(){const _0x4977df=['newConfigFileName','21rSFdNc','2863210SVmtYk','defaultApp','.appcode\x20to\x20','1405060CzGvCv','has','\x20app\x20list\x20--no-cache`\x20to\x20refresh\x20available\x20apps,\x20or\x20add\x20apps.','accessKey','service','\x20\x20To\x20proceed:\x20','_notice','130668fCDUGV','update','rawFlags','nonInteractive','27273128aYUYkh','ClientAk','9566039RgaTxD','pretty','Unknown\x20app:\x20','filter','object','execute','env','isNonInteractive','trim','mergedCli','defaultVerbose','../core/api-client.js','configMissing','801476WdQoQh','appCodeSource','production','../commands/app/remote-source.js','appCode','appcode','resolve','command','defaultPageSize','string','requiresAuth','items','APPCODE','1079023KotJRp','format','Set\x20accessKey\x20in\x20','doctor','schema','map','\x20or\x20pass\x20','includes','currentApp','`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.\x0a','../core/sdk-client.js','requiresAppCode','app','catch','cancelled'];a70_0x357a=function(){return _0x4977df;};return a70_0x357a();}function shouldResolveUpdateNotice(_0x584f37){const _0x3d55bc=a70_0x41961a;return _0x584f37['format']===_0x3d55bc(0xc7)&&!_0x584f37[_0x3d55bc(0xfe)];}function attachUpdateNotice(_0x37c5b7,_0x5398eb){const _0x1d9b8c=a70_0x41961a;if(!_0x5398eb||!_0x37c5b7||typeof _0x37c5b7!==_0x1d9b8c(0xca))return _0x37c5b7;const _0x57f66a=_0x37c5b7,_0x107f4a=typeof _0x57f66a[_0x1d9b8c(0xfa)]===_0x1d9b8c(0xca)&&_0x57f66a[_0x1d9b8c(0xfa)]!==null?_0x57f66a[_0x1d9b8c(0xfa)]:{};return{..._0x57f66a,'_notice':{..._0x107f4a,'update':_0x5398eb}};}
|
|
1
|
+
const a70_0x255ede=a70_0x5d80;(function(_0x110126,_0x4cec4e){const _0x3404ff=a70_0x5d80,_0x2dfa8c=_0x110126();while(!![]){try{const _0x40c971=parseInt(_0x3404ff(0x196))/0x1*(parseInt(_0x3404ff(0x1a0))/0x2)+parseInt(_0x3404ff(0x188))/0x3*(-parseInt(_0x3404ff(0x195))/0x4)+parseInt(_0x3404ff(0x1b6))/0x5+-parseInt(_0x3404ff(0x198))/0x6+-parseInt(_0x3404ff(0x18a))/0x7+parseInt(_0x3404ff(0x19d))/0x8+parseInt(_0x3404ff(0x17f))/0x9;if(_0x40c971===_0x4cec4e)break;else _0x2dfa8c['push'](_0x2dfa8c['shift']());}catch(_0x92af10){_0x2dfa8c['push'](_0x2dfa8c['shift']());}}}(a70_0x19f9,0xb0038));import{runCommandWithAdapter,requireConfirmationPrompt}from'@lovrabet/cli-framework';function a70_0x5d80(_0xa5fbb7,_0x27bd90){_0xa5fbb7=_0xa5fbb7-0x17e;const _0x19f9d7=a70_0x19f9();let _0x5d80b7=_0x19f9d7[_0xa5fbb7];return _0x5d80b7;}import{formatOutput}from'../framework/output.js';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME,GLOBAL_FLAGS,PIPELINE_FLAG_NAMES}from'../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../constant/product.js';import{isNonInteractiveMode,readAppCodeFromConfig}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{getApiDomain}from'../constant/domain.js';import{buildConfirmationLines,reconstructCommandArgv}from'../framework/runner-confirmation.js';import{mapUserFacingExecuteError}from'../framework/runner-error.js';import{resolveLatestUpdateNotice}from'../utils/update-notice.js';import{findAppByCode,findAppByName,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../commands/app/eligibility.js';function a70_0x19f9(){const _0x4e2366=['../commands/app/remote-source.js','755085JzKsfD','APPCODE','error','requiresAppCode','format','accessKey','apiDomain','../core/api-client.js','map','5174091bPeKiT','`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.\x0a','Set\x20appcode\x20via\x20--appcode\x20or\x20in\x20','newConfigFileName','cancelled','production','currentApp','nonInteractive','appCode','15AyuccM','update','2364915HPyHvP','mergedCli','filter','schema','pretty','name','.appcode\x20to\x20','has','catch','appcode','\x20app\x20list\x20--no-cache`\x20to\x20refresh\x20available\x20apps,\x20or\x20add\x20apps.','356620YZNCkE','44207yXcSVW','local-alias','2770188fNqZUQ','service','execute','defaultPageSize','app','374120ZgbPwX','validation','trim','54PhtYhF','string','env','pageSize','defaultApp','includes','_notice','High-risk\x20operation\x20`','requiresAuth','rawFlags','appcode\x20\x22','object','Set\x20accessKey\x20in\x20','configMissing','command','items','\x20\x20To\x20proceed:\x20','Unknown\x20app:\x20','riskLevel','authRequired','ACCESS_KEY'];a70_0x19f9=function(){return _0x4e2366;};return a70_0x19f9();}export function resolveAuthMode(_0x1b938c){return void _0x1b938c,AUTH_MODE['ClientAk'];}export function createPipelineEnv(_0x22a08d,_0x492cb4){const _0x2662f5=a70_0x5d80,_0x39237a=typeof _0x492cb4[_0x2662f5(0x19c)]===_0x2662f5(0x1a1)&&_0x492cb4[_0x2662f5(0x19c)][_0x2662f5(0x19f)]();return{'rawFlags':_0x492cb4,'appCode':_0x22a08d[_0x2662f5(0x187)]||productEnv('APPCODE')||(_0x39237a?undefined:readAppCodeFromConfig()),'appCodeSource':_0x22a08d['appCodeSource'],'apiDomain':getApiDomain(),'isNonInteractive':isNonInteractiveMode(_0x492cb4),'defaultFormat':_0x22a08d[_0x2662f5(0x1ba)],'defaultPageSize':_0x22a08d[_0x2662f5(0x1a3)],'defaultVerbose':_0x22a08d['verbose'],'riskLevel':_0x22a08d[_0x2662f5(0x1b2)],'accessKey':_0x22a08d[_0x2662f5(0x1bb)],'env':_0x22a08d['env'],'mergedCli':{'defaultApp':_0x22a08d[_0x2662f5(0x1a4)],'currentApp':_0x22a08d['currentApp'],'appCode':_0x22a08d[_0x2662f5(0x187)]}};}const runnerAdapter={'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS[a70_0x255ede(0x18c)](_0x565641=>PIPELINE_FLAG_NAMES[a70_0x255ede(0x191)](_0x565641[a70_0x255ede(0x18f)]))[a70_0x255ede(0x17e)](({name:_0x4d4060,type:_0x4856a2,description:_0x339698})=>({'name':_0x4d4060,'type':_0x4856a2,'description':_0x339698})),'formatOutput':formatOutput,'getCommandLabel'(_0x2b5b44){const _0x593e6e=a70_0x255ede;return CLI_BIN_NAME+'\x20'+_0x2b5b44[_0x593e6e(0x199)]+'\x20'+_0x2b5b44[_0x593e6e(0x1ae)];},'riskPolicy':{'onViolation'(_0x313f55){const _0x1b87ad=a70_0x255ede;console[_0x1b87ad(0x1b8)](_0x313f55);},'createError'(_0x17b2e7){return CliErrors['cancelled'](_0x17b2e7);}},async 'prepare'(_0x20fdd4,_0x2e3216){const _0x2d5f90=a70_0x255ede,_0x15c3ec=resolveAuthMode(_0x2e3216);if(_0x20fdd4[_0x2d5f90(0x1a8)]!==![]){if(!_0x2e3216['accessKey'])throw CliErrors[_0x2d5f90(0x1b3)](_0x2d5f90(0x1ac)+PRODUCT_CONFIG['newConfigFileName']+'\x20or\x20pass\x20'+productEnvName(_0x2d5f90(0x1b4))+'.');const {setActiveAK:_0x451606}=await import(_0x2d5f90(0x1bd));_0x451606(_0x2e3216[_0x2d5f90(0x1bb)]);}let _0xf3bca8='';if(_0x20fdd4[_0x2d5f90(0x1b9)]!==![]){_0xf3bca8=_0x2e3216['appCode']??'',_0xf3bca8=await resolveExplicitAppName(_0x20fdd4,_0x2e3216,_0xf3bca8);if(!_0xf3bca8){await assertSelectedAppNameIsRuntimeAccessible(_0x20fdd4,_0x2e3216);throw CliErrors[_0x2d5f90(0x1ad)](_0x2d5f90(0x181)+PRODUCT_CONFIG[_0x2d5f90(0x182)]+'.');}await assertAppCodeIsRuntimeAccessible(_0x20fdd4,_0x2e3216,_0xf3bca8);}if(_0xf3bca8){const {initSdkClient:_0x4ffc8e}=await import('../core/sdk-client.js');_0x4ffc8e({'appCode':_0xf3bca8,'env':_0x2e3216[_0x2d5f90(0x1a2)]??_0x2d5f90(0x184),'accessKey':_0x2e3216[_0x2d5f90(0x1bb)],'authMode':_0x15c3ec});}return{'defaults':{'booleans':{'verbose':_0x2e3216['defaultVerbose']},'numbers':{'pagesize':_0x2e3216[_0x2d5f90(0x19b)]}},'extras':{'appCode':_0xf3bca8,'cookie':'','apiDomain':_0x2e3216[_0x2d5f90(0x1bc)],'apiDir':'','accessKey':_0x2e3216['accessKey'],'envName':_0x2e3216[_0x2d5f90(0x1a2)],'mergedCli':_0x2e3216[_0x2d5f90(0x18b)]}};},async 'confirmHighRisk'({def:_0x532cfe,env:_0x495345,flags:_0x2191a3,commandLabel:_0x3876ac}){const _0x2d5871=a70_0x255ede;if(_0x495345['isNonInteractive']){const _0x4bf07d=reconstructCommandArgv(_0x532cfe,_0x2191a3);throw CliErrors[_0x2d5871(0x19e)](_0x2d5871(0x1a7)+_0x3876ac+_0x2d5871(0x180)+(_0x2d5871(0x1b0)+_0x4bf07d));}await requireConfirmationPrompt({'lines':buildConfirmationLines(_0x532cfe,_0x3876ac,_0x2191a3),'createCancelledError':_0x5d9c5b=>CliErrors[_0x2d5871(0x183)](_0x5d9c5b)});},'mapDryRunError'(_0x5c90c8){return mapUserFacingExecuteError(_0x5c90c8);},'mapExecuteError'(_0x5e44ed){return mapUserFacingExecuteError(_0x5e44ed);},async 'finalize'(){const {clearActiveAK:_0x22c47e}=await import('../core/api-client.js');_0x22c47e();}};async function resolveExplicitAppName(_0x521c62,_0x3ae8b9,_0x490518){const _0x25bc3b=a70_0x255ede;if(_0x521c62[_0x25bc3b(0x1b9)]===![])return _0x490518;const _0x2e2a52=typeof _0x3ae8b9[_0x25bc3b(0x1a9)][_0x25bc3b(0x19c)]==='string'?_0x3ae8b9[_0x25bc3b(0x1a9)][_0x25bc3b(0x19c)]['trim']():'';if(!_0x2e2a52)return _0x490518;const _0x189c67=typeof _0x3ae8b9[_0x25bc3b(0x1a9)][_0x25bc3b(0x193)]===_0x25bc3b(0x1a1)&&_0x3ae8b9[_0x25bc3b(0x1a9)][_0x25bc3b(0x193)][_0x25bc3b(0x19f)]()||productEnv(_0x25bc3b(0x1b7));if(_0x189c67||_0x3ae8b9['appCodeSource']===_0x25bc3b(0x197))return _0x490518;const {getRemoteAppList:_0x4ba4dd}=await import(_0x25bc3b(0x1b5)),_0x96536f=await _0x4ba4dd({'env':_0x3ae8b9[_0x25bc3b(0x1a2)]??'production','accessKey':_0x3ae8b9[_0x25bc3b(0x1bb)]}),_0x39539f=findAppByName(_0x96536f[_0x25bc3b(0x1af)],_0x2e2a52);if(_0x39539f&&!isRuntimeAccessibleApp(_0x39539f))throw runtimeInaccessibleAppError(_0x39539f,'\x22'+_0x2e2a52+'\x22');const _0x13de07=_0x39539f?.[_0x25bc3b(0x187)]?.['trim']();if(_0x13de07)return _0x13de07;throw CliErrors[_0x25bc3b(0x19e)](_0x25bc3b(0x1b1)+_0x2e2a52,'Run\x20`'+CLI_BIN_NAME+_0x25bc3b(0x194)+_0x2e2a52+_0x25bc3b(0x190)+PRODUCT_CONFIG['newConfigFileName']+'.');}async function assertSelectedAppNameIsRuntimeAccessible(_0x438dda,_0x1e86ef){const _0x3c5edc=a70_0x255ede;if(_0x438dda[_0x3c5edc(0x1b9)]===![]||!_0x1e86ef[_0x3c5edc(0x1bb)])return;const _0xbb0c5a=(typeof _0x1e86ef[_0x3c5edc(0x1a9)][_0x3c5edc(0x19c)]===_0x3c5edc(0x1a1)&&_0x1e86ef[_0x3c5edc(0x1a9)][_0x3c5edc(0x19c)][_0x3c5edc(0x19f)]()?_0x1e86ef[_0x3c5edc(0x1a9)][_0x3c5edc(0x19c)]:_0x1e86ef[_0x3c5edc(0x18b)]?.[_0x3c5edc(0x185)]??_0x1e86ef[_0x3c5edc(0x18b)]?.[_0x3c5edc(0x1a4)])?.['trim']();if(!_0xbb0c5a)return;const {getRemoteAppList:_0x29239b}=await import('../commands/app/remote-source.js'),_0x4ab1c1=await _0x29239b({'env':_0x1e86ef['env']??'production','accessKey':_0x1e86ef[_0x3c5edc(0x1bb)]}),_0x1748ed=findAppByName(_0x4ab1c1[_0x3c5edc(0x1af)],_0xbb0c5a);if(_0x1748ed&&!isRuntimeAccessibleApp(_0x1748ed))throw runtimeInaccessibleAppError(_0x1748ed,'\x22'+_0xbb0c5a+'\x22');}async function assertAppCodeIsRuntimeAccessible(_0x5bd68e,_0x18484d,_0xb611c0){const _0x276538=a70_0x255ede;if(_0x5bd68e[_0x276538(0x1b9)]===![]||!_0x18484d['accessKey'])return;const {getRemoteAppList:_0xa65335}=await import(_0x276538(0x1b5)),_0x15c03e=await _0xa65335({'env':_0x18484d[_0x276538(0x1a2)]??_0x276538(0x184),'accessKey':_0x18484d[_0x276538(0x1bb)]}),_0x4d2fde=findAppByCode(_0x15c03e['items'],_0xb611c0);if(_0x4d2fde&&!isRuntimeAccessibleApp(_0x4d2fde))throw runtimeInaccessibleAppError(_0x4d2fde,_0x276538(0x1aa)+_0xb611c0+'\x22');}export async function runCommand(_0x505c7a,_0x220925){await runCommandWithAdapter(shouldAttachUpdateNotice(_0x505c7a)?withUpdateNotice(_0x505c7a):_0x505c7a,_0x220925,runnerAdapter);}function shouldAttachUpdateNotice(_0x446074){const _0x546923=a70_0x255ede;return![_0x546923(0x189),_0x546923(0x18d),'doctor'][_0x546923(0x1a5)](_0x446074[_0x546923(0x199)]);}function withUpdateNotice(_0x2d5ef3){return{..._0x2d5ef3,async 'execute'(_0xc7d3f9){const _0x4e9146=a70_0x5d80,_0x1d8f00=shouldResolveUpdateNotice(_0xc7d3f9)?resolveLatestUpdateNotice()[_0x4e9146(0x192)](()=>null):Promise['resolve'](null),_0x3dab1e=await _0x2d5ef3[_0x4e9146(0x19a)](_0xc7d3f9);return attachUpdateNotice(_0x3dab1e,await _0x1d8f00);}};}function shouldResolveUpdateNotice(_0x570d28){const _0x4c0eb4=a70_0x255ede;return _0x570d28[_0x4c0eb4(0x1ba)]===_0x4c0eb4(0x18e)&&!_0x570d28[_0x4c0eb4(0x186)];}function attachUpdateNotice(_0x32cc3b,_0x22fc38){const _0x540a26=a70_0x255ede;if(!_0x22fc38||!_0x32cc3b||typeof _0x32cc3b!==_0x540a26(0x1ab))return _0x32cc3b;const _0x362460=_0x32cc3b,_0x3325da=typeof _0x362460['_notice']==='object'&&_0x362460[_0x540a26(0x1a6)]!==null?_0x362460['_notice']:{};return{..._0x362460,'_notice':{..._0x3325da,'update':_0x22fc38}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a71_0x6b64(){const _0x20525e=['required','../commands/registry.js','map','14xqeQCL','commands','50htiTKG','6kgisto','1853190QTpPfm','services','service','35661DDrZtA','4313680IxorvC','has','1632144dQUxhY','1329966TOQPnv','none','327322rfjsMq','10PLHlJT','auth','4136710hzHTii'];a71_0x6b64=function(){return _0x20525e;};return a71_0x6b64();}(function(_0x4bcd17,_0x2fe5e2){const _0x22a695=a71_0x5eaf,_0x314467=_0x4bcd17();while(!![]){try{const _0x3f9e8a=-parseInt(_0x22a695(0xe0))/0x1+parseInt(_0x22a695(0xd5))/0x2*(parseInt(_0x22a695(0xda))/0x3)+parseInt(_0x22a695(0xdd))/0x4+parseInt(_0x22a695(0xe3))/0x5*(-parseInt(_0x22a695(0xd6))/0x6)+-parseInt(_0x22a695(0xd3))/0x7*(-parseInt(_0x22a695(0xdb))/0x8)+parseInt(_0x22a695(0xd7))/0x9*(-parseInt(_0x22a695(0xe1))/0xa)+parseInt(_0x22a695(0xde))/0xb;if(_0x3f9e8a===_0x2fe5e2)break;else _0x314467['push'](_0x314467['shift']());}catch(_0x33751b){_0x314467['push'](_0x314467['shift']());}}}(a71_0x6b64,0x84cdb));import{buildSchemaPayload as a71_0xb77d14}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{findDynamicServiceDefinition,listDynamicServiceEntries}from'../commands/service/dynamic.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{getCliGitCommit,getCliVersion}from'../utils/version.js';export async function buildSchemaPayload(){const _0x44737f=a71_0x5eaf,{serviceRegistry:_0xba6c3b,findDefinition:_0x34a7d3}=await import(_0x44737f(0xd1)),_0x512b18=new Set(_0xba6c3b[_0x44737f(0xd2)](_0x473d28=>_0x473d28[_0x44737f(0xd9)])),_0x277dcc=listDynamicServiceEntries()['filter'](_0x48c762=>!_0x512b18[_0x44737f(0xdc)](_0x48c762[_0x44737f(0xd9)])),_0x69c02c=a71_0xb77d14({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'cliVersion':getCliVersion(),'gitCommit':getCliGitCommit(),'globalFlags':GLOBAL_FLAGS,'serviceRegistry':[..._0xba6c3b,..._0x277dcc],'buildAllFlags':buildAllFlags,'findDefinition':(_0x229475,_0x1245c3)=>_0x34a7d3(_0x229475,_0x1245c3)??findDynamicServiceDefinition(_0x229475,_0x1245c3)});return normalizeSchemaPayload(_0x69c02c);}function normalizeSchemaPayload(_0x218903){const _0x330b94=a71_0x5eaf;return{..._0x218903,'schemaVersion':0x2,'services':_0x218903[_0x330b94(0xd8)][_0x330b94(0xd2)](_0x28395e=>({..._0x28395e,'commands':_0x28395e[_0x330b94(0xd4)][_0x330b94(0xd2)](normalizeSchemaCommand)}))};}function a71_0x5eaf(_0x267cbd,_0x576cc5){_0x267cbd=_0x267cbd-0xd0;const _0x6b64c4=a71_0x6b64();let _0x5eafc3=_0x6b64c4[_0x267cbd];return _0x5eafc3;}function normalizeSchemaCommand(_0x278f56){const _0x11ae88=a71_0x5eaf,_0x4f5a7c=_0x278f56;return{..._0x278f56,'auth':_0x4f5a7c[_0x11ae88(0xe2)]??(_0x278f56['requiresAuth']?_0x11ae88(0xd0):_0x11ae88(0xdf))};}
|
package/lib/framework/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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 +1 @@
|
|
|
1
|
-
const
|
|
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';
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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 +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 +1 @@
|
|
|
1
|
-
const a76_0x4de48c=a76_0x41d9;(function(_0x2e59a3,_0x334e26){const _0x14afae=a76_0x41d9,_0x1036af=_0x2e59a3();while(!![]){try{const _0x286f16=parseInt(_0x14afae(0x20b))/0x1*(parseInt(_0x14afae(0x279))/0x2)+parseInt(_0x14afae(0x249))/0x3*(-parseInt(_0x14afae(0x21d))/0x4)+parseInt(_0x14afae(0x1f6))/0x5+-parseInt(_0x14afae(0x27f))/0x6*(parseInt(_0x14afae(0x29b))/0x7)+-parseInt(_0x14afae(0x256))/0x8+-parseInt(_0x14afae(0x1ed))/0x9+-parseInt(_0x14afae(0x2b6))/0xa*(-parseInt(_0x14afae(0x231))/0xb);if(_0x286f16===_0x334e26)break;else _0x1036af['push'](_0x1036af['shift']());}catch(_0x2e3a01){_0x1036af['push'](_0x1036af['shift']());}}}(a76_0x4a84,0xe13c0));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=a76_0x4de48c(0x24d),SKILL_FILE=a76_0x4de48c(0x232),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_0x4de48c(0x259)]),IGNORED_DIR_NAMES=new Set([a76_0x4de48c(0x29e),'.hg',a76_0x4de48c(0x1fb),'node_modules','.next',a76_0x4de48c(0x29a),a76_0x4de48c(0x295),a76_0x4de48c(0x271),a76_0x4de48c(0x1f3),'.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(_0xc476ed={}){const _0x2d7184=a76_0x4de48c,_0x18c5c5=_0xc476ed['homeDir']??homedir(),_0x565a5d=resolve(_0x18c5c5,PRODUCT_CONFIG[_0x2d7184(0x26d)],'cache'),_0x807f5a=trimmedEnv(_0x2d7184(0x285)),_0x680fa7=trimmedEnv(_0x2d7184(0x26c));return{'homeDir':_0x18c5c5,'cacheRoot':_0x565a5d,'managedRoot':resolve(_0x18c5c5,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0xc476ed[_0x2d7184(0x2a5)]??_0x807f5a??resolve(_0x18c5c5,_0x2d7184(0x297),_0x2d7184(0x2b7)),'claudeSkillsDir':_0xc476ed['claudeSkillsDir']??_0x680fa7??resolve(_0x18c5c5,_0x2d7184(0x2bc),_0x2d7184(0x2b7))};}export function getRuntimeSkillCacheRoot(_0x2636bd,_0x320e17,_0x18a8c8={}){const _0x340244=a76_0x4de48c,_0x27b4ca=resolveSkillSyncPaths(_0x18a8c8);return resolve(_0x27b4ca['cacheRoot'],_0x2636bd,fingerprintAccessKey(_0x320e17),_0x340244(0x2b7));}export function getRuntimeSkillDir(_0x257f6c,_0x5db43e,_0x7a89d7,_0x2a605e,_0x44f547,_0x4ed6e4={}){const _0x49d94f=a76_0x4de48c;return resolve(getRuntimeSkillCacheRoot(_0x257f6c,_0x5db43e,_0x4ed6e4),safePathSegment(_0x7a89d7,_0x49d94f(0x250)),_0x2a605e,safePathSegment(_0x44f547,_0x49d94f(0x22e)));}export function listLocalRuntimeSkills(_0x22204c,_0x50b5d4={}){const _0x316503=a76_0x4de48c,_0x55412a=safePathSegment(_0x22204c['appCode'],_0x316503(0x250)),_0x43b821=normalizeRuntimeSkillScopes(_0x22204c['scopes']),_0x42054f=new Set(_0x43b821),_0xf36bcb=_0x22204c[_0x316503(0x2af)]?.['trim'](),_0x4bbe08=new Map(),_0x4717f9=resolve(getRuntimeSkillCacheRoot(_0x22204c[_0x316503(0x213)],_0x22204c[_0x316503(0x23d)],_0x50b5d4),_0x55412a);for(const _0x11b8ff of _0x43b821){for(const _0xbb6571 of localSkillEntryDirs(resolve(_0x4717f9,_0x11b8ff))){collectLocalRuntimeSkill(_0x4bbe08,_0xbb6571,{'appCode':_0x55412a,'scopes':_0x42054f,'code':_0xf36bcb,'source':_0x316503(0x208)});}}const _0xd0ccd1=resolveSkillSyncPaths(_0x50b5d4);for(const _0x2c8d7d of[_0xd0ccd1['agentsSkillsDir'],_0xd0ccd1[_0x316503(0x258)]]){for(const _0x9ea58a of localSkillLinkCandidates(_0x2c8d7d,_0x55412a,_0x42054f)){collectLocalRuntimeSkill(_0x4bbe08,_0x9ea58a,{'appCode':_0x55412a,'scopes':_0x42054f,'code':_0xf36bcb,'source':_0x316503(0x2bd),'linkedPath':_0x9ea58a});}}return Array[_0x316503(0x290)](_0x4bbe08[_0x316503(0x27c)]())[_0x316503(0x27a)](compareLocalRuntimeSkills);}export function contentHash(_0x84e029){const _0x44d0e2=a76_0x4de48c;return createHash(_0x44d0e2(0x20d))[_0x44d0e2(0x254)](_0x84e029)['digest']('hex');}function fileContent(_0x58597f){const _0x3e4d9a=a76_0x4de48c;return _0x58597f[_0x3e4d9a(0x1f0)]??Buffer['from'](_0x58597f['content']??'',_0x3e4d9a(0x241));}function fileText(_0x254517){const _0x1b87fb=a76_0x4de48c;return fileContent(_0x254517)['toString'](_0x1b87fb(0x241));}function fileHash(_0xc59ab8){return bufferSha256(fileContent(_0xc59ab8));}function bufferSha256(_0x52689e){const _0x47c1b1=a76_0x4de48c;return createHash('sha256')[_0x47c1b1(0x254)](_0x52689e)[_0x47c1b1(0x263)](_0x47c1b1(0x294));}export function fileTreeHash(_0x4934c2){const _0xbdc6ab=a76_0x4de48c,_0x49a495=createHash('sha256');for(const _0xac7d7d of normalizeManifestFiles(_0x4934c2)){_0x49a495['update'](_0xac7d7d['path']),_0x49a495[_0xbdc6ab(0x254)]('\x00'),_0x49a495[_0xbdc6ab(0x254)](_0xac7d7d[_0xbdc6ab(0x20d)]),_0x49a495[_0xbdc6ab(0x254)]('\x00'),_0x49a495[_0xbdc6ab(0x254)](String(_0xac7d7d[_0xbdc6ab(0x22c)])),_0x49a495[_0xbdc6ab(0x254)]('\x00');}return _0x49a495[_0xbdc6ab(0x263)](_0xbdc6ab(0x294));}export function buildSkillPackage(_0x163eae){const _0x584f3c=a76_0x4de48c,_0x3f3b42=normalizeLocalFiles(_0x163eae);if(!_0x3f3b42[_0x584f3c(0x22f)](_0x387f0d=>_0x387f0d['path']===SKILL_FILE))throw CliErrors[_0x584f3c(0x27b)](_0x584f3c(0x244)+SKILL_FILE+'\x20in\x20Skill\x20file\x20package.');const _0x5c0334=localFilesToManifestFiles(_0x3f3b42),_0x4b9217=createDeterministicZipPackage(_0x3f3b42);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x5c0334),'zipSha256':bufferSha256(_0x4b9217),'zipSize':_0x4b9217['length'],'files':_0x5c0334},'packageBytes':_0x4b9217,'packageBase64':_0x4b9217[_0x584f3c(0x288)](_0x584f3c(0x25c))};}export function verifyRuntimeSkillPackage(_0x33b32f,_0x5a6ac4){const _0x4623fe=a76_0x4de48c,_0x594824=normalizePackageManifest(_0x33b32f,{'requireOssPath':![]});if(!_0x594824)throw CliErrors[_0x4623fe(0x27b)](_0x4623fe(0x278));return extractAndVerifyPackage(_0x594824,_0x5a6ac4);}export function verifyRuntimeSkillBundle(_0x5b82b5,_0x49e628){const _0x340753=a76_0x4de48c,_0x4df52e=normalizePackageManifest(_0x5b82b5,{'requireOssPath':![]});if(!_0x4df52e)throw CliErrors['validation'](_0x340753(0x278));if(_0x49e628[_0x340753(0x28e)]>MAX_SKILL_PACKAGE_BYTES)throw CliErrors['validation'](_0x340753(0x205));return extractAndVerifyPackageFiles(_0x4df52e,_0x49e628);}export function materializeRuntimeSkill(_0x54aaa0,_0x54e291,_0x339060){const _0x55d5c5=a76_0x4de48c,_0x5d2f58=requireSkillCode(_0x54aaa0),_0x443d85=normalizeRemoteManifest(_0x54aaa0['files']),_0x1b8b81=_0x443d85!==undefined,_0x14a354=_0x1b8b81?requirePackageBytes(_0x5d2f58,_0x339060[_0x55d5c5(0x2ab)]):undefined,_0x19f9fc=_0x1b8b81?extractAndVerifyPackage(_0x443d85,_0x14a354):[{'path':SKILL_FILE,'content':_0x54aaa0[_0x55d5c5(0x29d)]??''}],_0x1d16b0=_0x19f9fc[_0x55d5c5(0x2b4)](_0x1f52f9=>_0x1f52f9[_0x55d5c5(0x29c)]===SKILL_FILE);if(!_0x1d16b0)throw CliErrors['validation'](_0x55d5c5(0x206)+SKILL_FILE+':\x20'+_0x5d2f58);const _0x597791=fileText(_0x1d16b0);if(_0x1b8b81&&_0x54aaa0[_0x55d5c5(0x29d)]!==undefined&&_0x54aaa0[_0x55d5c5(0x29d)]!==_0x597791)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20'+SKILL_FILE+'\x20does\x20not\x20match\x20backend\x20content:\x20'+_0x5d2f58);const _0x5d59a5=withMaterializedSkillFrontmatter(_0x19f9fc,_0x54aaa0,_0x5d2f58),_0x430bfe=_0x5d59a5[_0x55d5c5(0x2b4)](_0x4bbbe8=>_0x4bbbe8[_0x55d5c5(0x29c)]===SKILL_FILE),_0x5cbe34=fileText(_0x430bfe),_0x2df584=getRuntimeSkillDir(_0x339060['env'],_0x339060[_0x55d5c5(0x23d)],_0x339060[_0x55d5c5(0x250)],_0x54e291,_0x5d2f58,_0x339060[_0x55d5c5(0x261)]),_0x4ae561=resolve(_0x2df584,SKILL_FILE),_0x5e0fca=resolve(_0x2df584,METADATA_FILE),_0x8d48ef=contentHash(_0x5cbe34),_0x218e48=readMetadataIfPresent(_0x5e0fca)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x2df584,_0x5e0fca,_0x5d59a5,_0x339060[_0x55d5c5(0x1fe)]===!![]),mkdirSync(_0x2df584,{'recursive':!![],'mode':0x1c0});const _0x25050d=existsSync(_0x4ae561)?readFileSync(_0x4ae561,_0x55d5c5(0x241)):undefined;return materializeFiles(_0x2df584,_0x5d59a5),_0x1b8b81&&removeStaleManagedFiles(_0x2df584,_0x218e48,_0x5d59a5),writeJsonAtomic(_0x5e0fca,buildMetadata(_0x54aaa0,_0x54e291,_0x339060[_0x55d5c5(0x250)],_0x8d48ef,_0x339060['pulledAt'],_0x1b8b81?_0x5d59a5:undefined)),{'skill':_0x54aaa0,'scope':_0x54e291,'dir':_0x2df584,'skillMdPath':_0x4ae561,'metadataPath':_0x5e0fca,'contentHash':_0x8d48ef,'changed':_0x25050d!==_0x5cbe34};}function withMaterializedSkillFrontmatter(_0x20acaf,_0x218c12,_0xae4da3){return normalizeLocalFiles(_0x20acaf)['map'](_0x553709=>{const _0x39d3db=a76_0x41d9,_0x1c4439=fileText(_0x553709);if(_0x553709[_0x39d3db(0x29c)]!==SKILL_FILE||hasYamlFrontmatter(_0x1c4439))return _0x553709;return{'path':_0x553709['path'],'content':prependSkillFrontmatter(_0x1c4439,{'name':_0xae4da3,'description':_0x218c12[_0x39d3db(0x245)]?.[_0x39d3db(0x230)]()||_0x218c12['skillName']?.[_0x39d3db(0x230)]()||_0xae4da3})};});}function hasYamlFrontmatter(_0x43d8ab){const _0x4656e3=a76_0x4de48c;return/^\uFEFF?---\s*\r?\n/[_0x4656e3(0x253)](_0x43d8ab);}function prependSkillFrontmatter(_0x3aa38a,_0x5dd5d8){const _0xaf1ff2=a76_0x4de48c,_0x4c3b23=_0x3aa38a[_0xaf1ff2(0x214)](/^\uFEFF/,'');return['---',_0xaf1ff2(0x246)+yamlString(_0x5dd5d8['name']),'description:\x20'+yamlString(_0x5dd5d8[_0xaf1ff2(0x245)]),'---','',_0x4c3b23][_0xaf1ff2(0x299)]('\x0a');}function yamlString(_0x2c7d85){const _0x194858=a76_0x4de48c;return JSON[_0x194858(0x23c)](_0x2c7d85[_0x194858(0x214)](/\r/g,'')[_0x194858(0x230)]());}export function linkEffectiveRuntimeSkills(_0x40d65e,_0x1ddcac,_0x4d4e63={}){const _0x45bcf0=a76_0x4de48c,_0x5192b5=new Map();for(const _0x33ad5d of _0x40d65e){const _0xf92d4f=_0x33ad5d['skill'][_0x45bcf0(0x22e)];if(!_0xf92d4f)continue;const _0x19e827=_0x5192b5[_0x45bcf0(0x21f)](_0xf92d4f);(!_0x19e827||_0x33ad5d[_0x45bcf0(0x24e)]===_0x45bcf0(0x242))&&_0x5192b5[_0x45bcf0(0x25a)](_0xf92d4f,_0x33ad5d);}const _0x3787d8=[],_0x434110=resolveSkillSyncPaths(_0x4d4e63);for(const _0x2a7275 of _0x5192b5[_0x45bcf0(0x27c)]()){const _0x143cec=requireSkillCode(_0x2a7275[_0x45bcf0(0x200)]),_0x3a1b5b=_0x1ddcac+'--'+_0x143cec;for(const _0x3ab252 of[_0x434110[_0x45bcf0(0x2a5)],_0x434110[_0x45bcf0(0x258)]]){_0x3787d8[_0x45bcf0(0x264)](ensureManagedSymlink(resolve(_0x3ab252,_0x3a1b5b),_0x2a7275[_0x45bcf0(0x27e)],_0x434110[_0x45bcf0(0x2ac)]));}}return _0x3787d8;}export function pruneStaleRuntimeSkillLinks(_0x1f0f0f,_0x992e85,_0x5c4456={},_0x14b064){const _0x39879e=a76_0x4de48c,_0x4e6553=resolveSkillSyncPaths(_0x5c4456),_0xad7eea=new Set([..._0x992e85][_0x39879e(0x2b3)](_0x17f2d9=>_0x17f2d9[_0x39879e(0x230)]())[_0x39879e(0x2a0)](Boolean)),_0x2e5f8f=_0x14b064?new Set([..._0x14b064][_0x39879e(0x2b3)](_0x1d448b=>_0x1d448b['trim']())[_0x39879e(0x2a0)](Boolean)):undefined,_0x51d238=[];for(const _0x23054e of[_0x4e6553[_0x39879e(0x2a5)],_0x4e6553[_0x39879e(0x258)]]){for(const _0x5f1915 of managedAppSkillLinkPaths(_0x23054e,_0x1f0f0f)){const _0x4612eb=basename(_0x5f1915)[_0x39879e(0x210)]((_0x1f0f0f+'--')[_0x39879e(0x28e)]);if(_0x2e5f8f&&!_0x2e5f8f[_0x39879e(0x21a)](_0x4612eb))continue;if(_0xad7eea['has'](_0x4612eb))continue;_0x51d238['push'](removeManagedSkillLink(_0x5f1915,_0x4e6553[_0x39879e(0x2ac)]));}}return _0x51d238;}export function pruneStaleRuntimeSkillCache(_0x44390b,_0x276e06={}){const _0x4800fc=a76_0x4de48c,_0xfea6b1=new Set([..._0x44390b[_0x4800fc(0x28a)]][_0x4800fc(0x2b3)](_0x586c32=>_0x586c32['trim']())[_0x4800fc(0x2a0)](Boolean)),_0x1b6b27=_0x44390b[_0x4800fc(0x20f)]?new Set([..._0x44390b[_0x4800fc(0x20f)]][_0x4800fc(0x2b3)](_0x4cb5c3=>_0x4cb5c3[_0x4800fc(0x230)]())['filter'](Boolean)):undefined,_0x27f532=_0x44390b[_0x4800fc(0x2ba)]??[_0x4800fc(0x242),_0x4800fc(0x24c)],_0x2b38aa=resolve(getRuntimeSkillCacheRoot(_0x44390b['env'],_0x44390b[_0x4800fc(0x23d)],_0x276e06),safePathSegment(_0x44390b[_0x4800fc(0x250)],_0x4800fc(0x250))),_0x3a1382=[];for(const _0x57dbf1 of _0x27f532){const _0x1b5cae=resolve(_0x2b38aa,_0x57dbf1);if(!existsSync(_0x1b5cae))continue;for(const _0x2026fd of readdirSync(_0x1b5cae,{'withFileTypes':!![]})){if(!_0x2026fd[_0x4800fc(0x2b5)]())continue;const _0xa683c1=_0x2026fd[_0x4800fc(0x223)];if(_0x1b6b27&&!_0x1b6b27[_0x4800fc(0x21a)](_0xa683c1))continue;if(_0xfea6b1[_0x4800fc(0x21a)](_0xa683c1))continue;const _0x3e6a38=resolve(_0x1b5cae,_0xa683c1),_0x795224=readMetadataIfPresent(resolve(_0x3e6a38,METADATA_FILE));if(_0x795224?.[_0x4800fc(0x250)]!==_0x44390b[_0x4800fc(0x250)]||_0x795224[_0x4800fc(0x24e)]!==_0x57dbf1||_0x795224[_0x4800fc(0x22e)]!==_0xa683c1){_0x3a1382[_0x4800fc(0x264)]({'path':_0x3e6a38,'action':_0x4800fc(0x2b2),'reason':_0x4800fc(0x226)});continue;}rmSync(_0x3e6a38,{'recursive':!![],'force':!![]}),_0x3a1382['push']({'path':_0x3e6a38,'action':_0x4800fc(0x203)});}}return _0x3a1382;}export function linkGlobalRuntimeSkills(_0xafb132,_0xe1be97={}){const _0x2e76ed=a76_0x4de48c,_0x18b0bc=resolveSkillSyncPaths(_0xe1be97),_0x4dd549=[];for(const _0x205404 of _0xafb132){if(_0x205404[_0x2e76ed(0x24e)]!==_0x2e76ed(0x238))throw CliErrors[_0x2e76ed(0x27b)](_0x2e76ed(0x21e)+_0x205404[_0x2e76ed(0x24e)]);const _0x1aa3b1=requireSkillCode(_0x205404[_0x2e76ed(0x200)]),_0x445b0d=copyManagedSkillDirectory(_0x205404[_0x2e76ed(0x27e)],resolve(_0x18b0bc[_0x2e76ed(0x2a5)],_0x1aa3b1));_0x4dd549[_0x2e76ed(0x264)]({..._0x445b0d,'contentHash':_0x205404[_0x2e76ed(0x2a9)]});}return _0x4dd549;}export function readPushDirectory(_0x29ddbb,_0x355fc9){const _0x211d19=a76_0x4de48c,_0x4551b1=resolvePushDirectoryRoot(_0x29ddbb),_0x789175=resolve(_0x4551b1,SKILL_FILE);if(!existsSync(_0x789175)||!lstatSync(_0x789175)['isFile']())throw CliErrors[_0x211d19(0x27b)]('Missing\x20'+SKILL_FILE+':\x20'+_0x789175);const _0x50e443=readMetadataIfPresent(resolve(_0x4551b1,METADATA_FILE));if(_0x50e443?.[_0x211d19(0x24e)]&&_0x50e443[_0x211d19(0x24e)]!==_0x211d19(0x242))throw CliErrors['validation'](_0x211d19(0x27d)+METADATA_FILE+_0x211d19(0x1f7)+_0x50e443[_0x211d19(0x24e)]+'\x22.');if(_0x50e443?.['appCode']&&_0x50e443[_0x211d19(0x250)]!==_0x355fc9)throw CliErrors['validation'](_0x211d19(0x2a4)+_0x50e443[_0x211d19(0x250)]+_0x211d19(0x227)+_0x355fc9+'\x22.');const _0x13d6c3=scanSkillDirectory(_0x4551b1),_0x26fc81=buildSkillPackage(_0x13d6c3),_0x3317ee=readFileSync(_0x789175,'utf8'),_0x341cf5=_0x50e443?.[_0x211d19(0x22e)]??deriveSkillCodeFromDirectory(_0x4551b1,_0x355fc9);if(!_0x341cf5)throw CliErrors['validation']('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+METADATA_FILE+'\x20or\x20directory\x20name.');return{'skillCode':_0x341cf5,'metadata':_0x50e443,'input':{'skillCode':_0x341cf5,'skillName':_0x50e443?.[_0x211d19(0x267)],'description':_0x50e443?.[_0x211d19(0x245)],'content':_0x3317ee,'files':_0x26fc81[_0x211d19(0x23e)],'packageBase64':_0x26fc81[_0x211d19(0x2a3)],'tags':_0x50e443?.[_0x211d19(0x289)],'version':_0x50e443?.[_0x211d19(0x221)],'sourceSessionId':_0x50e443?.[_0x211d19(0x2b9)]}};}function resolvePushDirectoryRoot(_0x4ab934){const _0x298ee1=a76_0x4de48c,_0x47c8cc=resolve(_0x4ab934);if(!existsSync(_0x47c8cc))throw CliErrors['validation']('Skill\x20directory\x20not\x20found:\x20'+_0x4ab934);const _0x9f4c52=lstatSync(_0x47c8cc);if(_0x9f4c52[_0x298ee1(0x2b5)]())return _0x47c8cc;if(_0x9f4c52['isSymbolicLink']()){const _0x117543=realpathSync(_0x47c8cc);if(lstatSync(_0x117543)[_0x298ee1(0x2b5)]())return _0x117543;}throw CliErrors[_0x298ee1(0x27b)](_0x298ee1(0x28c)+_0x4ab934);}export function recordPushedRuntimeSkill(_0x32fa2b,_0x598244,_0x33eb95,_0x268980={}){const _0xb15fdb=a76_0x4de48c,_0x29ab2f=resolvePushDirectoryRoot(_0x32fa2b),_0x1e4cb2=scanSkillDirectory(_0x29ab2f),_0x2253bb=_0x1e4cb2['find'](_0x3a22e1=>_0x3a22e1['path']===SKILL_FILE),_0x56d9f4=_0x2253bb?fileText(_0x2253bb):'',_0x2c7ace=tryNormalizePackageManifest(_0x598244[_0xb15fdb(0x2a8)]),_0x3de526={..._0x598244,'content':_0x598244[_0xb15fdb(0x29d)]??_0x56d9f4,'files':_0x2c7ace},_0x5d9338=_0x2c7ace?normalizeLocalFiles(_0x1e4cb2)['filter'](_0x1b5602=>_0x2c7ace['files'][_0xb15fdb(0x22f)](_0x3f7e5c=>_0x3f7e5c[_0xb15fdb(0x29c)]===_0x1b5602[_0xb15fdb(0x29c)])):undefined,_0x2a406e=buildMetadata(_0x3de526,_0x268980[_0xb15fdb(0x24e)]??'personal',_0x33eb95,contentHash(_0x3de526[_0xb15fdb(0x29d)]??''),_0x268980[_0xb15fdb(0x2a2)],_0x5d9338);writeJsonAtomic(resolve(_0x29ab2f,METADATA_FILE),_0x2a406e);}export function deriveSkillCodeFromDirectory(_0x902828,_0x41389c){const _0x2286a4=a76_0x4de48c,_0x1bf774=basename(resolve(_0x902828)),_0x4f9905=_0x41389c+'--';return _0x1bf774[_0x2286a4(0x2a1)](_0x4f9905)?_0x1bf774[_0x2286a4(0x210)](_0x4f9905[_0x2286a4(0x28e)]):_0x1bf774;}export function readMetadataIfPresent(_0x91fcff){const _0x3d2c1e=a76_0x4de48c;if(!existsSync(_0x91fcff))return undefined;try{const _0x87d62f=JSON[_0x3d2c1e(0x234)](readFileSync(_0x91fcff,_0x3d2c1e(0x241)));return _0x87d62f;}catch{throw CliErrors[_0x3d2c1e(0x27b)](_0x3d2c1e(0x23b)+METADATA_FILE+':\x20'+_0x91fcff);}}function normalizeRuntimeSkillScopes(_0x48effa){const _0x12a3da=a76_0x4de48c,_0x57ffcd=_0x48effa&&_0x48effa[_0x12a3da(0x28e)]>0x0?_0x48effa:[_0x12a3da(0x242),_0x12a3da(0x24c),_0x12a3da(0x238)],_0x59ccf7=[];for(const _0x3f9ee8 of _0x57ffcd){if(!isRuntimeSkillScope(_0x3f9ee8))throw CliErrors[_0x12a3da(0x27b)](_0x12a3da(0x225)+_0x3f9ee8);!_0x59ccf7[_0x12a3da(0x26e)](_0x3f9ee8)&&_0x59ccf7['push'](_0x3f9ee8);}return _0x59ccf7;}function isRuntimeSkillScope(_0x513ac8){const _0x336715=a76_0x4de48c;return _0x513ac8===_0x336715(0x242)||_0x513ac8===_0x336715(0x24c)||_0x513ac8===_0x336715(0x238);}function localSkillEntryDirs(_0x274a28){const _0x1ed38c=a76_0x4de48c;if(!existsSync(_0x274a28))return[];return readdirSync(_0x274a28,{'withFileTypes':!![]})['filter'](_0x514710=>_0x514710['isDirectory']()||_0x514710[_0x1ed38c(0x255)]())[_0x1ed38c(0x2b3)](_0x4bb97d=>resolve(_0x274a28,_0x4bb97d[_0x1ed38c(0x223)]));}function localSkillLinkCandidates(_0xbdff51,_0x50a722,_0x8a8520){const _0x3ac6bc=a76_0x4de48c;if(!existsSync(_0xbdff51))return[];const _0x2f7051=_0x50a722+'--';return readdirSync(_0xbdff51,{'withFileTypes':!![]})['filter'](_0x8afc46=>_0x8afc46['isDirectory']()||_0x8afc46['isSymbolicLink']())[_0x3ac6bc(0x2a0)](_0xba8642=>_0xba8642[_0x3ac6bc(0x223)][_0x3ac6bc(0x2a1)](_0x2f7051)||_0x8a8520[_0x3ac6bc(0x21a)](_0x3ac6bc(0x238)))['map'](_0x34fbc0=>resolve(_0xbdff51,_0x34fbc0[_0x3ac6bc(0x223)]));}function collectLocalRuntimeSkill(_0x21c7e9,_0x48ba74,_0x3aa365){const _0x14a6a5=a76_0x4de48c,_0x2efe13=resolve(_0x48ba74,METADATA_FILE),_0x125bfa=readMetadataIfPresent(_0x2efe13);if(!_0x125bfa)return;if(_0x125bfa[_0x14a6a5(0x250)]!==_0x3aa365[_0x14a6a5(0x250)])return;if(!isRuntimeSkillScope(_0x125bfa[_0x14a6a5(0x24e)])||!_0x3aa365['scopes'][_0x14a6a5(0x21a)](_0x125bfa[_0x14a6a5(0x24e)]))return;const _0x2e6e5c=_0x125bfa['skillCode']?.['trim']();if(!_0x2e6e5c)return;if(_0x3aa365[_0x14a6a5(0x2af)]&&_0x2e6e5c!==_0x3aa365[_0x14a6a5(0x2af)])return;const _0x38efc5=_0x125bfa[_0x14a6a5(0x24e)]+':'+_0x2e6e5c,_0x19f283=_0x3aa365[_0x14a6a5(0x23f)]?[_0x3aa365[_0x14a6a5(0x23f)]]:[],_0x45baed=_0x21c7e9[_0x14a6a5(0x21f)](_0x38efc5);if(_0x45baed){_0x3aa365[_0x14a6a5(0x281)]===_0x14a6a5(0x208)&&(_0x45baed[_0x14a6a5(0x27e)]=_0x48ba74,_0x45baed[_0x14a6a5(0x239)]=_0x48ba74,_0x45baed[_0x14a6a5(0x1f9)]=resolve(_0x48ba74,SKILL_FILE),_0x45baed[_0x14a6a5(0x1ff)]=_0x2efe13);for(const _0x1d4b43 of _0x19f283){!_0x45baed['linkedPaths'][_0x14a6a5(0x26e)](_0x1d4b43)&&_0x45baed[_0x14a6a5(0x29f)][_0x14a6a5(0x264)](_0x1d4b43);}_0x45baed[_0x14a6a5(0x29f)][_0x14a6a5(0x27a)]();return;}_0x21c7e9['set'](_0x38efc5,{..._0x125bfa,'tags':Array[_0x14a6a5(0x2a6)](_0x125bfa[_0x14a6a5(0x289)])?_0x125bfa[_0x14a6a5(0x289)]:[],'scope':_0x125bfa[_0x14a6a5(0x24e)],'source':_0x14a6a5(0x287),'dir':_0x48ba74,'cacheDir':_0x3aa365['source']===_0x14a6a5(0x208)?_0x48ba74:undefined,'skillMdPath':resolve(_0x48ba74,SKILL_FILE),'metadataPath':_0x2efe13,'linkedPaths':_0x19f283});}function compareLocalRuntimeSkills(_0x26729e,_0x556dfb){const _0x3e9008=a76_0x4de48c,_0x83a26a={'personal':0x0,'company':0x1,'builtin':0x2};return _0x83a26a[_0x26729e['scope']]-_0x83a26a[_0x556dfb['scope']]||_0x26729e[_0x3e9008(0x22e)][_0x3e9008(0x280)](_0x556dfb['skillCode'])||_0x26729e[_0x3e9008(0x27e)]['localeCompare'](_0x556dfb[_0x3e9008(0x27e)]);}function buildMetadata(_0x12c726,_0x35ca24,_0x4f7b22,_0x3c36b9,_0x1ad832,_0x395018){const _0x565f67=a76_0x4de48c,_0xaabb4f=_0x395018?normalizeLocalFiles(_0x395018):[],_0x5a86f9=normalizePackageManifest(_0x12c726['files'],{'requireOssPath':![]}),_0x1f6a75=_0xaabb4f['length']>0x0?Object[_0x565f67(0x277)](_0xaabb4f['map'](_0x283455=>[_0x283455[_0x565f67(0x29c)],fileHash(_0x283455)])):undefined;return{'schemaVersion':_0xaabb4f[_0x565f67(0x28e)]>0x0?0x2:0x1,'id':_0x12c726['id'],'appCode':_0x4f7b22,'skillCode':requireSkillCode(_0x12c726),'skillName':_0x12c726[_0x565f67(0x267)],'description':_0x12c726[_0x565f67(0x245)],'scope':_0x35ca24,'readonly':_0x35ca24!==_0x565f67(0x242)||_0x12c726[_0x565f67(0x2aa)]===!![],'tenantCode':_0x12c726[_0x565f67(0x1fa)],'userId':_0x12c726[_0x565f67(0x20a)],'version':_0x12c726[_0x565f67(0x221)],'status':_0x12c726[_0x565f67(0x272)],'tags':Array['isArray'](_0x12c726['tags'])?_0x12c726[_0x565f67(0x289)]:[],'hasUpstreamUpdate':_0x12c726[_0x565f67(0x28f)],'forkedFromSkillId':_0x12c726[_0x565f67(0x243)],'forkedFromVersion':_0x12c726[_0x565f67(0x1fd)],'sourceSessionId':_0x12c726[_0x565f67(0x2b9)],'contentHash':_0x3c36b9,'fileHashes':_0x1f6a75,'treeHash':_0xaabb4f[_0x565f67(0x28e)]>0x0?fileTreeHash(localFilesToManifestFiles(_0xaabb4f)):_0x5a86f9?.[_0x565f67(0x24a)],'ossPath':_0x5a86f9?.[_0x565f67(0x20e)],'zipSha256':_0x5a86f9?.[_0x565f67(0x28b)],'zipSize':_0x5a86f9?.[_0x565f67(0x228)],'files':_0xaabb4f[_0x565f67(0x28e)]>0x0?_0xaabb4f[_0x565f67(0x2b3)](_0x2cf6f3=>({'path':_0x2cf6f3[_0x565f67(0x29c)],'hash':fileHash(_0x2cf6f3),'size':fileContent(_0x2cf6f3)['length']})):undefined,'pulledAt':_0x1ad832??new Date()[_0x565f67(0x222)]()};}function requireSkillCode(_0x1555be){const _0x17fc3b=a76_0x4de48c,_0x51c6f8=_0x1555be['skillCode']?.[_0x17fc3b(0x230)]();if(!_0x51c6f8)throw CliErrors['validation'](_0x17fc3b(0x2b0));return _0x51c6f8;}function trimmedEnv(_0x4bbc51){const _0x70e9c3=productEnv(_0x4bbc51)?.['trim']();return _0x70e9c3?_0x70e9c3:undefined;}function safePathSegment(_0x251102,_0x3dc123='path\x20segment'){const _0x5b04df=a76_0x4de48c;if(!_0x251102||_0x251102[_0x5b04df(0x26e)]('/')||_0x251102['includes']('\x5c')||_0x251102[_0x5b04df(0x26e)]('..'))throw CliErrors[_0x5b04df(0x27b)]('Unsafe\x20'+_0x3dc123+_0x5b04df(0x20c)+_0x251102);return _0x251102;}function ensurePulledFilesCanBeOverwritten(_0x3a55c7,_0x35acb6,_0x4999b0,_0x46421c){const _0x1d7901=a76_0x4de48c;if(_0x46421c||!existsSync(_0x35acb6))return;const _0x3d94b9=readMetadataIfPresent(_0x35acb6);if(!_0x3d94b9)return;const _0x189df8=_0x3d94b9['fileHashes']&&Object[_0x1d7901(0x296)](_0x3d94b9[_0x1d7901(0x217)])[_0x1d7901(0x28e)]>0x0?_0x3d94b9[_0x1d7901(0x217)]:undefined;if(_0x189df8)for(const [_0x21fbfb,_0x423a66]of Object[_0x1d7901(0x22d)](_0x189df8)){const _0x387eb1=resolveManagedFilePath(_0x3a55c7,_0x21fbfb);if(!existsSync(_0x387eb1))throw CliErrors['validation'](_0x1d7901(0x2b8)+_0x3a55c7,_0x1d7901(0x207)+_0x21fbfb);const _0x46b92b=lstatSync(_0x387eb1);if(!_0x46b92b['isFile']())throw CliErrors[_0x1d7901(0x27b)](_0x1d7901(0x2b8)+_0x3a55c7,_0x1d7901(0x1ee)+_0x21fbfb);const _0x59c6dd=bufferSha256(readFileSync(_0x387eb1));if(_0x59c6dd!==_0x423a66)throw CliErrors[_0x1d7901(0x27b)](_0x1d7901(0x2b8)+_0x3a55c7+_0x1d7901(0x202)+_0x21fbfb,_0x1d7901(0x1f2)+_0x21fbfb);}else{const _0x2353ff=resolve(_0x3a55c7,SKILL_FILE);if(existsSync(_0x2353ff)&&_0x3d94b9['contentHash']){const _0x19eec9=contentHash(readFileSync(_0x2353ff,_0x1d7901(0x241)));if(_0x19eec9!==_0x3d94b9[_0x1d7901(0x2a9)])throw CliErrors[_0x1d7901(0x27b)](_0x1d7901(0x286)+_0x2353ff,_0x1d7901(0x270));}}for(const _0x4aa6d9 of normalizeLocalFiles(_0x4999b0)){if(_0x189df8?.[_0x4aa6d9[_0x1d7901(0x29c)]])continue;if(!_0x189df8&&_0x4aa6d9[_0x1d7901(0x29c)]===SKILL_FILE)continue;const _0x2673aa=resolveManagedFilePath(_0x3a55c7,_0x4aa6d9[_0x1d7901(0x29c)]);if(!existsSync(_0x2673aa))continue;const _0x5bbf30=lstatSync(_0x2673aa);if(!_0x5bbf30[_0x1d7901(0x201)]())throw CliErrors[_0x1d7901(0x27b)](_0x1d7901(0x2b8)+_0x3a55c7,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x4aa6d9[_0x1d7901(0x29c)]);const _0x154a50=bufferSha256(readFileSync(_0x2673aa));if(_0x154a50!==fileHash(_0x4aa6d9))throw CliErrors[_0x1d7901(0x27b)](_0x1d7901(0x2b8)+_0x3a55c7,_0x1d7901(0x237)+_0x4aa6d9[_0x1d7901(0x29c)]);}}function a76_0x4a84(){const _0x5a8fdb=['includes','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','coverage','status','Runtime\x20Skill\x20package\x20exceeds\x20total\x20file\x20size\x20limit.','.tmp','writeUInt16LE','Runtime\x20Skill\x20package\x20has\x20truncated\x20entry\x20name.','fromEntries','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','677956hlYOjg','sort','validation','values','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','dir','9865722zeiOcG','localeCompare','source','Runtime\x20Skill\x20package\x20exceeds\x20size\x20limit:\x20','copy','readUInt32LE','SKILL_ROOT','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','local','toString','tags','activeSkillCodes','zipSha256','Skill\x20directory\x20not\x20found:\x20','Runtime\x20Skill\x20package\x20has\x20invalid\x20central\x20directory\x20offsets.','length','hasUpstreamUpdate','from','max','unchanged','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','hex','build','keys','.agents','Runtime\x20Skill\x20package\x20CRC\x20mismatch:\x20','join','dist','7TtpMxH','path','content','.git','linkedPaths','filter','startsWith','pushedAt','packageBase64','Skill\x20metadata\x20appCode\x20\x22','agentsSkillsDir','isArray','external-symlink','files','contentHash','readonly','packageBytes','managedRoot','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20package-backed\x20Skill:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','code','Runtime\x20Skill\x20is\x20missing\x20skillCode.','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','skipped','map','find','isDirectory','2710gjScdc','skills','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','sourceSessionId','scopes','Runtime\x20Skill\x20package\x20central\x20directory\x20size\x20mismatch.','.claude','link','Runtime\x20Skill\x20package\x20has\x20truncated\x20central\x20directory.','15715809EFPYsj','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','Unsafe\x20Skill\x20file\x20path:\x20','bytes','Runtime\x20Skill\x20package\x20local\x20path\x20mismatch:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','.turbo','Runtime\x20Skill\x20package\x20uses\x20unsupported\x20multi-disk\x20zip\x20format.','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','2090040GGqMtT','\x20has\x20scope=\x22','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','skillMdPath','tenantCode','.svn','schemaVersion','forkedFromVersion','force','metadataPath','skill','isFile','.\x20Changed\x20file:\x20','removed','isSafeInteger','Runtime\x20Skill\x20package\x20exceeds\x20size\x20limit.','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','cache','Runtime\x20Skill\x20package\x20is\x20missing\x20zip\x20central\x20directory.','userId','1UEBJHg','\x20for\x20local\x20path:\x20','sha256','ossPath','pruneSkillCodes','slice','Skill\x20file\x20sha256\x20is\x20invalid:\x20','Skill\x20file\x20size\x20is\x20invalid:\x20','env','replace','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','Skill\x20directory\x20exceeds\x20file\x20count\x20limit.','fileHashes','isBuffer','Duplicate\x20Skill\x20package\x20entry:\x20','has','endsWith','Runtime\x20Skill\x20package\x20local\x20header\x20mismatch:\x20','68LaohNi','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','get','requireOssPath','version','toISOString','name','Runtime\x20Skill\x20package\x20has\x20invalid\x20central\x20directory\x20entry.','Unsupported\x20runtime\x20Skill\x20scope:\x20','metadata-mismatch','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','zipSize','toLowerCase','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','concat','size','entries','skillCode','some','trim','242869tYtuWn','SKILL.md','object','parse','created','Skill\x20file\x20path\x20must\x20be\x20text.','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','builtin','cacheDir','not-managed-symlink','Invalid\x20','stringify','accessKey','manifest','linkedPath','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','utf8','personal','forkedFromSkillId','Missing\x20','description','name:\x20','Runtime\x20Skill\x20package\x20has\x20truncated\x20entry\x20data:\x20','Skill\x20directory\x20exceeds\x20total\x20file\x20size\x20limit.','240453oDAdau','treeSha256','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','company','lovrabet.skill.json','scope','compare','appCode','Skill\x20package\x20exceeds\x20size\x20limit.','Skill\x20file\x20exceeds\x20size\x20limit:\x20','test','update','isSymbolicLink','8518240MdEKKT','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','claudeSkillsDir','.DS_Store','set','string','base64','alloc','writeUInt32LE','Runtime\x20Skill\x20package\x20contains\x20unsupported\x20compression\x20method.','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','paths','split','digest','push','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','subarray','skillName','Runtime\x20Skill\x20package\x20contains\x20encrypted\x20entries.','Runtime\x20Skill\x20package\x20uncompressed\x20size\x20mismatch:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','readUInt16LE','CLAUDE_SKILL_ROOT','homeDirName'];a76_0x4a84=function(){return _0x5a8fdb;};return a76_0x4a84();}function scanSkillDirectory(_0x1fc8d6){const _0x2c053d=realOrResolved(_0x1fc8d6),_0xf301f1=[];let _0x12e9b8=0x0;function _0x1357b5(_0x2a3d5a){const _0x3b6093=a76_0x41d9,_0x41480a=readdirSync(_0x2a3d5a,{'withFileTypes':!![]})[_0x3b6093(0x27a)]((_0x3e0105,_0x3ef9e1)=>_0x3e0105[_0x3b6093(0x223)]['localeCompare'](_0x3ef9e1['name']));for(const _0x4cf903 of _0x41480a){if(_0x4cf903[_0x3b6093(0x2b5)]()&&IGNORED_DIR_NAMES[_0x3b6093(0x21a)](_0x4cf903[_0x3b6093(0x223)]))continue;if(IGNORED_FILE_NAMES[_0x3b6093(0x21a)](_0x4cf903[_0x3b6093(0x223)]))continue;const _0x5df859=resolve(_0x2a3d5a,_0x4cf903['name']);if(_0x4cf903[_0x3b6093(0x255)]())throw CliErrors['validation'](_0x3b6093(0x265)+_0x5df859);const _0x481828=toPosixPath(relative(_0x2c053d,_0x5df859));if(_0x4cf903[_0x3b6093(0x2b5)]()){_0x1357b5(_0x5df859);continue;}if(!_0x4cf903[_0x3b6093(0x201)]())continue;validateSkillRelativePath(_0x481828);const _0x41a5f2=readFileSync(_0x5df859);if(_0x41a5f2[_0x3b6093(0x28e)]>MAX_SKILL_FILE_BYTES)throw CliErrors[_0x3b6093(0x27b)](_0x3b6093(0x252)+_0x481828);_0x12e9b8+=_0x41a5f2['length'];if(_0x12e9b8>MAX_SKILL_TOTAL_BYTES)throw CliErrors['validation'](_0x3b6093(0x248));_0xf301f1[_0x3b6093(0x264)]({'path':_0x481828,'bytes':_0x41a5f2});if(_0xf301f1[_0x3b6093(0x28e)]>MAX_SKILL_FILE_COUNT)throw CliErrors[_0x3b6093(0x27b)](_0x3b6093(0x216));}}return _0x1357b5(_0x2c053d),normalizeLocalFiles(_0xf301f1);}function normalizeLocalFiles(_0x1ba279){const _0x31ffe1=a76_0x4de48c;if(!Array['isArray'](_0x1ba279)||_0x1ba279[_0x31ffe1(0x28e)]===0x0)return[];if(_0x1ba279[_0x31ffe1(0x28e)]>MAX_SKILL_FILE_COUNT)throw CliErrors[_0x31ffe1(0x27b)](_0x31ffe1(0x216));const _0x2cd329=new Map();let _0x19f0e2=0x0;for(const _0x43df6f of _0x1ba279){if(!_0x43df6f||typeof _0x43df6f!==_0x31ffe1(0x233)||typeof _0x43df6f[_0x31ffe1(0x29c)]!==_0x31ffe1(0x25b))throw CliErrors[_0x31ffe1(0x27b)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x249bf3=normalizeSkillRelativePath(_0x43df6f[_0x31ffe1(0x29c)]);if(_0x2cd329[_0x31ffe1(0x21a)](_0x249bf3))throw CliErrors[_0x31ffe1(0x27b)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x249bf3);if(_0x43df6f[_0x31ffe1(0x1f0)]!==undefined&&!Buffer[_0x31ffe1(0x218)](_0x43df6f['bytes']))throw CliErrors['validation'](_0x31ffe1(0x260)+_0x249bf3);if(_0x43df6f[_0x31ffe1(0x1f0)]===undefined&&typeof _0x43df6f[_0x31ffe1(0x29d)]!=='string')throw CliErrors['validation']('Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'+_0x249bf3);const _0x1f7d84=fileContent(_0x43df6f),_0x3053bc=_0x1f7d84['length'];if(_0x3053bc>MAX_SKILL_FILE_BYTES)throw CliErrors[_0x31ffe1(0x27b)](_0x31ffe1(0x252)+_0x249bf3);_0x19f0e2+=_0x3053bc;if(_0x19f0e2>MAX_SKILL_TOTAL_BYTES)throw CliErrors[_0x31ffe1(0x27b)](_0x31ffe1(0x248));_0x2cd329[_0x31ffe1(0x25a)](_0x249bf3,{'path':_0x249bf3,'bytes':_0x1f7d84});}return Array[_0x31ffe1(0x290)](_0x2cd329[_0x31ffe1(0x27c)]())[_0x31ffe1(0x27a)](compareSkillFiles);}function normalizeManifestFiles(_0x2b2df8){const _0x27f9bb=a76_0x4de48c;if(!Array[_0x27f9bb(0x2a6)](_0x2b2df8)||_0x2b2df8[_0x27f9bb(0x28e)]===0x0)return[];if(_0x2b2df8[_0x27f9bb(0x28e)]>MAX_SKILL_FILE_COUNT)throw CliErrors[_0x27f9bb(0x27b)]('Skill\x20directory\x20exceeds\x20file\x20count\x20limit.');const _0x2edb75=new Map();let _0x2f16b0=0x0;for(const _0x45c733 of _0x2b2df8){if(!_0x45c733||typeof _0x45c733!==_0x27f9bb(0x233)||typeof _0x45c733[_0x27f9bb(0x29c)]!==_0x27f9bb(0x25b))throw CliErrors['validation'](_0x27f9bb(0x236));const _0x4b791e=normalizeSkillRelativePath(_0x45c733[_0x27f9bb(0x29c)]);if(_0x2edb75[_0x27f9bb(0x21a)](_0x4b791e))throw CliErrors['validation']('Duplicate\x20Skill\x20file\x20path:\x20'+_0x4b791e);if(!isSha256Hex(_0x45c733[_0x27f9bb(0x20d)]))throw CliErrors[_0x27f9bb(0x27b)](_0x27f9bb(0x211)+_0x4b791e);if(!Number['isSafeInteger'](_0x45c733['size'])||_0x45c733[_0x27f9bb(0x22c)]<0x0)throw CliErrors[_0x27f9bb(0x27b)](_0x27f9bb(0x212)+_0x4b791e);if(_0x45c733[_0x27f9bb(0x22c)]>MAX_SKILL_FILE_BYTES)throw CliErrors[_0x27f9bb(0x27b)](_0x27f9bb(0x252)+_0x4b791e);_0x2f16b0+=_0x45c733[_0x27f9bb(0x22c)];if(_0x2f16b0>MAX_SKILL_TOTAL_BYTES)throw CliErrors[_0x27f9bb(0x27b)]('Skill\x20directory\x20exceeds\x20total\x20file\x20size\x20limit.');_0x2edb75[_0x27f9bb(0x25a)](_0x4b791e,{'path':_0x4b791e,'sha256':_0x45c733[_0x27f9bb(0x20d)][_0x27f9bb(0x229)](),'size':_0x45c733[_0x27f9bb(0x22c)]});}return Array[_0x27f9bb(0x290)](_0x2edb75[_0x27f9bb(0x27c)]())[_0x27f9bb(0x27a)](compareSkillFiles);}function normalizeRemoteManifest(_0x3042d0){return normalizePackageManifest(_0x3042d0,{'requireOssPath':!![]});}function normalizePackageManifest(_0x4ce70d,_0x146e0b){const _0x242c09=a76_0x4de48c;if(!_0x4ce70d||typeof _0x4ce70d!==_0x242c09(0x233)||Array[_0x242c09(0x2a6)](_0x4ce70d))return undefined;const _0x214a63=_0x4ce70d,_0x1ff12c=typeof _0x214a63[_0x242c09(0x20e)]===_0x242c09(0x25b)?_0x214a63[_0x242c09(0x20e)][_0x242c09(0x230)]():undefined;if(_0x146e0b[_0x242c09(0x220)]&&!_0x1ff12c)return undefined;if(!Array['isArray'](_0x214a63[_0x242c09(0x2a8)])||_0x214a63[_0x242c09(0x2a8)]['length']===0x0)return undefined;if(!isSha256Hex(_0x214a63[_0x242c09(0x24a)]))throw CliErrors[_0x242c09(0x27b)](_0x242c09(0x1f8));if(!isSha256Hex(_0x214a63[_0x242c09(0x28b)]))throw CliErrors[_0x242c09(0x27b)](_0x242c09(0x257));if(!Number[_0x242c09(0x204)](_0x214a63['zipSize'])||_0x214a63[_0x242c09(0x228)]<0x0)throw CliErrors[_0x242c09(0x27b)]('Runtime\x20Skill\x20package\x20size\x20is\x20invalid.');if(_0x214a63[_0x242c09(0x228)]>MAX_SKILL_PACKAGE_BYTES)throw CliErrors[_0x242c09(0x27b)](_0x242c09(0x205));const _0x72d6d0=normalizeManifestFiles(_0x214a63[_0x242c09(0x2a8)]);if(!_0x72d6d0['some'](_0x1498a1=>_0x1498a1['path']===SKILL_FILE))throw CliErrors[_0x242c09(0x27b)]('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x7d0122=fileTreeHash(_0x72d6d0);if(_0x7d0122!==_0x214a63[_0x242c09(0x24a)]['toLowerCase']())throw CliErrors[_0x242c09(0x27b)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number[_0x242c09(0x204)](_0x214a63[_0x242c09(0x1fc)])?_0x214a63[_0x242c09(0x1fc)]:0x2,'ossPath':_0x1ff12c,'treeSha256':_0x7d0122,'zipSha256':_0x214a63['zipSha256'][_0x242c09(0x229)](),'zipSize':_0x214a63['zipSize'],'files':_0x72d6d0};}function tryNormalizeRemoteManifest(_0x555a5e){return normalizeRemoteManifest(_0x555a5e);}function tryNormalizePackageManifest(_0x170b32){return normalizePackageManifest(_0x170b32,{'requireOssPath':![]});}function requirePackageBytes(_0x3db212,_0x22a8b9){const _0x592748=a76_0x4de48c;if(!_0x22a8b9||_0x22a8b9['length']===0x0)throw CliErrors[_0x592748(0x27b)](_0x592748(0x2ad)+_0x3db212);if(_0x22a8b9[_0x592748(0x28e)]>MAX_SKILL_PACKAGE_BYTES)throw CliErrors[_0x592748(0x27b)](_0x592748(0x282)+_0x3db212);return _0x22a8b9;}function localFilesToManifestFiles(_0x96b686){const _0x4ad9f6=a76_0x4de48c;return normalizeLocalFiles(_0x96b686)[_0x4ad9f6(0x2b3)](_0x54b7f1=>({'path':_0x54b7f1['path'],'sha256':fileHash(_0x54b7f1),'size':fileContent(_0x54b7f1)[_0x4ad9f6(0x28e)]}));}function isSha256Hex(_0x107b1c){const _0x27efe3=a76_0x4de48c;return typeof _0x107b1c===_0x27efe3(0x25b)&&/^[a-fA-F0-9]{64}$/[_0x27efe3(0x253)](_0x107b1c);}function extractAndVerifyPackage(_0x4c61c9,_0x1dcb53){const _0x1783da=a76_0x4de48c,_0x18acf7=normalizePackageManifest(_0x4c61c9,{'requireOssPath':![]});if(!_0x18acf7)throw CliErrors[_0x1783da(0x27b)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x1dcb53['length']!==_0x18acf7[_0x1783da(0x228)])throw CliErrors['validation']('Runtime\x20Skill\x20package\x20size\x20mismatch.');const _0x4d0256=bufferSha256(_0x1dcb53);if(_0x4d0256!==_0x18acf7['zipSha256'])throw CliErrors[_0x1783da(0x27b)](_0x1783da(0x293));return extractAndVerifyPackageFiles(_0x18acf7,_0x1dcb53);}function extractAndVerifyPackageFiles(_0x18ffc0,_0x428271){const _0x2be0c7=a76_0x4de48c,_0x445cc9=parseZipPackage(_0x428271);if(_0x445cc9[_0x2be0c7(0x28e)]!==_0x18ffc0[_0x2be0c7(0x2a8)][_0x2be0c7(0x28e)])throw CliErrors[_0x2be0c7(0x27b)](_0x2be0c7(0x215));const _0x418329=new Map();for(const _0x43d2e6 of _0x445cc9){if(_0x418329['has'](_0x43d2e6[_0x2be0c7(0x29c)]))throw CliErrors[_0x2be0c7(0x27b)](_0x2be0c7(0x219)+_0x43d2e6[_0x2be0c7(0x29c)]);_0x418329[_0x2be0c7(0x25a)](_0x43d2e6[_0x2be0c7(0x29c)],_0x43d2e6);}const _0x5aeb18=[];for(const _0x437257 of _0x18ffc0['files']){const _0x453911=_0x418329[_0x2be0c7(0x21f)](_0x437257['path']);if(!_0x453911)throw CliErrors[_0x2be0c7(0x27b)](_0x2be0c7(0x240)+_0x437257['path']);if(_0x453911[_0x2be0c7(0x1f0)]['length']!==_0x437257['size'])throw CliErrors[_0x2be0c7(0x27b)]('Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'+_0x437257[_0x2be0c7(0x29c)]);const _0x4b84e6=bufferSha256(_0x453911['bytes']);if(_0x4b84e6!==_0x437257[_0x2be0c7(0x20d)])throw CliErrors[_0x2be0c7(0x27b)](_0x2be0c7(0x24b)+_0x437257[_0x2be0c7(0x29c)]);_0x5aeb18[_0x2be0c7(0x264)]({'path':_0x437257[_0x2be0c7(0x29c)],'bytes':_0x453911[_0x2be0c7(0x1f0)]});}return normalizeLocalFiles(_0x5aeb18);}function a76_0x41d9(_0x272b79,_0x17b6d0){_0x272b79=_0x272b79-0x1ec;const _0x4a84d1=a76_0x4a84();let _0x41d9f3=_0x4a84d1[_0x272b79];return _0x41d9f3;}function createDeterministicZipPackage(_0x5df383){const _0x3ecfe8=a76_0x4de48c,_0x51b924=normalizeLocalFiles(_0x5df383),_0x5de333=[],_0x55a8fb=[];let _0x3b6008=0x0;for(const _0x3be635 of _0x51b924){const _0x9240ae=Buffer[_0x3ecfe8(0x290)](_0x3be635[_0x3ecfe8(0x29c)],_0x3ecfe8(0x241)),_0x2395f7=fileContent(_0x3be635),_0x20b551=crc32(_0x2395f7),_0x343000=Buffer['alloc'](0x1e+_0x9240ae[_0x3ecfe8(0x28e)]);_0x343000[_0x3ecfe8(0x25e)](ZIP_LOCAL_FILE_HEADER_SIGNATURE,0x0),_0x343000[_0x3ecfe8(0x275)](0x14,0x4),_0x343000['writeUInt16LE'](ZIP_GENERAL_PURPOSE_UTF8,0x6),_0x343000[_0x3ecfe8(0x275)](ZIP_METHOD_STORE,0x8),_0x343000[_0x3ecfe8(0x275)](ZIP_FIXED_DOS_TIME,0xa),_0x343000[_0x3ecfe8(0x275)](ZIP_FIXED_DOS_DATE,0xc),_0x343000[_0x3ecfe8(0x25e)](_0x20b551,0xe),_0x343000[_0x3ecfe8(0x25e)](_0x2395f7[_0x3ecfe8(0x28e)],0x12),_0x343000[_0x3ecfe8(0x25e)](_0x2395f7['length'],0x16),_0x343000[_0x3ecfe8(0x275)](_0x9240ae[_0x3ecfe8(0x28e)],0x1a),_0x343000[_0x3ecfe8(0x275)](0x0,0x1c),_0x9240ae[_0x3ecfe8(0x283)](_0x343000,0x1e),_0x5de333[_0x3ecfe8(0x264)](_0x343000,_0x2395f7);const _0x5c7e5d=Buffer[_0x3ecfe8(0x25d)](0x2e+_0x9240ae[_0x3ecfe8(0x28e)]);_0x5c7e5d['writeUInt32LE'](ZIP_CENTRAL_DIRECTORY_SIGNATURE,0x0),_0x5c7e5d[_0x3ecfe8(0x275)](0x14,0x4),_0x5c7e5d[_0x3ecfe8(0x275)](0x14,0x6),_0x5c7e5d[_0x3ecfe8(0x275)](ZIP_GENERAL_PURPOSE_UTF8,0x8),_0x5c7e5d[_0x3ecfe8(0x275)](ZIP_METHOD_STORE,0xa),_0x5c7e5d['writeUInt16LE'](ZIP_FIXED_DOS_TIME,0xc),_0x5c7e5d['writeUInt16LE'](ZIP_FIXED_DOS_DATE,0xe),_0x5c7e5d[_0x3ecfe8(0x25e)](_0x20b551,0x10),_0x5c7e5d[_0x3ecfe8(0x25e)](_0x2395f7['length'],0x14),_0x5c7e5d[_0x3ecfe8(0x25e)](_0x2395f7[_0x3ecfe8(0x28e)],0x18),_0x5c7e5d[_0x3ecfe8(0x275)](_0x9240ae[_0x3ecfe8(0x28e)],0x1c),_0x5c7e5d[_0x3ecfe8(0x275)](0x0,0x1e),_0x5c7e5d['writeUInt16LE'](0x0,0x20),_0x5c7e5d[_0x3ecfe8(0x275)](0x0,0x22),_0x5c7e5d[_0x3ecfe8(0x275)](0x0,0x24),_0x5c7e5d[_0x3ecfe8(0x25e)](0x0,0x26),_0x5c7e5d['writeUInt32LE'](_0x3b6008,0x2a),_0x9240ae[_0x3ecfe8(0x283)](_0x5c7e5d,0x2e),_0x55a8fb['push'](_0x5c7e5d),_0x3b6008+=_0x343000[_0x3ecfe8(0x28e)]+_0x2395f7[_0x3ecfe8(0x28e)];}const _0x4485e8=Buffer[_0x3ecfe8(0x22b)](_0x55a8fb),_0x2ee074=_0x3b6008,_0x2369c9=_0x4485e8[_0x3ecfe8(0x28e)],_0x1dbdf=Buffer[_0x3ecfe8(0x25d)](0x16);_0x1dbdf[_0x3ecfe8(0x25e)](ZIP_END_OF_CENTRAL_DIRECTORY_SIGNATURE,0x0),_0x1dbdf[_0x3ecfe8(0x275)](0x0,0x4),_0x1dbdf['writeUInt16LE'](0x0,0x6),_0x1dbdf[_0x3ecfe8(0x275)](_0x51b924[_0x3ecfe8(0x28e)],0x8),_0x1dbdf[_0x3ecfe8(0x275)](_0x51b924['length'],0xa),_0x1dbdf['writeUInt32LE'](_0x2369c9,0xc),_0x1dbdf['writeUInt32LE'](_0x2ee074,0x10),_0x1dbdf[_0x3ecfe8(0x275)](0x0,0x14);const _0x4e0333=Buffer['concat']([..._0x5de333,_0x4485e8,_0x1dbdf]);if(_0x4e0333[_0x3ecfe8(0x28e)]>MAX_SKILL_PACKAGE_BYTES)throw CliErrors['validation'](_0x3ecfe8(0x251));return _0x4e0333;}function parseZipPackage(_0xc62a03){const _0x4e56e0=a76_0x4de48c;if(_0xc62a03[_0x4e56e0(0x28e)]<0x16)throw CliErrors['validation'](_0x4e56e0(0x1f5));const _0x54d11c=findEndOfCentralDirectory(_0xc62a03);if(_0x54d11c<0x0)throw CliErrors['validation'](_0x4e56e0(0x209));const _0x502114=_0xc62a03['readUInt16LE'](_0x54d11c+0x4),_0x1c18d7=_0xc62a03[_0x4e56e0(0x26b)](_0x54d11c+0x6),_0x4f8b47=_0xc62a03[_0x4e56e0(0x26b)](_0x54d11c+0xa),_0x403b43=_0xc62a03['readUInt32LE'](_0x54d11c+0xc),_0x58ba76=_0xc62a03[_0x4e56e0(0x284)](_0x54d11c+0x10);if(_0x502114!==0x0||_0x1c18d7!==0x0)throw CliErrors[_0x4e56e0(0x27b)](_0x4e56e0(0x1f4));if(_0x4f8b47>MAX_SKILL_FILE_COUNT)throw CliErrors[_0x4e56e0(0x27b)]('Runtime\x20Skill\x20package\x20exceeds\x20file\x20count\x20limit.');if(_0x58ba76+_0x403b43>_0x54d11c||_0x58ba76>=_0xc62a03[_0x4e56e0(0x28e)])throw CliErrors[_0x4e56e0(0x27b)](_0x4e56e0(0x28d));const _0x9d24f0=[];let _0x6bde78=0x0,_0x5e429b=_0x58ba76;for(let _0x167323=0x0;_0x167323<_0x4f8b47;_0x167323+=0x1){if(_0x5e429b+0x2e>_0xc62a03['length'])throw CliErrors['validation'](_0x4e56e0(0x1ec));if(_0xc62a03[_0x4e56e0(0x284)](_0x5e429b)!==ZIP_CENTRAL_DIRECTORY_SIGNATURE)throw CliErrors[_0x4e56e0(0x27b)](_0x4e56e0(0x224));const _0x43d997=_0xc62a03['readUInt16LE'](_0x5e429b+0x8),_0x1b8826=_0xc62a03['readUInt16LE'](_0x5e429b+0xa),_0x376530=_0xc62a03[_0x4e56e0(0x284)](_0x5e429b+0x10),_0x2d5ab8=_0xc62a03['readUInt32LE'](_0x5e429b+0x14),_0x1e1906=_0xc62a03[_0x4e56e0(0x284)](_0x5e429b+0x18),_0x430f6c=_0xc62a03[_0x4e56e0(0x26b)](_0x5e429b+0x1c),_0x2673f2=_0xc62a03[_0x4e56e0(0x26b)](_0x5e429b+0x1e),_0x387536=_0xc62a03['readUInt16LE'](_0x5e429b+0x20),_0x39183a=_0xc62a03[_0x4e56e0(0x284)](_0x5e429b+0x2a),_0x1538a8=_0x5e429b+0x2e,_0x12b241=_0x1538a8+_0x430f6c;if(_0x12b241>_0xc62a03[_0x4e56e0(0x28e)])throw CliErrors[_0x4e56e0(0x27b)](_0x4e56e0(0x276));if((_0x43d997&0x1)!==0x0)throw CliErrors[_0x4e56e0(0x27b)](_0x4e56e0(0x268));if(_0x1b8826!==ZIP_METHOD_STORE&&_0x1b8826!==ZIP_METHOD_DEFLATE)throw CliErrors['validation'](_0x4e56e0(0x25f));const _0x3b9988=normalizeSkillRelativePath(_0xc62a03[_0x4e56e0(0x266)](_0x1538a8,_0x12b241)['toString']('utf8'));if(_0x3b9988['endsWith']('/'))throw CliErrors[_0x4e56e0(0x27b)]('Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'+_0x3b9988);if(_0x1e1906>MAX_SKILL_FILE_BYTES)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20file\x20exceeds\x20size\x20limit:\x20'+_0x3b9988);_0x6bde78+=_0x1e1906;if(_0x6bde78>MAX_SKILL_TOTAL_BYTES)throw CliErrors[_0x4e56e0(0x27b)](_0x4e56e0(0x273));const _0xd8a6b4=readZipEntryData(_0xc62a03,_0x39183a,_0x3b9988,_0x2d5ab8),_0x399a1f=_0x1b8826===ZIP_METHOD_STORE?_0xd8a6b4:inflateRawSync(_0xd8a6b4);if(_0x399a1f[_0x4e56e0(0x28e)]!==_0x1e1906)throw CliErrors[_0x4e56e0(0x27b)](_0x4e56e0(0x269)+_0x3b9988);if(crc32(_0x399a1f)!==_0x376530)throw CliErrors[_0x4e56e0(0x27b)](_0x4e56e0(0x298)+_0x3b9988);_0x9d24f0[_0x4e56e0(0x264)]({'path':_0x3b9988,'bytes':_0x399a1f}),_0x5e429b=_0x12b241+_0x2673f2+_0x387536;}if(_0x5e429b!==_0x58ba76+_0x403b43)throw CliErrors[_0x4e56e0(0x27b)](_0x4e56e0(0x2bb));return _0x9d24f0[_0x4e56e0(0x27a)](compareSkillFiles);}function readZipEntryData(_0x2dc092,_0x145c45,_0x2487db,_0x5b501b){const _0x332d62=a76_0x4de48c;if(_0x145c45+0x1e>_0x2dc092['length'])throw CliErrors[_0x332d62(0x27b)]('Runtime\x20Skill\x20package\x20has\x20truncated\x20local\x20header:\x20'+_0x2487db);if(_0x2dc092['readUInt32LE'](_0x145c45)!==ZIP_LOCAL_FILE_HEADER_SIGNATURE)throw CliErrors[_0x332d62(0x27b)](_0x332d62(0x21c)+_0x2487db);const _0x6a030a=_0x2dc092[_0x332d62(0x26b)](_0x145c45+0x1a),_0x2c2594=_0x2dc092[_0x332d62(0x26b)](_0x145c45+0x1c),_0x199903=_0x145c45+0x1e,_0x11d671=_0x199903+_0x6a030a,_0x5923e0=_0x11d671+_0x2c2594,_0x195ad9=_0x5923e0+_0x5b501b;if(_0x11d671>_0x2dc092[_0x332d62(0x28e)]||_0x195ad9>_0x2dc092[_0x332d62(0x28e)])throw CliErrors[_0x332d62(0x27b)](_0x332d62(0x247)+_0x2487db);const _0x36d32d=normalizeSkillRelativePath(_0x2dc092[_0x332d62(0x266)](_0x199903,_0x11d671)[_0x332d62(0x288)](_0x332d62(0x241)));if(_0x36d32d!==_0x2487db)throw CliErrors[_0x332d62(0x27b)](_0x332d62(0x1f1)+_0x2487db);return _0x2dc092[_0x332d62(0x266)](_0x5923e0,_0x195ad9);}function findEndOfCentralDirectory(_0x4865fa){const _0x396512=a76_0x4de48c,_0x5dacc0=Math[_0x396512(0x291)](0x0,_0x4865fa[_0x396512(0x28e)]-0x16-0xffff);for(let _0x45ee6e=_0x4865fa[_0x396512(0x28e)]-0x16;_0x45ee6e>=_0x5dacc0;_0x45ee6e-=0x1){if(_0x4865fa['readUInt32LE'](_0x45ee6e)===ZIP_END_OF_CENTRAL_DIRECTORY_SIGNATURE){const _0x2bfe93=_0x4865fa[_0x396512(0x26b)](_0x45ee6e+0x14);if(_0x45ee6e+0x16+_0x2bfe93===_0x4865fa[_0x396512(0x28e)])return _0x45ee6e;}}return-0x1;}function createCrc32Table(){const _0x28d64c=new Uint32Array(0x100);for(let _0x293681=0x0;_0x293681<0x100;_0x293681+=0x1){let _0x84ca5f=_0x293681;for(let _0x43aed6=0x0;_0x43aed6<0x8;_0x43aed6+=0x1){_0x84ca5f=(_0x84ca5f&0x1)!==0x0?0xedb88320^_0x84ca5f>>>0x1:_0x84ca5f>>>0x1;}_0x28d64c[_0x293681]=_0x84ca5f>>>0x0;}return _0x28d64c;}function crc32(_0x20433a){let _0x2327bb=0xffffffff;for(const _0x1426e3 of _0x20433a){_0x2327bb=CRC32_TABLE[(_0x2327bb^_0x1426e3)&0xff]^_0x2327bb>>>0x8;}return(_0x2327bb^0xffffffff)>>>0x0;}function compareSkillFiles(_0x5b379a,_0x7159fc){const _0x44818b=a76_0x4de48c;if(_0x5b379a[_0x44818b(0x29c)]===SKILL_FILE)return _0x7159fc[_0x44818b(0x29c)]===SKILL_FILE?0x0:-0x1;if(_0x7159fc[_0x44818b(0x29c)]===SKILL_FILE)return 0x1;return Buffer[_0x44818b(0x24f)](Buffer[_0x44818b(0x290)](_0x5b379a[_0x44818b(0x29c)],'utf8'),Buffer[_0x44818b(0x290)](_0x7159fc[_0x44818b(0x29c)],_0x44818b(0x241)));}function materializeFiles(_0x274985,_0x2842d8){const _0x11129e=a76_0x4de48c;for(const _0x393b4b of normalizeLocalFiles(_0x2842d8)){const _0x848405=resolveManagedFilePath(_0x274985,_0x393b4b[_0x11129e(0x29c)]);mkdirSync(dirname(_0x848405),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x848405,fileContent(_0x393b4b),0x180);}}function removeStaleManagedFiles(_0x48d5ff,_0x4c72a9,_0x4710ff){const _0x1f06cb=a76_0x4de48c;if(!_0x4c72a9)return;const _0x66581f=new Set(normalizeLocalFiles(_0x4710ff)['map'](_0x2d9377=>_0x2d9377[_0x1f06cb(0x29c)]));for(const _0x20947e of Object[_0x1f06cb(0x296)](_0x4c72a9)){if(_0x66581f['has'](_0x20947e))continue;const _0x6598ae=resolveManagedFilePath(_0x48d5ff,_0x20947e);existsSync(_0x6598ae)&&lstatSync(_0x6598ae)[_0x1f06cb(0x201)]()&&rmSync(_0x6598ae,{'force':!![]});}}function resolveManagedFilePath(_0x9b4e85,_0x28d7b5){const _0x258dc8=a76_0x4de48c,_0x565244=normalizeSkillRelativePath(_0x28d7b5),_0x299092=realOrResolved(_0x9b4e85),_0x1ceed3=resolve(_0x299092,..._0x565244['split']('/'));if(!isPathInside(_0x1ceed3,_0x299092))throw CliErrors['validation'](_0x258dc8(0x1ef)+_0x28d7b5);return ensureNoSymlinkInManagedPath(_0x299092,_0x565244),_0x1ceed3;}function ensureNoSymlinkInManagedPath(_0x26438a,_0x54d910){const _0x44a596=a76_0x4de48c;let _0xe54514=_0x26438a;for(const _0x30f7f7 of _0x54d910[_0x44a596(0x262)]('/')){_0xe54514=resolve(_0xe54514,_0x30f7f7);const _0x4aa39b=lstatIfPresent(_0xe54514);if(_0x4aa39b?.[_0x44a596(0x255)]())throw CliErrors[_0x44a596(0x27b)](_0x44a596(0x22a)+_0x54d910);}}function normalizeSkillRelativePath(_0x55d2ab){const _0x221ebd=a76_0x4de48c,_0x3f8f71=toPosixPath(_0x55d2ab[_0x221ebd(0x230)]());return validateSkillRelativePath(_0x3f8f71),_0x3f8f71;}function validateSkillRelativePath(_0x41b7e5){const _0x1a9ad0=a76_0x4de48c;if(!_0x41b7e5||_0x41b7e5[_0x1a9ad0(0x2a1)]('/')||_0x41b7e5[_0x1a9ad0(0x26e)]('//'))throw CliErrors[_0x1a9ad0(0x27b)](_0x1a9ad0(0x1ef)+_0x41b7e5);for(const _0x4985e4 of _0x41b7e5['split']('/')){if(!_0x4985e4||_0x4985e4==='.'||_0x4985e4==='..')throw CliErrors[_0x1a9ad0(0x27b)](_0x1a9ad0(0x1ef)+_0x41b7e5);}}function toPosixPath(_0x5850bd){return _0x5850bd['replace'](/\\/g,'/');}function ensureManagedSymlink(_0x2581ae,_0x162c68,_0x285dde){const _0x3fda39=a76_0x4de48c;mkdirSync(dirname(_0x2581ae),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x2581ae)||isDanglingSymlink(_0x2581ae)){const _0x2052e1=lstatSync(_0x2581ae);if(!_0x2052e1[_0x3fda39(0x255)]())throw CliErrors[_0x3fda39(0x27b)](_0x3fda39(0x2b1)+_0x2581ae);const _0x5b8dfa=resolveSymlinkTarget(_0x2581ae);if(!isPathInside(realOrResolved(_0x5b8dfa),realOrResolved(_0x285dde)))throw CliErrors[_0x3fda39(0x27b)](_0x3fda39(0x26f)+_0x2581ae);if(realOrResolved(_0x5b8dfa)===realOrResolved(_0x162c68))return{'path':_0x2581ae,'target':_0x162c68,'action':_0x3fda39(0x292)};return unlinkSync(_0x2581ae),symlinkSync(_0x162c68,_0x2581ae,'dir'),{'path':_0x2581ae,'target':_0x162c68,'action':'updated'};}return symlinkSync(_0x162c68,_0x2581ae,_0x3fda39(0x27e)),{'path':_0x2581ae,'target':_0x162c68,'action':_0x3fda39(0x235)};}function managedAppSkillLinkPaths(_0x322c61,_0x26c0a2){const _0x2fd89a=a76_0x4de48c;if(!existsSync(_0x322c61))return[];const _0x197f6e=_0x26c0a2+'--';return readdirSync(_0x322c61,{'withFileTypes':!![]})[_0x2fd89a(0x2a0)](_0xe07d24=>_0xe07d24[_0x2fd89a(0x223)][_0x2fd89a(0x2a1)](_0x197f6e))[_0x2fd89a(0x2b3)](_0x372f34=>resolve(_0x322c61,_0x372f34[_0x2fd89a(0x223)]));}function removeManagedSkillLink(_0x2c3a7d,_0x50f44e){const _0x4b0f68=a76_0x4de48c,_0x271265=lstatIfPresent(_0x2c3a7d);if(!_0x271265?.['isSymbolicLink']())return{'path':_0x2c3a7d,'action':'skipped','reason':_0x4b0f68(0x23a)};const _0x1e0e90=resolveSymlinkTarget(_0x2c3a7d);if(!isPathInside(realOrResolved(_0x1e0e90),realOrResolved(_0x50f44e)))return{'path':_0x2c3a7d,'action':_0x4b0f68(0x2b2),'reason':_0x4b0f68(0x2a7)};return unlinkSync(_0x2c3a7d),{'path':_0x2c3a7d,'action':_0x4b0f68(0x203)};}function copyManagedSkillDirectory(_0xd1b63,_0x13a146){const _0x58e841=a76_0x4de48c,_0x569fbe=resolve(_0x13a146,METADATA_FILE),_0x1f5b3c=existsSync(_0x13a146);if(_0x1f5b3c){const _0x44855f=lstatSync(_0x13a146);if(_0x44855f[_0x58e841(0x255)]())throw CliErrors['validation'](_0x58e841(0x2ae)+_0x13a146);if(!_0x44855f[_0x58e841(0x2b5)]())throw CliErrors[_0x58e841(0x27b)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x13a146);const _0xea78e1=readMetadataIfPresent(_0x569fbe);if(_0xea78e1?.[_0x58e841(0x24e)]!==_0x58e841(0x238))throw CliErrors[_0x58e841(0x27b)](_0x58e841(0x26a)+_0x13a146);}mkdirSync(dirname(_0x13a146),{'recursive':!![],'mode':0x1c0});const _0x32c722=_0x1f5b3c?readMetadataIfPresent(_0x569fbe)?.[_0x58e841(0x2a9)]:undefined,_0x483bb1=readMetadataIfPresent(resolve(_0xd1b63,METADATA_FILE))?.[_0x58e841(0x2a9)];return _0x1f5b3c&&rmSync(_0x13a146,{'recursive':!![],'force':!![]}),copySkillDirectory(_0xd1b63,_0x13a146),{'path':_0x13a146,'target':_0xd1b63,'action':!_0x1f5b3c?_0x58e841(0x235):_0x32c722===_0x483bb1?_0x58e841(0x292):'updated'};}function copySkillDirectory(_0x1894f6,_0x2f9656){const _0x295645=a76_0x4de48c;mkdirSync(_0x2f9656,{'recursive':!![],'mode':0x1c0});for(const _0x543688 of readdirSync(_0x1894f6,{'withFileTypes':!![]})){const _0x58f8bc=resolve(_0x1894f6,_0x543688[_0x295645(0x223)]),_0xd7bc84=resolve(_0x2f9656,_0x543688[_0x295645(0x223)]);if(_0x543688['isSymbolicLink']())throw CliErrors['validation']('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0x58f8bc);if(_0x543688[_0x295645(0x2b5)]()){copySkillDirectory(_0x58f8bc,_0xd7bc84);continue;}_0x543688[_0x295645(0x201)]()&&writeFileSync(_0xd7bc84,readFileSync(_0x58f8bc));}}function isDanglingSymlink(_0x4b7231){const _0x4a04d1=a76_0x4de48c;try{return lstatSync(_0x4b7231)[_0x4a04d1(0x255)]();}catch{return![];}}function resolveSymlinkTarget(_0x560572){const _0xafd770=readlinkSync(_0x560572);return isAbsolute(_0xafd770)?_0xafd770:resolve(dirname(_0x560572),_0xafd770);}function isPathInside(_0x215820,_0x88fcbd){const _0x56b2d7=a76_0x4de48c,_0x1f34b1=_0x215820[_0x56b2d7(0x21b)](sep)?_0x215820:''+_0x215820+sep,_0x3ff1c7=_0x88fcbd[_0x56b2d7(0x21b)](sep)?_0x88fcbd:''+_0x88fcbd+sep;return _0x215820===_0x88fcbd||_0x1f34b1[_0x56b2d7(0x2a1)](_0x3ff1c7);}function realOrResolved(_0x150ce6){try{return realpathSync(_0x150ce6);}catch{return resolve(_0x150ce6);}}function lstatIfPresent(_0xcca671){try{return lstatSync(_0xcca671);}catch{return undefined;}}function writeTextAtomic(_0x16eeae,_0x12f1f7,_0x4c8a22){const _0x44fcd6=a76_0x4de48c;writeBytesAtomic(_0x16eeae,Buffer[_0x44fcd6(0x290)](_0x12f1f7,_0x44fcd6(0x241)),_0x4c8a22);}function writeBytesAtomic(_0xe008ff,_0x267593,_0x2f4513){const _0x2ff023=a76_0x4de48c,_0x4a6d08=_0xe008ff+_0x2ff023(0x274);try{writeFileSync(_0x4a6d08,_0x267593,{'mode':_0x2f4513}),renameSync(_0x4a6d08,_0xe008ff);}catch(_0xd1a7d7){try{rmSync(_0x4a6d08,{'force':!![]});}catch{}throw _0xd1a7d7;}}function writeJsonAtomic(_0x49e06c,_0x317ffb){const _0x4628bf=a76_0x4de48c;writeTextAtomic(_0x49e06c,JSON[_0x4628bf(0x23c)](_0x317ffb,null,0x2)+'\x0a',0x180);}
|
|
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 +1 @@
|
|
|
1
|
-
function
|
|
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()});
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +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();
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +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));}
|