feat(command): identify command sources
This commit is contained in:
parent
0e705e2a05
commit
3cd894d40a
4 changed files with 10 additions and 3 deletions
|
|
@ -85,6 +85,7 @@ export const layer = (options?: ShellSelect.Options) => Layer.effect(
|
|||
name: mcpCommandName(prompt.server, prompt.name),
|
||||
template: "",
|
||||
description: prompt.description,
|
||||
source: "mcp",
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
|
@ -98,7 +99,10 @@ export const layer = (options?: ShellSelect.Options) => Layer.effect(
|
|||
return (yield* mcpCommands()).find((command) => command.name === name)
|
||||
}),
|
||||
list: Effect.fn("CommandV2.list")(function* () {
|
||||
const commands = Array.from(state.get().commands.values()) as Info[]
|
||||
const commands = Array.from(state.get().commands.values()).map((command) => ({
|
||||
...command,
|
||||
source: command.source ?? "command" as const,
|
||||
}))
|
||||
const names = new Set(commands.map((command) => command.name))
|
||||
return [
|
||||
...commands,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue