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:
parent
361a49f3d7
commit
4b392a2eed
3 changed files with 17 additions and 8 deletions
|
|
@ -47,6 +47,11 @@ function formatDownloads(count: number): string {
|
||||||
return count.toString();
|
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 */
|
/** Sort tools by criterion, pushing broken tools to the bottom */
|
||||||
function sortTools(tools: Tool[], sortBy: SortOption): Tool[] {
|
function sortTools(tools: Tool[], sortBy: SortOption): Tool[] {
|
||||||
return [...tools].sort((a, b) => {
|
return [...tools].sort((a, b) => {
|
||||||
|
|
@ -166,11 +171,12 @@ export default function ToolSearchPage(): React.ReactElement {
|
||||||
const TableHeader = useCallback(
|
const TableHeader = useCallback(
|
||||||
() => (
|
() => (
|
||||||
<tr className="bg-surface text-left text-sm font-medium text-foreground-secondary">
|
<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-[250px]">Name</th>
|
||||||
<th className="px-4 py-3 w-[120px]">Category</th>
|
<th className="px-4 py-3 w-[300px]">Description</th>
|
||||||
<th className="px-4 py-3 w-[100px] text-right">Downloads</th>
|
<th className="px-4 py-3 w-[100px]">Category</th>
|
||||||
<th className="px-4 py-3 w-[80px] text-right">Likes</th>
|
<th className="px-4 py-3 w-[80px] text-right">Downloads</th>
|
||||||
<th className="px-4 py-3 w-[120px] text-right">Install</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>
|
</tr>
|
||||||
),
|
),
|
||||||
[]
|
[]
|
||||||
|
|
@ -197,11 +203,14 @@ export default function ToolSearchPage(): React.ReactElement {
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
</div>
|
</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}
|
{tool.package.npmPackageName}
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</td>
|
</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">
|
<td className="px-4 py-3">
|
||||||
<Badge variant="secondary" size="sm">
|
<Badge variant="secondary" size="sm">
|
||||||
{tool.package.category}
|
{tool.package.category}
|
||||||
|
|
|
||||||
|
|
@ -503,7 +503,7 @@ model Agent {
|
||||||
maxMessagesInContext Int @default(10) @map("max_messages_in_context")
|
maxMessagesInContext Int @default(10) @map("max_messages_in_context")
|
||||||
|
|
||||||
// Visibility
|
// Visibility
|
||||||
isPublic Boolean @default(false) @map("is_public")
|
isPublic Boolean @default(true) @map("is_public")
|
||||||
likeCount Int @default(0) @map("like_count")
|
likeCount Int @default(0) @map("like_count")
|
||||||
|
|
||||||
// Timestamps
|
// Timestamps
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ export const CreateAgentSchema = z.object({
|
||||||
temperature: z.number().min(0).max(2).default(0.7),
|
temperature: z.number().min(0).max(2).default(0.7),
|
||||||
maxToolCallsPerTurn: z.number().int().min(1).max(100).default(20),
|
maxToolCallsPerTurn: z.number().int().min(1).max(100).default(20),
|
||||||
maxMessagesInContext: z.number().int().min(1).max(100).default(10),
|
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(),
|
collectionIds: z.array(z.string()).optional(),
|
||||||
toolIds: z.array(z.string()).optional(),
|
toolIds: z.array(z.string()).optional(),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue