apt-mcp-agent-setup 3.5.13 → 3.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/bin/cli.js +1 -1
- package/build-input.json +122 -85
- package/bundle/NOTICES.md +0 -0
- package/bundle/core.enc +0 -0
- package/bundle/mcp-rules.enc +0 -0
- package/bundle/skills-aso.enc +0 -0
- package/bundle/skills-ba.enc +0 -0
- package/bundle/skills-base.enc +0 -0
- package/bundle/skills-be.enc +0 -0
- package/bundle/skills-design.enc +0 -0
- package/bundle/skills-fe.enc +0 -0
- package/bundle/skills-marketing.enc +0 -0
- package/bundle/skills-mobile.enc +0 -0
- package/bundle/skills-pm.enc +0 -0
- package/docs/technical-sources.md +8 -3
- package/integrity-manifest.json +149 -133
- package/package.json +1 -1
- package/release-check.js +26 -11
- package/src/backends/browser-tools.js +1 -1
- package/src/backends/index-cache-authority.js +1 -0
- package/src/backends/index-command.js +1 -1
- package/src/backends/index-maintenance.js +1 -0
- package/src/backends/index-store.js +1 -1
- package/src/backends/profiles.js +1 -1
- package/src/backends/review_graph.py +150 -6
- package/src/backends/source-discovery.js +1 -0
- package/src/core/admission-fence.js +1 -1
- package/src/core/aso-import.js +1 -1
- package/src/core/backend-lease-recovery.js +1 -0
- package/src/core/caller-context.js +1 -1
- package/src/core/catalog.js +1 -1
- package/src/core/claude-caller-authority.js +1 -1
- package/src/core/claude-invocation.js +1 -1
- package/src/core/claude-native.js +1 -1
- package/src/core/claude-plan.js +1 -1
- package/src/core/claude-transcript-scan.js +1 -1
- package/src/core/claude-worker-transcript.js +1 -1
- package/src/core/codex-host-metadata.js +1 -1
- package/src/core/codex-transcript-receipt.js +1 -1
- package/src/core/connection-inspector.js +1 -1
- package/src/core/context-metrics.js +1 -1
- package/src/core/doctor.js +1 -1
- package/src/core/draining-completion.js +1 -1
- package/src/core/execution.js +1 -1
- package/src/core/git-context.js +1 -1
- package/src/core/hook-bridge.js +1 -1
- package/src/core/hook-diagnostics.js +1 -0
- package/src/core/hook-lease.js +1 -0
- package/src/core/host-adapters.js +1 -1
- package/src/core/interrupted-operation-audit.js +1 -0
- package/src/core/ipc-envelope.js +1 -1
- package/src/core/legacy-retirement-proof.js +1 -0
- package/src/core/memory-scope.js +1 -1
- package/src/core/memory-store.js +1 -1
- package/src/core/model-inventory.js +1 -1
- package/src/core/model-routing.js +1 -1
- package/src/core/native-dispatch.js +1 -1
- package/src/core/native-receipt.js +1 -0
- package/src/core/node-version.js +1 -1
- package/src/core/npm-cli.js +1 -1
- package/src/core/owned-command-child.js +1 -1
- package/src/core/owned-command.js +1 -1
- package/src/core/owned-lock.js +1 -1
- package/src/core/owned-process.js +1 -1
- package/src/core/pipeline-journal.js +1 -0
- package/src/core/presentations.js +1 -1
- package/src/core/quality-artifacts.js +1 -1
- package/src/core/quality.js +1 -1
- package/src/core/read-command.js +1 -1
- package/src/core/readonly-skill.js +1 -1
- package/src/core/recovery-archive.js +1 -0
- package/src/core/resource-transaction.js +1 -1
- package/src/core/run-checkpoint.js +1 -1
- package/src/core/run-compatibility.js +1 -1
- package/src/core/run-state-codec.js +1 -0
- package/src/core/runtime-authority.js +1 -1
- package/src/core/runtime-info.js +1 -1
- package/src/core/runtime-ownership.js +1 -1
- package/src/core/session.js +1 -1
- package/src/core/skill-companions.js +1 -1
- package/src/core/skill-names.js +1 -1
- package/src/core/storage-retry.js +1 -1
- package/src/core/tool-contracts.js +1 -1
- package/src/core/update-control.js +1 -1
- package/src/core/upgrade-runs.js +1 -1
- package/src/core/upgrade-stop.js +1 -1
- package/src/core/windows-job.js +1 -1
- package/src/core/windows-legacy-query.ps1 +277 -0
- package/src/core/workflow-policy.js +1 -0
- package/src/core/workspace-generation.js +1 -1
- package/src/core/workspace-path.js +1 -1
- package/src/installer/bounded-command.js +1 -1
- package/src/installer/candidate-preflight.js +1 -1
- package/src/installer/connection-activation.js +1 -1
- package/src/installer/connection-supervisor.js +1 -1
- package/src/installer/deployment-draft.js +1 -1
- package/src/installer/gateway-context.js +1 -1
- package/src/installer/gateway-migration.js +1 -1
- package/src/installer/gateway-runtime.js +1 -1
- package/src/installer/global-setup.js +1 -1
- package/src/installer/hook-context-client.js +1 -1
- package/src/installer/hook-dispatcher.js +76 -24
- package/src/installer/host-hooks.js +1 -1
- package/src/installer/index-recovery.js +1 -1
- package/src/installer/interrupted-operation-recovery.js +1 -0
- package/src/installer/legacy-registration.js +1 -1
- package/src/installer/managed-config.js +1 -1
- package/src/installer/migration-scope.js +1 -1
- package/src/installer/platform-config.js +1 -1
- package/src/installer/prerequisites.js +1 -1
- package/src/installer/presentations.js +1 -1
- package/src/installer/project-outcome.js +1 -1
- package/src/installer/project-setup.js +1 -1
- package/src/installer/registration-closure.js +1 -1
- package/src/installer/registration-plan.js +1 -1
- package/src/installer/registration-receipt.js +1 -1
- package/src/installer/registrations.js +1 -1
- package/src/installer/runtime-activation.js +1 -1
- package/src/installer/runtime-child.js +1 -1
- package/src/installer/runtime-cleanup.js +1 -1
- package/src/installer/runtime-lock.js +1 -1
- package/src/installer/runtime-store.js +1 -1
- package/src/installer/runtime-supervisor.js +1 -1
- package/src/installer/setup-wizard.js +1 -1
- package/src/installer/update-addons.js +1 -1
- package/src/installer/update-cleanup.js +1 -1
- package/src/installer/update-executor.js +1 -1
- package/src/installer/update-history.js +1 -0
- package/src/installer/update-registration.js +1 -1
- package/src/installer/update-request.js +1 -1
- package/src/installer/update-scope.js +1 -1
- package/src/installer/workspace-registry.js +1 -1
- package/src/installer/workspace-transaction.js +1 -1
- package/src/installer/workspace-update.js +1 -1
- package/src/license/crypto.js +1 -1
- package/src/license/fingerprint.js +1 -1
- package/src/license/terms.js +1 -1
- package/src/license/verify.js +1 -1
- package/src/presets/index.js +1 -1
- package/src/proxy/backends.js +1 -1
- package/src/proxy/browser-sessions.js +1 -1
- package/src/proxy/core-tools.js +1 -1
- package/src/proxy/pipeline.js +1 -1
- package/src/proxy/public-catalog.js +1 -1
- package/src/proxy/router.config.js +1 -1
- package/src/proxy/router.js +1 -1
- package/src/proxy/server.js +1 -1
- package/src/proxy/workspace-gateway.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x361171=_0x4c42;(function(_0x5d04d0,_0x2446a5){const _0x543186=_0x4c42,_0x5012bc=_0x5d04d0();while(!![]){try{const _0x8813bd=parseInt(_0x543186(0x213))/0x1*(parseInt(_0x543186(0x1ea))/0x2)+-parseInt(_0x543186(0x294))/0x3+-parseInt(_0x543186(0x215))/0x4*(-parseInt(_0x543186(0x223))/0x5)+parseInt(_0x543186(0x22a))/0x6+parseInt(_0x543186(0x27a))/0x7*(-parseInt(_0x543186(0x1ff))/0x8)+-parseInt(_0x543186(0x25d))/0x9+parseInt(_0x543186(0x1e5))/0xa;if(_0x8813bd===_0x2446a5)break;else _0x5012bc['push'](_0x5012bc['shift']());}catch(_0x4b0de9){_0x5012bc['push'](_0x5012bc['shift']());}}}(_0xf0fc,0xcaf8d));const fs=require(_0x361171(0x214)),path=require('node:path'),os=require(_0x361171(0x1ce)),crypto=require(_0x361171(0x1c5)),{IDE_REGISTRY}=require('./platform-config'),{configEntry}=require('./registration-plan'),{parseJson,writeConfigAtomic}=require(_0x361171(0x281)),{matchingReceipt,registeredProjects,entryHash,recordRegistration}=require(_0x361171(0x1f9)),{WorkspaceRegistry}=require(_0x361171(0x23d)),hash=_0x1111ad=>crypto['createHash'](_0x361171(0x216))[_0x361171(0x23c)](_0x1111ad)['digest'](_0x361171(0x290)),isApt=_0x5ab1ac=>_0x5ab1ac==='apt-mcp-agent'||/^apt-mcp-agent-w[a-z0-9]+$/i[_0x361171(0x255)](_0x5ab1ac),fail=_0x54891f=>{const _0x4beadb=_0x361171;throw Object[_0x4beadb(0x21d)](new Error(_0x54891f),{'code':_0x54891f});},rootFor=_0x42e7f5=>_0x42e7f5[_0x361171(0x270)]||process.env.APT_MIGRATION_ROOT||path[_0x361171(0x266)](os[_0x361171(0x264)](),_0x361171(0x1cf),_0x361171(0x22d),'registration-migrations'),read=_0x56dc9b=>{const _0x44411f=_0x361171;try{return fs['readFileSync'](_0x56dc9b);}catch(_0x1390ce){if(_0x1390ce[_0x44411f(0x1c7)]===_0x44411f(0x1e7))return null;throw _0x1390ce;}};function durable(_0x22d8fd,_0xe6f057){const _0x17b9a7=_0x361171,_0x3de3c8={};_0x3de3c8['recursive']=!![],fs[_0x17b9a7(0x250)](path[_0x17b9a7(0x254)](_0x22d8fd),_0x3de3c8);const _0x33c188=_0x22d8fd+'.'+crypto[_0x17b9a7(0x240)]()+'.tmp',_0x36e4d1=fs[_0x17b9a7(0x1fb)](_0x33c188,'wx',0x180);try{fs[_0x17b9a7(0x282)](_0x36e4d1,_0xe6f057),fs[_0x17b9a7(0x272)](_0x36e4d1);}finally{fs[_0x17b9a7(0x247)](_0x36e4d1);}try{fs[_0x17b9a7(0x227)](_0x33c188,_0x22d8fd);}finally{try{fs[_0x17b9a7(0x26a)](_0x33c188);}catch{}}}function removeToml(_0x1da74b,_0x2eca11){const _0x48934f=_0x361171;return _0x1da74b[_0x48934f(0x269)](/(?=^\[)/m)[_0x48934f(0x249)](_0x174fb9=>{const _0x183131=_0x48934f,_0x377611=_0x174fb9[_0x183131(0x23a)](/^\[mcp_servers\.(?:"([^"]+)"|'([^']+)'|([^\.\]\r\n]+))(?:\.[^\]]+)?\]/)?.['slice'](0x1)[_0x183131(0x1cc)](Boolean);return!_0x2eca11[_0x183131(0x27b)](_0x377611);})[_0x48934f(0x266)]('');}function profileFor(_0x522740,_0x1802ae){const _0x40a403=_0x361171;if(_0x1802ae[_0x40a403(0x20e)]){if(_0x1802ae[_0x40a403(0x20e)]['split'](/\r?\n/)[_0x40a403(0x1ee)](_0x3b815c=>_0x3b815c[_0x40a403(0x212)]()&&!_0x3b815c[_0x40a403(0x212)]()['startsWith']('#')&&!/^\[mcp_servers\.[^\]]+\]$|^\s*(command|args)\s*=/[_0x40a403(0x255)](_0x3b815c)))fail(_0x40a403(0x218));const _0x2ad421={};return _0x2ad421[_0x40a403(0x205)]={},_0x2ad421[_0x40a403(0x28e)]={},_0x2ad421;}const _0x322508=structuredClone(_0x1802ae);require(_0x40a403(0x251))[_0x40a403(0x230)](_0x522740,_0x322508);if(_0x322508[_0x40a403(0x237)]!==undefined){if(_0x322508[_0x40a403(0x237)]!==_0x40a403(0x24a))fail(_0x40a403(0x218));delete _0x322508[_0x40a403(0x237)];}for(const _0x2d55bc of Object[_0x40a403(0x20d)](_0x322508))if(!['command',_0x40a403(0x20f),'env',_0x40a403(0x28e)][_0x40a403(0x27b)](_0x2d55bc))fail(_0x40a403(0x218));const _0x3fdc74=_0x322508[_0x40a403(0x205)]||{};if(Array[_0x40a403(0x1e9)](_0x3fdc74)||typeof _0x3fdc74!=='object'||Object[_0x40a403(0x284)](_0x3fdc74)[_0x40a403(0x1ee)](([_0x38ccc3,_0x53c37e])=>typeof _0x53c37e!==_0x40a403(0x203)||/^(APT_|MCP_SKIP_|NODE_OPTIONS$|NODE_PATH$)/i[_0x40a403(0x255)](_0x38ccc3))||new Set(Object[_0x40a403(0x20d)](_0x3fdc74)['map'](_0xa3aca6=>_0xa3aca6[_0x40a403(0x226)]()))['size']!==Object[_0x40a403(0x20d)](_0x3fdc74)[_0x40a403(0x26e)])fail(_0x40a403(0x218));const _0x2a7304=_0x322508[_0x40a403(0x28e)]||{};if(Array[_0x40a403(0x1e9)](_0x2a7304)||typeof _0x2a7304!=='object'||Object['values'](_0x2a7304)['some'](_0x2f72bb=>!_0x2f72bb||typeof _0x2f72bb!==_0x40a403(0x20b)||Array[_0x40a403(0x1e9)](_0x2f72bb)||Object['keys'](_0x2f72bb)[_0x40a403(0x1ee)](_0x1872c9=>![_0x40a403(0x257),_0x40a403(0x285)][_0x40a403(0x27b)](_0x1872c9))||Object[_0x40a403(0x217)](_0x2f72bb)[_0x40a403(0x1ee)](_0x2d8280=>typeof _0x2d8280!=='boolean')))fail('MIGRATION_PROFILE_UNSUPPORTED');const _0x17d596={};return _0x17d596[_0x40a403(0x205)]=_0x3fdc74,_0x17d596['tools']=_0x2a7304,_0x17d596;}function serverMap(_0x16298e,_0x45f2d4){const _0x41751d=_0x361171,_0xa23d76=IDE_REGISTRY[_0x45f2d4],_0x2a9908=parseJson(_0x16298e,{'jsonc':_0xa23d76[_0x41751d(0x25e)]}),_0x33b79=_0x2a9908[_0xa23d76[_0x41751d(0x1df)]]||{};if(Array[_0x41751d(0x1e9)](_0x33b79)||typeof _0x33b79!=='object')fail(_0x41751d(0x22e));if(_0x45f2d4===_0x41751d(0x29b)&&Object[_0x41751d(0x217)](_0x2a9908[_0x41751d(0x261)]||{})[_0x41751d(0x1ee)](_0x47cdff=>Object[_0x41751d(0x20d)](_0x47cdff?.['mcpServers']||{})['some'](isApt)))fail(_0x41751d(0x29d));return _0x33b79;}const _0x28743d={};_0x28743d[_0x361171(0x232)]=[];function _0x4c42(_0x3ef1e8,_0x2cccd9){_0x3ef1e8=_0x3ef1e8-0x1c3;const _0xf0fcae=_0xf0fc();let _0x4c428e=_0xf0fcae[_0x3ef1e8];if(_0x4c42['yjpDTx']===undefined){var _0x387475=function(_0x546ef7){const _0x38532b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1cee52='',_0x236a84='';for(let _0x699fd7=0x0,_0x28743d,_0x37dbae,_0x1ccfa2=0x0;_0x37dbae=_0x546ef7['charAt'](_0x1ccfa2++);~_0x37dbae&&(_0x28743d=_0x699fd7%0x4?_0x28743d*0x40+_0x37dbae:_0x37dbae,_0x699fd7++%0x4)?_0x1cee52+=String['fromCharCode'](0xff&_0x28743d>>(-0x2*_0x699fd7&0x6)):0x0){_0x37dbae=_0x38532b['indexOf'](_0x37dbae);}for(let _0x2a6606=0x0,_0x1c89aa=_0x1cee52['length'];_0x2a6606<_0x1c89aa;_0x2a6606++){_0x236a84+='%'+('00'+_0x1cee52['charCodeAt'](_0x2a6606)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x236a84);};_0x4c42['MRThdW']=_0x387475,_0x4c42['FYaehC']={},_0x4c42['yjpDTx']=!![];}const _0x5c4679=_0xf0fcae[0x0],_0x19e255=_0x3ef1e8+_0x5c4679,_0x5b6836=_0x4c42['FYaehC'][_0x19e255];return!_0x5b6836?(_0x4c428e=_0x4c42['MRThdW'](_0x4c428e),_0x4c42['FYaehC'][_0x19e255]=_0x4c428e):_0x4c428e=_0x5b6836,_0x4c428e;}function replacementFor(_0x262351,_0x53d556,_0x3d23bf,_0x2cd4a1=_0x28743d){const _0x9d09e9=_0x361171,_0xbb6640=IDE_REGISTRY[_0x262351[_0x9d09e9(0x1fc)]],_0x3f16de=_0x53d556?.[_0x9d09e9(0x20c)]()||'',_0x92e70b=[_0x3d23bf[_0x9d09e9(0x280)]('\x5c','/'),_0x9d09e9(0x1f8),_0x9d09e9(0x1ca),_0x262351[_0x9d09e9(0x1fc)]];if(_0x262351[_0x9d09e9(0x274)]===_0x9d09e9(0x22b)){if(!_0x53d556)return _0x3f16de;if(_0xbb6640['format']===_0x9d09e9(0x20e))return _0x3f16de;const _0xffb563={};_0xffb563['jsonc']=_0xbb6640[_0x9d09e9(0x25e)];const _0x17bab7=parseJson(_0x3f16de,_0xffb563);_0x17bab7[_0xbb6640[_0x9d09e9(0x1df)]]||={};const _0x279636=_0x2cd4a1[_0x9d09e9(0x232)]['filter'](_0x54ac0f=>_0x54ac0f[_0x9d09e9(0x220)]===_0x262351[_0x9d09e9(0x220)]&&_0x54ac0f[_0x9d09e9(0x21a)]);for(const _0x54b1ee of _0x279636){const _0x3e7f72=_0x17bab7[_0xbb6640[_0x9d09e9(0x1df)]][_0x54b1ee[_0x9d09e9(0x245)]];if(!_0x3e7f72)continue;delete _0x17bab7[_0xbb6640[_0x9d09e9(0x1df)]][_0x54b1ee['alias']];const _0x18db1a=[_0x3d23bf[_0x9d09e9(0x280)]('\x5c','/'),'--path',_0x262351['workspace'][_0x9d09e9(0x280)]('\x5c','/')],_0x12f412={..._0x3e7f72};_0x12f412[_0x9d09e9(0x276)]=_0x9d09e9(0x202),_0x12f412['args']=_0x18db1a,_0x17bab7[_0xbb6640[_0x9d09e9(0x1df)]][_0x9d09e9(0x28c)]=_0x12f412;}return JSON[_0x9d09e9(0x1f0)](_0x17bab7,null,0x2);}if(_0xbb6640[_0x9d09e9(0x278)]===_0x9d09e9(0x20e)){const _0x158621=removeToml(_0x3f16de,_0x262351[_0x9d09e9(0x1f3)]);return _0x262351[_0x9d09e9(0x274)]===_0x9d09e9(0x233)?_0x158621[_0x9d09e9(0x267)]()+_0x9d09e9(0x298)+JSON[_0x9d09e9(0x1f0)](_0x92e70b)+'\x0a':_0x158621;}serverMap(_0x3f16de||'{}',_0x262351['host']);const _0x93a913={};_0x93a913[_0x9d09e9(0x25e)]=_0xbb6640[_0x9d09e9(0x25e)];const _0x51c579=parseJson(_0x3f16de||'{}',_0x93a913);_0x51c579[_0xbb6640[_0x9d09e9(0x1df)]]||={};for(const _0x4da174 of _0x262351['aliases'])delete _0x51c579[_0xbb6640[_0x9d09e9(0x1df)]][_0x4da174];if(_0x262351[_0x9d09e9(0x274)]==='global'){const _0x106835={};_0x106835[_0x9d09e9(0x276)]=_0x9d09e9(0x202),_0x106835[_0x9d09e9(0x20f)]=_0x92e70b;const _0x3a2a6f=_0x106835;if(_0x262351['host']===_0x9d09e9(0x21b))require(_0x9d09e9(0x251))['configureAntigravityDiscovery'](_0x3a2a6f);_0x51c579[_0xbb6640[_0x9d09e9(0x1df)]][_0x9d09e9(0x28c)]=_0x3a2a6f;}return JSON[_0x9d09e9(0x1f0)](_0x51c579,null,0x2);}function _0xf0fc(){const _0x1570c8=['y2XVC2vK','tgvNywn5ignVBM5Ly3rPB25ZihjLy29UBMvJDgvKig9YignSB3nLza','BwfW','ywrVChrLza','yxb0lw1JCc1Hz2vUDa','BM9KztP1DgLS','Dg9VBhm','CMvHzhKTBMv4Dc1JB25Uzwn0Aw9U','Agv4','y29UzMLNDxjLqw50AwDYyxzPDhLeAxnJB3zLCNK','lI4Vy29Yzs9YDw4Ty29TCgf0AwjPBgL0Eq','D2LUmZi','nduYnZG0mhrit09HBG','yxbWBgLLza','ChjVAMvJDfbHDgHZ','CMvJzwLWDc1JB25MAxjTzwq','cGPBBwnWx3nLCNzLCNmUyxb0lw1JCc1Hz2vUDf0ky29TBwfUzca9icjUB2rLiGPHCMDZid0G','zNjVEMvU','DhjHBNnHy3rPB25jza','y2XHDwrL','y2HHBMDLrMvUy2u','tunqx05fu1rfrf9sruDju1rsqvrjt05Fvu5tvvbqt1juruq','ywrK','Bhn0yxrtEw5J','lNjLCgXHy2vTzw50','BM9KztPJCNLWDg8','iI0Tz2f0zxDHEsi','y29Kzq','BwLNCMf0Aw9Ulq','Dw5RBM93BG','ls1OB3n0','BgLZDa','zMLUza','DMvYC2LVBG','BM9KztPVCW','lMfUAgrO','C3rHDhvZ','AxnezwvWu3rYAwn0rxf1ywW','C3rHDgu','ywnXDwLYzvj1BNrPBwvmB2nR','D29YA3nWywnLuNvUuM9VDhm','zMvUy2u','y29UzMLNC0nOyw5Nzwq','ls1WyxrO','Bw9KzwXFBgLZDa','ChjVzMLSzuzVCG','lI9JB25Uzwn0Aw9UlwfJDgL2yxrPB24','DMvYAwzPzwq','CMvWBgfJzw1LBNq','lI4Vy29Yzs9YDw50Aw1Llw93BMvYC2HPCa','zw5YB2XS','Dg9Wtgv2zwXlzxK','lI4Vy29Yzs93B3jRC3bHy2uTCgf0Aa','CM9SBgvKlwjHy2S','yxbWBhKTAw50zw50','tuLhuKfusu9ox1bst0zjtevFq09orKXjq1q','CMvHzezLBMnL','mtG4mduYotbTze9bz1K','ChvZAa','ru5pru5u','Ag9ZDhm','AxnbCNjHEq','ngHYAKfztW','ywXSB2m','CMvJB3zLCNK','ChjVAMvJDenVBMzPzW','C29Tzq','Bgf1BMnOzxiUANm','C3rYAw5NAwz5','tevhqunzx0nmt1nvuKvFvu5wrvjjrKLfra','twf0y2HPBMCGB3DUzxjZAgLWihjLy2vPChrZ','ywXPyxnLCW','BwLNCMf0Aw9UugXHBG','z2XVyMfSq29UzMLN','y29UzMLNCW','zMLUzeLUzgv4','ls1NyxrLD2f5','lI9YzwDPC3rYyxrPB24TCMvJzwLWDa','ChjVAMvJDhnfBNjVBgXLza','B3bLBLn5BMm','Ag9ZDa','CMvZB2X2zq','CMvTB3zLq29UzMLNqxrVBwLJ','nZyWnJG4z05gEMTd','CMv2Awv3lxjLCxvPCMvK','uKvhsvnuuKfusu9ox09xtKvsu0Hjuf9srvfvsvjfra','BM9Kzq','C3rYAw5N','B3DUzwqTCMvNAxn0CMf0Aw9Ulw1Pz3jHDgLVBG','zw52','ChjVzMLSzq','y29UDgfPBNnxB3jRC3bHy2u','AxngAwXL','zxbVy2G','AM91CM5HBc5QC29U','B2jQzwn0','Dg9tDhjPBMC','A2v5CW','Dg9TBa','yxjNCW','ChjVB2y','D29YA3nWywnLt3DUzxjZAgLW','DhjPBq','mJCYndq3CNbbuLjK','BM9KztPMCW','oty5odHPzhHJtfK','C2HHmJu2','DMfSDwvZ','tuLhuKfusu9ox1bst0zjtevFvu5tvvbqt1juruq','lI4Vy29Yzs9VD25Lzc1SB2nR','CMv3CML0zvjLCxvPCMvK','yw50AwDYyxzPDhK','vu5tvvbqt1jururFse9tva','yxnZAwDU','ywrVChrHyMXL','yMXVy2TLCNm','y29UzMLNugf0Aa','zw50CNLiyxnO','zMfPBgvK','mJCWr1LeBwLK','C2vYDMLUz0nVBMzPCM1Lza','DxrMoa','Dg9vChbLCKnHC2u','CMvUyw1Lu3LUyW','BMv3sgfZAa','tuLhuKfusu9ox1bmqu5Fq0HbtKDfra','nda3mZqXofb2sNPICG','ChjVAMvJDa','yxbWBhLPBMC','yxb0lxj1BNrPBwu','su5wquXjrf9dt05gsuC','B3bLBG','BwLNCMf0zuDLBMvYyxrLzezPzwXKCW','Dg9ju09tDhjPBMC','CMvJB3jKCW','z2XVyMfS','CMvHzezPBgvtEw5J','r0furvDbwv9mqvvoq0HfuL9srvfvsvjfra','z2f0zxDHEs1TAwDYyxrPB24','DhLWzq','uKvhsvnuuKfusu9ox0nptKzjr19dt05gteLdva','CMv2zxjZzq','Bwf0y2G','v09ss1nqqunfx0jjtKrjtKDFuKvrvuLsruq','DxbKyxrL','lI93B3jRC3bHy2uTCMvNAxn0CNK','CMvNAxn0CNK','tuLhuKfusu9ox05fvvrsquXFufjprKLmrv9vtLnvufbpuLrfra','CMfUzg9Tvvvjra','D29YA3nWywnL','BgvNywn5lw93BMvYC2HPCc11BNzLCMLMAwvK','CgvUzgLUzY1ZywzLlwjVDw5Kyxj5','B3bLCMf0Aw9UCW','ywXPyxm','yxbWBhLnAwDYyxrPB24','y2XVC2vtEw5J','CMv2Awv3','zMLSDgvY','C3rKAw8','zhjHAw5PBMC','tuLhuKfusu9ox1nuquDfx0nptKzmsunu','zxHPC3rZu3LUyW','C2vZC2LVBL9IB290C3rYyxa','ChjLCgfYzwq','BwTKAxjtEw5J','lI9WBgf0zM9YBs1JB25MAwC','y29TBwL0DgvK','ChjVzMLSzxm','zgLYBMfTzq','DgvZDa','BwLNCMf0Aw9UlMXVy2S','zwfNzxi','CMvHBhbHDgHtEw5J','Dg9mB3DLCKnHC2u','C2LUz2XLlwDHDgv3yxK','Aw5JBhvKzvjLz2LZDgvYzwrqCM9Qzwn0CW','Aw5JBhvKzuDSB2jHBa','mtqZnZGYmJLoAg1qz0u','ANnVBMm','AM91CM5HBa','C2fTzvDVCMTZCgfJzq','ChjVAMvJDhm','tuLhuKfusu9ox0PpvvjoquXFsu5wquXjra','zw50CNK','Ag9TzwrPCG','B2XKsgfZAa','AM9PBG','DhjPBuvUza','tuLhuKfusu9ox1bmqu5Fsu5wquXjra','C3bSAxq','Dw5SAw5Ru3LUyW','q09otKvdveLptL9pv05fuLnisvbFuKvrvuLsruq','ChjVDMvUyw5Jzq','y29TBwL0DgLUzW','BgvUz3rO','lM9YAwDPBMfS','CM9VDa','qvbux1vqrefurv9qru5esu5h','zNn5BMntEw5J','yMXVy2TLzc1WCM9Qzwn0lxn5BMm','C2nVCgu','CMvNAxn0CMf0Aw9UsgfZAa','y29TBwfUza','AxntEw1IB2XPy0XPBMS','zM9YBwf0','tuLhuKfusu9ox1bbveHFrvndqvbf','mZvvwhH6teO','Aw5JBhvKzxm','Bgf1BMnOzxi','CMvJB25Uzwn0lxjLCxvPCMvK','B3jPz2LUywW','C2XPy2u','CMvWBgfJzufSBa','lI9Tyw5Hz2vKlwnVBMzPzW','D3jPDgvgAwXLu3LUyW','A2LUza','zw50CMLLCW','zw5HyMXLza','B3bLCMf0Aw9UC1jLCxvPCMvK','zMLSzq'];_0xf0fc=function(){return _0x1570c8;};return _0xf0fc();}function validateJournal(_0xdfa3c6,_0xfe6bb7,_0x22a8da,_0x5b257c){const _0x52dbcb=_0x361171;if(!['prepared','applying',_0x52dbcb(0x26d),_0x52dbcb(0x252),_0x52dbcb(0x1e1)][_0x52dbcb(0x27b)](_0xdfa3c6[_0x52dbcb(0x1d0)])||_0xdfa3c6[_0x52dbcb(0x244)][_0x52dbcb(0x26e)]!==_0xfe6bb7['configs'][_0x52dbcb(0x26e)])fail(_0x52dbcb(0x262));const _0xd65422=[];for(const [_0x38a6ef,_0x328592]of _0xfe6bb7['configs'][_0x52dbcb(0x284)]()){const _0x4888ba=_0xdfa3c6['operations'][_0x38a6ef];for(const _0x2a6735 of[_0x52dbcb(0x1fc),'scope',_0x52dbcb(0x220),'oldHash',_0x52dbcb(0x1f3)])if(!require('node:util')[_0x52dbcb(0x1d1)](_0x4888ba[_0x2a6735],_0x328592[_0x2a6735]))fail('MIGRATION_JOURNAL_INVALID');approvedPath(_0x328592,_0xfe6bb7);const _0x57aac7=_0x328592['oldHash']?staged(_0x22a8da,_0x38a6ef,_0x52dbcb(0x27e),_0x328592[_0x52dbcb(0x265)]):null,_0x3f984f=replacementFor(_0x328592,_0x57aac7,_0x5b257c,_0xfe6bb7);if(hash(_0x3f984f)!==_0x4888ba[_0x52dbcb(0x228)])fail('MIGRATION_JOURNAL_INVALID');staged(_0x22a8da,_0x38a6ef,'replacement',_0x4888ba[_0x52dbcb(0x228)]);for(const _0x168220 of _0xfe6bb7[_0x52dbcb(0x232)]['filter'](_0x591f37=>_0x591f37[_0x52dbcb(0x220)]===_0x328592[_0x52dbcb(0x220)])){if(!_0x328592[_0x52dbcb(0x1f3)][_0x52dbcb(0x27b)](_0x168220[_0x52dbcb(0x245)])||_0x168220[_0x52dbcb(0x1fc)]!==_0x328592[_0x52dbcb(0x1fc)]||_0x168220[_0x52dbcb(0x274)]!==_0x328592[_0x52dbcb(0x274)]||_0x168220['ownership']!==_0x52dbcb(0x297))fail(_0x52dbcb(0x262));const _0x257e30=configEntry(_0x57aac7?.[_0x52dbcb(0x20c)]()||'',_0x328592[_0x52dbcb(0x1fc)],_0x168220[_0x52dbcb(0x245)]);if(!_0x257e30||entryHash(_0x257e30)!==_0x168220[_0x52dbcb(0x221)])fail(_0x52dbcb(0x262));const _0x2e2107=profileFor(_0x328592[_0x52dbcb(0x1fc)],_0x257e30);if(!_0x168220[_0x52dbcb(0x241)]){if(Object[_0x52dbcb(0x20d)](_0x2e2107['env']||{})[_0x52dbcb(0x26e)]||Object[_0x52dbcb(0x20d)](_0x2e2107[_0x52dbcb(0x28e)]||{})[_0x52dbcb(0x1ee)](_0x4d640d=>![_0x52dbcb(0x24e),_0x52dbcb(0x1d8)][_0x52dbcb(0x27b)](_0x4d640d)||Object[_0x52dbcb(0x20d)](_0x2e2107['tools'][_0x4d640d])[_0x52dbcb(0x1ee)](_0x263f16=>_0x263f16!==_0x52dbcb(0x257))))fail(_0x52dbcb(0x23f));continue;}const _0x1dde4b=fs[_0x52dbcb(0x258)](_0x168220[_0x52dbcb(0x241)]);if(!_0xfe6bb7[_0x52dbcb(0x261)][_0x52dbcb(0x1ee)](_0x40a01f=>require('../core/workspace-path')[_0x52dbcb(0x260)](_0x40a01f,_0x1dde4b)))fail(_0x52dbcb(0x262));const _0x1b7cf8=_0xd65422[_0x52dbcb(0x1cc)](_0x217021=>_0x217021['host']===_0x168220['host']&&require(_0x52dbcb(0x1e0))[_0x52dbcb(0x260)](_0x217021[_0x52dbcb(0x241)],_0x1dde4b));if(_0x1b7cf8&&!require(_0x52dbcb(0x28d))[_0x52dbcb(0x1d1)](_0x1b7cf8['profile'],_0x2e2107))fail(_0x52dbcb(0x1e3));const _0x3adef6={};_0x3adef6['workspace']=_0x1dde4b,_0x3adef6[_0x52dbcb(0x1fc)]=_0x168220[_0x52dbcb(0x1fc)],_0x3adef6['profile']=_0x2e2107;if(!_0x1b7cf8)_0xd65422['push'](_0x3adef6);}}if(!require('node:util')['isDeepStrictEqual'](_0xd65422,_0xdfa3c6[_0x52dbcb(0x253)]))fail(_0x52dbcb(0x262));}function migrationPlan(_0x1b79c2={}){const _0x2c0d3e=_0x361171,_0x511779=Array[_0x2c0d3e(0x1e9)](_0x1b79c2[_0x2c0d3e(0x296)])&&_0x1b79c2['projectPaths'][_0x2c0d3e(0x26e)]>0x0,_0x545265=_0x511779&&_0x1b79c2[_0x2c0d3e(0x25b)]!==!![]?_0x1b79c2[_0x2c0d3e(0x296)]:[..._0x1b79c2['projectPaths']||[],...registeredProjects(_0x1b79c2)],_0xa64ea8=[...new Set(_0x545265)][_0x2c0d3e(0x249)](_0x31030d=>fs['existsSync'](_0x31030d))['map'](_0x38178d=>fs['realpathSync'](_0x38178d)),_0x7ab212=[],_0x5e4e66=[],_0x191655=[];for(const _0x41c508 of _0x1b79c2[_0x2c0d3e(0x1e8)]||Object['keys'](IDE_REGISTRY)){const _0x2a87e8=IDE_REGISTRY[_0x41c508];if(!_0x2a87e8)fail(_0x2c0d3e(0x21c));const _0x204850=[..._0x1b79c2['includeGlobal']===![]?[]:[{'scope':'global','file':_0x2a87e8[_0x2c0d3e(0x1f5)]?.(),'workspace':null}],..._0xa64ea8[_0x2c0d3e(0x28a)](_0x1eb8a0=>({'scope':_0x2c0d3e(0x22b),'file':_0x2a87e8[_0x2c0d3e(0x1ed)]?.(_0x1eb8a0),'workspace':_0x1eb8a0}))],_0x3fe920=new Set();for(const _0x56106e of _0x204850){if(!_0x56106e[_0x2c0d3e(0x287)]||_0x3fe920['has'](path[_0x2c0d3e(0x1fd)](_0x56106e[_0x2c0d3e(0x287)])))continue;_0x3fe920[_0x2c0d3e(0x29e)](path[_0x2c0d3e(0x1fd)](_0x56106e[_0x2c0d3e(0x287)]));const _0x50e03d=path[_0x2c0d3e(0x1fd)](_0x56106e[_0x2c0d3e(0x287)]),_0x44160e=read(_0x50e03d);if(!_0x44160e&&_0x56106e['scope']!==_0x2c0d3e(0x233))continue;let _0x32420a;try{_0x32420a=_0x2a87e8['format']===_0x2c0d3e(0x20e)?[...(_0x44160e?.[_0x2c0d3e(0x20c)]()||'')['matchAll'](/^\[mcp_servers\.(?:"([^"]+)"|'([^']+)'|([^\.\]\r\n]+))(?:\.[^\]]+)?\]/gm)][_0x2c0d3e(0x28a)](_0x1e1c15=>_0x1e1c15[_0x2c0d3e(0x27f)](0x1)['find'](Boolean))[_0x2c0d3e(0x249)](isApt):Object['keys'](serverMap(_0x44160e?.['toString']()||'{}',_0x41c508))[_0x2c0d3e(0x249)](isApt);}catch(_0x56e83c){const _0x218d65={};_0x218d65[_0x2c0d3e(0x1c7)]=_0x56e83c[_0x2c0d3e(0x1c7)]||'INVALID_CONFIG',_0x218d65[_0x2c0d3e(0x1fc)]=_0x41c508,_0x218d65[_0x2c0d3e(0x220)]=_0x50e03d,_0x191655['push'](_0x218d65);continue;}_0x32420a=[...new Set(_0x32420a)];if(!_0x32420a[_0x2c0d3e(0x26e)]&&_0x56106e[_0x2c0d3e(0x274)]!==_0x2c0d3e(0x233))continue;const _0x5174d9={'host':_0x41c508,'scope':_0x56106e[_0x2c0d3e(0x274)],'workspace':_0x56106e[_0x2c0d3e(0x241)]||null,'configPath':_0x50e03d,'oldHash':_0x44160e?hash(_0x44160e):null,'aliases':_0x32420a};_0x7ab212[_0x2c0d3e(0x1e6)](_0x5174d9);for(const _0x26e215 of _0x32420a){const _0x17efcf=configEntry(_0x44160e['toString'](),_0x41c508,_0x26e215),_0x32e9e8={};_0x32e9e8['host']=_0x41c508,_0x32e9e8[_0x2c0d3e(0x274)]=_0x56106e[_0x2c0d3e(0x274)],_0x32e9e8[_0x2c0d3e(0x220)]=_0x50e03d,_0x32e9e8['alias']=_0x26e215,_0x32e9e8[_0x2c0d3e(0x263)]=_0x17efcf,_0x32e9e8[_0x2c0d3e(0x241)]=_0x56106e[_0x2c0d3e(0x274)]===_0x2c0d3e(0x22b)?_0x56106e[_0x2c0d3e(0x241)]:undefined;const _0x1d45ef=matchingReceipt(_0x32e9e8,_0x1b79c2),_0x11e511=_0x56106e['scope']==='project'&&_0x1b79c2['launcher']&&_0x17efcf?.[_0x2c0d3e(0x276)]===_0x2c0d3e(0x202)&&Array['isArray'](_0x17efcf[_0x2c0d3e(0x20f)])&&_0x17efcf[_0x2c0d3e(0x20f)]['length']===0x3&&_0x17efcf[_0x2c0d3e(0x20f)][0x0]&&path[_0x2c0d3e(0x1fd)](_0x17efcf[_0x2c0d3e(0x20f)][0x0])===path[_0x2c0d3e(0x1fd)](_0x1b79c2[_0x2c0d3e(0x27c)])&&_0x17efcf[_0x2c0d3e(0x20f)][0x1]===_0x2c0d3e(0x1d7)&&((()=>{const _0x55979c=_0x2c0d3e;try{return sameWorkspace(_0x17efcf[_0x55979c(0x20f)][0x2],_0x56106e[_0x55979c(0x241)]);}catch{return![];}})()),_0x2af7e0=!_0x11e511,_0x2eae26={'host':_0x41c508,'scope':_0x56106e[_0x2c0d3e(0x274)],'configPath':_0x50e03d,'alias':_0x26e215,'entryHash':entryHash(_0x17efcf),'ownership':_0x1d45ef?_0x2c0d3e(0x297):_0x11e511?_0x2c0d3e(0x21e):_0x2c0d3e(0x1c9),'workspace':_0x1d45ef?.['workspace']||_0x56106e[_0x2c0d3e(0x241)],'rewriteRequired':_0x2af7e0};_0x5e4e66[_0x2c0d3e(0x1e6)](_0x2eae26);const _0x105a69={};_0x105a69[_0x2c0d3e(0x1c7)]=_0x2c0d3e(0x201),_0x105a69['host']=_0x41c508,_0x105a69[_0x2c0d3e(0x220)]=_0x50e03d,_0x105a69['alias']=_0x26e215;if(!_0x1d45ef&&_0x2af7e0)_0x191655[_0x2c0d3e(0x1e6)](_0x105a69);else{if(!_0x2eae26[_0x2c0d3e(0x241)]&&!(_0x26e215===_0x2c0d3e(0x28c)&&(_0x17efcf[_0x2c0d3e(0x20f)]||[])['includes'](_0x2c0d3e(0x1f8))||_0x17efcf['toml']?.[_0x2c0d3e(0x27b)](_0x2c0d3e(0x1c6))))_0x191655[_0x2c0d3e(0x1e6)]({'code':_0x2c0d3e(0x23b),'host':_0x41c508,'configPath':_0x50e03d,'alias':_0x26e215});}try{profileFor(_0x41c508,_0x17efcf);}catch(_0x762dd9){const _0x4ef79d={};_0x4ef79d[_0x2c0d3e(0x1c7)]=_0x762dd9['code'],_0x4ef79d[_0x2c0d3e(0x1fc)]=_0x41c508,_0x4ef79d[_0x2c0d3e(0x220)]=_0x50e03d,_0x4ef79d['alias']=_0x26e215,_0x191655['push'](_0x4ef79d);}}}}const _0x5219bd=_0x5e4e66[_0x2c0d3e(0x1ee)](_0x20a160=>_0x20a160[_0x2c0d3e(0x21a)]);return{'version':0x1,'kind':_0x2c0d3e(0x25a),'projects':_0xa64ea8,'hosts':_0x1b79c2['hosts']||Object['keys'](IDE_REGISTRY),'includeGlobal':_0x1b79c2['includeGlobal']!==![],'includeRegisteredProjects':_0x1b79c2[_0x2c0d3e(0x25b)]===!![],'launcher':_0x1b79c2['launcher']||null,'configs':_0x7ab212,'records':_0x5e4e66,'operationsRequired':_0x5219bd,'blockers':_0x191655,'status':_0x191655[_0x2c0d3e(0x26e)]?'blocked':_0x2c0d3e(0x200),'requirements':[_0x2c0d3e(0x1f2),'No\x20admitted\x20worker\x20or\x20operation',_0x2c0d3e(0x289)]};}function approvedPath(_0xbe2531,_0x12733c){const _0x17e295=_0x361171,_0x3d3fc6=IDE_REGISTRY[_0xbe2531['host']];if(!_0x3d3fc6||![_0x17e295(0x233),'project'][_0x17e295(0x27b)](_0xbe2531[_0x17e295(0x274)]))fail('MIGRATION_PATH_ESCAPE');const _0x9e8519=_0xbe2531[_0x17e295(0x274)]===_0x17e295(0x233)?[_0x3d3fc6[_0x17e295(0x1f5)]?.()]:_0x12733c['projects'][_0x17e295(0x28a)](_0x42ebcd=>_0x3d3fc6[_0x17e295(0x1ed)]?.(_0x42ebcd)),_0x2bfdb8=_0x25cd3b=>process['platform']===_0x17e295(0x293)?path[_0x17e295(0x1fd)](_0x25cd3b)[_0x17e295(0x259)]():path['resolve'](_0x25cd3b);if(!_0x9e8519[_0x17e295(0x249)](Boolean)[_0x17e295(0x1ee)](_0x143aec=>_0x2bfdb8(_0x143aec)===_0x2bfdb8(_0xbe2531[_0x17e295(0x220)])))fail(_0x17e295(0x279));let _0x23791b=_0xbe2531[_0x17e295(0x220)];while(!fs[_0x17e295(0x24d)](_0x23791b)&&path[_0x17e295(0x254)](_0x23791b)!==_0x23791b)_0x23791b=path[_0x17e295(0x254)](_0x23791b);if(_0x2bfdb8(_0x23791b)!==_0x2bfdb8(fs[_0x17e295(0x258)](_0x23791b))||fs['existsSync'](_0xbe2531[_0x17e295(0x220)])&&(!fs[_0x17e295(0x1c3)](_0xbe2531[_0x17e295(0x220)])[_0x17e295(0x208)]()||fs[_0x17e295(0x1c3)](_0xbe2531[_0x17e295(0x220)])[_0x17e295(0x277)]()))fail(_0x17e295(0x279));}function staged(_0x1be9fe,_0x511774,_0xb8d025,_0x56faec){const _0x3efcbf=_0x361171,_0x11c324=path['join'](_0x1be9fe,_0x511774+'.'+_0xb8d025);if(!fs[_0x3efcbf(0x1c3)](_0x11c324)[_0x3efcbf(0x208)]()||fs[_0x3efcbf(0x1c3)](_0x11c324)[_0x3efcbf(0x277)]()||!require(_0x3efcbf(0x1e0))[_0x3efcbf(0x207)](_0x1be9fe,fs[_0x3efcbf(0x258)](_0x11c324)))fail('MIGRATION_STAGE_CONFLICT');const _0x59b7ba=fs[_0x3efcbf(0x234)](_0x11c324);if(hash(_0x59b7ba)!==_0x56faec)fail(_0x3efcbf(0x24c));return _0x59b7ba;}async function applyMigration(_0x19597b,_0x5ef2a2={}){const _0x584a6f=_0x361171;if(_0x19597b?.[_0x584a6f(0x1cd)]!==0x1||_0x19597b[_0x584a6f(0x283)]!==_0x584a6f(0x25a)||!Array['isArray'](_0x19597b['hosts'])||!Array[_0x584a6f(0x1e9)](_0x19597b['projects'])||!Array['isArray'](_0x19597b[_0x584a6f(0x1f6)])||!Array[_0x584a6f(0x1e9)](_0x19597b[_0x584a6f(0x232)]))fail(_0x584a6f(0x268));const _0x31f60d=hash(JSON['stringify'](_0x19597b)),_0x4ec611=rootFor(_0x5ef2a2),_0x1ed9c5=path['join'](_0x4ec611,_0x31f60d),_0x55948b=path[_0x584a6f(0x266)](_0x1ed9c5,_0x584a6f(0x20a)),_0x3a1a8c=_0x5ef2a2[_0x584a6f(0x23e)]||new WorkspaceRegistry(),_0x4ebffd=_0x5ef2a2[_0x584a6f(0x27c)]||path[_0x584a6f(0x266)](os[_0x584a6f(0x264)](),_0x584a6f(0x1cf),_0x584a6f(0x22d),_0x584a6f(0x1ef));let _0xe20d0f;try{if(fs['lstatSync'](_0x55948b)['isSymbolicLink']())fail(_0x584a6f(0x279));_0xe20d0f=JSON['parse'](fs['readFileSync'](_0x55948b));if(_0xe20d0f[_0x584a6f(0x1cd)]!==0x1||_0xe20d0f['id']!==_0x31f60d||hash(JSON[_0x584a6f(0x1f0)](_0xe20d0f[_0x584a6f(0x248)]))!==_0x31f60d||!Array[_0x584a6f(0x1e9)](_0xe20d0f[_0x584a6f(0x244)])||!Array[_0x584a6f(0x1e9)](_0xe20d0f[_0x584a6f(0x253)]))fail(_0x584a6f(0x262));}catch(_0x22760d){if(_0x22760d[_0x584a6f(0x1c7)]!==_0x584a6f(0x1e7))throw _0x22760d;}if(!_0xe20d0f||_0xe20d0f[_0x584a6f(0x1d0)]===_0x584a6f(0x1e1)){const _0x3e3e42={..._0x5ef2a2};_0x3e3e42[_0x584a6f(0x296)]=_0x19597b['projects'],_0x3e3e42['hosts']=_0x19597b[_0x584a6f(0x1e8)],_0x3e3e42[_0x584a6f(0x25c)]=_0x19597b['includeGlobal'],_0x3e3e42['includeRegisteredProjects']=_0x19597b[_0x584a6f(0x25b)],_0x3e3e42[_0x584a6f(0x27c)]=_0x19597b[_0x584a6f(0x27c)]||_0x4ebffd;const _0x3894ba=migrationPlan(_0x3e3e42);if(hash(JSON[_0x584a6f(0x1f0)](_0x3894ba))!==_0x31f60d)fail(_0x584a6f(0x229));if(_0x3894ba[_0x584a6f(0x21f)]['length'])return{'status':_0x584a6f(0x273),'blockers':_0x3894ba[_0x584a6f(0x21f)]};_0xe20d0f=null;}if(!path['isAbsolute'](_0x4ebffd)||!fs[_0x584a6f(0x24d)](_0x4ebffd))fail(_0x584a6f(0x235));const _0x36b78d={};_0x36b78d['recursive']=!![],fs['mkdirSync'](_0x4ec611,_0x36b78d);if(fs[_0x584a6f(0x258)](_0x4ec611)!==path['resolve'](_0x4ec611))fail(_0x584a6f(0x279));const _0xedd75d=require(_0x584a6f(0x219))[_0x584a6f(0x1d3)](path['join'](_0x4ec611,_0x584a6f(0x256))),_0x4225dd={};_0x4225dd[_0x584a6f(0x1c7)]='MIGRATION_IN_PROGRESS';const _0x233cc6={};_0x233cc6[_0x584a6f(0x1d0)]=_0x584a6f(0x243),_0x233cc6[_0x584a6f(0x21f)]=[_0x4225dd];if(!_0xedd75d)return _0x233cc6;const _0x31bfc2=require('../core/admission-fence'),_0x229c80=[];let _0x4b1fe2=!_0xe20d0f,_0x531b27=![];const _0x10e3ec=_0x25548b=>{const _0x52deaf=_0x584a6f;_0xe20d0f[_0x52deaf(0x1d0)]=_0x25548b,_0xe20d0f['updatedAt']=new Date()[_0x52deaf(0x231)](),durable(_0x55948b,JSON[_0x52deaf(0x1f0)](_0xe20d0f));},_0x33307b=_0xd962f6=>{const _0x2460b3=_0x584a6f;if(!_0xe20d0f)return _0x5ef2a2;validateJournal(_0xe20d0f,_0x19597b,_0x1ed9c5,_0x4ebffd);const _0x4e9571=_0xe20d0f[_0x2460b3(0x244)][_0x2460b3(0x1f7)](_0x1743b6=>_0x1743b6[_0x2460b3(0x220)]===_0xd962f6[_0x2460b3(0x220)]);if(_0x4e9571<0x0)fail(_0x2460b3(0x262));const _0x18c5d5=_0xe20d0f[_0x2460b3(0x244)][_0x4e9571],_0x3838b8=read(_0x18c5d5[_0x2460b3(0x220)]),_0x3dc510=_0x3838b8?hash(_0x3838b8):null;if(![_0x18c5d5['oldHash'],_0x18c5d5[_0x2460b3(0x228)]][_0x2460b3(0x27b)](_0x3dc510))fail(_0x2460b3(0x238));return{..._0x5ef2a2,'originalConfig':staged(_0x1ed9c5,_0x4e9571,_0x2460b3(0x27e),_0x18c5d5[_0x2460b3(0x265)])[_0x2460b3(0x20c)]()};};try{if(_0x19597b[_0x584a6f(0x286)]===![]){const _0x2c6b25={};return _0x2c6b25[_0x584a6f(0x1d0)]=_0x584a6f(0x28f),_0x2c6b25[_0x584a6f(0x29a)]=_0x31f60d,_0x2c6b25[_0x584a6f(0x1d6)]=0x0,_0x2c6b25[_0x584a6f(0x1fa)]=0x0,_0x2c6b25[_0x584a6f(0x224)]=![],_0x2c6b25[_0x584a6f(0x28b)]=!![],_0x2c6b25;}for(const _0x2e4023 of _0x19597b[_0x584a6f(0x261)]){const _0x169e1b=_0x31bfc2['readFence'](_0x2e4023),_0x4f5dc0=_0x584a6f(0x1c8)+_0x31f60d,_0x10bacc={};_0x10bacc[_0x584a6f(0x1c7)]=_0x584a6f(0x271),_0x10bacc[_0x584a6f(0x241)]=_0x2e4023;const _0xec9795={};_0xec9795[_0x584a6f(0x1d0)]='pending-safe-boundary',_0xec9795[_0x584a6f(0x21f)]=[_0x10bacc];if(_0x169e1b[_0x584a6f(0x1d2)]!==_0x584a6f(0x22f)&&_0x169e1b[_0x584a6f(0x29a)]!==_0x4f5dc0)return _0xec9795;const _0x5edba3={};_0x5edba3[_0x584a6f(0x1d2)]='draining',_0x5edba3[_0x584a6f(0x29a)]=_0x4f5dc0;const _0x1bd6ac=_0x169e1b[_0x584a6f(0x1d2)]==='open'?_0x31bfc2[_0x584a6f(0x29c)](_0x2e4023,_0x169e1b[_0x584a6f(0x209)],_0x5edba3):_0x169e1b,_0x5688fe={};_0x5688fe['workspace']=_0x2e4023,_0x5688fe[_0x584a6f(0x1d5)]=_0x1bd6ac,_0x229c80['push'](_0x5688fe);const _0x119491=require(_0x584a6f(0x292))[_0x584a6f(0x1d4)](_0x2e4023),_0xd273c=require(_0x584a6f(0x1dd))[_0x584a6f(0x211)](_0x2e4023,_0x1bd6ac,_0x119491,{'rebuildCheckpoints':!![],'budgetMs':Number(process.env.APT_RUN_INSPECTION_TIMEOUT_MS||0x1d4c0)});if(_0xd273c[_0x584a6f(0x26e)])return{'status':_0x584a6f(0x243),'blockers':_0xd273c[_0x584a6f(0x28a)](_0x5d6f18=>({'code':'OWNERSHIP_IN_FLIGHT','workspace':_0x2e4023,'kind':_0x5d6f18[_0x584a6f(0x283)]}))};const _0x866120=require(_0x584a6f(0x1da))['listWorkspaceReceipts'](_0x2e4023),_0x14a606={};_0x14a606['code']=_0x584a6f(0x26b),_0x14a606[_0x584a6f(0x241)]=_0x2e4023;const _0x509146={};_0x509146[_0x584a6f(0x1d0)]=_0x584a6f(0x27d),_0x509146['blockers']=[_0x14a606];if(_0x866120[_0x584a6f(0x26e)]||Object[_0x584a6f(0x217)](_0x1bd6ac['members']||{})[_0x584a6f(0x1ee)](_0x546b09=>_0x546b09[_0x584a6f(0x1d2)]!==_0x584a6f(0x288)))return _0x509146;}for(const _0x2d4fdd of _0x19597b[_0x584a6f(0x232)][_0x584a6f(0x249)](_0x540ed0=>_0x540ed0['workspace'])){const _0x4892b7=await _0x5ef2a2['verifyClosure']?.(_0x2d4fdd,_0x33307b(_0x2d4fdd));if(_0x4892b7?.[_0x584a6f(0x1d0)]!==_0x584a6f(0x1db)||_0x4892b7[_0x584a6f(0x275)]!==_0x2d4fdd['entryHash'])return{'status':_0x584a6f(0x242),'blockers':[{'code':'LEGACY_CLOSURE_UNVERIFIED','host':_0x2d4fdd['host'],'alias':_0x2d4fdd[_0x584a6f(0x245)]}]};}if(!_0xe20d0f){const _0xad62c5=[],_0x1d34e1=[];for(const _0x22d0a5 of _0x19597b[_0x584a6f(0x1f6)]){approvedPath(_0x22d0a5,_0x19597b);const _0x23860f=read(_0x22d0a5[_0x584a6f(0x220)]);if((_0x23860f?hash(_0x23860f):null)!==_0x22d0a5['oldHash'])fail(_0x584a6f(0x229));const _0x54447b=IDE_REGISTRY[_0x22d0a5['host']];for(const _0x4c0d1a of _0x19597b[_0x584a6f(0x232)][_0x584a6f(0x249)](_0x884e33=>_0x884e33[_0x584a6f(0x220)]===_0x22d0a5[_0x584a6f(0x220)])){const _0x38ca43=configEntry(_0x23860f[_0x584a6f(0x20c)](),_0x22d0a5[_0x584a6f(0x1fc)],_0x4c0d1a[_0x584a6f(0x245)]),_0x55516d=profileFor(_0x22d0a5[_0x584a6f(0x1fc)],_0x38ca43),_0x11bb30={};_0x11bb30['host']=_0x4c0d1a[_0x584a6f(0x1fc)],_0x11bb30['scope']=_0x4c0d1a[_0x584a6f(0x274)],_0x11bb30['configPath']=_0x4c0d1a['configPath'],_0x11bb30[_0x584a6f(0x245)]=_0x4c0d1a[_0x584a6f(0x245)],_0x11bb30[_0x584a6f(0x263)]=_0x38ca43,_0x11bb30[_0x584a6f(0x241)]=_0x4c0d1a[_0x584a6f(0x274)]===_0x584a6f(0x22b)?_0x4c0d1a[_0x584a6f(0x241)]:undefined;if(!matchingReceipt(_0x11bb30,_0x5ef2a2))fail(_0x584a6f(0x201));if(!_0x4c0d1a['workspace']){if(Object[_0x584a6f(0x20d)](_0x55516d[_0x584a6f(0x205)]||{})[_0x584a6f(0x26e)]||Object[_0x584a6f(0x20d)](_0x55516d[_0x584a6f(0x28e)]||{})[_0x584a6f(0x1ee)](_0x552706=>!['session_bootstrap','model_list'][_0x584a6f(0x27b)](_0x552706)||Object[_0x584a6f(0x20d)](_0x55516d[_0x584a6f(0x28e)][_0x552706])[_0x584a6f(0x1ee)](_0x5580a2=>_0x5580a2!==_0x584a6f(0x257))))fail(_0x584a6f(0x23f));continue;}const _0x1ce213=fs[_0x584a6f(0x258)](_0x4c0d1a[_0x584a6f(0x241)]),_0x301c86=_0xad62c5[_0x584a6f(0x1cc)](_0x363490=>_0x363490[_0x584a6f(0x1fc)]===_0x4c0d1a[_0x584a6f(0x1fc)]&&require(_0x584a6f(0x1e0))[_0x584a6f(0x260)](_0x363490[_0x584a6f(0x241)],_0x1ce213));if(_0x301c86&&JSON[_0x584a6f(0x1f0)](_0x301c86['profile'])!==JSON[_0x584a6f(0x1f0)](_0x55516d))fail('MIGRATION_PROFILE_CONFLICT');const _0x1455eb={};_0x1455eb[_0x584a6f(0x241)]=_0x1ce213,_0x1455eb[_0x584a6f(0x1fc)]=_0x4c0d1a['host'],_0x1455eb[_0x584a6f(0x206)]=_0x55516d;if(!_0x301c86)_0xad62c5[_0x584a6f(0x1e6)](_0x1455eb);}const _0x4806d4=replacementFor(_0x22d0a5,_0x23860f,_0x4ebffd,_0x19597b),_0x4eacd8={..._0x22d0a5};_0x4eacd8[_0x584a6f(0x27e)]=_0x23860f,_0x4eacd8[_0x584a6f(0x1dc)]=_0x4806d4,_0x1d34e1[_0x584a6f(0x1e6)](_0x4eacd8);}for(const _0x1710f9 of _0x19597b[_0x584a6f(0x25c)]===![]?[]:_0x19597b[_0x584a6f(0x1e8)]){const _0x58fe24=IDE_REGISTRY[_0x1710f9]?.[_0x584a6f(0x1f5)]?.();if(!_0x58fe24)continue;let _0xc8adad=_0x1d34e1[_0x584a6f(0x1cc)](_0x1f7729=>_0x1f7729[_0x584a6f(0x220)]===path[_0x584a6f(0x1fd)](_0x58fe24));if(!_0xc8adad){const _0x32aabb=read(_0x58fe24);_0xc8adad={'host':_0x1710f9,'scope':_0x584a6f(0x233),'configPath':path[_0x584a6f(0x1fd)](_0x58fe24),'oldHash':_0x32aabb?hash(_0x32aabb):null,'original':_0x32aabb,'replacement':_0x32aabb?.[_0x584a6f(0x20c)]()||'','aliases':[]},_0x1d34e1[_0x584a6f(0x1e6)](_0xc8adad);}approvedPath(_0xc8adad,_0x19597b);const _0x292add=[_0x4ebffd['replaceAll']('\x5c','/'),_0x584a6f(0x1f8),_0x584a6f(0x1ca),_0x1710f9];if(IDE_REGISTRY[_0x1710f9][_0x584a6f(0x278)]===_0x584a6f(0x20e))_0xc8adad['replacement']=_0xc8adad[_0x584a6f(0x1dc)][_0x584a6f(0x267)]()+_0x584a6f(0x298)+JSON[_0x584a6f(0x1f0)](_0x292add)+'\x0a';else{const _0x4853ac={};_0x4853ac[_0x584a6f(0x25e)]=IDE_REGISTRY[_0x1710f9]['jsonc'];const _0x4135c1=parseJson(_0xc8adad[_0x584a6f(0x1dc)]||'{}',_0x4853ac);_0x4135c1[IDE_REGISTRY[_0x1710f9][_0x584a6f(0x1df)]]||={};const _0x455362={};_0x455362[_0x584a6f(0x276)]=_0x584a6f(0x202),_0x455362[_0x584a6f(0x20f)]=_0x292add;const _0x3afa4a=_0x455362;if(_0x1710f9===_0x584a6f(0x21b))require(_0x584a6f(0x251))[_0x584a6f(0x291)](_0x3afa4a);_0x4135c1[IDE_REGISTRY[_0x1710f9]['topLevelKey']][_0x584a6f(0x28c)]=_0x3afa4a,_0xc8adad[_0x584a6f(0x1dc)]=JSON['stringify'](_0x4135c1,null,0x2);}}for(const [_0x45f403,_0x2ccc36]of _0x1d34e1[_0x584a6f(0x284)]()){_0x2ccc36['newHash']=hash(_0x2ccc36[_0x584a6f(0x1dc)]);if(_0x2ccc36[_0x584a6f(0x27e)])durable(path['join'](_0x1ed9c5,_0x45f403+_0x584a6f(0x26f)),_0x2ccc36[_0x584a6f(0x27e)]);durable(path[_0x584a6f(0x266)](_0x1ed9c5,_0x45f403+_0x584a6f(0x1c4)),_0x2ccc36[_0x584a6f(0x1dc)]),delete _0x2ccc36[_0x584a6f(0x27e)],delete _0x2ccc36['replacement'];}const _0x3942e5={};_0x3942e5[_0x584a6f(0x1cd)]=0x1,_0x3942e5['id']=_0x31f60d,_0x3942e5['review']=_0x19597b,_0x3942e5[_0x584a6f(0x244)]=_0x1d34e1,_0x3942e5['profiles']=_0xad62c5,_0x3942e5[_0x584a6f(0x1d0)]='prepared',_0xe20d0f=_0x3942e5,_0x10e3ec(_0x584a6f(0x24f));}validateJournal(_0xe20d0f,_0x19597b,_0x1ed9c5,_0x4ebffd),_0x531b27=!![];for(const [_0x25c6da,_0x5d8bdf]of _0xe20d0f[_0x584a6f(0x244)][_0x584a6f(0x284)]()){approvedPath(_0x5d8bdf,_0x19597b),staged(_0x1ed9c5,_0x25c6da,_0x584a6f(0x1dc),_0x5d8bdf[_0x584a6f(0x228)]);if(_0x5d8bdf[_0x584a6f(0x265)])staged(_0x1ed9c5,_0x25c6da,_0x584a6f(0x27e),_0x5d8bdf['oldHash']);const _0x45bdb7=read(_0x5d8bdf['configPath']),_0x2d72bc=_0x45bdb7?hash(_0x45bdb7):null;if(![_0x5d8bdf[_0x584a6f(0x265)],_0x5d8bdf[_0x584a6f(0x228)]][_0x584a6f(0x27b)](_0x2d72bc))fail('REGISTRATION_CONFIG_CONFLICT');}for(const _0x209b4d of _0xe20d0f[_0x584a6f(0x253)]){if(!_0x19597b[_0x584a6f(0x261)][_0x584a6f(0x1ee)](_0xc4b3e4=>require(_0x584a6f(0x1e0))[_0x584a6f(0x260)](_0xc4b3e4,_0x209b4d[_0x584a6f(0x241)]))||!_0x19597b['hosts'][_0x584a6f(0x27b)](_0x209b4d[_0x584a6f(0x1fc)]))fail(_0x584a6f(0x262));const _0x4f23be=_0x3a1a8c[_0x584a6f(0x1cb)]()[_0x584a6f(0x1cc)](_0x3d643c=>require(_0x584a6f(0x1e0))[_0x584a6f(0x260)](_0x3d643c[_0x584a6f(0x241)],_0x209b4d[_0x584a6f(0x241)]));if(_0x4f23be?.[_0x584a6f(0x253)]?.[_0x209b4d[_0x584a6f(0x1fc)]]&&!require('node:util')[_0x584a6f(0x1d1)](_0x4f23be['profiles'][_0x209b4d[_0x584a6f(0x1fc)]],_0x209b4d[_0x584a6f(0x206)]))fail(_0x584a6f(0x1e3));}for(const _0x186980 of _0xe20d0f[_0x584a6f(0x253)]){const _0x47e787={..._0x186980};_0x47e787[_0x584a6f(0x26c)]=_0x584a6f(0x204),_0x3a1a8c[_0x584a6f(0x1de)](_0x47e787);}for(const _0x279141 of _0x229c80){const _0x2c92ca=_0x31bfc2[_0x584a6f(0x1e4)](_0x279141['workspace']);if(_0x2c92ca['state']===_0x584a6f(0x24b))_0x279141['fence']=_0x31bfc2['freezeFence'](_0x279141['workspace'],_0x2c92ca[_0x584a6f(0x209)],{'transactionId':_0x2c92ca[_0x584a6f(0x29a)]},_0x4ca5b5=>!Object['values'](_0x4ca5b5['members']||{})[_0x584a6f(0x1ee)](_0x74d8e8=>_0x74d8e8[_0x584a6f(0x1d2)]!=='closed')&&require('../core/runtime-ownership')[_0x584a6f(0x211)](_0x279141['workspace'],_0x4ca5b5,require('../core/run-compatibility')[_0x584a6f(0x1d4)](_0x279141[_0x584a6f(0x241)]),{'rebuildCheckpoints':!![],'budgetMs':Number(process.env.APT_RUN_INSPECTION_TIMEOUT_MS||0x1d4c0)})[_0x584a6f(0x26e)]===0x0);else{if(_0x2c92ca[_0x584a6f(0x1d2)]!==_0x584a6f(0x299))fail('ADMISSION_CONFLICT');}}_0x4b1fe2=![];for(const _0xedd202 of _0x19597b[_0x584a6f(0x232)][_0x584a6f(0x249)](_0x46e581=>_0x46e581['workspace'])){const _0x557785=await _0x5ef2a2['verifyClosure']?.(_0xedd202,_0x33307b(_0xedd202));if(_0x557785?.[_0x584a6f(0x1d0)]!=='verified'||_0x557785[_0x584a6f(0x275)]!==_0xedd202[_0x584a6f(0x221)])fail(_0x584a6f(0x1f1));}const _0x1dbf1f=[_0x584a6f(0x26d),_0x584a6f(0x252)][_0x584a6f(0x27b)](_0xe20d0f[_0x584a6f(0x1d0)]);for(const [_0x23865f,_0x4f114b]of _0xe20d0f[_0x584a6f(0x244)][_0x584a6f(0x284)]()){const _0x20d833=read(_0x4f114b['configPath']),_0x333e03=_0x20d833?hash(_0x20d833):null;_0x333e03!==_0x4f114b[_0x584a6f(0x228)]&&(_0x4f114b[_0x584a6f(0x1d0)]=_0x584a6f(0x1e2),_0x10e3ec(_0x1dbf1f?'committing':_0x584a6f(0x22c)),writeConfigAtomic(_0x4f114b['configPath'],staged(_0x1ed9c5,_0x23865f,'replacement',_0x4f114b[_0x584a6f(0x228)])[_0x584a6f(0x20c)](),{'expectedHash':_0x4f114b[_0x584a6f(0x265)]||hash(Buffer[_0x584a6f(0x1eb)](0x0))})),_0x4f114b[_0x584a6f(0x1d0)]=_0x584a6f(0x295),_0x10e3ec(_0x1dbf1f?_0x584a6f(0x26d):_0x584a6f(0x22c));}_0x10e3ec(_0x584a6f(0x26d));for(const _0x31e07a of _0xe20d0f[_0x584a6f(0x244)])if((read(_0x31e07a['configPath'])?hash(read(_0x31e07a[_0x584a6f(0x220)])):null)!==_0x31e07a[_0x584a6f(0x228)])fail(_0x584a6f(0x238));for(const _0x3c29f4 of _0xe20d0f['operations'][_0x584a6f(0x249)](_0x59e7e5=>_0x59e7e5['scope']===_0x584a6f(0x233))){if(hash(read(_0x3c29f4[_0x584a6f(0x220)])||'')!==_0x3c29f4['newHash'])fail('REGISTRATION_CONFIG_CONFLICT');const _0x5133a0=configEntry(fs[_0x584a6f(0x234)](_0x3c29f4[_0x584a6f(0x220)],_0x584a6f(0x225)),_0x3c29f4[_0x584a6f(0x1fc)],_0x584a6f(0x28c)),_0x272ede={};_0x272ede[_0x584a6f(0x1fc)]=_0x3c29f4[_0x584a6f(0x1fc)],_0x272ede['scope']=_0x584a6f(0x233),_0x272ede[_0x584a6f(0x220)]=_0x3c29f4[_0x584a6f(0x220)],_0x272ede['alias']='apt-mcp-agent',_0x272ede[_0x584a6f(0x241)]=null,_0x272ede['entry']=_0x5133a0,recordRegistration(_0x272ede,_0x5ef2a2);}for(const _0x54e3b9 of _0xe20d0f[_0x584a6f(0x244)][_0x584a6f(0x249)](_0x45b1f0=>_0x45b1f0[_0x584a6f(0x274)]==='project')){const _0xfe6f4a=configEntry(fs[_0x584a6f(0x234)](_0x54e3b9[_0x584a6f(0x220)],_0x584a6f(0x225)),_0x54e3b9[_0x584a6f(0x1fc)],_0x584a6f(0x28c));if(!_0xfe6f4a)fail(_0x584a6f(0x238));const _0x510190={};_0x510190['host']=_0x54e3b9[_0x584a6f(0x1fc)],_0x510190[_0x584a6f(0x274)]=_0x584a6f(0x22b),_0x510190[_0x584a6f(0x220)]=_0x54e3b9[_0x584a6f(0x220)],_0x510190[_0x584a6f(0x245)]='apt-mcp-agent',_0x510190['workspace']=_0x54e3b9[_0x584a6f(0x241)],_0x510190[_0x584a6f(0x263)]=_0xfe6f4a,_0x510190['provenance']=_0x584a6f(0x236),_0x510190[_0x584a6f(0x210)]={},_0x510190[_0x584a6f(0x210)][_0x584a6f(0x283)]='canonical-project-launcher',_0x510190[_0x584a6f(0x210)]['workspace']=_0x54e3b9[_0x584a6f(0x241)],recordRegistration(_0x510190,_0x5ef2a2);}_0x10e3ec(_0x584a6f(0x252)),_0x4b1fe2=!![];const _0x2fa241={};return _0x2fa241[_0x584a6f(0x1d0)]='ready-next-connection',_0x2fa241[_0x584a6f(0x29a)]=_0x31f60d,_0x2fa241[_0x584a6f(0x1d6)]=_0xe20d0f['operations']['length'],_0x2fa241['projectsEnrolled']=_0xe20d0f[_0x584a6f(0x253)][_0x584a6f(0x26e)],_0x2fa241[_0x584a6f(0x224)]=![],_0x2fa241;}catch(_0x27d3ff){if(_0xe20d0f&&_0x531b27&&![_0x584a6f(0x26d),_0x584a6f(0x252)][_0x584a6f(0x27b)](_0xe20d0f[_0x584a6f(0x1d0)]))try{for(let _0x59fa84=_0xe20d0f[_0x584a6f(0x244)][_0x584a6f(0x26e)]-0x1;_0x59fa84>=0x0;_0x59fa84--){const _0x241ae4=_0xe20d0f['operations'][_0x59fa84];approvedPath(_0x241ae4,_0x19597b);const _0x33aeb9=read(_0x241ae4['configPath']),_0x4fb0a4=_0x33aeb9?hash(_0x33aeb9):null;if(_0x4fb0a4===_0x241ae4['oldHash'])continue;if(_0x4fb0a4!==_0x241ae4[_0x584a6f(0x228)])fail(_0x584a6f(0x238));if(_0x241ae4[_0x584a6f(0x265)])writeConfigAtomic(_0x241ae4[_0x584a6f(0x220)],staged(_0x1ed9c5,_0x59fa84,_0x584a6f(0x27e),_0x241ae4[_0x584a6f(0x265)])['toString'](),{'expectedHash':_0x241ae4[_0x584a6f(0x228)]});else require('./managed-config')[_0x584a6f(0x1fe)](_0x241ae4['configPath'],_0x241ae4[_0x584a6f(0x228)]);}_0x10e3ec(_0x584a6f(0x1e1)),_0x4b1fe2=!![];}catch(_0x39a7a9){_0x4b1fe2=![],_0x27d3ff=_0x39a7a9;}else{if(_0xe20d0f)_0x4b1fe2=![];}const _0x248356={};_0x248356[_0x584a6f(0x1c7)]=_0x27d3ff['code']||'MIGRATION_FAILED';const _0x4716e4={};return _0x4716e4[_0x584a6f(0x1d0)]=_0x584a6f(0x222),_0x4716e4[_0x584a6f(0x29a)]=_0x31f60d,_0x4716e4[_0x584a6f(0x25f)]=_0x55948b,_0x4716e4[_0x584a6f(0x1ec)]=_0x4b1fe2?_0x584a6f(0x1e1):'recovery-required',_0x4716e4[_0x584a6f(0x21f)]=[_0x248356],_0x4716e4;}finally{if(_0x4b1fe2)for(const {workspace:_0x43d81c,fence:_0x165e60}of _0x229c80[_0x584a6f(0x239)]()){const _0x2a1599=_0x31bfc2[_0x584a6f(0x1e4)](_0x43d81c);if(_0x2a1599[_0x584a6f(0x29a)]===_0x165e60[_0x584a6f(0x29a)]&&[_0x584a6f(0x24b),_0x584a6f(0x299)][_0x584a6f(0x27b)](_0x2a1599[_0x584a6f(0x1d2)]))_0x31bfc2[_0x584a6f(0x29c)](_0x43d81c,_0x2a1599[_0x584a6f(0x209)],{'state':'open','transactionId':_0x2a1599[_0x584a6f(0x29a)]});}_0xedd75d();}}const _0x32c61a={};_0x32c61a[_0x361171(0x1f4)]=migrationPlan,_0x32c61a[_0x361171(0x246)]=applyMigration,_0x32c61a[_0x361171(0x1d9)]=profileFor,module['exports']=_0x32c61a;
|
|
1
|
+
'use strict';const _0xa5ab4a=_0x641a;(function(_0x8da696,_0x2aade1){const _0x57f710=_0x641a,_0x5a6c35=_0x8da696();while(!![]){try{const _0x19726b=-parseInt(_0x57f710(0x242))/0x1+-parseInt(_0x57f710(0x239))/0x2*(parseInt(_0x57f710(0x22d))/0x3)+-parseInt(_0x57f710(0x240))/0x4+-parseInt(_0x57f710(0x1d6))/0x5+-parseInt(_0x57f710(0x1cc))/0x6*(parseInt(_0x57f710(0x1ad))/0x7)+-parseInt(_0x57f710(0x22e))/0x8*(-parseInt(_0x57f710(0x1da))/0x9)+-parseInt(_0x57f710(0x1d9))/0xa*(-parseInt(_0x57f710(0x259))/0xb);if(_0x19726b===_0x2aade1)break;else _0x5a6c35['push'](_0x5a6c35['shift']());}catch(_0x4cbc3a){_0x5a6c35['push'](_0x5a6c35['shift']());}}}(_0x46e4,0xa3112));const fs=require(_0xa5ab4a(0x1bd)),path=require(_0xa5ab4a(0x232)),os=require('node:os'),crypto=require(_0xa5ab4a(0x27f)),{IDE_REGISTRY}=require(_0xa5ab4a(0x224)),{configEntry}=require('./registration-plan'),{parseJson,writeConfigAtomic}=require('./managed-config'),{matchingReceipt,registeredProjects,entryHash,recordRegistration}=require(_0xa5ab4a(0x22a)),{WorkspaceRegistry}=require(_0xa5ab4a(0x219)),hash=_0x5756f2=>crypto[_0xa5ab4a(0x271)]('sha256')[_0xa5ab4a(0x268)](_0x5756f2)[_0xa5ab4a(0x23c)]('hex'),isApt=_0x322bf9=>_0x322bf9===_0xa5ab4a(0x1b3)||/^apt-mcp-agent-w[a-z0-9]+$/i['test'](_0x322bf9),fail=_0x2a817d=>{const _0x452450=_0xa5ab4a;throw Object[_0x452450(0x1e9)](new Error(_0x2a817d),{'code':_0x2a817d});},rootFor=_0x42db20=>_0x42db20['root']||process.env.APT_MIGRATION_ROOT||path[_0xa5ab4a(0x238)](os['homedir'](),_0xa5ab4a(0x1b7),'apt-runtime',_0xa5ab4a(0x27d)),read=_0x1cc222=>{const _0x49e0f8=_0xa5ab4a;try{return fs[_0x49e0f8(0x20e)](_0x1cc222);}catch(_0x5f4548){if(_0x5f4548[_0x49e0f8(0x206)]===_0x49e0f8(0x1ec))return null;throw _0x5f4548;}};function durable(_0x452ae1,_0x198a38){const _0x2e4c6a=_0xa5ab4a,_0xd6c633={};_0xd6c633[_0x2e4c6a(0x24a)]=!![],fs[_0x2e4c6a(0x1a4)](path[_0x2e4c6a(0x213)](_0x452ae1),_0xd6c633);const _0x501403=_0x452ae1+'.'+crypto[_0x2e4c6a(0x1cb)]()+_0x2e4c6a(0x241),_0x294cf0=fs[_0x2e4c6a(0x265)](_0x501403,'wx',0x180);try{fs[_0x2e4c6a(0x211)](_0x294cf0,_0x198a38),fs[_0x2e4c6a(0x1ba)](_0x294cf0);}finally{fs[_0x2e4c6a(0x248)](_0x294cf0);}try{fs[_0x2e4c6a(0x1c3)](_0x501403,_0x452ae1);}finally{try{fs[_0x2e4c6a(0x225)](_0x501403);}catch{}}}function removeToml(_0x1cdd6d,_0x4f0db8){const _0x5cd6f9=_0xa5ab4a;return _0x1cdd6d[_0x5cd6f9(0x1ed)](/(?=^\[)/m)[_0x5cd6f9(0x230)](_0xab3b70=>{const _0x3659a1=_0x5cd6f9,_0x1ab82e=_0xab3b70[_0x3659a1(0x233)](/^\[mcp_servers\.(?:"([^"]+)"|'([^']+)'|([^\.\]\r\n]+))(?:\.[^\]]+)?\]/)?.[_0x3659a1(0x1d8)](0x1)[_0x3659a1(0x23b)](Boolean);return!_0x4f0db8[_0x3659a1(0x200)](_0x1ab82e);})[_0x5cd6f9(0x238)]('');}function _0x641a(_0x5ab8b1,_0x31a6a8){_0x5ab8b1=_0x5ab8b1-0x19c;const _0x46e46d=_0x46e4();let _0x641a50=_0x46e46d[_0x5ab8b1];if(_0x641a['xZRpZs']===undefined){var _0x46d2d1=function(_0xfb3302){const _0x2914dc='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1fe82d='',_0x32a592='';for(let _0x37509c=0x0,_0x4b2278,_0x41a7a1,_0x42354e=0x0;_0x41a7a1=_0xfb3302['charAt'](_0x42354e++);~_0x41a7a1&&(_0x4b2278=_0x37509c%0x4?_0x4b2278*0x40+_0x41a7a1:_0x41a7a1,_0x37509c++%0x4)?_0x1fe82d+=String['fromCharCode'](0xff&_0x4b2278>>(-0x2*_0x37509c&0x6)):0x0){_0x41a7a1=_0x2914dc['indexOf'](_0x41a7a1);}for(let _0x5d16d7=0x0,_0x7bb9db=_0x1fe82d['length'];_0x5d16d7<_0x7bb9db;_0x5d16d7++){_0x32a592+='%'+('00'+_0x1fe82d['charCodeAt'](_0x5d16d7)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x32a592);};_0x641a['KBDtzm']=_0x46d2d1,_0x641a['EJUpFD']={},_0x641a['xZRpZs']=!![];}const _0xf954c1=_0x46e46d[0x0],_0x5bef84=_0x5ab8b1+_0xf954c1,_0xe36298=_0x641a['EJUpFD'][_0x5bef84];return!_0xe36298?(_0x641a50=_0x641a['KBDtzm'](_0x641a50),_0x641a['EJUpFD'][_0x5bef84]=_0x641a50):_0x641a50=_0xe36298,_0x641a50;}function profileFor(_0x55642d,_0x307aca){const _0x334dd0=_0xa5ab4a;if(_0x307aca[_0x334dd0(0x1ea)]){if(_0x307aca['toml'][_0x334dd0(0x1ed)](/\r?\n/)[_0x334dd0(0x24d)](_0x29372b=>_0x29372b['trim']()&&!_0x29372b[_0x334dd0(0x24b)]()[_0x334dd0(0x1d2)]('#')&&!/^\[mcp_servers\.[^\]]+\]$|^\s*(command|args)\s*=/['test'](_0x29372b)))fail(_0x334dd0(0x253));const _0x34357e={};return _0x34357e[_0x334dd0(0x252)]={},_0x34357e[_0x334dd0(0x1f1)]={},_0x34357e;}const _0x3f07b3=structuredClone(_0x307aca);require(_0x334dd0(0x224))[_0x334dd0(0x26f)](_0x55642d,_0x3f07b3);if(_0x3f07b3['type']!==undefined){if(_0x3f07b3['type']!==_0x334dd0(0x236))fail(_0x334dd0(0x253));delete _0x3f07b3['type'];}for(const _0x454e25 of Object[_0x334dd0(0x23e)](_0x3f07b3))if(![_0x334dd0(0x1ca),_0x334dd0(0x1b0),_0x334dd0(0x252),_0x334dd0(0x1f1)][_0x334dd0(0x200)](_0x454e25))fail('MIGRATION_PROFILE_UNSUPPORTED');const _0x30ecb7=_0x3f07b3[_0x334dd0(0x252)]||{};if(Array[_0x334dd0(0x227)](_0x30ecb7)||typeof _0x30ecb7!=='object'||Object[_0x334dd0(0x21f)](_0x30ecb7)[_0x334dd0(0x24d)](([_0x2eaea5,_0x3ef1b6])=>typeof _0x3ef1b6!=='string'||/^(APT_|MCP_SKIP_|NODE_OPTIONS$|NODE_PATH$)/i[_0x334dd0(0x234)](_0x2eaea5))||new Set(Object['keys'](_0x30ecb7)[_0x334dd0(0x1b4)](_0x30b0f2=>_0x30b0f2[_0x334dd0(0x215)]()))[_0x334dd0(0x1c8)]!==Object[_0x334dd0(0x23e)](_0x30ecb7)[_0x334dd0(0x205)])fail(_0x334dd0(0x253));const _0x517816=_0x3f07b3['tools']||{};if(Array[_0x334dd0(0x227)](_0x517816)||typeof _0x517816!==_0x334dd0(0x27c)||Object['values'](_0x517816)['some'](_0x3df736=>!_0x3df736||typeof _0x3df736!==_0x334dd0(0x27c)||Array['isArray'](_0x3df736)||Object[_0x334dd0(0x23e)](_0x3df736)[_0x334dd0(0x24d)](_0x432acf=>!['eager','enabled'][_0x334dd0(0x200)](_0x432acf))||Object[_0x334dd0(0x258)](_0x3df736)[_0x334dd0(0x24d)](_0x5aa4cc=>typeof _0x5aa4cc!==_0x334dd0(0x247))))fail('MIGRATION_PROFILE_UNSUPPORTED');const _0x87ff1c={};return _0x87ff1c[_0x334dd0(0x252)]=_0x30ecb7,_0x87ff1c[_0x334dd0(0x1f1)]=_0x517816,_0x87ff1c;}function serverMap(_0x2080ec,_0x495356){const _0x4906c9=_0xa5ab4a,_0x2839d6=IDE_REGISTRY[_0x495356],_0x5e0afe=parseJson(_0x2080ec,{'jsonc':_0x2839d6['jsonc']}),_0x4c6889=_0x5e0afe[_0x2839d6[_0x4906c9(0x1fa)]]||{};if(Array[_0x4906c9(0x227)](_0x4c6889)||typeof _0x4c6889!==_0x4906c9(0x27c))fail('INVALID_CONFIG');if(_0x495356===_0x4906c9(0x226)&&Object[_0x4906c9(0x258)](_0x5e0afe[_0x4906c9(0x24e)]||{})[_0x4906c9(0x24d)](_0xe7c0d8=>Object[_0x4906c9(0x23e)](_0xe7c0d8?.[_0x4906c9(0x1fd)]||{})[_0x4906c9(0x24d)](isApt)))fail(_0x4906c9(0x26c));return _0x4c6889;}const _0x4b2278={};_0x4b2278[_0xa5ab4a(0x25a)]=[];function replacementFor(_0x13cbed,_0x7b4e66,_0x5d70a3,_0x5de61e=_0x4b2278){const _0x261812=_0xa5ab4a,_0x1f973d=IDE_REGISTRY[_0x13cbed[_0x261812(0x1c4)]],_0x5a08a0=_0x7b4e66?.[_0x261812(0x1bb)]()||'',_0x106356=[_0x5d70a3[_0x261812(0x255)]('\x5c','/'),'--gateway',_0x261812(0x1de),_0x13cbed[_0x261812(0x1c4)]];if(_0x13cbed[_0x261812(0x1f9)]===_0x261812(0x1d3)){if(!_0x7b4e66)return _0x5a08a0;if(_0x1f973d[_0x261812(0x1fe)]===_0x261812(0x1ea))return _0x5a08a0;const _0xc108e6={};_0xc108e6[_0x261812(0x263)]=_0x1f973d[_0x261812(0x263)];const _0x2021b5=parseJson(_0x5a08a0,_0xc108e6);_0x2021b5[_0x1f973d['topLevelKey']]||={};const _0xa8e790=_0x5de61e[_0x261812(0x25a)][_0x261812(0x230)](_0x571df9=>_0x571df9[_0x261812(0x25d)]===_0x13cbed[_0x261812(0x25d)]&&_0x571df9[_0x261812(0x1aa)]);for(const _0x5f647d of _0xa8e790){const _0x20aedd=_0x2021b5[_0x1f973d['topLevelKey']][_0x5f647d['alias']];if(!_0x20aedd)continue;delete _0x2021b5[_0x1f973d[_0x261812(0x1fa)]][_0x5f647d['alias']];const _0x4adf36=[_0x5d70a3[_0x261812(0x255)]('\x5c','/'),_0x261812(0x270),_0x13cbed[_0x261812(0x20a)][_0x261812(0x255)]('\x5c','/')],_0x1e8f65={..._0x20aedd};_0x1e8f65['command']=_0x261812(0x1af),_0x1e8f65[_0x261812(0x1b0)]=_0x4adf36,_0x2021b5[_0x1f973d[_0x261812(0x1fa)]][_0x261812(0x1b3)]=_0x1e8f65;}return JSON[_0x261812(0x24f)](_0x2021b5,null,0x2);}if(_0x1f973d[_0x261812(0x1fe)]===_0x261812(0x1ea)){const _0x34aec8=removeToml(_0x5a08a0,_0x13cbed[_0x261812(0x1ce)]);return _0x13cbed[_0x261812(0x1f9)]===_0x261812(0x19f)?_0x34aec8[_0x261812(0x1cd)]()+'\x0a\x0a[mcp_servers.apt-mcp-agent]\x0acommand\x20=\x20\x22node\x22\x0aargs\x20=\x20'+JSON[_0x261812(0x24f)](_0x106356)+'\x0a':_0x34aec8;}serverMap(_0x5a08a0||'{}',_0x13cbed[_0x261812(0x1c4)]);const _0x5cd2bd={};_0x5cd2bd['jsonc']=_0x1f973d[_0x261812(0x263)];const _0x3c08c6=parseJson(_0x5a08a0||'{}',_0x5cd2bd);_0x3c08c6[_0x1f973d['topLevelKey']]||={};for(const _0x321ea9 of _0x13cbed['aliases'])delete _0x3c08c6[_0x1f973d['topLevelKey']][_0x321ea9];if(_0x13cbed[_0x261812(0x1f9)]===_0x261812(0x19f)){const _0xdc410c={};_0xdc410c[_0x261812(0x1ca)]=_0x261812(0x1af),_0xdc410c[_0x261812(0x1b0)]=_0x106356;const _0x461d53=_0xdc410c;if(_0x13cbed[_0x261812(0x1c4)]===_0x261812(0x1f0))require('./platform-config')[_0x261812(0x1f5)](_0x461d53);_0x3c08c6[_0x1f973d[_0x261812(0x1fa)]][_0x261812(0x1b3)]=_0x461d53;}return JSON[_0x261812(0x24f)](_0x3c08c6,null,0x2);}function validateJournal(_0x1a5bb8,_0x49409c,_0x4b1057,_0x4a327b){const _0x5b96d6=_0xa5ab4a;if(![_0x5b96d6(0x19c),_0x5b96d6(0x19e),_0x5b96d6(0x220),_0x5b96d6(0x203),_0x5b96d6(0x1c0)][_0x5b96d6(0x200)](_0x1a5bb8[_0x5b96d6(0x26d)])||_0x1a5bb8[_0x5b96d6(0x231)][_0x5b96d6(0x205)]!==_0x49409c[_0x5b96d6(0x261)][_0x5b96d6(0x205)])fail(_0x5b96d6(0x1e6));const _0x174cda=[];for(const [_0x4d6a23,_0x1c3c95]of _0x49409c['configs'][_0x5b96d6(0x21f)]()){const _0x182d81=_0x1a5bb8[_0x5b96d6(0x231)][_0x4d6a23];for(const _0x5e8b99 of['host',_0x5b96d6(0x1f9),_0x5b96d6(0x25d),_0x5b96d6(0x25c),_0x5b96d6(0x1ce)])if(!require(_0x5b96d6(0x254))[_0x5b96d6(0x1f4)](_0x182d81[_0x5e8b99],_0x1c3c95[_0x5e8b99]))fail(_0x5b96d6(0x1e6));approvedPath(_0x1c3c95,_0x49409c);const _0x2f3156=_0x1c3c95[_0x5b96d6(0x25c)]?staged(_0x4b1057,_0x4d6a23,_0x5b96d6(0x207),_0x1c3c95[_0x5b96d6(0x25c)]):null,_0x576f10=replacementFor(_0x1c3c95,_0x2f3156,_0x4a327b,_0x49409c);if(hash(_0x576f10)!==_0x182d81[_0x5b96d6(0x266)])fail(_0x5b96d6(0x1e6));staged(_0x4b1057,_0x4d6a23,_0x5b96d6(0x228),_0x182d81[_0x5b96d6(0x266)]);for(const _0x2d68f0 of _0x49409c[_0x5b96d6(0x25a)]['filter'](_0x2c0787=>_0x2c0787[_0x5b96d6(0x25d)]===_0x1c3c95[_0x5b96d6(0x25d)])){if(!_0x1c3c95[_0x5b96d6(0x1ce)][_0x5b96d6(0x200)](_0x2d68f0[_0x5b96d6(0x251)])||_0x2d68f0['host']!==_0x1c3c95[_0x5b96d6(0x1c4)]||_0x2d68f0[_0x5b96d6(0x1f9)]!==_0x1c3c95['scope']||_0x2d68f0['ownership']!==_0x5b96d6(0x1a5))fail(_0x5b96d6(0x1e6));const _0x5aa94e=configEntry(_0x2f3156?.[_0x5b96d6(0x1bb)]()||'',_0x1c3c95['host'],_0x2d68f0[_0x5b96d6(0x251)]);if(!_0x5aa94e||entryHash(_0x5aa94e)!==_0x2d68f0[_0x5b96d6(0x1c5)])fail('MIGRATION_JOURNAL_INVALID');const _0x3793a1=profileFor(_0x1c3c95[_0x5b96d6(0x1c4)],_0x5aa94e);if(!_0x2d68f0[_0x5b96d6(0x20a)]){if(Object[_0x5b96d6(0x23e)](_0x3793a1[_0x5b96d6(0x252)]||{})[_0x5b96d6(0x205)]||Object[_0x5b96d6(0x23e)](_0x3793a1[_0x5b96d6(0x1f1)]||{})['some'](_0x3cec3c=>![_0x5b96d6(0x1b1),_0x5b96d6(0x276)][_0x5b96d6(0x200)](_0x3cec3c)||Object[_0x5b96d6(0x23e)](_0x3793a1[_0x5b96d6(0x1f1)][_0x3cec3c])[_0x5b96d6(0x24d)](_0xc3d346=>_0xc3d346!==_0x5b96d6(0x21d))))fail(_0x5b96d6(0x218));continue;}const _0x489588=fs[_0x5b96d6(0x1b9)](_0x2d68f0['workspace']);if(!_0x49409c[_0x5b96d6(0x24e)]['some'](_0x51a890=>require('../core/workspace-path')[_0x5b96d6(0x272)](_0x51a890,_0x489588)))fail(_0x5b96d6(0x1e6));const _0x36167b=_0x174cda['find'](_0x49ee6a=>_0x49ee6a['host']===_0x2d68f0['host']&&require('../core/workspace-path')[_0x5b96d6(0x272)](_0x49ee6a[_0x5b96d6(0x20a)],_0x489588));if(_0x36167b&&!require(_0x5b96d6(0x254))['isDeepStrictEqual'](_0x36167b['profile'],_0x3793a1))fail(_0x5b96d6(0x1b5));const _0xbd9d53={};_0xbd9d53[_0x5b96d6(0x20a)]=_0x489588,_0xbd9d53['host']=_0x2d68f0[_0x5b96d6(0x1c4)],_0xbd9d53[_0x5b96d6(0x20b)]=_0x3793a1;if(!_0x36167b)_0x174cda[_0x5b96d6(0x201)](_0xbd9d53);}}if(!require('node:util')[_0x5b96d6(0x1f4)](_0x174cda,_0x1a5bb8['profiles']))fail(_0x5b96d6(0x1e6));}function migrationPlan(_0x45ad40={}){const _0x371d82=_0xa5ab4a,_0x1dfbbd=Array[_0x371d82(0x227)](_0x45ad40[_0x371d82(0x21b)])&&_0x45ad40['projectPaths']['length']>0x0,_0x45481a=_0x1dfbbd&&_0x45ad40['includeRegisteredProjects']!==!![]?_0x45ad40[_0x371d82(0x21b)]:[..._0x45ad40[_0x371d82(0x21b)]||[],...registeredProjects(_0x45ad40)],_0x1bf1f0=[...new Set(_0x45481a)][_0x371d82(0x230)](_0x30254a=>fs['existsSync'](_0x30254a))[_0x371d82(0x1b4)](_0x4f05bd=>fs['realpathSync'](_0x4f05bd)),_0x5d7080=[],_0x57595f=[],_0x54128b=[];for(const _0x4e8aaa of _0x45ad40[_0x371d82(0x22f)]||Object[_0x371d82(0x23e)](IDE_REGISTRY)){const _0x238d8b=IDE_REGISTRY[_0x4e8aaa];if(!_0x238d8b)fail('UNSUPPORTED_HOST');const _0x16ca28=[..._0x45ad40[_0x371d82(0x24c)]===![]?[]:[{'scope':_0x371d82(0x19f),'file':_0x238d8b[_0x371d82(0x21a)]?.(),'workspace':null}],..._0x1bf1f0[_0x371d82(0x1b4)](_0x5c9c6e=>({'scope':_0x371d82(0x1d3),'file':_0x238d8b['projectConfig']?.(_0x5c9c6e),'workspace':_0x5c9c6e}))],_0x5db9fa=new Set();for(const _0x592f58 of _0x16ca28){if(!_0x592f58[_0x371d82(0x1c6)]||_0x5db9fa[_0x371d82(0x274)](path['resolve'](_0x592f58[_0x371d82(0x1c6)])))continue;_0x5db9fa['add'](path[_0x371d82(0x250)](_0x592f58['file']));const _0x58eac8=path[_0x371d82(0x250)](_0x592f58['file']),_0x26777d=read(_0x58eac8);if(!_0x26777d&&_0x592f58['scope']!==_0x371d82(0x19f))continue;let _0x1465d4;try{_0x1465d4=_0x238d8b['format']===_0x371d82(0x1ea)?[...(_0x26777d?.[_0x371d82(0x1bb)]()||'')[_0x371d82(0x1ff)](/^\[mcp_servers\.(?:"([^"]+)"|'([^']+)'|([^\.\]\r\n]+))(?:\.[^\]]+)?\]/gm)][_0x371d82(0x1b4)](_0x155697=>_0x155697['slice'](0x1)[_0x371d82(0x23b)](Boolean))[_0x371d82(0x230)](isApt):Object[_0x371d82(0x23e)](serverMap(_0x26777d?.[_0x371d82(0x1bb)]()||'{}',_0x4e8aaa))['filter'](isApt);}catch(_0x596493){const _0x486c0d={};_0x486c0d[_0x371d82(0x206)]=_0x596493['code']||_0x371d82(0x202),_0x486c0d[_0x371d82(0x1c4)]=_0x4e8aaa,_0x486c0d[_0x371d82(0x25d)]=_0x58eac8,_0x54128b[_0x371d82(0x201)](_0x486c0d);continue;}_0x1465d4=[...new Set(_0x1465d4)];if(!_0x1465d4[_0x371d82(0x205)]&&_0x592f58[_0x371d82(0x1f9)]!==_0x371d82(0x19f))continue;const _0x506b10={'host':_0x4e8aaa,'scope':_0x592f58[_0x371d82(0x1f9)],'workspace':_0x592f58[_0x371d82(0x20a)]||null,'configPath':_0x58eac8,'oldHash':_0x26777d?hash(_0x26777d):null,'aliases':_0x1465d4};_0x5d7080[_0x371d82(0x201)](_0x506b10);for(const _0x256d0b of _0x1465d4){const _0x11f20d=configEntry(_0x26777d[_0x371d82(0x1bb)](),_0x4e8aaa,_0x256d0b),_0x1d19eb={};_0x1d19eb[_0x371d82(0x1c4)]=_0x4e8aaa,_0x1d19eb['scope']=_0x592f58['scope'],_0x1d19eb[_0x371d82(0x25d)]=_0x58eac8,_0x1d19eb['alias']=_0x256d0b,_0x1d19eb['entry']=_0x11f20d,_0x1d19eb[_0x371d82(0x20a)]=_0x592f58[_0x371d82(0x1f9)]===_0x371d82(0x1d3)?_0x592f58[_0x371d82(0x20a)]:undefined;const _0x23c75a=matchingReceipt(_0x1d19eb,_0x45ad40),_0x29577e=_0x592f58[_0x371d82(0x1f9)]==='project'&&_0x45ad40[_0x371d82(0x26a)]&&_0x11f20d?.['command']===_0x371d82(0x1af)&&Array[_0x371d82(0x227)](_0x11f20d['args'])&&_0x11f20d[_0x371d82(0x1b0)][_0x371d82(0x205)]===0x3&&_0x11f20d[_0x371d82(0x1b0)][0x0]&&path[_0x371d82(0x250)](_0x11f20d['args'][0x0])===path['resolve'](_0x45ad40['launcher'])&&_0x11f20d['args'][0x1]===_0x371d82(0x270)&&((()=>{const _0x11956b=_0x371d82;try{return sameWorkspace(_0x11f20d['args'][0x2],_0x592f58[_0x11956b(0x20a)]);}catch{return![];}})()),_0x1e4eae=!_0x29577e,_0x438a7b={'host':_0x4e8aaa,'scope':_0x592f58['scope'],'configPath':_0x58eac8,'alias':_0x256d0b,'entryHash':entryHash(_0x11f20d),'ownership':_0x23c75a?_0x371d82(0x1a5):_0x29577e?'adoptable':_0x371d82(0x1bf),'workspace':_0x23c75a?.[_0x371d82(0x20a)]||_0x592f58[_0x371d82(0x20a)],'rewriteRequired':_0x1e4eae};_0x57595f[_0x371d82(0x201)](_0x438a7b);const _0x5e9c25={};_0x5e9c25['code']=_0x371d82(0x1d7),_0x5e9c25[_0x371d82(0x1c4)]=_0x4e8aaa,_0x5e9c25[_0x371d82(0x25d)]=_0x58eac8,_0x5e9c25[_0x371d82(0x251)]=_0x256d0b;if(!_0x23c75a&&_0x1e4eae)_0x54128b[_0x371d82(0x201)](_0x5e9c25);else{if(!_0x438a7b[_0x371d82(0x20a)]&&!(_0x256d0b===_0x371d82(0x1b3)&&(_0x11f20d[_0x371d82(0x1b0)]||[])['includes']('--gateway')||_0x11f20d['toml']?.[_0x371d82(0x200)](_0x371d82(0x243))))_0x54128b[_0x371d82(0x201)]({'code':_0x371d82(0x26b),'host':_0x4e8aaa,'configPath':_0x58eac8,'alias':_0x256d0b});}try{profileFor(_0x4e8aaa,_0x11f20d);}catch(_0x1158a1){const _0x1e03bc={};_0x1e03bc[_0x371d82(0x206)]=_0x1158a1[_0x371d82(0x206)],_0x1e03bc['host']=_0x4e8aaa,_0x1e03bc[_0x371d82(0x25d)]=_0x58eac8,_0x1e03bc[_0x371d82(0x251)]=_0x256d0b,_0x54128b[_0x371d82(0x201)](_0x1e03bc);}}}}const _0x153127=_0x57595f['some'](_0x2a3630=>_0x2a3630[_0x371d82(0x1aa)]);return{'version':0x1,'kind':_0x371d82(0x257),'projects':_0x1bf1f0,'hosts':_0x45ad40[_0x371d82(0x22f)]||Object[_0x371d82(0x23e)](IDE_REGISTRY),'includeGlobal':_0x45ad40[_0x371d82(0x24c)]!==![],'includeRegisteredProjects':_0x45ad40[_0x371d82(0x1e3)]===!![],'launcher':_0x45ad40[_0x371d82(0x26a)]||null,'configs':_0x5d7080,'records':_0x57595f,'operationsRequired':_0x153127,'blockers':_0x54128b,'status':_0x54128b['length']?_0x371d82(0x25e):_0x371d82(0x1db),'requirements':[_0x371d82(0x245),'No\x20admitted\x20worker\x20or\x20operation','Legacy\x20connections\x20reconnected\x20or\x20closed']};}function approvedPath(_0x1dcc2b,_0x3959c8){const _0x9dde31=_0xa5ab4a,_0x47ed80=IDE_REGISTRY[_0x1dcc2b['host']];if(!_0x47ed80||!['global','project'][_0x9dde31(0x200)](_0x1dcc2b[_0x9dde31(0x1f9)]))fail('MIGRATION_PATH_ESCAPE');const _0x4141c6=_0x1dcc2b[_0x9dde31(0x1f9)]==='global'?[_0x47ed80[_0x9dde31(0x21a)]?.()]:_0x3959c8['projects'][_0x9dde31(0x1b4)](_0x320638=>_0x47ed80['projectConfig']?.(_0x320638)),_0x3295fd=_0x44a81a=>process[_0x9dde31(0x1e4)]===_0x9dde31(0x27e)?path[_0x9dde31(0x250)](_0x44a81a)[_0x9dde31(0x20c)]():path[_0x9dde31(0x250)](_0x44a81a);if(!_0x4141c6['filter'](Boolean)[_0x9dde31(0x24d)](_0x4bdbc6=>_0x3295fd(_0x4bdbc6)===_0x3295fd(_0x1dcc2b[_0x9dde31(0x25d)])))fail(_0x9dde31(0x275));let _0x28e480=_0x1dcc2b[_0x9dde31(0x25d)];while(!fs[_0x9dde31(0x1a1)](_0x28e480)&&path['dirname'](_0x28e480)!==_0x28e480)_0x28e480=path[_0x9dde31(0x213)](_0x28e480);if(_0x3295fd(_0x28e480)!==_0x3295fd(fs['realpathSync'](_0x28e480))||fs[_0x9dde31(0x1a1)](_0x1dcc2b[_0x9dde31(0x25d)])&&(!fs[_0x9dde31(0x1d1)](_0x1dcc2b[_0x9dde31(0x25d)])[_0x9dde31(0x1d0)]()||fs[_0x9dde31(0x1d1)](_0x1dcc2b['configPath'])[_0x9dde31(0x1e5)]()))fail(_0x9dde31(0x275));}function staged(_0x27a75f,_0x1b2822,_0x5d23a1,_0x18c12c){const _0x2a9022=_0xa5ab4a,_0x114c25=path[_0x2a9022(0x238)](_0x27a75f,_0x1b2822+'.'+_0x5d23a1);if(!fs[_0x2a9022(0x1d1)](_0x114c25)[_0x2a9022(0x1d0)]()||fs[_0x2a9022(0x1d1)](_0x114c25)[_0x2a9022(0x1e5)]()||!require(_0x2a9022(0x1a7))[_0x2a9022(0x21e)](_0x27a75f,fs['realpathSync'](_0x114c25)))fail(_0x2a9022(0x1c2));const _0x1d191d=fs[_0x2a9022(0x20e)](_0x114c25);if(hash(_0x1d191d)!==_0x18c12c)fail(_0x2a9022(0x1c2));return _0x1d191d;}function _0x46e4(){const _0x3bb505=['zgLYBMfTzq','BwLNCMf0Aw9UlMXVy2S','Dg9vChbLCKnHC2u','tuLhuKfusu9ox1bmqu5Fsu5wquXjra','tuLhuKfusu9ox1bmqu5Fq0HbtKDfra','tuLhuKfusu9ox05fvvrsquXFufjprKLmrv9vtLnvufbpuLrfra','lI93B3jRC3bHy2uTCMvNAxn0CNK','z2XVyMfSq29UzMLN','ChjVAMvJDfbHDgHZ','lNjLCgXHy2vTzw50','zwfNzxi','y29UDgfPBNnxB3jRC3bHy2u','zw50CMLLCW','y29TBwL0DgLUzW','zMLUzeLUzgv4','DMvYAwzPzwq','DxbKyxrLzef0','lI9WBgf0zM9YBs1JB25MAwC','Dw5SAw5Ru3LUyW','y2XHDwrL','AxnbCNjHEq','CMvWBgfJzw1LBNq','ChjVzMLSzuzVCG','lI9YzwDPC3rYyxrPB24TCMvJzwLWDa','BgLZDa','CMvJB3zLCNK','odK1ndq5AhfKzvHA','mtaYotm1mNHNBLDAuW','Ag9ZDhm','zMLSDgvY','B3bLCMf0Aw9UCW','BM9KztPWyxrO','Bwf0y2G','DgvZDa','CMvHzezLBMnL','C3rKAw8','tuLhuKfusu9ox0Lox1bst0Dsrvnt','AM9PBG','nKnMq0zQua','CgvUzgLUzY1ZywzLlwjVDw5Kyxj5','zMLUza','zgLNzxn0','BgLZDfDVCMTZCgfJzvjLy2vPChrZ','A2v5CW','lI9JB25Uzwn0Aw9UlwfJDgL2yxrPB24','ndG4mdC4oe1SrMPMqq','lNrTCa','nJGZmdCXsNbvwe1s','iI0Tz2f0zxDHEsi','AM91CM5HBc5QC29U','twf0y2HPBMCGB3DUzxjZAgLWihjLy2vPChrZ','yxb0lxj1BNrPBwu','yM9VBgvHBG','y2XVC2vtEw5J','uKvhsvnuuKfusu9ox0nptKzjr19dt05gteLdva','CMvJDxjZAxzL','DhjPBq','Aw5JBhvKzuDSB2jHBa','C29Tzq','ChjVAMvJDhm','C3rYAw5NAwz5','CMvZB2X2zq','ywXPyxm','zw52','tuLhuKfusu9ox1bst0zjtevFvu5tvvbqt1juruq','BM9KztP1DgLS','CMvWBgfJzufSBa','t1DorvjtseLqx0Lox0zmsuDiva','C2LUz2XLlwDHDgv3yxK','DMfSDwvZ','mZyYoti0mZjlAxHjC0i','CMvJB3jKCW','D29YA3nWywnLuNvUuM9VDhm','B2XKsgfZAa','y29UzMLNugf0Aa','yMXVy2TLza','Ag9TzwrPCG','BgvNywn5lw93BMvYC2HPCc11BNzLCMLMAwvK','y29UzMLNCW','y2HHBMDLrMvUy2u','ANnVBMm','B3bLBG','B3bLBLn5BMm','BMv3sgfZAa','zxbVy2G','DxbKyxrL','BwvTyMvYCW','Bgf1BMnOzxi','v09ss1nqqunfx0jjtKrjtKDFuKvrvuLsruq','tunqx05fu1rfrf9sruDju1rsqvrjt05Fvu5tvvbqt1juruq','C3rHDhvZ','ywrVChrLza','BwLNCMf0zuDLBMvYyxrLzezPzwXKCW','ls1WyxrO','y3jLyxrLsgfZAa','C2fTzvDVCMTZCgfJzq','CMvHzhKTBMv4Dc1JB25Uzwn0Aw9U','AgfZ','tuLhuKfusu9ox1bbveHFrvndqvbf','Bw9KzwXFBgLZDa','qvbux1vqrefurv9qru5esu5h','B3bLCMf0Aw9UC1jLCxvPCMvK','y2fUB25Py2fSlxbYB2PLy3qTBgf1BMnOzxi','AM91CM5HBa','ChjVDMvUyw5Jzq','B2jQzwn0','CMvNAxn0CMf0Aw9Ulw1Pz3jHDgLVBNm','D2LUmZi','BM9KztPJCNLWDg8','ChjLCgfYzwq','ChjVzMLSzxm','yxbWBhLPBMC','z2XVyMfS','lI4Vy29Yzs9VD25Lzc1SB2nR','zxHPC3rZu3LUyW','lI4Vy29Yzs9YDw50Aw1Llw93BMvYC2HPCa','DMvYAwz5q2XVC3vYzq','BwTKAxjtEw5J','CMvJzwLWDc1JB25MAxjTzwq','DMvYC2LVBG','lI4Vy29Yzs93B3jRC3bHy2uTCgf0Aa','zw5YB2XS','zw50CNK','CMv3CML0zvjLCxvPCMvK','BwLNCMf0Aw9UugXHBG','lM9YAwDPBMfS','mJGYmZHzyNrYzeO','tevhqunzx0nmt1nvuKvFvu5wrvjjrKLfra','BM9Kzq','yxjNCW','C2vZC2LVBL9IB290C3rYyxa','yxbWBgLLza','yxb0lw1JCc1Hz2vUDa','BwfW','tuLhuKfusu9ox1bst0zjtevFq09orKXjq1q','y29UzMLNC0nOyw5Nzwq','lMfUAgrO','A2LUza','CMvHBhbHDgHtEw5J','zNn5BMntEw5J','Dg9tDhjPBMC','zMvUy2u','BM9KztPMCW','yxbWBhKTAw50zw50','Dw5RBM93BG','CM9SBgvKlwjHy2S','ChjVB2y','tuLhuKfusu9ox1nuquDfx0nptKzmsunu','CMvUyw1Lu3LUyW','Ag9ZDa','zw50CNLiyxnO','zMLSzq','CMv2zxjZzq','C2L6zq','DhjHBNnHy3rPB25jza','y29TBwfUza','CMfUzg9Tvvvjra','ntrtC21Pr3q','DhjPBuvUza','ywXPyxnLCW','CMvTB3zLq29UzMLNqxrVBwLJ','AxngAwXL','Bhn0yxrtEw5J','C3rHCNrZv2L0Aa','ChjVAMvJDa','D29YA3nWywnLt3DUzxjZAgLW','CMvJB25Uzwn0lxjLCxvPCMvK','mZq4nti1mgr4v0nADa','uKvhsvnuuKfusu9ox09xtKvsu0Hjuf9srvfvsvjfra','C2XPy2u','mtbArfzvtxq','nJnoqxjhs1u','CMv2Awv3lxjLCxvPCMvK','zNjLzxPLrMvUy2u','q09otKvdveLptL9pv05fuLnisvbFuKvrvuLsruq','ls1OB3n0','ChjVAMvJDhnfBNjVBgXLza','CgfYC2u','yMXVy2TLzc1WCM9Qzwn0lxn5BMm','CMvNAxn0CNK','Aw5JBhvKzvjLz2LZDgvYzwrqCM9Qzwn0CW','CgXHDgzVCM0','AxntEw1IB2XPy0XPBMS','tuLhuKfusu9ox0PpvvjoquXFsu5wquXjra','Bgf1BMnOzxiUANm','tuLhuKfusu9ox0zbsuXfra','yxnZAwDU','Dg9TBa','CMv2Awv3','ru5pru5u','C3bSAxq','BwLNCMf0Aw9Ulq','lI4Vy29Yzs9YDw4Ty29TCgf0AwjPBgL0Eq','yw50AwDYyxzPDhK','Dg9VBhm','zMfPBgvK','C3rHDgu','AxnezwvWu3rYAwn0rxf1ywW','y29UzMLNDxjLqw50AwDYyxzPDhLeAxnJB3zLCNK','lI4Vy29Yzs9Hzg1PC3nPB24TzMvUy2u','y2XVC2vK','DxrMoa','C2nVCgu','Dg9Wtgv2zwXlzxK','Dg9ju09tDhjPBMC','z2f0zxDHEs1TAwDYyxrPB24','BwnWu2vYDMvYCW','zM9YBwf0','Bwf0y2HbBgW','Aw5JBhvKzxm','ChvZAa','su5wquXjrf9dt05gsuC','y29TBwL0DgvK','CMvJB3zLCNKTCMvXDwLYzwq','BgvUz3rO','y29Kzq','B3jPz2LUywW','yMXVy2TLCNm','r0furvDbwv9mqvvoq0HfuL9srvfvsvjfra','D29YA3nWywnL','ChjVzMLSzq','Dg9mB3DLCKnHC2u','qurnsvntsu9ox0nptKzmsunu','CMvHzezPBgvtEw5J','yxbWBhLnAwDYyxrPB24','zNjVEMvU','D3jPDgvgAwXLu3LUyW','CMvNAxn0CMf0Aw9UsgfZAa'];_0x46e4=function(){return _0x3bb505;};return _0x46e4();}async function applyMigration(_0x2837a6,_0x4c0d3b={}){const _0x51f307=_0xa5ab4a;if(_0x2837a6?.[_0x51f307(0x1a6)]!==0x1||_0x2837a6['kind']!==_0x51f307(0x257)||!Array[_0x51f307(0x227)](_0x2837a6['hosts'])||!Array[_0x51f307(0x227)](_0x2837a6[_0x51f307(0x24e)])||!Array[_0x51f307(0x227)](_0x2837a6[_0x51f307(0x261)])||!Array[_0x51f307(0x227)](_0x2837a6[_0x51f307(0x25a)]))fail(_0x51f307(0x216));const _0x1d3571=hash(JSON[_0x51f307(0x24f)](_0x2837a6)),_0x1c0c11=rootFor(_0x4c0d3b),_0x32482b=path[_0x51f307(0x238)](_0x1c0c11,_0x1d3571),_0x264c6c=path['join'](_0x32482b,_0x51f307(0x244)),_0x33ee64=_0x4c0d3b[_0x51f307(0x1e2)]||new WorkspaceRegistry(),_0x1083e1=_0x4c0d3b[_0x51f307(0x26a)]||path[_0x51f307(0x238)](os[_0x51f307(0x25f)](),_0x51f307(0x1b7),_0x51f307(0x246),_0x51f307(0x1e7));let _0x417f2f;try{if(fs[_0x51f307(0x1d1)](_0x264c6c)['isSymbolicLink']())fail(_0x51f307(0x275));_0x417f2f=JSON[_0x51f307(0x1e0)](fs[_0x51f307(0x20e)](_0x264c6c));if(_0x417f2f['version']!==0x1||_0x417f2f['id']!==_0x1d3571||hash(JSON[_0x51f307(0x24f)](_0x417f2f['review']))!==_0x1d3571||!Array[_0x51f307(0x227)](_0x417f2f['operations'])||!Array[_0x51f307(0x227)](_0x417f2f[_0x51f307(0x19d)]))fail(_0x51f307(0x1e6));}catch(_0x297f9b){if(_0x297f9b[_0x51f307(0x206)]!=='ENOENT')throw _0x297f9b;}if(!_0x417f2f||_0x417f2f[_0x51f307(0x26d)]==='rolled-back'){const _0x4c8148={..._0x4c0d3b};_0x4c8148[_0x51f307(0x21b)]=_0x2837a6[_0x51f307(0x24e)],_0x4c8148['hosts']=_0x2837a6[_0x51f307(0x22f)],_0x4c8148[_0x51f307(0x24c)]=_0x2837a6['includeGlobal'],_0x4c8148[_0x51f307(0x1e3)]=_0x2837a6[_0x51f307(0x1e3)],_0x4c8148[_0x51f307(0x26a)]=_0x2837a6[_0x51f307(0x26a)]||_0x1083e1;const _0x35a1d2=migrationPlan(_0x4c8148);if(hash(JSON[_0x51f307(0x24f)](_0x35a1d2))!==_0x1d3571)fail(_0x51f307(0x217));if(_0x35a1d2[_0x51f307(0x208)][_0x51f307(0x205)])return{'status':_0x51f307(0x1e1),'blockers':_0x35a1d2[_0x51f307(0x208)]};_0x417f2f=null;}if(!path['isAbsolute'](_0x1083e1)||!fs['existsSync'](_0x1083e1))fail(_0x51f307(0x209));const _0x547103={};_0x547103[_0x51f307(0x24a)]=!![],fs[_0x51f307(0x1a4)](_0x1c0c11,_0x547103);if(fs['realpathSync'](_0x1c0c11)!==path['resolve'](_0x1c0c11))fail('MIGRATION_PATH_ESCAPE');const _0x5a1107=require(_0x51f307(0x1a0))['acquireRuntimeLock'](path['join'](_0x1c0c11,_0x51f307(0x214))),_0x410786={};_0x410786[_0x51f307(0x206)]=_0x51f307(0x237);const _0x360a68={};_0x360a68[_0x51f307(0x26d)]='pending-safe-boundary',_0x360a68[_0x51f307(0x208)]=[_0x410786];if(!_0x5a1107)return _0x360a68;const _0x3112ca=require(_0x51f307(0x1f6)),_0x3abe80=[];let _0x14f321=!_0x417f2f,_0x46fa48=![];const _0x288e4e=_0x9c7909=>{const _0x3fe5b6=_0x51f307;_0x417f2f[_0x3fe5b6(0x26d)]=_0x9c7909,_0x417f2f[_0x3fe5b6(0x223)]=new Date()[_0x3fe5b6(0x1fb)](),durable(_0x264c6c,JSON['stringify'](_0x417f2f));},_0x5f177d=_0x3baa14=>{const _0x8e026e=_0x51f307;if(!_0x417f2f)return _0x4c0d3b;validateJournal(_0x417f2f,_0x2837a6,_0x32482b,_0x1083e1);const _0x496393=_0x417f2f['operations'][_0x8e026e(0x221)](_0x247e95=>_0x247e95[_0x8e026e(0x25d)]===_0x3baa14[_0x8e026e(0x25d)]);if(_0x496393<0x0)fail('MIGRATION_JOURNAL_INVALID');const _0x4bc5d8=_0x417f2f['operations'][_0x496393],_0x3b7cdc=read(_0x4bc5d8['configPath']),_0x4b6854=_0x3b7cdc?hash(_0x3b7cdc):null;if(![_0x4bc5d8[_0x8e026e(0x25c)],_0x4bc5d8[_0x8e026e(0x266)]][_0x8e026e(0x200)](_0x4b6854))fail(_0x8e026e(0x249));return{..._0x4c0d3b,'originalConfig':staged(_0x32482b,_0x496393,'original',_0x4bc5d8['oldHash'])[_0x8e026e(0x1bb)]()};};try{if(_0x2837a6[_0x51f307(0x278)]===![]){const _0x243ba6={};return _0x243ba6[_0x51f307(0x26d)]=_0x51f307(0x273),_0x243ba6[_0x51f307(0x1c9)]=_0x1d3571,_0x243ba6[_0x51f307(0x1b6)]=0x0,_0x243ba6[_0x51f307(0x1df)]=0x0,_0x243ba6['servingConfirmed']=![],_0x243ba6[_0x51f307(0x26e)]=!![],_0x243ba6;}for(const _0x57b925 of _0x2837a6[_0x51f307(0x24e)]){const _0x3602c2=_0x3112ca[_0x51f307(0x235)](_0x57b925),_0x17200a=_0x51f307(0x1ee)+_0x1d3571,_0x5e9906={};_0x5e9906['code']=_0x51f307(0x277),_0x5e9906['workspace']=_0x57b925;const _0x57c64b={};_0x57c64b[_0x51f307(0x26d)]='pending-safe-boundary',_0x57c64b['blockers']=[_0x5e9906];if(_0x3602c2['state']!=='open'&&_0x3602c2[_0x51f307(0x1c9)]!==_0x17200a)return _0x57c64b;const _0x1fc779={};_0x1fc779[_0x51f307(0x1f3)]='draining',_0x1fc779[_0x51f307(0x1c9)]=_0x17200a;const _0x5021df=_0x3602c2[_0x51f307(0x1f3)]===_0x51f307(0x264)?_0x3112ca[_0x51f307(0x262)](_0x57b925,_0x3602c2[_0x51f307(0x267)],_0x1fc779):_0x3602c2,_0x3be775={};_0x3be775[_0x51f307(0x20a)]=_0x57b925,_0x3be775[_0x51f307(0x1bc)]=_0x5021df,_0x3abe80['push'](_0x3be775);const _0x3f0ba4=require(_0x51f307(0x1ef))[_0x51f307(0x25b)](_0x57b925),_0x80f602=require(_0x51f307(0x1a2))['workspaceOwnership'](_0x57b925,_0x5021df,_0x3f0ba4,{'rebuildCheckpoints':!![],'budgetMs':Number(process.env.APT_RUN_INSPECTION_TIMEOUT_MS||0x1d4c0)});if(_0x80f602[_0x51f307(0x205)])return{'status':_0x51f307(0x23a),'blockers':_0x80f602[_0x51f307(0x1b4)](_0x3e9608=>({'code':_0x51f307(0x256),'workspace':_0x57b925,'kind':_0x3e9608['kind']}))};const _0x1a2c77=require(_0x51f307(0x23f))[_0x51f307(0x23d)](_0x57b925),_0x49c201={};_0x49c201[_0x51f307(0x206)]=_0x51f307(0x1dd),_0x49c201[_0x51f307(0x20a)]=_0x57b925;const _0x2c2a9f={};_0x2c2a9f[_0x51f307(0x26d)]=_0x51f307(0x1d5),_0x2c2a9f[_0x51f307(0x208)]=[_0x49c201];if(_0x1a2c77[_0x51f307(0x205)]||Object[_0x51f307(0x258)](_0x5021df[_0x51f307(0x269)]||{})[_0x51f307(0x24d)](_0x3f45e7=>_0x3f45e7[_0x51f307(0x1f3)]!=='closed'))return _0x2c2a9f;}for(const _0x31507b of _0x2837a6[_0x51f307(0x25a)][_0x51f307(0x230)](_0x944e32=>_0x944e32[_0x51f307(0x20a)])){const _0x495f6d=await _0x4c0d3b['verifyClosure']?.(_0x31507b,_0x5f177d(_0x31507b));if(_0x495f6d?.['status']!==_0x51f307(0x222)||_0x495f6d[_0x51f307(0x212)]!==_0x31507b['entryHash'])return{'status':_0x51f307(0x260),'blockers':[{'code':_0x51f307(0x1ae),'host':_0x31507b['host'],'alias':_0x31507b[_0x51f307(0x251)]}]};}if(!_0x417f2f){const _0x47167d=[],_0x55b54b=[];for(const _0x218112 of _0x2837a6['configs']){approvedPath(_0x218112,_0x2837a6);const _0x1e50d1=read(_0x218112[_0x51f307(0x25d)]);if((_0x1e50d1?hash(_0x1e50d1):null)!==_0x218112[_0x51f307(0x25c)])fail(_0x51f307(0x217));const _0x49b8ea=IDE_REGISTRY[_0x218112[_0x51f307(0x1c4)]];for(const _0x2eea4d of _0x2837a6[_0x51f307(0x25a)][_0x51f307(0x230)](_0x20678e=>_0x20678e['configPath']===_0x218112[_0x51f307(0x25d)])){const _0x22d147=configEntry(_0x1e50d1[_0x51f307(0x1bb)](),_0x218112[_0x51f307(0x1c4)],_0x2eea4d['alias']),_0x507aa0=profileFor(_0x218112[_0x51f307(0x1c4)],_0x22d147),_0xfa80ab={};_0xfa80ab[_0x51f307(0x1c4)]=_0x2eea4d[_0x51f307(0x1c4)],_0xfa80ab[_0x51f307(0x1f9)]=_0x2eea4d[_0x51f307(0x1f9)],_0xfa80ab[_0x51f307(0x25d)]=_0x2eea4d[_0x51f307(0x25d)],_0xfa80ab[_0x51f307(0x251)]=_0x2eea4d[_0x51f307(0x251)],_0xfa80ab[_0x51f307(0x1a9)]=_0x22d147,_0xfa80ab['workspace']=_0x2eea4d[_0x51f307(0x1f9)]===_0x51f307(0x1d3)?_0x2eea4d[_0x51f307(0x20a)]:undefined;if(!matchingReceipt(_0xfa80ab,_0x4c0d3b))fail(_0x51f307(0x1d7));if(!_0x2eea4d['workspace']){if(Object[_0x51f307(0x23e)](_0x507aa0[_0x51f307(0x252)]||{})[_0x51f307(0x205)]||Object[_0x51f307(0x23e)](_0x507aa0[_0x51f307(0x1f1)]||{})[_0x51f307(0x24d)](_0x167107=>!['session_bootstrap',_0x51f307(0x276)][_0x51f307(0x200)](_0x167107)||Object[_0x51f307(0x23e)](_0x507aa0['tools'][_0x167107])[_0x51f307(0x24d)](_0x45412f=>_0x45412f!==_0x51f307(0x21d))))fail(_0x51f307(0x218));continue;}const _0x37bc90=fs['realpathSync'](_0x2eea4d['workspace']),_0xfa10d7=_0x47167d[_0x51f307(0x23b)](_0x5a063d=>_0x5a063d[_0x51f307(0x1c4)]===_0x2eea4d['host']&&require(_0x51f307(0x1a7))[_0x51f307(0x272)](_0x5a063d[_0x51f307(0x20a)],_0x37bc90));if(_0xfa10d7&&JSON[_0x51f307(0x24f)](_0xfa10d7[_0x51f307(0x20b)])!==JSON[_0x51f307(0x24f)](_0x507aa0))fail(_0x51f307(0x1b5));const _0x496427={};_0x496427[_0x51f307(0x20a)]=_0x37bc90,_0x496427[_0x51f307(0x1c4)]=_0x2eea4d['host'],_0x496427['profile']=_0x507aa0;if(!_0xfa10d7)_0x47167d['push'](_0x496427);}const _0x41c111=replacementFor(_0x218112,_0x1e50d1,_0x1083e1,_0x2837a6),_0x489de6={..._0x218112};_0x489de6[_0x51f307(0x207)]=_0x1e50d1,_0x489de6[_0x51f307(0x228)]=_0x41c111,_0x55b54b[_0x51f307(0x201)](_0x489de6);}for(const _0x41d114 of _0x2837a6['includeGlobal']===![]?[]:_0x2837a6[_0x51f307(0x22f)]){const _0x271479=IDE_REGISTRY[_0x41d114]?.['globalConfig']?.();if(!_0x271479)continue;let _0x8bf8d1=_0x55b54b[_0x51f307(0x23b)](_0x393ebc=>_0x393ebc['configPath']===path[_0x51f307(0x250)](_0x271479));if(!_0x8bf8d1){const _0x3f3cae=read(_0x271479);_0x8bf8d1={'host':_0x41d114,'scope':_0x51f307(0x19f),'configPath':path[_0x51f307(0x250)](_0x271479),'oldHash':_0x3f3cae?hash(_0x3f3cae):null,'original':_0x3f3cae,'replacement':_0x3f3cae?.[_0x51f307(0x1bb)]()||'','aliases':[]},_0x55b54b['push'](_0x8bf8d1);}approvedPath(_0x8bf8d1,_0x2837a6);const _0x32191e=[_0x1083e1[_0x51f307(0x255)]('\x5c','/'),'--gateway','--host',_0x41d114];if(IDE_REGISTRY[_0x41d114][_0x51f307(0x1fe)]==='toml')_0x8bf8d1[_0x51f307(0x228)]=_0x8bf8d1['replacement'][_0x51f307(0x1cd)]()+'\x0a\x0a[mcp_servers.apt-mcp-agent]\x0acommand\x20=\x20\x22node\x22\x0aargs\x20=\x20'+JSON['stringify'](_0x32191e)+'\x0a';else{const _0x1761a2={};_0x1761a2[_0x51f307(0x263)]=IDE_REGISTRY[_0x41d114][_0x51f307(0x263)];const _0x3b253d=parseJson(_0x8bf8d1['replacement']||'{}',_0x1761a2);_0x3b253d[IDE_REGISTRY[_0x41d114][_0x51f307(0x1fa)]]||={};const _0x4e0df1={};_0x4e0df1[_0x51f307(0x1ca)]=_0x51f307(0x1af),_0x4e0df1[_0x51f307(0x1b0)]=_0x32191e;const _0x2e3f15=_0x4e0df1;if(_0x41d114===_0x51f307(0x1f0))require(_0x51f307(0x224))[_0x51f307(0x1f5)](_0x2e3f15);_0x3b253d[IDE_REGISTRY[_0x41d114][_0x51f307(0x1fa)]]['apt-mcp-agent']=_0x2e3f15,_0x8bf8d1[_0x51f307(0x228)]=JSON['stringify'](_0x3b253d,null,0x2);}}for(const [_0x2fa100,_0x1a2d81]of _0x55b54b[_0x51f307(0x21f)]()){_0x1a2d81[_0x51f307(0x266)]=hash(_0x1a2d81[_0x51f307(0x228)]);if(_0x1a2d81[_0x51f307(0x207)])durable(path[_0x51f307(0x238)](_0x32482b,_0x2fa100+_0x51f307(0x1ac)),_0x1a2d81[_0x51f307(0x207)]);durable(path[_0x51f307(0x238)](_0x32482b,_0x2fa100+_0x51f307(0x21c)),_0x1a2d81['replacement']),delete _0x1a2d81[_0x51f307(0x207)],delete _0x1a2d81[_0x51f307(0x228)];}const _0x190a69={};_0x190a69['version']=0x1,_0x190a69['id']=_0x1d3571,_0x190a69[_0x51f307(0x1eb)]=_0x2837a6,_0x190a69[_0x51f307(0x231)]=_0x55b54b,_0x190a69[_0x51f307(0x19d)]=_0x47167d,_0x190a69['status']='prepared',_0x417f2f=_0x190a69,_0x288e4e(_0x51f307(0x19c));}validateJournal(_0x417f2f,_0x2837a6,_0x32482b,_0x1083e1),_0x46fa48=!![];for(const [_0x8e70d7,_0x2c5078]of _0x417f2f[_0x51f307(0x231)]['entries']()){approvedPath(_0x2c5078,_0x2837a6),staged(_0x32482b,_0x8e70d7,_0x51f307(0x228),_0x2c5078[_0x51f307(0x266)]);if(_0x2c5078['oldHash'])staged(_0x32482b,_0x8e70d7,_0x51f307(0x207),_0x2c5078[_0x51f307(0x25c)]);const _0x1a95d7=read(_0x2c5078['configPath']),_0x592531=_0x1a95d7?hash(_0x1a95d7):null;if(![_0x2c5078[_0x51f307(0x25c)],_0x2c5078['newHash']][_0x51f307(0x200)](_0x592531))fail('REGISTRATION_CONFIG_CONFLICT');}for(const _0xf7c198 of _0x417f2f[_0x51f307(0x19d)]){if(!_0x2837a6['projects']['some'](_0x124c54=>require(_0x51f307(0x1a7))[_0x51f307(0x272)](_0x124c54,_0xf7c198['workspace']))||!_0x2837a6['hosts']['includes'](_0xf7c198[_0x51f307(0x1c4)]))fail(_0x51f307(0x1e6));const _0xd449c2=_0x33ee64[_0x51f307(0x22b)]()['find'](_0x2e736d=>require(_0x51f307(0x1a7))[_0x51f307(0x272)](_0x2e736d[_0x51f307(0x20a)],_0xf7c198[_0x51f307(0x20a)]));if(_0xd449c2?.['profiles']?.[_0xf7c198[_0x51f307(0x1c4)]]&&!require('node:util')[_0x51f307(0x1f4)](_0xd449c2[_0x51f307(0x19d)][_0xf7c198[_0x51f307(0x1c4)]],_0xf7c198[_0x51f307(0x20b)]))fail(_0x51f307(0x1b5));}for(const _0x5ca0d3 of _0x417f2f[_0x51f307(0x19d)]){const _0x2950b8={..._0x5ca0d3};_0x2950b8[_0x51f307(0x27b)]='owned-registration-migration',_0x33ee64[_0x51f307(0x1a8)](_0x2950b8);}for(const _0x657339 of _0x3abe80){const _0x12110b=_0x3112ca[_0x51f307(0x235)](_0x657339[_0x51f307(0x20a)]);if(_0x12110b[_0x51f307(0x1f3)]==='draining')_0x657339[_0x51f307(0x1bc)]=_0x3112ca[_0x51f307(0x1dc)](_0x657339['workspace'],_0x12110b['epoch'],{'transactionId':_0x12110b['transactionId']},_0x4e7571=>!Object[_0x51f307(0x258)](_0x4e7571[_0x51f307(0x269)]||{})['some'](_0x5ba76d=>_0x5ba76d[_0x51f307(0x1f3)]!==_0x51f307(0x1f7))&&require(_0x51f307(0x1a2))[_0x51f307(0x1d4)](_0x657339[_0x51f307(0x20a)],_0x4e7571,require('../core/run-compatibility')[_0x51f307(0x25b)](_0x657339[_0x51f307(0x20a)]),{'rebuildCheckpoints':!![],'budgetMs':Number(process.env.APT_RUN_INSPECTION_TIMEOUT_MS||0x1d4c0)})[_0x51f307(0x205)]===0x0);else{if(_0x12110b[_0x51f307(0x1f3)]!==_0x51f307(0x210))fail(_0x51f307(0x20d));}}_0x14f321=![];for(const _0x8f2232 of _0x2837a6[_0x51f307(0x25a)]['filter'](_0xa4965a=>_0xa4965a['workspace'])){const _0x241773=await _0x4c0d3b[_0x51f307(0x1a3)]?.(_0x8f2232,_0x5f177d(_0x8f2232));if(_0x241773?.[_0x51f307(0x26d)]!==_0x51f307(0x222)||_0x241773['registrationHash']!==_0x8f2232['entryHash'])fail('LEGACY_CLOSURE_UNVERIFIED');}const _0x5335d2=[_0x51f307(0x220),'committed'][_0x51f307(0x200)](_0x417f2f[_0x51f307(0x26d)]);for(const [_0x1ebb7f,_0x2e3aa6]of _0x417f2f[_0x51f307(0x231)]['entries']()){const _0x15898d=read(_0x2e3aa6[_0x51f307(0x25d)]),_0x431a2b=_0x15898d?hash(_0x15898d):null;_0x431a2b!==_0x2e3aa6['newHash']&&(_0x2e3aa6[_0x51f307(0x26d)]=_0x51f307(0x1be),_0x288e4e(_0x5335d2?_0x51f307(0x220):_0x51f307(0x19e)),writeConfigAtomic(_0x2e3aa6['configPath'],staged(_0x32482b,_0x1ebb7f,_0x51f307(0x228),_0x2e3aa6['newHash'])[_0x51f307(0x1bb)](),{'expectedHash':_0x2e3aa6[_0x51f307(0x25c)]||hash(Buffer['alloc'](0x0))})),_0x2e3aa6[_0x51f307(0x26d)]=_0x51f307(0x1b2),_0x288e4e(_0x5335d2?'committing':_0x51f307(0x19e));}_0x288e4e(_0x51f307(0x220));for(const _0x4ecf9f of _0x417f2f[_0x51f307(0x231)])if((read(_0x4ecf9f[_0x51f307(0x25d)])?hash(read(_0x4ecf9f[_0x51f307(0x25d)])):null)!==_0x4ecf9f[_0x51f307(0x266)])fail(_0x51f307(0x249));for(const _0x5bce7a of _0x417f2f[_0x51f307(0x231)]['filter'](_0x523ede=>_0x523ede['scope']===_0x51f307(0x19f))){if(hash(read(_0x5bce7a[_0x51f307(0x25d)])||'')!==_0x5bce7a[_0x51f307(0x266)])fail(_0x51f307(0x249));const _0x50423f=configEntry(fs[_0x51f307(0x20e)](_0x5bce7a[_0x51f307(0x25d)],_0x51f307(0x1f8)),_0x5bce7a[_0x51f307(0x1c4)],_0x51f307(0x1b3)),_0x1c694d={};_0x1c694d['host']=_0x5bce7a['host'],_0x1c694d[_0x51f307(0x1f9)]=_0x51f307(0x19f),_0x1c694d[_0x51f307(0x25d)]=_0x5bce7a[_0x51f307(0x25d)],_0x1c694d[_0x51f307(0x251)]=_0x51f307(0x1b3),_0x1c694d[_0x51f307(0x20a)]=null,_0x1c694d[_0x51f307(0x1a9)]=_0x50423f,recordRegistration(_0x1c694d,_0x4c0d3b);}for(const _0x4623d8 of _0x417f2f['operations']['filter'](_0xf96a6a=>_0xf96a6a[_0x51f307(0x1f9)]===_0x51f307(0x1d3))){const _0x349675=configEntry(fs[_0x51f307(0x20e)](_0x4623d8[_0x51f307(0x25d)],'utf8'),_0x4623d8['host'],_0x51f307(0x1b3));if(!_0x349675)fail(_0x51f307(0x249));const _0x51a26c={};_0x51a26c[_0x51f307(0x1c4)]=_0x4623d8[_0x51f307(0x1c4)],_0x51a26c['scope']=_0x51f307(0x1d3),_0x51a26c['configPath']=_0x4623d8['configPath'],_0x51a26c[_0x51f307(0x251)]='apt-mcp-agent',_0x51a26c[_0x51f307(0x20a)]=_0x4623d8['workspace'],_0x51a26c[_0x51f307(0x1a9)]=_0x349675,_0x51a26c['provenance']=_0x51f307(0x1fc),_0x51a26c[_0x51f307(0x1c1)]={},_0x51a26c[_0x51f307(0x1c1)][_0x51f307(0x1b8)]=_0x51f307(0x279),_0x51a26c[_0x51f307(0x1c1)][_0x51f307(0x20a)]=_0x4623d8[_0x51f307(0x20a)],recordRegistration(_0x51a26c,_0x4c0d3b);}_0x288e4e(_0x51f307(0x203)),_0x14f321=!![];const _0x260eed={};return _0x260eed[_0x51f307(0x26d)]='ready-next-connection',_0x260eed[_0x51f307(0x1c9)]=_0x1d3571,_0x260eed[_0x51f307(0x1b6)]=_0x417f2f[_0x51f307(0x231)][_0x51f307(0x205)],_0x260eed['projectsEnrolled']=_0x417f2f[_0x51f307(0x19d)][_0x51f307(0x205)],_0x260eed['servingConfirmed']=![],_0x260eed;}catch(_0x566008){if(_0x417f2f&&_0x46fa48&&![_0x51f307(0x220),_0x51f307(0x203)]['includes'](_0x417f2f[_0x51f307(0x26d)]))try{for(let _0x264aa4=_0x417f2f['operations'][_0x51f307(0x205)]-0x1;_0x264aa4>=0x0;_0x264aa4--){const _0x4d4517=_0x417f2f[_0x51f307(0x231)][_0x264aa4];approvedPath(_0x4d4517,_0x2837a6);const _0x4fbb55=read(_0x4d4517[_0x51f307(0x25d)]),_0x257246=_0x4fbb55?hash(_0x4fbb55):null;if(_0x257246===_0x4d4517['oldHash'])continue;if(_0x257246!==_0x4d4517[_0x51f307(0x266)])fail(_0x51f307(0x249));if(_0x4d4517['oldHash'])writeConfigAtomic(_0x4d4517[_0x51f307(0x25d)],staged(_0x32482b,_0x264aa4,_0x51f307(0x207),_0x4d4517[_0x51f307(0x25c)])[_0x51f307(0x1bb)](),{'expectedHash':_0x4d4517[_0x51f307(0x266)]});else require('./managed-config')[_0x51f307(0x1cf)](_0x4d4517['configPath'],_0x4d4517['newHash']);}_0x288e4e(_0x51f307(0x1c0)),_0x14f321=!![];}catch(_0x580177){_0x14f321=![],_0x566008=_0x580177;}else{if(_0x417f2f)_0x14f321=![];}const _0x184240={};_0x184240['code']=_0x566008[_0x51f307(0x206)]||_0x51f307(0x1e8);const _0x3492ed={};return _0x3492ed['status']=_0x51f307(0x1f2),_0x3492ed[_0x51f307(0x1c9)]=_0x1d3571,_0x3492ed[_0x51f307(0x27a)]=_0x264c6c,_0x3492ed[_0x51f307(0x22c)]=_0x14f321?_0x51f307(0x1c0):_0x51f307(0x204),_0x3492ed['blockers']=[_0x184240],_0x3492ed;}finally{if(_0x14f321)for(const {workspace:_0x1970a7,fence:_0x101f16}of _0x3abe80[_0x51f307(0x1c7)]()){const _0x2dcbea=_0x3112ca[_0x51f307(0x235)](_0x1970a7);if(_0x2dcbea[_0x51f307(0x1c9)]===_0x101f16[_0x51f307(0x1c9)]&&['draining',_0x51f307(0x210)]['includes'](_0x2dcbea[_0x51f307(0x1f3)]))_0x3112ca[_0x51f307(0x262)](_0x1970a7,_0x2dcbea['epoch'],{'state':'open','transactionId':_0x2dcbea['transactionId']});}_0x5a1107();}}const _0x21c654={};_0x21c654[_0xa5ab4a(0x1ab)]=migrationPlan,_0x21c654[_0xa5ab4a(0x20f)]=applyMigration,_0x21c654[_0xa5ab4a(0x229)]=profileFor,module['exports']=_0x21c654;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x10bfaf=_0x44ee;(function(_0x4548bc,_0x245288){const _0x5db774=_0x44ee,_0x131db2=_0x4548bc();while(!![]){try{const _0x392a79=-parseInt(_0x5db774(0x16c))/0x1+-parseInt(_0x5db774(0x15d))/0x2*(parseInt(_0x5db774(0x149))/0x3)+-parseInt(_0x5db774(0x187))/0x4*(parseInt(_0x5db774(0x163))/0x5)+parseInt(_0x5db774(0x19a))/0x6*(-parseInt(_0x5db774(0x166))/0x7)+parseInt(_0x5db774(0x197))/0x8*(parseInt(_0x5db774(0x1a1))/0x9)+-parseInt(_0x5db774(0x16d))/0xa+parseInt(_0x5db774(0x1a3))/0xb;if(_0x392a79===_0x245288)break;else _0x131db2['push'](_0x131db2['shift']());}catch(_0xe351bd){_0x131db2['push'](_0x131db2['shift']());}}}(_0x53ed,0xe58eb));const {PassThrough}=require(_0x10bfaf(0x185)),{StringDecoder}=require(_0x10bfaf(0x189)),crypto=require('node:crypto'),{WorkspaceGateway}=require(_0x10bfaf(0x181));class GatewaySession{constructor(_0x1b113c,_0x1b060f){const _0x2c67aa=_0x10bfaf;this[_0x2c67aa(0x15b)]=_0x1b113c,this[_0x2c67aa(0x194)]=_0x1b060f,this[_0x2c67aa(0x176)]=new PassThrough(),this[_0x2c67aa(0x18e)]=new PassThrough(),this[_0x2c67aa(0x144)]=new Map(),this['sequence']=0x0,this['buffer']='',this[_0x2c67aa(0x188)]=new StringDecoder(_0x2c67aa(0x146));const _0x5ece28=_0x1b060f['Supervisor']||require(_0x2c67aa(0x152))['ConnectionSupervisor'];this[_0x2c67aa(0x173)]=new _0x5ece28({..._0x1b060f,'workspace':_0x1b113c[_0x2c67aa(0x156)],'explicitWorkspace':!![],'connectionId':crypto[_0x2c67aa(0x14a)](),'gatewayBinding':_0x1b113c,'stdin':this['input'],'stdout':this[_0x2c67aa(0x18e)]}),this[_0x2c67aa(0x18e)]['on'](_0x2c67aa(0x145),_0x1a86eb=>this[_0x2c67aa(0x159)](_0x1a86eb));}async[_0x10bfaf(0x182)](_0x5e47f7){const _0xc1b4d5=_0x10bfaf;await require(_0xc1b4d5(0x17b))[_0xc1b4d5(0x19f)](this[_0xc1b4d5(0x15b)][_0xc1b4d5(0x156)],this[_0xc1b4d5(0x194)]['publicKey']),await this[_0xc1b4d5(0x173)][_0xc1b4d5(0x182)]();const _0x8d861e=await this['request']({'method':_0xc1b4d5(0x154),'params':{..._0x5e47f7,'capabilities':{},'rootPath':this['binding']['workspace'],'rootUri':undefined,'workspaceFolders':[{'path':this[_0xc1b4d5(0x15b)][_0xc1b4d5(0x156)]}]}}),_0x30de31={};_0x30de31[_0xc1b4d5(0x186)]=_0xc1b4d5(0x1a2),_0x30de31[_0xc1b4d5(0x190)]=_0xc1b4d5(0x16e),this['input'][_0xc1b4d5(0x18b)](JSON['stringify'](_0x30de31)+'\x0a');const _0x4745da={};_0x4745da[_0xc1b4d5(0x190)]=_0xc1b4d5(0x14f),_0x4745da[_0xc1b4d5(0x17e)]={};const _0x11284b=await this[_0xc1b4d5(0x15c)](_0x4745da),_0x7168fa={};_0x7168fa['code']=_0xc1b4d5(0x1a0);if(!Array['isArray'](_0x11284b['tools']))throw Object['assign'](new Error(_0xc1b4d5(0x14c)),_0x7168fa);return this[_0xc1b4d5(0x16b)]=_0x11284b[_0xc1b4d5(0x155)],this[_0xc1b4d5(0x18d)]=crypto['createHash'](_0xc1b4d5(0x15e))[_0xc1b4d5(0x177)](JSON[_0xc1b4d5(0x196)](_0x11284b[_0xc1b4d5(0x155)]))[_0xc1b4d5(0x14b)]('hex'),this;}[_0x10bfaf(0x15c)](_0x590cbf){const _0x3493fb=_0x10bfaf,_0x3aa798=_0x3493fb(0x147)+this[_0x3493fb(0x173)][_0x3493fb(0x17f)]+':'+ ++this[_0x3493fb(0x161)];return new Promise((_0x159333,_0x2600e2)=>{const _0xdc5bc3=_0x3493fb,_0x2356b3={};_0x2356b3[_0xdc5bc3(0x193)]=_0x159333,_0x2356b3[_0xdc5bc3(0x17d)]=_0x2600e2,_0x2356b3[_0xdc5bc3(0x160)]=_0x590cbf['id'],this[_0xdc5bc3(0x144)][_0xdc5bc3(0x157)](_0x3aa798,_0x2356b3);const _0x21ec3e={..._0x590cbf};_0x21ec3e['jsonrpc']=_0xdc5bc3(0x1a2),_0x21ec3e['id']=_0x3aa798;const _0x2aa3ed=JSON[_0xdc5bc3(0x196)](_0x21ec3e)+'\x0a';this['input'][_0xdc5bc3(0x18b)](_0x2aa3ed,_0x22cd4b=>{const _0x15dc70=_0xdc5bc3;_0x22cd4b&&(this[_0x15dc70(0x144)]['delete'](_0x3aa798),_0x2600e2(_0x22cd4b));});});}['cancel'](_0x2f5c65){const _0x5be1b2=_0x10bfaf;for(const [_0x41b481,_0x4753ea]of this['pending'])if(_0x4753ea[_0x5be1b2(0x160)]===_0x2f5c65)this[_0x5be1b2(0x176)][_0x5be1b2(0x18b)](JSON[_0x5be1b2(0x196)]({'jsonrpc':_0x5be1b2(0x1a2),'method':_0x5be1b2(0x192),'params':{'requestId':_0x41b481}})+'\x0a');}[_0x10bfaf(0x159)](_0xe15e2b){const _0x289af5=_0x10bfaf;this[_0x289af5(0x175)]+=this[_0x289af5(0x188)][_0x289af5(0x18b)](_0xe15e2b);if(Buffer[_0x289af5(0x148)](this[_0x289af5(0x175)])>0x8*0x400*0x400){for(const _0x10b002 of this['pending'][_0x289af5(0x151)]())_0x10b002[_0x289af5(0x17d)](Object[_0x289af5(0x15f)](new Error(_0x289af5(0x171)),{'code':'GATEWAY_OUTPUT_LIMIT'}));this[_0x289af5(0x144)][_0x289af5(0x179)](),void this[_0x289af5(0x199)]()['catch'](()=>{});return;}let _0x5a4b03;while((_0x5a4b03=this[_0x289af5(0x175)][_0x289af5(0x162)]('\x0a'))>=0x0){const _0x1521ba=this[_0x289af5(0x175)]['slice'](0x0,_0x5a4b03);this['buffer']=this[_0x289af5(0x175)][_0x289af5(0x178)](_0x5a4b03+0x1);if(!_0x1521ba[_0x289af5(0x184)]())continue;let _0x3741ce;try{_0x3741ce=JSON['parse'](_0x1521ba);}catch{continue;}const _0x5bb964=this[_0x289af5(0x144)][_0x289af5(0x15a)](_0x3741ce['id']);if(_0x5bb964&&!_0x3741ce[_0x289af5(0x190)]){this[_0x289af5(0x144)]['delete'](_0x3741ce['id']);if(_0x3741ce['error'])_0x5bb964[_0x289af5(0x17d)](Object['assign'](new Error(_0x3741ce[_0x289af5(0x16f)][_0x289af5(0x18f)]),{'code':_0x289af5(0x169),'rpcError':_0x3741ce['error']}));else _0x5bb964[_0x289af5(0x193)](_0x3741ce['result']);continue;}if(_0x3741ce['method']&&_0x3741ce['id']!==undefined){const _0x517a16={};_0x517a16[_0x289af5(0x170)]=-0x7f59,_0x517a16['message']='APT_HOST_REQUEST_UNSUPPORTED';const _0x3d3c37={};_0x3d3c37[_0x289af5(0x186)]=_0x289af5(0x1a2),_0x3d3c37['id']=_0x3741ce['id'],_0x3d3c37[_0x289af5(0x16f)]=_0x517a16,this[_0x289af5(0x176)][_0x289af5(0x18b)](JSON[_0x289af5(0x196)](_0x3d3c37)+'\x0a');}else _0x3741ce[_0x289af5(0x190)]&&_0x3741ce[_0x289af5(0x190)]!=='notifications/tools/list_changed'&&this[_0x289af5(0x194)][_0x289af5(0x18c)]?.(_0x3741ce,this);}}async[_0x10bfaf(0x199)](){const _0x5590cc=_0x10bfaf;try{await this[_0x5590cc(0x173)]['close'](_0x5590cc(0x18a));}finally{for(const _0x1bb036 of this[_0x5590cc(0x144)][_0x5590cc(0x151)]())_0x1bb036['reject'](Object[_0x5590cc(0x15f)](new Error(_0x5590cc(0x14d)),{'code':_0x5590cc(0x198)}));this[_0x5590cc(0x144)][_0x5590cc(0x179)](),this[_0x5590cc(0x176)][_0x5590cc(0x183)](),this[_0x5590cc(0x18e)][_0x5590cc(0x183)]();}}}async function startGateway(_0x478e46){const _0x11602a=_0x10bfaf,_0x2a600b=_0x478e46[_0x11602a(0x168)]||process[_0x11602a(0x168)],_0x1ff5e8=_0x478e46[_0x11602a(0x19d)]||process['stdout'],_0x38357d=new Set(),_0x4e40c8=new Map(),_0x3e5ee1=_0x13c4a6=>{const _0x1dd5c7=_0x11602a;if(!_0x13c4a6)return;!_0x1ff5e8[_0x1dd5c7(0x18b)](JSON['stringify'](_0x13c4a6)+'\x0a')&&(_0x2a600b['pause'](),_0x1ff5e8[_0x1dd5c7(0x17a)]('drain',()=>_0x2a600b['resume']()));},_0x236a86={};_0x236a86[_0x11602a(0x186)]=_0x11602a(0x1a2),_0x236a86['method']='notifications/tools/list_changed';const _0x85d5fd=new WorkspaceGateway({..._0x478e46,'onCatalogChanged':()=>_0x3e5ee1(_0x236a86),'runtimeFactory':async(_0x4a6cb7,_0x102a61,_0x4e728c)=>{const _0x27b1d1=_0x11602a,_0x19918c={..._0x478e46};_0x19918c['childEnvironment']=_0x4e728c[_0x27b1d1(0x167)]||{},_0x19918c['onMessage']=_0x3e5ee1;const _0x224c8f=new GatewaySession(_0x4a6cb7,_0x19918c);try{return await _0x224c8f['start'](_0x102a61),_0x38357d['add'](_0x224c8f),_0x224c8f;}catch(_0x5038b5){await _0x224c8f[_0x27b1d1(0x199)]()['catch'](()=>{});throw _0x5038b5;}}}),_0x1f5289=new(require(_0x11602a(0x164)))['GatewayContext'](_0x85d5fd,_0x478e46[_0x11602a(0x158)]);await _0x1f5289[_0x11602a(0x182)]();const _0x5c78e9=_0x85d5fd[_0x11602a(0x199)][_0x11602a(0x150)](_0x85d5fd);_0x85d5fd[_0x11602a(0x199)]=async()=>{const _0x2be854=_0x11602a;try{await _0x5c78e9();}finally{await _0x1f5289[_0x2be854(0x199)]();}};let _0x500478='',_0x319007=new StringDecoder(_0x11602a(0x146));return _0x2a600b['on'](_0x11602a(0x145),_0x273968=>{const _0x2955c3=_0x11602a;_0x500478+=_0x319007[_0x2955c3(0x18b)](_0x273968);if(Buffer[_0x2955c3(0x148)](_0x500478)>0x8*0x400*0x400)return void _0x85d5fd[_0x2955c3(0x199)]()[_0x2955c3(0x17c)](_0x3488ba=>console[_0x2955c3(0x16f)](_0x3488ba[_0x2955c3(0x170)]));let _0x16e908;while((_0x16e908=_0x500478[_0x2955c3(0x162)]('\x0a'))>=0x0){const _0xbb9fb5=_0x500478[_0x2955c3(0x178)](0x0,_0x16e908);_0x500478=_0x500478[_0x2955c3(0x178)](_0x16e908+0x1);if(!_0xbb9fb5[_0x2955c3(0x184)]())continue;let _0x39afc3;try{_0x39afc3=JSON[_0x2955c3(0x14e)](_0xbb9fb5);}catch{const _0x491cd8={};_0x491cd8[_0x2955c3(0x170)]=-0x7fbc,_0x491cd8[_0x2955c3(0x18f)]='Parse\x20error';const _0x165237={};_0x165237['jsonrpc']=_0x2955c3(0x1a2),_0x165237['id']=null,_0x165237[_0x2955c3(0x16f)]=_0x491cd8,_0x3e5ee1(_0x165237);continue;}if(!_0x39afc3||typeof _0x39afc3!==_0x2955c3(0x180)||Array[_0x2955c3(0x195)](_0x39afc3)||_0x39afc3[_0x2955c3(0x186)]!==_0x2955c3(0x1a2)||_0x39afc3[_0x2955c3(0x190)]!==undefined&&typeof _0x39afc3[_0x2955c3(0x190)]!=='string'){const _0x57d2e3={};_0x57d2e3[_0x2955c3(0x170)]=-0x7f58,_0x57d2e3[_0x2955c3(0x18f)]=_0x2955c3(0x153);const _0x42aa5d={};_0x42aa5d[_0x2955c3(0x186)]='2.0',_0x42aa5d['id']=null,_0x42aa5d[_0x2955c3(0x16f)]=_0x57d2e3,_0x3e5ee1(_0x42aa5d);continue;}if(!_0x39afc3[_0x2955c3(0x190)])continue;if(_0x39afc3[_0x2955c3(0x190)]===_0x2955c3(0x192)){for(const _0x57d0a of _0x38357d)_0x57d0a['cancel'](_0x39afc3[_0x2955c3(0x17e)]?.[_0x2955c3(0x174)]);continue;}const _0x18b28c=JSON[_0x2955c3(0x196)](_0x39afc3['id']);if(_0x39afc3['id']!==undefined&&_0x4e40c8[_0x2955c3(0x19e)](_0x18b28c)){const _0x448a67={};_0x448a67[_0x2955c3(0x170)]=-0x7f58,_0x448a67[_0x2955c3(0x18f)]=_0x2955c3(0x172);const _0x3d2f70={};_0x3d2f70['jsonrpc']=_0x2955c3(0x1a2),_0x3d2f70['id']=_0x39afc3['id'],_0x3d2f70['error']=_0x448a67,_0x3e5ee1(_0x3d2f70);continue;}const _0x153fb3=_0x85d5fd[_0x2955c3(0x191)](_0x39afc3)[_0x2955c3(0x19c)](_0x3e5ee1)[_0x2955c3(0x17c)](_0x35d65c=>{const _0x2bf811=_0x2955c3,_0x421fcb={};_0x421fcb['code']=-0x7f5b,_0x421fcb[_0x2bf811(0x18f)]=_0x35d65c[_0x2bf811(0x170)]||_0x2bf811(0x143);if(_0x39afc3['id']!==undefined)_0x3e5ee1({'jsonrpc':_0x2bf811(0x1a2),'id':_0x39afc3['id'],'error':_0x421fcb});})['finally'](()=>_0x4e40c8['delete'](_0x18b28c));if(_0x39afc3['id']!==undefined)_0x4e40c8[_0x2955c3(0x157)](_0x18b28c,_0x153fb3);}}),_0x2a600b['on'](_0x11602a(0x1a4),()=>void _0x85d5fd[_0x11602a(0x199)]()['catch'](_0x33d130=>console['error']('[APT]\x20Gateway\x20shutdown\x20unconfirmed:',_0x33d130[_0x11602a(0x170)]))),_0x2a600b['on'](_0x11602a(0x16f),()=>void _0x85d5fd['close']()[_0x11602a(0x17c)](_0x2cbf9c=>console[_0x11602a(0x16f)](_0x11602a(0x16a),_0x2cbf9c[_0x11602a(0x170)]))),_0x85d5fd;}const _0x2efc2a={};function _0x44ee(_0x3eff8d,_0x3045fe){_0x3eff8d=_0x3eff8d-0x143;const _0x53ed49=_0x53ed();let _0x44eef7=_0x53ed49[_0x3eff8d];if(_0x44ee['tbPybV']===undefined){var _0x426743=function(_0x52f3fb){const _0x46413c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5be11c='',_0x5589f5='';for(let _0x3c7787=0x0,_0x2b8152,_0x4fd9cb,_0x6b6c06=0x0;_0x4fd9cb=_0x52f3fb['charAt'](_0x6b6c06++);~_0x4fd9cb&&(_0x2b8152=_0x3c7787%0x4?_0x2b8152*0x40+_0x4fd9cb:_0x4fd9cb,_0x3c7787++%0x4)?_0x5be11c+=String['fromCharCode'](0xff&_0x2b8152>>(-0x2*_0x3c7787&0x6)):0x0){_0x4fd9cb=_0x46413c['indexOf'](_0x4fd9cb);}for(let _0x398310=0x0,_0x5638fe=_0x5be11c['length'];_0x398310<_0x5638fe;_0x398310++){_0x5589f5+='%'+('00'+_0x5be11c['charCodeAt'](_0x398310)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5589f5);};_0x44ee['NmviYA']=_0x426743,_0x44ee['pCBwSJ']={},_0x44ee['tbPybV']=!![];}const _0x1bc941=_0x53ed49[0x0],_0x15d0b2=_0x3eff8d+_0x1bc941,_0x1a3b98=_0x44ee['pCBwSJ'][_0x15d0b2];return!_0x1a3b98?(_0x44eef7=_0x44ee['NmviYA'](_0x44eef7),_0x44ee['pCBwSJ'][_0x15d0b2]=_0x44eef7):_0x44eef7=_0x1a3b98,_0x44eef7;}function _0x53ed(){const _0xea1d2e=['CMvQzwn0','CgfYyw1Z','y29UBMvJDgLVBKLK','B2jQzwn0','lI4VChjVEhKVD29YA3nWywnLlwDHDgv3yxK','C3rHCNq','zgvZDhjVEq','DhjPBq','BM9KztPZDhjLyw0','ANnVBNjWyW','mJi4odeYBMrpDLrA','zgvJB2rLCG','BM9KztPZDhjPBMDFzgvJB2rLCG','z2f0zxDHEs1ZzxnZAw9UlwnSB3nLza','D3jPDgu','B25nzxnZywDL','y2f0ywXVz0HHC2G','B3v0Chv0','BwvZC2fNzq','Bwv0Ag9K','AgfUzgXL','BM90AwzPy2f0Aw9UCY9Jyw5JzwXSzwq','CMvZB2X2zq','B3b0Aw9UCW','AxnbCNjHEq','C3rYAw5NAwz5','mtzruNPTy1K','tvvuqvrjt05Ft1vuq09nrv9vtKTot1Do','y2XVC2u','mty5nZrNAvDnDvm','zxHWB3j0CW','DgHLBG','C3rKB3v0','AgfZ','CMvJB3zLCKjLzM9Yzvn0yxj0Dxa','r0furvDbwv9dqvrbte9hx1voqvzbsuXbqKXf','ndeXmJKXou9YyKvttG','mI4W','nJe0mZKXndDMC0LRrvq','zw5K','r0furvDbwv9gquLmruq','CgvUzgLUzW','zgf0yq','DxrMoa','z2f0zxDHEtO','yNL0zuXLBMD0Aa','mtaXnti2ovfVr3nAqW','CMfUzg9Tvvvjra','zgLNzxn0','uNvUDgLTzsbJyxrHBg9NihvUyxzHAwXHyMXL','uMvXDwvZDcbVDxrJB21LigLZihvUA25VD24Gywz0zxiGy29UBMvJDgLVBIbJBg9Zzwq','CgfYC2u','Dg9VBhmVBgLZDa','yMLUza','DMfSDwvZ','lI9JB25Uzwn0Aw9Ulxn1CgvYDMLZB3i','sw52ywXPzcbszxf1zxn0','Aw5PDgLHBgL6zq','Dg9VBhm','D29YA3nWywnL','C2v0','y29UDgv4De9WDgLVBNm','CMvJzwL2zq','z2v0','yMLUzgLUzW','CMvXDwvZDa','mtbgAgX3DgO','C2HHmJu2','yxnZAwDU','Ag9ZDeLK','C2vXDwvUy2u','Aw5KzxHpzG','mte1tKTxt2Xq','lI9NyxrLD2f5lwnVBNrLEhq','r2f0zxDHEvnLC3nPB24','ndm0CeHSvwHL','zw52','C3rKAw4','uLvoveLnrv9suenFrvjst1i','w0fqvf0Gr2f0zxDHEsbZAhv0zg93BIb1BMnVBMzPCM1LzdO','y2f0ywXVzW','mtq4mZu5ne92ru9MEa','odKYmZe2mhvizw1uyG','BM90AwzPy2f0Aw9UCY9PBML0AwfSAxPLza','zxjYB3i','y29Kzq','q2HPBgqGB3v0Chv0igv4y2vLzhmGBgLTAxq','uKvrvuvtvf9jrf9dt05gteLdva','C3vWzxj2AxnVCG','CMvXDwvZDeLK','yNvMzMvY','Aw5WDxq','DxbKyxrL','C2XPy2u','y2XLyxi','B25Jzq','lI91CgrHDguTCMvXDwvZDa','y2f0y2G'];_0x53ed=function(){return _0xea1d2e;};return _0x53ed();}_0x2efc2a[_0x10bfaf(0x165)]=GatewaySession,_0x2efc2a['startGateway']=startGateway,module[_0x10bfaf(0x19b)]=_0x2efc2a;
|
|
1
|
+
'use strict';const _0x295976=_0x56c3;(function(_0x65d1a4,_0x4c067b){const _0xabb685=_0x56c3,_0x10279a=_0x65d1a4();while(!![]){try{const _0x1c6710=-parseInt(_0xabb685(0x209))/0x1*(parseInt(_0xabb685(0x1f5))/0x2)+-parseInt(_0xabb685(0x20d))/0x3*(-parseInt(_0xabb685(0x1ef))/0x4)+parseInt(_0xabb685(0x1c2))/0x5*(parseInt(_0xabb685(0x1cd))/0x6)+-parseInt(_0xabb685(0x1e4))/0x7+parseInt(_0xabb685(0x220))/0x8*(parseInt(_0xabb685(0x1e8))/0x9)+-parseInt(_0xabb685(0x1d2))/0xa+-parseInt(_0xabb685(0x21d))/0xb;if(_0x1c6710===_0x4c067b)break;else _0x10279a['push'](_0x10279a['shift']());}catch(_0x5f8b04){_0x10279a['push'](_0x10279a['shift']());}}}(_0x5240,0x75532));const {PassThrough}=require(_0x295976(0x20a)),{StringDecoder}=require(_0x295976(0x1cb)),crypto=require(_0x295976(0x1e6)),{WorkspaceGateway}=require(_0x295976(0x1f4));function _0x5240(){const _0x21abb3=['ywrK','BwvZC2fNzq','CgfYC2u','odGYntGWzwjWy0Lc','C3rYAw5NAwz5','BM90AwzPy2f0Aw9UCY9PBML0AwfSAxPLza','qvbux0Hpu1rFuKvrvuvtvf9vtLnvufbpuLrfra','zgvZDhjVEq','CMvZDw1L','Cgf1C2u','sw52ywXPzcbszxf1zxn0','C3rKAw4','BM9KztPZDhjPBMDFzgvJB2rLCG','AgfZ','nNjsu0PMAa','B3b0Aw9UCW','CMvXDwvZDa','Agv4','D29YA3nWywnL','mtq5ntG2mgH2B0XNEq','w0fqvf0Gr2f0zxDHEsbZAhv0zg93BIb1BMnVBMzPCM1LzdO','zxjYB3i','uMvXDwvZDcbVDxrJB21LigLZihvUA25VD24Gywz0zxiGy29UBMvJDgLVBIbJBg9Zzwq','DxrMoa','B25nzxnZywDL','B2jQzwn0','Dg9VBhmVBgLZDa','yNvMzMvY','Dg9VBhm','C2HHmJu2','B25Jzq','r2f0zxDHEvnLC3nPB24','zhjHAw4','CMvJzwL2zq','CgfYyw1Z','Aw5KzxHpzG','AgfUzgXL','nte1mJq5Dw9LCxjM','r0furvDbwv9pvvrqvvrFteLnsvq','BM9KztPJCNLWDg8','C3rHCNq','mtGXodLZvfnAvwG','uNvUDgLTzsbJyxrHBg9NihvUyxzHAwXHyMXL','ChvIBgLJs2v5','y2XVC2u','Ag9ZDeLK','DhjPBq','C3rKB3v0','mtC1mZeXmKvpqvrxra','CMvQzwn0','zgf0yq','y29Kzq','yMLUza','lI4VChjVEhKVD29YA3nWywnLlwDHDgv3yxK','mMHqufHnyq','BM90AwzPy2f0Aw9UCY90B29SCY9SAxn0x2nOyw5Nzwq','r2f0zxDHEunVBNrLEhq','D3jPDgu','y2HPBgrfBNzPCM9UBwvUDa','C2XPy2u','CMfUzg9Tvvvjra','CMvZDwX0','CMvZB2X2zq','Aw5WDxq','yMLUzgLUzW','r0furvDbwv9dqvrbte9hx1voqvzbsuXbqKXf','lI91CgrHDguTCMvXDwvZDa','y2f0ywXVzW','CMvXDwvZDeLK','C3rHCNrhyxrLD2f5','u3vWzxj2AxnVCG','CMvJB3zLCKjLzM9Yzvn0yxj0Dxa','C2v0','zgLNzxn0','mJq5mZnOqLrSvxO','BM9KztPZDhjLyw0','yNL0zuXLBMD0Aa','z2f0zxDHEtO','nMvftuvRBq','yxnZAwDU','AxnbCNjHEq','B3v0Chv0','y2f0y2G','zxHWB3j0CW','q29UBMvJDgLVBLn1CgvYDMLZB3i','q2HPBgqGB3v0Chv0igv4y2vLzhmGBgLTAxq','Bwv0Ag9K','r0furvDbwv9gquLmruq','C3rYAw5N','DgHLBG','ANnVBNjWyW','lI9JB25Uzwn0Aw9Ulxn1CgvYDMLZB3i','y2XLyxi','BM90AwzPy2f0Aw9UCY9Jyw5JzwXSzwq','mte3mJCWmdfLDeT6txm','DxbKyxrL','mI4W','mJKZnMfrt2zYyW','zgvSzxrL','y2f0ywXVz0HHC2G','C3vWzxj2AxnVCG','zgvJB2rLCG','uKvrvuvtvf9jrf9dt05gteLdva','C2vXDwvUy2u','tvvuqvrjt05Ft1vuq09nrv9vtKTot1Do','y3jLyxrLsgfZAa','y2fUy2vS','CgvUzgLUzW','lI9NyxrLD2f5lwnVBNrLEhq'];_0x5240=function(){return _0x21abb3;};return _0x5240();}class GatewaySession{constructor(_0x58241f,_0x2874ac){const _0x446ef2=_0x295976;this['binding']=_0x58241f,this['options']=_0x2874ac,this[_0x446ef2(0x1fe)]=new PassThrough(),this[_0x446ef2(0x210)]=new PassThrough(),this['pending']=new Map(),this[_0x446ef2(0x226)]=0x0,this['buffer']='',this[_0x446ef2(0x224)]=new StringDecoder(_0x446ef2(0x1d6));const _0x4a30a2=_0x2874ac[_0x446ef2(0x205)]||require(_0x446ef2(0x21a))[_0x446ef2(0x213)];this['supervisor']=new _0x4a30a2({..._0x2874ac,'workspace':_0x58241f[_0x446ef2(0x1d1)],'explicitWorkspace':!![],'connectionId':crypto[_0x446ef2(0x1fb)](),'gatewayBinding':_0x58241f,'stdin':this['input'],'stdout':this['output']}),this[_0x446ef2(0x210)]['on'](_0x446ef2(0x1f1),_0x47fe9d=>this[_0x446ef2(0x1e0)](_0x47fe9d));}async[_0x295976(0x1e7)](_0x1a2bbf){const _0x24fa49=_0x295976;await require(_0x24fa49(0x201))[_0x24fa49(0x206)](this[_0x24fa49(0x1ff)][_0x24fa49(0x1d1)],this[_0x24fa49(0x1ce)][_0x24fa49(0x1ea)]),await this[_0x24fa49(0x223)][_0x24fa49(0x1e7)]();const _0xab927d=await this[_0x24fa49(0x1cf)]({'method':'initialize','params':{..._0x1a2bbf,'capabilities':{},'rootPath':this[_0x24fa49(0x1ff)][_0x24fa49(0x1d1)],'rootUri':undefined,'workspaceFolders':[{'path':this[_0x24fa49(0x1ff)][_0x24fa49(0x1d1)]}]}}),_0x246b56={};_0x246b56[_0x24fa49(0x219)]=_0x24fa49(0x21f),_0x246b56[_0x24fa49(0x215)]=_0x24fa49(0x1c4),this['input'][_0x24fa49(0x1f8)](JSON[_0x24fa49(0x1c3)](_0x246b56)+'\x0a');const _0x236afd={};_0x236afd['method']=_0x24fa49(0x1d9),_0x236afd[_0x24fa49(0x1e1)]={};const _0x569711=await this[_0x24fa49(0x1cf)](_0x236afd),_0x1eba4e={};_0x1eba4e[_0x24fa49(0x1f2)]=_0x24fa49(0x200);if(!Array['isArray'](_0x569711[_0x24fa49(0x1db)]))throw Object['assign'](new Error(_0x24fa49(0x1e9)),_0x1eba4e);return this[_0x24fa49(0x202)]=_0x569711[_0x24fa49(0x1db)],this[_0x24fa49(0x222)]=crypto[_0x24fa49(0x1bb)](_0x24fa49(0x1dc))[_0x24fa49(0x21e)](JSON['stringify'](_0x569711['tools']))[_0x24fa49(0x208)](_0x24fa49(0x1d0)),this;}['request'](_0x555c47){const _0x2f411e=_0x295976,_0x20e997=_0x2f411e(0x20c)+this[_0x2f411e(0x223)]['connectionId']+':'+ ++this[_0x2f411e(0x226)];return new Promise((_0x2ede53,_0x550f5d)=>{const _0xe570a0=_0x2f411e,_0x4abfb9={};_0x4abfb9[_0xe570a0(0x1fd)]=_0x2ede53,_0x4abfb9['reject']=_0x550f5d,_0x4abfb9['hostId']=_0x555c47['id'],this[_0xe570a0(0x1bd)][_0xe570a0(0x207)](_0x20e997,_0x4abfb9);const _0x211833={..._0x555c47};_0x211833['jsonrpc']=_0xe570a0(0x21f),_0x211833['id']=_0x20e997;const _0x43c5fa=JSON[_0xe570a0(0x1c3)](_0x211833)+'\x0a';this[_0xe570a0(0x1fe)][_0xe570a0(0x1f8)](_0x43c5fa,_0x4abf0f=>{const _0x2532df=_0xe570a0;_0x4abf0f&&(this[_0x2532df(0x1bd)]['delete'](_0x20e997),_0x550f5d(_0x4abf0f));});});}['cancel'](_0x4baf68){const _0x29039c=_0x295976;for(const [_0x53a368,_0x9aa210]of this[_0x29039c(0x1bd)])if(_0x9aa210[_0x29039c(0x1ec)]===_0x4baf68)this[_0x29039c(0x1fe)][_0x29039c(0x1f8)](JSON[_0x29039c(0x1c3)]({'jsonrpc':_0x29039c(0x21f),'method':'notifications/cancelled','params':{'requestId':_0x53a368}})+'\x0a');}[_0x295976(0x1e0)](_0x211583){const _0x3d4c38=_0x295976;this[_0x3d4c38(0x1da)]+=this[_0x3d4c38(0x224)][_0x3d4c38(0x1f8)](_0x211583);if(Buffer[_0x3d4c38(0x20b)](this[_0x3d4c38(0x1da)])>0x8*0x400*0x400){for(const _0x3f643b of this[_0x3d4c38(0x1bd)]['values']())_0x3f643b[_0x3d4c38(0x1f0)](Object[_0x3d4c38(0x20e)](new Error(_0x3d4c38(0x214)),{'code':_0x3d4c38(0x1e5)}));this[_0x3d4c38(0x1bd)][_0x3d4c38(0x21b)](),void this[_0x3d4c38(0x1eb)]()[_0x3d4c38(0x211)](()=>{});return;}let _0x2da515;while((_0x2da515=this[_0x3d4c38(0x1da)][_0x3d4c38(0x1e2)]('\x0a'))>=0x0){const _0x1db292=this[_0x3d4c38(0x1da)][_0x3d4c38(0x1fa)](0x0,_0x2da515);this[_0x3d4c38(0x1da)]=this['buffer']['slice'](_0x2da515+0x1);if(!_0x1db292[_0x3d4c38(0x1ed)]())continue;let _0x6e506b;try{_0x6e506b=JSON['parse'](_0x1db292);}catch{continue;}const _0x1b11d2=this[_0x3d4c38(0x1bd)]['get'](_0x6e506b['id']);if(_0x1b11d2&&!_0x6e506b[_0x3d4c38(0x215)]){this[_0x3d4c38(0x1bd)][_0x3d4c38(0x221)](_0x6e506b['id']);if(_0x6e506b['error'])_0x1b11d2[_0x3d4c38(0x1f0)](Object[_0x3d4c38(0x20e)](new Error(_0x6e506b[_0x3d4c38(0x1d4)][_0x3d4c38(0x1c0)]),{'code':'RUNTIME_RPC_ERROR','rpcError':_0x6e506b['error']}));else _0x1b11d2[_0x3d4c38(0x1fd)](_0x6e506b[_0x3d4c38(0x1fc)]);continue;}if(_0x6e506b[_0x3d4c38(0x215)]&&_0x6e506b['id']!==undefined){const _0x49e3b0={};_0x49e3b0[_0x3d4c38(0x1f2)]=-0x7f59,_0x49e3b0[_0x3d4c38(0x1c0)]=_0x3d4c38(0x1c5);const _0x31bc8f={};_0x31bc8f[_0x3d4c38(0x219)]=_0x3d4c38(0x21f),_0x31bc8f['id']=_0x6e506b['id'],_0x31bc8f[_0x3d4c38(0x1d4)]=_0x49e3b0,this[_0x3d4c38(0x1fe)][_0x3d4c38(0x1f8)](JSON[_0x3d4c38(0x1c3)](_0x31bc8f)+'\x0a');}else _0x6e506b[_0x3d4c38(0x215)]&&_0x6e506b[_0x3d4c38(0x215)]!==_0x3d4c38(0x1f6)&&this[_0x3d4c38(0x1ce)]['onMessage']?.(_0x6e506b,this);}}async[_0x295976(0x1eb)](){const _0x4394df=_0x295976;try{await this[_0x4394df(0x223)]['close']('gateway-session-closed');}finally{for(const _0x2d242a of this[_0x4394df(0x1bd)]['values']())_0x2d242a[_0x4394df(0x1f0)](Object[_0x4394df(0x20e)](new Error(_0x4394df(0x1d5)),{'code':_0x4394df(0x1ba)}));this['pending'][_0x4394df(0x21b)](),this['input'][_0x4394df(0x1c6)](),this[_0x4394df(0x210)][_0x4394df(0x1c6)]();}}}function _0x56c3(_0x5d3505,_0xeacf24){_0x5d3505=_0x5d3505-0x1ba;const _0x524006=_0x5240();let _0x56c362=_0x524006[_0x5d3505];if(_0x56c3['GTHDMB']===undefined){var _0x4ca5c5=function(_0x429254){const _0x20dec2='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x87e26c='',_0x1f288c='';for(let _0x5c23b8=0x0,_0x4127f6,_0x587a04,_0x43829c=0x0;_0x587a04=_0x429254['charAt'](_0x43829c++);~_0x587a04&&(_0x4127f6=_0x5c23b8%0x4?_0x4127f6*0x40+_0x587a04:_0x587a04,_0x5c23b8++%0x4)?_0x87e26c+=String['fromCharCode'](0xff&_0x4127f6>>(-0x2*_0x5c23b8&0x6)):0x0){_0x587a04=_0x20dec2['indexOf'](_0x587a04);}for(let _0x2a7e38=0x0,_0x4cbc73=_0x87e26c['length'];_0x2a7e38<_0x4cbc73;_0x2a7e38++){_0x1f288c+='%'+('00'+_0x87e26c['charCodeAt'](_0x2a7e38)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1f288c);};_0x56c3['KOBnVt']=_0x4ca5c5,_0x56c3['yugXrI']={},_0x56c3['GTHDMB']=!![];}const _0x33ca70=_0x524006[0x0],_0x398c8a=_0x5d3505+_0x33ca70,_0x501acf=_0x56c3['yugXrI'][_0x398c8a];return!_0x501acf?(_0x56c362=_0x56c3['KOBnVt'](_0x56c362),_0x56c3['yugXrI'][_0x398c8a]=_0x56c362):_0x56c362=_0x501acf,_0x56c362;}async function startGateway(_0xe5c3c0){const _0x49b9f5=_0x295976,_0x43609a=_0xe5c3c0['stdin']||process[_0x49b9f5(0x1ca)],_0x1e34b=_0xe5c3c0['stdout']||process[_0x49b9f5(0x1ee)],_0x4115d2=new Set(),_0x133f09=new Map(),_0x5d0f2d=_0x562812=>{const _0x27d458=_0x49b9f5;if(!_0x562812)return;!_0x1e34b['write'](JSON[_0x27d458(0x1c3)](_0x562812)+'\x0a')&&(_0x43609a[_0x27d458(0x1c8)](),_0x1e34b[_0x27d458(0x1dd)](_0x27d458(0x1df),()=>_0x43609a[_0x27d458(0x1c7)]()));},_0x38a0f0={};_0x38a0f0[_0x49b9f5(0x219)]=_0x49b9f5(0x21f),_0x38a0f0[_0x49b9f5(0x215)]='notifications/tools/list_changed';const _0xfef945=new WorkspaceGateway({..._0xe5c3c0,'onCatalogChanged':()=>_0x5d0f2d(_0x38a0f0),'runtimeFactory':async(_0x4156d2,_0x216d61,_0x1b4c22)=>{const _0x1fc78e=_0x49b9f5,_0x53a88f={..._0xe5c3c0};_0x53a88f[_0x1fc78e(0x1f9)]=_0x1b4c22['env']||{},_0x53a88f[_0x1fc78e(0x1d7)]=_0x5d0f2d;const _0x4f2b4e=new GatewaySession(_0x4156d2,_0x53a88f);try{return await _0x4f2b4e[_0x1fc78e(0x1e7)](_0x216d61),_0x4115d2[_0x1fc78e(0x1bf)](_0x4f2b4e),_0x4f2b4e;}catch(_0x14fb0d){await _0x4f2b4e[_0x1fc78e(0x1eb)]()['catch'](()=>{});throw _0x14fb0d;}}}),_0x11d98d=new(require(_0x49b9f5(0x1be)))[(_0x49b9f5(0x1f7))](_0xfef945,_0xe5c3c0['contextOptions']);await _0x11d98d['start']();const _0x38bceb=_0xfef945[_0x49b9f5(0x1eb)][_0x49b9f5(0x1f3)](_0xfef945);_0xfef945[_0x49b9f5(0x1eb)]=async()=>{try{await _0x38bceb();}finally{await _0x11d98d['close']();}};let _0x1ae7dd='',_0x4cc350=new StringDecoder(_0x49b9f5(0x1d6));return _0x43609a['on'](_0x49b9f5(0x1f1),_0x4367af=>{const _0x1c7ecb=_0x49b9f5;_0x1ae7dd+=_0x4cc350[_0x1c7ecb(0x1f8)](_0x4367af);if(Buffer[_0x1c7ecb(0x20b)](_0x1ae7dd)>0x8*0x400*0x400)return void _0xfef945['close']()[_0x1c7ecb(0x211)](_0x4661e3=>console[_0x1c7ecb(0x1d4)](_0x4661e3[_0x1c7ecb(0x1f2)]));let _0x4bc265;while((_0x4bc265=_0x1ae7dd[_0x1c7ecb(0x1e2)]('\x0a'))>=0x0){const _0x2f3847=_0x1ae7dd[_0x1c7ecb(0x1fa)](0x0,_0x4bc265);_0x1ae7dd=_0x1ae7dd[_0x1c7ecb(0x1fa)](_0x4bc265+0x1);if(!_0x2f3847['trim']())continue;let _0x2c7645;try{_0x2c7645=JSON[_0x1c7ecb(0x1c1)](_0x2f3847);}catch{const _0x205a38={};_0x205a38[_0x1c7ecb(0x1f2)]=-0x7fbc,_0x205a38[_0x1c7ecb(0x1c0)]='Parse\x20error';const _0xe7a1e2={};_0xe7a1e2[_0x1c7ecb(0x219)]=_0x1c7ecb(0x21f),_0xe7a1e2['id']=null,_0xe7a1e2[_0x1c7ecb(0x1d4)]=_0x205a38,_0x5d0f2d(_0xe7a1e2);continue;}if(!_0x2c7645||typeof _0x2c7645!==_0x1c7ecb(0x1d8)||Array[_0x1c7ecb(0x20f)](_0x2c7645)||_0x2c7645[_0x1c7ecb(0x219)]!==_0x1c7ecb(0x21f)||_0x2c7645[_0x1c7ecb(0x215)]!==undefined&&typeof _0x2c7645[_0x1c7ecb(0x215)]!==_0x1c7ecb(0x217)){const _0x1a64f8={};_0x1a64f8[_0x1c7ecb(0x1f2)]=-0x7f58,_0x1a64f8[_0x1c7ecb(0x1c0)]=_0x1c7ecb(0x1c9);const _0x408162={};_0x408162[_0x1c7ecb(0x219)]=_0x1c7ecb(0x21f),_0x408162['id']=null,_0x408162[_0x1c7ecb(0x1d4)]=_0x1a64f8,_0x5d0f2d(_0x408162);continue;}if(!_0x2c7645['method'])continue;if(_0x2c7645[_0x1c7ecb(0x215)]===_0x1c7ecb(0x21c)){for(const _0x151fe0 of _0x4115d2)_0x151fe0[_0x1c7ecb(0x1bc)](_0x2c7645['params']?.[_0x1c7ecb(0x203)]);continue;}const _0x3a99da=JSON['stringify'](_0x2c7645['id']);if(_0x2c7645['id']!==undefined&&_0x133f09[_0x1c7ecb(0x1cc)](_0x3a99da)){const _0x64da1f={};_0x64da1f[_0x1c7ecb(0x1f2)]=-0x7f58,_0x64da1f[_0x1c7ecb(0x1c0)]=_0x1c7ecb(0x225);const _0x15020a={};_0x15020a[_0x1c7ecb(0x219)]=_0x1c7ecb(0x21f),_0x15020a['id']=_0x2c7645['id'],_0x15020a[_0x1c7ecb(0x1d4)]=_0x64da1f,_0x5d0f2d(_0x15020a);continue;}const _0x4dbf16=_0xfef945[_0x1c7ecb(0x1e3)](_0x2c7645)[_0x1c7ecb(0x218)](_0x5d0f2d)[_0x1c7ecb(0x211)](_0x1a81c9=>{const _0x5c4078=_0x1c7ecb,_0x5e4b11={};_0x5e4b11['code']=-0x7f5b,_0x5e4b11['message']=_0x1a81c9[_0x5c4078(0x1f2)]||_0x5c4078(0x216);if(_0x2c7645['id']!==undefined)_0x5d0f2d({'jsonrpc':_0x5c4078(0x21f),'id':_0x2c7645['id'],'error':_0x5e4b11});})['finally'](()=>_0x133f09['delete'](_0x3a99da));if(_0x2c7645['id']!==undefined)_0x133f09['set'](_0x3a99da,_0x4dbf16);}}),_0x43609a['on']('end',()=>void _0xfef945[_0x49b9f5(0x1eb)]()['catch'](_0xa1450e=>console[_0x49b9f5(0x1d4)](_0x49b9f5(0x1d3),_0xa1450e[_0x49b9f5(0x1f2)]))),_0x43609a['on'](_0x49b9f5(0x1d4),()=>void _0xfef945[_0x49b9f5(0x1eb)]()[_0x49b9f5(0x211)](_0x36b245=>console[_0x49b9f5(0x1d4)](_0x49b9f5(0x1d3),_0x36b245[_0x49b9f5(0x1f2)]))),_0xfef945;}const _0x452223={};_0x452223[_0x295976(0x1de)]=GatewaySession,_0x452223[_0x295976(0x204)]=startGateway,module[_0x295976(0x212)]=_0x452223;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x1666c1=_0x4fef;(function(_0x1b23fd,_0x2e0f9a){const _0x197a93=_0x4fef,_0x281a55=_0x1b23fd();while(!![]){try{const _0x4fe047=-parseInt(_0x197a93(0x1ed))/0x1+-parseInt(_0x197a93(0x205))/0x2*(parseInt(_0x197a93(0x210))/0x3)+parseInt(_0x197a93(0x1f4))/0x4+-parseInt(_0x197a93(0x21d))/0x5*(parseInt(_0x197a93(0x219))/0x6)+-parseInt(_0x197a93(0x1ee))/0x7*(parseInt(_0x197a93(0x228))/0x8)+-parseInt(_0x197a93(0x222))/0x9*(parseInt(_0x197a93(0x201))/0xa)+parseInt(_0x197a93(0x229))/0xb;if(_0x4fe047===_0x2e0f9a)break;else _0x281a55['push'](_0x281a55['shift']());}catch(_0x1ab00f){_0x281a55['push'](_0x281a55['shift']());}}}(_0x3de3,0xbde5d));const fs=require('fs'),path=require(_0x1666c1(0x22e)),os=require('os'),child_process=require('child_process');function _0x4fef(_0x3d0878,_0x22cb53){_0x3d0878=_0x3d0878-0x1e8;const _0x3de376=_0x3de3();let _0x4fef17=_0x3de376[_0x3d0878];if(_0x4fef['MkEpvh']===undefined){var _0x10e40d=function(_0x5782b0){const _0x47d15b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x53e93e='',_0xc311f2='';for(let _0x40bf9b=0x0,_0x33a643,_0x471779,_0x3207d4=0x0;_0x471779=_0x5782b0['charAt'](_0x3207d4++);~_0x471779&&(_0x33a643=_0x40bf9b%0x4?_0x33a643*0x40+_0x471779:_0x471779,_0x40bf9b++%0x4)?_0x53e93e+=String['fromCharCode'](0xff&_0x33a643>>(-0x2*_0x40bf9b&0x6)):0x0){_0x471779=_0x47d15b['indexOf'](_0x471779);}for(let _0x1c318e=0x0,_0x127664=_0x53e93e['length'];_0x1c318e<_0x127664;_0x1c318e++){_0xc311f2+='%'+('00'+_0x53e93e['charCodeAt'](_0x1c318e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xc311f2);};_0x4fef['WHWiNT']=_0x10e40d,_0x4fef['TcUTcR']={},_0x4fef['MkEpvh']=!![];}const _0x56664d=_0x3de376[0x0],_0x3a6ef0=_0x3d0878+_0x56664d,_0x1f978a=_0x4fef['TcUTcR'][_0x3a6ef0];return!_0x1f978a?(_0x4fef17=_0x4fef['WHWiNT'](_0x4fef17),_0x4fef['TcUTcR'][_0x3a6ef0]=_0x4fef17):_0x4fef17=_0x1f978a,_0x4fef17;}function sanitizeErrorMessage(_0x341e97){const _0x9d3f0=_0x1666c1;if(!_0x341e97)return _0x341e97;return _0x341e97[_0x9d3f0(0x200)](/@colbymchenry\/codegraph/g,'code\x20intelligence\x20engine')[_0x9d3f0(0x200)](/code-review-graph/g,'graph\x20analysis\x20engine')[_0x9d3f0(0x200)](/code_review_graph/g,_0x9d3f0(0x212))[_0x9d3f0(0x200)](/@modelcontextprotocol\/server-memory/g,_0x9d3f0(0x21c));}function getDefaultMarkerPath(){const _0x2c8b7c=_0x1666c1;return path[_0x2c8b7c(0x20a)](os['homedir'](),_0x2c8b7c(0x231),_0x2c8b7c(0x22b));}function resolvePip(){const _0x516675=_0x1666c1,_0xc3d3a6=require('child_process');let _0x36ae72=_0x516675(0x224);for(const _0x1521d7 of[_0x516675(0x20e),_0x516675(0x224),'py']){try{const _0x4ab497={};_0x4ab497[_0x516675(0x21f)]=['pipe',_0x516675(0x1f3),'ignore'],_0xc3d3a6['execSync'](_0x1521d7+_0x516675(0x227),_0x4ab497),_0x36ae72=_0x1521d7;break;}catch(_0x1d96e4){}}for(const _0x51494b of[_0x516675(0x1e9),_0x516675(0x1ef),_0x36ae72+_0x516675(0x1fa)]){try{const _0x44a1aa={};_0x44a1aa[_0x516675(0x21f)]=[_0x516675(0x1f3),_0x516675(0x1f3),_0x516675(0x21e)];const _0x3491a8=_0xc3d3a6[_0x516675(0x203)](_0x51494b+'\x20--version',_0x44a1aa)[_0x516675(0x216)]()[_0x516675(0x214)]();if(_0x3491a8[_0x516675(0x20f)]()[_0x516675(0x1fc)](_0x516675(0x1ef)))return _0x51494b;}catch(_0x1cf521){}}return'pip';}function _0x3de3(){const _0x515223=['ic1TihbPCa','BwTKAxjtEw5J','Aw5JBhvKzxm','ufjprKLmrq','q29TBwfUzcbZDgrLCNiGB3v0Chv0oGO','Bg9N','CMvWBgfJzq','ntuWodeXmejAzLHQuW','lI4VlI4VCgfJA2fNzs5QC29U','zxHLy1n5BMm','BwvZC2fNzq','mJq2CuHMwvvb','ms4YlJm1','CgfYC2u','CgvYBwLZC2LVBG','y2HPBgrFChjVy2vZCW','AM9PBG','Dg9ju09tDhjPBMC','C3vJy2vZCW','C3rYAw5NAwz5','ChL0Ag9UmW','Dg9mB3DLCKnHC2u','mty1ndHeC1jgsLu','C3rKzxjY','z3jHCgGGyw5HBhLZAxmGzw5NAw5L','icaXlIbsDw5UAw5NihrOzsbZzxr1CcbJB21Tyw5KihDPDgGGC3vKBZO','DhjPBq','z2v0rgvMyxvSDe1HCMTLCLbHDgG','Dg9tDhjPBMC','lI4VyMfJA2vUzhmVChjVzMLSzxm','CgvYBq','ndyZotHhvujdsfu','Aw5ZCgvJDa','lI4U','A25VD2XLzgDLihbLCNnPC3rLBMnLigXHEwvY','mtm1uMDzthjI','AwDUB3jL','C3rKAw8','vxbNCMfKAw5NigDSB2jHBcbnq1aGqwDLBNqGzgvWzw5Kzw5JAwvZigzYB20GDMvYC2LVBIa','lsblBM93BgvKz2uGCgvYC2LZDgvUy2uGBgf5zxiGChjVDMLZAw9UzwqGAw4GDgHLiefqvcbIywnRzw5KihbYB2zPBguU','ovr0Eg5XCW','CMvHzezPBgvtEw5J','ChL0Ag9U','zxjYB3i','rufdq0vt','ic0TDMvYC2LVBG','nZjUBer2CeO','ndyXnZK0odvqvKvjsgm','Aw5ZDgfSBa','lMDSB2jHBc1PBNn0ywXSzwq','rMfPBgvKihrVigLUC3rHBgWGz2XVyMfSie1ducb0B29SCZOG','yNjVD3nLCI1SB2nHBa','Cgf0Aa','CgfJA2fNzvzLCNnPB24','ihrVia','lMfUAgrO','icaYlIbpCIbMAxHPBMCGEw91CIbUCg0Gz2XVyMfSigrPCMvJDg9YEsbWzxjTAxnZAw9UCYaOAhr0Chm6lY9KB2nZlM5WBwPZlMnVBs9YzxnVBhzPBMCTzwfJy2vZlxbLCM1PC3nPB25ZlwvYCM9YCY13AgvUlwLUC3rHBgXPBMCTCgfJA2fNzxmTz2XVyMfSBhKPcG','CgLWmW','CMvJDxjZAxzL','zxHPC3rZu3LUyW','zxHWB3j0CW','nZGXnZK0ugn0y0zV','mta1ntCXouj6v1DiEa','CgLW','r2XVyMfSie1ducbbz2vUDcbKzxbLBMrLBMnPzxmGAw5ZDgfSBgvKihn1y2nLC3nMDwXSEs4','ms4WlJa','C2TPChbLza','CgLWzq','nJi3nJeYEuT5CuvP','zxzLCNK','zw50CMLLCW','DxrMoa','DMvYC2LVBG','zMLSDgvY'];_0x3de3=function(){return _0x515223;};return _0x3de3();}function resolvePython(){const _0x2d3c64=_0x1666c1,_0x1b3e90=require(_0x2d3c64(0x209));for(const _0x2c576d of['python3',_0x2d3c64(0x224),'py']){try{const _0x2f2f9a={};return _0x2f2f9a[_0x2d3c64(0x21f)]=[_0x2d3c64(0x1f3),_0x2d3c64(0x1f3),_0x2d3c64(0x21e)],_0x1b3e90[_0x2d3c64(0x203)](_0x2c576d+_0x2d3c64(0x227),_0x2f2f9a),_0x2c576d;}catch(_0x53a50b){}}return'python';}function installGlobalTools(_0x141e86=getDefaultMarkerPath()){const _0x4d64f8=_0x1666c1,_0x112da4=path['join'](__dirname,_0x4d64f8(0x202)),_0x436bbe={};_0x436bbe['version']=_0x4d64f8(0x206);let _0x26df95=_0x436bbe;try{_0x26df95=JSON[_0x4d64f8(0x207)](fs[_0x4d64f8(0x223)](_0x112da4,'utf8'));}catch(_0x216c60){}if(fs[_0x4d64f8(0x1eb)](_0x141e86))try{const _0xa30eab=JSON[_0x4d64f8(0x207)](fs[_0x4d64f8(0x223)](_0x141e86,'utf8'));if(_0xa30eab[_0x4d64f8(0x22f)]===_0x26df95[_0x4d64f8(0x1f8)]&&_0xa30eab['backendProfile']===require(_0x4d64f8(0x217))[_0x4d64f8(0x1fd)]&&Object[_0x4d64f8(0x1f6)](require(_0x4d64f8(0x217))[_0x4d64f8(0x21a)]())[_0x4d64f8(0x1f9)](([_0x55b351])=>_0x55b351!==_0x4d64f8(0x22d))[_0x4d64f8(0x1f5)](([,_0x1d93a8])=>_0x1d93a8['configured'])){const _0x50ee6f={};return _0x50ee6f[_0x4d64f8(0x20c)]=!![],_0x50ee6f['skipped']=!![],_0x50ee6f;}console[_0x4d64f8(0x1ff)](_0x4d64f8(0x220)+(_0xa30eab[_0x4d64f8(0x22f)]||_0x4d64f8(0x1f1))+_0x4d64f8(0x230)+_0x26df95[_0x4d64f8(0x1f8)]+_0x4d64f8(0x21b));}catch(_0x51b80d){}console[_0x4d64f8(0x1ff)]('Installing\x20global\x20MCP\x20Agent\x20dependencies...');try{require(_0x4d64f8(0x217))[_0x4d64f8(0x22a)](),console[_0x4d64f8(0x1ff)](_0x4d64f8(0x221));const _0x42554f=path['dirname'](_0x141e86);if(!fs['existsSync'](_0x42554f)){const _0x2f1edf={};_0x2f1edf[_0x4d64f8(0x1ea)]=!![],fs[_0x4d64f8(0x1fb)](_0x42554f,_0x2f1edf);}fs['writeFileSync'](_0x141e86,JSON[_0x4d64f8(0x20d)]({'packageVersion':_0x26df95[_0x4d64f8(0x1f8)],'backendProfile':require(_0x4d64f8(0x217))[_0x4d64f8(0x1fd)],'installedAt':new Date()[_0x4d64f8(0x20b)](),'status':'success'}),_0x4d64f8(0x1f7)),console[_0x4d64f8(0x1ff)](_0x4d64f8(0x1f0));const _0x58e020={};return _0x58e020[_0x4d64f8(0x20c)]=!![],_0x58e020[_0x4d64f8(0x1f2)]=![],_0x58e020;}catch(_0x27b175){const _0x13b5a6=_0x27b175[_0x4d64f8(0x211)]?_0x27b175['stderr']['toString'](_0x4d64f8(0x1f7)):'',_0x36a01e=sanitizeErrorMessage(_0x27b175[_0x4d64f8(0x204)]),_0x49b8b5=sanitizeErrorMessage(_0x13b5a6);console['error']('Error\x20during\x20global\x20dependencies\x20installation:',_0x36a01e);_0x49b8b5&&console[_0x4d64f8(0x225)](_0x4d64f8(0x1fe)+_0x49b8b5);(_0x36a01e['includes'](_0x4d64f8(0x226))||_0x49b8b5[_0x4d64f8(0x1fc)]('EACCES')||_0x36a01e[_0x4d64f8(0x1fc)](_0x4d64f8(0x208))||_0x49b8b5['includes']('permission')||_0x36a01e['includes']('perm')||_0x49b8b5[_0x4d64f8(0x1fc)](_0x4d64f8(0x218)))&&(console[_0x4d64f8(0x225)]('\x0a💡\x20Tip:\x20This\x20looks\x20like\x20a\x20permission\x20issue.\x20Please\x20try\x20either:'),console[_0x4d64f8(0x225)](_0x4d64f8(0x213)),console[_0x4d64f8(0x225)]('\x20\x20\x20\x20\x20sudo\x20npx\x20apt-mcp-agent-setup\x20install\x20--key\x20<KEY>'),console['error'](_0x4d64f8(0x1e8)));throw new Error(_0x4d64f8(0x22c)+_0x36a01e);}}const _0x127664={};_0x127664[_0x1666c1(0x215)]=getDefaultMarkerPath,_0x127664['installGlobalTools']=installGlobalTools,module[_0x1666c1(0x1ec)]=_0x127664;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function _0x4bb1(_0x15d675,_0xc867ff){_0x15d675=_0x15d675-0xec;const _0x54ff35=_0x54ff();let _0x4bb126=_0x54ff35[_0x15d675];if(_0x4bb1['hkTlTk']===undefined){var _0x4a9531=function(_0xc34961){const _0x5714ef='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5d0970='',_0x1105d3='';for(let _0x213d82=0x0,_0x463be2,_0x5792a0,_0x8b4b57=0x0;_0x5792a0=_0xc34961['charAt'](_0x8b4b57++);~_0x5792a0&&(_0x463be2=_0x213d82%0x4?_0x463be2*0x40+_0x5792a0:_0x5792a0,_0x213d82++%0x4)?_0x5d0970+=String['fromCharCode'](0xff&_0x463be2>>(-0x2*_0x213d82&0x6)):0x0){_0x5792a0=_0x5714ef['indexOf'](_0x5792a0);}for(let _0x6790a8=0x0,_0x1d6669=_0x5d0970['length'];_0x6790a8<_0x1d6669;_0x6790a8++){_0x1105d3+='%'+('00'+_0x5d0970['charCodeAt'](_0x6790a8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1105d3);};_0x4bb1['BGjgqC']=_0x4a9531,_0x4bb1['Vihqyg']={},_0x4bb1['hkTlTk']=!![];}const _0x2f3e50=_0x54ff35[0x0],_0x414059=_0x15d675+_0x2f3e50,_0x28c13e=_0x4bb1['Vihqyg'][_0x414059];return!_0x28c13e?(_0x4bb126=_0x4bb1['BGjgqC'](_0x4bb126),_0x4bb1['Vihqyg'][_0x414059]=_0x4bb126):_0x4bb126=_0x28c13e,_0x4bb126;}const _0x38492e=_0x4bb1;(function(_0x24b6da,_0x57d52a){const _0x478b66=_0x4bb1,_0x2dff46=_0x24b6da();while(!![]){try{const _0x1ae503=-parseInt(_0x478b66(0x119))/0x1+-parseInt(_0x478b66(0x108))/0x2+parseInt(_0x478b66(0xff))/0x3+-parseInt(_0x478b66(0x127))/0x4+parseInt(_0x478b66(0x103))/0x5*(-parseInt(_0x478b66(0xfe))/0x6)+-parseInt(_0x478b66(0x130))/0x7+parseInt(_0x478b66(0x116))/0x8*(parseInt(_0x478b66(0xf4))/0x9);if(_0x1ae503===_0x57d52a)break;else _0x2dff46['push'](_0x2dff46['shift']());}catch(_0x255dff){_0x2dff46['push'](_0x2dff46['shift']());}}}(_0x54ff,0x82030));const crypto=require(_0x38492e(0x12a)),connectionActivation=require(_0x38492e(0xed));function hookContextClient(_0x1d6669,_0x513909,_0x51838b={}){return{async 'issue'(_0x3504f8){const _0x57c6f1=_0x4bb1,_0x4b0697=_0x51838b['lease']||require(_0x57c6f1(0x132))['acceptHookLease']();_0x4b0697[_0x57c6f1(0x11c)]();const _0x4b82c7=crypto[_0x57c6f1(0xfd)](0x20)['toString'](_0x57c6f1(0x105)),_0x207377={};_0x207377[_0x57c6f1(0xee)]=_0x3504f8['tool'],_0x207377[_0x57c6f1(0x109)]=_0x3504f8[_0x57c6f1(0x109)],_0x207377['arguments']=_0x3504f8['arguments'],_0x207377[_0x57c6f1(0x100)]=_0x3504f8[_0x57c6f1(0x100)],_0x207377[_0x57c6f1(0x10d)]=_0x513909['agent_id']||null,_0x207377[_0x57c6f1(0xfa)]=_0x513909[_0x57c6f1(0x101)],_0x207377[_0x57c6f1(0x107)]=_0x513909['transcript_path'],_0x207377[_0x57c6f1(0x112)]=_0x4b0697[_0x57c6f1(0x11f)],_0x207377[_0x57c6f1(0x11b)]=_0x4b82c7;const _0x28398c=_0x207377,_0x358985={};_0x358985[_0x57c6f1(0x118)]=_0x4b0697;if(_0x3504f8[_0x57c6f1(0xee)]===_0x57c6f1(0x128)&&!_0x28398c[_0x57c6f1(0x10d)])await require(_0x57c6f1(0x12e))[_0x57c6f1(0x111)](_0x1d6669,_0x28398c,_0x358985);_0x4b0697[_0x57c6f1(0x11c)]();const _0x3e8b7=connectionActivation['listWorkspaceReceipts'](_0x1d6669)[_0x57c6f1(0xf0)](_0x365a79=>_0x365a79[_0x57c6f1(0x12c)]===0x2),_0x397f0a={};_0x397f0a[_0x57c6f1(0x124)]=_0x57c6f1(0x12b);if(!_0x3e8b7[_0x57c6f1(0x125)])throw Object[_0x57c6f1(0xf5)](new Error(_0x57c6f1(0x110)),_0x397f0a);let _0x7e4f81=0x0,_0x1fe182=_0x57c6f1(0x12b),_0x3d2eee=-0x1;const _0x594b99=[],_0x34a4b6=require(_0x57c6f1(0xf9))[_0x57c6f1(0xf8)](_0x1d6669),_0x5e0e7e=await Promise['allSettled'](_0x3e8b7[_0x57c6f1(0x12d)](_0x3a2537=>connectionActivation[_0x57c6f1(0x120)](_0x3a2537,_0x57c6f1(0x123),{'nativeCaller':_0x28398c,'timeoutMs':Math[_0x57c6f1(0xf7)](0x1,Math['min'](0x1388,_0x4b0697[_0x57c6f1(0x11a)]()))})));_0x4b0697[_0x57c6f1(0x11c)]();for(const [_0x15ab4b,_0x4865d]of _0x5e0e7e[_0x57c6f1(0x10b)]()){const _0x3d33f2={};_0x3d33f2[_0x57c6f1(0x124)]='CALLER_CONTEXT_UNAVAILABLE';const _0x38fd78=_0x4865d[_0x57c6f1(0x115)]===_0x57c6f1(0x104)?_0x4865d[_0x57c6f1(0x11e)]:_0x3d33f2,_0x33478a=_0x38fd78[_0x57c6f1(0x10a)]==='authenticated-live-process',_0x2e8c8c={};_0x2e8c8c[_0x57c6f1(0xf3)]=_0x3e8b7[_0x15ab4b][_0x57c6f1(0xf3)],_0x2e8c8c[_0x57c6f1(0x115)]=_0x38fd78['status']||'failed',_0x2e8c8c['code']=_0x38fd78['code']||null,_0x2e8c8c['authenticated']=_0x33478a,_0x594b99[_0x57c6f1(0x117)](_0x2e8c8c),_0x34a4b6({'event':_0x57c6f1(0xec),'connectionId':_0x3e8b7[_0x15ab4b][_0x57c6f1(0xf3)],'childPid':_0x38fd78[_0x57c6f1(0x129)],'generation':_0x38fd78[_0x57c6f1(0x11d)],'invocationId':_0x3504f8['toolUseId'],'correlation':require(_0x57c6f1(0xf6))[_0x57c6f1(0xfb)](_0x4b82c7),'reason':_0x38fd78[_0x57c6f1(0x124)]||_0x38fd78[_0x57c6f1(0x115)]||_0x57c6f1(0x121)});if(_0x38fd78[_0x57c6f1(0x10a)]===_0x57c6f1(0x131)&&_0x38fd78[_0x57c6f1(0x115)]==='issued'&&_0x38fd78[_0x57c6f1(0x122)]===_0x4b82c7)_0x7e4f81++;else{const _0x33226e=_0x33478a?_0x38fd78[_0x57c6f1(0x124)]?.[_0x57c6f1(0x114)]('NATIVE_')?0x3:0x2:0x0;_0x33226e>_0x3d2eee&&(_0x1fe182=_0x38fd78[_0x57c6f1(0x124)]||_0x57c6f1(0x12b),_0x3d2eee=_0x33226e);}}if(!_0x7e4f81)throw Object[_0x57c6f1(0xf5)](new Error(_0x1fe182),{'code':_0x1fe182,'diagnostics':_0x594b99});return _0x4b0697[_0x57c6f1(0x11c)](),_0x4b82c7;}};}async function verifyGatewayBinding(_0x1fa507,_0x43843c){const _0x562d5e=_0x38492e;if(!_0x43843c)return![];const _0x4e7c4c=connectionActivation[_0x562d5e(0x133)](_0x1fa507)[_0x562d5e(0xf0)](_0x4ad58c=>_0x4ad58c[_0x562d5e(0x12c)]===0x2),_0x34c62f={};_0x34c62f[_0x562d5e(0x102)]=0x1388;const _0x2148d1=await Promise['allSettled'](_0x4e7c4c[_0x562d5e(0x12d)](_0xd89f7b=>connectionActivation[_0x562d5e(0x120)](_0xd89f7b,_0x562d5e(0xef),_0x34c62f)));return _0x2148d1[_0x562d5e(0x10f)](_0x2a25da=>_0x2a25da[_0x562d5e(0x115)]===_0x562d5e(0x104)&&_0x2a25da[_0x562d5e(0x11e)][_0x562d5e(0x10a)]===_0x562d5e(0x131)&&_0x2a25da[_0x562d5e(0x11e)][_0x562d5e(0x115)]===_0x562d5e(0x113)&&_0x2a25da['value'][_0x562d5e(0xf2)]===!![]&&_0x2a25da[_0x562d5e(0x11e)][_0x562d5e(0x10c)]?.[_0x562d5e(0xfc)]===_0x562d5e(0x12f)&&_0x2a25da[_0x562d5e(0x11e)][_0x562d5e(0x10c)][_0x562d5e(0x10e)]===_0x43843c&&require(_0x562d5e(0x126))['sameWorkspace'](_0x2a25da[_0x562d5e(0x11e)][_0x562d5e(0x10c)]['workspace'],_0x1fa507));}function _0x54ff(){const _0xc062f7=['C29Tzq','uMvJB25Uzwn0ihrOCM91z2GGysbJywXSzxiTy29UDgv4DcbJyxbHyMXLihn1CgvYDMLZB3i','ChjLCgfYzuHVB2TcAw5KAw5N','Ag9VA0XLyxnL','yM91BMq','C3rHCNrZv2L0Aa','C3rHDhvZ','mZmWmtm2A21vyvnS','ChvZAa','BgvHC2u','ode1ndu4vMr0su51','CMvTywLUAw5Ntxm','CMvXDwvZDgvKvg9Rzw4','yxnZzxj0q3vYCMvUDa','z2vUzxjHDgLVBG','DMfSDwu','D2LYzq','y29UDhjVBenVBM5Ly3rPB24','zMfPBgvK','z3jHBNq','Ag9VAY1JB250zxH0','y29Kzq','BgvUz3rO','lI4Vy29Yzs93B3jRC3bHy2uTCgf0Aa','mtu2nJG0ngfPyxLTEq','C2vZC2LVBL9IB290C3rYyxa','y2HPBgrqAwq','BM9KztPJCNLWDg8','q0fmtevsx0nptLrfwfrFvu5bvKfjtefcteu','C3vWzxj2AxnVCLbYB3rVy29S','BwfW','lI9NyxrLD2f5lwnVBNrLEhq','yxb0lw1JCc1Hz2vUDa','nJe3nde4mNblsg9LtW','yxv0AgvUDgLJyxrLzc1SAxzLlxbYB2nLC3m','lI4Vy29Yzs9OB29RlwXLyxnL','BgLZDfDVCMTZCgfJzvjLy2vPChrZ','z3jHBNqTAxnZDwfUy2uTywnR','lI9JB25Uzwn0Aw9UlwfJDgL2yxrPB24','Dg9VBa','z2f0zxDHEs1IAw5KAw5N','zMLSDgvY','Ag9VA0nVBNrLEhrdBgLLBNq','C2vYDMLUzW','y29UBMvJDgLVBKLK','odm3zMzXCu1L','yxnZAwDU','lI4Vy29Yzs9JBgf1zguTBMf0AxzL','Bwf4','Ag9VA0rPywDUB3n0AwnZ','lI4Vy29Yzs9OB29RlwrPywDUB3n0AwnZ','BMf0AxzLvg9VBe5HBwu','zMLUz2vYChjPBNq','CMvNAxn0CMf0Aw9U','CMfUzg9TqNL0zxm','mtHSwhDorgq','mtm5mtm0me5zDMPNtG','BMf0AxzLugfYzw50','Dg9VBf9Uyw1L','DgLTzw91De1Z','mtyXntq1mgj3z2XSAa','zNvSzMLSBgvK','yMfZzty0DxjS','DMvYAwz5r2f0zxDHEujPBMrPBMC','BMf0AxzLvhjHBNnJCMLWDfbHDgG','mtqYmtiZnNzlrvz6CW','Dg9VBfvZzuLK','zxzPzgvUy2u','zw50CMLLCW','yMLUzgLUzW','BMf0AxzLq2HPBgq','C2vZC2LVBKLK'];_0x54ff=function(){return _0xc062f7;};return _0x54ff();}const _0x6790a8={};_0x6790a8[_0x38492e(0xf1)]=hookContextClient,_0x6790a8[_0x38492e(0x106)]=verifyGatewayBinding,module['exports']=_0x6790a8;
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
// Embedded with a trusted installation key. Only built-in modules may be used
|
|
4
4
|
// until the committed release has been verified.
|
|
5
5
|
function hookDispatcher(root, publicKey) {
|
|
6
|
-
return { runCLI(host, event, projectPath) {
|
|
7
|
-
const fs = require('node:fs'), path = require('node:path'), crypto = require('node:crypto');
|
|
8
|
-
// Host adapters pass the workspace as base64 so hook command shells never
|
|
9
|
-
// reinterpret path data. Keep absolute raw paths usable for internal calls.
|
|
10
|
-
const inputPath = String(projectPath);
|
|
11
|
-
const decodedProjectPath = Buffer.from(inputPath, 'base64').toString('utf8');
|
|
12
|
-
const workspaceInput = path.isAbsolute(inputPath) || !fs.existsSync(decodedProjectPath) ? inputPath : decodedProjectPath;
|
|
13
|
-
const workspace = fs.realpathSync(workspaceInput);
|
|
6
|
+
return { runCLI(host, event, projectPath, executionOptions = {}) {
|
|
7
|
+
const fs = require('node:fs'), path = require('node:path'), crypto = require('node:crypto');
|
|
8
|
+
// Host adapters pass the workspace as base64 so hook command shells never
|
|
9
|
+
// reinterpret path data. Keep absolute raw paths usable for internal calls.
|
|
10
|
+
const inputPath = String(projectPath);
|
|
11
|
+
const decodedProjectPath = Buffer.from(inputPath, 'base64').toString('utf8');
|
|
12
|
+
const workspaceInput = path.isAbsolute(inputPath) || !fs.existsSync(decodedProjectPath) ? inputPath : decodedProjectPath;
|
|
13
|
+
const workspace = fs.realpathSync(workspaceInput);
|
|
14
14
|
const canonical = process.platform === 'win32' ? workspace.toLowerCase() : workspace;
|
|
15
15
|
const authorityFile = path.join(workspace, '.agents', 'runtime', 'generation.json');
|
|
16
16
|
let selected;
|
|
@@ -32,7 +32,7 @@ function hookDispatcher(root, publicKey) {
|
|
|
32
32
|
if (crypto.createHash('sha256').update(JSON.stringify(manifest)).digest('hex') !== selected.digest ||
|
|
33
33
|
!crypto.verify(null, Buffer.from(JSON.stringify(manifest.files)), publicKey, Buffer.from(manifest.signature, 'base64url')))
|
|
34
34
|
throw Error('HOOK_RUNTIME_SIGNATURE_INVALID');
|
|
35
|
-
for (const required of ['src/core/hook-bridge.js'])
|
|
35
|
+
for (const required of ['src/core/hook-bridge.js'])
|
|
36
36
|
if (!manifest.files[required]) throw Error('HOOK_RUNTIME_RECONNECT_REQUIRED');
|
|
37
37
|
for (const [file, digest] of Object.entries(manifest.files)) {
|
|
38
38
|
if (path.isAbsolute(file) || file.includes('\\') || file.split('/').some(part => !part || part === '..' || part === '.'))
|
|
@@ -46,27 +46,79 @@ function hookDispatcher(root, publicKey) {
|
|
|
46
46
|
throw Error('HOOK_RUNTIME_INTEGRITY_INVALID');
|
|
47
47
|
}
|
|
48
48
|
return require(path.join(release, 'src/core/hook-bridge.js')).runCLI(host, event,
|
|
49
|
-
Buffer.from(workspace, 'utf8').toString('base64'));
|
|
49
|
+
Buffer.from(workspace, 'utf8').toString('base64'), executionOptions);
|
|
50
50
|
} };
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
// The parent only uses built-ins. Synchronous hashing/locks in the signed
|
|
54
|
+
// worker cannot prevent the parent from producing a blocking decision.
|
|
55
|
+
function superviseHook(root, publicKey, dispatcherSource, args, timeoutMs) {
|
|
56
|
+
const cp = require('node:child_process'), crypto = require('node:crypto');
|
|
57
|
+
const lease = { id: crypto.randomUUID(), notAfter: Date.now() + timeoutMs, maxDurationMs: timeoutMs };
|
|
58
|
+
const program = `const dispatcher = (${dispatcherSource})(${JSON.stringify(root)}, ${JSON.stringify(publicKey)});
|
|
59
|
+
process.once('message', async message => {
|
|
60
|
+
try { await dispatcher.runCLI(...message.args, { hookLease: message.lease }); }
|
|
61
|
+
catch (error) { process.stderr.write('APT hook: ' + (error.message || String(error)) + '\\n'); process.exitCode = 2; }
|
|
62
|
+
finally { if (process.connected) process.disconnect(); }
|
|
63
|
+
});`;
|
|
64
|
+
return new Promise((resolve, reject) => {
|
|
65
|
+
let settled = false, output = '', errors = '', inputBytes = 0;
|
|
66
|
+
const child = cp.spawn(process.execPath, ['-e', program], { windowsHide: true, stdio: ['pipe', 'pipe', 'pipe', 'ipc'] });
|
|
67
|
+
const detach = () => {
|
|
68
|
+
clearTimeout(timer); process.stdin.unpipe(child.stdin); process.stdin.removeListener('data', countInput);
|
|
69
|
+
child.stdin.destroy();
|
|
70
|
+
};
|
|
71
|
+
const fail = code => {
|
|
72
|
+
if (settled) return;
|
|
73
|
+
settled = true; detach();
|
|
74
|
+
if (child.connected) child.disconnect();
|
|
75
|
+
child.kill(); child.stdout.destroy(); child.stderr.destroy(); child.unref();
|
|
76
|
+
reject(new Error(code));
|
|
77
|
+
};
|
|
78
|
+
const countInput = chunk => { inputBytes += chunk.length; if (inputBytes > 2 * 1024 * 1024) fail('HOOK_INPUT_LIMIT'); };
|
|
79
|
+
const timer = setTimeout(() => fail('HOOK_DEADLINE_EXCEEDED'), timeoutMs);
|
|
80
|
+
child.on('error', () => fail('HOOK_WORKER_UNAVAILABLE'));
|
|
81
|
+
child.stdin.on('error', () => {});
|
|
82
|
+
child.stdout.on('data', chunk => { output += chunk.toString(); if (Buffer.byteLength(output) > 2 * 1024 * 1024) fail('HOOK_OUTPUT_LIMIT'); });
|
|
83
|
+
child.stderr.on('data', chunk => { errors += chunk.toString(); if (Buffer.byteLength(errors) > 64 * 1024) fail('HOOK_OUTPUT_LIMIT'); });
|
|
84
|
+
child.on('close', code => {
|
|
85
|
+
if (settled) return;
|
|
86
|
+
if (Date.now() >= lease.notAfter) return fail('HOOK_DEADLINE_EXCEEDED');
|
|
87
|
+
settled = true; detach();
|
|
88
|
+
if (code === 0) { if (output) process.stdout.write(output); }
|
|
89
|
+
if (errors) process.stderr.write(errors);
|
|
90
|
+
process.exitCode = code === 0 ? 0 : 2;
|
|
91
|
+
resolve();
|
|
92
|
+
});
|
|
93
|
+
process.stdin.on('data', countInput); process.stdin.pipe(child.stdin);
|
|
94
|
+
child.send({ args, lease }, error => { if (error) fail('HOOK_WORKER_UNAVAILABLE'); });
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function renderDispatcher(runtimeRoot, publicKey, options = {}) {
|
|
99
|
+
const timeoutMs = options.timeoutMs === undefined ? 10000 : options.timeoutMs;
|
|
100
|
+
if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 100 || timeoutMs > 10000) throw new Error('HOOK_DEADLINE_INVALID');
|
|
54
101
|
return `'use strict';
|
|
55
102
|
const dispatcher = (${hookDispatcher.toString()})(${JSON.stringify(runtimeRoot)}, ${JSON.stringify(publicKey.toString())});
|
|
56
|
-
function reportFailure(error) {
|
|
57
|
-
process.stderr.write('APT hook: ' + (error && error.message ? error.message : String(error)) + '\\n');
|
|
58
|
-
process.exitCode = 2;
|
|
59
|
-
}
|
|
103
|
+
function reportFailure(error) {
|
|
104
|
+
process.stderr.write('APT hook: ' + (error && error.message ? error.message : String(error)) + '\\n');
|
|
105
|
+
process.exitCode = 2;
|
|
106
|
+
}
|
|
60
107
|
module.exports = { runCLI(...args) {
|
|
61
108
|
try {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
109
|
+
// Generated host commands use node --eval. Direct verifier consumers keep
|
|
110
|
+
// the synchronous interface; host execution always has an outer watchdog.
|
|
111
|
+
const hostCLI = process.argv.length === 1 && process.execArgv.some(arg => arg === '-e' || arg === '--eval');
|
|
112
|
+
const result = hostCLI
|
|
113
|
+
? (${superviseHook.toString()})(${JSON.stringify(runtimeRoot)}, ${JSON.stringify(publicKey.toString())}, ${JSON.stringify(hookDispatcher.toString())}, args, ${timeoutMs})
|
|
114
|
+
: dispatcher.runCLI(...args);
|
|
115
|
+
if (result && typeof result.then === 'function') result.catch(reportFailure);
|
|
116
|
+
return result;
|
|
117
|
+
} catch (error) {
|
|
118
|
+
reportFailure(error);
|
|
119
|
+
}
|
|
120
|
+
} };
|
|
121
|
+
`;
|
|
122
|
+
}
|
|
71
123
|
|
|
72
124
|
module.exports = { hookDispatcher, renderDispatcher };
|