mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-08 06:42:39 +02:00
Community cards and prebuilt cards (#258)
* Add community sharing feature and merge with pre-built templates * Add warning before publishing * [Untested] Add delete flow for community cards * Fix bug with sorting by likes count and update design of cards * Fix community assistant parsing errors * Remove all as a type filter * Remove default assistant name for publishing to community * Update DB calls to be standardized paginated
This commit is contained in:
parent
62c1230cff
commit
be4e17b5a5
20 changed files with 2144 additions and 264 deletions
|
|
@ -2,7 +2,8 @@
|
|||
import { z } from 'zod';
|
||||
import { container } from "@/di/container";
|
||||
import { redirect } from "next/navigation";
|
||||
import { templates } from "../lib/project_templates";
|
||||
// Fetch library templates from the unified assistant templates repository
|
||||
import { MongoDBAssistantTemplatesRepository } from "@/src/infrastructure/repositories/mongodb.assistant-templates.repository";
|
||||
import { authCheck } from "./auth.actions";
|
||||
import { ApiKey } from "@/src/entities/models/api-key";
|
||||
import { Project } from "@/src/entities/models/project";
|
||||
|
|
@ -40,14 +41,17 @@ const updateLiveWorkflowController = container.resolve<IUpdateLiveWorkflowContro
|
|||
const revertToLiveWorkflowController = container.resolve<IRevertToLiveWorkflowController>('revertToLiveWorkflowController');
|
||||
|
||||
export async function listTemplates() {
|
||||
const templatesArray = Object.entries(templates)
|
||||
.filter(([key]) => key !== 'default') // Exclude the default template
|
||||
.map(([key, template]) => ({
|
||||
id: key,
|
||||
...template
|
||||
}));
|
||||
|
||||
return templatesArray;
|
||||
const repo = new MongoDBAssistantTemplatesRepository();
|
||||
const result = await repo.list({ source: 'library', isPublic: true }, undefined, 100);
|
||||
// Map to the shape expected by callers (tools at top-level)
|
||||
return result.items.map((item) => ({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
description: item.description,
|
||||
category: item.category,
|
||||
tools: (item as any).workflow?.tools || [],
|
||||
copilotPrompt: item.copilotPrompt,
|
||||
}));
|
||||
}
|
||||
|
||||
export async function projectAuthCheck(projectId: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue