mirror of
https://github.com/morluto/rea
synced 2026-10-26 06:16:17 -04:00
fix(mcp): require absolute JavaScript application inputs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { z } from "zod";
|
||||
import { absoluteLocalPathStringSchema } from "../../domain/localPath.js";
|
||||
import type { ToolContract } from "../toolContractTypes.js";
|
||||
import { toolContractMetadata } from "../toolEffects.js";
|
||||
import { electronFuseOutputSchemas } from "../toolOutputSchemaGroups.js";
|
||||
@@ -35,13 +36,19 @@ import { JAVASCRIPT_RUNTIME_RECONCILIATION_EXAMPLE } from "./javascriptRuntimeRe
|
||||
|
||||
const listOutputSchema = evidenceResultOf(electronTargetListSchema);
|
||||
const inspectionOutputSchema = evidenceResultOf(electronPageInspectionSchema);
|
||||
const javascriptApplicationMcpInputSchema =
|
||||
analyzeJavaScriptApplicationInputSchema.extend({
|
||||
input_path: absoluteLocalPathStringSchema.describe(
|
||||
"Absolute path to the JavaScript application on the machine running REA.",
|
||||
),
|
||||
});
|
||||
/** Caller-selected delivery of a completed JavaScript application analysis. */
|
||||
export const analyzeJavaScriptApplicationRequestSchema = z
|
||||
.discriminatedUnion("detail", [
|
||||
analyzeJavaScriptApplicationInputSchema.extend(
|
||||
javascriptApplicationMcpInputSchema.extend(
|
||||
javaScriptRoutesCompleteDeliveryShape,
|
||||
),
|
||||
analyzeJavaScriptApplicationInputSchema.extend(
|
||||
javascriptApplicationMcpInputSchema.extend(
|
||||
javaScriptRoutesSummaryDeliveryShape,
|
||||
),
|
||||
])
|
||||
|
||||
@@ -106,6 +106,12 @@ const inputCases = (
|
||||
|
||||
return [
|
||||
pathCase("open_binary", "path", { path: absolute }, { path: relative }),
|
||||
pathCase(
|
||||
"analyze_javascript_application",
|
||||
"input_path",
|
||||
{ input_path: absolute, detail: "complete" },
|
||||
{ input_path: relative, detail: "complete" },
|
||||
),
|
||||
pathCase(
|
||||
"open_binary",
|
||||
"snapshot_path",
|
||||
|
||||
Reference in New Issue
Block a user