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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions globalSetup.ts

This file was deleted.

9 changes: 1 addition & 8 deletions src/mastra/agents/acpAgent.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { Agent } from '@mastra/core/agent';

import { createAnswerRelevancyScorer } from '@mastra/evals/scorers/prebuilt';

import { googleAIFlashLite, pgMemory, pgQueryTool } from '../config';

import { arxivTool } from '../tools/arxiv.tool';
import { csvToJsonTool } from '../tools/csv-to-json.tool';
import { createDataDirTool, getDataFileInfoTool, listDataDirTool, moveDataFileTool, searchDataFilesTool, writeDataFileTool } from '../tools/data-file-manager';
Expand Down Expand Up @@ -133,9 +129,6 @@ export const acpAgent = new Agent({
outputProcessors: [new TokenLimiterProcessor(1048576)],
workflows: {},
scorers: {
relevancy: {
scorer: createAnswerRelevancyScorer({ model: googleAIFlashLite }),
sampling: { type: "ratio", rate: 0.5 }
}

},
Comment on lines 131 to 133
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Empty scorers configuration - consider cleanup.

The scorers configuration is now empty, consistent with the PR's goal to remove scorer integrations. Consider removing the empty scorers property entirely if it's not required, or add a comment indicating this is intentional if it serves as a placeholder for future scorers.

🤖 Prompt for AI Agents
In src/mastra/agents/acpAgent.ts around lines 131 to 133, the scorers property
is an empty object literal; remove the entire empty `scorers` property to clean
up unused configuration, or if it must remain as an explicit placeholder,
replace it with a concise comment explaining it's intentionally left empty for
future scorer integrations (e.g., "// scorers intentionally omitted — no
integrations required"); ensure formatting and trailing commas remain valid
after removal or comment insertion.

});
4 changes: 2 additions & 2 deletions src/mastra/agents/businessLegalAgents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { GoogleGenerativeAIProviderMetadata } from '@ai-sdk/google';
import { googleTools } from '@ai-sdk/google/internal';
import { Agent } from '@mastra/core/agent';

import { BatchPartsProcessor, TokenLimiterProcessor, UnicodeNormalizer } from '@mastra/core/processors';
import { TokenLimiterProcessor, UnicodeNormalizer } from '@mastra/core/processors';
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removed import BatchPartsProcessor may still be needed elsewhere in the file. Verify that this processor is not used anywhere in the code.

Copilot uses AI. Check for mistakes.
import type { RequestContext } from '@mastra/core/request-context';
import {
createAnswerRelevancyScorer,
Expand All @@ -14,7 +14,7 @@ import { PGVECTOR_PROMPT } from "@mastra/pg";
import { google, googleAI, googleAI3, googleAIFlashLite } from '../config/google';
import { log } from '../config/logger';
import { pgMemory, pgQueryTool } from '../config/pg-storage';
import { researchCompletenessScorer, sourceDiversityScorer, summaryQualityScorer } from '../scorers/custom-scorers';

import { mdocumentChunker } from '../tools/document-chunking.tool';
import { evaluateResultTool } from '../tools/evaluateResultTool';
import { extractLearningsTool } from '../tools/extractLearningsTool';
Expand Down
11 changes: 2 additions & 9 deletions src/mastra/agents/contentStrategistAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Agent } from '@mastra/core/agent';
import { googleAI } from '../config/google';
import { pgMemory } from '../config/pg-storage';
import { webScraperTool } from '../tools/web-scraper-tool';
import { structureScorer, creativityScorer } from '../scorers';

import { chartSupervisorTool } from '../tools/financial-chart-tools';
import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google';
import type { RequestContext } from '@mastra/core/request-context'
Expand Down Expand Up @@ -98,14 +98,7 @@ EXAMPLE FLOW:
chartSupervisorTool
},
scorers: {
structure: {
scorer: structureScorer,
sampling: { type: 'ratio', rate: 0.3 },
},
creativity: {
scorer: creativityScorer,
sampling: { type: 'ratio', rate: 0.3 },
},

},
outputProcessors: [new TokenLimiterProcessor(1048576)]
});
7 changes: 2 additions & 5 deletions src/mastra/agents/copywriterAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { log } from '../config/logger'
import { pgMemory } from '../config/pg-storage'
import { googleAIFlashLite } from '../config/google'
import { structureScorer } from '../scorers'

import { chartSupervisorTool } from '../tools/financial-chart-tools'
import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google'
import type { RequestContext } from '@mastra/core/request-context'
Expand Down Expand Up @@ -137,10 +137,7 @@ Provide the final content in a clear, well-structured format appropriate for the
chartSupervisorTool
},
scorers: {
structure: {
scorer: structureScorer,
sampling: { type: 'ratio', rate: 0.5 },
},

},
workflows: {},
maxRetries: 5,
Expand Down
6 changes: 1 addition & 5 deletions src/mastra/agents/csv_to_excalidraw.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Agent } from "@mastra/core/agent";
import { googleAI, pgMemory } from "../config";
import { structureScorer } from "../scorers";
import type { GoogleGenerativeAIProviderOptions } from "@ai-sdk/google";
import type { RequestContext } from '@mastra/core/request-context'
import { TokenLimiterProcessor } from "@mastra/core/processors";
Expand Down Expand Up @@ -177,10 +176,7 @@ Structure:
memory: pgMemory,
tools: {},
scorers: {
structure: {
scorer: structureScorer,
sampling: { type: 'ratio', rate: 0.3 },
},

},
workflows: {},
maxRetries: 5,
Expand Down
7 changes: 2 additions & 5 deletions src/mastra/agents/editorAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { RequestContext } from '@mastra/core/request-context';
import { googleAI } from '../config/google';
import { log } from '../config/logger';
import { pgMemory } from '../config/pg-storage';
import { summaryQualityScorer } from '../scorers';

import { TokenLimiterProcessor } from '@mastra/core/processors';

export type UserTier = 'free' | 'pro' | 'enterprise'
Expand Down Expand Up @@ -122,10 +122,7 @@ Tailor your editing style to the content type:
memory: pgMemory,
tools: [],
scorers: {
summaryQuality: {
scorer: summaryQualityScorer,
sampling: { type: 'ratio', rate: 0.6 },
}

},
Comment on lines 124 to 126
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Empty scorers configuration - consider cleanup.

The scorers configuration is now empty following the removal of summaryQualityScorer. Consider removing the empty scorers property entirely if it's not required, or add a comment indicating this is intentional if it serves as a placeholder for future scorers.

🤖 Prompt for AI Agents
In src/mastra/agents/editorAgent.ts around lines 124-126 the object contains an
empty scorers: {} entry left after removing summaryQualityScorer; either delete
the entire scorers property to clean up the config or replace it with a
single-line comment (e.g. // placeholder for future scorers) to indicate it is
intentionally empty, and adjust trailing commas/formatting accordingly so
linting/type checks remain satisfied.

workflows: {},
maxRetries: 5,
Expand Down
8 changes: 3 additions & 5 deletions src/mastra/agents/evaluationAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Agent } from '@mastra/core/agent'
import { googleAIFlashLite } from '../config/google'
import { log } from '../config/logger'
import { pgMemory } from '../config/pg-storage'
import { responseQualityScorer, structureScorer, taskCompletionScorer } from '../scorers'

import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google'
import type { RequestContext } from '@mastra/core/request-context'
import { TokenLimiterProcessor } from '@mastra/core/processors'
Expand Down Expand Up @@ -129,10 +129,8 @@ For each search result provided, you must determine its relevance to the user's
model: googleAIFlashLite,
memory: pgMemory,
scorers: {
responseQuality: {
scorer: responseQualityScorer,
sampling: { type: 'ratio', rate: 0.5 },
}


},
workflows: {},
maxRetries: 5,
Expand Down
9 changes: 4 additions & 5 deletions src/mastra/agents/image_to_csv.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Agent } from "@mastra/core/agent";
import { googleAI, pgMemory } from "../config";
import { csvValidityScorer } from "../scorers";


import type { GoogleGenerativeAIProviderOptions } from "@ai-sdk/google";
import type { RequestContext } from "@mastra/core/request-context";
import { TokenLimiterProcessor } from "@mastra/core/processors";
Expand Down Expand Up @@ -146,10 +147,8 @@ IMPORTANT: Only return the CSV string including the header row. Do not include a
memory: pgMemory,
tools: {},
scorers: {
csvValidity: {
scorer: csvValidityScorer,
sampling: { type: 'ratio', rate: 1.0 },
},


},
Comment on lines 149 to 152
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Remove extra whitespace in empty scorers object.

The scorers configuration is now empty following the removal of csvValidityScorer. Line 151 contains unnecessary whitespace. Consider either removing the empty scorers property entirely or cleaning up the formatting.

Apply this diff to remove the extra blank line:

   scorers: {
-
-    
+
   },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
scorers: {
csvValidity: {
scorer: csvValidityScorer,
sampling: { type: 'ratio', rate: 1.0 },
},
},
scorers: {
},
🤖 Prompt for AI Agents
In src/mastra/agents/image_to_csv.ts around lines 149 to 152, the empty scorers
object contains an extra blank line; remove the unnecessary whitespace by either
deleting the entire empty "scorers" property if it's unused, or collapse it to a
single-line empty object (e.g. scorers: {}), ensuring consistent formatting with
surrounding properties.

workflows: {},
maxRetries: 5,
Expand Down
7 changes: 2 additions & 5 deletions src/mastra/agents/learningExtractionAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Agent } from '@mastra/core/agent'
import { googleAI } from '../config/google'
import { log } from '../config/logger'
import { pgMemory } from '../config/pg-storage'
import { structureScorer } from '../scorers'

import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google'
import type { RequestContext } from '@mastra/core/request-context'
import { TokenLimiterProcessor } from '@mastra/core/processors'
Expand Down Expand Up @@ -64,10 +64,7 @@ export const learningExtractionAgent = new Agent({
model: googleAI,
memory: pgMemory,
scorers: {
structure: {
scorer: structureScorer,
sampling: { type: 'ratio', rate: 0.7 },
},

},
workflows: {},
maxRetries: 5,
Expand Down
7 changes: 2 additions & 5 deletions src/mastra/agents/package-publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Agent } from '@mastra/core/agent';

import { googleAIFlashLite } from '../config/google.js';
import { pgMemory } from '../config/pg-storage.js';
import { taskCompletionScorer } from '../scorers';

import { activeDistTag, pnpmBuild, pnpmChangesetPublish, pnpmChangesetStatus } from '../tools/pnpm-tool';
import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google';
import type { RequestContext } from '@mastra/core/request-context';
Expand Down Expand Up @@ -196,10 +196,7 @@ export const danePackagePublisher = new Agent({
},
// options: { tracingPolicy: { internal: InternalSpans.AGENT } },
scorers: {
taskCompletion: {
scorer: taskCompletionScorer,
sampling: { type: 'ratio', rate: 0.4 },
},

},
Comment on lines 198 to 200
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Empty scorers configuration - consider cleanup.

The scorers configuration is now empty following the removal of taskCompletionScorer. Consider removing the empty scorers property entirely if it's not required, or add a comment indicating this is intentional if it serves as a placeholder for future scorers.

🤖 Prompt for AI Agents
In src/mastra/agents/package-publisher.ts around lines 198 to 200 there is an
empty scorers: { } block left after removal of taskCompletionScorer; remove the
entire scorers property if it is not used anywhere, or if it is intentionally a
placeholder, replace the empty object with a one-line comment (e.g. //
placeholder for future scorers) so the intent is clear to readers and linters.

outputProcessors: [new TokenLimiterProcessor(1048576)]
});
19 changes: 1 addition & 18 deletions src/mastra/agents/recharts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ import { TokenLimiterProcessor, UnicodeNormalizer } from '@mastra/core/processor
import { PGVECTOR_PROMPT } from "@mastra/pg"
import { googleAI, googleAIFlashLite, pgMemory, pgQueryTool } from '../config'
import { log } from '../config/logger'
import {
financialDataScorer,
responseQualityScorer,
sourceDiversityScorer,
taskCompletionScorer,
} from '../scorers'
import { alphaVantageStockTool } from '../tools/alpha-vantage.tool'
import { chartDataProcessorTool, chartGeneratorTool, chartTypeAdvisorTool } from '../tools/financial-chart-tools'
import {
Expand Down Expand Up @@ -513,18 +507,7 @@ Return comprehensive chart package:
options: {
},
scorers: {
taskCompletion: {
scorer: taskCompletionScorer,
sampling: { type: 'ratio', rate: 0.5 },
},
sourceDiversity: {
scorer: sourceDiversityScorer,
sampling: { type: 'ratio', rate: 0.3 },
},
financialData: {
scorer: financialDataScorer,
sampling: { type: 'ratio', rate: 0.6 },
},

},
Comment on lines 507 to 511
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Remove empty options and scorers properties.

Both options and scorers are empty objects. Consider removing them entirely to reduce noise and improve maintainability.

   memory: pgMemory,
-  options: {
-  },
-  scorers: {
-
-  },
   inputProcessors: [
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
options: {
},
scorers: {
taskCompletion: {
scorer: taskCompletionScorer,
sampling: { type: 'ratio', rate: 0.5 },
},
sourceDiversity: {
scorer: sourceDiversityScorer,
sampling: { type: 'ratio', rate: 0.3 },
},
financialData: {
scorer: financialDataScorer,
sampling: { type: 'ratio', rate: 0.6 },
},
},
memory: pgMemory,
inputProcessors: [
🤖 Prompt for AI Agents
In src/mastra/agents/recharts.ts around lines 507 to 511, the object literal
contains empty properties "options" and "scorers"; remove those two keys
entirely from the object to reduce noise, adjust surrounding commas/formatting
so the object remains valid, and run TypeScript/linters to confirm no references
break (if any code expects them, replace removal with explicit undefined or
update callers).

inputProcessors: [
new UnicodeNormalizer({
Expand Down
15 changes: 2 additions & 13 deletions src/mastra/agents/reportAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Agent } from '@mastra/core/agent'
import { googleAI, googleAIFlashLite, googleAIPro } from '../config/google'
import { log } from '../config/logger'
import { pgMemory } from '../config/pg-storage'
import { researchCompletenessScorer, structureScorer, summaryQualityScorer } from '../scorers'

import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google'
import type { RequestContext } from '@mastra/core/request-context'
import { TokenLimiterProcessor } from '@mastra/core/processors'
Expand Down Expand Up @@ -107,18 +107,7 @@ export const reportAgent = new Agent({
memory: pgMemory,
options: {},
scorers: {
researchCompleteness: {
scorer: researchCompletenessScorer,
sampling: { type: 'ratio', rate: 0.8 },
},
summaryQuality: {
scorer: summaryQualityScorer,
sampling: { type: 'ratio', rate: 0.6 },
},
structure: {
scorer: structureScorer,
sampling: { type: 'ratio', rate: 1.0 },
},

},
Comment on lines 109 to 111
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Empty scorers configuration - consider cleanup.

The scorers configuration is now empty following the removal of multiple scorers (researchCompletenessScorer, structureScorer, summaryQualityScorer). Consider removing the empty scorers property entirely if it's not required, or add a comment indicating this is intentional if it serves as a placeholder for future scorers.

🤖 Prompt for AI Agents
In src/mastra/agents/reportAgent.ts around lines 109 to 111, the scorers
property is an empty object which is unnecessary; either remove the entire
scorers property if it's not used, or keep it but add a concise comment
explaining it's an intentional placeholder for future scorers (e.g., "//
placeholder for future scorers"). Update the file accordingly and run tests/lint
to ensure no references expect that property.

tools: {},
workflows: {},
Expand Down
13 changes: 1 addition & 12 deletions src/mastra/agents/researchAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import { googleTools } from '@ai-sdk/google/internal';
import { Agent } from '@mastra/core/agent';
import { TokenLimiterProcessor, UnicodeNormalizer } from '@mastra/core/processors';
import type { RequestContext } from '@mastra/core/request-context';
import {
createAnswerRelevancyScorer,
createToxicityScorer
} from '@mastra/evals/scorers/prebuilt';
import { PGVECTOR_PROMPT } from "@mastra/pg";
import { google, googleAI, googleAIFlashLite } from '../config/google';
import { log } from '../config/logger';
Expand Down Expand Up @@ -208,14 +204,7 @@ export const researchAgent = new Agent({
},
memory: pgMemory,
scorers: {
relevancy: {
scorer: createAnswerRelevancyScorer({ model: googleAIFlashLite }),
sampling: { type: "ratio", rate: 0.5 }
},
safety: {
scorer: createToxicityScorer({ model: googleAIFlashLite }),
sampling: { type: "ratio", rate: 0.3 }
}

},
Comment on lines 206 to 208
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider removing the empty scorers property.

The scorers configuration is now empty. If scorers are not currently needed, consider removing this property entirely rather than leaving an empty object. This improves clarity and reduces confusion about whether scorers should be configured.

   memory: pgMemory,
-  scorers: {
-
-  },
   maxRetries: 5,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
scorers: {
relevancy: {
scorer: createAnswerRelevancyScorer({ model: googleAIFlashLite }),
sampling: { type: "ratio", rate: 0.5 }
},
safety: {
scorer: createToxicityScorer({ model: googleAIFlashLite }),
sampling: { type: "ratio", rate: 0.3 }
}
},
memory: pgMemory,
maxRetries: 5,
🤖 Prompt for AI Agents
In src/mastra/agents/researchAgent.ts around lines 206 to 208, the object
includes an empty scorers property which is unnecessary; remove the entire
scorers: { } entry from the configuration to avoid confusion and keep the object
concise, or if scorers will be used soon, replace it with a clear TODO comment
indicating intended future configuration.

maxRetries: 5,
//voice: gvoice,
Expand Down
13 changes: 0 additions & 13 deletions src/mastra/agents/scriptWriterAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BaseSpan } from '@mastra/observability';
import type { RequestContext } from '@mastra/core/request-context';
import { googleAI } from '../config/google';
import { pgMemory } from '../config/pg-storage';
import { creativityScorer, pacingScorer, scriptFormatScorer } from '../scorers';
import { webScraperTool } from '../tools/web-scraper-tool';
import { TokenLimiterProcessor } from '@mastra/core/processors';
export type UserTier = 'free' | 'pro' | 'enterprise'
Expand Down Expand Up @@ -82,18 +81,6 @@ export const scriptWriterAgent = new Agent({
memory: pgMemory,
options: {},
scorers: {
scriptFormat: {
scorer: scriptFormatScorer,
sampling: { type: 'ratio', rate: 1.0 },
},
pacing: {
scorer: pacingScorer,
sampling: { type: 'ratio', rate: 1.0 },
},
creativity: {
scorer: creativityScorer,
sampling: { type: 'ratio', rate: 0.8 },
},
},
tools: {
webScraperTool
Expand Down
16 changes: 0 additions & 16 deletions src/mastra/color-change-tool.ts

This file was deleted.

9 changes: 9 additions & 0 deletions src/mastra/evals/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Evals
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Replace H1 heading with H2.

Per coding guidelines, H1 headings should not be used as they will be generated from the title. Use ## for H2 instead.

Apply this diff:

-# Evals
+## Evals
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Evals
## Evals
🤖 Prompt for AI Agents
In src/mastra/evals/AGENTS.md around line 1 the file uses an H1 heading ("#
Evals"); per guidelines replace the H1 with an H2 by changing the leading '#' to
'##' so the heading becomes "## Evals" (ensure only the heading level is changed
and no other content is modified).


This folder contains evaluation helpers and prebuilt scorers aligned with Mastra's evals reference.

Purpose: Provide scorer utils, prebuilt scorers (bias, completeness, prompt-alignment, tool-call-accuracy, noise-sensitivity), and runEvals helper exports for local experiments and CI tests.

Guidelines:
- Use `createScorer` and `runEvals` from `@mastra/core/evals` when building scorers.
- Keep prebuilt scorers small and well-tested; use judge (LLM) configuration for LLM-based scorers.
Loading
Loading