Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

541 B
Raw Blame
import type Database from 'better-sqlite3';

function tableExists(db: Database.Database, tableName: string): boolean {
  return Boolean(
    db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(tableName),
  );
}

function run(db: Database.Database): void {
  if (!tableExists(db, 'right_sidebar_tabs')) return;
  db.exec(
    `CREATE UNIQUE INDEX IF NOT EXISTS right_sidebar_tabs_subagents_singleton_idx
       ON right_sidebar_tabs (session_id)
      WHERE kind = 'subagents'`,
  );
}

module.exports = { run };