@weirdfingers/baseboards 0.9.6 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +560 -469
- package/dist/index.js.map +1 -1
- package/package.json +2 -5
- package/templates/README.md +0 -122
- package/templates/api/.env.example +0 -65
- package/templates/api/ARTIFACT_RESOLUTION_GUIDE.md +0 -148
- package/templates/api/Dockerfile +0 -32
- package/templates/api/README.md +0 -264
- package/templates/api/alembic/env.py +0 -114
- package/templates/api/alembic/script.py.mako +0 -28
- package/templates/api/alembic/versions/20250101_000000_initial_schema.py +0 -506
- package/templates/api/alembic/versions/20251022_174729_remove_provider_name_from_generations.py +0 -75
- package/templates/api/alembic/versions/20251023_165852_switch_to_declarative_base_and_mapping.py +0 -467
- package/templates/api/alembic/versions/20251202_000000_add_artifact_lineage.py +0 -134
- package/templates/api/alembic/versions/2025925_62735_add_seed_data_for_default_tenant.py +0 -88
- package/templates/api/alembic.ini +0 -36
- package/templates/api/config/generators.yaml +0 -237
- package/templates/api/config/storage_config.yaml +0 -26
- package/templates/api/docs/ADDING_GENERATORS.md +0 -409
- package/templates/api/docs/GENERATORS_API.md +0 -502
- package/templates/api/docs/MIGRATIONS.md +0 -472
- package/templates/api/docs/TESTING_LIVE_APIS.md +0 -417
- package/templates/api/docs/storage_providers.md +0 -337
- package/templates/api/pyproject.toml +0 -205
- package/templates/api/src/boards/__init__.py +0 -10
- package/templates/api/src/boards/api/app.py +0 -172
- package/templates/api/src/boards/api/auth.py +0 -75
- package/templates/api/src/boards/api/endpoints/__init__.py +0 -3
- package/templates/api/src/boards/api/endpoints/jobs.py +0 -76
- package/templates/api/src/boards/api/endpoints/setup.py +0 -505
- package/templates/api/src/boards/api/endpoints/sse.py +0 -129
- package/templates/api/src/boards/api/endpoints/storage.py +0 -155
- package/templates/api/src/boards/api/endpoints/tenant_registration.py +0 -296
- package/templates/api/src/boards/api/endpoints/uploads.py +0 -149
- package/templates/api/src/boards/api/endpoints/webhooks.py +0 -13
- package/templates/api/src/boards/auth/__init__.py +0 -15
- package/templates/api/src/boards/auth/adapters/__init__.py +0 -27
- package/templates/api/src/boards/auth/adapters/auth0.py +0 -220
- package/templates/api/src/boards/auth/adapters/base.py +0 -73
- package/templates/api/src/boards/auth/adapters/clerk.py +0 -172
- package/templates/api/src/boards/auth/adapters/jwt.py +0 -122
- package/templates/api/src/boards/auth/adapters/none.py +0 -102
- package/templates/api/src/boards/auth/adapters/oidc.py +0 -284
- package/templates/api/src/boards/auth/adapters/supabase.py +0 -110
- package/templates/api/src/boards/auth/context.py +0 -35
- package/templates/api/src/boards/auth/factory.py +0 -129
- package/templates/api/src/boards/auth/middleware.py +0 -221
- package/templates/api/src/boards/auth/provisioning.py +0 -129
- package/templates/api/src/boards/auth/tenant_extraction.py +0 -278
- package/templates/api/src/boards/cli.py +0 -354
- package/templates/api/src/boards/config.py +0 -131
- package/templates/api/src/boards/database/__init__.py +0 -7
- package/templates/api/src/boards/database/cli.py +0 -110
- package/templates/api/src/boards/database/connection.py +0 -292
- package/templates/api/src/boards/database/models.py +0 -19
- package/templates/api/src/boards/database/seed_data.py +0 -182
- package/templates/api/src/boards/dbmodels/__init__.py +0 -441
- package/templates/api/src/boards/generators/__init__.py +0 -57
- package/templates/api/src/boards/generators/artifact_resolution.py +0 -405
- package/templates/api/src/boards/generators/artifacts.py +0 -53
- package/templates/api/src/boards/generators/base.py +0 -144
- package/templates/api/src/boards/generators/implementations/__init__.py +0 -14
- package/templates/api/src/boards/generators/implementations/fal/__init__.py +0 -25
- package/templates/api/src/boards/generators/implementations/fal/audio/__init__.py +0 -23
- package/templates/api/src/boards/generators/implementations/fal/audio/beatoven_music_generation.py +0 -171
- package/templates/api/src/boards/generators/implementations/fal/audio/beatoven_sound_effect_generation.py +0 -167
- package/templates/api/src/boards/generators/implementations/fal/audio/chatterbox_text_to_speech.py +0 -176
- package/templates/api/src/boards/generators/implementations/fal/audio/chatterbox_tts_turbo.py +0 -195
- package/templates/api/src/boards/generators/implementations/fal/audio/elevenlabs_sound_effects_v2.py +0 -194
- package/templates/api/src/boards/generators/implementations/fal/audio/elevenlabs_tts_eleven_v3.py +0 -209
- package/templates/api/src/boards/generators/implementations/fal/audio/fal_elevenlabs_tts_turbo_v2_5.py +0 -206
- package/templates/api/src/boards/generators/implementations/fal/audio/fal_minimax_speech_26_hd.py +0 -237
- package/templates/api/src/boards/generators/implementations/fal/audio/minimax_music_v2.py +0 -173
- package/templates/api/src/boards/generators/implementations/fal/audio/minimax_speech_2_6_turbo.py +0 -221
- package/templates/api/src/boards/generators/implementations/fal/image/__init__.py +0 -63
- package/templates/api/src/boards/generators/implementations/fal/image/bytedance_seedream_v45_edit.py +0 -219
- package/templates/api/src/boards/generators/implementations/fal/image/clarity_upscaler.py +0 -220
- package/templates/api/src/boards/generators/implementations/fal/image/crystal_upscaler.py +0 -173
- package/templates/api/src/boards/generators/implementations/fal/image/fal_ideogram_character.py +0 -227
- package/templates/api/src/boards/generators/implementations/fal/image/flux_2.py +0 -203
- package/templates/api/src/boards/generators/implementations/fal/image/flux_2_edit.py +0 -230
- package/templates/api/src/boards/generators/implementations/fal/image/flux_2_pro.py +0 -204
- package/templates/api/src/boards/generators/implementations/fal/image/flux_2_pro_edit.py +0 -221
- package/templates/api/src/boards/generators/implementations/fal/image/flux_pro_kontext.py +0 -216
- package/templates/api/src/boards/generators/implementations/fal/image/flux_pro_ultra.py +0 -197
- package/templates/api/src/boards/generators/implementations/fal/image/gemini_25_flash_image.py +0 -177
- package/templates/api/src/boards/generators/implementations/fal/image/gemini_25_flash_image_edit.py +0 -208
- package/templates/api/src/boards/generators/implementations/fal/image/gpt_image_15_edit.py +0 -216
- package/templates/api/src/boards/generators/implementations/fal/image/gpt_image_1_5.py +0 -177
- package/templates/api/src/boards/generators/implementations/fal/image/gpt_image_1_edit_image.py +0 -182
- package/templates/api/src/boards/generators/implementations/fal/image/gpt_image_1_mini.py +0 -167
- package/templates/api/src/boards/generators/implementations/fal/image/ideogram_character_edit.py +0 -299
- package/templates/api/src/boards/generators/implementations/fal/image/ideogram_v2.py +0 -190
- package/templates/api/src/boards/generators/implementations/fal/image/imagen4_preview.py +0 -191
- package/templates/api/src/boards/generators/implementations/fal/image/imagen4_preview_fast.py +0 -179
- package/templates/api/src/boards/generators/implementations/fal/image/nano_banana.py +0 -183
- package/templates/api/src/boards/generators/implementations/fal/image/nano_banana_edit.py +0 -212
- package/templates/api/src/boards/generators/implementations/fal/image/nano_banana_pro.py +0 -179
- package/templates/api/src/boards/generators/implementations/fal/image/nano_banana_pro_edit.py +0 -226
- package/templates/api/src/boards/generators/implementations/fal/image/qwen_image.py +0 -249
- package/templates/api/src/boards/generators/implementations/fal/image/qwen_image_edit.py +0 -244
- package/templates/api/src/boards/generators/implementations/fal/image/reve_edit.py +0 -178
- package/templates/api/src/boards/generators/implementations/fal/image/reve_text_to_image.py +0 -155
- package/templates/api/src/boards/generators/implementations/fal/image/seedream_v45_text_to_image.py +0 -180
- package/templates/api/src/boards/generators/implementations/fal/utils.py +0 -61
- package/templates/api/src/boards/generators/implementations/fal/video/__init__.py +0 -77
- package/templates/api/src/boards/generators/implementations/fal/video/bytedance_seedance_v1_pro_text_to_video.py +0 -209
- package/templates/api/src/boards/generators/implementations/fal/video/creatify_lipsync.py +0 -161
- package/templates/api/src/boards/generators/implementations/fal/video/fal_bytedance_seedance_v1_pro_image_to_video.py +0 -222
- package/templates/api/src/boards/generators/implementations/fal/video/fal_minimax_hailuo_02_standard_text_to_video.py +0 -152
- package/templates/api/src/boards/generators/implementations/fal/video/fal_pixverse_lipsync.py +0 -197
- package/templates/api/src/boards/generators/implementations/fal/video/fal_sora_2_text_to_video.py +0 -173
- package/templates/api/src/boards/generators/implementations/fal/video/infinitalk.py +0 -221
- package/templates/api/src/boards/generators/implementations/fal/video/kling_video_ai_avatar_v2_pro.py +0 -168
- package/templates/api/src/boards/generators/implementations/fal/video/kling_video_ai_avatar_v2_standard.py +0 -159
- package/templates/api/src/boards/generators/implementations/fal/video/kling_video_v2_5_turbo_pro_image_to_video.py +0 -175
- package/templates/api/src/boards/generators/implementations/fal/video/kling_video_v2_5_turbo_pro_text_to_video.py +0 -168
- package/templates/api/src/boards/generators/implementations/fal/video/minimax_hailuo_2_3_pro_image_to_video.py +0 -153
- package/templates/api/src/boards/generators/implementations/fal/video/sora2_image_to_video.py +0 -172
- package/templates/api/src/boards/generators/implementations/fal/video/sora_2_image_to_video_pro.py +0 -175
- package/templates/api/src/boards/generators/implementations/fal/video/sora_2_text_to_video_pro.py +0 -163
- package/templates/api/src/boards/generators/implementations/fal/video/sync_lipsync_v2.py +0 -167
- package/templates/api/src/boards/generators/implementations/fal/video/sync_lipsync_v2_pro.py +0 -155
- package/templates/api/src/boards/generators/implementations/fal/video/veed_fabric_1_0.py +0 -180
- package/templates/api/src/boards/generators/implementations/fal/video/veed_lipsync.py +0 -174
- package/templates/api/src/boards/generators/implementations/fal/video/veo3.py +0 -194
- package/templates/api/src/boards/generators/implementations/fal/video/veo31.py +0 -190
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_fast.py +0 -190
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_fast_image_to_video.py +0 -191
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_first_last_frame_to_video.py +0 -187
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_image_to_video.py +0 -183
- package/templates/api/src/boards/generators/implementations/fal/video/veo31_reference_to_video.py +0 -172
- package/templates/api/src/boards/generators/implementations/fal/video/wan_25_preview_image_to_video.py +0 -212
- package/templates/api/src/boards/generators/implementations/fal/video/wan_25_preview_text_to_video.py +0 -208
- package/templates/api/src/boards/generators/implementations/fal/video/wan_pro_image_to_video.py +0 -158
- package/templates/api/src/boards/generators/implementations/kie/__init__.py +0 -11
- package/templates/api/src/boards/generators/implementations/kie/base.py +0 -316
- package/templates/api/src/boards/generators/implementations/kie/image/__init__.py +0 -3
- package/templates/api/src/boards/generators/implementations/kie/image/nano_banana_edit.py +0 -190
- package/templates/api/src/boards/generators/implementations/kie/utils.py +0 -98
- package/templates/api/src/boards/generators/implementations/kie/video/__init__.py +0 -8
- package/templates/api/src/boards/generators/implementations/kie/video/veo3.py +0 -161
- package/templates/api/src/boards/generators/implementations/openai/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/openai/audio/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/openai/audio/whisper.py +0 -69
- package/templates/api/src/boards/generators/implementations/openai/image/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/openai/image/dalle3.py +0 -96
- package/templates/api/src/boards/generators/implementations/replicate/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/replicate/image/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/replicate/image/flux_pro.py +0 -88
- package/templates/api/src/boards/generators/implementations/replicate/video/__init__.py +0 -1
- package/templates/api/src/boards/generators/implementations/replicate/video/lipsync.py +0 -73
- package/templates/api/src/boards/generators/loader.py +0 -253
- package/templates/api/src/boards/generators/registry.py +0 -114
- package/templates/api/src/boards/generators/resolution.py +0 -632
- package/templates/api/src/boards/generators/testmods/class_gen.py +0 -34
- package/templates/api/src/boards/generators/testmods/import_side_effect.py +0 -35
- package/templates/api/src/boards/graphql/__init__.py +0 -7
- package/templates/api/src/boards/graphql/access_control.py +0 -136
- package/templates/api/src/boards/graphql/mutations/root.py +0 -148
- package/templates/api/src/boards/graphql/queries/root.py +0 -116
- package/templates/api/src/boards/graphql/resolvers/__init__.py +0 -8
- package/templates/api/src/boards/graphql/resolvers/auth.py +0 -12
- package/templates/api/src/boards/graphql/resolvers/board.py +0 -1053
- package/templates/api/src/boards/graphql/resolvers/generation.py +0 -666
- package/templates/api/src/boards/graphql/resolvers/generator.py +0 -50
- package/templates/api/src/boards/graphql/resolvers/lineage.py +0 -381
- package/templates/api/src/boards/graphql/resolvers/upload.py +0 -463
- package/templates/api/src/boards/graphql/resolvers/user.py +0 -25
- package/templates/api/src/boards/graphql/schema.py +0 -81
- package/templates/api/src/boards/graphql/types/board.py +0 -102
- package/templates/api/src/boards/graphql/types/generation.py +0 -166
- package/templates/api/src/boards/graphql/types/generator.py +0 -17
- package/templates/api/src/boards/graphql/types/user.py +0 -47
- package/templates/api/src/boards/jobs/repository.py +0 -153
- package/templates/api/src/boards/logging.py +0 -195
- package/templates/api/src/boards/middleware.py +0 -339
- package/templates/api/src/boards/progress/__init__.py +0 -4
- package/templates/api/src/boards/progress/models.py +0 -25
- package/templates/api/src/boards/progress/publisher.py +0 -64
- package/templates/api/src/boards/py.typed +0 -0
- package/templates/api/src/boards/redis_pool.py +0 -118
- package/templates/api/src/boards/storage/__init__.py +0 -52
- package/templates/api/src/boards/storage/base.py +0 -363
- package/templates/api/src/boards/storage/config.py +0 -187
- package/templates/api/src/boards/storage/factory.py +0 -288
- package/templates/api/src/boards/storage/implementations/__init__.py +0 -27
- package/templates/api/src/boards/storage/implementations/gcs.py +0 -340
- package/templates/api/src/boards/storage/implementations/local.py +0 -201
- package/templates/api/src/boards/storage/implementations/s3.py +0 -294
- package/templates/api/src/boards/storage/implementations/supabase.py +0 -218
- package/templates/api/src/boards/tenant_isolation.py +0 -446
- package/templates/api/src/boards/validation.py +0 -262
- package/templates/api/src/boards/workers/__init__.py +0 -1
- package/templates/api/src/boards/workers/actors.py +0 -274
- package/templates/api/src/boards/workers/cli.py +0 -125
- package/templates/api/src/boards/workers/context.py +0 -348
- package/templates/api/src/boards/workers/middleware.py +0 -58
- package/templates/api/src/py.typed +0 -0
- package/templates/compose.web.yaml +0 -35
- package/templates/compose.yaml +0 -116
- package/templates/docker/env.example +0 -23
- package/templates/web/.env.example +0 -28
- package/templates/web/Dockerfile +0 -51
- package/templates/web/components.json +0 -22
- package/templates/web/imageLoader.js +0 -18
- package/templates/web/next-env.d.ts +0 -5
- package/templates/web/next.config.js +0 -36
- package/templates/web/package.json +0 -41
- package/templates/web/postcss.config.mjs +0 -7
- package/templates/web/public/favicon.ico +0 -0
- package/templates/web/src/app/boards/[boardId]/page.tsx +0 -353
- package/templates/web/src/app/globals.css +0 -123
- package/templates/web/src/app/layout.tsx +0 -31
- package/templates/web/src/app/lineage/[generationId]/page.tsx +0 -235
- package/templates/web/src/app/page.tsx +0 -35
- package/templates/web/src/app/providers.tsx +0 -18
- package/templates/web/src/components/boards/ArtifactInputSlots.tsx +0 -206
- package/templates/web/src/components/boards/ArtifactPreview.tsx +0 -466
- package/templates/web/src/components/boards/GenerationGrid.tsx +0 -282
- package/templates/web/src/components/boards/GenerationInput.tsx +0 -370
- package/templates/web/src/components/boards/GeneratorSelector.tsx +0 -272
- package/templates/web/src/components/boards/UploadArtifact.tsx +0 -563
- package/templates/web/src/components/header.tsx +0 -32
- package/templates/web/src/components/theme-provider.tsx +0 -10
- package/templates/web/src/components/theme-toggle.tsx +0 -75
- package/templates/web/src/components/ui/alert-dialog.tsx +0 -157
- package/templates/web/src/components/ui/button.tsx +0 -58
- package/templates/web/src/components/ui/card.tsx +0 -92
- package/templates/web/src/components/ui/dropdown-menu.tsx +0 -200
- package/templates/web/src/components/ui/navigation-menu.tsx +0 -168
- package/templates/web/src/components/ui/toast.tsx +0 -128
- package/templates/web/src/components/ui/toaster.tsx +0 -35
- package/templates/web/src/components/ui/use-toast.ts +0 -187
- package/templates/web/src/hooks/useGeneratorMRU.ts +0 -57
- package/templates/web/src/lib/utils.ts +0 -6
- package/templates/web/tsconfig.json +0 -41
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { useParams, useRouter } from "next/navigation";
|
|
5
|
-
import { useLineage, type AncestryNode, type DescendantNode } from "@weirdfingers/boards";
|
|
6
|
-
import { Card } from "@/components/ui/card";
|
|
7
|
-
import { Button } from "@/components/ui/button";
|
|
8
|
-
import { ArrowLeft, Loader2 } from "lucide-react";
|
|
9
|
-
|
|
10
|
-
export default function LineageExplorerPage() {
|
|
11
|
-
const params = useParams();
|
|
12
|
-
const router = useRouter();
|
|
13
|
-
const generationId = params.generationId as string;
|
|
14
|
-
|
|
15
|
-
const { ancestry, descendants, loading, error } = useLineage(generationId, {
|
|
16
|
-
maxDepth: 10,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
if (loading) {
|
|
20
|
-
return (
|
|
21
|
-
<div className="container mx-auto p-6 flex items-center justify-center min-h-screen">
|
|
22
|
-
<div className="flex items-center gap-2">
|
|
23
|
-
<Loader2 className="h-6 w-6 animate-spin" />
|
|
24
|
-
<span>Loading lineage...</span>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (error) {
|
|
31
|
-
return (
|
|
32
|
-
<div className="container mx-auto p-6">
|
|
33
|
-
<Card className="p-6 border-red-500">
|
|
34
|
-
<h2 className="text-xl font-bold text-red-600 mb-2">Error</h2>
|
|
35
|
-
<p className="text-red-600">{error.message}</p>
|
|
36
|
-
<Button
|
|
37
|
-
onClick={() => router.back()}
|
|
38
|
-
variant="outline"
|
|
39
|
-
className="mt-4"
|
|
40
|
-
>
|
|
41
|
-
<ArrowLeft className="mr-2 h-4 w-4" />
|
|
42
|
-
Go Back
|
|
43
|
-
</Button>
|
|
44
|
-
</Card>
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<div className="container mx-auto p-6">
|
|
51
|
-
<div className="mb-6">
|
|
52
|
-
<Button
|
|
53
|
-
onClick={() => router.back()}
|
|
54
|
-
variant="outline"
|
|
55
|
-
className="mb-4"
|
|
56
|
-
>
|
|
57
|
-
<ArrowLeft className="mr-2 h-4 w-4" />
|
|
58
|
-
Back
|
|
59
|
-
</Button>
|
|
60
|
-
<h1 className="text-3xl font-bold">Artifact Lineage Explorer</h1>
|
|
61
|
-
<p className="text-muted-foreground mt-2">
|
|
62
|
-
Explore the ancestry and descendants of generation {generationId}
|
|
63
|
-
</p>
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
|
67
|
-
{/* Ancestry Section */}
|
|
68
|
-
<Card className="p-6">
|
|
69
|
-
<h2 className="text-2xl font-bold mb-4">Ancestry</h2>
|
|
70
|
-
<p className="text-muted-foreground mb-4">
|
|
71
|
-
Shows all parent generations that contributed to this artifact
|
|
72
|
-
</p>
|
|
73
|
-
{ancestry ? (
|
|
74
|
-
<AncestryTree node={ancestry} currentGenerationId={generationId} />
|
|
75
|
-
) : (
|
|
76
|
-
<p className="text-muted-foreground">No ancestry data available</p>
|
|
77
|
-
)}
|
|
78
|
-
</Card>
|
|
79
|
-
|
|
80
|
-
{/* Descendants Section */}
|
|
81
|
-
<Card className="p-6">
|
|
82
|
-
<h2 className="text-2xl font-bold mb-4">Descendants</h2>
|
|
83
|
-
<p className="text-muted-foreground mb-4">
|
|
84
|
-
Shows all child generations that used this artifact as input
|
|
85
|
-
</p>
|
|
86
|
-
{descendants ? (
|
|
87
|
-
<DescendantTree node={descendants} currentGenerationId={generationId} />
|
|
88
|
-
) : (
|
|
89
|
-
<p className="text-muted-foreground">
|
|
90
|
-
No descendants data available
|
|
91
|
-
</p>
|
|
92
|
-
)}
|
|
93
|
-
</Card>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
interface AncestryTreeProps {
|
|
100
|
-
node: AncestryNode;
|
|
101
|
-
currentGenerationId: string;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function AncestryTree({ node, currentGenerationId }: AncestryTreeProps) {
|
|
105
|
-
const router = useRouter();
|
|
106
|
-
const isCurrentGeneration = node.generation.id === currentGenerationId;
|
|
107
|
-
|
|
108
|
-
return (
|
|
109
|
-
<div className="space-y-2">
|
|
110
|
-
<div
|
|
111
|
-
className={`p-3 rounded-lg border ${
|
|
112
|
-
isCurrentGeneration
|
|
113
|
-
? "bg-primary/10 border-primary"
|
|
114
|
-
: "bg-card hover:bg-accent cursor-pointer"
|
|
115
|
-
}`}
|
|
116
|
-
onClick={() => {
|
|
117
|
-
if (!isCurrentGeneration) {
|
|
118
|
-
router.push(`/lineage/${node.generation.id}`);
|
|
119
|
-
}
|
|
120
|
-
}}
|
|
121
|
-
>
|
|
122
|
-
<div className="flex items-start justify-between">
|
|
123
|
-
<div className="flex-1">
|
|
124
|
-
<div className="flex items-center gap-2">
|
|
125
|
-
<span className="font-mono text-sm text-muted-foreground">
|
|
126
|
-
Depth: {node.depth}
|
|
127
|
-
</span>
|
|
128
|
-
{node.role && (
|
|
129
|
-
<span className="px-2 py-0.5 text-xs rounded-full bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300">
|
|
130
|
-
{node.role}
|
|
131
|
-
</span>
|
|
132
|
-
)}
|
|
133
|
-
</div>
|
|
134
|
-
<p className="font-semibold mt-1">{node.generation.generatorName}</p>
|
|
135
|
-
<p className="text-sm text-muted-foreground">
|
|
136
|
-
{node.generation.artifactType} • {node.generation.status}
|
|
137
|
-
</p>
|
|
138
|
-
<p className="text-xs text-muted-foreground font-mono mt-1">
|
|
139
|
-
{node.generation.id.slice(0, 8)}...
|
|
140
|
-
</p>
|
|
141
|
-
</div>
|
|
142
|
-
{node.generation.thumbnailUrl && (
|
|
143
|
-
// eslint-disable-next-line @next/next/no-img-element
|
|
144
|
-
<img
|
|
145
|
-
src={node.generation.thumbnailUrl}
|
|
146
|
-
alt="Thumbnail"
|
|
147
|
-
className="w-16 h-16 object-cover rounded"
|
|
148
|
-
/>
|
|
149
|
-
)}
|
|
150
|
-
</div>
|
|
151
|
-
</div>
|
|
152
|
-
|
|
153
|
-
{node.parents && node.parents.length > 0 && (
|
|
154
|
-
<div className="ml-6 pl-4 border-l-2 border-muted space-y-2">
|
|
155
|
-
{node.parents.map((parent, idx) => (
|
|
156
|
-
<AncestryTree
|
|
157
|
-
key={`${parent.generation.id}-${idx}`}
|
|
158
|
-
node={parent}
|
|
159
|
-
currentGenerationId={currentGenerationId}
|
|
160
|
-
/>
|
|
161
|
-
))}
|
|
162
|
-
</div>
|
|
163
|
-
)}
|
|
164
|
-
</div>
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
interface DescendantTreeProps {
|
|
169
|
-
node: DescendantNode;
|
|
170
|
-
currentGenerationId: string;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function DescendantTree({ node, currentGenerationId }: DescendantTreeProps) {
|
|
174
|
-
const router = useRouter();
|
|
175
|
-
const isCurrentGeneration = node.generation.id === currentGenerationId;
|
|
176
|
-
|
|
177
|
-
return (
|
|
178
|
-
<div className="space-y-2">
|
|
179
|
-
<div
|
|
180
|
-
className={`p-3 rounded-lg border ${
|
|
181
|
-
isCurrentGeneration
|
|
182
|
-
? "bg-primary/10 border-primary"
|
|
183
|
-
: "bg-card hover:bg-accent cursor-pointer"
|
|
184
|
-
}`}
|
|
185
|
-
onClick={() => {
|
|
186
|
-
if (!isCurrentGeneration) {
|
|
187
|
-
router.push(`/lineage/${node.generation.id}`);
|
|
188
|
-
}
|
|
189
|
-
}}
|
|
190
|
-
>
|
|
191
|
-
<div className="flex items-start justify-between">
|
|
192
|
-
<div className="flex-1">
|
|
193
|
-
<div className="flex items-center gap-2">
|
|
194
|
-
<span className="font-mono text-sm text-muted-foreground">
|
|
195
|
-
Depth: {node.depth}
|
|
196
|
-
</span>
|
|
197
|
-
{node.role && (
|
|
198
|
-
<span className="px-2 py-0.5 text-xs rounded-full bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300">
|
|
199
|
-
{node.role}
|
|
200
|
-
</span>
|
|
201
|
-
)}
|
|
202
|
-
</div>
|
|
203
|
-
<p className="font-semibold mt-1">{node.generation.generatorName}</p>
|
|
204
|
-
<p className="text-sm text-muted-foreground">
|
|
205
|
-
{node.generation.artifactType} • {node.generation.status}
|
|
206
|
-
</p>
|
|
207
|
-
<p className="text-xs text-muted-foreground font-mono mt-1">
|
|
208
|
-
{node.generation.id.slice(0, 8)}...
|
|
209
|
-
</p>
|
|
210
|
-
</div>
|
|
211
|
-
{node.generation.thumbnailUrl && (
|
|
212
|
-
// eslint-disable-next-line @next/next/no-img-element
|
|
213
|
-
<img
|
|
214
|
-
src={node.generation.thumbnailUrl}
|
|
215
|
-
alt="Thumbnail"
|
|
216
|
-
className="w-16 h-16 object-cover rounded"
|
|
217
|
-
/>
|
|
218
|
-
)}
|
|
219
|
-
</div>
|
|
220
|
-
</div>
|
|
221
|
-
|
|
222
|
-
{node.children && node.children.length > 0 && (
|
|
223
|
-
<div className="ml-6 pl-4 border-l-2 border-muted space-y-2">
|
|
224
|
-
{node.children.map((child, idx) => (
|
|
225
|
-
<DescendantTree
|
|
226
|
-
key={`${child.generation.id}-${idx}`}
|
|
227
|
-
node={child}
|
|
228
|
-
currentGenerationId={currentGenerationId}
|
|
229
|
-
/>
|
|
230
|
-
))}
|
|
231
|
-
</div>
|
|
232
|
-
)}
|
|
233
|
-
</div>
|
|
234
|
-
);
|
|
235
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useBoards } from "@weirdfingers/boards";
|
|
4
|
-
import { Button } from "@/components/ui/button";
|
|
5
|
-
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
6
|
-
import Link from "next/link";
|
|
7
|
-
|
|
8
|
-
export default function Home() {
|
|
9
|
-
const { boards, createBoard } = useBoards();
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<main className="container mx-auto p-4">
|
|
13
|
-
<div className="flex justify-between items-center mb-4">
|
|
14
|
-
<h1 className="text-2xl font-bold">Boards</h1>
|
|
15
|
-
<Button onClick={() => createBoard({ title: "New Board" })}>
|
|
16
|
-
Create Board
|
|
17
|
-
</Button>
|
|
18
|
-
</div>
|
|
19
|
-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
20
|
-
{boards.map((board) => (
|
|
21
|
-
<Link href={`/boards/${board.id}`} key={board.id}>
|
|
22
|
-
<Card>
|
|
23
|
-
<CardHeader>
|
|
24
|
-
<CardTitle>{board.title}</CardTitle>
|
|
25
|
-
</CardHeader>
|
|
26
|
-
<CardContent>
|
|
27
|
-
<p>{board.description || "No description"}</p>
|
|
28
|
-
</CardContent>
|
|
29
|
-
</Card>
|
|
30
|
-
</Link>
|
|
31
|
-
))}
|
|
32
|
-
</div>
|
|
33
|
-
</main>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { BoardsProvider, NoAuthProvider } from "@weirdfingers/boards";
|
|
5
|
-
|
|
6
|
-
export function Providers({ children }: { children: React.ReactNode }) {
|
|
7
|
-
const apiUrl = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8088";
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<BoardsProvider
|
|
11
|
-
authProvider={new NoAuthProvider()}
|
|
12
|
-
apiUrl={apiUrl}
|
|
13
|
-
// graphqlUrl will default to `${apiUrl}/graphql`
|
|
14
|
-
>
|
|
15
|
-
{children}
|
|
16
|
-
</BoardsProvider>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React, { useState } from "react";
|
|
4
|
-
import { FileVideo, Volume2, X } from "lucide-react";
|
|
5
|
-
import Image from "next/image";
|
|
6
|
-
|
|
7
|
-
interface Generation {
|
|
8
|
-
id: string;
|
|
9
|
-
artifactType: string;
|
|
10
|
-
storageUrl?: string | null;
|
|
11
|
-
thumbnailUrl?: string | null;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface ArtifactSlot {
|
|
15
|
-
name: string;
|
|
16
|
-
type: string; // "audio", "video", "image", etc.
|
|
17
|
-
required: boolean;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface ArtifactInputSlotsProps {
|
|
21
|
-
slots: ArtifactSlot[];
|
|
22
|
-
selectedArtifacts: Map<string, Generation>;
|
|
23
|
-
availableArtifacts: Generation[];
|
|
24
|
-
onSelectArtifact: (slotName: string, artifact: Generation | null) => void;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function ArtifactInputSlots({
|
|
28
|
-
slots,
|
|
29
|
-
selectedArtifacts,
|
|
30
|
-
availableArtifacts,
|
|
31
|
-
onSelectArtifact,
|
|
32
|
-
}: ArtifactInputSlotsProps) {
|
|
33
|
-
const [dragOverSlot, setDragOverSlot] = useState<string | null>(null);
|
|
34
|
-
|
|
35
|
-
const getIcon = (type: string) => {
|
|
36
|
-
switch (type.toLowerCase()) {
|
|
37
|
-
case "video":
|
|
38
|
-
return <FileVideo className="w-5 h-5" />;
|
|
39
|
-
case "audio":
|
|
40
|
-
return <Volume2 className="w-5 h-5" />;
|
|
41
|
-
default:
|
|
42
|
-
return <FileVideo className="w-5 h-5" />;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const getFilteredArtifacts = (slotType: string) => {
|
|
47
|
-
return availableArtifacts.filter(
|
|
48
|
-
(artifact) =>
|
|
49
|
-
artifact.artifactType.toLowerCase() === slotType.toLowerCase()
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const handleDragOver = (
|
|
54
|
-
e: React.DragEvent,
|
|
55
|
-
slotType: string,
|
|
56
|
-
slotName: string
|
|
57
|
-
) => {
|
|
58
|
-
e.preventDefault();
|
|
59
|
-
e.stopPropagation();
|
|
60
|
-
|
|
61
|
-
// Check if the dragged artifact type matches the slot type
|
|
62
|
-
try {
|
|
63
|
-
const data = e.dataTransfer.types.includes("application/json");
|
|
64
|
-
if (data) {
|
|
65
|
-
e.dataTransfer.dropEffect = "copy";
|
|
66
|
-
setDragOverSlot(slotName);
|
|
67
|
-
}
|
|
68
|
-
} catch {
|
|
69
|
-
// Ignore errors during drag over
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const handleDragLeave = (e: React.DragEvent) => {
|
|
74
|
-
e.preventDefault();
|
|
75
|
-
e.stopPropagation();
|
|
76
|
-
setDragOverSlot(null);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const handleDrop = (
|
|
80
|
-
e: React.DragEvent,
|
|
81
|
-
slotType: string,
|
|
82
|
-
slotName: string
|
|
83
|
-
) => {
|
|
84
|
-
e.preventDefault();
|
|
85
|
-
e.stopPropagation();
|
|
86
|
-
setDragOverSlot(null);
|
|
87
|
-
|
|
88
|
-
try {
|
|
89
|
-
const jsonData = e.dataTransfer.getData("application/json");
|
|
90
|
-
if (jsonData) {
|
|
91
|
-
const artifact = JSON.parse(jsonData) as Generation;
|
|
92
|
-
|
|
93
|
-
// Check if artifact type matches slot type
|
|
94
|
-
if (artifact.artifactType.toLowerCase() === slotType.toLowerCase()) {
|
|
95
|
-
onSelectArtifact(slotName, artifact);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
} catch (err) {
|
|
99
|
-
console.error("Error handling drop:", err);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
return (
|
|
104
|
-
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
105
|
-
{slots.map((slot) => {
|
|
106
|
-
const selectedArtifact = selectedArtifacts.get(slot.name);
|
|
107
|
-
const matchingArtifacts = getFilteredArtifacts(slot.type);
|
|
108
|
-
|
|
109
|
-
return (
|
|
110
|
-
<div key={slot.name} className="relative">
|
|
111
|
-
{selectedArtifact ? (
|
|
112
|
-
// Show selected artifact
|
|
113
|
-
<div className="border-2 border-primary rounded-lg p-4 bg-primary/5">
|
|
114
|
-
<div className="flex items-start gap-3">
|
|
115
|
-
<div className="flex-shrink-0">
|
|
116
|
-
{selectedArtifact.thumbnailUrl ||
|
|
117
|
-
selectedArtifact.storageUrl ? (
|
|
118
|
-
<Image
|
|
119
|
-
src={
|
|
120
|
-
selectedArtifact.thumbnailUrl ||
|
|
121
|
-
selectedArtifact.storageUrl ||
|
|
122
|
-
""
|
|
123
|
-
}
|
|
124
|
-
alt={`${slot.type} preview`}
|
|
125
|
-
className="w-16 h-16 object-cover rounded"
|
|
126
|
-
width={64}
|
|
127
|
-
height={64}
|
|
128
|
-
/>
|
|
129
|
-
) : (
|
|
130
|
-
<div className="w-16 h-16 bg-muted rounded flex items-center justify-center">
|
|
131
|
-
{getIcon(slot.type)}
|
|
132
|
-
</div>
|
|
133
|
-
)}
|
|
134
|
-
</div>
|
|
135
|
-
<div className="flex-1 min-w-0">
|
|
136
|
-
<div className="flex items-center gap-2">
|
|
137
|
-
{getIcon(slot.type)}
|
|
138
|
-
<span className="font-medium text-sm capitalize">
|
|
139
|
-
{slot.type} {selectedArtifact.id.substring(0, 7)}
|
|
140
|
-
</span>
|
|
141
|
-
</div>
|
|
142
|
-
<p className="text-xs text-muted-foreground mt-1">
|
|
143
|
-
{slot.name.replace(/_/g, " ")}
|
|
144
|
-
</p>
|
|
145
|
-
</div>
|
|
146
|
-
<button
|
|
147
|
-
onClick={() => onSelectArtifact(slot.name, null)}
|
|
148
|
-
className="flex-shrink-0 p-1 hover:bg-primary/10 rounded"
|
|
149
|
-
>
|
|
150
|
-
<X className="w-4 h-4" />
|
|
151
|
-
</button>
|
|
152
|
-
</div>
|
|
153
|
-
</div>
|
|
154
|
-
) : (
|
|
155
|
-
// Show slot placeholder
|
|
156
|
-
<div
|
|
157
|
-
className={`border-2 border-dashed rounded-lg p-6 transition-all ${
|
|
158
|
-
dragOverSlot === slot.name
|
|
159
|
-
? "border-primary bg-primary/5"
|
|
160
|
-
: "border-border hover:border-border/80"
|
|
161
|
-
}`}
|
|
162
|
-
onDragOver={(e) => handleDragOver(e, slot.type, slot.name)}
|
|
163
|
-
onDragLeave={handleDragLeave}
|
|
164
|
-
onDrop={(e) => handleDrop(e, slot.type, slot.name)}
|
|
165
|
-
>
|
|
166
|
-
<div className="flex flex-col items-center justify-center text-center">
|
|
167
|
-
<div className="mb-2">{getIcon(slot.type)}</div>
|
|
168
|
-
<p className="text-sm font-medium text-foreground mb-1">
|
|
169
|
-
{dragOverSlot === slot.name
|
|
170
|
-
? `Drop ${slot.type} here`
|
|
171
|
-
: `Add a ${slot.type}`}
|
|
172
|
-
</p>
|
|
173
|
-
{matchingArtifacts.length > 0 ? (
|
|
174
|
-
<select
|
|
175
|
-
onChange={(e) => {
|
|
176
|
-
const artifact = matchingArtifacts.find(
|
|
177
|
-
(a) => a.id === e.target.value
|
|
178
|
-
);
|
|
179
|
-
if (artifact) {
|
|
180
|
-
onSelectArtifact(slot.name, artifact);
|
|
181
|
-
}
|
|
182
|
-
}}
|
|
183
|
-
className="mt-2 px-3 py-1.5 text-sm border border-border rounded bg-background"
|
|
184
|
-
>
|
|
185
|
-
<option value="">Select from board...</option>
|
|
186
|
-
{matchingArtifacts.map((artifact) => (
|
|
187
|
-
<option key={artifact.id} value={artifact.id}>
|
|
188
|
-
{artifact.artifactType} -{" "}
|
|
189
|
-
{artifact.id.substring(0, 8)}
|
|
190
|
-
</option>
|
|
191
|
-
))}
|
|
192
|
-
</select>
|
|
193
|
-
) : (
|
|
194
|
-
<p className="text-xs text-muted-foreground mt-1">
|
|
195
|
-
No {slot.type} artifacts in this board yet.
|
|
196
|
-
</p>
|
|
197
|
-
)}
|
|
198
|
-
</div>
|
|
199
|
-
</div>
|
|
200
|
-
)}
|
|
201
|
-
</div>
|
|
202
|
-
);
|
|
203
|
-
})}
|
|
204
|
-
</div>
|
|
205
|
-
);
|
|
206
|
-
}
|