gpt-engineer-app[bot] commited on
Commit
2d4ae6f
·
1 Parent(s): 238df2a
src/routes/dashboard.branch-debug.tsx CHANGED
@@ -16,6 +16,25 @@ export const Route = createFileRoute("/dashboard/branch-debug")({
16
 
17
  type Zone = "user" | "server" | "ai";
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  const STEPS: {
20
  id: number; label: string; sublabel: string; color: string; icon: string;
21
  zone: Zone; code: string; detail: string; codeLabel: string;
 
16
 
17
  type Zone = "user" | "server" | "ai";
18
 
19
+ const LANGUAGES = [
20
+ { id: "auto", label: "Auto-detect language" },
21
+ { id: "python", label: "Python" },
22
+ { id: "cpp", label: "C / C++" },
23
+ { id: "typescript", label: "TypeScript / JS" },
24
+ { id: "rust", label: "Rust" },
25
+ { id: "go", label: "Go" },
26
+ { id: "java", label: "Java" },
27
+ ];
28
+
29
+ function detectInputType(text: string): "diff" | "snippet" | "unknown" {
30
+ if (!text || text.trim().length < 10) return "unknown";
31
+ const lines = text.trim().split("\n");
32
+ const diffHeaders = lines.filter((l) => /^(diff --git|---\s|\+\+\+\s|@@\s|index [a-f0-9])/.test(l)).length;
33
+ const diffLines = lines.filter((l) => /^[+\-](?![+\-])/.test(l)).length;
34
+ if (diffHeaders >= 1 || (diffLines / lines.length > 0.3 && diffLines >= 3)) return "diff";
35
+ return "snippet";
36
+ }
37
+
38
  const STEPS: {
39
  id: number; label: string; sublabel: string; color: string; icon: string;
40
  zone: Zone; code: string; detail: string; codeLabel: string;