Scaffolding and Foundation Changes

- feat(cli): add compactToolOutput ui setting
- feat(cli): add DenseToolMessage component and supporting rendering logic
- feat(cli): implement compact tool output rendering logic in ToolGroupMessage
- feat(core): add tool display name constants and update tool constructors
- feat(cli): update compact output allowlist to use DISPLAY_NAME constants
- test(cli): add compact tool output rendering and spacing tests

-----
Note: Unsafe assignments/assertions/'any' usage still exist in ToolGroupMessage.tsx and DenseToolMessage.tsx and need to be addressed before PR.
Note: Tests contain 'any' casts for mocks that need to be addressed before PR.
This commit is contained in:
Jarrod Whelan
2026-03-09 09:36:43 -07:00
parent c25ff94608
commit fa7c5ee983
22 changed files with 1739 additions and 151 deletions

View File

@@ -8,6 +8,7 @@ import { type FunctionCall } from '@google/genai';
import type {
ToolConfirmationOutcome,
ToolConfirmationPayload,
DiffStat,
} from '../tools/tools.js';
import type { ToolCall } from '../scheduler/types.js';
@@ -88,6 +89,7 @@ export type SerializableConfirmationDetails =
originalContent: string | null;
newContent: string;
isModifying?: boolean;
diffStat?: DiffStat;
}
| {
type: 'exec';

View File

@@ -28,7 +28,7 @@ import { isGitRepository } from '../utils/gitUtils.js';
import type { Config } from '../config/config.js';
import type { FileExclusions } from '../utils/ignorePatterns.js';
import { ToolErrorType } from './tool-error.js';
import { GREP_TOOL_NAME } from './tool-names.js';
import { GREP_TOOL_NAME, GREP_DISPLAY_NAME } from './tool-names.js';
import { debugLogger } from '../utils/debugLogger.js';
import { GREP_DEFINITION } from './definitions/coreTools.js';
import { resolveToolDeclaration } from './definitions/resolver.js';
@@ -599,7 +599,7 @@ export class GrepTool extends BaseDeclarativeTool<GrepToolParams, ToolResult> {
) {
super(
GrepTool.Name,
'SearchText',
GREP_DISPLAY_NAME,
GREP_DEFINITION.base.description!,
Kind.Search,
GREP_DEFINITION.base.parametersJsonSchema,

View File

@@ -18,7 +18,7 @@ import { makeRelative, shortenPath } from '../utils/paths.js';
import type { Config } from '../config/config.js';
import { DEFAULT_FILE_FILTERING_OPTIONS } from '../config/constants.js';
import { ToolErrorType } from './tool-error.js';
import { LS_TOOL_NAME } from './tool-names.js';
import { LS_TOOL_NAME, LS_DISPLAY_NAME } from './tool-names.js';
import { debugLogger } from '../utils/debugLogger.js';
import { LS_DEFINITION } from './definitions/coreTools.js';
import { resolveToolDeclaration } from './definitions/resolver.js';
@@ -291,7 +291,7 @@ export class LSTool extends BaseDeclarativeTool<LSToolParams, ToolResult> {
) {
super(
LSTool.Name,
'ReadFolder',
LS_DISPLAY_NAME,
LS_DEFINITION.base.description!,
Kind.Search,
LS_DEFINITION.base.parametersJsonSchema,

View File

@@ -33,7 +33,10 @@ import { getProgrammingLanguage } from '../telemetry/telemetry-utils.js';
import { logFileOperation } from '../telemetry/loggers.js';
import { FileOperationEvent } from '../telemetry/types.js';
import { ToolErrorType } from './tool-error.js';
import { READ_MANY_FILES_TOOL_NAME } from './tool-names.js';
import {
READ_MANY_FILES_TOOL_NAME,
READ_MANY_FILES_DISPLAY_NAME,
} from './tool-names.js';
import { READ_MANY_FILES_DEFINITION } from './definitions/coreTools.js';
import { resolveToolDeclaration } from './definitions/resolver.js';
@@ -472,7 +475,7 @@ export class ReadManyFilesTool extends BaseDeclarativeTool<
) {
super(
ReadManyFilesTool.Name,
'ReadManyFiles',
READ_MANY_FILES_DISPLAY_NAME,
READ_MANY_FILES_DEFINITION.base.description!,
Kind.Read,
READ_MANY_FILES_DEFINITION.base.parametersJsonSchema,

View File

@@ -160,6 +160,11 @@ export const EDIT_DISPLAY_NAME = 'Edit';
export const ASK_USER_DISPLAY_NAME = 'Ask User';
export const READ_FILE_DISPLAY_NAME = 'ReadFile';
export const GLOB_DISPLAY_NAME = 'FindFiles';
export const LS_DISPLAY_NAME = 'ReadFolder';
export const GREP_DISPLAY_NAME = 'SearchText';
export const WEB_SEARCH_DISPLAY_NAME = 'GoogleSearch';
export const WEB_FETCH_DISPLAY_NAME = 'WebFetch';
export const READ_MANY_FILES_DISPLAY_NAME = 'ReadManyFiles';
export const TRACKER_CREATE_TASK_TOOL_NAME = 'tracker_create_task';
export const TRACKER_UPDATE_TASK_TOOL_NAME = 'tracker_update_task';
export const TRACKER_GET_TASK_TOOL_NAME = 'tracker_get_task';

View File

@@ -27,7 +27,7 @@ import {
WebFetchFallbackAttemptEvent,
} from '../telemetry/index.js';
import { LlmRole } from '../telemetry/llmRole.js';
import { WEB_FETCH_TOOL_NAME } from './tool-names.js';
import { WEB_FETCH_TOOL_NAME, WEB_FETCH_DISPLAY_NAME } from './tool-names.js';
import { debugLogger } from '../utils/debugLogger.js';
import { retryWithBackoff } from '../utils/retry.js';
import { WEB_FETCH_DEFINITION } from './definitions/coreTools.js';
@@ -684,7 +684,7 @@ export class WebFetchTool extends BaseDeclarativeTool<
) {
super(
WebFetchTool.Name,
'WebFetch',
WEB_FETCH_DISPLAY_NAME,
WEB_FETCH_DEFINITION.base.description!,
Kind.Fetch,
WEB_FETCH_DEFINITION.base.parametersJsonSchema,

View File

@@ -5,7 +5,7 @@
*/
import type { MessageBus } from '../confirmation-bus/message-bus.js';
import { WEB_SEARCH_TOOL_NAME } from './tool-names.js';
import { WEB_SEARCH_TOOL_NAME, WEB_SEARCH_DISPLAY_NAME } from './tool-names.js';
import type { GroundingMetadata } from '@google/genai';
import {
BaseDeclarativeTool,
@@ -206,7 +206,7 @@ export class WebSearchTool extends BaseDeclarativeTool<
) {
super(
WebSearchTool.Name,
'GoogleSearch',
WEB_SEARCH_DISPLAY_NAME,
WEB_SEARCH_DEFINITION.base.description!,
Kind.Search,
WEB_SEARCH_DEFINITION.base.parametersJsonSchema,