larkup 0.1.14

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.
Files changed (141) hide show
  1. package/.env +2 -0
  2. package/app/actions/vercel.ts +417 -0
  3. package/app/api/chat/route.ts +192 -0
  4. package/app/api/chat/status/route.ts +55 -0
  5. package/app/api/chat/suggestions/route.ts +115 -0
  6. package/app/api/config/route.ts +73 -0
  7. package/app/api/config/test/route.ts +67 -0
  8. package/app/api/config/test-embedding/route.ts +40 -0
  9. package/app/api/config/test-llm/route.ts +47 -0
  10. package/app/api/config/test-provider/route.ts +36 -0
  11. package/app/api/demo/route.ts +176 -0
  12. package/app/api/deploy/ssh/route.ts +340 -0
  13. package/app/api/documents/route.ts +90 -0
  14. package/app/api/firecrawl/local/route.ts +46 -0
  15. package/app/api/index/route.ts +113 -0
  16. package/app/api/jobs/[id]/route.ts +44 -0
  17. package/app/api/jobs/route.ts +116 -0
  18. package/app/api/parse-file/route.ts +39 -0
  19. package/app/api/search/google/route.ts +162 -0
  20. package/app/api/search/route.ts +29 -0
  21. package/app/api/server/download/route.ts +112 -0
  22. package/app/api/server/generate/route.ts +46 -0
  23. package/app/api/server/local/route.ts +42 -0
  24. package/app/api/servers/route.ts +137 -0
  25. package/app/api/vector-stores/install/route.ts +65 -0
  26. package/app/api/vector-stores/status/route.ts +26 -0
  27. package/app/chat/page.tsx +15 -0
  28. package/app/configure/page.tsx +53 -0
  29. package/app/data/page.tsx +15 -0
  30. package/app/demo/page.tsx +15 -0
  31. package/app/favicon.ico +0 -0
  32. package/app/globals.css +190 -0
  33. package/app/index-data/page.tsx +15 -0
  34. package/app/layout.tsx +51 -0
  35. package/app/page.tsx +34 -0
  36. package/app/server/page.tsx +22 -0
  37. package/app/simple/chat/page.tsx +17 -0
  38. package/app/simple/docs/page.tsx +21 -0
  39. package/app/simple/layout.tsx +9 -0
  40. package/app/simple/settings/page.tsx +627 -0
  41. package/app/template.tsx +16 -0
  42. package/app/themes.css +733 -0
  43. package/components/alerts/generic-alert.tsx +74 -0
  44. package/components/app-sidebar.tsx +187 -0
  45. package/components/app-topnav.tsx +195 -0
  46. package/components/chat/chat-settings-modal.tsx +209 -0
  47. package/components/chat/chat-workspace.tsx +348 -0
  48. package/components/chat/knowledge-base-result.tsx +97 -0
  49. package/components/chat/message-item.tsx +103 -0
  50. package/components/client-layout-wrapper.tsx +182 -0
  51. package/components/configure/configure-form.tsx +1683 -0
  52. package/components/configure/store-fields.tsx +152 -0
  53. package/components/data/corpus-panel.tsx +499 -0
  54. package/components/data/data-workspace.tsx +272 -0
  55. package/components/data/firecrawl-notice.tsx +236 -0
  56. package/components/data/jobs-panel.tsx +485 -0
  57. package/components/data/paste-panel.tsx +79 -0
  58. package/components/data/scrape-panel.tsx +964 -0
  59. package/components/data/upload-panel.tsx +714 -0
  60. package/components/demo/demo-workspace.tsx +419 -0
  61. package/components/global-settings.tsx +286 -0
  62. package/components/index/index-workspace.tsx +482 -0
  63. package/components/onboarding/simple-setup.tsx +702 -0
  64. package/components/onboarding/tech-setup.tsx +121 -0
  65. package/components/onboarding/welcome-screen.tsx +183 -0
  66. package/components/page-header.tsx +44 -0
  67. package/components/server/code-viewer.tsx +87 -0
  68. package/components/server/deploy-button.tsx +1390 -0
  69. package/components/server/server-workspace.tsx +392 -0
  70. package/components/simple/sdk-connect-dialog.tsx +201 -0
  71. package/components/simple/simple-index-button.tsx +83 -0
  72. package/components/simple/simple-sidebar.tsx +161 -0
  73. package/components/theme-customizer-provider.tsx +171 -0
  74. package/components/theme-switcher.tsx +445 -0
  75. package/components/ui/alert-dialog.tsx +187 -0
  76. package/components/ui/alert.tsx +76 -0
  77. package/components/ui/badge.tsx +52 -0
  78. package/components/ui/button.tsx +59 -0
  79. package/components/ui/card.tsx +103 -0
  80. package/components/ui/checkbox.tsx +28 -0
  81. package/components/ui/collapsible.tsx +21 -0
  82. package/components/ui/dialog.tsx +159 -0
  83. package/components/ui/dropdown-menu.tsx +281 -0
  84. package/components/ui/input.tsx +22 -0
  85. package/components/ui/label.tsx +20 -0
  86. package/components/ui/popover.tsx +90 -0
  87. package/components/ui/progress.tsx +83 -0
  88. package/components/ui/provider-icon.tsx +94 -0
  89. package/components/ui/scroll-area.tsx +55 -0
  90. package/components/ui/select.tsx +248 -0
  91. package/components/ui/separator.tsx +25 -0
  92. package/components/ui/sheet.tsx +138 -0
  93. package/components/ui/skeleton.tsx +13 -0
  94. package/components/ui/sonner.tsx +63 -0
  95. package/components/ui/switch.tsx +32 -0
  96. package/components/ui/table.tsx +116 -0
  97. package/components/ui/tabs.tsx +84 -0
  98. package/components/ui/textarea.tsx +18 -0
  99. package/components/ui/tooltip.tsx +66 -0
  100. package/components/workspace/delete-server-dialog.tsx +71 -0
  101. package/components/workspace/server-form-dialog.tsx +103 -0
  102. package/components/workspace/server-switcher.tsx +163 -0
  103. package/components/workspace/workspace-provider.tsx +177 -0
  104. package/components/workspace/workspace-top-bar.tsx +23 -0
  105. package/components.json +21 -0
  106. package/lib/error-formatter.ts +15 -0
  107. package/lib/utils.ts +6 -0
  108. package/next-env.d.ts +6 -0
  109. package/next.config.mjs +18 -0
  110. package/package.json +65 -0
  111. package/postcss.config.mjs +8 -0
  112. package/public/docker.png +0 -0
  113. package/public/favicon.ico +0 -0
  114. package/public/github.svg +3 -0
  115. package/public/hetzner.svg +1 -0
  116. package/public/icons/aws.svg +38 -0
  117. package/public/icons/azure.svg +1 -0
  118. package/public/icons/chroma.png +0 -0
  119. package/public/icons/cohere.svg +30 -0
  120. package/public/icons/digital-ocean.webp +0 -0
  121. package/public/icons/firecrawl2.png +0 -0
  122. package/public/icons/gcp.svg +1 -0
  123. package/public/icons/gemini.svg +1 -0
  124. package/public/icons/jina.svg +1 -0
  125. package/public/icons/lancedb2.png +0 -0
  126. package/public/icons/mistral.svg +469 -0
  127. package/public/icons/nomic.png +0 -0
  128. package/public/icons/openai.svg +1 -0
  129. package/public/icons/pgvector2.png +0 -0
  130. package/public/icons/pinecone.png +0 -0
  131. package/public/icons/qdrant.svg +35 -0
  132. package/public/icons/supabase.png +0 -0
  133. package/public/icons/vercel copy.svg +1 -0
  134. package/public/icons/vercel.svg +1 -0
  135. package/public/icons/voyage-light.png +0 -0
  136. package/public/icons/weaviate.webp +0 -0
  137. package/public/logo-light.png +0 -0
  138. package/public/logo.png +0 -0
  139. package/public/logo9.png +0 -0
  140. package/public/vercel.svg +1 -0
  141. package/tsconfig.json +33 -0
@@ -0,0 +1,182 @@
1
+ "use client";
2
+
3
+ import { useState } from "react";
4
+ import {
5
+ useThemeCustomizer,
6
+ PanelBgVariant,
7
+ } from "./theme-customizer-provider";
8
+ import { AppSidebar } from "./app-sidebar";
9
+ import { AppTopNav } from "./app-topnav";
10
+ import { usePathname } from "next/navigation";
11
+ import { WorkspaceTopBar } from "@/components/workspace/workspace-top-bar";
12
+ import { cn } from "@/lib/utils";
13
+ import { useWorkspace } from "@/components/workspace/workspace-provider";
14
+ import { WelcomeScreen } from "@/components/onboarding/welcome-screen";
15
+ import { TechSetup } from "@/components/onboarding/tech-setup";
16
+ import { SimpleSetup } from "@/components/onboarding/simple-setup";
17
+ import { SimpleSidebar } from "@/components/simple/simple-sidebar";
18
+
19
+ const PANEL_BG_COLORS: Record<PanelBgVariant, string | null> = {
20
+ "panel-default": "#FAFAFA",
21
+ "panel-white": "#FFFFFF",
22
+ "panel-fafafa": "#F4F4F4",
23
+ "panel-warm": "#F7F1EA",
24
+ "panel-soft": "#FBFAF8",
25
+ "panel-silver": "#F8F8F8",
26
+ "panel-stone": "#F5F5F2",
27
+ };
28
+
29
+ type OnboardingStep = "welcome" | "tech-setup" | "simple-setup"
30
+
31
+ export function ClientLayoutWrapper({
32
+ children,
33
+ }: {
34
+ children: React.ReactNode;
35
+ }) {
36
+ const { layout, pageStyle, panelBg } = useThemeCustomizer();
37
+ const pathname = usePathname();
38
+ const isChatPage = pathname?.includes("/chat");
39
+ const { isFirstRun, isLoading, mode } = useWorkspace();
40
+
41
+ // Local onboarding step state — only used during the onboarding flow
42
+ const [onboardingStep, setOnboardingStep] = useState<OnboardingStep>("welcome")
43
+
44
+ const panelColor = PANEL_BG_COLORS[panelBg];
45
+ const panelStyle = panelColor ? { backgroundColor: panelColor } : undefined;
46
+
47
+ // ── Onboarding: full-page screens ──────────────────────────────────
48
+ // Show onboarding when it's first run (no servers) OR no mode has been chosen yet
49
+ const needsOnboarding = !isLoading && (isFirstRun || (!mode && !isLoading))
50
+
51
+ if (needsOnboarding) {
52
+ if (onboardingStep === "welcome") {
53
+ return (
54
+ <WelcomeScreen
55
+ onSelectTech={() => setOnboardingStep("tech-setup")}
56
+ onSelectSimple={() => setOnboardingStep("simple-setup")}
57
+ />
58
+ )
59
+ }
60
+ if (onboardingStep === "tech-setup") {
61
+ return <TechSetup onBack={() => setOnboardingStep("welcome")} />
62
+ }
63
+ if (onboardingStep === "simple-setup") {
64
+ return <SimpleSetup onBack={() => setOnboardingStep("welcome")} />
65
+ }
66
+ }
67
+
68
+ // ── Loading state ──────────────────────────────────────────────────
69
+ if (isLoading) {
70
+ return (
71
+ <div className="flex h-screen items-center justify-center">
72
+ <div className="size-6 animate-spin rounded-full border-2 border-primary border-t-transparent" />
73
+ </div>
74
+ )
75
+ }
76
+
77
+ // ── Shared layout classes ──────────────────────────────────────────
78
+ const containerClasses =
79
+ pageStyle === "fused"
80
+ ? "h-[calc(100vh-8rem)] bg-background text-foreground overflow-hidden"
81
+ : "h-[calc(100vh-8rem)] rounded-2xl border border-border bg-panel text-panel-foreground overflow-hidden";
82
+
83
+ const sidebarContainerClasses =
84
+ pageStyle === "fused"
85
+ ? "h-[calc(100vh-1.5rem)] flex flex-col bg-background text-foreground overflow-hidden"
86
+ : "h-[calc(100vh-1.5rem)] flex flex-col rounded-2xl border border-border bg-panel text-panel-foreground overflow-hidden";
87
+
88
+ // ── Simple mode layout ─────────────────────────────────────────────
89
+ if (mode === "simple") {
90
+ // TopNav layout for simple mode
91
+ if (layout === "topnav") {
92
+ return (
93
+ <div className="flex h-screen flex-col overflow-hidden">
94
+ <AppTopNav />
95
+ <main
96
+ className={cn("flex-1 min-h-0 overflow-hidden p-4 md:p-6 lg:p-8")}
97
+ >
98
+ <div
99
+ className={cn(containerClasses, "container mx-auto flex flex-col")}
100
+ style={panelStyle}
101
+ >
102
+ {children}
103
+ </div>
104
+ </main>
105
+ </div>
106
+ );
107
+ }
108
+
109
+ // Default sidebar layout for simple mode
110
+ return (
111
+ <div className="flex h-screen overflow-hidden">
112
+ <SimpleSidebar />
113
+ <main className="min-w-0 flex-1 p-3 pl-3 md:pl-0 overflow-hidden">
114
+ <div className={sidebarContainerClasses} style={panelStyle}>
115
+ <WorkspaceTopBar />
116
+ <div
117
+ className={cn(
118
+ "flex-1 min-h-0",
119
+ isChatPage ? "overflow-hidden flex flex-col" : "overflow-auto",
120
+ )}
121
+ >
122
+ <div
123
+ className={cn(
124
+ "container mx-auto",
125
+ isChatPage ? "flex-1 min-h-0 flex flex-col" : "pb-8",
126
+ )}
127
+ >
128
+ {children}
129
+ </div>
130
+ </div>
131
+ </div>
132
+ </main>
133
+ </div>
134
+ );
135
+ }
136
+
137
+ // ── Tech mode layout (existing) ────────────────────────────────────
138
+ if (layout === "topnav") {
139
+ return (
140
+ <div className="flex h-screen flex-col overflow-hidden">
141
+ <AppTopNav />
142
+ <main
143
+ className={cn("flex-1 min-h-0 overflow-hidden p-4 md:p-6 lg:p-8")}
144
+ >
145
+ <div
146
+ className={cn(containerClasses, "container mx-auto flex flex-col")}
147
+ style={panelStyle}
148
+ >
149
+ {children}
150
+ </div>
151
+ </main>
152
+ </div>
153
+ );
154
+ }
155
+
156
+ // Default Sidebar Layout
157
+ return (
158
+ <div className="flex h-screen overflow-hidden">
159
+ <AppSidebar />
160
+ <main className="min-w-0 flex-1 p-3 pl-3 md:pl-0 overflow-hidden">
161
+ <div className={sidebarContainerClasses} style={panelStyle}>
162
+ <WorkspaceTopBar />
163
+ <div
164
+ className={cn(
165
+ "flex-1 min-h-0",
166
+ isChatPage ? "overflow-hidden flex flex-col" : "overflow-auto",
167
+ )}
168
+ >
169
+ <div
170
+ className={cn(
171
+ "container mx-auto",
172
+ isChatPage ? "flex-1 min-h-0 flex flex-col" : "pb-8",
173
+ )}
174
+ >
175
+ {children}
176
+ </div>
177
+ </div>
178
+ </div>
179
+ </main>
180
+ </div>
181
+ );
182
+ }