@vheins/local-memory-mcp 0.9.4 → 0.9.6

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.
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
10
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
11
- <script type="module" crossorigin src="/assets/index-DQK5O2_4.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-C9M1BD7U.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-CNE1bKgp.css">
13
13
  </head>
14
14
  <body>
@@ -10,7 +10,7 @@ import {
10
10
  createFileSink,
11
11
  listResources,
12
12
  logger
13
- } from "../chunk-LFMZUZGW.js";
13
+ } from "../chunk-PWNNK75T.js";
14
14
 
15
15
  // src/dashboard/server.ts
16
16
  import express from "express";
@@ -52,9 +52,10 @@ import {
52
52
  normalizeRepo,
53
53
  readResource,
54
54
  setLogLevel,
55
+ toContextSlug,
55
56
  updateSessionFromInitialize,
56
57
  updateSessionRoots
57
- } from "../chunk-LFMZUZGW.js";
58
+ } from "../chunk-PWNNK75T.js";
58
59
 
59
60
  // src/mcp/server.ts
60
61
  import readline from "readline";
@@ -1808,15 +1809,55 @@ async function handleTaskClaim(args, storage) {
1808
1809
 
1809
1810
  // src/mcp/tools/standard.store.ts
1810
1811
  import { randomUUID as randomUUID3 } from "crypto";
1812
+ function generateShortCode2() {
1813
+ const chars = "ABCDEFGHJKLMNPQRSTUVWXYZ0123456789";
1814
+ let code = "";
1815
+ for (let i = 0; i < 6; i++) {
1816
+ code += chars.charAt(Math.floor(Math.random() * chars.length));
1817
+ }
1818
+ return code;
1819
+ }
1811
1820
  async function handleStandardStore(params, db2, vectors2) {
1812
1821
  const validated = StandardStoreSchema.parse(params);
1822
+ const incomingVersion = validated.version || "1.0.0";
1823
+ const incomingLanguage = validated.language ?? null;
1824
+ const incomingStack = validated.stack ?? [];
1825
+ const conflict = db2.standards.checkConflicts(
1826
+ validated.content,
1827
+ incomingVersion,
1828
+ validated.repo,
1829
+ incomingLanguage,
1830
+ incomingStack,
1831
+ 0.82
1832
+ );
1833
+ if (conflict) {
1834
+ return createMcpResponse(
1835
+ {
1836
+ success: false,
1837
+ error: "STANDARD_CONFLICT",
1838
+ message: `This standard's content is highly similar to an existing standard (ID: ${conflict.id}, similarity: ${(conflict.similarity * 100).toFixed(1)}%).`,
1839
+ conflicting_standard: {
1840
+ id: conflict.id,
1841
+ title: conflict.title,
1842
+ version: conflict.version,
1843
+ language: conflict.language,
1844
+ stack: conflict.stack,
1845
+ content: conflict.content
1846
+ },
1847
+ instruction: "Use 'standard-update' on the existing ID to update it. To store a distinct variant, supply a different 'version', 'language', or non-overlapping 'stack'."
1848
+ },
1849
+ `Rejected: conflicts with standard "${conflict.title}" (${conflict.id}). Update it via 'standard-update', or differentiate by version / language / stack.`,
1850
+ { structuredContentPathHint: "conflicting_standard" }
1851
+ );
1852
+ }
1813
1853
  const now = (/* @__PURE__ */ new Date()).toISOString();
1814
1854
  const entry = {
1815
1855
  id: randomUUID3(),
1856
+ code: generateShortCode2(),
1816
1857
  title: validated.name,
1817
1858
  content: validated.content,
1818
1859
  parent_id: validated.parent_id || null,
1819
- context: validated.context || "general",
1860
+ context: toContextSlug(validated.context || "general"),
1820
1861
  version: validated.version || "1.0.0",
1821
1862
  language: validated.language || null,
1822
1863
  stack: validated.stack || [],
@@ -1839,6 +1880,7 @@ async function handleStandardStore(params, db2, vectors2) {
1839
1880
  }
1840
1881
  logger.info("[Tool] standard.store - saved coding standard", {
1841
1882
  standardId: entry.id,
1883
+ code: entry.code,
1842
1884
  title: entry.title,
1843
1885
  stack: entry.stack,
1844
1886
  language: entry.language
@@ -1847,9 +1889,9 @@ async function handleStandardStore(params, db2, vectors2) {
1847
1889
  {
1848
1890
  success: true,
1849
1891
  standard: entry,
1850
- message: `Coding standard "${entry.title}" saved successfully.`
1892
+ message: `Coding standard [${entry.code}] "${entry.title}" saved successfully.`
1851
1893
  },
1852
- `Saved coding standard: ${entry.title}`,
1894
+ `Saved coding standard [${entry.code}]: ${entry.title}`,
1853
1895
  {
1854
1896
  structuredContentPathHint: "standard",
1855
1897
  includeSerializedStructuredContent: true
@@ -1944,8 +1986,9 @@ async function handleStandardSearch(params, db2, vectors2) {
1944
1986
  context: validated.context,
1945
1987
  version: validated.version
1946
1988
  });
1947
- const COLUMNS = ["id", "title", "context", "language", "scope", "tags", "updated_at"];
1989
+ const COLUMNS = ["code", "id", "title", "context", "language", "scope", "tags", "updated_at"];
1948
1990
  const rows = paginatedResults.map((standard) => [
1991
+ standard.code ?? "-",
1949
1992
  standard.id,
1950
1993
  standard.title,
1951
1994
  standard.context,
@@ -1958,12 +2001,12 @@ async function handleStandardSearch(params, db2, vectors2) {
1958
2001
  if (paginatedResults.length > 0) {
1959
2002
  const parts = [
1960
2003
  "Standards:",
1961
- "- title|context|language|scope",
2004
+ "- code|title|context|language|scope",
1962
2005
  ...paginatedResults.map(
1963
- (standard) => `- ${standard.title}|${standard.context}|${standard.language || "-"}|${standard.is_global ? "global" : standard.repo || "-"}`
2006
+ (standard) => `- ${standard.code ?? "-"}|${standard.title}|${standard.context}|${standard.language || "-"}|${standard.is_global ? "global" : standard.repo || "-"}`
1964
2007
  ),
1965
2008
  "",
1966
- "Use standard-detail with id for full content."
2009
+ "Use standard-detail with code for full content."
1967
2010
  ];
1968
2011
  contentSummary = parts.join("\n");
1969
2012
  } else {
@@ -2042,13 +2085,15 @@ async function handleStandardUpdate(params, db2, vectors2) {
2042
2085
  // src/mcp/tools/standard.detail.ts
2043
2086
  async function handleStandardDetail(args, storage) {
2044
2087
  const validated = StandardDetailSchema.parse(args);
2045
- const standard = storage.standards.getById(validated.id);
2088
+ const standard = validated.id ? storage.standards.getById(validated.id) : storage.standards.getByCode(validated.code);
2046
2089
  if (!standard) {
2047
- throw new Error(`Coding standard not found: ${validated.id}`);
2090
+ const identifier = validated.id ?? validated.code;
2091
+ throw new Error(`Coding standard not found: ${identifier}`);
2048
2092
  }
2049
2093
  storage.standards.incrementHitCounts([standard.id]);
2050
2094
  const lines = [
2051
2095
  `ID: ${standard.id}`,
2096
+ ...standard.code ? [`Code: ${standard.code}`] : [],
2052
2097
  `Title: ${standard.title}`,
2053
2098
  `Parent ID: ${standard.parent_id || "-"}`,
2054
2099
  `Context: ${standard.context}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vheins/local-memory-mcp",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "description": "MCP Local Memory Service for coding copilot agents",
5
5
  "mcpName": "io.github.vheins/local-memory-mcp",
6
6
  "type": "module",