Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/calm-sessions-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
Comment thread
gakonst marked this conversation as resolved.
'mppx': patch
---

Added payer-isolated SQLite session reuse, cross-process scope leases, and shared Node APIs and CLI commands for listing, recovering, reconciling, and receipt-confirmed closing of durable Tempo sessions.
7 changes: 7 additions & 0 deletions .changeset/fresh-viem-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'mppx': patch
---

Replaced the expired Viem pull-request preview with the published release containing the Tempo relay
signature fix, raised the Viem peer floor to that fixed release, rejected non-primitive subscription
authorization signatures before encoding, and resolved the current brace-expansion audit advisory.
31 changes: 23 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,23 @@ Mppx.create({
const res = await fetch('https://mpp.dev/api/ping/paid')
```

Node clients can persist durable session state while supplying their own account implementation:

```ts
import { sessionManager } from 'mppx/client'
import { createSqliteChannelStore } from 'mppx/client/node'

const channelStore = createSqliteChannelStore({
namespace: new URL(endpoint).origin,
payer: account.address,
})
const manager = sessionManager({ account, bootstrap: true, channelStore, client })
```

The default channel database is `~/.tempo/wallet/channels.db`; pass `path` to override it.
The SQLite-backed Node APIs, CLI session requests, and persistent session commands require Node.js
22.5 or newer. Other CLI commands continue to support the package's Node.js baseline.

## Examples

| Example | Description |
Expand All @@ -109,18 +126,16 @@ mppx account create
# make request - automatic payment handling, curl-like api
mppx example.com

# open another session instead of reusing the preferred channel
mppx example.com --session new

# inspect and close retained sessions
mppx sessions list
mppx sessions view <channel-id>
mppx sessions close <channel-id>
mppx sessions close --all --yes
mppx sessions sync
mppx sessions close <channel-id> # cooperative by default
mppx sessions close <channel-id> --on-chain # start/finalize precompile close
```

`--session auto` is the default. Pass `new` to open another channel or a channel ID to select one
explicitly.
Cold clients recover an existing session through the server's standard session bootstrap and write
the resulting snapshot to the SQLite channel database. MPPx does not keep a second CLI-specific
session registry or parse external wallet state.

You can also install globally to use the `mppx` CLI from anywhere:

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"testcontainers": "^12.0.4",
"tsx": "^4.22.4",
"typescript": "~6.0.3",
"viem": "https://pkg.pr.new/viem@4880",
"viem": "2.55.8",
"vite": "^8.1.3",
"vp": "npm:vite-plus@~0.1.24",
"ws": "^8.21.0",
Expand Down Expand Up @@ -212,7 +212,7 @@
"elysia": ">=1",
"express": ">=5",
"hono": ">=4.12.25",
"viem": ">=2.54.0"
"viem": ">=2.55.7"
},
"peerDependenciesMeta": {
"@modelcontextprotocol/sdk": {
Expand All @@ -232,7 +232,7 @@
"@stripe/stripe-js": "9.9.0",
"eventsource-parser": "3.1.0",
"incur": "^0.4.10",
"ox": "0.14.30",
"ox": "0.14.32",
"zod": "^4.4.3"
},
"repository": {
Expand Down
Loading
Loading