Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ STRIPE_LIVE_WEBHOOK_SECRET=whsec_...
STRIPE_LIVE_PRO_PRICE_ID=price_...
STRIPE_LIVE_SCALE_PRICE_ID=price_...
# Optional scaffold/MCP model override
ANTHROPIC_MODEL=claude-3-5-sonnet-20241022
ANTHROPIC_MODEL=claude-opus-4-6

# RepoFuse MCP
# GitHub token with repo read access for the repositories you want RepoFuse to analyze
GITHUB_TOKEN=ghp_...
# Optional model override for the MCP server
REPOFUSE_MODEL=claude-3-5-sonnet-20241022
REPOFUSE_MODEL=claude-opus-4-6
# Optional tuning knobs
REPOFUSE_MAX_FILES_PER_REPO=120
REPOFUSE_MAX_BLUEPRINTS=5
Expand Down
2 changes: 1 addition & 1 deletion app/api/analyze/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function POST() {
const anthropicRunner = process.env.ANTHROPIC_API_KEY
? createAnthropicPromptRunner({
apiKey: process.env.ANTHROPIC_API_KEY,
model: process.env.ANTHROPIC_MODEL || process.env.REPOFUSE_MODEL || 'claude-sonnet-4-5-20250929',
model: process.env.ANTHROPIC_MODEL || process.env.REPOFUSE_MODEL || 'claude-opus-4-6',
})
: undefined

Expand Down
2 changes: 1 addition & 1 deletion app/api/mcp/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function handleMcpRequest(request: Request) {
}

const { canAccessPro } = await resolveProAccess(user)
const model = process.env.REPOFUSE_MODEL || process.env.ANTHROPIC_MODEL || 'claude-sonnet-4-5-20250929'
const model = process.env.REPOFUSE_MODEL || process.env.ANTHROPIC_MODEL || 'claude-opus-4-6'
const anthropicRunner = process.env['ANTHROPIC_' + 'API_KEY']
? createAnthropicPromptRunner({ apiKey: process.env['ANTHROPIC_' + 'API_KEY'], model })
: undefined
Expand Down
2 changes: 1 addition & 1 deletion app/api/preview/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

send({ stage: "live", url: previewUrl, savedId: saved[0]?.id, hostedBy });

} catch (err: any) {

Check failure on line 89 in app/api/preview/route.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type
console.error("[preview]", err);
send({ stage: "error", message: err.message ?? "Unexpected error." });
} finally {
Expand Down Expand Up @@ -139,7 +139,7 @@
const SKIP = ["node_modules", ".git", "dist", "build", ".next", "coverage"];
const TEXT_EXTS = [".ts", ".tsx", ".js", ".jsx", ".json", ".css", ".scss", ".html", ".md"];

const textFiles = (tree.tree ?? []).filter((item: any) => {

Check failure on line 142 in app/api/preview/route.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type
if (item.type !== "blob") return false;
if (SKIP.some((s) => item.path.includes(s))) return false;
if (item.size > 100_000) return false;
Expand All @@ -148,7 +148,7 @@
});

const results = await Promise.allSettled(
textFiles.slice(0, 80).map(async (item: any) => {

Check failure on line 151 in app/api/preview/route.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type
const res = await ghFetch(`https://api.github.com/repos/${owner}/${repo}/contents/${item.path}`, token);
const data = await res.json();
const content = data.encoding === "base64"
Expand All @@ -172,12 +172,12 @@
// ─── Claude dep-fixer ────────────────────────────────────────────────────────

async function fixDependencies(raw: string) {
let parsed: Record<string, any>;

Check failure on line 175 in app/api/preview/route.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type
try { parsed = JSON.parse(raw); }
catch { return { fixedPackageJson: {}, changes: ["Could not parse package.json"] }; }

const response = await anthropic.messages.create({
model: "claude-sonnet-4-20250514",
model: "claude-opus-4-6",
max_tokens: 2048,
messages: [{
role: "user",
Expand All @@ -202,14 +202,14 @@

// ─── Vercel helpers ───────────────────────────────────────────────────────────

function buildDeployFiles(files: GitHubFile[], fixedPkg: Record<string, any>) {

Check failure on line 205 in app/api/preview/route.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type
return files.map((f) => ({
file: f.path,
data: f.path === "package.json" ? JSON.stringify(fixedPkg, null, 2) : f.content,
}));
}

function detectFramework(pkg: Record<string, any>): string | null {

Check failure on line 212 in app/api/preview/route.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
if (deps["next"]) return "nextjs";
if (deps["react-scripts"]) return "create-react-app";
Expand All @@ -231,7 +231,7 @@
? `https://api.vercel.com/v13/deployments?teamId=${teamId}`
: "https://api.vercel.com/v13/deployments";

const body: Record<string, any> = { name, files, target: "preview", projectSettings: {} };

Check failure on line 234 in app/api/preview/route.ts

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Unexpected any. Specify a different type
if (framework) body.projectSettings.framework = framework;

const res = await fetch(url, {
Expand Down
2 changes: 1 addition & 1 deletion examples/claude-desktop.mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"env": {
"GITHUB_TOKEN": "ghp_your_token_here",
"ANTHROPIC_API_KEY": "sk-ant-your-key-here",
"REPOFUSE_MODEL": "claude-3-5-sonnet-20241022",
"REPOFUSE_MODEL": "claude-opus-4-6",
"REPOFUSE_MAX_FILES_PER_REPO": "120",
"REPOFUSE_MAX_BLUEPRINTS": "5"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cursor.mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"env": {
"GITHUB_TOKEN": "ghp_your_token_here",
"ANTHROPIC_API_KEY": "sk-ant-your-key-here",
"REPOFUSE_MODEL": "claude-3-5-sonnet-20241022",
"REPOFUSE_MODEL": "claude-opus-4-6",
"REPOFUSE_MAX_FILES_PER_REPO": "120",
"REPOFUSE_MAX_BLUEPRINTS": "5"
}
Expand Down
6 changes: 3 additions & 3 deletions lib/ai-gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Anthropic from '@anthropic-ai/sdk'
import { generateText, type ModelMessage } from 'ai'

/** Default gateway model (provider/model). See https://ai-gateway.vercel.sh/v1/models */
export const DEFAULT_GATEWAY_MODEL = 'anthropic/claude-sonnet-4.6'
export const DEFAULT_GATEWAY_MODEL = 'anthropic/claude-opus-4.6'

export type AiGatewayFeature =
| 'analysis-run'
Expand Down Expand Up @@ -49,7 +49,7 @@ export function getAnthropicMessagesModel(): string {
}
return configured
}
return usesGatewayAuth() ? DEFAULT_GATEWAY_MODEL : 'claude-sonnet-4-5-20250929'
return usesGatewayAuth() ? DEFAULT_GATEWAY_MODEL : 'claude-opus-4-6'
}

export function gatewayProviderOptions(userId?: string, feature?: AiGatewayFeature) {
Expand Down Expand Up @@ -99,7 +99,7 @@ export async function generateWithGateway(params: {
// to avoid routing through Vercel AI Gateway which requires paid gateway credits.
if (!usesGatewayAuth() && directAnthropicKey()) {
const client = getAnthropicClient()
const directModel = process.env.ANTHROPIC_ANALYSIS_MODEL?.trim() || 'claude-sonnet-4-5-20250929'
const directModel = process.env.ANTHROPIC_ANALYSIS_MODEL?.trim() || 'claude-opus-4-6'
const response = await client.messages.create({
model: directModel,
max_tokens: params.maxOutputTokens ?? 4096,
Expand Down
12 changes: 6 additions & 6 deletions lib/ai-providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ export interface AIProviderConfig {
export function getProviderModel(provider: AIProvider): string {
switch (provider) {
case 'anthropic':
return 'anthropic/claude-sonnet-4.6'
return 'anthropic/claude-opus-4.6'
case 'openai':
return 'gpt-4o'
case 'grok':
return 'grok-2'
case 'deepinfra':
return 'deepseek-ai/deepseek-coder-33b-instruct'
case 'builtin':
return 'claude-opus-4.1' // Default to Anthropic for builtin
return 'claude-opus-4.6' // Default to Anthropic for builtin
default:
return 'claude-opus-4.1'
return 'claude-opus-4.6'
}
}

Expand All @@ -34,7 +34,7 @@ export function getProviderModel(provider: AIProvider): string {
export function getAISDKModel(provider: AIProvider, apiKey?: string): string {
switch (provider) {
case 'anthropic':
return apiKey ? `anthropic/claude-sonnet-4.6?apiKey=${apiKey}` : 'anthropic/claude-sonnet-4.6'
return apiKey ? `anthropic/claude-opus-4.6?apiKey=${apiKey}` : 'anthropic/claude-opus-4.6'
case 'openai':
return apiKey ? `openai/gpt-4o?apiKey=${apiKey}` : 'openai/gpt-4o'
case 'grok':
Expand All @@ -43,9 +43,9 @@ export function getAISDKModel(provider: AIProvider, apiKey?: string): string {
return apiKey ? `deepinfra/deepseek-ai/deepseek-coder-33b-instruct?apiKey=${apiKey}` : 'deepinfra/deepseek-ai/deepseek-coder-33b-instruct'
case 'builtin':
// Builtin uses Vercel AI Gateway (no API key needed)
return 'anthropic/claude-sonnet-4.6'
return 'anthropic/claude-opus-4.6'
default:
return 'anthropic/claude-sonnet-4.6'
return 'anthropic/claude-opus-4.6'
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/anthropic-model.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getAnthropicMessagesModel, getGatewayModel } from '@/lib/ai-gateway'

/** @deprecated Prefer getGatewayModel() for AI SDK or getAnthropicMessagesModel() for Messages API */
export const DEFAULT_ANTHROPIC_MODEL = 'claude-sonnet-4-5-20250929'
export const DEFAULT_ANTHROPIC_MODEL = 'claude-opus-4-6'

/** Anthropic Messages API model (gateway slug when AI Gateway auth is configured). */
export function getAnthropicModel(): string {
Expand Down
2 changes: 1 addition & 1 deletion lib/repofuse-core.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Anthropic from '@anthropic-ai/sdk'

const DEFAULT_REPOFUSE_MODEL = process.env.REPOFUSE_MODEL || process.env.ANTHROPIC_MODEL || 'claude-3-5-sonnet-20241022'
const DEFAULT_REPOFUSE_MODEL = process.env.REPOFUSE_MODEL || process.env.ANTHROPIC_MODEL || 'claude-opus-4-6'

const CODE_EXTENSIONS = new Set([
'ts', 'tsx', 'js', 'jsx', 'mjs', 'cjs', 'py', 'go', 'rs', 'java', 'rb', 'php', 'vue', 'svelte', 'swift', 'kt', 'kts',
Expand Down
2 changes: 1 addition & 1 deletion mcp/repofuse.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createRepoFuseMcpServer } from '../lib/repofuse-mcp.js'

const githubToken = requireEnv('GITHUB_TOKEN')
const anthropicApiKey = requireEnv('ANTHROPIC_API_KEY')
const model = process.env.REPOFUSE_MODEL || process.env.ANTHROPIC_MODEL || 'claude-3-5-sonnet-20241022'
const model = process.env.REPOFUSE_MODEL || process.env.ANTHROPIC_MODEL || 'claude-opus-4-6'
const maxFilesPerRepo = numberFromEnv('REPOFUSE_MAX_FILES_PER_REPO', 120)
const maxBlueprints = numberFromEnv('REPOFUSE_MAX_BLUEPRINTS', 5)

Expand Down
Loading