mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 15:31:27 +00:00
feat(commands): Enable @file processing in TOML commands (#6716)
This commit is contained in:
parent
529c2649b8
commit
bfdddcbd99
27 changed files with 1836 additions and 331 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue