@context-engine-bridge/context-engine-mcp-bridge 0.0.57 → 0.0.58

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/mcpServer.js +15 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@context-engine-bridge/context-engine-mcp-bridge",
3
- "version": "0.0.57",
3
+ "version": "0.0.58",
4
4
  "description": "Context Engine MCP bridge (http/stdio proxy combining indexer + memory servers)",
5
5
  "bin": {
6
6
  "ctxce": "bin/ctxce.js",
package/src/mcpServer.js CHANGED
@@ -1766,9 +1766,21 @@ let _sessionCollectionsCache = null;
1766
1766
  let _sessionCollectionsMtime = 0;
1767
1767
  let _sessionCollectionsCacheKey = "";
1768
1768
 
1769
+ function _collectionRepoName(collection) {
1770
+ if (!collection || typeof collection !== "string") return null;
1771
+ const lastDash = collection.lastIndexOf("-");
1772
+ if (lastDash <= 0) return collection.toLowerCase();
1773
+ const maybeSuffix = collection.slice(lastDash + 1);
1774
+ if (/^[a-f0-9]{6,}$/.test(maybeSuffix)) {
1775
+ return collection.slice(0, lastDash).toLowerCase();
1776
+ }
1777
+ return collection.toLowerCase();
1778
+ }
1779
+
1769
1780
  function _findWorkspaceDirByCollection(collection) {
1770
1781
  if (!collection) return null;
1771
1782
  const wsRoot = path.join(os.homedir(), ".ctxce", "workspaces");
1783
+ const targetName = _collectionRepoName(collection);
1772
1784
  try {
1773
1785
  const realWsRoot = fs.realpathSync(wsRoot);
1774
1786
  const dirs = fs.readdirSync(wsRoot).slice(0, MAX_WS_SCAN);
@@ -1782,8 +1794,9 @@ function _findWorkspaceDirByCollection(collection) {
1782
1794
  } catch (_) { continue; }
1783
1795
  try {
1784
1796
  const cfg = JSON.parse(fs.readFileSync(path.join(realDir, "ctx_config.json"), "utf8"));
1785
- if (cfg && cfg.default_collection === collection) {
1786
- return realDir;
1797
+ if (cfg && cfg.default_collection) {
1798
+ if (cfg.default_collection === collection) return realDir;
1799
+ if (targetName && _collectionRepoName(cfg.default_collection) === targetName) return realDir;
1787
1800
  }
1788
1801
  } catch (_) {}
1789
1802
  }