mppx 0.11.0 → 0.12.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/CHANGELOG.md +28 -0
- package/README.md +22 -1
- package/dist/cli/agent.d.ts +3 -0
- package/dist/cli/agent.js +20 -0
- package/dist/cli/cli.d.ts +1 -1
- package/dist/cli/cli.js +135 -135
- package/dist/cli/plugins/index.js +12 -12
- package/dist/cli/validate/payment.js +29 -12
- package/dist/evm/server/Methods.d.ts +164 -3
- package/dist/evm/server/Methods.js +50 -2
- package/dist/internal/version.d.ts +2 -2
- package/dist/internal/version.js +1 -1
- package/dist/server/Mppx.d.ts +5 -1
- package/dist/server/Mppx.js +120 -49
- package/dist/server/internal/html/compose.main.gen.d.ts +1 -1
- package/dist/server/internal/html/serviceWorker.gen.d.ts +1 -1
- package/dist/stripe/server/Methods.js +2 -4
- package/dist/stripe/server/internal/html.gen.d.ts +1 -1
- package/dist/tempo/internal/currencies.d.ts +19 -0
- package/dist/tempo/internal/currencies.js +41 -0
- package/dist/tempo/internal/defaults.d.ts +5 -3
- package/dist/tempo/internal/defaults.js +6 -2
- package/dist/tempo/internal/fee-payer.d.ts +5 -4
- package/dist/tempo/internal/fee-payer.js +7 -5
- package/dist/tempo/server/Charge.d.ts +12 -1
- package/dist/tempo/server/Charge.js +34 -32
- package/dist/tempo/server/Methods.d.ts +5003 -40
- package/dist/tempo/server/Methods.js +104 -13
- package/dist/tempo/server/internal/html.gen.d.ts +1 -1
- package/dist/tempo/server/internal/html.gen.js +1 -1
- package/dist/tempo/session/server/ChannelStore.d.ts +2 -0
- package/dist/tempo/session/server/ChannelStore.js +12 -3
- package/dist/tempo/session/server/CredentialVerification.d.ts +2 -0
- package/dist/tempo/session/server/CredentialVerification.js +22 -13
- package/dist/tempo/session/server/RequestState.d.ts +6 -0
- package/dist/tempo/session/server/RequestState.js +11 -4
- package/dist/tempo/session/server/Session.js +8 -1
- package/dist/tempo/session/server/Settlement.d.ts +2 -0
- package/dist/tempo/session/server/Settlement.js +13 -8
- package/dist/tempo/subscription/KeyAuthorization.d.ts +70 -8
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# mppx
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e4f0e02: Added ordered `currencies` configuration to the Tempo and EVM server factories, with OUSD followed by USDC.e on Tempo mainnet and OUSD followed by pathUSD on Moderato. Added chain-aware viem token-set support and deprecated the factories' singular `currency` option. Explicit currency configuration continued to restrict acceptance to that currency.
|
|
8
|
+
|
|
9
|
+
Changed `tempo.charge()`, `tempo.session()`, and `tempo.subscription()` to return ordered method groups. Existing `methods: [tempo.charge(options)]` configuration remained supported. Code inspecting a single method directly must now destructure the returned group; explicit composition should use configured handlers such as `mppx.tempo.charge`. Wire Challenges and per-handler currency overrides remained singular.
|
|
10
|
+
|
|
11
|
+
Preserved offer selection, callbacks, and error responses through nested composition. Preserved proof replay policy without a configured store and honored explicit charge chain IDs. Shared session storage and settlement dispatch across accepted currencies, applied settlement thresholds using each channel's currency, and initialized session extensions without mutating previously created methods. Preserved each existing subscription's authorized currency during reuse and renewal, and defaulted new subscription offers to mainnet, with `testnet: true` selecting Moderato.
|
|
12
|
+
|
|
13
|
+
Reduced package size by removing duplicated HTML bundle literals from generated type declarations.
|
|
14
|
+
|
|
15
|
+
Pinned workspace viem dependencies to the public `2.57.1` release and required `viem >=2.57.1` as a peer dependency.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 1d08567: Added AI agent attribution to the CLI User-Agent header when a recognized environment signal is present.
|
|
20
|
+
- 869885e: Added `allowedFeeTokens` for sponsored Tempo charges. Preserved local token defaults and allowed hosted sponsors to choose their fee token unless explicitly restricted.
|
|
21
|
+
- 3a23894: Fixed implicit and explicit composition to preserve each configured method's identity, currency defaults, and offer order. Resolved standalone credentials against configured request bindings, rejected ambiguous method matches, and limited per-method payment success hooks to the selected method.
|
|
22
|
+
- dcf1589: Fixed CLI agent attribution test isolation across agent environments.
|
|
23
|
+
- 75cb219: Fixed hosted fee sponsorship for credential-triggered Tempo session settlement and close.
|
|
24
|
+
- fe2e66e: Fixed split-charge verification to reject payment transfers with attribution memos bound to conflicting challenges or realms.
|
|
25
|
+
- 8d2fb06: Fixed Tempo session content requests to require a voucher advance before charging, preventing an accepted cumulative voucher from authorizing multiple responses while preserving idempotent management updates.
|
|
26
|
+
- 8829293: Allowed `hostedFeePayer: true` in Stripe test mode by applying hosted fee sponsorship only in live mode.
|
|
27
|
+
- 8405b23: Fixed Stripe sandbox sessions to use Tempo testnet.
|
|
28
|
+
- 7159693: Fixed testnet validation of streaming Tempo sessions.
|
|
29
|
+
- 420b99b: Added automatic testnet faucet funding for session operators in `mppx validate`.
|
|
30
|
+
|
|
3
31
|
## 0.11.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -51,7 +51,6 @@ import { Mppx, tempo } from 'mppx/server'
|
|
|
51
51
|
const mppx = Mppx.create({
|
|
52
52
|
methods: [
|
|
53
53
|
tempo({
|
|
54
|
-
currency: '0x20c0000000000000000000000000000000000000',
|
|
55
54
|
recipient: '0x742d35Cc6634c0532925a3b844bC9e7595F8fE00',
|
|
56
55
|
}),
|
|
57
56
|
],
|
|
@@ -226,3 +225,25 @@ Built on the ["Payment" HTTP Authentication Scheme](https://datatracker.ietf.org
|
|
|
226
225
|
## License
|
|
227
226
|
|
|
228
227
|
MIT
|
|
228
|
+
|
|
229
|
+
### Accepted Tempo currencies
|
|
230
|
+
|
|
231
|
+
`tempo()`, `tempo.charge()`, `tempo.session()`, and `tempo.subscription()` offer OUSD first, followed by USDC.e on mainnet or pathUSD on Moderato (`testnet: true`). Each factory returns a group accepted directly by `Mppx.create`. Clients choose one offer; ordering does not trigger an automatic swap.
|
|
232
|
+
|
|
233
|
+
```ts
|
|
234
|
+
import { Mppx, tempo } from 'mppx/server'
|
|
235
|
+
import { ousd, usdce } from 'viem/tokens'
|
|
236
|
+
|
|
237
|
+
const mppx = Mppx.create({
|
|
238
|
+
methods: [
|
|
239
|
+
tempo.charge({
|
|
240
|
+
currencies: [ousd, usdce],
|
|
241
|
+
recipient: '0x742d35Cc6634c0532925a3b844bC9e7595F8fE00',
|
|
242
|
+
}),
|
|
243
|
+
],
|
|
244
|
+
})
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Omit `currencies` for the network defaults, or use `currencies: [ousd]` to accept only OUSD on mainnet. Explicit lists replace the defaults. The deprecated `currency` option also restricts acceptance to one token. Wire requests and handler overrides continue to use singular `currency`.
|
|
248
|
+
|
|
249
|
+
Use configured handlers such as `mppx.tempo.charge` when composing payments. Code that directly inspects a Method can destructure the group: `const [charge] = tempo.charge({ currencies: [ousd] })`. Existing sessions and subscriptions continue using their originally authorized currency.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const agentSignals = [
|
|
2
|
+
['ANTIGRAVITY_CLI_ALIAS', 'antigravity'],
|
|
3
|
+
['CLAUDECODE', 'claude_code'],
|
|
4
|
+
['CLINE_ACTIVE', 'cline'],
|
|
5
|
+
['CODEX_SANDBOX', 'codex_cli'],
|
|
6
|
+
['CODEX_THREAD_ID', 'codex_cli'],
|
|
7
|
+
['CODEX_SANDBOX_NETWORK_DISABLED', 'codex_cli'],
|
|
8
|
+
['CODEX_CI', 'codex_cli'],
|
|
9
|
+
['CURSOR_AGENT', 'cursor'],
|
|
10
|
+
['GEMINI_CLI', 'gemini_cli'],
|
|
11
|
+
['OPENCODE', 'open_code'],
|
|
12
|
+
['OPENCLAW_SHELL', 'openclaw'],
|
|
13
|
+
['CLAUDE_CODE_ENTRYPOINT', 'claude_code'],
|
|
14
|
+
['CODEX_INTERNAL_ORIGINATOR_OVERRIDE', 'codex_cli'],
|
|
15
|
+
];
|
|
16
|
+
/** Returns the first recognized AI agent in signal priority order. */
|
|
17
|
+
export function detectAgent(env = process.env) {
|
|
18
|
+
return agentSignals.find(([variable]) => env[variable])?.[1];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=agent.js.map
|