Skip to content

Conversation

@ssdeanx
Copy link
Owner

@ssdeanx ssdeanx commented Dec 6, 2025

#11 networks working smoothly

…cture

  • Update all agent provider options with proper TypeScript typing using satisfies operator
  • Remove deprecated structuredOutput flags from agent configurations
  • Replace demo/test routes with new networks navigation
  • Add MDX frontmatter handling and improve Turbopack compatibility
  • Move blog data to separate module for better organization
  • Update footer to use dynamic year with useEffect hook
  • Add new networks images and blog layout components

BREAKING CHANGE: Agent provider configurations have been updated and may require dependency version updates. Navigation routes changed from /test to /networks.

Summary by Sourcery

Refine agent provider configurations and documentation layouts while improving MDX handling and navigation.

New Features:

  • Introduce dedicated blog data module and blog layout with recent posts sidebar and new dev session blog entry.
  • Add reusable docs layout with shared navbar, sidebar navigation, and footer, plus client-side frontmatter stripping utility for MDX pages.
  • Add technical documentation pages for lib utilities, chat UI, networks, workflows, and dashboard subsystems.

Bug Fixes:

  • Fix MDX content issues by adjusting loader configuration, enabling frontmatter support, and guarding against rendered frontmatter headings.
  • Correct various navigation and routing links, including tools and networks routes, and clean up stray MDX artifacts in existing docs.
  • Stabilize footer year rendering to avoid hydration issues by using state and effect instead of inline date calls.

Enhancements:

  • Align Google provider options across agents with proper TypeScript typing via satisfies, remove deprecated structuredOutput flags, and prune unused scorers, tools, and output processors.
  • Simplify docs and blog pages by centralizing blog posts data, removing redundant navbar usage on docs index, and optimizing code highlighting helper behavior.
  • Update README with new networks screenshots for visual documentation.

Build:

  • Adjust MDX loader configuration to use serializable plugin specifiers for Turbopack compatibility and add MDX-related dependencies to package.json.

…cture

- Update all agent provider options with proper TypeScript typing using satisfies operator
- Remove deprecated structuredOutput flags from agent configurations
- Replace demo/test routes with new networks navigation
- Add MDX frontmatter handling and improve Turbopack compatibility
- Move blog data to separate module for better organization
- Update footer to use dynamic year with useEffect hook
- Add new networks images and blog layout components

BREAKING CHANGE: Agent provider configurations have been updated and may require dependency version updates. Navigation routes changed from /test to /networks.
Copilot AI review requested due to automatic review settings December 6, 2025 14:36
@continue
Copy link

continue bot commented Dec 6, 2025

Keep this PR in a mergeable state →

Learn more

All Green is an AI agent that automatically:

✅ Addresses code review comments

✅ Fixes failing CI checks

✅ Resolves merge conflicts

@sourcery-ai
Copy link

sourcery-ai bot commented Dec 6, 2025

Reviewer's Guide

Refactors agent provider configurations to use typed GoogleGenerativeAIProviderOptions and removes deprecated options, updates site navigation from demo/test to networks, improves MDX/frontmatter handling and docs/blog layouts, and adds new documentation and assets for networks and internal components.

Sequence diagram for navigation to networks pages

sequenceDiagram
  actor User
  participant Navbar
  participant NextRouter
  participant NetworksPage
  participant NetworksList
  participant NetworkDetailPage

  User->>Navbar: Click Networks button
  Navbar->>NextRouter: navigate(/networks)
  NextRouter->>NetworksPage: Render networks index
  NetworksPage->>NetworksList: Render list of networks
  User->>NetworksList: Click specific network card
  NetworksList->>NextRouter: navigate(/networks/{id})
  NextRouter->>NetworkDetailPage: Render network detail view
Loading

Class diagram for Agent providerOptions with GoogleGenerativeAIProviderOptions typing

classDiagram
  class Agent {
    +string id
    +string name
    +AgentConfig config
  }

  class AgentConfig {
    +function generate(runtimeContext, providerMetadata)
    +object tools
    +object memory
    +object options
  }

  class ProviderOptionsWrapper {
    +GoogleProviderOptions google
  }

  class GoogleProviderOptions {
    +ThinkingConfig thinkingConfig
    +string[] responseModalities
    +string mediaResolution
    +string cachedContent
    +object imageConfig
    +number numberOfImages
  }

  class ThinkingConfig {
    +string thinkingLevel
    +boolean includeThoughts
    +number thinkingBudget
  }

  class GoogleGenerativeAIProviderOptions {
    <<type_from_ai_sdk_google>>
  }

  Agent --> AgentConfig
  AgentConfig --> ProviderOptionsWrapper : uses
  ProviderOptionsWrapper --> GoogleProviderOptions
  GoogleProviderOptions --> ThinkingConfig
  GoogleProviderOptions ..|> GoogleGenerativeAIProviderOptions : satisfies
Loading

File-Level Changes

Change Details Files
Align agent provider configurations with GoogleGenerativeAIProviderOptions and remove deprecated/unused options and tools.
  • Import GoogleGenerativeAIProviderOptions in multiple agent modules and assert google providerOptions with satisfies for stronger typing.
  • Remove deprecated structuredOutput and various sampling/max token fields from google providerOptions across agents.
  • Remove or comment out unused Google tools (googleSearch, codeExecution, urlContext) and BatchPartsProcessor/outputProcessors/scorers in several agents to simplify configuration.
  • Adjust specific providerOptions such as mediaResolution, responseModalities, cachedContent and imageConfig to match new expectations.
src/mastra/agents/codingAgents.ts
src/mastra/agents/stockAnalysisAgent.ts
src/mastra/agents/recharts.ts
src/mastra/agents/researchAgent.ts
src/mastra/agents/dane.ts
src/mastra/agents/scriptWriterAgent.ts
src/mastra/agents/businessLegalAgents.ts
src/mastra/agents/evaluationAgent.ts
src/mastra/agents/excalidraw_validator.ts
src/mastra/agents/image_to_csv.ts
src/mastra/agents/copywriterAgent.ts
src/mastra/agents/reportAgent.ts
src/mastra/agents/contentStrategistAgent.ts
src/mastra/agents/editorAgent.ts
src/mastra/agents/image.ts
src/mastra/agents/calendarAgent.ts
src/mastra/agents/csv_to_excalidraw.ts
src/mastra/agents/learningExtractionAgent.ts
src/mastra/agents/package-publisher.ts
src/mastra/agents/sql.ts
src/mastra/agents/weather-agent.ts
src/mastra/agents/acpAgent.ts
Rework navigation and links to use new /networks routes and simpler href patterns.
  • Change navbar CTA from /test Demo to /networks Networks for both desktop and mobile links.
  • Update NetworksList cards and tools docs links to use direct string hrefs instead of pathname/query objects for better DX and URL clarity.
  • Adjust docs page to rely on shared layout/Navbar instead of embedding Navbar locally.
app/components/navbar.tsx
app/components/networks-list.tsx
app/components/tools-list.tsx
app/docs/page.tsx
Improve MDX handling, frontmatter behavior, and docs/blog layouts including sidebar and blog data extraction.
  • Switch MDX loader plugins in next.config.ts to string specifiers for Turbopack compatibility and enable remark-gfm/rehype-highlight.
  • Add client-side StripFrontmatter component and h2 guard in mdx-components to avoid rendering raw frontmatter and prevent hydration issues.
  • Introduce DocsLayout and BlogLayout with shared Navbar/Footer, new Sidebar navigation, and a recent posts sidebar for blog pages.
  • Extract BLOG_POSTS into a shared blog-data module and add a new session-summary blog page using BlogLayout.
next.config.ts
mdx-components.tsx
app/components/strip-frontmatter.tsx
app/docs/layout.tsx
app/blog/layout.tsx
app/components/sidebar.tsx
app/components/blog-list.tsx
app/components/blog-data.tsx
app/blog/session-summary/page.tsx
Add internal technical documentation for key subsystems and adjust content files to remove stray MDX artifacts.
  • Add detailed markdown docs under docs/components for lib utilities, chat UI, networks, workflows, and dashboard subsystems with frontmatter metadata.
  • Clean up MDX pages by removing stray parameter/filePath artifacts from getting-started and openapi-schema pages.
  • Add a simple Vitest example test for docs/hello-world to validate docs scaffolding.
docs/components/lib-documentation.md
docs/components/app-chat-documentation.md
docs/components/app-networks-documentation.md
docs/components/app-workflows-documentation.md
docs/components/app-dashboard-documentation.md
app/docs/getting-started/page.mdx
app/api-reference/openapi-schema/page.mdx
tests/docs-hello-world.test.ts
Minor UI and DX improvements including footer behavior and async utilities.
  • Change footer year to be derived via useEffect into state (avoids SSR/CSR mismatch) instead of new Date() inline.
  • Simplify highlightCode helper by removing redundant await Promise.all.
  • Tighten docs tools/card links and button structure, including wrapping contact link in Button and fixing nesting/indentation issues.
  • Add new README images for networks UI and register MDX-related devDependencies in package.json.
app/components/footer.tsx
src/components/ai-elements/code-block.tsx
app/components/tools-list.tsx
README.md
package.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions
Copy link

github-actions bot commented Dec 6, 2025

🤖 Hi @ssdeanx, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@coderabbitai
Copy link

coderabbitai bot commented Dec 6, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Added blog section with layout, recent posts sidebar, and session documentation.
    • Enhanced navigation to highlight Networks section.
    • Added comprehensive documentation for chat UI, dashboard, networks, and workflows subsystems.
  • Bug Fixes

    • Fixed accidental MDX frontmatter appearing in rendered pages.
  • Refactoring

    • Simplified dynamic routing in navigation links.
    • Reorganized blog post data management.
  • Chores

    • Added MDX frontmatter processing dependencies.
    • Added test coverage for documentation utilities.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

This PR introduces a blog section with layouts and shared post data, refactors navigation to point to Networks, standardizes Google AI provider type constraints across 20+ agents, adds comprehensive documentation files, implements MDX frontmatter stripping, extracts blog data to a reusable module, and updates build configuration for MDX plugin handling.

Changes

Cohort / File(s) Summary
Blog and Documentation Layouts
app/blog/layout.tsx, app/blog/session-summary/page.tsx, app/docs/layout.tsx, app/docs/page.tsx
Introduces new BlogLayout and DocsLayout components that compose Navbar, Sidebar, Footer with responsive grids. BlogLayout renders a sticky "Recent posts" sidebar; DocsLayout includes StripFrontmatter for frontmatter cleanup.
Blog Data Extraction
app/components/blog-data.tsx, app/components/blog-list.tsx
Extracts blog post data (title, excerpt, date, readTime, category, slug) to centralized BLOG_POSTS constant in blog-data.tsx; BlogList now imports and uses externalized data.
Navigation and Component Updates
app/components/navbar.tsx, app/components/sidebar.tsx, app/components/footer.tsx
Updates navbar links from Demo/Test to Networks; adds new Sidebar component with active route detection; Footer now uses state-managed year display via useEffect.
Routing Simplification
app/components/networks-list.tsx, app/components/tools-list.tsx
Converts dynamic Next.js Link hrefs from object format (pathname + query) to string templates (e.g., /networks/${id}, /docs/tools/${id}).
Frontmatter Handling
app/components/strip-frontmatter.tsx, mdx-components.tsx, next.config.ts
Introduces StripFrontmatter component to remove accidental YAML frontmatter from rendered pages; h2 MDX component now filters frontmatter-like content; next.config.ts updates MDX plugin references to string identifiers (remark-gfm, rehype-highlight).
Build Configuration
package.json
Adds three MDX/frontmatter packages: @mdx-js/loader, remark-frontmatter, remark-mdx-frontmatter (to both dependencies and devDependencies).
AI Agents - Type Constraint Updates
src/mastra/agents/*.ts (20+ files including acpAgent, businessLegalAgents, calendarAgent, codingAgents, contentStrategistAgent, copywriterAgent, csv_to_excalidraw, dane, editorAgent, evaluationAgent, excalidraw_validator, image, image_to_csv, learningExtractionAgent, package-publisher, recharts, reportAgent, researchAgent, scriptWriterAgent, sql, stockAnalysisAgent, weather-agent)
Systematically applies satisfies GoogleGenerativeAIProviderOptions type constraints to providerOptions.google blocks across agents; removes deprecated config fields (maxOutputTokens, structuredOutput, temperature, topP in various agents); some agents add responseModalities or mediaResolution; codingAgents adds model selection hook; several agents remove tool integrations (githubMCP, googleSearch, codeExecution, urlContext).
Code Utilities
src/components/ai-elements/code-block.tsx
Removes explicit await from Promise.all() return in highlightCode function.
Comprehensive Documentation
docs/components/app-chat-documentation.md, docs/components/app-dashboard-documentation.md, docs/components/app-networks-documentation.md, docs/components/app-workflows-documentation.md, docs/components/lib-documentation.md
Adds five new technical documentation files covering chat subsystem, dashboard UI, agent networks, workflow visualizer, and lib utilities; includes architecture diagrams (Mermaid), interface docs, usage examples, testing guidance.
Metadata and Configuration
README.md, app/api-reference/openapi-schema/page.mdx, app/docs/getting-started/page.mdx
README adds network-related badge images; API reference page adds trailing newline; getting-started page removes formatting metadata.
Tests
tests/docs-hello-world.test.ts
Adds new test validating sayHello() function returns expected string.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Areas requiring extra attention:

  • Agent configuration changes across 20+ files: While the pattern is repetitive (type assertions), verify that removed fields (maxOutputTokens, structuredOutput, temperature, topP) don't break downstream behavior and that responseModalities/mediaResolution additions are correct.
  • Tool removal in agents (e.g., codingAgents, researchAgent, scriptWriterAgent): Confirm that removing googleSearch, codeExecution, and urlContext tools doesn't degrade agent capabilities or cause runtime errors.
  • MDX frontmatter handling logic in StripFrontmatter and mdx-components.tsx: Validate pattern matching for YAML detection and ensure edge cases (malformed frontmatter, nested structures) are handled correctly.
  • Routing changes from object hrefs to string templates: Ensure Next.js dynamic route resolution still works correctly with simplified paths.
  • Layout component composition: Verify Navbar, Sidebar, Footer integration and responsive behavior across blog and docs sections.

Possibly related PRs

  • Develop #2: Modifies app/components/networks-list.tsx styling/animation; this PR changes its routing logic, so both touch the same component and may require coordinated review.

Suggested reviewers

  • sourcery-ai

Poem

🐰 Hops through blogs with layouts so neat,
Networks and docs, a complete retreat!
Type-safe agents, now all aligned,
Frontmatter stripped, no clutter to find,
With tools refined and routes made sleek,
This PR's the highlight of the week!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'refactor(agents)!: update provider configurations and navigation stru…' is truncated but clearly addresses the main changes: agent provider configuration updates and navigation structure changes from /test to /networks routes.
Description check ✅ Passed The PR description comprehensively relates to the changeset, detailing agent provider updates, MDX frontmatter handling, navigation route changes, blog data organization, footer improvements, and new components.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ssdeanx, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces significant refactorings to the application's agent configurations, enhancing type safety and streamlining provider options. It also overhauls the documentation and blog systems with new layouts, improved MDX handling, and comprehensive technical documentation for key application areas. Furthermore, core navigation has been updated to reflect a new 'Networks' section, improving overall application structure and user experience.

Highlights

  • Agent Configuration Refinement: Standardized agent provider options using TypeScript's satisfies operator, removed deprecated structuredOutput flags, and streamlined various provider parameters across multiple agents for improved type safety and clarity.
  • Enhanced Documentation System: Introduced new DocsLayout and BlogLayout components, added a Sidebar for navigation, implemented client-side MDX frontmatter stripping, and updated next.config.ts for improved MDX parsing and Turbopack compatibility.
  • Comprehensive New Documentation: Added extensive MDX documentation files for core application subsystems including app/chat, app/dashboard, app/networks, app/workflows, and lib/ utilities, providing detailed technical insights.
  • Navigation and Routing Update: Replaced /test routes with /networks across the application, including navbar links and internal component routing, reflecting a shift towards a dedicated 'Networks' section.
  • Code Organization and Maintenance: Centralized blog post data into a separate module, updated the footer to dynamically display the current year, and performed minor code optimizations.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Dec 6, 2025

🤖 I'm sorry @ssdeanx, but I was unable to process your request. Please see the logs for more details.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The new footer year logic using useState/useEffect introduces an initial empty year on SSR and adds unnecessary client-side work; consider computing new Date().getFullYear() at render or module scope instead of managing it as React state.
  • Frontmatter stripping is now implemented both in the MDX h2 component and via the StripFrontmatter DOM helper, which is brittle and potentially fragile across layout changes; it would be more robust to centralize this behavior (e.g., via the existing remark frontmatter plugins in the MDX pipeline) rather than manipulating the DOM after render.
  • The h2 frontmatter guard in mdx-components.tsx only triggers when children is a plain string, but MDX often passes headings as arrays or nested nodes; consider normalizing children (e.g., with React.Children.toArray + textContent extraction) so frontmatter detection works reliably across MDX documents.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new footer year logic using `useState`/`useEffect` introduces an initial empty year on SSR and adds unnecessary client-side work; consider computing `new Date().getFullYear()` at render or module scope instead of managing it as React state.
- Frontmatter stripping is now implemented both in the MDX `h2` component and via the `StripFrontmatter` DOM helper, which is brittle and potentially fragile across layout changes; it would be more robust to centralize this behavior (e.g., via the existing remark frontmatter plugins in the MDX pipeline) rather than manipulating the DOM after render.
- The `h2` frontmatter guard in `mdx-components.tsx` only triggers when `children` is a plain string, but MDX often passes headings as arrays or nested nodes; consider normalizing `children` (e.g., with `React.Children.toArray` + `textContent` extraction) so frontmatter detection works reliably across MDX documents.

## Individual Comments

### Comment 1
<location> `app/components/footer.tsx:62-70` </location>
<code_context>
     setTimeout(() => setStatus("idle"), 3000)
   }

+  const [year, setYear] = useState<number | null>(null)
+
+  useEffect(() => {
</code_context>

<issue_to_address>
**suggestion:** Using state and an effect for the year is unnecessary and briefly renders an empty value.

You can replace this `useState`/`useEffect` pair with a direct `new Date().getFullYear()` (or a hard-coded year), which is safe to run on the server and avoids extra client logic and the transient empty value on first render.

Suggested implementation:

```typescript
import Link from "next/link"
import { Button } from "@/ui/button"
import { Input } from "@/ui/input"

```

```typescript
    setTimeout(() => setStatus("idle"), 3000)
  }

  const year = new Date().getFullYear()

```
</issue_to_address>

### Comment 2
<location> `tests/docs-hello-world.test.ts:1-2` </location>
<code_context>
+import { describe, it, expect } from 'vitest';
+const { sayHello } = require('../docs/hello-world.js');
+
+describe('Docs Hello World', () => {
</code_context>

<issue_to_address>
**suggestion:** Align test module style and typings with the rest of the codebase

Since this is a TypeScript test file and the repo favors ES modules, use an `import` with typing instead of `require`, e.g.

```ts
import { sayHello } from '../docs/hello-world';
```

This ensures proper type-checking and avoids potential CommonJS/ESM interop issues if `docs/hello-world` is updated later.

```suggestion
import { describe, it, expect } from 'vitest';
import { sayHello } from '../docs/hello-world';
```
</issue_to_address>

### Comment 3
<location> `docs/components/app-dashboard-documentation.md:39-49` </location>
<code_context>
+
+```mermaid
+graph TD
+  App[NextJS App] --> DashboardPage[app/dashboard/page.tsx]
+  DashboardPage --> DashboardProviders[DashboardProviders/providers.tsx]
+  DashboardProviders --> ReactQuery[React Query (QueryClient)]
</code_context>

<issue_to_address>
**nitpick (typo):** Align the "NextJS" label with the "Next.js" naming used elsewhere.

In the mermaid diagram this node is labeled `NextJS App`, but elsewhere you use `Next.js` (e.g., "Next.js 16"). Please update the node label to `Next.js App` for consistency.

```suggestion
```mermaid
graph TD
  App[Next.js App] --> DashboardPage[app/dashboard/page.tsx]
  DashboardPage --> DashboardProviders[DashboardProviders/providers.tsx]
  DashboardProviders --> ReactQuery[React Query (QueryClient)]
  DashboardPage --> Header[StatGrid / Cards]
  DashboardPage --> Content[Cards: Agents, Workflows, Traces]
  Content --> Subcomponents[_components/*: StatCard, DataTable, Sidebar, DetailPanel]
  DataFetch --> Hooks[lib/hooks/use-dashboard-queries]
  Hooks --> MastraAPI[Mastra Backend]
```
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +62 to 70
const [year, setYear] = useState<number | null>(null)

useEffect(() => {
setYear(new Date().getFullYear())
}, [])

return (
<footer className="border-t border-border bg-background">
{/* Newsletter section */}
Copy link

Choose a reason for hiding this comment

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

suggestion: Using state and an effect for the year is unnecessary and briefly renders an empty value.

You can replace this useState/useEffect pair with a direct new Date().getFullYear() (or a hard-coded year), which is safe to run on the server and avoids extra client logic and the transient empty value on first render.

Suggested implementation:

import Link from "next/link"
import { Button } from "@/ui/button"
import { Input } from "@/ui/input"
    setTimeout(() => setStatus("idle"), 3000)
  }

  const year = new Date().getFullYear()

Comment on lines +1 to +2
import { describe, it, expect } from 'vitest';
const { sayHello } = require('../docs/hello-world.js');
Copy link

Choose a reason for hiding this comment

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

suggestion: Align test module style and typings with the rest of the codebase

Since this is a TypeScript test file and the repo favors ES modules, use an import with typing instead of require, e.g.

import { sayHello } from '../docs/hello-world';

This ensures proper type-checking and avoids potential CommonJS/ESM interop issues if docs/hello-world is updated later.

Suggested change
import { describe, it, expect } from 'vitest';
const { sayHello } = require('../docs/hello-world.js');
import { describe, it, expect } from 'vitest';
import { sayHello } from '../docs/hello-world';

date_created: 2025-12-06
last_updated: 2025-12-06
owner: AgentStack Frontend Team
tags: [component, ui, chat, provider, documentation]

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when references to undefined definitions are found. Note documentation

[no-undefined-references] Found reference to undefined definition
date_created: 2025-12-06
last_updated: 2025-12-06
owner: AgentStack Frontend Team
tags: [component, ui, chat, provider, documentation]

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when shortcut reference links are used. Note documentation

[no-shortcut-reference-link] Use the trailing [] on reference links
date_created: 2025-12-06
last_updated: 2025-12-06
owner: AgentStack Frontend Team
tags: [component, ui, dashboard, observability, admin]

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when references to undefined definitions are found. Note documentation

[no-undefined-references] Found reference to undefined definition
date_created: 2025-12-06
last_updated: 2025-12-06
owner: AgentStack Frontend Team
tags: [component, ui, dashboard, observability, admin]

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when shortcut reference links are used. Note documentation

[no-shortcut-reference-link] Use the trailing [] on reference links
date_created: 2025-12-06
last_updated: 2025-12-06
owner: AgentStack Frontend Team
tags: [component, ui, networks, provider, documentation]

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when references to undefined definitions are found. Note documentation

[no-undefined-references] Found reference to undefined definition
date_created: 2025-12-06
last_updated: 2025-12-06
owner: AgentStack Frontend Team
tags: [component, ui, networks, provider, documentation]

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when shortcut reference links are used. Note documentation

[no-shortcut-reference-link] Use the trailing [] on reference links
date_created: 2025-12-06
last_updated: 2025-12-06
owner: AgentStack Frontend Team
tags: [component, ui, workflows, visualization, provider]

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when references to undefined definitions are found. Note documentation

[no-undefined-references] Found reference to undefined definition
date_created: 2025-12-06
last_updated: 2025-12-06
owner: AgentStack Frontend Team
tags: [component, ui, workflows, visualization, provider]

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when shortcut reference links are used. Note documentation

[no-shortcut-reference-link] Use the trailing [] on reference links
date_created: 2025-12-06
last_updated: 2025-12-06
owner: AgentStack Frontend Team
tags: [library, client, sdk, hooks, types, docs]

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when references to undefined definitions are found. Note documentation

[no-undefined-references] Found reference to undefined definition
date_created: 2025-12-06
last_updated: 2025-12-06
owner: AgentStack Frontend Team
tags: [library, client, sdk, hooks, types, docs]

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when shortcut reference links are used. Note documentation

[no-shortcut-reference-link] Use the trailing [] on reference links
@ssdeanx ssdeanx merged commit 890b9e1 into main Dec 6, 2025
103 of 106 checks passed
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This is a substantial and valuable pull request that significantly refactors agent configurations, improves the documentation structure, and enhances the MDX handling for better compatibility and developer experience. The move to TypeScript's satisfies operator for provider options is a great improvement for type safety, and the cleanup of deprecated flags and unused components is well-executed. The introduction of new layouts for the blog and docs sections, along with the centralized blog data, greatly improves code organization and maintainability. I've identified a critical issue with a component import in the new blog post page that will likely cause a build failure, along with a few medium-severity suggestions to improve code style and maintainability by addressing formatting and magic numbers. Overall, this is a very strong set of changes.

Comment on lines +3 to +44
export default function SessionSummary() {
const title = "Dev Session: Docs, MDX, Layouts & Fixes"
const date = "2025-12-06"
const readTime = "4 min read"
return (
<BlogLayout title={title} date={date} readTime={readTime} category="Dev Diary">
<section className="prose max-w-none mdx-content">
<p>
This development session implemented a number of fixes and improvements across the repo —
focusing on the documentation system, MDX handling, page layouts, and developer ergonomics.
</p>

<h2>What I changed</h2>
<ul>
<li>Added docs layout with a persistent Navbar + left Sidebar for documentation pages.</li>
<li>Created a blog layout that also keeps the Navbar and adds a Recent posts sidebar.</li>
<li>Fixed several MDX loader/frontmatter issues and installed the missing MDX loader.
Added a defensive client-side strip of raw frontmatter while we stabilize server-side parsing.</li>
<li>Added OO-style documentation files under <code>docs/components/</code> for app/chat, app/networks, app/workflows, app/dashboard, and lib/.</li>
<li>Extracted blog post data into a shared file and added this session summary post.</li>
</ul>

<h2>Why this matters</h2>
<p>
These changes improve the developer experience when writing docs and blog posts, prevent
hydration mismatches caused by stray MDX frontmatter, and standardize layouts across docs
and blog sections so navigation is consistent.
</p>

<h2>Next steps</h2>
<ol>
<li>Replace the frontmatter runtime guard with a robust server-side parsing pipeline so
metadata becomes first-class page metadata rather than visible content.</li>
<li>Convert selected MDX docs to use true frontmatter exports and canonical metadata.</li>
<li>Add automated tests for MDX rendering and layout presence to prevent regressions.</li>
</ol>

<p>— Dev session complete</p>
</section>
</BlogLayout>
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

There seems to be a confusion with the BlogLayout component being used here. This page imports a named export BlogLayout from app/components/blog-layout and passes props like title and date.

However, this pull request also introduces a new Next.js route layout at app/blog/layout.tsx, which is a default export and only accepts children. This session-summary page will be wrapped by that route layout.

This will likely cause a build error or a runtime error due to one of the following reasons:

  1. The component at app/components/blog-layout.tsx is missing from this pull request.
  2. The import path is incorrect.
  3. There's a naming collision and this page is intended to be simpler, without the wrapping BlogLayout component.

Please verify the implementation. If app/components/blog-layout.tsx is a new component, it should be included in this PR. If it's an existing component, ensure it's being used correctly in the context of the new app/blog/layout.tsx route layout.

<div className="sticky top-20 rounded-lg border border-border bg-card p-4">
<div className="mb-3 text-sm font-semibold text-muted-foreground">Recent posts</div>
<ul className="space-y-3">
{BLOG_POSTS.slice(0, 5).map((p) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The number 5 is used here as a magic number to limit the number of recent posts. It's better to define this as a named constant at the top of the file for better readability and maintainability.

For example:

const RECENT_POSTS_COUNT = 5;

// ... later in the component
{BLOG_POSTS.slice(0, RECENT_POSTS_COUNT).map((p) => (

if (!main) return

// look at the first few block children
const candidates = Array.from(main.children).slice(0, 3)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The number 3 is used here as a magic number to determine how many child elements to check for frontmatter. This should be extracted into a named constant to improve clarity and make it easier to adjust in the future.

For example:

const CANDIDATE_ELEMENTS_TO_INSPECT = 3;

// ... in useEffect
const candidates = Array.from(main.children).slice(0, CANDIDATE_ELEMENTS_TO_INSPECT);

Comment on lines +588 to 590
<Button variant="outline" size="lg" asChild>
<Link href="/contact">Request a Tool</Link>
</Button>
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The indentation of this <Button> component seems to be incorrect. It's indented one level too deep, which misaligns it with the preceding 'Build Custom Tool' button.

Suggested change
<Button variant="outline" size="lg" asChild>
<Link href="/contact">Request a Tool</Link>
</Button>
<Button variant="outline" size="lg" asChild>
<Link href="/contact">Request a Tool</Link>
</Button>

@greptile-apps
Copy link

greptile-apps bot commented Dec 6, 2025

Greptile Overview

Greptile Summary

This PR modernizes agent provider configurations and improves the development experience with better MDX handling and navigation structure.

Major Changes:

  • Updated all agent provider options to use TypeScript satisfies operator with GoogleGenerativeAIProviderOptions for improved type safety
  • Removed deprecated structuredOutput flags from agent configurations across 20+ agent files
  • Changed navigation routes from /test to /networks throughout the UI
  • Enhanced Turbopack compatibility by converting MDX plugin imports from functions to string specifiers
  • Added MDX frontmatter handling utilities to prevent accidental rendering of metadata
  • Refactored blog data into separate module for better organization
  • Updated footer to use useEffect for dynamic year calculation to avoid hydration mismatches

Issues Found:

  • Unused variable model in src/mastra/agents/codingAgents.ts:9
  • Commented-out code in codingAgents.ts (lines 120, 142) should be removed
  • Empty outputProcessors arrays in multiple agent files can be removed for cleaner code

Impact:
The breaking changes require attention to navigation routing and may require dependency version updates for agent configurations. The MDX improvements enhance developer experience with better Turbopack support.

Confidence Score: 4/5

  • This PR is safe to merge with minor cleanup recommended
  • The changes are well-structured and consistent across the codebase. Type safety improvements with satisfies operator are excellent. The main issues are cosmetic (unused variables, commented code, empty arrays) that don't affect functionality. The breaking changes are well-documented in the PR description.
  • Pay attention to src/mastra/agents/codingAgents.ts which has unused variables and commented-out code that should be cleaned up before merge

Important Files Changed

File Analysis

Filename Score Overview
src/mastra/agents/codingAgents.ts 3/5 Updated provider configurations with satisfies GoogleGenerativeAIProviderOptions and removed deprecated structuredOutput flags. Contains unused variable model and commented-out code that should be cleaned up.
src/mastra/agents/researchAgent.ts 4/5 Removed deprecated structuredOutput flag, removed Google-specific tools (googleSearch, codeExecution, urlContext), and removed BatchPartsProcessor from outputProcessors. TypeScript typing improved with satisfies operator.
src/mastra/agents/businessLegalAgents.ts 4/5 Removed structuredOutput, maxOutputTokens, temperature, and topP configurations. Added TypeScript typing with satisfies operator for better type safety.
app/components/navbar.tsx 5/5 Updated navigation links from /test (Demo) to /networks (Networks). Clean routing update consistent with the PR's breaking change.
next.config.ts 5/5 Changed MDX plugin imports from function imports to string specifiers for Turbopack compatibility. Added helpful comments explaining the serialization requirement.
mdx-components.tsx 5/5 Added frontmatter filtering logic to h2 component to prevent rendering metadata as page content. Includes clear comments explaining the rationale.

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Agent as Agent Configuration
    participant Provider as Google AI Provider
    participant UI as UI Components
    participant MDX as MDX Processor
    
    Note over Dev,MDX: Agent Provider Configuration Update
    Dev->>Agent: Remove structuredOutput flag
    Dev->>Agent: Add satisfies GoogleGenerativeAIProviderOptions
    Agent->>Provider: Type-safe configuration
    Provider-->>Agent: Validated options
    
    Note over Dev,MDX: Navigation Structure Change
    Dev->>UI: Update navbar routes
    UI->>UI: Replace /test → /networks
    UI-->>Dev: Updated navigation
    
    Note over Dev,MDX: MDX Frontmatter Handling
    Dev->>MDX: Change plugin imports to strings
    MDX->>MDX: Enable Turbopack serialization
    Dev->>UI: Add StripFrontmatter component
    Dev->>UI: Add h2 filtering in mdx-components
    MDX-->>UI: Prevent frontmatter rendering
    
    Note over Dev,UI: Blog Organization
    Dev->>UI: Extract blog data to separate module
    Dev->>UI: Create blog layout with sidebar
    UI-->>Dev: Improved maintainability
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

47 files reviewed, 5 comments

Edit Code Review Agent Settings | Greptile

import { google, GoogleGenerativeAIProviderOptions } from '@ai-sdk/google';


const model = google('gemini-2.5-flash');
Copy link

Choose a reason for hiding this comment

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

syntax: Unused variable model declared but never used

Suggested change
const model = google('gemini-2.5-flash');
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/mastra/agents/codingAgents.ts
Line: 9:9

Comment:
**syntax:** Unused variable `model` declared but never used

```suggestion
```

How can I resolve this? If you propose a fix, please make it concise.

searchCode,
getFileContent,
...githubMCP.getTools(),
// ...githubMCP.getTools(),
Copy link

Choose a reason for hiding this comment

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

style: Commented-out code should be removed

Suggested change
// ...githubMCP.getTools(),
},
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/mastra/agents/codingAgents.ts
Line: 120:120

Comment:
**style:** Commented-out code should be removed

```suggestion
  },
```

How can I resolve this? If you propose a fix, please make it concise.

],
})

//log.info('Cached tokens:', providerMetadata.google?.usageMetadata);
Copy link

Choose a reason for hiding this comment

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

style: Commented-out debug code should be removed

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/mastra/agents/codingAgents.ts
Line: 142:142

Comment:
**style:** Commented-out debug code should be removed

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 138 to 139
outputProcessors: [
new BatchPartsProcessor({ batchSize: 5, maxWaitTime: 100, emitOnNonText: true }),
],
Copy link

Choose a reason for hiding this comment

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

style: Empty outputProcessors array can be removed entirely for cleaner code

Suggested change
outputProcessors: [
new BatchPartsProcessor({ batchSize: 5, maxWaitTime: 100, emitOnNonText: true }),
],
})
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/mastra/agents/codingAgents.ts
Line: 138:139

Comment:
**style:** Empty `outputProcessors` array can be removed entirely for cleaner code

```suggestion
})
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 253 to 254
outputProcessors: [
new BatchPartsProcessor({
batchSize: 5,
maxWaitTime: 100,
emitOnNonText: true,
}),
],
Copy link

Choose a reason for hiding this comment

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

style: Empty outputProcessors array can be removed

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/mastra/agents/researchAgent.ts
Line: 253:254

Comment:
**style:** Empty `outputProcessors` array can be removed

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors agent provider configurations across the codebase, adding explicit TypeScript typing using the satisfies operator. It also updates navigation from demo/test routes to networks, improves MDX frontmatter handling for Turbopack compatibility, and reorganizes blog data into a separate module.

Key Changes

  • Added satisfies GoogleGenerativeAIProviderOptions to all agent provider configurations for improved type safety
  • Removed deprecated structuredOutput flags and cleaned up unnecessary provider options
  • Replaced /test routes with /networks navigation throughout the UI
  • Added MDX loader packages and improved frontmatter handling to prevent hydration mismatches

Reviewed changes

Copilot reviewed 47 out of 51 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/mastra/agents/*.ts Updated all agent files with typed provider options and removed deprecated flags
app/components/navbar.tsx Changed Demo link to Networks
app/components/footer.tsx Added useEffect hook for dynamic year to prevent hydration mismatches
next.config.ts Updated MDX plugins to use string specifiers for Turbopack compatibility
mdx-components.tsx Added frontmatter filtering logic to prevent duplicate metadata rendering
app/docs/layout.tsx New docs layout with persistent navbar and sidebar
app/blog/layout.tsx New blog layout with sidebar showing recent posts
app/components/blog-data.tsx Extracted blog posts data into shared module
docs/components/*.md Added comprehensive technical documentation for major app sections
package.json Added MDX loader and frontmatter handling dependencies
tests/docs-hello-world.test.ts New test file for docs hello world example
Comments suppressed due to low confidence (6)

src/mastra/agents/scriptWriterAgent.ts:1

  • The import of webScraperTool is added but there's no test coverage for this tool integration in the scriptWriterAgent. Consider adding tests to verify the tool is properly configured and can be invoked by the agent.
    src/mastra/agents/researchAgent.ts:1
  • The agent now supports IMAGE response modality, but there's no test coverage verifying that image responses are properly handled. Add tests to ensure image responses from the provider are correctly processed.
    src/mastra/agents/editorAgent.ts:1
  • Removing all tools from editorAgent (previously had code_execution and google_search) is a significant change that should be covered by tests to verify the agent still functions correctly without these tools.
    src/mastra/agents/codingAgents.ts:1
  • Commented-out code should be removed rather than left in the codebase. If this code needs to be temporarily disabled, use a feature flag or configuration option instead.
    src/mastra/agents/codingAgents.ts:1
  • Commented-out debug logging should be removed. If this logging is needed for debugging, implement it properly with a debug flag or remove it entirely.
    src/mastra/agents/codingAgents.ts:1
  • The model variable is defined but never used in this file, and there's excessive whitespace between imports. Remove the unused variable and clean up the import spacing.

: [];

return await Promise.all([
return Promise.all([
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

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

Removing the await keyword before Promise.all() is correct since the function is already async and the caller will await the result. However, ensure error handling in callers is updated if needed, as errors will now be thrown at the caller level rather than caught here.

Suggested change
return Promise.all([
return await Promise.all([

Copilot uses AI. Check for mistakes.
Comment on lines +62 to +67
const [year, setYear] = useState<number | null>(null)

useEffect(() => {
setYear(new Date().getFullYear())
}, [])

Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

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

Initializing year as null and setting it in useEffect causes an initial render with an empty string which could create a layout shift. Consider initializing with new Date().getFullYear() directly or using a more elegant pattern like useState(() => new Date().getFullYear()) to avoid the initial null state.

Suggested change
const [year, setYear] = useState<number | null>(null)
useEffect(() => {
setYear(new Date().getFullYear())
}, [])
const [year] = useState(() => new Date().getFullYear())

Copilot uses AI. Check for mistakes.
Comment on lines +85 to +86
remarkPlugins: ["remark-gfm"],
rehypePlugins: ["rehype-highlight"],
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

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

Using string specifiers for plugins is a workaround for Turbopack serialization. Consider documenting this as a known limitation and adding a TODO to revert to function imports once Turbopack supports non-serializable options.

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +29
h2: ({ children }) => {
// Skip rendering accidental MDX frontmatter that may appear verbatim
// in documents when frontmatter parsing is disabled. Frontmatter
// typically contains `title:` and `description:` keys; if we detect
// that pattern, render nothing to avoid duplicating metadata in the page
// body and to prevent SSR/CSR hydration mismatches.
if (typeof children === "string") {
const lower = children.toLowerCase()
if (lower.includes("title:") && lower.includes("description:")) return null
}

return (
<h2 className="mb-4 mt-10 text-2xl font-bold text-foreground scroll-m-20">
{children}
</h2>
)
},
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

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

This frontmatter detection logic is fragile and could hide legitimate h2 headings that happen to contain these words. Consider implementing proper server-side frontmatter parsing instead of this client-side workaround.

Suggested change
h2: ({ children }) => {
// Skip rendering accidental MDX frontmatter that may appear verbatim
// in documents when frontmatter parsing is disabled. Frontmatter
// typically contains `title:` and `description:` keys; if we detect
// that pattern, render nothing to avoid duplicating metadata in the page
// body and to prevent SSR/CSR hydration mismatches.
if (typeof children === "string") {
const lower = children.toLowerCase()
if (lower.includes("title:") && lower.includes("description:")) return null
}
return (
<h2 className="mb-4 mt-10 text-2xl font-bold text-foreground scroll-m-20">
{children}
</h2>
)
},
h2: ({ children }) => (
<h2 className="mb-4 mt-10 text-2xl font-bold text-foreground scroll-m-20">
{children}
</h2>
),

Copilot uses AI. Check for mistakes.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 25

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (6)
src/mastra/agents/image_to_csv.ts (1)

123-133: Align responseModalities with CSV-only contract

The system prompt mandates returning only a CSV string, but responseModalities allows ['TEXT', 'IMAGE']. Depending on the Google model, this may encourage multimodal responses (e.g., image output) that violate the agent’s expected text-only contract. Consider restricting to TEXT unless you explicitly handle image responses downstream.

-          mediaResolution: 'MEDIA_RESOLUTION_MEDIUM',
-          responseModalities: ['TEXT', 'IMAGE'],
+          mediaResolution: 'MEDIA_RESOLUTION_MEDIUM',
+          responseModalities: ['TEXT'],
src/mastra/agents/stockAnalysisAgent.ts (1)

7-12: Remove unused scorer imports.

These scorer imports are no longer used after the removal of the scorers configuration block. Removing unused imports improves code maintainability and reduces bundle size.

Apply this diff to remove the unused imports:

-import {
-  financialDataScorer,
-  responseQualityScorer,
-  sourceDiversityScorer,
-  taskCompletionScorer,
-} from '../scorers'
src/mastra/agents/businessLegalAgents.ts (1)

55-123: Finish standardizing Google provider options and removing structuredOutput flags

legalResearchAgent has been updated to:

  • Use } satisfies GoogleGenerativeAIProviderOptions on providerOptions.google.
  • Drop deprecated fields like structuredOutput.

However, in the same file:

  • contractAnalysisAgent, complianceMonitoringAgent, and businessStrategyAgent still set structuredOutput: true inside providerOptions.google and don’t use the satisfies GoogleGenerativeAIProviderOptions pattern.

Given the PR objective to remove the deprecated structuredOutput flag and standardize Google provider typing, it would be good to:

  • Remove structuredOutput (and any other deprecated fields) from these remaining agents’ providerOptions.google blocks.
  • Optionally apply the same satisfies GoogleGenerativeAIProviderOptions constraint there for consistency and type safety.

This keeps all business/legal agents aligned with the new provider configuration contract.

src/mastra/agents/dane.ts (1)

13-15: Unused userId variable.

The userId is extracted from runtimeContext but never used in the instruction content. This pattern repeats across all agent definitions in this file (lines 14, 46, 75, 110, 146).

Either remove the unused variable or interpolate it into the content:

  instructions: ({ runtimeContext }) => {
-   const userId = runtimeContext.get('userId');
    return {
      role: 'system',
      content: `
    You are Dane, the ultimate GitHub operator.
src/mastra/agents/recharts.ts (1)

3-3: Unused import: BatchPartsProcessor.

The BatchPartsProcessor is imported but not used anywhere in the file. Based on the AI summary, outputProcessors configurations using this processor were removed. Clean up the import.

-import { BatchPartsProcessor, UnicodeNormalizer } from '@mastra/core/processors'
+import { UnicodeNormalizer } from '@mastra/core/processors'
src/mastra/agents/sql.ts (1)

16-19: Unused language variable.

The language is extracted from runtimeContext but never used in the instruction content. Either remove it or use it for localized responses.

  instructions: ({ runtimeContext }: { runtimeContext: RuntimeContext<SqlAgentRuntimeContext> }) => {
-   // runtimeContext is read at invocation time
    const userTier = runtimeContext.get('user-tier') ?? 'free'
-   const language = runtimeContext.get('language') ?? 'en'

    return {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5734742 and 4fed9cb.

⛔ Files ignored due to path filters (4)
  • docs/{0CA9633D-6C14-4807-930B-94B218D510C2}.png is excluded by !**/*.png
  • networksCustomToolv1.png is excluded by !**/*.png
  • networksv1.png is excluded by !**/*.png
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (47)
  • README.md (1 hunks)
  • app/api-reference/openapi-schema/page.mdx (1 hunks)
  • app/blog/layout.tsx (1 hunks)
  • app/blog/session-summary/page.tsx (1 hunks)
  • app/components/blog-data.tsx (1 hunks)
  • app/components/blog-list.tsx (1 hunks)
  • app/components/footer.tsx (3 hunks)
  • app/components/navbar.tsx (2 hunks)
  • app/components/networks-list.tsx (1 hunks)
  • app/components/sidebar.tsx (1 hunks)
  • app/components/strip-frontmatter.tsx (1 hunks)
  • app/components/tools-list.tsx (3 hunks)
  • app/docs/getting-started/page.mdx (1 hunks)
  • app/docs/layout.tsx (1 hunks)
  • app/docs/page.tsx (0 hunks)
  • docs/components/app-chat-documentation.md (1 hunks)
  • docs/components/app-dashboard-documentation.md (1 hunks)
  • docs/components/app-networks-documentation.md (1 hunks)
  • docs/components/app-workflows-documentation.md (1 hunks)
  • docs/components/lib-documentation.md (1 hunks)
  • mdx-components.tsx (1 hunks)
  • next.config.ts (1 hunks)
  • package.json (1 hunks)
  • src/components/ai-elements/code-block.tsx (1 hunks)
  • src/mastra/agents/acpAgent.ts (1 hunks)
  • src/mastra/agents/businessLegalAgents.ts (2 hunks)
  • src/mastra/agents/calendarAgent.ts (2 hunks)
  • src/mastra/agents/codingAgents.ts (7 hunks)
  • src/mastra/agents/contentStrategistAgent.ts (2 hunks)
  • src/mastra/agents/copywriterAgent.ts (2 hunks)
  • src/mastra/agents/csv_to_excalidraw.ts (2 hunks)
  • src/mastra/agents/dane.ts (6 hunks)
  • src/mastra/agents/editorAgent.ts (3 hunks)
  • src/mastra/agents/evaluationAgent.ts (2 hunks)
  • src/mastra/agents/excalidraw_validator.ts (2 hunks)
  • src/mastra/agents/image.ts (2 hunks)
  • src/mastra/agents/image_to_csv.ts (2 hunks)
  • src/mastra/agents/learningExtractionAgent.ts (2 hunks)
  • src/mastra/agents/package-publisher.ts (2 hunks)
  • src/mastra/agents/recharts.ts (5 hunks)
  • src/mastra/agents/reportAgent.ts (2 hunks)
  • src/mastra/agents/researchAgent.ts (2 hunks)
  • src/mastra/agents/scriptWriterAgent.ts (3 hunks)
  • src/mastra/agents/sql.ts (2 hunks)
  • src/mastra/agents/stockAnalysisAgent.ts (3 hunks)
  • src/mastra/agents/weather-agent.ts (2 hunks)
  • tests/docs-hello-world.test.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • app/docs/page.tsx
🧰 Additional context used
📓 Path-based instructions (19)
**/app/**

📄 CodeRabbit inference engine (.github/instructions/next-js.instructions.md)

Use the app/ directory structure for route handlers, server components, and client components (Next.js 13+). Prefer this over the pages/ directory for new projects.

Files:

  • app/components/sidebar.tsx
  • app/components/strip-frontmatter.tsx
  • app/components/blog-data.tsx
  • app/docs/getting-started/page.mdx
  • app/components/tools-list.tsx
  • app/blog/layout.tsx
  • app/docs/layout.tsx
  • app/components/navbar.tsx
  • app/components/blog-list.tsx
  • app/blog/session-summary/page.tsx
  • app/api-reference/openapi-schema/page.mdx
  • app/components/networks-list.tsx
  • app/components/footer.tsx
**/components/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/next-js.instructions.md)

Use PascalCase for component file names (e.g., ComponentName.jsx or ComponentName.tsx).

Files:

  • app/components/sidebar.tsx
  • app/components/strip-frontmatter.tsx
  • app/components/blog-data.tsx
  • app/components/tools-list.tsx
  • app/components/navbar.tsx
  • app/components/blog-list.tsx
  • app/components/networks-list.tsx
  • app/components/footer.tsx
  • src/components/ai-elements/code-block.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/next-js.instructions.md)

**/*.{js,jsx,ts,tsx}: Use next/dynamic for dynamic imports to load components only when needed, improving initial load time.
Use next/image component for automatic image optimization, including lazy loading and responsive images.
Use React.memo to prevent unnecessary re-renders of components.
Use the <Link prefetch> tag to prefetch pages that are likely to be visited.
Use getServerSideProps, getStaticProps, or server components for fetching data on the server-side.
Use SWR or React Query for client-side data fetching and caching.
Use CSS Modules, Styled Components, or Tailwind CSS for component-level styling. Prefer Tailwind CSS for rapid development.
Use React Context, Zustand, Jotai, or Recoil for managing global state. Avoid Redux unless necessary.
Use react-hook-form for managing forms and validation.
Only fetch the data that is needed by the component to avoid over-fetching.
Avoid long-running synchronous operations in the main thread to prevent blocking.
Always use setState or hooks to update state instead of mutating state directly.
Include a complete dependency array in useEffect hooks to prevent unexpected behavior.
Avoid writing server-side code in client components to prevent exposing secrets or causing unexpected behavior.
Use try...catch blocks for handling errors in asynchronous operations.
Implement error boundary components using getDerivedStateFromError or componentDidCatch lifecycle methods.
Sanitize user input to prevent Cross-Site Scripting (XSS) attacks. Be especially careful when rendering HTML directly from user input.
Store authentication tokens in HTTP-only cookies or local storage securely.
Implement role-based access control to restrict access to sensitive resources.
Clean up event listeners and timers in useEffect hooks to avoid memory leaks.
Only update state when necessary to reduce the number of re-renders and improve performance.
Use immutable data structures and avoid mutating data directly to prevent unexpected...

Files:

  • app/components/sidebar.tsx
  • src/mastra/agents/calendarAgent.ts
  • app/components/strip-frontmatter.tsx
  • src/mastra/agents/weather-agent.ts
  • app/components/blog-data.tsx
  • src/mastra/agents/evaluationAgent.ts
  • app/components/tools-list.tsx
  • src/mastra/agents/image_to_csv.ts
  • app/blog/layout.tsx
  • src/mastra/agents/researchAgent.ts
  • app/docs/layout.tsx
  • app/components/navbar.tsx
  • src/mastra/agents/contentStrategistAgent.ts
  • app/components/blog-list.tsx
  • src/mastra/agents/excalidraw_validator.ts
  • src/mastra/agents/copywriterAgent.ts
  • app/blog/session-summary/page.tsx
  • next.config.ts
  • src/mastra/agents/csv_to_excalidraw.ts
  • src/mastra/agents/stockAnalysisAgent.ts
  • src/mastra/agents/dane.ts
  • tests/docs-hello-world.test.ts
  • src/mastra/agents/image.ts
  • src/mastra/agents/businessLegalAgents.ts
  • app/components/networks-list.tsx
  • app/components/footer.tsx
  • src/mastra/agents/learningExtractionAgent.ts
  • src/mastra/agents/scriptWriterAgent.ts
  • src/mastra/agents/package-publisher.ts
  • mdx-components.tsx
  • src/mastra/agents/reportAgent.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/agents/sql.ts
  • src/mastra/agents/acpAgent.ts
  • src/mastra/agents/codingAgents.ts
  • src/mastra/agents/recharts.ts
  • src/components/ai-elements/code-block.tsx
app/**/*.{tsx,ts}

📄 CodeRabbit inference engine (app/AGENTS.md)

app/**/*.{tsx,ts}: Use Tailwind CSS 4 with oklch color variables for styling in Next.js App Router pages and layouts
Use React 19 latest features in component implementations within the app directory

Files:

  • app/components/sidebar.tsx
  • app/components/strip-frontmatter.tsx
  • app/components/blog-data.tsx
  • app/components/tools-list.tsx
  • app/blog/layout.tsx
  • app/docs/layout.tsx
  • app/components/navbar.tsx
  • app/components/blog-list.tsx
  • app/blog/session-summary/page.tsx
  • app/components/networks-list.tsx
  • app/components/footer.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never commit API keys or secrets to the repository; use maskSensitiveMessageData() helper from src/mastra/config/pg-storage.ts when logging

Files:

  • app/components/sidebar.tsx
  • src/mastra/agents/calendarAgent.ts
  • app/components/strip-frontmatter.tsx
  • src/mastra/agents/weather-agent.ts
  • app/components/blog-data.tsx
  • src/mastra/agents/evaluationAgent.ts
  • app/components/tools-list.tsx
  • src/mastra/agents/image_to_csv.ts
  • app/blog/layout.tsx
  • src/mastra/agents/researchAgent.ts
  • app/docs/layout.tsx
  • app/components/navbar.tsx
  • src/mastra/agents/contentStrategistAgent.ts
  • app/components/blog-list.tsx
  • src/mastra/agents/excalidraw_validator.ts
  • src/mastra/agents/copywriterAgent.ts
  • app/blog/session-summary/page.tsx
  • next.config.ts
  • src/mastra/agents/csv_to_excalidraw.ts
  • src/mastra/agents/stockAnalysisAgent.ts
  • src/mastra/agents/dane.ts
  • tests/docs-hello-world.test.ts
  • src/mastra/agents/image.ts
  • src/mastra/agents/businessLegalAgents.ts
  • app/components/networks-list.tsx
  • app/components/footer.tsx
  • src/mastra/agents/learningExtractionAgent.ts
  • src/mastra/agents/scriptWriterAgent.ts
  • src/mastra/agents/package-publisher.ts
  • mdx-components.tsx
  • src/mastra/agents/reportAgent.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/agents/sql.ts
  • src/mastra/agents/acpAgent.ts
  • src/mastra/agents/codingAgents.ts
  • src/mastra/agents/recharts.ts
  • src/components/ai-elements/code-block.tsx
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Next.js 16 App Router with React 19 for frontend development in the app/ directory

Files:

  • app/components/sidebar.tsx
  • app/components/strip-frontmatter.tsx
  • app/components/blog-data.tsx
  • app/components/tools-list.tsx
  • app/blog/layout.tsx
  • app/docs/layout.tsx
  • app/components/navbar.tsx
  • app/components/blog-list.tsx
  • app/blog/session-summary/page.tsx
  • app/components/networks-list.tsx
  • app/components/footer.tsx
{app,ui,src/components}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Tailwind CSS 4 with oklch color variables for styling in UI components

Files:

  • app/components/sidebar.tsx
  • app/components/strip-frontmatter.tsx
  • app/components/blog-data.tsx
  • app/components/tools-list.tsx
  • app/blog/layout.tsx
  • app/docs/layout.tsx
  • app/components/navbar.tsx
  • app/components/blog-list.tsx
  • app/blog/session-summary/page.tsx
  • app/components/networks-list.tsx
  • app/components/footer.tsx
  • src/components/ai-elements/code-block.tsx
{app,src/components}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

{app,src/components}/**/*.{ts,tsx}: Use shadcn/ui base components (34 components) located in ui/ directory for common UI elements
Use AI Elements library (30 components) from src/components/ai-elements/ for chat, reasoning, and canvas UIs

Files:

  • app/components/sidebar.tsx
  • app/components/strip-frontmatter.tsx
  • app/components/blog-data.tsx
  • app/components/tools-list.tsx
  • app/blog/layout.tsx
  • app/docs/layout.tsx
  • app/components/navbar.tsx
  • app/components/blog-list.tsx
  • app/blog/session-summary/page.tsx
  • app/components/networks-list.tsx
  • app/components/footer.tsx
  • src/components/ai-elements/code-block.tsx
**/*.{js,ts}

📄 CodeRabbit inference engine (.github/instructions/next-js.instructions.md)

Use parameterized queries or an ORM to prevent SQL injection attacks.

Files:

  • src/mastra/agents/calendarAgent.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/evaluationAgent.ts
  • src/mastra/agents/image_to_csv.ts
  • src/mastra/agents/researchAgent.ts
  • src/mastra/agents/contentStrategistAgent.ts
  • src/mastra/agents/excalidraw_validator.ts
  • src/mastra/agents/copywriterAgent.ts
  • next.config.ts
  • src/mastra/agents/csv_to_excalidraw.ts
  • src/mastra/agents/stockAnalysisAgent.ts
  • src/mastra/agents/dane.ts
  • tests/docs-hello-world.test.ts
  • src/mastra/agents/image.ts
  • src/mastra/agents/businessLegalAgents.ts
  • src/mastra/agents/learningExtractionAgent.ts
  • src/mastra/agents/scriptWriterAgent.ts
  • src/mastra/agents/package-publisher.ts
  • src/mastra/agents/reportAgent.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/agents/sql.ts
  • src/mastra/agents/acpAgent.ts
  • src/mastra/agents/codingAgents.ts
  • src/mastra/agents/recharts.ts
src/mastra/agents/**/*.ts

📄 CodeRabbit inference engine (src/mastra/AGENTS.md)

Add new agent definitions under src/mastra/agents that wire tools together into higher-level behaviors

Files:

  • src/mastra/agents/calendarAgent.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/evaluationAgent.ts
  • src/mastra/agents/image_to_csv.ts
  • src/mastra/agents/researchAgent.ts
  • src/mastra/agents/contentStrategistAgent.ts
  • src/mastra/agents/excalidraw_validator.ts
  • src/mastra/agents/copywriterAgent.ts
  • src/mastra/agents/csv_to_excalidraw.ts
  • src/mastra/agents/stockAnalysisAgent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/agents/image.ts
  • src/mastra/agents/businessLegalAgents.ts
  • src/mastra/agents/learningExtractionAgent.ts
  • src/mastra/agents/scriptWriterAgent.ts
  • src/mastra/agents/package-publisher.ts
  • src/mastra/agents/reportAgent.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/agents/sql.ts
  • src/mastra/agents/acpAgent.ts
  • src/mastra/agents/codingAgents.ts
  • src/mastra/agents/recharts.ts
src/mastra/agents/*.ts

📄 CodeRabbit inference engine (src/mastra/agents/AGENTS.md)

src/mastra/agents/*.ts: Agent file naming convention: Create agent files using kebab-case with .ts extension in /src/mastra/agents/ directory (e.g., your-agent-name.ts)
Each agent must follow the pattern: export agent as const yourAgent = new Agent({ id: 'your-agent-id', name: 'Your Agent Name', description: '...' })

Files:

  • src/mastra/agents/calendarAgent.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/evaluationAgent.ts
  • src/mastra/agents/image_to_csv.ts
  • src/mastra/agents/researchAgent.ts
  • src/mastra/agents/contentStrategistAgent.ts
  • src/mastra/agents/excalidraw_validator.ts
  • src/mastra/agents/copywriterAgent.ts
  • src/mastra/agents/csv_to_excalidraw.ts
  • src/mastra/agents/stockAnalysisAgent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/agents/image.ts
  • src/mastra/agents/businessLegalAgents.ts
  • src/mastra/agents/learningExtractionAgent.ts
  • src/mastra/agents/scriptWriterAgent.ts
  • src/mastra/agents/package-publisher.ts
  • src/mastra/agents/reportAgent.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/agents/sql.ts
  • src/mastra/agents/acpAgent.ts
  • src/mastra/agents/codingAgents.ts
  • src/mastra/agents/recharts.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Run eslint with --max-warnings=0 on src/**/*.{ts,tsx} to enforce linting standards

Files:

  • src/mastra/agents/calendarAgent.ts
  • src/mastra/agents/weather-agent.ts
  • src/mastra/agents/evaluationAgent.ts
  • src/mastra/agents/image_to_csv.ts
  • src/mastra/agents/researchAgent.ts
  • src/mastra/agents/contentStrategistAgent.ts
  • src/mastra/agents/excalidraw_validator.ts
  • src/mastra/agents/copywriterAgent.ts
  • src/mastra/agents/csv_to_excalidraw.ts
  • src/mastra/agents/stockAnalysisAgent.ts
  • src/mastra/agents/dane.ts
  • src/mastra/agents/image.ts
  • src/mastra/agents/businessLegalAgents.ts
  • src/mastra/agents/learningExtractionAgent.ts
  • src/mastra/agents/scriptWriterAgent.ts
  • src/mastra/agents/package-publisher.ts
  • src/mastra/agents/reportAgent.ts
  • src/mastra/agents/editorAgent.ts
  • src/mastra/agents/sql.ts
  • src/mastra/agents/acpAgent.ts
  • src/mastra/agents/codingAgents.ts
  • src/mastra/agents/recharts.ts
  • src/components/ai-elements/code-block.tsx
**/*.md

📄 CodeRabbit inference engine (.github/instructions/markdown.instructions.md)

**/*.md: Use appropriate heading levels (H2, H3, etc.) to structure markdown content. Do not use H1 headings, as these will be generated from the title. Use ## for H2 and ### for H3 in a hierarchical manner. Recommend restructuring if content includes H4 or higher levels.
Use bullet points (with -) or numbered lists (with 1.) for lists in markdown. Indent nested lists with two spaces and ensure proper indentation and spacing.
Use fenced code blocks (triple backticks) for code snippets in markdown. Specify the language after the opening backticks for syntax highlighting (e.g., csharp).
Use proper markdown syntax for links: [link text](URL). Ensure that link text is descriptive and URLs are valid and accessible.
Use proper markdown syntax for images: ![alt text](image URL). Include a brief description of the image in the alt text for accessibility.
Use markdown tables (with | delimiters) for tabular data. Ensure proper formatting, alignment, and inclusion of headers.
Limit line length to 80 characters in markdown for readability. Use soft line breaks for long paragraphs.
Use appropriate whitespace in markdown to separate sections and improve readability. Use blank lines between sections and avoid excessive whitespace.
Include YAML front matter at the beginning of markdown files with required metadata fields: post_title, author1, post_slug, microsoft_alias, featured_image, categories (from /categories.txt), tags, ai_note, summary, and post_date.

Files:

  • docs/components/app-workflows-documentation.md
  • README.md
  • docs/components/app-dashboard-documentation.md
  • docs/components/lib-documentation.md
  • docs/components/app-chat-documentation.md
  • docs/components/app-networks-documentation.md
**/app/**/layout.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/next-js.instructions.md)

**/app/**/layout.{js,jsx,ts,tsx}: Define layouts for routes and their children using layout.tsx or layout.jsx files within the app/ directory.
Use next/font to optimize font loading and prevent layout shift.

Files:

  • app/blog/layout.tsx
  • app/docs/layout.tsx
app/**/layout.tsx

📄 CodeRabbit inference engine (app/AGENTS.md)

Use React Server Components (RSC) architecture with Next.js 16 App Router for pages and layouts

Files:

  • app/blog/layout.tsx
  • app/docs/layout.tsx
**/app/**/page.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/next-js.instructions.md)

Represent route UIs using page.tsx or page.jsx files within the app/ directory structure.

Files:

  • app/blog/session-summary/page.tsx
**/next.config.{js,ts}

📄 CodeRabbit inference engine (.github/instructions/next-js.instructions.md)

**/next.config.{js,ts}: Integrate linting and formatting into the build process to ensure consistent code.
Analyze bundle size using tools like webpack-bundle-analyzer to identify large dependencies.
Use tree shaking to remove unused code from bundles.

Files:

  • next.config.ts
**/*.test.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.github/instructions/next-js.instructions.md)

**/*.test.{js,jsx,ts,tsx}: Write unit tests for individual components to ensure they are working correctly.
Use React Testing Library for component testing to encourage testing from a user perspective.
Mock external dependencies to isolate components during testing.
Use Jest or Mocha as a testing framework for unit and integration tests.
Use Mock Service Worker (msw) to intercept and mock API calls during testing.
Co-locate test files with components using a consistent naming convention (e.g., ComponentName.test.js).
Test edge cases and error conditions to ensure components are robust.

Files:

  • tests/docs-hello-world.test.ts
**/*.test.ts?(x)

📄 CodeRabbit inference engine (AGENTS.md)

Use Vitest for all unit testing in the Mastra project

Files:

  • tests/docs-hello-world.test.ts
🧬 Code graph analysis (6)
app/components/sidebar.tsx (1)
ui/link.tsx (1)
  • Link (22-49)
app/components/tools-list.tsx (1)
ui/link.tsx (1)
  • Link (22-49)
app/docs/layout.tsx (4)
app/components/navbar.tsx (1)
  • Navbar (95-379)
app/components/sidebar.tsx (1)
  • Sidebar (16-43)
app/components/strip-frontmatter.tsx (1)
  • StripFrontmatter (9-34)
app/components/footer.tsx (1)
  • Footer (46-242)
app/components/navbar.tsx (1)
ui/link.tsx (1)
  • Link (22-49)
app/blog/session-summary/page.tsx (1)
app/blog/layout.tsx (1)
  • BlogLayout (7-42)
src/mastra/agents/codingAgents.ts (1)
src/mastra/config/google.ts (1)
  • google (42-44)
🪛 LanguageTool
docs/components/app-workflows-documentation.md

[style] ~146-~146: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...ogress mapping. - High: Add support for very large workflows (virtualized canvas, paginate...

(EN_WEAK_ADJECTIVE)

docs/components/app-dashboard-documentation.md

[style] ~113-~113: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...ve tables should use virtualization for very large datasets. - Reliability: UI gracefully ...

(EN_WEAK_ADJECTIVE)


[style] ~132-~132: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ... virtualization for DataTable to handle very large result sets and include role-based test...

(EN_WEAK_ADJECTIVE)

docs/components/app-networks-documentation.md

[grammar] ~19-~19: Use a hyphen to join words.
Context: ...ts through multi-agent networks (A2A/MCP style workflows). - Expose a well-typed ...

(QB_NEW_EN_HYPHEN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Agent
  • GitHub Check: Sourcery review
  • GitHub Check: Codacy Security Scan
🔇 Additional comments (34)
src/components/ai-elements/code-block.tsx (1)

52-72: Directly returning Promise.all from highlightCode is correct

Returning Promise.all([...]) directly from this async function keeps the same observable behavior as the previous return await Promise.all([...]) in this context (no surrounding try/catch), and the call site using .then(([light, dark]) => ...) continues to work as before. No further changes needed here.

src/mastra/agents/package-publisher.ts (1)

175-181: Verify @ai-sdk/google package supports GoogleGenerativeAIProviderOptions with thinkingConfig.

The satisfies GoogleGenerativeAIProviderOptions pattern correctly enforces type safety. However, confirm that the installed @ai-sdk/google version exports this type and supports the thinkingConfig structure with thinkingBudget: -1. Since the PR notes potential dependency version updates, verify compatibility by checking package.json for the @ai-sdk/google version and referencing the current library documentation for the GoogleGenerativeAIProviderOptions interface definition.

src/mastra/agents/stockAnalysisAgent.ts (1)

27-27: Good addition for type safety.

The import of GoogleGenerativeAIProviderOptions enables the type constraint on line 223, ensuring the provider configuration is type-safe.

src/mastra/agents/excalidraw_validator.ts (2)

101-103: This configuration is consistent with the project-wide standard and does not require changes.

The responseModalities: ['TEXT', 'IMAGE'] configuration at lines 101-103 is a standard pattern used across virtually all agents in the codebase (calendarAgent, dane, image_to_csv, evaluationAgent, contentStrategistAgent, businessLegalAgents, researchAgent, reportAgent, and others). This appears to be an intentional architectural choice to provide the model with capability flexibility, not a copy-paste error specific to this agent. Removing 'IMAGE' from this agent alone would create inconsistency with the established codebase pattern.


4-4: The import and configuration options are correct. GoogleGenerativeAIProviderOptions is properly exported from @ai-sdk/google (v2.0.44+), and both responseModalities and mediaResolution are valid, documented options in the Gemini API. The responseModalities: ['TEXT', 'IMAGE'] configuration is standard across multiple agents in the codebase as part of the Google AI provider standardization.

src/mastra/agents/reportAgent.ts (1)

94-104: The satisfies operator usage and provider options are correct.

All properties and their values conform to the latest @ai-sdk/google API documentation:

  • thinkingConfig with thinkingLevel: 'medium', includeThoughts: true, and thinkingBudget: -1 (dynamic thinking) are valid
  • mediaResolution: 'MEDIA_RESOLUTION_MEDIUM' provides balanced image detail and cost
  • responseModalities: ['TEXT', 'IMAGE'] enables both text and image responses

The satisfies GoogleGenerativeAIProviderOptions type assertion correctly validates the configuration at compile time without widening the object type.

src/mastra/agents/codingAgents.ts (2)

105-108: Excellent tier-based model selection pattern.

The dynamic model selection based on user tier is well-implemented and properly typed. This pattern ensures enterprise users get the more capable model while keeping costs manageable for other tiers.


212-212: Excellent use of TypeScript satisfies for type safety.

The consistent application of the satisfies GoogleGenerativeAIProviderOptions operator across all agent configurations provides compile-time type checking while preserving the exact object structure. This prevents type errors without sacrificing type information.

Also applies to: 325-325, 436-436

src/mastra/agents/scriptWriterAgent.ts (2)

1-1: LGTM! Type import improves type safety.

The addition of GoogleGenerativeAIProviderOptions import enables proper TypeScript type checking via the satisfies operator, aligning with the PR's objective to add proper typing to agent configurations.


9-9: The import is correct and the webScraperTool is production-ready.

The webScraperTool provides enhanced functionality beyond the replaced tools. It includes:

  • HTML parsing with JSDOM and Cheerio fallback
  • CSS selector-based element extraction with attribute support
  • HTML-to-markdown conversion with sanitization
  • Secure file persistence with path validation
  • Comprehensive error handling, tracing, and progress reporting
  • XSS and injection attack prevention

The tool is well-implemented and appropriate for the Script Writer agent's needs.

app/components/navbar.tsx (2)

339-341: LGTM: Mobile navigation updated to Networks.

The mobile CTA correctly updates to match the desktop navigation changes, maintaining consistency across viewports.


235-235: LGTM: Desktop navigation updated to Networks.

The navigation link correctly updates from Demo to Networks, aligning with the PR's route changes from /test to /networks. The /networks route exists and is properly configured.

src/mastra/agents/weather-agent.ts (1)

10-10: No changes needed. The GoogleGenerativeAIProviderOptions type is correctly exported by @ai-sdk/google (v2.0.44+) and properly imported on line 10. The usage on line 46 with the satisfies constraint is valid and improves type safety as intended.

app/components/footer.tsx (1)

3-3: Dynamic year via client-side state looks correct

The year state + useEffect pattern is hook-safe and avoids server/client date mismatches; the year ?? '' fallback also prevents rendering null. Only minor tradeoff is a briefly empty year before hydration, which is acceptable here.

Also applies to: 62-67, 225-225

src/mastra/agents/image.ts (1)

6-6: Type‑constraining Google provider options is a good improvement

Using satisfies GoogleGenerativeAIProviderOptions on providerOptions.google gives you strong typing without changing runtime behavior, and the imageConfig block is kept minimal and clear. Please just confirm that imageConfig and its fields match the exact shape expected by your current @ai-sdk/google version.

Also applies to: 53-53

app/components/blog-list.tsx (1)

9-9: Externalizing BLOG_POSTS data looks good

Importing BLOG_POSTS from a shared blog-data module simplifies this component and enables reuse in layouts/sidebars, as long as the data shape (slug, date, readTime, etc.) remains consistent with the current usage.

app/components/tools-list.tsx (2)

405-407: String hrefs for dynamic tool docs routes are appropriate

Switching to href={/docs/tools/${tool.id}} simplifies the Link configuration and matches Next’s recommended pattern for [id] routes, while keeping the generated URLs unchanged.

Also applies to: 478-480


583-587: CTA links now use straightforward static paths

Using plain string hrefs ("/docs/tools/custom" and "/contact") for these CTAs is clear and avoids unnecessary pathname/query objects, with no behavioral change.

Also applies to: 588-590

src/mastra/agents/learningExtractionAgent.ts (1)

7-7: Aligning google provider options with GoogleGenerativeAIProviderOptions is good

Adding GoogleGenerativeAIProviderOptions and using } satisfies GoogleGenerativeAIProviderOptions on the google block gives compile‑time guarantees without changing behavior, which is exactly what we want for these configs. Please just verify that the current @ai-sdk/google version exposes this type and that thinkingConfig is still a valid field on it.

Also applies to: 55-62

app/components/networks-list.tsx (1)

86-88: String href for network detail routes is correct

Using href={/networks/${network.id}} is the idiomatic Next form for [id] routes and keeps the behavior of the previous pathname/query object while simplifying the code.

src/mastra/agents/researchAgent.ts (1)

165-174: Provider options typing change looks correct

Constraining providerOptions.google with satisfies GoogleGenerativeAIProviderOptions tightens typing without altering the runtime shape; no issues spotted here.

src/mastra/agents/csv_to_excalidraw.ts (1)

161-170: Consistent providerOptions typing

Using } satisfies GoogleGenerativeAIProviderOptions for providerOptions.google matches the pattern used in other agents and improves type safety without changing runtime behavior. Looks good.

src/mastra/agents/recharts.ts (1)

28-28: Type constraints applied consistently.

The satisfies GoogleGenerativeAIProviderOptions assertions provide compile-time type safety for the Google provider options across all four chart agents.

Also applies to: 116-116, 213-213, 361-361, 488-488

src/mastra/agents/calendarAgent.ts (1)

5-5: LGTM!

The type constraint is correctly applied, and unlike some other agents, this one properly uses the userId variable in the instruction content.

Also applies to: 42-42

app/docs/layout.tsx (1)

10-28: Layout structure looks good.

The server component layout correctly composes Navbar, Sidebar, Footer, and StripFrontmatter. The responsive design with conditional sidebar visibility follows Next.js App Router patterns.

app/blog/layout.tsx (1)

12-14: Docs Sidebar in Blog layout may cause confusion.

The Sidebar component renders documentation navigation sections (Getting Started, Core Concepts, etc.). In the blog layout, this might confuse users expecting blog-specific navigation. Verify this is intentional cross-navigation, or consider a blog-specific sidebar.

src/mastra/agents/sql.ts (1)

7-7: Type constraint correctly applied.

The satisfies GoogleGenerativeAIProviderOptions assertion provides type safety for the Google provider configuration.

Also applies to: 83-83

app/components/sidebar.tsx (1)

16-42: Clean sidebar implementation.

The component correctly uses usePathname for active link detection and follows responsive design patterns. The dynamic icon rendering via <s.icon /> is a nice pattern.

src/mastra/agents/dane.ts (1)

7-7: Type-safe provider options look good.

The satisfies operator correctly constrains the provider options to GoogleGenerativeAIProviderOptions without changing runtime behavior. This improves compile-time type checking across all agent configurations. The responseModalities: ['TEXT', 'IMAGE'] field is a valid option supported by the Google AI provider, as confirmed by its consistent usage across multiple agent files in the codebase.

src/mastra/agents/acpAgent.ts (1)

21-21: Type‑safe Google provider options look good, just confirm against SDK version

Using satisfies GoogleGenerativeAIProviderOptions on providerOptions.google is a solid way to keep the config aligned with the SDK without widening types; the current fields (thinkingConfig, responseModalities) look consistent with other agents in this repo. Please just ensure the project compiles cleanly with the current @ai-sdk/google version so any drift in option names is caught by TS.

Also applies to: 120-127

app/blog/session-summary/page.tsx (1)

1-44: SessionSummary blog page is straightforward and consistent with the new layout

The page cleanly wraps static content in BlogLayout with sensible metadata props and uses Tailwind prose styling; no issues from a routing or React/Next.js perspective.

src/mastra/agents/contentStrategistAgent.ts (1)

8-8: Consistent Google provider typing; confirm options against current SDK

The switch to } satisfies GoogleGenerativeAIProviderOptions for providerOptions.google matches the pattern used in other agents and helps catch misconfigured fields (e.g., mediaResolution, responseModalities) at compile time. Please confirm the current @ai-sdk/google version still expects these option names to avoid subtle type/config mismatches.

Also applies to: 79-89

src/mastra/agents/copywriterAgent.ts (1)

16-16: Type‑safe Google options plus lower media resolution—confirm intent

Using satisfies GoogleGenerativeAIProviderOptions on providerOptions.google is a good move for catching config drift at compile time. Setting mediaResolution: 'MEDIA_RESOLUTION_LOW' will reduce image quality/size versus a medium setting; that seems reasonable for a text‑first copywriter agent, but please confirm this downgrade is intentional for your UX and cost profile, and that it still matches the valid enum values in the current @ai-sdk/google version.

Also applies to: 115-125

src/mastra/agents/editorAgent.ts (1)

1-1: Provider typing is appropriate; empty tools array is intentional for this editor design

The import of GoogleGenerativeAIProviderOptions and the satisfies GoogleGenerativeAIProviderOptions annotation for providerOptions.google are correct. The tools: [] is valid and intentional—this agent is designed as a pure content editor relying on LLM reasoning and quality scorers rather than external tool invocation, which is appropriate for its role.

Comment on lines +7 to +8
export default function BlogLayout({ children }: { children: React.ReactNode }) {
return (
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Missing metadata export.

Unlike the docs layout, this layout doesn't export metadata. Add metadata for better SEO.

+export const metadata = {
+  title: "Blog - AgentStack",
+  description: "Latest news, tutorials, and insights from the AgentStack team",
+}
+
 export default function BlogLayout({ children }: { children: React.ReactNode }) {
📝 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
export default function BlogLayout({ children }: { children: React.ReactNode }) {
return (
export const metadata = {
title: "Blog - AgentStack",
description: "Latest news, tutorials, and insights from the AgentStack team",
}
export default function BlogLayout({ children }: { children: React.ReactNode }) {
return (
🤖 Prompt for AI Agents
In app/blog/layout.tsx around lines 7-8, the BlogLayout is missing an exported
metadata object for SEO; add an export const metadata placed above the default
export that includes at minimum title and description (and ideally
openGraph/title/description, canonical URL, and robots entries) matching the
blog context so Next.js can consume it for SEO; ensure the metadata shape
follows Next.js Metadata type (string fields or nested objects) and export it
alongside the default BlogLayout.

Comment on lines +21 to +31
{BLOG_POSTS.slice(0, 5).map((p) => (
<li key={p.slug}>
<Link href={`/blog/${p.slug}`} className="block text-sm text-muted-foreground hover:text-foreground">
<div className="flex items-center justify-between">
<span className="font-medium text-foreground">{p.title}</span>
<span className="text-xs text-muted-foreground">{p.date}</span>
</div>
<p className="text-xs text-muted-foreground line-clamp-2">{p.excerpt}</p>
</Link>
</li>
))}
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 adding prefetch to blog post links.

Per coding guidelines, use <Link prefetch> for pages likely to be visited. Recent posts in the sidebar are high-probability navigation targets.

-                   <Link href={`/blog/${p.slug}`} className="block text-sm text-muted-foreground hover:text-foreground">
+                   <Link href={`/blog/${p.slug}`} prefetch className="block text-sm text-muted-foreground hover:text-foreground">
📝 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
{BLOG_POSTS.slice(0, 5).map((p) => (
<li key={p.slug}>
<Link href={`/blog/${p.slug}`} className="block text-sm text-muted-foreground hover:text-foreground">
<div className="flex items-center justify-between">
<span className="font-medium text-foreground">{p.title}</span>
<span className="text-xs text-muted-foreground">{p.date}</span>
</div>
<p className="text-xs text-muted-foreground line-clamp-2">{p.excerpt}</p>
</Link>
</li>
))}
{BLOG_POSTS.slice(0, 5).map((p) => (
<li key={p.slug}>
<Link href={`/blog/${p.slug}`} prefetch className="block text-sm text-muted-foreground hover:text-foreground">
<div className="flex items-center justify-between">
<span className="font-medium text-foreground">{p.title}</span>
<span className="text-xs text-muted-foreground">{p.date}</span>
</div>
<p className="text-xs text-muted-foreground line-clamp-2">{p.excerpt}</p>
</Link>
</li>
))}
🤖 Prompt for AI Agents
In app/blog/layout.tsx around lines 21 to 31, the Link elements for the recent
posts don't enable prefetching; update the Link JSX inside the BLOG_POSTS.map to
include the prefetch prop (e.g., <Link href={`/blog/${p.slug}`} prefetch> or
prefetch={true}) so Next will prefetch those high-probability navigation
targets; make the change for each mapped Link and keep existing props and
classes intact.

Comment on lines +1 to +53
export const BLOG_POSTS = [
{
title: "Hello World with AgentStack (Mastra)",
excerpt:
"A 10-minute guide to get started with AgentStack, covering agents, tools, storage, MCP, and workflows.",
date: "2025-12-01",
readTime: "10 min read",
category: "Tutorial",
slug: "hello-world-agentstack",
},
{
title: "Introducing AgentStack: Multi-Agent Framework for Production",
excerpt:
"Learn how AgentStack simplifies building, deploying, and managing AI agents at scale with our new open-source framework.",
date: "2025-11-28",
readTime: "5 min read",
category: "Announcement",
slug: "introducing-agentstack",
},
{
title: "Building RAG Pipelines with PgVector",
excerpt:
"A comprehensive guide to implementing retrieval-augmented generation using PostgreSQL and vector embeddings.",
date: "2025-11-25",
readTime: "8 min read",
category: "Tutorial",
slug: "rag-pipelines-pgvector",
},
{
title: "Agent Orchestration Patterns",
excerpt: "Explore common patterns for coordinating multiple AI agents in complex workflows.",
date: "2025-11-20",
readTime: "6 min read",
category: "Architecture",
slug: "agent-orchestration-patterns",
},
{
title: "Observability for AI Applications",
excerpt: "How to implement tracing, monitoring, and debugging for your AI agent systems.",
date: "2025-11-15",
readTime: "7 min read",
category: "Best Practices",
slug: "observability-ai-applications",
},
{
title: "Dev Session: Repo fixes, MDX, docs, and layouts",
excerpt: "Summary of recent development session: docs layouts, MDX fixes, blog & docs layouts, sidebar, and tooling updates.",
date: "2025-12-06",
readTime: "4 min read",
category: "Dev Diary",
slug: "session-summary",
},
]
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Add TypeScript type definitions for blog post structure.

The exported BLOG_POSTS array lacks explicit TypeScript typing, which reduces type safety for consuming components.

Apply this diff to add proper typing:

+export interface BlogPost {
+  title: string;
+  excerpt: string;
+  date: string;
+  readTime: string;
+  category: string;
+  slug: string;
+}
+
-export const BLOG_POSTS = [
+export const BLOG_POSTS: readonly BlogPost[] = [
   {
     title: "Hello World with AgentStack (Mastra)",

Alternatively, if using Zod for runtime validation:

import { z } from 'zod';

const BlogPostSchema = z.object({
  title: z.string(),
  excerpt: z.string(),
  date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
  readTime: z.string(),
  category: z.string(),
  slug: z.string(),
});

export type BlogPost = z.infer<typeof BlogPostSchema>;
export const BLOG_POSTS = [...] as const satisfies readonly BlogPost[];
🤖 Prompt for AI Agents
In app/components/blog-data.tsx lines 1-53, the BLOG_POSTS export is untyped
which reduces type safety; add an explicit BlogPost type (or a Zod
BlogPostSchema with date regex) and annotate/export the BLOG_POSTS array as
readonly BlogPost[] (or use "as const satisfies readonly BlogPost[]") so
consuming components get proper typing and optional runtime validation if using
Zod; update imports/exports accordingly and ensure each object conforms to the
type (date string format, required fields).

Comment on lines +27 to +36
<Link
key={s.href}
href={s.href}
className={`flex items-center gap-3 rounded-md px-3 py-2 text-sm transition-all hover:bg-primary/5 ${
active ? "bg-primary/10 text-primary font-semibold" : "text-muted-foreground"
}`}
>
<s.icon className="size-4" />
{s.title}
</Link>
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 adding prefetch to navigation links.

Per coding guidelines, use <Link prefetch> for pages likely to be visited. Documentation sections are high-probability targets.

              <Link
                key={s.href}
                href={s.href}
+               prefetch
                className={`flex items-center gap-3 rounded-md px-3 py-2 text-sm transition-all hover:bg-primary/5 ${
                  active ? "bg-primary/10 text-primary font-semibold" : "text-muted-foreground"
                }`}
              >
📝 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
<Link
key={s.href}
href={s.href}
className={`flex items-center gap-3 rounded-md px-3 py-2 text-sm transition-all hover:bg-primary/5 ${
active ? "bg-primary/10 text-primary font-semibold" : "text-muted-foreground"
}`}
>
<s.icon className="size-4" />
{s.title}
</Link>
<Link
key={s.href}
href={s.href}
prefetch
className={`flex items-center gap-3 rounded-md px-3 py-2 text-sm transition-all hover:bg-primary/5 ${
active ? "bg-primary/10 text-primary font-semibold" : "text-muted-foreground"
}`}
>
<s.icon className="size-4" />
{s.title}
</Link>
🤖 Prompt for AI Agents
In app/components/sidebar.tsx around lines 27 to 36, the Link elements rendering
documentation/navigation entries should include the prefetch prop to improve
perceived navigation performance; update the Link JSX to add prefetch (e.g.
prefetch or prefetch={true}) for internal/documentation routes (ensure you only
add it for internal hrefs, not external links) and keep the existing
className/children unchanged.

Comment on lines +15 to +31
// look at the first few block children
const candidates = Array.from(main.children).slice(0, 3)
for (const el of candidates) {
const text = (el.textContent || "").trim().toLowerCase()
if (!text) continue
// common YAML frontmatter markers
if (text.startsWith("title:") || text.includes("title:") && text.includes("description:")) {
el.remove()
break
}
}
} catch (e) {
// intentionally no-op: if DOM shape is unexpected, don't break rendering
// eslint-disable-next-line no-console
console.debug("strip-frontmatter: no-op", e)
}
}, [])
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Clarify frontmatter detection condition for readability and intent

The core heuristic:

if (text.startsWith("title:") || text.includes("title:") && text.includes("description:")) {

relies on && binding tighter than ||, so it effectively means:

  • remove if text starts with title:, or
  • remove if it includes both title: and description:.

Given the comments mention “starts with title: or contains description:”, it would be clearer to:

  • Add parentheses to make the precedence explicit, and/or
  • Align the condition with the intended rule (e.g., include description:-only cases if that’s desired).

Example for clarity:

if (
  text.startsWith("title:") ||
  (text.includes("title:") && text.includes("description:"))
) {
  el.remove()
  break
}

This is a minor readability/intent tweak; the current implementation is otherwise safe and bounded.

🤖 Prompt for AI Agents
In app/components/strip-frontmatter.tsx around lines 15 to 31, the conditional
combining startsWith and includes relies on operator precedence which makes the
intent unclear; update the if to make precedence explicit by grouping the
includes checks with parentheses (or rewrite to two clearly separated
conditions) so it reads: remove element if text.startsWith("title:") OR
(text.includes("title:") AND text.includes("description:")), and optionally add
a short inline comment clarifying the heuristic.

import { log } from '../config/logger'
import { pgMemory } from '../config/pg-storage'
import { responseQualityScorer, structureScorer, taskCompletionScorer } from '../scorers'
import { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google'
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Google provider typing is solid; double‑check modality settings

Using satisfies GoogleGenerativeAIProviderOptions on providerOptions.google is a good move for type safety, and the new fields:

  • responseModalities: ['TEXT', 'IMAGE']
  • mediaResolution: 'MEDIA_RESOLUTION_LOW'

are reasonable if you truly plan to allow image responses here. Given this agent’s contract is “always respond with valid JSON only”, you might instead keep responseModalities to ['TEXT'] to avoid any chance of image output affecting cost or behavior, unless you explicitly rely on images elsewhere.

Also, please confirm these option names/values align with the exact @ai-sdk/google version in use so the satisfies constraint stays valid.

Also applies to: 131-135

🤖 Prompt for AI Agents
In src/mastra/agents/evaluationAgent.ts around lines 7 and again around lines
131-135, the providerOptions.google currently allows image modality and low
media resolution; change responseModalities to only ['TEXT'] (and remove or
unset mediaResolution if images are not used) to ensure the agent always returns
JSON text only, then run TypeScript build to ensure the object still satisfies
GoogleGenerativeAIProviderOptions and adjust field names/values to exactly match
the installed @ai-sdk/google version if any type errors occur.

import { InternalSpans } from "@mastra/core/ai-tracing";
import { googleAI, pgMemory } from "../config";
import { csvValidityScorer } from "../scorers";
import { GoogleGenerativeAIProviderOptions } from "@ai-sdk/google";
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Prefer import type for type-only GoogleGenerativeAIProviderOptions

GoogleGenerativeAIProviderOptions is only used in a satisfies clause, so making this a type-only import avoids an unnecessary runtime dependency and matches common TS best practices.

-import { GoogleGenerativeAIProviderOptions } from "@ai-sdk/google";
+import type { GoogleGenerativeAIProviderOptions } from "@ai-sdk/google";
📝 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
import { GoogleGenerativeAIProviderOptions } from "@ai-sdk/google";
import type { GoogleGenerativeAIProviderOptions } from "@ai-sdk/google";
🤖 Prompt for AI Agents
In src/mastra/agents/image_to_csv.ts around line 5, the
GoogleGenerativeAIProviderOptions is only used as a type in a satisfies clause
and should be a type-only import to avoid a runtime dependency; change the
import statement to use "import type { GoogleGenerativeAIProviderOptions } from
'@ai-sdk/google';" (and ensure your TS config allows type-only imports/emit),
leaving the rest of the code unchanged.

import { pgMemory } from '../config/pg-storage.js';
import { taskCompletionScorer } from '../scorers';
import { activeDistTag, pnpmBuild, pnpmChangesetPublish, pnpmChangesetStatus } from '../tools/pnpm-tool';
import { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google';
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 using type-only import syntax.

The import is only used for type checking with the satisfies operator. Consider using the type keyword to clarify intent and potentially improve tree-shaking.

Apply this diff:

-import { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google';
+import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google';
📝 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
import { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google';
import type { GoogleGenerativeAIProviderOptions } from '@ai-sdk/google';
🤖 Prompt for AI Agents
In src/mastra/agents/package-publisher.ts around line 7, the import of
GoogleGenerativeAIProviderOptions is used only for type-checking with the
satisfies operator; change it to a type-only import by prefixing with the type
keyword (e.g., import type { GoogleGenerativeAIProviderOptions } from
'@ai-sdk/google';) so the import is clearly marked as type-only and can be
removed at runtime.

Comment on lines 94 to 96
tools: {
googleSearch: googleTools.googleSearch({
mode: 'MODE_DYNAMIC',
dynamicThreshold: 0.7,
}),
codeExecution: googleTools.codeExecution({}),
urlContext: googleTools.urlContext({}),
webScraperTool
}
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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, read the scriptWriterAgent file to see the full context
echo "=== scriptWriterAgent.ts content ==="
cat -n src/mastra/agents/scriptWriterAgent.ts

Repository: ssdeanx/AgentStack

Length of output: 4527


🏁 Script executed:

#!/bin/bash
# Search for usages of scriptWriterAgent
echo "=== Script Writer Agent References ==="
rg -n --type=ts 'scriptWriterAgent' -C2 | grep -v 'scriptWriterAgent.ts'

echo -e "\n=== Tests for scriptWriterAgent ==="
fd -e test.ts -e spec.ts -e test.js -e spec.js | xargs grep -l 'scriptWriterAgent' 2>/dev/null || echo "No test files found"

Repository: ssdeanx/AgentStack

Length of output: 5765


🏁 Script executed:

#!/bin/bash
# Check for any imports of the removed tools in the codebase
echo "=== googleSearch references ==="
rg -n 'googleSearch' --type=ts -C2 | head -30

echo -e "\n=== codeExecution references ==="
rg -n 'codeExecution' --type=ts -C2 | head -30

echo -e "\n=== urlContext references ==="
rg -n 'urlContext' --type=ts -C2 | head -30

Repository: ssdeanx/AgentStack

Length of output: 3310


🏁 Script executed:

#!/bin/bash
# Check agent file naming convention compliance
echo "=== Agent files in src/mastra/agents/ ==="
ls -la src/mastra/agents/

echo -e "\n=== Checking naming pattern ==="
fd --type=f '\.ts$' src/mastra/agents/ | head -20

Repository: ssdeanx/AgentStack

Length of output: 3109


🏁 Script executed:

#!/bin/bash
# Check if webScraperTool exists and verify it
echo "=== Checking webScraperTool ==="
fd -name '*web-scraper*' -type f

echo -e "\n=== webScraperTool content ==="
cat -n src/mastra/tools/web-scraper-tool.ts | head -50

Repository: ssdeanx/AgentStack

Length of output: 1982


🏁 Script executed:

#!/bin/bash
# Check git history to see if tools were actually removed from this agent
echo "=== Git log for scriptWriterAgent.ts ==="
git log --oneline src/mastra/agents/scriptWriterAgent.ts | head -10

echo -e "\n=== Previous version of scriptWriterAgent.ts ==="
git show HEAD~1:src/mastra/agents/scriptWriterAgent.ts 2>/dev/null | head -100 || echo "Could not retrieve previous version"

Repository: ssdeanx/AgentStack

Length of output: 235


🏁 Script executed:

#!/antml/bin
# Verify if googleSearch, codeExecution, urlContext are tools that should be in an agent
echo "=== Agent tool imports across codebase ==="
rg -n 'tools:\s*\{' src/mastra/agents/ -A5 | head -60

Repository: ssdeanx/AgentStack

Length of output: 3216


File naming violates agent naming convention.

The file scriptWriterAgent.ts should follow kebab-case naming per the coding guidelines. Rename to script-writer-agent.ts for consistency with the agent naming convention.

The webScraperTool configuration is appropriate and aligns with how other agents in the codebase configure their tools.

🤖 Prompt for AI Agents
In src/mastra/agents/scriptWriterAgent.ts around lines 94 to 96, the filename
violates the agent naming convention and must be renamed to kebab-case: change
the file to src/mastra/agents/script-writer-agent.ts; update all imports/exports
that reference the old filename across the repo (including tests, index/barrel
exports, and any build/tsconfig paths), adjust any related default/named export
lines if they include the filename, and run a project-wide search to ensure no
remaining references to scriptWriterAgent.ts remain before committing.

Comment on lines +1 to +8
import { describe, it, expect } from 'vitest';
const { sayHello } = require('../docs/hello-world.js');

describe('Docs Hello World', () => {
it('returns expected greeting', () => {
expect(sayHello()).toBe('Hello, AgentStack!');
});
});
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 using an ES module import for sayHello in this TS test

The test itself is fine and uses Vitest correctly, but since this is a .test.ts file already using import syntax, you may want to switch the require('../docs/hello-world.js') to an import for consistency and better type support:

-import { describe, it, expect } from 'vitest';
-const { sayHello } = require('../docs/hello-world.js');
+import { describe, it, expect } from 'vitest';
+import { sayHello } from '../docs/hello-world.js';
📝 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
import { describe, it, expect } from 'vitest';
const { sayHello } = require('../docs/hello-world.js');
describe('Docs Hello World', () => {
it('returns expected greeting', () => {
expect(sayHello()).toBe('Hello, AgentStack!');
});
});
import { describe, it, expect } from 'vitest';
import { sayHello } from '../docs/hello-world.js';
describe('Docs Hello World', () => {
it('returns expected greeting', () => {
expect(sayHello()).toBe('Hello, AgentStack!');
});
});
🤖 Prompt for AI Agents
In tests/docs-hello-world.test.ts around lines 1–8, replace the CommonJS require
usage with an ES module import for consistency and better TypeScript support:
remove the const { sayHello } = require('../docs/hello-world.js') line and add
an ES import like import { sayHello } from '../docs/hello-world.js'; (ensure
your tsconfig/module settings allow ESM imports or change the path/extension if
needed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants