@vibegrid/mcp 0.4.0-beta.2 → 0.4.0-beta.3

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 (2) hide show
  1. package/dist/index.js +46 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -331,6 +331,7 @@ function createSchema() {
331
331
  CREATE INDEX IF NOT EXISTS idx_session_events_type ON session_events(event_type, timestamp DESC);
332
332
  `);
333
333
  migrateSchema(d);
334
+ verifySchema(d);
334
335
  }
335
336
  function migrateSchema(d) {
336
337
  const row = d.prepare("SELECT value FROM schema_meta WHERE key = 'schema_version'").get();
@@ -401,6 +402,50 @@ function migrateSchema(d) {
401
402
  logger_default.info("[database] migrated schema to version 3 (session sort order)");
402
403
  }
403
404
  }
405
+ function verifySchema(d) {
406
+ const expectedByTable = {
407
+ projects: [
408
+ {
409
+ column: "workspace_id",
410
+ ddl: "ALTER TABLE projects ADD COLUMN workspace_id TEXT NOT NULL DEFAULT 'personal'"
411
+ }
412
+ ],
413
+ workflows: [
414
+ {
415
+ column: "workspace_id",
416
+ ddl: "ALTER TABLE workflows ADD COLUMN workspace_id TEXT NOT NULL DEFAULT 'personal'"
417
+ }
418
+ ],
419
+ remote_hosts: [
420
+ { column: "auth_method", ddl: "ALTER TABLE remote_hosts ADD COLUMN auth_method TEXT" },
421
+ { column: "credential_id", ddl: "ALTER TABLE remote_hosts ADD COLUMN credential_id TEXT" },
422
+ {
423
+ column: "encrypted_password",
424
+ ddl: "ALTER TABLE remote_hosts ADD COLUMN encrypted_password TEXT"
425
+ }
426
+ ],
427
+ sessions: [
428
+ {
429
+ column: "sort_order",
430
+ ddl: "ALTER TABLE sessions ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0"
431
+ }
432
+ ]
433
+ };
434
+ for (const [table, columns] of Object.entries(expectedByTable)) {
435
+ const existing = new Set(
436
+ d.prepare(`PRAGMA table_info(${table})`).all().map((c) => c.name)
437
+ );
438
+ for (const { column, ddl } of columns) {
439
+ if (existing.has(column)) continue;
440
+ try {
441
+ d.exec(ddl);
442
+ logger_default.warn(`[database] self-heal: added missing column ${table}.${column}`);
443
+ } catch (err) {
444
+ logger_default.error(`[database] self-heal: failed to add ${table}.${column}:`, err);
445
+ }
446
+ }
447
+ }
448
+ }
404
449
  function loadConfig() {
405
450
  const d = getDb();
406
451
  const defaults = loadDefaults(d);
@@ -2215,7 +2260,7 @@ console.warn = (...args) => _origError("[mcp:warn]", ...args);
2215
2260
  console.error = (...args) => _origError("[mcp:error]", ...args);
2216
2261
  async function main() {
2217
2262
  configManager.init();
2218
- const version = true ? "0.4.0-beta.2" : createRequire(import.meta.url)("../package.json").version;
2263
+ const version = true ? "0.4.0-beta.3" : createRequire(import.meta.url)("../package.json").version;
2219
2264
  const server = createMcpServer(version);
2220
2265
  const transport = new StdioServerTransport();
2221
2266
  await server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibegrid/mcp",
3
- "version": "0.4.0-beta.2",
3
+ "version": "0.4.0-beta.3",
4
4
  "description": "VibeGrid MCP server — task management, git, and workflow tools for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",