feat: add fork-based ownership and fix MCP non-scoped package names

Fork-based ownership:
- Add forkedFromId, forkCount fields to Collection and Agent models
- Add fork-status API endpoints for collections and agents
- Add ForkButton and ForkedFromBadge UI components
- Update clone endpoints to set forkedFromId and increment forkCount
- Add COLLECTION_FORKED and AGENT_FORKED activity types
- Enforce owner-only access for MCP tool execution and agent chat

MCP fix:
- Fix parseToolName to handle non-scoped packages like firecrawl-aisdk
- Try both scoped (@scope/name) and literal (name-with-hyphens) interpretations
- Pass collection envVars to tool executor for API key support
This commit is contained in:
Ajax Davis 2026-01-13 10:23:28 +10:00
parent e2bb06df60
commit 95cb0a96f0
22 changed files with 925 additions and 79 deletions

View file

@ -169,6 +169,8 @@ export const AgentSchema = z.object({
isPublic: z.boolean(),
toolCount: z.number(),
collectionCount: z.number(),
forkCount: z.number().default(0),
forkedFromId: z.string().nullable().optional(),
createdAt: z.date(),
updatedAt: z.date(),
});

View file

@ -107,6 +107,8 @@ export const CollectionSchema = z.object({
description: z.string().nullable(),
isPublic: z.boolean(),
toolCount: z.number(),
forkCount: z.number().default(0),
forkedFromId: z.string().nullable().optional(),
createdAt: z.date(),
updatedAt: z.date(),
});