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
2 changes: 1 addition & 1 deletion apps/mcp/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export class SupermemoryClient {
async getDocuments(
containerTags?: string[],
page = 1,
limit = 200,
limit = 10,
): Promise<DocumentsApiResponse> {
try {
const response = await fetch(`${this.apiUrl}/v3/documents/documents`, {
Expand Down
4 changes: 2 additions & 2 deletions apps/mcp/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export class SupermemoryMCP extends McpAgent<Env, unknown, Props> {
? [effectiveContainerTag]
: undefined

const result = await client.getDocuments(containerTags, 1, 200)
const result = await client.getDocuments(containerTags, 1, 10)

const memoryCount = result.documents.reduce(
(sum, d) => sum + d.memoryEntries.length,
Expand Down Expand Up @@ -366,7 +366,7 @@ export class SupermemoryMCP extends McpAgent<Env, unknown, Props> {
inputSchema: z.object({
containerTag: z.string().optional(),
page: z.number().optional().default(1),
limit: z.number().optional().default(200),
limit: z.number().optional().default(10),
}),
_meta: {
ui: {
Expand Down
10 changes: 8 additions & 2 deletions apps/web/app/(app)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ export default function NewPage() {
const [fullscreenInitialContent, setFullscreenInitialContent] = useState("")
const [queuedChatSeed, setQueuedChatSeed] = useState<string | null>(null)
const [queuedChatModel, setQueuedChatModel] = useState<ModelId | null>(null)
const [queuedChatProject, setQueuedChatProject] = useState<string | null>(
null,
)
const [queuedHighlightContent, setQueuedHighlightContent] = useState<
string | null
>(null)
Expand Down Expand Up @@ -473,17 +476,19 @@ export default function NewPage() {
setQueuedHighlightContent(highlightContent)
setQueuedChatSeed(userReply)
setQueuedChatModel(null)
setQueuedChatProject(null)
setQueuedMessageSource("highlight")
void setViewMode("chat")
},
[setViewMode],
)

const handleHomeChatStart = useCallback(
(message: string, model: ModelId) => {
(message: string, model: ModelId, projectId: string) => {
setQueuedHighlightContent(null)
setQueuedChatSeed(message)
setQueuedChatModel(model)
setQueuedChatProject(projectId)
setQueuedMessageSource("home")
void setViewMode("chat")
},
Expand All @@ -493,6 +498,7 @@ export default function NewPage() {
const consumeQueuedChat = useCallback(() => {
setQueuedChatSeed(null)
setQueuedChatModel(null)
setQueuedChatProject(null)
setQueuedHighlightContent(null)
setQueuedMessageSource("highlight")
}, [])
Expand Down Expand Up @@ -608,7 +614,7 @@ export default function NewPage() {
onConsumeQueuedMessage={consumeQueuedChat}
queuedMessageSource={queuedMessageSource}
initialSelectedModel={queuedChatModel}
emptyStateSuggestions={highlightsData?.questions}
initialChatProject={queuedChatProject}
/>
</div>
) : viewMode === "integrations" ? (
Expand Down
8 changes: 7 additions & 1 deletion apps/web/components/chat/chat-graph-context-rail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ import { dmSansClassName } from "@/lib/fonts"

export function ChatGraphContextRail({
messages,
containerTags,
className,
}: {
messages: UIMessage[]
containerTags?: string[] | null
className?: string
}) {
const { effectiveContainerTags } = useProject()
const graphContainerTags =
containerTags === undefined
? effectiveContainerTags
: (containerTags ?? undefined)
const highlightIds = useMemo(
() => extractHighlightDocumentIdsFromMessages(messages),
[messages],
Expand Down Expand Up @@ -45,7 +51,7 @@ export function ChatGraphContextRail({
<div className="pointer-events-none absolute inset-y-0 right-0 z-10 w-24 bg-gradient-to-r from-transparent to-[#05080D]" />
<div className="relative z-[2] min-h-0 flex-1 pt-10">
<MemoryGraph
containerTags={effectiveContainerTags}
containerTags={graphContainerTags}
variant="consumer"
highlightDocumentIds={highlightIds}
highlightsVisible={highlightIds.length > 0}
Expand Down
44 changes: 16 additions & 28 deletions apps/web/components/chat/home-chat-composer.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
"use client"

import { useCallback, useMemo, useState } from "react"
import { useCallback, useState } from "react"
import ChatInput from "./input"
import ChatModelSelector from "./model-selector"
import { getChatSpaceDisplayLabel } from "@/lib/chat-space-label"
import { useProject } from "@/stores"
import { useContainerTags } from "@/hooks/use-container-tags"
import { dmSansClassName } from "@/lib/fonts"
import { cn } from "@lib/utils"
import type { ModelId } from "@/lib/models"
import { SpaceSelector } from "@/components/space-selector"

export function HomeChatComposer({
onStartChat,
className,
}: {
onStartChat: (message: string, model: ModelId) => void
onStartChat: (message: string, model: ModelId, projectId: string) => void
className?: string
}) {
const [input, setInput] = useState("")
const [selectedModel, setSelectedModel] = useState<ModelId>("gemini-2.5-pro")
const { selectedProject } = useProject()
const { allProjects } = useContainerTags()
const chatSpaceLabel = useMemo(
() =>
getChatSpaceDisplayLabel({
selectedProject,
allProjects,
}),
[selectedProject, allProjects],
)
const [chatSpaceProjects, setChatSpaceProjects] = useState<string[]>([
selectedProject,
])

const send = useCallback(() => {
const t = input.trim()
if (!t) return
onStartChat(t, selectedModel)
onStartChat(t, selectedModel, chatSpaceProjects[0] ?? selectedProject)
setInput("")
}, [input, onStartChat, selectedModel])
}, [chatSpaceProjects, input, onStartChat, selectedModel, selectedProject])

const handleKeyDown = (e: React.KeyboardEvent) => {
if (e.key === "Enter" && !e.shiftKey) {
Expand All @@ -46,7 +38,7 @@ export function HomeChatComposer({

return (
<div className={cn(className)}>
<div className="mx-auto w-full max-w-[720px] px-4 pt-1 pb-3 md:pb-4">
<div className="mx-auto w-full max-w-[720px] px-4 pt-1 pb-[max(1.25rem,calc(env(safe-area-inset-bottom)+1rem))] md:pb-6">
<ChatInput
value={input}
onChange={(e) => setInput(e.target.value)}
Expand All @@ -62,17 +54,13 @@ export function HomeChatComposer({
onModelChange={setSelectedModel}
minimal
/>
<div
className={cn(
"inline-flex max-w-[min(160px,35vw)] min-w-0 shrink items-center rounded-full bg-fg-primary/5 px-3 py-1.5",
dmSansClassName(),
)}
title={chatSpaceLabel}
>
<span className="truncate text-sm text-fg-primary">
{chatSpaceLabel}
</span>
</div>
<SpaceSelector
selectedProjects={chatSpaceProjects}
onValueChange={setChatSpaceProjects}
variant="insideOut"
includeAuto
triggerClassName="h-auto min-h-0 max-w-[min(160px,35vw)] rounded-full border border-[#161F2C] bg-[#000000] px-3 py-1.5 shadow-none hover:bg-[#05080D]"
/>
</>
}
/>
Expand Down
Loading
Loading