mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 18:33:15 +00:00
* feat: Generate title for gh issues * fix a lot * fix: add proposed plan to gh issue body * cr * cr * cr * improve prompting * cr
37 lines
1 KiB
TypeScript
37 lines
1 KiB
TypeScript
import { isAgentInboxInterruptSchema } from "@/lib/agent-inbox-interrupt";
|
|
import { ThreadView } from "../agent-inbox";
|
|
import { GenericInterruptView } from "./generic-interrupt";
|
|
import { useStream } from "@langchain/langgraph-sdk/react";
|
|
|
|
interface InterruptProps {
|
|
interruptValue?: unknown;
|
|
isLastMessage: boolean;
|
|
hasNoAIOrToolMessages?: boolean;
|
|
forceRenderInterrupt?: boolean;
|
|
thread: ReturnType<typeof useStream>;
|
|
}
|
|
|
|
export function Interrupt({
|
|
interruptValue,
|
|
isLastMessage,
|
|
hasNoAIOrToolMessages,
|
|
forceRenderInterrupt,
|
|
thread,
|
|
}: InterruptProps) {
|
|
return (
|
|
<>
|
|
{isAgentInboxInterruptSchema(interruptValue) &&
|
|
(isLastMessage || hasNoAIOrToolMessages || forceRenderInterrupt) && (
|
|
<ThreadView
|
|
interrupt={interruptValue}
|
|
thread={thread}
|
|
/>
|
|
)}
|
|
{interruptValue &&
|
|
!isAgentInboxInterruptSchema(interruptValue) &&
|
|
(isLastMessage || forceRenderInterrupt) ? (
|
|
<GenericInterruptView interrupt={interruptValue} />
|
|
) : null}
|
|
</>
|
|
);
|
|
}
|