feat: implement project setup dialog and refactor sidebar integration

- Added a new ProjectSetupDialog component to facilitate project specification generation, enhancing user experience by guiding users through project setup.
- Refactored the Sidebar component to integrate the new ProjectSetupDialog, replacing the previous inline dialog implementation for improved code organization and maintainability.
- Updated the sidebar to handle project overview and feature generation options, streamlining the project setup process.
- Removed the old dialog implementation from the Sidebar, reducing code duplication and improving clarity.
This commit is contained in:
Cody Seibert
2025-12-15 01:07:47 -05:00
parent 919e08689a
commit f25d62fe25
13 changed files with 724 additions and 332 deletions

View File

@@ -11,7 +11,7 @@ import { ProviderFactory } from "../providers/provider-factory.js";
import type { ExecuteOptions } from "../providers/types.js";
import { readImageAsBase64 } from "../lib/image-handler.js";
import { buildPromptWithImages } from "../lib/prompt-builder.js";
import { getEffectiveModel } from "../lib/model-resolver.js";
import { createChatOptions } from "../lib/sdk-options.js";
import { isAbortError } from "../lib/error-handler.js";
interface Message {
@@ -176,8 +176,19 @@ export class AgentService {
await this.saveSession(sessionId, session.messages);
try {
// Use session model, parameter model, or default
const effectiveModel = getEffectiveModel(model, session.model);
// Build SDK options using centralized configuration
const sdkOptions = createChatOptions({
cwd: workingDirectory || session.workingDirectory,
model: model,
sessionModel: session.model,
systemPrompt: this.getSystemPrompt(),
abortController: session.abortController!,
});
// Extract model, maxTurns, and allowedTools from SDK options
const effectiveModel = sdkOptions.model!;
const maxTurns = sdkOptions.maxTurns;
const allowedTools = sdkOptions.allowedTools as string[] | undefined;
// Get provider for this model
const provider = ProviderFactory.getProviderForModel(effectiveModel);
@@ -192,17 +203,8 @@ export class AgentService {
model: effectiveModel,
cwd: workingDirectory || session.workingDirectory,
systemPrompt: this.getSystemPrompt(),
maxTurns: 20,
allowedTools: [
"Read",
"Write",
"Edit",
"Glob",
"Grep",
"Bash",
"WebSearch",
"WebFetch",
],
maxTurns: maxTurns,
allowedTools: allowedTools,
abortController: session.abortController!,
conversationHistory:
conversationHistory.length > 0 ? conversationHistory : undefined,

View File

@@ -9,16 +9,16 @@
* - Verification and merge workflows
*/
import { AbortError } from "@anthropic-ai/claude-agent-sdk";
import { ProviderFactory } from "../providers/provider-factory.js";
import type { ExecuteOptions } from "../providers/types.js";
import { exec } from "child_process";
import { promisify } from "util";
import path from "path";
import fs from "fs/promises";
import type { EventEmitter, EventType } from "../lib/events.js";
import type { EventEmitter } from "../lib/events.js";
import { buildPromptWithImages } from "../lib/prompt-builder.js";
import { resolveModelString, DEFAULT_MODELS } from "../lib/model-resolver.js";
import { createAutoModeOptions } from "../lib/sdk-options.js";
import { isAbortError, classifyError } from "../lib/error-handler.js";
const execAsync = promisify(exec);
@@ -1085,7 +1085,18 @@ When done, summarize what you implemented and any notes for the developer.`;
imagePaths?: string[],
model?: string
): Promise<void> {
const finalModel = resolveModelString(model, DEFAULT_MODELS.claude);
// Build SDK options using centralized configuration for feature implementation
const sdkOptions = createAutoModeOptions({
cwd: workDir,
model: model,
abortController,
});
// Extract model, maxTurns, and allowedTools from SDK options
const finalModel = sdkOptions.model!;
const maxTurns = sdkOptions.maxTurns;
const allowedTools = sdkOptions.allowedTools as string[] | undefined;
console.log(
`[AutoMode] runAgent called for feature ${featureId} with model: ${finalModel}`
);
@@ -1108,9 +1119,9 @@ When done, summarize what you implemented and any notes for the developer.`;
const options: ExecuteOptions = {
prompt: promptContent,
model: finalModel,
maxTurns: 50,
maxTurns: maxTurns,
cwd: workDir,
allowedTools: ["Read", "Write", "Edit", "Glob", "Grep", "Bash"],
allowedTools: allowedTools,
abortController,
};