lensmcp 1.0.0 → 1.2.0

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.
@@ -4,7 +4,7 @@ var __export = (target, all) => {
4
4
  __defProp(target, name, { get: all[name], enumerable: true });
5
5
  };
6
6
 
7
- // servers/lensai-mcp/dist/dashboard.js
7
+ // servers/lensmcp-mcp/dist/dashboard.js
8
8
  import "reflect-metadata";
9
9
  import { readdirSync, readFileSync as readFileSync2 } from "node:fs";
10
10
  import { createServer as createServer2 } from "node:http";
@@ -15915,11 +15915,11 @@ var AgentSessionSchema = ResourceEnvelopeSchema.extend({
15915
15915
  });
15916
15916
 
15917
15917
  // libs/protocol-types/dist/lib/tokens.js
15918
- var SessionToken = /* @__PURE__ */ Symbol.for("@lensai/session/Session");
15919
- var EventBusToken = /* @__PURE__ */ Symbol.for("@lensai/core/EventBus");
15920
- var GraphStoreToken = /* @__PURE__ */ Symbol.for("@lensai/core/GraphStore");
15921
- var ResourceStoreToken = /* @__PURE__ */ Symbol.for("@lensai/core/ResourceStore");
15922
- var StorageToken = /* @__PURE__ */ Symbol.for("@lensai/storage/Storage");
15918
+ var SessionToken = /* @__PURE__ */ Symbol.for("@lensmcp/session/Session");
15919
+ var EventBusToken = /* @__PURE__ */ Symbol.for("@lensmcp/core/EventBus");
15920
+ var GraphStoreToken = /* @__PURE__ */ Symbol.for("@lensmcp/core/GraphStore");
15921
+ var ResourceStoreToken = /* @__PURE__ */ Symbol.for("@lensmcp/core/ResourceStore");
15922
+ var StorageToken = /* @__PURE__ */ Symbol.for("@lensmcp/storage/Storage");
15923
15923
 
15924
15924
  // libs/session/dist/lib/providers.js
15925
15925
  var activeSession;
@@ -15928,21 +15928,21 @@ function setActiveSession(session2) {
15928
15928
  }
15929
15929
  function requireSession() {
15930
15930
  if (!activeSession) {
15931
- throw new Error("No LensAI session is active. Did you call bootstrapLensai() before the FrontMCP container started?");
15931
+ throw new Error("No LensMCP session is active. Did you call bootstrapLensmcp() before the FrontMCP container started?");
15932
15932
  }
15933
15933
  return activeSession;
15934
15934
  }
15935
15935
  var SessionProvider = AsyncProvider({
15936
15936
  provide: SessionToken,
15937
- name: "LensaiSession",
15938
- description: "The active LensAI Session instance.",
15937
+ name: "LensmcpSession",
15938
+ description: "The active LensMCP Session instance.",
15939
15939
  scope: ProviderScope.GLOBAL,
15940
15940
  inject: () => [],
15941
15941
  useFactory: () => requireSession()
15942
15942
  });
15943
15943
  var EventBusProvider = AsyncProvider({
15944
15944
  provide: EventBusToken,
15945
- name: "LensaiEventBus",
15945
+ name: "LensmcpEventBus",
15946
15946
  description: "The session's normalised event bus.",
15947
15947
  scope: ProviderScope.GLOBAL,
15948
15948
  inject: () => [],
@@ -15950,7 +15950,7 @@ var EventBusProvider = AsyncProvider({
15950
15950
  });
15951
15951
  var GraphStoreProvider = AsyncProvider({
15952
15952
  provide: GraphStoreToken,
15953
- name: "LensaiGraphStore",
15953
+ name: "LensmcpGraphStore",
15954
15954
  description: "The typed multi-axis trace graph.",
15955
15955
  scope: ProviderScope.GLOBAL,
15956
15956
  inject: () => [],
@@ -15958,7 +15958,7 @@ var GraphStoreProvider = AsyncProvider({
15958
15958
  });
15959
15959
  var ResourceStoreProvider = AsyncProvider({
15960
15960
  provide: ResourceStoreToken,
15961
- name: "LensaiResourceStore",
15961
+ name: "LensmcpResourceStore",
15962
15962
  description: "Registry of agent-readable MCP resources.",
15963
15963
  scope: ProviderScope.GLOBAL,
15964
15964
  inject: () => [],
@@ -15966,13 +15966,13 @@ var ResourceStoreProvider = AsyncProvider({
15966
15966
  });
15967
15967
  var StorageProvider = AsyncProvider({
15968
15968
  provide: StorageToken,
15969
- name: "LensaiStorage",
15969
+ name: "LensmcpStorage",
15970
15970
  description: "Hot-tier storage backend (in-memory ring buffer by default).",
15971
15971
  scope: ProviderScope.GLOBAL,
15972
15972
  inject: () => [],
15973
15973
  useFactory: () => requireSession().storage
15974
15974
  });
15975
- var lensaiProviderArray = [
15975
+ var lensmcpProviderArray = [
15976
15976
  SessionProvider,
15977
15977
  EventBusProvider,
15978
15978
  GraphStoreProvider,
@@ -15981,11 +15981,11 @@ var lensaiProviderArray = [
15981
15981
  ];
15982
15982
 
15983
15983
  // libs/session/dist/lib/bootstrap.js
15984
- function bootstrapLensai(opts = {}) {
15984
+ function bootstrapLensmcp(opts = {}) {
15985
15985
  const session2 = new Session(opts);
15986
15986
  session2.start();
15987
15987
  setActiveSession(session2);
15988
- return { session: session2, providers: lensaiProviderArray };
15988
+ return { session: session2, providers: lensmcpProviderArray };
15989
15989
  }
15990
15990
 
15991
15991
  // libs/session/dist/lib/collectors/tsc-collector.js
@@ -16053,9 +16053,9 @@ function createUdsServer(opts) {
16053
16053
 
16054
16054
  // libs/session/dist/lib/ingest.js
16055
16055
  function startEventIngest(opts) {
16056
- const eventFile = opts.eventFile ?? process.env["LENSAI_EVENT_FILE"];
16057
- const socketPath = opts.socketPath ?? process.env["LENSAI_IPC_SOCKET"];
16058
- const udsPath = opts.udsPath ?? process.env["LENSAI_UDS"];
16056
+ const eventFile = opts.eventFile ?? process.env["LENSMCP_EVENT_FILE"];
16057
+ const socketPath = opts.socketPath ?? process.env["LENSMCP_IPC_SOCKET"];
16058
+ const udsPath = opts.udsPath ?? process.env["LENSMCP_UDS"];
16059
16059
  const onError = opts.onError ?? (() => void 0);
16060
16060
  let published = 0;
16061
16061
  const publish = (line) => {
@@ -16087,7 +16087,7 @@ function startEventIngest(opts) {
16087
16087
  let position = 0;
16088
16088
  let carry = "";
16089
16089
  let skipPartialFirstLine = false;
16090
- const replayBytes = opts.replayBytes ?? Number(process.env["LENSAI_REPLAY_BYTES"] ?? 4 * 1024 * 1024);
16090
+ const replayBytes = opts.replayBytes ?? Number(process.env["LENSMCP_REPLAY_BYTES"] ?? 4 * 1024 * 1024);
16091
16091
  if (existsSync2(eventFile)) {
16092
16092
  try {
16093
16093
  const size = statSync(eventFile).size;
@@ -16221,7 +16221,7 @@ function loadWorkspaceThresholds(cwd = process.cwd()) {
16221
16221
  return resolveThresholds();
16222
16222
  try {
16223
16223
  const nx = JSON.parse(readFileSync(nxPath, "utf8"));
16224
- return resolveThresholds(nx.lensai?.thresholds);
16224
+ return resolveThresholds(nx.lensmcp?.thresholds);
16225
16225
  } catch {
16226
16226
  return resolveThresholds();
16227
16227
  }
@@ -17971,7 +17971,7 @@ VisualRulesResource = __decorate([
17971
17971
  name: "visual-rules",
17972
17972
  uri: "visual://rules",
17973
17973
  mimeType: "application/json",
17974
- description: "All registered visual rules (builtins + lensai.rules.json + visual.register_rule)."
17974
+ description: "All registered visual rules (builtins + lensmcp.rules.json + visual.register_rule)."
17975
17975
  })
17976
17976
  ], VisualRulesResource);
17977
17977
  var rules_resource_default = VisualRulesResource;
@@ -17989,7 +17989,7 @@ VisualTokensResource = __decorate([
17989
17989
  name: "visual-tokens",
17990
17990
  uri: "visual://tokens",
17991
17991
  mimeType: "application/json",
17992
- description: "Resolved design tokens from lensai.tokens.json."
17992
+ description: "Resolved design tokens from lensmcp.tokens.json."
17993
17993
  })
17994
17994
  ], VisualTokensResource);
17995
17995
  var tokens_resource_default = VisualTokensResource;
@@ -18357,7 +18357,7 @@ ReactPagesCurrentResource = __decorate([
18357
18357
  name: "react-pages-current",
18358
18358
  uri: "react://pages/current",
18359
18359
  mimeType: "application/json",
18360
- description: "The most recently active React page (from <LensaiRoot>)."
18360
+ description: "The most recently active React page (from <LensmcpRoot>)."
18361
18361
  })
18362
18362
  ], ReactPagesCurrentResource);
18363
18363
  var pages_current_resource_default = ReactPagesCurrentResource;
@@ -18790,7 +18790,7 @@ ValtioStoresResource = __decorate([
18790
18790
  name: "valtio-stores",
18791
18791
  uri: "valtio://stores",
18792
18792
  mimeType: "application/json",
18793
- description: "Registered Valtio stores (created via lensai-wrapped proxy())."
18793
+ description: "Registered Valtio stores (created via lensmcp-wrapped proxy())."
18794
18794
  })
18795
18795
  ], ValtioStoresResource);
18796
18796
  var stores_resource_default = ValtioStoresResource;
@@ -19685,9 +19685,9 @@ function toOwnerView(o) {
19685
19685
  };
19686
19686
  }
19687
19687
 
19688
- // servers/lensai-mcp/dist/bootstrap.js
19688
+ // servers/lensmcp-mcp/dist/bootstrap.js
19689
19689
  function createLensSession() {
19690
- const { session: session2, providers } = bootstrapLensai();
19690
+ const { session: session2, providers } = bootstrapLensmcp();
19691
19691
  const thresholds = loadWorkspaceThresholds();
19692
19692
  installBuildReducer({ bus: session2.bus, resources: session2.resources });
19693
19693
  installLintReducer({ bus: session2.bus, resources: session2.resources });
@@ -19751,16 +19751,16 @@ function createLensSession() {
19751
19751
  });
19752
19752
  const ingest = startEventIngest({
19753
19753
  bus: session2.bus,
19754
- onError: (err) => console.error("[lensai] ingest error:", err)
19754
+ onError: (err) => console.error("[lensmcp] ingest error:", err)
19755
19755
  });
19756
19756
  if (ingest.mode !== "none") {
19757
- console.error(`[lensai] event ingest active (mode=${ingest.mode})`);
19757
+ console.error(`[lensmcp] event ingest active (mode=${ingest.mode})`);
19758
19758
  }
19759
19759
  session2.onShutdown({ name: "event-ingest", stop: () => ingest.stop() });
19760
19760
  return { session: session2, providers, ingest };
19761
19761
  }
19762
19762
 
19763
- // servers/lensai-mcp/dist/flow-shape.js
19763
+ // servers/lensmcp-mcp/dist/flow-shape.js
19764
19764
  function areaOf(event) {
19765
19765
  const { source, category, title, kind } = event;
19766
19766
  if (kind?.startsWith("memory") || kind === "db-query")
@@ -20129,9 +20129,9 @@ function buildFlowDetail(rawEvents) {
20129
20129
  return { events: rich };
20130
20130
  }
20131
20131
 
20132
- // servers/lensai-mcp/dist/dashboard.js
20132
+ // servers/lensmcp-mcp/dist/dashboard.js
20133
20133
  var { session } = createLensSession();
20134
- var PORT = Number(process.env["LENSAI_DASHBOARD_PORT"] ?? 4321);
20134
+ var PORT = Number(process.env["LENSMCP_DASHBOARD_PORT"] ?? 4321);
20135
20135
  async function snapshot2() {
20136
20136
  const uris = session.resources.list().sort();
20137
20137
  const resources = {};
@@ -20303,7 +20303,7 @@ function appendLog(event) {
20303
20303
  session.bus.subscribe(appendLog);
20304
20304
  (() => {
20305
20305
  try {
20306
- const file2 = process.env["LENSAI_EVENT_FILE"] ?? `${process.cwd()}/.lensai/events.jsonl`;
20306
+ const file2 = process.env["LENSMCP_EVENT_FILE"] ?? `${process.cwd()}/.lensmcp/events.jsonl`;
20307
20307
  const lines = readFileSync2(file2, "utf8").trim().split("\n").slice(-25e3);
20308
20308
  for (const line of lines) {
20309
20309
  try {
@@ -20328,7 +20328,7 @@ function discoverDecls() {
20328
20328
  const walk = (dir, depth) => {
20329
20329
  if (depth > 4)
20330
20330
  return;
20331
- let entries = [];
20331
+ let entries;
20332
20332
  try {
20333
20333
  entries = readdirSync(dir, { withFileTypes: true });
20334
20334
  } catch {
@@ -20493,7 +20493,7 @@ var server = createServer2((req, res) => {
20493
20493
  });
20494
20494
  server.listen(PORT, () => {
20495
20495
  const n = session.resources.list().length;
20496
- console.error(`[lensai] dashboard \u2192 http://localhost:${PORT} (${n} resources registered)`);
20496
+ console.error(`[lensmcp] dashboard \u2192 http://localhost:${PORT} (${n} resources registered)`);
20497
20497
  });
20498
20498
  function shutdown(signal) {
20499
20499
  server.close();
@@ -20503,7 +20503,7 @@ process.on("SIGINT", shutdown);
20503
20503
  process.on("SIGTERM", shutdown);
20504
20504
  var PAGE = `<!doctype html>
20505
20505
  <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
20506
- <title>LensAI lens</title>
20506
+ <title>LensMCP lens</title>
20507
20507
  <style>
20508
20508
  :root { color-scheme: dark; }
20509
20509
  * { box-sizing: border-box; }
@@ -20712,7 +20712,7 @@ var PAGE = `<!doctype html>
20712
20712
  <body>
20713
20713
  <header>
20714
20714
  <span class="dot off" id="dot"></span>
20715
- <strong>LensAI</strong><span class="muted">lens</span>
20715
+ <strong>LensMCP</strong><span class="muted">lens</span>
20716
20716
  <nav class="tabs" id="tabs">
20717
20717
  <a href="#/flows" data-view="flows">Flows</a>
20718
20718
  <a href="#/cluster" data-view="cluster">Cluster</a>
@@ -20813,9 +20813,9 @@ var PAGE = `<!doctype html>
20813
20813
  var evs = detail.events || [];
20814
20814
  // identical flow \u2192 keep the DOM (and any open detail box) untouched
20815
20815
  var sig = detail.flowId + ':' + evs.length + ':' + (evs.length ? evs[evs.length - 1].id : '');
20816
- if (window.__lensaiFlowSig === sig) return;
20817
- var sameFlow = String(window.__lensaiFlowSig || '').indexOf(detail.flowId + ':') === 0;
20818
- window.__lensaiFlowSig = sig;
20816
+ if (window.__lensmcpFlowSig === sig) return;
20817
+ var sameFlow = String(window.__lensmcpFlowSig || '').indexOf(detail.flowId + ':') === 0;
20818
+ window.__lensmcpFlowSig = sig;
20819
20819
  detailBox.style.display = detailBox.style.display === 'block' ? 'block' : 'none';
20820
20820
  meta.replaceChildren(
20821
20821
  el('span', null, detail.flowId),
@@ -20826,14 +20826,14 @@ var PAGE = `<!doctype html>
20826
20826
 
20827
20827
  // ReactFlow canvas (flow-app.js) renders the layer boxes + causal edges;
20828
20828
  // the SVG below stays as the no-asset fallback.
20829
- if (window.__lensaiRenderFlow) {
20829
+ if (window.__lensmcpRenderFlow) {
20830
20830
  document.getElementById('flow-root').style.display = 'block';
20831
20831
  scroll.style.display = 'none';
20832
20832
  var t0rf = evs.reduce(function (m, e) { return Math.min(m, e.start != null ? e.start : e.t); }, Infinity);
20833
20833
  stepState = { evs: evs, t0: t0rf, rf: true };
20834
- var keepIdxRf = sameFlow && window.__lensaiStepIdx != null && window.__lensaiStepIdx < evs.length
20835
- ? window.__lensaiStepIdx : 0;
20836
- window.__lensaiRenderFlow(detail, keepIdxRf);
20834
+ var keepIdxRf = sameFlow && window.__lensmcpStepIdx != null && window.__lensmcpStepIdx < evs.length
20835
+ ? window.__lensmcpStepIdx : 0;
20836
+ window.__lensmcpRenderFlow(detail, keepIdxRf);
20837
20837
  document.getElementById('step-panel').classList.add('active');
20838
20838
  detailBox.style.display = 'none';
20839
20839
  setStep(keepIdxRf, true);
@@ -20981,8 +20981,8 @@ var PAGE = `<!doctype html>
20981
20981
  panel.classList.add('active');
20982
20982
  detailBox.style.display = 'none'; // superseded by the panel
20983
20983
  stepState = { evs: evs, pos: pos, nodeBoxes: nodeBoxes, t0: t0, scroll: scroll, nodeW: NODE_W };
20984
- var keepIdx = sameFlow && window.__lensaiStepIdx != null && window.__lensaiStepIdx < evs.length
20985
- ? window.__lensaiStepIdx : 0;
20984
+ var keepIdx = sameFlow && window.__lensmcpStepIdx != null && window.__lensmcpStepIdx < evs.length
20985
+ ? window.__lensmcpStepIdx : 0;
20986
20986
  setStep(keepIdx, true);
20987
20987
  }
20988
20988
 
@@ -20992,12 +20992,12 @@ var PAGE = `<!doctype html>
20992
20992
  if (!stepState) return;
20993
20993
  var evs = stepState.evs;
20994
20994
  i = Math.max(0, Math.min(i, evs.length - 1));
20995
- window.__lensaiStepIdx = i;
20995
+ window.__lensmcpStepIdx = i;
20996
20996
  var ev = evs[i];
20997
20997
  if (stepState.rf) {
20998
20998
  // center the canvas only for NAVIGATION (buttons/keys); a canvas click
20999
20999
  // or a background refresh selects without yanking the viewport.
21000
- if (window.__lensaiHighlightStep) window.__lensaiHighlightStep(i, !keepScroll);
21000
+ if (window.__lensmcpHighlightStep) window.__lensmcpHighlightStep(i, !keepScroll);
21001
21001
  } else {
21002
21002
  stepState.nodeBoxes.forEach(function (b, j) {
21003
21003
  b.setAttribute('class', j === i ? 'node-box current' : 'node-box');
@@ -21043,21 +21043,21 @@ var PAGE = `<!doctype html>
21043
21043
  body.replaceChildren.apply(body, children);
21044
21044
  }
21045
21045
  document.getElementById('step-prev').addEventListener('click', function () {
21046
- if (window.__lensaiStepIdx != null) setStep(window.__lensaiStepIdx - 1);
21046
+ if (window.__lensmcpStepIdx != null) setStep(window.__lensmcpStepIdx - 1);
21047
21047
  });
21048
21048
  document.getElementById('step-next').addEventListener('click', function () {
21049
- if (window.__lensaiStepIdx != null) setStep(window.__lensaiStepIdx + 1);
21049
+ if (window.__lensmcpStepIdx != null) setStep(window.__lensmcpStepIdx + 1);
21050
21050
  });
21051
21051
  document.addEventListener('keydown', function (e) {
21052
21052
  if (!stepState) return;
21053
21053
  var flowsVisible = document.getElementById('view-flows').style.display !== 'none';
21054
21054
  if (!flowsVisible) return;
21055
21055
  if (e.target && /INPUT|TEXTAREA|SELECT/.test(e.target.tagName)) return;
21056
- if (e.key === 'ArrowRight' || e.key === 'ArrowDown') { e.preventDefault(); setStep((window.__lensaiStepIdx || 0) + 1); }
21057
- if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') { e.preventDefault(); setStep((window.__lensaiStepIdx || 0) - 1); }
21056
+ if (e.key === 'ArrowRight' || e.key === 'ArrowDown') { e.preventDefault(); setStep((window.__lensmcpStepIdx || 0) + 1); }
21057
+ if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') { e.preventDefault(); setStep((window.__lensmcpStepIdx || 0) - 1); }
21058
21058
  });
21059
21059
  // canvas \u2192 panel: a ReactFlow node click selects that step in the inspector
21060
- window.__lensaiOnStepSelect = function (i) { setStep(i, true); };
21060
+ window.__lensmcpOnStepSelect = function (i) { setStep(i, true); };
21061
21061
 
21062
21062
  function selectFlow(flowId) {
21063
21063
  selectedFlow = flowId;