Files
artsite/shared/utils/tools/stats.ts
Arthur DANJOU 6e28fdd17a feat: integrate new AI tools and enhance API functionality
- Added '@nuxtjs/mdc' module to nuxt.config.ts for improved UI components.
- Configured MDC settings to disable anchor links for headings.
- Updated API proxy settings to include '/api/uses' and a general '/api/' endpoint.
- Introduced new dependencies for AI SDKs and tools in package.json.
- Created a new chat API endpoint to handle AI interactions with various tools.
- Implemented utility functions for activity tracking, resource reading, resume retrieval, statistics, status monitoring, and categorized tool usage.
- Updated social links in types/index.ts to redirect through a custom domain.
- Updated worker configuration to include AI binding for Cloudflare.
2025-12-19 17:57:43 +01:00

13 lines
440 B
TypeScript

import type { UIToolInvocation } from 'ai'
import { tool } from 'ai'
import type { Stats } from '~~/types'
export type StatsUIToolInvocation = UIToolInvocation<typeof statsTool>
export const statsTool = tool({
description: 'Detailed coding statistics and analytics from WakaTime, including programming languages, time spent coding, and productivity metrics',
execute: async () => {
return await $fetch<Stats>('/api/stats')
}
})