fix: convert from use-query-params to nuqs

This commit is contained in:
bracesproul
2025-03-17 13:14:47 -07:00
parent 706cc7cc1a
commit c8bfb1cdc8
9 changed files with 4121 additions and 2024 deletions

View File

@@ -81,7 +81,8 @@
"vite": "^6.1.0"
},
"overrides": {
"react-is": "^19.0.0-rc-69d4b800-20241021"
"react-is": "^19.0.0-rc-69d4b800-20241021",
"@langchain/langgraph-checkpoint": "^0.0.16"
},
"packageManager": "pnpm@10.5.1+sha512.c424c076bd25c1a5b188c37bb1ca56cc1e136fbf530d98bcb3289982a08fd25527b8c9c4ec113be5e3393c39af04521dd647bcf1d0801eaf8ac6a7b14da313af"
}

6043
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@ import { InboxItemInput } from "./inbox-item-input";
import useInterruptedActions from "../hooks/use-interrupted-actions";
import { cn } from "@/lib/utils";
import { toast } from "sonner";
import { useQueryState } from 'nuqs'
import { useQueryState } from "nuqs";
import { constructOpenInStudioURL } from "../utils";
import { HumanInterrupt } from "@langchain/langgraph/prebuilt";

View File

@@ -4,7 +4,7 @@ import { Thread } from "@langchain/langgraph-sdk";
import { useEffect } from "react";
import { getContentString } from "../utils";
import { useQueryState, parseAsBoolean } from 'nuqs'
import { useQueryState, parseAsBoolean } from "nuqs";
import {
Sheet,
SheetContent,

View File

@@ -21,7 +21,7 @@ import {
PanelRightClose,
SquarePen,
} from "lucide-react";
import { useQueryState, parseAsBoolean } from 'nuqs'
import { useQueryState, parseAsBoolean } from "nuqs";
import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
import ThreadHistory from "./history";
import { toast } from "sonner";

View File

@@ -11,7 +11,7 @@ import { MessageContentComplex } from "@langchain/core/messages";
import { Fragment } from "react/jsx-runtime";
import { isAgentInboxInterruptSchema } from "@/lib/agent-inbox-interrupt";
import { ThreadView } from "../agent-inbox";
import { useQueryState, parseAsBoolean } from 'nuqs'
import { useQueryState, parseAsBoolean } from "nuqs";
function CustomComponent({
message,
@@ -74,7 +74,8 @@ export function AssistantMessage({
handleRegenerate: (parentCheckpoint: Checkpoint | null | undefined) => void;
}) {
const contentString = getContentString(message.content);
const [hideToolCalls] = useQueryState("hideToolCalls",
const [hideToolCalls] = useQueryState(
"hideToolCalls",
parseAsBoolean.withDefault(false),
);

View File

@@ -12,7 +12,7 @@ import {
type UIMessage,
type RemoveUIMessage,
} from "@langchain/langgraph-sdk/react-ui";
import { useQueryState } from 'nuqs'
import { useQueryState } from "nuqs";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import { LangGraphLogoSVG } from "@/components/icons/langgraph";
@@ -133,9 +133,7 @@ export const StreamProvider: React.FC<{ children: ReactNode }> = ({
_setApiKey(key);
};
const [assistantId, setAssistantId] = useQueryState(
"assistantId",
);
const [assistantId, setAssistantId] = useQueryState("assistantId");
if (!apiUrl || !assistantId) {
return (

View File

@@ -1,7 +1,7 @@
import { validate } from "uuid";
import { getApiKey } from "@/lib/api-key";
import { Thread } from "@langchain/langgraph-sdk";
import { useQueryState } from 'nuqs'
import { useQueryState } from "nuqs";
import {
createContext,
useContext,