Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions apps/browser-extension/entrypoints/content/chatgpt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ function addSupermemoryButtonToMemoriesDialog() {

if (memoriesDialog.querySelector("#supermemory-save-button")) return


const deleteAllContainer = memoriesDialog.querySelector(
".mt-5.flex.justify-end",
".flex.items-center.gap-0\\.5",
)
if (!deleteAllContainer) return

Expand Down Expand Up @@ -267,24 +268,12 @@ async function saveMemoriesToSupermemory() {
return
}

const memoryRows = memoriesTable.querySelectorAll("tr")
const memories: string[] = []

memoryRows.forEach((row) => {
const memoryCell = row.querySelector("td .py-2.whitespace-pre-wrap")
if (memoryCell?.textContent) {
memories.push(memoryCell.textContent.trim())
}
})

console.log("Memories:", memories)

if (memories.length === 0) {
if (!memoriesTable.textContent) {
DOMUtils.showToast("error")
return
}

const combinedContent = `ChatGPT Saved Memories:\n\n${memories.map((memory, index) => `${index + 1}. ${memory}`).join("\n\n")}`
const combinedContent = `Memories from ChatGPT:\n\n${memoriesTable.textContent}`

const response = await browser.runtime.sendMessage({
action: MESSAGE_TYPES.SAVE_MEMORY,
Expand Down
2 changes: 1 addition & 1 deletion apps/browser-extension/wxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineConfig({
manifest: {
name: "supermemory",
homepage_url: "https://supermemory.ai",
version: "6.0.104",
version: "6.0.105",
permissions: ["contextMenus", "storage", "activeTab", "webRequest", "tabs"],
host_permissions: [
"*://x.com/*",
Expand Down
10 changes: 5 additions & 5 deletions apps/memory-graph-playground/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { NextConfig } from "next";
import type { NextConfig } from "next"

const nextConfig: NextConfig = {
/* config options here */
reactCompiler: true,
};
/* config options here */
reactCompiler: true,
}

export default nextConfig;
export default nextConfig
10 changes: 5 additions & 5 deletions apps/memory-graph-playground/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
};
plugins: {
"@tailwindcss/postcss": {},
},
}

export default config;
export default config
87 changes: 48 additions & 39 deletions apps/memory-graph-playground/src/app/api/graph/route.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,55 @@
import { NextResponse } from 'next/server'
import { NextResponse } from "next/server"

export async function POST(request: Request) {
try {
const body = await request.json()
const { apiKey, page = 1, limit = 500, sort = 'createdAt', order = 'desc' } = body
try {
const body = await request.json()
const {
apiKey,
page = 1,
limit = 500,
sort = "createdAt",
order = "desc",
} = body

if (!apiKey) {
return NextResponse.json(
{ error: 'API key is required' },
{ status: 400 }
)
}
if (!apiKey) {
return NextResponse.json(
{ error: "API key is required" },
{ status: 400 },
)
}

const response = await fetch('https://api.supermemory.ai/v3/documents/documents', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`,
},
body: JSON.stringify({
page,
limit,
sort,
order,
}),
})
const response = await fetch(
"https://api.supermemory.ai/v3/documents/documents",
{
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify({
page,
limit,
sort,
order,
}),
},
)

if (!response.ok) {
const errorData = await response.json().catch(() => ({}))
return NextResponse.json(
{ error: errorData.message || `API error: ${response.status}` },
{ status: response.status }
)
}
if (!response.ok) {
const errorData = await response.json().catch(() => ({}))
return NextResponse.json(
{ error: errorData.message || `API error: ${response.status}` },
{ status: response.status },
)
}

const data = await response.json()
return NextResponse.json(data)
} catch (error) {
console.error('Graph API error:', error)
return NextResponse.json(
{ error: 'Failed to fetch documents' },
{ status: 500 }
)
}
const data = await response.json()
return NextResponse.json(data)
} catch (error) {
console.error("Graph API error:", error)
return NextResponse.json(
{ error: "Failed to fetch documents" },
{ status: 500 },
)
}
}
26 changes: 13 additions & 13 deletions apps/memory-graph-playground/src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
@import "tailwindcss";

:root {
--background: #ffffff;
--foreground: #171717;
--background: #ffffff;
--foreground: #171717;
}

@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono);
--color-background: var(--background);
--color-foreground: var(--foreground);
--font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono);
}

@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}

body {
background: var(--background);
color: var(--foreground);
font-family: Arial, Helvetica, sans-serif;
background: var(--background);
color: var(--foreground);
font-family: Arial, Helvetica, sans-serif;
}
46 changes: 23 additions & 23 deletions apps/memory-graph-playground/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import type { Metadata } from "next"
import { Geist, Geist_Mono } from "next/font/google"
import "./globals.css"

const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
variable: "--font-geist-sans",
subsets: ["latin"],
})

const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
variable: "--font-geist-mono",
subsets: ["latin"],
})

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
title: "Create Next App",
description: "Generated by create next app",
}

export default function RootLayout({
children,
children,
}: Readonly<{
children: React.ReactNode;
children: React.ReactNode
}>) {
return (
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
</body>
</html>
);
return (
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
</body>
</html>
)
}
Loading
Loading