From f58aa9f97317e71b1dc4136c1667d7470eefd128 Mon Sep 17 00:00:00 2001 From: govind-superu Date: Tue, 2 Jul 2024 17:34:38 +0530 Subject: [PATCH 1/8] fixed link --- apps/web/app/(landing)/Cta.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/app/(landing)/Cta.tsx b/apps/web/app/(landing)/Cta.tsx index 95040ddf..55a2baf0 100644 --- a/apps/web/app/(landing)/Cta.tsx +++ b/apps/web/app/(landing)/Cta.tsx @@ -36,7 +36,7 @@ function Cta() {
Sign in
From 83ca8e9f6520b1a4898f546a383d27276dce09f9 Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Tue, 2 Jul 2024 15:42:44 -0500 Subject: [PATCH 2/8] slice the tweet text to prevent issues --- apps/extension/background.ts | 2 +- apps/web/app/actions/doers.ts | 2 +- apps/web/migrations/0000_setup.sql | 133 +++++++++++++++++++++++++++++ 3 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 apps/web/migrations/0000_setup.sql diff --git a/apps/extension/background.ts b/apps/extension/background.ts index 56a1a26c..1102b764 100644 --- a/apps/extension/background.ts +++ b/apps/extension/background.ts @@ -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) => { diff --git a/apps/web/app/actions/doers.ts b/apps/web/app/actions/doers.ts index 82263f6e..280ee244 100644 --- a/apps/web/app/actions/doers.ts +++ b/apps/web/app/actions/doers.ts @@ -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}`, }; diff --git a/apps/web/migrations/0000_setup.sql b/apps/web/migrations/0000_setup.sql new file mode 100644 index 00000000..65a41795 --- /dev/null +++ b/apps/web/migrations/0000_setup.sql @@ -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`); \ No newline at end of file From 4c871e8dda0063ef1de7aec0851dd029c4bd5421 Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Tue, 2 Jul 2024 16:12:47 -0500 Subject: [PATCH 3/8] fix ci/cd --- apps/web/app/(dash)/chat/chatWindow.tsx | 4 ++-- package.json | 2 +- packages/tailwind-config/globals.css | 19 ------------------- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/apps/web/app/(dash)/chat/chatWindow.tsx b/apps/web/app/(dash)/chat/chatWindow.tsx index 7cdf7bbb..1d54e912 100644 --- a/apps/web/app/(dash)/chat/chatWindow.tsx +++ b/apps/web/app/(dash)/chat/chatWindow.tsx @@ -207,7 +207,7 @@ function ChatWindow({ ) : (
@@ -242,7 +242,7 @@ function ChatWindow({ {/* TODO: fade out content on the right side, the fade goes away when the user scrolls */} {/* Loading state */} diff --git a/package.json b/package.json index 79b1f113..586601fc 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "engines": { "node": ">=18" }, - "packageManager": "bun@1.1.0", + "packageManager": "yarn@1.22.21", "workspaces": [ "apps/*", "packages/*" diff --git a/packages/tailwind-config/globals.css b/packages/tailwind-config/globals.css index 0b12258c..d4f994ed 100644 --- a/packages/tailwind-config/globals.css +++ b/packages/tailwind-config/globals.css @@ -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.) */ From bb3517939d4afaf4542e168d933d060a587f2645 Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Tue, 2 Jul 2024 16:15:02 -0500 Subject: [PATCH 4/8] try to fix ci/cd again --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 586601fc..64795c25 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "@cloudflare/next-on-pages": "1", "@cloudflare/workers-types": "^4.20240614.0", "@repo/eslint-config": "*", - "@repo/shared-types": "*", "@repo/tailwind-config": "*", "@repo/typescript-config": "*", "@repo/ui": "*", @@ -35,7 +34,7 @@ "engines": { "node": ">=18" }, - "packageManager": "yarn@1.22.21", + "packageManager": "bun@1.1.0", "workspaces": [ "apps/*", "packages/*" From a76773b5eb8d278cff344fd08f647c5526175a7f Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Tue, 2 Jul 2024 16:16:28 -0500 Subject: [PATCH 5/8] try to fix ci/cd --- apps/web/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/package.json b/apps/web/package.json index 44522dcc..56437059 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -36,7 +36,6 @@ "@repo/eslint-config": "*", "@repo/typescript-config": "*", "@repo/tailwind-config": "*", - "@repo/shared-types": "*", "@types/eslint": "^8.56.5", "@types/node": "^20.11.24", "@types/react": "^18.2.61", From 3fc129b2c570c1687ab7493c0c6329c4ea36cc54 Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Tue, 2 Jul 2024 16:17:01 -0500 Subject: [PATCH 6/8] attempt to fix ci/cd again --- apps/web/package.json | 1 + packages/shared-types/package.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/package.json b/apps/web/package.json index 56437059..44522dcc 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -36,6 +36,7 @@ "@repo/eslint-config": "*", "@repo/typescript-config": "*", "@repo/tailwind-config": "*", + "@repo/shared-types": "*", "@types/eslint": "^8.56.5", "@types/node": "^20.11.24", "@types/react": "^18.2.61", diff --git a/packages/shared-types/package.json b/packages/shared-types/package.json index 18e6049e..4cd1f0be 100644 --- a/packages/shared-types/package.json +++ b/packages/shared-types/package.json @@ -1,3 +1,4 @@ { - "name": "@repo/shared-types" + "name": "@repo/shared-types", + "version": "0.0.1" } From a1f356548fb2815714befa06f18ac18148dde379 Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Tue, 2 Jul 2024 16:24:30 -0500 Subject: [PATCH 7/8] add sharedtypes back to package.json --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 64795c25..79b1f113 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@cloudflare/next-on-pages": "1", "@cloudflare/workers-types": "^4.20240614.0", "@repo/eslint-config": "*", + "@repo/shared-types": "*", "@repo/tailwind-config": "*", "@repo/typescript-config": "*", "@repo/ui": "*", From 31bc48fa4f73fd12e7af09162088c87c5b99c1a9 Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Tue, 2 Jul 2024 16:39:47 -0500 Subject: [PATCH 8/8] attempt to make the add modal more accessible --- apps/cf-ai-backend/src/index.ts | 2 +- apps/web/app/(dash)/menu.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/cf-ai-backend/src/index.ts b/apps/cf-ai-backend/src/index.ts index 2c756dcc..31ee520f 100644 --- a/apps/cf-ai-backend/src/index.ts +++ b/apps/cf-ai-backend/src/index.ts @@ -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, }), diff --git a/apps/web/app/(dash)/menu.tsx b/apps/web/app/(dash)/menu.tsx index b72efce1..11738391 100644 --- a/apps/web/app/(dash)/menu.tsx +++ b/apps/web/app/(dash)/menu.tsx @@ -178,7 +178,7 @@ function Menu() {
- +
{ const content = e.get("content")?.toString();