mirror of
https://github.com/morluto/rea.git
synced 2026-10-31 20:06:14 +00:00
64 lines
2.5 KiB
TypeScript
64 lines
2.5 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 and JavaScript analysis Evidence. */
|
|
export const ANALYSIS_VIEW_TOOL_CONTRACTS = [
|
|
{
|
|
name: "inspect_analysis_view",
|
|
...toolContractMetadata("inspect_analysis_view"),
|
|
kind: "application",
|
|
description:
|
|
"Inspect a selected view of completed binary-layout or JavaScript application 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 with a positive limit. Module pages contain JavaScript assets, bundled modules and source modules; use node_id when paths are ambiguous or unavailable. Returns selected facts inline with 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 retained Evidence when 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 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[];
|