mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-07 11:51:14 -07:00
feat(commands): Enable @file processing in TOML commands (#6716)
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type { IPromptProcessor } from './types.js';
|
||||
import { appendToLastTextPart } from '@google/gemini-cli-core';
|
||||
import type { IPromptProcessor, PromptPipelineContent } from './types.js';
|
||||
import type { CommandContext } from '../../ui/commands/types.js';
|
||||
|
||||
/**
|
||||
@@ -14,9 +15,12 @@ import type { CommandContext } from '../../ui/commands/types.js';
|
||||
* This processor is only used if the prompt does NOT contain {{args}}.
|
||||
*/
|
||||
export class DefaultArgumentProcessor implements IPromptProcessor {
|
||||
async process(prompt: string, context: CommandContext): Promise<string> {
|
||||
if (context.invocation!.args) {
|
||||
return `${prompt}\n\n${context.invocation!.raw}`;
|
||||
async process(
|
||||
prompt: PromptPipelineContent,
|
||||
context: CommandContext,
|
||||
): Promise<PromptPipelineContent> {
|
||||
if (context.invocation?.args) {
|
||||
return appendToLastTextPart(prompt, context.invocation.raw);
|
||||
}
|
||||
return prompt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user