diff --git a/apps/web/src/app/tool/[...slug]/page.tsx b/apps/web/src/app/tool/[...slug]/page.tsx index d60d92b..2c4d348 100644 --- a/apps/web/src/app/tool/[...slug]/page.tsx +++ b/apps/web/src/app/tool/[...slug]/page.tsx @@ -14,60 +14,54 @@ import { AppHeader } from '~/components/AppHeader'; import { Markdown } from '~/components/Markdown'; import { ToolPlayground } from '~/components/ToolPlayground'; -interface Tool { +interface Package { id: string; npmPackageName: string; npmVersion: string; - description: string; + npmDescription: string | null; + npmHomepage: string | null; category: string; - tags: string[]; npmRepository: { url: string; type: string } | null; - qualityScore: string; isOfficial: boolean; - npmDownloadsLastMonth: number; - npmDownloadsLastWeek: number; + npmDownloadsLastMonth: number | null; npmKeywords: string[]; npmReadme: string | null; npmAuthor: { name: string; email?: string; url?: string } | string | null; npmMaintainers: Array<{ name: string; email?: string }> | null; + npmLicense: string | null; + githubStars: number | null; + frameworks: string[]; + tier: string; + createdAt: string; + updatedAt: string; +} + +interface Tool { + id: string; + exportName: string; + description: string; + parameters: Array<{ + name: string; + type: string; + description: string; + required: boolean; + default?: unknown; + }> | null; + returns: { + type: string; + description: string; + } | null; + aiAgent: { + useCase?: string; + limitations?: string; + examples?: string[]; + } | null; + qualityScore: string | null; importHealth?: 'HEALTHY' | 'BROKEN' | 'UNKNOWN'; executionHealth?: 'HEALTHY' | 'BROKEN' | 'UNKNOWN'; healthCheckError?: string | null; lastHealthCheck?: string | null; - tpmjsMetadata: { - example?: string; - parameters?: Array<{ - name: string; - type: string; - description: string; - required: boolean; - default?: unknown; - }>; - returns?: { - type: string; - description: string; - }; - authentication?: { - required: boolean; - type?: string; - }; - pricing?: { - model: string; - }; - frameworks?: string[]; - links?: { - documentation?: string; - repository?: string; - homepage?: string; - }; - aiAgent?: { - useCase?: string; - limitations?: string; - examples?: string[]; - }; - } | null; - githubStars: number | null; - npmLicense: string | null; + package: Package; createdAt: string; updatedAt: string; } @@ -146,7 +140,8 @@ export default function ToolDetailPage({ ); } - const authorName = typeof tool.npmAuthor === 'string' ? tool.npmAuthor : tool.npmAuthor?.name; + const pkg = tool.package; + const authorName = typeof pkg.npmAuthor === 'string' ? pkg.npmAuthor : pkg.npmAuthor?.name; const recheckHealth = async () => { setRecheckLoading(true); @@ -186,14 +181,17 @@ export default function ToolDetailPage({ Tools / - {tool.npmPackageName} + {pkg.npmPackageName} {/* Title section */}
+ {pkg.npmPackageName} +
{tool.description}
{authorName && (@@ -201,16 +199,16 @@ export default function ToolDetailPage({
)}- {tool.tpmjsMetadata.aiAgent.useCase} -
+{tool.aiAgent.useCase}
- {tool.tpmjsMetadata.aiAgent.limitations} + {tool.aiAgent.limitations}
{param.name}
@@ -422,14 +428,14 @@ export default function ToolDetailPage({
Downloads/month
- {tool.npmDownloadsLastMonth?.toLocaleString() || '0'} + {pkg.npmDownloadsLastMonth?.toLocaleString() || '0'}
GitHub Stars
- {tool.githubStars.toLocaleString()} + {pkg.githubStars.toLocaleString()}