@toon-protocol/client-mcp 0.16.0 → 0.17.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.
- package/dist/{chunk-XFUZJ4XF.js → chunk-6Q3RYIEE.js} +99 -45
- package/dist/chunk-6Q3RYIEE.js.map +1 -0
- package/dist/{chunk-P7YF72JB.js → chunk-UDHZEABQ.js} +303 -663
- package/dist/chunk-UDHZEABQ.js.map +1 -0
- package/dist/{chunk-N7MWQMBC.js → chunk-ZPXVGXGV.js} +2 -2
- package/dist/daemon.js +2 -2
- package/dist/index.d.ts +62 -1
- package/dist/index.js +3 -3
- package/dist/mcp.js +2 -2
- package/package.json +6 -6
- package/dist/chunk-P7YF72JB.js.map +0 -1
- package/dist/chunk-XFUZJ4XF.js.map +0 -1
- /package/dist/{chunk-N7MWQMBC.js.map → chunk-ZPXVGXGV.js.map} +0 -0
|
@@ -2,7 +2,7 @@ import { createRequire as __cr } from 'module'; const require = __cr(import.meta
|
|
|
2
2
|
import {
|
|
3
3
|
ControlApiError,
|
|
4
4
|
DaemonUnreachableError
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UDHZEABQ.js";
|
|
6
6
|
|
|
7
7
|
// ../views/dist/tool-names.js
|
|
8
8
|
var PUBLISH_TOOL = "toon_publish_unsigned";
|
|
@@ -1811,4 +1811,4 @@ export {
|
|
|
1811
1811
|
TOOL_DEFINITIONS,
|
|
1812
1812
|
dispatchTool
|
|
1813
1813
|
};
|
|
1814
|
-
//# sourceMappingURL=chunk-
|
|
1814
|
+
//# sourceMappingURL=chunk-ZPXVGXGV.js.map
|
package/dist/daemon.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ClientRunner,
|
|
5
5
|
registerRoutes,
|
|
6
6
|
scaffoldFirstRun
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6Q3RYIEE.js";
|
|
8
8
|
import {
|
|
9
9
|
ControlClient,
|
|
10
10
|
ToonClient,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
resolveConfig,
|
|
18
18
|
spawnDaemonDetached,
|
|
19
19
|
waitForReady
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-UDHZEABQ.js";
|
|
21
21
|
import "./chunk-32QD72IL.js";
|
|
22
22
|
import "./chunk-DLYE6U2Z.js";
|
|
23
23
|
import "./chunk-LR7W2ISE.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -326,6 +326,16 @@ interface SwapRequest {
|
|
|
326
326
|
* config-seeded apex). The swap peer must be a child peer of this apex.
|
|
327
327
|
*/
|
|
328
328
|
btpUrl?: string;
|
|
329
|
+
/**
|
|
330
|
+
* Mint a FRESH sender-chosen execution condition per packet
|
|
331
|
+
* (`C_i = sha256(P_i)`, toon-client#350 / rolling-swap toon-meta#145 §3)
|
|
332
|
+
* and verify each FULFILL's preimage client-side; a mismatch counts the
|
|
333
|
+
* packet failed. Requires a maker + connector implementing the
|
|
334
|
+
* sender-chosen fulfillment contract (connector#309) — the deployed
|
|
335
|
+
* claim-issuing mill does NOT, so this is opt-in; the default (unset)
|
|
336
|
+
* keeps today's legacy zero-condition packets.
|
|
337
|
+
*/
|
|
338
|
+
senderConditions?: boolean;
|
|
329
339
|
}
|
|
330
340
|
/** One accumulated, decrypted claim harvested from a single swap packet. */
|
|
331
341
|
interface SwapClaim {
|
|
@@ -365,6 +375,14 @@ interface SwapResponse {
|
|
|
365
375
|
code?: string;
|
|
366
376
|
/** First rejection message, if any. */
|
|
367
377
|
message?: string;
|
|
378
|
+
/**
|
|
379
|
+
* Early wire-skew alarm (#349): set when packets were FULFILLed but no
|
|
380
|
+
* accepted claim carries `swapSignerAddress` settlement metadata — the
|
|
381
|
+
* signature of a pre-rename (sdk <2.0.0) swap peer whose `millSignerAddress`
|
|
382
|
+
* field sdk ≥2 silently drops. Settling such claims fails later with
|
|
383
|
+
* `MISSING_SETTLEMENT_METADATA`; this surfaces the problem at swap time.
|
|
384
|
+
*/
|
|
385
|
+
warning?: string;
|
|
368
386
|
}
|
|
369
387
|
/**
|
|
370
388
|
* `POST /http-fetch-paid` — payment-aware HTTP GET/POST. The daemon issues the
|
|
@@ -1276,6 +1294,14 @@ interface ToonClientLike {
|
|
|
1276
1294
|
amount: bigint;
|
|
1277
1295
|
toonData: Uint8Array;
|
|
1278
1296
|
claim?: unknown;
|
|
1297
|
+
/**
|
|
1298
|
+
* Sender-chosen 32-byte execution condition (toon-client#350). The
|
|
1299
|
+
* transport puts it on the PREPARE and verifies the FULFILL preimage
|
|
1300
|
+
* (`sha256(fulfillment) == condition`); absent/all-zero = legacy packet.
|
|
1301
|
+
*/
|
|
1302
|
+
executionCondition?: Uint8Array;
|
|
1303
|
+
/** Explicit ILP expiry; defaults to `now + timeout` in the transport. */
|
|
1304
|
+
expiresAt?: Date;
|
|
1279
1305
|
}): Promise<{
|
|
1280
1306
|
accepted: boolean;
|
|
1281
1307
|
data?: string;
|
|
@@ -1563,8 +1589,43 @@ declare class ClientRunner {
|
|
|
1563
1589
|
settleChannel(req: SettleChannelRequest): Promise<SettleChannelResponse>;
|
|
1564
1590
|
/** Run `fn` against the apex client that tracks `channelId`, else throw. */
|
|
1565
1591
|
private withTrackingApex;
|
|
1566
|
-
/**
|
|
1592
|
+
/**
|
|
1593
|
+
* Swap source→target asset against a swap peer via the selected apex.
|
|
1594
|
+
*
|
|
1595
|
+
* sdk ≥2.0.0 (the `mill`→`swap` vocabulary rename, toon commit `af4cd24`):
|
|
1596
|
+
* `streamSwap` takes `swapPubkey`/`swapIlpAddress` and accumulated claims
|
|
1597
|
+
* carry `swapSignerAddress`. The rename has NO wire back-compat — a
|
|
1598
|
+
* pre-rename (sdk ≤1.x) swap peer still emits `millSignerAddress` in its
|
|
1599
|
+
* FULFILL settlement metadata, which `decodeFulfillMetadata` silently drops
|
|
1600
|
+
* as an unknown field. That skew would otherwise surface only much later as
|
|
1601
|
+
* `MISSING_SETTLEMENT_METADATA` in `buildSettlementTx`, so we detect it
|
|
1602
|
+
* here (accepted claims with no `swapSignerAddress`) and surface a loud
|
|
1603
|
+
* `warning` on the response at swap time (#349).
|
|
1604
|
+
*
|
|
1605
|
+
* With `req.senderConditions` set, every swap packet is sent with a FRESH
|
|
1606
|
+
* sender-minted execution condition (`C_i = sha256(P_i)`, one per packet —
|
|
1607
|
+
* toon-client#350, rolling-swap spec §3 R1/R2) and the transport verifies
|
|
1608
|
+
* each FULFILL's preimage; a mismatch counts the packet failed. This
|
|
1609
|
+
* requires a maker/connector implementing the sender-chosen fulfillment
|
|
1610
|
+
* contract (connector#309) — the deployed claim-issuing mill cannot satisfy
|
|
1611
|
+
* it — so it is opt-in and the default stays the legacy zero condition.
|
|
1612
|
+
*/
|
|
1567
1613
|
swap(req: SwapRequest): Promise<SwapResponse>;
|
|
1614
|
+
/**
|
|
1615
|
+
* Wrap an apex client so each `sendSwapPacket` call carries a freshly
|
|
1616
|
+
* minted sender-chosen execution condition (one preimage per packet, spec
|
|
1617
|
+
* R1 — reuse would let an observer of packet *i* fulfill packet *i+1*).
|
|
1618
|
+
* `streamSwap` calls `sendSwapPacket` once per packet, so minting here
|
|
1619
|
+
* yields exactly one condition per packet. The transports verify each
|
|
1620
|
+
* FULFILL's preimage against the condition and fail the packet on mismatch.
|
|
1621
|
+
*
|
|
1622
|
+
* NOTE: the minted preimage is intentionally NOT retained yet — leg-B
|
|
1623
|
+
* receive-side ingestion (where the sender reveals `P_i`) is a separate
|
|
1624
|
+
* rolling-swap workstream (toon-meta docs/rolling-swap.md §3.2). Until a
|
|
1625
|
+
* maker implements the connector#309 contract end-to-end, packets sent with
|
|
1626
|
+
* conditions will fail closed rather than settle unverified.
|
|
1627
|
+
*/
|
|
1628
|
+
private withSenderConditions;
|
|
1568
1629
|
/**
|
|
1569
1630
|
* Payment-aware HTTP fetch through an apex's client. The client issues the
|
|
1570
1631
|
* request and, on `402 Payment Required`, pays over TOON and retries; we
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
hasConfiguredIdentity,
|
|
9
9
|
registerRoutes,
|
|
10
10
|
scaffoldFirstRun
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6Q3RYIEE.js";
|
|
12
12
|
import {
|
|
13
13
|
PUBLISH_TOOL,
|
|
14
14
|
TOOL_DEFINITIONS,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
buildFollowListFilter,
|
|
19
19
|
buildProfileFilter,
|
|
20
20
|
dispatchTool
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ZPXVGXGV.js";
|
|
22
22
|
import {
|
|
23
23
|
ControlApiError,
|
|
24
24
|
ControlClient,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
resolveMnemonic,
|
|
37
37
|
spawnDaemonDetached,
|
|
38
38
|
waitForReady
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-UDHZEABQ.js";
|
|
40
40
|
import "./chunk-32QD72IL.js";
|
|
41
41
|
import "./chunk-DLYE6U2Z.js";
|
|
42
42
|
import "./chunk-LR7W2ISE.js";
|
package/dist/mcp.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
APP_RESOURCE_URI,
|
|
5
5
|
TOOL_DEFINITIONS,
|
|
6
6
|
dispatchTool
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZPXVGXGV.js";
|
|
8
8
|
import {
|
|
9
9
|
ARWEAVE_GATEWAYS,
|
|
10
10
|
ControlClient,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
readConfigFile,
|
|
14
14
|
spawnDaemonDetached,
|
|
15
15
|
waitForReady
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UDHZEABQ.js";
|
|
17
17
|
import "./chunk-32QD72IL.js";
|
|
18
18
|
import "./chunk-DLYE6U2Z.js";
|
|
19
19
|
import "./chunk-LR7W2ISE.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toon-protocol/client-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Always-on local daemon + MCP server letting a Claude agent (Desktop or Code) act as a TOON Protocol client: pay-to-write publishing, free reads, channel/balance management, and swaps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Jonathan Green",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@anthropic-ai/claude-agent-sdk": "0.3.186",
|
|
43
|
-
"@toon-protocol/core": "^
|
|
44
|
-
"@toon-protocol/sdk": "^0.
|
|
43
|
+
"@toon-protocol/core": "^2.0.0",
|
|
44
|
+
"@toon-protocol/sdk": "^2.0.0",
|
|
45
45
|
"@types/node": "^20.0.0",
|
|
46
46
|
"@types/ws": "^8.5.10",
|
|
47
47
|
"tsup": "^8.0.0",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"typescript": "^5.3.0",
|
|
50
50
|
"vitest": "^1.0.0",
|
|
51
51
|
"@toon-protocol/arweave": "0.2.0",
|
|
52
|
-
"@toon-protocol/client": "0.
|
|
53
|
-
"@toon-protocol/
|
|
54
|
-
"@toon-protocol/
|
|
52
|
+
"@toon-protocol/client": "0.17.0",
|
|
53
|
+
"@toon-protocol/rig": "2.6.2",
|
|
54
|
+
"@toon-protocol/views": "0.17.0"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=20"
|