@massa-ai/mcp-client 1.41.0 → 1.42.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.
@@ -109640,6 +109640,48 @@ var init_postgres_vector_store = __esm(() => {
109640
109640
  lastIndexed: row.last_updated?.toISOString() ?? null
109641
109641
  }));
109642
109642
  }
109643
+ async getPool() {
109644
+ if (this.pool)
109645
+ return this.pool;
109646
+ const pg2 = await Promise.resolve().then(() => (init_esm6(), exports_esm));
109647
+ const PgPool = pg2.default?.Pool ?? pg2.Pool;
109648
+ const poolConfig = {
109649
+ connectionString: this.config.connectionString,
109650
+ max: this.config.poolSize,
109651
+ idleTimeoutMillis: 30000,
109652
+ connectionTimeoutMillis: 5000
109653
+ };
109654
+ this.pool = new PgPool(poolConfig);
109655
+ return this.pool;
109656
+ }
109657
+ async listAllProjectsAcrossDimensions() {
109658
+ const pool = await this.getPool();
109659
+ const { rows: tables } = await pool.query(`
109660
+ SELECT tablename FROM pg_tables
109661
+ WHERE tablename = 'vector_documents'
109662
+ OR tablename ~ '^vector_documents_[0-9]+d$'
109663
+ ORDER BY tablename
109664
+ `);
109665
+ if (tables.length === 0)
109666
+ return [];
109667
+ const unionParts = tables.map((t) => `SELECT project_id, COUNT(*)::int AS doc_count, MAX(updated_at) AS last_updated, SUM(LENGTH(content))::bigint AS total_size FROM ${t.tablename} WHERE id NOT LIKE '_metadata:%' GROUP BY project_id`).join(" UNION ALL ");
109668
+ const { rows } = await pool.query(`
109669
+ SELECT project_id,
109670
+ SUM(doc_count)::int AS doc_count,
109671
+ MAX(last_updated) AS last_updated,
109672
+ SUM(total_size)::bigint AS total_size
109673
+ FROM (${unionParts}) AS merged
109674
+ GROUP BY project_id
109675
+ ORDER BY last_updated DESC
109676
+ `);
109677
+ return rows.map((row) => ({
109678
+ projectId: row.project_id,
109679
+ projectPath: null,
109680
+ documentCount: parseInt(row.doc_count),
109681
+ totalSize: parseInt(row.total_size ?? "0"),
109682
+ lastIndexed: row.last_updated?.toISOString() ?? null
109683
+ }));
109684
+ }
109643
109685
  async getCollection(name26) {
109644
109686
  const pool = await this.ensureInitialized();
109645
109687
  return new PostgresVectorCollection(pool, name26, this.tableName, this);
package/dist/index.js CHANGED
@@ -116199,6 +116199,48 @@ var init_postgres_vector_store = __esm(() => {
116199
116199
  lastIndexed: row.last_updated?.toISOString() ?? null
116200
116200
  }));
116201
116201
  }
116202
+ async getPool() {
116203
+ if (this.pool)
116204
+ return this.pool;
116205
+ const pg2 = await Promise.resolve().then(() => (init_esm6(), exports_esm));
116206
+ const PgPool = pg2.default?.Pool ?? pg2.Pool;
116207
+ const poolConfig = {
116208
+ connectionString: this.config.connectionString,
116209
+ max: this.config.poolSize,
116210
+ idleTimeoutMillis: 30000,
116211
+ connectionTimeoutMillis: 5000
116212
+ };
116213
+ this.pool = new PgPool(poolConfig);
116214
+ return this.pool;
116215
+ }
116216
+ async listAllProjectsAcrossDimensions() {
116217
+ const pool = await this.getPool();
116218
+ const { rows: tables } = await pool.query(`
116219
+ SELECT tablename FROM pg_tables
116220
+ WHERE tablename = 'vector_documents'
116221
+ OR tablename ~ '^vector_documents_[0-9]+d$'
116222
+ ORDER BY tablename
116223
+ `);
116224
+ if (tables.length === 0)
116225
+ return [];
116226
+ const unionParts = tables.map((t) => `SELECT project_id, COUNT(*)::int AS doc_count, MAX(updated_at) AS last_updated, SUM(LENGTH(content))::bigint AS total_size FROM ${t.tablename} WHERE id NOT LIKE '_metadata:%' GROUP BY project_id`).join(" UNION ALL ");
116227
+ const { rows } = await pool.query(`
116228
+ SELECT project_id,
116229
+ SUM(doc_count)::int AS doc_count,
116230
+ MAX(last_updated) AS last_updated,
116231
+ SUM(total_size)::bigint AS total_size
116232
+ FROM (${unionParts}) AS merged
116233
+ GROUP BY project_id
116234
+ ORDER BY last_updated DESC
116235
+ `);
116236
+ return rows.map((row) => ({
116237
+ projectId: row.project_id,
116238
+ projectPath: null,
116239
+ documentCount: parseInt(row.doc_count),
116240
+ totalSize: parseInt(row.total_size ?? "0"),
116241
+ lastIndexed: row.last_updated?.toISOString() ?? null
116242
+ }));
116243
+ }
116202
116244
  async getCollection(name26) {
116203
116245
  const pool = await this.ensureInitialized();
116204
116246
  return new PostgresVectorCollection(pool, name26, this.tableName, this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@massa-ai/mcp-client",
3
- "version": "1.41.0",
3
+ "version": "1.42.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.41.0",
24
- "@massa-ai/shared": "^1.41.0",
23
+ "@massa-ai/core": "^1.42.0",
24
+ "@massa-ai/shared": "^1.42.0",
25
25
  "@modelcontextprotocol/sdk": "^1.0.0"
26
26
  },
27
27
  "devDependencies": {