mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
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:
@@ -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]
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user