fix(cli): support project slash command completion (#245)

Add project-level slash command discovery with recursive nested command scanning, pass workingDirectory through slash-command handlers, and align hub/web source unions to include project commands.
This commit is contained in:
Jlovec
2026-03-05 12:50:59 +08:00
committed by GitHub
parent 55f08bd562
commit ef3328f48f
9 changed files with 164 additions and 17 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ export function useSlashCommands(
// If API succeeded, add user-defined and plugin commands
if (query.data?.success && query.data.commands) {
const extraCommands = query.data.commands.filter(
cmd => cmd.source === 'user' || cmd.source === 'plugin'
cmd => cmd.source === 'user' || cmd.source === 'plugin' || cmd.source === 'project'
)
return [...builtin, ...extraCommands]
}
+1 -1
View File
@@ -6,7 +6,7 @@ export interface Suggestion {
label: string
description?: string
content?: string // Expanded content for Codex user prompts
source?: 'builtin' | 'user' | 'plugin'
source?: 'builtin' | 'user' | 'plugin' | 'project'
}
interface SuggestionOptions {
+1 -1
View File
@@ -151,7 +151,7 @@ export type GitStatusFiles = {
export type SlashCommand = {
name: string
description?: string
source: 'builtin' | 'user' | 'plugin'
source: 'builtin' | 'user' | 'plugin' | 'project'
content?: string // Expanded content for Codex user prompts
pluginName?: string
}