wip: HistoryItemToolGroupDisplay

This commit is contained in:
Michael Bleigh
2026-04-11 19:01:57 -07:00
parent 88bebef3a9
commit 383cb7d795
4 changed files with 45 additions and 1 deletions

View File

@@ -208,6 +208,7 @@ export const HistoryItemDisplay: React.FC<HistoryItemDisplayProps> = ({
isToolGroupBoundary={isToolGroupBoundary}
/>
)}
{/* TODO: tool_group_display goes here */}
{itemForDisplay.type === 'subagent' && (
<SubagentHistoryMessage
item={itemForDisplay}

View File

@@ -121,6 +121,7 @@ export const ToolGroupMessage: React.FC<ToolGroupMessageProps> = ({
isToolGroupBoundary,
}) => {
const settings = useSettings();
const isLowErrorVerbosity = settings.merged.ui?.errorVerbosity !== 'full';
const isCompactModeEnabled = settings.merged.ui?.compactToolOutput === true;

View File

@@ -260,6 +260,11 @@ export type HistoryItemToolGroup = HistoryItemBase & {
borderDimColor?: boolean;
};
export type HistoryItemToolDisplayGroup = HistoryItemBase & {
type: 'tool_display_group';
tools: ToolDisplay[];
};
export type HistoryItemUserShell = HistoryItemBase & {
type: 'user_shell';
text: string;
@@ -393,6 +398,7 @@ export type HistoryItemWithoutId =
| HistoryItemAbout
| HistoryItemHelp
| HistoryItemToolGroup
| HistoryItemToolDisplayGroup
| HistoryItemStats
| HistoryItemModelStats
| HistoryItemToolStats

View File

@@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
import type { AnsiOutput } from 'src/utils/terminalSerializer.js';
import type { Kind } from '../tools/tools.js';
export type WithMeta = { _meta?: Record<string, unknown> };
@@ -182,13 +183,48 @@ export type DisplayDiff = {
beforeText: string;
afterText: string;
};
export type DisplayContent = DisplayText | DisplayDiff;
export type DisplayTerminal = {
type: 'terminal';
pid?: string;
exitCode?: number;
ansi?: AnsiOutput;
};
export type DisplayAgent = {
type: 'agent';
threadId: string;
};
export type DisplayContent =
| DisplayText
| DisplayDiff
| DisplayTerminal
| DisplayAgent;
export type ToolDisplayFormat =
/**
* Displays as compact when user has enabled compact tools, box otherwise.
* This is the default format if none is selected.
**/
| 'auto'
/** Always display this tool in compact format. */
| 'compact'
/** Always display this tool in full box format. */
| 'box'
/** Hide this tool from the event history. */
| 'hidden'
/** Display this tool as a message-like notice. */
| 'notice';
export interface ToolDisplay {
/** A display name for the tool. */
name?: string;
/** A short description of what the tool is doing. */
description?: string;
/** A short, one-line summary of the tool's results. */
resultSummary?: string | null;
result?: DisplayContent | null;
/** A tool may specify its preferred display format. */
format?: ToolDisplayFormat;
}
export interface ToolRequest {