feat(dotnet): add managed native boundary inspection
This commit is contained in:
@@ -73,12 +73,47 @@ export const managedMemberInputSchema = z.object({
|
||||
max_method_instructions: z.number().int().min(1).max(100_000).default(10_000),
|
||||
});
|
||||
|
||||
/** Exact caller boundary for execution-free managed/native boundary inspection. */
|
||||
export const managedNativeBoundaryInputSchema = z.object({
|
||||
module_ref_offset: z.number().int().min(0).default(0),
|
||||
module_ref_limit: z.number().int().min(1).max(500).default(100),
|
||||
import_offset: z.number().int().min(0).default(0),
|
||||
import_limit: z.number().int().min(1).max(500).default(100),
|
||||
implementation_offset: z.number().int().min(0).default(0),
|
||||
implementation_limit: z.number().int().min(1).max(500).default(100),
|
||||
max_file_bytes: z
|
||||
.number()
|
||||
.int()
|
||||
.min(4_096)
|
||||
.max(1_073_741_824)
|
||||
.default(268_435_456),
|
||||
max_metadata_bytes: z
|
||||
.number()
|
||||
.int()
|
||||
.min(256)
|
||||
.max(268_435_456)
|
||||
.default(67_108_864),
|
||||
max_table_rows: z.number().int().min(1).max(1_000_000).default(100_000),
|
||||
max_heap_item_bytes: z
|
||||
.number()
|
||||
.int()
|
||||
.min(1)
|
||||
.max(16_777_216)
|
||||
.default(1_048_576),
|
||||
});
|
||||
|
||||
const outputSchema = managedOutputSchemas.inspect_managed_artifact;
|
||||
if (outputSchema === undefined)
|
||||
throw new Error("Missing managed output schema for inspect_managed_artifact");
|
||||
const memberOutputSchema = managedOutputSchemas.inspect_managed_members;
|
||||
if (memberOutputSchema === undefined)
|
||||
throw new Error("Missing managed output schema for inspect_managed_members");
|
||||
const nativeBoundaryOutputSchema =
|
||||
managedOutputSchemas.inspect_managed_native_boundaries;
|
||||
if (nativeBoundaryOutputSchema === undefined)
|
||||
throw new Error(
|
||||
"Missing managed output schema for inspect_managed_native_boundaries",
|
||||
);
|
||||
|
||||
/** Read-only managed artifact contracts. */
|
||||
export const MANAGED_TOOL_CONTRACTS = [
|
||||
@@ -122,6 +157,26 @@ export const MANAGED_TOOL_CONTRACTS = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "inspect_managed_native_boundaries",
|
||||
description:
|
||||
"Inspect PE/CLI ModuleRef, ImplMap/PInvoke declarations, CLI native-header indicators, and non-IL method implementation flags without loading or executing target code. Results are managed declarations and degraded native-boundary observations, not verified native exports or addresses.",
|
||||
kind: "managed-provider",
|
||||
inputSchema: managedNativeBoundaryInputSchema,
|
||||
outputSchema: nativeBoundaryOutputSchema,
|
||||
annotations: {
|
||||
readOnlyHint: true,
|
||||
destructiveHint: false,
|
||||
idempotentHint: true,
|
||||
openWorldHint: false,
|
||||
},
|
||||
examples: [
|
||||
{
|
||||
title: "Example inspect managed/native boundary request",
|
||||
input: { import_limit: 50, implementation_limit: 50 },
|
||||
},
|
||||
],
|
||||
},
|
||||
] as const satisfies readonly ToolContract[];
|
||||
|
||||
/** Names of execution-free managed static operations. */
|
||||
|
||||
@@ -27,6 +27,7 @@ import {
|
||||
import {
|
||||
managedArtifactInspectionSchema,
|
||||
managedMemberInspectionSchema,
|
||||
managedNativeBoundaryInspectionSchema,
|
||||
} from "../domain/managedArtifact.js";
|
||||
import { managedMemberComparisonResultSchema } from "../domain/managedMemberComparison.js";
|
||||
import { artifactComparisonResultSchema } from "../domain/artifactComparison.js";
|
||||
@@ -538,6 +539,9 @@ export const artifactOutputSchemas: Readonly<Record<string, z.ZodObject>> = {
|
||||
export const managedOutputSchemas: Readonly<Record<string, z.ZodObject>> = {
|
||||
inspect_managed_artifact: resultOf(managedArtifactInspectionSchema),
|
||||
inspect_managed_members: resultOf(managedMemberInspectionSchema),
|
||||
inspect_managed_native_boundaries: resultOf(
|
||||
managedNativeBoundaryInspectionSchema,
|
||||
),
|
||||
};
|
||||
|
||||
/** Exact Evidence v2 schema for provider-neutral managed workflows. */
|
||||
|
||||
Reference in New Issue
Block a user