gpt-engineer-app[bot] commited on
Commit
2190fce
Β·
1 Parent(s): c328d6a
src/server/branch-debug.functions.ts CHANGED
@@ -1,5 +1,4 @@
1
  import { createServerFn } from "@tanstack/react-start";
2
- import { requireSupabaseAuth } from "@/integrations/supabase/auth-middleware";
3
  import { fetchAIWithFallback, getAIConfig } from "./ai-config";
4
  import { z } from "zod";
5
 
@@ -318,7 +317,6 @@ export async function analyzeDiff(diff: string, failureDescription: string, user
318
  }
319
 
320
  export const debugBranch = createServerFn({ method: "POST" })
321
- .middleware([requireSupabaseAuth])
322
  .inputValidator((d: unknown) => InputSchema.parse(d))
323
  .handler(async ({ data, context }): Promise<DebugResult> => {
324
  return analyzeDiff(data.diff, data.failureDescription, context.userId);
@@ -449,7 +447,6 @@ export async function analyzeSnippet(
449
  }
450
 
451
  export const debugSnippet = createServerFn({ method: "POST" })
452
- .middleware([requireSupabaseAuth])
453
  .inputValidator((d: unknown) => SnippetInputSchema.parse(d))
454
  .handler(async ({ data, context }): Promise<DebugResult> => {
455
  return analyzeSnippet(data.snippet, data.failureDescription, data.language, context.userId);
 
1
  import { createServerFn } from "@tanstack/react-start";
 
2
  import { fetchAIWithFallback, getAIConfig } from "./ai-config";
3
  import { z } from "zod";
4
 
 
317
  }
318
 
319
  export const debugBranch = createServerFn({ method: "POST" })
 
320
  .inputValidator((d: unknown) => InputSchema.parse(d))
321
  .handler(async ({ data, context }): Promise<DebugResult> => {
322
  return analyzeDiff(data.diff, data.failureDescription, context.userId);
 
447
  }
448
 
449
  export const debugSnippet = createServerFn({ method: "POST" })
 
450
  .inputValidator((d: unknown) => SnippetInputSchema.parse(d))
451
  .handler(async ({ data, context }): Promise<DebugResult> => {
452
  return analyzeSnippet(data.snippet, data.failureDescription, data.language, context.userId);
src/server/forensic.functions.ts CHANGED
@@ -1,7 +1,6 @@
1
  import { createServerFn } from "@tanstack/react-start";
2
  import { z } from "zod";
3
  import { sanitize, restore } from "./branch-debug.functions";
4
- import { requireSupabaseAuth } from "@/integrations/supabase/auth-middleware";
5
  import { fetchAIWithFallback, getAIConfig } from "./ai-config";
6
 
7
  // ───────────────────────── SSRF Guard ─────────────────────────
@@ -120,7 +119,6 @@ const ConnectSchema = z.object({
120
  });
121
 
122
  export const testVehicleConnection = createServerFn({ method: "POST" })
123
- .middleware([requireSupabaseAuth])
124
  .inputValidator((d: unknown) => ConnectSchema.parse(d))
125
  .handler(async ({ data }) => {
126
  const results: Record<string, any> = {};
@@ -180,7 +178,6 @@ const FetchSchema = z.object({
180
  });
181
 
182
  export const fetchVehicleCode = createServerFn({ method: "POST" })
183
- .middleware([requireSupabaseAuth])
184
  .inputValidator((d: unknown) => FetchSchema.parse(d))
185
  .handler(async ({ data }): Promise<FetchedCode> => {
186
  const warnings: string[] = [];
@@ -469,7 +466,6 @@ function deepRestore(value: any, rev: Map<string, string>): any {
469
  }
470
 
471
  export const runForensicStage = createServerFn({ method: "POST" })
472
- .middleware([requireSupabaseAuth])
473
  .inputValidator((d: unknown) => StageInput.parse(d))
474
  .handler(async ({ data, context }): Promise<{ result: StageResult; sanitizationStats: { identifiersTokenized: number; commentsStripped: number; secretsBlocked: number } }> => {
475
  getAIConfig();
 
1
  import { createServerFn } from "@tanstack/react-start";
2
  import { z } from "zod";
3
  import { sanitize, restore } from "./branch-debug.functions";
 
4
  import { fetchAIWithFallback, getAIConfig } from "./ai-config";
5
 
6
  // ───────────────────────── SSRF Guard ─────────────────────────
 
119
  });
120
 
121
  export const testVehicleConnection = createServerFn({ method: "POST" })
 
122
  .inputValidator((d: unknown) => ConnectSchema.parse(d))
123
  .handler(async ({ data }) => {
124
  const results: Record<string, any> = {};
 
178
  });
179
 
180
  export const fetchVehicleCode = createServerFn({ method: "POST" })
 
181
  .inputValidator((d: unknown) => FetchSchema.parse(d))
182
  .handler(async ({ data }): Promise<FetchedCode> => {
183
  const warnings: string[] = [];
 
466
  }
467
 
468
  export const runForensicStage = createServerFn({ method: "POST" })
 
469
  .inputValidator((d: unknown) => StageInput.parse(d))
470
  .handler(async ({ data, context }): Promise<{ result: StageResult; sanitizationStats: { identifiersTokenized: number; commentsStripped: number; secretsBlocked: number } }> => {
471
  getAIConfig();
src/server/incidents.functions.ts CHANGED
@@ -1,6 +1,5 @@
1
  import { createServerFn } from "@tanstack/react-start";
2
  import { supabaseAdmin } from "@/integrations/supabase/client.server";
3
- import { requireSupabaseAuth } from "@/integrations/supabase/auth-middleware";
4
  import { fetchAIWithFallback, getAIConfig } from "./ai-config";
5
  import { AV_KNOWLEDGE_BASE } from "./av-knowledge";
6
  import { z } from "zod";
@@ -64,7 +63,6 @@ const SYSTEM_PROMPT = `You are DriveCore Incident Bot, a multi-agent AI safety a
64
  The user may submit ANY free-form text β€” full incident reports, brief notes, questions, partial logs, or general descriptions. Reason freely with your full intelligence: infer context, fill gaps with plausible domain knowledge, and produce useful analysis even when input is sparse or ambiguous. Mark uncertainty where appropriate. Always call submit_analysis with the structured result.`;
65
 
66
  export const analyzeIncident = createServerFn({ method: "POST" })
67
- .middleware([requireSupabaseAuth])
68
  .inputValidator((d: unknown) => InputSchema.parse(d))
69
  .handler(async ({ data, context }) => {
70
  const supabase = supabaseAdmin;
 
1
  import { createServerFn } from "@tanstack/react-start";
2
  import { supabaseAdmin } from "@/integrations/supabase/client.server";
 
3
  import { fetchAIWithFallback, getAIConfig } from "./ai-config";
4
  import { AV_KNOWLEDGE_BASE } from "./av-knowledge";
5
  import { z } from "zod";
 
63
  The user may submit ANY free-form text β€” full incident reports, brief notes, questions, partial logs, or general descriptions. Reason freely with your full intelligence: infer context, fill gaps with plausible domain knowledge, and produce useful analysis even when input is sparse or ambiguous. Mark uncertainty where appropriate. Always call submit_analysis with the structured result.`;
64
 
65
  export const analyzeIncident = createServerFn({ method: "POST" })
 
66
  .inputValidator((d: unknown) => InputSchema.parse(d))
67
  .handler(async ({ data, context }) => {
68
  const supabase = supabaseAdmin;