fix(dispatch): resolve plugin namespace parsing, template substitution, and discovery duplication
This commit is contained in:
@@ -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}")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user