mirror of
https://github.com/morluto/rea.git
synced 2026-11-11 09:21:16 +00:00
Add explicit MCP Dart AOT summary delivery and exact retained string-pool pages while preserving complete defaults, CLI behavior, ABI selection, original Evidence identity, partial coverage and lower bounds. Real LocalSend SDK replies shrink 92.05% with approximately unchanged SDK time. Two actual Codex pairs preserve all selected facts and reduce total input 48.75% / 42.38%, uncached input 33.63% / 42.52%, and task time 23.95% / 30.30%; all client errors/repeated calls remain counted. Preserve old portable Evidence and the real CLI complete result after rebasing onto SAZ/qlog main. Curated results keep measured and integration runtime pins separate; raw artifacts stay outside Git. Refs #2016. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
58 lines
3.2 KiB
TypeScript
58 lines
3.2 KiB
TypeScript
import { z } from "zod";
|
|
import {
|
|
flutterInputSchemas,
|
|
dartAotInspectionInputSchema,
|
|
flutterResultSchemas,
|
|
} from "../../domain/flutter/flutterBuildAnalysis.js";
|
|
import { dartAotSummaryViewResultSchema } from "../../domain/analysisView/analysisView.js";
|
|
import type { ToolContract } from "../toolContractTypes.js";
|
|
import { evidenceResultOf } from "../toolOutputSchemaPrimitives.js";
|
|
import { toolContractMetadata } from "../toolEffects.js";
|
|
|
|
/** Flutter build identification by pure APK parsing. */
|
|
export const FLUTTER_TOOL_CONTRACTS = [
|
|
{
|
|
name: "identify_flutter_build",
|
|
...toolContractMetadata("identify_flutter_build"),
|
|
description:
|
|
"Identify a Flutter app's build facts by pure parsing: the Dart VM snapshot hash from every lib/<abi>/libapp.so AOT section (vm and isolate, cross-checked), per-ABI library digests, the engine library's GNU build-id, and any labeled Dart version or toolchain strings libflutter.so carries. The snapshot hash is the artifact that maps to a Dart SDK release through an external dataset; REA performs no lookup. No engine, no execution, no external tools.",
|
|
kind: "flutter-provider",
|
|
inputSchema: flutterInputSchemas.identify_flutter_build,
|
|
outputSchema: evidenceResultOf(flutterResultSchemas.identify_flutter_build),
|
|
examples: [
|
|
{
|
|
title: "Identify a Flutter build",
|
|
input: { path: "/targets/Example.apk" },
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: "inspect_dart_aot",
|
|
...toolContractMetadata("inspect_dart_aot"),
|
|
description:
|
|
"Inspect one ABI's Dart AOT snapshot inside an APK: the four snapshot symbols located through the ELF dynamic symbol table with their offsets, sizes, and section headers (magic, kind, length), the snapshot hash, and a bounded string-pool projection from the isolate data section (package: source URIs, dart: SDK URIs, identifier-like tokens) exposing the app's dependency structure. String-pool entries are byte-pattern observations, not deserialized cluster semantics; typed class and function recovery needs an SDK-specific parser. Omitted or complete detail returns the full observation. Select detail: \"summary\" for target/ABI/library identity, all snapshot headers, coverage and original lower-bound counts without string lists. The complete source stays retained; read returned strings via inspect_analysis_view with parent_evidence_id and kind dart-aot, collection package_uris/dart_uris/class_like_tokens, offset and limit. Exhausting pages does not imply complete pool coverage. No engine, no execution.",
|
|
kind: "flutter-provider",
|
|
inputSchema: dartAotInspectionInputSchema,
|
|
outputSchema: evidenceResultOf(
|
|
z.union([
|
|
flutterResultSchemas.inspect_dart_aot,
|
|
dartAotSummaryViewResultSchema,
|
|
]),
|
|
),
|
|
examples: [
|
|
{
|
|
title: "Inspect the preferred ABI's AOT snapshot",
|
|
input: { path: "/targets/Example.apk" },
|
|
},
|
|
{
|
|
title: "Inspect one ABI explicitly",
|
|
input: { path: "/targets/Example.apk", abi: "arm64-v8a" },
|
|
},
|
|
{
|
|
title: "Inspect snapshot identity with retained string lists",
|
|
input: { path: "/targets/Example.apk", detail: "summary" },
|
|
},
|
|
],
|
|
},
|
|
] as const satisfies readonly ToolContract[];
|