fix(KB-043): fix type errors and test failures across all packages

- Add mergeRetries field to updateTask type signature alongside model overrides
- Fix GitManagerModal type imports and error handling
- Update Column, ListView, and GitManagerModal tests for type compatibility
- Fix tsconfig.app.json path references
- Adjust CLI build settings for proper bundling
This commit is contained in:
gsxdsm
2026-03-29 19:36:44 -07:00
parent a5393463d5
commit e06198c6aa
7 changed files with 22 additions and 12 deletions

View File

@@ -95,7 +95,13 @@ if (!existsSync(dashboardClientSrc)) {
// Express.static requires a real filesystem directory, so we co-locate
// the pre-built SPA next to the binary rather than embedding blobs.
function copyClientAssets() {
if (existsSync(dashboardClientDest)) rmSync(dashboardClientDest, { recursive: true });
try {
if (existsSync(dashboardClientDest)) {
rmSync(dashboardClientDest, { recursive: true, force: true });
}
} catch {
// Ignore cleanup errors - directory might not exist or be accessible
}
console.log("Copying dashboard client assets...");
mkdirSync(dashboardClientDest, { recursive: true });
cpSync(dashboardClientSrc, dashboardClientDest, { recursive: true });

View File

@@ -340,7 +340,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
async updateTask(
id: string,
updates: { title?: string; description?: string; prompt?: string; worktree?: string; status?: string | null; dependencies?: string[]; blockedBy?: string | null; paused?: boolean; baseBranch?: string; size?: "S" | "M" | "L"; reviewLevel?: number; modelProvider?: string | null; modelId?: string | null; validatorModelProvider?: string | null; validatorModelId?: string | null },
updates: { title?: string; description?: string; prompt?: string; worktree?: string; status?: string | null; dependencies?: string[]; blockedBy?: string | null; paused?: boolean; baseBranch?: string; size?: "S" | "M" | "L"; reviewLevel?: number; mergeRetries?: number; modelProvider?: string | null; modelId?: string | null; validatorModelProvider?: string | null; validatorModelId?: string | null },
): Promise<Task> {
return this.withTaskLock(id, async () => {
const dir = this.taskDir(id);
@@ -382,6 +382,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
if (updates.baseBranch !== undefined) task.baseBranch = updates.baseBranch;
if (updates.size !== undefined) task.size = updates.size;
if (updates.reviewLevel !== undefined) task.reviewLevel = updates.reviewLevel;
if (updates.mergeRetries !== undefined) task.mergeRetries = updates.mergeRetries;
if (updates.modelProvider === null) {
task.modelProvider = undefined;
} else if (updates.modelProvider !== undefined) {

View File

@@ -25,7 +25,7 @@ import {
} from "../api";
import {
GitBranch as GitBranchIcon,
GitCommit,
GitCommit as GitCommitIcon,
GitPullRequest,
GitMerge,
RefreshCw,
@@ -47,7 +47,7 @@ type SectionId = "status" | "commits" | "branches" | "worktrees" | "remotes";
const SECTIONS = [
{ id: "status" as SectionId, label: "Status", icon: Radio },
{ id: "commits" as SectionId, label: "Commits", icon: GitCommit },
{ id: "commits" as SectionId, label: "Commits", icon: GitCommitIcon },
{ id: "branches" as SectionId, label: "Branches", icon: GitBranchIcon },
{ id: "worktrees" as SectionId, label: "Worktrees", icon: HardDrive },
{ id: "remotes" as SectionId, label: "Remotes", icon: GitMerge },

View File

@@ -25,10 +25,12 @@ function makeTask(id: string): Task {
column: "triage" as ColumnType,
status: undefined as any,
steps: [],
currentStep: 0,
dependencies: [],
description: "",
created: new Date().toISOString(),
updated: new Date().toISOString(),
log: [],
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
};
}

View File

@@ -37,8 +37,8 @@ import {
const mockAddToast = vi.fn();
const mockTasks: Task[] = [
{ id: "KB-001", description: "Test task 1", column: "in-progress", dependencies: [], worktree: "/worktrees/kb-001" },
{ id: "KB-002", description: "Test task 2", column: "todo", dependencies: [] },
{ id: "KB-001", description: "Test task 1", column: "in-progress", dependencies: [], worktree: "/worktrees/kb-001", steps: [], currentStep: 0, log: [], createdAt: new Date().toISOString(), updatedAt: new Date().toISOString() },
{ id: "KB-002", description: "Test task 2", column: "todo", dependencies: [], steps: [], currentStep: 0, log: [], createdAt: new Date().toISOString(), updatedAt: new Date().toISOString() },
];
describe("GitManagerModal", () => {

View File

@@ -795,15 +795,15 @@ describe("ListView Column Visibility", () => {
// Uncheck all but one
for (let i = 0; i < checkboxes.length - 1; i++) {
if (checkboxes[i].checked) {
if ((checkboxes[i] as HTMLInputElement).checked) {
fireEvent.click(checkboxes[i]);
}
}
// The last checkbox should be disabled (check the disabled property)
const lastCheckbox = checkboxes[checkboxes.length - 1];
if (lastCheckbox.checked) {
expect(lastCheckbox.disabled).toBe(true);
if ((lastCheckbox as HTMLInputElement).checked) {
expect((lastCheckbox as HTMLInputElement).disabled).toBe(true);
}
});

View File

@@ -5,7 +5,8 @@
"jsx": "react-jsx",
"moduleResolution": "bundler",
"module": "ESNext",
"noEmit": true
"noEmit": true,
"types": ["vitest/globals", "@testing-library/jest-dom", "node"]
},
"include": ["app"]
}