@saihm/mcp-server-pro 0.1.6 → 0.1.7
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/client.js +15 -0
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -291,12 +291,27 @@ export class SaihmProClient {
|
|
|
291
291
|
if (this.tier === undefined) {
|
|
292
292
|
throw new SaihmEndpointError(0, 'no_tier', 'join requires a tier (set SAIHM_TIER)');
|
|
293
293
|
}
|
|
294
|
+
const ch = await this.onboardFetch(this.onboardBase + '/api/onboard/challenge', { method: 'GET' });
|
|
295
|
+
const nonce = ch.nonce;
|
|
296
|
+
if (typeof nonce !== 'string' || nonce.length === 0) {
|
|
297
|
+
throw new SaihmEndpointError(502, 'checkout_no_nonce', 'onboard challenge returned no nonce');
|
|
298
|
+
}
|
|
299
|
+
let nonceBytes;
|
|
300
|
+
try {
|
|
301
|
+
nonceBytes = fromHex(nonce);
|
|
302
|
+
}
|
|
303
|
+
catch {
|
|
304
|
+
throw new SaihmEndpointError(502, 'checkout_bad_nonce', 'onboard challenge nonce is not hex');
|
|
305
|
+
}
|
|
306
|
+
const signature = toHex(signChallenge(this.identity.mldsaSecretKey, nonceBytes));
|
|
294
307
|
const out = await this.onboardFetch(this.onboardBase + '/api/stripe/checkout', {
|
|
295
308
|
method: 'POST',
|
|
296
309
|
headers: { 'content-type': 'application/json' },
|
|
297
310
|
body: JSON.stringify({
|
|
298
311
|
tier: this.tier,
|
|
299
312
|
mldsaPubKey: toHex(this.identity.mldsaPubKey),
|
|
313
|
+
nonce,
|
|
314
|
+
signature,
|
|
300
315
|
uiMode: 'hosted',
|
|
301
316
|
}),
|
|
302
317
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saihm/mcp-server-pro",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "SAIHM production thin-client. Seals client-side via @saihm/client-pro (ML-DSA-65 identity, per-cell AES-256-GCM DEK wrapped under a client KEK, ML-KEM-768 authenticated sharing) and POSTs opaque ciphertext to the blind, non-custodial SAIHM /mcp endpoint. The master secret, KEK, and plaintext never leave this process. Apache-2.0.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|