diff --git a/CLAUDE.md b/CLAUDE.md index 16cadd13..6d1763ea 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -37,7 +37,7 @@ This is a **Turbo monorepo** containing multiple applications and shared package The API serves as the core backend with these key features: **Key API Routes** -- `/v3/memories` - CRUD operations for documents/memories +- `/v3/documents` - CRUD operations for documents/memories - `/v3/search` - Semantic search across indexed content - `/v3/connections` - External service integrations (Google Drive, Notion, OneDrive) - `/v3/settings` - Organization and user settings @@ -116,4 +116,4 @@ All content goes through the `IngestContentWorkflow` which handles: ### Deployment - Cloudflare Workers for scalable serverless deployment - Source map uploads to Sentry for production debugging -- Environment-specific configuration management \ No newline at end of file +- Environment-specific configuration management diff --git a/apps/browser-extension/utils/api.ts b/apps/browser-extension/utils/api.ts index 7e4de310..2a4c838b 100644 --- a/apps/browser-extension/utils/api.ts +++ b/apps/browser-extension/utils/api.ts @@ -104,7 +104,7 @@ export async function setDefaultProject(project: Project): Promise { */ export async function saveMemory(payload: MemoryPayload): Promise { try { - const response = await makeAuthenticatedRequest("/v3/memories", { + const response = await makeAuthenticatedRequest("/v3/documents", { method: "POST", body: JSON.stringify(payload), }) @@ -139,7 +139,7 @@ export async function saveAllTweets( ): Promise { try { const response = await makeAuthenticatedRequest( - "/v3/memories/batch", + "/v3/documents/batch", { method: "POST", body: JSON.stringify({ diff --git a/apps/web/components/views/add-memory/index.tsx b/apps/web/components/views/add-memory/index.tsx index 74469f3b..8bd6a0f0 100644 --- a/apps/web/components/views/add-memory/index.tsx +++ b/apps/web/components/views/add-memory/index.tsx @@ -33,6 +33,7 @@ import { UploadIcon, } from "lucide-react" import { AnimatePresence, motion } from "motion/react" +import dynamic from "next/dynamic" import { useEffect, useState } from "react" import { toast } from "sonner" import { z } from "zod" @@ -43,7 +44,6 @@ import { ActionButtons } from "./action-buttons" import { MemoryUsageRing } from "./memory-usage-ring" import { ProjectSelection } from "./project-selection" import { TabButton } from "./tab-button" -import dynamic from "next/dynamic" const TextEditor = dynamic( () => import("./text-editor").then((mod) => ({ default: mod.TextEditor })), @@ -236,7 +236,7 @@ export function AddMemoryView({ const processingPromise = (async () => { // First, create the memory - const response = await $fetch("@post/memories", { + const response = await $fetch("@post/documents", { body: { content: content, containerTags: [project], @@ -262,7 +262,7 @@ export function AddMemoryView({ while (attempts < maxAttempts) { try { const memory = await $fetch<{ status: string; content: string }>( - "@get/memories/" + memoryId, + `@get/documents/${memoryId}`, ) if (memory.error) { @@ -438,7 +438,7 @@ export function AddMemoryView({ formData.append("containerTags", JSON.stringify([project])) const response = await fetch( - `${process.env.NEXT_PUBLIC_BACKEND_URL}/v3/memories/file`, + `${process.env.NEXT_PUBLIC_BACKEND_URL}/v3/documents/file`, { method: "POST", body: formData, @@ -455,7 +455,7 @@ export function AddMemoryView({ // If we have metadata, we can update the document after creation if (title || description) { - await $fetch(`@patch/memories/${data.id}`, { + await $fetch(`@patch/documents/${data.id}`, { body: { metadata: { ...(title && { title }), @@ -648,12 +648,12 @@ export function AddMemoryView({ }`} > {state.meta.errors.length > 0 && ( @@ -692,36 +692,36 @@ export function AddMemoryView({ {({ state, handleChange }) => ( setShowCreateProjectDialog(true) } - disabled={addContentMutation.isPending} - isLoading={isLoadingProjects} - id="note-project" + onProjectChange={handleChange} + projects={projects} + selectedProject={state.value} /> )} { setShowAddDialog(false) onClose?.() addContentForm.reset() }} - submitText="Add Note" submitIcon={Plus} - isSubmitting={addContentMutation.isPending} - isSubmitDisabled={!addContentForm.state.canSubmit} + submitText="Add Note" /> @@ -818,36 +818,36 @@ export function AddMemoryView({ {({ state, handleChange }) => ( setShowCreateProjectDialog(true) } - disabled={addContentMutation.isPending} - isLoading={isLoadingProjects} - id="link-project-2" + onProjectChange={handleChange} + projects={projects} + selectedProject={state.value} /> )} { setShowAddDialog(false) onClose?.() addContentForm.reset() }} - submitText="Add Link" submitIcon={Plus} - isSubmitting={addContentMutation.isPending} - isSubmitDisabled={!addContentForm.state.canSubmit} + submitText="Add Link" /> @@ -970,37 +970,37 @@ export function AddMemoryView({ {({ state, handleChange }) => ( setShowCreateProjectDialog(true) } - disabled={fileUploadMutation.isPending} - isLoading={isLoadingProjects} - id="file-project" + onProjectChange={handleChange} + projects={projects} + selectedProject={state.value} /> )} { setShowAddDialog(false) onClose?.() fileUploadForm.reset() setSelectedFiles([]) }} - submitText="Upload File" submitIcon={UploadIcon} - isSubmitting={fileUploadMutation.isPending} - isSubmitDisabled={selectedFiles.length === 0} + submitText="Upload File" /> @@ -1058,9 +1058,9 @@ export function AddMemoryView({