@massa-ai/mcp-client 1.12.0 → 1.12.1

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.
@@ -3040,7 +3040,7 @@ function sanitizeFTS5Query(query) {
3040
3040
  return quotedTerms.join(" OR ");
3041
3041
  }
3042
3042
  function sanitizeFilePath(filePath) {
3043
- return filePath.replace(/\.\.\//g, "").replace(/\.\.\\/g, "").replace(/^\/+/, "");
3043
+ return filePath.split(/[/\\]+/).filter((segment) => segment !== ".." && segment !== "").join("/");
3044
3044
  }
3045
3045
  var init_sanitizer = __esm(() => {
3046
3046
  init_config();
@@ -107184,8 +107184,102 @@ function findCodeBoundaries(lines) {
107184
107184
  return boundaries;
107185
107185
  }
107186
107186
  function netBraceDelta(line) {
107187
- const stripped = line.replace(/\/\*.*?\*\//g, "").replace(/\/\/.*$/, "").replace(/'(?:\\.|[^'\\])*'/g, "''").replace(/"(?:\\.|[^"\\])*"/g, '""').replace(/`(?:\\.|[^`\\])*`/g, "``").replace(/\/(?:\\.|[^/\\\n])+\/[gimsuy]*/g, "//");
107188
- return (stripped.match(/\{/g) || []).length - (stripped.match(/\}/g) || []).length;
107187
+ let delta = 0;
107188
+ let i = 0;
107189
+ const n = line.length;
107190
+ let lastSig = -1;
107191
+ let word = "";
107192
+ let regexPossible = true;
107193
+ const opensRegex = () => {
107194
+ if (lastSig === -1)
107195
+ return true;
107196
+ const c = String.fromCharCode(lastSig);
107197
+ if (/[\w)\]}'"`]/.test(c))
107198
+ return REGEX_PREFIX_KEYWORDS.has(word);
107199
+ return true;
107200
+ };
107201
+ while (i < n) {
107202
+ const code = line.charCodeAt(i);
107203
+ const next = line.charCodeAt(i + 1);
107204
+ if (code === 47 && next === 47)
107205
+ break;
107206
+ if (code === 47 && next === 42) {
107207
+ const end = line.indexOf("*/", i + 2);
107208
+ if (end === -1) {
107209
+ lastSig = code;
107210
+ word = "";
107211
+ i++;
107212
+ continue;
107213
+ }
107214
+ i = end + 2;
107215
+ continue;
107216
+ }
107217
+ if (code === 47 && regexPossible && opensRegex()) {
107218
+ let j = i + 1;
107219
+ let closed = false;
107220
+ while (j < n) {
107221
+ const inner = line.charCodeAt(j);
107222
+ if (inner === 92) {
107223
+ j += 2;
107224
+ continue;
107225
+ }
107226
+ if (inner === 47) {
107227
+ closed = true;
107228
+ break;
107229
+ }
107230
+ if (inner === 10)
107231
+ break;
107232
+ j++;
107233
+ }
107234
+ if (closed) {
107235
+ j++;
107236
+ while (j < n && /[a-z]/.test(line[j]))
107237
+ j++;
107238
+ lastSig = 47;
107239
+ word = "";
107240
+ i = j;
107241
+ continue;
107242
+ }
107243
+ regexPossible = false;
107244
+ lastSig = code;
107245
+ word = "";
107246
+ i++;
107247
+ continue;
107248
+ }
107249
+ if (code === 39 || code === 34 || code === 96) {
107250
+ const quote = code;
107251
+ i++;
107252
+ while (i < n) {
107253
+ const inner = line.charCodeAt(i);
107254
+ if (inner === 92) {
107255
+ i += 2;
107256
+ continue;
107257
+ }
107258
+ i++;
107259
+ if (inner === quote)
107260
+ break;
107261
+ }
107262
+ lastSig = quote;
107263
+ word = "";
107264
+ continue;
107265
+ }
107266
+ if (code === 123)
107267
+ delta++;
107268
+ else if (code === 125)
107269
+ delta--;
107270
+ if (code === 32 || code === 9) {
107271
+ i++;
107272
+ continue;
107273
+ }
107274
+ if (code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 95 || code === 36) {
107275
+ word += line[i];
107276
+ } else {
107277
+ word = "";
107278
+ }
107279
+ lastSig = code;
107280
+ i++;
107281
+ }
107282
+ return delta;
107189
107283
  }
107190
107284
  function extractFileImports(content, ext2) {
107191
107285
  const lines = content.split(`
@@ -107216,7 +107310,7 @@ function extractFileImports(content, ext2) {
107216
107310
  function isCodeFile(ext2) {
107217
107311
  return CODE_EXTENSIONS.has(ext2);
107218
107312
  }
107219
- var RESERVED_KEYWORDS, CONTAINER_RE, TOP_LEVEL_RE, METHOD_RE, CODE_EXTENSIONS;
107313
+ var RESERVED_KEYWORDS, CONTAINER_RE, TOP_LEVEL_RE, METHOD_RE, REGEX_PREFIX_KEYWORDS, CODE_EXTENSIONS;
107220
107314
  var init_chunker_code = __esm(() => {
107221
107315
  RESERVED_KEYWORDS = new Set([
107222
107316
  "if",
@@ -107237,6 +107331,22 @@ var init_chunker_code = __esm(() => {
107237
107331
  CONTAINER_RE = /^(?:export\s+(?:default\s+)?)?(?:abstract\s+)?(?:class|interface|enum|namespace|trait|impl)\s+(\w+)/;
107238
107332
  TOP_LEVEL_RE = /^(?:export\s+(?:default\s+)?)?(?:async\s+)?(?:function|const|let|var|type|struct|fn|def|func)\s+(\w+)/;
107239
107333
  METHOD_RE = /^(?:public\s+|private\s+|protected\s+|static\s+|readonly\s+|override\s+|async\s+|abstract\s+|get\s+|set\s+)*(\w+)\s*[(<]/;
107334
+ REGEX_PREFIX_KEYWORDS = new Set([
107335
+ "return",
107336
+ "typeof",
107337
+ "case",
107338
+ "do",
107339
+ "else",
107340
+ "in",
107341
+ "of",
107342
+ "new",
107343
+ "delete",
107344
+ "void",
107345
+ "throw",
107346
+ "yield",
107347
+ "await",
107348
+ "instanceof"
107349
+ ]);
107240
107350
  CODE_EXTENSIONS = new Set([
107241
107351
  ".ts",
107242
107352
  ".js",
@@ -113813,6 +113923,7 @@ var init_session_store = __esm(() => {
113813
113923
  });
113814
113924
 
113815
113925
  // ../../packages/core/dist/services/synapse/session/session-registry.js
113926
+ import { randomUUID as randomUUID3 } from "crypto";
113816
113927
  function tokenize3(text2) {
113817
113928
  const tokens = new Set;
113818
113929
  for (const match2 of text2.toLowerCase().matchAll(TOKEN_RE2)) {
@@ -113820,6 +113931,9 @@ function tokenize3(text2) {
113820
113931
  }
113821
113932
  return tokens;
113822
113933
  }
113934
+ function newSynapseSessionId() {
113935
+ return `syn_${randomUUID3()}`;
113936
+ }
113823
113937
 
113824
113938
  class SessionRegistry {
113825
113939
  sessions = new Map;
@@ -115223,7 +115337,7 @@ class TaskEnvelopeService {
115223
115337
  const registry3 = getSessionRegistry();
115224
115338
  let sessionId;
115225
115339
  try {
115226
- sessionId = `syn_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
115340
+ sessionId = newSynapseSessionId();
115227
115341
  registry3.create({
115228
115342
  sessionId,
115229
115343
  agentId: input.agentId,
@@ -120330,7 +120444,7 @@ var init_index_job_store = __esm(() => {
120330
120444
  });
120331
120445
 
120332
120446
  // ../../packages/core/dist/services/jobs/index-job-tracker.js
120333
- import { randomUUID as randomUUID3 } from "crypto";
120447
+ import { randomUUID as randomUUID4 } from "crypto";
120334
120448
 
120335
120449
  class IndexJobTracker {
120336
120450
  static instance;
@@ -120354,7 +120468,7 @@ class IndexJobTracker {
120354
120468
  return IndexJobTracker.instance;
120355
120469
  }
120356
120470
  createJob(projectId, projectPath) {
120357
- const jobId = randomUUID3();
120471
+ const jobId = randomUUID4();
120358
120472
  const job = {
120359
120473
  jobId,
120360
120474
  projectId,
@@ -121371,7 +121485,7 @@ __export(exports_memory_consolidation_job, {
121371
121485
  memoryConsolidationJob: () => memoryConsolidationJob,
121372
121486
  MemoryConsolidationJob: () => MemoryConsolidationJob
121373
121487
  });
121374
- import { randomUUID as randomUUID4 } from "crypto";
121488
+ import { randomUUID as randomUUID5 } from "crypto";
121375
121489
  async function addSupercedesEdge(store3, newId, sourceId, batchId) {
121376
121490
  const evidence = JSON.stringify({ batchId, consolidated: true });
121377
121491
  await store3.createEdge({
@@ -121515,11 +121629,11 @@ class MemoryConsolidationJob {
121515
121629
  });
121516
121630
  return { merged: 0, batchesCreated: 0 };
121517
121631
  }
121518
- const batch = await consolidateWindow(rowsToCandidates(candidates), this.llm, { idFactory: () => `batch-${now2}-${randomUUID4().slice(0, 8)}` }).catch(() => null);
121632
+ const batch = await consolidateWindow(rowsToCandidates(candidates), this.llm, { idFactory: () => `batch-${now2}-${randomUUID5().slice(0, 8)}` }).catch(() => null);
121519
121633
  if (!batch)
121520
121634
  return { merged: 0, batchesCreated: 0 };
121521
121635
  const sourceRows = candidates.filter((c) => batch.sourceIds.includes(c.id));
121522
- const newId = `mem-${now2}-${randomUUID4().slice(0, 8)}`;
121636
+ const newId = `mem-${now2}-${randomUUID5().slice(0, 8)}`;
121523
121637
  const importance = sourceRows.length ? Math.min(1, Math.max(...sourceRows.map((r) => r.importance))) : 0.7;
121524
121638
  const projectId = sourceRows.find((r) => r.project_id)?.project_id ?? null;
121525
121639
  try {
@@ -122342,7 +122456,7 @@ var init_auto_improve_llm = __esm(() => {
122342
122456
  });
122343
122457
 
122344
122458
  // ../../packages/core/dist/services/jobs/auto-improve-apply.js
122345
- import { randomUUID as randomUUID5 } from "crypto";
122459
+ import { randomUUID as randomUUID6 } from "crypto";
122346
122460
  function validateCreatePayload(p) {
122347
122461
  if ("type" in p && p.type !== undefined && p.type !== null) {
122348
122462
  if (typeof p.type !== "string" || !VALID_MEMORY_TYPES.has(p.type)) {
@@ -122383,7 +122497,7 @@ function buildUpdatePatch(p) {
122383
122497
  return patch;
122384
122498
  }
122385
122499
  async function applyProposal(job, record2) {
122386
- const memId = record2.targetMemoryId ?? `proposal-mem-${record2.id}-${randomUUID5().slice(0, 8)}`;
122500
+ const memId = record2.targetMemoryId ?? `proposal-mem-${record2.id}-${randomUUID6().slice(0, 8)}`;
122387
122501
  const p = record2.payload;
122388
122502
  if (record2.kind === "memory.create") {
122389
122503
  validateCreatePayload(p);
@@ -122745,7 +122859,7 @@ __export(exports_observation_consolidation_job, {
122745
122859
  observationConsolidationJob: () => observationConsolidationJob,
122746
122860
  ObservationConsolidationJob: () => ObservationConsolidationJob
122747
122861
  });
122748
- import { randomUUID as randomUUID6 } from "crypto";
122862
+ import { randomUUID as randomUUID7 } from "crypto";
122749
122863
  function readBridgeConfig() {
122750
122864
  try {
122751
122865
  const c = config.get("hooks")?.bridge;
@@ -122835,7 +122949,7 @@ class ObservationConsolidationJob {
122835
122949
  if (observations.length < 2)
122836
122950
  return noop2;
122837
122951
  const window2 = observations.slice(0, this.maxWindow);
122838
- const batchId = `obs-batch-${Date.now()}-${randomUUID6().slice(0, 8)}`;
122952
+ const batchId = `obs-batch-${Date.now()}-${randomUUID7().slice(0, 8)}`;
122839
122953
  const prompt = buildObservationPrompt(window2);
122840
122954
  let batch;
122841
122955
  try {
@@ -122861,7 +122975,7 @@ class ObservationConsolidationJob {
122861
122975
  }
122862
122976
  if (!batch)
122863
122977
  return noop2;
122864
- const newId = `mem-${Date.now()}-${randomUUID6().slice(0, 8)}`;
122978
+ const newId = `mem-${Date.now()}-${randomUUID7().slice(0, 8)}`;
122865
122979
  const importance = 0.7;
122866
122980
  try {
122867
122981
  await Promise.resolve(this.memoryRepo.insert({
@@ -129839,7 +129953,7 @@ var init_load = __esm(() => {
129839
129953
  });
129840
129954
 
129841
129955
  // ../../packages/core/dist/data/graph-generation/graph-generation-repository-pg.js
129842
- import { randomUUID as randomUUID7 } from "crypto";
129956
+ import { randomUUID as randomUUID8 } from "crypto";
129843
129957
  function boundedText2(value, label, max = 512) {
129844
129958
  const normalized = value.normalize("NFC").trim();
129845
129959
  if (!normalized || normalized.length > max || normalized.includes("\x00")) {
@@ -129943,8 +130057,8 @@ class GraphGenerationRepositoryPg {
129943
130057
  }
129944
130058
  async begin(rawInput) {
129945
130059
  const input = validateBegin2(rawInput);
129946
- const generationId = randomUUID7();
129947
- const leaseToken = randomUUID7();
130060
+ const generationId = randomUUID8();
130061
+ const leaseToken = randomUUID8();
129948
130062
  return getPrismaClient2().$transaction(async (tx) => {
129949
130063
  const workspace = await lockWorkspace(tx, input.projectId);
129950
130064
  if (workspace.active_graph_generation_id !== input.expectedActiveGenerationId) {
@@ -132269,11 +132383,12 @@ function buildRetrievalCall(category, sessionId, _projectId, summaryTokens) {
132269
132383
  queries.push(short);
132270
132384
  }
132271
132385
  }
132272
- const queryArr = queries.map((q) => `"${q.replace(/"/g, "\\\"")}"`).join(", ");
132273
- return `recall(query: ${queries[0] ? `"${queries[0].replace(/"/g, "\\\"")}"` : '""'}, projectId: "${_projectId}", limit: 10)
132274
- // or: search(query: ${queries[0] ? `"${queries[0].replace(/"/g, "\\\"")}"` : '""'}, projectId: "${_projectId}", maxResults: 5)
132386
+ const primaryQuery = queries[0] ?? "";
132387
+ const queryArr = queries.map((q) => JSON.stringify(q)).join(", ");
132388
+ return `recall(query: ${JSON.stringify(primaryQuery)}, projectId: ${JSON.stringify(_projectId)}, limit: 10)
132389
+ // or: search(query: ${JSON.stringify(primaryQuery)}, projectId: ${JSON.stringify(_projectId)}, maxResults: 5)
132275
132390
  // queries: [${queryArr}]
132276
- // sessionId: "${sessionId}"`;
132391
+ // sessionId: ${JSON.stringify(sessionId)}`;
132277
132392
  }
132278
132393
 
132279
132394
  class CompactionSnapshotService {
package/dist/index.js CHANGED
@@ -28037,7 +28037,7 @@ function sanitizeFTS5Query(query) {
28037
28037
  return quotedTerms.join(" OR ");
28038
28038
  }
28039
28039
  function sanitizeFilePath(filePath) {
28040
- return filePath.replace(/\.\.\//g, "").replace(/\.\.\\/g, "").replace(/^\/+/, "");
28040
+ return filePath.split(/[/\\]+/).filter((segment) => segment !== ".." && segment !== "").join("/");
28041
28041
  }
28042
28042
  var init_sanitizer = __esm(() => {
28043
28043
  init_config();
@@ -113743,8 +113743,102 @@ function findCodeBoundaries(lines) {
113743
113743
  return boundaries;
113744
113744
  }
113745
113745
  function netBraceDelta(line) {
113746
- const stripped = line.replace(/\/\*.*?\*\//g, "").replace(/\/\/.*$/, "").replace(/'(?:\\.|[^'\\])*'/g, "''").replace(/"(?:\\.|[^"\\])*"/g, '""').replace(/`(?:\\.|[^`\\])*`/g, "``").replace(/\/(?:\\.|[^/\\\n])+\/[gimsuy]*/g, "//");
113747
- return (stripped.match(/\{/g) || []).length - (stripped.match(/\}/g) || []).length;
113746
+ let delta = 0;
113747
+ let i = 0;
113748
+ const n = line.length;
113749
+ let lastSig = -1;
113750
+ let word = "";
113751
+ let regexPossible = true;
113752
+ const opensRegex = () => {
113753
+ if (lastSig === -1)
113754
+ return true;
113755
+ const c = String.fromCharCode(lastSig);
113756
+ if (/[\w)\]}'"`]/.test(c))
113757
+ return REGEX_PREFIX_KEYWORDS.has(word);
113758
+ return true;
113759
+ };
113760
+ while (i < n) {
113761
+ const code = line.charCodeAt(i);
113762
+ const next = line.charCodeAt(i + 1);
113763
+ if (code === 47 && next === 47)
113764
+ break;
113765
+ if (code === 47 && next === 42) {
113766
+ const end = line.indexOf("*/", i + 2);
113767
+ if (end === -1) {
113768
+ lastSig = code;
113769
+ word = "";
113770
+ i++;
113771
+ continue;
113772
+ }
113773
+ i = end + 2;
113774
+ continue;
113775
+ }
113776
+ if (code === 47 && regexPossible && opensRegex()) {
113777
+ let j = i + 1;
113778
+ let closed = false;
113779
+ while (j < n) {
113780
+ const inner = line.charCodeAt(j);
113781
+ if (inner === 92) {
113782
+ j += 2;
113783
+ continue;
113784
+ }
113785
+ if (inner === 47) {
113786
+ closed = true;
113787
+ break;
113788
+ }
113789
+ if (inner === 10)
113790
+ break;
113791
+ j++;
113792
+ }
113793
+ if (closed) {
113794
+ j++;
113795
+ while (j < n && /[a-z]/.test(line[j]))
113796
+ j++;
113797
+ lastSig = 47;
113798
+ word = "";
113799
+ i = j;
113800
+ continue;
113801
+ }
113802
+ regexPossible = false;
113803
+ lastSig = code;
113804
+ word = "";
113805
+ i++;
113806
+ continue;
113807
+ }
113808
+ if (code === 39 || code === 34 || code === 96) {
113809
+ const quote = code;
113810
+ i++;
113811
+ while (i < n) {
113812
+ const inner = line.charCodeAt(i);
113813
+ if (inner === 92) {
113814
+ i += 2;
113815
+ continue;
113816
+ }
113817
+ i++;
113818
+ if (inner === quote)
113819
+ break;
113820
+ }
113821
+ lastSig = quote;
113822
+ word = "";
113823
+ continue;
113824
+ }
113825
+ if (code === 123)
113826
+ delta++;
113827
+ else if (code === 125)
113828
+ delta--;
113829
+ if (code === 32 || code === 9) {
113830
+ i++;
113831
+ continue;
113832
+ }
113833
+ if (code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 95 || code === 36) {
113834
+ word += line[i];
113835
+ } else {
113836
+ word = "";
113837
+ }
113838
+ lastSig = code;
113839
+ i++;
113840
+ }
113841
+ return delta;
113748
113842
  }
113749
113843
  function extractFileImports(content, ext2) {
113750
113844
  const lines = content.split(`
@@ -113775,7 +113869,7 @@ function extractFileImports(content, ext2) {
113775
113869
  function isCodeFile(ext2) {
113776
113870
  return CODE_EXTENSIONS.has(ext2);
113777
113871
  }
113778
- var RESERVED_KEYWORDS, CONTAINER_RE, TOP_LEVEL_RE, METHOD_RE, CODE_EXTENSIONS;
113872
+ var RESERVED_KEYWORDS, CONTAINER_RE, TOP_LEVEL_RE, METHOD_RE, REGEX_PREFIX_KEYWORDS, CODE_EXTENSIONS;
113779
113873
  var init_chunker_code = __esm(() => {
113780
113874
  RESERVED_KEYWORDS = new Set([
113781
113875
  "if",
@@ -113796,6 +113890,22 @@ var init_chunker_code = __esm(() => {
113796
113890
  CONTAINER_RE = /^(?:export\s+(?:default\s+)?)?(?:abstract\s+)?(?:class|interface|enum|namespace|trait|impl)\s+(\w+)/;
113797
113891
  TOP_LEVEL_RE = /^(?:export\s+(?:default\s+)?)?(?:async\s+)?(?:function|const|let|var|type|struct|fn|def|func)\s+(\w+)/;
113798
113892
  METHOD_RE = /^(?:public\s+|private\s+|protected\s+|static\s+|readonly\s+|override\s+|async\s+|abstract\s+|get\s+|set\s+)*(\w+)\s*[(<]/;
113893
+ REGEX_PREFIX_KEYWORDS = new Set([
113894
+ "return",
113895
+ "typeof",
113896
+ "case",
113897
+ "do",
113898
+ "else",
113899
+ "in",
113900
+ "of",
113901
+ "new",
113902
+ "delete",
113903
+ "void",
113904
+ "throw",
113905
+ "yield",
113906
+ "await",
113907
+ "instanceof"
113908
+ ]);
113799
113909
  CODE_EXTENSIONS = new Set([
113800
113910
  ".ts",
113801
113911
  ".js",
@@ -120372,6 +120482,7 @@ var init_session_store = __esm(() => {
120372
120482
  });
120373
120483
 
120374
120484
  // ../../packages/core/dist/services/synapse/session/session-registry.js
120485
+ import { randomUUID as randomUUID3 } from "crypto";
120375
120486
  function tokenize3(text2) {
120376
120487
  const tokens = new Set;
120377
120488
  for (const match2 of text2.toLowerCase().matchAll(TOKEN_RE2)) {
@@ -120379,6 +120490,9 @@ function tokenize3(text2) {
120379
120490
  }
120380
120491
  return tokens;
120381
120492
  }
120493
+ function newSynapseSessionId() {
120494
+ return `syn_${randomUUID3()}`;
120495
+ }
120382
120496
 
120383
120497
  class SessionRegistry {
120384
120498
  sessions = new Map;
@@ -121782,7 +121896,7 @@ class TaskEnvelopeService {
121782
121896
  const registry3 = getSessionRegistry();
121783
121897
  let sessionId;
121784
121898
  try {
121785
- sessionId = `syn_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
121899
+ sessionId = newSynapseSessionId();
121786
121900
  registry3.create({
121787
121901
  sessionId,
121788
121902
  agentId: input.agentId,
@@ -123451,7 +123565,7 @@ var init_index_job_store = __esm(() => {
123451
123565
  });
123452
123566
 
123453
123567
  // ../../packages/core/dist/services/jobs/index-job-tracker.js
123454
- import { randomUUID as randomUUID3 } from "crypto";
123568
+ import { randomUUID as randomUUID4 } from "crypto";
123455
123569
 
123456
123570
  class IndexJobTracker {
123457
123571
  static instance;
@@ -123475,7 +123589,7 @@ class IndexJobTracker {
123475
123589
  return IndexJobTracker.instance;
123476
123590
  }
123477
123591
  createJob(projectId, projectPath) {
123478
- const jobId = randomUUID3();
123592
+ const jobId = randomUUID4();
123479
123593
  const job = {
123480
123594
  jobId,
123481
123595
  projectId,
@@ -128034,7 +128148,7 @@ var init_load = __esm(() => {
128034
128148
  });
128035
128149
 
128036
128150
  // ../../packages/core/dist/data/graph-generation/graph-generation-repository-pg.js
128037
- import { randomUUID as randomUUID4 } from "crypto";
128151
+ import { randomUUID as randomUUID5 } from "crypto";
128038
128152
  function boundedText2(value, label, max = 512) {
128039
128153
  const normalized = value.normalize("NFC").trim();
128040
128154
  if (!normalized || normalized.length > max || normalized.includes("\x00")) {
@@ -128138,8 +128252,8 @@ class GraphGenerationRepositoryPg {
128138
128252
  }
128139
128253
  async begin(rawInput) {
128140
128254
  const input = validateBegin2(rawInput);
128141
- const generationId = randomUUID4();
128142
- const leaseToken = randomUUID4();
128255
+ const generationId = randomUUID5();
128256
+ const leaseToken = randomUUID5();
128143
128257
  return getPrismaClient2().$transaction(async (tx) => {
128144
128258
  const workspace = await lockWorkspace(tx, input.projectId);
128145
128259
  if (workspace.active_graph_generation_id !== input.expectedActiveGenerationId) {
@@ -132510,7 +132624,7 @@ __export(exports_memory_consolidation_job, {
132510
132624
  memoryConsolidationJob: () => memoryConsolidationJob,
132511
132625
  MemoryConsolidationJob: () => MemoryConsolidationJob
132512
132626
  });
132513
- import { randomUUID as randomUUID5 } from "crypto";
132627
+ import { randomUUID as randomUUID6 } from "crypto";
132514
132628
  async function addSupercedesEdge(store3, newId, sourceId, batchId) {
132515
132629
  const evidence = JSON.stringify({ batchId, consolidated: true });
132516
132630
  await store3.createEdge({
@@ -132654,11 +132768,11 @@ class MemoryConsolidationJob {
132654
132768
  });
132655
132769
  return { merged: 0, batchesCreated: 0 };
132656
132770
  }
132657
- const batch = await consolidateWindow(rowsToCandidates(candidates2), this.llm, { idFactory: () => `batch-${now2}-${randomUUID5().slice(0, 8)}` }).catch(() => null);
132771
+ const batch = await consolidateWindow(rowsToCandidates(candidates2), this.llm, { idFactory: () => `batch-${now2}-${randomUUID6().slice(0, 8)}` }).catch(() => null);
132658
132772
  if (!batch)
132659
132773
  return { merged: 0, batchesCreated: 0 };
132660
132774
  const sourceRows = candidates2.filter((c) => batch.sourceIds.includes(c.id));
132661
- const newId = `mem-${now2}-${randomUUID5().slice(0, 8)}`;
132775
+ const newId = `mem-${now2}-${randomUUID6().slice(0, 8)}`;
132662
132776
  const importance = sourceRows.length ? Math.min(1, Math.max(...sourceRows.map((r) => r.importance))) : 0.7;
132663
132777
  const projectId = sourceRows.find((r) => r.project_id)?.project_id ?? null;
132664
132778
  try {
@@ -135956,11 +136070,12 @@ function buildRetrievalCall(category, sessionId, _projectId, summaryTokens) {
135956
136070
  queries.push(short);
135957
136071
  }
135958
136072
  }
135959
- const queryArr = queries.map((q) => `"${q.replace(/"/g, "\\\"")}"`).join(", ");
135960
- return `recall(query: ${queries[0] ? `"${queries[0].replace(/"/g, "\\\"")}"` : '""'}, projectId: "${_projectId}", limit: 10)
135961
- // or: search(query: ${queries[0] ? `"${queries[0].replace(/"/g, "\\\"")}"` : '""'}, projectId: "${_projectId}", maxResults: 5)
136073
+ const primaryQuery = queries[0] ?? "";
136074
+ const queryArr = queries.map((q) => JSON.stringify(q)).join(", ");
136075
+ return `recall(query: ${JSON.stringify(primaryQuery)}, projectId: ${JSON.stringify(_projectId)}, limit: 10)
136076
+ // or: search(query: ${JSON.stringify(primaryQuery)}, projectId: ${JSON.stringify(_projectId)}, maxResults: 5)
135962
136077
  // queries: [${queryArr}]
135963
- // sessionId: "${sessionId}"`;
136078
+ // sessionId: ${JSON.stringify(sessionId)}`;
135964
136079
  }
135965
136080
 
135966
136081
  class CompactionSnapshotService {
@@ -142486,7 +142601,7 @@ var init_auto_improve_llm = __esm(() => {
142486
142601
  });
142487
142602
 
142488
142603
  // ../../packages/core/dist/services/jobs/auto-improve-apply.js
142489
- import { randomUUID as randomUUID6 } from "crypto";
142604
+ import { randomUUID as randomUUID7 } from "crypto";
142490
142605
  function validateCreatePayload(p) {
142491
142606
  if ("type" in p && p.type !== undefined && p.type !== null) {
142492
142607
  if (typeof p.type !== "string" || !VALID_MEMORY_TYPES.has(p.type)) {
@@ -142527,7 +142642,7 @@ function buildUpdatePatch(p) {
142527
142642
  return patch;
142528
142643
  }
142529
142644
  async function applyProposal(job, record3) {
142530
- const memId = record3.targetMemoryId ?? `proposal-mem-${record3.id}-${randomUUID6().slice(0, 8)}`;
142645
+ const memId = record3.targetMemoryId ?? `proposal-mem-${record3.id}-${randomUUID7().slice(0, 8)}`;
142531
142646
  const p = record3.payload;
142532
142647
  if (record3.kind === "memory.create") {
142533
142648
  validateCreatePayload(p);
@@ -142889,7 +143004,7 @@ __export(exports_observation_consolidation_job, {
142889
143004
  observationConsolidationJob: () => observationConsolidationJob,
142890
143005
  ObservationConsolidationJob: () => ObservationConsolidationJob
142891
143006
  });
142892
- import { randomUUID as randomUUID7 } from "crypto";
143007
+ import { randomUUID as randomUUID8 } from "crypto";
142893
143008
  function readBridgeConfig() {
142894
143009
  try {
142895
143010
  const c = config2.get("hooks")?.bridge;
@@ -142979,7 +143094,7 @@ class ObservationConsolidationJob {
142979
143094
  if (observations.length < 2)
142980
143095
  return noop2;
142981
143096
  const window2 = observations.slice(0, this.maxWindow);
142982
- const batchId = `obs-batch-${Date.now()}-${randomUUID7().slice(0, 8)}`;
143097
+ const batchId = `obs-batch-${Date.now()}-${randomUUID8().slice(0, 8)}`;
142983
143098
  const prompt = buildObservationPrompt(window2);
142984
143099
  let batch;
142985
143100
  try {
@@ -143005,7 +143120,7 @@ class ObservationConsolidationJob {
143005
143120
  }
143006
143121
  if (!batch)
143007
143122
  return noop2;
143008
- const newId = `mem-${Date.now()}-${randomUUID7().slice(0, 8)}`;
143123
+ const newId = `mem-${Date.now()}-${randomUUID8().slice(0, 8)}`;
143009
143124
  const importance = 0.7;
143010
143125
  try {
143011
143126
  await Promise.resolve(this.memoryRepo.insert({
@@ -162050,7 +162165,7 @@ var init_hook_service = __esm(() => {
162050
162165
  });
162051
162166
 
162052
162167
  // ../../packages/core/dist/services/bootstrap/bootstrap-service.js
162053
- import { randomUUID as randomUUID8 } from "crypto";
162168
+ import { randomUUID as randomUUID9 } from "crypto";
162054
162169
  import fs13 from "fs";
162055
162170
  import path23 from "path";
162056
162171
  import { spawn as spawn2 } from "child_process";
@@ -162152,7 +162267,7 @@ class BootstrapService {
162152
162267
  return { ...noopResult("no-signals"), signalCount };
162153
162268
  }
162154
162269
  const capped = seeds.slice(0, cfg.maxSeedMemories);
162155
- const bootstrapId = `boot-${Date.now()}-${randomUUID8().slice(0, 8)}`;
162270
+ const bootstrapId = `boot-${Date.now()}-${randomUUID9().slice(0, 8)}`;
162156
162271
  let ids;
162157
162272
  try {
162158
162273
  ids = await storeSeeds(this.memoryRepo, projectId, bootstrapId, capped, signals);
@@ -162406,7 +162521,7 @@ async function storeSeeds(memoryRepo, projectId, bootstrapId, seeds, signals) {
162406
162521
  const ids = [];
162407
162522
  const signalCount = countSignals(signals);
162408
162523
  for (const seed of seeds) {
162409
- const id = `seed-${Date.now()}-${randomUUID8().slice(0, 8)}`;
162524
+ const id = `seed-${Date.now()}-${randomUUID9().slice(0, 8)}`;
162410
162525
  const input = {
162411
162526
  id,
162412
162527
  content: truncate3(seed.summary, MAX_SUMMARY_CHARS),
@@ -162746,7 +162861,7 @@ var init_handoff_repository = __esm(() => {
162746
162861
  });
162747
162862
 
162748
162863
  // ../../packages/core/dist/services/handoff/handoff-service.js
162749
- import { randomUUID as randomUUID9 } from "crypto";
162864
+ import { randomUUID as randomUUID10 } from "crypto";
162750
162865
 
162751
162866
  class HandoffService {
162752
162867
  store;
@@ -162801,7 +162916,7 @@ class HandoffService {
162801
162916
  return { ok: true, id, status: "open", memoryId };
162802
162917
  }
162803
162918
  async dualWrite(record3) {
162804
- const memId = `handoff-mem-${record3.id}-${randomUUID9().slice(0, 8)}`;
162919
+ const memId = `handoff-mem-${record3.id}-${randomUUID10().slice(0, 8)}`;
162805
162920
  const input = buildHandoffMemoryInput(memId, record3);
162806
162921
  await Promise.resolve(this.memoryRepo.insert(input));
162807
162922
  return memId;
@@ -163051,6 +163166,7 @@ __export(exports_dist, {
163051
163166
  normalizeStructuralFile: () => normalizeStructuralFile,
163052
163167
  normalizeQueryCaptures: () => normalizeQueryCaptures,
163053
163168
  nextCronRun: () => nextCronRun,
163169
+ newSynapseSessionId: () => newSynapseSessionId,
163054
163170
  newProposalId: () => newProposalId,
163055
163171
  newObservationId: () => newObservationId,
163056
163172
  newHandoffId: () => newHandoffId,
@@ -166551,7 +166667,7 @@ class EmbeddedApiClient {
166551
166667
  }
166552
166668
  async handleSynapseSession(body) {
166553
166669
  const registry3 = getSessionRegistry();
166554
- const sessionId = body.sessionId ?? `syn_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
166670
+ const sessionId = body.sessionId ?? newSynapseSessionId();
166555
166671
  const session2 = registry3.create({
166556
166672
  sessionId,
166557
166673
  agentId: body.agentId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massa-ai/mcp-client",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "massa-ai MCP server - Semantic code search, memory, and context compression via Model Context Protocol",
5
5
  "author": "luizgmassa",
6
6
  "type": "module",
@@ -20,8 +20,8 @@
20
20
  "type-check": "tsc --noEmit"
21
21
  },
22
22
  "dependencies": {
23
- "@massa-ai/core": "^1.12.0",
24
- "@massa-ai/shared": "^1.12.0",
23
+ "@massa-ai/core": "^1.12.1",
24
+ "@massa-ai/shared": "^1.12.1",
25
25
  "@modelcontextprotocol/sdk": "^1.0.0"
26
26
  },
27
27
  "devDependencies": {