larkup 0.1.34 → 0.1.35
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/diagnostics/route-bundle-stats.json +8 -8
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/required-server-files.js +1 -1
- package/.next/required-server-files.json +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +16 -16
- package/.next/server/app/_not-found.segments/_full.segment.rsc +16 -16
- package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/analytics/page_client-reference-manifest.js +1 -1
- package/.next/server/app/analytics.html +1 -1
- package/.next/server/app/analytics.rsc +17 -17
- package/.next/server/app/analytics.segments/_full.segment.rsc +17 -17
- package/.next/server/app/analytics.segments/_head.segment.rsc +4 -4
- package/.next/server/app/analytics.segments/_index.segment.rsc +11 -11
- package/.next/server/app/analytics.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/analytics.segments/analytics/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/analytics.segments/analytics.segment.rsc +3 -3
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/chat/route.js.nft.json +1 -1
- package/.next/server/app/api/chat/status/route.js.nft.json +1 -1
- package/.next/server/app/api/chat/suggestions/route.js.nft.json +1 -1
- package/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/server/app/api/config/test/route.js.nft.json +1 -1
- package/.next/server/app/api/connections/route.js.nft.json +1 -1
- package/.next/server/app/api/connections/webhook/route.js.nft.json +1 -1
- package/.next/server/app/api/demo/route.js.nft.json +1 -1
- package/.next/server/app/api/deploy/cloud-project/route.js.nft.json +1 -1
- package/.next/server/app/api/deploy/ssh/route.js.nft.json +1 -1
- package/.next/server/app/api/deployment/blob-setup/route.js.nft.json +1 -1
- package/.next/server/app/api/deployment/config/route.js.nft.json +1 -1
- package/.next/server/app/api/describe-image/route.js.nft.json +1 -1
- package/.next/server/app/api/documents/route.js.nft.json +1 -1
- package/.next/server/app/api/firecrawl/local/route.js.nft.json +1 -1
- package/.next/server/app/api/index/route.js.nft.json +1 -1
- package/.next/server/app/api/jobs/[id]/route.js +2 -1
- package/.next/server/app/api/jobs/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/jobs/route.js +2 -1
- package/.next/server/app/api/jobs/route.js.nft.json +1 -1
- package/.next/server/app/api/media/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/media/process/route.js.nft.json +1 -1
- package/.next/server/app/api/media/route.js.nft.json +1 -1
- package/.next/server/app/api/media/stream/route.js.nft.json +1 -1
- package/.next/server/app/api/search/bing/route.js.nft.json +1 -1
- package/.next/server/app/api/search/brave/route.js.nft.json +1 -1
- package/.next/server/app/api/search/exa/route.js.nft.json +1 -1
- package/.next/server/app/api/search/google/route.js.nft.json +1 -1
- package/.next/server/app/api/search/route.js +3 -2
- package/.next/server/app/api/search/route.js.nft.json +1 -1
- package/.next/server/app/api/search/tavily/route.js.nft.json +1 -1
- package/.next/server/app/api/server/agent/route.js.nft.json +1 -1
- package/.next/server/app/api/server/download/route.js.nft.json +1 -1
- package/.next/server/app/api/server/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/server/local/route.js.nft.json +1 -1
- package/.next/server/app/api/servers/route.js.nft.json +1 -1
- package/.next/server/app/api/tabular/query/route.js.nft.json +1 -1
- package/.next/server/app/api/tabular/route.js.nft.json +1 -1
- package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
- package/.next/server/app/chat.html +1 -1
- package/.next/server/app/chat.rsc +17 -17
- package/.next/server/app/chat.segments/_full.segment.rsc +17 -17
- package/.next/server/app/chat.segments/_head.segment.rsc +4 -4
- package/.next/server/app/chat.segments/_index.segment.rsc +11 -11
- package/.next/server/app/chat.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/chat.segments/chat/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/chat.segments/chat.segment.rsc +3 -3
- package/.next/server/app/data/page_client-reference-manifest.js +1 -1
- package/.next/server/app/data.html +1 -1
- package/.next/server/app/data.rsc +17 -17
- package/.next/server/app/data.segments/_full.segment.rsc +17 -17
- package/.next/server/app/data.segments/_head.segment.rsc +4 -4
- package/.next/server/app/data.segments/_index.segment.rsc +11 -11
- package/.next/server/app/data.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/data.segments/data/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/data.segments/data.segment.rsc +3 -3
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +16 -16
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +16 -16
- package/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/server/app/index.segments/_index.segment.rsc +11 -11
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings.html +1 -1
- package/.next/server/app/settings.rsc +18 -18
- package/.next/server/app/settings.segments/_full.segment.rsc +18 -18
- package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings.segments/_index.segment.rsc +11 -11
- package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/.next/server/chunks/0598_next_dist_esm_build_templates_app-route_0kbcuk-.js +4 -4
- package/.next/server/chunks/[root-of-the-server]__08es4vu._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0j034yj._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0j2l54r._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ahdfq9._.js +3 -3
- package/.next/server/chunks/[root-of-the-server]__1idgvjh._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1pumzqp._.js +3 -0
- package/.next/server/chunks/packages_marketplace_src_125_g2p._.js +1 -1
- package/.next/server/chunks/packages_scraper_src_0kkcv_v._.js +61 -0
- package/.next/server/chunks/ssr/_169pdlf._.js +1 -1
- package/.next/server/chunks/ssr/_1yqlx1m._.js +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/standalone/apps/web/.next/BUILD_ID +1 -1
- package/.next/standalone/apps/web/.next/build-manifest.json +3 -3
- package/.next/standalone/apps/web/.next/required-server-files.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.rsc +16 -16
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +16 -16
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/analytics/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/analytics.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/analytics.rsc +17 -17
- package/.next/standalone/apps/web/.next/server/app/analytics.segments/_full.segment.rsc +17 -17
- package/.next/standalone/apps/web/.next/server/app/analytics.segments/_head.segment.rsc +4 -4
- package/.next/standalone/apps/web/.next/server/app/analytics.segments/_index.segment.rsc +11 -11
- package/.next/standalone/apps/web/.next/server/app/analytics.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/analytics.segments/analytics/__PAGE__.segment.rsc +3 -3
- package/.next/standalone/apps/web/.next/server/app/analytics.segments/analytics.segment.rsc +3 -3
- package/.next/standalone/apps/web/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/chat/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/chat/status/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/chat/suggestions/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/config/test/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/connections/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/connections/webhook/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/demo/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/deploy/cloud-project/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/deploy/ssh/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/deployment/blob-setup/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/deployment/config/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/describe-image/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/documents/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/firecrawl/local/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/index/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/jobs/[id]/route.js +2 -1
- package/.next/standalone/apps/web/.next/server/app/api/jobs/[id]/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/jobs/route.js +2 -1
- package/.next/standalone/apps/web/.next/server/app/api/jobs/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/media/[id]/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/media/process/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/media/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/media/stream/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/search/bing/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/search/brave/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/search/exa/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/search/google/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/search/route.js +3 -2
- package/.next/standalone/apps/web/.next/server/app/api/search/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/search/tavily/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/server/agent/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/server/download/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/server/generate/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/server/local/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/servers/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/tabular/query/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/api/tabular/route.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/chat/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/chat.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/chat.rsc +17 -17
- package/.next/standalone/apps/web/.next/server/app/chat.segments/_full.segment.rsc +17 -17
- package/.next/standalone/apps/web/.next/server/app/chat.segments/_head.segment.rsc +4 -4
- package/.next/standalone/apps/web/.next/server/app/chat.segments/_index.segment.rsc +11 -11
- package/.next/standalone/apps/web/.next/server/app/chat.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/chat.segments/chat/__PAGE__.segment.rsc +3 -3
- package/.next/standalone/apps/web/.next/server/app/chat.segments/chat.segment.rsc +3 -3
- package/.next/standalone/apps/web/.next/server/app/data/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/data.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/data.rsc +17 -17
- package/.next/standalone/apps/web/.next/server/app/data.segments/_full.segment.rsc +17 -17
- package/.next/standalone/apps/web/.next/server/app/data.segments/_head.segment.rsc +4 -4
- package/.next/standalone/apps/web/.next/server/app/data.segments/_index.segment.rsc +11 -11
- package/.next/standalone/apps/web/.next/server/app/data.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/data.segments/data/__PAGE__.segment.rsc +3 -3
- package/.next/standalone/apps/web/.next/server/app/data.segments/data.segment.rsc +3 -3
- package/.next/standalone/apps/web/.next/server/app/index.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.rsc +16 -16
- package/.next/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +16 -16
- package/.next/standalone/apps/web/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/apps/web/.next/server/app/index.segments/_index.segment.rsc +11 -11
- package/.next/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.rsc +18 -18
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_full.segment.rsc +18 -18
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_head.segment.rsc +4 -4
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_index.segment.rsc +11 -11
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/apps/web/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/.next/standalone/apps/web/.next/server/chunks/0598_next_dist_esm_build_templates_app-route_0kbcuk-.js +4 -4
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__08es4vu._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0j034yj._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0j2l54r._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__1ahdfq9._.js +3 -3
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__1idgvjh._.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__1pumzqp._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/packages_marketplace_src_125_g2p._.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/packages_scraper_src_0kkcv_v._.js +61 -0
- package/.next/standalone/apps/web/.next/server/chunks/ssr/_169pdlf._.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/_1yqlx1m._.js +1 -1
- package/.next/standalone/apps/web/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/apps/web/.next/server/pages/404.html +1 -1
- package/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
- package/.next/standalone/apps/web/.next/static/chunks/{2oscz5_mk5ikl.js → 2997cwisllvit.js} +1 -1
- package/.next/standalone/apps/web/.next/static/chunks/{068nxrakm96je.js → 3q4k1i384p4oi.js} +3 -3
- package/.next/standalone/apps/web/CHANGELOG.md +11 -0
- package/.next/standalone/apps/web/app/api/chat/route.ts +38 -6
- package/.next/standalone/apps/web/components/data/firecrawl-notice.tsx +5 -5
- package/.next/standalone/apps/web/components/data/media-panel.tsx +2 -2
- package/.next/standalone/apps/web/components/ui/skeleton.tsx +6 -5
- package/.next/standalone/apps/web/package.json +1 -1
- package/.next/standalone/apps/web/server.js +1 -1
- package/.next/static/chunks/{2oscz5_mk5ikl.js → 2997cwisllvit.js} +1 -1
- package/.next/static/chunks/{068nxrakm96je.js → 3q4k1i384p4oi.js} +3 -3
- package/CHANGELOG.md +11 -0
- package/app/api/chat/route.ts +38 -6
- package/components/data/firecrawl-notice.tsx +5 -5
- package/components/data/media-panel.tsx +2 -2
- package/components/ui/skeleton.tsx +6 -5
- package/package.json +6 -6
- package/.next/server/chunks/[root-of-the-server]__067hiof._.js +0 -61
- package/.next/server/chunks/[root-of-the-server]__0a_0ywc._.js +0 -61
- package/.next/server/chunks/[root-of-the-server]__0u17zp8._.js +0 -61
- package/.next/server/chunks/[root-of-the-server]__1vsvck0._.js +0 -61
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__067hiof._.js +0 -61
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0a_0ywc._.js +0 -61
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0u17zp8._.js +0 -61
- package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__1vsvck0._.js +0 -61
- /package/.next/standalone/apps/web/.next/static/{Z7m9nJOto4bGgVOcfPX_4 → hstz-5a1zIL7sCMiAn-KB}/_buildManifest.js +0 -0
- /package/.next/standalone/apps/web/.next/static/{Z7m9nJOto4bGgVOcfPX_4 → hstz-5a1zIL7sCMiAn-KB}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/apps/web/.next/static/{Z7m9nJOto4bGgVOcfPX_4 → hstz-5a1zIL7sCMiAn-KB}/_ssgManifest.js +0 -0
- /package/.next/static/{Z7m9nJOto4bGgVOcfPX_4 → hstz-5a1zIL7sCMiAn-KB}/_buildManifest.js +0 -0
- /package/.next/static/{Z7m9nJOto4bGgVOcfPX_4 → hstz-5a1zIL7sCMiAn-KB}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{Z7m9nJOto4bGgVOcfPX_4 → hstz-5a1zIL7sCMiAn-KB}/_ssgManifest.js +0 -0
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# larkup
|
|
2
2
|
|
|
3
|
+
## 0.1.35
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5ba20af: Make the local crawler work without Docker, make Marketplace installs opt-in and removable, and bound RAG retrieval tool loops and context growth.
|
|
8
|
+
- Updated dependencies [5ba20af]
|
|
9
|
+
- @larkup/scraper@0.1.26
|
|
10
|
+
- @larkup/marketplace@0.1.9
|
|
11
|
+
- @larkup/tool-doc-editor@0.2.5
|
|
12
|
+
- @larkup/tool-video-audio@0.2.2
|
|
13
|
+
|
|
3
14
|
## 0.1.34
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -78,7 +78,7 @@ RETRIEVAL RULES:
|
|
|
78
78
|
- Do not search for greetings, casual conversation, writing help, brainstorming, explanations you can answer reliably from general knowledge, or questions unrelated to the user's indexed data.
|
|
79
79
|
- Use searchKnowledgeBase only when the answer depends on the user's indexed/private content, an exact source-specific fact, or a topic that plausibly refers to something the user indexed.
|
|
80
80
|
- Treat questions about the user or their materials as knowledge-base questions: phrases such as "I", "my", "our", "you have", "the database", "the document", "the file", or "the diagram" require searchKnowledgeBase before answering whenever indexed content may contain the answer.
|
|
81
|
-
- Search at most once per user request
|
|
81
|
+
- Search at most once per user request. Never repeat a search when a prior tool result in this conversation already contains enough evidence. If the results do not answer the question, say so plainly instead of making more searches or guessing.
|
|
82
82
|
|
|
83
83
|
IMAGE AND MEDIA RULES:
|
|
84
84
|
- NEVER output raw markdown image syntax like . The chat UI blocks these and shows "[Image unavailable]". Instead, always use the presentMedia tool to display images, videos, or audio from indexed content.
|
|
@@ -178,6 +178,26 @@ export async function POST(req: Request) {
|
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
if (typeof resultObj !== 'object' || resultObj === null) return result;
|
|
181
|
+
// Keep previous retrieval evidence available for follow-up questions,
|
|
182
|
+
// while preventing several full five-chunk search responses from taking
|
|
183
|
+
// over the model context on a long conversation.
|
|
184
|
+
if (toolName === 'searchKnowledgeBase' && Array.isArray(resultObj.hits)) {
|
|
185
|
+
const compact = {
|
|
186
|
+
...resultObj,
|
|
187
|
+
hits: resultObj.hits.map((hit: any) => ({
|
|
188
|
+
documentId: hit.documentId,
|
|
189
|
+
title: hit.title,
|
|
190
|
+
url: hit.url,
|
|
191
|
+
score: hit.score,
|
|
192
|
+
text: typeof hit.text === 'string' ? hit.text.slice(0, 1_000) : hit.text,
|
|
193
|
+
images: hit.images,
|
|
194
|
+
metadata: hit.metadata,
|
|
195
|
+
timelineContext: hit.timelineContext,
|
|
196
|
+
endingContext: hit.endingContext,
|
|
197
|
+
})),
|
|
198
|
+
};
|
|
199
|
+
return isString ? JSON.stringify(compact) : compact;
|
|
200
|
+
}
|
|
181
201
|
const isDocTool =
|
|
182
202
|
toolName &&
|
|
183
203
|
['fillDocumentForm', 'editDocument', 'requestDocumentSignature'].includes(toolName);
|
|
@@ -365,11 +385,23 @@ ${fieldLines}`;
|
|
|
365
385
|
model,
|
|
366
386
|
system: systemPrompt,
|
|
367
387
|
messages: await convertToModelMessages(safeMessages, { tools }),
|
|
368
|
-
maxOutputTokens:
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
388
|
+
maxOutputTokens: 4096,
|
|
389
|
+
// Five steps covers the only useful multi-step case (retrieve, optionally
|
|
390
|
+
// present one media item, then answer) without allowing a tool loop to
|
|
391
|
+
// burn the context window and end with no response.
|
|
392
|
+
stopWhen: stepCountIs(5),
|
|
393
|
+
toolChoice: 'auto',
|
|
394
|
+
prepareStep: ({ stepNumber }) => {
|
|
395
|
+
if (forceKnowledgeBaseSearch && stepNumber === 0) {
|
|
396
|
+
return { toolChoice: { type: 'tool', toolName: 'searchKnowledgeBase' } };
|
|
397
|
+
}
|
|
398
|
+
// A retrieval is deliberately one-shot per turn. This is applied at the
|
|
399
|
+
// runtime level rather than relying only on the model prompt.
|
|
400
|
+
if (forceKnowledgeBaseSearch) {
|
|
401
|
+
return { activeTools: Object.keys(tools).filter((name) => name !== 'searchKnowledgeBase') };
|
|
402
|
+
}
|
|
403
|
+
return undefined;
|
|
404
|
+
},
|
|
373
405
|
onFinish: async ({ usage, response }) => {
|
|
374
406
|
const { trackUsageEvent, estimateCost } = await import('@larkup/core/analytics-store');
|
|
375
407
|
const u = usage as any;
|
|
@@ -33,7 +33,7 @@ const fetcher = (url: string) => fetch(url).then((r) => r.json());
|
|
|
33
33
|
* Web-crawler launcher notice.
|
|
34
34
|
*
|
|
35
35
|
* Adapts to the runtime environment:
|
|
36
|
-
* - **Web / Desktop**:
|
|
36
|
+
* - **Web / Desktop**: starts Larkup's built-in crawler (no Docker required).
|
|
37
37
|
* - **Docker**: detects a sibling crawler service on the Docker network.
|
|
38
38
|
*
|
|
39
39
|
* The API key (cloud) option is managed in Settings — this component only
|
|
@@ -59,7 +59,7 @@ export function FirecrawlNotice({
|
|
|
59
59
|
const runtimeEnv = data?.runtimeEnv ?? 'web';
|
|
60
60
|
const running = state?.running ?? false;
|
|
61
61
|
const dockerReady = docker?.compose ?? false;
|
|
62
|
-
const hasError = !cloudConfigured && (!
|
|
62
|
+
const hasError = !cloudConfigured && (!running || !!state?.lastError);
|
|
63
63
|
|
|
64
64
|
useEffect(() => {
|
|
65
65
|
if (!isLoading) {
|
|
@@ -76,7 +76,7 @@ export function FirecrawlNotice({
|
|
|
76
76
|
description:
|
|
77
77
|
runtimeEnv === 'docker'
|
|
78
78
|
? 'Checking if the crawler service is available on the network.'
|
|
79
|
-
: '
|
|
79
|
+
: 'Starting Larkup’s built-in crawler. No Docker setup is required.',
|
|
80
80
|
},
|
|
81
81
|
);
|
|
82
82
|
}
|
|
@@ -100,8 +100,8 @@ export function FirecrawlNotice({
|
|
|
100
100
|
'Start Larkup with the optional crawler profile in docker-compose, or add a Firecrawl API key in Settings.',
|
|
101
101
|
});
|
|
102
102
|
} else {
|
|
103
|
-
toast.
|
|
104
|
-
description: '
|
|
103
|
+
toast.success('Web crawler is ready', {
|
|
104
|
+
description: 'You can now scrape websites without Docker.',
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
} else {
|
|
@@ -1634,9 +1634,9 @@ function ActiveIndexingList({
|
|
|
1634
1634
|
{asset.processingMessage || 'Preparing media indexing...'}
|
|
1635
1635
|
</p>
|
|
1636
1636
|
</div>
|
|
1637
|
-
{
|
|
1637
|
+
{asset.processingSteps?.length ? (
|
|
1638
1638
|
<PipelineSteps steps={asset.processingSteps} />
|
|
1639
|
-
) : null}
|
|
1639
|
+
) : null}
|
|
1640
1640
|
</div>
|
|
1641
1641
|
);
|
|
1642
1642
|
})}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import { cn } from '@/lib/utils';
|
|
2
3
|
|
|
3
|
-
function Skeleton({ className, ...props }:
|
|
4
|
+
function Skeleton({ className, ...props }: HTMLAttributes<HTMLDivElement>) {
|
|
4
5
|
return (
|
|
5
6
|
<div
|
|
6
7
|
data-slot="skeleton"
|
|
7
|
-
className={cn(
|
|
8
|
+
className={cn('animate-pulse rounded-md bg-muted', className)}
|
|
8
9
|
{...props}
|
|
9
10
|
/>
|
|
10
|
-
)
|
|
11
|
+
);
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
export { Skeleton }
|
|
14
|
+
export { Skeleton };
|
|
@@ -15,7 +15,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
|
|
|
15
15
|
const hostname = process.env.HOSTNAME || '0.0.0.0'
|
|
16
16
|
|
|
17
17
|
let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
|
|
18
|
-
const nextConfig = {"env":{"NEXT_PUBLIC_APP_VERSION":"0.1.
|
|
18
|
+
const nextConfig = {"env":{"NEXT_PUBLIC_APP_VERSION":"0.1.35"},"webpack":null,"typescript":{"ignoreBuildErrors":true},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.mjs","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":true,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/Users/abdelrahmanabounida/Desktop/my-ai-startup/larkup/larkup","cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"experimental":{"appNewScrollHandler":false,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"partialFallbacks":false,"dynamicOnHover":false,"varyParams":false,"prefetchInlining":false,"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":9,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"useTypeScriptCli":false,"viewTransition":false,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":false,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":false,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.mjs","transpilePackages":["@larkup/core","@larkup/vector-stores","@larkup/scraper","@larkup/marketplace"],"serverExternalPackages":["@lancedb/lancedb","chromadb","dockerode","@larkup/sandbox"],"turbopack":{"root":"/Users/abdelrahmanabounida/Desktop/my-ai-startup/larkup/larkup"},"distDirRoot":".next","_originalRewrites":{"beforeFiles":[],"afterFiles":[{"source":"/uploads/:path*","destination":"/api/uploads/:path*"}],"fallback":[]}}
|
|
19
19
|
|
|
20
20
|
process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
|
|
21
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,721606,e=>{"use strict";var t=e.i(199910),s=e.i(178328),a=e.i(732684);function n(){return"u">typeof window}function r(){return"production"}function i(){return"development"===((n()?window.vam:r())||"production")}function l(e){return RegExp(`/${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?=[/?#]|$)`)}function o(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function d(e){return(0,s.useEffect)(()=>{var t;e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),(0,s.useEffect)(()=>{!function(e={debug:!0},t){var s;if(!n())return;let{beforeSend:a,src:l,dataset:d}=function(e,t){var s,a;let n=e;if(t)try{n={...null==(s=JSON.parse(t))?void 0:s.analytics,...e}}catch{}!function(e="auto"){if("auto"===e){window.vam=r();return}window.vam=e}(n.mode);let l={sdkn:"@vercel/analytics"+(n.framework?`/${n.framework}`:""),sdkv:"2.0.1"};return n.disableAutoTrack&&(l.disableAutoTrack="1"),n.viewEndpoint&&(l.viewEndpoint=o(n.viewEndpoint)),n.eventEndpoint&&(l.eventEndpoint=o(n.eventEndpoint)),n.sessionEndpoint&&(l.sessionEndpoint=o(n.sessionEndpoint)),i()&&!1===n.debug&&(l.debug="false"),n.dsn&&(l.dsn=n.dsn),n.endpoint?l.endpoint=n.endpoint:n.basePath&&(l.endpoint=o(`${n.basePath}/insights`)),{beforeSend:n.beforeSend,src:(a=n).scriptSrc?o(a.scriptSrc):i()?"https://va.vercel-scripts.com/v1/script.debug.js":a.basePath?o(`${a.basePath}/insights/script.js`):"/_vercel/insights/script.js",dataset:l}}(e,t);if(window.va||(window.va=function(...e){window.vaq||(window.vaq=[]),window.vaq.push(e)}),a&&(null==(s=window.va)||s.call(window,"beforeSend",a)),document.head.querySelector(`script[src*="${l}"]`))return;let c=document.createElement("script");for(let[e,t]of(c.src=l,Object.entries(d)))c.dataset[e]=t;c.defer=!0,c.onerror=()=>{let e=i()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${l}. ${e}`)},document.head.appendChild(c)}({framework:e.framework||"react",basePath:e.basePath??function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...void 0!==e.route&&{disableAutoTrack:!0},...e},e.configString??function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}())},[]),(0,s.useEffect)(()=>{e.route&&e.path&&function({route:e,path:t}){var s;null==(s=window.va)||s.call(window,"pageview",{route:e,path:t})}({route:e.route,path:e.path})},[e.route,e.path]),null}function c(e){let n,r,i,{route:o,path:c}=(n=(0,a.useParams)(),r=(0,a.useSearchParams)(),i=(0,a.usePathname)(),n?{route:function(e,t){if(!e||!t)return e;let s=e;try{let e=Object.entries(t);for(let[t,a]of e)if(!Array.isArray(a)){let e=l(a);e.test(s)&&(s=s.replace(e,`/[${t}]`))}for(let[t,a]of e)if(Array.isArray(a)){let e=l(a.join("/"));e.test(s)&&(s=s.replace(e,`/[...${t}]`))}return s}catch{return e}}(i,Object.keys(n).length?n:Object.fromEntries(r.entries())),path:i}:{route:null,path:i});return s.default.createElement(d,{path:c,route:o,...e,basePath:function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.NEXT_PUBLIC_VERCEL_OBSERVABILITY_BASEPATH}(),configString:function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.NEXT_PUBLIC_VERCEL_OBSERVABILITY_CLIENT_CONFIG}(),framework:"next"})}e.s(["Analytics",0,function(e){return s.default.createElement(s.Suspense,{fallback:null},s.default.createElement(c,{...e}))}])},7012,e=>{"use strict";var t=e.i(523829),s=e.i(178328),a=(e,t,s,a,n,r,i,l)=>{let o=document.documentElement,d=["light","dark"];function c(t){var s;(Array.isArray(e)?e:[e]).forEach(e=>{let s="class"===e,a=s&&r?n.map(e=>r[e]||e):n;s?(o.classList.remove(...a),o.classList.add(r&&r[t]?r[t]:t)):o.setAttribute(e,t)}),s=t,l&&d.includes(s)&&(o.style.colorScheme=s)}if(a)c(a);else try{let e=localStorage.getItem(t)||s,a=i&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(a)}catch(e){}},n=s.createContext(void 0),r={setTheme:e=>{},themes:[]};s.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:l,value:o,themes:d,nonce:c,scriptProps:u})=>{let m=JSON.stringify([n,t,l,e,d,o,r,i]).slice(1,-1);return s.createElement("script",{...u,suppressHydrationWarning:!0,nonce:"u"<typeof window?c:"",dangerouslySetInnerHTML:{__html:`(${a.toString()})(${m})`}})});var i=e.i(746632),l=e.i(795360),l=l,o=e.i(951482),o=o,d=e.i(195300),d=d,c=e.i(909042),c=c,u=e.i(964548),u=u;e.s(["Toaster",0,({...e})=>{var a;let{theme:m="system"}=null!=(a=s.useContext(n))?a:r;return(0,t.jsx)(i.Toaster,{closeButton:!0,theme:m,className:"toaster group z-9999999! ",icons:{success:(0,t.jsx)(l.default,{className:"size-5 text-white",fill:"#10b981"}),info:(0,t.jsx)(o.default,{className:"size-5 text-white",fill:"#3b82f6"}),warning:(0,t.jsx)(d.default,{className:"size-5 text-white",fill:"#f59e0b"}),error:(0,t.jsx)(c.default,{className:"size-5 text-white",fill:"#ef4444"}),loading:(0,t.jsx)(u.default,{className:"size-5 animate-spin text-muted-foreground"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)",zIndex:999999},toastOptions:{classNames:{toast:"group toast items-start group-[.toaster]:!bg-[#F9F9F7] dark:group-[.toaster]:!bg-zinc-900 group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:",icon:"mt-0.5",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",success:"group-[.toaster]:!bg-[#F9F9F7] dark:group-[.toaster]:!bg-zinc-900",error:"group-[.toaster]:!bg-[#F9F9F7] dark:group-[.toaster]:!bg-zinc-900",warning:"group-[.toaster]:!bg-[#F9F9F7] dark:group-[.toaster]:!bg-zinc-900",info:"group-[.toaster]:!bg-[#F9F9F7] dark:group-[.toaster]:!bg-zinc-900"}},...e})}],7012)},266186,e=>{"use strict";var t=e.i(523829),s=e.i(82100),a=e.i(178328),n=e.i(334347),r=e.i(732684),i=e.i(301470),l=e.i(518864),o=e.i(487779),d=e.i(874822);let c=(0,d.default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);var u=e.i(708909),m=e.i(37126),x=e.i(152236),h=e.i(839717),p=e.i(133058);let f=(0,d.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var g=e.i(980369),b=e.i(379702),j=e.i(885131),v=e.i(440087),y=e.i(624529),N=e.i(874560),w=e.i(746632),k=e.i(501706),C=e.i(466691),A=e.i(282879);function F({target:e,open:s,onOpenChange:n}){let{deleteServer:r}=(0,y.useWorkspace)(),[i,l]=(0,a.useState)(!1);async function o(){if(e){l(!0);try{await r(e.id),w.toast.success(`Deleted "${e.name}".`),n(!1)}catch{w.toast.error("Could not delete the server.")}finally{l(!1)}}}return(0,t.jsx)(A.Dialog,{open:s,onOpenChange:n,children:(0,t.jsxs)(A.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsxs)(A.DialogHeader,{children:[(0,t.jsxs)(A.DialogTitle,{children:["Delete “",e?.name,"”?"]}),(0,t.jsx)(A.DialogDescription,{children:"This permanently removes the server's documents, index, vector data, and generated files. This cannot be undone."})]}),(0,t.jsxs)(A.DialogFooter,{children:[(0,t.jsx)(C.Button,{variant:"outline",onClick:()=>n(!1),disabled:i,children:"Cancel"}),(0,t.jsxs)(C.Button,{variant:"destructive",onClick:()=>void o(),disabled:i,children:[i&&(0,t.jsx)(k.Loader2,{className:"size-4 animate-spin"}),"Delete server"]})]})]})})}function S(){let{servers:e,activeServer:s,activateServer:n}=(0,y.useWorkspace)(),[r,i]=(0,a.useState)(!1),[l,o]=(0,a.useState)(null),[d,c]=(0,a.useState)(null);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(v.DropdownMenu,{children:[(0,t.jsxs)(v.DropdownMenuTrigger,{render:(0,t.jsx)("button",{type:"button",className:"flex w-full items-center gap-2 rounded-lg border border-border bg-card px-2 py-1.5 text-left transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),children:[(0,t.jsx)("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-md bg-primary/12 text-primary",children:(0,t.jsx)(m.Server,{className:"size-3.5"})}),(0,t.jsx)("span",{className:"flex min-w-0 flex-1 flex-col",children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:s?.name??"No server"}),s?.running&&(0,t.jsx)(z,{})]})}),(0,t.jsx)(f,{className:"size-4 shrink-0 text-muted-foreground"})]}),(0,t.jsxs)(v.DropdownMenuContent,{align:"start",sideOffset:6,className:"w-(--anchor-width) min-w-[260px]",children:[(0,t.jsxs)(v.DropdownMenuGroup,{children:[(0,t.jsx)(v.DropdownMenuLabel,{children:"Your servers"}),e.map(e=>{let a=e.id===s?.id;return(0,t.jsxs)(v.DropdownMenuItem,{onClick:()=>{a||n(e.id)},className:"gap-2",children:[(0,t.jsx)("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:(0,t.jsx)(m.Server,{className:"size-3.5"})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:e.name}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-[11px] text-muted-foreground tabular-nums",children:[(0,t.jsxs)("span",{children:[e.docCount," docs"]}),e.indexed&&(0,t.jsx)("span",{children:"· indexed"}),e.running&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-500",children:[(0,t.jsx)(z,{}),"live"]})]})]}),a&&(0,t.jsx)(p.Check,{className:"size-4 shrink-0 text-primary"})]},e.id)})]}),(0,t.jsx)(v.DropdownMenuSeparator,{}),(0,t.jsxs)(v.DropdownMenuItem,{onClick:()=>i(!0),className:"gap-2 h-9",children:[(0,t.jsx)(b.Plus,{className:"size-4"}),"New server"]}),s&&(0,t.jsxs)(v.DropdownMenuItem,{onClick:()=>o(s),className:"gap-2 h-9",children:[(0,t.jsx)(g.Pencil,{className:"size-4"}),"Rename current"]}),s&&e.length>1&&(0,t.jsxs)(v.DropdownMenuItem,{variant:"destructive",onClick:()=>c(s),className:"gap-2",children:[(0,t.jsx)(j.Trash2,{className:"size-4"}),"Delete current"]})]})]}),(0,t.jsx)(N.ServerFormDialog,{mode:"create",open:r,onOpenChange:i}),(0,t.jsx)(N.ServerFormDialog,{mode:"rename",target:l,open:null!==l,onOpenChange:e=>!e&&o(null)}),(0,t.jsx)(F,{target:d,open:null!==d,onOpenChange:e=>!e&&c(null)})]})}function z(){return(0,t.jsxs)("span",{className:"relative flex size-2",children:[(0,t.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-green-500 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex size-2 rounded-full bg-green-500"})]})}let E={"panel-default":void 0,"panel-white":"#FFFFFF","panel-fafafa":"#FAFAFA","panel-warm":"#F7F1EA","panel-soft":"#FBFAF8","panel-silver":"#F8F8F8","panel-stone":"#F5F5F2"},D=[{id:"chat",label:"Chat",href:"/chat",icon:i.MessageCircle},{id:"data",label:"Data",href:"/data",icon:l.Database},{id:"analytics",label:"Analytics",href:"/analytics",icon:c},{id:"settings",label:"Settings",href:"/settings",icon:o.Settings}];function T(){let e=(0,r.usePathname)(),{pageStyle:i,navBg:l}=(0,s.useThemeCustomizer)(),{activeServer:o}=(0,y.useWorkspace)(),[d,c]=(0,a.useState)(!0);(0,a.useEffect)(()=>{"false"===localStorage.getItem("sidebar-collapsed")&&c(!1)},[]);let p=()=>{let e=!d;c(e),localStorage.setItem("sidebar-collapsed",String(e))},f=l?E[l]:void 0;return(0,t.jsx)(h.TooltipProvider,{delay:150,children:(0,t.jsxs)("aside",{className:(0,x.cn)("sticky top-0 hidden h-screen shrink-0 flex-col self-start py-4 md:flex transition-all duration-300 ease-in-out",d?"w-18":"w-60",f?"":"bg-background","fused"===i?"border-r border-border":""),style:f?{backgroundColor:f}:void 0,children:[(0,t.jsx)("div",{className:(0,x.cn)("flex w-full items-center mb-6",d?"justify-center px-3":"justify-between px-4"),children:d?(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:p,"aria-label":"Expand sidebar",className:"flex size-10 items-center justify-center rounded-xl bg-primary text-primary-foreground transition-transform hover:scale-105"}),children:(0,t.jsx)("img",{src:"/logo9.png",className:"size-5",alt:"logo"})}),(0,t.jsx)(h.TooltipContent,{side:"right",sideOffset:10,children:"Expand sidebar"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.default,{href:"/chat",className:"flex items-center gap-2.5",children:[(0,t.jsx)("span",{className:"flex size-9 items-center justify-center rounded-xl bg-primary text-primary-foreground transition-transform hover:scale-105",children:(0,t.jsx)("img",{src:"/logo9.png",className:"size-5",alt:"logo"})}),(0,t.jsx)("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Larkup"})]}),(0,t.jsx)("button",{onClick:p,className:"flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors","aria-label":"Collapse sidebar",children:(0,t.jsx)(u.ChevronLeft,{className:"size-3.5"})})]})}),(0,t.jsx)("nav",{className:(0,x.cn)("flex flex-1 flex-col w-full",d?"items-center px-3 gap-3":"px-3 gap-1.5"),children:D.map(s=>{let a=s.icon,r=e===s.href||"/"!==s.href&&e?.startsWith(s.href);return d?(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{render:(0,t.jsx)(n.default,{href:s.href,"aria-current":r?"page":void 0,onClick:t=>{"chat"===s.id&&"/chat"===e&&(t.preventDefault(),window.dispatchEvent(new CustomEvent("new-chat")))},className:(0,x.cn)("group relative flex size-10 items-center justify-center rounded-xl transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring",r?"bg-[#F0F0F0] text-foreground":"text-muted-foreground hover:bg-[#EBEBEB] hover:text-foreground")}),children:(0,t.jsx)(a,{className:"size-4.5",strokeWidth:r?2.25:1.75})}),(0,t.jsx)(h.TooltipContent,{side:"right",sideOffset:10,children:s.label})]},s.id):(0,t.jsxs)(n.default,{href:s.href,"aria-current":r?"page":void 0,onClick:t=>{"chat"===s.id&&"/chat"===e&&(t.preventDefault(),window.dispatchEvent(new CustomEvent("new-chat")))},className:(0,x.cn)("group relative flex items-center gap-3 rounded-xl px-3 py-2.5 text-[13px] font-medium transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring",r?"bg-[#F0F0F0] text-foreground":"text-muted-foreground hover:bg-[#EBEBEB] hover:text-foreground"),children:[(0,t.jsx)(a,{className:"size-4.5 shrink-0",strokeWidth:r?2.25:1.75}),(0,t.jsx)("span",{className:"truncate",children:s.label})]},s.id)})}),(0,t.jsx)("div",{className:(0,x.cn)("w-full pt-3",d?"px-2":"px-3"),children:d?(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:p,className:"flex w-full items-center justify-center py-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors"}),children:(0,t.jsxs)("div",{className:"relative size-8 rounded-lg border border-border bg-card flex items-center justify-center text-muted-foreground transition-colors group-hover:text-foreground",children:[(0,t.jsx)(m.Server,{className:"size-4"}),(0,t.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 flex size-2.5",children:o?.running?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-green-500 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex size-full rounded-full bg-green-500 border border-card"})]}):(0,t.jsx)("span",{className:"relative inline-flex size-full rounded-full bg-gray-500 border border-card"})})]})}),(0,t.jsxs)(h.TooltipContent,{side:"right",sideOffset:10,children:[o?.name??"No server"," (",o?.running?"Live":"Offline",")"]})]}):(0,t.jsx)(S,{})})]})})}let I={"panel-default":void 0,"panel-white":"#FFFFFF","panel-fafafa":"#FAFAFA","panel-warm":"#F7F1EA","panel-soft":"#FBFAF8","panel-silver":"#F8F8F8","panel-stone":"#F5F5F2"},M=[{id:"chat",label:"Chat",href:"/chat",icon:i.MessageCircle},{id:"data",label:"Data",href:"/data",icon:l.Database},{id:"analytics",label:"Analytics",href:"/analytics",icon:c},{id:"settings",label:"Settings",href:"/settings",icon:o.Settings}];function P(){let e=(0,r.usePathname)(),{username:a}=(0,y.useWorkspace)(),{navBg:i}=(0,s.useThemeCustomizer)(),l=i?I[i]:void 0;return(0,t.jsx)(h.TooltipProvider,{delay:150,children:(0,t.jsxs)("header",{className:(0,x.cn)("sticky top-0 z-50 flex h-14 shrink-0 items-center gap-6 border-b border-border px-4 md:px-6",l?"":"bg-[#F5F5F4]"),style:l?{backgroundColor:l}:void 0,children:[(0,t.jsxs)(n.default,{href:"/chat","aria-label":"larkup home",className:"flex items-center gap-2.5 shrink-0",children:[(0,t.jsx)("span",{className:"flex size-9 items-center justify-center rounded-xl bg-primary text-primary-foreground transition-transform hover:scale-105",children:(0,t.jsx)("img",{src:"/logo9.png",className:"size-5",alt:"logo"})}),(0,t.jsx)("span",{className:"font-semibold tracking-tight text-foreground hidden sm:inline-block",children:"Larkup"})]}),(0,t.jsx)("nav",{className:"flex h-full items-center gap-1",children:M.map(s=>{let a=s.icon,r=e===s.href||"/"!==s.href&&e?.startsWith(s.href);return(0,t.jsxs)(n.default,{href:s.href,"aria-current":r?"page":void 0,className:(0,x.cn)("group relative flex items-center gap-2 h-full px-3 text-[13px] font-medium transition-colors outline-none",r?"text-primary":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(a,{className:"size-[16px]",strokeWidth:r?2.25:1.75}),(0,t.jsx)("span",{className:"hidden md:inline",children:s.label}),(0,t.jsx)("span",{className:(0,x.cn)("absolute bottom-0 left-2 right-2 h-[2px] rounded-full bg-primary transition-opacity",r?"opacity-100":"opacity-0")})]},s.id)})}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(S,{}),a&&(0,t.jsxs)("span",{className:"hidden text-sm text-muted-foreground md:block",children:["Hi, ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:a})]})]})]})})}let _=(0,d.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);var B=e.i(570764),O=e.i(18928),O=O,L=e.i(562949),R=e.i(741445),V=e.i(924911),$=e.i(300033),W=e.i(856474),K=e.i(266741);let U=["vercel_ai_gateway","openai","google","mistral","custom"];function H(){let{setUsername:e,createServer:s,refresh:n}=(0,y.useWorkspace)(),i=(0,r.useRouter)(),[l,o]=(0,a.useState)(""),[d,c]=(0,a.useState)("vercel_ai_gateway"),[u,m]=(0,a.useState)(""),[x,h]=(0,a.useState)(null),[p,f]=(0,a.useState)("vercel_ai_gateway"),[b,j]=(0,a.useState)(""),[v,N]=(0,a.useState)(null),[F,S]=(0,a.useState)(!1),[z,E]=(0,a.useState)(!1),[D,T]=(0,a.useState)(!1),[I,M]=(0,a.useState)(!1),[P,H]=(0,a.useState)(null),q="custom"===d,Y="custom"===p,J=z||q||d!==p?b:u,G=async()=>{S(!0);try{let t=await fetch("/api/config"),{config:a}=await t.json(),r={...a};q&&x?(r.embeddingProvider="custom",r.embeddingModelId=`custom:${x.modelName}`,r.embeddingApiKey=x.apiKey||void 0,r.customEmbeddings=[x]):(r.embeddingProvider=d,r.embeddingApiKey=u),z?Y&&v?(r.chatProvider="custom",r.chatModelId=`custom:${v.modelName}`,r.chatApiKey=v.apiKey||void 0,r.customChatModels=[v]):(r.chatProvider=p,r.chatApiKey=J):q&&x||(r.chatProvider=d,r.chatApiKey=u);let o=await fetch("/api/config/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({embeddingProvider:r.embeddingProvider,embeddingApiKey:r.embeddingApiKey,embeddingModelId:r.embeddingModelId,customEmbeddings:r.customEmbeddings,chatProvider:r.chatProvider,chatApiKey:r.chatApiKey,chatModelId:r.chatModelId,customChatModels:r.customChatModels})});if(!o.ok){let e=await o.json();w.toast.error(e.error||"Verification failed — please check your API key.",{duration:8e3}),S(!1);return}l.trim()&&await e(l.trim()),await s("my-larkup"),await fetch("/api/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),n(),i.push("/chat")}catch(e){w.toast.error("Failed to complete setup")}finally{S(!1)}},X=async()=>{S(!0);try{l.trim()&&await e(l.trim()),await s("my-larkup"),n(),i.push("/chat")}catch(e){w.toast.error("Failed to complete setup")}finally{S(!1)}},Z=(e,s)=>(0,t.jsxs)($.Select,{value:e,onValueChange:e=>{var t;"custom"===(t=e??"")?("embedding"===s?c("custom"):f("custom"),H(s)):"embedding"===s?(c(t),h(null),!z&&f(t)):(f(t),N(null))},children:[(0,t.jsx)($.SelectTrigger,{className:"w-full bg-white/90 hover:bg-white",children:(0,t.jsx)("span",{className:"flex items-center gap-2",children:W.PROVIDER_META[e]?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.ProviderIcon,{src:W.PROVIDER_META[e].iconSrc,alt:W.PROVIDER_META[e].label,pillBg:W.PROVIDER_META[e].pillBg,size:16}),W.PROVIDER_META[e].label]}):"Select provider"})}),(0,t.jsx)($.SelectContent,{children:U.map(e=>{let s=W.PROVIDER_META[e];return s?(0,t.jsx)($.SelectItem,{value:e,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(W.ProviderIcon,{src:s.iconSrc,alt:s.label,pillBg:s.pillBg,size:16}),(0,t.jsxs)("span",{children:[s.label,"vercel_ai_gateway"===e&&" (Recommended)","custom"===e&&" (OpenAI-compatible)"]})]})},e):null})})]}),Q=(e,s)=>(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50/50 px-3 py-2",children:[(0,t.jsx)("span",{className:"text-green-600 text-xs",children:"✓"}),(0,t.jsx)("span",{className:"flex-1 truncate text-xs font-medium text-foreground",children:e.modelName}),(0,t.jsx)("button",{type:"button",onClick:()=>H(s),className:"text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(g.Pencil,{className:"size-3"})})]});return(0,t.jsxs)("div",{className:"fixed inset-0 z-50 overflow-y-auto bg-background",children:[(0,t.jsxs)("div",{className:"pointer-events-none fixed inset-0 overflow-hidden",children:[(0,t.jsx)("div",{className:"absolute -left-20 -top-20 h-125 w-125 rounded-full bg-stone-200/40 blur-3xl animate-pulse"}),(0,t.jsx)("div",{className:"absolute -bottom-32 -right-32 h-150 w-150 rounded-full bg-amber-100/30 blur-3xl animate-pulse [animation-delay:1s]"})]}),(0,t.jsx)("div",{className:"relative z-10 flex min-h-full w-full flex-col items-center justify-center px-6 py-12",children:(0,t.jsxs)("div",{className:"flex w-full max-w-lg flex-col items-center gap-8 animate-fade-up",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 text-center",children:[(0,t.jsx)("div",{className:"flex size-14 items-center justify-center rounded-xl bg-primary text-primary-foreground ",children:(0,t.jsx)("img",{src:"/logo9.png",className:"size-8",alt:"Larkup"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight text-foreground",children:"Welcome to Larkup"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Let's set up your AI models. You can change these later in Settings."})]})]}),(0,t.jsxs)("div",{className:"w-full space-y-5 rounded-2xl p-6 backdrop-blur-xl",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-foreground",children:"Your Name (Optional)"}),(0,t.jsx)(V.Input,{value:l,onChange:e=>o(e.target.value),placeholder:"How should we call you?",className:"bg-background/50"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-foreground",children:"Embedding Provider"}),Z(d,"embedding"),q&&x&&Q(x,"embedding"),q&&!x&&(0,t.jsx)("p",{className:"text-[11px] text-amber-600 mt-1",children:"Please configure and test your custom model to continue."})]}),!q&&(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("label",{className:"text-xs font-medium text-foreground",children:["API Key",!z&&(0,t.jsxs)("span",{className:"text-muted-foreground font-normal",children:[" ","(used for both embedding & chat)"]})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(V.Input,{type:D?"text":"password",value:u,onChange:e=>m(e.target.value),placeholder:"sk-...",className:"bg-background/50 pr-10"}),(0,t.jsx)("button",{type:"button","aria-label":D?"Hide API key":"Show API key",onClick:()=>T(e=>!e),className:"absolute inset-y-0 right-0 flex items-center px-3 text-muted-foreground hover:text-foreground",children:D?(0,t.jsx)(R.EyeOff,{className:"size-4"}):(0,t.jsx)(L.Eye,{className:"size-4"})})]})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>E(!z),className:"flex w-full items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[z?(0,t.jsx)(O.default,{className:"size-3.5"}):(0,t.jsx)(B.ChevronDown,{className:"size-3.5"}),"Use a different chat model"]}),z&&(0,t.jsxs)("div",{className:"space-y-3 rounded-xl border border-border/40 bg-muted/20 p-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-foreground",children:"Chat Provider"}),Z(p,"chat"),Y&&v&&Q(v,"chat"),Y&&!v&&(0,t.jsx)("p",{className:"text-[11px] text-amber-600 mt-1",children:"Please configure and test your custom model to continue."})]}),!Y&&(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-foreground",children:"Chat API Key"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(V.Input,{type:I?"text":"password",value:b,onChange:e=>j(e.target.value),placeholder:"sk-...",className:"bg-background/50 pr-10"}),(0,t.jsx)("button",{type:"button","aria-label":I?"Hide chat API key":"Show chat API key",onClick:()=>M(e=>!e),className:"absolute inset-y-0 right-0 flex items-center px-3 text-muted-foreground hover:text-foreground",children:I?(0,t.jsx)(R.EyeOff,{className:"size-4"}):(0,t.jsx)(L.Eye,{className:"size-4"})})]})]})]}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"More providers and fine-grained model selection available in Settings → AI Models."}),(0,t.jsxs)("div",{className:"pt-2 flex gap-3",children:[(0,t.jsx)(C.Button,{variant:"outline",className:"flex-1",onClick:X,disabled:F,children:"Skip for now"}),(0,t.jsx)(C.Button,{className:"flex-1",onClick:G,disabled:F||!(()=>{if(q){if(!x)return!1}else if(!u)return!1;if(z){if(Y){if(!v)return!1}else if(!J)return!1}return!0})(),children:F?(0,t.jsx)(k.Loader2,{className:"size-4 animate-spin"}):(0,t.jsxs)(t.Fragment,{children:["Continue ",(0,t.jsx)(_,{className:"ml-1.5 size-4"})]})})]})]})]})}),(0,t.jsx)(A.Dialog,{open:null!==P,onOpenChange:e=>{e||("embedding"!==P||x||c("vercel_ai_gateway"),"chat"!==P||v||f("vercel_ai_gateway"),H(null))},children:(0,t.jsxs)(A.DialogContent,{className:"max-w-xl",children:[(0,t.jsxs)(A.DialogHeader,{children:[(0,t.jsxs)(A.DialogTitle,{children:["Custom ","embedding"===P?"Embedding":"Chat"," Model"]}),(0,t.jsxs)(A.DialogDescription,{children:["Connect an OpenAI-compatible ","embedding"===P?"embedding":"chat"," ","model. Test the connection before adding."]})]}),P&&(0,t.jsx)(K.CustomModelForm,{type:P,onSave:e=>{"embedding"===P?(h(e),c("custom")):"chat"===P&&(N(e),f("custom")),H(null)},onCancel:()=>{"embedding"!==P||x||c("vercel_ai_gateway"),"chat"!==P||v||f("vercel_ai_gateway"),H(null)}})]})})]})}let q={"panel-default":"#FAFAFA","panel-white":"#FFFFFF","panel-fafafa":"#FAFAFA","panel-warm":"#F7F1EA","panel-soft":"#FBFAF8","panel-silver":"#F8F8F8","panel-stone":"#F5F5F2"};e.s(["ClientLayoutWrapper",0,function({children:e}){let{pageStyle:a,panelBg:n,layout:i}=(0,s.useThemeCustomizer)(),l=(0,r.usePathname)(),o=l?.includes("/chat"),{isFirstRun:d,isLoading:c}=(0,y.useWorkspace)(),u=q[n],m=u?{backgroundColor:u}:void 0;return!c&&d?(0,t.jsx)(H,{}):c?(0,t.jsx)("div",{className:"flex h-screen items-center justify-center",children:(0,t.jsx)("div",{className:"size-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):"topnav"===i?(0,t.jsxs)("div",{className:"flex flex-col h-screen overflow-hidden",children:[(0,t.jsx)(P,{}),(0,t.jsx)("main",{className:"min-w-0 flex-1 overflow-hidden",children:(0,t.jsx)("div",{className:"h-full flex flex-col bg-background text-foreground",style:m,children:(0,t.jsx)("div",{className:(0,x.cn)("flex-1 min-h-0",o||l?.includes("/settings")||l?.includes("/analytics")?"overflow-hidden flex flex-col":"overflow-auto"),children:(0,t.jsx)("div",{className:(0,x.cn)("h-full w-full",o||l?.includes("/settings")||l?.includes("/analytics")?"flex-1 min-h-0 flex flex-col":"container mx-auto pb-8"),children:e})})})})]}):(0,t.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[(0,t.jsx)(T,{}),(0,t.jsx)("main",{className:"min-w-0 flex-1 overflow-hidden",children:(0,t.jsx)("div",{className:"fused"===a?"h-screen flex flex-col bg-background text-foreground overflow-hidden":"h-screen flex flex-col md:rounded-l-2xl border-l border-border bg-panel text-panel-foreground overflow-hidden",style:m,children:(0,t.jsx)("div",{className:(0,x.cn)("flex-1 min-h-0",o||l?.includes("/settings")||l?.includes("/analytics")?"overflow-hidden flex flex-col":"overflow-auto"),children:(0,t.jsx)("div",{className:(0,x.cn)("h-full w-full",o||l?.includes("/settings")||l?.includes("/analytics")?"flex-1 min-h-0 flex flex-col":"container mx-auto pb-8"),children:e})})})})]})}],266186)},953159,e=>{"use strict";var t=e.i(523829),s=e.i(842646),a=e.i(501706),n=e.i(178328),r=e.i(866657),i=e.i(874822);let l=(0,i.default)("boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);var o=e.i(871942);let d=(0,i.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var c=e.i(518864),u=e.i(702938);let m=(0,i.default)("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);var x=e.i(743118),h=e.i(714809),p=e.i(241491),f=e.i(539352);let g=(0,i.default)("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);var b=e.i(682458),j=e.i(161351),v=e.i(466691),y=e.i(861947),N=e.i(323621),w=e.i(524365),k=e.i(534792),C=e.i(746632),A=e.i(878835),F=e.i(282879);let S=e=>fetch(e).then(e=>e.json()),z=["chunking","embedding","upserting"];function E({open:e,onOpenChange:i,trigger:l}){let[o,d]=(0,n.useState)(!1),[c,u]=(0,n.useState)(!1),m=void 0!==e,g=m?e:c,b=m&&i?i:u,{data:j,isLoading:y,mutate:N}=(0,s.default)("/api/index",S,{refreshInterval:e=>e?.run&&z.includes(e.run.status)?1e3:0}),T=(0,n.useRef)(void 0);(0,n.useEffect)(()=>{let e=j?.run?.warning;e&&e!==T.current?C.toast.warning(e,{id:"rate-limit-warning",duration:7e4}):!e&&T.current&&(C.toast.dismiss("rate-limit-warning"),C.toast.success("Rate limit resolved — resuming indexing.",{duration:3e3})),T.current=e},[j?.run?.warning]);let[M,P]=(0,n.useState)(!1);async function _(e=!1){d(!0);try{let t=await fetch("/api/index",{method:"POST",body:JSON.stringify({incremental:e}),headers:{"Content-Type":"application/json"}}),s=await t.json();if(!t.ok)return void C.toast.error(s.error??"Could not start indexing.");C.toast.success("Indexing started."),N()}catch{C.toast.error("Could not start indexing.")}finally{d(!1)}}async function B(){d(!0);try{if(!(await fetch("/api/index",{method:"DELETE"})).ok)return void C.toast.error("Could not cancel indexing.");C.toast.success("Indexing cancelled."),N()}catch{C.toast.error("Could not cancel indexing.")}finally{d(!1)}}return(0,n.useEffect)(()=>{let e=j?.run?.status;e&&z.includes(e)?P(!0):M&&"completed"===e&&(P(!1),b(!1),C.toast.success("Indexing completed successfully!"))},[j?.run?.status,M,b]),(0,t.jsxs)(F.Dialog,{open:g,onOpenChange:b,children:[l?(0,t.jsx)(F.DialogTrigger,{render:(0,n.isValidElement)(l)?l:(0,t.jsx)("button",{children:l})}):(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[j?.run?.status==="completed"&&(0,t.jsxs)(A.AlertDialog,{children:[(0,t.jsx)(A.AlertDialogTrigger,{render:(0,t.jsxs)(v.Button,{disabled:!j.ready||!!(j.run&&z.includes(j.run.status))||o,variant:"outline",children:[(0,t.jsx)(f.RotateCcw,{className:"size-4 mr-2"}),"Re-Index Data"]})}),(0,t.jsxs)(A.AlertDialogContent,{children:[(0,t.jsxs)(A.AlertDialogHeader,{children:[(0,t.jsx)(A.AlertDialogTitle,{children:"Are you sure you want to re-index data?"}),(0,t.jsx)(A.AlertDialogDescription,{children:"This will rebuild the entire index from scratch. All documents will be re-processed."})]}),(0,t.jsxs)(A.AlertDialogFooter,{children:[(0,t.jsx)(A.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(A.AlertDialogAction,{onClick:()=>{b(!0),_(!1)},children:"Continue"})]})]})]}),(0,t.jsx)(F.DialogTrigger,{render:(0,t.jsxs)(v.Button,{disabled:!j?.ready||j?.unindexedCount===0,children:[(0,t.jsx)(h.Layers,{className:"size-4 mr-2"}),"Index Data"]})})]}),(0,t.jsxs)(F.DialogContent,{className:"max-w-2xl max-h-[90vh] overflow-y-auto ",children:[(0,t.jsxs)(F.DialogHeader,{children:[(0,t.jsx)(F.DialogTitle,{children:"Index Data"}),(0,t.jsx)(F.DialogDescription,{children:"Chunk, embed, and index into your selected vector database."})]}),y||!j?(0,t.jsx)("div",{className:"py-6",children:(0,t.jsx)(k.Skeleton,{className:"h-40 w-full"})}):(0,t.jsxs)("div",{className:"space-y-6 py-4",children:[(0,t.jsx)(D,{config:j.config,docCount:j.docCount,charCount:j.charCount}),!j.ready&&(0,t.jsxs)(w.Alert,{variant:"default",children:[(0,t.jsx)(r.AlertTriangle,{className:"size-4 text-orange-500!"}),(0,t.jsx)(w.AlertTitle,{className:"text-orange-500!",children:"Not ready to index"}),(0,t.jsx)(w.AlertDescription,{children:(0,t.jsx)("ul",{className:"list-disc pl-4",children:j.blockers.map(e=>(0,t.jsx)("li",{children:e},e))})})]}),(0,t.jsx)(I,{run:j.run,running:!!(j.run&&z.includes(j.run.status))}),j.ready&&!j.run&&(0,t.jsxs)(w.Alert,{children:[(0,t.jsx)(x.Info,{className:"size-4 text-blue-500!"}),(0,t.jsx)(w.AlertTitle,{className:"text-blue-600 dark:text-blue-400",children:"Before you start indexing"}),(0,t.jsxs)(w.AlertDescription,{className:"text-muted-foreground space-y-1",children:[(0,t.jsxs)("p",{children:["Once indexing begins, two settings become"," ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:"locked"})," to the existing index:"]}),(0,t.jsxs)("ul",{className:"list-disc pl-4 space-y-0.5",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Embedding model"})," — you can swap to any model with the"," ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:"same vector dimensions"}),", but switching to a model with different dimensions will require a full re-index."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Vector store"})," — changing the store after indexing requires starting fresh."]})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)(v.Button,{onClick:()=>_(j.run?.status==="completed"),disabled:!j.ready||!!(j.run&&z.includes(j.run.status))||o||j.run?.status==="completed"&&0===j.unindexedCount,size:"lg",children:[j.run&&z.includes(j.run.status)||o?(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin mr-2"}):(0,t.jsx)(p.Play,{className:"size-4 mr-2"}),j.run&&z.includes(j.run.status)?"Indexing…":o?"Starting…":j.run?.status==="completed"?`Index new documents (${j.unindexedCount})`:`Start indexing (${j.unindexedCount})`]}),j.run?.status==="completed"&&!(j.run&&z.includes(j.run.status))&&(0,t.jsxs)(A.AlertDialog,{children:[(0,t.jsx)(A.AlertDialogTrigger,{render:(0,t.jsxs)(v.Button,{variant:"outline",size:"lg",disabled:o,children:[(0,t.jsx)(f.RotateCcw,{className:"size-4 mr-2"}),"Re-Index All"]})}),(0,t.jsxs)(A.AlertDialogContent,{children:[(0,t.jsxs)(A.AlertDialogHeader,{children:[(0,t.jsx)(A.AlertDialogTitle,{children:"Are you sure you want to re-index data?"}),(0,t.jsx)(A.AlertDialogDescription,{children:"This will rebuild the entire index from scratch. All documents will be re-processed."})]}),(0,t.jsxs)(A.AlertDialogFooter,{children:[(0,t.jsx)(A.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(A.AlertDialogAction,{onClick:()=>{b(!0),_(!1)},children:"Continue"})]})]})]}),!!(j.run&&z.includes(j.run.status))&&(0,t.jsx)(v.Button,{onClick:B,disabled:o,size:"lg",variant:"destructive",children:"Cancel"})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"lg",onClick:()=>b(!1),children:"Close"})]})]})]})]})}function D({config:e,docCount:s,charCount:a}){let n=(0,b.getEmbeddingModel)(e.embeddingModelId),r=(0,j.getVectorStore)(e.vectorStore),i=[{icon:d,label:"Embedding model",value:n?.label??e.embeddingModelId,hint:n?`${n.dimensions} dims`:void 0},{icon:c.Database,label:"Vector store",value:r?.label??e.vectorStore},{icon:l,label:"Index type",value:e.indexType.toUpperCase()},{icon:g,label:"Chunking",value:`${e.chunking.chunkSize} / ${e.chunking.chunkOverlap}`,hint:"size / overlap"},{icon:u.FileText,label:"Corpus",value:`${s.toLocaleString()} docs`,hint:`${a.toLocaleString()} chars`}];return(0,t.jsxs)("div",{className:"rounded-xl border bg-card text-card-foreground p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-base font-semibold mb-4",children:[(0,t.jsx)(h.Layers,{className:"size-4 text-primary"}),"Index configuration"]}),(0,t.jsx)("dl",{className:"grid grid-cols-2 gap-x-6 gap-y-5 sm:grid-cols-3",children:i.map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(e.icon,{className:"size-3.5"}),e.label]}),(0,t.jsxs)("dd",{className:"text-sm font-medium leading-tight",children:[e.value,e.hint&&(0,t.jsx)("span",{className:"ml-1.5 font-mono text-[11px] font-normal text-muted-foreground",children:e.hint})]})]},e.label))})]})}let T={idle:{label:"Idle"},chunking:{label:"Chunking",phase:"Splitting documents into chunks"},embedding:{label:"Embedding",phase:"Generating vector embeddings"},upserting:{label:"Storing",phase:"Writing vectors to the store"},completed:{label:"Completed"},failed:{label:"Failed"}};function I({run:e,running:s}){if(!e)return(0,t.jsxs)("div",{className:"rounded-xl border bg-card text-card-foreground flex flex-col items-center justify-center gap-1 py-8 text-center",children:[(0,t.jsx)(m,{className:"mb-1 size-6 text-muted-foreground/60"}),(0,t.jsx)("p",{className:"text-sm font-medium",children:"No index built yet"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Build a Larkup index to embed your corpus and make it searchable."})]});let n=T[e.status],i=e.totalChunks>0?Math.round(e.processedChunks/e.totalChunks*100):5*!!s;return(0,t.jsxs)("div",{className:"rounded-xl border bg-card text-card-foreground p-4 space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-base font-semibold",children:["completed"===e.status?(0,t.jsx)(o.CheckCircle2,{className:"size-4 text-primary"}):"failed"===e.status?(0,t.jsx)(r.AlertTriangle,{className:"size-4 text-destructive"}):(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin text-primary"}),n.label]}),(0,t.jsx)(P,{status:e.status})]}),"failed"===e.status?(0,t.jsx)(t.Fragment,{}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:n.phase??"Done"}),(0,t.jsxs)("span",{className:"font-mono tabular-nums",children:[e.processedChunks.toLocaleString(),e.totalChunks>0&&` / ${e.totalChunks.toLocaleString()}`," chunks"]})]}),(0,t.jsx)(y.Progress,{value:i,className:"**:data-[slot=progress-indicator]:bg-green-600"})]}),(0,t.jsxs)("dl",{className:"grid grid-cols-2 gap-4 pt-1 sm:grid-cols-4",children:[(0,t.jsx)(M,{label:"Documents",value:e.docCount.toLocaleString()}),(0,t.jsx)(M,{label:"Chunks",value:e.totalChunks.toLocaleString()}),(0,t.jsx)(M,{label:"Dimensions",value:e.dimensions?e.dimensions.toLocaleString():"—"}),(0,t.jsx)(M,{label:"Duration",value:e.durationMs?`${(e.durationMs/1e3).toFixed(1)}s`:s?"running…":"—"})]})]})]})}function M({label:e,value:s}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("dt",{className:"text-xs text-muted-foreground",children:e}),(0,t.jsx)("dd",{className:"font-mono text-sm tabular-nums",children:s})]})}function P({status:e}){return"completed"===e?(0,t.jsx)(N.Badge,{className:"bg-primary/12 text-primary hover:bg-primary/12",children:"Ready"}):"failed"===e?(0,t.jsx)(N.Badge,{variant:"destructive",children:"Failed"}):z.includes(e)?(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-xs font-medium text-green-600",children:[(0,t.jsxs)("span",{className:"relative flex size-2",children:[(0,t.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-green-600 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex size-2 rounded-full bg-green-600"})]}),"Live"]}):null}let _=e=>fetch(e).then(e=>e.json()),B=["chunking","embedding","upserting"];e.s(["GlobalIndexProgress",0,function(){let{data:e}=(0,s.default)("/api/index",_,{refreshInterval:e=>e?.run&&B.includes(e.run.status)?1e3:0});if(!(e?.run&&B.includes(e.run.status))||!e?.run)return null;let{run:n}=e,r=n.totalChunks>0?Math.round(n.processedChunks/n.totalChunks*100):5;return(0,t.jsx)("div",{className:"fixed bottom-6 right-6 z-50",children:(0,t.jsx)(E,{trigger:(0,t.jsxs)("button",{className:"flex items-center gap-3 rounded-full border bg-background px-4 py-2 text-sm font-medium transition-all hover:bg-muted/50 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin text-primary"}),(0,t.jsxs)("div",{className:"flex flex-col items-start gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs leading-none text-muted-foreground",children:"Storing..."}),(0,t.jsxs)("span",{className:"leading-none",children:[r,"%"]})]})]})})})}],953159)},232295,e=>{"use strict";var t=e.i(199910),s=e.i(523829),a=e.i(178328),n=e.i(960198),r=e.i(133058),i=e.i(736484),l=e.i(417368),o=e.i(466691);let d="larkup-update-dismissed",c={docker:"docker compose pull && docker compose up -d",npm:"larkup update"};e.s(["UpdateBanner",0,function(){let[u,m]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),[g,b]=(0,a.useState)(!1),j="0.1.34",v="__TAURI__"in window?"desktop":"true"===t.default.env.NEXT_PUBLIC_DOCKER_ENV||"true"===t.default.env.NEXT_PUBLIC_RUNNING_IN_DOCKER?"docker":"npm";(0,a.useEffect)(()=>{if(function(){try{let e=localStorage.getItem(d);if(!e)return!1;let{timestamp:t}=JSON.parse(e);return Date.now()-t<864e5}catch{return!1}}())return;let e=new AbortController;return fetch("https://larkup.de/api/version",{signal:e.signal,cache:"no-store"}).then(e=>e.json()).then(e=>{e.version&&function(e,t){let s=e.replace(/^v/,"").split(".").map(Number),a=t.replace(/^v/,"").split(".").map(Number);for(let e=0;e<3;e++){let t=s[e]||0,n=a[e]||0;if(t>n)return 1;if(t<n)return -1}return 0}(e.version,j)>0&&(m(e.version),h(!0))}).catch(()=>{}),()=>e.abort()},[j]);let y=async()=>{if("desktop"===v){f(!0);try{let{check:t}=await e.A(963347),{relaunch:s}=await e.A(995308),a=await t();a?(await a.downloadAndInstall(),await s()):f(!1)}catch(e){console.error("Auto-update failed:",e),f(!1),window.open("https://larkup.de/download","_blank")}}else try{await navigator.clipboard.writeText(c[v]),b(!0),window.setTimeout(()=>b(!1),2e3)}catch(e){console.error("Could not copy update command:",e)}};return x&&u?(0,s.jsx)("div",{role:"status","aria-live":"polite",className:"relative z-50 border-b border-border bg-background px-3 py-2 text-foreground sm:px-4",children:(0,s.jsxs)("div",{className:"mx-auto flex min-h-7 max-w-screen-2xl items-center gap-2.5",children:[(0,s.jsx)("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background",children:(0,s.jsx)(n.ArrowUp,{className:"size-3.5","aria-hidden":"true"})}),(0,s.jsxs)("p",{className:"min-w-0 text-xs sm:text-sm",children:[(0,s.jsxs)("span",{className:"font-medium",children:["Larkup v",u," is available."]})," ",(0,s.jsxs)("span",{className:"hidden text-muted-foreground sm:inline",children:["You're using v",j,"."]})]}),"desktop"!==v&&(0,s.jsx)("code",{className:"ml-auto hidden max-w-[38rem] truncate rounded-[5px] border border-border bg-muted/40 px-2 py-1 font-mono text-[11px] text-muted-foreground lg:block",children:c[v]}),(0,s.jsx)(o.Button,{type:"button",variant:"desktop"===v?"default":"outline",size:"xs",onClick:y,disabled:p,"aria-label":"desktop"===v?"Update Larkup now":"Copy update command",className:"desktop"===v?"ml-auto":"ml-auto lg:ml-0",children:"desktop"===v?p?"Updating...":"Update now":g?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.Check,{"aria-hidden":"true"}),"Copied"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Copy,{"aria-hidden":"true"}),"Copy command"]})}),(0,s.jsx)(o.Button,{type:"button",variant:"ghost",size:"icon-xs",onClick:()=>{try{localStorage.setItem(d,JSON.stringify({timestamp:Date.now()}))}catch{}h(!1)},"aria-label":"Dismiss update notification",title:"Remind me tomorrow",children:(0,s.jsx)(l.X,{"aria-hidden":"true"})})]})}):null}])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,721606,e=>{"use strict";var t=e.i(199910),s=e.i(178328),a=e.i(732684);function n(){return"u">typeof window}function r(){return"production"}function i(){return"development"===((n()?window.vam:r())||"production")}function l(e){return RegExp(`/${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?=[/?#]|$)`)}function o(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function d(e){return(0,s.useEffect)(()=>{var t;e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),(0,s.useEffect)(()=>{!function(e={debug:!0},t){var s;if(!n())return;let{beforeSend:a,src:l,dataset:d}=function(e,t){var s,a;let n=e;if(t)try{n={...null==(s=JSON.parse(t))?void 0:s.analytics,...e}}catch{}!function(e="auto"){if("auto"===e){window.vam=r();return}window.vam=e}(n.mode);let l={sdkn:"@vercel/analytics"+(n.framework?`/${n.framework}`:""),sdkv:"2.0.1"};return n.disableAutoTrack&&(l.disableAutoTrack="1"),n.viewEndpoint&&(l.viewEndpoint=o(n.viewEndpoint)),n.eventEndpoint&&(l.eventEndpoint=o(n.eventEndpoint)),n.sessionEndpoint&&(l.sessionEndpoint=o(n.sessionEndpoint)),i()&&!1===n.debug&&(l.debug="false"),n.dsn&&(l.dsn=n.dsn),n.endpoint?l.endpoint=n.endpoint:n.basePath&&(l.endpoint=o(`${n.basePath}/insights`)),{beforeSend:n.beforeSend,src:(a=n).scriptSrc?o(a.scriptSrc):i()?"https://va.vercel-scripts.com/v1/script.debug.js":a.basePath?o(`${a.basePath}/insights/script.js`):"/_vercel/insights/script.js",dataset:l}}(e,t);if(window.va||(window.va=function(...e){window.vaq||(window.vaq=[]),window.vaq.push(e)}),a&&(null==(s=window.va)||s.call(window,"beforeSend",a)),document.head.querySelector(`script[src*="${l}"]`))return;let c=document.createElement("script");for(let[e,t]of(c.src=l,Object.entries(d)))c.dataset[e]=t;c.defer=!0,c.onerror=()=>{let e=i()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${l}. ${e}`)},document.head.appendChild(c)}({framework:e.framework||"react",basePath:e.basePath??function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...void 0!==e.route&&{disableAutoTrack:!0},...e},e.configString??function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}())},[]),(0,s.useEffect)(()=>{e.route&&e.path&&function({route:e,path:t}){var s;null==(s=window.va)||s.call(window,"pageview",{route:e,path:t})}({route:e.route,path:e.path})},[e.route,e.path]),null}function c(e){let n,r,i,{route:o,path:c}=(n=(0,a.useParams)(),r=(0,a.useSearchParams)(),i=(0,a.usePathname)(),n?{route:function(e,t){if(!e||!t)return e;let s=e;try{let e=Object.entries(t);for(let[t,a]of e)if(!Array.isArray(a)){let e=l(a);e.test(s)&&(s=s.replace(e,`/[${t}]`))}for(let[t,a]of e)if(Array.isArray(a)){let e=l(a.join("/"));e.test(s)&&(s=s.replace(e,`/[...${t}]`))}return s}catch{return e}}(i,Object.keys(n).length?n:Object.fromEntries(r.entries())),path:i}:{route:null,path:i});return s.default.createElement(d,{path:c,route:o,...e,basePath:function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.NEXT_PUBLIC_VERCEL_OBSERVABILITY_BASEPATH}(),configString:function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.NEXT_PUBLIC_VERCEL_OBSERVABILITY_CLIENT_CONFIG}(),framework:"next"})}e.s(["Analytics",0,function(e){return s.default.createElement(s.Suspense,{fallback:null},s.default.createElement(c,{...e}))}])},7012,e=>{"use strict";var t=e.i(523829),s=e.i(178328),a=(e,t,s,a,n,r,i,l)=>{let o=document.documentElement,d=["light","dark"];function c(t){var s;(Array.isArray(e)?e:[e]).forEach(e=>{let s="class"===e,a=s&&r?n.map(e=>r[e]||e):n;s?(o.classList.remove(...a),o.classList.add(r&&r[t]?r[t]:t)):o.setAttribute(e,t)}),s=t,l&&d.includes(s)&&(o.style.colorScheme=s)}if(a)c(a);else try{let e=localStorage.getItem(t)||s,a=i&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(a)}catch(e){}},n=s.createContext(void 0),r={setTheme:e=>{},themes:[]};s.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:l,value:o,themes:d,nonce:c,scriptProps:u})=>{let m=JSON.stringify([n,t,l,e,d,o,r,i]).slice(1,-1);return s.createElement("script",{...u,suppressHydrationWarning:!0,nonce:"u"<typeof window?c:"",dangerouslySetInnerHTML:{__html:`(${a.toString()})(${m})`}})});var i=e.i(746632),l=e.i(795360),l=l,o=e.i(951482),o=o,d=e.i(195300),d=d,c=e.i(909042),c=c,u=e.i(964548),u=u;e.s(["Toaster",0,({...e})=>{var a;let{theme:m="system"}=null!=(a=s.useContext(n))?a:r;return(0,t.jsx)(i.Toaster,{closeButton:!0,theme:m,className:"toaster group z-9999999! ",icons:{success:(0,t.jsx)(l.default,{className:"size-5 text-white",fill:"#10b981"}),info:(0,t.jsx)(o.default,{className:"size-5 text-white",fill:"#3b82f6"}),warning:(0,t.jsx)(d.default,{className:"size-5 text-white",fill:"#f59e0b"}),error:(0,t.jsx)(c.default,{className:"size-5 text-white",fill:"#ef4444"}),loading:(0,t.jsx)(u.default,{className:"size-5 animate-spin text-muted-foreground"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)",zIndex:999999},toastOptions:{classNames:{toast:"group toast items-start group-[.toaster]:!bg-[#F9F9F7] dark:group-[.toaster]:!bg-zinc-900 group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:",icon:"mt-0.5",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",success:"group-[.toaster]:!bg-[#F9F9F7] dark:group-[.toaster]:!bg-zinc-900",error:"group-[.toaster]:!bg-[#F9F9F7] dark:group-[.toaster]:!bg-zinc-900",warning:"group-[.toaster]:!bg-[#F9F9F7] dark:group-[.toaster]:!bg-zinc-900",info:"group-[.toaster]:!bg-[#F9F9F7] dark:group-[.toaster]:!bg-zinc-900"}},...e})}],7012)},266186,e=>{"use strict";var t=e.i(523829),s=e.i(82100),a=e.i(178328),n=e.i(334347),r=e.i(732684),i=e.i(301470),l=e.i(518864),o=e.i(487779),d=e.i(874822);let c=(0,d.default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);var u=e.i(708909),m=e.i(37126),x=e.i(152236),h=e.i(839717),p=e.i(133058);let f=(0,d.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var g=e.i(980369),b=e.i(379702),j=e.i(885131),v=e.i(440087),y=e.i(624529),N=e.i(874560),w=e.i(746632),k=e.i(501706),C=e.i(466691),A=e.i(282879);function F({target:e,open:s,onOpenChange:n}){let{deleteServer:r}=(0,y.useWorkspace)(),[i,l]=(0,a.useState)(!1);async function o(){if(e){l(!0);try{await r(e.id),w.toast.success(`Deleted "${e.name}".`),n(!1)}catch{w.toast.error("Could not delete the server.")}finally{l(!1)}}}return(0,t.jsx)(A.Dialog,{open:s,onOpenChange:n,children:(0,t.jsxs)(A.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsxs)(A.DialogHeader,{children:[(0,t.jsxs)(A.DialogTitle,{children:["Delete “",e?.name,"”?"]}),(0,t.jsx)(A.DialogDescription,{children:"This permanently removes the server's documents, index, vector data, and generated files. This cannot be undone."})]}),(0,t.jsxs)(A.DialogFooter,{children:[(0,t.jsx)(C.Button,{variant:"outline",onClick:()=>n(!1),disabled:i,children:"Cancel"}),(0,t.jsxs)(C.Button,{variant:"destructive",onClick:()=>void o(),disabled:i,children:[i&&(0,t.jsx)(k.Loader2,{className:"size-4 animate-spin"}),"Delete server"]})]})]})})}function S(){let{servers:e,activeServer:s,activateServer:n}=(0,y.useWorkspace)(),[r,i]=(0,a.useState)(!1),[l,o]=(0,a.useState)(null),[d,c]=(0,a.useState)(null);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(v.DropdownMenu,{children:[(0,t.jsxs)(v.DropdownMenuTrigger,{render:(0,t.jsx)("button",{type:"button",className:"flex w-full items-center gap-2 rounded-lg border border-border bg-card px-2 py-1.5 text-left transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"}),children:[(0,t.jsx)("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-md bg-primary/12 text-primary",children:(0,t.jsx)(m.Server,{className:"size-3.5"})}),(0,t.jsx)("span",{className:"flex min-w-0 flex-1 flex-col",children:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:s?.name??"No server"}),s?.running&&(0,t.jsx)(z,{})]})}),(0,t.jsx)(f,{className:"size-4 shrink-0 text-muted-foreground"})]}),(0,t.jsxs)(v.DropdownMenuContent,{align:"start",sideOffset:6,className:"w-(--anchor-width) min-w-[260px]",children:[(0,t.jsxs)(v.DropdownMenuGroup,{children:[(0,t.jsx)(v.DropdownMenuLabel,{children:"Your servers"}),e.map(e=>{let a=e.id===s?.id;return(0,t.jsxs)(v.DropdownMenuItem,{onClick:()=>{a||n(e.id)},className:"gap-2",children:[(0,t.jsx)("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:(0,t.jsx)(m.Server,{className:"size-3.5"})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:e.name}),(0,t.jsxs)("span",{className:"flex items-center gap-2 text-[11px] text-muted-foreground tabular-nums",children:[(0,t.jsxs)("span",{children:[e.docCount," docs"]}),e.indexed&&(0,t.jsx)("span",{children:"· indexed"}),e.running&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-500",children:[(0,t.jsx)(z,{}),"live"]})]})]}),a&&(0,t.jsx)(p.Check,{className:"size-4 shrink-0 text-primary"})]},e.id)})]}),(0,t.jsx)(v.DropdownMenuSeparator,{}),(0,t.jsxs)(v.DropdownMenuItem,{onClick:()=>i(!0),className:"gap-2 h-9",children:[(0,t.jsx)(b.Plus,{className:"size-4"}),"New server"]}),s&&(0,t.jsxs)(v.DropdownMenuItem,{onClick:()=>o(s),className:"gap-2 h-9",children:[(0,t.jsx)(g.Pencil,{className:"size-4"}),"Rename current"]}),s&&e.length>1&&(0,t.jsxs)(v.DropdownMenuItem,{variant:"destructive",onClick:()=>c(s),className:"gap-2",children:[(0,t.jsx)(j.Trash2,{className:"size-4"}),"Delete current"]})]})]}),(0,t.jsx)(N.ServerFormDialog,{mode:"create",open:r,onOpenChange:i}),(0,t.jsx)(N.ServerFormDialog,{mode:"rename",target:l,open:null!==l,onOpenChange:e=>!e&&o(null)}),(0,t.jsx)(F,{target:d,open:null!==d,onOpenChange:e=>!e&&c(null)})]})}function z(){return(0,t.jsxs)("span",{className:"relative flex size-2",children:[(0,t.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-green-500 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex size-2 rounded-full bg-green-500"})]})}let E={"panel-default":void 0,"panel-white":"#FFFFFF","panel-fafafa":"#FAFAFA","panel-warm":"#F7F1EA","panel-soft":"#FBFAF8","panel-silver":"#F8F8F8","panel-stone":"#F5F5F2"},D=[{id:"chat",label:"Chat",href:"/chat",icon:i.MessageCircle},{id:"data",label:"Data",href:"/data",icon:l.Database},{id:"analytics",label:"Analytics",href:"/analytics",icon:c},{id:"settings",label:"Settings",href:"/settings",icon:o.Settings}];function T(){let e=(0,r.usePathname)(),{pageStyle:i,navBg:l}=(0,s.useThemeCustomizer)(),{activeServer:o}=(0,y.useWorkspace)(),[d,c]=(0,a.useState)(!0);(0,a.useEffect)(()=>{"false"===localStorage.getItem("sidebar-collapsed")&&c(!1)},[]);let p=()=>{let e=!d;c(e),localStorage.setItem("sidebar-collapsed",String(e))},f=l?E[l]:void 0;return(0,t.jsx)(h.TooltipProvider,{delay:150,children:(0,t.jsxs)("aside",{className:(0,x.cn)("sticky top-0 hidden h-screen shrink-0 flex-col self-start py-4 md:flex transition-all duration-300 ease-in-out",d?"w-18":"w-60",f?"":"bg-background","fused"===i?"border-r border-border":""),style:f?{backgroundColor:f}:void 0,children:[(0,t.jsx)("div",{className:(0,x.cn)("flex w-full items-center mb-6",d?"justify-center px-3":"justify-between px-4"),children:d?(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:p,"aria-label":"Expand sidebar",className:"flex size-10 items-center justify-center rounded-xl bg-primary text-primary-foreground transition-transform hover:scale-105"}),children:(0,t.jsx)("img",{src:"/logo9.png",className:"size-5",alt:"logo"})}),(0,t.jsx)(h.TooltipContent,{side:"right",sideOffset:10,children:"Expand sidebar"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.default,{href:"/chat",className:"flex items-center gap-2.5",children:[(0,t.jsx)("span",{className:"flex size-9 items-center justify-center rounded-xl bg-primary text-primary-foreground transition-transform hover:scale-105",children:(0,t.jsx)("img",{src:"/logo9.png",className:"size-5",alt:"logo"})}),(0,t.jsx)("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Larkup"})]}),(0,t.jsx)("button",{onClick:p,className:"flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors","aria-label":"Collapse sidebar",children:(0,t.jsx)(u.ChevronLeft,{className:"size-3.5"})})]})}),(0,t.jsx)("nav",{className:(0,x.cn)("flex flex-1 flex-col w-full",d?"items-center px-3 gap-3":"px-3 gap-1.5"),children:D.map(s=>{let a=s.icon,r=e===s.href||"/"!==s.href&&e?.startsWith(s.href);return d?(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{render:(0,t.jsx)(n.default,{href:s.href,"aria-current":r?"page":void 0,onClick:t=>{"chat"===s.id&&"/chat"===e&&(t.preventDefault(),window.dispatchEvent(new CustomEvent("new-chat")))},className:(0,x.cn)("group relative flex size-10 items-center justify-center rounded-xl transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring",r?"bg-[#F0F0F0] text-foreground":"text-muted-foreground hover:bg-[#EBEBEB] hover:text-foreground")}),children:(0,t.jsx)(a,{className:"size-4.5",strokeWidth:r?2.25:1.75})}),(0,t.jsx)(h.TooltipContent,{side:"right",sideOffset:10,children:s.label})]},s.id):(0,t.jsxs)(n.default,{href:s.href,"aria-current":r?"page":void 0,onClick:t=>{"chat"===s.id&&"/chat"===e&&(t.preventDefault(),window.dispatchEvent(new CustomEvent("new-chat")))},className:(0,x.cn)("group relative flex items-center gap-3 rounded-xl px-3 py-2.5 text-[13px] font-medium transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring",r?"bg-[#F0F0F0] text-foreground":"text-muted-foreground hover:bg-[#EBEBEB] hover:text-foreground"),children:[(0,t.jsx)(a,{className:"size-4.5 shrink-0",strokeWidth:r?2.25:1.75}),(0,t.jsx)("span",{className:"truncate",children:s.label})]},s.id)})}),(0,t.jsx)("div",{className:(0,x.cn)("w-full pt-3",d?"px-2":"px-3"),children:d?(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:p,className:"flex w-full items-center justify-center py-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors"}),children:(0,t.jsxs)("div",{className:"relative size-8 rounded-lg border border-border bg-card flex items-center justify-center text-muted-foreground transition-colors group-hover:text-foreground",children:[(0,t.jsx)(m.Server,{className:"size-4"}),(0,t.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 flex size-2.5",children:o?.running?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-green-500 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex size-full rounded-full bg-green-500 border border-card"})]}):(0,t.jsx)("span",{className:"relative inline-flex size-full rounded-full bg-gray-500 border border-card"})})]})}),(0,t.jsxs)(h.TooltipContent,{side:"right",sideOffset:10,children:[o?.name??"No server"," (",o?.running?"Live":"Offline",")"]})]}):(0,t.jsx)(S,{})})]})})}let I={"panel-default":void 0,"panel-white":"#FFFFFF","panel-fafafa":"#FAFAFA","panel-warm":"#F7F1EA","panel-soft":"#FBFAF8","panel-silver":"#F8F8F8","panel-stone":"#F5F5F2"},M=[{id:"chat",label:"Chat",href:"/chat",icon:i.MessageCircle},{id:"data",label:"Data",href:"/data",icon:l.Database},{id:"analytics",label:"Analytics",href:"/analytics",icon:c},{id:"settings",label:"Settings",href:"/settings",icon:o.Settings}];function P(){let e=(0,r.usePathname)(),{username:a}=(0,y.useWorkspace)(),{navBg:i}=(0,s.useThemeCustomizer)(),l=i?I[i]:void 0;return(0,t.jsx)(h.TooltipProvider,{delay:150,children:(0,t.jsxs)("header",{className:(0,x.cn)("sticky top-0 z-50 flex h-14 shrink-0 items-center gap-6 border-b border-border px-4 md:px-6",l?"":"bg-[#F5F5F4]"),style:l?{backgroundColor:l}:void 0,children:[(0,t.jsxs)(n.default,{href:"/chat","aria-label":"larkup home",className:"flex items-center gap-2.5 shrink-0",children:[(0,t.jsx)("span",{className:"flex size-9 items-center justify-center rounded-xl bg-primary text-primary-foreground transition-transform hover:scale-105",children:(0,t.jsx)("img",{src:"/logo9.png",className:"size-5",alt:"logo"})}),(0,t.jsx)("span",{className:"font-semibold tracking-tight text-foreground hidden sm:inline-block",children:"Larkup"})]}),(0,t.jsx)("nav",{className:"flex h-full items-center gap-1",children:M.map(s=>{let a=s.icon,r=e===s.href||"/"!==s.href&&e?.startsWith(s.href);return(0,t.jsxs)(n.default,{href:s.href,"aria-current":r?"page":void 0,className:(0,x.cn)("group relative flex items-center gap-2 h-full px-3 text-[13px] font-medium transition-colors outline-none",r?"text-primary":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(a,{className:"size-[16px]",strokeWidth:r?2.25:1.75}),(0,t.jsx)("span",{className:"hidden md:inline",children:s.label}),(0,t.jsx)("span",{className:(0,x.cn)("absolute bottom-0 left-2 right-2 h-[2px] rounded-full bg-primary transition-opacity",r?"opacity-100":"opacity-0")})]},s.id)})}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(S,{}),a&&(0,t.jsxs)("span",{className:"hidden text-sm text-muted-foreground md:block",children:["Hi, ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:a})]})]})]})})}let _=(0,d.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);var B=e.i(570764),O=e.i(18928),O=O,L=e.i(562949),R=e.i(741445),V=e.i(924911),$=e.i(300033),W=e.i(856474),K=e.i(266741);let U=["vercel_ai_gateway","openai","google","mistral","custom"];function H(){let{setUsername:e,createServer:s,refresh:n}=(0,y.useWorkspace)(),i=(0,r.useRouter)(),[l,o]=(0,a.useState)(""),[d,c]=(0,a.useState)("vercel_ai_gateway"),[u,m]=(0,a.useState)(""),[x,h]=(0,a.useState)(null),[p,f]=(0,a.useState)("vercel_ai_gateway"),[b,j]=(0,a.useState)(""),[v,N]=(0,a.useState)(null),[F,S]=(0,a.useState)(!1),[z,E]=(0,a.useState)(!1),[D,T]=(0,a.useState)(!1),[I,M]=(0,a.useState)(!1),[P,H]=(0,a.useState)(null),q="custom"===d,Y="custom"===p,J=z||q||d!==p?b:u,G=async()=>{S(!0);try{let t=await fetch("/api/config"),{config:a}=await t.json(),r={...a};q&&x?(r.embeddingProvider="custom",r.embeddingModelId=`custom:${x.modelName}`,r.embeddingApiKey=x.apiKey||void 0,r.customEmbeddings=[x]):(r.embeddingProvider=d,r.embeddingApiKey=u),z?Y&&v?(r.chatProvider="custom",r.chatModelId=`custom:${v.modelName}`,r.chatApiKey=v.apiKey||void 0,r.customChatModels=[v]):(r.chatProvider=p,r.chatApiKey=J):q&&x||(r.chatProvider=d,r.chatApiKey=u);let o=await fetch("/api/config/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({embeddingProvider:r.embeddingProvider,embeddingApiKey:r.embeddingApiKey,embeddingModelId:r.embeddingModelId,customEmbeddings:r.customEmbeddings,chatProvider:r.chatProvider,chatApiKey:r.chatApiKey,chatModelId:r.chatModelId,customChatModels:r.customChatModels})});if(!o.ok){let e=await o.json();w.toast.error(e.error||"Verification failed — please check your API key.",{duration:8e3}),S(!1);return}l.trim()&&await e(l.trim()),await s("my-larkup"),await fetch("/api/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),n(),i.push("/chat")}catch(e){w.toast.error("Failed to complete setup")}finally{S(!1)}},X=async()=>{S(!0);try{l.trim()&&await e(l.trim()),await s("my-larkup"),n(),i.push("/chat")}catch(e){w.toast.error("Failed to complete setup")}finally{S(!1)}},Z=(e,s)=>(0,t.jsxs)($.Select,{value:e,onValueChange:e=>{var t;"custom"===(t=e??"")?("embedding"===s?c("custom"):f("custom"),H(s)):"embedding"===s?(c(t),h(null),!z&&f(t)):(f(t),N(null))},children:[(0,t.jsx)($.SelectTrigger,{className:"w-full bg-white/90 hover:bg-white",children:(0,t.jsx)("span",{className:"flex items-center gap-2",children:W.PROVIDER_META[e]?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.ProviderIcon,{src:W.PROVIDER_META[e].iconSrc,alt:W.PROVIDER_META[e].label,pillBg:W.PROVIDER_META[e].pillBg,size:16}),W.PROVIDER_META[e].label]}):"Select provider"})}),(0,t.jsx)($.SelectContent,{children:U.map(e=>{let s=W.PROVIDER_META[e];return s?(0,t.jsx)($.SelectItem,{value:e,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(W.ProviderIcon,{src:s.iconSrc,alt:s.label,pillBg:s.pillBg,size:16}),(0,t.jsxs)("span",{children:[s.label,"vercel_ai_gateway"===e&&" (Recommended)","custom"===e&&" (OpenAI-compatible)"]})]})},e):null})})]}),Q=(e,s)=>(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50/50 px-3 py-2",children:[(0,t.jsx)("span",{className:"text-green-600 text-xs",children:"✓"}),(0,t.jsx)("span",{className:"flex-1 truncate text-xs font-medium text-foreground",children:e.modelName}),(0,t.jsx)("button",{type:"button",onClick:()=>H(s),className:"text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(g.Pencil,{className:"size-3"})})]});return(0,t.jsxs)("div",{className:"fixed inset-0 z-50 overflow-y-auto bg-background",children:[(0,t.jsxs)("div",{className:"pointer-events-none fixed inset-0 overflow-hidden",children:[(0,t.jsx)("div",{className:"absolute -left-20 -top-20 h-125 w-125 rounded-full bg-stone-200/40 blur-3xl animate-pulse"}),(0,t.jsx)("div",{className:"absolute -bottom-32 -right-32 h-150 w-150 rounded-full bg-amber-100/30 blur-3xl animate-pulse [animation-delay:1s]"})]}),(0,t.jsx)("div",{className:"relative z-10 flex min-h-full w-full flex-col items-center justify-center px-6 py-12",children:(0,t.jsxs)("div",{className:"flex w-full max-w-lg flex-col items-center gap-8 animate-fade-up",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 text-center",children:[(0,t.jsx)("div",{className:"flex size-14 items-center justify-center rounded-xl bg-primary text-primary-foreground ",children:(0,t.jsx)("img",{src:"/logo9.png",className:"size-8",alt:"Larkup"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight text-foreground",children:"Welcome to Larkup"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Let's set up your AI models. You can change these later in Settings."})]})]}),(0,t.jsxs)("div",{className:"w-full space-y-5 rounded-2xl p-6 backdrop-blur-xl",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-foreground",children:"Your Name (Optional)"}),(0,t.jsx)(V.Input,{value:l,onChange:e=>o(e.target.value),placeholder:"How should we call you?",className:"bg-background/50"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-foreground",children:"Embedding Provider"}),Z(d,"embedding"),q&&x&&Q(x,"embedding"),q&&!x&&(0,t.jsx)("p",{className:"text-[11px] text-amber-600 mt-1",children:"Please configure and test your custom model to continue."})]}),!q&&(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("label",{className:"text-xs font-medium text-foreground",children:["API Key",!z&&(0,t.jsxs)("span",{className:"text-muted-foreground font-normal",children:[" ","(used for both embedding & chat)"]})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(V.Input,{type:D?"text":"password",value:u,onChange:e=>m(e.target.value),placeholder:"sk-...",className:"bg-background/50 pr-10"}),(0,t.jsx)("button",{type:"button","aria-label":D?"Hide API key":"Show API key",onClick:()=>T(e=>!e),className:"absolute inset-y-0 right-0 flex items-center px-3 text-muted-foreground hover:text-foreground",children:D?(0,t.jsx)(R.EyeOff,{className:"size-4"}):(0,t.jsx)(L.Eye,{className:"size-4"})})]})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>E(!z),className:"flex w-full items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[z?(0,t.jsx)(O.default,{className:"size-3.5"}):(0,t.jsx)(B.ChevronDown,{className:"size-3.5"}),"Use a different chat model"]}),z&&(0,t.jsxs)("div",{className:"space-y-3 rounded-xl border border-border/40 bg-muted/20 p-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-foreground",children:"Chat Provider"}),Z(p,"chat"),Y&&v&&Q(v,"chat"),Y&&!v&&(0,t.jsx)("p",{className:"text-[11px] text-amber-600 mt-1",children:"Please configure and test your custom model to continue."})]}),!Y&&(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-foreground",children:"Chat API Key"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(V.Input,{type:I?"text":"password",value:b,onChange:e=>j(e.target.value),placeholder:"sk-...",className:"bg-background/50 pr-10"}),(0,t.jsx)("button",{type:"button","aria-label":I?"Hide chat API key":"Show chat API key",onClick:()=>M(e=>!e),className:"absolute inset-y-0 right-0 flex items-center px-3 text-muted-foreground hover:text-foreground",children:I?(0,t.jsx)(R.EyeOff,{className:"size-4"}):(0,t.jsx)(L.Eye,{className:"size-4"})})]})]})]}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"More providers and fine-grained model selection available in Settings → AI Models."}),(0,t.jsxs)("div",{className:"pt-2 flex gap-3",children:[(0,t.jsx)(C.Button,{variant:"outline",className:"flex-1",onClick:X,disabled:F,children:"Skip for now"}),(0,t.jsx)(C.Button,{className:"flex-1",onClick:G,disabled:F||!(()=>{if(q){if(!x)return!1}else if(!u)return!1;if(z){if(Y){if(!v)return!1}else if(!J)return!1}return!0})(),children:F?(0,t.jsx)(k.Loader2,{className:"size-4 animate-spin"}):(0,t.jsxs)(t.Fragment,{children:["Continue ",(0,t.jsx)(_,{className:"ml-1.5 size-4"})]})})]})]})]})}),(0,t.jsx)(A.Dialog,{open:null!==P,onOpenChange:e=>{e||("embedding"!==P||x||c("vercel_ai_gateway"),"chat"!==P||v||f("vercel_ai_gateway"),H(null))},children:(0,t.jsxs)(A.DialogContent,{className:"max-w-xl",children:[(0,t.jsxs)(A.DialogHeader,{children:[(0,t.jsxs)(A.DialogTitle,{children:["Custom ","embedding"===P?"Embedding":"Chat"," Model"]}),(0,t.jsxs)(A.DialogDescription,{children:["Connect an OpenAI-compatible ","embedding"===P?"embedding":"chat"," ","model. Test the connection before adding."]})]}),P&&(0,t.jsx)(K.CustomModelForm,{type:P,onSave:e=>{"embedding"===P?(h(e),c("custom")):"chat"===P&&(N(e),f("custom")),H(null)},onCancel:()=>{"embedding"!==P||x||c("vercel_ai_gateway"),"chat"!==P||v||f("vercel_ai_gateway"),H(null)}})]})})]})}let q={"panel-default":"#FAFAFA","panel-white":"#FFFFFF","panel-fafafa":"#FAFAFA","panel-warm":"#F7F1EA","panel-soft":"#FBFAF8","panel-silver":"#F8F8F8","panel-stone":"#F5F5F2"};e.s(["ClientLayoutWrapper",0,function({children:e}){let{pageStyle:a,panelBg:n,layout:i}=(0,s.useThemeCustomizer)(),l=(0,r.usePathname)(),o=l?.includes("/chat"),{isFirstRun:d,isLoading:c}=(0,y.useWorkspace)(),u=q[n],m=u?{backgroundColor:u}:void 0;return!c&&d?(0,t.jsx)(H,{}):c?(0,t.jsx)("div",{className:"flex h-screen items-center justify-center",children:(0,t.jsx)("div",{className:"size-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):"topnav"===i?(0,t.jsxs)("div",{className:"flex flex-col h-screen overflow-hidden",children:[(0,t.jsx)(P,{}),(0,t.jsx)("main",{className:"min-w-0 flex-1 overflow-hidden",children:(0,t.jsx)("div",{className:"h-full flex flex-col bg-background text-foreground",style:m,children:(0,t.jsx)("div",{className:(0,x.cn)("flex-1 min-h-0",o||l?.includes("/settings")||l?.includes("/analytics")?"overflow-hidden flex flex-col":"overflow-auto"),children:(0,t.jsx)("div",{className:(0,x.cn)("h-full w-full",o||l?.includes("/settings")||l?.includes("/analytics")?"flex-1 min-h-0 flex flex-col":"container mx-auto pb-8"),children:e})})})})]}):(0,t.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[(0,t.jsx)(T,{}),(0,t.jsx)("main",{className:"min-w-0 flex-1 overflow-hidden",children:(0,t.jsx)("div",{className:"fused"===a?"h-screen flex flex-col bg-background text-foreground overflow-hidden":"h-screen flex flex-col md:rounded-l-2xl border-l border-border bg-panel text-panel-foreground overflow-hidden",style:m,children:(0,t.jsx)("div",{className:(0,x.cn)("flex-1 min-h-0",o||l?.includes("/settings")||l?.includes("/analytics")?"overflow-hidden flex flex-col":"overflow-auto"),children:(0,t.jsx)("div",{className:(0,x.cn)("h-full w-full",o||l?.includes("/settings")||l?.includes("/analytics")?"flex-1 min-h-0 flex flex-col":"container mx-auto pb-8"),children:e})})})})]})}],266186)},953159,e=>{"use strict";var t=e.i(523829),s=e.i(842646),a=e.i(501706),n=e.i(178328),r=e.i(866657),i=e.i(874822);let l=(0,i.default)("boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);var o=e.i(871942);let d=(0,i.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var c=e.i(518864),u=e.i(702938);let m=(0,i.default)("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);var x=e.i(743118),h=e.i(714809),p=e.i(241491),f=e.i(539352);let g=(0,i.default)("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);var b=e.i(682458),j=e.i(161351),v=e.i(466691),y=e.i(861947),N=e.i(323621),w=e.i(524365),k=e.i(534792),C=e.i(746632),A=e.i(878835),F=e.i(282879);let S=e=>fetch(e).then(e=>e.json()),z=["chunking","embedding","upserting"];function E({open:e,onOpenChange:i,trigger:l}){let[o,d]=(0,n.useState)(!1),[c,u]=(0,n.useState)(!1),m=void 0!==e,g=m?e:c,b=m&&i?i:u,{data:j,isLoading:y,mutate:N}=(0,s.default)("/api/index",S,{refreshInterval:e=>e?.run&&z.includes(e.run.status)?1e3:0}),T=(0,n.useRef)(void 0);(0,n.useEffect)(()=>{let e=j?.run?.warning;e&&e!==T.current?C.toast.warning(e,{id:"rate-limit-warning",duration:7e4}):!e&&T.current&&(C.toast.dismiss("rate-limit-warning"),C.toast.success("Rate limit resolved — resuming indexing.",{duration:3e3})),T.current=e},[j?.run?.warning]);let[M,P]=(0,n.useState)(!1);async function _(e=!1){d(!0);try{let t=await fetch("/api/index",{method:"POST",body:JSON.stringify({incremental:e}),headers:{"Content-Type":"application/json"}}),s=await t.json();if(!t.ok)return void C.toast.error(s.error??"Could not start indexing.");C.toast.success("Indexing started."),N()}catch{C.toast.error("Could not start indexing.")}finally{d(!1)}}async function B(){d(!0);try{if(!(await fetch("/api/index",{method:"DELETE"})).ok)return void C.toast.error("Could not cancel indexing.");C.toast.success("Indexing cancelled."),N()}catch{C.toast.error("Could not cancel indexing.")}finally{d(!1)}}return(0,n.useEffect)(()=>{let e=j?.run?.status;e&&z.includes(e)?P(!0):M&&"completed"===e&&(P(!1),b(!1),C.toast.success("Indexing completed successfully!"))},[j?.run?.status,M,b]),(0,t.jsxs)(F.Dialog,{open:g,onOpenChange:b,children:[l?(0,t.jsx)(F.DialogTrigger,{render:(0,n.isValidElement)(l)?l:(0,t.jsx)("button",{children:l})}):(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[j?.run?.status==="completed"&&(0,t.jsxs)(A.AlertDialog,{children:[(0,t.jsx)(A.AlertDialogTrigger,{render:(0,t.jsxs)(v.Button,{disabled:!j.ready||!!(j.run&&z.includes(j.run.status))||o,variant:"outline",children:[(0,t.jsx)(f.RotateCcw,{className:"size-4 mr-2"}),"Re-Index Data"]})}),(0,t.jsxs)(A.AlertDialogContent,{children:[(0,t.jsxs)(A.AlertDialogHeader,{children:[(0,t.jsx)(A.AlertDialogTitle,{children:"Are you sure you want to re-index data?"}),(0,t.jsx)(A.AlertDialogDescription,{children:"This will rebuild the entire index from scratch. All documents will be re-processed."})]}),(0,t.jsxs)(A.AlertDialogFooter,{children:[(0,t.jsx)(A.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(A.AlertDialogAction,{onClick:()=>{b(!0),_(!1)},children:"Continue"})]})]})]}),(0,t.jsx)(F.DialogTrigger,{render:(0,t.jsxs)(v.Button,{disabled:!j?.ready||j?.unindexedCount===0,children:[(0,t.jsx)(h.Layers,{className:"size-4 mr-2"}),"Index Data"]})})]}),(0,t.jsxs)(F.DialogContent,{className:"max-w-2xl max-h-[90vh] overflow-y-auto ",children:[(0,t.jsxs)(F.DialogHeader,{children:[(0,t.jsx)(F.DialogTitle,{children:"Index Data"}),(0,t.jsx)(F.DialogDescription,{children:"Chunk, embed, and index into your selected vector database."})]}),y||!j?(0,t.jsx)("div",{className:"py-6",children:(0,t.jsx)(k.Skeleton,{className:"h-40 w-full"})}):(0,t.jsxs)("div",{className:"space-y-6 py-4",children:[(0,t.jsx)(D,{config:j.config,docCount:j.docCount,charCount:j.charCount}),!j.ready&&(0,t.jsxs)(w.Alert,{variant:"default",children:[(0,t.jsx)(r.AlertTriangle,{className:"size-4 text-orange-500!"}),(0,t.jsx)(w.AlertTitle,{className:"text-orange-500!",children:"Not ready to index"}),(0,t.jsx)(w.AlertDescription,{children:(0,t.jsx)("ul",{className:"list-disc pl-4",children:j.blockers.map(e=>(0,t.jsx)("li",{children:e},e))})})]}),(0,t.jsx)(I,{run:j.run,running:!!(j.run&&z.includes(j.run.status))}),j.ready&&!j.run&&(0,t.jsxs)(w.Alert,{children:[(0,t.jsx)(x.Info,{className:"size-4 text-blue-500!"}),(0,t.jsx)(w.AlertTitle,{className:"text-blue-600 dark:text-blue-400",children:"Before you start indexing"}),(0,t.jsxs)(w.AlertDescription,{className:"text-muted-foreground space-y-1",children:[(0,t.jsxs)("p",{children:["Once indexing begins, two settings become"," ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:"locked"})," to the existing index:"]}),(0,t.jsxs)("ul",{className:"list-disc pl-4 space-y-0.5",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Embedding model"})," — you can swap to any model with the"," ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:"same vector dimensions"}),", but switching to a model with different dimensions will require a full re-index."]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Vector store"})," — changing the store after indexing requires starting fresh."]})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)(v.Button,{onClick:()=>_(j.run?.status==="completed"),disabled:!j.ready||!!(j.run&&z.includes(j.run.status))||o||j.run?.status==="completed"&&0===j.unindexedCount,size:"lg",children:[j.run&&z.includes(j.run.status)||o?(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin mr-2"}):(0,t.jsx)(p.Play,{className:"size-4 mr-2"}),j.run&&z.includes(j.run.status)?"Indexing…":o?"Starting…":j.run?.status==="completed"?`Index new documents (${j.unindexedCount})`:`Start indexing (${j.unindexedCount})`]}),j.run?.status==="completed"&&!(j.run&&z.includes(j.run.status))&&(0,t.jsxs)(A.AlertDialog,{children:[(0,t.jsx)(A.AlertDialogTrigger,{render:(0,t.jsxs)(v.Button,{variant:"outline",size:"lg",disabled:o,children:[(0,t.jsx)(f.RotateCcw,{className:"size-4 mr-2"}),"Re-Index All"]})}),(0,t.jsxs)(A.AlertDialogContent,{children:[(0,t.jsxs)(A.AlertDialogHeader,{children:[(0,t.jsx)(A.AlertDialogTitle,{children:"Are you sure you want to re-index data?"}),(0,t.jsx)(A.AlertDialogDescription,{children:"This will rebuild the entire index from scratch. All documents will be re-processed."})]}),(0,t.jsxs)(A.AlertDialogFooter,{children:[(0,t.jsx)(A.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(A.AlertDialogAction,{onClick:()=>{b(!0),_(!1)},children:"Continue"})]})]})]}),!!(j.run&&z.includes(j.run.status))&&(0,t.jsx)(v.Button,{onClick:B,disabled:o,size:"lg",variant:"destructive",children:"Cancel"})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"lg",onClick:()=>b(!1),children:"Close"})]})]})]})]})}function D({config:e,docCount:s,charCount:a}){let n=(0,b.getEmbeddingModel)(e.embeddingModelId),r=(0,j.getVectorStore)(e.vectorStore),i=[{icon:d,label:"Embedding model",value:n?.label??e.embeddingModelId,hint:n?`${n.dimensions} dims`:void 0},{icon:c.Database,label:"Vector store",value:r?.label??e.vectorStore},{icon:l,label:"Index type",value:e.indexType.toUpperCase()},{icon:g,label:"Chunking",value:`${e.chunking.chunkSize} / ${e.chunking.chunkOverlap}`,hint:"size / overlap"},{icon:u.FileText,label:"Corpus",value:`${s.toLocaleString()} docs`,hint:`${a.toLocaleString()} chars`}];return(0,t.jsxs)("div",{className:"rounded-xl border bg-card text-card-foreground p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-base font-semibold mb-4",children:[(0,t.jsx)(h.Layers,{className:"size-4 text-primary"}),"Index configuration"]}),(0,t.jsx)("dl",{className:"grid grid-cols-2 gap-x-6 gap-y-5 sm:grid-cols-3",children:i.map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(e.icon,{className:"size-3.5"}),e.label]}),(0,t.jsxs)("dd",{className:"text-sm font-medium leading-tight",children:[e.value,e.hint&&(0,t.jsx)("span",{className:"ml-1.5 font-mono text-[11px] font-normal text-muted-foreground",children:e.hint})]})]},e.label))})]})}let T={idle:{label:"Idle"},chunking:{label:"Chunking",phase:"Splitting documents into chunks"},embedding:{label:"Embedding",phase:"Generating vector embeddings"},upserting:{label:"Storing",phase:"Writing vectors to the store"},completed:{label:"Completed"},failed:{label:"Failed"}};function I({run:e,running:s}){if(!e)return(0,t.jsxs)("div",{className:"rounded-xl border bg-card text-card-foreground flex flex-col items-center justify-center gap-1 py-8 text-center",children:[(0,t.jsx)(m,{className:"mb-1 size-6 text-muted-foreground/60"}),(0,t.jsx)("p",{className:"text-sm font-medium",children:"No index built yet"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Build a Larkup index to embed your corpus and make it searchable."})]});let n=T[e.status],i=e.totalChunks>0?Math.round(e.processedChunks/e.totalChunks*100):5*!!s;return(0,t.jsxs)("div",{className:"rounded-xl border bg-card text-card-foreground p-4 space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-base font-semibold",children:["completed"===e.status?(0,t.jsx)(o.CheckCircle2,{className:"size-4 text-primary"}):"failed"===e.status?(0,t.jsx)(r.AlertTriangle,{className:"size-4 text-destructive"}):(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin text-primary"}),n.label]}),(0,t.jsx)(P,{status:e.status})]}),"failed"===e.status?(0,t.jsx)(t.Fragment,{}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:n.phase??"Done"}),(0,t.jsxs)("span",{className:"font-mono tabular-nums",children:[e.processedChunks.toLocaleString(),e.totalChunks>0&&` / ${e.totalChunks.toLocaleString()}`," chunks"]})]}),(0,t.jsx)(y.Progress,{value:i,className:"**:data-[slot=progress-indicator]:bg-green-600"})]}),(0,t.jsxs)("dl",{className:"grid grid-cols-2 gap-4 pt-1 sm:grid-cols-4",children:[(0,t.jsx)(M,{label:"Documents",value:e.docCount.toLocaleString()}),(0,t.jsx)(M,{label:"Chunks",value:e.totalChunks.toLocaleString()}),(0,t.jsx)(M,{label:"Dimensions",value:e.dimensions?e.dimensions.toLocaleString():"—"}),(0,t.jsx)(M,{label:"Duration",value:e.durationMs?`${(e.durationMs/1e3).toFixed(1)}s`:s?"running…":"—"})]})]})]})}function M({label:e,value:s}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("dt",{className:"text-xs text-muted-foreground",children:e}),(0,t.jsx)("dd",{className:"font-mono text-sm tabular-nums",children:s})]})}function P({status:e}){return"completed"===e?(0,t.jsx)(N.Badge,{className:"bg-primary/12 text-primary hover:bg-primary/12",children:"Ready"}):"failed"===e?(0,t.jsx)(N.Badge,{variant:"destructive",children:"Failed"}):z.includes(e)?(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-xs font-medium text-green-600",children:[(0,t.jsxs)("span",{className:"relative flex size-2",children:[(0,t.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-green-600 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex size-2 rounded-full bg-green-600"})]}),"Live"]}):null}let _=e=>fetch(e).then(e=>e.json()),B=["chunking","embedding","upserting"];e.s(["GlobalIndexProgress",0,function(){let{data:e}=(0,s.default)("/api/index",_,{refreshInterval:e=>e?.run&&B.includes(e.run.status)?1e3:0});if(!(e?.run&&B.includes(e.run.status))||!e?.run)return null;let{run:n}=e,r=n.totalChunks>0?Math.round(n.processedChunks/n.totalChunks*100):5;return(0,t.jsx)("div",{className:"fixed bottom-6 right-6 z-50",children:(0,t.jsx)(E,{trigger:(0,t.jsxs)("button",{className:"flex items-center gap-3 rounded-full border bg-background px-4 py-2 text-sm font-medium transition-all hover:bg-muted/50 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[(0,t.jsx)(a.Loader2,{className:"size-4 animate-spin text-primary"}),(0,t.jsxs)("div",{className:"flex flex-col items-start gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs leading-none text-muted-foreground",children:"Storing..."}),(0,t.jsxs)("span",{className:"leading-none",children:[r,"%"]})]})]})})})}],953159)},232295,e=>{"use strict";var t=e.i(199910),s=e.i(523829),a=e.i(178328),n=e.i(960198),r=e.i(133058),i=e.i(736484),l=e.i(417368),o=e.i(466691);let d="larkup-update-dismissed",c={docker:"docker compose pull && docker compose up -d",npm:"larkup update"};e.s(["UpdateBanner",0,function(){let[u,m]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),[g,b]=(0,a.useState)(!1),j="0.1.35",v="__TAURI__"in window?"desktop":"true"===t.default.env.NEXT_PUBLIC_DOCKER_ENV||"true"===t.default.env.NEXT_PUBLIC_RUNNING_IN_DOCKER?"docker":"npm";(0,a.useEffect)(()=>{if(function(){try{let e=localStorage.getItem(d);if(!e)return!1;let{timestamp:t}=JSON.parse(e);return Date.now()-t<864e5}catch{return!1}}())return;let e=new AbortController;return fetch("https://larkup.de/api/version",{signal:e.signal,cache:"no-store"}).then(e=>e.json()).then(e=>{e.version&&function(e,t){let s=e.replace(/^v/,"").split(".").map(Number),a=t.replace(/^v/,"").split(".").map(Number);for(let e=0;e<3;e++){let t=s[e]||0,n=a[e]||0;if(t>n)return 1;if(t<n)return -1}return 0}(e.version,j)>0&&(m(e.version),h(!0))}).catch(()=>{}),()=>e.abort()},[j]);let y=async()=>{if("desktop"===v){f(!0);try{let{check:t}=await e.A(963347),{relaunch:s}=await e.A(995308),a=await t();a?(await a.downloadAndInstall(),await s()):f(!1)}catch(e){console.error("Auto-update failed:",e),f(!1),window.open("https://larkup.de/download","_blank")}}else try{await navigator.clipboard.writeText(c[v]),b(!0),window.setTimeout(()=>b(!1),2e3)}catch(e){console.error("Could not copy update command:",e)}};return x&&u?(0,s.jsx)("div",{role:"status","aria-live":"polite",className:"relative z-50 border-b border-border bg-background px-3 py-2 text-foreground sm:px-4",children:(0,s.jsxs)("div",{className:"mx-auto flex min-h-7 max-w-screen-2xl items-center gap-2.5",children:[(0,s.jsx)("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background",children:(0,s.jsx)(n.ArrowUp,{className:"size-3.5","aria-hidden":"true"})}),(0,s.jsxs)("p",{className:"min-w-0 text-xs sm:text-sm",children:[(0,s.jsxs)("span",{className:"font-medium",children:["Larkup v",u," is available."]})," ",(0,s.jsxs)("span",{className:"hidden text-muted-foreground sm:inline",children:["You're using v",j,"."]})]}),"desktop"!==v&&(0,s.jsx)("code",{className:"ml-auto hidden max-w-[38rem] truncate rounded-[5px] border border-border bg-muted/40 px-2 py-1 font-mono text-[11px] text-muted-foreground lg:block",children:c[v]}),(0,s.jsx)(o.Button,{type:"button",variant:"desktop"===v?"default":"outline",size:"xs",onClick:y,disabled:p,"aria-label":"desktop"===v?"Update Larkup now":"Copy update command",className:"desktop"===v?"ml-auto":"ml-auto lg:ml-0",children:"desktop"===v?p?"Updating...":"Update now":g?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.Check,{"aria-hidden":"true"}),"Copied"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Copy,{"aria-hidden":"true"}),"Copy command"]})}),(0,s.jsx)(o.Button,{type:"button",variant:"ghost",size:"icon-xs",onClick:()=>{try{localStorage.setItem(d,JSON.stringify({timestamp:Date.now()}))}catch{}h(!1)},"aria-label":"Dismiss update notification",title:"Remind me tomorrow",children:(0,s.jsx)(l.X,{"aria-hidden":"true"})})]})}):null}])}]);
|