import { useParams, Link } from "react-router"; import { Download, Star, Terminal, ChevronRight, ArrowLeft, } from "lucide-react"; import { Button } from "../components/ui/button"; import { Badge } from "../components/ui/badge"; import { Card, CardContent, CardHeader } from "../components/ui/card"; import { useEffect, useState } from "react"; interface Server { id: string; name: string; description: string; command: string; githubStars: number; environmentVariables: { name: string; description: string; required: boolean; }[]; } function getGooseInstallLink(server: Server): string { const parts = server.command.split(" "); const baseCmd = parts[0]; const args = parts.slice(1); const queryParams = [ `cmd=${encodeURIComponent(baseCmd)}`, ...args.map((arg) => `arg=${encodeURIComponent(arg)}`), `description=${encodeURIComponent(server.description)}`, ...server.environmentVariables .filter((env) => env.required) .map( (env) => `env=${encodeURIComponent(`${env.name}=${env.description}`)}` ), ].join("&"); return `goose://extension?${queryParams}`; } export default function DetailPage() { const { id } = useParams(); const [server, setServer] = useState(null); const [isCommandVisible, setIsCommandVisible] = useState(true); const serverUrl = "https://block.github.io/goose/v1/extensions/servers.json"; useEffect(() => { fetch(serverUrl) .then((res) => res.json()) .then((servers) => { const matchingServer = servers.find((s: Server) => s.id === id); if (matchingServer) { setServer(matchingServer); } }); }, [id]); if (!server) { return (
Goose Extensions {" "} /
); } return (
{/* */}

{server.name}

{server.description}

{/* */}

Command

goose session --with-extension "{server.command}"
{server.environmentVariables.length > 0 && (

Environment Variables

{server.environmentVariables.map((env) => (
{env.name}
{env.description}
{env.required && ( Required )}
))}
)}
{server.githubStars} on Github
); }