feat(dotnet): add managed artifact triage
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import type { ToolContract } from "./toolContracts.js";
|
||||
import { managedOutputSchemas } from "./toolOutputSchemas.js";
|
||||
|
||||
/** Exact caller boundary for execution-free PE/CLI triage and identity. */
|
||||
export const managedArtifactInputSchema = z.object({
|
||||
reference_offset: z.number().int().min(0).default(0),
|
||||
reference_limit: z.number().int().min(1).max(500).default(100),
|
||||
resource_offset: z.number().int().min(0).default(0),
|
||||
resource_limit: z.number().int().min(1).max(500).default(100),
|
||||
attribute_offset: z.number().int().min(0).default(0),
|
||||
attribute_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");
|
||||
|
||||
/** Read-only managed artifact contracts. */
|
||||
export const MANAGED_TOOL_CONTRACTS = [
|
||||
{
|
||||
name: "inspect_managed_artifact",
|
||||
description:
|
||||
"Classify the active PE/CLI artifact and inventory exact assembly/module identity, target framework evidence, references, resources, and custom attributes without loading or executing target code. Returns bounded pages and explicit partial or malformed coverage.",
|
||||
kind: "managed-provider",
|
||||
inputSchema: managedArtifactInputSchema,
|
||||
outputSchema,
|
||||
annotations: {
|
||||
readOnlyHint: true,
|
||||
destructiveHint: false,
|
||||
idempotentHint: true,
|
||||
openWorldHint: false,
|
||||
},
|
||||
examples: [
|
||||
{
|
||||
title: "Example inspect managed artifact request",
|
||||
input: {},
|
||||
},
|
||||
],
|
||||
},
|
||||
] as const satisfies readonly ToolContract[];
|
||||
|
||||
/** Names of execution-free managed static operations. */
|
||||
export type ManagedToolName = (typeof MANAGED_TOOL_CONTRACTS)[number]["name"];
|
||||
Reference in New Issue
Block a user