Add Deep Agents UI, pipeline fixes, and agent improvements.

Includes deep-agents-ui integration, rework detection via Gitea,
tool-call sanitization fixes, and startup scripts.
This commit is contained in:
dapa46
2026-06-18 19:33:26 +03:00
parent ba83d0cfe4
commit 0f38d8d588
83 changed files with 22561 additions and 179 deletions
@@ -0,0 +1,37 @@
"use client";
import { ReactNode, createContext, useContext } from "react";
import { Assistant } from "@langchain/langgraph-sdk";
import { type StateType, useChat } from "@/app/hooks/useChat";
import type { UseStreamThread } from "@langchain/langgraph-sdk/react";
interface ChatProviderProps {
children: ReactNode;
activeAssistant: Assistant | null;
onHistoryRevalidate?: () => void;
thread?: UseStreamThread<StateType>;
}
export function ChatProvider({
children,
activeAssistant,
onHistoryRevalidate,
thread,
}: ChatProviderProps) {
const chat = useChat({ activeAssistant, onHistoryRevalidate, thread });
return <ChatContext.Provider value={chat}>{children}</ChatContext.Provider>;
}
export type ChatContextType = ReturnType<typeof useChat>;
export const ChatContext = createContext<ChatContextType | undefined>(
undefined
);
export function useChatContext() {
const context = useContext(ChatContext);
if (context === undefined) {
throw new Error("useChatContext must be used within a ChatProvider");
}
return context;
}