Skip to content

@pgege/kaboo-react


Function: resolveTimelineTool()

resolveTimelineTool(entry, tools): ToolCall | undefined

Defined in: src/utils/timeline.ts:28

Resolve a timeline tool entry to its ToolCall.

tools is the owning group's tools list, which holds the single copy the entry references. Returns undefined for a reference with no match, which a caller should render as nothing rather than as an empty row.

Parameters

entry

TimelineEntry

tools

ToolCall[]

Returns

ToolCall | undefined

Example

import { resolveTimelineTool } from "@pgege/kaboo-react";

function firstToolName(group: { tools: ToolCall[]; timeline: TimelineEntry[] }) {
  for (const entry of group.timeline) {
    const tool = resolveTimelineTool(entry, group.tools);
    if (tool) return tool.toolName;
  }
  return null;
}