cascrow-mcp 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.js +38 -9
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -126,7 +126,7 @@ Rate limit: 3 registrations per IP per hour.
126
126
  | `cascrow_get_proof_status` | Poll a submitted proof's verification result. |
127
127
  | `cascrow_watch_verification` | Submit proof and block until verification completes (combines submit + poll). |
128
128
  | `cascrow_mcp_submit` | Submit proof and get an immediate verdict in one call — auto-releases funds and mints the NFT on approval. |
129
- | `cascrow_verify_work` | Verify AI work with no escrow contract, from a GitHub PR or pasted code. Returns a public report URL. |
129
+ | `cascrow_verify_work` | Verify AI work with no escrow contract, from a GitHub PR, pasted code, or a base64-encoded screenshot. Returns a public report URL. |
130
130
  | `cascrow_escrow_fund` | Fund a milestone with an EVM private key (fully autonomous). |
131
131
  | `cascrow_fund_milestone` | Fund via MetaMask (browser flow). |
132
132
  | `cascrow_get_contract` | Get contract status and all milestone states. |
package/index.js CHANGED
@@ -493,8 +493,8 @@ const TOOLS = [
493
493
  name: "cascrow_verify_work",
494
494
  description:
495
495
  "Verify AI-generated work without any escrow contract. " +
496
- "Provide a task description and either a GitHub PR URL or paste code/text. " +
497
- "Returns a public shareable report URL with a YES/NO decision, confidence score, " +
496
+ "Provide a task description and either a GitHub PR URL, pasted code/text, or a screenshot/image " +
497
+ "(base64-encoded). Returns a public shareable report URL with a YES/NO decision, confidence score, " +
498
498
  "and per-model reasoning from 5 AI models. Use this to prove that AI work was actually done correctly.",
499
499
  inputSchema: {
500
500
  type: "object",
@@ -506,11 +506,20 @@ const TOOLS = [
506
506
  },
507
507
  prUrl: {
508
508
  type: "string",
509
- description: "GitHub PR URL (e.g. github.com/owner/repo/pull/42). Takes precedence over codeText.",
509
+ description: "GitHub PR URL (e.g. github.com/owner/repo/pull/42). Takes precedence over codeText/imageBase64.",
510
510
  },
511
511
  codeText: {
512
512
  type: "string",
513
- description: "Paste code, diff, or work description (max 50,000 chars). Used if no prUrl.",
513
+ description: "Paste code, diff, or work description (max 50,000 chars). Used if no prUrl or imageBase64.",
514
+ },
515
+ imageBase64: {
516
+ type: "string",
517
+ description: "Base64-encoded screenshot/image proof (e.g. a working UI). Requires imageMimeType. Used if no prUrl.",
518
+ },
519
+ imageMimeType: {
520
+ type: "string",
521
+ enum: ["image/jpeg", "image/png", "image/webp", "image/gif"],
522
+ description: "MIME type of imageBase64 — required when imageBase64 is provided.",
514
523
  },
515
524
  checklistItems: {
516
525
  type: "array",
@@ -882,11 +891,31 @@ async function handleMcpSubmit({ contract_id, milestone_id, evidence }) {
882
891
  };
883
892
  }
884
893
 
885
- async function handleVerifyWork({ taskDescription, prUrl, codeText, checklistItems }) {
886
- if (!prUrl && !codeText) {
887
- throw new Error("Provide either prUrl (GitHub PR URL) or codeText.");
894
+ const IMAGE_EXT_BY_MIME = { "image/jpeg": "jpg", "image/png": "png", "image/webp": "webp", "image/gif": "gif" };
895
+
896
+ async function handleVerifyWork({ taskDescription, prUrl, codeText, imageBase64, imageMimeType, checklistItems }) {
897
+ let data;
898
+ if (imageBase64) {
899
+ if (!imageMimeType || !IMAGE_EXT_BY_MIME[imageMimeType]) {
900
+ throw new Error("imageMimeType must be one of: image/jpeg, image/png, image/webp, image/gif");
901
+ }
902
+ const buffer = Buffer.from(imageBase64, "base64");
903
+ const form = new FormData();
904
+ form.append("taskDescription", taskDescription);
905
+ form.append("image", new Blob([buffer], { type: imageMimeType }), `image.${IMAGE_EXT_BY_MIME[imageMimeType]}`);
906
+ const res = await fetch(`${BASE_URL}/api/verify/standalone`, {
907
+ method: "POST",
908
+ headers: { ...authHeader },
909
+ body: form,
910
+ });
911
+ data = await res.json();
912
+ if (!res.ok) throw new Error(data.error ?? `HTTP ${res.status}`);
913
+ } else {
914
+ if (!prUrl && !codeText) {
915
+ throw new Error("Provide either prUrl (GitHub PR URL), codeText, or imageBase64 + imageMimeType.");
916
+ }
917
+ data = await apiPost("/api/verify/standalone", { taskDescription, prUrl, codeText, checklistItems });
888
918
  }
889
- const data = await apiPost("/api/verify/standalone", { taskDescription, prUrl, codeText, checklistItems });
890
919
  const decision = data.decision === "YES" ? "✅ VERIFIED" : "❌ NOT VERIFIED";
891
920
  const conf = data.confidence != null ? ` (${data.confidence}% confidence)` : "";
892
921
  const checklistNote = data.checklistResults
@@ -941,7 +970,7 @@ async function handleWatchVerification({ milestoneId, content, filename }) {
941
970
  // ─── MCP Server ───────────────────────────────────────────────────────────────
942
971
 
943
972
  const server = new Server(
944
- { name: "cascrow", version: "1.5.0" },
973
+ { name: "cascrow", version: "1.5.1" },
945
974
  { capabilities: { tools: {} } }
946
975
  );
947
976
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cascrow-mcp",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "MCP server for Cascrow — AI-verified milestone escrow on the XRP Ledger",
5
5
  "type": "module",
6
6
  "main": "index.js",