Skip to content

Commit b6cd1a8

Browse files
author
SqlRush
committed
Show plugin by direct name
1 parent b158fd1 commit b6cd1a8

3 files changed

Lines changed: 44 additions & 0 deletions

File tree

docs/first-second-parity-audit.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Anthropic API 和 conversation:
8181
- `/config <section>` now shares the same section-alias normalization as `/config show <section>` for non-mutating direct section invocations such as `/config env`, `/config permissions`, and `/config integrations`, while preserving existing mutating forms such as `/config model <name>` and `/config output-style <name>`.
8282
- `/memory list` now takes the no-query local file-list path used by `/memory show`, while `/memory status` continues to report the session/relevant-memory summary.
8383
- `/mcp <server-name>` now takes the no-query local server-detail path used by `/mcp show <server-name>` when the name matches a configured settings or plugin MCP server, while unknown one-word subcommands still report unsupported.
84+
- `/plugin <plugin-name>` now takes the no-query local plugin-detail path used by `/plugin show <plugin-name>` when the name matches a local plugin manifest, while unknown one-word subcommands still report unsupported.
8485
- A basic `Skill` tool wrapper is now registered with the default built-in tool set. It can invoke local project prompt skills through the command registry, returns the official-style `Launching skill: ...` result plus structured command metadata, and passes expanded meta user messages through `ToolResult.NewMessages`; the conversation runner now appends those new messages to transcripts and subsequent model requests.
8586
- Basic slash prompt command invocation is now wired for local project prompt skills: `/skill args` is parsed before the model request, converted into official-shaped command metadata plus expanded meta prompt messages, appended to transcript parent chains, and can override the turn model from skill frontmatter.
8687
- Local prompt-skill slash commands and the `Skill` tool now emit `command_permissions` attachments, parse `allowed-tools` into command-scoped permission rules, and merge those rules into the engine permission decider for the current turn so authorized follow-up tool calls can pass without leaking into later turns.

internal/conversation/run.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2849,6 +2849,11 @@ func (r Runner) formatPluginSummary(raw string) string {
28492849
case "enable", "disable":
28502850
return r.setPluginEnabledSummary(args)
28512851
default:
2852+
if len(args) == 1 {
2853+
if plugin, ok := findLoadedPlugin(pluginpkg.LoadPluginDirs(pluginpkg.ProjectPluginDirs(r.WorkingDirectory)), args[0]); ok {
2854+
return r.formatPluginShow([]string{"show", plugin.Name})
2855+
}
2856+
}
28522857
return "Plugin subcommand is not implemented in the Go runtime yet: " + strings.Join(args, " ")
28532858
}
28542859
}

internal/conversation/run_test.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4196,6 +4196,44 @@ func TestRunnerPluginShowReportsLocalPluginDetails(t *testing.T) {
41964196
t.Fatalf("plugin show missing %q: %q", want, text)
41974197
}
41984198
}
4199+
4200+
result, err = runner.RunTurn(context.Background(), nil, messages.UserText("/plugin demo"))
4201+
if err != nil {
4202+
t.Fatal(err)
4203+
}
4204+
if len(client.requests) != 0 {
4205+
t.Fatalf("model should not be queried, requests = %#v", client.requests)
4206+
}
4207+
text = result.Messages[1].Content[0].Text
4208+
for _, want := range []string{
4209+
"Plugin demo",
4210+
"State: enabled",
4211+
"Path: " + pluginDir,
4212+
"Version: 1.2.3",
4213+
"Description: Demo plugin",
4214+
"Commands: 1",
4215+
"Skills: 1",
4216+
"Agents: 1",
4217+
"MCP servers: 1",
4218+
"Output styles: 1",
4219+
"Hooks: 1",
4220+
"Commands:",
4221+
"- /plugin:deploy",
4222+
"Skills:",
4223+
"- /demo:audit",
4224+
"Agents:",
4225+
"- demo:reviewer",
4226+
"MCP servers:",
4227+
"- plugin:docs",
4228+
"Output styles:",
4229+
"- demo:brief",
4230+
"Hook events:",
4231+
"- PreToolUse (1)",
4232+
} {
4233+
if !strings.Contains(text, want) {
4234+
t.Fatalf("direct plugin show missing %q: %q", want, text)
4235+
}
4236+
}
41994237
}
42004238

42014239
func TestRunnerPluginShowReportsDisabledLocalPlugin(t *testing.T) {

0 commit comments

Comments
 (0)