MCPcopy
hub / github.com/docker/docker-agent / skillCommandParser

Function skillCommandParser

pkg/tui/page/chat/queue_test.go:443–460  ·  view source on GitHub ↗

skillCommandParser mirrors the real skill palette item built in BuildCommandCategories: an Immediate slash command whose Execute re-emits the same slash text as a BypassQueue SendMsg.

(name string)

Source from the content-addressed store, hash-verified

441// BuildCommandCategories: an Immediate slash command whose Execute re-emits
442// the same slash text as a BypassQueue SendMsg.
443func skillCommandParser(name string) *commands.Parser {
444 return commands.NewParser(commands.Category{
445 Name: "Skills",
446 Commands: []commands.Item{
447 {
448 SlashCommand: "/" + name,
449 Immediate: true,
450 Execute: func(arg string) tea.Cmd {
451 input := "/" + name
452 if arg = strings.TrimSpace(arg); arg != "" {
453 input += " " + arg
454 }
455 return core.CmdHandler(messages.SendMsg{Content: input, BypassQueue: true})
456 },
457 },
458 },
459 })
460}
461
462// dispatchTypedSkill reproduces typing a skill slash command in the editor.
463// Hop 1: handleSendMsg parses it and Execute re-emits a BypassQueue SendMsg.

Calls 2

NewParserFunction · 0.92
CmdHandlerFunction · 0.92

Tested by

no test coverage detected