Skip to content

Commit f168cb4

Browse files
sweetmantechclaude
andcommitted
chore: remove unused handleChatStream (all traffic goes through x402)
Since /api/chat now routes through x402, handleChatStream is no longer used. Remove it and its tests to follow YAGNI principle. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 873d9e2 commit f168cb4

File tree

162 files changed

+4014
-4456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+4014
-4456
lines changed

app/api/accounts/[id]/route.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@ export async function OPTIONS() {
2323
* - id (required): The unique identifier of the account (UUID)
2424
*
2525
* @param request - The request object
26+
* @param params.params
2627
* @param params - Route params containing the account ID
2728
* @returns A NextResponse with account data
2829
*/
29-
export async function GET(
30-
request: NextRequest,
31-
{ params }: { params: Promise<{ id: string }> },
32-
) {
30+
export async function GET(request: NextRequest, { params }: { params: Promise<{ id: string }> }) {
3331
return getAccountHandler(request, params);
3432
}
35-

app/api/artists/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,3 @@ export async function GET(request: NextRequest) {
5454
export async function POST(request: NextRequest) {
5555
return createArtistPostHandler(request);
5656
}
57-

app/api/connectors/authorize/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export async function OPTIONS() {
2727
* - connector: The connector slug, e.g., "googlesheets" (required)
2828
* - callback_url: Optional custom callback URL after OAuth
2929
*
30+
* @param request
3031
* @returns The redirect URL for OAuth authorization
3132
*/
3233
export async function POST(request: NextRequest): Promise<NextResponse> {
@@ -60,8 +61,7 @@ export async function POST(request: NextRequest): Promise<NextResponse> {
6061
{ status: 200, headers },
6162
);
6263
} catch (error) {
63-
const message =
64-
error instanceof Error ? error.message : "Failed to authorize connector";
64+
const message = error instanceof Error ? error.message : "Failed to authorize connector";
6565
return NextResponse.json({ error: message }, { status: 500, headers });
6666
}
6767
}

app/api/connectors/route.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export async function OPTIONS() {
2424
*
2525
* Authentication: x-api-key OR Authorization Bearer token required.
2626
*
27+
* @param request
2728
* @returns List of connectors with connection status
2829
*/
2930
export async function GET(request: NextRequest): Promise<NextResponse> {
@@ -49,8 +50,7 @@ export async function GET(request: NextRequest): Promise<NextResponse> {
4950
{ status: 200, headers },
5051
);
5152
} catch (error) {
52-
const message =
53-
error instanceof Error ? error.message : "Failed to fetch connectors";
53+
const message = error instanceof Error ? error.message : "Failed to fetch connectors";
5454
return NextResponse.json({ error: message }, { status: 500, headers });
5555
}
5656
}
@@ -63,6 +63,8 @@ export async function GET(request: NextRequest): Promise<NextResponse> {
6363
* Authentication: x-api-key OR Authorization Bearer token required.
6464
*
6565
* Body: { connected_account_id: string }
66+
*
67+
* @param request
6668
*/
6769
export async function DELETE(request: NextRequest): Promise<NextResponse> {
6870
const headers = getCorsHeaders();
@@ -88,7 +90,7 @@ export async function DELETE(request: NextRequest): Promise<NextResponse> {
8890
if (!isOwner) {
8991
return NextResponse.json(
9092
{ error: "Connected account not found or does not belong to this user" },
91-
{ status: 403, headers }
93+
{ status: 403, headers },
9294
);
9395
}
9496

@@ -102,8 +104,7 @@ export async function DELETE(request: NextRequest): Promise<NextResponse> {
102104
{ status: 200, headers },
103105
);
104106
} catch (error) {
105-
const message =
106-
error instanceof Error ? error.message : "Failed to disconnect connector";
107+
const message = error instanceof Error ? error.message : "Failed to disconnect connector";
107108
return NextResponse.json({ error: message }, { status: 500, headers });
108109
}
109110
}

app/api/organizations/artists/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ export async function OPTIONS() {
2929
export async function POST(request: NextRequest) {
3030
return addArtistToOrgHandler(request);
3131
}
32-

app/api/organizations/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ export async function GET(request: NextRequest) {
4545
export async function POST(request: NextRequest) {
4646
return createOrganizationHandler(request);
4747
}
48-

app/api/spotify/artist/albums/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ export async function OPTIONS() {
3232
export async function GET(request: NextRequest) {
3333
return getSpotifyArtistAlbumsHandler(request);
3434
}
35-

app/api/transcribe/route.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { NextRequest, NextResponse } from "next/server";
22
import { processAudioTranscription } from "@/lib/transcribe/processAudioTranscription";
33
import { formatTranscriptionError } from "@/lib/transcribe/types";
44

5+
/**
6+
*
7+
* @param req
8+
*/
59
export async function POST(req: NextRequest) {
610
try {
711
const body = await req.json();
@@ -40,4 +44,3 @@ export async function POST(req: NextRequest) {
4044
return NextResponse.json({ error: message }, { status });
4145
}
4246
}
43-

evals/catalog-songs-count.eval.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { Eval } from "braintrust";
22
import { Factuality, AnswerCorrectness } from "autoevals";
3-
import {
4-
callChatFunctionsWithResult,
5-
extractTextFromResult,
6-
} from "@/lib/evals";
3+
import { callChatFunctionsWithResult, extractTextFromResult } from "@/lib/evals";
74
import getCatalogSongsCountData from "@/lib/evals/getCatalogSongsCountData";
85

96
/**

evals/first-week-album-sales.eval.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import { callChatFunctions } from "@/lib/evals";
1414
Eval("First Week Album Sales Evaluation", {
1515
data: () => [
1616
{
17-
input:
18-
"how many albums did Halsey The Great Impersonator sell the first week of release",
17+
input: "how many albums did Halsey The Great Impersonator sell the first week of release",
1918
expected:
2019
"Halsey's album 'The Great Impersonator' sold between 93,000 and 100,000 copies in its first week of release. It debuted at No. 2 on the Billboard 200 chart.",
2120
metadata: {
@@ -26,8 +25,7 @@ Eval("First Week Album Sales Evaluation", {
2625
},
2726
},
2827
{
29-
input:
30-
"what were the first week sales for Taylor Swift's Midnights album?",
28+
input: "what were the first week sales for Taylor Swift's Midnights album?",
3129
expected:
3230
"Taylor Swift's Midnights sold 1.578 million equivalent album units in its first week in the United States, which included between 1 million and 1.5 million pure album sales. This marked the biggest sales week for any album since Adele's 25 in 2015 and the best sales week for a vinyl album in the modern tracking era.",
3331
metadata: {
@@ -38,8 +36,7 @@ Eval("First Week Album Sales Evaluation", {
3836
},
3937
},
4038
{
41-
input:
42-
"how many copies did Drake's Certified Lover Boy sell in the first week",
39+
input: "how many copies did Drake's Certified Lover Boy sell in the first week",
4340
expected:
4441
"Drake's 'Certified Lover Boy' sold approximately 613,000 album-equivalent units in its first week, securing the #1 spot on the Billboard 200 chart.",
4542
metadata: {
@@ -50,8 +47,7 @@ Eval("First Week Album Sales Evaluation", {
5047
},
5148
},
5249
{
53-
input:
54-
"what are the first week streaming numbers for Bad Bunny's Un Verano Sin Ti",
50+
input: "what are the first week streaming numbers for Bad Bunny's Un Verano Sin Ti",
5551
expected:
5652
"In its first week of release in the United States, Bad Bunny's album Un Verano Sin Ti garnered over 355 million on-demand streams and 274,000 album-equivalent units, the most for any album that year and the largest streaming week for a Latin album ever at that time. The album also set a record for the biggest debut for a Latin album in Spotify's history.",
5753
metadata: {

0 commit comments

Comments
 (0)