@prismnetwork/mcp 0.8.3 → 0.8.4

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/package.json +1 -1
  2. package/server.mjs +11 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismnetwork/mcp",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "MCP server for leasing and running on Prism Network GPUs.",
5
5
  "mcpName": "tech.prismnetwork/mcp",
6
6
  "type": "module",
package/server.mjs CHANGED
@@ -112,6 +112,14 @@ function requireCommand(value) {
112
112
  return value;
113
113
  }
114
114
 
115
+ // What the escrow actually holds, which is what the day's budget should count.
116
+ // Booking the caller's ceiling instead charged a 0.2 USDG lease against a 0.5
117
+ // USDG cap, so a 5 USDG day bought ten leases where it could afford twenty-five.
118
+ function escrowed(quote) {
119
+ const held = Number(quote?.maximum_escrow);
120
+ return Number.isFinite(held) && held > 0 ? held : undefined;
121
+ }
122
+
115
123
  // The per-call ceiling is the operator's, not the model's: an omitted max_usdg
116
124
  // takes the configured cap rather than a hardcoded one, and a stated max_usdg
117
125
  // above it is refused when the ledger checks the commit.
@@ -495,6 +503,7 @@ async function handle(name, args) {
495
503
  });
496
504
  return {
497
505
  reference: batch.fundingHash,
506
+ settledMicros: escrowed(batch.quote),
498
507
  value: {
499
508
  lease_id: batch.leaseId,
500
509
  funding_tx: batch.fundingHash,
@@ -592,7 +601,7 @@ async function handle(name, args) {
592
601
  maxDeposit: cap,
593
602
  minTrustClass: args.min_trust_class ?? "open",
594
603
  });
595
- return { value: funded, reference: funded.fundingHash };
604
+ return { value: funded, reference: funded.fundingHash, settledMicros: escrowed(funded.quote) };
596
605
  });
597
606
  leases.set(lease.leaseId, lease);
598
607
  const summary = {
@@ -690,7 +699,7 @@ async function handleVault(name, args) {
690
699
  throw new Error(`unknown tool ${name}`);
691
700
  }
692
701
 
693
- const server = new Server({ name: "prism", version: "0.8.3" }, { capabilities: { tools: {} } });
702
+ const server = new Server({ name: "prism", version: "0.8.4" }, { capabilities: { tools: {} } });
694
703
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
695
704
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
696
705
  try {