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)
| 441 | // BuildCommandCategories: an Immediate slash command whose Execute re-emits |
| 442 | // the same slash text as a BypassQueue SendMsg. |
| 443 | func 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. |
no test coverage detected