feat(commands): Enable @file processing in TOML commands (#6716)

This commit is contained in:
Abhi
2025-08-27 23:22:21 -04:00
committed by GitHub
parent 529c2649b8
commit bfdddcbd99
27 changed files with 1836 additions and 331 deletions

View File

@@ -5,7 +5,7 @@
*/
import { type ReactNode } from 'react';
import type { Content } from '@google/genai';
import type { Content, PartListUnion } from '@google/genai';
import type { HistoryItemWithoutId, HistoryItem } from '../types.js';
import type { Config, GitService, Logger } from '@google/gemini-cli-core';
import type { LoadedSettings } from '../../config/settings.js';
@@ -122,7 +122,7 @@ export interface LoadHistoryActionReturn {
*/
export interface SubmitPromptActionReturn {
type: 'submit_prompt';
content: string;
content: PartListUnion;
}
/**

View File

@@ -491,7 +491,7 @@ describe('useSlashCommandProcessor', () => {
description: 'A command from a file',
action: async () => ({
type: 'submit_prompt',
content: 'The actual prompt from the TOML file.',
content: [{ text: 'The actual prompt from the TOML file.' }],
}),
},
CommandKind.FILE,
@@ -507,7 +507,7 @@ describe('useSlashCommandProcessor', () => {
expect(actionResult).toEqual({
type: 'submit_prompt',
content: 'The actual prompt from the TOML file.',
content: [{ text: 'The actual prompt from the TOML file.' }],
});
expect(mockAddItem).toHaveBeenCalledWith(
@@ -523,7 +523,7 @@ describe('useSlashCommandProcessor', () => {
description: 'A command from mcp',
action: async () => ({
type: 'submit_prompt',
content: 'The actual prompt from the mcp command.',
content: [{ text: 'The actual prompt from the mcp command.' }],
}),
},
CommandKind.MCP_PROMPT,
@@ -539,7 +539,7 @@ describe('useSlashCommandProcessor', () => {
expect(actionResult).toEqual({
type: 'submit_prompt',
content: 'The actual prompt from the mcp command.',
content: [{ text: 'The actual prompt from the mcp command.' }],
});
expect(mockAddItem).toHaveBeenCalledWith(

View File

@@ -9,6 +9,7 @@ import type {
ToolCallConfirmationDetails,
ToolResultDisplay,
} from '@google/gemini-cli-core';
import type { PartListUnion } from '@google/genai';
// Only defining the state enum needed by the UI
export enum StreamingState {
@@ -239,7 +240,7 @@ export interface ConsoleMessageItem {
*/
export interface SubmitPromptResult {
type: 'submit_prompt';
content: string;
content: PartListUnion;
}
/**