feat: Add path property to command struct

- Include 'path' field in Command interface for directory awareness
- Add 'path' to command object creation for devchat run listing
- Update CommandEntry interface in devchat tool wrapper to hold 'path'
This commit is contained in:
bobo.yang 2024-02-03 16:12:37 +08:00
parent 2ff769b79f
commit 7f8694ff26
2 changed files with 3 additions and 0 deletions

View File

@ -9,6 +9,7 @@ export interface Command {
name: string; name: string;
pattern: string; pattern: string;
description: string; description: string;
path: string;
args: number; args: number;
handler: (commandName: string, userInput: string) => Promise<string>; handler: (commandName: string, userInput: string) => Promise<string>;
} }
@ -24,6 +25,7 @@ async function getCommandListByDevChatRun(includeHide: boolean = false): Promise
name: command.name, name: command.name,
pattern: command.name, pattern: command.name,
description: command.description, description: command.description,
path: command.path,
args: 0, args: 0,
handler: async (commandName: string, userInput: string) => { return ''; } handler: async (commandName: string, userInput: string) => { return ''; }
}; };

View File

@ -41,6 +41,7 @@ export interface LogEntry {
export interface CommandEntry { export interface CommandEntry {
name: string; name: string;
description: string; description: string;
path: string;
} }
export interface TopicEntry { export interface TopicEntry {