From cbe75cc521b5a21469bc4c2ab7e6f01f1006ec24 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 16:22:03 -0500 Subject: [PATCH 01/15] ci: add Braintrust evals GitHub Action workflow Adds evaluation workflow that runs on PRs to main and test branches. Uses braintrustdata/eval-action@v1 with Node.js runtime. Requires BRAINTRUST_API_KEY secret to be configured in repository settings. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/evals.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/evals.yml diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml new file mode 100644 index 000000000..11a4fc7d4 --- /dev/null +++ b/.github/workflows/evals.yml @@ -0,0 +1,32 @@ +name: Evals + +on: + pull_request: + branches: [main, test] + +jobs: + evals: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Install dependencies + run: pnpm install + + - name: Run Evals + uses: braintrustdata/eval-action@v1 + with: + api_key: ${{ secrets.BRAINTRUST_API_KEY }} + runtime: node From 66859d532bb7c890cabb4a087608c5ac1871d706 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 16:27:23 -0500 Subject: [PATCH 02/15] fix: add permissions for eval-action to post PR comments Co-Authored-By: Claude Opus 4.5 --- .github/workflows/evals.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml index 11a4fc7d4..fa23ad357 100644 --- a/.github/workflows/evals.yml +++ b/.github/workflows/evals.yml @@ -4,6 +4,10 @@ on: pull_request: branches: [main, test] +permissions: + contents: read + pull-requests: write + jobs: evals: runs-on: ubuntu-latest From 403c7c25a42ce75aa4cf0237a2c5f36baf69b922 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 16:30:53 -0500 Subject: [PATCH 03/15] feat: migrate evals from Recoup-Chat to Recoup-API - Copy evals/ directory with 10 evaluation scripts - Copy lib/evals/ with helper functions and scorers - Add braintrust and autoevals dependencies - Add eval script to package.json Co-Authored-By: Claude Opus 4.5 --- evals/README.md | 23 ++ evals/catalog-opportunity-analysis.eval.ts | 103 ++++++++ evals/catalog-songs-count.eval.ts | 31 +++ evals/first-week-album-sales.eval.ts | 76 ++++++ evals/memory-tools.eval.ts | 68 ++++++ evals/monthly-listeners-tracking.eval.ts | 45 ++++ evals/search-web-tool.eval.ts | 272 +++++++++++++++++++++ evals/social-scraping.eval.ts | 142 +++++++++++ evals/spotify-followers.eval.ts | 26 ++ evals/spotify-tools.eval.ts | 85 +++++++ evals/tiktok-analytics-questions.eval.ts | 58 +++++ lib/evals/callChatFunctions.ts | 19 ++ lib/evals/callChatFunctionsWithResult.ts | 49 ++++ lib/evals/createToolsCalledScorer.ts | 41 ++++ lib/evals/extractTextFromResult.ts | 24 ++ lib/evals/extractTextResultFromSteps.ts | 37 +++ lib/evals/getCatalogSongsCountData.ts | 42 ++++ lib/evals/getCatalogSongsCountExpected.ts | 39 +++ lib/evals/getMonthlyListenersDates.ts | 51 ++++ lib/evals/getSpotifyFollowersData.ts | 24 ++ lib/evals/getSpotifyFollowersExpected.ts | 18 ++ lib/evals/index.ts | 4 + lib/evals/scorers/CatalogAvailability.ts | 100 ++++++++ lib/evals/scorers/QuestionAnswered.ts | 113 +++++++++ lib/evals/scorers/ToolsCalled.ts | 83 +++++++ package.json | 5 +- 26 files changed, 1577 insertions(+), 1 deletion(-) create mode 100644 evals/README.md create mode 100644 evals/catalog-opportunity-analysis.eval.ts create mode 100644 evals/catalog-songs-count.eval.ts create mode 100644 evals/first-week-album-sales.eval.ts create mode 100644 evals/memory-tools.eval.ts create mode 100644 evals/monthly-listeners-tracking.eval.ts create mode 100644 evals/search-web-tool.eval.ts create mode 100644 evals/social-scraping.eval.ts create mode 100644 evals/spotify-followers.eval.ts create mode 100644 evals/spotify-tools.eval.ts create mode 100644 evals/tiktok-analytics-questions.eval.ts create mode 100644 lib/evals/callChatFunctions.ts create mode 100644 lib/evals/callChatFunctionsWithResult.ts create mode 100644 lib/evals/createToolsCalledScorer.ts create mode 100644 lib/evals/extractTextFromResult.ts create mode 100644 lib/evals/extractTextResultFromSteps.ts create mode 100644 lib/evals/getCatalogSongsCountData.ts create mode 100644 lib/evals/getCatalogSongsCountExpected.ts create mode 100644 lib/evals/getMonthlyListenersDates.ts create mode 100644 lib/evals/getSpotifyFollowersData.ts create mode 100644 lib/evals/getSpotifyFollowersExpected.ts create mode 100644 lib/evals/index.ts create mode 100644 lib/evals/scorers/CatalogAvailability.ts create mode 100644 lib/evals/scorers/QuestionAnswered.ts create mode 100644 lib/evals/scorers/ToolsCalled.ts diff --git a/evals/README.md b/evals/README.md new file mode 100644 index 000000000..9e5b65004 --- /dev/null +++ b/evals/README.md @@ -0,0 +1,23 @@ +# Recoup Evaluation System + +This directory contains our **Braintrust-based evaluation framework** for testing and improving our AI systems. + +## 🚀 Quick Start + +### Prerequisites + +- Node.js >= 18 +- Braintrust API key in `.env` file: `BRAINTRUST_API_KEY=your_key_here` + +### Running Evaluations + +```bash +# Run all evaluation scripts +pnpm eval + +# Run specific evaluation +pnpm eval evals/first-week-album-sales.eval.ts + +# Or use npx directly with external packages flag +npx braintrust eval --external-packages playwright playwright-core chromium-bidi @browserbasehq/stagehand +``` diff --git a/evals/catalog-opportunity-analysis.eval.ts b/evals/catalog-opportunity-analysis.eval.ts new file mode 100644 index 000000000..5abffb84b --- /dev/null +++ b/evals/catalog-opportunity-analysis.eval.ts @@ -0,0 +1,103 @@ +import { Eval } from "braintrust"; +import { callChatFunctions } from "@/lib/evals"; +import { CatalogAvailability } from "@/lib/evals/scorers/CatalogAvailability"; + +/** + * Catalog Opportunity Analysis Evaluation + * + * This evaluation tests whether the AI system can effectively analyze catalog opportunities + * and provide relevant song recommendations for specific use cases like playlists, sync opportunities, + * or thematic collections. It focuses on the system's ability to understand context and suggest + * appropriate songs from the catalog. + * + * Run: npx braintrust eval evals/catalog-opportunity-analysis.eval.ts + */ + +const expected = `Here are some great Halloween-themed songs perfect for a Peloton Halloween playlist: +- Lord Infamous & II-Tone - "Helloween" +- th1rt3en & Pharoahe Monch – "The Exorcist" +- DC The Don – "Zombieland" +- DC The Don – "Freddy Krueger" + +These songs provide the perfect spooky atmosphere while maintaining the high-energy vibe needed for Peloton workouts. The mix includes both classic Halloween hits and darker, more intense tracks that will keep riders motivated during their Halloween-themed rides.`; + +Eval("Catalog Opportunity Analysis Evaluation", { + data: () => [ + { + input: "Peloton needs songs for a Halloween playlist", + expected, + metadata: { + category: "playlist_recommendation", + use_case: "peloton_halloween", + expected_tool_usage: true, + data_type: "catalog_analysis", + requires_web_search: true, + target_platform: "peloton", + theme: "halloween", + }, + }, + { + input: "Brands need Christmas Songs for Sync", + expected, + metadata: { + category: "sync_licensing", + use_case: "brand_christmas_sync", + expected_tool_usage: true, + data_type: "catalog_analysis", + requires_web_search: true, + target_platform: "brand_sync", + theme: "christmas", + }, + }, + { + input: "Spotify needs songs for a LGBTQ+ Valentines Mix", + expected, + metadata: { + category: "playlist_recommendation", + use_case: "spotify_lgbtq_valentines", + expected_tool_usage: true, + data_type: "catalog_analysis", + requires_web_search: true, + target_platform: "spotify", + theme: "lgbtq_valentines", + }, + }, + { + input: "Spotify needs songs for Black History Month", + expected, + metadata: { + category: "playlist_recommendation", + use_case: "spotify_black_history_month", + expected_tool_usage: true, + data_type: "catalog_analysis", + requires_web_search: true, + target_platform: "spotify", + theme: "black_history_month", + }, + }, + { + input: "Apple needs songs for International Women's Day", + expected, + metadata: { + category: "playlist_recommendation", + use_case: "apple_international_womens_day", + expected_tool_usage: true, + data_type: "catalog_analysis", + requires_web_search: true, + target_platform: "apple", + theme: "international_womens_day", + }, + }, + ], + + task: async (input: string): Promise => { + try { + const response = await callChatFunctions(input); + return response; + } catch (error) { + return `Error: ${error instanceof Error ? error.message : "Function call failed"}`; + } + }, + + scores: [CatalogAvailability], +}); diff --git a/evals/catalog-songs-count.eval.ts b/evals/catalog-songs-count.eval.ts new file mode 100644 index 000000000..960068b59 --- /dev/null +++ b/evals/catalog-songs-count.eval.ts @@ -0,0 +1,31 @@ +import { Eval } from "braintrust"; +import { Factuality, AnswerCorrectness } from "autoevals"; +import { + callChatFunctionsWithResult, + extractTextFromResult, +} from "@/lib/evals"; +import getCatalogSongsCountData from "@/lib/evals/getCatalogSongsCountData"; + +/** + * Catalog Songs Count Evaluation + * + * This evaluation tests whether your AI system properly uses tool calls + * to fetch catalog data and return accurate song counts instead of defaulting + * to "I don't have access" responses. + * + * Run: npx braintrust eval evals/catalog-songs-count.eval.ts + */ +Eval("Catalog Songs Count Evaluation", { + data: getCatalogSongsCountData, + task: async (input: string): Promise => { + try { + const response = await callChatFunctionsWithResult(input); + const output = extractTextFromResult(response); + return output; + } catch (error) { + return `Error: ${error instanceof Error ? error.message : "Function call failed"}`; + } + }, + + scores: [AnswerCorrectness, Factuality], +}); diff --git a/evals/first-week-album-sales.eval.ts b/evals/first-week-album-sales.eval.ts new file mode 100644 index 000000000..31f03c49c --- /dev/null +++ b/evals/first-week-album-sales.eval.ts @@ -0,0 +1,76 @@ +import { Eval } from "braintrust"; +import { Factuality } from "autoevals"; +import { callChatFunctions } from "@/lib/evals"; + +/** + * Album Sales Tool Call Evaluation + * + * This evaluation tests whether your AI system properly uses tool calls + * to fetch album sales data instead of defaulting to "I don't have access" responses. + * + * Run: npx braintrust eval evals/first-week-album-sales.eval.ts + */ + +Eval("First Week Album Sales Evaluation", { + data: () => [ + { + input: + "how many albums did Halsey The Great Impersonator sell the first week of release", + expected: + "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.", + metadata: { + artist: "Halsey", + album: "The Great Impersonator", + expected_tool_usage: true, + data_type: "first_week_album_sales", + }, + }, + { + input: + "what were the first week sales for Taylor Swift's Midnights album?", + expected: + "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.", + metadata: { + artist: "Taylor Swift", + album: "Midnights", + expected_tool_usage: true, + data_type: "first_week_album_sales", + }, + }, + { + input: + "how many copies did Drake's Certified Lover Boy sell in the first week", + expected: + "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.", + metadata: { + artist: "Drake", + album: "Certified Lover Boy", + expected_tool_usage: true, + data_type: "first_week_album_sales", + }, + }, + { + input: + "what are the first week streaming numbers for Bad Bunny's Un Verano Sin Ti", + expected: + "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.", + metadata: { + artist: "Bad Bunny", + album: "Un Verano Sin Ti", + expected_tool_usage: true, + data_type: "first_week_streaming_numbers", + }, + }, + ], + + task: async (input: string): Promise => { + try { + const response = await callChatFunctions(input); + return response; + } catch (error) { + return `Error: ${error instanceof Error ? error.message : "Function call failed"}`; + } + }, + + scores: [Factuality], +}); diff --git a/evals/memory-tools.eval.ts b/evals/memory-tools.eval.ts new file mode 100644 index 000000000..9de8fda65 --- /dev/null +++ b/evals/memory-tools.eval.ts @@ -0,0 +1,68 @@ +import { Eval } from "braintrust"; +import { + callChatFunctionsWithResult, + extractTextFromResult, + createToolsCalledScorer, +} from "@/lib/evals"; + +/** + * Memory & Storage Tools Evaluation + * + * This evaluation tests whether the AI properly uses memory/storage tools when + * asked to save information. The AI should: + * 1. Use write_file to save to artist's file storage + * 2. Use create_knowledge_base to save to artist's knowledge base + * 3. NOT just use generate_txt_file (which doesn't persist properly) + * 4. Keep saved content concise with high signal, low noise + * + * Test cases: + * - "Can I save all this info somewhere?" - Should use write_file or create_knowledge_base + * + * Required Tools: write_file, create_knowledge_base + * Penalized Tools: generate_txt_file (when used alone without write_file) + * + * Run: npx braintrust eval evals/memory-tools.eval.ts + */ + +const REQUIRED_TOOLS = ["write_file", "create_knowledge_base"]; + +const PENALIZED_TOOLS = ["generate_txt_file"]; + +Eval("Memory & Storage Tools Evaluation", { + data: () => [ + { + input: "Can I save all this info somewhere?", + expected: + "Confirmation that info was saved using write_file or create_knowledge_base (not just generate_txt_file)", + metadata: { + artist: "Unknown", + platform: "n/a", + request_type: "save_information", + expected_tool_usage: true, + requiredTools: REQUIRED_TOOLS, + penalizedTools: PENALIZED_TOOLS, + }, + }, + ], + + task: async (input: string) => { + try { + const result = await callChatFunctionsWithResult(input); + const output = extractTextFromResult(result); + const toolCalls = + result.toolCalls?.map((tc) => ({ + toolName: tc.toolName, + args: {}, + })) || []; + + return { output, toolCalls }; + } catch (error) { + return { + output: `Error: ${error instanceof Error ? error.message : "Function call failed"}`, + toolCalls: [], + }; + } + }, + + scores: [createToolsCalledScorer(REQUIRED_TOOLS, PENALIZED_TOOLS)], +}); diff --git a/evals/monthly-listeners-tracking.eval.ts b/evals/monthly-listeners-tracking.eval.ts new file mode 100644 index 000000000..7fa4965b5 --- /dev/null +++ b/evals/monthly-listeners-tracking.eval.ts @@ -0,0 +1,45 @@ +import { Eval } from "braintrust"; +import { AnswerSimilarity } from "autoevals"; +import { callChatFunctions } from "@/lib/evals"; +import { EVAL_ARTISTS } from "@/lib/consts"; +import { getDynamicDates } from "@/lib/evals/getMonthlyListenersDates"; + +/** + * Monthly Listeners Tracking Evaluation + * + * This evaluation tests whether Recoup properly sets up monthly listener reporting + * for artists when users request tracking data between specific dates. + * + * Run: npx braintrust eval evals/monthly-listeners-tracking.eval.ts + */ +Eval("Monthly Listeners Tracking Evaluation", { + data: () => { + const { startDateFormatted, endDateFormatted } = getDynamicDates(); + + const testCases = EVAL_ARTISTS.map((artist) => ({ + input: `what is the increase for ${artist} monthlies from ${startDateFormatted} to ${endDateFormatted}`, + expected: `I've set up a monthlies tracking for ${artist}. would you like to receive the updated list in your email?`, + metadata: { + artist, + start_date: startDateFormatted, + end_date: endDateFormatted, + expected_tool_usage: true, + data_type: "monthly_listeners_tracking", + tracking_setup: true, + }, + })); + + return testCases; + }, + + task: async (input: string): Promise => { + try { + const response = await callChatFunctions(input); + return response; + } catch (error) { + return `Error: ${error instanceof Error ? error.message : "Function call failed"}`; + } + }, + + scores: [AnswerSimilarity], +}); diff --git a/evals/search-web-tool.eval.ts b/evals/search-web-tool.eval.ts new file mode 100644 index 000000000..dda174926 --- /dev/null +++ b/evals/search-web-tool.eval.ts @@ -0,0 +1,272 @@ +import { Eval } from "braintrust"; +import { AnswerCorrectness } from "autoevals"; +import { callChatFunctions } from "@/lib/evals"; + +/** + * Search Web Tool Evaluation + * + * This evaluation tests whether the searchWeb tool properly uses Perplexity's API + * to fetch accurate, up-to-date information from the web and returns factual responses + * with proper citations. It focuses on current events, recent releases, and factual data + * that requires web search capabilities. + * + * Run: npx braintrust eval evals/search-web-tool.eval.ts + */ + +Eval("Search Web Tool Evaluation", { + data: () => [ + { + input: "What are the latest music industry trends for 2025?", + expected: `The latest music industry trends for 2025 include several transformative shifts driven by technology, changing listener habits, and new genre developments. + +## Key Trends in 2025 Music Industry + +- Music is increasingly defined by moment and mood rather than strict genres, with a rise in unique and bold styles that break mainstream formulas. Musicians no longer need to conform to established molds to find success, aided by viral social media and streaming algorithms. +- Generative AI tools are becoming integrated into music production workflows, enabling new creative possibilities and disrupting formulaic genres. +- An aesthetic shift toward "dirty" and authentic sounds is emerging, especially in pop music. +- Social media continues to birth new music formats tailored for short-video consumption, influencing how music is created and marketed. +- Live music is gaining even more value despite the rise of digital platforms. +- Sync licensing revenue is growing, fueled by demand from streaming services and gaming. There's a shift away from just "sync-friendly" music toward originality and emotional impact in sync selections. Hip-Hop, R&B, Indie, Electronic, Latin, and Retro genres are notably popular for sync. +- AI-powered tools are helping music supervisors sift through the ever-expanding catalogs to find sync-ready music. +- Blockchain technology is expected to significantly reshape music publishing by enhancing transparency, rights management, and faster royalty payments, empowering artists. +- Distribution models are shifting toward direct-to-fan platforms like Bandcamp and Patreon, allowing artists greater control and profit retention. +- Micro-genres and niche musical styles are increasingly gaining focus, supported by enhanced artist data analytics to understand listener behavior better. +- Despite challenges like slowing streaming growth and high concert ticket prices, the industry continues evolving with innovation in AI and broader artist diversity. + +Dance music specifically shows signs of a softening trend with the rise of slower, groove-focused styles versus the previous half-decade's faster, aggressive beats. +These trends collectively indicate a music industry in 2025 that is more diverse, technology-driven, artist-empowered, and tuned to new consumption patterns driven by social media, AI, and fan-direct engagement.`, + metadata: { + category: "industry_trends", + expected_tool_usage: true, + data_type: "current_events", + requires_web_search: true, + }, + }, + { + input: "What happened at the 2025 Grammy Awards?", + expected: `The 2025 Grammy Awards (67th edition) were historic for several reasons: Beyoncé finally won Album of the Year—the top prize she had long been denied—and became the first Black woman to win Best Country Album, while Kendrick Lamar swept major rap categories with his song "Not Like Us". Sabrina Carpenter took home Album of the Year, Shakira won Best Latin Pop Album, and Chappell Roan was named Best New Artist, bringing dazzling performances and activism to the stage. + +67th Annual Grammy Awards +Key Moments and Milestones: + +Beyoncé's double win for "Cowboy Carter" marked a breakthrough for Black artists in country music—her astonished reaction and acceptance speech are already iconic. + +Kendrick Lamar dominated with "Not Like Us," winning five Grammys (including record and song of the year); his diss track for Drake became an anthem for Los Angeles in light of recent wildfires, and the awards focused heavily on fundraising for wildfire victims. + +Chappell Roan delivered a theatrical performance of "Pink Pony Club" featuring queer and rodeo themes. She urged record labels to provide fair wages and healthcare for emerging artists. + +Shakira, winning Best Latin Pop Album, dedicated her award to immigrants and made a passionate speech about supporting immigrant communities in the US. + +The Weeknd ended his Grammy boycott, returning for a surprise performance and opening dialogue about Academy diversity. + +Janelle Monáe led a moving tribute to Quincy Jones, joined by Cynthia Erivo, Herbie Hancock, and Stevie Wonder, with Taylor Swift supporting the tribute. + +Sabrina Carpenter was recognized with Album of the Year, highlighting the ceremony’s focus on new voices. + +Show Format: + +The ceremony, organized by Trevor Noah, had a telethon-like format to support victims of Los Angeles wildfires, with frequent calls for donations and themed performances. + +Fashion and pop culture moments, such as Miley Cyrus's bold dress and Chappell Roan's art-inspired gown, stood out on the red carpet. + +What stood out and why it matters: + +This year's Grammys were notable for historic wins, genre-crossing breakthroughs, and activism onstage. Beyoncé’s recognition for both country and overall album marked a cultural milestone for Grammy representation, while Lamar’s wins reinforced the ceremony's relevance to contemporary social issues. The spotlight on fundraising and artist advocacy set a new precedent for the event’s purpose and public engagement, and star performances from the likes of Sabrina Carpenter, Chappell Roan, and Shakira signaled a shift toward fresh voices and more inclusive storytelling.`, + metadata: { + category: "awards", + expected_tool_usage: true, + data_type: "current_events", + requires_web_search: true, + }, + }, + { + input: + "What are the current Spotify streaming numbers for Bad Bunny's latest album?", + expected: `Bad Bunny's latest album titled "DeBÍ TiRAR MáS FOToS," released in 2025, currently has around 1.07 billion streams on Spotify. His previous album "Un Verano Sin Ti" has over 20.6 billion streams on Spotify, making it one of the most streamed albums on the platform as of late 2025.`, + metadata: { + category: "streaming_data", + expected_tool_usage: true, + data_type: "current_streaming_stats", + requires_web_search: true, + }, + }, + { + input: "What new albums were released in January 2025?", + expected: `In January 2025, several notable albums were released across various genres. Key releases include: + +- The Weeknd's album "Hurry Up Tomorrow," released on January 24, which was accompanied by a tour and a related film debut scheduled for May 16, 2025. +- Lil Baby's album "WHAM (Who Hard As Me)," released on January 3, featuring collaborations with artists like Young Thug, Future, Travis Scott, and production from prominent producers such as Southside and Wheezy. +- Mac Miller's posthumous album "Balloonerism," released on January 17, with 14 tracks recorded over a decade ago and officially released in 2025. +- Bad Bunny's album "Debí Tirar Más Fotos," released on January 5. +- Ethel Cain's album "Perverts," released on January 8. +- Franz Ferdinand's album "The Human Fear," released on January 10. +- Ringo Starr's album "Look Up," released on January 10. + +Other notable releases include albums and EPs by Ellis King, Lambrini Girls, Mon Rovîa, Moonchild Sanelly, Tremonti, and several others across different music styles. + +There were also albums highlighted for their quality and range, from introspective hip-hop to dance-pop with influences from artists like Björk and Radiohead. + +This January lineup showcased a mix of established artists and emerging talent, setting the tone for music in 2025.`, + metadata: { + category: "releases", + expected_tool_usage: true, + data_type: "recent_releases", + requires_web_search: true, + }, + }, + { + input: "What are the latest developments in music streaming technology?", + expected: `The latest developments in music streaming technology in 2025 center around advanced AI-driven personalization, high-resolution (hi-res) and lossless audio streaming, integration of blockchain for direct artist payments, and emerging AI detection tools for identifying AI-generated music. + +### AI-Driven Personalization and Contextual Experiences +Music streaming platforms use AI and machine learning to create hyper-personalized listening experiences, understanding not only users' preferences but also contextual factors like mood, activity, and time of day. This allows apps to offer playlists and recommendations tailored specifically to each unique moment, going beyond traditional genre or artist-based suggestions. Features like AI DJs and AI-powered remixing tools are part of this trend, enhancing user engagement and creating a more dynamic discovery process. + +### Enhanced Audio Quality with Hi-Res and Lossless Streaming +There is growing demand and broader availability of high-resolution audio streaming, delivering superior sound quality to listeners. Major platforms including Apple Music, Amazon Music, and TIDAL offer hi-res and spatial audio options, while Spotify is launching its long-awaited Spotify HiFi tier with lossless streaming as part of a new premium subscription add-on called "Music Pro." This trend reflects an industry-wide move toward premium sound experiences especially valued by audiophiles. + +### Blockchain Integration for Fair Artist Compensation +Blockchain technology is being adopted by platforms like Audius to provide decentralized and transparent music distribution, allowing artists to sell music directly to fans and receive payments via smart contracts without intermediaries. This innovation is beginning to reshape the economic model of music streaming with more direct artist-fan engagement and fair compensation. + +### AI Music Detection and Content Integrity +With the rise of AI-generated music, platforms like Deezer have implemented AI detection tools to identify and tag artificially created music tracks. For example, Deezer found that approximately 10% of daily uploads were fully AI-generated and plans to exclude such content from algorithmic recommendations to preserve platform integrity. Tools like Ircam Amplify's AI Music Detector achieve high accuracy in distinguishing human and AI music, which is vital for protecting artists' rights and ensuring fair revenue distribution. + +### Other Emerging Trends +- Social media synergy with streaming services continues to impact music discovery and promotion. +- Immersive experiences such as virtual and augmented reality concerts are poised to dissolve physical barriers between artists and fans. +- Subscription models are evolving with offerings targeting superfans with exclusive perks and enhanced interactivity. + +These trends collectively showcase how music streaming technology in 2025 is becoming more personalized, immersive, transparent, and high-fidelity while addressing new challenges posed by AI-generated content.`, + metadata: { + category: "technology", + expected_tool_usage: true, + data_type: "tech_developments", + requires_web_search: true, + }, + }, + { + input: "What is Bad Bunny's current tour schedule for 2025?", + expected: `Bad Bunny's current 2025 tour schedule includes two major components: + +1. A concert residency titled "No Me Quiero Ir de Aquí" in Puerto Rico at the José Miguel Agrelot Coliseum, running from July 11 to September 20, 2025, with 31 concert dates. + +2. An all-stadium world tour called the "Debí Tirar Más Fotos World Tour" supporting his 2025 album, starting November 21, 2025, at Estadio Olímpico Félix Sánchez in Santo Domingo, and concluding July 22, 2026, in Brussels. This tour features over 57 shows across Latin America, Australia, Japan, and Europe, with many additional dates added due to high demand. + +There are no 2025 U.S. tour dates, reportedly due to concerns over anti-immigration raids. The residency and world tour cover a wide range of locations internationally with record-breaking ticket sales and multiple added shows in cities like Mexico City, Madrid, and others.`, + metadata: { + category: "tour_info", + expected_tool_usage: true, + data_type: "current_tour_dates", + requires_web_search: true, + }, + }, + { + input: "What are the latest collaborations in hip-hop for August 2025?", + expected: `In August 2025, some of the latest notable collaborations in hip-hop included: + +- Drake featuring Central Cee on the track "WHICH ONE" (DJ OiO Acap In). +- Offset featuring JID on the song "Bodies". +- Offset teaming up with Key Glock for "Run It Up". +- Joyner Lucas featuring J Balvin, Fireboy DML, and DaBaby on a track titled "Time Is Money". +- Metro Boomin featuring Waka Flocka Flame on "Clap" and with J Money, Quavo, and Waka Flocka Flame on "Drip BBQ". +- Buddah Bless featuring Big Sean, 2 Chainz, and BossMan Dlow on "See The World". +- Juicy J featuring Wale and Trey Songz on "Bounce It". +- Pluto and YK Niece featuring Sexyy Red on "WHIM WHAMIEE (Remix)". + +These collaborations highlight a range of featured artists who dropped new tracks or contributed to each other's projects in August 2025.`, + metadata: { + category: "collaborations", + expected_tool_usage: true, + data_type: "recent_collaborations", + requires_web_search: true, + }, + }, + { + input: + "What are the current music industry revenue statistics for Q2 2025?", + expected: `The current music industry revenue statistics for Q2 2025 show continued growth driven primarily by streaming and subscription services. + +Key highlights from major companies: +- Universal Music Group reported revenue of €2.98 billion for Q2 2025, a 1.6% year-over-year increase (4.5% in constant currency). Recorded Music revenue rose 1.1%, with streaming revenue up 4.4%, and subscription revenue growing 5.3% year-over-year. Music Publishing revenue grew 11.5% year-over-year. Adjusted EBITDA margin expanded to 22.7%. +- Sony generated $2.77 billion in global music revenue in Q2 2025, up 8.8% year-over-year in constant currency. Recorded Music revenue was $2.09 billion, with streaming at $1.36 billion (7.3% increase). Physical music sales rose 19%. Music Publishing earned $683 million, up 9.9%, with streaming publishing revenue increasing 8%. +- Spotify reported total revenue of €4.2 billion for Q2 2025, a 10% increase year-over-year. Subscribers climbed 12% to 276 million, and monthly active users grew 11% to 696 million. +- Live Nation recorded a consolidated revenue surge of 16% to $7 billion in Q2 2025, driven by global fan demand. +- Industry-wide, revenue across all formats hit a new high of $5.6 billion mid-year 2025, with paid subscriptions driving much of that growth, growing 5.7% to $3.2 billion. + +Streaming remains the dominant and fastest-growing revenue source, supported by subscriptions. Physical sales showed some growth in companies like Sony but declined in others. Music publishing also saw healthy growth. + +These figures represent strong, broad-based financial health in the global music industry for Q2 2025, with double-digit growth in key segments like streaming and live events continuing to drive overall revenue increases.`, + metadata: { + category: "market_data", + expected_tool_usage: true, + data_type: "revenue_statistics", + requires_web_search: true, + }, + }, + { + input: "What are the latest changes in music copyright law for 2025?", + expected: `The latest changes in music copyright law for 2025 focus heavily on issues related to artificial intelligence (AI), international rights, and new rulings on originality and royalty protections. Key updates include: + +- In the UK, there is a debated government plan to allow AI developers to train on copyrighted music with an "opt-out" system, meaning unless creators choose not to allow it. This faced strong opposition from musicians, and the government may adjust the approach. Also, the UK expanded rights for more international performers to receive royalties when their recordings are played in public or on radio. + +- The UK House of Lords recently voted in favor of strengthening copyright protections against unauthorized use by AI firms, emphasizing the need for transparency and redress mechanisms for creators. + +- In the US, the Supreme Court declined to revive the copyright infringement suit against Ed Sheeran, affirming that common musical structures like chord progressions are not copyrightable. This sets a precedent supporting originality as a requirement. + +- AI-generated music is a central issue globally. Lawsuits and debates revolve around whether AI can legally train on copyrighted songs and when AI-generated outputs infringe copyrights. Countries vary in their legal stances— for example, the US leans on fair use for AI training data, while the EU allows AI training unless rights holders opt out. + +- Various legal cases in 2024-2025 tested copyright issues related to AI music, including suits against AI companies for unauthorized training on copyrighted songs and concerns over AI-generated music mimicking real artists' voices. + +- Tax regulation changes from 2025 adjust how earnings from copyright income versus professional income are treated for musicians and other creative professionals. + +Overall, 2025 sees music copyright law adapting to address the growing influence of AI in music creation, emphasizing the protection of creators' rights internationally, clarifying originality standards, and adjusting royalty frameworks.`, + metadata: { + category: "legal", + expected_tool_usage: true, + data_type: "copyright_updates", + requires_web_search: true, + }, + }, + { + input: + "What are the latest features on TikTok for music creators in Q2 2025?", + expected: `The latest features on TikTok for music creators in Q2 2025 center around the beta launch of TikTok Songwriter Features. These include: + +- Songwriter Account Label: Music creators can create official Songwriter accounts that add a clear "Songwriter" label to their profile for identification. +- Songwriter Music Tab: A dedicated tab on user profiles where songwriters can spotlight tracks they have written or co-written. +- Story Sharing Tools: Songwriters can share stories behind their music to engage fans deeper. +- Enhanced Music Discovery: Fans can explore, use, save, and share music from songwriters easily. +- Existing tools integration: Features like #BehindTheSong campaign, "New" tags on latest releases, and Add to Music App for saving songs to streaming services complement the new tools. + +These innovations aim to highlight songwriters' work, improve discovery, and support monetization opportunities based on songwriter feedback and research. Notable early users include Lauren Christy, Toby Gad, and Justin Tranter. These features reflect TikTok's strong commitment to music creators and help build their audience and profile on the platform in 2025.`, + metadata: { + category: "platform_features", + expected_tool_usage: true, + data_type: "social_media_updates", + requires_web_search: true, + }, + }, + { + input: + "whats going on at spotify for artists with terms and services. Artists do not like it", + expected: + "Spotify updated its Terms of Service in 2025, which has caused controversy among artists. The main concerns arise from language in the terms that grant Spotify broad rights to use any user-uploaded content through Spotify for Artists—such as music, photos, biographies, and promotional materials—in marketing and promotional activities worldwide and royalty-free. This means Spotify can use artists' uploaded content to promote its platform without additional compensation to the artists. Some artists feel this overreaches and infringes on their control over their intellectual property.", + metadata: { + category: "platform_policy", + expected_tool_usage: true, + data_type: "current_events", + requires_web_search: true, + }, + }, + ], + + task: async (input: string): Promise => { + try { + const response = await callChatFunctions(input); + return response; + } catch (error) { + return `Error: ${error instanceof Error ? error.message : "Function call failed"}`; + } + }, + + scores: [AnswerCorrectness], +}); diff --git a/evals/social-scraping.eval.ts b/evals/social-scraping.eval.ts new file mode 100644 index 000000000..277616d96 --- /dev/null +++ b/evals/social-scraping.eval.ts @@ -0,0 +1,142 @@ +import { Eval } from "braintrust"; +import { + callChatFunctionsWithResult, + extractTextFromResult, + createToolsCalledScorer, +} from "@/lib/evals"; + +/** + * Social Scraping Evaluation + * + * This evaluation tests whether the AI properly handles scraping requests by: + * 1. Attempting scraping tools (web search, Apify, Instagram/Twitter scrapers) before giving up + * 2. Using fresh data from scrapes instead of relying on stale database values + * 3. Providing specific numbers/data from scraping results + * + * Test cases: + * - "Scrape all social profiles" - Should attempt all available scrapers + * - "How many Instagram followers do I have?" - Should use fresh scraping data + * - "How many followers on TikTok and X?" - Should scrape/search for real counts, not return stale 0s + * - "What videos on IG reels caused the spike in 'The Thrill'?" - Should scrape Instagram for song usage data + * - "Fetch streaming trend and playlist-add history for 90 days" - Should use web search and Spotify tools for trend data + * - "Find press/interviews/moments for Wiz Khalifa" - Should use web search to find visibility events and streaming impact + * + * Required Tools: search_web, web_deep_research, get_apify_scraper, scrape_instagram_profile, scrape_instagram_comments, search_twitter, get_twitter_trends + * Penalized Tools: contact_team + * + * Run: npx braintrust eval evals/social-scraping.eval.ts + */ + +const REQUIRED_TOOLS = [ + "search_web", + "web_deep_research", + "get_apify_scraper", + "scrape_instagram_profile", + "scrape_instagram_comments", + "search_twitter", + "get_twitter_trends", +]; + +const PENALIZED_TOOLS = ["contact_team"]; + +Eval("Social Scraping Evaluation", { + data: () => [ + { + input: + "Scrape all social profiles for @iamjuliusblack now. If you can't scrape certain profiles, tell me how I can get them integrated here.", + expected: + "Exec summary + status table with Platform/Status/Data/Gaps/Next Step, showing partial data from successful scrapes and clear next steps for failed ones", + metadata: { + artist: "Julius Black", + platform: "all", + request_type: "scrape_all_profiles", + requiredTools: REQUIRED_TOOLS, + penalizedTools: PENALIZED_TOOLS, + }, + }, + { + input: "How many Instagram followers do I have?", + expected: + "Specific follower count from fresh scraping (e.g., '112,545 followers')", + metadata: { + artist: "Fat Beats", + platform: "instagram", + request_type: "follower_count", + requiredTools: REQUIRED_TOOLS, + penalizedTools: PENALIZED_TOOLS, + }, + }, + { + input: "How many followers do I have on TikTok and X?", + expected: + "Specific follower counts from scraping/web search (not stale database values showing 0)", + metadata: { + artist: "Fat Beats", + platform: "tiktok_and_x", + request_type: "follower_counts", + requiredTools: REQUIRED_TOOLS, + penalizedTools: PENALIZED_TOOLS, + }, + }, + { + input: + 'What videos on IG reels over the last 24 hours caused the spike in the song "The Thrill" being used in short form content?', + expected: + "List of Instagram Reels videos that used 'The Thrill' in the last 24 hours, with view counts and engagement data from scraping", + metadata: { + artist: "Unknown", + platform: "instagram", + request_type: "song_usage_tracking", + requiredTools: REQUIRED_TOOLS, + penalizedTools: PENALIZED_TOOLS, + }, + }, + { + input: + "Fetch streaming trend and playlist-add history for the last 90 days (shows what's actually growing).", + expected: + "Streaming trend data and playlist-add history from Spotify tools and web search", + metadata: { + artist: "Unknown", + platform: "spotify", + request_type: "streaming_trends", + requiredTools: REQUIRED_TOOLS, + penalizedTools: PENALIZED_TOOLS, + }, + }, + { + input: + "Can you help me find strong press, interviews or moments in the last year that Wiz Khalifa was part of? Example: He did NPR's Tiny Desk in June [https://www.youtube.com/watch?v=grWRQ0cONXA]. Trying to see what big moments he had that brought him more visibility and streaming uplift", + expected: + "List of press moments, interviews, and visibility events for Wiz Khalifa from web search, with streaming impact analysis", + metadata: { + artist: "Wiz Khalifa", + platform: "multiple", + request_type: "press_moments_research", + requiredTools: REQUIRED_TOOLS, + penalizedTools: PENALIZED_TOOLS, + }, + }, + ], + + task: async (input: string) => { + try { + const result = await callChatFunctionsWithResult(input); + const output = extractTextFromResult(result); + const toolCalls = + result.toolCalls?.map((tc) => ({ + toolName: tc.toolName, + args: {}, + })) || []; + + return { output, toolCalls }; + } catch (error) { + return { + output: `Error: ${error instanceof Error ? error.message : "Function call failed"}`, + toolCalls: [], + }; + } + }, + + scores: [createToolsCalledScorer(REQUIRED_TOOLS, PENALIZED_TOOLS)], +}); diff --git a/evals/spotify-followers.eval.ts b/evals/spotify-followers.eval.ts new file mode 100644 index 000000000..777535a46 --- /dev/null +++ b/evals/spotify-followers.eval.ts @@ -0,0 +1,26 @@ +import { Eval } from "braintrust"; +import { AnswerCorrectness } from "autoevals"; +import { callChatFunctions } from "@/lib/evals"; +import getSpotifyFollowersData from "@/lib/evals/getSpotifyFollowersData"; + +/** + * Spotify Followers Evaluation + * + * This evaluation tests whether your AI system properly uses tool calls + * to fetch Spotify follower data instead of defaulting to "I don't have access" responses. + * + * Run: npx braintrust eval evals/spotify-followers.eval.ts + */ +Eval("Spotify Followers Evaluation", { + data: getSpotifyFollowersData, + task: async (input: string): Promise => { + try { + const response = await callChatFunctions(input); + return response; + } catch (error) { + return `Error: ${error instanceof Error ? error.message : "Function call failed"}`; + } + }, + + scores: [AnswerCorrectness], +}); diff --git a/evals/spotify-tools.eval.ts b/evals/spotify-tools.eval.ts new file mode 100644 index 000000000..adb8856d6 --- /dev/null +++ b/evals/spotify-tools.eval.ts @@ -0,0 +1,85 @@ +import { Eval } from "braintrust"; +import { + callChatFunctionsWithResult, + extractTextFromResult, + createToolsCalledScorer, +} from "@/lib/evals"; + +/** + * Spotify Tools Evaluation + * + * This evaluation tests whether the AI properly uses tools when asked to craft + * Spotify-related pitches and strategies. The AI should: + * 1. Search for Spotify for Artists requirements and playlist submission guidelines + * 2. Use Spotify tools to get artist/album/track/playlist data + * 3. Ask clarifying questions if needed + * 4. NOT just respond without gathering data first + * + * Test cases: + * - "Craft a Spotify for Artists pitch" - Should use Spotify tools to gather album/track data + * - "Research playlists and curators" - Should search for playlists and analyze requirements + * + * Required Tools: search_web, web_deep_research, get_spotify_search, get_spotify_artist_top_tracks, get_spotify_artist_albums + * + * Run: npx braintrust eval evals/spotify-tools.eval.ts + */ + +const REQUIRED_TOOLS = [ + "search_web", + "web_deep_research", + "get_spotify_search", + "get_spotify_artist_top_tracks", + "get_spotify_artist_albums", +]; + +Eval("Spotify Tools Evaluation", { + data: () => [ + { + input: + 'craft a spotify for artists pitch, in line with their requirements, about the 2 late to be toxic album and focus track "what happened 2 us". ask any questions you need to get necessary info you don\'t have', + expected: + "A Spotify for Artists pitch using data from Spotify tools and web research", + metadata: { + artist: "Unknown", + platform: "Spotify", + request_type: "pitch_creation", + expected_tool_usage: true, + requiredTools: REQUIRED_TOOLS, + }, + }, + { + input: + "Research playlists in my genre and style that would be perfect for my music. Find playlist curators, analyze submission requirements, and give me a strategy for getting my songs placed on high-impact playlists.", + expected: + "List of relevant playlists with curator info, submission requirements, and placement strategy from Spotify tools and web research", + metadata: { + artist: "Unknown", + platform: "Spotify", + request_type: "playlist_research", + expected_tool_usage: true, + requiredTools: REQUIRED_TOOLS, + }, + }, + ], + + task: async (input: string) => { + try { + const result = await callChatFunctionsWithResult(input); + const output = extractTextFromResult(result); + const toolCalls = + result.toolCalls?.map((tc) => ({ + toolName: tc.toolName, + args: {}, + })) || []; + + return { output, toolCalls }; + } catch (error) { + return { + output: `Error: ${error instanceof Error ? error.message : "Function call failed"}`, + toolCalls: [], + }; + } + }, + + scores: [createToolsCalledScorer(REQUIRED_TOOLS)], +}); diff --git a/evals/tiktok-analytics-questions.eval.ts b/evals/tiktok-analytics-questions.eval.ts new file mode 100644 index 000000000..b74579a33 --- /dev/null +++ b/evals/tiktok-analytics-questions.eval.ts @@ -0,0 +1,58 @@ +import { Eval } from "braintrust"; +import { callChatFunctions } from "@/lib/evals"; +import { QuestionAnswered } from "@/lib/evals/scorers/QuestionAnswered"; + +/** + * TikTok Analytics Questions Evaluation + * + * This evaluation tests whether the AI system properly answers questions about + * TikTok analytics and performance data. The AI should: + * 1. Provide specific answers/data if available through tools + * 2. Use web search to find the answer + * 3. Show progress/steps to customer while processing (like Perplexity) + * 4. Use AI elements to display what it's doing + * + * The AI should NOT: + * - Simply explain why it can't answer without attempting to get the data + * - Make the customer wait 3+ minutes with no feedback + * - Deflect to manual workarounds without trying automated solutions first + * + * Run: npx braintrust eval evals/tiktok-analytics-questions.eval.ts + */ +Eval("TikTok Analytics Questions Evaluation", { + data: () => [ + { + input: "how many total views does @iamjuliusblack have on TikTok", + expected: + "A specific number of total views (e.g., '150,000 total views')", + metadata: { + artist: "Julius Black", + platform: "tiktok", + handle: "@iamjuliusblack", + metric: "total_views", + }, + }, + { + input: "show me @iamjuliusblack's 10 highest performing TikTok posts", + expected: + "A ranked list of 10 TikTok posts with URLs, view counts, likes, and captions", + metadata: { + artist: "Julius Black", + platform: "tiktok", + handle: "@iamjuliusblack", + metric: "top_posts", + }, + }, + ], + + task: async (input: string): Promise => { + try { + const response = await callChatFunctions(input); + return response; + } catch (error) { + return `Error: ${error instanceof Error ? error.message : "Function call failed"}`; + } + }, + + scores: [QuestionAnswered], +}); diff --git a/lib/evals/callChatFunctions.ts b/lib/evals/callChatFunctions.ts new file mode 100644 index 000000000..ef770a2b5 --- /dev/null +++ b/lib/evals/callChatFunctions.ts @@ -0,0 +1,19 @@ +import { callChatFunctionsWithResult } from "./callChatFunctionsWithResult"; +import { extractTextFromResult } from "./extractTextFromResult"; + +/** + * Call the chat functions directly instead of making HTTP requests + * This function encapsulates the logic for calling the chat system + * and can be reused across different evaluations. + * + * @deprecated Use callChatFunctionsWithResult for access to tool calls + */ +export async function callChatFunctions(input: string): Promise { + try { + const result = await callChatFunctionsWithResult(input); + return extractTextFromResult(result); + } catch (error) { + console.error("Error calling chat functions:", error); + throw error; + } +} diff --git a/lib/evals/callChatFunctionsWithResult.ts b/lib/evals/callChatFunctionsWithResult.ts new file mode 100644 index 000000000..d8abf5286 --- /dev/null +++ b/lib/evals/callChatFunctionsWithResult.ts @@ -0,0 +1,49 @@ +import { UIMessage } from "ai"; +import { DEFAULT_MODEL, EVAL_ACCOUNT_ID, EVAL_ACCESS_TOKEN } from "@/lib/consts"; +import { setupChatRequest } from "@/lib/chat/setupChatRequest"; +import { generateText } from "ai"; +import { ChatRequestBody } from "@/lib/chat/validateChatRequest"; + +/** + * Call the chat functions and return the full result including tool calls from ALL steps. + * + * Note: result.toolCalls only contains calls from the LAST step. When using multi-step + * tool chains, we need to collect toolCalls from result.steps to capture all tool usage. + */ +export async function callChatFunctionsWithResult(input: string) { + const messages: UIMessage[] = [ + { + id: "user-message", + role: "user", + parts: [ + { + type: "text", + text: input, + }, + ], + }, + ]; + + const body: ChatRequestBody = { + messages, + roomId: "3779c62e-7583-40c6-a0bb-6bbac841a531", + accountId: EVAL_ACCOUNT_ID, + accessToken: EVAL_ACCESS_TOKEN, + artistId: "29cfd55a-98d9-45a5-96c9-c751a88f7799", + model: DEFAULT_MODEL, + excludeTools: [], // Don't exclude any tools - we want to test tool usage + }; + + const chatConfig = await setupChatRequest(body); + const result = await generateText(chatConfig); + + // Collect tool calls from ALL steps, not just the last one + const allToolCalls = + result.steps?.flatMap((step) => step.toolCalls || []) || result.toolCalls; + + // Return result with all tool calls from all steps + return { + ...result, + toolCalls: allToolCalls, + }; +} diff --git a/lib/evals/createToolsCalledScorer.ts b/lib/evals/createToolsCalledScorer.ts new file mode 100644 index 000000000..dff87149e --- /dev/null +++ b/lib/evals/createToolsCalledScorer.ts @@ -0,0 +1,41 @@ +import { ToolsCalled } from "./scorers/ToolsCalled"; + +/** + * Creates a scorer that checks if required tools were called. + * Handles extracting output text and toolCalls from the task result. + */ +export const createToolsCalledScorer = ( + requiredTools: string[], + penalizedTools: string[] = [] +) => { + return async (args: { + output: unknown; + expected?: string; + input: string; + }) => { + // Extract output text and toolCalls + const outputText = + typeof args.output === "object" && args.output && "output" in args.output + ? (args.output.output as string) + : (args.output as string); + + const toolCalls = + typeof args.output === "object" && + args.output && + "toolCalls" in args.output + ? (args.output.toolCalls as Array<{ + toolName: string; + args: Record; + }>) + : undefined; + + return await ToolsCalled({ + output: outputText, + input: args.input, + expected: args.expected, + toolCalls, + requiredTools, + penalizedTools, + }); + }; +}; diff --git a/lib/evals/extractTextFromResult.ts b/lib/evals/extractTextFromResult.ts new file mode 100644 index 000000000..09e7a69fa --- /dev/null +++ b/lib/evals/extractTextFromResult.ts @@ -0,0 +1,24 @@ +import { generateText } from "ai"; +import { extractTextResultFromSteps } from "./extractTextResultFromSteps"; + +/** + * Extract text from a GenerateTextResult + */ +export function extractTextFromResult( + result: Awaited> +): string { + // Handle multi-step responses (when maxSteps > 1) + const stepsText = extractTextResultFromSteps(result); + if (stepsText) return stepsText; + + // Fallback to direct text/content properties + if (typeof result.text === "string") { + return result.text; + } + + if (typeof result.content === "string") { + return result.content; + } + + return String(result.text || result.content || "No response content"); +} diff --git a/lib/evals/extractTextResultFromSteps.ts b/lib/evals/extractTextResultFromSteps.ts new file mode 100644 index 000000000..9c4606f02 --- /dev/null +++ b/lib/evals/extractTextResultFromSteps.ts @@ -0,0 +1,37 @@ +import { generateText } from "ai"; +import type { TextPart } from "ai"; + +/** + * Extract text from multi-step GenerateTextResult + * Handles responses where maxSteps > 1 + */ +export function extractTextResultFromSteps( + result: Awaited> +): string | null { + if ( + !result.steps || + !Array.isArray(result.steps) || + result.steps.length === 0 + ) { + return null; + } + + const lastStep = result.steps[result.steps.length - 1]; + + if (!lastStep.content || !Array.isArray(lastStep.content)) { + return null; + } + + const textParts = lastStep.content + .filter( + (part: unknown): part is TextPart => + typeof part === "object" && + part !== null && + "type" in part && + part.type === "text" + ) + .map((part: TextPart) => part.text) + .join(""); + + return textParts || null; +} diff --git a/lib/evals/getCatalogSongsCountData.ts b/lib/evals/getCatalogSongsCountData.ts new file mode 100644 index 000000000..f36aaf5d8 --- /dev/null +++ b/lib/evals/getCatalogSongsCountData.ts @@ -0,0 +1,42 @@ +import getCatalogSongsCountExpected from "@/lib/evals/getCatalogSongsCountExpected"; + +const getCatalogSongsCountData = async () => { + const { expected, catalogName, count } = await getCatalogSongsCountExpected(); + + const testCases = [ + { + input: `How many songs are in my catalog?`, + expected, + metadata: { + catalogName, + count, + expected_tool_usage: true, + data_type: "catalog_songs_count", + }, + }, + { + input: `What's the total count of songs in my music catalog?`, + expected, + metadata: { + catalogName, + count, + expected_tool_usage: true, + data_type: "catalog_songs_count", + }, + }, + { + input: `Get the number of songs in my catalog`, + expected, + metadata: { + catalogName, + count, + expected_tool_usage: true, + data_type: "catalog_songs_count", + }, + }, + ]; + + return testCases; +}; + +export default getCatalogSongsCountData; diff --git a/lib/evals/getCatalogSongsCountExpected.ts b/lib/evals/getCatalogSongsCountExpected.ts new file mode 100644 index 000000000..6f04e59ca --- /dev/null +++ b/lib/evals/getCatalogSongsCountExpected.ts @@ -0,0 +1,39 @@ +import { getCatalogs } from "@/lib/catalog/getCatalogs"; +import { getCatalogSongs } from "@/lib/catalog/getCatalogSongs"; +import { EVAL_ACCOUNT_ID } from "@/lib/consts"; + +async function getCatalogSongsCountExpected() { + try { + const catalogsData = await getCatalogs(EVAL_ACCOUNT_ID); + + if (!catalogsData.catalogs || catalogsData.catalogs.length === 0) { + throw new Error("No catalogs found for account"); + } + + const firstCatalog = catalogsData.catalogs[0]; + const catalogSongs = await getCatalogSongs(firstCatalog.id); + + const count = catalogSongs.pagination.total_count; + const formattedCount = count.toLocaleString(); + const expected = `The catalog "${firstCatalog.name}" (id: ${firstCatalog.id}) contains ${formattedCount} songs.`; + + return { + catalogId: firstCatalog.id, + catalogName: firstCatalog.name, + count, + expected, + }; + } catch (error) { + console.error("Error fetching catalog songs count:", error); + const fallbackExpected = + "Catalog song count data could not be retrieved at this time. Please try again later."; + return { + catalogId: "", + catalogName: "", + count: 0, + expected: fallbackExpected, + }; + } +} + +export default getCatalogSongsCountExpected; diff --git a/lib/evals/getMonthlyListenersDates.ts b/lib/evals/getMonthlyListenersDates.ts new file mode 100644 index 000000000..e7c922be1 --- /dev/null +++ b/lib/evals/getMonthlyListenersDates.ts @@ -0,0 +1,51 @@ +export interface DynamicDates { + startDateFormatted: string; + endDateFormatted: string; + startDate: Date; + endDate: Date; +} + +/** + * Generates dynamic dates for monthly listeners tracking: + * - End date: 1 week ago from today + * - Start date: 1 month prior to end date + * + * @returns Object containing formatted date strings and Date objects + */ +export function getDynamicDates(): DynamicDates { + const today = new Date(); + + // End date: 1 week ago + const endDate = new Date(today); + endDate.setDate(today.getDate() - 7); + + // Start date: 1 month prior to end date + const startDate = new Date(endDate); + startDate.setMonth(endDate.getMonth() - 1); + + // Format dates as "Month Day" (e.g., "June 6", "September 12") + const formatDate = (date: Date) => { + const months = [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", + ]; + return `${months[date.getMonth()]} ${date.getDate()}`; + }; + + return { + startDateFormatted: formatDate(startDate), + endDateFormatted: formatDate(endDate), + startDate, + endDate, + }; +} diff --git a/lib/evals/getSpotifyFollowersData.ts b/lib/evals/getSpotifyFollowersData.ts new file mode 100644 index 000000000..2edb87cc8 --- /dev/null +++ b/lib/evals/getSpotifyFollowersData.ts @@ -0,0 +1,24 @@ +import getSpotifyFollowersExpected from "@/lib/evals/getSpotifyFollowersExpected"; +import { EVAL_ARTISTS } from "@/lib/consts"; + +const getSpotifyFollowersData = async () => { + const testCases = await Promise.all( + EVAL_ARTISTS.map(async (artist) => { + const { expected } = await getSpotifyFollowersExpected(artist); + return { + input: `how many total followers does ${artist} have on Spotify`, + expected, + metadata: { + artist, + platform: "Spotify", + expected_tool_usage: true, + data_type: "spotify_followers", + }, + }; + }) + ); + + return testCases; +}; + +export default getSpotifyFollowersData; diff --git a/lib/evals/getSpotifyFollowersExpected.ts b/lib/evals/getSpotifyFollowersExpected.ts new file mode 100644 index 000000000..ef96e2487 --- /dev/null +++ b/lib/evals/getSpotifyFollowersExpected.ts @@ -0,0 +1,18 @@ +import { getSpotifyFollowers } from "@/lib/spotify/getSpotifyFollowers"; + +async function getSpotifyFollowersExpected(artist: string) { + try { + const followerCount = await getSpotifyFollowers(artist); + const expected = `${artist} has ${followerCount} followers on Spotify.`; + + const data = { followerCount, expected }; + return data; + } catch (error) { + console.error(`Error fetching Spotify followers for "${artist}":`, error); + const fallbackExpected = `${artist} has follower data that could not be retrieved at this time. Please try again later.`; + const data = { followerCount: 0, expected: fallbackExpected }; + return data; + } +} + +export default getSpotifyFollowersExpected; diff --git a/lib/evals/index.ts b/lib/evals/index.ts new file mode 100644 index 000000000..c01b213ad --- /dev/null +++ b/lib/evals/index.ts @@ -0,0 +1,4 @@ +export { callChatFunctions } from "./callChatFunctions"; +export { callChatFunctionsWithResult } from "./callChatFunctionsWithResult"; +export { extractTextFromResult } from "./extractTextFromResult"; +export { createToolsCalledScorer } from "./createToolsCalledScorer"; diff --git a/lib/evals/scorers/CatalogAvailability.ts b/lib/evals/scorers/CatalogAvailability.ts new file mode 100644 index 000000000..206053f2d --- /dev/null +++ b/lib/evals/scorers/CatalogAvailability.ts @@ -0,0 +1,100 @@ +import { DEFAULT_MODEL } from "@/lib/consts"; +import { generateObject } from "ai"; +import { getCatalogDataAsCSV } from "@/lib/catalog/getCatalogDataAsCSV"; +import { z } from "zod"; + +/** + * Custom scorer that uses AI to check if recommended songs are actually in the catalog + */ +export const CatalogAvailability = async ({ + output, +}: { + output: string; + expected: string; + input: string; +}) => { + try { + const catalogId = "325a0fa0-401e-4968-ae43-e9ce469b31f0"; + const catalog = await getCatalogDataAsCSV(catalogId); + + const result = await generateObject({ + model: DEFAULT_MODEL, + system: `You are a music catalog analyst. Your job is to analyze song recommendations and determine which ones are available in the provided music catalog. + +Instructions: +1. Extract all song recommendations from the output text +2. For each song, check if it exists in the catalog (exact match or close match) +3. Consider variations in artist names, song titles, and formatting +4. Return detailed analysis with scores and reasoning +5. CRITICAL: Use only double quotes in JSON strings. Escape any internal quotes with backslashes. +6. CRITICAL: Ensure all strings are properly escaped for valid JSON format + +Catalog format: ISRC,Track Name,Release Name,Artist Name`, + prompt: `Analyze this song recommendation output against the music catalog and return ONLY valid JSON: + +OUTPUT TO ANALYZE: +${output} + +MUSIC CATALOG: +${catalog} + +IMPORTANT: Return ONLY valid JSON. Use double quotes for all strings. Escape any quotes within strings with backslashes. Example: "reasoning": "This is a test with \\"quotes\\" inside"`, + schema: z.object({ + analysis: z + .string() + .describe("Detailed analysis of the song recommendations"), + totalSongs: z.number().describe("Total number of songs recommended"), + songsInCatalog: z + .number() + .describe("Number of songs that are in the catalog"), + matchedSongs: z + .array( + z.object({ + recommended: z.string().describe("The song as recommended"), + catalogMatch: z.string().describe("The matching song in catalog"), + confidence: z + .number() + .min(0) + .max(1) + .describe("Confidence in the match (0-1)"), + }) + ) + .describe("Songs that were matched to the catalog"), + unmatchedSongs: z + .array(z.string()) + .describe("Songs that were not found in the catalog"), + score: z + .number() + .min(0) + .max(1) + .describe("Overall score (0-1) based on catalog availability"), + reasoning: z.string().describe("Explanation of the scoring logic"), + }), + }); + + if (!result.object) { + throw new Error("No response object received from AI model"); + } + + const score = + typeof result.object.score === "number" + ? Math.max(0, Math.min(1, result.object.score)) + : 0; + + return { + name: "catalog_availability", + score, + metadata: result.object, + }; + } catch (error) { + console.error("Error in CatalogAvailability scorer:", error); + return { + name: "catalog_availability", + score: 0, + metadata: { + error: "Failed to analyze catalog availability", + error_message: error instanceof Error ? error.message : "Unknown error", + }, + }; + } +}; diff --git a/lib/evals/scorers/QuestionAnswered.ts b/lib/evals/scorers/QuestionAnswered.ts new file mode 100644 index 000000000..787eca4b0 --- /dev/null +++ b/lib/evals/scorers/QuestionAnswered.ts @@ -0,0 +1,113 @@ +import { DEFAULT_MODEL } from "@/lib/consts"; +import { generateObject } from "ai"; +import { z } from "zod"; + +/** + * Custom scorer that checks if the AI actually answered the customer's question + * with a specific answer, or if it deflected/explained why it couldn't answer + */ +export const QuestionAnswered = async ({ + output, + expected, + input, +}: { + output: string; + expected?: string; + input: string; +}) => { + try { + const result = await generateObject({ + model: DEFAULT_MODEL, + system: `You are an AI evaluation expert. Your job is to determine if an AI assistant actually answered the customer's question with a specific answer, or if it deflected, explained why it couldn't answer, or gave generic suggestions without providing the requested information. + +Instructions: +1. Read the customer's question carefully to understand what specific information they're asking for +2. Analyze the AI's response to see if it provides that specific information +3. Distinguish between: + - ANSWERED: The AI provided the specific information requested (even if approximate or with caveats) + - NOT ANSWERED: The AI explained why it can't answer, offered alternatives, or deflected without providing the core information +4. Consider partial answers where the AI provides some but not all requested information +5. Return your analysis with a score from 0-1 where: + - 1.0 = Fully answered with specific information + - 0.5-0.9 = Partially answered or answered with significant caveats + - 0.0-0.4 = Did not answer, deflected, or only explained why it couldn't answer`, + prompt: `Evaluate whether this AI response actually answered the customer's question: + +CUSTOMER QUESTION: +${input} + +AI RESPONSE: +${output} +${expected ? `\nEXPECTED ANSWER TYPE:\n${expected}` : ""} + +Return your evaluation as JSON.`, + schema: z.object({ + answered: z + .boolean() + .describe( + "Did the AI provide the specific information requested in the question?" + ), + hasSpecificAnswer: z + .boolean() + .describe( + "Does the response contain specific data/numbers/facts that directly address the question?" + ), + deflected: z + .boolean() + .describe( + "Did the AI deflect by explaining why it can't answer or offering alternatives instead of answering?" + ), + score: z + .number() + .min(0) + .max(1) + .describe( + "Score from 0-1 where 1=fully answered, 0.5-0.9=partially answered, 0-0.4=not answered" + ), + reasoning: z + .string() + .describe( + "Detailed explanation of why the response did or did not answer the question" + ), + whatWasAsked: z + .string() + .describe("What specific information did the customer ask for?"), + whatWasProvided: z + .string() + .describe("What information did the AI actually provide?"), + }), + }); + + if (!result.object) { + throw new Error("No response object received from AI model"); + } + + const score = + typeof result.object.score === "number" + ? Math.max(0, Math.min(1, result.object.score)) + : 0; + + return { + name: "question_answered", + score, + metadata: { + answered: result.object.answered, + hasSpecificAnswer: result.object.hasSpecificAnswer, + deflected: result.object.deflected, + reasoning: result.object.reasoning, + whatWasAsked: result.object.whatWasAsked, + whatWasProvided: result.object.whatWasProvided, + }, + }; + } catch (error) { + console.error("Error in QuestionAnswered scorer:", error); + return { + name: "question_answered", + score: 0, + metadata: { + error: "Failed to evaluate if question was answered", + error_message: error instanceof Error ? error.message : "Unknown error", + }, + }; + } +}; diff --git a/lib/evals/scorers/ToolsCalled.ts b/lib/evals/scorers/ToolsCalled.ts new file mode 100644 index 000000000..bcbc9ef6e --- /dev/null +++ b/lib/evals/scorers/ToolsCalled.ts @@ -0,0 +1,83 @@ +/** + * Generic scorer that checks if specific tools were called + */ +export const ToolsCalled = async ({ + toolCalls, + requiredTools = [], + penalizedTools = [], +}: { + output: string; + expected?: string; + input: string; + toolCalls?: Array<{ toolName: string; args: Record }>; + requiredTools?: string[]; + penalizedTools?: string[]; +}) => { + try { + const calledTools = toolCalls?.map((tc) => tc.toolName) || []; + + // Check if required tools were called + const calledRequiredTools = requiredTools.filter((requiredTool) => + calledTools.some((tool) => + tool.toLowerCase().includes(requiredTool.toLowerCase()) + ) + ); + + // Check if penalized tools were called + const calledPenalizedTools = penalizedTools.filter((penalizedTool) => + calledTools.some((tool) => + tool.toLowerCase().includes(penalizedTool.toLowerCase()) + ) + ); + + // Calculate score based on required tools + let score = 0; + + if (requiredTools.length === 0) { + // No required tools specified - scorer not properly configured + return { + name: "tools_called", + score: 0, + metadata: { + error: "No required tools specified", + calledTools, + }, + }; + } + + // Score based on percentage of required tools called + score = calledRequiredTools.length / requiredTools.length; + + // Penalize for calling penalized tools + if (calledPenalizedTools.length > 0) { + score = Math.max(0, score - calledPenalizedTools.length * 0.3); + } + + score = Math.max(0, Math.min(1, score)); + + return { + name: "tools_called", + score, + metadata: { + calledTools, + requiredTools, + calledRequiredTools, + penalizedTools, + calledPenalizedTools, + missingRequiredTools: requiredTools.filter( + (tool) => !calledRequiredTools.includes(tool) + ), + }, + }; + } catch (error) { + console.error("Error in ToolsCalled scorer:", error); + return { + name: "tools_called", + score: 0, + metadata: { + error: "Failed to evaluate tool calls", + error_message: error instanceof Error ? error.message : "Unknown error", + }, + }; + } +}; diff --git a/package.json b/package.json index 117a350a8..3aefdf143 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,13 @@ "lint": "eslint . --ext .ts --fix", "lint:check": "eslint . --ext .ts", "test": "vitest run", - "test:watch": "vitest" + "test:watch": "vitest", + "eval": "braintrust eval --external-packages playwright playwright-core chromium-bidi @browserbasehq/stagehand" }, "dependencies": { "@ai-sdk/anthropic": "^3.0.13", + "autoevals": "^0.0.129", + "braintrust": "^0.4.9", "@ai-sdk/gateway": "^3.0.14", "@ai-sdk/google": "^3.0.8", "@ai-sdk/mcp": "^0.0.12", From 405c95c6d9447138c11d860c09e4b5b76ff9e8ff Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 16:32:21 -0500 Subject: [PATCH 04/15] chore: update pnpm-lock.yaml with new dependencies Co-Authored-By: Claude Opus 4.5 --- pnpm-lock.yaml | 907 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 893 insertions(+), 14 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e4f20f8e4..f0686ba0c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,6 +56,12 @@ importers: arweave: specifier: ^1.15.7 version: 1.15.7 + autoevals: + specifier: ^0.0.129 + version: 0.0.129(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + braintrust: + specifier: ^0.4.9 + version: 0.4.10(zod@4.1.13) bullmq: specifier: ^5.65.1 version: 5.65.1 @@ -146,13 +152,13 @@ importers: version: 3.5.2 tailwindcss: specifier: ^3.4.1 - version: 3.4.18 + version: 3.4.18(yaml@2.8.2) typescript: specifier: ^5 version: 5.9.3 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(@types/node@20.19.25)(jiti@1.21.7) + version: 3.2.4(@types/debug@4.1.12)(@types/node@20.19.25)(jiti@1.21.7)(yaml@2.8.2) packages: @@ -223,6 +229,10 @@ packages: peerDependencies: zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/provider@1.1.3': + resolution: {integrity: sha512-qZMxYJ0qqX/RfnuIaab+zp8UAeJn/ygXXAffR5I4N0n1IrvA6qBsjc8hXLmBiMV2zoXlifkacF7sEFnYnjBcqg==} + engines: {node: '>=18'} + '@ai-sdk/provider@2.0.0': resolution: {integrity: sha512-6o7Y2SeO9vFKB8lArHXehNuusnpddKPk7xqL7T2/b+OvXMRIXUO1rR4wcv1hAFUAT9avGZshty3Wlua/XA7TvA==} engines: {node: '>=18'} @@ -248,6 +258,11 @@ packages: '@apify/utilities@2.24.0': resolution: {integrity: sha512-tc1lH0T4C0KOrCFKy4+pP/bj0VkAKUOqG1Unyyz0ddKv2b8R1PKxboEx2sGDZSHxCLA+nbk/kC2jgIvGqen2KA==} + '@asteasolutions/zod-to-openapi@6.4.0': + resolution: {integrity: sha512-8cxfF7AHHx2PqnN4Cd8/O8CBu/nVYJP9DpnfVLW3BFb66VJDnqI/CczZnkqMc3SNh6J9GiX7JbJ5T4BSP4HZ2Q==} + peerDependencies: + zod: ^3.20.2 + '@babel/runtime@7.28.4': resolution: {integrity: sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==} engines: {node: '>=6.9.0'} @@ -255,6 +270,9 @@ packages: '@base-org/account@2.4.0': resolution: {integrity: sha512-A4Umpi8B9/pqR78D1Yoze4xHyQaujioVRqqO3d6xuDFw9VRtjg6tK3bPlwE0aW+nVH/ntllCpPa2PbI8Rnjcug==} + '@braintrust/core@0.0.87': + resolution: {integrity: sha512-yKo+2McKBcluVUq+5qoYI7QfGvqZ7c0ftTOmnRSToBR2RqGyHkClnnQZ3+M8Guuk9NEKJu92UMTTaR9AonIvvA==} + '@bugsnag/cuid@3.2.1': resolution: {integrity: sha512-zpvN8xQ5rdRWakMd/BcVkdn2F8HKlDSbM3l7duueK590WmI1T0ObTLc1V/1e55r14WNjPd5AJTYX4yPEAFVi+Q==} @@ -325,156 +343,312 @@ packages: resolution: {integrity: sha512-YAdE/IJSpwbOTiaURNCKECdAwqrJuFiZhylmesBcIRawtYKnBR2wxPhoIewMg+Yu+QuYvHfJNReWpoxGBKOChA==} engines: {node: '>=18'} + '@esbuild/aix-ppc64@0.25.12': + resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + '@esbuild/aix-ppc64@0.27.2': resolution: {integrity: sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] + '@esbuild/android-arm64@0.25.12': + resolution: {integrity: sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm64@0.27.2': resolution: {integrity: sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==} engines: {node: '>=18'} cpu: [arm64] os: [android] + '@esbuild/android-arm@0.25.12': + resolution: {integrity: sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + '@esbuild/android-arm@0.27.2': resolution: {integrity: sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==} engines: {node: '>=18'} cpu: [arm] os: [android] + '@esbuild/android-x64@0.25.12': + resolution: {integrity: sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + '@esbuild/android-x64@0.27.2': resolution: {integrity: sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==} engines: {node: '>=18'} cpu: [x64] os: [android] + '@esbuild/darwin-arm64@0.25.12': + resolution: {integrity: sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-arm64@0.27.2': resolution: {integrity: sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] + '@esbuild/darwin-x64@0.25.12': + resolution: {integrity: sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + '@esbuild/darwin-x64@0.27.2': resolution: {integrity: sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==} engines: {node: '>=18'} cpu: [x64] os: [darwin] + '@esbuild/freebsd-arm64@0.25.12': + resolution: {integrity: sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-arm64@0.27.2': resolution: {integrity: sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-x64@0.25.12': + resolution: {integrity: sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + '@esbuild/freebsd-x64@0.27.2': resolution: {integrity: sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] + '@esbuild/linux-arm64@0.25.12': + resolution: {integrity: sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm64@0.27.2': resolution: {integrity: sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==} engines: {node: '>=18'} cpu: [arm64] os: [linux] + '@esbuild/linux-arm@0.25.12': + resolution: {integrity: sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + '@esbuild/linux-arm@0.27.2': resolution: {integrity: sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==} engines: {node: '>=18'} cpu: [arm] os: [linux] + '@esbuild/linux-ia32@0.25.12': + resolution: {integrity: sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-ia32@0.27.2': resolution: {integrity: sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==} engines: {node: '>=18'} cpu: [ia32] os: [linux] + '@esbuild/linux-loong64@0.25.12': + resolution: {integrity: sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-loong64@0.27.2': resolution: {integrity: sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==} engines: {node: '>=18'} cpu: [loong64] os: [linux] + '@esbuild/linux-mips64el@0.25.12': + resolution: {integrity: sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-mips64el@0.27.2': resolution: {integrity: sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] + '@esbuild/linux-ppc64@0.25.12': + resolution: {integrity: sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-ppc64@0.27.2': resolution: {integrity: sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] + '@esbuild/linux-riscv64@0.25.12': + resolution: {integrity: sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-riscv64@0.27.2': resolution: {integrity: sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] + '@esbuild/linux-s390x@0.25.12': + resolution: {integrity: sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-s390x@0.27.2': resolution: {integrity: sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==} engines: {node: '>=18'} cpu: [s390x] os: [linux] + '@esbuild/linux-x64@0.25.12': + resolution: {integrity: sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + '@esbuild/linux-x64@0.27.2': resolution: {integrity: sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==} engines: {node: '>=18'} cpu: [x64] os: [linux] + '@esbuild/netbsd-arm64@0.25.12': + resolution: {integrity: sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + '@esbuild/netbsd-arm64@0.27.2': resolution: {integrity: sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] + '@esbuild/netbsd-x64@0.25.12': + resolution: {integrity: sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + '@esbuild/netbsd-x64@0.27.2': resolution: {integrity: sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] + '@esbuild/openbsd-arm64@0.25.12': + resolution: {integrity: sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + '@esbuild/openbsd-arm64@0.27.2': resolution: {integrity: sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] + '@esbuild/openbsd-x64@0.25.12': + resolution: {integrity: sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + '@esbuild/openbsd-x64@0.27.2': resolution: {integrity: sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] + '@esbuild/openharmony-arm64@0.25.12': + resolution: {integrity: sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + '@esbuild/openharmony-arm64@0.27.2': resolution: {integrity: sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] + '@esbuild/sunos-x64@0.25.12': + resolution: {integrity: sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + '@esbuild/sunos-x64@0.27.2': resolution: {integrity: sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==} engines: {node: '>=18'} cpu: [x64] os: [sunos] + '@esbuild/win32-arm64@0.25.12': + resolution: {integrity: sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-arm64@0.27.2': resolution: {integrity: sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==} engines: {node: '>=18'} cpu: [arm64] os: [win32] + '@esbuild/win32-ia32@0.25.12': + resolution: {integrity: sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-ia32@0.27.2': resolution: {integrity: sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==} engines: {node: '>=18'} cpu: [ia32] os: [win32] + '@esbuild/win32-x64@0.25.12': + resolution: {integrity: sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@esbuild/win32-x64@0.27.2': resolution: {integrity: sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==} engines: {node: '>=18'} @@ -732,6 +906,12 @@ packages: '@jsonhero/path@1.0.21': resolution: {integrity: sha512-gVUDj/92acpVoJwsVJ/RuWOaHyG4oFzn898WNGQItLCTQ+hOaVlEaImhwE1WqOTf+l3dGOUkbSiVKlb3q1hd1Q==} + '@kwsites/file-exists@1.1.1': + resolution: {integrity: sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==} + + '@kwsites/promise-deferred@1.1.1': + resolution: {integrity: sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==} + '@lit-labs/ssr-dom-shim@1.4.0': resolution: {integrity: sha512-ficsEARKnmmW5njugNYKipTm4SFnbik7CXtoencDZzmzo/dQ+2Q0bgkzJuoJP20Aj0F+izzJjOqsnkd6F/o1bw==} @@ -864,6 +1044,9 @@ packages: '@napi-rs/wasm-runtime@0.2.12': resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==} + '@next/env@14.2.35': + resolution: {integrity: sha512-DuhvCtj4t9Gwrx80dmz2F4t/zKQ4ktN8WrMwOuVzkJfBilwAwGr6v16M5eI8yCuZ63H9TTuEU09Iu2HqkzFPVQ==} + '@next/env@16.0.7': resolution: {integrity: sha512-gpaNgUh5nftFKRkRQGnVi5dpcYSKGcZZkQffZ172OrG/XkrnS7UBTQ648YY+8ME92cC4IojpI2LqTC8sTDhAaw==} @@ -1954,9 +2137,15 @@ packages: '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} + '@types/node-fetch@2.6.13': + resolution: {integrity: sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw==} + '@types/node@12.20.55': resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} + '@types/node@18.19.130': + resolution: {integrity: sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==} + '@types/node@20.19.25': resolution: {integrity: sha512-ZsJzA5thDQMSQO788d7IocwwQbI8B5OPzmqNvpf3NY/+MHDAS759Wo0gd2WQeXYt5AAAQjzcrTVC6SKCuYgoCQ==} @@ -2140,6 +2329,15 @@ packages: cpu: [x64] os: [win32] + '@vercel/functions@1.6.0': + resolution: {integrity: sha512-R6FKQrYT5MZs5IE1SqeCJWxMuBdHawFcCZboKKw8p7s+6/mcd55Gx6tWmyKnQTyrSEA04NH73Tc9CbqpEle8RA==} + engines: {node: '>= 16'} + peerDependencies: + '@aws-sdk/credential-provider-web-identity': '*' + peerDependenciesMeta: + '@aws-sdk/credential-provider-web-identity': + optional: true + '@vercel/oidc@3.0.5': resolution: {integrity: sha512-fnYhv671l+eTTp48gB4zEsTW/YtRgRPnkI2nT7x6qw5rkI1Lq2hTmQIpHPgyThI0znLK+vX2n9XxKdXZ7BUbbw==} engines: {node: '>= 20'} @@ -2343,6 +2541,10 @@ packages: zod: optional: true + abort-controller@3.0.0: + resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} + engines: {node: '>=6.5'} + accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} @@ -2445,6 +2647,9 @@ packages: resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==} engines: {node: '>= 0.4'} + array-flatten@1.1.1: + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + array-includes@3.1.9: resolution: {integrity: sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==} engines: {node: '>= 0.4'} @@ -2515,6 +2720,9 @@ packages: resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} engines: {node: '>=8.0.0'} + autoevals@0.0.129: + resolution: {integrity: sha512-LhrPnh/3dcOdlqLeEXfaUGwwGMYggO1rsYb4sc8N5H7wX+5IYd14N3xXDQlNqlny9DJRkzvd/lvSDhBvrmA0rw==} + available-typed-arrays@1.0.7: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} @@ -2570,6 +2778,9 @@ packages: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} + binary-search@1.3.6: + resolution: {integrity: sha512-nbE1WxOTTrUWIfsfZ4aHGYu5DOuNkbxGokjV6Z2kxfJK3uaAb8zNK1muzOeipoLHZjInT4Br88BHpzevc681xA==} + bintrees@1.0.2: resolution: {integrity: sha512-VOMgTMwjAaUG580SXn3LacVgjurrbMme7ZZNYGSSV7mmtY6QQRh0Eg3pwIcntQ77DErK1L0NxkbetjcoXzVwKw==} @@ -2585,6 +2796,10 @@ packages: bn.js@5.2.2: resolution: {integrity: sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw==} + body-parser@1.20.4: + resolution: {integrity: sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + body-parser@2.2.1: resolution: {integrity: sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw==} engines: {node: '>=18'} @@ -2605,6 +2820,12 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} + braintrust@0.4.10: + resolution: {integrity: sha512-Dk4aVsHWjgeTyGcM056vleXZGLz3qIHw6rDYP4iyY4DOZeD6JSDGSepGb1dulpcwqf2WC6w9XIFTF7Y/4gfahg==} + hasBin: true + peerDependencies: + zod: ^3.25.34 + bs58@4.0.1: resolution: {integrity: sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==} @@ -2685,6 +2906,9 @@ packages: resolution: {integrity: sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==} engines: {node: '>= 16'} + cheminfo-types@1.10.0: + resolution: {integrity: sha512-lDoOWfctAQPQrrhydtdb2vV3S8RDuRNp62lzs/gIjNqMNubhsvqr+hI8XQJSy8X1ZXpGvzIQNGBYy4SVrKQNaQ==} + chokidar@3.6.0: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} @@ -2696,6 +2920,10 @@ packages: cjs-module-lexer@1.4.3: resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==} + cli-progress@3.12.0: + resolution: {integrity: sha512-tRkV3HJ1ASwm19THiiLIXLO7Im7wlTuKnvkYaTkyoAPefqjNg7W7DHKUlGRxy9vxDvbyCYQkQozvptuMkGCg8A==} + engines: {node: '>=4'} + client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} @@ -2748,9 +2976,22 @@ packages: resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==} engines: {node: '>= 12.0.0'} + compute-cosine-similarity@1.1.0: + resolution: {integrity: sha512-FXhNx0ILLjGi9Z9+lglLzM12+0uoTnYkHm7GiadXDAr0HGVLm25OivUS1B/LPkbzzvlcXz/1EvWg9ZYyJSdhTw==} + + compute-dot@1.1.0: + resolution: {integrity: sha512-L5Ocet4DdMrXboss13K59OK23GXjiSia7+7Ukc7q4Bl+RVpIXK2W9IHMbWDZkh+JUEvJAwOKRaJDiFUa1LTnJg==} + + compute-l2norm@1.1.0: + resolution: {integrity: sha512-6EHh1Elj90eU28SXi+h2PLnTQvZmkkHWySpoFz+WOlVNLz3DQoC4ISUHSV9n5jMxPHtKGJ01F4uu2PsXBB8sSg==} + concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + content-disposition@0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + content-disposition@1.0.1: resolution: {integrity: sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==} engines: {node: '>=18'} @@ -2762,6 +3003,9 @@ packages: cookie-es@1.2.2: resolution: {integrity: sha512-+W7VmiVINB+ywl1HGXJXmrqkOhpKrIiVZV6tQuV54ZyQC7MMuBt81Vc336GMLoHBq5hV/F9eXgt5Mnx0Rha5Fg==} + cookie-signature@1.0.7: + resolution: {integrity: sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==} + cookie-signature@1.2.2: resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==} engines: {node: '>=6.6.0'} @@ -2855,6 +3099,14 @@ packages: dayjs@1.11.13: resolution: {integrity: sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==} + debug@2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + debug@3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -2935,6 +3187,10 @@ packages: destr@2.0.5: resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + destroy@1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + detect-browser@5.3.0: resolution: {integrity: sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w==} @@ -2959,6 +3215,10 @@ packages: resolution: {integrity: sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==} engines: {node: '>=10'} + dotenv@16.6.1: + resolution: {integrity: sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==} + engines: {node: '>=12'} + dunder-proto@1.0.1: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} @@ -3056,6 +3316,11 @@ packages: es6-promisify@5.0.0: resolution: {integrity: sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==} + esbuild@0.25.12: + resolution: {integrity: sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==} + engines: {node: '>=18'} + hasBin: true + esbuild@0.27.2: resolution: {integrity: sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==} engines: {node: '>=18'} @@ -3228,6 +3493,10 @@ packages: ethereum-cryptography@2.2.1: resolution: {integrity: sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==} + event-target-shim@5.0.1: + resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} + engines: {node: '>=6'} + eventemitter2@6.4.9: resolution: {integrity: sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg==} @@ -3241,6 +3510,10 @@ packages: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} + eventsource-parser@1.1.2: + resolution: {integrity: sha512-v0eOBUbiaFojBu2s2NPBfYUoRR9GjcDNvCXVaqEf5vVfpIAh9f8RCo4vXTP8c63QRKCFwoLpMpTdPwwhEKVgzA==} + engines: {node: '>=14.18'} + eventsource-parser@3.0.6: resolution: {integrity: sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==} engines: {node: '>=18.0.0'} @@ -3266,6 +3539,10 @@ packages: peerDependencies: express: '>= 4.11' + express@4.22.1: + resolution: {integrity: sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==} + engines: {node: '>= 0.10.0'} + express@5.2.1: resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} engines: {node: '>= 18'} @@ -3340,6 +3617,9 @@ packages: resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} engines: {node: ^12.20 || >= 14.13} + fft.js@4.0.4: + resolution: {integrity: sha512-f9c00hphOgeQTlDyavwTtu6RiK8AIFjD6+jvXkNkpeQ7rirK3uFWVpalkoS4LAwbdX7mfZ8aoBfFVQX1Re/8aw==} + file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} @@ -3356,6 +3636,10 @@ packages: resolution: {integrity: sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==} engines: {node: '>=0.10.0'} + finalhandler@1.3.2: + resolution: {integrity: sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==} + engines: {node: '>= 0.8'} + finalhandler@2.1.1: resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==} engines: {node: '>= 18.0.0'} @@ -3395,6 +3679,9 @@ packages: forever-agent@0.6.1: resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} + form-data-encoder@1.7.2: + resolution: {integrity: sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==} + form-data@2.3.3: resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==} engines: {node: '>= 0.12'} @@ -3403,6 +3690,10 @@ packages: resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} engines: {node: '>= 6'} + formdata-node@4.4.1: + resolution: {integrity: sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==} + engines: {node: '>= 12.20'} + formdata-polyfill@4.0.10: resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} engines: {node: '>=12.20.0'} @@ -3411,6 +3702,10 @@ packages: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} + fresh@0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + fresh@2.0.0: resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} engines: {node: '>= 0.8'} @@ -3512,6 +3807,9 @@ packages: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} @@ -3592,6 +3890,10 @@ packages: resolution: {integrity: sha512-kmgmea2nguZEvRqW79gDqNXyxA3OS5WIgMVffrHpqXV4F/J4UmNIw2vstixioLTNSkd5rFB8G0s3Lwzogm6OFw==} engines: {node: '>=20.0.0'} + iconv-lite@0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + iconv-lite@0.7.0: resolution: {integrity: sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==} engines: {node: '>=0.10.0'} @@ -3642,6 +3944,9 @@ packages: iron-webcrypto@1.2.1: resolution: {integrity: sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==} + is-any-array@2.0.1: + resolution: {integrity: sha512-UtilS7hLRu++wb/WBAw9bNuP1Eg04Ivn1vERJck8zJthEvXCBEBpGR/33u/xLKWEQf95803oalHrVDptcAvFdQ==} + is-arguments@1.2.0: resolution: {integrity: sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==} engines: {node: '>= 0.4'} @@ -3835,6 +4140,10 @@ packages: jose@6.1.2: resolution: {integrity: sha512-MpcPtHLE5EmztuFIqB0vzHAWJPpmN1E6L4oo+kze56LIs3MyXIj9ZHMDxqOvkP38gBR7K1v3jqd4WU2+nrfONQ==} + js-levenshtein@1.1.6: + resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==} + engines: {node: '>=0.10.0'} + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -3927,6 +4236,9 @@ packages: resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} engines: {node: '>=14'} + linear-sum-assignment@1.0.9: + resolution: {integrity: sha512-1T2Ek3sxpt2mBHeBFMRJEikiIK/yIOwf+mrxv/DkAU/5ddnCMndZL//hFH7QuHa1tbaQADzsf9t7rkGZKqoFfQ==} + lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} @@ -4009,10 +4321,17 @@ packages: md5@2.3.0: resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==} + media-typer@0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + media-typer@1.1.0: resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==} engines: {node: '>= 0.8'} + merge-descriptors@1.0.3: + resolution: {integrity: sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==} + merge-descriptors@2.0.0: resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==} engines: {node: '>=18'} @@ -4024,6 +4343,10 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + methods@1.1.2: + resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} + engines: {node: '>= 0.6'} + micro-ftch@0.3.1: resolution: {integrity: sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==} @@ -4084,9 +4407,30 @@ packages: typescript: optional: true + ml-array-max@1.2.4: + resolution: {integrity: sha512-BlEeg80jI0tW6WaPyGxf5Sa4sqvcyY6lbSn5Vcv44lp1I2GR6AWojfUvLnGTNsIXrZ8uqWmo8VcG1WpkI2ONMQ==} + + ml-array-min@1.2.3: + resolution: {integrity: sha512-VcZ5f3VZ1iihtrGvgfh/q0XlMobG6GQ8FsNyQXD3T+IlstDv85g8kfV0xUG1QPRO/t21aukaJowDzMTc7j5V6Q==} + + ml-array-rescale@1.3.7: + resolution: {integrity: sha512-48NGChTouvEo9KBctDfHC3udWnQKNKEWN0ziELvY3KG25GR5cA8K8wNVzracsqSW1QEkAXjTNx+ycgAv06/1mQ==} + + ml-matrix@6.12.1: + resolution: {integrity: sha512-TJ+8eOFdp+INvzR4zAuwBQJznDUfktMtOB6g/hUcGh3rcyjxbz4Te57Pgri8Q9bhSQ7Zys4IYOGhFdnlgeB6Lw==} + + ml-spectra-processing@14.19.0: + resolution: {integrity: sha512-PbvRh/cFneCDY629qpURsaq58oz0pF+TM8w5lLtvAVfZmA6QOHEf5eh93n73HXS7HgkAzLJNXnKefCW8kSBmKQ==} + + ml-xsadd@3.0.1: + resolution: {integrity: sha512-Fz2q6dwgzGM8wYKGArTUTZDGa4lQFA2Vi6orjGeTVRy22ZnQFKlJuwS9n8NRviqz1KHAHAzdKJwbnYhdo38uYg==} + module-details-from-path@1.0.4: resolution: {integrity: sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==} + ms@2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -4106,6 +4450,10 @@ packages: multiformats@9.9.0: resolution: {integrity: sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==} + mustache@4.2.0: + resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} + hasBin: true + mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} @@ -4265,6 +4613,18 @@ packages: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} + openai@4.104.0: + resolution: {integrity: sha512-p99EFNsA/yX6UhVO93f5kJsDRLAg+CTA2RBqdHK4RtK8u5IJw32Hyb2dTGKbnnFmnuoBv5r7Z2CURI9sGZpSuA==} + hasBin: true + peerDependencies: + ws: ^8.18.0 + zod: ^3.23.8 + peerDependenciesMeta: + ws: + optional: true + zod: + optional: true + openai@5.23.2: resolution: {integrity: sha512-MQBzmTulj+MM5O8SKEk/gL8a7s5mktS9zUtAkU257WjvobGc9nKcBuVwjyEEcb9SI8a8Y2G/mzn3vm9n1Jlleg==} hasBin: true @@ -4283,6 +4643,9 @@ packages: openapi-typescript-helpers@0.0.15: resolution: {integrity: sha512-opyTPaunsklCBpTK8JGef6mfPhLSnyy5a0IN9vKtx3+4aExf+KxEqYwIy3hqkedXIB97u357uLMJsOnm3GVjsw==} + openapi3-ts@4.5.0: + resolution: {integrity: sha512-jaL+HgTq2Gj5jRcfdutgRGLosCy/hT8sQf6VOy+P+g36cZOjI1iukdPnijC+4CmeRzg/jEllJUboEic2FhxhtQ==} + optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -4383,6 +4746,9 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} + path-to-regexp@0.1.12: + resolution: {integrity: sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==} + path-to-regexp@8.3.0: resolution: {integrity: sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==} @@ -4437,6 +4803,10 @@ packages: resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==} engines: {node: '>=16.20.0'} + pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + pngjs@5.0.0: resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} engines: {node: '>=10.13.0'} @@ -4627,6 +4997,10 @@ packages: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} engines: {node: '>= 0.6'} + raw-body@2.5.3: + resolution: {integrity: sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==} + engines: {node: '>= 0.8'} + raw-body@3.0.2: resolution: {integrity: sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==} engines: {node: '>= 0.10'} @@ -4805,10 +5179,18 @@ packages: engines: {node: '>=10'} hasBin: true + send@0.19.2: + resolution: {integrity: sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==} + engines: {node: '>= 0.8.0'} + send@1.2.0: resolution: {integrity: sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==} engines: {node: '>= 18'} + serve-static@1.16.3: + resolution: {integrity: sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==} + engines: {node: '>= 0.8.0'} + serve-static@2.2.0: resolution: {integrity: sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==} engines: {node: '>= 18'} @@ -4871,9 +5253,16 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + simple-git@3.30.0: + resolution: {integrity: sha512-q6lxyDsCmEal/MEGhP1aVyQ3oxnagGlBDOVSIB4XUVLl1iZh0Pah6ebC9V4xBap/RfgP2WlI8EKs0WS0rMEJHg==} + slug@6.1.0: resolution: {integrity: sha512-x6vLHCMasg4DR2LPiyFGI0gJJhywY6DTiGhCrOMzb3SOk/0JVLIaL4UhyFSHu04SD3uAavrKY/K3zZ3i6iRcgA==} + slugify@1.6.6: + resolution: {integrity: sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==} + engines: {node: '>=8.0.0'} + socket.io-adapter@2.5.5: resolution: {integrity: sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==} @@ -4900,6 +5289,10 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} + source-map@0.7.6: + resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==} + engines: {node: '>= 12'} + spdx-exceptions@2.5.0: resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} @@ -5182,6 +5575,10 @@ packages: resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} engines: {node: '>=16'} + type-is@1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + type-is@2.0.1: resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==} engines: {node: '>= 0.6'} @@ -5224,6 +5621,9 @@ packages: uncrypto@0.1.3: resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} + undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} @@ -5332,6 +5732,10 @@ packages: util@0.12.5: resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} + utils-merge@1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + uuid@10.0.0: resolution: {integrity: sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==} hasBin: true @@ -5361,6 +5765,12 @@ packages: resolution: {integrity: sha512-sgECfZthyaCKW10N0fm27cg8HYTFK5qMWgypqkXMQ4Wbl/zZKx7xZICgcoxIIE+WFAP/MBL2EFwC/YvLxw3Zeg==} engines: {node: '>=0.10.0'} + validate.io-array@1.0.6: + resolution: {integrity: sha512-DeOy7CnPEziggrOO5CZhVKJw6S3Yi7e9e65R1Nl/RTN1vTQKnzjfvks0/8kQ40FP/dsjRAOd4hxmJ7uLa6vxkg==} + + validate.io-function@1.0.2: + resolution: {integrity: sha512-LlFybRJEriSuBnUhQyG5bwglhh50EpTL2ul23MPIuR1odjO7XaMLFV8vHGwp7AZciFxtYOeiSCT5st+XSPONiQ==} + valtio@1.13.2: resolution: {integrity: sha512-Qik0o+DSy741TmkqmRfjq+0xpZBXi/Y6+fXZLn0xNF1z/waFMbE3rkivv5Zcf9RrMUp6zswf2J7sbh2KBlba5A==} engines: {node: '>=12.20.0'} @@ -5485,6 +5895,10 @@ packages: resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} engines: {node: '>= 8'} + web-streams-polyfill@4.0.0-beta.3: + resolution: {integrity: sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==} + engines: {node: '>= 14'} + webextension-polyfill@0.10.0: resolution: {integrity: sha512-c5s35LgVa5tFaHhrZDnr3FpQpjj1BB+RXhLTYUxGqBVN460HkbM8TBtEqdXWbpTKfzwCcjAZVF7zXCYSKtcp9g==} @@ -5619,6 +6033,11 @@ packages: yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + yaml@2.8.2: + resolution: {integrity: sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==} + engines: {node: '>= 14.6'} + hasBin: true + yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} engines: {node: '>=6'} @@ -5776,6 +6195,10 @@ snapshots: eventsource-parser: 3.0.6 zod: 4.1.13 + '@ai-sdk/provider@1.1.3': + dependencies: + json-schema: 0.4.0 + '@ai-sdk/provider@2.0.0': dependencies: json-schema: 0.4.0 @@ -5802,6 +6225,11 @@ snapshots: '@apify/consts': 2.48.0 '@apify/log': 2.5.28 + '@asteasolutions/zod-to-openapi@6.4.0(zod@3.25.76)': + dependencies: + openapi3-ts: 4.5.0 + zod: 3.25.76 + '@babel/runtime@7.28.4': {} '@base-org/account@2.4.0(@types/react@19.2.7)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(react@19.2.1)(typescript@5.9.3)(use-sync-external-store@1.4.0(react@19.2.1))(utf-8-validate@5.0.10)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76)': @@ -5829,6 +6257,12 @@ snapshots: - ws - zod + '@braintrust/core@0.0.87': + dependencies: + '@asteasolutions/zod-to-openapi': 6.4.0(zod@3.25.76) + uuid: 9.0.1 + zod: 3.25.76 + '@bugsnag/cuid@3.2.1': {} '@coinbase/cdp-sdk@1.38.6(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@5.0.10)(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))': @@ -6028,81 +6462,159 @@ snapshots: esquery: 1.6.0 jsdoc-type-pratt-parser: 4.1.0 + '@esbuild/aix-ppc64@0.25.12': + optional: true + '@esbuild/aix-ppc64@0.27.2': optional: true + '@esbuild/android-arm64@0.25.12': + optional: true + '@esbuild/android-arm64@0.27.2': optional: true + '@esbuild/android-arm@0.25.12': + optional: true + '@esbuild/android-arm@0.27.2': optional: true + '@esbuild/android-x64@0.25.12': + optional: true + '@esbuild/android-x64@0.27.2': optional: true + '@esbuild/darwin-arm64@0.25.12': + optional: true + '@esbuild/darwin-arm64@0.27.2': optional: true + '@esbuild/darwin-x64@0.25.12': + optional: true + '@esbuild/darwin-x64@0.27.2': optional: true + '@esbuild/freebsd-arm64@0.25.12': + optional: true + '@esbuild/freebsd-arm64@0.27.2': optional: true + '@esbuild/freebsd-x64@0.25.12': + optional: true + '@esbuild/freebsd-x64@0.27.2': optional: true + '@esbuild/linux-arm64@0.25.12': + optional: true + '@esbuild/linux-arm64@0.27.2': optional: true + '@esbuild/linux-arm@0.25.12': + optional: true + '@esbuild/linux-arm@0.27.2': optional: true + '@esbuild/linux-ia32@0.25.12': + optional: true + '@esbuild/linux-ia32@0.27.2': optional: true + '@esbuild/linux-loong64@0.25.12': + optional: true + '@esbuild/linux-loong64@0.27.2': optional: true + '@esbuild/linux-mips64el@0.25.12': + optional: true + '@esbuild/linux-mips64el@0.27.2': optional: true + '@esbuild/linux-ppc64@0.25.12': + optional: true + '@esbuild/linux-ppc64@0.27.2': optional: true + '@esbuild/linux-riscv64@0.25.12': + optional: true + '@esbuild/linux-riscv64@0.27.2': optional: true + '@esbuild/linux-s390x@0.25.12': + optional: true + '@esbuild/linux-s390x@0.27.2': optional: true + '@esbuild/linux-x64@0.25.12': + optional: true + '@esbuild/linux-x64@0.27.2': optional: true + '@esbuild/netbsd-arm64@0.25.12': + optional: true + '@esbuild/netbsd-arm64@0.27.2': optional: true + '@esbuild/netbsd-x64@0.25.12': + optional: true + '@esbuild/netbsd-x64@0.27.2': optional: true + '@esbuild/openbsd-arm64@0.25.12': + optional: true + '@esbuild/openbsd-arm64@0.27.2': optional: true + '@esbuild/openbsd-x64@0.25.12': + optional: true + '@esbuild/openbsd-x64@0.27.2': optional: true + '@esbuild/openharmony-arm64@0.25.12': + optional: true + '@esbuild/openharmony-arm64@0.27.2': optional: true + '@esbuild/sunos-x64@0.25.12': + optional: true + '@esbuild/sunos-x64@0.27.2': optional: true + '@esbuild/win32-arm64@0.25.12': + optional: true + '@esbuild/win32-arm64@0.27.2': optional: true + '@esbuild/win32-ia32@0.25.12': + optional: true + '@esbuild/win32-ia32@0.27.2': optional: true + '@esbuild/win32-x64@0.25.12': + optional: true + '@esbuild/win32-x64@0.27.2': optional: true @@ -6326,6 +6838,14 @@ snapshots: '@jsonhero/path@1.0.21': {} + '@kwsites/file-exists@1.1.1': + dependencies: + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + + '@kwsites/promise-deferred@1.1.1': {} + '@lit-labs/ssr-dom-shim@1.4.0': {} '@lit/reactive-element@2.1.1': @@ -6563,6 +7083,8 @@ snapshots: '@tybys/wasm-util': 0.10.1 optional: true + '@next/env@14.2.35': {} + '@next/env@16.0.7': {} '@next/eslint-plugin-next@15.1.7': @@ -8171,8 +8693,17 @@ snapshots: '@types/ms@2.1.0': {} + '@types/node-fetch@2.6.13': + dependencies: + '@types/node': 20.19.25 + form-data: 4.0.5 + '@types/node@12.20.55': {} + '@types/node@18.19.130': + dependencies: + undici-types: 5.26.5 + '@types/node@20.19.25': dependencies: undici-types: 6.21.0 @@ -8354,6 +8885,8 @@ snapshots: '@unrs/resolver-binding-win32-x64-msvc@1.11.1': optional: true + '@vercel/functions@1.6.0': {} + '@vercel/oidc@3.0.5': {} '@vercel/oidc@3.1.0': {} @@ -8366,13 +8899,13 @@ snapshots: chai: 5.3.3 tinyrainbow: 2.0.0 - '@vitest/mocker@3.2.4(vite@7.3.0(@types/node@20.19.25)(jiti@1.21.7))': + '@vitest/mocker@3.2.4(vite@7.3.0(@types/node@20.19.25)(jiti@1.21.7)(yaml@2.8.2))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 7.3.0(@types/node@20.19.25)(jiti@1.21.7) + vite: 7.3.0(@types/node@20.19.25)(jiti@1.21.7)(yaml@2.8.2) '@vitest/pretty-format@3.2.4': dependencies: @@ -9056,6 +9589,10 @@ snapshots: typescript: 5.9.3 zod: 4.1.13 + abort-controller@3.0.0: + dependencies: + event-target-shim: 5.0.1 + accepts@1.3.8: dependencies: mime-types: 2.1.35 @@ -9164,6 +9701,8 @@ snapshots: call-bound: 1.0.4 is-array-buffer: 3.0.5 + array-flatten@1.1.1: {} + array-includes@3.1.9: dependencies: call-bind: 1.0.8 @@ -9273,6 +9812,22 @@ snapshots: atomic-sleep@1.0.0: {} + autoevals@0.0.129(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10)): + dependencies: + '@braintrust/core': 0.0.87 + ajv: 8.17.1 + compute-cosine-similarity: 1.1.0 + js-levenshtein: 1.1.6 + js-yaml: 4.1.1 + linear-sum-assignment: 1.0.9 + mustache: 4.2.0 + openai: 4.104.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76) + zod: 3.25.76 + zod-to-json-schema: 3.25.0(zod@3.25.76) + transitivePeerDependencies: + - encoding + - ws + available-typed-arrays@1.0.7: dependencies: possible-typed-array-names: 1.1.0 @@ -9320,6 +9875,8 @@ snapshots: binary-extensions@2.3.0: {} + binary-search@1.3.6: {} + bintrees@1.0.2: {} bl@1.2.3: @@ -9333,6 +9890,23 @@ snapshots: bn.js@5.2.2: {} + body-parser@1.20.4: + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.1 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.14.0 + raw-body: 2.5.3 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + body-parser@2.2.1: dependencies: bytes: 3.1.2 @@ -9368,6 +9942,34 @@ snapshots: dependencies: fill-range: 7.1.1 + braintrust@0.4.10(zod@4.1.13): + dependencies: + '@ai-sdk/provider': 1.1.3 + '@next/env': 14.2.35 + '@vercel/functions': 1.6.0 + argparse: 2.0.1 + chalk: 4.1.2 + cli-progress: 3.12.0 + cors: 2.8.5 + dotenv: 16.6.1 + esbuild: 0.25.12 + eventsource-parser: 1.1.2 + express: 4.22.1 + graceful-fs: 4.2.11 + http-errors: 2.0.1 + minimatch: 9.0.5 + mustache: 4.2.0 + pluralize: 8.0.0 + simple-git: 3.30.0 + slugify: 1.6.6 + source-map: 0.7.6 + uuid: 9.0.1 + zod: 4.1.13 + zod-to-json-schema: 3.25.0(zod@4.1.13) + transitivePeerDependencies: + - '@aws-sdk/credential-provider-web-identity' + - supports-color + bs58@4.0.1: dependencies: base-x: 3.0.11 @@ -9451,6 +10053,8 @@ snapshots: check-error@2.1.3: {} + cheminfo-types@1.10.0: {} + chokidar@3.6.0: dependencies: anymatch: 3.1.3 @@ -9469,6 +10073,10 @@ snapshots: cjs-module-lexer@1.4.3: {} + cli-progress@3.12.0: + dependencies: + string-width: 4.2.3 + client-only@0.0.1: {} cliui@6.0.0: @@ -9505,14 +10113,37 @@ snapshots: comment-parser@1.4.1: {} + compute-cosine-similarity@1.1.0: + dependencies: + compute-dot: 1.1.0 + compute-l2norm: 1.1.0 + validate.io-array: 1.0.6 + validate.io-function: 1.0.2 + + compute-dot@1.1.0: + dependencies: + validate.io-array: 1.0.6 + validate.io-function: 1.0.2 + + compute-l2norm@1.1.0: + dependencies: + validate.io-array: 1.0.6 + validate.io-function: 1.0.2 + concat-map@0.0.1: {} + content-disposition@0.5.4: + dependencies: + safe-buffer: 5.2.1 + content-disposition@1.0.1: {} content-type@1.0.5: {} cookie-es@1.2.2: {} + cookie-signature@1.0.7: {} + cookie-signature@1.2.2: {} cookie@0.4.2: {} @@ -9600,6 +10231,10 @@ snapshots: dayjs@1.11.13: {} + debug@2.6.9: + dependencies: + ms: 2.0.0 + debug@3.2.7: dependencies: ms: 2.1.3 @@ -9650,6 +10285,8 @@ snapshots: destr@2.0.5: {} + destroy@1.2.0: {} + detect-browser@5.3.0: {} detect-libc@2.1.2: {} @@ -9668,6 +10305,8 @@ snapshots: dependencies: is-obj: 2.0.0 + dotenv@16.6.1: {} + dunder-proto@1.0.1: dependencies: call-bind-apply-helpers: 1.0.2 @@ -9867,6 +10506,35 @@ snapshots: dependencies: es6-promise: 4.2.8 + esbuild@0.25.12: + optionalDependencies: + '@esbuild/aix-ppc64': 0.25.12 + '@esbuild/android-arm': 0.25.12 + '@esbuild/android-arm64': 0.25.12 + '@esbuild/android-x64': 0.25.12 + '@esbuild/darwin-arm64': 0.25.12 + '@esbuild/darwin-x64': 0.25.12 + '@esbuild/freebsd-arm64': 0.25.12 + '@esbuild/freebsd-x64': 0.25.12 + '@esbuild/linux-arm': 0.25.12 + '@esbuild/linux-arm64': 0.25.12 + '@esbuild/linux-ia32': 0.25.12 + '@esbuild/linux-loong64': 0.25.12 + '@esbuild/linux-mips64el': 0.25.12 + '@esbuild/linux-ppc64': 0.25.12 + '@esbuild/linux-riscv64': 0.25.12 + '@esbuild/linux-s390x': 0.25.12 + '@esbuild/linux-x64': 0.25.12 + '@esbuild/netbsd-arm64': 0.25.12 + '@esbuild/netbsd-x64': 0.25.12 + '@esbuild/openbsd-arm64': 0.25.12 + '@esbuild/openbsd-x64': 0.25.12 + '@esbuild/openharmony-arm64': 0.25.12 + '@esbuild/sunos-x64': 0.25.12 + '@esbuild/win32-arm64': 0.25.12 + '@esbuild/win32-ia32': 0.25.12 + '@esbuild/win32-x64': 0.25.12 + esbuild@0.27.2: optionalDependencies: '@esbuild/aix-ppc64': 0.27.2 @@ -10159,6 +10827,8 @@ snapshots: '@scure/bip32': 1.4.0 '@scure/bip39': 1.3.0 + event-target-shim@5.0.1: {} + eventemitter2@6.4.9: {} eventemitter3@3.1.2: {} @@ -10167,6 +10837,8 @@ snapshots: events@3.3.0: {} + eventsource-parser@1.1.2: {} + eventsource-parser@3.0.6: {} eventsource@3.0.7: @@ -10197,6 +10869,42 @@ snapshots: dependencies: express: 5.2.1 + express@4.22.1: + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.4 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.7.2 + cookie-signature: 1.0.7 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.3.2 + fresh: 0.5.2 + http-errors: 2.0.1 + merge-descriptors: 1.0.3 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.12 + proxy-addr: 2.0.7 + qs: 6.14.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.19.2 + serve-static: 1.16.3 + setprototypeof: 1.2.0 + statuses: 2.0.2 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + express@5.2.1: dependencies: accepts: 2.0.0 @@ -10290,6 +10998,8 @@ snapshots: node-domexception: 1.0.0 web-streams-polyfill: 3.3.3 + fft.js@4.0.4: {} + file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -10302,6 +11012,18 @@ snapshots: filter-obj@1.1.0: {} + finalhandler@1.3.2: + dependencies: + debug: 2.6.9 + encodeurl: 2.0.0 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.2 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + finalhandler@2.1.1: dependencies: debug: 4.4.3 @@ -10343,6 +11065,8 @@ snapshots: forever-agent@0.6.1: {} + form-data-encoder@1.7.2: {} + form-data@2.3.3: dependencies: asynckit: 0.4.0 @@ -10357,12 +11081,19 @@ snapshots: hasown: 2.0.2 mime-types: 2.1.35 + formdata-node@4.4.1: + dependencies: + node-domexception: 1.0.0 + web-streams-polyfill: 4.0.0-beta.3 + formdata-polyfill@4.0.10: dependencies: fetch-blob: 3.2.0 forwarded@0.2.0: {} + fresh@0.5.2: {} + fresh@2.0.0: {} fsevents@2.3.3: @@ -10495,6 +11226,8 @@ snapshots: gopd@1.2.0: {} + graceful-fs@4.2.11: {} + graphemer@1.4.0: {} gtoken@8.0.0: @@ -10584,6 +11317,10 @@ snapshots: iceberg-js@0.8.0: {} + iconv-lite@0.4.24: + dependencies: + safer-buffer: 2.1.2 + iconv-lite@0.7.0: dependencies: safer-buffer: 2.1.2 @@ -10638,6 +11375,8 @@ snapshots: iron-webcrypto@1.2.1: {} + is-any-array@2.0.1: {} + is-arguments@1.2.0: dependencies: call-bound: 1.0.4 @@ -10836,6 +11575,8 @@ snapshots: jose@6.1.2: {} + js-levenshtein@1.1.6: {} + js-tokens@4.0.0: {} js-tokens@9.0.1: {} @@ -10932,6 +11673,12 @@ snapshots: lilconfig@3.1.3: {} + linear-sum-assignment@1.0.9: + dependencies: + cheminfo-types: 1.10.0 + ml-matrix: 6.12.1 + ml-spectra-processing: 14.19.0 + lines-and-columns@1.2.4: {} lit-element@4.2.1: @@ -11005,14 +11752,20 @@ snapshots: crypt: 0.0.2 is-buffer: 1.1.6 + media-typer@0.3.0: {} + media-typer@1.1.0: {} + merge-descriptors@1.0.3: {} + merge-descriptors@2.0.0: {} merge-stream@2.0.0: {} merge2@1.4.1: {} + methods@1.1.2: {} + micro-ftch@0.3.1: {} micromatch@4.0.8: @@ -11056,8 +11809,40 @@ snapshots: optionalDependencies: typescript: 5.9.3 + ml-array-max@1.2.4: + dependencies: + is-any-array: 2.0.1 + + ml-array-min@1.2.3: + dependencies: + is-any-array: 2.0.1 + + ml-array-rescale@1.3.7: + dependencies: + is-any-array: 2.0.1 + ml-array-max: 1.2.4 + ml-array-min: 1.2.3 + + ml-matrix@6.12.1: + dependencies: + is-any-array: 2.0.1 + ml-array-rescale: 1.3.7 + + ml-spectra-processing@14.19.0: + dependencies: + binary-search: 1.3.6 + cheminfo-types: 1.10.0 + fft.js: 4.0.4 + is-any-array: 2.0.1 + ml-matrix: 6.12.1 + ml-xsadd: 3.0.1 + + ml-xsadd@3.0.1: {} + module-details-from-path@1.0.4: {} + ms@2.0.0: {} + ms@2.1.2: {} ms@2.1.3: {} @@ -11082,6 +11867,8 @@ snapshots: multiformats@9.9.0: {} + mustache@4.2.0: {} + mz@2.7.0: dependencies: any-promise: 1.3.0 @@ -11244,6 +12031,21 @@ snapshots: dependencies: mimic-fn: 4.0.0 + openai@4.104.0(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@3.25.76): + dependencies: + '@types/node': 18.19.130 + '@types/node-fetch': 2.6.13 + abort-controller: 3.0.0 + agentkeepalive: 4.6.0 + form-data-encoder: 1.7.2 + formdata-node: 4.4.1 + node-fetch: 2.7.0 + optionalDependencies: + ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10) + zod: 3.25.76 + transitivePeerDependencies: + - encoding + openai@5.23.2(ws@8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10))(zod@4.1.13): optionalDependencies: ws: 8.18.3(bufferutil@4.0.9)(utf-8-validate@5.0.10) @@ -11255,6 +12057,10 @@ snapshots: openapi-typescript-helpers@0.0.15: {} + openapi3-ts@4.5.0: + dependencies: + yaml: 2.8.2 + optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -11411,6 +12217,8 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 + path-to-regexp@0.1.12: {} + path-to-regexp@8.3.0: {} pathe@2.0.3: {} @@ -11456,6 +12264,8 @@ snapshots: pkce-challenge@5.0.1: {} + pluralize@8.0.0: {} + pngjs@5.0.0: {} pony-cause@2.1.11: {} @@ -11494,12 +12304,13 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.5.6 - postcss-load-config@6.0.1(jiti@1.21.7)(postcss@8.5.6): + postcss-load-config@6.0.1(jiti@1.21.7)(postcss@8.5.6)(yaml@2.8.2): dependencies: lilconfig: 3.1.3 optionalDependencies: jiti: 1.21.7 postcss: 8.5.6 + yaml: 2.8.2 postcss-nested@6.2.0(postcss@8.5.6): dependencies: @@ -11626,6 +12437,13 @@ snapshots: range-parser@1.2.1: {} + raw-body@2.5.3: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.1 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + raw-body@3.0.2: dependencies: bytes: 3.1.2 @@ -11872,6 +12690,24 @@ snapshots: semver@7.7.3: {} + send@0.19.2: + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.1 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + send@1.2.0: dependencies: debug: 4.4.3 @@ -11888,6 +12724,15 @@ snapshots: transitivePeerDependencies: - supports-color + serve-static@1.16.3: + dependencies: + encodeurl: 2.0.0 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.19.2 + transitivePeerDependencies: + - supports-color + serve-static@2.2.0: dependencies: encodeurl: 2.0.0 @@ -11998,8 +12843,18 @@ snapshots: signal-exit@4.1.0: {} + simple-git@3.30.0: + dependencies: + '@kwsites/file-exists': 1.1.1 + '@kwsites/promise-deferred': 1.1.1 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + slug@6.1.0: {} + slugify@1.6.6: {} + socket.io-adapter@2.5.5(bufferutil@4.0.9)(utf-8-validate@5.0.10): dependencies: debug: 4.3.4 @@ -12058,6 +12913,8 @@ snapshots: source-map-js@1.2.1: {} + source-map@0.7.6: {} + spdx-exceptions@2.5.0: {} spdx-expression-parse@4.0.0: @@ -12246,7 +13103,7 @@ snapshots: dependencies: '@pkgr/core': 0.2.9 - tailwindcss@3.4.18: + tailwindcss@3.4.18(yaml@2.8.2): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -12265,7 +13122,7 @@ snapshots: postcss: 8.5.6 postcss-import: 15.1.0(postcss@8.5.6) postcss-js: 4.1.0(postcss@8.5.6) - postcss-load-config: 6.0.1(jiti@1.21.7)(postcss@8.5.6) + postcss-load-config: 6.0.1(jiti@1.21.7)(postcss@8.5.6)(yaml@2.8.2) postcss-nested: 6.2.0(postcss@8.5.6) postcss-selector-parser: 6.1.2 resolve: 1.22.11 @@ -12376,6 +13233,11 @@ snapshots: type-fest@4.41.0: {} + type-is@1.6.18: + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + type-is@2.0.1: dependencies: content-type: 1.0.5 @@ -12434,6 +13296,8 @@ snapshots: uncrypto@0.1.3: {} + undici-types@5.26.5: {} + undici-types@6.21.0: {} undici-types@7.16.0: {} @@ -12513,6 +13377,8 @@ snapshots: is-typed-array: 1.1.15 which-typed-array: 1.1.19 + utils-merge@1.0.1: {} + uuid@10.0.0: {} uuid@11.1.0: {} @@ -12527,6 +13393,10 @@ snapshots: vali-date@1.0.0: {} + validate.io-array@1.0.6: {} + + validate.io-function@1.0.2: {} + valtio@1.13.2(@types/react@19.2.7)(react@19.2.1): dependencies: derive-valtio: 0.1.0(valtio@1.13.2(@types/react@19.2.7)(react@19.2.1)) @@ -12612,13 +13482,13 @@ snapshots: - utf-8-validate - zod - vite-node@3.2.4(@types/node@20.19.25)(jiti@1.21.7): + vite-node@3.2.4(@types/node@20.19.25)(jiti@1.21.7)(yaml@2.8.2): dependencies: cac: 6.7.14 debug: 4.4.3 es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 7.3.0(@types/node@20.19.25)(jiti@1.21.7) + vite: 7.3.0(@types/node@20.19.25)(jiti@1.21.7)(yaml@2.8.2) transitivePeerDependencies: - '@types/node' - jiti @@ -12633,7 +13503,7 @@ snapshots: - tsx - yaml - vite@7.3.0(@types/node@20.19.25)(jiti@1.21.7): + vite@7.3.0(@types/node@20.19.25)(jiti@1.21.7)(yaml@2.8.2): dependencies: esbuild: 0.27.2 fdir: 6.5.0(picomatch@4.0.3) @@ -12645,12 +13515,13 @@ snapshots: '@types/node': 20.19.25 fsevents: 2.3.3 jiti: 1.21.7 + yaml: 2.8.2 - vitest@3.2.4(@types/debug@4.1.12)(@types/node@20.19.25)(jiti@1.21.7): + vitest@3.2.4(@types/debug@4.1.12)(@types/node@20.19.25)(jiti@1.21.7)(yaml@2.8.2): dependencies: '@types/chai': 5.2.3 '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(vite@7.3.0(@types/node@20.19.25)(jiti@1.21.7)) + '@vitest/mocker': 3.2.4(vite@7.3.0(@types/node@20.19.25)(jiti@1.21.7)(yaml@2.8.2)) '@vitest/pretty-format': 3.2.4 '@vitest/runner': 3.2.4 '@vitest/snapshot': 3.2.4 @@ -12668,8 +13539,8 @@ snapshots: tinyglobby: 0.2.15 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 7.3.0(@types/node@20.19.25)(jiti@1.21.7) - vite-node: 3.2.4(@types/node@20.19.25)(jiti@1.21.7) + vite: 7.3.0(@types/node@20.19.25)(jiti@1.21.7)(yaml@2.8.2) + vite-node: 3.2.4(@types/node@20.19.25)(jiti@1.21.7)(yaml@2.8.2) why-is-node-running: 2.3.0 optionalDependencies: '@types/debug': 4.1.12 @@ -12736,6 +13607,8 @@ snapshots: web-streams-polyfill@3.3.3: {} + web-streams-polyfill@4.0.0-beta.3: {} + webextension-polyfill@0.10.0: {} webidl-conversions@3.0.1: {} @@ -12994,6 +13867,8 @@ snapshots: yallist@4.0.0: {} + yaml@2.8.2: {} + yargs-parser@18.1.3: dependencies: camelcase: 5.3.1 @@ -13019,6 +13894,10 @@ snapshots: dependencies: zod: 3.25.76 + zod-to-json-schema@3.25.0(zod@3.25.76): + dependencies: + zod: 3.25.76 + zod-to-json-schema@3.25.0(zod@4.1.13): dependencies: zod: 4.1.13 From 22a54a17ed8b7bdb1afa4ca691493e0a28589ec0 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 16:40:43 -0500 Subject: [PATCH 05/15] fix: add missing dependencies for evals - Add lib/consts.ts re-export file for Recoup-Chat compatibility - Add lib/catalog/ files for catalog data fetching and formatting - Add lib/spotify/getSpotifyFollowers.ts for Spotify follower evals - Add EVAL_ACCOUNT_ID, EVAL_ACCESS_TOKEN, EVAL_ARTISTS to lib/const.ts Co-Authored-By: Claude Opus 4.5 --- lib/catalog/formatCatalogSongsAsCSV.ts | 13 +++++ lib/catalog/getCatalogDataAsCSV.ts | 29 +++++++++++ lib/catalog/getCatalogSongs.ts | 71 ++++++++++++++++++++++++++ lib/catalog/getCatalogs.ts | 41 +++++++++++++++ lib/const.ts | 11 ++++ lib/consts.ts | 8 +++ lib/spotify/getSpotifyFollowers.ts | 70 +++++++++++++++++++++++++ 7 files changed, 243 insertions(+) create mode 100644 lib/catalog/formatCatalogSongsAsCSV.ts create mode 100644 lib/catalog/getCatalogDataAsCSV.ts create mode 100644 lib/catalog/getCatalogSongs.ts create mode 100644 lib/catalog/getCatalogs.ts create mode 100644 lib/consts.ts create mode 100644 lib/spotify/getSpotifyFollowers.ts diff --git a/lib/catalog/formatCatalogSongsAsCSV.ts b/lib/catalog/formatCatalogSongsAsCSV.ts new file mode 100644 index 000000000..f9d0bf226 --- /dev/null +++ b/lib/catalog/formatCatalogSongsAsCSV.ts @@ -0,0 +1,13 @@ +import { CatalogSong } from "./getCatalogSongs"; + +/** + * Formats catalog songs into the CSV-like format expected by the scorer + */ +export function formatCatalogSongsAsCSV(songs: CatalogSong[]): string { + const csvLines = songs.map((song) => { + const artistNames = song.artists.map((artist) => artist.name).join(", "); + return `${song.isrc},"${song.name}","${song.album}","${artistNames}"`; + }); + + return csvLines.join("\n"); +} diff --git a/lib/catalog/getCatalogDataAsCSV.ts b/lib/catalog/getCatalogDataAsCSV.ts new file mode 100644 index 000000000..ea529c37e --- /dev/null +++ b/lib/catalog/getCatalogDataAsCSV.ts @@ -0,0 +1,29 @@ +import { getCatalogSongs, CatalogSong } from "./getCatalogSongs"; +import { formatCatalogSongsAsCSV } from "./formatCatalogSongsAsCSV"; + +/** + * Gets all catalog songs and formats them as CSV for the scorer + */ +export async function getCatalogDataAsCSV(catalogId: string): Promise { + const allSongs: CatalogSong[] = []; + let currentPage = 1; + let totalPages = 1; + + try { + do { + const response = await getCatalogSongs(catalogId, 100, currentPage); + + // Add songs from this page to our collection + allSongs.push(...response.songs); + + // Update pagination info + totalPages = response.pagination.total_pages; + currentPage++; + } while (currentPage <= totalPages); + + return formatCatalogSongsAsCSV(allSongs); + } catch (error) { + console.error("Error fetching all catalog songs:", error); + throw error; + } +} diff --git a/lib/catalog/getCatalogSongs.ts b/lib/catalog/getCatalogSongs.ts new file mode 100644 index 000000000..b82747a6c --- /dev/null +++ b/lib/catalog/getCatalogSongs.ts @@ -0,0 +1,71 @@ +/** + * Fetches a single page of songs from a catalog + */ + +import { Tables } from "@/types/database.types"; +import { NEW_API_BASE_URL } from "../consts"; + +type Song = Tables<"songs">; +type Account = Tables<"accounts">; + +export type CatalogSong = Song & { + catalog_id: string; + artists: Array>; +}; + +export interface CatalogSongsResponse { + status: string; + songs: CatalogSong[]; + pagination: { + total_count: number; + page: number; + limit: number; + total_pages: number; + }; + error?: string; +} + +export async function getCatalogSongs( + catalogId: string, + pageSize: number = 100, + page: number = 1, + artistName?: string +): Promise { + try { + const params = new URLSearchParams({ + catalog_id: catalogId, + page: page.toString(), + limit: pageSize.toString(), + }); + + if (artistName) { + params.append("artistName", artistName); + } + + const response = await fetch( + `${NEW_API_BASE_URL}/api/catalogs/songs?${params}`, + { + method: "GET", + headers: { + "Content-Type": "application/json", + }, + } + ); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`HTTP ${response.status}: ${errorText}`); + } + + const data: CatalogSongsResponse = await response.json(); + + if (data.status === "error") { + throw new Error(data.error || "Unknown error occurred"); + } + + return data; + } catch (error) { + console.error("Error fetching catalog songs:", error); + throw error; + } +} diff --git a/lib/catalog/getCatalogs.ts b/lib/catalog/getCatalogs.ts new file mode 100644 index 000000000..179d1f3a9 --- /dev/null +++ b/lib/catalog/getCatalogs.ts @@ -0,0 +1,41 @@ +import { Tables } from "@/types/database.types"; + +type Catalog = Tables<"catalogs">; + +export interface CatalogsResponse { + status: string; + catalogs: Catalog[]; + error?: string; +} + +export async function getCatalogs( + accountId: string +): Promise { + try { + const response = await fetch( + `https://api.recoupable.com/api/catalogs?account_id=${accountId}`, + { + method: "GET", + headers: { + "Content-Type": "application/json", + }, + } + ); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`HTTP ${response.status}: ${errorText}`); + } + + const data: CatalogsResponse = await response.json(); + + if (data.status === "error") { + throw new Error(data.error || "Unknown error occurred"); + } + + return data; + } catch (error) { + console.error("Error fetching catalogs:", error); + throw error; + } +} diff --git a/lib/const.ts b/lib/const.ts index bd1e73a23..c5e01ef73 100644 --- a/lib/const.ts +++ b/lib/const.ts @@ -28,3 +28,14 @@ export const SUPABASE_STORAGE_BUCKET = "user-files"; * API keys from this org have universal access and can specify any accountId. */ export const RECOUP_ORG_ID = "04e3aba9-c130-4fb8-8b92-34e95d43e66b"; + +// EVALS +export const EVAL_ACCOUNT_ID = "fb678396-a68f-4294-ae50-b8cacf9ce77b"; +export const EVAL_ACCESS_TOKEN = process.env.EVAL_ACCESS_TOKEN || ""; +export const EVAL_ARTISTS = [ + "Gliiico", + "Mac Miller", + "Wiz Khalifa", + "Mod Sun", + "Julius Black", +]; diff --git a/lib/consts.ts b/lib/consts.ts new file mode 100644 index 000000000..388428d85 --- /dev/null +++ b/lib/consts.ts @@ -0,0 +1,8 @@ +/** + * Re-export all constants from lib/const.ts for compatibility with + * code migrated from Recoup-Chat that imports from "@/lib/consts" + */ +export * from "./const"; + +// Additional constants needed for evals that are specific to Recoup-Chat +export const NEW_API_BASE_URL = "https://recoup-api.vercel.app"; diff --git a/lib/spotify/getSpotifyFollowers.ts b/lib/spotify/getSpotifyFollowers.ts new file mode 100644 index 000000000..da4903686 --- /dev/null +++ b/lib/spotify/getSpotifyFollowers.ts @@ -0,0 +1,70 @@ +import { NEW_API_BASE_URL } from "../consts"; + +interface SpotifyArtist { + external_urls: { + spotify: string; + }; + followers: { + href: null; + total: number; + }; + genres: string[]; + href: string; + id: string; + images: Array<{ + url: string; + height: number; + width: number; + }>; + name: string; + popularity: number; + type: string; + uri: string; +} + +interface SpotifySearchResponse { + status: string; + artists: { + href: string; + limit: number; + next: string | null; + offset: number; + previous: null; + total: number; + items: SpotifyArtist[]; + }; +} + +/** + * Get Spotify follower count for an artist + * @param artistName - The name of the artist to search for + * @returns Promise - The follower count of the first matching artist + */ +export async function getSpotifyFollowers(artistName: string): Promise { + try { + const encodedName = encodeURIComponent(artistName); + const url = `${NEW_API_BASE_URL}/api/spotify/search?q=${encodedName}&type=artist`; + + const response = await fetch(url); + + if (!response.ok) { + throw new Error( + `API request failed: ${response.status} ${response.statusText}` + ); + } + + const data: SpotifySearchResponse = await response.json(); + + if (data.status !== "success" || !data.artists.items.length) { + throw new Error(`No artists found for "${artistName}"`); + } + + return data.artists.items[0].followers.total; + } catch (error) { + console.error( + `Error fetching Spotify followers for "${artistName}":`, + error + ); + throw error; + } +} From 6ef962f61abc0defaaa64b80954eac1e8357d46b Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 16:48:49 -0500 Subject: [PATCH 06/15] fix: correct ChatRequestBody property names in eval - Change accessToken to authToken (matching ChatRequestBody type) - Add required orgId: null property Co-Authored-By: Claude Opus 4.5 --- lib/evals/callChatFunctionsWithResult.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/evals/callChatFunctionsWithResult.ts b/lib/evals/callChatFunctionsWithResult.ts index d8abf5286..207e2b621 100644 --- a/lib/evals/callChatFunctionsWithResult.ts +++ b/lib/evals/callChatFunctionsWithResult.ts @@ -28,7 +28,8 @@ export async function callChatFunctionsWithResult(input: string) { messages, roomId: "3779c62e-7583-40c6-a0bb-6bbac841a531", accountId: EVAL_ACCOUNT_ID, - accessToken: EVAL_ACCESS_TOKEN, + authToken: EVAL_ACCESS_TOKEN, + orgId: null, artistId: "29cfd55a-98d9-45a5-96c9-c751a88f7799", model: DEFAULT_MODEL, excludeTools: [], // Don't exclude any tools - we want to test tool usage From e3c2d2589901545652ca4e9f6a5ff359eaebea2b Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 16:54:08 -0500 Subject: [PATCH 07/15] fix: add PRIVY_PROJECT_SECRET env var to evals workflow Required for lib/const.ts module loading during eval compilation. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/evals.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml index fa23ad357..ec16f1c04 100644 --- a/.github/workflows/evals.yml +++ b/.github/workflows/evals.yml @@ -34,3 +34,5 @@ jobs: with: api_key: ${{ secrets.BRAINTRUST_API_KEY }} runtime: node + env: + PRIVY_PROJECT_SECRET: ${{ secrets.PRIVY_PROJECT_SECRET }} From d388babcbcd5b36f0df041f02a98b48b5c5421de Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 16:55:11 -0500 Subject: [PATCH 08/15] refactor: move env vars to job level in evals workflow Match Recoup-Chat pattern for consistency. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/evals.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml index ec16f1c04..6b7b71fdb 100644 --- a/.github/workflows/evals.yml +++ b/.github/workflows/evals.yml @@ -11,6 +11,9 @@ permissions: jobs: evals: runs-on: ubuntu-latest + timeout-minutes: 11 + env: + PRIVY_PROJECT_SECRET: ${{ secrets.PRIVY_PROJECT_SECRET }} steps: - name: Checkout code @@ -34,5 +37,3 @@ jobs: with: api_key: ${{ secrets.BRAINTRUST_API_KEY }} runtime: node - env: - PRIVY_PROJECT_SECRET: ${{ secrets.PRIVY_PROJECT_SECRET }} From b27d31bffb548b08e8011b740ba362bdc57a5280 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 17:02:07 -0500 Subject: [PATCH 09/15] fix: add external packages and env vars for evals - Add @composio/core and @composio/vercel to --external-packages (fixes createRequire(import.meta.url) bundler error) - Add COMPOSIO_API_KEY, OPENAI_API_KEY, AI_GATEWAY_API_KEY env vars Co-Authored-By: Claude Opus 4.5 --- .github/workflows/evals.yml | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml index 6b7b71fdb..832b8d5e0 100644 --- a/.github/workflows/evals.yml +++ b/.github/workflows/evals.yml @@ -14,6 +14,9 @@ jobs: timeout-minutes: 11 env: PRIVY_PROJECT_SECRET: ${{ secrets.PRIVY_PROJECT_SECRET }} + COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + AI_GATEWAY_API_KEY: ${{ secrets.AI_GATEWAY_API_KEY }} steps: - name: Checkout code diff --git a/package.json b/package.json index 3aefdf143..d26f5869d 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint:check": "eslint . --ext .ts", "test": "vitest run", "test:watch": "vitest", - "eval": "braintrust eval --external-packages playwright playwright-core chromium-bidi @browserbasehq/stagehand" + "eval": "braintrust eval --external-packages playwright playwright-core chromium-bidi @browserbasehq/stagehand @composio/core @composio/vercel" }, "dependencies": { "@ai-sdk/anthropic": "^3.0.13", From 0f9c740ab2188aa6bb7ef6c2fe4b9eeb3730bcc4 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 17:04:30 -0500 Subject: [PATCH 10/15] fix: run pnpm eval directly instead of using eval-action The braintrustdata/eval-action doesn't support --external-packages flag. Running pnpm eval directly uses the package.json script with the flag. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/evals.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml index 832b8d5e0..7403e7f50 100644 --- a/.github/workflows/evals.yml +++ b/.github/workflows/evals.yml @@ -36,7 +36,6 @@ jobs: run: pnpm install - name: Run Evals - uses: braintrustdata/eval-action@v1 - with: - api_key: ${{ secrets.BRAINTRUST_API_KEY }} - runtime: node + env: + BRAINTRUST_API_KEY: ${{ secrets.BRAINTRUST_API_KEY }} + run: pnpm eval From 3b957534bc4cd09a099ad1fc75668e30a25c6db0 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 17:05:57 -0500 Subject: [PATCH 11/15] fix: make Composio client lazy-loaded to fix braintrust bundling - Use dynamic imports for @composio/core and @composio/vercel - This avoids the createRequire(import.meta.url) error during bundling - Update all callers to await getComposioClient() - Revert to using braintrustdata/eval-action@v1 Co-Authored-By: Claude Opus 4.5 --- .github/workflows/evals.yml | 7 ++++--- lib/composio/client.ts | 16 +++++++++++----- lib/composio/connectors/authorizeConnector.ts | 2 +- lib/composio/connectors/getConnectors.ts | 2 +- lib/composio/toolRouter/createSession.ts | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml index 7403e7f50..832b8d5e0 100644 --- a/.github/workflows/evals.yml +++ b/.github/workflows/evals.yml @@ -36,6 +36,7 @@ jobs: run: pnpm install - name: Run Evals - env: - BRAINTRUST_API_KEY: ${{ secrets.BRAINTRUST_API_KEY }} - run: pnpm eval + uses: braintrustdata/eval-action@v1 + with: + api_key: ${{ secrets.BRAINTRUST_API_KEY }} + runtime: node diff --git a/lib/composio/client.ts b/lib/composio/client.ts index ca066c48d..055540af6 100644 --- a/lib/composio/client.ts +++ b/lib/composio/client.ts @@ -1,11 +1,17 @@ -import { Composio } from "@composio/core"; -import { VercelProvider } from "@composio/vercel"; import { getComposioApiKey } from "./getComposioApiKey"; -const apiKey = getComposioApiKey(); +/** + * Lazily imports and creates a Composio client. + * Uses dynamic imports to avoid bundler issues with @composio/core's + * use of createRequire(import.meta.url). + */ +export const getComposioClient = async () => { + const { Composio } = await import("@composio/core"); + const { VercelProvider } = await import("@composio/vercel"); -export const getComposioClient = (): Composio => { - return new Composio({ + const apiKey = getComposioApiKey(); + + return new Composio({ apiKey, provider: new VercelProvider(), }); diff --git a/lib/composio/connectors/authorizeConnector.ts b/lib/composio/connectors/authorizeConnector.ts index 23a611345..7b5b44a6a 100644 --- a/lib/composio/connectors/authorizeConnector.ts +++ b/lib/composio/connectors/authorizeConnector.ts @@ -25,7 +25,7 @@ export async function authorizeConnector( connector: string, customCallbackUrl?: string, ): Promise { - const composio = getComposioClient(); + const composio = await getComposioClient(); const callbackUrl = customCallbackUrl || getCallbackUrl({ destination: "connectors" }); diff --git a/lib/composio/connectors/getConnectors.ts b/lib/composio/connectors/getConnectors.ts index 6f5ac127c..c82489419 100644 --- a/lib/composio/connectors/getConnectors.ts +++ b/lib/composio/connectors/getConnectors.ts @@ -17,7 +17,7 @@ export interface ConnectorInfo { * @returns List of connectors with connection status */ export async function getConnectors(userId: string): Promise { - const composio = getComposioClient(); + const composio = await getComposioClient(); const session = await composio.create(userId); const toolkits = await session.toolkits(); diff --git a/lib/composio/toolRouter/createSession.ts b/lib/composio/toolRouter/createSession.ts index 1cd36e411..1be944af5 100644 --- a/lib/composio/toolRouter/createSession.ts +++ b/lib/composio/toolRouter/createSession.ts @@ -11,7 +11,7 @@ const ENABLED_TOOLKITS = ["googlesheets"]; * Create a Composio Tool Router session for a user. */ export async function createToolRouterSession(userId: string, roomId?: string) { - const composio = getComposioClient(); + const composio = await getComposioClient(); const callbackUrl = getCallbackUrl({ destination: "chat", From c75331576ed9edefc262a12621acb9f5ab580734 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 17:14:49 -0500 Subject: [PATCH 12/15] fix: add paths and package_manager to eval-action - Set paths: "evals/" to tell action where to find eval files - Set package_manager: pnpm Co-Authored-By: Claude Opus 4.5 --- .github/workflows/evals.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml index 832b8d5e0..0d92a08ee 100644 --- a/.github/workflows/evals.yml +++ b/.github/workflows/evals.yml @@ -40,3 +40,5 @@ jobs: with: api_key: ${{ secrets.BRAINTRUST_API_KEY }} runtime: node + paths: "evals/" + package_manager: pnpm From 479680f315c65b9d2af388bdfa7e8e8ac39736ed Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 17:16:40 -0500 Subject: [PATCH 13/15] fix: add SUPABASE_URL and SUPABASE_KEY env vars to evals Co-Authored-By: Claude Opus 4.5 --- .github/workflows/evals.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml index 0d92a08ee..20b2707eb 100644 --- a/.github/workflows/evals.yml +++ b/.github/workflows/evals.yml @@ -17,6 +17,8 @@ jobs: COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} AI_GATEWAY_API_KEY: ${{ secrets.AI_GATEWAY_API_KEY }} + SUPABASE_URL: ${{ secrets.SUPABASE_URL }} + SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} steps: - name: Checkout code From d398fdf8e09abd75c2b5ef5344c1509fd8098ac7 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 17:23:47 -0500 Subject: [PATCH 14/15] fix: gracefully skip Composio tools when unavailable Handle cases where COMPOSIO_API_KEY is missing or @composio packages fail to load (bundler incompatibility with createRequire). Returns empty ToolSet instead of throwing, allowing evals to run without Composio tools. Co-Authored-By: Claude Opus 4.5 --- lib/composio/toolRouter/getTools.ts | 38 ++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/lib/composio/toolRouter/getTools.ts b/lib/composio/toolRouter/getTools.ts index 3d7134287..9855098cf 100644 --- a/lib/composio/toolRouter/getTools.ts +++ b/lib/composio/toolRouter/getTools.ts @@ -44,6 +44,10 @@ function isValidTool(tool: unknown): tool is Tool { * - COMPOSIO_GET_TOOL_SCHEMAS - Get parameter schemas * - COMPOSIO_MULTI_EXECUTE_TOOL - Execute actions * + * Gracefully returns empty ToolSet when: + * - COMPOSIO_API_KEY is not set + * - @composio packages fail to load (bundler incompatibility) + * * @param userId - Unique identifier for the user (accountId) * @param roomId - Optional chat room ID for OAuth redirect * @returns ToolSet containing filtered Vercel AI SDK tools @@ -52,21 +56,33 @@ export async function getComposioTools( userId: string, roomId?: string ): Promise { - const session = await createToolRouterSession(userId, roomId); - const allTools = await session.tools(); + // Skip Composio if API key is not configured + if (!process.env.COMPOSIO_API_KEY) { + return {}; + } + + try { + const session = await createToolRouterSession(userId, roomId); + const allTools = await session.tools(); - // Filter to only allowed tools with runtime validation - const filteredTools: ToolSet = {}; + // Filter to only allowed tools with runtime validation + const filteredTools: ToolSet = {}; - for (const toolName of ALLOWED_TOOLS) { - if (toolName in allTools) { - const tool = (allTools as Record)[toolName]; + for (const toolName of ALLOWED_TOOLS) { + if (toolName in allTools) { + const tool = (allTools as Record)[toolName]; - if (isValidTool(tool)) { - filteredTools[toolName] = tool; + if (isValidTool(tool)) { + filteredTools[toolName] = tool; + } } } - } - return filteredTools; + return filteredTools; + } catch (error) { + // Gracefully handle Composio loading failures + // (e.g., bundler incompatibility with createRequire(import.meta.url)) + console.warn("Composio tools unavailable:", (error as Error).message); + return {}; + } } From ee8d42066a6dcd56236a8db04ff20c7a13983756 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Wed, 21 Jan 2026 17:30:46 -0500 Subject: [PATCH 15/15] fix: remove COMPOSIO_API_KEY from evals workflow The @composio packages use createRequire(import.meta.url) which is incompatible with Braintrust's bundler. By not setting COMPOSIO_API_KEY, getComposioTools returns {} immediately without attempting to import the incompatible packages. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/evals.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml index 20b2707eb..c31fd81d7 100644 --- a/.github/workflows/evals.yml +++ b/.github/workflows/evals.yml @@ -14,7 +14,8 @@ jobs: timeout-minutes: 11 env: PRIVY_PROJECT_SECRET: ${{ secrets.PRIVY_PROJECT_SECRET }} - COMPOSIO_API_KEY: ${{ secrets.COMPOSIO_API_KEY }} + # Note: COMPOSIO_API_KEY intentionally omitted - @composio packages + # are incompatible with Braintrust's bundler (createRequire issue) OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} AI_GATEWAY_API_KEY: ${{ secrets.AI_GATEWAY_API_KEY }} SUPABASE_URL: ${{ secrets.SUPABASE_URL }}