fix(managed): validate CLI type selections with the member contract (#2125)

`inspect-managed-members --type` accepted repeated and empty names that
the MCP contract rejects. The provider's contract parse then threw, and
the CLI reported execution_failure with advice to run `rea doctor`.
Reuse the contract's type_names schema so the CLI rejects them as a
validation error on --type.

Fixes #2121

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-12 19:26:32 +08:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 672bdea21f
commit 60259a91d9
2 changed files with 36 additions and 6 deletions
+4 -6
View File
@@ -16,6 +16,7 @@ import { logCliCommand } from "../cliLogging.js";
import type { Logger } from "pino";
import type { CliInstance } from "./types.js";
import { registerProjectManagedApplicationGraph } from "./managedProjectGraphCommand.js";
import { managedMembersInputSchema } from "../contracts/managed/managedToolContracts.js";
export const registerManagedCommands = (
cli: CliInstance,
@@ -60,12 +61,9 @@ const registerInspectManagedMembers = (
path: z.string().describe("Managed PE executable or assembly path"),
}),
options: z.object({
type: z
.array(z.string())
.optional()
.describe(
"Inspect only members declared by this exact type full name, such as System.Threading.Monitor; a nested type is named by its bare name, which selects every nested type of that name (repeatable)",
),
type: managedMembersInputSchema.shape.type_names.describe(
"Inspect only members declared by this exact type full name, such as System.Threading.Monitor; a nested type is named by its bare name, which selects every nested type of that name (repeatable)",
),
}),
run: ({ args, options }) =>
logCliCommand(logger, "inspect-managed-members", () =>