Open source file-system and knowledge based agent template. Build AI agents that stay up to date with your knowledge base
add bot installation card
Hugo Richard8cc9c4c3d639
diff --git a/apps/chat/app/app.config.ts b/apps/chat/app/app.config.tsindex 5bfbf27..a591621 100644--- a/apps/chat/app/app.config.ts+++ b/apps/chat/app/app.config.ts@@ -14,7 +14,7 @@ export default defineAppConfig({slots: {header: 'h-auto flex-col items-stretch gap-1.5 p-2',body: 'p-2 gap-1 overflow-hidden',- footer: 'p-0 h-0 min-h-0',+ footer: 'p-0',toggle: '-ms-1.5'}},diff --git a/apps/chat/app/components/InstallBotCard.vue b/apps/chat/app/components/InstallBotCard.vuenew file mode 100644index 0000000..38d28c1--- /dev/null+++ b/apps/chat/app/components/InstallBotCard.vue@@ -0,0 +1,159 @@+<script setup lang="ts">+const { loggedIn } = useUserSession()+const { dismissed, githubUrl, discordUrl, hasAny, dismiss } = useInstallBot()++const visible = computed(() => loggedIn.value && !dismissed.value && hasAny.value)++const cardRef = useTemplateRef<HTMLElement>('card')+const rotateX = ref(0)+const rotateY = ref(0)+const shineX = ref(50)+const shineY = ref(50)+const isHovering = ref(false)++function onMouseMove(e: MouseEvent) {+ const el = cardRef.value+ if (!el) return+ const rect = el.getBoundingClientRect()+ const x = (e.clientX - rect.left) / rect.width+ const y = (e.clientY - rect.top) / rect.height++ rotateX.value = (y - 0.5) * -20+ rotateY.value = (x - 0.5) * 20+ shineX.value = x * 100+ shineY.value = y * 100+}++function onMouseEnter() {+ isHovering.value = true+}++function onMouseLeave() {+ isHovering.value = false+ rotateX.value = 0+ rotateY.value = 0+ shineX.value = 50+ shineY.value = 50+}+</script>++<template>+ <Transition+ enter-active-class="transition-all duration-300 ease-out"+ enter-from-class="opacity-0 translate-y-2"+ leave-active-class="transition-all duration-200 ease-in"+ leave-to-class="opacity-0 translate-y-2"+ >+ <div+ v-if="visible"+ class="m-2"+ style="perspective: 800px"+ >+ <div+ ref="card"+ class="holo-border rounded-xl p-px relative cursor-default"+ :style="{+ transform: `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`,+ transition: isHovering ? 'transform 0.1s ease-out' : 'transform 0.4s ease-out',+ }"+ @mousemove="onMouseMove"+ @mouseenter="onMouseEnter"+ @mouseleave="onMouseLeave"+ >+ <!-- Animated border glow -->+ <div+ class="holo-border-shine"+ :style="{+ opacity: isHovering ? 1 : 0.3,+ background: `radial-gradient(circle at ${shineX}% ${shineY}%, white 0%, oklch(90% 0 0 / 0.5) 30%, transparent 70%)`,+ }"+ />++ <!-- Inner card -->+ <div class="holo-inner p-3 relative overflow-hidden">+ <!-- Surface shine -->+ <div+ class="holo-shine"+ :style="{+ opacity: isHovering ? 1 : 0,+ background: `radial-gradient(circle at ${shineX}% ${shineY}%, oklch(100% 0 0 / 0.12) 0%, oklch(95% 0 0 / 0.06) 35%, transparent 70%)`,+ }"+ />++ <div class="relative">+ <div class="flex items-center justify-between mb-1.5">+ <p class="text-xs font-medium text-highlighted leading-tight">+ Install our bots+ </p>+ <button+ class="shrink-0 text-dimmed hover:text-highlighted transition-colors p-0.5"+ @click="dismiss"+ >+ <UIcon name="i-lucide-x" class="size-3.5" />+ </button>+ </div>++ <p class="text-[11px] text-muted leading-snug mb-2.5">+ Get AI answers on your favorite platforms.+ </p>++ <div class="flex items-center gap-1.5">+ <UButton+ v-if="githubUrl"+ label="GitHub"+ icon="i-simple-icons-github"+ size="xs"+ variant="outline"+ color="neutral"+ :to="githubUrl"+ target="_blank"+ />+ <UButton+ v-if="discordUrl"+ label="Discord"+ icon="i-simple-icons-discord"+ size="xs"+ variant="outline"+ color="neutral"+ :to="discordUrl"+ target="_blank"+ />+ </div>+ </div>+ </div>+ </div>+ </div>+ </Transition>+</template>++<style scoped>+.holo-border {+ background: oklch(30% 0 0 / 0.6);+ transform-style: preserve-3d;+ will-change: transform;+}++.holo-border-shine {+ position: absolute;+ inset: 0;+ border-radius: inherit;+ pointer-events: none;+ transition: opacity 0.4s ease;+ z-index: 0;+}++.holo-inner {+ background: var(--ui-bg-elevated);+ border-radius: calc(var(--radius-xl, 0.75rem) - 1px);+ position: relative;+ z-index: 1;+}++.holo-shine {+ position: absolute;+ inset: 0;+ pointer-events: none;+ transition: opacity 0.3s ease;+ z-index: 2;+}+</style>diff --git a/apps/chat/app/composables/useInstallBot.ts b/apps/chat/app/composables/useInstallBot.tsnew file mode 100644index 0000000..37b67eb--- /dev/null+++ b/apps/chat/app/composables/useInstallBot.ts@@ -0,0 +1,37 @@+const DISMISS_KEY = 'savoir:install-bot-dismissed'++const dismissed = ref(true)+let initialized = false++export function useInstallBot() {+ const config = useRuntimeConfig()++ if (import.meta.client && !initialized) {+ dismissed.value = localStorage.getItem(DISMISS_KEY) === '1'+ initialized = true+ }++ const githubUrl = computed(() => {+ const slug = config.public.github.appSlug+ if (!slug) return null+ return `https://github.com/apps/${slug}/installations/new`+ })++ const discordUrl = computed(() => {+ return config.public.discordBotUrl || null+ })++ const hasAny = computed(() => !!githubUrl.value || !!discordUrl.value)++ function dismiss() {+ dismissed.value = true+ localStorage.setItem(DISMISS_KEY, '1')+ }++ function resetDismiss() {+ dismissed.value = false+ localStorage.removeItem(DISMISS_KEY)+ }++ return { dismissed, githubUrl, discordUrl, hasAny, dismiss, resetDismiss }+}diff --git a/apps/chat/app/layouts/default.vue b/apps/chat/app/layouts/default.vueindex 162d2ab..f2ab07c 100644--- a/apps/chat/app/layouts/default.vue+++ b/apps/chat/app/layouts/default.vue@@ -335,7 +335,9 @@ defineShortcuts({</template></template>- <template #footer />+ <template #footer="{ collapsed }">+ <InstallBotCard v-if="!collapsed && !isAdminRoute" />+ </template></UDashboardSidebar><UDashboardSearchdiff --git a/apps/chat/app/pages/settings/index.vue b/apps/chat/app/pages/settings/index.vueindex d1ba370..760ce3e 100644--- a/apps/chat/app/pages/settings/index.vue+++ b/apps/chat/app/pages/settings/index.vue@@ -108,6 +108,8 @@ async function revokeOtherSessions() {}}+const { dismissed: botDismissed, githubUrl: botGithubUrl, discordUrl: botDiscordUrl, hasAny: hasAnyBot, resetDismiss: resetBotDismiss } = useInstallBot()+const deleteAccountModal = overlay.create(LazyModalConfirm, {props: {title: 'Delete account',@@ -317,6 +319,66 @@ async function deleteAccount() {</div></section>+ <section v-if="hasAnyBot">+ <h2 class="text-[10px] text-muted uppercase tracking-wide mb-3 font-pixel">+ Integrations+ </h2>+ <div class="rounded-lg border border-default divide-y divide-default">+ <div v-if="botGithubUrl" class="flex items-center justify-between gap-4 px-4 py-3">+ <div class="flex items-center gap-3">+ <UIcon name="i-simple-icons-github" class="size-5 text-highlighted" />+ <div>+ <p class="text-sm text-highlighted">+ GitHub Bot+ </p>+ <p class="text-xs text-muted">+ Get AI answers directly on your GitHub issues and PRs.+ </p>+ </div>+ </div>+ <UButton+ label="Install"+ icon="i-lucide-arrow-up-right"+ trailing+ size="xs"+ :to="botGithubUrl"+ target="_blank"+ />+ </div>+ <div v-if="botDiscordUrl" class="flex items-center justify-between gap-4 px-4 py-3">+ <div class="flex items-center gap-3">+ <UIcon name="i-simple-icons-discord" class="size-5 text-highlighted" />+ <div>+ <p class="text-sm text-highlighted">+ Discord Bot+ </p>+ <p class="text-xs text-muted">+ Add AI answers to your Discord server.+ </p>+ </div>+ </div>+ <UButton+ label="Install"+ icon="i-lucide-arrow-up-right"+ trailing+ size="xs"+ :to="botDiscordUrl"+ target="_blank"+ />+ </div>+ <div v-if="botDismissed" class="px-4 py-3">+ <UButton+ label="Show sidebar suggestion"+ color="neutral"+ variant="ghost"+ size="xs"+ icon="i-lucide-eye"+ @click="resetBotDismiss"+ />+ </div>+ </div>+ </section>+<section><h2 class="text-[10px] text-muted uppercase tracking-wide mb-3 font-pixel">Developerdiff --git a/apps/chat/nuxt.config.ts b/apps/chat/nuxt.config.tsindex f5163e5..058b7b7 100644--- a/apps/chat/nuxt.config.ts+++ b/apps/chat/nuxt.config.ts@@ -120,7 +120,9 @@ export default defineNuxtConfig({siteUrl: '',github: {botTrigger: '',+ appSlug: '',},+ discordBotUrl: '',},}})diff --git a/bun.lock b/bun.lockindex b1088e4..9b75a59 100644--- a/bun.lock+++ b/bun.lock@@ -1831,7 +1831,7 @@"commander": ["[email protected]", "", {}, "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA=="],- "comment-parser": ["[email protected]", "", {}, "sha512-aRDkn3uyIlCFfk5NUA+VdwMmMsh8JGhc4hapfV4yxymHGQ3BVskMQfoXGpCo5IoBuQ9tS5iiVKhCpTcB4pW4qw=="],+ "comment-parser": ["[email protected]", "", {}, "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg=="],"commondir": ["[email protected]", "", {}, "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg=="],@@ -3951,8 +3951,6 @@"@better-auth/cli/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="],- "@better-auth/core/@standard-schema/spec": ["@standard-schema/[email protected]", "", {}, "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA=="],-"@better-auth/drizzle-adapter/@better-auth/core": ["@better-auth/[email protected]", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "zod": "^4.3.6" }, "peerDependencies": { "@better-auth/utils": "0.3.1", "@better-fetch/fetch": "1.1.21", "better-call": "1.2.1", "jose": "^6.1.0", "kysely": "^0.28.5", "nanostores": "^1.0.1" } }, "sha512-oOK1O3bwfzebK5W4iIYOdB+IBLk+RLWfOm/MU6dMq4l1HNWvi5iZ75lxxk7Sgx0MfaeEn1C+lXIHplDyeeZKhQ=="],"@better-auth/kysely-adapter/@better-auth/core": ["@better-auth/[email protected]", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "zod": "^4.3.6" }, "peerDependencies": { "@better-auth/utils": "0.3.1", "@better-fetch/fetch": "1.1.21", "better-call": "1.2.1", "jose": "^6.1.0", "kysely": "^0.28.5", "nanostores": "^1.0.1" } }, "sha512-oOK1O3bwfzebK5W4iIYOdB+IBLk+RLWfOm/MU6dMq4l1HNWvi5iZ75lxxk7Sgx0MfaeEn1C+lXIHplDyeeZKhQ=="],@@ -3987,8 +3985,6 @@"@emotion/babel-plugin/source-map": ["[email protected]", "", {}, "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ=="],- "@es-joy/jsdoccomment/comment-parser": ["[email protected]", "", {}, "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg=="],-"@esbuild-kit/core-utils/esbuild": ["[email protected]", "", { "optionalDependencies": { "@esbuild/android-arm": "0.18.20", "@esbuild/android-arm64": "0.18.20", "@esbuild/android-x64": "0.18.20", "@esbuild/darwin-arm64": "0.18.20", "@esbuild/darwin-x64": "0.18.20", "@esbuild/freebsd-arm64": "0.18.20", "@esbuild/freebsd-x64": "0.18.20", "@esbuild/linux-arm": "0.18.20", "@esbuild/linux-arm64": "0.18.20", "@esbuild/linux-ia32": "0.18.20", "@esbuild/linux-loong64": "0.18.20", "@esbuild/linux-mips64el": "0.18.20", "@esbuild/linux-ppc64": "0.18.20", "@esbuild/linux-riscv64": "0.18.20", "@esbuild/linux-s390x": "0.18.20", "@esbuild/linux-x64": "0.18.20", "@esbuild/netbsd-x64": "0.18.20", "@esbuild/openbsd-x64": "0.18.20", "@esbuild/sunos-x64": "0.18.20", "@esbuild/win32-arm64": "0.18.20", "@esbuild/win32-ia32": "0.18.20", "@esbuild/win32-x64": "0.18.20" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA=="],"@eslint-community/eslint-utils/eslint-visitor-keys": ["[email protected]", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="],@@ -4181,7 +4177,7 @@"@vercel/nft/resolve-from": ["[email protected]", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="],- "@vercel/queue/@vercel/oidc": ["@vercel/[email protected]", "", {}, "sha512-fnYhv671l+eTTp48gB4zEsTW/YtRgRPnkI2nT7x6qw5rkI1Lq2hTmQIpHPgyThI0znLK+vX2n9XxKdXZ7BUbbw=="],+ "@vercel/queue/@vercel/oidc": ["@vercel/[email protected]", "", {}, "sha512-UycprH3T6n3jH0k44NHMa7pnFHGu/N05MjojYr+Mc6I7obkoLIJujSWwin1pCvdy/eOxrI/l3uDLQsmcrOb4ug=="],"@vercel/queue/mixpart": ["[email protected]", "", {}, "sha512-2ZfG/NO2SVE9HLk1/W+yOrIOA0d674ljZExLdievZQpYjbJYQjIdye8vNMR63yF7nN/NbO9q8mp16JUEYBCilg=="],@@ -4193,8 +4189,6 @@"@vitejs/plugin-vue/@rolldown/pluginutils": ["@rolldown/[email protected]", "", {}, "sha512-izyXV/v+cHiRfozX62W9htOAvwMo4/bXKDrQ+vom1L1qRuexPock/7VZDAhnpHCLNejd3NJ6hiab+tO0D44Rgw=="],- "@vitejs/plugin-vue-jsx/@rolldown/pluginutils": ["@rolldown/[email protected]", "", {}, "sha512-1BrrmTu0TWfOP1riA8uakjFc9bpIUGzVKETsOtzY39pPga8zELGDl8eu1Dx7/gjM5CAz14UknsUMpBO8L+YntQ=="],-"@vue-macros/common/ast-kit": ["[email protected]", "", { "dependencies": { "@babel/parser": "^7.28.5", "pathe": "^2.0.3" } }, "sha512-m1Q/RaVOnTp9JxPX+F+Zn7IcLYMzM8kZofDImfsKZd8MbR+ikdOzTeztStWqfrqIxZnYWryyI9ePm3NGjnZgGw=="],"@vue/babel-plugin-jsx/@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A=="],@@ -4347,8 +4341,6 @@"eslint-plugin-import-x/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="],- "eslint-plugin-jsdoc/comment-parser": ["[email protected]", "", {}, "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg=="],-"eslint-plugin-jsdoc/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="],"eslint-plugin-package-json/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="],@@ -4489,6 +4481,8 @@"semver-truncate/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="],+ "sharp/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="],+"sort-keys/is-plain-obj": ["[email protected]", "", {}, "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg=="],"sort-package-json/detect-indent": ["[email protected]", "", {}, "sha512-y+8xyqdGLL+6sh0tVeHcfP/QDd8gUgbasolJJpY7NgeQGSZ739bDtSiaiDgtoicy+mtYB81dKLxO9xRhCyIB3A=="],