Add caller-selected native dossier facets with preserved Evidence identity, provenance, unknowns and transport recovery. Refs #1247 and #1065. Co-authored-by: jhuang-tw <77732008+jhuang-tw@users.noreply.github.com> Co-authored-by: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com>
79 lines
3.0 KiB
TypeScript
79 lines
3.0 KiB
TypeScript
import {
|
|
analysisViewResultSchema,
|
|
inspectAnalysisViewInputSchema,
|
|
} from "../domain/analysisView/analysisView.js";
|
|
import type { ToolContract } from "./toolContractTypes.js";
|
|
import { toolContractMetadata } from "./toolEffects.js";
|
|
import { evidenceResultOf } from "./toolOutputSchemaPrimitives.js";
|
|
|
|
const RETAINED_EXAMPLE_ID = `ev_${"a".repeat(64)}`;
|
|
|
|
/** Selected views of already completed layout, JavaScript and native function Evidence. */
|
|
export const ANALYSIS_VIEW_TOOL_CONTRACTS = [
|
|
{
|
|
name: "inspect_analysis_view",
|
|
...toolContractMetadata("inspect_analysis_view"),
|
|
kind: "application",
|
|
description:
|
|
"Inspect selected views of completed binary-layout, JavaScript application or native analyze_function Evidence without repeating analysis. Use an exact same-session retained evidence_id or portable inline Evidence. Select a summary, layout mitigations/linkage facet, one section/symbol/module, or a stable page. Module pages include assets, bundled and source modules; use node_id for ambiguous or unavailable paths. Native views select procedure, pseudocode, assembly, callers/callees, references and high-pcode. Use nonnegative offset and a positive caller-selected limit (defaults 0 and 64); pseudocode uses UTF-16 code units, other native pages use rows. Returns artifact identity, parent Evidence ID, a distinct view digest, coverage, limitations and unknowns. Actual serialized size determines MCP transport admission; choose a smaller page or export the complete retained Evidence if needed.",
|
|
inputSchema: inspectAnalysisViewInputSchema,
|
|
outputSchema: evidenceResultOf(analysisViewResultSchema),
|
|
examples: [
|
|
{
|
|
title: "Summarize retained JavaScript application Evidence",
|
|
input: {
|
|
source: {
|
|
kind: "retained-evidence",
|
|
evidence_id: RETAINED_EXAMPLE_ID,
|
|
},
|
|
view: { kind: "summary" },
|
|
},
|
|
},
|
|
{
|
|
title: "Read one ELF section from retained layout Evidence",
|
|
input: {
|
|
source: {
|
|
kind: "retained-evidence",
|
|
evidence_id: RETAINED_EXAMPLE_ID,
|
|
},
|
|
view: {
|
|
kind: "item",
|
|
collection: "sections",
|
|
selector: { name: ".text" },
|
|
},
|
|
},
|
|
},
|
|
{
|
|
title: "Page native high-pcode operations from retained Evidence",
|
|
input: {
|
|
source: {
|
|
kind: "retained-evidence",
|
|
evidence_id: RETAINED_EXAMPLE_ID,
|
|
},
|
|
view: {
|
|
kind: "native",
|
|
facet: "value_flow_operations",
|
|
offset: 0,
|
|
limit: 32,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
title: "Page module identities from retained application Evidence",
|
|
input: {
|
|
source: {
|
|
kind: "retained-evidence",
|
|
evidence_id: RETAINED_EXAMPLE_ID,
|
|
},
|
|
view: {
|
|
kind: "page",
|
|
collection: "modules",
|
|
offset: 0,
|
|
limit: 32,
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
] as const satisfies readonly ToolContract[];
|