@basegrid_tech/mcp 0.7.0 → 0.9.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.
Files changed (2) hide show
  1. package/dist/index.js +108 -59
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -10,6 +10,10 @@ import fs4 from "fs";
10
10
  // ../shared/src/types.ts
11
11
  var CLAUDE_DEFAULT_MODEL_ID = "claude-sonnet-4-6";
12
12
  var CLAUDE_DEFAULT_EFFORT = "medium";
13
+ var CLAUDE_OBSOLETE_MODEL_IDS = [
14
+ "claude-opus-4-7[1m]",
15
+ "claude-opus-4-6[1m]"
16
+ ];
13
17
  var CODEX_DEFAULT_MODEL_ID = "gpt-5.5";
14
18
  var CODEX_OBSOLETE_MODEL_IDS = [
15
19
  "gpt-5-codex",
@@ -466,7 +470,11 @@ function createSchema() {
466
470
  agent_session_id TEXT,
467
471
  docked INTEGER NOT NULL DEFAULT 0,
468
472
  basegrid_role TEXT,
469
- shell_cwd TEXT
473
+ shell_cwd TEXT,
474
+ tab_type TEXT NOT NULL DEFAULT 'terminal',
475
+ browser_url TEXT,
476
+ browser_title TEXT,
477
+ browser_favicon TEXT
470
478
  );
471
479
 
472
480
  CREATE TABLE IF NOT EXISTS schedule_log (
@@ -588,6 +596,7 @@ function createSchema() {
588
596
  alias TEXT,
589
597
  alias_generated_at INTEGER,
590
598
  sort_order INTEGER NOT NULL DEFAULT 0,
599
+ is_auto_generated INTEGER,
591
600
  updated_at INTEGER NOT NULL,
592
601
  PRIMARY KEY (project_path, worktree_path)
593
602
  );
@@ -974,7 +983,7 @@ function migrateSchema(d) {
974
983
  last_synced_at TEXT NOT NULL,
975
984
  conflict_state TEXT NOT NULL DEFAULT 'none',
976
985
  PRIMARY KEY (task_id),
977
- UNIQUE (connection_id, external_id)
986
+ UNIQUE (connection_id, external_id, external_url)
978
987
  )
979
988
  `);
980
989
  const taskCols = d.prepare("PRAGMA table_info(tasks)").all();
@@ -1127,6 +1136,63 @@ function migrateSchema(d) {
1127
1136
  })();
1128
1137
  logger_default.info("[database] migrated schema to version 24 (account cache + install_id)");
1129
1138
  }
1139
+ if (version < 25) {
1140
+ d.pragma("foreign_keys = OFF");
1141
+ try {
1142
+ d.transaction(() => {
1143
+ d.exec(`
1144
+ CREATE TABLE task_source_links_new (
1145
+ task_id TEXT NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
1146
+ connection_id TEXT NOT NULL REFERENCES source_connections(id) ON DELETE CASCADE,
1147
+ connector_id TEXT NOT NULL,
1148
+ external_id TEXT NOT NULL,
1149
+ external_url TEXT NOT NULL,
1150
+ source_status_raw TEXT NOT NULL,
1151
+ source_updated_at TEXT NOT NULL,
1152
+ last_synced_at TEXT NOT NULL,
1153
+ conflict_state TEXT NOT NULL DEFAULT 'none',
1154
+ last_error TEXT,
1155
+ last_error_at TEXT,
1156
+ PRIMARY KEY (task_id),
1157
+ UNIQUE (connection_id, external_id, external_url)
1158
+ )
1159
+ `);
1160
+ d.exec(`
1161
+ INSERT INTO task_source_links_new
1162
+ (task_id, connection_id, connector_id, external_id, external_url,
1163
+ source_status_raw, source_updated_at, last_synced_at, conflict_state,
1164
+ last_error, last_error_at)
1165
+ SELECT
1166
+ task_id, connection_id, connector_id, external_id, external_url,
1167
+ source_status_raw, source_updated_at, last_synced_at, conflict_state,
1168
+ last_error, last_error_at
1169
+ FROM task_source_links
1170
+ `);
1171
+ d.exec("DROP TABLE task_source_links");
1172
+ d.exec("ALTER TABLE task_source_links_new RENAME TO task_source_links");
1173
+ d.prepare(
1174
+ "INSERT OR REPLACE INTO schema_meta (key, value) VALUES ('schema_version', '25')"
1175
+ ).run();
1176
+ })();
1177
+ } finally {
1178
+ d.pragma("foreign_keys = ON");
1179
+ }
1180
+ logger_default.info(
1181
+ "[database] migrated schema to version 25 (task_source_links unique includes external_url)"
1182
+ );
1183
+ }
1184
+ if (version < 26) {
1185
+ d.transaction(() => {
1186
+ const cols = d.prepare("PRAGMA table_info(worktree_list_cache)").all();
1187
+ if (!cols.some((c) => c.name === "is_auto_generated")) {
1188
+ d.exec("ALTER TABLE worktree_list_cache ADD COLUMN is_auto_generated INTEGER");
1189
+ }
1190
+ d.prepare(
1191
+ "INSERT OR REPLACE INTO schema_meta (key, value) VALUES ('schema_version', '26')"
1192
+ ).run();
1193
+ })();
1194
+ logger_default.info("[database] migrated schema to version 26 (worktree is_auto_generated flag)");
1195
+ }
1130
1196
  }
1131
1197
  function verifySchema(d) {
1132
1198
  const expectedTables = [
@@ -1174,7 +1240,7 @@ function verifySchema(d) {
1174
1240
  last_synced_at TEXT NOT NULL,
1175
1241
  conflict_state TEXT NOT NULL DEFAULT 'none',
1176
1242
  PRIMARY KEY (task_id),
1177
- UNIQUE (connection_id, external_id)
1243
+ UNIQUE (connection_id, external_id, external_url)
1178
1244
  )`
1179
1245
  }
1180
1246
  ];
@@ -1225,7 +1291,14 @@ function verifySchema(d) {
1225
1291
  ddl: "ALTER TABLE sessions ADD COLUMN docked INTEGER NOT NULL DEFAULT 0"
1226
1292
  },
1227
1293
  { column: "basegrid_role", ddl: "ALTER TABLE sessions ADD COLUMN basegrid_role TEXT" },
1228
- { column: "shell_cwd", ddl: "ALTER TABLE sessions ADD COLUMN shell_cwd TEXT" }
1294
+ { column: "shell_cwd", ddl: "ALTER TABLE sessions ADD COLUMN shell_cwd TEXT" },
1295
+ {
1296
+ column: "tab_type",
1297
+ ddl: "ALTER TABLE sessions ADD COLUMN tab_type TEXT NOT NULL DEFAULT 'terminal'"
1298
+ },
1299
+ { column: "browser_url", ddl: "ALTER TABLE sessions ADD COLUMN browser_url TEXT" },
1300
+ { column: "browser_title", ddl: "ALTER TABLE sessions ADD COLUMN browser_title TEXT" },
1301
+ { column: "browser_favicon", ddl: "ALTER TABLE sessions ADD COLUMN browser_favicon TEXT" }
1229
1302
  ],
1230
1303
  agent_commands: [
1231
1304
  {
@@ -1278,6 +1351,10 @@ function verifySchema(d) {
1278
1351
  {
1279
1352
  column: "sort_order",
1280
1353
  ddl: "ALTER TABLE worktree_list_cache ADD COLUMN sort_order INTEGER NOT NULL DEFAULT 0"
1354
+ },
1355
+ {
1356
+ column: "is_auto_generated",
1357
+ ddl: "ALTER TABLE worktree_list_cache ADD COLUMN is_auto_generated INTEGER"
1281
1358
  }
1282
1359
  ]
1283
1360
  };
@@ -1328,6 +1405,7 @@ var DEFAULTS_KEYS_MAP = {
1328
1405
  widgetEnabled: true,
1329
1406
  minimizeToTray: true,
1330
1407
  dashboardEnabled: true,
1408
+ canvasEnabled: true,
1331
1409
  slashCommandFallbackDescription: true,
1332
1410
  taskViewMode: true,
1333
1411
  taskListCollapsedStatuses: true,
@@ -1351,21 +1429,21 @@ var DEFAULTS_KEYS_MAP = {
1351
1429
  defaultSpinnerVariant: true,
1352
1430
  dragFilesFromChanges: true,
1353
1431
  taskGithubIssueEnabled: true,
1354
- morningBriefingEnabled: true,
1355
- lastBriefingShownDate: true,
1356
- toolHeatmapEnabled: true,
1357
1432
  dashboardCollapsedColumns: true,
1358
1433
  perfOverlayEnabled: true,
1359
1434
  sidebarSnapPointsEnabled: true,
1360
1435
  sidebarWidth: true,
1361
1436
  navigationHistoryEnabled: true,
1362
1437
  experimentalClaudeStreamRuntime: true,
1363
- costForecastEnabled: true,
1438
+ experimentalHeadlessHiddenTerminals: true,
1364
1439
  sendAnonymousUsageData: true,
1365
1440
  reviewAgent: true,
1366
1441
  reviewClaudeModel: true,
1367
1442
  reviewCodexModel: true,
1368
- reviewCodexEffort: true
1443
+ reviewCodexEffort: true,
1444
+ aiCommitModel: true,
1445
+ aiCommitThinkingLevel: true,
1446
+ aiCommitCustomPrompt: true
1369
1447
  };
1370
1448
  var DEFAULTS_KEYS = Object.keys(DEFAULTS_KEYS_MAP);
1371
1449
  var INTERNAL_DEFAULTS_KEYS = /* @__PURE__ */ new Set([
@@ -1622,65 +1700,35 @@ function dbInsertTask(task) {
1622
1700
  task.sourceExternalId ?? null
1623
1701
  );
1624
1702
  }
1703
+ function addSet(sets, params, column, value) {
1704
+ if (value !== void 0) {
1705
+ sets.push(`${column} = ?`);
1706
+ params.push(value);
1707
+ }
1708
+ }
1625
1709
  function dbUpdateTask(id, updates) {
1626
1710
  const sets = [];
1627
1711
  const params = [];
1628
- if (updates.title !== void 0) {
1629
- sets.push("title = ?");
1630
- params.push(updates.title);
1631
- }
1632
- if (updates.description !== void 0) {
1633
- sets.push("description = ?");
1634
- params.push(updates.description);
1635
- }
1636
- if (updates.status !== void 0) {
1637
- sets.push("status = ?");
1638
- params.push(updates.status);
1639
- }
1640
- if (updates.order !== void 0) {
1641
- sets.push('"order" = ?');
1642
- params.push(updates.order);
1643
- }
1644
- if (updates.branch !== void 0) {
1645
- sets.push("branch = ?");
1646
- params.push(updates.branch);
1647
- }
1712
+ addSet(sets, params, "title", updates.title);
1713
+ addSet(sets, params, "description", updates.description);
1714
+ addSet(sets, params, "status", updates.status);
1715
+ addSet(sets, params, '"order"', updates.order);
1716
+ addSet(sets, params, "branch", updates.branch);
1648
1717
  if (updates.useWorktree !== void 0) {
1649
1718
  sets.push("use_worktree = ?");
1650
1719
  params.push(updates.useWorktree ? 1 : 0);
1651
1720
  }
1652
- if (updates.assignedAgent !== void 0) {
1653
- sets.push("assigned_agent = ?");
1654
- params.push(updates.assignedAgent);
1655
- }
1656
- if (updates.assignedSessionId !== void 0) {
1657
- sets.push("assigned_session_id = ?");
1658
- params.push(updates.assignedSessionId);
1659
- }
1660
- if (updates.agentSessionId !== void 0) {
1661
- sets.push("agent_session_id = ?");
1662
- params.push(updates.agentSessionId);
1663
- }
1664
- if (updates.updatedAt !== void 0) {
1665
- sets.push("updated_at = ?");
1666
- params.push(updates.updatedAt);
1667
- }
1721
+ addSet(sets, params, "assigned_agent", updates.assignedAgent);
1722
+ addSet(sets, params, "assigned_session_id", updates.assignedSessionId);
1723
+ addSet(sets, params, "agent_session_id", updates.agentSessionId);
1724
+ addSet(sets, params, "updated_at", updates.updatedAt);
1668
1725
  if ("completedAt" in updates) {
1669
1726
  sets.push("completed_at = ?");
1670
1727
  params.push(updates.completedAt ?? null);
1671
1728
  }
1672
- if (updates.sourceConnectorId !== void 0) {
1673
- sets.push("source_connector_id = ?");
1674
- params.push(updates.sourceConnectorId);
1675
- }
1676
- if (updates.sourceExternalUrl !== void 0) {
1677
- sets.push("source_external_url = ?");
1678
- params.push(updates.sourceExternalUrl);
1679
- }
1680
- if (updates.sourceExternalId !== void 0) {
1681
- sets.push("source_external_id = ?");
1682
- params.push(updates.sourceExternalId);
1683
- }
1729
+ addSet(sets, params, "source_connector_id", updates.sourceConnectorId);
1730
+ addSet(sets, params, "source_external_url", updates.sourceExternalUrl);
1731
+ addSet(sets, params, "source_external_id", updates.sourceExternalId);
1684
1732
  if (sets.length === 0) return;
1685
1733
  params.push(id);
1686
1734
  getDb().prepare(`UPDATE tasks SET ${sets.join(", ")} WHERE id = ?`).run(...params);
@@ -2046,7 +2094,8 @@ var ConfigManager = class {
2046
2094
  * ни `/effort`. Теперь записываем стандартные значения в DB сразу, чтобы
2047
2095
  * источник правды был один. */
2048
2096
  seedClaudeDefaults(config) {
2049
- const needsModel = config.defaults.claudeDefaultModel == null;
2097
+ const stored = config.defaults.claudeDefaultModel;
2098
+ const needsModel = stored == null || typeof stored === "string" && CLAUDE_OBSOLETE_MODEL_IDS.includes(stored);
2050
2099
  const needsEffort = config.defaults.claudeDefaultEffort == null;
2051
2100
  if (!needsModel && !needsEffort) return config;
2052
2101
  const seeded = {
@@ -3538,7 +3587,7 @@ console.warn = (...args) => _origError("[mcp:warn]", ...args);
3538
3587
  console.error = (...args) => _origError("[mcp:error]", ...args);
3539
3588
  async function main() {
3540
3589
  configManager.init();
3541
- const version = true ? "0.7.0" : createRequire(import.meta.url)("../package.json").version;
3590
+ const version = true ? "0.9.0" : createRequire(import.meta.url)("../package.json").version;
3542
3591
  const server = createMcpServer(version);
3543
3592
  const transport = new StdioServerTransport();
3544
3593
  await server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basegrid_tech/mcp",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "BaseGrid MCP server — task management, git, and workflow tools for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -42,8 +42,8 @@
42
42
  "zod": "^4.3.6"
43
43
  },
44
44
  "devDependencies": {
45
- "@basegrid/server": "0.7.0",
46
- "@basegrid/shared": "0.7.0",
45
+ "@basegrid/server": "0.9.0",
46
+ "@basegrid/shared": "0.9.0",
47
47
  "tsup": "^8.5.1",
48
48
  "tsx": "^4.21.0",
49
49
  "typescript": "^6.0.3"