Skip to content

Commit 0c1317b

Browse files
committed
feat: update dependencies and enhance tools
- Updated the "ai" package version from ^5.0.121 to ^6.0.37 in package.json. - Added "mathjs" package with version ^15.1.0 to package.json. - Imported "convexMemory" in copywriterAgent.ts for enhanced functionality. - Introduced a helper function `isErrCanceled` in arxiv.tool.ts to streamline error handling for cancellation. - Refactored error handling in arxivPdfParserTool to utilize the new `isErrCanceled` function. - Enhanced PDF data handling in arxivPdfParserTool to support various data types. - Updated temperature conversion error messages in calculator.tool.ts for better clarity. - Improved matrix multiplication error handling in calculator.tool.ts. - Refactored calendar-tool.ts to streamline logging and remove unnecessary mastra references. - Updated chartjs.tool.ts to ensure proper typing and handling of indicator data. - Enhanced code-analysis.tool.ts and code-search.tool.ts to replace mastra references with tracingContext. - Improved error handling and logging in code-chunking.ts for better debugging. - Enhanced weather-tool.ts and web-scraper-tool.ts to ensure proper tracing context usage. - Refactored data exporter logic in dataExporterTool to handle various data types more robustly. - Improved error messages and handling in various tools for better user feedback and debugging.
1 parent 6ee8faf commit 0c1317b

15 files changed

Lines changed: 385 additions & 409 deletions

mdx-components.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { MDXComponents } from 'mdx/types'
2+
import type { ReactNode } from 'react'
23
import Link from 'next/link'
34

45
// Custom components that work with MDX plugins
@@ -47,7 +48,7 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
4748
// Links with hover effects
4849
a: ({ href, children }) => (
4950
<Link
50-
href={href ?? '#'}
51+
href={typeof href === 'string' ? href : '#'}
5152
className="font-medium text-primary underline underline-offset-4 hover:text-primary/80 transition-colors"
5253
>
5354
{children}
@@ -75,8 +76,8 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
7576
),
7677

7778
// Code blocks and inline code - these work with rehype-highlight
78-
code: ({ children, className }) => {
79-
const isInline = !className?.includes('language-')
79+
code: ({ children, className }: { children?: ReactNode; className?: string }) => {
80+
const isInline = typeof className !== 'string' || !className.includes('language-')
8081
return isInline ? (
8182
<code className="relative rounded bg-muted px-1.5 py-0.5 font-mono text-sm text-foreground">
8283
{children}
@@ -116,9 +117,9 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
116117
),
117118

118119
// Images with responsive design
119-
img: ({ src, alt, title }) => (
120+
img: ({ src, alt, title }: { src?: string; alt?: string; title?: string }) => (
120121
<img
121-
src={src}
122+
src={src ?? undefined}
122123
alt={alt ?? ''}
123124
title={title}
124125
className="my-4 rounded-lg border border-border"

0 commit comments

Comments
 (0)