Elffuss BraidHub

kikocis/continue public

d0cd3fef8227 · 498 BRawPermalink
1import { ToolCallState } from "core";
2import { RootState } from "../store";
3
4export function findCurrentToolCall(
5 chatHistory: RootState["session"]["history"],
6): ToolCallState | undefined {
7 return chatHistory[chatHistory.length - 1]?.toolCallState;
8}
9
10export function findToolCall(
11 chatHistory: RootState["session"]["history"],
12 toolCallId: string,
13): ToolCallState | undefined {
14 return chatHistory.find(
15 (item) => item.toolCallState?.toolCallId === toolCallId,
16 )?.toolCallState;
17}