memorix 1.8.1 → 1.8.2

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 (37) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cli/index.js +326 -52
  3. package/dist/index.js +581 -315
  4. package/dist/maintenance-runner.js +31 -25
  5. package/dist/media-audio-runner.js +31 -25
  6. package/dist/media-video-runner.js +31 -25
  7. package/dist/memcode-runtime/CHANGELOG.md +20 -0
  8. package/dist/sdk.js +573 -314
  9. package/dist/vector-backfill-runner.js +31 -25
  10. package/docs/1.2.0-PROVIDER-QUALITY.md +15 -6
  11. package/docs/1.3.3-MULTIMODAL-MEDIA-AND-MCP-COMPAT.md +7 -6
  12. package/docs/1.8.0-RELEASE-CANDIDATE-SPEC.md +10 -8
  13. package/docs/API_REFERENCE.md +10 -8
  14. package/docs/CONFIGURATION.md +2 -2
  15. package/docs/DEVELOPMENT.md +2 -2
  16. package/docs/README.md +10 -7
  17. package/package.json +1 -1
  18. package/plugins/antigravity/memorix/plugin.json +2 -1
  19. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  20. package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
  21. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  22. package/plugins/copilot/memorix/plugin.json +1 -1
  23. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  24. package/plugins/hermes/memorix/plugin.yaml +1 -1
  25. package/plugins/omp/memorix/package.json +1 -1
  26. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  27. package/plugins/pi/memorix/package.json +1 -1
  28. package/server.json +3 -3
  29. package/src/cli/commands/serve-http.ts +10 -2
  30. package/src/codegraph/external-provider.ts +299 -19
  31. package/src/config/dotenv-loader.ts +9 -4
  32. package/src/config.ts +16 -16
  33. package/src/dashboard/maintenance.ts +4 -1
  34. package/src/llm/provider.ts +17 -4
  35. package/src/server/mcp-compat.ts +82 -0
  36. package/src/server/mcp-diagnostics.ts +13 -4
  37. package/src/server.ts +5 -2
package/dist/index.js CHANGED
@@ -3279,8 +3279,10 @@ function loadEnvFile(filePath) {
3279
3279
  loadedEnvFiles.push(filePath);
3280
3280
  }
3281
3281
  function loadDotenv(projectRoot, options = {}) {
3282
- if (dotenvLoaded && dotenvProjectRoot === (projectRoot ?? null)) return;
3283
- if (dotenvLoaded && dotenvProjectRoot !== (projectRoot ?? null)) {
3282
+ const userHomeDir = options.userHomeDir ?? homedir4();
3283
+ const normalizedProjectRoot = projectRoot ?? null;
3284
+ if (dotenvLoaded && dotenvProjectRoot === normalizedProjectRoot && dotenvHomeDir === userHomeDir) return;
3285
+ if (dotenvLoaded && (dotenvProjectRoot !== normalizedProjectRoot || dotenvHomeDir !== userHomeDir)) {
3284
3286
  resetDotenv();
3285
3287
  }
3286
3288
  loadedEnvFiles.length = 0;
@@ -3289,9 +3291,10 @@ function loadDotenv(projectRoot, options = {}) {
3289
3291
  if (projectRoot) {
3290
3292
  loadEnvFile(getProjectDotenvPath(projectRoot));
3291
3293
  }
3292
- loadEnvFile(getGlobalDotenvPath(options.userHomeDir ?? homedir4()));
3294
+ loadEnvFile(getGlobalDotenvPath(userHomeDir));
3293
3295
  dotenvLoaded = true;
3294
- dotenvProjectRoot = projectRoot ?? null;
3296
+ dotenvProjectRoot = normalizedProjectRoot;
3297
+ dotenvHomeDir = userHomeDir;
3295
3298
  }
3296
3299
  function resetDotenv() {
3297
3300
  for (const key of injectedKeys) {
@@ -3300,6 +3303,7 @@ function resetDotenv() {
3300
3303
  injectedKeys.clear();
3301
3304
  dotenvLoaded = false;
3302
3305
  dotenvProjectRoot = null;
3306
+ dotenvHomeDir = null;
3303
3307
  loadedEnvFiles.length = 0;
3304
3308
  loadedEnvKeys.clear();
3305
3309
  }
@@ -3312,7 +3316,7 @@ function getLoadedEnvKeys() {
3312
3316
  function getLoadedEnvValue(key) {
3313
3317
  return loadedEnvValues.get(key);
3314
3318
  }
3315
- var dotenvLoaded, dotenvProjectRoot, loadedEnvFiles, loadedEnvKeys, loadedEnvValues, injectedKeys;
3319
+ var dotenvLoaded, dotenvProjectRoot, dotenvHomeDir, loadedEnvFiles, loadedEnvKeys, loadedEnvValues, injectedKeys;
3316
3320
  var init_dotenv_loader = __esm({
3317
3321
  "src/config/dotenv-loader.ts"() {
3318
3322
  "use strict";
@@ -3320,6 +3324,7 @@ var init_dotenv_loader = __esm({
3320
3324
  init_config_paths();
3321
3325
  dotenvLoaded = false;
3322
3326
  dotenvProjectRoot = null;
3327
+ dotenvHomeDir = null;
3323
3328
  loadedEnvFiles = [];
3324
3329
  loadedEnvKeys = /* @__PURE__ */ new Set();
3325
3330
  loadedEnvValues = /* @__PURE__ */ new Map();
@@ -3671,33 +3676,33 @@ __export(config_exports, {
3671
3676
  resetConfigCache: () => resetConfigCache,
3672
3677
  resetDotenv: () => resetDotenv
3673
3678
  });
3674
- function getLLMApiKey() {
3675
- return getResolvedMemoryLane().llm.apiKey;
3679
+ function getLLMApiKey(options = {}) {
3680
+ return getResolvedMemoryLane(options).llm.apiKey;
3676
3681
  }
3677
- function getLLMProvider() {
3678
- const provider2 = getResolvedMemoryLane().llm.provider;
3682
+ function getLLMProvider(options = {}) {
3683
+ const provider2 = getResolvedMemoryLane(options).llm.provider;
3679
3684
  if (provider2) return provider2;
3680
3685
  if (process.env.ANTHROPIC_API_KEY && !process.env.OPENAI_API_KEY) return "anthropic";
3681
3686
  if (process.env.OPENROUTER_API_KEY && !process.env.OPENAI_API_KEY) return "openrouter";
3682
3687
  return "openai";
3683
3688
  }
3684
- function getLLMModel(providerDefault) {
3685
- return getResolvedMemoryLane().llm.model || providerDefault;
3689
+ function getLLMModel(providerDefault, options = {}) {
3690
+ return getResolvedMemoryLane(options).llm.model || providerDefault;
3686
3691
  }
3687
- function getLLMBaseUrl(providerDefault) {
3688
- return getResolvedMemoryLane().llm.baseUrl || providerDefault;
3692
+ function getLLMBaseUrl(providerDefault, options = {}) {
3693
+ return getResolvedMemoryLane(options).llm.baseUrl || providerDefault;
3689
3694
  }
3690
- function getAgentLLMApiKey() {
3691
- return getResolvedAgentLane().apiKey;
3695
+ function getAgentLLMApiKey(options = {}) {
3696
+ return getResolvedAgentLane(options).apiKey;
3692
3697
  }
3693
- function getAgentLLMProvider() {
3694
- return getResolvedAgentLane().provider || getLLMProvider();
3698
+ function getAgentLLMProvider(options = {}) {
3699
+ return getResolvedAgentLane(options).provider || getLLMProvider(options);
3695
3700
  }
3696
- function getAgentLLMModel(providerDefault) {
3697
- return getResolvedAgentLane().model || getLLMModel(providerDefault);
3701
+ function getAgentLLMModel(providerDefault, options = {}) {
3702
+ return getResolvedAgentLane(options).model || getLLMModel(providerDefault, options);
3698
3703
  }
3699
- function getAgentLLMBaseUrl(providerDefault) {
3700
- return getResolvedAgentLane().baseUrl || getLLMBaseUrl(providerDefault);
3704
+ function getAgentLLMBaseUrl(providerDefault, options = {}) {
3705
+ return getResolvedAgentLane(options).baseUrl || getLLMBaseUrl(providerDefault, options);
3701
3706
  }
3702
3707
  function getEmbeddingMode() {
3703
3708
  const provider2 = getResolvedEmbeddingLane().provider?.toLowerCase()?.trim();
@@ -5956,18 +5961,19 @@ async function* callLLMWithToolsStream(messages, tools) {
5956
5961
  }
5957
5962
  function initLLM(options = {}) {
5958
5963
  const scope = options.scope ?? "memory";
5959
- const apiKey = scope === "agent" ? getAgentLLMApiKey() : getLLMApiKey();
5964
+ const configOptions = { projectRoot: options.projectRoot, homeDir: options.homeDir };
5965
+ const apiKey = scope === "agent" ? getAgentLLMApiKey(configOptions) : getLLMApiKey(configOptions);
5960
5966
  if (!apiKey) {
5961
5967
  currentConfig = null;
5962
5968
  return null;
5963
5969
  }
5964
- const provider2 = scope === "agent" ? getAgentLLMProvider() : getLLMProvider();
5970
+ const provider2 = scope === "agent" ? getAgentLLMProvider(configOptions) : getLLMProvider(configOptions);
5965
5971
  const defaults2 = PROVIDER_DEFAULTS[provider2] ?? PROVIDER_DEFAULTS.openai;
5966
5972
  currentConfig = {
5967
5973
  provider: provider2,
5968
5974
  apiKey,
5969
- model: scope === "agent" ? getAgentLLMModel(defaults2.model) : getLLMModel(defaults2.model),
5970
- baseUrl: scope === "agent" ? getAgentLLMBaseUrl(defaults2.baseUrl) : getLLMBaseUrl(defaults2.baseUrl)
5975
+ model: scope === "agent" ? getAgentLLMModel(defaults2.model, configOptions) : getLLMModel(defaults2.model, configOptions),
5976
+ baseUrl: scope === "agent" ? getAgentLLMBaseUrl(defaults2.baseUrl, configOptions) : getLLMBaseUrl(defaults2.baseUrl, configOptions)
5971
5977
  };
5972
5978
  return currentConfig;
5973
5979
  }
@@ -65987,11 +65993,11 @@ var require_bignumber = __commonJS({
65987
65993
  return n > 0 || n === i2 ? i2 : i2 - 1;
65988
65994
  }
65989
65995
  function coeffToString(a) {
65990
- var s2, z627, i2 = 1, j = a.length, r2 = a[0] + "";
65996
+ var s2, z628, i2 = 1, j = a.length, r2 = a[0] + "";
65991
65997
  for (; i2 < j; ) {
65992
65998
  s2 = a[i2++] + "";
65993
- z627 = LOG_BASE - s2.length;
65994
- for (; z627--; s2 = "0" + s2) ;
65999
+ z628 = LOG_BASE - s2.length;
66000
+ for (; z628--; s2 = "0" + s2) ;
65995
66001
  r2 += s2;
65996
66002
  }
65997
66003
  for (j = r2.length; r2.charCodeAt(--j) === 48; ) ;
@@ -66024,15 +66030,15 @@ var require_bignumber = __commonJS({
66024
66030
  function toExponential(str2, e2) {
66025
66031
  return (str2.length > 1 ? str2.charAt(0) + "." + str2.slice(1) : str2) + (e2 < 0 ? "e" : "e+") + e2;
66026
66032
  }
66027
- function toFixedPoint(str2, e2, z627) {
66033
+ function toFixedPoint(str2, e2, z628) {
66028
66034
  var len, zs;
66029
66035
  if (e2 < 0) {
66030
- for (zs = z627 + "."; ++e2; zs += z627) ;
66036
+ for (zs = z628 + "."; ++e2; zs += z628) ;
66031
66037
  str2 = zs + str2;
66032
66038
  } else {
66033
66039
  len = str2.length;
66034
66040
  if (++e2 > len) {
66035
- for (zs = z627, e2 -= len; --e2; zs += z627) ;
66041
+ for (zs = z628, e2 -= len; --e2; zs += z628) ;
66036
66042
  str2 += zs;
66037
66043
  } else if (e2 < len) {
66038
66044
  str2 = str2.slice(0, e2) + "." + str2.slice(e2);
@@ -158111,6 +158117,51 @@ var init_request_context = __esm({
158111
158117
  }
158112
158118
  });
158113
158119
 
158120
+ // src/server/mcp-compat.ts
158121
+ import { RequestSchema } from "@modelcontextprotocol/sdk/types.js";
158122
+ import { z as z625 } from "zod/v4";
158123
+ function buildMcpDiscoverResult(server, serverInfo) {
158124
+ const getCapabilities = server.server.getCapabilities.bind(server.server);
158125
+ return {
158126
+ resultType: "complete",
158127
+ supportedVersions: [
158128
+ MCP_MODERN_PROTOCOL_VERSION,
158129
+ MCP_LEGACY_PROTOCOL_VERSION,
158130
+ MCP_OLDEST_LEGACY_PROTOCOL_VERSION
158131
+ ],
158132
+ capabilities: getCapabilities(),
158133
+ _meta: {
158134
+ [MCP_SERVER_INFO_META_KEY]: { ...serverInfo }
158135
+ },
158136
+ // v1 has no response-cache negotiation. A zero private TTL is the
158137
+ // conservative result and prevents clients from inventing a shared cache.
158138
+ ttlMs: 0,
158139
+ cacheScope: "private"
158140
+ };
158141
+ }
158142
+ function registerMcpDiscovery(server, serverInfo) {
158143
+ if (registeredServers.has(server)) return;
158144
+ server.server.setRequestHandler(ServerDiscoverRequestSchema, async () => buildMcpDiscoverResult(server, serverInfo));
158145
+ registeredServers.add(server);
158146
+ }
158147
+ var MCP_MODERN_PROTOCOL_VERSION, MCP_LEGACY_PROTOCOL_VERSION, MCP_OLDEST_LEGACY_PROTOCOL_VERSION, MCP_SERVER_DISCOVER_METHOD, MCP_SERVER_INFO_META_KEY, ServerDiscoverRequestSchema, registeredServers;
158148
+ var init_mcp_compat = __esm({
158149
+ "src/server/mcp-compat.ts"() {
158150
+ "use strict";
158151
+ init_esm_shims();
158152
+ MCP_MODERN_PROTOCOL_VERSION = "2026-07-28";
158153
+ MCP_LEGACY_PROTOCOL_VERSION = "2025-11-25";
158154
+ MCP_OLDEST_LEGACY_PROTOCOL_VERSION = "2024-11-05";
158155
+ MCP_SERVER_DISCOVER_METHOD = "server/discover";
158156
+ MCP_SERVER_INFO_META_KEY = "io.modelcontextprotocol/serverInfo";
158157
+ ServerDiscoverRequestSchema = RequestSchema.extend({
158158
+ method: z625.literal(MCP_SERVER_DISCOVER_METHOD),
158159
+ params: z625.looseObject({}).optional()
158160
+ });
158161
+ registeredServers = /* @__PURE__ */ new WeakSet();
158162
+ }
158163
+ });
158164
+
158114
158165
  // src/runtime/maintenance-targets.ts
158115
158166
  var maintenance_targets_exports = {};
158116
158167
  __export(maintenance_targets_exports, {
@@ -159841,6 +159892,27 @@ function unavailableHealth(result) {
159841
159892
  if (result.outputLimited) return { state: "invalid", reason: "A local CodeGraph response exceeded the safety limit." };
159842
159893
  return { state: "unavailable", reason: "A local CodeGraph command did not complete." };
159843
159894
  }
159895
+ function notAttemptedDiagnostic(command) {
159896
+ return { command, attempted: false, outcome: "not-attempted" };
159897
+ }
159898
+ function commandDiagnostic(command, result, outcome, reason) {
159899
+ return {
159900
+ command,
159901
+ attempted: true,
159902
+ outcome,
159903
+ ...typeof result.exitCode === "number" ? { exitCode: result.exitCode } : {},
159904
+ ...reason ? { reason: sanitizeCredentials(reason).slice(0, 240) } : {}
159905
+ };
159906
+ }
159907
+ function failedCommandDiagnostic(command, result) {
159908
+ const outcome = result.timedOut ? "timed-out" : result.outputLimited ? "output-limited" : "failed";
159909
+ return commandDiagnostic(
159910
+ command,
159911
+ result,
159912
+ outcome,
159913
+ result.error || result.stderr || "CodeGraph command did not complete."
159914
+ );
159915
+ }
159844
159916
  async function runSafely(runner, input) {
159845
159917
  try {
159846
159918
  return await runner.run(input);
@@ -159990,6 +160062,7 @@ function parseOutline(value, projectRoot, exclude) {
159990
160062
  if (nodes.some((node) => !node)) return void 0;
159991
160063
  const byId = /* @__PURE__ */ new Map();
159992
160064
  for (const node of nodes) {
160065
+ if (byId.has(node.id)) return void 0;
159993
160066
  byId.set(node.id, externalSymbol(node));
159994
160067
  }
159995
160068
  const entryPoints = value.entryPoints.map((item) => parseNode(item, projectRoot, exclude)).filter((node) => Boolean(node)).map(externalSymbol).filter((node, index, items) => items.findIndex((item) => item.id === node.id) === index).slice(0, 5);
@@ -160003,7 +160076,7 @@ function parseOutline(value, projectRoot, exclude) {
160003
160076
  if (!source || !target || !kind || rawEdge.line !== void 0 && (!line || line < 1)) return void 0;
160004
160077
  const from = byId.get(source);
160005
160078
  const to = byId.get(target);
160006
- if (!from || !to) continue;
160079
+ if (!from || !to) return void 0;
160007
160080
  relations.push({ from, to, kind, ...line ? { line } : {} });
160008
160081
  }
160009
160082
  const relatedFiles = value.relatedFiles.map((item) => safeRelativePath(projectRoot, item, exclude));
@@ -160021,45 +160094,234 @@ function parseOutline(value, projectRoot, exclude) {
160021
160094
  stats: { nodes: nodeCount, edges: edgeCount, files: fileCount }
160022
160095
  };
160023
160096
  }
160097
+ function parseTextLocation(value) {
160098
+ const match2 = value.trim().match(/^(.*?)(?::([1-9]\d*))?$/);
160099
+ if (!match2?.[1]) return void 0;
160100
+ return {
160101
+ filePath: match2[1].trim(),
160102
+ ...match2[2] ? { line: Number(match2[2]) } : {}
160103
+ };
160104
+ }
160105
+ function parseExploreText(value, projectRoot, exclude) {
160106
+ if (!value.trim() || Buffer.byteLength(value, "utf8") > MAX_EXTERNAL_CODEGRAPH_OUTPUT_BYTES) return void 0;
160107
+ const entryPoints = [];
160108
+ const nodes = [];
160109
+ const relatedFiles = /* @__PURE__ */ new Set();
160110
+ const byName = /* @__PURE__ */ new Map();
160111
+ let section = null;
160112
+ let relationKind = "references";
160113
+ const addNode = (node, entry) => {
160114
+ const key = `${node.filePath}\0${node.name}`;
160115
+ const existing = byName.get(key);
160116
+ if (existing) return;
160117
+ byName.set(key, node);
160118
+ relatedFiles.add(node.filePath);
160119
+ (entry ? entryPoints : nodes).push(node);
160120
+ };
160121
+ for (const rawLine of value.split(/\r?\n/)) {
160122
+ const line = rawLine.trim();
160123
+ const fileHeader = line.match(/^\*\*`([^`]+)`\*\*\s+(?:—|-)\s+(.+)$/);
160124
+ if (fileHeader) {
160125
+ const filePath = safeRelativePath(projectRoot, fileHeader[1], exclude);
160126
+ if (!filePath) return void 0;
160127
+ const symbolText = fileHeader[2].split(/\s+·\s+/, 1)[0] ?? "";
160128
+ const symbols = [...symbolText.matchAll(/([^,]+?)\(([^()]+)\)/g)];
160129
+ if (symbols.length === 0) return void 0;
160130
+ const isFirstFile = entryPoints.length === 0 && nodes.length === 0;
160131
+ for (const symbol of symbols.slice(0, MAX_EXTERNAL_NODE_COUNT)) {
160132
+ const name = symbol[1]?.trim();
160133
+ const kind = symbol[2]?.trim();
160134
+ if (!name || !kind) return void 0;
160135
+ addNode({
160136
+ id: `explore:${filePath}:${name}`,
160137
+ kind,
160138
+ name,
160139
+ filePath
160140
+ }, isFirstFile);
160141
+ }
160142
+ section = null;
160143
+ continue;
160144
+ }
160145
+ if (/^#{2,3}\s+Entry Points?\b/i.test(line)) {
160146
+ section = "entry";
160147
+ continue;
160148
+ }
160149
+ if (/^#{2,3}\s+Related Symbols?\b/i.test(line)) {
160150
+ section = "related";
160151
+ continue;
160152
+ }
160153
+ if (/^\*\*Relationships\*\*$/i.test(line)) {
160154
+ section = "relationships";
160155
+ continue;
160156
+ }
160157
+ if (/^\*\*(?:Source Code|Code)\*\*$/i.test(line) || /^#{2,3}\s+/i.test(line)) {
160158
+ section = null;
160159
+ continue;
160160
+ }
160161
+ if (section === "entry") {
160162
+ const match2 = line.match(/^-\s+\*\*(.+?)\*\*\s+\(([^)]+)\)\s+-\s+(.+)$/);
160163
+ if (!match2) continue;
160164
+ const location = parseTextLocation(match2[3]);
160165
+ if (!location) return void 0;
160166
+ const filePath = safeRelativePath(projectRoot, location.filePath, exclude);
160167
+ if (!filePath) return void 0;
160168
+ addNode({
160169
+ id: `explore:${filePath}:${match2[1]}`,
160170
+ kind: match2[2],
160171
+ name: match2[1],
160172
+ filePath,
160173
+ ...location.line ? { startLine: location.line, endLine: location.line } : {}
160174
+ }, true);
160175
+ continue;
160176
+ }
160177
+ if (section === "related") {
160178
+ const match2 = line.match(/^-\s+([^:]+):\s+(.+)$/);
160179
+ if (!match2) continue;
160180
+ const filePath = safeRelativePath(projectRoot, match2[1], exclude);
160181
+ if (!filePath) return void 0;
160182
+ relatedFiles.add(filePath);
160183
+ for (const rawSymbol of match2[2].split(",")) {
160184
+ const symbol = rawSymbol.trim().match(/^(.+?)(?::([1-9]\d*))?$/);
160185
+ if (!symbol?.[1]) return void 0;
160186
+ addNode({
160187
+ id: `explore:${filePath}:${symbol[1].trim()}`,
160188
+ kind: "unknown",
160189
+ name: symbol[1].trim(),
160190
+ filePath,
160191
+ ...symbol[2] ? { startLine: Number(symbol[2]), endLine: Number(symbol[2]) } : {}
160192
+ }, false);
160193
+ }
160194
+ continue;
160195
+ }
160196
+ if (section === "relationships") {
160197
+ const kind = line.match(/^\*\*([^*]+):\*\*$/);
160198
+ if (kind?.[1]) {
160199
+ relationKind = kind[1].trim();
160200
+ continue;
160201
+ }
160202
+ }
160203
+ }
160204
+ const bySymbolName = /* @__PURE__ */ new Map();
160205
+ for (const node of [...entryPoints, ...nodes]) {
160206
+ if (!bySymbolName.has(node.name)) bySymbolName.set(node.name, node);
160207
+ }
160208
+ const relations = [];
160209
+ if (section === "relationships") {
160210
+ for (const rawLine of value.split(/\r?\n/)) {
160211
+ const line = rawLine.trim();
160212
+ const match2 = line.match(/^-\s+(.+?)\s+(?:\u2192|->)\s+(.+)$/);
160213
+ if (!match2) continue;
160214
+ const from = bySymbolName.get(match2[1].trim());
160215
+ const to = bySymbolName.get(match2[2].trim());
160216
+ if (!from || !to) continue;
160217
+ relations.push({
160218
+ from: externalSymbol(from),
160219
+ to: externalSymbol(to),
160220
+ kind: relationKind
160221
+ });
160222
+ }
160223
+ } else {
160224
+ const relationshipStart = value.split(/\r?\n/).findIndex((line) => /^\s*\*\*Relationships\*\*\s*$/i.test(line));
160225
+ if (relationshipStart >= 0) {
160226
+ const relationshipLines = value.split(/\r?\n/).slice(relationshipStart + 1);
160227
+ for (const rawLine of relationshipLines) {
160228
+ const line = rawLine.trim();
160229
+ if (/^\*\*(?:Source Code|Code)\*\*$/i.test(line) || /^#{2,3}\s+/i.test(line)) break;
160230
+ const kind = line.match(/^\*\*([^*]+):\*\*$/);
160231
+ if (kind?.[1]) {
160232
+ relationKind = kind[1].trim();
160233
+ continue;
160234
+ }
160235
+ const match2 = line.match(/^-\s+(.+?)\s+(?:\u2192|->)\s+(.+)$/);
160236
+ if (!match2) continue;
160237
+ const from = bySymbolName.get(match2[1].trim());
160238
+ const to = bySymbolName.get(match2[2].trim());
160239
+ if (from && to) relations.push({ from: externalSymbol(from), to: externalSymbol(to), kind: relationKind });
160240
+ }
160241
+ }
160242
+ }
160243
+ const allNodes = [...entryPoints, ...nodes];
160244
+ if (allNodes.length === 0) return void 0;
160245
+ return {
160246
+ provider: "external",
160247
+ entryPoints: entryPoints.map(externalSymbol).slice(0, 5),
160248
+ relations: relations.slice(0, 6),
160249
+ relatedFiles: [...relatedFiles].slice(0, 5),
160250
+ stats: {
160251
+ nodes: allNodes.length,
160252
+ edges: relations.length,
160253
+ files: relatedFiles.size
160254
+ }
160255
+ };
160256
+ }
160257
+ function parseExplorePayload(value, projectRoot, exclude) {
160258
+ if (typeof value === "string") return parseExploreText(value, projectRoot, exclude);
160259
+ if (isRecord3(value) && isRecord3(value.result)) value = value.result;
160260
+ if (isRecord3(value) && Array.isArray(value.content)) {
160261
+ const text2 = value.content.filter((item) => isRecord3(item) && item.type === "text" && typeof item.text === "string").map((item) => item.text).join("\n");
160262
+ return parseExploreText(text2, projectRoot, exclude);
160263
+ }
160264
+ return parseOutline(value, projectRoot, exclude);
160265
+ }
160024
160266
  function fallbackCaution(health) {
160025
160267
  if (health.state === "disabled" || health.state === "not-detected" || health.state === "not-initialized" || health.state === "ready") return void 0;
160026
160268
  return "External semantic CodeGraph is " + health.state + "; using Lite structural evidence for this brief.";
160027
160269
  }
160270
+ function queryFallbackCaution(diagnostics) {
160271
+ return `External semantic CodeGraph context was unavailable (context: ${diagnostics.context.outcome}; explore: ${diagnostics.explore.outcome}); using Lite structural evidence.`;
160272
+ }
160028
160273
  async function getExternalCodeGraphContext(input) {
160029
160274
  const inspected = await inspectExternalCodeGraph(input);
160030
160275
  if (inspected.health.state !== "ready") {
160031
160276
  return { ...inspected, caution: fallbackCaution(inspected.health) };
160032
160277
  }
160033
160278
  const mode = input.mode ?? "auto";
160034
- const result = await runSafely(input.runner ?? defaultRunner, {
160279
+ const runner = input.runner ?? defaultRunner;
160280
+ const contextResult = await runSafely(runner, {
160035
160281
  command: input.command,
160036
160282
  args: ["context", "--path", input.projectRoot, "--format", "json", "--max-nodes", "8", "--no-code", input.task],
160037
160283
  cwd: input.projectRoot,
160038
160284
  timeoutMs: boundedTimeout(input.timeoutMs),
160039
160285
  maxOutputBytes: MAX_EXTERNAL_CODEGRAPH_OUTPUT_BYTES
160040
160286
  });
160041
- if (!result.ok) {
160042
- const health = unavailableHealth(result);
160287
+ const diagnostics = {
160288
+ context: contextResult.ok ? commandDiagnostic("context", contextResult, "success") : failedCommandDiagnostic("context", contextResult),
160289
+ explore: notAttemptedDiagnostic("explore")
160290
+ };
160291
+ const contextOutline = contextResult.ok ? parseOutline(parseJson2(contextResult.stdout), input.projectRoot, input.exclude) : void 0;
160292
+ if (contextOutline && (contextOutline.entryPoints.length > 0 || contextOutline.relations.length > 0 || contextOutline.relatedFiles.length > 0)) {
160043
160293
  return {
160044
- health,
160045
- quality: providerQuality({ mode, health }),
160046
- caution: fallbackCaution(health)
160294
+ ...inspected,
160295
+ outline: contextOutline,
160296
+ diagnostics,
160297
+ quality: providerQuality({ mode, health: inspected.health, selected: "external" })
160047
160298
  };
160048
160299
  }
160049
- const outline = parseOutline(parseJson2(result.stdout), input.projectRoot, input.exclude);
160050
- if (!outline) {
160051
- const health = { state: "invalid", reason: "The local CodeGraph context payload failed validation." };
160300
+ if (contextResult.ok) diagnostics.context = commandDiagnostic("context", contextResult, "invalid-output", "The context payload failed validation or contained no safe outline.");
160301
+ const exploreResult = await runSafely(runner, {
160302
+ command: input.command,
160303
+ args: ["explore", "--path", input.projectRoot, "--max-files", "4", input.task],
160304
+ cwd: input.projectRoot,
160305
+ timeoutMs: boundedTimeout(input.timeoutMs),
160306
+ maxOutputBytes: MAX_EXTERNAL_CODEGRAPH_OUTPUT_BYTES
160307
+ });
160308
+ diagnostics.explore = exploreResult.ok ? commandDiagnostic("explore", exploreResult, "success") : failedCommandDiagnostic("explore", exploreResult);
160309
+ const exploreOutline = exploreResult.ok ? parseExplorePayload(parseJson2(exploreResult.stdout) ?? exploreResult.stdout, input.projectRoot, input.exclude) : void 0;
160310
+ if (exploreOutline && (exploreOutline.entryPoints.length > 0 || exploreOutline.relations.length > 0 || exploreOutline.relatedFiles.length > 0)) {
160052
160311
  return {
160053
- health,
160054
- quality: providerQuality({ mode, health }),
160055
- caution: fallbackCaution(health)
160312
+ ...inspected,
160313
+ outline: exploreOutline,
160314
+ diagnostics,
160315
+ quality: providerQuality({ mode, health: inspected.health, selected: "external" })
160056
160316
  };
160057
160317
  }
160058
- const contributes = outline.entryPoints.length > 0 || outline.relations.length > 0 || outline.relatedFiles.length > 0;
160318
+ if (exploreResult.ok) diagnostics.explore = commandDiagnostic("explore", exploreResult, "invalid-output", "The explore payload failed validation or contained no safe outline.");
160319
+ const health = exploreResult.ok ? { state: "invalid", reason: "The local CodeGraph context and explore payloads failed validation." } : unavailableHealth(exploreResult);
160059
160320
  return {
160060
- ...inspected,
160061
- ...contributes ? { outline } : {},
160062
- quality: providerQuality({ mode, health: inspected.health, ...contributes ? { selected: "external" } : {} })
160321
+ health,
160322
+ quality: providerQuality({ mode, health }),
160323
+ diagnostics,
160324
+ caution: queryFallbackCaution(diagnostics)
160063
160325
  };
160064
160326
  }
160065
160327
  var DEFAULT_EXTERNAL_CODEGRAPH_TIMEOUT_MS, MAX_EXTERNAL_CODEGRAPH_TIMEOUT_MS, EXTERNAL_CODEGRAPH_LIFECYCLE_TIMEOUT_MS, MAX_EXTERNAL_CODEGRAPH_OUTPUT_BYTES, MAX_EXTERNAL_NODE_COUNT, MAX_EXTERNAL_EDGE_COUNT, MAX_EXTERNAL_FILE_COUNT, MAX_EXTERNAL_TEXT_LENGTH, LITE_SUPPORTED_LANGUAGES, defaultRunner;
@@ -160070,7 +160332,7 @@ var init_external_provider = __esm({
160070
160332
  init_secret_filter();
160071
160333
  init_exclude3();
160072
160334
  init_ids();
160073
- DEFAULT_EXTERNAL_CODEGRAPH_TIMEOUT_MS = 1200;
160335
+ DEFAULT_EXTERNAL_CODEGRAPH_TIMEOUT_MS = 3e3;
160074
160336
  MAX_EXTERNAL_CODEGRAPH_TIMEOUT_MS = 5e3;
160075
160337
  EXTERNAL_CODEGRAPH_LIFECYCLE_TIMEOUT_MS = 3e4;
160076
160338
  MAX_EXTERNAL_CODEGRAPH_OUTPUT_BYTES = 256 * 1024;
@@ -163353,6 +163615,7 @@ async function executeCleanup(context, payload, token) {
163353
163615
  return { action: "cleanup", projectId: context.projectId, ...result };
163354
163616
  }
163355
163617
  async function previewDeduplicate(context) {
163618
+ initLLM({ scope: "memory", projectRoot: context.projectRoot });
163356
163619
  if (!isLLMEnabled()) {
163357
163620
  return {
163358
163621
  action: "deduplicate",
@@ -165109,7 +165372,7 @@ var init_event_bus = __esm({
165109
165372
  });
165110
165373
 
165111
165374
  // src/orchestrate/task-graph.ts
165112
- import { z as z625 } from "zod";
165375
+ import { z as z626 } from "zod";
165113
165376
  function parseTaskGraph(raw) {
165114
165377
  const json2 = extractJson(raw);
165115
165378
  if (!json2) {
@@ -165301,25 +165564,25 @@ var init_task_graph = __esm({
165301
165564
  "src/orchestrate/task-graph.ts"() {
165302
165565
  "use strict";
165303
165566
  init_esm_shims();
165304
- TaskNodeSchema = z625.object({
165305
- tempId: z625.string().min(1).describe('Temporary ID like "t1", "t2"'),
165306
- role: z625.enum(["pm", "engineer", "qa", "reviewer"]),
165307
- description: z625.string().min(30).describe("Self-contained task description with all context"),
165308
- deps: z625.array(z625.string()).describe("tempIds of prerequisite tasks"),
165309
- files: z625.array(z625.string()).optional().describe("Files this task will create or modify"),
165567
+ TaskNodeSchema = z626.object({
165568
+ tempId: z626.string().min(1).describe('Temporary ID like "t1", "t2"'),
165569
+ role: z626.enum(["pm", "engineer", "qa", "reviewer"]),
165570
+ description: z626.string().min(30).describe("Self-contained task description with all context"),
165571
+ deps: z626.array(z626.string()).describe("tempIds of prerequisite tasks"),
165572
+ files: z626.array(z626.string()).optional().describe("Files this task will create or modify"),
165310
165573
  /** Phase 7: Natural-language acceptance criteria (Goal-First Testing) */
165311
- goals: z625.array(z625.string()).optional().describe("Acceptance criteria for task verification")
165574
+ goals: z626.array(z626.string()).optional().describe("Acceptance criteria for task verification")
165312
165575
  });
165313
- TaskGraphSchema = z625.object({
165314
- summary: z625.string().min(10).describe("One-paragraph plan summary"),
165315
- tasks: z625.array(TaskNodeSchema).min(2).max(30)
165576
+ TaskGraphSchema = z626.object({
165577
+ summary: z626.string().min(10).describe("One-paragraph plan summary"),
165578
+ tasks: z626.array(TaskNodeSchema).min(2).max(30)
165316
165579
  }).superRefine((data, ctx) => {
165317
165580
  const ids = new Set(data.tasks.map((t2) => t2.tempId));
165318
165581
  for (const task of data.tasks) {
165319
165582
  for (const dep of task.deps) {
165320
165583
  if (!ids.has(dep)) {
165321
165584
  ctx.addIssue({
165322
- code: z625.ZodIssueCode.custom,
165585
+ code: z626.ZodIssueCode.custom,
165323
165586
  message: `Task "${task.tempId}" references unknown dependency "${dep}"`,
165324
165587
  path: ["tasks"]
165325
165588
  });
@@ -165327,7 +165590,7 @@ var init_task_graph = __esm({
165327
165590
  }
165328
165591
  if (task.deps.includes(task.tempId)) {
165329
165592
  ctx.addIssue({
165330
- code: z625.ZodIssueCode.custom,
165593
+ code: z626.ZodIssueCode.custom,
165331
165594
  message: `Task "${task.tempId}" depends on itself`,
165332
165595
  path: ["tasks"]
165333
165596
  });
@@ -165335,21 +165598,21 @@ var init_task_graph = __esm({
165335
165598
  }
165336
165599
  if (data.tasks.length > 0 && data.tasks[data.tasks.length - 1].role !== "reviewer") {
165337
165600
  ctx.addIssue({
165338
- code: z625.ZodIssueCode.custom,
165601
+ code: z626.ZodIssueCode.custom,
165339
165602
  message: 'Last task must have role "reviewer"',
165340
165603
  path: ["tasks"]
165341
165604
  });
165342
165605
  }
165343
165606
  if (hasCycle(data.tasks)) {
165344
165607
  ctx.addIssue({
165345
- code: z625.ZodIssueCode.custom,
165608
+ code: z626.ZodIssueCode.custom,
165346
165609
  message: "Task graph contains a cycle",
165347
165610
  path: ["tasks"]
165348
165611
  });
165349
165612
  }
165350
165613
  if (ids.size !== data.tasks.length) {
165351
165614
  ctx.addIssue({
165352
- code: z625.ZodIssueCode.custom,
165615
+ code: z626.ZodIssueCode.custom,
165353
165616
  message: "Duplicate tempId values detected",
165354
165617
  path: ["tasks"]
165355
165618
  });
@@ -167812,7 +168075,7 @@ __export(server_exports2, {
167812
168075
  });
167813
168076
  import { createHash as createHash16 } from "crypto";
167814
168077
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
167815
- import { z as z626 } from "zod";
168078
+ import { z as z627 } from "zod";
167816
168079
  function formatFormationStageDurations(stageDurationsMs) {
167817
168080
  const orderedStages = ["extract", "resolve", "evaluate"];
167818
168081
  const parts = orderedStages.filter((stage) => stageDurationsMs[stage] !== void 0).map((stage) => `${stage}=${stageDurationsMs[stage]}ms`);
@@ -168184,10 +168447,12 @@ The path should point to a directory containing a .git folder.`
168184
168447
  isError: true
168185
168448
  };
168186
168449
  };
168187
- const server = existingServer ?? new McpServer({
168450
+ const serverInfo = {
168188
168451
  name: "memorix",
168189
- version: true ? "1.8.1" : "1.0.1"
168190
- });
168452
+ version: true ? "1.8.2" : "1.0.1"
168453
+ };
168454
+ const server = existingServer ?? new McpServer(serverInfo);
168455
+ registerMcpDiscovery(server, serverInfo);
168191
168456
  const originalRegisterTool = server.registerTool.bind(server);
168192
168457
  server.registerTool = ((name, ...args) => {
168193
168458
  if (!isToolInProfile(name, toolProfile)) {
@@ -168270,42 +168535,42 @@ The path should point to a directory containing a .git folder.`
168270
168535
  title: "Store Memory",
168271
168536
  description: "Store a new observation/memory. Automatically indexed for search. Use type to classify: gotcha ([GOTCHA] critical pitfall), decision ([DECISION] architecture choice), problem-solution ([FIX] bug fix), how-it-works ([INFO] explanation), what-changed ([CHANGE] change), discovery ([DISCOVERY] insight), why-it-exists ([WHY] rationale), trade-off ([TRADEOFF] compromise), session-request ([SESSION] original goal). Project visibility is the default. Personal or team visibility requires an explicitly joined coordination identity. Set longTerm only when the caller explicitly wants an additional source-backed long-term candidate; it is never injected until an operator records a review through the CLI. For a read-only task, do not store unless the user explicitly asks to save a record.",
168272
168537
  inputSchema: {
168273
- entityName: z626.string().describe('The entity this observation belongs to (e.g., "auth-module", "port-config")'),
168274
- type: z626.enum(OBSERVATION_TYPES).describe("Observation type for classification"),
168275
- title: z626.string().describe("Short descriptive title (~5-10 words)"),
168276
- narrative: z626.string().describe("Full description of the observation"),
168277
- facts: z626.array(z626.string()).optional().describe('Structured facts (e.g., "Default timeout: 60s")'),
168278
- filesModified: z626.array(z626.string()).optional().describe("Files involved"),
168279
- concepts: z626.array(z626.string()).optional().describe("Related concepts/keywords"),
168280
- topicKey: z626.string().optional().describe(
168538
+ entityName: z627.string().describe('The entity this observation belongs to (e.g., "auth-module", "port-config")'),
168539
+ type: z627.enum(OBSERVATION_TYPES).describe("Observation type for classification"),
168540
+ title: z627.string().describe("Short descriptive title (~5-10 words)"),
168541
+ narrative: z627.string().describe("Full description of the observation"),
168542
+ facts: z627.array(z627.string()).optional().describe('Structured facts (e.g., "Default timeout: 60s")'),
168543
+ filesModified: z627.array(z627.string()).optional().describe("Files involved"),
168544
+ concepts: z627.array(z627.string()).optional().describe("Related concepts/keywords"),
168545
+ topicKey: z627.string().optional().describe(
168281
168546
  'Optional topic identifier for upserts (e.g., "architecture/auth-model"). If an observation with the same topicKey already exists in this project, it will be UPDATED instead of creating a new one. Use memorix_suggest_topic_key to generate a stable key. Good for evolving decisions, architecture docs, etc.'
168282
168547
  ),
168283
- progress: z626.object({
168284
- feature: z626.string().describe("Feature or task name"),
168285
- status: z626.enum(["in-progress", "completed", "blocked"]).describe("Current status"),
168286
- completion: z626.number().optional().describe("Completion percentage 0-100")
168548
+ progress: z627.object({
168549
+ feature: z627.string().describe("Feature or task name"),
168550
+ status: z627.enum(["in-progress", "completed", "blocked"]).describe("Current status"),
168551
+ completion: z627.number().optional().describe("Completion percentage 0-100")
168287
168552
  }).optional().describe("Progress tracking for task/feature observations"),
168288
- relatedCommits: z626.array(z626.string()).optional().describe("Git commit hashes this memory relates to (links ground truth \u2194 reasoning)"),
168289
- relatedEntities: z626.array(z626.string()).optional().describe("Other entity names this memory cross-references"),
168290
- visibility: z626.enum(["personal", "project", "team"]).optional().describe(
168553
+ relatedCommits: z627.array(z627.string()).optional().describe("Git commit hashes this memory relates to (links ground truth \u2194 reasoning)"),
168554
+ relatedEntities: z627.array(z627.string()).optional().describe("Other entity names this memory cross-references"),
168555
+ visibility: z627.enum(["personal", "project", "team"]).optional().describe(
168291
168556
  "Retrieval scope. Project is the normal shared default; personal/team require memorix_session_start with joinTeam=true."
168292
168557
  ),
168293
- longTerm: z626.object({
168294
- kind: z626.enum(["episodic", "semantic", "procedural"]).describe("Cognitive kind for an additional long-term candidate."),
168295
- scope: z626.enum(["project", "user", "team"]).optional().default("project").describe("Long-term scope. User capture is private source evidence and needs a bound agent identity."),
168296
- tags: z626.array(z626.string()).optional().describe("Small set of retrieval tags for the candidate."),
168297
- applicability: z626.string().optional().describe("When this durable fact or procedure applies.")
168558
+ longTerm: z627.object({
168559
+ kind: z627.enum(["episodic", "semantic", "procedural"]).describe("Cognitive kind for an additional long-term candidate."),
168560
+ scope: z627.enum(["project", "user", "team"]).optional().default("project").describe("Long-term scope. User capture is private source evidence and needs a bound agent identity."),
168561
+ tags: z627.array(z627.string()).optional().describe("Small set of retrieval tags for the candidate."),
168562
+ applicability: z627.string().optional().describe("When this durable fact or procedure applies.")
168298
168563
  }).optional().describe("Optional explicit request to create a source-backed long-term candidate alongside this observation. Candidates are not automatically injected."),
168299
- overrideReadOnly: z626.boolean().optional().describe(
168564
+ overrideReadOnly: z627.boolean().optional().describe(
168300
168565
  "Use only when the user explicitly asks to save memory during a read-only or no-modification task."
168301
168566
  ),
168302
- attachments: z626.array(z626.object({
168303
- modality: z626.enum(["image", "audio", "video", "document"]),
168304
- url: z626.string().describe(
168567
+ attachments: z627.array(z627.object({
168568
+ modality: z627.enum(["image", "audio", "video", "document"]),
168569
+ url: z627.string().describe(
168305
168570
  "Public HTTPS provenance reference without query parameters or fragments. Memorix does not fetch this URL: attachment metadata is persisted and BM25-searchable, while observation vectors remain text-only."
168306
168571
  ),
168307
- mimeType: z626.string().optional(),
168308
- name: z626.string().optional()
168572
+ mimeType: z627.string().optional(),
168573
+ name: z627.string().optional()
168309
168574
  })).optional().describe("Safe public provenance references. They are stored as metadata for lexical retrieval; raw inline media is never stored.")
168310
168575
  }
168311
168576
  },
@@ -168843,8 +169108,8 @@ Entity: ${entityName} | Type: ${type} | Project: ${project.id}${obs.topicKey ? `
168843
169108
  title: "Suggest Topic Key",
168844
169109
  description: 'Suggest a stable topic_key for memory upserts. Use this before memorix_store when you want evolving topics (like architecture decisions, config docs) to update a single observation over time instead of creating duplicates. Returns a key like "architecture/auth-model" or "bug/timeout-in-api-gateway".',
168845
169110
  inputSchema: {
168846
- type: z626.string().describe("Observation type (e.g., decision, architecture, bugfix, discovery)"),
168847
- title: z626.string().describe("Observation title \u2014 used to generate the stable key")
169111
+ type: z627.string().describe("Observation type (e.g., decision, architecture, bugfix, discovery)"),
169112
+ title: z627.string().describe("Observation title \u2014 used to generate the stable key")
168848
169113
  }
168849
169114
  },
168850
169115
  async ({ type: obsType, title }) => {
@@ -168869,28 +169134,28 @@ Use this as the \`topicKey\` parameter in \`memorix_store\` to enable upsert beh
168869
169134
  title: "Search Memory",
168870
169135
  description: "Search project memory. Returns a compact index (~50-100 tokens/result). Do not use as a follow-up to a complete memorix_project_context brief unless a specific fact is still missing or the user asks for deeper history; provide purpose when intentionally expanding. Use memorix_detail to fetch full content for specific IDs. Use memorix_timeline to see chronological context. Searches across all observations stored from any IDE session \u2014 enabling cross-session and cross-agent context retrieval.",
168871
169136
  inputSchema: {
168872
- query: z626.string().describe("Search query (natural language or keywords)"),
168873
- limit: z626.number().optional().describe("Max results (default: 20)"),
168874
- type: z626.enum(OBSERVATION_TYPES).optional().describe("Filter by observation type"),
168875
- maxTokens: z626.number().optional().describe("Token budget \u2014 trim results to fit (0 = unlimited)"),
168876
- scope: z626.enum(["project", "global"]).optional().default("project").describe(
169137
+ query: z627.string().describe("Search query (natural language or keywords)"),
169138
+ limit: z627.number().optional().describe("Max results (default: 20)"),
169139
+ type: z627.enum(OBSERVATION_TYPES).optional().describe("Filter by observation type"),
169140
+ maxTokens: z627.number().optional().describe("Token budget \u2014 trim results to fit (0 = unlimited)"),
169141
+ scope: z627.enum(["project", "global"]).optional().default("project").describe(
168877
169142
  'Search scope: "project" (default) only searches current project, "global" searches all projects'
168878
169143
  ),
168879
- since: z626.string().optional().describe('Only return observations created after this date (ISO 8601 or natural like "2025-01-15")'),
168880
- until: z626.string().optional().describe('Only return observations created before this date (ISO 8601 or natural like "2025-02-01")'),
168881
- status: z626.enum(["active", "resolved", "archived", "all"]).optional().default("active").describe(
169144
+ since: z627.string().optional().describe('Only return observations created after this date (ISO 8601 or natural like "2025-01-15")'),
169145
+ until: z627.string().optional().describe('Only return observations created before this date (ISO 8601 or natural like "2025-02-01")'),
169146
+ status: z627.enum(["active", "resolved", "archived", "all"]).optional().default("active").describe(
168882
169147
  'Filter by memory status. "active" (default) shows current memories, "all" includes resolved/archived.'
168883
169148
  ),
168884
- source: z626.enum(["agent", "git", "manual"]).optional().describe(
169149
+ source: z627.enum(["agent", "git", "manual"]).optional().describe(
168885
169150
  'Filter by memory source. "git" returns only commit-derived ground truth memories. Omit for all sources.'
168886
169151
  ),
168887
- quality: z626.enum(["fast", "balanced", "thorough"]).optional().default("balanced").describe(
169152
+ quality: z627.enum(["fast", "balanced", "thorough"]).optional().default("balanced").describe(
168888
169153
  "Retrieval profile: fast stays local, balanced uses configured embeddings, thorough explicitly permits optional LLM refinement."
168889
169154
  ),
168890
- purpose: z626.string().optional().describe(
169155
+ purpose: z627.string().optional().describe(
168891
169156
  "Why this must expand beyond the latest Autopilot brief. Name the missing fact or the user's explicit request."
168892
169157
  ),
168893
- force: z626.boolean().optional().describe(
169158
+ force: z627.boolean().optional().describe(
168894
169159
  "Use only when the user explicitly asks to read a record already represented in the latest Autopilot brief."
168895
169160
  )
168896
169161
  }
@@ -168979,9 +169244,9 @@ _Search mode: ${getLastSearchMode2(project.id)}_`;
168979
169244
  title: "Memory Graph Context",
168980
169245
  description: "Build a compact, prompt-ready memory graph context packet for the current project. Use this for broad memory overview questions, project memory graph questions, or task-specific memory grounding. Returns high-signal memories, entities, relations, and risks as background context, not instructions.",
168981
169246
  inputSchema: {
168982
- query: z626.string().describe("Current task or topic to build memory graph context for"),
168983
- limit: z626.number().optional().describe("Max high-signal memories to include (default: 5)"),
168984
- format: z626.enum(["prompt", "summary"]).optional().default("prompt").describe(
169247
+ query: z627.string().describe("Current task or topic to build memory graph context for"),
169248
+ limit: z627.number().optional().describe("Max high-signal memories to include (default: 5)"),
169249
+ format: z627.enum(["prompt", "summary"]).optional().default("prompt").describe(
168985
169250
  'Output format. "prompt" is agent-ready; "summary" is a compact human overview.'
168986
169251
  )
168987
169252
  }
@@ -169016,14 +169281,14 @@ _Search mode: ${getLastSearchMode2(project.id)}_`;
169016
169281
  title: "Memory Autopilot Project Context",
169017
169282
  description: "Build a compact Memory Autopilot brief for the current coding task. Schedules Code Memory refresh when needed, includes Start here files, reliable code-bound memories, stale/suspect cautions, and verification hints. Use this at the start of a new coding turn or after switching tasks.",
169018
169283
  inputSchema: {
169019
- task: z626.string().optional().describe("Current coding task or question"),
169020
- refresh: z626.enum(["auto", "always", "never"]).optional().default("auto").describe(
169284
+ task: z627.string().optional().describe("Current coding task or question"),
169285
+ refresh: z627.enum(["auto", "always", "never"]).optional().default("auto").describe(
169021
169286
  "Code Memory refresh policy. auto refreshes only when missing or stale."
169022
169287
  ),
169023
- format: z626.enum(["prompt", "summary", "json", "receipt"]).optional().default("prompt").describe(
169288
+ format: z627.enum(["prompt", "summary", "json", "receipt"]).optional().default("prompt").describe(
169024
169289
  'Output format. "prompt" is agent-ready; "summary" is human-readable; "receipt" is bounded JSON; "json" is detailed diagnostics.'
169025
169290
  ),
169026
- agent: z626.enum([
169291
+ agent: z627.enum([
169027
169292
  "windsurf",
169028
169293
  "cursor",
169029
169294
  "claude-code",
@@ -169038,7 +169303,7 @@ _Search mode: ${getLastSearchMode2(project.id)}_`;
169038
169303
  "opencode",
169039
169304
  "trae"
169040
169305
  ]).optional().describe("Optional target agent for compatible workflow selection."),
169041
- limit: z626.number().optional().describe("Reserved for future source limits; current prompt stays compact by default.")
169306
+ limit: z627.number().optional().describe("Reserved for future source limits; current prompt stays compact by default.")
169042
169307
  }
169043
169308
  },
169044
169309
  async ({ task, refresh, format, agent }) => {
@@ -169139,12 +169404,12 @@ _Search mode: ${getLastSearchMode2(project.id)}_`;
169139
169404
  title: "Context Pack",
169140
169405
  description: "Build a prompt-ready working context pack for a coding task. Combines relevant memories, CodeGraph Memory facts, freshness warnings, suggested reads, and verification hints. After a complete memorix_project_context brief, provide purpose only when deliberately expanding beyond it.",
169141
169406
  inputSchema: {
169142
- task: z626.string().describe("Current coding task or question"),
169143
- limit: z626.preprocess(
169407
+ task: z627.string().describe("Current coding task or question"),
169408
+ limit: z627.preprocess(
169144
169409
  (value) => typeof value === "string" && value.trim() !== "" ? Number(value) : value,
169145
- z626.number().int().positive().max(100)
169410
+ z627.number().int().positive().max(100)
169146
169411
  ).optional().describe("Max active memories to inspect before code-ref filtering (default: 20)"),
169147
- purpose: z626.string().optional().describe(
169412
+ purpose: z627.string().optional().describe(
169148
169413
  "Why this must expand beyond the latest Autopilot brief. Name the missing fact or the user's explicit request."
169149
169414
  )
169150
169415
  }
@@ -169239,7 +169504,7 @@ _Search mode: ${getLastSearchMode2(project.id)}_`;
169239
169504
  title: "Knowledge Workspace",
169240
169505
  description: "Manage the reviewable project Knowledge Workspace. Use it only for deliberate knowledge operations: initialize a local or versioned workspace, review source-backed claims, compile proposals, lint, apply a reviewed proposal, or manage canonical workflows. It is intentionally absent from the default micro/lite profiles.",
169241
169506
  inputSchema: {
169242
- action: z626.enum([
169507
+ action: z627.enum([
169243
169508
  "workspace_init",
169244
169509
  "status",
169245
169510
  "claim_list",
@@ -169254,21 +169519,21 @@ _Search mode: ${getLastSearchMode2(project.id)}_`;
169254
169519
  "workflow_apply",
169255
169520
  "workflow_run"
169256
169521
  ]).describe("Knowledge operation to perform"),
169257
- mode: z626.enum(["local", "versioned"]).optional().default("local").describe("Workspace mode; versioned writes require an explicit project path during workspace_init"),
169258
- path: z626.string().optional().describe("Explicit versioned workspace path, used only by workspace_init"),
169259
- proposalId: z626.string().optional().describe("Pending proposal id for proposal_apply"),
169260
- allowManualOverwrite: z626.boolean().optional().default(false).describe("Explicitly allow proposal_apply to replace a manually edited page"),
169261
- claimId: z626.string().optional().describe("Source-backed claim id for claim_review"),
169262
- claimReviewState: z626.enum(["approved", "rejected"]).optional().describe("Deliberate review verdict for claim_review"),
169263
- reviewDetail: z626.string().max(2e3).optional().describe("Evidence check performed before approving or rejecting a claim"),
169264
- workflowId: z626.string().optional().describe("Canonical workflow id for workflow preview, apply, or run"),
169265
- agent: z626.string().optional().describe("Target agent for a workflow adapter"),
169266
- task: z626.string().optional().describe("Task text for workflow selection or a workflow run"),
169267
- outcome: z626.enum(["passed", "failed", "cancelled", "in-progress"]).optional().describe("Workflow run outcome"),
169268
- verificationVerdict: z626.enum(["passed", "failed", "not-run"]).optional().describe("Workflow run verification verdict"),
169269
- failureReason: z626.string().optional().describe("Sanitized workflow failure reason"),
169270
- startingSnapshotId: z626.string().optional().describe("Code snapshot id present when a workflow run began"),
169271
- evidenceIds: z626.array(z626.string()).max(24).optional().describe("Selected evidence ids for a workflow run")
169522
+ mode: z627.enum(["local", "versioned"]).optional().default("local").describe("Workspace mode; versioned writes require an explicit project path during workspace_init"),
169523
+ path: z627.string().optional().describe("Explicit versioned workspace path, used only by workspace_init"),
169524
+ proposalId: z627.string().optional().describe("Pending proposal id for proposal_apply"),
169525
+ allowManualOverwrite: z627.boolean().optional().default(false).describe("Explicitly allow proposal_apply to replace a manually edited page"),
169526
+ claimId: z627.string().optional().describe("Source-backed claim id for claim_review"),
169527
+ claimReviewState: z627.enum(["approved", "rejected"]).optional().describe("Deliberate review verdict for claim_review"),
169528
+ reviewDetail: z627.string().max(2e3).optional().describe("Evidence check performed before approving or rejecting a claim"),
169529
+ workflowId: z627.string().optional().describe("Canonical workflow id for workflow preview, apply, or run"),
169530
+ agent: z627.string().optional().describe("Target agent for a workflow adapter"),
169531
+ task: z627.string().optional().describe("Task text for workflow selection or a workflow run"),
169532
+ outcome: z627.enum(["passed", "failed", "cancelled", "in-progress"]).optional().describe("Workflow run outcome"),
169533
+ verificationVerdict: z627.enum(["passed", "failed", "not-run"]).optional().describe("Workflow run verification verdict"),
169534
+ failureReason: z627.string().optional().describe("Sanitized workflow failure reason"),
169535
+ startingSnapshotId: z627.string().optional().describe("Code snapshot id present when a workflow run began"),
169536
+ evidenceIds: z627.array(z627.string()).max(24).optional().describe("Selected evidence ids for a workflow run")
169272
169537
  }
169273
169538
  },
169274
169539
  async ({
@@ -169544,8 +169809,8 @@ _Search mode: ${getLastSearchMode2(project.id)}_`;
169544
169809
  title: "Resolve Memories",
169545
169810
  description: `Mark observations as resolved (completed/no longer active). Resolved memories are hidden from default search but can still be found with status="all". Use this to mark completed tasks, fixed bugs, or outdated information so they don't pollute future context.`,
169546
169811
  inputSchema: {
169547
- ids: z626.array(z626.number()).describe("Observation IDs to mark as resolved"),
169548
- status: z626.enum(["resolved", "archived"]).optional().default("resolved").describe(
169812
+ ids: z627.array(z627.number()).describe("Observation IDs to mark as resolved"),
169813
+ status: z627.enum(["resolved", "archived"]).optional().default("resolved").describe(
169549
169814
  'Target status: "resolved" (default, completed/done) or "archived" (permanently hidden)'
169550
169815
  )
169551
169816
  }
@@ -169583,17 +169848,17 @@ _Search mode: ${getLastSearchMode2(project.id)}_`;
169583
169848
  title: "Store Reasoning Trace",
169584
169849
  description: "Store a reasoning trace \u2014 WHY you chose this approach, what alternatives you considered, and what outcome you expect. This creates a searchable record of your decision-making process. Use this when making non-trivial technical decisions, choosing between approaches, or solving complex problems. Unlike regular memories that record WHAT happened, reasoning memories record HOW you thought about it.",
169585
169850
  inputSchema: {
169586
- entityName: z626.string().describe('The entity this reasoning applies to (e.g., "auth-module", "database-schema")'),
169587
- decision: z626.string().describe("What was decided or chosen"),
169588
- alternatives: z626.array(z626.string()).optional().describe("Other options that were considered"),
169589
- rationale: z626.string().describe("Why this approach was chosen over alternatives"),
169590
- constraints: z626.array(z626.string()).optional().describe("Constraints that influenced the decision (time, perf, compat, etc.)"),
169591
- expectedOutcome: z626.string().optional().describe("What outcome is expected from this decision"),
169592
- risks: z626.array(z626.string()).optional().describe("Known risks or potential downsides"),
169593
- concepts: z626.array(z626.string()).optional().describe("Related technical concepts"),
169594
- filesModified: z626.array(z626.string()).optional().describe("Files related to this reasoning"),
169595
- relatedCommits: z626.array(z626.string()).optional().describe("Git commit hashes this reasoning explains (links ground truth \u2194 reasoning)"),
169596
- relatedEntities: z626.array(z626.string()).optional().describe("Other entity names this reasoning relates to (cross-references)")
169851
+ entityName: z627.string().describe('The entity this reasoning applies to (e.g., "auth-module", "database-schema")'),
169852
+ decision: z627.string().describe("What was decided or chosen"),
169853
+ alternatives: z627.array(z627.string()).optional().describe("Other options that were considered"),
169854
+ rationale: z627.string().describe("Why this approach was chosen over alternatives"),
169855
+ constraints: z627.array(z627.string()).optional().describe("Constraints that influenced the decision (time, perf, compat, etc.)"),
169856
+ expectedOutcome: z627.string().optional().describe("What outcome is expected from this decision"),
169857
+ risks: z627.array(z627.string()).optional().describe("Known risks or potential downsides"),
169858
+ concepts: z627.array(z627.string()).optional().describe("Related technical concepts"),
169859
+ filesModified: z627.array(z627.string()).optional().describe("Files related to this reasoning"),
169860
+ relatedCommits: z627.array(z627.string()).optional().describe("Git commit hashes this reasoning explains (links ground truth \u2194 reasoning)"),
169861
+ relatedEntities: z627.array(z627.string()).optional().describe("Other entity names this reasoning relates to (cross-references)")
169597
169862
  }
169598
169863
  },
169599
169864
  async ({ entityName, decision, alternatives, rationale, constraints, expectedOutcome, risks, concepts, filesModified, relatedCommits, relatedEntities }) => {
@@ -169668,7 +169933,7 @@ Entity: ${entityName} | ${facts.length} facts | ${obs.tokens} tokens${reasoningA
169668
169933
  title: "Audit Project Attribution",
169669
169934
  description: "Scan the current project for observations that may have been written to the wrong project bucket. Identifies observations whose entityName appears exclusively in a different project. Read-only \u2014 no data is changed. Use memorix_resolve to archive confirmed mis-attributed observations.",
169670
169935
  inputSchema: {
169671
- threshold: z626.number().int().min(1).optional().describe(
169936
+ threshold: z627.number().int().min(1).optional().describe(
169672
169937
  "Minimum occurrences of an entityName in another project to flag it as suspicious (default: 2)"
169673
169938
  )
169674
169939
  }
@@ -169732,9 +169997,9 @@ Entity: ${entityName} | ${facts.length} facts | ${obs.tokens} tokens${reasoningA
169732
169997
  title: "Search Reasoning Patterns",
169733
169998
  description: "Search past reasoning traces to understand WHY decisions were made. Returns reasoning memories that explain the thought process behind technical choices. Use this when revisiting code, questioning a design decision, or looking for precedent on how similar problems were solved before.",
169734
169999
  inputSchema: {
169735
- query: z626.string().describe('Search query \u2014 describe what reasoning you want to find (e.g., "why did we choose PostgreSQL", "auth approach rationale")'),
169736
- limit: z626.number().optional().describe("Max results (default: 10)"),
169737
- scope: z626.enum(["project", "global"]).optional().default("project").describe("Search scope")
170000
+ query: z627.string().describe('Search query \u2014 describe what reasoning you want to find (e.g., "why did we choose PostgreSQL", "auth approach rationale")'),
170001
+ limit: z627.number().optional().describe("Max results (default: 10)"),
170002
+ scope: z627.enum(["project", "global"]).optional().default("project").describe("Search scope")
169738
170003
  }
169739
170004
  },
169740
170005
  async ({ query, limit: limit2, scope }) => {
@@ -169768,8 +170033,8 @@ ${result.formatted}` }]
169768
170033
  title: "Deduplicate Memories",
169769
170034
  description: "Scan active memories for duplicates, contradictions, and outdated information using LLM analysis. Automatically resolves redundant memories. Requires LLM to be configured (set MEMORIX_LLM_API_KEY or OPENAI_API_KEY environment variable). Without LLM, falls back to basic similarity-based consolidation.",
169770
170035
  inputSchema: {
169771
- query: z626.string().optional().describe("Optional query to scope dedup to a topic (default: scan all)"),
169772
- dryRun: z626.boolean().optional().default(false).describe("Preview only \u2014 show what would be resolved without making changes")
170036
+ query: z627.string().optional().describe("Optional query to scope dedup to a topic (default: scan all)"),
170037
+ dryRun: z627.boolean().optional().default(false).describe("Preview only \u2014 show what would be resolved without making changes")
169773
170038
  }
169774
170039
  },
169775
170040
  async ({ query, dryRun }) => {
@@ -169838,9 +170103,9 @@ ${actionLines.join("\n")}`
169838
170103
  title: "Memory Timeline",
169839
170104
  description: "Deep retrieval: expand chronological context around a specific observation \u2014 distinguishes explicit memory evolution, hook activity traces, and git-backed facts. Natural follow-up after session L1 routing hints (hook traces) or L3 evidence pointers (git memory).",
169840
170105
  inputSchema: {
169841
- anchorId: z626.number().describe("Observation ID to center the timeline on"),
169842
- depthBefore: z626.number().optional().describe("Number of observations before (default: 3)"),
169843
- depthAfter: z626.number().optional().describe("Number of observations after (default: 3)")
170106
+ anchorId: z627.number().describe("Observation ID to center the timeline on"),
170107
+ depthBefore: z627.number().optional().describe("Number of observations before (default: 3)"),
170108
+ depthAfter: z627.number().optional().describe("Number of observations after (default: 3)")
169844
170109
  }
169845
170110
  },
169846
170111
  async ({ anchorId, depthBefore, depthAfter }) => {
@@ -169870,18 +170135,18 @@ ${actionLines.join("\n")}`
169870
170135
  title: "Memory Details",
169871
170136
  description: 'Fetch full observation, mini-skill, or curated durable-memory details \u2014 includes source kind (explicit memory / hook trace / git evidence), value category, and cross-references (~500-1000 tokens each). Do not re-fetch content already covered by a complete memorix_project_context brief unless a specific fact is still missing or the user asks for deeper history; provide purpose when intentionally expanding. Always use memorix_search first to find relevant IDs, then fetch only what you need. Accepts typed refs from search results (e.g. "obs:42", "skill:3") and durable refs from a project brief (e.g. "durable:<uuid>") via the typedRefs field, or legacy numeric ids / object refs for backward compatibility.',
169872
170137
  inputSchema: {
169873
- ids: z626.array(z626.number()).optional().describe("Observation IDs to fetch (legacy, from memorix_search results)"),
169874
- refs: z626.array(
169875
- z626.object({
169876
- id: z626.number().describe("Observation ID"),
169877
- projectId: z626.string().optional().describe("Project ID for global-search disambiguation")
170138
+ ids: z627.array(z627.number()).optional().describe("Observation IDs to fetch (legacy, from memorix_search results)"),
170139
+ refs: z627.array(
170140
+ z627.object({
170141
+ id: z627.number().describe("Observation ID"),
170142
+ projectId: z627.string().optional().describe("Project ID for global-search disambiguation")
169878
170143
  })
169879
170144
  ).optional().describe("Explicit observation refs. Prefer this for global search results."),
169880
- typedRefs: z626.array(z626.string()).optional().describe('Typed memory refs from search results or a project brief, e.g. "obs:42", "skill:3", "durable:<uuid>", "obs:42@org/proj"'),
169881
- purpose: z626.string().optional().describe(
170145
+ typedRefs: z627.array(z627.string()).optional().describe('Typed memory refs from search results or a project brief, e.g. "obs:42", "skill:3", "durable:<uuid>", "obs:42@org/proj"'),
170146
+ purpose: z627.string().optional().describe(
169882
170147
  "Why this must expand beyond the latest Autopilot brief. Name the missing fact or the user's explicit request."
169883
170148
  ),
169884
- force: z626.boolean().optional().describe(
170149
+ force: z627.boolean().optional().describe(
169885
170150
  "Use only when the user explicitly asks to read a record already represented in the latest Autopilot brief."
169886
170151
  )
169887
170152
  }
@@ -169960,7 +170225,7 @@ ${actionLines.join("\n")}`
169960
170225
  title: "Memory Retention Status & Archive",
169961
170226
  description: 'Show memory retention status or archive expired memories. action="report" (default): show active/stale/archive-candidate counts. action="archive": move expired observations to archive file (reversible). action="stale": list stale observations with full retention explanation. Uses exponential decay scoring based on importance, age, and access patterns.',
169962
170227
  inputSchema: {
169963
- action: z626.enum(["report", "archive", "stale"]).optional().describe('Action: "report" (show status, default) or "archive" (move expired to archive) or "stale" (list stale observations with explanation)')
170228
+ action: z627.enum(["report", "archive", "stale"]).optional().describe('Action: "report" (show status, default) or "archive" (move expired to archive) or "stale" (list stale observations with explanation)')
169964
170229
  }
169965
170230
  },
169966
170231
  async (args) => {
@@ -170225,10 +170490,10 @@ ${Math.max(0, managedIds.size - result.resolved.length)} visible writable observ
170225
170490
  title: "Create Entities",
170226
170491
  description: "Create multiple new entities in the knowledge graph",
170227
170492
  inputSchema: {
170228
- entities: z626.array(z626.object({
170229
- name: z626.string().describe("The name of the entity"),
170230
- entityType: z626.string().describe("The type of the entity"),
170231
- observations: z626.array(z626.string()).describe("Initial observations")
170493
+ entities: z627.array(z627.object({
170494
+ name: z627.string().describe("The name of the entity"),
170495
+ entityType: z627.string().describe("The type of the entity"),
170496
+ observations: z627.array(z627.string()).describe("Initial observations")
170232
170497
  }))
170233
170498
  }
170234
170499
  },
@@ -170248,10 +170513,10 @@ ${Math.max(0, managedIds.size - result.resolved.length)} visible writable observ
170248
170513
  title: "Create Relations",
170249
170514
  description: "Create multiple new relations between entities in the knowledge graph. Relations should be in active voice. Recommended relation types (from mcp-memory-service): causes, fixes, supports, opposes, contradicts, depends_on, implements, extends, replaces, documents",
170250
170515
  inputSchema: {
170251
- relations: z626.array(z626.object({
170252
- from: z626.string().describe("Source entity name"),
170253
- to: z626.string().describe("Target entity name"),
170254
- relationType: z626.string().describe("Type of relation (e.g., causes, fixes, supports, depends_on, implements)")
170516
+ relations: z627.array(z627.object({
170517
+ from: z627.string().describe("Source entity name"),
170518
+ to: z627.string().describe("Target entity name"),
170519
+ relationType: z627.string().describe("Type of relation (e.g., causes, fixes, supports, depends_on, implements)")
170255
170520
  }))
170256
170521
  }
170257
170522
  },
@@ -170271,9 +170536,9 @@ ${Math.max(0, managedIds.size - result.resolved.length)} visible writable observ
170271
170536
  title: "Add Observations",
170272
170537
  description: "Add new observations to existing entities in the knowledge graph",
170273
170538
  inputSchema: {
170274
- observations: z626.array(z626.object({
170275
- entityName: z626.string().describe("Entity name to add observations to"),
170276
- contents: z626.array(z626.string()).describe("Observation contents to add")
170539
+ observations: z627.array(z627.object({
170540
+ entityName: z627.string().describe("Entity name to add observations to"),
170541
+ contents: z627.array(z627.string()).describe("Observation contents to add")
170277
170542
  }))
170278
170543
  }
170279
170544
  },
@@ -170293,7 +170558,7 @@ ${Math.max(0, managedIds.size - result.resolved.length)} visible writable observ
170293
170558
  title: "Delete Entities",
170294
170559
  description: "Delete multiple entities and their associated relations from the knowledge graph",
170295
170560
  inputSchema: {
170296
- entityNames: z626.array(z626.string()).describe("Entity names to delete")
170561
+ entityNames: z627.array(z627.string()).describe("Entity names to delete")
170297
170562
  }
170298
170563
  },
170299
170564
  async ({ entityNames }) => {
@@ -170312,9 +170577,9 @@ ${Math.max(0, managedIds.size - result.resolved.length)} visible writable observ
170312
170577
  title: "Delete Observations",
170313
170578
  description: "Delete specific observations from entities in the knowledge graph",
170314
170579
  inputSchema: {
170315
- deletions: z626.array(z626.object({
170316
- entityName: z626.string().describe("Entity containing the observations"),
170317
- observations: z626.array(z626.string()).describe("Observations to delete")
170580
+ deletions: z627.array(z627.object({
170581
+ entityName: z627.string().describe("Entity containing the observations"),
170582
+ observations: z627.array(z627.string()).describe("Observations to delete")
170318
170583
  }))
170319
170584
  }
170320
170585
  },
@@ -170334,10 +170599,10 @@ ${Math.max(0, managedIds.size - result.resolved.length)} visible writable observ
170334
170599
  title: "Delete Relations",
170335
170600
  description: "Delete multiple relations from the knowledge graph",
170336
170601
  inputSchema: {
170337
- relations: z626.array(z626.object({
170338
- from: z626.string(),
170339
- to: z626.string(),
170340
- relationType: z626.string()
170602
+ relations: z627.array(z627.object({
170603
+ from: z627.string(),
170604
+ to: z627.string(),
170605
+ relationType: z627.string()
170341
170606
  }))
170342
170607
  }
170343
170608
  },
@@ -170386,7 +170651,7 @@ ${Math.max(0, managedIds.size - result.resolved.length)} visible writable observ
170386
170651
  title: "Search Nodes",
170387
170652
  description: "Search for nodes in the knowledge graph based on a query",
170388
170653
  inputSchema: {
170389
- query: z626.string().describe("Search query to match against entity names, types, and observations")
170654
+ query: z627.string().describe("Search query to match against entity names, types, and observations")
170390
170655
  }
170391
170656
  },
170392
170657
  async ({ query }) => {
@@ -170405,7 +170670,7 @@ ${Math.max(0, managedIds.size - result.resolved.length)} visible writable observ
170405
170670
  title: "Open Nodes",
170406
170671
  description: "Open specific nodes in the knowledge graph by their names",
170407
170672
  inputSchema: {
170408
- names: z626.array(z626.string()).describe("Entity names to retrieve")
170673
+ names: z627.array(z627.string()).describe("Entity names to retrieve")
170409
170674
  }
170410
170675
  },
170411
170676
  async ({ names }) => {
@@ -170427,8 +170692,8 @@ ${Math.max(0, managedIds.size - result.resolved.length)} visible writable observ
170427
170692
  title: "Rules Sync",
170428
170693
  description: "Scan project for agent rule files (Cursor, Claude Code, Codex, Windsurf, Antigravity, Gemini CLI, Copilot, Kiro, OpenCode, Trae), deduplicate, detect conflicts, and optionally generate rules for a target agent format. Without target: returns sync status report. With target: generates converted rule files.",
170429
170694
  inputSchema: {
170430
- action: z626.enum(["status", "generate"]).describe('Action: "status" for report, "generate" to produce target files'),
170431
- target: z626.enum(RULE_SOURCES).optional().describe("Target agent format for generation (required when action=generate)")
170695
+ action: z627.enum(["status", "generate"]).describe('Action: "status" for report, "generate" to produce target files'),
170696
+ target: z627.enum(RULE_SOURCES).optional().describe("Target agent format for generation (required when action=generate)")
170432
170697
  }
170433
170698
  },
170434
170699
  async ({ action, target }) => {
@@ -170483,9 +170748,9 @@ ${Math.max(0, managedIds.size - result.resolved.length)} visible writable observ
170483
170748
  title: "Workspace Sync",
170484
170749
  description: 'Migrate your entire workspace environment between AI coding agents (Cursor, Windsurf, Claude Code, Codex, Copilot, Gemini CLI, OpenClaw, Hermes Agent, Oh-my-Pi, Kiro, Antigravity, OpenCode, Trae). Syncs MCP server configs, workflows, rules, and skills across IDEs. Action "scan": detect all workspace configs. Action "migrate": generate configs for target agent (preview only). Action "apply": migrate AND write configs to disk with backup/rollback.',
170485
170750
  inputSchema: {
170486
- action: z626.enum(["scan", "migrate", "apply"]).describe('Action: "scan" to detect configs, "migrate" to preview, "apply" to write to disk'),
170487
- target: z626.enum(AGENT_TARGETS).optional().describe("Target agent for migration (required for migrate)"),
170488
- items: z626.array(z626.string()).optional().describe('Selective sync: list specific MCP server or skill names to sync (e.g. ["figma-remote-mcp-server", "create-subagent"]). Omit to sync all.')
170751
+ action: z627.enum(["scan", "migrate", "apply"]).describe('Action: "scan" to detect configs, "migrate" to preview, "apply" to write to disk'),
170752
+ target: z627.enum(AGENT_TARGETS).optional().describe("Target agent for migration (required for migrate)"),
170753
+ items: z627.array(z627.string()).optional().describe('Selective sync: list specific MCP server or skill names to sync (e.g. ["figma-remote-mcp-server", "create-subagent"]). Omit to sync all.')
170489
170754
  }
170490
170755
  },
170491
170756
  async ({ action, target, items }) => {
@@ -170581,10 +170846,10 @@ ${Math.max(0, managedIds.size - result.resolved.length)} visible writable observ
170581
170846
  title: "Project Skills",
170582
170847
  description: `Memory-driven project skills. Action "list": show all available skills from all agents. Action "generate": auto-generate project-specific skills from observation patterns (gotchas, decisions, how-it-works). Action "inject": return a specific skill's full content for direct use. Generated skills follow the SKILL.md standard and can be synced across Cursor, Windsurf, Claude Code, Codex, Copilot, Kiro, Antigravity, OpenCode, and Trae. OpenClaw, Hermes Agent, and Oh-my-Pi receive skills through their official bundle/plugin/package setup lanes rather than generic workspace skill copy.`,
170583
170848
  inputSchema: {
170584
- action: z626.enum(["list", "generate", "inject"]).describe('Action: "list" to discover skills, "generate" to create from memory, "inject" to get skill content'),
170585
- name: z626.string().optional().describe('Skill name (required for "inject")'),
170586
- target: z626.enum(AGENT_TARGETS).optional().describe('Target agent to write generated skills to (optional for "generate")'),
170587
- write: z626.boolean().optional().describe("Whether to write generated skills to disk (default: false, preview only)")
170849
+ action: z627.enum(["list", "generate", "inject"]).describe('Action: "list" to discover skills, "generate" to create from memory, "inject" to get skill content'),
170850
+ name: z627.string().optional().describe('Skill name (required for "inject")'),
170851
+ target: z627.enum(AGENT_TARGETS).optional().describe('Target agent to write generated skills to (optional for "generate")'),
170852
+ write: z627.boolean().optional().describe("Whether to write generated skills to disk (default: false, preview only)")
170588
170853
  }
170589
170854
  },
170590
170855
  async ({ action, name, target, write }) => {
@@ -170694,12 +170959,12 @@ ${skill2.content}` }]
170694
170959
  title: "Promote to Mini-Skill",
170695
170960
  description: 'Promote observations to permanent mini-skills that never decay and are auto-injected at session start. Action "promote": convert observation(s) to a mini-skill. Action "list": show all active mini-skills. Action "delete": remove a mini-skill by ID.\n\nMini-skills are project-specific specialized knowledge derived from your actual memories \u2014 gotchas, decisions, fixes that generic online skills cannot provide.',
170696
170961
  inputSchema: {
170697
- action: z626.enum(["promote", "list", "delete"]).describe("Action to perform"),
170698
- observationIds: z626.array(z626.number()).optional().describe('Observation IDs to promote (required for "promote")'),
170699
- skillId: z626.number().optional().describe('Mini-skill ID to delete (required for "delete")'),
170700
- trigger: z626.string().optional().describe("Override: when this skill should be applied"),
170701
- instruction: z626.string().optional().describe("Override: what the agent should do"),
170702
- tags: z626.array(z626.string()).optional().describe("Extra classification tags")
170962
+ action: z627.enum(["promote", "list", "delete"]).describe("Action to perform"),
170963
+ observationIds: z627.array(z627.number()).optional().describe('Observation IDs to promote (required for "promote")'),
170964
+ skillId: z627.number().optional().describe('Mini-skill ID to delete (required for "delete")'),
170965
+ trigger: z627.string().optional().describe("Override: when this skill should be applied"),
170966
+ instruction: z627.string().optional().describe("Override: what the agent should do"),
170967
+ tags: z627.array(z627.string()).optional().describe("Extra classification tags")
170703
170968
  }
170704
170969
  },
170705
170970
  async ({ action, observationIds, skillId, trigger, instruction, tags }) => {
@@ -170778,8 +171043,8 @@ ${skill2.content}` }]
170778
171043
  title: "Consolidate Memories",
170779
171044
  description: 'Find and merge similar observations to reduce memory bloat. Uses text similarity to cluster related observations by entity+type, then merges them into single consolidated records. Use action="preview" to see candidates without changing data, action="execute" to merge.\n\nExample: 10 similar gotchas about Windows paths \u2192 1 consolidated gotcha with all facts preserved.',
170780
171045
  inputSchema: {
170781
- action: z626.enum(["preview", "execute"]).describe("preview = dry run showing candidates, execute = actually merge"),
170782
- threshold: z626.number().optional().describe("Similarity threshold 0.0-1.0 (default: 0.45). Lower = more aggressive merging")
171046
+ action: z627.enum(["preview", "execute"]).describe("preview = dry run showing candidates, execute = actually merge"),
171047
+ threshold: z627.number().optional().describe("Similarity threshold 0.0-1.0 (default: 0.45). Lower = more aggressive merging")
170783
171048
  }
170784
171049
  },
170785
171050
  async ({ action, threshold }) => {
@@ -170825,13 +171090,13 @@ ${skill2.content}` }]
170825
171090
  title: "Start Session",
170826
171091
  description: "Start a new coding session. Returns a compact continuation card with the latest handoff and a few memory references. Call this at the beginning of a session to track activity; retrieve a referenced memory only when it is relevant. Any previous active session for this project will be auto-closed. By default this is lightweight: it binds the project, opens a session, and avoids dumping full history into the new context. Coordination identity is opt-in via `joinTeam: true` or a separate `team_manage` join call.\n\nIMPORTANT for HTTP/control-plane mode: pass `projectRoot` with the absolute path to your workspace root (e.g., the directory open in your IDE). Memorix uses this to detect the git project and bind this session to the correct project context. Without it, project-scoped tools will be disabled.",
170827
171092
  inputSchema: {
170828
- sessionId: z626.string().optional().describe("Custom session ID (auto-generated if omitted)"),
170829
- agent: z626.string().optional().describe('Agent/IDE name (e.g., "cursor", "windsurf", "claude-code")'),
170830
- agentType: z626.string().optional().describe('Agent type used for optional coordination identity mapping (e.g., "windsurf", "cursor").'),
170831
- instanceId: z626.string().optional().describe("Stable instance ID for optional coordination identity across restarts. If omitted with joinTeam=true, Memorix derives a deterministic fallback from the project and agent identity."),
170832
- joinTeam: z626.boolean().optional().describe("If true, also join orchestration coordination state for this session. Defaults to false."),
170833
- role: z626.string().optional().describe("Explicit role override used only when joinTeam=true."),
170834
- projectRoot: z626.string().optional().describe(
171093
+ sessionId: z627.string().optional().describe("Custom session ID (auto-generated if omitted)"),
171094
+ agent: z627.string().optional().describe('Agent/IDE name (e.g., "cursor", "windsurf", "claude-code")'),
171095
+ agentType: z627.string().optional().describe('Agent type used for optional coordination identity mapping (e.g., "windsurf", "cursor").'),
171096
+ instanceId: z627.string().optional().describe("Stable instance ID for optional coordination identity across restarts. If omitted with joinTeam=true, Memorix derives a deterministic fallback from the project and agent identity."),
171097
+ joinTeam: z627.boolean().optional().describe("If true, also join orchestration coordination state for this session. Defaults to false."),
171098
+ role: z627.string().optional().describe("Explicit role override used only when joinTeam=true."),
171099
+ projectRoot: z627.string().optional().describe(
170835
171100
  "Absolute path to the workspace/project root directory (e.g., the folder open in your IDE). Memorix will detect the git project from this path and bind this session to it. Required for HTTP transport when multiple projects are open simultaneously or when rebinding an existing control-plane session."
170836
171101
  )
170837
171102
  }
@@ -171038,8 +171303,8 @@ ${s2.instruction}`.toLowerCase();
171038
171303
  title: "End Session",
171039
171304
  description: "End a coding session with a structured summary. This summary will be injected into the next session so the next agent can resume work seamlessly.\n\nRecommended summary format:\n## Goal\n[What we were working on]\n\n## Discoveries\n- [Technical findings, gotchas, learnings]\n\n## Accomplished\n- [OK] [Completed tasks]\n- [PENDING] [Pending for next session]\n\n## Relevant Files\n- path/to/file \u2014 [what changed]",
171040
171305
  inputSchema: {
171041
- sessionId: z626.string().describe("Session ID to close (from memorix_session_start)"),
171042
- summary: z626.string().optional().describe("Structured session summary (Goal/Discoveries/Accomplished/Files format)")
171306
+ sessionId: z627.string().describe("Session ID to close (from memorix_session_start)"),
171307
+ summary: z627.string().optional().describe("Structured session summary (Goal/Discoveries/Accomplished/Files format)")
171043
171308
  }
171044
171309
  },
171045
171310
  async ({ sessionId, summary }) => {
@@ -171067,7 +171332,7 @@ ${summary ? "Summary saved for next session context injection." : "No summary pr
171067
171332
  title: "Session Context",
171068
171333
  description: "Get context from previous coding sessions. Use this after compaction to recover lost context, or to manually review session history. Returns previous session summaries and key observations.",
171069
171334
  inputSchema: {
171070
- limit: z626.number().optional().describe("Number of recent sessions to include (default: 3)")
171335
+ limit: z627.number().optional().describe("Number of recent sessions to include (default: 3)")
171071
171336
  }
171072
171337
  },
171073
171338
  async ({ limit: limit2 }) => {
@@ -171100,14 +171365,14 @@ ${summary ? "Summary saved for next session context injection." : "No summary pr
171100
171365
  title: "Compact Continuity Checkpoints",
171101
171366
  description: "Inspect, preview, or archive bounded checkpoints recorded around a host-native context compaction. Use only to debug or explicitly review compaction continuity. These are lifecycle records, not durable memories or transcript backups. CLI equivalent: memorix checkpoint list|show|context|archive.",
171102
171367
  inputSchema: {
171103
- action: z626.enum(["list", "show", "context", "archive"]).default("list"),
171104
- id: z626.string().optional().describe("Checkpoint ID for show, context, or archive"),
171105
- sessionId: z626.string().optional().describe("Optional host session ID filter"),
171106
- agent: z626.string().optional().describe("Optional host agent filter"),
171107
- task: z626.string().optional().describe("Current task for a bounded context preview"),
171108
- maxTokens: z626.number().optional().describe("Maximum tokens for action=context (default: 420)"),
171109
- limit: z626.number().optional().describe("Maximum records for action=list (default: 20)"),
171110
- includeArchived: z626.boolean().optional().default(false).describe("Include archived records in action=list")
171368
+ action: z627.enum(["list", "show", "context", "archive"]).default("list"),
171369
+ id: z627.string().optional().describe("Checkpoint ID for show, context, or archive"),
171370
+ sessionId: z627.string().optional().describe("Optional host session ID filter"),
171371
+ agent: z627.string().optional().describe("Optional host agent filter"),
171372
+ task: z627.string().optional().describe("Current task for a bounded context preview"),
171373
+ maxTokens: z627.number().optional().describe("Maximum tokens for action=context (default: 420)"),
171374
+ limit: z627.number().optional().describe("Maximum records for action=list (default: 20)"),
171375
+ includeArchived: z627.boolean().optional().default(false).describe("Include archived records in action=list")
171111
171376
  }
171112
171377
  },
171113
171378
  async ({ action, id, sessionId, agent, task, maxTokens, limit: limit2, includeArchived }) => {
@@ -171180,9 +171445,9 @@ ${summary ? "Summary saved for next session context injection." : "No summary pr
171180
171445
  title: "Transfer Memories",
171181
171446
  description: 'Export or import project memories. Action "export": export observations visible to the current agent and project sessions (JSON or Markdown). Action "import": import from a JSON export (re-assigns IDs, skips duplicate topicKeys).',
171182
171447
  inputSchema: {
171183
- action: z626.enum(["export", "import"]).describe("Operation: export or import"),
171184
- format: z626.enum(["json", "markdown"]).optional().describe("Export format (for export, default: json)"),
171185
- data: z626.string().optional().describe("JSON string from a previous export (for import)")
171448
+ action: z627.enum(["export", "import"]).describe("Operation: export or import"),
171449
+ format: z627.enum(["json", "markdown"]).optional().describe("Export format (for export, default: json)"),
171450
+ data: z627.string().optional().describe("JSON string from a previous export (for import)")
171186
171451
  }
171187
171452
  },
171188
171453
  async ({ action, format, data: jsonStr }) => {
@@ -171231,7 +171496,7 @@ ${json2}
171231
171496
  title: "Launch Dashboard",
171232
171497
  description: "Launch the Memorix Web Dashboard in the browser. In HTTP control-plane mode, this reuses the current control-plane dashboard. In stdio/standalone mode, it starts the standalone dashboard server.",
171233
171498
  inputSchema: {
171234
- port: z626.number().optional().describe("Optional port override for standalone mode. In HTTP control-plane mode, the active dashboard port is reused.")
171499
+ port: z627.number().optional().describe("Optional port override for standalone mode. In HTTP control-plane mode, the active dashboard port is reused.")
171235
171500
  }
171236
171501
  },
171237
171502
  async ({ port: dashboardPort }) => {
@@ -171395,13 +171660,13 @@ ${json2}
171395
171660
  title: "Evidence Cards",
171396
171661
  description: "Inspect the bounded, project-scoped provenance cards behind Memorix context. Use list for a compact index, get/events for one source, sync to repair the projection, and stale when known source files changed. Cards expose sourceRef, locator, capturedHash, and freshness.",
171397
171662
  inputSchema: {
171398
- action: z626.enum(["list", "get", "sync", "stale", "events"]).describe("Evidence operation"),
171399
- candidateKind: z626.enum(["observation", "code", "git", "test", "document", "workflow", "graph"]).optional().default("observation"),
171400
- candidateId: z626.string().optional().describe("Candidate id, usually an observation id"),
171401
- query: z626.string().optional().describe("Optional title/source query for list"),
171402
- paths: z626.array(z626.string()).max(200).optional().describe("Changed source paths for stale"),
171403
- reason: z626.string().max(500).optional().describe("Why evidence became stale"),
171404
- limit: z626.number().int().positive().max(100).optional().default(20)
171663
+ action: z627.enum(["list", "get", "sync", "stale", "events"]).describe("Evidence operation"),
171664
+ candidateKind: z627.enum(["observation", "code", "git", "test", "document", "workflow", "graph"]).optional().default("observation"),
171665
+ candidateId: z627.string().optional().describe("Candidate id, usually an observation id"),
171666
+ query: z627.string().optional().describe("Optional title/source query for list"),
171667
+ paths: z627.array(z627.string()).max(200).optional().describe("Changed source paths for stale"),
171668
+ reason: z627.string().max(500).optional().describe("Why evidence became stale"),
171669
+ limit: z627.number().int().positive().max(100).optional().default(20)
171405
171670
  }
171406
171671
  },
171407
171672
  async ({ action, candidateKind, candidateId, query, paths, reason, limit: limit2 }) => {
@@ -171441,15 +171706,15 @@ ${json2}
171441
171706
  title: "Memory Feedback",
171442
171707
  description: "Record or inspect auditable memory outcomes. Positive verification/use strengthens recall; correction, conflict, source change, or weaken lowers it. Use revoke with targetEventId to undo one prior signal without deleting audit history.",
171443
171708
  inputSchema: {
171444
- action: z626.enum(["record", "show", "audit"]).describe("Feedback operation"),
171445
- candidateKind: z626.enum(["observation", "claim", "durable-memory", "workflow"]).optional().default("observation"),
171446
- candidateId: z626.string().describe("Memory or knowledge candidate id"),
171447
- signal: z626.enum(["user-correction", "verification-success", "verification-failure", "code-change", "used", "not-used", "code-conflict", "strengthen", "weaken", "revoke"]).optional(),
171448
- sourceRef: z626.string().max(500).optional().describe("Source of this feedback, such as test:run-42 or user:chat"),
171449
- actor: z626.string().max(200).optional(),
171450
- note: z626.string().max(2e3).optional(),
171451
- targetEventId: z626.string().optional().describe("Existing event id when action=record and signal=revoke"),
171452
- limit: z626.number().int().positive().max(200).optional().default(100)
171709
+ action: z627.enum(["record", "show", "audit"]).describe("Feedback operation"),
171710
+ candidateKind: z627.enum(["observation", "claim", "durable-memory", "workflow"]).optional().default("observation"),
171711
+ candidateId: z627.string().describe("Memory or knowledge candidate id"),
171712
+ signal: z627.enum(["user-correction", "verification-success", "verification-failure", "code-change", "used", "not-used", "code-conflict", "strengthen", "weaken", "revoke"]).optional(),
171713
+ sourceRef: z627.string().max(500).optional().describe("Source of this feedback, such as test:run-42 or user:chat"),
171714
+ actor: z627.string().max(200).optional(),
171715
+ note: z627.string().max(2e3).optional(),
171716
+ targetEventId: z627.string().optional().describe("Existing event id when action=record and signal=revoke"),
171717
+ limit: z627.number().int().positive().max(200).optional().default(100)
171453
171718
  }
171454
171719
  },
171455
171720
  async ({ action, candidateKind, candidateId, signal, sourceRef, actor, note, targetEventId, limit: limit2 }) => {
@@ -171515,19 +171780,19 @@ ${json2}
171515
171780
  title: "Coordination Management",
171516
171781
  description: 'Register, unregister, or list agents in the project coordination state. Action "join": register this agent (returns agent ID and instance ID for reactivation). Action "leave": mark agent inactive, release locks. Action "status": list all agents with roles and capabilities, plus role occupancy. Action "listRoles": show defined roles for this project. Action "addRole": define a new role for this project. Action "removeRole": remove a role definition.',
171517
171782
  inputSchema: {
171518
- action: z626.enum(["join", "leave", "status", "listRoles", "addRole", "removeRole"]).describe("Operation to perform"),
171519
- name: z626.string().optional().describe('Agent display name for join (e.g., "cursor-frontend")'),
171520
- agentType: z626.string().optional().describe('Agent type for join (e.g., "windsurf", "cursor", "claude-code")'),
171521
- instanceId: z626.string().optional().describe("Stable instance ID for join (preserves identity across restarts)"),
171522
- role: z626.string().optional().describe("Agent role for join (defaults by agentType if omitted)"),
171523
- capabilities: z626.array(z626.string()).optional().describe("Agent capabilities for join"),
171524
- agentId: z626.string().optional().describe("Agent ID for leave"),
171783
+ action: z627.enum(["join", "leave", "status", "listRoles", "addRole", "removeRole"]).describe("Operation to perform"),
171784
+ name: z627.string().optional().describe('Agent display name for join (e.g., "cursor-frontend")'),
171785
+ agentType: z627.string().optional().describe('Agent type for join (e.g., "windsurf", "cursor", "claude-code")'),
171786
+ instanceId: z627.string().optional().describe("Stable instance ID for join (preserves identity across restarts)"),
171787
+ role: z627.string().optional().describe("Agent role for join (defaults by agentType if omitted)"),
171788
+ capabilities: z627.array(z627.string()).optional().describe("Agent capabilities for join"),
171789
+ agentId: z627.string().optional().describe("Agent ID for leave"),
171525
171790
  // Role management params
171526
- roleId: z626.string().optional().describe("Role ID (for addRole/removeRole)"),
171527
- label: z626.string().optional().describe("Role label (for addRole)"),
171528
- roleDescription: z626.string().optional().describe("Role description (for addRole)"),
171529
- preferredAgentTypes: z626.array(z626.string()).optional().describe("Preferred agent types for this role (for addRole)"),
171530
- maxConcurrent: z626.number().optional().describe("Max concurrent agents for this role (for addRole, default 1)")
171791
+ roleId: z627.string().optional().describe("Role ID (for addRole/removeRole)"),
171792
+ label: z627.string().optional().describe("Role label (for addRole)"),
171793
+ roleDescription: z627.string().optional().describe("Role description (for addRole)"),
171794
+ preferredAgentTypes: z627.array(z627.string()).optional().describe("Preferred agent types for this role (for addRole)"),
171795
+ maxConcurrent: z627.number().optional().describe("Max concurrent agents for this role (for addRole, default 1)")
171531
171796
  }
171532
171797
  },
171533
171798
  async ({ action, name, agentType, instanceId, role, capabilities, agentId, roleId, label, roleDescription, preferredAgentTypes, maxConcurrent }) => {
@@ -171640,9 +171905,9 @@ ${agentLines.join("\n")}`
171640
171905
  title: "File Lock Management",
171641
171906
  description: 'Advisory file locks to prevent conflicting edits. Auto-releases after 10 min TTL. Action "lock": acquire lock. Action "unlock": release lock. Action "status": check lock status.',
171642
171907
  inputSchema: {
171643
- action: z626.enum(["lock", "unlock", "status"]).describe("Operation to perform"),
171644
- file: z626.string().optional().describe("File path (required for lock/unlock, optional for status \u2014 omit to list all)"),
171645
- agentId: z626.string().optional().describe("Agent ID (required for lock/unlock)")
171908
+ action: z627.enum(["lock", "unlock", "status"]).describe("Operation to perform"),
171909
+ file: z627.string().optional().describe("File path (required for lock/unlock, optional for status \u2014 omit to list all)"),
171910
+ agentId: z627.string().optional().describe("Agent ID (required for lock/unlock)")
171646
171911
  }
171647
171912
  },
171648
171913
  async ({ action, file, agentId }) => {
@@ -171684,17 +171949,17 @@ ${lines.join("\n")}` }] };
171684
171949
  title: "Task Status",
171685
171950
  description: 'Create, claim, complete, or list tasks in the team task board. Supports dependencies. Action "create": create a task. Action "claim": assign to yourself (atomic, race-safe). Action "complete": mark done with result. Action "list": show tasks.',
171686
171951
  inputSchema: {
171687
- action: z626.enum(["create", "claim", "complete", "list"]).describe("Operation to perform"),
171688
- description: z626.string().optional().describe("Task description (for create)"),
171689
- deps: z626.array(z626.string()).optional().describe("Dependency task IDs (for create)"),
171690
- taskId: z626.string().optional().describe("Task ID (for claim/complete)"),
171691
- agentId: z626.string().optional().describe("Agent ID (for claim/complete)"),
171692
- result: z626.string().optional().describe("Result summary (for complete)"),
171693
- status: z626.enum(["pending", "in_progress", "completed", "failed"]).optional().describe("Filter by status (for list)"),
171694
- available: z626.boolean().optional().describe("Show only claimable tasks (for list)"),
171695
- metadata: z626.string().optional().describe("JSON metadata for the task (for create). Used by planner/review tasks for autonomous mode."),
171696
- requiredRole: z626.string().optional().describe("Required role for this task (for create). Agents without this role cannot claim."),
171697
- preferredRole: z626.string().optional().describe("Preferred role for this task (for create). Agents with this role are prioritized.")
171952
+ action: z627.enum(["create", "claim", "complete", "list"]).describe("Operation to perform"),
171953
+ description: z627.string().optional().describe("Task description (for create)"),
171954
+ deps: z627.array(z627.string()).optional().describe("Dependency task IDs (for create)"),
171955
+ taskId: z627.string().optional().describe("Task ID (for claim/complete)"),
171956
+ agentId: z627.string().optional().describe("Agent ID (for claim/complete)"),
171957
+ result: z627.string().optional().describe("Result summary (for complete)"),
171958
+ status: z627.enum(["pending", "in_progress", "completed", "failed"]).optional().describe("Filter by status (for list)"),
171959
+ available: z627.boolean().optional().describe("Show only claimable tasks (for list)"),
171960
+ metadata: z627.string().optional().describe("JSON metadata for the task (for create). Used by planner/review tasks for autonomous mode."),
171961
+ requiredRole: z627.string().optional().describe("Required role for this task (for create). Agents without this role cannot claim."),
171962
+ preferredRole: z627.string().optional().describe("Preferred role for this task (for create). Agents with this role are prioritized.")
171698
171963
  }
171699
171964
  },
171700
171965
  async ({ action, description: desc, deps, taskId, agentId, result, status, available, metadata, requiredRole, preferredRole }) => {
@@ -171767,15 +172032,15 @@ ${lines.join("\n")}` }] };
171767
172032
  title: "Team Messaging",
171768
172033
  description: `Send, broadcast, or read messages between agents. Durable: messages survive restarts and reach inactive recipients. Action "send": direct message to one agent. Action "broadcast": message all agents. Action "inbox": read this agent's inbox.`,
171769
172034
  inputSchema: {
171770
- action: z626.enum(["send", "broadcast", "inbox"]).describe("Operation to perform"),
171771
- from: z626.string().optional().describe("Your sender agent ID. Omit it to use this session identity."),
171772
- to: z626.string().optional().describe("Receiver agent ID (for send)"),
171773
- type: z626.enum(["request", "response", "info", "announcement", "contract", "error", "handoff"]).optional().describe("Message type (for send/broadcast)"),
171774
- content: z626.string().optional().describe("Message content (for send/broadcast)"),
171775
- agentId: z626.string().optional().describe("Agent ID (for inbox)"),
171776
- markRead: z626.boolean().optional().default(false).describe("Mark messages as read (for inbox)"),
171777
- toRole: z626.string().optional().describe("Target role for role-based messaging/handoff (for send)"),
171778
- handoffStatus: z626.enum(["open", "claimed", "completed", "archived"]).optional().describe("Handoff status (for send with type=handoff)")
172035
+ action: z627.enum(["send", "broadcast", "inbox"]).describe("Operation to perform"),
172036
+ from: z627.string().optional().describe("Your sender agent ID. Omit it to use this session identity."),
172037
+ to: z627.string().optional().describe("Receiver agent ID (for send)"),
172038
+ type: z627.enum(["request", "response", "info", "announcement", "contract", "error", "handoff"]).optional().describe("Message type (for send/broadcast)"),
172039
+ content: z627.string().optional().describe("Message content (for send/broadcast)"),
172040
+ agentId: z627.string().optional().describe("Agent ID (for inbox)"),
172041
+ markRead: z627.boolean().optional().default(false).describe("Mark messages as read (for inbox)"),
172042
+ toRole: z627.string().optional().describe("Target role for role-based messaging/handoff (for send)"),
172043
+ handoffStatus: z627.enum(["open", "claimed", "completed", "archived"]).optional().describe("Handoff status (for send with type=handoff)")
171779
172044
  }
171780
172045
  },
171781
172046
  async ({ action, from, to, type: msgType, content, agentId, markRead, toRole, handoffStatus }) => {
@@ -171845,8 +172110,8 @@ ${lines.join("\n")}` }] };
171845
172110
  title: "Team Poll \u2014 Situational Awareness",
171846
172111
  description: "Get a full snapshot of your project coordination state in one call. Returns: your agent info, watermark (new observations since last session), inbox (unread messages), tasks (your in-progress, available to claim, completed, failed), and team roster (active agents). Use this to decide what to work on next.",
171847
172112
  inputSchema: {
171848
- agentId: z626.string().optional().describe("Your agent ID (from team_manage join or session_start with joinTeam=true). If omitted, returns project-level overview only."),
171849
- markInboxRead: z626.boolean().optional().describe("If true, mark all inbox messages as read after returning them.")
172113
+ agentId: z627.string().optional().describe("Your agent ID (from team_manage join or session_start with joinTeam=true). If omitted, returns project-level overview only."),
172114
+ markInboxRead: z627.boolean().optional().describe("If true, mark all inbox messages as read after returning them.")
171850
172115
  }
171851
172116
  },
171852
172117
  async ({ agentId, markInboxRead }) => {
@@ -171940,13 +172205,13 @@ ${lines.join("\n")}` }] };
171940
172205
  title: "Team Handoff \u2014 Agent Context Transfer",
171941
172206
  description: "Create a structured handoff artifact when passing work to another agent. A targeted handoff is visible only to its sender and recipient; a broadcast handoff is team-visible. The handoff is stored as a durable observation (immune to archival) and a notification message is sent to the recipient. Use this when completing a task and another agent should continue, or when you want to leave context for whoever works on this next.",
171942
172207
  inputSchema: {
171943
- fromAgentId: z626.string().describe("Your agent ID (from team_manage join or session_start with joinTeam=true)"),
171944
- summary: z626.string().describe("Human-readable summary of what you did and what needs to happen next"),
171945
- context: z626.string().describe("Detailed context for the next agent: what was done, current state, known issues, next steps"),
171946
- toAgentId: z626.string().optional().describe("Specific recipient agent ID. Omit to broadcast to all."),
171947
- taskId: z626.string().optional().describe("Link to a specific team_task ID"),
171948
- filesModified: z626.array(z626.string()).optional().describe("Files you modified during this work"),
171949
- concepts: z626.array(z626.string()).optional().describe("Key concepts for search discoverability")
172208
+ fromAgentId: z627.string().describe("Your agent ID (from team_manage join or session_start with joinTeam=true)"),
172209
+ summary: z627.string().describe("Human-readable summary of what you did and what needs to happen next"),
172210
+ context: z627.string().describe("Detailed context for the next agent: what was done, current state, known issues, next steps"),
172211
+ toAgentId: z627.string().optional().describe("Specific recipient agent ID. Omit to broadcast to all."),
172212
+ taskId: z627.string().optional().describe("Link to a specific team_task ID"),
172213
+ filesModified: z627.array(z627.string()).optional().describe("Files you modified during this work"),
172214
+ concepts: z627.array(z627.string()).optional().describe("Key concepts for search discoverability")
171950
172215
  }
171951
172216
  },
171952
172217
  async ({ fromAgentId, summary, context, toAgentId, taskId, filesModified, concepts }) => {
@@ -172026,7 +172291,7 @@ ${lines.join("\n")}` }] };
172026
172291
  title: "Manage Controlled Media",
172027
172292
  description: "Use the controlled local media library for an explicit import, attachment, inspection, or MiniMax generation request. Assets stay outside the Git worktree and enter normal memory only when attach is explicitly true. Use the CLI for destructive removal, quota cleanup, and direct generation. MCP generation is disabled by default and requires MEMORIX_MCP_MEDIA_GENERATION=1 after the operator reviews provider billing.",
172028
172293
  inputSchema: {
172029
- action: z626.enum([
172294
+ action: z627.enum([
172030
172295
  "import",
172031
172296
  "attach",
172032
172297
  "list",
@@ -172037,32 +172302,32 @@ ${lines.join("\n")}` }] };
172037
172302
  ...mediaTranscriptionEnabled ? ["derive-audio"] : [],
172038
172303
  ...mediaGenerationEnabled ? ["generate-image", "generate-video"] : []
172039
172304
  ]),
172040
- path: z626.string().optional().describe("Explicit local image/audio/video/PDF path for import."),
172041
- assetId: z626.string().optional().describe("Controlled MediaAsset ID for attach/show."),
172042
- jobId: z626.string().optional().describe("Durable media job ID for status."),
172043
- kind: z626.enum(["image", "audio", "video", "document"]).optional().describe("Optional asset list filter."),
172044
- limit: z626.number().int().min(1).max(100).optional().describe("Maximum assets to list."),
172045
- title: z626.string().optional().describe("Observation title when attaching generated/imported output."),
172046
- narrative: z626.string().optional().describe("Short retrieval text when attaching an asset."),
172047
- maxPages: z626.number().int().min(1).max(100).optional().describe("Bounded PDF extraction page limit."),
172048
- maxChars: z626.number().int().min(1).max(6e4).optional().describe("Bounded PDF extraction character limit."),
172049
- attach: z626.boolean().optional().describe("Attach generated/imported output to normal project memory explicitly."),
172305
+ path: z627.string().optional().describe("Explicit local image/audio/video/PDF path for import."),
172306
+ assetId: z627.string().optional().describe("Controlled MediaAsset ID for attach/show."),
172307
+ jobId: z627.string().optional().describe("Durable media job ID for status."),
172308
+ kind: z627.enum(["image", "audio", "video", "document"]).optional().describe("Optional asset list filter."),
172309
+ limit: z627.number().int().min(1).max(100).optional().describe("Maximum assets to list."),
172310
+ title: z627.string().optional().describe("Observation title when attaching generated/imported output."),
172311
+ narrative: z627.string().optional().describe("Short retrieval text when attaching an asset."),
172312
+ maxPages: z627.number().int().min(1).max(100).optional().describe("Bounded PDF extraction page limit."),
172313
+ maxChars: z627.number().int().min(1).max(6e4).optional().describe("Bounded PDF extraction character limit."),
172314
+ attach: z627.boolean().optional().describe("Attach generated/imported output to normal project memory explicitly."),
172050
172315
  ...mediaGenerationOrTranscription ? {
172051
- model: z626.string().max(160).optional().describe("Provider model for the selected media action."),
172052
- prompt: z626.string().optional().describe("Explicit prompt for generation or transcription.")
172316
+ model: z627.string().max(160).optional().describe("Provider model for the selected media action."),
172317
+ prompt: z627.string().optional().describe("Explicit prompt for generation or transcription.")
172053
172318
  } : {},
172054
172319
  ...mediaTranscriptionEnabled ? {
172055
- provider: z626.enum(["openai", "groq"]).optional().describe("Explicit audio transcription provider."),
172056
- language: z626.string().max(32).optional().describe("Optional ISO-639-1 hint for audio transcription.")
172320
+ provider: z627.enum(["openai", "groq"]).optional().describe("Explicit audio transcription provider."),
172321
+ language: z627.string().max(32).optional().describe("Optional ISO-639-1 hint for audio transcription.")
172057
172322
  } : {},
172058
172323
  ...mediaGenerationEnabled ? {
172059
- image: z626.string().optional().describe("Base64-encoded reference image for image-to-image generation."),
172060
- region: z626.enum(["global", "cn"]).optional().describe("MiniMax deployment region."),
172061
- n: z626.number().int().min(1).max(4).optional().describe("Image output count."),
172062
- ratio: z626.enum(["adaptive", "1:1", "16:9", "4:3", "3:2", "2:3", "3:4", "9:16", "21:9"]).optional().describe("Image or video aspect ratio."),
172063
- width: z626.number().int().min(1).max(8192).optional().describe("Requested image width."),
172064
- height: z626.number().int().min(1).max(8192).optional().describe("Requested image height."),
172065
- duration: z626.union([z626.literal(5), z626.literal(10)]).optional().describe("MiniMax video duration in seconds.")
172324
+ image: z627.string().optional().describe("Base64-encoded reference image for image-to-image generation."),
172325
+ region: z627.enum(["global", "cn"]).optional().describe("MiniMax deployment region."),
172326
+ n: z627.number().int().min(1).max(4).optional().describe("Image output count."),
172327
+ ratio: z627.enum(["adaptive", "1:1", "16:9", "4:3", "3:2", "2:3", "3:4", "9:16", "21:9"]).optional().describe("Image or video aspect ratio."),
172328
+ width: z627.number().int().min(1).max(8192).optional().describe("Requested image width."),
172329
+ height: z627.number().int().min(1).max(8192).optional().describe("Requested image height."),
172330
+ duration: z627.union([z627.literal(5), z627.literal(10)]).optional().describe("MiniMax video duration in seconds.")
172066
172331
  } : {}
172067
172332
  }
172068
172333
  },
@@ -172260,10 +172525,10 @@ ${lines.join("\n")}` }] };
172260
172525
  title: "Ingest Image",
172261
172526
  description: "Legacy compatibility path: import caller-provided image bytes into the controlled local asset library, then store a text retrieval projection. For durable media operations, prefer memorix_media or the media CLI.",
172262
172527
  inputSchema: {
172263
- base64: z626.string().describe("Base64-encoded image data"),
172264
- mimeType: z626.string().optional().describe("Deprecated compatibility hint. Memorix detects the actual MIME type from the image bytes."),
172265
- filename: z626.string().optional().describe("Original filename"),
172266
- prompt: z626.string().optional().describe("Custom analysis prompt")
172528
+ base64: z627.string().describe("Base64-encoded image data"),
172529
+ mimeType: z627.string().optional().describe("Deprecated compatibility hint. Memorix detects the actual MIME type from the image bytes."),
172530
+ filename: z627.string().optional().describe("Original filename"),
172531
+ prompt: z627.string().optional().describe("Custom analysis prompt")
172267
172532
  }
172268
172533
  },
172269
172534
  async (args) => {
@@ -172563,6 +172828,7 @@ var init_server2 = __esm({
172563
172828
  init_secret_filter();
172564
172829
  init_surfaced_registry();
172565
172830
  init_request_context();
172831
+ init_mcp_compat();
172566
172832
  FORMATION_TIMEOUT_MS = parseFormationTimeoutMs(process.env.MEMORIX_FORMATION_TIMEOUT_MS);
172567
172833
  COMPACT_ON_WRITE_TIMEOUT_MS = 12e3;
172568
172834
  COMPRESSION_TIMEOUT_MS = 5e3;
@@ -172735,7 +173001,7 @@ var init_serve_shared = __esm({
172735
173001
 
172736
173002
  // src/cli/version.ts
172737
173003
  function getCliVersion() {
172738
- return true ? "1.8.1" : pkg.version;
173004
+ return true ? "1.8.2" : pkg.version;
172739
173005
  }
172740
173006
  var init_version3 = __esm({
172741
173007
  "src/cli/version.ts"() {