feat(KB-032): add Planning Mode for AI-assisted task creation

- Add PlanningModeModal component with interactive task planning UI
- Implement backend planning API with /api/planning endpoints
- Add PlanningSession class for managing planning state
- Integrate planning mode into dashboard with header button
- Add comprehensive tests for planning components and API routes
- Include AI agent structure for future planning automation
- Update README with Planning Mode documentation
This commit is contained in:
gsxdsm
2026-03-29 21:40:14 -07:00
parent 27a18549b3
commit 385739ee2c
19 changed files with 3024 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
export { COLUMNS, COLUMN_LABELS, COLUMN_DESCRIPTIONS, VALID_TRANSITIONS, DEFAULT_SETTINGS, THINKING_LEVELS, THEME_MODES, COLOR_THEMES } from "./types.js";
export type { Column, IssueInfo, IssueState, PrInfo, PrStatus, Task, TaskAttachment, TaskCreateInput, TaskDetail, AgentLogEntry, AgentLogType, AgentRole, BoardConfig, MergeResult, Settings, TaskStep, StepStatus, TaskLogEntry, ThinkingLevel, SteeringComment, ThemeMode, ColorTheme } from "./types.js";
export type { Column, IssueInfo, IssueState, PrInfo, PrStatus, Task, TaskAttachment, TaskCreateInput, TaskDetail, AgentLogEntry, AgentLogType, AgentRole, BoardConfig, MergeResult, Settings, TaskStep, StepStatus, TaskLogEntry, ThinkingLevel, SteeringComment, ThemeMode, ColorTheme, PlanningQuestion, PlanningSummary, PlanningResponse, PlanningQuestionType } from "./types.js";
export { TaskStore } from "./store.js";
export { canTransition, getValidTransitions, resolveDependencyOrder } from "./board.js";
export {

View File

@@ -331,3 +331,43 @@ export const VALID_TRANSITIONS: Record<Column, Column[]> = {
done: ["archived"],
archived: ["done"],
};
// ── Planning Mode Types ────────────────────────────────────────────────────
/** Type of planning question presented to the user */
export type PlanningQuestionType = "text" | "single_select" | "multi_select" | "confirm";
/** A single question in the planning conversation flow */
export interface PlanningQuestion {
id: string;
type: PlanningQuestionType;
question: string;
description?: string;
options?: Array<{ id: string; label: string; description?: string }>;
}
/** The final summary generated after planning conversation completes */
export interface PlanningSummary {
title: string;
description: string;
suggestedSize: "S" | "M" | "L";
suggestedDependencies: string[];
keyDeliverables: string[];
}
/** Response from planning endpoints - either a question or the final summary */
export type PlanningResponse =
| { type: "question"; data: PlanningQuestion }
| { type: "complete"; data: PlanningSummary };
/** Planning session state stored in memory */
export interface PlanningSession {
id: string;
ip: string;
initialPlan: string;
history: Array<{ question: PlanningQuestion; response: unknown }>;
currentQuestion?: PlanningQuestion;
summary?: PlanningSummary;
createdAt: Date;
updatedAt: Date;
}