huskies: merge 473_refactor_split_chat_tsx_into_smaller_components

This commit is contained in:
dave
2026-04-04 15:12:03 +00:00
parent d4979ae492
commit fa99f19198
9 changed files with 1679 additions and 1228 deletions
+50
View File
@@ -0,0 +1,50 @@
export function formatToolActivity(toolName: string): string {
switch (toolName) {
// Built-in provider tool names
case "read_file":
case "Read":
return "Reading file...";
case "write_file":
case "Write":
case "Edit":
return "Writing file...";
case "list_directory":
case "Glob":
return "Listing files...";
case "search_files":
case "Grep":
return "Searching files...";
case "exec_shell":
case "Bash":
return "Executing command...";
// Claude Code additional tool names
case "Task":
return "Running task...";
case "WebFetch":
return "Fetching web content...";
case "WebSearch":
return "Searching the web...";
case "NotebookEdit":
return "Editing notebook...";
case "TodoWrite":
return "Updating tasks...";
default:
return `Using ${toolName}...`;
}
}
export const estimateTokens = (text: string): number =>
Math.ceil(text.length / 4);
export const getContextWindowSize = (
modelName: string,
claudeContextWindows?: Map<string, number>,
): number => {
if (modelName.startsWith("claude-")) {
return claudeContextWindows?.get(modelName) ?? 200000;
}
if (modelName.includes("llama3")) return 8192;
if (modelName.includes("qwen2.5")) return 32768;
if (modelName.includes("deepseek")) return 16384;
return 8192;
};