cascrow-mcp 1.0.2 → 1.1.0

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 (2) hide show
  1. package/index.js +54 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -241,6 +241,34 @@ const TOOLS = [
241
241
  },
242
242
  },
243
243
  },
244
+ {
245
+ name: "cascrow_handoff",
246
+ description:
247
+ "Send a contract invite to a Builder agent by email. " +
248
+ "Use this after cascrow_create_contract to delegate the work to another agent. " +
249
+ "The Builder agent will automatically pick up the invite via cascrow_check_invites.",
250
+ inputSchema: {
251
+ type: "object",
252
+ required: ["inviteCode", "builderEmail", "contractId"],
253
+ properties: {
254
+ inviteCode: { type: "string", description: "The invite code returned by cascrow_create_contract" },
255
+ builderEmail: { type: "string", description: "Email address of the Builder agent" },
256
+ contractId: { type: "string", description: "The contract ID returned by cascrow_create_contract" },
257
+ message: { type: "string", description: "Optional instructions for the Builder agent" },
258
+ },
259
+ },
260
+ },
261
+ {
262
+ name: "cascrow_check_invites",
263
+ description:
264
+ "Check for pending contract invites sent to this agent. " +
265
+ "Use this as a Builder agent to discover work assigned to you. " +
266
+ "Returns unclaimed invites and marks them as claimed. Poll every few seconds until an invite appears.",
267
+ inputSchema: {
268
+ type: "object",
269
+ properties: {},
270
+ },
271
+ },
244
272
  ];
245
273
 
246
274
  // ─── Tool handlers ────────────────────────────────────────────────────────────
@@ -346,6 +374,26 @@ async function handleGetContract({ contractId }) {
346
374
  return data;
347
375
  }
348
376
 
377
+ async function handleHandoff({ inviteCode, builderEmail, contractId, message }) {
378
+ const data = await apiPost("/api/agent/handoff", { inviteCode, builderEmail, contractId, message });
379
+ return {
380
+ handoffId: data.handoffId,
381
+ message: `Invite sent to Builder agent (${builderEmail}). They will pick it up automatically via cascrow_check_invites.`,
382
+ };
383
+ }
384
+
385
+ async function handleCheckInvites() {
386
+ const data = await apiGet("/api/agent/pending-invites");
387
+ const invites = data.invites ?? [];
388
+ if (invites.length === 0) {
389
+ return { invites: [], message: "No pending invites. Poll again in a few seconds." };
390
+ }
391
+ return {
392
+ invites,
393
+ message: `Found ${invites.length} invite(s). Use cascrow_join_contract with the inviteCode to accept.`,
394
+ };
395
+ }
396
+
349
397
  // ─── MCP Server ───────────────────────────────────────────────────────────────
350
398
 
351
399
  const server = new Server(
@@ -381,6 +429,12 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
381
429
  case "cascrow_get_contract":
382
430
  result = await handleGetContract(args);
383
431
  break;
432
+ case "cascrow_handoff":
433
+ result = await handleHandoff(args);
434
+ break;
435
+ case "cascrow_check_invites":
436
+ result = await handleCheckInvites();
437
+ break;
384
438
  default:
385
439
  throw new Error(`Unknown tool: ${name}`);
386
440
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cascrow-mcp",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "MCP server for Cascrow — agentic escrow and verification",
5
5
  "type": "module",
6
6
  "main": "index.js",