@lensmcp/cluster 1.25.76 → 1.25.78
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/basic-ssl.js +1 -1
- package/build-host.js +1 -1
- package/build-scope-patterns.js +1 -1
- package/bundle-parent.js +1 -1
- package/checkout-cache.js +1 -1
- package/child-process-env.js +1 -1
- package/compile-retry.js +1 -1
- package/config-files.js +1 -1
- package/create-webpack-dev.js +1 -1
- package/create-webpack-prod.js +1 -1
- package/dev-devtool.js +1 -1
- package/devserver-host.js +1 -1
- package/devserver-notifier.js +1 -1
- package/devserver-transport.js +1 -1
- package/error-stack-release.js +1 -1
- package/executors/build/build.impl.js +1 -1
- package/executors/gateway/body-stall.d.ts +14 -1
- package/executors/gateway/body-stall.js +1 -1
- package/executors/gateway/canonical-path.js +1 -1
- package/executors/gateway/client-ip.d.ts +39 -15
- package/executors/gateway/client-ip.js +1 -1
- package/executors/gateway/gateway-errors.js +1 -1
- package/executors/gateway/gateway.impl.js +1 -1
- package/executors/gateway/gateway.lib.js +1 -1
- package/executors/gateway/health-check.js +1 -1
- package/executors/gateway/jwks-verify.js +1 -1
- package/executors/gateway/jwt-claims.d.ts +13 -0
- package/executors/gateway/jwt-claims.js +1 -1
- package/executors/gateway/main.prod-gateway.js +2 -2
- package/executors/gateway/main.rollout.js +4 -4
- package/executors/gateway/manifest.d.ts +72 -27
- package/executors/gateway/manifest.js +1 -1
- package/executors/gateway/metrics.js +1 -1
- package/executors/gateway/otel-tracing.js +1 -1
- package/executors/gateway/prod-config.d.ts +9 -1
- package/executors/gateway/prod-config.js +1 -1
- package/executors/gateway/prod-gateway.lib.js +1 -1
- package/executors/gateway/prod-runtime/access-log.js +1 -1
- package/executors/gateway/prod-runtime/app.d.ts +2 -0
- package/executors/gateway/prod-runtime/app.js +1 -1
- package/executors/gateway/prod-runtime/auth.js +1 -1
- package/executors/gateway/prod-runtime/body-stall.js +1 -1
- package/executors/gateway/prod-runtime/cors.js +1 -1
- package/executors/gateway/prod-runtime/edge.d.ts +13 -0
- package/executors/gateway/prod-runtime/edge.js +1 -1
- package/executors/gateway/prod-runtime/handler.d.ts +2 -0
- package/executors/gateway/prod-runtime/handler.js +1 -1
- package/executors/gateway/prod-runtime/hooks.js +1 -1
- package/executors/gateway/prod-runtime/observability.js +1 -1
- package/executors/gateway/prod-runtime/rollout.d.ts +7 -0
- package/executors/gateway/prod-runtime/rollout.js +1 -1
- package/executors/gateway/prod-runtime/route-limits.d.ts +30 -0
- package/executors/gateway/prod-runtime/route-limits.js +1 -0
- package/executors/gateway/prod-runtime/routing.js +1 -1
- package/executors/gateway/prod-runtime/server.js +1 -1
- package/executors/gateway/prod-runtime/trust.d.ts +45 -1
- package/executors/gateway/prod-runtime/trust.js +1 -1
- package/executors/gateway/prod-runtime/types.d.ts +33 -5
- package/executors/gateway/prod-runtime/upgrade.d.ts +2 -27
- package/executors/gateway/prod-runtime/upgrade.js +11 -9
- package/executors/gateway/prod-runtime/upstream-errors.d.ts +9 -0
- package/executors/gateway/prod-runtime/upstream-errors.js +1 -1
- package/executors/gateway/prod-runtime/upstream.js +1 -1
- package/executors/gateway/providers-prod.js +1 -1
- package/executors/gateway/rate-limit.js +2 -2
- package/executors/gateway/registry-source.d.ts +3 -2
- package/executors/gateway/registry-source.js +2 -1
- package/executors/gateway/rollout-ops.js +2 -2
- package/executors/gateway/runtime/act.js +1 -1
- package/executors/gateway/runtime/auth.js +1 -1
- package/executors/gateway/runtime/awake.js +1 -1
- package/executors/gateway/runtime/chooser.js +12 -12
- package/executors/gateway/runtime/control.js +2 -2
- package/executors/gateway/runtime/dev-auth.js +1 -1
- package/executors/gateway/runtime/discovery.js +1 -1
- package/executors/gateway/runtime/edge.js +1 -1
- package/executors/gateway/runtime/guest-graph.js +2 -2
- package/executors/gateway/runtime/guest-replay.js +2 -2
- package/executors/gateway/runtime/handler.js +1 -1
- package/executors/gateway/runtime/hmr-reload.js +1 -1
- package/executors/gateway/runtime/hooks.js +1 -1
- package/executors/gateway/runtime/hosted-dashboard.js +1 -1
- package/executors/gateway/runtime/instance.js +3 -3
- package/executors/gateway/runtime/internal-fetch.js +1 -1
- package/executors/gateway/runtime/lens-children.js +1 -1
- package/executors/gateway/runtime/lifecycle.js +4 -4
- package/executors/gateway/runtime/observability.js +3 -3
- package/executors/gateway/runtime/on-demand.js +7 -7
- package/executors/gateway/runtime/orphan-reaper.js +2 -2
- package/executors/gateway/runtime/own-log.js +6 -6
- package/executors/gateway/runtime/parked-dashboards.js +1 -1
- package/executors/gateway/runtime/pod-env.js +2 -2
- package/executors/gateway/runtime/pod-output.js +1 -1
- package/executors/gateway/runtime/pod-probe.js +1 -1
- package/executors/gateway/runtime/process-names.js +1 -1
- package/executors/gateway/runtime/project-graph-store.js +1 -1
- package/executors/gateway/runtime/proxy.js +1 -1
- package/executors/gateway/runtime/registration-guards.js +1 -1
- package/executors/gateway/runtime/route-registry.js +1 -1
- package/executors/gateway/runtime/scope.js +1 -1
- package/executors/gateway/runtime/serve-launch.js +3 -3
- package/executors/gateway/runtime/server.js +2 -2
- package/executors/gateway/runtime/service-keys.js +1 -1
- package/executors/gateway/runtime/shared-build.js +3 -3
- package/executors/gateway/runtime/source-poller.js +1 -1
- package/executors/gateway/runtime/types.js +1 -1
- package/executors/gateway/runtime/upgrade.js +1 -1
- package/executors/gateway/runtime/warm-start.js +1 -1
- package/executors/gateway/runtime/workspace-auth.js +1 -1
- package/executors/gateway/runtime/workspace-log.js +1 -1
- package/executors/gateway/runtime/workspace-middleware.js +1 -1
- package/executors/gateway/runtime/workspace-registry.js +1 -1
- package/executors/gateway/ssrf-guard.js +1 -1
- package/executors/gateway/workspace-auth.js +1 -1
- package/executors/serve/serve.impl.js +1 -1
- package/executors/serve/stop-on-signal.js +1 -1
- package/executors/trust/hostname.js +1 -1
- package/executors/trust/trust.impl.js +3 -3
- package/exit-reason.js +2 -2
- package/fork-ts-check-reporter.js +1 -1
- package/gateway.js +1 -1
- package/gc-notice.js +1 -1
- package/graph-snapshot.js +1 -1
- package/handoff-retire.js +1 -1
- package/heap-snapshot.js +1 -1
- package/hot-swap-registries.js +1 -1
- package/index.js +1 -1
- package/inspector-secret.js +1 -1
- package/main.devserver.js +11 -11
- package/notice-generation.js +1 -1
- package/package.json +4 -4
- package/perf/heavy-barrel-import.js +1 -1
- package/perf/perf-config.js +1 -1
- package/perf/perf-rule-events.js +2 -2
- package/perf/perf-rules-analysis.js +1 -1
- package/perf/perf-rules-plugin.js +1 -1
- package/perf/source-scan.js +5 -5
- package/perf/workspace-libraries.js +2 -2
- package/pod-memory-events.js +2 -2
- package/pod-memory.js +1 -1
- package/pod-sock.js +1 -1
- package/process-name.js +1 -1
- package/redis-disconnect-fix.js +1 -1
- package/schema-first-instance.js +1 -1
- package/serve-runner.js +1 -1
- package/service-build-events.js +2 -2
- package/shared-build/attach.js +2 -2
- package/shared-build/host.js +3 -3
- package/shared-build/protocol.js +1 -1
- package/shared-build/shared-compilation.js +3 -3
- package/shared-build/signature.js +1 -1
- package/stdio-guard.js +1 -1
- package/swap-mode.js +1 -1
- package/swap-recycle.js +1 -1
- package/tsgo-check-plugin.js +4 -4
- package/typecheck-bus.js +3 -3
- package/typecheck-queue.js +1 -1
- package/worker-guard.js +1 -1
- package/worker-retire.js +1 -1
- package/worker-supervisor.js +2 -2
- package/workspace-paths.js +1 -1
package/shared-build/host.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`)[0],"firstLine");class BuildHost{static{
|
|
3
|
-
`)),c=e.toldFiles.get(t)!==r;e.toldFiles.set(t,r),this.tell(t,{type:"built",ok:s.errorCount===0,changed:i,hash:s.hash,text:(0,shared_compilation_1.describeBuild)(s,{webpackVersion:e.webpackVersion,durationMs:o.durationMs,changed:i}),errors:s.errorCount,warnings:s.warningCount,durationMs:o.durationMs,sourceMaps:e.sourceMaps,...c?{files:s.files}:{}})}closeGroup(e){e.retry.dispose();for(const i of e.pausing.values())clearTimeout(i);e.pausing.clear();const t=e.compiler,o=e.watching;e.watching=void 0;const s=h(()=>{try{t?.close?.(()=>{})}catch{}},"closeCompiler");o?o.close(s):s()}stop(e=5e3){this.stopped=!0;const t=[...this.groups.values()];return this.groups.clear(),this.members.clear(),new Promise(o=>{let s=t.length;if(s===0)return o();const i=setTimeout(o,e);i.unref?.();for(const r of t){r.retry.dispose();for(const n of r.pausing.values())clearTimeout(n);const c=h(()=>{--s===0&&(clearTimeout(i),o())},"done"),a=r.compiler,
|
|
1
|
+
"use strict";var j=Object.defineProperty;var y=(p,e)=>j(p,"name",{value:e,configurable:!0});var k=Object.defineProperty,h=y((p,e)=>k(p,"name",{value:e,configurable:!0}),"h");Object.defineProperty(exports,"__esModule",{value:!0}),exports.BuildHost=exports.DEFAULT_PAUSE_MS=void 0,exports.withEnv=withEnv,exports.buildTargetString=buildTargetString;const tslib_1=require("tslib"),node_crypto_1=require("node:crypto"),path=tslib_1.__importStar(require("node:path")),checkout_cache_1=require("../checkout-cache"),config_files_1=require("../config-files"),compile_retry_1=require("../compile-retry"),dev_devtool_1=require("../dev-devtool"),create_webpack_dev_1=require("../create-webpack-dev"),perf_rules_plugin_1=require("../perf/perf-rules-plugin"),signature_1=require("./signature"),shared_compilation_1=require("./shared-compilation");exports.DEFAULT_PAUSE_MS=5e3;function withEnv(p,e){const t={...process.env};for(const o of Object.keys(process.env))delete process.env[o];for(const[o,s]of Object.entries(p))s!==void 0&&(process.env[o]=s);try{return e()}finally{for(const o of Object.keys(process.env))delete process.env[o];Object.assign(process.env,t)}}y(withEnv,"withEnv"),h(withEnv,"withEnv");function buildTargetString(p){return`${p.project}:${p.target}${p.configuration?`:${p.configuration}`:""}`}y(buildTargetString,"buildTargetString"),h(buildTargetString,"buildTargetString");const shortHash=h(p=>(0,node_crypto_1.createHash)("sha256").update(p).digest("hex").slice(0,16),"shortHash"),firstLine=h(p=>(p?.message??String(p)).split(`
|
|
2
|
+
`)[0],"firstLine");class BuildHost{static{y(this,"BuildHost")}static{h(this,"BuildHost")}constructor(e){this.opts=e,this.groups=new Map,this.members=new Map,this.stopped=!1,this.pauseMs=e.pauseMs??exports.DEFAULT_PAUSE_MS,this.webpack=e.webpack??require("webpack")}tell(e,t){this.opts.send({type:"member",member:e,event:t})}describe(){return[...this.groups.values()].map(e=>({group:e.key,projects:e.registry.projects()}))}evaluate(e){const t=e.options;if(t.webpackConfigPath)try{delete require.cache[require.resolve(path.resolve(t.appRoot,t.webpackConfigPath))]}catch{}const o={...e.env,NODE_ENV:"development",NX_BUILD_TARGET:buildTargetString(e),NX_WORKSPACE_ROOT:this.opts.root,LENSMCP_TYPECHECK:"off"},s=withEnv(o,()=>(0,create_webpack_dev_1.createDevWebpackConfig)(t)),i=(0,signature_1.transpileCompilerOptions)(t.tsConfig,this.opts.root),r=(0,signature_1.memberSignature)({join:e,devtool:s.devtool,config:s,compilerOptions:i});return{config:s,signature:r,configFiles:(0,config_files_1.configFilesOf)({...t,workspaceRoot:this.opts.root})}}join(e,t){if(this.stopped)return this.tell(e,{type:"refused",reason:"the build host is stopping"});this.leave(e,{quiet:!0});const o=(0,signature_1.refusalOf)(t,this.opts.root);if(o)return this.opts.log(`${t.project}: compiles on its own \u2014 ${o}`),this.tell(e,{type:"refused",reason:o});let s;try{s=this.evaluate(t)}catch(i){const r=`its webpack config could not be built here (${firstLine(i)})`;return this.opts.log(`${t.project}: compiles on its own \u2014 ${r}`),this.tell(e,{type:"refused",reason:r})}this.admit(e,t,s)}admit(e,t,o){let s=this.groups.get(o.signature.key);if(!s){for(const a of this.groups.values()){const l=(0,signature_1.describeDifference)(o.signature,a.signature);this.opts.log(`${t.project}: compiled apart from ${a.registry.projects().sort().join(", ")||"the other group"} \u2014 ${l??"its compile signature differs"}`);break}try{s=this.createGroup(o,t)}catch(a){const l=`the shared compiler could not be created (${firstLine(a)})`;return this.opts.log(`${t.project}: compiles on its own \u2014 ${l}`),this.tell(e,{type:"refused",reason:l})}this.groups.set(s.key,s)}this.members.set(e,{project:t.project,group:s,join:t});for(const a of o.configFiles)s.configFiles.add(a);const i=s.projects.get(t.project)??new Set;i.add(e);const r=!s.projects.has(t.project);s.projects.set(t.project,i);const c=s.pausing.get(t.project);if(c&&(clearTimeout(c),s.pausing.delete(t.project)),this.tell(e,{type:"accepted",group:s.key,projects:[...s.projects.keys()]}),r)s.registry.set(t.project,(0,shared_compilation_1.memberEntries)(t.project,t.options)),this.opts.log(`shared compilation ${s.key.slice(0,8)}: ${s.registry.projects().sort().join(", ")}`),this.kick(s);else{const a=s.last.get(t.project);a&&this.tellBuilt(s,e,a)}}leave(e,t={}){const o=this.members.get(e);if(!o)return;this.members.delete(e);const{project:s,group:i}=o;i.told.delete(e),i.toldFiles.delete(e);const r=i.projects.get(s);if(r?.delete(e),r&&r.size>0)return;t.quiet||this.opts.log(`${s}: no member left \u2014 its entries pause in ${Math.round(this.pauseMs/1e3)} s`);const c=setTimeout(()=>this.pause(i,s),this.pauseMs);c.unref?.(),i.pausing.set(s,c)}pause(e,t){if(e.pausing.delete(t),!((e.projects.get(t)?.size??0)>0)){if(e.projects.delete(t),e.registry.delete(t),e.last.delete(t),e.projects.size===0){this.opts.log(`shared compilation ${e.key.slice(0,8)}: no service left \u2014 closed`),this.groups.delete(e.key),this.closeGroup(e);return}this.opts.log(`shared compilation ${e.key.slice(0,8)}: ${t} paused \u2014 ${e.registry.projects().sort().join(", ")}`),this.kick(e)}}kick(e){if(e.watching){e.watching.invalidate();return}e.watching=e.compiler.watch(e.watchOptions,(t,o)=>this.onBuild(e,t,o))}createGroup(e,t){const o=e.signature.key,s=new shared_compilation_1.EntryRegistry,i=t.options,r=e.config,c=r.devtool,a=path.join((0,checkout_cache_1.checkoutCacheDir)(this.opts.root,"lensmcp-build"),o,"out"),l=(0,create_webpack_dev_1.devCacheOptions)(i,c),n={key:o,signature:e.signature,registry:s,projects:new Map,pausing:new Map,last:new Map,told:new Map,toldFiles:new Map,compiler:void 0,watching:void 0,watchOptions:{},sourceMaps:!1,webpackVersion:"",retry:(0,compile_retry_1.createFailureRetry)(()=>this.compileAgain(n),this.opts.retryDelaysMs??compile_retry_1.RETRY_AFTER_FAILURE_MS),configFiles:new Set(e.configFiles),configChanged:new Set},u=r.plugins.filter(d=>!signature_1.PER_SERVICE_PLUGINS.has(d?.constructor?.name));u.push(new perf_rules_plugin_1.PerfRulesPlugin({project:t.project,workspaceRoot:this.opts.root,tsConfig:i.tsConfig,entries:h(()=>s.entryProjects(),"entries")}),new shared_compilation_1.SharedEntriesPlugin({registry:s,workspaceRoot:this.opts.root,outputPath:a,cache:{...l,name:`shared-${o}`,version:`${l.version}-${o}`}}),new config_files_1.ConfigFilesPlugin({files:h(()=>n.configFiles,"files"),changed:h(d=>{for(const f of d)n.configChanged.add(f)},"changed")}),{apply:h(d=>{d.hooks.watchRun.tap("LensmcpSharedBuild",f=>{const w=[...f.modifiedFiles??[],...f.removedFiles??[]].filter(b=>typeof b=="string").slice(-32);for(const b of this.membersOf(n))this.tell(b,{type:"watch-run",paths:w})}),d.hooks.watchClose.tap("LensmcpSharedBuild",()=>{for(const f of this.membersOf(n))this.tell(f,{type:"watch-closed"})})},"apply")});const g={...r,plugins:u};delete g.watch,n.watchOptions=r.watchOptions??{};const m={...t.env,NODE_ENV:"development",NX_BUILD_TARGET:buildTargetString(t),NX_WORKSPACE_ROOT:this.opts.root,LENSMCP_TYPECHECK:"off"};return n.compiler=withEnv(m,()=>this.webpack(g)),n.sourceMaps=(0,dev_devtool_1.bundleCarriesSourceMaps)(n.compiler.options.devtool),n.webpackVersion=String(n.compiler.webpack?.version??"5"),n}membersOf(e){const t=[];for(const o of e.projects.values())t.push(...o);return t}compileAgain(e){this.stopped||this.groups.get(e.key)!==e||!e.watching||(this.opts.log(`shared compilation ${e.key.slice(0,8)}: compiling again after the failure`),e.watching.invalidate())}onBuild(e,t,o){if(this.stopped||e.configChanged.size>0&&!this.reconfigure(e))return;if(t){const n=t?.message??String(t),{delayMs:u,retry:g}=e.retry.failed();this.opts.log(`shared compilation ${e.key.slice(0,8)} failed: ${n} \u2014 compiling again in ${Math.round(u/1e3)} s (retry ${g})`);for(const m of this.membersOf(e))this.tell(m,{type:"failed",message:n});return}const s=e.retry.succeeded();s>0&&this.opts.log(`shared compilation ${e.key.slice(0,8)}: compiled again after ${s} failure${s===1?"":"s"} \u2014 watching again`);const i=o,r=Math.max(0,(i.endTime??0)-(i.startTime??0)),c=(0,shared_compilation_1.attributeCompilation)(i.compilation,e.registry),a=[];for(const[n,u]of c){e.last.get(n)?.attribution.hash!==u.hash&&a.push(n);const g={attribution:u,durationMs:r};e.last.set(n,g);for(const m of e.projects.get(n)??[])this.tellBuilt(e,m,g)}const l=[...c.values()].filter(n=>n.errorCount>0).map(n=>n.project);this.opts.log(`built ${[...c.keys()].sort().join(", ")||"nothing"} in ${r} ms \u2014 ${a.length?`changed: ${a.sort().join(", ")}`:"no bundle changed"}${l.length?`; errors in: ${l.sort().join(", ")}`:""}`)}reconfigure(e){const t=[...e.configChanged].map(c=>path.relative(this.opts.root,c)).sort().join(", ");e.configChanged.clear();const o=[];for(const[c,a]of this.members){if(a.group!==e)continue;let l;try{l=this.evaluate(a.join)}catch(n){this.opts.log(`${a.project}: ${t} changed, but its webpack config could not be built from it (${firstLine(n)}) \u2014 it compiles as before`);continue}for(const n of l.configFiles)e.configFiles.add(n);l.signature.key!==e.key&&o.push({member:c,join:a.join,evaluated:l})}const s=`shared compilation ${e.key.slice(0,8)}`;if(o.length===0)return this.opts.log(`${s}: ${t} changed \u2014 nothing it compiles with did`),!0;const i=[...new Set(o.map(c=>c.join.project))].sort();for(const c of o)this.detach(c.member);const r=e.projects.size>0;this.opts.log(`${s}: ${t} changed what ${i.join(", ")} compile${i.length===1?"s":""} with \u2014 a new compiler reads it${r?"":"; this one closes"}`),r||(this.groups.delete(e.key),setImmediate(()=>this.closeGroup(e)));for(const c of o)this.admit(c.member,c.join,c.evaluated);return r}detach(e){const t=this.members.get(e);if(!t)return;this.members.delete(e);const{project:o,group:s}=t;s.told.delete(e),s.toldFiles.delete(e);const i=s.projects.get(o);if(i?.delete(e),i&&i.size>0)return;s.projects.delete(o),s.registry.delete(o),s.last.delete(o);const r=s.pausing.get(o);r&&(clearTimeout(r),s.pausing.delete(o))}tellBuilt(e,t,o){const s=o.attribution,i=e.told.get(t)!==s.hash;e.told.set(t,s.hash);const r=shortHash([...s.files].sort().join(`
|
|
3
|
+
`)),c=e.toldFiles.get(t)!==r;e.toldFiles.set(t,r),this.tell(t,{type:"built",ok:s.errorCount===0,changed:i,hash:s.hash,text:(0,shared_compilation_1.describeBuild)(s,{webpackVersion:e.webpackVersion,durationMs:o.durationMs,changed:i}),errors:s.errorCount,warnings:s.warningCount,durationMs:o.durationMs,sourceMaps:e.sourceMaps,...c?{files:s.files}:{}})}closeGroup(e){e.retry.dispose();for(const i of e.pausing.values())clearTimeout(i);e.pausing.clear();const t=e.compiler,o=e.watching;e.watching=void 0;const s=h(()=>{try{t?.close?.(()=>{})}catch{}},"closeCompiler");o?o.close(s):s()}stop(e=5e3){this.stopped=!0;const t=[...this.groups.values()];return this.groups.clear(),this.members.clear(),new Promise(o=>{let s=t.length;if(s===0)return o();const i=setTimeout(o,e);i.unref?.();for(const r of t){r.retry.dispose();for(const n of r.pausing.values())clearTimeout(n);const c=h(()=>{--s===0&&(clearTimeout(i),o())},"done"),a=r.compiler,l=h(()=>{try{a.close(()=>c())}catch{c()}},"closeCompiler");r.watching?r.watching.close(l):l()}})}}exports.BuildHost=BuildHost;
|
package/shared-build/protocol.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _=Object.defineProperty;var r=(t,e)=>_(t,"name",{value:e,configurable:!0});var o=Object.defineProperty,s=r((t,e)=>o(t,"name",{value:e,configurable:!0}),"s");Object.defineProperty(exports,"__esModule",{value:!0}),exports.SHARED_COMPILER_DEFAULT=exports.BUILD_HOST_ROOT_FLAG=exports.BUILD_HOST_ROLE=exports.SHARED_BUILD_CHANNEL=exports.SHARED_BUILD_ENV=exports.SHARED_COMPILER_ENV=void 0,exports.sharedCompilerEnabled=sharedCompilerEnabled,exports.isRunnerJoinMessage=isRunnerJoinMessage,exports.isRunnerInbound=isRunnerInbound,exports.buildHostArgs=buildHostArgs,exports.isBuildHostCommandOf=isBuildHostCommandOf,exports.SHARED_COMPILER_ENV="LENSMCP_SHARED_COMPILER",exports.SHARED_BUILD_ENV="LENSMCP_SHARED_BUILD",exports.SHARED_BUILD_CHANNEL="lensmcp-shared-build",exports.BUILD_HOST_ROLE="build",exports.BUILD_HOST_ROOT_FLAG="--workspace-root=";const ON=/^(1|on|true|yes)$/i,OFF=/^(0|off|false|no)$/i;exports.SHARED_COMPILER_DEFAULT=!0;function sharedCompilerEnabled(t=process.env,e){const n=(t[exports.SHARED_COMPILER_ENV]??"").trim();return ON.test(n)?!0:OFF.test(n)?!1:e??exports.SHARED_COMPILER_DEFAULT}r(sharedCompilerEnabled,"sharedCompilerEnabled"),s(sharedCompilerEnabled,"sharedCompilerEnabled");function isRunnerJoinMessage(t){const e=t;return!!e&&e.channel===exports.SHARED_BUILD_CHANNEL&&e.type==="join"&&typeof e.join?.project=="string"}r(isRunnerJoinMessage,"isRunnerJoinMessage"),s(isRunnerJoinMessage,"isRunnerJoinMessage");function isRunnerInbound(t){const e=t;return!!e&&e.channel===exports.SHARED_BUILD_CHANNEL&&typeof e.event?.type=="string"}r(isRunnerInbound,"isRunnerInbound"),s(isRunnerInbound,"isRunnerInbound");function buildHostArgs(t){return["host",`${exports.BUILD_HOST_ROOT_FLAG}${t.replace(/\/+$/,"")}`]}r(buildHostArgs,"buildHostArgs"),s(buildHostArgs,"buildHostArgs");function isBuildHostCommandOf(t,e){return/\bbuild-host\.(js|ts)\b/.test(t)&&t.trimEnd().endsWith(` ${exports.BUILD_HOST_ROOT_FLAG}${e.replace(/\/+$/,"")}`)}r(isBuildHostCommandOf,"isBuildHostCommandOf"),s(isBuildHostCommandOf,"isBuildHostCommandOf");
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
${String(e.message??e).trim()}`}
|
|
3
|
-
`)}
|
|
1
|
+
"use strict";var w=Object.defineProperty;var l=(t,e)=>w(t,"name",{value:e,configurable:!0});var $=Object.defineProperty,c=l((t,e)=>$(t,"name",{value:e,configurable:!0}),"c");Object.defineProperty(exports,"__esModule",{value:!0}),exports.SharedEntriesPlugin=exports.EntryRegistry=void 0,exports.memberEntries=memberEntries,exports.attributeCompilation=attributeCompilation,exports.describeBuild=describeBuild;const tslib_1=require("tslib"),node_crypto_1=require("node:crypto"),path=tslib_1.__importStar(require("node:path"));function memberEntries(t,e){const r=[{name:t,project:t,import:e.main,outputFile:path.join(e.outputDir,"main.js")}];for(const o of e.additionalEntryPoints??[])r.push({name:`${t}~${o.entryName}`,project:t,import:o.entryPath,outputFile:path.join(e.outputDir,`${o.entryName}.js`)});return r}l(memberEntries,"memberEntries"),c(memberEntries,"memberEntries");class EntryRegistry{static{l(this,"EntryRegistry")}static{c(this,"EntryRegistry")}constructor(){this.byProject=new Map}set(e,r){this.byProject.set(e,r)}delete(e){return this.byProject.delete(e)}has(e){return this.byProject.has(e)}projects(){return[...this.byProject.keys()]}entriesOf(e){return this.byProject.get(e)??[]}entryProjects(){const e={};for(const[r,o]of this.byProject)for(const n of o)e[n.name]=r;return e}entry(e){for(const r of this.byProject.values()){const o=r.find(n=>n.name===e);if(o)return o}}webpackEntries(e){const r={};for(const o of this.byProject.values())for(const n of o)r[n.name]={import:[n.import],filename:path.relative(e,n.outputFile)};return r}}exports.EntryRegistry=EntryRegistry;class SharedEntriesPlugin{static{l(this,"SharedEntriesPlugin")}static{c(this,"SharedEntriesPlugin")}constructor(e){this.options=e}apply(e){const{registry:r,workspaceRoot:o,outputPath:n,cache:s}=this.options;e.options.context=o,e.context=o,e.options.output={...e.options.output,path:n,clean:!1,chunkFilename:c(m=>{const i=m.chunk?.runtime,d=typeof i=="string"?i:i?[...i].sort()[0]:void 0,u=d?r.entry(d):void 0;return`${u?path.relative(n,path.dirname(u.outputFile)):"."}/[id].js`},"chunkFilename")},e.options.cache={...s,buildDependencies:{...s.buildDependencies}},e.options.entry=()=>Promise.resolve(r.webpackEntries(n))}}exports.SharedEntriesPlugin=SharedEntriesPlugin;const resourceOf=c(t=>{if(typeof t.resource!="string"||!t.resource)return;const e=t.resource.search(/[?#]/);return e===-1?t.resource:t.resource.slice(0,e)},"resourceOf");function formatLoc(t){const e=t?.start;if(!e||typeof e.line!="number")return"";const r=`${e.line}:${e.column??0}`,o=t?.end;return!o||typeof o.line!="number"?r:o.line===e.line?`${r}-${o.column??0}`:`${r}-${o.line}:${o.column??0}`}l(formatLoc,"formatLoc"),c(formatLoc,"formatLoc");function formatProblem(t,e,r){const o=e.module;let n="";try{n=o?.readableIdentifier?o.readableIdentifier(r.requestShortener):""}catch{}const s=formatLoc(e.loc);return`${n?`${t} in ${n}${s?` ${s}`:""}`:t}
|
|
2
|
+
${String(e.message??e).trim()}`}l(formatProblem,"formatProblem"),c(formatProblem,"formatProblem");const MAX_PROBLEMS=30,MAX_PROBLEM_CHARS=4e3;function attributeCompilation(t,e){const r=new Map,o=new Map,n=t.compiler?.context??t.options?.context??process.cwd();for(const i of e.projects()){const d=new Set;let u=!1;for(const a of e.entriesOf(i)){const p=t.entrypoints?.get(a.name);if(p){u=!0;for(const f of p.chunks??[]){d.add(f);for(const y of f.getAllAsyncChunks?.()??[])d.add(y)}}}if(!u)continue;const h=new Set,g=[],b=[];for(const a of d){g.push(`${String(a.id)}:${a.hash??""}`);for(const p of t.chunkGraph.getChunkModulesIterable(a)){let f=o.get(p);f||o.set(p,f=new Set),f.add(i);const y=resourceOf(p);y&&h.add(y)}for(const p of a.files??[]){const f=t.getAsset?.(p),y=path.resolve(t.outputOptions?.path??n,p);b.push({file:path.relative(n,y),size:f?.info?.size??f?.source?.size?.()??0})}}r.set(i,{project:i,hash:(0,node_crypto_1.createHash)("sha256").update(g.sort().join("|")).digest("hex").slice(0,16),errors:[],warnings:[],errorCount:0,warningCount:0,files:[...h],assets:b})}const s=e.entryProjects(),m=c((i,d)=>{for(const u of d){let h=u.module?o.get(u.module):void 0;!h&&u.loc?.name&&s[u.loc.name]&&(h=[s[u.loc.name]]),h||(h=r.keys());const g=formatProblem(i==="errors"?"ERROR":"WARNING",u,t);for(const b of h){const a=r.get(b);a&&(i==="errors"?a.errorCount+=1:a.warningCount+=1,a[i].length<MAX_PROBLEMS&&a[i].push(g.length>MAX_PROBLEM_CHARS?`${g.slice(0,MAX_PROBLEM_CHARS)}\u2026`:g))}}},"assign");return m("errors",t.errors??[]),m("warnings",t.warnings??[]),r}l(attributeCompilation,"attributeCompilation"),c(attributeCompilation,"attributeCompilation");function describeBuild(t,e){const r=[];if(e.changed)for(const s of t.assets)r.push(`asset ${s.file} ${formatSize(s.size)} [emitted]`);for(const s of t.errors)r.push("",s);for(const s of t.warnings)r.push("",s);(t.errors.length||t.warnings.length)&&r.push("");const o=c((s,m)=>`${s} ${m}${s===1?"":"s"}`,"plural"),n=t.errorCount?`compiled with ${o(t.errorCount,"error")}${t.warningCount?` and ${o(t.warningCount,"warning")}`:""}`:t.warningCount?`compiled with ${o(t.warningCount,"warning")}`:"compiled successfully";return r.push(`webpack ${e.webpackVersion} ${n} in ${e.durationMs} ms (shared compilation${e.changed?"":" \u2014 this service's bundle is unchanged"})`),r.join(`
|
|
3
|
+
`)}l(describeBuild,"describeBuild"),c(describeBuild,"describeBuild");function formatSize(t){return t>=1024*1024?`${(t/(1024*1024)).toFixed(2)} MiB`:t>=1024?`${(t/1024).toFixed(1)} KiB`:`${t} bytes`}l(formatSize,"formatSize"),c(formatSize,"formatSize");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var g=Object.defineProperty;var p=(e,i)=>g(e,"name",{value:i,configurable:!0});var d=Object.defineProperty,a=p((e,i)=>d(e,"name",{value:i,configurable:!0}),"a");Object.defineProperty(exports,"__esModule",{value:!0}),exports.PER_SERVICE_PLUGINS=exports.TYPECHECK_ONLY_COMPILER_OPTIONS=exports.PER_SERVICE_TARGET_KEYS=void 0,exports.transpileCompilerOptions=transpileCompilerOptions,exports.memberMasks=memberMasks,exports.configFingerprint=configFingerprint,exports.memberSignature=memberSignature,exports.describeDifference=describeDifference,exports.refusalOf=refusalOf;const tslib_1=require("tslib"),node_crypto_1=require("node:crypto"),node_module_1=require("node:module"),path=tslib_1.__importStar(require("node:path"));exports.PER_SERVICE_TARGET_KEYS=["entryFile","tsConfigFile","outputPath","workers","configEnv","childCount","serviceName","servePrefix","gateway","internalPort","debugPort","logFile","webpackConfigPath","devtool","memoryLimit","port"],exports.TYPECHECK_ONLY_COMPILER_OPTIONS=new Set(["configFilePath","pathsBasePath","rootDir","rootDirs","outDir","outFile","declaration","declarationDir","declarationMap","emitDeclarationOnly","composite","incremental","tsBuildInfoFile","noEmit","noEmitOnError","types","typeRoots","lib","skipLibCheck","skipDefaultLibCheck","forceConsistentCasingInFileNames","strict","noImplicitAny","strictNullChecks","strictFunctionTypes","strictBindCallApply","strictPropertyInitialization","strictBuiltinIteratorReturn","noImplicitThis","useUnknownInCatchVariables","noUnusedLocals","noUnusedParameters","exactOptionalPropertyTypes","noImplicitReturns","noFallthroughCasesInSwitch","noUncheckedIndexedAccess","noImplicitOverride","noPropertyAccessFromIndexSignature","allowUnusedLabels","allowUnreachableCode","noErrorTruncation","diagnostics","extendedDiagnostics","listFiles","listEmittedFiles","traceResolution","explainFiles","pretty","preserveWatchOutput","assumeChangesOnlyAffectDirectDependencies","noStrictGenericChecks","suppressExcessPropertyErrors","suppressImplicitAnyIndexErrors","disableSizeLimit","disableSourceOfProjectReferenceRedirect","disableSolutionSearching","disableReferencedProjectLoad","noCheck","noUncheckedSideEffectImports","checkJs","maxNodeModuleJsDepth","isolatedDeclarations","erasableSyntaxOnly","libReplacement"]),exports.PER_SERVICE_PLUGINS=new Set(["DevServerReloadPlugin","PerfRulesPlugin","ForkTsCheckReporterPlugin","TsgoCheckPlugin","ForkTsCheckerWebpackPlugin","HotModuleReplacementPlugin"]);const UNWALKED_PLUGINS=new Set([...exports.PER_SERVICE_PLUGINS,"NxAppWebpackPlugin"]),sha=a(e=>(0,node_crypto_1.createHash)("sha256").update(e).digest("hex").slice(0,16),"sha");function loadTypeScript(e){try{return(0,node_module_1.createRequire)(path.join(e,"package.json"))("typescript")}catch{return require("typescript")}}p(loadTypeScript,"loadTypeScript"),a(loadTypeScript,"loadTypeScript");function canonical(e){if(Array.isArray(e))return e.map(canonical);if(e&&typeof e=="object"){const i={};for(const o of Object.keys(e).sort())i[o]=canonical(e[o]);return i}return e}p(canonical,"canonical"),a(canonical,"canonical");function transpileCompilerOptions(e,i){const o=loadTypeScript(i),r=o.readConfigFile(e,c=>o.sys.readFile(c));if(r.error)throw new Error(`cannot read ${e}: ${String(r.error.messageText)}`);const s={...o.sys,readDirectory:a(()=>[],"readDirectory")},u=o.parseJsonConfigFileContent(r.config,s,path.dirname(e),void 0,e),t={};for(const[c,f]of Object.entries(u.options))exports.TYPECHECK_ONLY_COMPILER_OPTIONS.has(c)||(t[c]=f);const n=u.options.paths;if(n){const c=u.options.baseUrl??u.options.pathsBasePath??path.dirname(e);t.paths=Object.fromEntries(Object.entries(n).map(([f,l])=>[f,l.map(m=>path.resolve(c,m))]))}return canonical(t)}p(transpileCompilerOptions,"transpileCompilerOptions"),a(transpileCompilerOptions,"transpileCompilerOptions");function memberMasks(e,i){const o=[{from:e.appRoot,to:"<appRoot>"},{from:e.outputDir,to:"<outputDir>"},{from:e.main,to:"<main>"},{from:e.tsConfig,to:"<tsConfig>"}];for(const r of e.additionalEntryPoints??[])o.push({from:r.entryPath,to:`<worker:${r.entryName}>`});return o.filter(r=>r.from).sort((r,s)=>s.from.length-r.from.length).concat([i,i.replace(/[^\w.-]+/g,"_"),e.appName,e.serviceName].filter(r=>!!r).map(r=>({from:r,to:"<project>",whole:!0})))}p(memberMasks,"memberMasks"),a(memberMasks,"memberMasks");const MAX_DEPTH=8,MAX_KEYS=200;function configFingerprint(e,i){const o=new WeakSet,r=a(t=>{let n=t;for(const c of i){if(c.whole){if(n===c.from)return c.to;continue}n.includes(c.from)&&(n=n.split(c.from).join(c.to))}return n},"mask"),s=a((t,n)=>{if(typeof t=="string")return r(t);if(typeof t=="function")return`fn:${sha(r(Function.prototype.toString.call(t)))}`;if(t instanceof RegExp)return`re:${r(String(t))}`;if(!t||typeof t!="object")return t;if(o.has(t))return"<cycle>";if(n>=MAX_DEPTH)return"<deep>";o.add(t);try{if(Array.isArray(t))return t.slice(0,MAX_KEYS).map(l=>s(l,n+1));if(t instanceof Map)return{$map:[...t.entries()].slice(0,MAX_KEYS).map(([l,m])=>[s(l,n+1),s(m,n+1)])};if(t instanceof Set)return{$set:[...t].slice(0,MAX_KEYS).map(l=>s(l,n+1))};const c=t.constructor?.name,f=c&&c!=="Object"?{$class:c}:{};for(const l of Object.keys(t).sort().slice(0,MAX_KEYS))f[l]=s(t[l],n+1);return f}finally{o.delete(t)}},"walk"),u={};for(const t of Object.keys(e).sort()){if(t==="entry"||t==="watch")continue;let n=e[t];t==="plugins"&&Array.isArray(n)&&(n=n.filter(c=>!UNWALKED_PLUGINS.has(c?.constructor?.name??""))),t==="output"&&n&&typeof n=="object"&&(n=Object.fromEntries(Object.entries(n).filter(([c])=>c!=="path"))),u[`config.${t}`]=sha(JSON.stringify(s(n,0)))}return u}p(configFingerprint,"configFingerprint"),a(configFingerprint,"configFingerprint");function moduleShapingOptions(e,i){return canonical({devtool:i,buildLibsFromSource:e.buildLibsFromSource??!0,orgScopes:e.orgScopes??[],bundlePackages:e.bundlePackages??[],nodeExternalsConfig:e.nodeExternalsConfig??null})}p(moduleShapingOptions,"moduleShapingOptions"),a(moduleShapingOptions,"moduleShapingOptions");function memberSignature(e){const{join:i}=e,o={};for(const[s,u]of Object.entries(i.targetOptions??{}))exports.PER_SERVICE_TARGET_KEYS.includes(s)||(o[s]=u);const r={options:sha(JSON.stringify(moduleShapingOptions(i.options,e.devtool))),targetOptions:sha(JSON.stringify(canonical(o))),tsconfig:sha(JSON.stringify(e.compilerOptions)),...configFingerprint(e.config,memberMasks(i.options,i.project))};return{key:sha(JSON.stringify(canonical(r))),parts:r}}p(memberSignature,"memberSignature"),a(memberSignature,"memberSignature");const PART_NAMES={options:"its build options (devtool, buildLibsFromSource, orgScopes, bundlePackages or nodeExternalsConfig)",targetOptions:"its serve target options",tsconfig:"its tsconfig compiler options"};function describeDifference(e,i){const o=[...new Set([...Object.keys(e.parts),...Object.keys(i.parts)])].sort((r,s)=>order(r)-order(s)||r.localeCompare(s));for(const r of o)if(e.parts[r]!==i.parts[r])return PART_NAMES[r]??`its webpack config (\`${r.slice(7)}\` \u2014 a webpackConfigPath override?)`}p(describeDifference,"describeDifference"),a(describeDifference,"describeDifference");function order(e){return e in PART_NAMES?0:1}p(order,"order"),a(order,"order");function refusalOf(e,i){const{options:o}=e,r=a(s=>!!s&&!path.relative(i,path.resolve(i,s)).startsWith(".."),"inside");if(o.buildLibsFromSource===!1)return"buildLibsFromSource is false \u2014 its library paths are its own (a tsconfig nx writes per project)";if([...o.assets??[],...Array.isArray(e.targetOptions?.assets)?e.targetOptions.assets:[]].length>0)return"it copies assets \u2014 they are copied relative to one output directory, and a shared compilation writes several";if(!r(o.outputDir))return`its output directory (${o.outputDir}) is outside the workspace`;if(o.webpackConfigPath&&!r(path.resolve(o.appRoot,o.webpackConfigPath)))return"its webpackConfigPath is outside the workspace";for(const s of o.additionalEntryPoints??[])if(!/^[\w.-]+$/.test(s.entryName))return`worker "${s.entryName}" is not a plain file name`}p(refusalOf,"refusalOf"),a(refusalOf,"refusalOf");
|
package/stdio-guard.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var c=Object.defineProperty;var r=(o,e)=>c(o,"name",{value:e,configurable:!0});var d=Object.defineProperty,s=r((o,e)=>d(o,"name",{value:e,configurable:!0}),"s");Object.defineProperty(exports,"__esModule",{value:!0}),exports.guardBrokenStdio=guardBrokenStdio;function guardBrokenStdio(o=[process.stdout,process.stderr]){for(const e of o){const t=e;t.__lensmcpStdioGuard||(t.__lensmcpStdioGuard=!0,e.on("error",n=>{if(n?.code!=="EPIPE")throw n}))}}r(guardBrokenStdio,"guardBrokenStdio"),s(guardBrokenStdio,"guardBrokenStdio");
|
package/swap-mode.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var o=(r,e)=>a(r,"name",{value:e,configurable:!0});var t=Object.defineProperty,s=o((r,e)=>t(r,"name",{value:e,configurable:!0}),"s");Object.defineProperty(exports,"__esModule",{value:!0}),exports.swapMode=swapMode,exports.abandonSuperseded=abandonSuperseded,exports.maxRetiring=maxRetiring;function swapMode(r=process.env){const e=(r.LENSMCP_SWAP_MODE??"").trim().toLowerCase();return e==="in-process"||e==="inprocess"||e==="hot"?"in-process":"process"}o(swapMode,"swapMode"),s(swapMode,"swapMode");function abandonSuperseded(r,e=process.env){const n=Number(e.LENSMCP_SWAP_MAX_SUPERSEDED),i=Number.isFinite(n)&&n>=0?Math.floor(n):2;return r<i}o(abandonSuperseded,"abandonSuperseded"),s(abandonSuperseded,"abandonSuperseded");function maxRetiring(r=process.env){const e=Number(r.LENSMCP_SWAP_MAX_RETIRING);return Number.isFinite(e)&&e>=1?Math.floor(e):2}o(maxRetiring,"maxRetiring"),s(maxRetiring,"maxRetiring");
|
package/swap-recycle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var o=Object.defineProperty;var n=(s,e)=>o(s,"name",{value:e,configurable:!0});var t=Object.defineProperty,r=n((s,e)=>t(s,"name",{value:e,configurable:!0}),"r");Object.defineProperty(exports,"__esModule",{value:!0}),exports.swapRecyclePolicy=swapRecyclePolicy,exports.recycleReason=recycleReason;const MB=1024*1024,numberFrom=r((s,e,a)=>{if(s===void 0||s.trim()==="")return e;const i=Number(s);return Number.isFinite(i)&&i>=a?i:e},"numberFrom");function swapRecyclePolicy(s=process.env){return{enabled:!["0","false","no","off"].includes((s.LENSMCP_SWAP_RECYCLE??"").trim().toLowerCase()),heapFactor:numberFrom(s.LENSMCP_SWAP_RECYCLE_HEAP_FACTOR,3,0),minHeapBytes:numberFrom(s.LENSMCP_SWAP_RECYCLE_MIN_MB,512,0)*MB,heapRatio:Math.min(1,numberFrom(s.LENSMCP_SWAP_RECYCLE_HEAP_RATIO,.7,0)),maxSwaps:Math.floor(numberFrom(s.LENSMCP_SWAP_RECYCLE_AFTER,0,0)),stuckCloseMs:Math.floor(numberFrom(s.LENSMCP_SWAP_RECYCLE_STUCK_CLOSE_MS,6e4,0)),settleMs:Math.floor(numberFrom(s.LENSMCP_SWAP_RECYCLE_SETTLE_MS,5e3,0)),retainedMs:Math.floor(numberFrom(s.LENSMCP_SWAP_RECYCLE_RETAINED_MS,10*6e4,0))}}n(swapRecyclePolicy,"swapRecyclePolicy"),r(swapRecyclePolicy,"swapRecyclePolicy");const mb=r(s=>(s/MB).toFixed(0),"mb");function recycleReason(s,e){if(!(!s.enabled||e.swaps<1)){if(s.maxSwaps>0&&e.swaps>=s.maxSwaps)return`${e.swaps} hot swaps in this process (LENSMCP_SWAP_RECYCLE_AFTER=${s.maxSwaps})`;if(s.stuckCloseMs>0&&(e.stuckCloses??0)>0){const a=e.stuckCloses;return`${a} previous app${a===1?" has":"s have"} not finished closing after ${Math.round(s.stuckCloseMs/1e3)}s \u2014 a shutdown hook that never returns keeps the whole app, its connections included, in memory`}if(s.retainedMs>0&&e.retained&&e.retained.gcs>=2&&e.retained.ageMs>=s.retainedMs){const a=e.retained,i=a.ageMs<9e4?`${Math.round(a.ageMs/1e3)}s`:`${Math.round(a.ageMs/6e4)} min`;return`generation ${a.generation} is still in memory ${i} after its app was closed, through ${a.gcs} full GCs \u2014 something still points into it, and only a fresh process gives it back`}if(s.heapRatio>0&&e.limitBytes>0&&e.usedBytes>=s.heapRatio*e.limitBytes){const a=Math.round(e.usedBytes/e.limitBytes*100);return`its heap is ${mb(e.usedBytes)} MB after a full GC, ${a}% of V8's ${mb(e.limitBytes)} MB limit`}if(s.heapFactor>0&&e.settled!==!1&&e.baselineBytes!==void 0&&e.baselineBytes>0&&e.usedBytes>=s.minHeapBytes&&e.usedBytes>=s.heapFactor*e.baselineBytes){const a=(e.usedBytes/e.baselineBytes).toFixed(1);return`its heap is ${mb(e.usedBytes)} MB after a full GC, ${a}\xD7 the ${mb(e.baselineBytes)} MB it booted with \u2014 earlier generations of the bundle are still in memory`}}}n(recycleReason,"recycleReason"),r(recycleReason,"recycleReason");
|
package/tsgo-check-plugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`&&(n=!1,t+=r);continue}if(s){r==="*"&&
|
|
1
|
+
"use strict";var k=Object.defineProperty;var l=(e,t)=>k(e,"name",{value:t,configurable:!0});var b=Object.defineProperty,c=l((e,t)=>b(e,"name",{value:t,configurable:!0}),"c");Object.defineProperty(exports,"__esModule",{value:!0}),exports.TsgoCheckPlugin=exports.TSGO_MISSING_CAUSE=exports.TSGO_PACKAGE=void 0,exports.checkerMaxProcs=checkerMaxProcs,exports.tsgoIncremental=tsgoIncremental,exports.tsgoBuildInfoPath=tsgoBuildInfoPath,exports.tsgoCheckArgs=tsgoCheckArgs,exports.typecheckMode=typecheckMode,exports.resolveTsgoPackageDir=resolveTsgoPackageDir,exports.resolveTsgoBin=resolveTsgoBin,exports.reportTsgoUnavailable=reportTsgoUnavailable,exports.effectivePaths=effectivePaths,exports.tsconfigChain=tsconfigChain,exports.writeShimTsconfig=writeShimTsconfig;const tslib_1=require("tslib"),node_child_process_1=require("node:child_process"),fs=tslib_1.__importStar(require("node:fs")),path=tslib_1.__importStar(require("node:path")),typecheck_bus_1=require("./typecheck-bus"),typecheck_queue_1=require("./typecheck-queue"),DEFAULT_TIMEOUT_MS=12e4,DEFAULT_MAX_PROCS=4;function checkerMaxProcs(e=process.env){const t=Number(e.LENSMCP_TYPECHECK_GOMAXPROCS);return Number.isInteger(t)&&t>=1?t:DEFAULT_MAX_PROCS}l(checkerMaxProcs,"checkerMaxProcs"),c(checkerMaxProcs,"checkerMaxProcs");function tsgoIncremental(e=process.env){const t=(e.LENSMCP_TSGO_INCREMENTAL??"").trim().toLowerCase();return!(t==="0"||t==="false"||t==="off"||t==="no")}l(tsgoIncremental,"tsgoIncremental"),c(tsgoIncremental,"tsgoIncremental");function tsgoBuildInfoPath(e,t){return path.join(t,"tmp","lensmcp-tsgo",`${e}.tsbuildinfo`)}l(tsgoBuildInfoPath,"tsgoBuildInfoPath"),c(tsgoBuildInfoPath,"tsgoBuildInfoPath");function tsgoCheckArgs(e,t){return["--noEmit","--pretty","false",...t?["--incremental","--tsBuildInfoFile",t]:[],"-p",e]}l(tsgoCheckArgs,"tsgoCheckArgs"),c(tsgoCheckArgs,"tsgoCheckArgs");const livePlugins=new Set;let exitHooked=!1;function stopWithTheProcess(e){livePlugins.add(e),!exitHooked&&(exitHooked=!0,process.once("exit",()=>{for(const t of livePlugins)t.dispose()}))}l(stopWithTheProcess,"stopWithTheProcess"),c(stopWithTheProcess,"stopWithTheProcess");function typecheckMode(e=process.env){const t=e.LENSMCP_TYPECHECK;return t===void 0||t===""||t==="tsgo"?"tsgo":t==="off"?"off":"tsc"}l(typecheckMode,"typecheckMode"),c(typecheckMode,"typecheckMode"),exports.TSGO_PACKAGE="@typescript/native-preview";function shimNames(e){return e==="win32"?["tsgo.cmd","tsgo.exe"]:["tsgo"]}l(shimNames,"shimNames"),c(shimNames,"shimNames");function isExecutableFile(e,t){try{if(!fs.statSync(e).isFile())return!1}catch{return!1}if(t==="win32")return!0;try{return fs.accessSync(e,fs.constants.X_OK),!0}catch{return!1}}l(isExecutableFile,"isExecutableFile"),c(isExecutableFile,"isExecutableFile");function resolveTsgoPackageDir(){try{return path.dirname(require.resolve(`${exports.TSGO_PACKAGE}/package.json`))}catch{}try{let e=path.dirname(require.resolve(exports.TSGO_PACKAGE));for(let t=0;t<6;t++){const o=path.join(e,"package.json");if(fs.existsSync(o))try{const{name:s}=JSON.parse(fs.readFileSync(o,"utf8"));if(s===exports.TSGO_PACKAGE)return e}catch{}const n=path.dirname(e);if(n===e)break;e=n}}catch{}return null}l(resolveTsgoPackageDir,"resolveTsgoPackageDir"),c(resolveTsgoPackageDir,"resolveTsgoPackageDir");function packageDeclaredBin(e){try{const{bin:t}=JSON.parse(fs.readFileSync(path.join(e,"package.json"),"utf8")),o=typeof t=="string"?t:t?.tsgo;return o?path.join(e,o):null}catch{return null}}l(packageDeclaredBin,"packageDeclaredBin"),c(packageDeclaredBin,"packageDeclaredBin");function ownBinCandidates(e,t){const o=path.resolve(e,"..","..",".bin"),n=shimNames(t).map(i=>path.join(o,i)),s=t==="win32"?null:packageDeclaredBin(e);return s?[s,...n]:n}l(ownBinCandidates,"ownBinCandidates"),c(ownBinCandidates,"ownBinCandidates");function resolveTsgoBin(e,t,o={}){const n=o.platform??process.platform,s=o.isExecutable??(r=>isExecutableFile(r,n));if(t)return s(t)?t:null;for(const r of shimNames(n)){const a=path.join(e,"node_modules",".bin",r);if(s(a))return a}const i=(o.ownPackageDir??resolveTsgoPackageDir)();return i?ownBinCandidates(i,n).find(s)??null:null}l(resolveTsgoBin,"resolveTsgoBin"),c(resolveTsgoBin,"resolveTsgoBin"),exports.TSGO_MISSING_CAUSE=`tsgo binary not found \u2014 @lensmcp/cluster depends on ${exports.TSGO_PACKAGE}, so an absent binary means an incomplete install (reinstall node_modules), a platform with no ${exports.TSGO_PACKAGE} build, or a LENSMCP_TSGO_BIN override pointing at a missing or non-executable file`;function reportTsgoUnavailable(e){try{(0,typecheck_bus_1.publishTypecheckRun)({workspaceRoot:e.workspaceRoot,project:e.appName,tool:"tsgo",tsConfig:e.tsConfig,output:"",durationMs:0,toolError:e.detail,...e.eventFile?{eventFile:e.eventFile}:{}})}catch{}}l(reportTsgoUnavailable,"reportTsgoUnavailable"),c(reportTsgoUnavailable,"reportTsgoUnavailable");function parseJsonc(e){let t="",o=!1,n=!1,s=!1;for(let i=0;i<e.length;i++){const r=e[i],a=e[i+1];if(n){r===`
|
|
2
|
+
`&&(n=!1,t+=r);continue}if(s){r==="*"&&a==="/"&&(s=!1,i++);continue}if(o){t+=r,r==="\\"?(t+=a??"",i++):r==='"'&&(o=!1);continue}if(r==='"'){o=!0,t+=r;continue}if(r==="/"&&a==="/"){n=!0,i++;continue}if(r==="/"&&a==="*"){s=!0,i++;continue}t+=r}try{return JSON.parse(t.replace(/,(\s*[}\]])/g,"$1"))}catch{return null}}l(parseJsonc,"parseJsonc"),c(parseJsonc,"parseJsonc");function resolveExtends(e,t){if(!e.startsWith(".")&&!path.isAbsolute(e))return null;const o=path.isAbsolute(e)?e:path.resolve(t,e);for(const n of[o,`${o}.json`,path.join(o,"tsconfig.json")])try{if(fs.statSync(n).isFile())return n}catch{}return null}l(resolveExtends,"resolveExtends"),c(resolveExtends,"resolveExtends");function effectivePaths(e,t=new Set){if(t.has(e))return null;t.add(e);let o;try{o=fs.readFileSync(e,"utf8")}catch{return null}const n=parseJsonc(o);if(!n)return null;const s=path.dirname(e),i=n.compilerOptions??{},r=Array.isArray(n.extends)?n.extends.filter(p=>typeof p=="string"):typeof n.extends=="string"?[n.extends]:[],a=c(()=>{for(const p of[...r].reverse()){const d=resolveExtends(p,s);if(!d)continue;const f=effectivePaths(d,t);if(f)return f}return null},"inherited"),u=i.paths,h=typeof i.baseUrl=="string"?path.resolve(s,i.baseUrl):void 0;if(!u){const p=a();return p?{paths:p.paths,anchorDir:h??p.anchorDir}:null}return{paths:u,anchorDir:h??a()?.anchorDir??s}}l(effectivePaths,"effectivePaths"),c(effectivePaths,"effectivePaths");function tsconfigChain(e){const t=[],o=c(n=>{if(t.includes(n))return;t.push(n);let s;try{s=parseJsonc(fs.readFileSync(n,"utf8"))}catch{return}const i=s?.extends,r=Array.isArray(i)?i.filter(a=>typeof a=="string"):typeof i=="string"?[i]:[];for(const a of r){const u=resolveExtends(a,path.dirname(n));u&&!u.split(path.sep).includes("node_modules")&&o(u)}},"visit");return o(path.resolve(e)),t}l(tsconfigChain,"tsconfigChain"),c(tsconfigChain,"tsconfigChain");function writeShimTsconfig(e,t,o){const n=path.join(o,"tmp","lensmcp-tsgo");fs.mkdirSync(n,{recursive:!0});const s=path.join(n,`${e}.tsconfig.json`),i=effectivePaths(t),r=i?Object.fromEntries(Object.entries(i.paths).map(([h,p])=>[h,(Array.isArray(p)?p:[]).map(d=>path.isAbsolute(d)?d:path.resolve(i.anchorDir,d))])):void 0,a=JSON.stringify({extends:t,compilerOptions:{module:"preserve",moduleResolution:"bundler",isolatedModules:!1,baseUrl:null,...r&&Object.keys(r).length?{paths:r}:{}}},null,2);let u;try{u=fs.readFileSync(s,"utf8")}catch{}return u!==a&&fs.writeFileSync(s,a),s}l(writeShimTsconfig,"writeShimTsconfig"),c(writeShimTsconfig,"writeShimTsconfig");class TsgoCheckPlugin{static{l(this,"TsgoCheckPlugin")}static{c(this,"TsgoCheckPlugin")}constructor(t){this.timer=null,this.phase="idle",this.dirty=!1,this.ticket=null,this.inflight=null,this.askedAt=0,this.shimPath=null,this.disabled=!1,this.disposed=!1,this.opts=t,this.spawnImpl=t.spawnImpl??node_child_process_1.spawn,this.queue=t.queue??(0,typecheck_queue_1.machineTypecheckQueue)(),this.buildInfo=t.incremental??tsgoIncremental()?tsgoBuildInfoPath(t.appName,t.workspaceRoot):void 0}apply(t){t.hooks.done.tap("TsgoCheckPlugin",o=>{o.hasErrors()||this.schedule()}),t.hooks.shutdown?.tap?.("TsgoCheckPlugin",()=>this.dispose()),t.hooks.watchClose?.tap?.("TsgoCheckPlugin",()=>this.dispose()),stopWithTheProcess(this)}schedule(){this.disabled||this.disposed||(this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>this.request(),this.opts.debounceMs??500),this.timer.unref?.())}request(){if(this.disabled||this.disposed)return;if(this.phase==="running"){this.dirty=!0;return}if(this.phase==="waiting")return;this.phase="waiting",this.askedAt=Date.now();const t=this.queue(this.opts.appName,()=>this.run(),{onHold:c(o=>this.held(o),"onHold")});this.isIdle()?t.release():this.ticket=t}held(t){if(!this.disposed&&(console.log(`[tsgo] ${this.opts.appName}: check held \u2014 ${t.availableMb} MB free, it waits for ${t.minFreeMb} MB (LENSMCP_TYPECHECK_MIN_FREE_MB)`),this.opts.publishEvents!==!1))try{(0,typecheck_bus_1.publishTypecheckHeld)({workspaceRoot:this.opts.workspaceRoot,project:this.opts.appName,tool:"tsgo",tsConfig:this.opts.tsConfig,availableMb:t.availableMb,minFreeMb:t.minFreeMb,...this.opts.eventFile?{eventFile:this.opts.eventFile}:{}})}catch{}}forgetBuildInfo(){if(this.buildInfo)try{fs.rmSync(this.buildInfo,{force:!0})}catch{}}isIdle(){return this.phase==="idle"}publish(t){if(this.opts.publishEvents!==!1)try{(0,typecheck_bus_1.publishTypecheckRun)({workspaceRoot:this.opts.workspaceRoot,project:this.opts.appName,tool:"tsgo",tsConfig:this.opts.tsConfig,output:t.output,durationMs:t.durationMs,...t.toolError?{toolError:t.toolError}:{},...this.opts.eventFile?{eventFile:this.opts.eventFile}:{}})}catch{}}run(){if(this.disposed)return this.leave();let t;try{t=resolveTsgoBin(this.opts.workspaceRoot,this.opts.binPath),t&&(this.shimPath=writeShimTsconfig(this.opts.appName,this.opts.tsConfig,this.opts.workspaceRoot))}catch(h){return console.warn(`[tsgo] ${this.opts.appName}: could not prepare the check \u2014 ${h.message}`),this.publish({output:"",durationMs:0,toolError:`could not prepare the check: ${h.message}`}),this.leave()}if(!t){this.disabled=!0;const h=`${exports.TSGO_MISSING_CAUSE}. Type checking is disabled for the rest of this session`;return console.warn(`[tsgo] ${this.opts.appName}: ${h}.`),this.publish({output:"",durationMs:0,toolError:h}),this.leave()}this.phase="running",this.dirty=!1;const o=Date.now(),n=o-this.askedAt,s=this.spawnImpl(t,tsgoCheckArgs(this.shimPath,this.buildInfo),{cwd:this.opts.workspaceRoot,stdio:["ignore","pipe","pipe"],env:{...process.env,GOMAXPROCS:process.env.GOMAXPROCS??String(this.opts.maxProcs??checkerMaxProcs())}});this.inflight=s;let i="",r=!1;const a=this.opts.timeoutMs??DEFAULT_TIMEOUT_MS,u=setTimeout(()=>{r=!0,s.kill("SIGKILL")},a);u.unref?.(),s.stdout?.on("data",h=>{i+=h.toString()}),s.stderr?.on("data",h=>{i+=h.toString()}),s.on("error",()=>{clearTimeout(u),this.inflight===s&&(console.warn(`[tsgo] ${this.opts.appName}: failed to spawn ${t}`),this.forgetBuildInfo(),this.publish({output:"",durationMs:Date.now()-o,toolError:`failed to spawn ${t}`}),this.finish(s))}),s.on("close",(h,p)=>{if(clearTimeout(u),this.inflight!==s)return;const d=Date.now()-o,f=(d/1e3).toFixed(1),m=n>=1e3?`${f}s, waited ${(n/1e3).toFixed(1)}s`:`${f}s`;if(this.disposed)return this.finish(s);if(r){const y=`the check was killed after ${Math.round(a/1e3)}s without finishing`;return console.warn(`[tsgo] ${this.opts.appName}: ${y} \u2014 no verdict.`),this.forgetBuildInfo(),this.publish({output:"",durationMs:d,toolError:y}),this.finish(s)}if(p)return this.forgetBuildInfo(),this.finish(s);if(h===0)return console.log(`[tsgo] ${this.opts.appName}: types clean (${m})`),this.publish({output:"",durationMs:d}),this.finish(s);i.trim()&&process.stdout.write(i.endsWith(`
|
|
3
3
|
`)?i:`${i}
|
|
4
|
-
`);const
|
|
5
|
-
`)[0]?.slice(0,300)??""}
|
|
4
|
+
`);const g=(i.match(/error TS\d+/g)??[]).length;console.log(`[tsgo] ${this.opts.appName}: ${g} type error${g===1?"":"s"} (${m})`),g===0&&this.forgetBuildInfo(),this.publish({output:i,durationMs:d,...g===0?{toolError:`tsgo exited ${h} with no diagnostics: ${firstLine(i)}`}:{}}),this.finish(s)})}finish(t){this.inflight===t&&(this.inflight=null),this.leave(),this.dirty&&!this.disposed&&(this.dirty=!1,this.request())}leave(){this.phase="idle",this.ticket?.release(),this.ticket=null}dispose(){this.disposed||(this.disposed=!0,livePlugins.delete(this),this.timer&&clearTimeout(this.timer),this.inflight&&(this.inflight.kill("SIGKILL"),this.forgetBuildInfo()),this.ticket?.release(),this.ticket=null)}}exports.TsgoCheckPlugin=TsgoCheckPlugin;function firstLine(e){return e.trim().split(`
|
|
5
|
+
`)[0]?.slice(0,300)??""}l(firstLine,"firstLine"),c(firstLine,"firstLine");
|
package/typecheck-bus.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`)){const
|
|
1
|
+
"use strict";var g=Object.defineProperty;var n=(t,e)=>g(t,"name",{value:e,configurable:!0});var f=Object.defineProperty,o=n((t,e)=>f(t,"name",{value:e,configurable:!0}),"o");Object.defineProperty(exports,"__esModule",{value:!0}),exports.MAX_DIAGNOSTICS_PER_RUN=void 0,exports.stripAnsi=stripAnsi,exports.parseTscDiagnosticLine=parseTscDiagnosticLine,exports.parseTscOutput=parseTscOutput,exports.buildTypecheckRunEvents=buildTypecheckRunEvents,exports.resolveEventFile=resolveEventFile,exports.appendTypecheckEvents=appendTypecheckEvents,exports.publishTypecheckDiagnostics=publishTypecheckDiagnostics,exports.publishTypecheckRun=publishTypecheckRun,exports.buildTypecheckHeldEvent=buildTypecheckHeldEvent,exports.publishTypecheckHeld=publishTypecheckHeld;const tslib_1=require("tslib"),fs=tslib_1.__importStar(require("node:fs")),path=tslib_1.__importStar(require("node:path")),busHygiene=(()=>{try{return require("@lensmcp/node-instrumentation")}catch{return}})(),DIAG_LINE_REGEX=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+(TS\d+):\s+(.+)$/,ANSI_CSI=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g");function stripAnsi(t){return t.replace(ANSI_CSI,"")}n(stripAnsi,"stripAnsi"),o(stripAnsi,"stripAnsi");function parseTscDiagnosticLine(t){const e=stripAnsi(t).trim();if(!e)return null;const i=DIAG_LINE_REGEX.exec(e);if(!i)return null;const[,s,l,u,c,a,p]=i;return!s||!l||!u||!c||!a||!p?null:{file:s,line:Number(l),column:Number(u),severity:c==="warning"?"warning":"error",code:a,message:p}}n(parseTscDiagnosticLine,"parseTscDiagnosticLine"),o(parseTscDiagnosticLine,"parseTscDiagnosticLine");function parseTscOutput(t){const e=[];for(const i of t.split(`
|
|
2
|
+
`)){const s=parseTscDiagnosticLine(i);s&&e.push(s)}return e}n(parseTscOutput,"parseTscOutput"),o(parseTscOutput,"parseTscOutput"),exports.MAX_DIAGNOSTICS_PER_RUN=200;let idCounter=0;function makeId(){return idCounter=(idCounter+1)%65535,`${Date.now().toString(36)}${idCounter.toString(36)}${Math.random().toString(36).slice(2,8)}`}n(makeId,"makeId"),o(makeId,"makeId");function buildTypecheckRunEvents(t){const e=(t.now??Date.now)(),i=t.idImpl??makeId,s="pending",l={sessionId:s,source:"typescript",category:"typecheck",context:{sessionId:s,projectName:t.project}},u={project:t.project,tool:t.tool,...t.tsConfig?{tsConfig:t.tsConfig}:{}},c=t.diagnostics.filter(r=>r.severity==="error"),a=t.diagnostics.slice(0,exports.MAX_DIAGNOSTICS_PER_RUN),p=[];if(!t.toolError){p.push({...l,id:i(),timestamp:e,severity:"info",title:`tsc clear: ${t.project}`,message:`typecheck run starting for ${t.project}`,fingerprint:`tsc:${t.project}:run-start`,raw:{...u,kind:"typecheck-run",phase:"start"}});for(const r of a)p.push({...l,id:i(),timestamp:e,severity:r.severity,title:`${r.code}: ${r.message}`,message:r.message,location:{file:r.file,line:r.line,column:r.column},fingerprint:`tsc:${t.project}:${r.file}:${r.line}:${r.column}:${r.code}`,raw:{...u,kind:"typecheck-diagnostic",code:r.code}})}const d=t.toolError?"error":c.length>0?"failing":"clean";return p.push({...l,id:i(),timestamp:e,severity:"info",title:`typecheck run: ${t.project} \u2014 ${t.toolError?"tool error":`${c.length} error${c.length===1?"":"s"}`} (${t.durationMs}ms)`,...t.toolError?{message:t.toolError}:{},fingerprint:`tsc:${t.project}:run-end`,raw:{...u,kind:"typecheck-run",phase:"end",status:d,durationMs:t.durationMs,errorCount:c.length,warningCount:t.diagnostics.length-c.length,...t.diagnostics.length>a.length?{truncatedDiagnostics:t.diagnostics.length-a.length}:{},...t.toolError?{error:t.toolError}:{}}}),p}n(buildTypecheckRunEvents,"buildTypecheckRunEvents"),o(buildTypecheckRunEvents,"buildTypecheckRunEvents");function resolveEventFile(t){return process.env.LENSMCP_EVENT_FILE||path.join(t,".lensmcp","events.jsonl")}n(resolveEventFile,"resolveEventFile"),o(resolveEventFile,"resolveEventFile");let ensuredDir=null;function ensureDir(t){const e=path.dirname(t);ensuredDir!==e&&(fs.mkdirSync(e,{recursive:!0}),ensuredDir=e)}n(ensureDir,"ensureDir"),o(ensureDir,"ensureDir");function appendTypecheckEvents(t,e){if(e.length===0)return;const i=e.map(s=>JSON.stringify(s)).join(`
|
|
3
3
|
`)+`
|
|
4
|
-
`;try{ensureDir(
|
|
4
|
+
`;try{ensureDir(t),busHygiene?.maybeRotateEventFile(t,i.length),fs.appendFileSync(t,i)}catch(s){if(s?.code==="ENOENT"){try{ensuredDir=null,ensureDir(t),fs.appendFileSync(t,i)}catch{}return}}}n(appendTypecheckEvents,"appendTypecheckEvents"),o(appendTypecheckEvents,"appendTypecheckEvents");function publishTypecheckDiagnostics(t){const e=buildTypecheckRunEvents({project:t.project,tool:t.tool,...t.tsConfig?{tsConfig:t.tsConfig}:{},diagnostics:t.diagnostics,durationMs:t.durationMs});return appendTypecheckEvents(t.eventFile??resolveEventFile(t.workspaceRoot),e),e}n(publishTypecheckDiagnostics,"publishTypecheckDiagnostics"),o(publishTypecheckDiagnostics,"publishTypecheckDiagnostics");function publishTypecheckRun(t){const e=buildTypecheckRunEvents({project:t.project,tool:t.tool,...t.tsConfig?{tsConfig:t.tsConfig}:{},diagnostics:t.toolError?[]:parseTscOutput(t.output),durationMs:t.durationMs,...t.toolError?{toolError:t.toolError}:{}});return appendTypecheckEvents(t.eventFile??resolveEventFile(t.workspaceRoot),e),e}n(publishTypecheckRun,"publishTypecheckRun"),o(publishTypecheckRun,"publishTypecheckRun");function buildTypecheckHeldEvent(t){const e="pending";return{id:(t.idImpl??makeId)(),sessionId:e,timestamp:(t.now??Date.now)(),source:"typescript",category:"typecheck",severity:"info",context:{sessionId:e,projectName:t.project},title:`typecheck held: ${t.project} \u2014 ${t.availableMb} MB free, a check waits for ${t.minFreeMb} MB`,message:`the type check of ${t.project} waits until ${t.minFreeMb} MB is free (LENSMCP_TYPECHECK_MIN_FREE_MB)`,fingerprint:`tsc:${t.project}:run-held`,raw:{project:t.project,tool:t.tool,...t.tsConfig?{tsConfig:t.tsConfig}:{},kind:"typecheck-run",phase:"held",availableMb:t.availableMb,minFreeMb:t.minFreeMb}}}n(buildTypecheckHeldEvent,"buildTypecheckHeldEvent"),o(buildTypecheckHeldEvent,"buildTypecheckHeldEvent");function publishTypecheckHeld(t){const e=buildTypecheckHeldEvent(t);return appendTypecheckEvents(t.eventFile??resolveEventFile(t.workspaceRoot),[e]),e}n(publishTypecheckHeld,"publishTypecheckHeld"),o(publishTypecheckHeld,"publishTypecheckHeld");
|
package/typecheck-queue.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var P=Object.defineProperty;var i=(e,t)=>P(e,"name",{value:t,configurable:!0});var x=Object.defineProperty,n=i((e,t)=>x(e,"name",{value:t,configurable:!0}),"n");Object.defineProperty(exports,"__esModule",{value:!0}),exports.immediateQueue=void 0,exports.typecheckQueueDir=typecheckQueueDir,exports.typecheckSlots=typecheckSlots,exports.typecheckMinFreeMb=typecheckMinFreeMb,exports.availableMemoryMb=availableMemoryMb,exports.liveTickets=liveTickets,exports.machineTypecheckQueue=machineTypecheckQueue;const tslib_1=require("tslib"),fs=tslib_1.__importStar(require("node:fs")),os=tslib_1.__importStar(require("node:os")),path=tslib_1.__importStar(require("node:path")),TICKET_SUFFIX=".ticket",DEFAULT_POLL_MS=250,DEFAULT_SETTLE_MS=120,DEFAULT_MAX_AGE_MS=15*6e4,MAX_SLOTS=8,DEFAULT_HOLD_POLL_MS=2e3,DEFAULT_MIN_FREE_MB=2048;function typecheckQueueDir(e=process.env){return path.join(e.LENSMCP_HOME||os.homedir(),".lensmcp","typecheck-queue")}i(typecheckQueueDir,"typecheckQueueDir"),n(typecheckQueueDir,"typecheckQueueDir");function typecheckSlots(e=process.env){const t=Number(e.LENSMCP_TYPECHECK_CONCURRENCY);return Number.isInteger(t)&&t>=1?Math.min(t,MAX_SLOTS):1}i(typecheckSlots,"typecheckSlots"),n(typecheckSlots,"typecheckSlots");function typecheckMinFreeMb(e=process.env){const t=e.LENSMCP_TYPECHECK_MIN_FREE_MB,o=Number(t);return t!==void 0&&t.trim()!==""&&Number.isFinite(o)&&o>=0?Math.round(o):DEFAULT_MIN_FREE_MB}i(typecheckMinFreeMb,"typecheckMinFreeMb"),n(typecheckMinFreeMb,"typecheckMinFreeMb");function availableMemoryMb(){const e=process.availableMemory;if(typeof e=="function")try{const t=e.call(process);return Number.isFinite(t)&&t>0?Math.round(t/(1024*1024)):void 0}catch{return}}i(availableMemoryMb,"availableMemoryMb"),n(availableMemoryMb,"availableMemoryMb");function pidAlive(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}i(pidAlive,"pidAlive"),n(pidAlive,"pidAlive");const ticketPid=n(e=>{const t=Number(e.split("-")[0]);return Number.isInteger(t)&&t>0?t:void 0},"ticketPid");function liveTickets(e,t={}){const o=t.isAlive??pidAlive,_=(t.now??Date.now)(),p=t.maxAgeMs??DEFAULT_MAX_AGE_MS;let u;try{u=fs.readdirSync(e).filter(r=>r.endsWith(TICKET_SUFFIX))}catch{return[]}const s=[];for(const r of u){const c=path.join(e,r);let a;try{a=fs.statSync(c,{bigint:!0})}catch{continue}const M=ticketPid(r);if(M===void 0||!o(M)||_-Number(a.mtimeMs)>p){try{fs.unlinkSync(c)}catch{}continue}s.push({name:r,at:a.mtimeNs})}return s.sort((r,c)=>r.at<c.at?-1:r.at>c.at?1:r.name<c.name?-1:r.name>c.name?1:0),s.map(r=>r.name)}i(liveTickets,"liveTickets"),n(liveTickets,"liveTickets");let ticketSeq=0;function machineTypecheckQueue(e={}){const t=e.dir??typecheckQueueDir(),o=Math.max(1,e.slots??typecheckSlots()),_=e.pollMs??DEFAULT_POLL_MS,p=e.settleMs??DEFAULT_SETTLE_MS,u=e.pid??process.pid,s=e.minFreeMb??typecheckMinFreeMb(),r=e.availableMb??availableMemoryMb,c=e.holdPollMs??DEFAULT_HOLD_POLL_MS,a=n(()=>liveTickets(t,e),"scan"),M=n(()=>{if(s<=0)return;const l=r();return l!==void 0&&l<s?{availableMb:l,minFreeMb:s}:void 0},"memoryHold");return(l,N,L)=>{const v=`${u}-${(ticketSeq++).toString(36)}-${Math.random().toString(36).slice(2,8)}${TICKET_SUFFIX}`,S=path.join(t,v);let m=!1,b=!1,k=!1,d;const f=n(()=>{m||b||(b=!0,N())},"turn"),E=n(()=>{try{return fs.mkdirSync(t,{recursive:!0}),fs.writeFileSync(S,JSON.stringify({pid:u,label:l,at:(e.now??Date.now)()})),!0}catch{return!1}},"write"),y=n(h=>{d=setTimeout(T,h),d.unref?.()},"later");function T(){if(m||b)return;const h=a().indexOf(v);if(h===-1)return E()?y(p):f();if(h<o){const F=M();if(!F)return f();if(!k){k=!0;try{L?.onHold?.(F)}catch{}}return y(c)}y(_)}return i(T,"L"),n(T,"look"),E()?(y(p),{release(){if(!m){m=!0,d&&clearTimeout(d);try{fs.unlinkSync(S)}catch{}}}}):(f(),{release(){m=!0}})}}i(machineTypecheckQueue,"machineTypecheckQueue"),n(machineTypecheckQueue,"machineTypecheckQueue");const immediateQueue=n((e,t)=>(t(),{release(){}}),"immediateQueue");exports.immediateQueue=immediateQueue;
|
package/worker-guard.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var n=Object.defineProperty;var o=(e,r)=>n(e,"name",{value:r,configurable:!0});var t=Object.defineProperty,s=o((e,r)=>t(e,"name",{value:r,configurable:!0}),"s");Object.defineProperty(exports,"__esModule",{value:!0});const worker_retire_1=require("./worker-retire"),orphanMs=(()=>{const e=Number(process.env.LENSMCP_WORKER_ORPHAN_MS);return Number.isFinite(e)&&e>=0&&process.env.LENSMCP_WORKER_ORPHAN_MS!==""?e:1e4})();if(typeof process.send=="function"&&process.channel){process.once("disconnect",()=>{for(const r of[process.stdout,process.stderr])r.on("error",()=>{});setTimeout(()=>process.exit(0),orphanMs).unref(),process.kill(process.pid,"SIGTERM")});const e=s(r=>{(0,worker_retire_1.isRetireMessage)(r)&&(process.off("message",e),(0,worker_retire_1.exitWhenIdle)({graceMs:(0,worker_retire_1.retireGraceMs)(),exit:s(c=>{try{process.stderr.write(`[worker-guard] ${c}
|
|
2
2
|
`)}catch{}process.exit(0)},"exit")}))},"onRetire");process.on("message",e),process.channel.unref()}
|
package/worker-retire.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _=Object.defineProperty;var s=(e,t)=>_(e,"name",{value:t,configurable:!0});var R=Object.defineProperty,n=s((e,t)=>R(e,"name",{value:t,configurable:!0}),"n");Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_RETIRE_GRACE_MS=exports.RETIRE_GRACE_ENV=exports.RETIRE_MESSAGE=void 0,exports.isRetireMessage=isRetireMessage,exports.retireGraceMs=retireGraceMs,exports.exitWhenIdle=exitWhenIdle,exports.RETIRE_MESSAGE="lensmcp-worker-retire",exports.RETIRE_GRACE_ENV="LENSMCP_WORKER_RETIRE_GRACE_MS",exports.DEFAULT_RETIRE_GRACE_MS=5e3;const POLL_MS=250;function isRetireMessage(e){return!!e&&typeof e=="object"&&e.type===exports.RETIRE_MESSAGE}s(isRetireMessage,"isRetireMessage"),n(isRetireMessage,"isRetireMessage");function retireGraceMs(e=process.env){const t=e[exports.RETIRE_GRACE_ENV]?.trim(),r=t?Number(t):NaN;return Number.isFinite(r)&&r>=0?r:exports.DEFAULT_RETIRE_GRACE_MS}s(retireGraceMs,"retireGraceMs"),n(retireGraceMs,"retireGraceMs");function exitWhenIdle(e){const t=e.globals??globalThis,r=t.__lensmcpActiveWork;if(typeof r!="function")return;const c=t.__lensmcpStopWorkIntake;if(typeof c=="function")try{c(Number.MAX_SAFE_INTEGER)}catch{}const a=e.now??Date.now;let o;const i=setInterval(()=>{let E;try{E=Number(r()?.count)}catch{return}if(Number.isFinite(E)){if(E>0){o=void 0;return}o??=a(),!(a()-o<e.graceMs)&&(clearInterval(i),e.exit(`retired: no job in flight for ${e.graceMs}ms and still running \u2014 exiting (its shutdown left a handle open)`))}},POLL_MS);return i.unref?.(),{cancel:n(()=>clearInterval(i),"cancel")}}s(exitWhenIdle,"exitWhenIdle"),n(exitWhenIdle,"exitWhenIdle");
|
package/worker-supervisor.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`):void 0)}
|
|
1
|
+
"use strict";var k=Object.defineProperty;var a=(r,e)=>k(r,"name",{value:e,configurable:!0});var f=Object.defineProperty,i=a((r,e)=>f(r,"name",{value:e,configurable:!0}),"i");Object.defineProperty(exports,"__esModule",{value:!0}),exports.CRASH_LINES=exports.MIN_RESPAWN_MS=exports.CRASH_LOOP_AFTER=void 0,exports.serializeWorkerSpecs=serializeWorkerSpecs,exports.parseWorkerSpecs=parseWorkerSpecs,exports.workerEnv=workerEnv,exports.workerBackoff=workerBackoff,exports.respawnDelay=respawnDelay,exports.workerExitVerdict=workerExitVerdict,exports.spanOf=spanOf,exports.crashLines=crashLines,exports.buildWorkerStartedEvent=buildWorkerStartedEvent,exports.buildWorkerUpEvent=buildWorkerUpEvent,exports.buildWorkerCrashedEvent=buildWorkerCrashedEvent,exports.buildWorkerExitedEvent=buildWorkerExitedEvent,exports.buildWorkerStoppedEvent=buildWorkerStoppedEvent;const exit_reason_1=require("./exit-reason"),child_process_env_1=require("./child-process-env"),NAME_RE=/^[\w.-]+$/,ENV_KEY_RE=/^[A-Za-z_][A-Za-z0-9_]*$/;function serializeWorkerSpecs(r){return JSON.stringify(r.map(e=>({name:e.name,...e.env&&typeof e.env=="object"?{env:e.env}:{},...e.port!==void 0?{port:e.port}:{}})))}a(serializeWorkerSpecs,"serializeWorkerSpecs"),i(serializeWorkerSpecs,"serializeWorkerSpecs");function parseWorkerSpecs(r){const e=[];let t;try{t=JSON.parse(r||"[]")}catch{return{specs:[],problems:[`WORKERS is not JSON: ${String(r).slice(0,80)}`]}}if(!Array.isArray(t))return{specs:[],problems:["WORKERS is not a list"]};const n=[];for(const s of t){const o=typeof s=="string"?{name:s}:s,p=typeof o?.name=="string"?o.name:"";if(!NAME_RE.test(p)){e.push(`worker ${JSON.stringify(o?.name??s)} is not a plain file name \u2014 not started`);continue}if(n.some(d=>d.name===p)){e.push(`worker "${p}" is declared twice \u2014 started once`);continue}const c={};for(const[d,l]of Object.entries(o?.env&&typeof o.env=="object"?o.env:{})){if(!ENV_KEY_RE.test(d)){e.push(`worker "${p}": env ${JSON.stringify(d)} is not a variable name \u2014 left out`);continue}typeof l=="string"||typeof l=="number"||typeof l=="boolean"?c[d]=String(l):e.push(`worker "${p}": env ${d} is not a string, number or boolean \u2014 left out`)}let u=0;o?.port!==void 0&&(Number.isInteger(o.port)&&o.port>=0&&o.port<=65535?u=o.port:e.push(`worker "${p}": port ${JSON.stringify(o.port)} is not a port \u2014 it gets 0 (a free one)`)),n.push({name:p,env:c,port:u})}return{specs:n,problems:e}}a(parseWorkerSpecs,"parseWorkerSpecs"),i(parseWorkerSpecs,"parseWorkerSpecs");function workerEnv(r,e){const t={...r,PORT:String(e.port),...e.env,LENSMCP_WORKER:e.name};return delete t.WORKERS,(0,child_process_env_1.childProcessEnv)(t)}a(workerEnv,"workerEnv"),i(workerEnv,"workerEnv"),exports.CRASH_LOOP_AFTER=3;function envMs(r,e,t){const n=Number(r[e]);return r[e]!==void 0&&r[e]!==""&&Number.isFinite(n)&&n>=0?Math.floor(n):t}a(envMs,"envMs"),i(envMs,"envMs"),exports.MIN_RESPAWN_MS=100;function workerBackoff(r=process.env){const e=Math.max(exports.MIN_RESPAWN_MS,envMs(r,"LENSMCP_WORKER_BACKOFF_MS",1e3));return{baseMs:e,maxMs:Math.max(e,envMs(r,"LENSMCP_WORKER_BACKOFF_MAX_MS",6e4)),stableMs:envMs(r,"LENSMCP_WORKER_STABLE_MS",3e4)}}a(workerBackoff,"workerBackoff"),i(workerBackoff,"workerBackoff");function respawnDelay(r,e){const t=Math.max(1,Math.floor(r));return Math.min(e.maxMs,e.baseMs*2**Math.min(t-1,30))}a(respawnDelay,"respawnDelay"),i(respawnDelay,"respawnDelay");function workerExitVerdict(r,e,t){return t?{kind:"stopped"}:r===0&&!e?{kind:"exited"}:{kind:"crashed",external:e==="SIGTERM"||e==="SIGINT"||e==="SIGHUP"}}a(workerExitVerdict,"workerExitVerdict"),i(workerExitVerdict,"workerExitVerdict");function spanOf(r){return r<1e4?`${Math.round(r/100)/10} s`:r<12e4?`${Math.round(r/1e3)} s`:`${Math.round(r/6e4)} min`}a(spanOf,"spanOf"),i(spanOf,"spanOf"),exports.CRASH_LINES=12;const STACK_FRAMES=3,ANSI_SGR=/\x1b\[[0-9;]*m/g;function crashLines(r,e=exports.CRASH_LINES){const t=[];let n=0,s=0;const o=i(()=>{s&&t.push(` \u2026 ${s} more frame${s===1?"":"s"}`),s=0},"fold");for(const p of r){const c=p.replace(ANSI_SGR,"");if(/^\s+at\s/.test(c)){if(n+=1,n>STACK_FRAMES){s+=1;continue}}else o(),n=0;t.push(c)}return o(),t.slice(-e)}a(crashLines,"crashLines"),i(crashLines,"crashLines");let idCounter=0;function makeId(){return idCounter=(idCounter+1)%65535,`${Date.now().toString(36)}${idCounter.toString(36)}${Math.random().toString(36).slice(2,8)}`}a(makeId,"makeId"),i(makeId,"makeId");function envelope(r,e,t,n,s,o,p,c){const u="pending";return{id:p(),sessionId:u,timestamp:o,source:"gateway",category:"cluster",severity:t,context:{sessionId:u,projectName:r.project},fingerprint:`cluster-${e}:${r.service}`,title:n,...c?{message:c}:{},raw:{kind:e,project:r.project,service:r.service,worker:r.worker,pid:r.pid,podGeneration:r.podGeneration,...s}}}a(envelope,"envelope"),i(envelope,"envelope");function buildWorkerStartedEvent(r,e,t=Date.now(),n=makeId){const s=e.why==="respawn"?`started again (restart ${e.restarts})`:e.why==="reload"?"started on the new build":"started";return envelope(r,"worker-started","info",`${r.service} worker ${r.worker} ${s} \u2014 pid ${r.pid}`,{why:e.why,port:e.port,restarts:e.restarts},t,n)}a(buildWorkerStartedEvent,"buildWorkerStartedEvent"),i(buildWorkerStartedEvent,"buildWorkerStartedEvent");function buildWorkerUpEvent(r,e,t=Date.now(),n=makeId){return envelope(r,"worker-up","info",`${r.service} worker ${r.worker} is up again \u2014 ${spanOf(e.ranMs)} without a crash, after ${e.afterCrashes} in a row`,{ranMs:e.ranMs,afterCrashes:e.afterCrashes},t,n)}a(buildWorkerUpEvent,"buildWorkerUpEvent"),i(buildWorkerUpEvent,"buildWorkerUpEvent");function buildWorkerCrashedEvent(r,e,t=Date.now(),n=makeId){const s=e.crashes>=exports.CRASH_LOOP_AFTER,o=e.signal?e.signal:`exit ${e.code}`,p=s?`${r.service} worker ${r.worker} is crash-looping \u2014 ${e.crashes} crashes in a row (${o}); next start in ${spanOf(e.nextInMs)}`:`${r.service} worker ${r.worker} crashed (${o}${e.external?", a signal from outside its devserver":""}) after ${spanOf(e.ranMs)} \u2014 starting it again in ${spanOf(e.nextInMs)}`,c=e.external?`stopped by ${e.signal} from outside its devserver (\`kill\`, Activity Monitor)`:(0,exit_reason_1.describeExit)(e.code,e.signal),u=crashLines(e.lines);return envelope(r,"worker-crashed","error",p,{exitCode:e.code,signal:e.signal,ranMs:e.ranMs,crashes:e.crashes,restarts:e.restarts,nextInMs:e.nextInMs,crashLooping:s,external:e.external,...c?{reading:c}:{},lines:u},t,n,u.length?u.join(`
|
|
2
|
+
`):void 0)}a(buildWorkerCrashedEvent,"buildWorkerCrashedEvent"),i(buildWorkerCrashedEvent,"buildWorkerCrashedEvent");function buildWorkerExitedEvent(r,e,t=Date.now(),n=makeId){const s=e.reason??`it ended on its own (code 0) after ${spanOf(e.ranMs)}`;return envelope(r,"worker-exited","warning",`${r.service} worker ${r.worker} is not running \u2014 ${s}; not started again until the next build`,{ranMs:e.ranMs,...e.reason?{reason:e.reason}:{}},t,n)}a(buildWorkerExitedEvent,"buildWorkerExitedEvent"),i(buildWorkerExitedEvent,"buildWorkerExitedEvent");function buildWorkerStoppedEvent(r,e,t=Date.now(),n=makeId){return envelope(r,"worker-stopped","info",`${r.service} worker ${r.worker} stopped \u2014 ${e.reason}`,{reason:e.reason},t,n)}a(buildWorkerStoppedEvent,"buildWorkerStoppedEvent"),i(buildWorkerStoppedEvent,"buildWorkerStoppedEvent");
|
package/workspace-paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var x=Object.defineProperty;var f=(s,e)=>x(s,"name",{value:e,configurable:!0});var h=Object.defineProperty,u=f((s,e)=>h(s,"name",{value:e,configurable:!0}),"u");Object.defineProperty(exports,"__esModule",{value:!0}),exports.WorkspacePathsResolverPlugin=void 0,exports.readWorkspacePaths=readWorkspacePaths,exports.hasPathMappings=hasPathMappings,exports.workspacePathCandidates=workspacePathCandidates;const tslib_1=require("tslib"),fs=tslib_1.__importStar(require("node:fs")),node_module_1=require("node:module"),path=tslib_1.__importStar(require("node:path"));function loadTypeScript(s){try{return(0,node_module_1.createRequire)(path.join(s,"package.json"))("typescript")}catch{return require("typescript")}}f(loadTypeScript,"loadTypeScript"),u(loadTypeScript,"loadTypeScript");function readWorkspacePaths(s,e){const i=path.resolve(e,s);if(!fs.existsSync(i))return null;try{const n=loadTypeScript(e),r=n.readJsonConfigFile(i,o=>n.sys.readFile(o)),a={...n.sys,readDirectory:u(()=>[],"readDirectory")},{options:t}=n.parseJsonSourceFileConfigFileContent(r,a,path.dirname(i),void 0,i),l=new Map,d=[];for(const[o,c]of Object.entries(t.paths??{})){if(!Array.isArray(c))continue;const p=o.indexOf("*");p===-1?l.set(o,c):o.indexOf("*",p+1)===-1&&d.push({key:o,prefix:o.slice(0,p),suffix:o.slice(p+1),targets:c})}return{configFiles:[i,...(r.extendedSourceFiles??[]).map(o=>path.resolve(o))],baseDir:t.baseUrl??t.pathsBasePath??path.dirname(i),...t.baseUrl?{baseUrl:t.baseUrl}:{},exact:l,patterns:d}}catch{return null}}f(readWorkspacePaths,"readWorkspacePaths"),u(readWorkspacePaths,"readWorkspacePaths");function hasPathMappings(s){return!!s&&(s.exact.size>0||s.patterns.length>0)}f(hasPathMappings,"hasPathMappings"),u(hasPathMappings,"hasPathMappings");function workspacePathCandidates(s,e){const i=[],n=s.exact.get(e);if(n)for(const r of n)i.push({file:path.resolve(s.baseDir,r),via:e});else{let r;for(const a of s.patterns)e.length<a.prefix.length+a.suffix.length||!e.startsWith(a.prefix)||!e.endsWith(a.suffix)||(!r||a.prefix.length>r.prefix.length)&&(r=a);if(r){const a=e.slice(r.prefix.length,e.length-r.suffix.length);for(const t of r.targets){const l=t.indexOf("*"),d=l===-1?t:t.slice(0,l)+a+t.slice(l+1);i.push({file:path.resolve(s.baseDir,d),via:r.key})}}}return s.baseUrl&&i.push({file:path.resolve(s.baseUrl,e),via:"baseUrl"}),i}f(workspacePathCandidates,"workspacePathCandidates"),u(workspacePathCandidates,"workspacePathCandidates");class WorkspacePathsResolverPlugin{static{f(this,"WorkspacePathsResolverPlugin")}static{u(this,"WorkspacePathsResolverPlugin")}constructor(e){this.paths=e}apply(e){const i=e.ensureHook("internal-resolve");e.getHook("normal-resolve").tapAsync("WorkspacePathsResolverPlugin",(n,r,a)=>{const t=n.request;if(!t||t.startsWith(".")||path.isAbsolute(t))return a();const l=workspacePathCandidates(this.paths,t);let d=0;const o=u(()=>{const c=l[d++];if(!c)return a();e.doResolve(i,{...n,request:c.file,fullySpecified:!1},`aliased with mapping '${c.via}' (tsconfig paths): '${t}' to '${c.file}'`,r,(p,g)=>{if(p)return a(p);if(g)return a(null,g);o()})},"attempt");o()})}}exports.WorkspacePathsResolverPlugin=WorkspacePathsResolverPlugin;
|