fix(dispatch): resolve plugin namespace parsing, template substitution, and discovery duplication

This commit is contained in:
YeonGyu-Kim
2026-03-03 00:14:01 +09:00
parent 813973041e
commit 3de05a55d5
10 changed files with 256 additions and 38 deletions
@@ -35,6 +35,14 @@ function writePluginFixture(baseDir: string): void {
description: Run prompt from daplug
---
Execute daplug prompt flow.
`,
)
writeFileSync(
join(pluginInstallPath, "commands", "templated.md"),
`---
description: Templated prompt from daplug
---
Echo $ARGUMENTS and \${user_message}.
`,
)
@@ -165,4 +173,23 @@ describe("auto-slash command executor plugin dispatch", () => {
)
expect(result.error).not.toContain("Marketplace plugin commands")
})
it("replaces $ARGUMENTS placeholders in plugin command templates", async () => {
const result = await executeSlashCommand(
{
command: "daplug:templated",
args: "ship it",
raw: "/daplug:templated ship it",
},
{
skills: [],
pluginsEnabled: true,
},
)
expect(result.success).toBe(true)
expect(result.replacementText).toContain("Echo ship it and ship it.")
expect(result.replacementText).not.toContain("$ARGUMENTS")
expect(result.replacementText).not.toContain("${user_message}")
})
})