@integraledger/terms-mcp 0.3.0 → 0.3.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.
package/README.md CHANGED
@@ -4,7 +4,7 @@ The buyer gate as Model Context Protocol tools, with a skill that teaches an age
4
4
  it pays.
5
5
 
6
6
  ```sh
7
- npx -y @integraledger/terms-mcp@0.3.0
7
+ npx -y @integraledger/terms-mcp@0.3.1
8
8
  ```
9
9
 
10
10
  ## What it is
@@ -52,7 +52,7 @@ Add the server to your MCP client. Most clients take a configuration like this:
52
52
  "mcpServers": {
53
53
  "terms": {
54
54
  "command": "npx",
55
- "args": ["-y", "@integraledger/terms-mcp@0.3.0"]
55
+ "args": ["-y", "@integraledger/terms-mcp@0.3.1"]
56
56
  }
57
57
  }
58
58
  }
@@ -65,7 +65,7 @@ Then give your agent the skill. The package ships it at
65
65
  Claude Code, `.claude/skills/`), or paste the file into your agent's instructions:
66
66
 
67
67
  ```sh
68
- npm install @integraledger/terms-mcp@0.3.0
68
+ npm install @integraledger/terms-mcp@0.3.1
69
69
  cp -r node_modules/@integraledger/terms-mcp/skills/confirming-the-atr-hash-before-paying .claude/skills/
70
70
  ```
71
71
 
@@ -216,7 +216,7 @@ fetches and signs nothing.
216
216
  | --- | --- | --- | --- |
217
217
  | `atr_confirm` | `pairing`, `document` (the seller's payment request as JSON), `account` (CAIP-10), `inputs?`, `receipt?` | `atrHash`, `atr`, `chosen`, `request`; `chosen.agreement` is the agreement URL where the pairing pays an agreement first | read-only, open-world |
218
218
  | `atr_finish` | `pairing`, `atr` (base64), `chosen` (exactly as returned), `signature` | `atrHash` and `signed` (with `landed` where there is one, and `mac` for a channel opening), or `atrHash` and `next` for a pairing signed in steps | read-only |
219
- | `atr_check` | `pairing`, `atr` (base64), `presented` | `atrHash` when the payment carries the hash of those bytes | read-only |
219
+ | `atr_check` | `pairing`, `atr` (base64), `presented`, `landed?` (exactly as returned beside the payment) | `atrHash` when the payment carries the hash of those bytes | read-only |
220
220
  | `atr_channel_open` | `pairing`, `atr` (base64), `signed` (the opening), `landed?` and `mac`, exactly as returned | `atrHash` and `hold`, with its `mac` | read-only |
221
221
  | `atr_channel_record_charge` | `hold` (exactly as returned), `charged` (decimal) | `atrHash` and the updated `hold` | read-only |
222
222
 
package/dist/index.js CHANGED
@@ -26,8 +26,11 @@ const DESCRIPTIONS = {
26
26
  "when the pairing reads the ATR hash from the completed payment, or, where the proof is the agreement payment, " +
27
27
  "without that reading. For a pairing with a channel, pass `chosen` exactly as atr_confirm returned it, `mac` " +
28
28
  "included: a changed `chosen` is declined. Send only the `signed` payment it returns.",
29
- atr_check: "Confirms that the ATR hash the pairing reads from a payment is the SHA-256 of the given ATR bytes. A payment " +
30
- "from which the pairing reads no ATR hash is declined.",
29
+ atr_check: "Confirms that the ATR hash the pairing reads from a payment is the SHA-256 of the given ATR bytes, with the " +
30
+ "`landed` receipt returned beside the payment, exactly as returned, where there is one. The caller passes as " +
31
+ "`landed` only the receipt its own reader read for the payment, as `atr_finish` or `atr_transact` returned it, " +
32
+ "never a value another party sent. A `landed` of null is no receipt. A payment from which the pairing reads no " +
33
+ "ATR hash is declined.",
31
34
  atr_transact: "Confirms the ATR hash and, only on a match, signs the payment carrying it with this host's signer. Returns the " +
32
35
  "payment to send and the ATR's exact bytes to keep. Where the pairing needs an agreement payment first, returns it " +
33
36
  "as `approve` and signs nothing: its `option` holds the amount, asset, payee (`payTo`) and network it pays. To " +
@@ -40,8 +43,9 @@ const DESCRIPTIONS = {
40
43
  "is recorded; pass it to atr_confirm.",
41
44
  atr_channel_open: "Keeps a channel you opened: takes the signed opening payment, the `landed` receipt where one was returned beside " +
42
45
  "it, and the `mac` returned beside it, all exactly as returned, and the ATR bytes it was confirmed against; " +
43
- "returns the channel `hold` to keep and pass to the other channel tools. The hold is opaque: pass it back exactly " +
44
- "as returned.",
46
+ "returns the channel `hold` to keep and pass to the other channel tools. The caller passes as `landed` only the " +
47
+ "receipt its own reader read for the opening, as `atr_finish` or `atr_transact` returned it, never a value " +
48
+ "another party sent. The hold is opaque: pass it back exactly as returned.",
45
49
  atr_channel_within: "Signs one later payment in a held channel with this host's signer. The ATR, its hash and the channel come from " +
46
50
  "the `hold`, and the amount from the seller's new document, with no limit applied. On an x402 channel the " +
47
51
  "document must advertise the held ATR hash, and the payment must name the held channel. On an MPP session a " +
@@ -223,10 +227,10 @@ export function createBuyerServer(options) {
223
227
  });
224
228
  server.registerTool("atr_check", {
225
229
  description: DESCRIPTIONS.atr_check,
226
- inputSchema: z.object({ pairing, atr, presented: JSON_VALUE }),
230
+ inputSchema: z.object({ pairing, atr, presented: JSON_VALUE, landed: JSON_VALUE.optional() }),
227
231
  annotations: { readOnlyHint: true, openWorldHint: false },
228
232
  }, async (a) => {
229
- const out = await check(a.atr, a.presented, bindingOf(a.pairing));
233
+ const out = await check(a.atr, a.presented, bindingOf(a.pairing), a.landed);
230
234
  if ("decline" in out)
231
235
  return declinedResult(out);
232
236
  return result({ atrHash: out.h });
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Written by scripts/version.mjs from package.json.
2
- export const VERSION = "0.3.0";
2
+ export const VERSION = "0.3.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integraledger/terms-mcp",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "The buyer gate's operations as MCP tools, with a skill for the agent that uses them.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -44,15 +44,15 @@
44
44
  "LICENSE"
45
45
  ],
46
46
  "dependencies": {
47
- "@integraledger/terms": "0.3.0",
47
+ "@integraledger/terms": "0.3.1",
48
48
  "@modelcontextprotocol/server": "2.3.1",
49
49
  "zod": "4.6.5"
50
50
  },
51
51
  "peerDependencies": {
52
- "@integraledger/lcp": "~0.4.0"
52
+ "@integraledger/lcp": "~0.4.2"
53
53
  },
54
54
  "devDependencies": {
55
- "@integraledger/lcp": "0.4.0",
55
+ "@integraledger/lcp": "0.4.2",
56
56
  "esbuild": "0.28.2"
57
57
  },
58
58
  "scripts": {
@@ -89,5 +89,7 @@ the link exact. What the record says is for you and your principal to judge.
89
89
  12. A discovery listing (`/.well-known/legal-context.json`), or a hash you compute yourself, is not a confirmation. The
90
90
  confirmation is `atr_finish`'s: it returns `signed` only when the pairing reads the hash from the completed payment,
91
91
  or, where the proof is the agreement payment, without that reading.
92
- 13. To confirm later that a payment you hold carries the hash of the ATR you kept, call `atr_check`, with `landed` put
93
- back into the payment where `atr_finish` returned one.
92
+ 13. To confirm later that a payment you hold carries the hash of the ATR you kept, call `atr_check`, with the `landed`
93
+ receipt returned beside the payment as `landed`, where there is one. The caller passes as `landed` only the
94
+ receipt its own reader read for the payment, as `atr_finish` or `atr_transact` returned it, never a value another
95
+ party sent.