mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
COMPLETED MIGRATIONS: - Migrate git utilities from routes/common.ts (383 lines → 39 lines) - Replace duplicated code with imports from @automaker/git-utils - Keep only route-specific utilities (getErrorMessage, createLogError) - All git operations now use shared package consistently - Remove duplicate model constants in UI - Update model-config.ts to import from @automaker/types - Update agent-context-parser.ts to use DEFAULT_MODELS.claude - Removed 40+ lines of duplicated code DEFERRED (Server-Specific): - enhancement-prompts.ts (456 lines) - Server-only, no UI usage - app-spec-format.ts (318 lines) - Server-only, no UI usage 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
58 lines
1.3 KiB
TypeScript
58 lines
1.3 KiB
TypeScript
/**
|
|
* Model Configuration - Centralized model settings for the app
|
|
*
|
|
* Models can be overridden via environment variables:
|
|
* - AUTOMAKER_MODEL_CHAT: Model for chat interactions
|
|
* - AUTOMAKER_MODEL_DEFAULT: Fallback model for all operations
|
|
*/
|
|
|
|
// Import shared model constants and types
|
|
import { CLAUDE_MODEL_MAP, DEFAULT_MODELS } from "@automaker/types";
|
|
import { resolveModelString } from "@automaker/model-resolver";
|
|
|
|
// Re-export for backward compatibility
|
|
export { CLAUDE_MODEL_MAP, DEFAULT_MODELS, resolveModelString };
|
|
|
|
/**
|
|
* Get the model for chat operations
|
|
*
|
|
* Priority:
|
|
* 1. Explicit model parameter
|
|
* 2. AUTOMAKER_MODEL_CHAT environment variable
|
|
* 3. AUTOMAKER_MODEL_DEFAULT environment variable
|
|
* 4. Default chat model
|
|
*/
|
|
export function getChatModel(explicitModel?: string): string {
|
|
if (explicitModel) {
|
|
return resolveModelString(explicitModel);
|
|
}
|
|
|
|
const envModel =
|
|
import.meta.env.AUTOMAKER_MODEL_CHAT || import.meta.env.AUTOMAKER_MODEL_DEFAULT;
|
|
|
|
if (envModel) {
|
|
return resolveModelString(envModel);
|
|
}
|
|
|
|
return DEFAULT_MODELS.claude;
|
|
}
|
|
|
|
/**
|
|
* Default allowed tools for chat interactions
|
|
*/
|
|
export const CHAT_TOOLS = [
|
|
"Read",
|
|
"Write",
|
|
"Edit",
|
|
"Glob",
|
|
"Grep",
|
|
"Bash",
|
|
"WebSearch",
|
|
"WebFetch",
|
|
] as const;
|
|
|
|
/**
|
|
* Default max turns for chat
|
|
*/
|
|
export const CHAT_MAX_TURNS = 1000;
|