mirror of
https://github.com/morluto/rea.git
synced 2026-11-02 21:06:04 +00:00
fix(mcp): require absolute JavaScript application inputs
This commit is contained in:
1 parent
59f0eb4244
commit
4e7fb1ee8a
2 files changed
+15
-2
No files matched your search
@@ -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