@massa-ai/mcp-client 1.59.0 → 1.60.0

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.
@@ -505,13 +505,33 @@ var init_inference_providers = __esm(() => {
505
505
  },
506
506
  knownDimensions: {
507
507
  "text-embedding-nomic-embed-text-v1.5": 768,
508
- "text-embedding-qwen3-embedding-0.6b": 1024
508
+ "text-embedding-qwen3-embedding-0.6b": 1024,
509
+ "qwen3-embedding-0.6b-dwq": 1024
509
510
  },
510
511
  defaultModels: {
511
512
  embedding: "text-embedding-qwen3-embedding-0.6b",
512
513
  instruct: "qwen3-vl-8b-instruct",
513
514
  coding: "qwen2.5-coder-7b-instruct"
514
515
  },
516
+ mlxModels: {
517
+ embedding: {
518
+ repo: "mlx-community/Qwen3-Embedding-0.6B-4bit-DWQ",
519
+ model: "qwen3-embedding-0.6b-dwq"
520
+ },
521
+ instruct: {
522
+ repo: "mlx-community/Qwen3-VL-8B-Instruct-4bit",
523
+ model: "qwen3-vl-8b-instruct"
524
+ },
525
+ coding: {
526
+ repo: "mlx-community/Qwen2.5-Coder-7B-Instruct-4bit",
527
+ model: "qwen2.5-coder-7b-instruct"
528
+ }
529
+ },
530
+ ggufRepos: {
531
+ embedding: "Qwen/Qwen3-Embedding-0.6B-GGUF",
532
+ instruct: "lmstudio-community/Qwen3-VL-8B-Instruct-GGUF",
533
+ coding: "lmstudio-community/Qwen2.5-Coder-7B-Instruct-GGUF"
534
+ },
515
535
  appliesContextPerRequest: false,
516
536
  embedBatchSize: 64,
517
537
  supportsOllamaVersionProbe: false,
@@ -128350,6 +128370,7 @@ class PgObservationStore {
128350
128370
  mirror = new Map;
128351
128371
  hydrated = false;
128352
128372
  hydrating = null;
128373
+ inflight = new Map;
128353
128374
  hydrateFailedAt = 0;
128354
128375
  static HYDRATE_RETRY_MS = 30000;
128355
128376
  getClient() {
@@ -128401,46 +128422,53 @@ class PgObservationStore {
128401
128422
  const cachedCanonical = getProjectIdentityAliasResolver().resolveCached(obs.projectId);
128402
128423
  this.mirror.set(obs.id, cachedCanonical && cachedCanonical !== obs.projectId ? { ...obs, projectId: cachedCanonical } : obs);
128403
128424
  this.ensureHydrated();
128404
- (async () => {
128405
- try {
128406
- const prisma2 = this.getClient();
128407
- const canonicalProjectId = await getProjectIdentityAliasResolver().resolve(obs.projectId);
128408
- if (canonicalProjectId !== obs.projectId) {
128409
- this.mirror.set(obs.id, { ...obs, projectId: canonicalProjectId });
128410
- }
128411
- await prisma2.$executeRaw`
128412
- INSERT INTO observations (
128413
- id, project_id, session_id, source, category, payload_json, importance, created_at, agent_id, attribution_source
128414
- ) VALUES (
128415
- ${obs.id},
128416
- ${canonicalProjectId},
128417
- ${obs.sessionId},
128418
- ${obs.source},
128419
- ${obs.category ?? null},
128420
- ${obs.payloadJson},
128421
- ${obs.importance},
128422
- ${obs.createdAt}::bigint,
128423
- ${obs.agentId ?? null},
128424
- ${obs.attributionSource ?? null}
128425
- )
128426
- ON CONFLICT (id) DO UPDATE SET
128427
- project_id = EXCLUDED.project_id,
128428
- session_id = EXCLUDED.session_id,
128429
- source = EXCLUDED.source,
128430
- category = EXCLUDED.category,
128431
- payload_json = EXCLUDED.payload_json,
128432
- importance = EXCLUDED.importance,
128433
- created_at = EXCLUDED.created_at,
128434
- agent_id = EXCLUDED.agent_id,
128435
- attribution_source = EXCLUDED.attribution_source
128436
- `;
128437
- } catch (e) {
128438
- logger.warn("PgObservationStore.insert failed (best-effort)", {
128439
- id: obs.id,
128440
- error: e.message
128441
- });
128425
+ this.chainWrite(obs.id, async () => {
128426
+ const prisma2 = this.getClient();
128427
+ const canonicalProjectId = await getProjectIdentityAliasResolver().resolve(obs.projectId);
128428
+ if (canonicalProjectId !== obs.projectId) {
128429
+ this.mirror.set(obs.id, { ...obs, projectId: canonicalProjectId });
128442
128430
  }
128443
- })();
128431
+ await prisma2.$executeRaw`
128432
+ INSERT INTO observations (
128433
+ id, project_id, session_id, source, category, payload_json, importance, created_at, agent_id, attribution_source
128434
+ ) VALUES (
128435
+ ${obs.id},
128436
+ ${canonicalProjectId},
128437
+ ${obs.sessionId},
128438
+ ${obs.source},
128439
+ ${obs.category ?? null},
128440
+ ${obs.payloadJson},
128441
+ ${obs.importance},
128442
+ ${obs.createdAt}::bigint,
128443
+ ${obs.agentId ?? null},
128444
+ ${obs.attributionSource ?? null}
128445
+ )
128446
+ ON CONFLICT (id) DO UPDATE SET
128447
+ project_id = EXCLUDED.project_id,
128448
+ session_id = EXCLUDED.session_id,
128449
+ source = EXCLUDED.source,
128450
+ category = EXCLUDED.category,
128451
+ payload_json = EXCLUDED.payload_json,
128452
+ importance = EXCLUDED.importance,
128453
+ created_at = EXCLUDED.created_at,
128454
+ agent_id = EXCLUDED.agent_id,
128455
+ attribution_source = EXCLUDED.attribution_source
128456
+ `;
128457
+ });
128458
+ }
128459
+ chainWrite(key, fn) {
128460
+ const prev = this.inflight.get(key) ?? Promise.resolve();
128461
+ const next = prev.then(fn).catch((e) => {
128462
+ logger.warn("PgObservationStore.insert failed (best-effort)", {
128463
+ id: key,
128464
+ error: e.message
128465
+ });
128466
+ });
128467
+ this.inflight.set(key, next);
128468
+ next.then(() => {
128469
+ if (this.inflight.get(key) === next)
128470
+ this.inflight.delete(key);
128471
+ });
128444
128472
  }
128445
128473
  listRecent(projectId, limit) {
128446
128474
  this.ensureHydrated();
@@ -128467,6 +128495,9 @@ class PgObservationStore {
128467
128495
  await this.ensureHydrated();
128468
128496
  }
128469
128497
  async __drain() {
128498
+ const pending = Array.from(this.inflight.values());
128499
+ if (pending.length > 0)
128500
+ await Promise.allSettled(pending);
128470
128501
  await new Promise((r) => setTimeout(r, 10));
128471
128502
  }
128472
128503
  }
package/dist/index.js CHANGED
@@ -25502,13 +25502,33 @@ var init_inference_providers = __esm(() => {
25502
25502
  },
25503
25503
  knownDimensions: {
25504
25504
  "text-embedding-nomic-embed-text-v1.5": 768,
25505
- "text-embedding-qwen3-embedding-0.6b": 1024
25505
+ "text-embedding-qwen3-embedding-0.6b": 1024,
25506
+ "qwen3-embedding-0.6b-dwq": 1024
25506
25507
  },
25507
25508
  defaultModels: {
25508
25509
  embedding: "text-embedding-qwen3-embedding-0.6b",
25509
25510
  instruct: "qwen3-vl-8b-instruct",
25510
25511
  coding: "qwen2.5-coder-7b-instruct"
25511
25512
  },
25513
+ mlxModels: {
25514
+ embedding: {
25515
+ repo: "mlx-community/Qwen3-Embedding-0.6B-4bit-DWQ",
25516
+ model: "qwen3-embedding-0.6b-dwq"
25517
+ },
25518
+ instruct: {
25519
+ repo: "mlx-community/Qwen3-VL-8B-Instruct-4bit",
25520
+ model: "qwen3-vl-8b-instruct"
25521
+ },
25522
+ coding: {
25523
+ repo: "mlx-community/Qwen2.5-Coder-7B-Instruct-4bit",
25524
+ model: "qwen2.5-coder-7b-instruct"
25525
+ }
25526
+ },
25527
+ ggufRepos: {
25528
+ embedding: "Qwen/Qwen3-Embedding-0.6B-GGUF",
25529
+ instruct: "lmstudio-community/Qwen3-VL-8B-Instruct-GGUF",
25530
+ coding: "lmstudio-community/Qwen2.5-Coder-7B-Instruct-GGUF"
25531
+ },
25512
25532
  appliesContextPerRequest: false,
25513
25533
  embedBatchSize: 64,
25514
25534
  supportsOllamaVersionProbe: false,
@@ -138101,6 +138121,7 @@ class PgObservationStore {
138101
138121
  mirror = new Map;
138102
138122
  hydrated = false;
138103
138123
  hydrating = null;
138124
+ inflight = new Map;
138104
138125
  hydrateFailedAt = 0;
138105
138126
  static HYDRATE_RETRY_MS = 30000;
138106
138127
  getClient() {
@@ -138152,46 +138173,53 @@ class PgObservationStore {
138152
138173
  const cachedCanonical = getProjectIdentityAliasResolver().resolveCached(obs.projectId);
138153
138174
  this.mirror.set(obs.id, cachedCanonical && cachedCanonical !== obs.projectId ? { ...obs, projectId: cachedCanonical } : obs);
138154
138175
  this.ensureHydrated();
138155
- (async () => {
138156
- try {
138157
- const prisma2 = this.getClient();
138158
- const canonicalProjectId = await getProjectIdentityAliasResolver().resolve(obs.projectId);
138159
- if (canonicalProjectId !== obs.projectId) {
138160
- this.mirror.set(obs.id, { ...obs, projectId: canonicalProjectId });
138161
- }
138162
- await prisma2.$executeRaw`
138163
- INSERT INTO observations (
138164
- id, project_id, session_id, source, category, payload_json, importance, created_at, agent_id, attribution_source
138165
- ) VALUES (
138166
- ${obs.id},
138167
- ${canonicalProjectId},
138168
- ${obs.sessionId},
138169
- ${obs.source},
138170
- ${obs.category ?? null},
138171
- ${obs.payloadJson},
138172
- ${obs.importance},
138173
- ${obs.createdAt}::bigint,
138174
- ${obs.agentId ?? null},
138175
- ${obs.attributionSource ?? null}
138176
- )
138177
- ON CONFLICT (id) DO UPDATE SET
138178
- project_id = EXCLUDED.project_id,
138179
- session_id = EXCLUDED.session_id,
138180
- source = EXCLUDED.source,
138181
- category = EXCLUDED.category,
138182
- payload_json = EXCLUDED.payload_json,
138183
- importance = EXCLUDED.importance,
138184
- created_at = EXCLUDED.created_at,
138185
- agent_id = EXCLUDED.agent_id,
138186
- attribution_source = EXCLUDED.attribution_source
138187
- `;
138188
- } catch (e) {
138189
- logger.warn("PgObservationStore.insert failed (best-effort)", {
138190
- id: obs.id,
138191
- error: e.message
138192
- });
138176
+ this.chainWrite(obs.id, async () => {
138177
+ const prisma2 = this.getClient();
138178
+ const canonicalProjectId = await getProjectIdentityAliasResolver().resolve(obs.projectId);
138179
+ if (canonicalProjectId !== obs.projectId) {
138180
+ this.mirror.set(obs.id, { ...obs, projectId: canonicalProjectId });
138193
138181
  }
138194
- })();
138182
+ await prisma2.$executeRaw`
138183
+ INSERT INTO observations (
138184
+ id, project_id, session_id, source, category, payload_json, importance, created_at, agent_id, attribution_source
138185
+ ) VALUES (
138186
+ ${obs.id},
138187
+ ${canonicalProjectId},
138188
+ ${obs.sessionId},
138189
+ ${obs.source},
138190
+ ${obs.category ?? null},
138191
+ ${obs.payloadJson},
138192
+ ${obs.importance},
138193
+ ${obs.createdAt}::bigint,
138194
+ ${obs.agentId ?? null},
138195
+ ${obs.attributionSource ?? null}
138196
+ )
138197
+ ON CONFLICT (id) DO UPDATE SET
138198
+ project_id = EXCLUDED.project_id,
138199
+ session_id = EXCLUDED.session_id,
138200
+ source = EXCLUDED.source,
138201
+ category = EXCLUDED.category,
138202
+ payload_json = EXCLUDED.payload_json,
138203
+ importance = EXCLUDED.importance,
138204
+ created_at = EXCLUDED.created_at,
138205
+ agent_id = EXCLUDED.agent_id,
138206
+ attribution_source = EXCLUDED.attribution_source
138207
+ `;
138208
+ });
138209
+ }
138210
+ chainWrite(key, fn) {
138211
+ const prev = this.inflight.get(key) ?? Promise.resolve();
138212
+ const next = prev.then(fn).catch((e) => {
138213
+ logger.warn("PgObservationStore.insert failed (best-effort)", {
138214
+ id: key,
138215
+ error: e.message
138216
+ });
138217
+ });
138218
+ this.inflight.set(key, next);
138219
+ next.then(() => {
138220
+ if (this.inflight.get(key) === next)
138221
+ this.inflight.delete(key);
138222
+ });
138195
138223
  }
138196
138224
  listRecent(projectId, limit) {
138197
138225
  this.ensureHydrated();
@@ -138218,6 +138246,9 @@ class PgObservationStore {
138218
138246
  await this.ensureHydrated();
138219
138247
  }
138220
138248
  async __drain() {
138249
+ const pending = Array.from(this.inflight.values());
138250
+ if (pending.length > 0)
138251
+ await Promise.allSettled(pending);
138221
138252
  await new Promise((r) => setTimeout(r, 10));
138222
138253
  }
138223
138254
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massa-ai/mcp-client",
3
- "version": "1.59.0",
3
+ "version": "1.60.0",
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.59.0",
24
- "@massa-ai/shared": "^1.59.0",
23
+ "@massa-ai/core": "^1.60.0",
24
+ "@massa-ai/shared": "^1.60.0",
25
25
  "@modelcontextprotocol/sdk": "^1.0.0"
26
26
  },
27
27
  "devDependencies": {