fix: add description column to tools page and make agents public by default

- Add description column to tools registry table
- Change agent isPublic default from false to true in Prisma schema
- Update CreateAgentSchema Zod default to true
This commit is contained in:
Ajax Davis 2026-01-07 22:07:36 +10:00
parent 3ccacf9d5b
commit 5c99c1f3a5
3 changed files with 17 additions and 8 deletions

View file

@ -47,6 +47,11 @@ function formatDownloads(count: number): string {
return count.toString();
}
function truncateText(text: string, maxLength: number): string {
if (text.length <= maxLength) return text;
return `${text.slice(0, maxLength).trim()}...`;
}
/** Sort tools by criterion, pushing broken tools to the bottom */
function sortTools(tools: Tool[], sortBy: SortOption): Tool[] {
return [...tools].sort((a, b) => {
@ -166,11 +171,12 @@ export default function ToolSearchPage(): React.ReactElement {
const TableHeader = useCallback(
() => (
<tr className="bg-surface text-left text-sm font-medium text-foreground-secondary">
<th className="px-4 py-3 w-[300px]">Name</th>
<th className="px-4 py-3 w-[120px]">Category</th>
<th className="px-4 py-3 w-[100px] text-right">Downloads</th>
<th className="px-4 py-3 w-[80px] text-right">Likes</th>
<th className="px-4 py-3 w-[120px] text-right">Install</th>
<th className="px-4 py-3 w-[250px]">Name</th>
<th className="px-4 py-3 w-[300px]">Description</th>
<th className="px-4 py-3 w-[100px]">Category</th>
<th className="px-4 py-3 w-[80px] text-right">Downloads</th>
<th className="px-4 py-3 w-[60px] text-right">Likes</th>
<th className="px-4 py-3 w-[100px] text-right">Install</th>
</tr>
),
[]
@ -197,11 +203,14 @@ export default function ToolSearchPage(): React.ReactElement {
</Badge>
)}
</div>
<div className="text-xs text-foreground-tertiary truncate max-w-[280px]">
<div className="text-xs text-foreground-tertiary truncate max-w-[230px]">
{tool.package.npmPackageName}
</div>
</Link>
</td>
<td className="px-4 py-3 text-sm text-foreground-secondary">
{tool.description ? truncateText(tool.description, 60) : '—'}
</td>
<td className="px-4 py-3">
<Badge variant="secondary" size="sm">
{tool.package.category}

View file

@ -503,7 +503,7 @@ model Agent {
maxMessagesInContext Int @default(10) @map("max_messages_in_context")
// Visibility
isPublic Boolean @default(false) @map("is_public")
isPublic Boolean @default(true) @map("is_public")
likeCount Int @default(0) @map("like_count")
// Timestamps

View file

@ -33,7 +33,7 @@ export const CreateAgentSchema = z.object({
temperature: z.number().min(0).max(2).default(0.7),
maxToolCallsPerTurn: z.number().int().min(1).max(100).default(20),
maxMessagesInContext: z.number().int().min(1).max(100).default(10),
isPublic: z.boolean().default(false),
isPublic: z.boolean().default(true),
collectionIds: z.array(z.string()).optional(),
toolIds: z.array(z.string()).optional(),
});