@lensmcp/nx-plugin 1.26.1 → 1.26.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -67,6 +67,12 @@ export declare function findMcpBundle(workspaceRoot: string): string | undefined
67
67
  * default :4321). Same shipping story as the MCP bundle.
68
68
  */
69
69
  export declare function findDashboardBundle(workspaceRoot: string): string | undefined;
70
+ /**
71
+ * Resolve the workspace-action runner bundle (`bundled/workspace-action-runner.js`) — the machine queue's and the
72
+ * Docker commands' entry. The gateway starts one process of it when it starts: the sweep of what dead Docker runs
73
+ * left (`--docker-sweep`, planning/docker § 5). Same shipping story as the MCP bundle.
74
+ */
75
+ export declare function findActionRunner(workspaceRoot: string): string | undefined;
70
76
  export declare function findCaptureRunner(workspaceRoot: string): string | undefined;
71
77
  /**
72
78
  * Resolve the standalone browser-event bridge runner — the self-contained
package/lens-frontend.js CHANGED
@@ -1 +1 @@
1
- "use strict";var S=Object.defineProperty;var i=(e,n)=>S(e,"name",{value:n,configurable:!0});var h=Object.defineProperty,r=i((e,n)=>h(e,"name",{value:n,configurable:!0}),"r"),b=Object.defineProperty,s=r((e,n)=>b(e,"name",{value:n,configurable:!0}),"s");Object.defineProperty(exports,"__esModule",{value:!0}),exports.spawnLensFrontend=spawnLensFrontend,exports.locateBin=locateBin,exports.resolveFirstExisting=resolveFirstExisting,exports.globalNodeModules=globalNodeModules,exports.findMcpBundle=findMcpBundle,exports.findDashboardBundle=findDashboardBundle,exports.findCaptureRunner=findCaptureRunner,exports.findBridgeBundle=findBridgeBundle,exports.clusterPageHosts=clusterPageHosts,exports.withBridgeAllowedOrigins=withBridgeAllowedOrigins,exports.lensmcpJsonProblem=lensmcpJsonProblem,exports.lensmcpServices=lensmcpServices,exports.declFor=declFor,exports.readClusterPageDecls=readClusterPageDecls,exports.standaloneBridgeOrigins=standaloneBridgeOrigins;const node_child_process_1=require("node:child_process"),node_fs_1=require("node:fs"),node_path_1=require("node:path"),lens_store_1=require("./lens-store");function spawnLensFrontend(e,n){const t=e.log??(f=>console.log(f)),{projectRoot:o,workspaceRoot:c,eventFile:p}=e,l=e.chrome!==!1,g=e.headless!==!1,a=e.viteBin??locateBin("vite",[o,c]);if(!a)throw new Error("[lens] Could not find the vite binary in node_modules/.bin.");const d=e.port??(l?5173:void 0),m=["--config",resolveFirstExisting(["vite.config.ts","vite.config.mts","vite.config.js","vite.config.mjs","vite.config.cts","vite.config.cjs"],o)??(0,node_path_1.join)(o,"vite.config.ts"),o];d!==void 0&&m.push("--port",String(d),"--strictPort");const v={LENSMCP_EVENT_FILE:p,...e.project?{LENSMCP_APP:e.project}:{},...e.viteEnv??{}},j=e.labelPrefix??"";t(`[lens] starting Vite for ${e.project??o}${d?` on :${d}`:""}`);const x=n(`${j}vite`,a,m,v),u=e.openUrl??(d?`http://localhost:${d}/`:void 0);if(l){const f=findCaptureRunner(c);f?u?(t(`[lens] starting browser capture \u2192 ${u}`),n(`${j}browser-capture`,process.execPath,[f],{...v,LENSMCP_DEV_URL:u,LENSMCP_TOKENS_FILE:(0,node_path_1.join)(c,"lensmcp.tokens.json"),LENSMCP_RULES_FILE:(0,node_path_1.join)(c,"lensmcp.rules.json"),LENSMCP_HEADLESS:g===!1?"false":"true"},!0,{delayMs:1e4,max:5})):t("[lens] no dev URL/port resolved \u2014 skipping live capture."):t("[lens] browser-capture runner not found \u2014 skipping live capture. Install the self-contained CLI: `npm i -D lensmcp` (it ships `bundled/capture-runner.js`).")}return{...d!==void 0?{devPort:d}:{},...u?{devUrl:u}:{},vite:x}}i(spawnLensFrontend,"spawnLensFrontend"),r(spawnLensFrontend,"spawnLensFrontend"),s(spawnLensFrontend,"spawnLensFrontend");function locateBin(e,n){for(const t of n){const o=(0,node_path_1.join)(t,"node_modules",".bin",e);if((0,node_fs_1.existsSync)(o))return o}}i(locateBin,"locateBin"),r(locateBin,"locateBin"),s(locateBin,"locateBin");function resolveFirstExisting(e,n){for(const t of e){const o=(0,node_path_1.join)(n,t);if((0,node_fs_1.existsSync)(o))return o}}i(resolveFirstExisting,"resolveFirstExisting"),r(resolveFirstExisting,"resolveFirstExisting"),s(resolveFirstExisting,"resolveFirstExisting");let cachedGlobalRoot;function globalNodeModules(){if(cachedGlobalRoot!==void 0)return cachedGlobalRoot??void 0;const e=(0,node_path_1.resolve)((0,node_path_1.dirname)(process.execPath),"..","lib","node_modules");if((0,node_fs_1.existsSync)(e))return cachedGlobalRoot=e,e;try{const n=(0,node_child_process_1.execSync)("npm root -g",{encoding:"utf8",timeout:5e3}).trim();cachedGlobalRoot=n&&(0,node_fs_1.existsSync)(n)?n:null}catch{cachedGlobalRoot=null}return cachedGlobalRoot??void 0}i(globalNodeModules,"globalNodeModules"),r(globalNodeModules,"globalNodeModules"),s(globalNodeModules,"globalNodeModules");function lensmcpPackages(e){return(0,lens_store_1.storeFirst)((0,node_path_1.join)(e,"node_modules","lensmcp"))}i(lensmcpPackages,"lensmcpPackages"),r(lensmcpPackages,"lensmcpPackages"),s(lensmcpPackages,"lensmcpPackages");function findMcpBundle(e){const n=globalNodeModules();return firstExisting([...lensmcpPackages(e).map(t=>(0,node_path_1.join)(t,"bundled","main.js")),...n?[(0,node_path_1.join)(n,"lensmcp","bundled","main.js")]:[],(0,node_path_1.join)(e,"servers","lensmcp-mcp","dist","main.js")])}i(findMcpBundle,"findMcpBundle"),r(findMcpBundle,"findMcpBundle"),s(findMcpBundle,"findMcpBundle");function findDashboardBundle(e){const n=globalNodeModules();return firstExisting([...lensmcpPackages(e).map(t=>(0,node_path_1.join)(t,"bundled","dashboard.js")),...n?[(0,node_path_1.join)(n,"lensmcp","bundled","dashboard.js")]:[],(0,node_path_1.join)(e,"servers","lensmcp-mcp","dist","dashboard.js")])}i(findDashboardBundle,"findDashboardBundle"),r(findDashboardBundle,"findDashboardBundle"),s(findDashboardBundle,"findDashboardBundle");function findCaptureRunner(e){const n=globalNodeModules();return firstExisting([...lensmcpPackages(e).map(t=>(0,node_path_1.join)(t,"bundled","capture-runner.js")),...n?[(0,node_path_1.join)(n,"lensmcp","bundled","capture-runner.js")]:[],(0,node_path_1.join)(e,"libs","browser-capture","dist","capture-runner.js")])}i(findCaptureRunner,"findCaptureRunner"),r(findCaptureRunner,"findCaptureRunner"),s(findCaptureRunner,"findCaptureRunner");function findBridgeBundle(e){const n=globalNodeModules();return firstExisting([...lensmcpPackages(e).map(t=>(0,node_path_1.join)(t,"bundled","bridge.js")),...n?[(0,node_path_1.join)(n,"lensmcp","bundled","bridge.js")]:[],(0,node_path_1.join)(e,"libs","bridge","dist","main.js")])}i(findBridgeBundle,"findBridgeBundle"),r(findBridgeBundle,"findBridgeBundle"),s(findBridgeBundle,"findBridgeBundle");function firstExisting(e){for(const n of e)if((0,node_fs_1.existsSync)(n))return n}i(firstExisting,"firstExisting"),r(firstExisting,"firstExisting"),s(firstExisting,"firstExisting");function clusterPageHosts(e){const n=new Set;for(const t of e){if(t.service||typeof t.host!="string")continue;const o=t.host.trim().toLowerCase();o&&n.add(o.startsWith("*.")?o.slice(1):o)}return[...n]}i(clusterPageHosts,"clusterPageHosts"),r(clusterPageHosts,"clusterPageHosts"),s(clusterPageHosts,"clusterPageHosts");function withBridgeAllowedOrigins(e,n){const t=[...new Set([...(e??"").split(/[\s,]+/).filter(Boolean),...n])];return t.length>0?t.join(","):void 0}i(withBridgeAllowedOrigins,"withBridgeAllowedOrigins"),r(withBridgeAllowedOrigins,"withBridgeAllowedOrigins"),s(withBridgeAllowedOrigins,"withBridgeAllowedOrigins");function lensmcpJsonProblem(e){const n=(0,node_path_1.join)(e,"lensmcp.json");let t;try{t=(0,node_fs_1.readFileSync)(n,"utf8")}catch{return}try{const o=JSON.parse(t);return o&&typeof o=="object"&&!Array.isArray(o)?void 0:`${n} is not a JSON object \u2014 fix it, or remove it`}catch(o){return`${n} is not valid JSON (${o instanceof Error?o.message:String(o)}) \u2014 fix it, or remove it`}}i(lensmcpJsonProblem,"lensmcpJsonProblem"),r(lensmcpJsonProblem,"lensmcpJsonProblem"),s(lensmcpJsonProblem,"lensmcpJsonProblem");function lensmcpServices(e){try{const n=JSON.parse((0,node_fs_1.readFileSync)((0,node_path_1.join)(e,"lensmcp.json"),"utf8")).services;return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}catch{return{}}}i(lensmcpServices,"lensmcpServices"),r(lensmcpServices,"lensmcpServices"),s(lensmcpServices,"lensmcpServices");function declFor(e,n,t){const o=n===void 0?void 0:e[n];if(o!==!1)return o&&typeof o=="object"&&!Array.isArray(o)?o:t?.cluster??t?.davnx}i(declFor,"declFor"),r(declFor,"declFor"),s(declFor,"declFor");function readClusterPageDecls(e,n){const t=lensmcpServices(e),o=[];for(const c of n){const p=typeof c=="string"?c:c.root;let l;try{l=JSON.parse((0,node_fs_1.readFileSync)((0,node_path_1.join)(e,p,"project.json"),"utf8"))}catch{l=void 0}const g=typeof c=="string"?typeof l?.name=="string"&&l.name?l.name:(0,node_path_1.basename)((0,node_path_1.resolve)(e,p)):c.name,a=declFor(t,g,l);a&&typeof a=="object"&&o.push(a)}return o}i(readClusterPageDecls,"readClusterPageDecls"),r(readClusterPageDecls,"readClusterPageDecls"),s(readClusterPageDecls,"readClusterPageDecls");function standaloneBridgeOrigins(e,n,t=process.env){const o=clusterPageHosts(readClusterPageDecls(e,n)),c=withBridgeAllowedOrigins(t.LENSMCP_BRIDGE_ALLOWED_ORIGINS,o);return c?{hosts:o,allowedOrigins:c}:{hosts:o}}i(standaloneBridgeOrigins,"standaloneBridgeOrigins"),r(standaloneBridgeOrigins,"standaloneBridgeOrigins"),s(standaloneBridgeOrigins,"standaloneBridgeOrigins");
1
+ "use strict";var S=Object.defineProperty;var i=(e,n)=>S(e,"name",{value:n,configurable:!0});var h=Object.defineProperty,r=i((e,n)=>h(e,"name",{value:n,configurable:!0}),"r"),b=Object.defineProperty,s=r((e,n)=>b(e,"name",{value:n,configurable:!0}),"s");Object.defineProperty(exports,"__esModule",{value:!0}),exports.spawnLensFrontend=spawnLensFrontend,exports.locateBin=locateBin,exports.resolveFirstExisting=resolveFirstExisting,exports.globalNodeModules=globalNodeModules,exports.findMcpBundle=findMcpBundle,exports.findDashboardBundle=findDashboardBundle,exports.findActionRunner=findActionRunner,exports.findCaptureRunner=findCaptureRunner,exports.findBridgeBundle=findBridgeBundle,exports.clusterPageHosts=clusterPageHosts,exports.withBridgeAllowedOrigins=withBridgeAllowedOrigins,exports.lensmcpJsonProblem=lensmcpJsonProblem,exports.lensmcpServices=lensmcpServices,exports.declFor=declFor,exports.readClusterPageDecls=readClusterPageDecls,exports.standaloneBridgeOrigins=standaloneBridgeOrigins;const node_child_process_1=require("node:child_process"),node_fs_1=require("node:fs"),node_path_1=require("node:path"),lens_store_1=require("./lens-store");function spawnLensFrontend(e,n){const t=e.log??(f=>console.log(f)),{projectRoot:o,workspaceRoot:c,eventFile:p}=e,l=e.chrome!==!1,g=e.headless!==!1,a=e.viteBin??locateBin("vite",[o,c]);if(!a)throw new Error("[lens] Could not find the vite binary in node_modules/.bin.");const d=e.port??(l?5173:void 0),m=["--config",resolveFirstExisting(["vite.config.ts","vite.config.mts","vite.config.js","vite.config.mjs","vite.config.cts","vite.config.cjs"],o)??(0,node_path_1.join)(o,"vite.config.ts"),o];d!==void 0&&m.push("--port",String(d),"--strictPort");const j={LENSMCP_EVENT_FILE:p,...e.project?{LENSMCP_APP:e.project}:{},...e.viteEnv??{}},v=e.labelPrefix??"";t(`[lens] starting Vite for ${e.project??o}${d?` on :${d}`:""}`);const x=n(`${v}vite`,a,m,j),u=e.openUrl??(d?`http://localhost:${d}/`:void 0);if(l){const f=findCaptureRunner(c);f?u?(t(`[lens] starting browser capture \u2192 ${u}`),n(`${v}browser-capture`,process.execPath,[f],{...j,LENSMCP_DEV_URL:u,LENSMCP_TOKENS_FILE:(0,node_path_1.join)(c,"lensmcp.tokens.json"),LENSMCP_RULES_FILE:(0,node_path_1.join)(c,"lensmcp.rules.json"),LENSMCP_HEADLESS:g===!1?"false":"true"},!0,{delayMs:1e4,max:5})):t("[lens] no dev URL/port resolved \u2014 skipping live capture."):t("[lens] browser-capture runner not found \u2014 skipping live capture. Install the self-contained CLI: `npm i -D lensmcp` (it ships `bundled/capture-runner.js`).")}return{...d!==void 0?{devPort:d}:{},...u?{devUrl:u}:{},vite:x}}i(spawnLensFrontend,"spawnLensFrontend"),r(spawnLensFrontend,"spawnLensFrontend"),s(spawnLensFrontend,"spawnLensFrontend");function locateBin(e,n){for(const t of n){const o=(0,node_path_1.join)(t,"node_modules",".bin",e);if((0,node_fs_1.existsSync)(o))return o}}i(locateBin,"locateBin"),r(locateBin,"locateBin"),s(locateBin,"locateBin");function resolveFirstExisting(e,n){for(const t of e){const o=(0,node_path_1.join)(n,t);if((0,node_fs_1.existsSync)(o))return o}}i(resolveFirstExisting,"resolveFirstExisting"),r(resolveFirstExisting,"resolveFirstExisting"),s(resolveFirstExisting,"resolveFirstExisting");let cachedGlobalRoot;function globalNodeModules(){if(cachedGlobalRoot!==void 0)return cachedGlobalRoot??void 0;const e=(0,node_path_1.resolve)((0,node_path_1.dirname)(process.execPath),"..","lib","node_modules");if((0,node_fs_1.existsSync)(e))return cachedGlobalRoot=e,e;try{const n=(0,node_child_process_1.execSync)("npm root -g",{encoding:"utf8",timeout:5e3}).trim();cachedGlobalRoot=n&&(0,node_fs_1.existsSync)(n)?n:null}catch{cachedGlobalRoot=null}return cachedGlobalRoot??void 0}i(globalNodeModules,"globalNodeModules"),r(globalNodeModules,"globalNodeModules"),s(globalNodeModules,"globalNodeModules");function lensmcpPackages(e){return(0,lens_store_1.storeFirst)((0,node_path_1.join)(e,"node_modules","lensmcp"))}i(lensmcpPackages,"lensmcpPackages"),r(lensmcpPackages,"lensmcpPackages"),s(lensmcpPackages,"lensmcpPackages");function findMcpBundle(e){const n=globalNodeModules();return firstExisting([...lensmcpPackages(e).map(t=>(0,node_path_1.join)(t,"bundled","main.js")),...n?[(0,node_path_1.join)(n,"lensmcp","bundled","main.js")]:[],(0,node_path_1.join)(e,"servers","lensmcp-mcp","dist","main.js")])}i(findMcpBundle,"findMcpBundle"),r(findMcpBundle,"findMcpBundle"),s(findMcpBundle,"findMcpBundle");function findDashboardBundle(e){const n=globalNodeModules();return firstExisting([...lensmcpPackages(e).map(t=>(0,node_path_1.join)(t,"bundled","dashboard.js")),...n?[(0,node_path_1.join)(n,"lensmcp","bundled","dashboard.js")]:[],(0,node_path_1.join)(e,"servers","lensmcp-mcp","dist","dashboard.js")])}i(findDashboardBundle,"findDashboardBundle"),r(findDashboardBundle,"findDashboardBundle"),s(findDashboardBundle,"findDashboardBundle");function findActionRunner(e){const n=globalNodeModules();return firstExisting([...lensmcpPackages(e).map(t=>(0,node_path_1.join)(t,"bundled","workspace-action-runner.js")),...n?[(0,node_path_1.join)(n,"lensmcp","bundled","workspace-action-runner.js")]:[],(0,node_path_1.join)(e,"servers","lensmcp-mcp","dist","workspace-action-runner.js")])}i(findActionRunner,"findActionRunner"),r(findActionRunner,"findActionRunner"),s(findActionRunner,"findActionRunner");function findCaptureRunner(e){const n=globalNodeModules();return firstExisting([...lensmcpPackages(e).map(t=>(0,node_path_1.join)(t,"bundled","capture-runner.js")),...n?[(0,node_path_1.join)(n,"lensmcp","bundled","capture-runner.js")]:[],(0,node_path_1.join)(e,"libs","browser-capture","dist","capture-runner.js")])}i(findCaptureRunner,"findCaptureRunner"),r(findCaptureRunner,"findCaptureRunner"),s(findCaptureRunner,"findCaptureRunner");function findBridgeBundle(e){const n=globalNodeModules();return firstExisting([...lensmcpPackages(e).map(t=>(0,node_path_1.join)(t,"bundled","bridge.js")),...n?[(0,node_path_1.join)(n,"lensmcp","bundled","bridge.js")]:[],(0,node_path_1.join)(e,"libs","bridge","dist","main.js")])}i(findBridgeBundle,"findBridgeBundle"),r(findBridgeBundle,"findBridgeBundle"),s(findBridgeBundle,"findBridgeBundle");function firstExisting(e){for(const n of e)if((0,node_fs_1.existsSync)(n))return n}i(firstExisting,"firstExisting"),r(firstExisting,"firstExisting"),s(firstExisting,"firstExisting");function clusterPageHosts(e){const n=new Set;for(const t of e){if(t.service||typeof t.host!="string")continue;const o=t.host.trim().toLowerCase();o&&n.add(o.startsWith("*.")?o.slice(1):o)}return[...n]}i(clusterPageHosts,"clusterPageHosts"),r(clusterPageHosts,"clusterPageHosts"),s(clusterPageHosts,"clusterPageHosts");function withBridgeAllowedOrigins(e,n){const t=[...new Set([...(e??"").split(/[\s,]+/).filter(Boolean),...n])];return t.length>0?t.join(","):void 0}i(withBridgeAllowedOrigins,"withBridgeAllowedOrigins"),r(withBridgeAllowedOrigins,"withBridgeAllowedOrigins"),s(withBridgeAllowedOrigins,"withBridgeAllowedOrigins");function lensmcpJsonProblem(e){const n=(0,node_path_1.join)(e,"lensmcp.json");let t;try{t=(0,node_fs_1.readFileSync)(n,"utf8")}catch{return}try{const o=JSON.parse(t);return o&&typeof o=="object"&&!Array.isArray(o)?void 0:`${n} is not a JSON object \u2014 fix it, or remove it`}catch(o){return`${n} is not valid JSON (${o instanceof Error?o.message:String(o)}) \u2014 fix it, or remove it`}}i(lensmcpJsonProblem,"lensmcpJsonProblem"),r(lensmcpJsonProblem,"lensmcpJsonProblem"),s(lensmcpJsonProblem,"lensmcpJsonProblem");function lensmcpServices(e){try{const n=JSON.parse((0,node_fs_1.readFileSync)((0,node_path_1.join)(e,"lensmcp.json"),"utf8")).services;return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}catch{return{}}}i(lensmcpServices,"lensmcpServices"),r(lensmcpServices,"lensmcpServices"),s(lensmcpServices,"lensmcpServices");function declFor(e,n,t){const o=n===void 0?void 0:e[n];if(o!==!1)return o&&typeof o=="object"&&!Array.isArray(o)?o:t?.cluster??t?.davnx}i(declFor,"declFor"),r(declFor,"declFor"),s(declFor,"declFor");function readClusterPageDecls(e,n){const t=lensmcpServices(e),o=[];for(const c of n){const p=typeof c=="string"?c:c.root;let l;try{l=JSON.parse((0,node_fs_1.readFileSync)((0,node_path_1.join)(e,p,"project.json"),"utf8"))}catch{l=void 0}const g=typeof c=="string"?typeof l?.name=="string"&&l.name?l.name:(0,node_path_1.basename)((0,node_path_1.resolve)(e,p)):c.name,a=declFor(t,g,l);a&&typeof a=="object"&&o.push(a)}return o}i(readClusterPageDecls,"readClusterPageDecls"),r(readClusterPageDecls,"readClusterPageDecls"),s(readClusterPageDecls,"readClusterPageDecls");function standaloneBridgeOrigins(e,n,t=process.env){const o=clusterPageHosts(readClusterPageDecls(e,n)),c=withBridgeAllowedOrigins(t.LENSMCP_BRIDGE_ALLOWED_ORIGINS,o);return c?{hosts:o,allowedOrigins:c}:{hosts:o}}i(standaloneBridgeOrigins,"standaloneBridgeOrigins"),r(standaloneBridgeOrigins,"standaloneBridgeOrigins"),s(standaloneBridgeOrigins,"standaloneBridgeOrigins");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/nx-plugin",
3
- "version": "1.26.1",
3
+ "version": "1.26.3",
4
4
  "main": "./index.js",
5
5
  "module": "./index.js",
6
6
  "types": "./index.d.ts",