diff --git a/apps/web/src/app/dashboard/agents/[id]/page.tsx b/apps/web/src/app/dashboard/agents/[id]/page.tsx index c645150..67362b3 100644 --- a/apps/web/src/app/dashboard/agents/[id]/page.tsx +++ b/apps/web/src/app/dashboard/agents/[id]/page.tsx @@ -4,6 +4,15 @@ import type { AIProvider } from '@tpmjs/types/agent'; import { PROVIDER_MODELS, SUPPORTED_PROVIDERS } from '@tpmjs/types/agent'; import { Button } from '@tpmjs/ui/Button/Button'; import { Icon } from '@tpmjs/ui/Icon/Icon'; +import { + Table, + TableBody, + TableCell, + TableEmpty, + TableHead, + TableHeader, + TableRow, +} from '@tpmjs/ui/Table/Table'; import Link from 'next/link'; import { useParams, useRouter } from 'next/navigation'; import { useCallback, useEffect, useRef, useState } from 'react'; @@ -534,48 +543,14 @@ export default function AgentDetailPage(): React.ReactElement { {/* Tools Section */} -
-
+
+

Tools

{agentTools.length} attached
- {/* Current Tools */} - {agentTools.length > 0 && ( -
- {agentTools.map((at) => ( -
-
- -
-

{at.tool.name}

-

- {at.tool.npmPackageName} -

-
-
- -
- ))} -
- )} - {/* Add Tool Search */} -
+
setShowToolSearch(true)} placeholder="Search tools to add..." - className="w-full pl-9 pr-3 py-2 bg-background border border-border rounded-lg text-foreground text-sm placeholder:text-foreground-tertiary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary" + className="w-full pl-9 pr-3 py-2 bg-surface border border-border rounded-lg text-foreground text-sm placeholder:text-foreground-tertiary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary" /> {isSearchingTools && (
@@ -602,7 +577,7 @@ export default function AgentDetailPage(): React.ReactElement { {/* Search Results Dropdown */} {showToolSearch && toolSearch && ( -
+
{toolSearchResults.length > 0 ? ( toolSearchResults.map((tool) => (
+ + {/* Tools Table */} + + + + Tool + Package + Actions + + + + {agentTools.length === 0 ? ( + + + + } + title="No tools attached" + description="Search above to add tools to this agent" + /> + ) : ( + agentTools.map((at) => ( + + +
+
+ +
+ {at.tool.name} +
+
+ + + {at.tool.npmPackageName} + + + +
+ +
+
+
+ )) + )} +
+
{/* Collections Section */} -
-
+
+

Collections

{agentCollections.length} attached
- {/* Current Collections */} - {agentCollections.length > 0 && ( -
- {agentCollections.map((ac) => ( -
-
- -
-

- {ac.collection.name} -

-

- {ac.collection.toolCount} tools -

-
-
- -
- ))} -
- )} - {/* Add Collection Search */} -
+
setShowCollectionSearch(true)} placeholder="Search collections to add..." - className="w-full pl-9 pr-3 py-2 bg-background border border-border rounded-lg text-foreground text-sm placeholder:text-foreground-tertiary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary" + className="w-full pl-9 pr-3 py-2 bg-surface border border-border rounded-lg text-foreground text-sm placeholder:text-foreground-tertiary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary" /> {isSearchingCollections && (
@@ -700,7 +694,7 @@ export default function AgentDetailPage(): React.ReactElement { {/* Search Results Dropdown */} {showCollectionSearch && collectionSearch && ( -
+
{collectionSearchResults.length > 0 ? ( collectionSearchResults.map((collection) => (
+ + {/* Collections Table */} + + + + Collection + Tools + Actions + + + + {agentCollections.length === 0 ? ( + + + + } + title="No collections attached" + description="Search above to add collections to this agent" + /> + ) : ( + agentCollections.map((ac) => ( + + +
+
+ +
+ {ac.collection.name} +
+
+ + + {ac.collection.toolCount} tools + + + +
+ +
+
+
+ )) + )} +
+
{/* Configuration */}