@massa-ai/mcp-client 1.34.0 → 1.35.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.
@@ -133320,8 +133320,8 @@ class GraphGenerationRepositoryPg {
133320
133320
  async heartbeat(lease, leaseTtlMs) {
133321
133321
  const ttl = validateTtl2(leaseTtlMs);
133322
133322
  return getPrismaClient2().$transaction(async (tx) => {
133323
- const workspace = await lockWorkspace(tx, lease.projectId);
133324
133323
  const generation = await lockGeneration(tx, lease.projectId, lease.generationId);
133324
+ const workspace = await lockWorkspace(tx, lease.projectId);
133325
133325
  if (!leaseMatches(workspace, generation, lease))
133326
133326
  return { status: "lease_lost" };
133327
133327
  const renewed = await tx.$queryRaw`
@@ -133344,8 +133344,8 @@ class GraphGenerationRepositoryPg {
133344
133344
  }
133345
133345
  async complete(lease) {
133346
133346
  return getPrismaClient2().$transaction(async (tx) => {
133347
- const workspace = await lockWorkspace(tx, lease.projectId);
133348
133347
  const generation = await lockGeneration(tx, lease.projectId, lease.generationId);
133348
+ const workspace = await lockWorkspace(tx, lease.projectId);
133349
133349
  if (!leaseMatches(workspace, generation, lease))
133350
133350
  return { status: "lease_lost" };
133351
133351
  const live = await tx.$queryRaw`
@@ -133374,8 +133374,8 @@ class GraphGenerationRepositoryPg {
133374
133374
  }
133375
133375
  async activate(lease) {
133376
133376
  return getPrismaClient2().$transaction(async (tx) => {
133377
- const workspace = await lockWorkspace(tx, lease.projectId);
133378
133377
  const generation = await lockGeneration(tx, lease.projectId, lease.generationId);
133378
+ const workspace = await lockWorkspace(tx, lease.projectId);
133379
133379
  if (!leaseMatches(workspace, generation, lease))
133380
133380
  return { status: "lease_lost" };
133381
133381
  if (workspace.active_graph_generation_id !== generation.expected_active_id) {
@@ -133425,8 +133425,8 @@ class GraphGenerationRepositoryPg {
133425
133425
  async abort(lease, reason) {
133426
133426
  const failureReason = boundedText2(reason, "reason", MAX_FAILURE_REASON);
133427
133427
  return getPrismaClient2().$transaction(async (tx) => {
133428
- const workspace = await lockWorkspace(tx, lease.projectId);
133429
133428
  const generation = await lockGeneration(tx, lease.projectId, lease.generationId);
133429
+ const workspace = await lockWorkspace(tx, lease.projectId);
133430
133430
  if (!leaseMatches(workspace, generation, lease))
133431
133431
  return { status: "lease_lost" };
133432
133432
  const live = await tx.$queryRaw`
@@ -133502,7 +133502,7 @@ class GraphGenerationCoordinator {
133502
133502
  async begin(input) {
133503
133503
  const deadline = Date.now() + GRAPH_GENERATION_LEASE_TTL_MS;
133504
133504
  for (;; ) {
133505
- const outcome2 = await this.repository.begin({ ...input, leaseTtlMs: GRAPH_GENERATION_LEASE_TTL_MS });
133505
+ const outcome2 = await withDeadlockRetry(() => this.repository.begin({ ...input, leaseTtlMs: GRAPH_GENERATION_LEASE_TTL_MS }), { operation: "graph_generation.begin", maxAttempts: 5 });
133506
133506
  if (outcome2.status === "acquired")
133507
133507
  return outcome2.lease;
133508
133508
  if (outcome2.status === "stale_active") {
@@ -133514,12 +133514,12 @@ class GraphGenerationCoordinator {
133514
133514
  }
133515
133515
  }
133516
133516
  async heartbeat(lease) {
133517
- const outcome2 = await withDeadlockRetry(() => this.repository.heartbeat(lease, GRAPH_GENERATION_LEASE_TTL_MS), { operation: "graph_generation.heartbeat", maxAttempts: 3 });
133517
+ const outcome2 = await withDeadlockRetry(() => this.repository.heartbeat(lease, GRAPH_GENERATION_LEASE_TTL_MS), { operation: "graph_generation.heartbeat", maxAttempts: 5 });
133518
133518
  if (outcome2.status !== "renewed")
133519
133519
  throw new Error("graph_generation_lease_lost");
133520
133520
  }
133521
133521
  async activate(lease) {
133522
- const completeness = await this.repository.complete(lease);
133522
+ const completeness = await withDeadlockRetry(() => this.repository.complete(lease), { operation: "graph_generation.complete", maxAttempts: 5 });
133523
133523
  if (completeness.status === "incomplete") {
133524
133524
  throw new Error(`graph_generation_incomplete:${completeness.reasons.join(",")}`);
133525
133525
  }
@@ -133528,7 +133528,7 @@ class GraphGenerationCoordinator {
133528
133528
  if (completeness.status === "stale_active") {
133529
133529
  throw new Error(`graph_generation_stale_active:${completeness.activeGenerationId ?? "none"}`);
133530
133530
  }
133531
- const activation = await this.repository.activate(lease);
133531
+ const activation = await withDeadlockRetry(() => this.repository.activate(lease), { operation: "graph_generation.activate", maxAttempts: 5 });
133532
133532
  if (activation.status === "activated")
133533
133533
  return activation;
133534
133534
  if (activation.status === "incomplete") {
@@ -133539,7 +133539,7 @@ class GraphGenerationCoordinator {
133539
133539
  throw new Error(`graph_generation_stale_active:${activation.activeGenerationId ?? "none"}`);
133540
133540
  }
133541
133541
  async abort(lease, reason) {
133542
- const outcome2 = await this.repository.abort(lease, reason);
133542
+ const outcome2 = await withDeadlockRetry(() => this.repository.abort(lease, reason), { operation: "graph_generation.abort", maxAttempts: 5 });
133543
133543
  if (outcome2.status === "lease_lost")
133544
133544
  throw new Error("graph_generation_lease_lost_during_abort");
133545
133545
  }
package/dist/index.js CHANGED
@@ -128881,8 +128881,8 @@ class GraphGenerationRepositoryPg {
128881
128881
  async heartbeat(lease, leaseTtlMs) {
128882
128882
  const ttl = validateTtl2(leaseTtlMs);
128883
128883
  return getPrismaClient2().$transaction(async (tx) => {
128884
- const workspace = await lockWorkspace(tx, lease.projectId);
128885
128884
  const generation = await lockGeneration(tx, lease.projectId, lease.generationId);
128885
+ const workspace = await lockWorkspace(tx, lease.projectId);
128886
128886
  if (!leaseMatches(workspace, generation, lease))
128887
128887
  return { status: "lease_lost" };
128888
128888
  const renewed = await tx.$queryRaw`
@@ -128905,8 +128905,8 @@ class GraphGenerationRepositoryPg {
128905
128905
  }
128906
128906
  async complete(lease) {
128907
128907
  return getPrismaClient2().$transaction(async (tx) => {
128908
- const workspace = await lockWorkspace(tx, lease.projectId);
128909
128908
  const generation = await lockGeneration(tx, lease.projectId, lease.generationId);
128909
+ const workspace = await lockWorkspace(tx, lease.projectId);
128910
128910
  if (!leaseMatches(workspace, generation, lease))
128911
128911
  return { status: "lease_lost" };
128912
128912
  const live = await tx.$queryRaw`
@@ -128935,8 +128935,8 @@ class GraphGenerationRepositoryPg {
128935
128935
  }
128936
128936
  async activate(lease) {
128937
128937
  return getPrismaClient2().$transaction(async (tx) => {
128938
- const workspace = await lockWorkspace(tx, lease.projectId);
128939
128938
  const generation = await lockGeneration(tx, lease.projectId, lease.generationId);
128939
+ const workspace = await lockWorkspace(tx, lease.projectId);
128940
128940
  if (!leaseMatches(workspace, generation, lease))
128941
128941
  return { status: "lease_lost" };
128942
128942
  if (workspace.active_graph_generation_id !== generation.expected_active_id) {
@@ -128986,8 +128986,8 @@ class GraphGenerationRepositoryPg {
128986
128986
  async abort(lease, reason) {
128987
128987
  const failureReason = boundedText2(reason, "reason", MAX_FAILURE_REASON);
128988
128988
  return getPrismaClient2().$transaction(async (tx) => {
128989
- const workspace = await lockWorkspace(tx, lease.projectId);
128990
128989
  const generation = await lockGeneration(tx, lease.projectId, lease.generationId);
128990
+ const workspace = await lockWorkspace(tx, lease.projectId);
128991
128991
  if (!leaseMatches(workspace, generation, lease))
128992
128992
  return { status: "lease_lost" };
128993
128993
  const live = await tx.$queryRaw`
@@ -129063,7 +129063,7 @@ class GraphGenerationCoordinator {
129063
129063
  async begin(input) {
129064
129064
  const deadline = Date.now() + GRAPH_GENERATION_LEASE_TTL_MS;
129065
129065
  for (;; ) {
129066
- const outcome2 = await this.repository.begin({ ...input, leaseTtlMs: GRAPH_GENERATION_LEASE_TTL_MS });
129066
+ const outcome2 = await withDeadlockRetry(() => this.repository.begin({ ...input, leaseTtlMs: GRAPH_GENERATION_LEASE_TTL_MS }), { operation: "graph_generation.begin", maxAttempts: 5 });
129067
129067
  if (outcome2.status === "acquired")
129068
129068
  return outcome2.lease;
129069
129069
  if (outcome2.status === "stale_active") {
@@ -129075,12 +129075,12 @@ class GraphGenerationCoordinator {
129075
129075
  }
129076
129076
  }
129077
129077
  async heartbeat(lease) {
129078
- const outcome2 = await withDeadlockRetry(() => this.repository.heartbeat(lease, GRAPH_GENERATION_LEASE_TTL_MS), { operation: "graph_generation.heartbeat", maxAttempts: 3 });
129078
+ const outcome2 = await withDeadlockRetry(() => this.repository.heartbeat(lease, GRAPH_GENERATION_LEASE_TTL_MS), { operation: "graph_generation.heartbeat", maxAttempts: 5 });
129079
129079
  if (outcome2.status !== "renewed")
129080
129080
  throw new Error("graph_generation_lease_lost");
129081
129081
  }
129082
129082
  async activate(lease) {
129083
- const completeness = await this.repository.complete(lease);
129083
+ const completeness = await withDeadlockRetry(() => this.repository.complete(lease), { operation: "graph_generation.complete", maxAttempts: 5 });
129084
129084
  if (completeness.status === "incomplete") {
129085
129085
  throw new Error(`graph_generation_incomplete:${completeness.reasons.join(",")}`);
129086
129086
  }
@@ -129089,7 +129089,7 @@ class GraphGenerationCoordinator {
129089
129089
  if (completeness.status === "stale_active") {
129090
129090
  throw new Error(`graph_generation_stale_active:${completeness.activeGenerationId ?? "none"}`);
129091
129091
  }
129092
- const activation = await this.repository.activate(lease);
129092
+ const activation = await withDeadlockRetry(() => this.repository.activate(lease), { operation: "graph_generation.activate", maxAttempts: 5 });
129093
129093
  if (activation.status === "activated")
129094
129094
  return activation;
129095
129095
  if (activation.status === "incomplete") {
@@ -129100,7 +129100,7 @@ class GraphGenerationCoordinator {
129100
129100
  throw new Error(`graph_generation_stale_active:${activation.activeGenerationId ?? "none"}`);
129101
129101
  }
129102
129102
  async abort(lease, reason) {
129103
- const outcome2 = await this.repository.abort(lease, reason);
129103
+ const outcome2 = await withDeadlockRetry(() => this.repository.abort(lease, reason), { operation: "graph_generation.abort", maxAttempts: 5 });
129104
129104
  if (outcome2.status === "lease_lost")
129105
129105
  throw new Error("graph_generation_lease_lost_during_abort");
129106
129106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massa-ai/mcp-client",
3
- "version": "1.34.0",
3
+ "version": "1.35.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.34.0",
24
- "@massa-ai/shared": "^1.34.0",
23
+ "@massa-ai/core": "^1.35.1",
24
+ "@massa-ai/shared": "^1.35.1",
25
25
  "@modelcontextprotocol/sdk": "^1.0.0"
26
26
  },
27
27
  "devDependencies": {