mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
feat(commands): Implement argument handling for custom commands via a prompt pipeline (#4702)
This commit is contained in:
@@ -14,6 +14,15 @@ import { SessionStatsState } from '../contexts/SessionContext.js';
|
||||
|
||||
// Grouped dependencies for clarity and easier mocking
|
||||
export interface CommandContext {
|
||||
// Invocation properties for when commands are called.
|
||||
invocation?: {
|
||||
/** The raw, untrimmed input string from the user. */
|
||||
raw: string;
|
||||
/** The primary name of the command that was matched. */
|
||||
name: string;
|
||||
/** The arguments string that follows the command name. */
|
||||
args: string;
|
||||
};
|
||||
// Core services and configuration
|
||||
services: {
|
||||
// TODO(abhipatel12): Ensure that config is never null.
|
||||
@@ -132,7 +141,7 @@ export interface SlashCommand {
|
||||
// The action to run. Optional for parent commands that only group sub-commands.
|
||||
action?: (
|
||||
context: CommandContext,
|
||||
args: string,
|
||||
args: string, // TODO: Remove args. CommandContext now contains the complete invocation.
|
||||
) =>
|
||||
| void
|
||||
| SlashCommandActionReturn
|
||||
|
||||
Reference in New Issue
Block a user