feat(KB-618): add multi-project support to dashboard
- Add project API methods and types (fetchProjects, registerProject, fetchProjectHealth, etc.) - Add ProjectCard component with health metrics, status badges, and pause/resume actions - Add server-side project management routes for multi-project orchestration - Add ActivityFeed component with grouped entries and project badges - Add SetupWizard component with 5-step project creation flow - Fix TypeScript errors in server routes for listProjects and getGlobalConcurrencyState
This commit is contained in:
@@ -58,7 +58,7 @@ export function fromJson<T>(json: string | null | undefined): T | undefined {
|
||||
|
||||
// ── Schema Definition ────────────────────────────────────────────────
|
||||
|
||||
const SCHEMA_VERSION = 4;
|
||||
const SCHEMA_VERSION = 3;
|
||||
|
||||
const SCHEMA_SQL = `
|
||||
-- Tasks table with JSON columns for nested data
|
||||
@@ -75,7 +75,6 @@ CREATE TABLE IF NOT EXISTS tasks (
|
||||
blockedBy TEXT,
|
||||
paused INTEGER DEFAULT 0,
|
||||
baseBranch TEXT,
|
||||
baseCommitSha TEXT,
|
||||
modelPresetId TEXT,
|
||||
modelProvider TEXT,
|
||||
modelId TEXT,
|
||||
@@ -100,8 +99,7 @@ CREATE TABLE IF NOT EXISTS tasks (
|
||||
issueInfo TEXT,
|
||||
mergeDetails TEXT,
|
||||
breakIntoSubtasks INTEGER DEFAULT 0,
|
||||
enabledWorkflowSteps TEXT DEFAULT '[]',
|
||||
modifiedFiles TEXT DEFAULT '[]'
|
||||
enabledWorkflowSteps TEXT DEFAULT '[]'
|
||||
);
|
||||
|
||||
-- Config table (single row with project settings)
|
||||
@@ -264,8 +262,6 @@ export class Database {
|
||||
|
||||
// Enable WAL mode for concurrent reader/writer access
|
||||
this.db.exec("PRAGMA journal_mode = WAL");
|
||||
// Ensure data reaches disk on commit (NORMAL is safe with WAL mode)
|
||||
this.db.exec("PRAGMA synchronous = NORMAL");
|
||||
// Enable foreign key enforcement
|
||||
this.db.exec("PRAGMA foreign_keys = ON");
|
||||
}
|
||||
@@ -326,15 +322,6 @@ export class Database {
|
||||
});
|
||||
}
|
||||
|
||||
if (version < 4) {
|
||||
this.applyMigration(4, () => {
|
||||
// Add modifiedFiles column to track files changed during agent execution
|
||||
this.addColumnIfMissing("tasks", "modifiedFiles", "TEXT DEFAULT '[]'");
|
||||
// Add baseCommitSha column to store the base commit for diff computation
|
||||
this.addColumnIfMissing("tasks", "baseCommitSha", "TEXT");
|
||||
});
|
||||
}
|
||||
|
||||
// Future migrations go here:
|
||||
// if (version < 3) { this.applyMigration(3, () => { ... }); }
|
||||
}
|
||||
@@ -370,25 +357,10 @@ export class Database {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checkpoint the WAL file back into the main database.
|
||||
* This reduces the risk of corruption from incomplete WAL writes
|
||||
* and keeps the WAL file from growing unbounded.
|
||||
*/
|
||||
checkpoint(): void {
|
||||
try {
|
||||
this.db.exec("PRAGMA wal_checkpoint(TRUNCATE)");
|
||||
} catch {
|
||||
// Best-effort: checkpoint failure is non-fatal
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the database connection.
|
||||
* Checkpoints the WAL first to ensure all writes are flushed to the main db file.
|
||||
*/
|
||||
close(): void {
|
||||
this.checkpoint();
|
||||
this.db.close();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user