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 f383d7abb5
commit c084cc3f26
10 changed files with 256 additions and 38 deletions
@@ -0,0 +1,28 @@
import { describe, expect, it } from "bun:test"
import { formatLoadedCommand } from "./command-output-formatter"
import type { CommandInfo } from "./types"
describe("command output formatter", () => {
describe("#given command template includes argument placeholders", () => {
it("#then replaces both placeholder forms", async () => {
// given
const command: CommandInfo = {
name: "daplug:templated",
metadata: {
name: "daplug:templated",
description: "Templated plugin command",
},
content: "Echo $ARGUMENTS and ${user_message}.",
scope: "plugin",
}
// when
const output = await formatLoadedCommand(command, "ship it")
// then
expect(output).toContain("Echo ship it and ship it.")
expect(output).not.toContain("$ARGUMENTS")
expect(output).not.toContain("${user_message}")
})
})
})