mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-06 02:47:54 +00:00
Merge branch 'main' of https://github.com/Dhravya/supermemory
This commit is contained in:
commit
3125f7490e
9 changed files with 142 additions and 27 deletions
|
|
@ -203,7 +203,7 @@ app.get(
|
|||
|
||||
const preparedContext = normalizedData.map(
|
||||
({ metadata, score, normalizedScore }) => ({
|
||||
context: `Website title: ${metadata!.title}\nDescription: ${metadata!.description}\nURL: ${metadata!.url}\nContent: ${metadata!.text}`,
|
||||
context: `Title: ${metadata!.title}\nDescription: ${metadata!.description}\nURL: ${metadata!.url}\nContent: ${metadata!.text}`,
|
||||
score,
|
||||
normalizedScore,
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ const batchImportAll = async (cursor = "", totalImported = 0) => {
|
|||
pageContent: tweetMd,
|
||||
url: `https://twitter.com/supermemoryai/status/${tweet.id_str}`,
|
||||
title: `Tweet by ${tweet.user.name}`,
|
||||
description: tweet.text.slice(0, 100),
|
||||
description: tweet.text.slice(0, 200),
|
||||
type: "tweet",
|
||||
}),
|
||||
}).then((ers) => {
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ function ChatWindow({
|
|||
</motion.div>
|
||||
) : (
|
||||
<div
|
||||
className="max-w-3xl z-10 mx-auto relative h-full overflow-y-auto no-scrollbar"
|
||||
className="max-w-3xl z-10 mx-auto relative h-full overflow-y-auto"
|
||||
key="chat"
|
||||
>
|
||||
<div className="w-full pt-24 mb-40 px-4 md:px-0">
|
||||
|
|
@ -242,7 +242,7 @@ function ChatWindow({
|
|||
</AccordionTrigger>
|
||||
{/* TODO: fade out content on the right side, the fade goes away when the user scrolls */}
|
||||
<AccordionContent
|
||||
className="flex items-center no-scrollbar overflow-auto gap-4 relative max-w-3xl no-scrollbar"
|
||||
className="flex items-center overflow-auto gap-4 relative max-w-3xl no-scrollbar"
|
||||
defaultChecked
|
||||
>
|
||||
{/* Loading state */}
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ function Menu() {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<DialogContent className="sm:max-w-[425px] rounded-2xl bg-[#161f2a]/40 backdrop-blur-md">
|
||||
<DialogContent className="sm:max-w-[425px] rounded-2xl bg-background z-[39] backdrop-blur-md">
|
||||
<form
|
||||
action={async (e: FormData) => {
|
||||
const content = e.get("content")?.toString();
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ function Cta() {
|
|||
<div className="w-full lg:w-3/4 mx-auto">
|
||||
<Link
|
||||
href="/signin"
|
||||
className="inline-flex gap-x-2 justify-start items-start py-3 px-5 ml-3 w-full rounded-3xl border duration-200 sm:w-auto group bg-page-gradient border-white/30 text-md font-geistSans hover:border-zinc-600 hover:bg-transparent/10 hover:text-zinc-100 text-white"
|
||||
className="inline-flex gap-x-2 justify-start items-start py-3 px-5 ml-3 w-full rounded-3xl border duration-200 sm:w-auto group bg-page-gradient border-white/30 text-md font-geistSans hover:border-zinc-600 hover:bg-transparent/10 hover:text-zinc-100 text-white z-[1] relative"
|
||||
>
|
||||
Sign in
|
||||
<div className="flex overflow-hidden relative justify-center items-center ml-1 w-5 h-5">
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ export const createMemory = async (input: {
|
|||
pageContent = tweetToMd(tweet);
|
||||
metadata = {
|
||||
baseUrl: input.content,
|
||||
description: tweet.text,
|
||||
description: tweet.text.slice(0, 200),
|
||||
image: tweet.user.profile_image_url_https,
|
||||
title: `Tweet by ${tweet.user.name}`,
|
||||
};
|
||||
|
|
|
|||
133
apps/web/migrations/0000_setup.sql
Normal file
133
apps/web/migrations/0000_setup.sql
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
CREATE TABLE `account` (
|
||||
`userId` text NOT NULL,
|
||||
`type` text NOT NULL,
|
||||
`provider` text NOT NULL,
|
||||
`providerAccountId` text NOT NULL,
|
||||
`refresh_token` text,
|
||||
`access_token` text,
|
||||
`expires_at` integer,
|
||||
`token_type` text,
|
||||
`scope` text,
|
||||
`id_token` text,
|
||||
`session_state` text,
|
||||
PRIMARY KEY(`provider`, `providerAccountId`),
|
||||
FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `authenticator` (
|
||||
`credentialID` text NOT NULL,
|
||||
`userId` text NOT NULL,
|
||||
`providerAccountId` text NOT NULL,
|
||||
`credentialPublicKey` text NOT NULL,
|
||||
`counter` integer NOT NULL,
|
||||
`credentialDeviceType` text NOT NULL,
|
||||
`credentialBackedUp` integer NOT NULL,
|
||||
`transports` text,
|
||||
PRIMARY KEY(`credentialID`, `userId`),
|
||||
FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `canvas` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`title` text DEFAULT 'Untitled' NOT NULL,
|
||||
`description` text DEFAULT 'Untitled' NOT NULL,
|
||||
`url` text DEFAULT '' NOT NULL,
|
||||
`userId` text NOT NULL,
|
||||
FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `chatHistory` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`threadId` text NOT NULL,
|
||||
`question` text NOT NULL,
|
||||
`answerParts` text,
|
||||
`answerSources` text,
|
||||
`answerJustification` text,
|
||||
FOREIGN KEY (`threadId`) REFERENCES `chatThread`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `chatThread` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`firstMessage` text NOT NULL,
|
||||
`userId` text NOT NULL,
|
||||
FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `contentToSpace` (
|
||||
`contentId` integer NOT NULL,
|
||||
`spaceId` integer NOT NULL,
|
||||
PRIMARY KEY(`contentId`, `spaceId`),
|
||||
FOREIGN KEY (`contentId`) REFERENCES `storedContent`(`id`) ON UPDATE no action ON DELETE cascade,
|
||||
FOREIGN KEY (`spaceId`) REFERENCES `space`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `session` (
|
||||
`sessionToken` text PRIMARY KEY NOT NULL,
|
||||
`userId` text NOT NULL,
|
||||
`expires` integer NOT NULL,
|
||||
FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `space` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`name` text DEFAULT 'none' NOT NULL,
|
||||
`user` text(255),
|
||||
`createdAt` integer NOT NULL,
|
||||
`numItems` integer DEFAULT 0 NOT NULL,
|
||||
FOREIGN KEY (`user`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `spacesAccess` (
|
||||
`spaceId` integer NOT NULL,
|
||||
`userEmail` text NOT NULL,
|
||||
PRIMARY KEY(`spaceId`, `userEmail`),
|
||||
FOREIGN KEY (`spaceId`) REFERENCES `space`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `storedContent` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`content` text NOT NULL,
|
||||
`title` text(255),
|
||||
`description` text(255),
|
||||
`url` text NOT NULL,
|
||||
`savedAt` integer NOT NULL,
|
||||
`baseUrl` text(255),
|
||||
`ogImage` text(255),
|
||||
`type` text DEFAULT 'page',
|
||||
`image` text(255),
|
||||
`user` text,
|
||||
`noteId` integer,
|
||||
FOREIGN KEY (`user`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `user` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`name` text,
|
||||
`email` text NOT NULL,
|
||||
`emailVerified` integer,
|
||||
`image` text,
|
||||
`telegramId` text
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `verificationToken` (
|
||||
`identifier` text NOT NULL,
|
||||
`token` text NOT NULL,
|
||||
`expires` integer NOT NULL,
|
||||
PRIMARY KEY(`identifier`, `token`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `authenticator_credentialID_unique` ON `authenticator` (`credentialID`);--> statement-breakpoint
|
||||
CREATE INDEX `canvas_user_userId` ON `canvas` (`userId`);--> statement-breakpoint
|
||||
CREATE INDEX `chatHistory_thread_idx` ON `chatHistory` (`threadId`);--> statement-breakpoint
|
||||
CREATE INDEX `chatThread_user_idx` ON `chatThread` (`userId`);--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `space_name_unique` ON `space` (`name`);--> statement-breakpoint
|
||||
CREATE INDEX `spaces_name_idx` ON `space` (`name`);--> statement-breakpoint
|
||||
CREATE INDEX `spaces_user_idx` ON `space` (`user`);--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `storedContent_baseUrl_unique` ON `storedContent` (`baseUrl`);--> statement-breakpoint
|
||||
CREATE INDEX `storedContent_url_idx` ON `storedContent` (`url`);--> statement-breakpoint
|
||||
CREATE INDEX `storedContent_savedAt_idx` ON `storedContent` (`savedAt`);--> statement-breakpoint
|
||||
CREATE INDEX `storedContent_title_idx` ON `storedContent` (`title`);--> statement-breakpoint
|
||||
CREATE INDEX `storedContent_user_idx` ON `storedContent` (`user`);--> statement-breakpoint
|
||||
CREATE INDEX `users_email_idx` ON `user` (`email`);--> statement-breakpoint
|
||||
CREATE INDEX `users_telegram_idx` ON `user` (`telegramId`);--> statement-breakpoint
|
||||
CREATE INDEX `users_id_idx` ON `user` (`id`);
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"name": "@repo/shared-types"
|
||||
"name": "@repo/shared-types",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,25 +127,6 @@ body {
|
|||
);
|
||||
}
|
||||
|
||||
/* width */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
/* Track */
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Handle */
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #131f2c;
|
||||
}
|
||||
|
||||
/* Handle on hover */
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #22303d;
|
||||
}
|
||||
|
||||
.no-scrollbar {
|
||||
/* For WebKit (Safari, Chrome, etc.) */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue