mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-13 17:52:38 +02:00
chat-messages: add timeline tool registry with HITL-aware fallback.
This commit is contained in:
parent
48c4df822a
commit
97a7626179
9 changed files with 778 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
import type { ToolCallItem } from "../types";
|
||||
import type { TimelineToolProps } from "./types";
|
||||
|
||||
/**
|
||||
* Lossless mapping ``ToolCallItem → TimelineToolProps``. Pure;
|
||||
* extracts only the fields tool components actually consume.
|
||||
*
|
||||
* ``id``, ``kind``, ``items``, ``spanId``, ``thinkingStepId`` are
|
||||
* intentionally dropped — they're timeline-internal concerns (React
|
||||
* key, dispatch, indentation, back-correlation) that tool components
|
||||
* have no reason to see.
|
||||
*/
|
||||
export function adaptItemToProps(item: ToolCallItem): TimelineToolProps {
|
||||
return {
|
||||
toolCallId: item.toolCallId,
|
||||
toolName: item.toolName,
|
||||
args: item.args,
|
||||
argsText: item.argsText,
|
||||
result: item.result,
|
||||
langchainToolCallId: item.langchainToolCallId,
|
||||
status: item.status,
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue