@gvnrdao/dh-mcp 0.5.11 → 0.5.12
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/boundary.js +31 -4
- package/dist/connector-embed.js +246 -23
- package/dist/connector.js +247 -24
- package/dist/index.js +32 -5
- package/package.json +2 -2
package/dist/boundary.js
CHANGED
|
@@ -56700,7 +56700,17 @@ function getSepoliaConfig() {
|
|
|
56700
56700
|
function getMainnetConfig() {
|
|
56701
56701
|
return {
|
|
56702
56702
|
mode: "service",
|
|
56703
|
-
|
|
56703
|
+
// Cutover 2026-09-08: the product's own domain. `ops.gvnr.xyz` still serves the same
|
|
56704
|
+
// broker and always will — every already-installed copy of this package calls it, so
|
|
56705
|
+
// it can never be retired. This changes what NEW installs default to, nothing else.
|
|
56706
|
+
//
|
|
56707
|
+
// Safe only because the server accepts the new audience ALREADY: the SDK derives the
|
|
56708
|
+
// login audience from this endpoint (`server-session.ts` — `loginAudience ??
|
|
56709
|
+
// serviceEndpoint`) and lit-ops-server FAILS CLOSED on an unknown one. Verified live
|
|
56710
|
+
// before this edit: DH_ACCEPTED_LOGIN_AUDIENCES on the deployed revision lists
|
|
56711
|
+
// https://ops.diamondhands.credit. Publishing this ahead of that would lock out every
|
|
56712
|
+
// client that installed it.
|
|
56713
|
+
serviceEndpoint: "https://ops.diamondhands.credit",
|
|
56704
56714
|
chainId: 1,
|
|
56705
56715
|
name: "mainnet",
|
|
56706
56716
|
// No default RPC: mainnet runs in service mode (serviceEndpoint above), so
|
|
@@ -80809,12 +80819,25 @@ document.getElementById("generate").onclick = () => submit(true);
|
|
|
80809
80819
|
|
|
80810
80820
|
// src/util/page-headers.ts
|
|
80811
80821
|
var import_node_crypto6 = require("crypto");
|
|
80812
|
-
function htmlPageSecurityHeaders() {
|
|
80822
|
+
function htmlPageSecurityHeaders(extra) {
|
|
80813
80823
|
const nonce = (0, import_node_crypto6.randomBytes)(16).toString("base64");
|
|
80824
|
+
const base = [
|
|
80825
|
+
`default-src 'none'`,
|
|
80826
|
+
`script-src 'nonce-${nonce}'`,
|
|
80827
|
+
`style-src 'unsafe-inline'`,
|
|
80828
|
+
`connect-src 'self'`,
|
|
80829
|
+
`base-uri 'none'`,
|
|
80830
|
+
`form-action 'none'`,
|
|
80831
|
+
`frame-ancestors 'none'`
|
|
80832
|
+
];
|
|
80833
|
+
for (const [directive, sources] of Object.entries(extra ?? {})) {
|
|
80834
|
+
if (sources.length === 0) continue;
|
|
80835
|
+
base.push(`${directive} ${sources.join(" ")}`);
|
|
80836
|
+
}
|
|
80814
80837
|
return {
|
|
80815
80838
|
nonce,
|
|
80816
80839
|
headers: {
|
|
80817
|
-
"Content-Security-Policy":
|
|
80840
|
+
"Content-Security-Policy": base.join("; "),
|
|
80818
80841
|
"X-Frame-Options": "DENY",
|
|
80819
80842
|
"Referrer-Policy": "no-referrer",
|
|
80820
80843
|
"X-Content-Type-Options": "nosniff"
|
|
@@ -81522,7 +81545,11 @@ var NETWORK_DEFAULTS = {
|
|
|
81522
81545
|
},
|
|
81523
81546
|
mainnet: {
|
|
81524
81547
|
rpcUrl: "https://ethereum-rpc.publicnode.com",
|
|
81525
|
-
|
|
81548
|
+
// Cutover 2026-09-08 — see sdk/src/constants/chunks/network-configs.ts for the full
|
|
81549
|
+
// reasoning. Widening, not a rename: ops.gvnr.xyz serves the same broker and cannot be
|
|
81550
|
+
// retired while installed copies call it. The sepolia entry above deliberately stays on
|
|
81551
|
+
// ops-test.gvnr.xyz — there is no ops-test.diamondhands.credit twin (open decision 2).
|
|
81552
|
+
serviceEndpoint: "https://ops.diamondhands.credit",
|
|
81526
81553
|
litNetwork: "chipotle",
|
|
81527
81554
|
// On-chain PKPValidation generation, mainnet (validatorForVersion(3) is the ONLY
|
|
81528
81555
|
// registered validator — verified live 2026-08-05). Without this the SDK defaults
|
package/dist/connector-embed.js
CHANGED
|
@@ -40818,6 +40818,226 @@ source of truth.
|
|
|
40818
40818
|
`;
|
|
40819
40819
|
}
|
|
40820
40820
|
|
|
40821
|
+
// src/connector/landing-page.ts
|
|
40822
|
+
var FAVICON_SVG = `<svg width="512" height="512" viewBox="-6 -11 88 88" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Diamond Hands"><path d="M1.08325 20.7041L37.9038 64.4967L74.2886 20.7041L61.8699 0.877686H13.502L1.08325 20.7041Z" fill="#C9F284" stroke="#34440E" stroke-width="1.75559"/><path d="M13.9385 0.877441L37.9045 64.2785" stroke="#34440E" stroke-width="1.75559"/><path d="M61.6553 0.877441L37.9071 64.4964" stroke="#34440E" stroke-width="1.75559"/><path d="M1.08276 20.7029H74.2882" stroke="#34440E" stroke-width="1.75559"/></svg>`;
|
|
40823
|
+
var FAVICON_DATA_URI = `data:image/svg+xml,${encodeURIComponent(FAVICON_SVG).replace(/'/g, "%27")}`;
|
|
40824
|
+
var BACKGROUND_IMAGE_ORIGIN = "https://images.gvnr.xyz";
|
|
40825
|
+
var BACKGROUND_IMAGE_URL = `${BACKGROUND_IMAGE_ORIGIN}/images/layout/backgroundCorleoneb.jpg`;
|
|
40826
|
+
var escapeHtml = (s) => s.replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]);
|
|
40827
|
+
function moneyReality(networks2) {
|
|
40828
|
+
const mainnet = networks2.includes("mainnet");
|
|
40829
|
+
const sepolia = networks2.includes("sepolia");
|
|
40830
|
+
if (mainnet && sepolia) {
|
|
40831
|
+
return {
|
|
40832
|
+
label: "REAL MONEY on mainnet \xB7 practice funds on sepolia",
|
|
40833
|
+
detail: "This deployment serves both networks. Mainnet moves real BTC and real UCD; sepolia is the test network and its funds are not real. Ask which network you are on before acting."
|
|
40834
|
+
};
|
|
40835
|
+
}
|
|
40836
|
+
if (mainnet) {
|
|
40837
|
+
return {
|
|
40838
|
+
label: "REAL MONEY \u2014 Ethereum mainnet",
|
|
40839
|
+
detail: "This deployment serves mainnet only. Every fund-moving operation moves real BTC and real UCD, and each one needs a fresh signature from your own wallet."
|
|
40840
|
+
};
|
|
40841
|
+
}
|
|
40842
|
+
return {
|
|
40843
|
+
label: "PRACTICE FUNDS \u2014 sepolia test network",
|
|
40844
|
+
detail: "This deployment serves sepolia only. The contracts and ceremonies are real, the money is not. Nothing here can move mainnet funds."
|
|
40845
|
+
};
|
|
40846
|
+
}
|
|
40847
|
+
function renderLandingPage(input) {
|
|
40848
|
+
const { publicOrigin, networks: networks2, version: version2, nonce } = input;
|
|
40849
|
+
const origin2 = escapeHtml(publicOrigin);
|
|
40850
|
+
const money = moneyReality(networks2);
|
|
40851
|
+
const config = JSON.stringify({ mcpServers: { "diamond-hands": { type: "http", url: `${publicOrigin}/mcp` } } }, null, 2);
|
|
40852
|
+
return `<!doctype html>
|
|
40853
|
+
<html lang="en">
|
|
40854
|
+
<head>
|
|
40855
|
+
<meta charset="utf-8">
|
|
40856
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
40857
|
+
<title>Diamond Hands \u2014 MCP endpoint</title>
|
|
40858
|
+
<link rel="icon" type="image/svg+xml" href="${FAVICON_DATA_URI}">
|
|
40859
|
+
<link rel="apple-touch-icon" href="${FAVICON_DATA_URI}">
|
|
40860
|
+
<style>
|
|
40861
|
+
* { margin:0; padding:0; box-sizing:border-box; }
|
|
40862
|
+
/* House treatment (ops.gvnr.xyz, brando.gvnr.xyz): the image fills the viewport,
|
|
40863
|
+
centred and cropped, and the PAGE never scrolls. */
|
|
40864
|
+
html, body { width:100%; height:100%; overflow:hidden; }
|
|
40865
|
+
body {
|
|
40866
|
+
background: url('${BACKGROUND_IMAGE_URL}') center center / cover no-repeat fixed;
|
|
40867
|
+
color:#f3f4f6;
|
|
40868
|
+
font:15px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
|
|
40869
|
+
}
|
|
40870
|
+
/* NO full-page scrim: the photograph is the point, so darkness lives only behind the
|
|
40871
|
+
text that needs to stay legible. The content scrolls INSIDE the viewport rather than
|
|
40872
|
+
the page scrolling, so a short window never clips anything and the image never moves. */
|
|
40873
|
+
.scroll { height:100%; overflow-y:auto; overscroll-behavior:contain; }
|
|
40874
|
+
main { max-width:41rem; margin:0 auto; padding:1.9rem 1.25rem 2rem;
|
|
40875
|
+
text-shadow:0 1px 3px rgba(0,0,0,.85); }
|
|
40876
|
+
/* Wide viewports: the lower half goes side-by-side so the whole page fits without the
|
|
40877
|
+
viewport scrolling \u2014 the house treatment is a full-bleed image, not a long page. */
|
|
40878
|
+
@media (min-width: 62rem) and (min-height: 34rem) {
|
|
40879
|
+
main { max-width:62rem; }
|
|
40880
|
+
.cols { display:grid; grid-template-columns:1fr 1fr; gap:0 1.6rem; align-items:start; }
|
|
40881
|
+
.cols h2:first-child { margin-top:0; }
|
|
40882
|
+
}
|
|
40883
|
+
h1 { font-size:1.35rem; margin:0 0 .25rem; letter-spacing:-.01em; }
|
|
40884
|
+
.sub { color:#dfe3ea; margin:0 0 1.1rem; font-size:14px; }
|
|
40885
|
+
.card { background:rgba(6,8,12,.62); border:1px solid rgba(255,255,255,.16);
|
|
40886
|
+
border-radius:10px; padding:.75rem .95rem; margin:0 0 .8rem;
|
|
40887
|
+
backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); }
|
|
40888
|
+
.money { border-left:3px solid #f59e0b; }
|
|
40889
|
+
.money strong { display:block; margin-bottom:.15rem; }
|
|
40890
|
+
h2 { font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:#cbd2dc;
|
|
40891
|
+
margin:1.1rem 0 .45rem; font-weight:600; }
|
|
40892
|
+
pre { margin:0; padding:.7rem .9rem; background:rgba(0,0,0,.66);
|
|
40893
|
+
border:1px solid rgba(255,255,255,.16); border-radius:8px; overflow-x:auto;
|
|
40894
|
+
font-size:12.5px; line-height:1.45; text-shadow:none;
|
|
40895
|
+
font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }
|
|
40896
|
+
code { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:.92em; }
|
|
40897
|
+
table { border-collapse:collapse; width:100%; font-size:13.5px; }
|
|
40898
|
+
td { padding:.3rem .6rem .3rem 0; border-bottom:1px solid rgba(255,255,255,.12); vertical-align:top; }
|
|
40899
|
+
td:first-child { color:#cbd2dc; white-space:nowrap; width:10.5rem; }
|
|
40900
|
+
tr:last-child td { border-bottom:0; }
|
|
40901
|
+
a { color:inherit; text-decoration:underline; text-underline-offset:2px; }
|
|
40902
|
+
.row { display:flex; align-items:center; gap:.6rem; margin-bottom:.4rem; font-size:13px; }
|
|
40903
|
+
button { font:inherit; font-size:12.5px; padding:.25rem .65rem;
|
|
40904
|
+
border:1px solid rgba(255,255,255,.24); border-radius:6px;
|
|
40905
|
+
background:rgba(0,0,0,.55); color:#f3f4f6; cursor:pointer; text-shadow:none; }
|
|
40906
|
+
button:hover { background:rgba(0,0,0,.75); }
|
|
40907
|
+
footer { color:#cbd2dc; font-size:12.5px; margin-top:1.1rem; padding-top:.7rem;
|
|
40908
|
+
border-top:1px solid rgba(255,255,255,.14); }
|
|
40909
|
+
[hidden] { display:none !important; }
|
|
40910
|
+
#reveal-wrap { margin:0 0 .4rem; }
|
|
40911
|
+
#reveal { display:inline-block; padding:.4rem .85rem; border-radius:6px;
|
|
40912
|
+
border:1px solid rgba(255,255,255,.26); background:rgba(6,8,12,.62);
|
|
40913
|
+
backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
|
|
40914
|
+
text-decoration:none; font-size:13.5px; text-shadow:none; cursor:pointer; }
|
|
40915
|
+
#reveal:hover { background:rgba(6,8,12,.85); border-color:rgba(255,255,255,.4); }
|
|
40916
|
+
#reveal::after { content:" \u2193"; opacity:.7; }
|
|
40917
|
+
</style>
|
|
40918
|
+
</head>
|
|
40919
|
+
<body>
|
|
40920
|
+
<div class="scroll">
|
|
40921
|
+
<main>
|
|
40922
|
+
<h1>Diamond Hands \u2014 MCP endpoint</h1>
|
|
40923
|
+
<p class="sub">This host is a <strong>Model Context Protocol</strong> server, not a website.
|
|
40924
|
+
There is no app to use here. If you are a person, the app is at
|
|
40925
|
+
<a href="https://app.diamondhands.credit/">app.diamondhands.credit</a>.</p>
|
|
40926
|
+
|
|
40927
|
+
<!-- Revealed BY SCRIPT, hidden in the served markup \u2014 the inverse of #details below.
|
|
40928
|
+
With no JS this stays hidden and the details stay open, so the page degrades to
|
|
40929
|
+
everything-visible rather than to a trigger that does nothing. -->
|
|
40930
|
+
<p id="reveal-wrap" hidden><a href="#details" id="reveal" role="button">View MCP installation details</a></p>
|
|
40931
|
+
|
|
40932
|
+
<div id="details">
|
|
40933
|
+
<div class="card money">
|
|
40934
|
+
<strong>${escapeHtml(money.label)}</strong>
|
|
40935
|
+
${escapeHtml(money.detail)}
|
|
40936
|
+
</div>
|
|
40937
|
+
|
|
40938
|
+
<div class="cols">
|
|
40939
|
+
<section>
|
|
40940
|
+
<h2>Connect an agent</h2>
|
|
40941
|
+
<div class="row">
|
|
40942
|
+
<span style="color:var(--muted);font-size:13px">Add this to your MCP client configuration:</span>
|
|
40943
|
+
<button id="copy" type="button">Copy</button>
|
|
40944
|
+
</div>
|
|
40945
|
+
<pre id="cfg">${escapeHtml(config)}</pre>
|
|
40946
|
+
|
|
40947
|
+
<h2>How authorization works</h2>
|
|
40948
|
+
<div class="card">
|
|
40949
|
+
Identity is a <strong>wallet</strong>, not an account: OAuth 2.1 with dynamic client
|
|
40950
|
+
registration (RFC 7591) and PKCE, where the login is an Ethereum signature (EIP-4361).
|
|
40951
|
+
No passwords, no user database. The bearer token proves <em>session identity only</em> \u2014
|
|
40952
|
+
it signs nothing and can never move funds; every fund-moving step raises its own approval
|
|
40953
|
+
in your own wallet. Session state is in memory, so a restart means signing in again.
|
|
40954
|
+
</div>
|
|
40955
|
+
</section>
|
|
40956
|
+
|
|
40957
|
+
<section>
|
|
40958
|
+
<h2>Endpoints</h2>
|
|
40959
|
+
<div class="card">
|
|
40960
|
+
<table>
|
|
40961
|
+
<tr><td>MCP</td><td><code>${origin2}/mcp</code> \u2014 streamable HTTP</td></tr>
|
|
40962
|
+
<tr><td>Networks served</td><td><code>${escapeHtml(networks2.join(", "))}</code></td></tr>
|
|
40963
|
+
<tr><td>Registration</td><td><a href="/auth.md">/auth.md</a> \u2014 how an agent registers and signs in</td></tr>
|
|
40964
|
+
<tr><td>Resource metadata</td><td><a href="/.well-known/oauth-protected-resource">/.well-known/oauth-protected-resource</a></td></tr>
|
|
40965
|
+
<tr><td>Auth server metadata</td><td><a href="/.well-known/oauth-authorization-server">/.well-known/oauth-authorization-server</a></td></tr>
|
|
40966
|
+
</table>
|
|
40967
|
+
</div>
|
|
40968
|
+
|
|
40969
|
+
</section>
|
|
40970
|
+
</div>
|
|
40971
|
+
|
|
40972
|
+
<footer>
|
|
40973
|
+
<code>@gvnrdao/dh-mcp</code> v${escapeHtml(version2)} \xB7 origin <code>${origin2}</code>
|
|
40974
|
+
</footer>
|
|
40975
|
+
</div>
|
|
40976
|
+
</main>
|
|
40977
|
+
</div>
|
|
40978
|
+
<script nonce="${escapeHtml(nonce)}">
|
|
40979
|
+
// Progressive disclosure, applied by SCRIPT rather than baked into the markup: the
|
|
40980
|
+
// details ship visible, and only a browser that can re-open them is allowed to close
|
|
40981
|
+
// them. A page whose whole content sits behind a trigger that needs JS is a page that
|
|
40982
|
+
// shows two sentences and nothing else when the script does not run.
|
|
40983
|
+
(function () {
|
|
40984
|
+
var details = document.getElementById('details');
|
|
40985
|
+
var wrap = document.getElementById('reveal-wrap');
|
|
40986
|
+
var link = document.getElementById('reveal');
|
|
40987
|
+
if (!details || !wrap || !link) return;
|
|
40988
|
+
details.hidden = true;
|
|
40989
|
+
wrap.hidden = false;
|
|
40990
|
+
link.addEventListener('click', function (e) {
|
|
40991
|
+
e.preventDefault();
|
|
40992
|
+
wrap.hidden = true;
|
|
40993
|
+
details.hidden = false;
|
|
40994
|
+
});
|
|
40995
|
+
})();
|
|
40996
|
+
|
|
40997
|
+
document.getElementById('copy').addEventListener('click', function () {
|
|
40998
|
+
var t = document.getElementById('cfg').textContent;
|
|
40999
|
+
navigator.clipboard.writeText(t).then(function () {
|
|
41000
|
+
var b = document.getElementById('copy');
|
|
41001
|
+
b.textContent = 'Copied'; setTimeout(function () { b.textContent = 'Copy'; }, 1400);
|
|
41002
|
+
});
|
|
41003
|
+
});
|
|
41004
|
+
</script>
|
|
41005
|
+
</body>
|
|
41006
|
+
</html>
|
|
41007
|
+
`;
|
|
41008
|
+
}
|
|
41009
|
+
|
|
41010
|
+
// src/util/page-headers.ts
|
|
41011
|
+
var import_node_crypto = require("crypto");
|
|
41012
|
+
function htmlPageSecurityHeaders(extra) {
|
|
41013
|
+
const nonce = (0, import_node_crypto.randomBytes)(16).toString("base64");
|
|
41014
|
+
const base = [
|
|
41015
|
+
`default-src 'none'`,
|
|
41016
|
+
`script-src 'nonce-${nonce}'`,
|
|
41017
|
+
`style-src 'unsafe-inline'`,
|
|
41018
|
+
`connect-src 'self'`,
|
|
41019
|
+
`base-uri 'none'`,
|
|
41020
|
+
`form-action 'none'`,
|
|
41021
|
+
`frame-ancestors 'none'`
|
|
41022
|
+
];
|
|
41023
|
+
for (const [directive, sources] of Object.entries(extra ?? {})) {
|
|
41024
|
+
if (sources.length === 0) continue;
|
|
41025
|
+
base.push(`${directive} ${sources.join(" ")}`);
|
|
41026
|
+
}
|
|
41027
|
+
return {
|
|
41028
|
+
nonce,
|
|
41029
|
+
headers: {
|
|
41030
|
+
"Content-Security-Policy": base.join("; "),
|
|
41031
|
+
"X-Frame-Options": "DENY",
|
|
41032
|
+
"Referrer-Policy": "no-referrer",
|
|
41033
|
+
"X-Content-Type-Options": "nosniff"
|
|
41034
|
+
}
|
|
41035
|
+
};
|
|
41036
|
+
}
|
|
41037
|
+
|
|
41038
|
+
// src/version.ts
|
|
41039
|
+
var SERVER_VERSION = "0.5.12";
|
|
41040
|
+
|
|
40821
41041
|
// src/connector/siwe-oauth.ts
|
|
40822
41042
|
var import_node_crypto2 = require("crypto");
|
|
40823
41043
|
var import_ethers = require("ethers");
|
|
@@ -40867,7 +41087,7 @@ button { font-size: 1rem; padding: 0.6rem 1.2rem; cursor: pointer; margin-right:
|
|
|
40867
41087
|
</head>
|
|
40868
41088
|
<body>
|
|
40869
41089
|
<h1>Sign in to Diamond Hands</h1>
|
|
40870
|
-
<p><span class="cname" dir="ltr">${
|
|
41090
|
+
<p><span class="cname" dir="ltr">${escapeHtml2(clientName)}</span> is asking to connect. Signing in proves you own a wallet address \u2014 it authorizes nothing on-chain and can never move funds.</p>
|
|
40871
41091
|
<p class="dest">When you sign, this connection is handed to <code dir="ltr">${renderRedirectHost(redirectHost)}</code>. Anyone can register a client under any name, so read the host, not the name \u2014 and read it from the <b>bold end</b>, which is the part that decides who actually owns it. If you do not recognize it, close this page; nothing has happened yet.</p>
|
|
40872
41092
|
<button id="connect">Browser wallet</button>
|
|
40873
41093
|
<button id="wc">Mobile wallet (QR)</button>
|
|
@@ -40943,7 +41163,7 @@ document.getElementById("wc").addEventListener("click", async () => {
|
|
|
40943
41163
|
</body>
|
|
40944
41164
|
</html>`;
|
|
40945
41165
|
}
|
|
40946
|
-
function
|
|
41166
|
+
function escapeHtml2(s) {
|
|
40947
41167
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
40948
41168
|
}
|
|
40949
41169
|
var MAX_CLIENT_NAME_CHARS = 64;
|
|
@@ -40964,7 +41184,7 @@ function splitRedirectHost(host) {
|
|
|
40964
41184
|
function renderRedirectHost(host) {
|
|
40965
41185
|
const { head, elided, tail } = splitRedirectHost(host);
|
|
40966
41186
|
const cut = elided === 0 ? "" : `<span class="host-cut">\u2026+${elided} chars\u2026</span>`;
|
|
40967
|
-
return `<span class="host-head">${
|
|
41187
|
+
return `<span class="host-head">${escapeHtml2(head)}</span>${cut}<span class="host-tail">${escapeHtml2(tail)}</span>`;
|
|
40968
41188
|
}
|
|
40969
41189
|
function clampClientName(name) {
|
|
40970
41190
|
const points = [...name];
|
|
@@ -40972,21 +41192,6 @@ function clampClientName(name) {
|
|
|
40972
41192
|
return `${points.slice(0, MAX_CLIENT_NAME_CHARS - 1).join("")}\u2026`;
|
|
40973
41193
|
}
|
|
40974
41194
|
|
|
40975
|
-
// src/util/page-headers.ts
|
|
40976
|
-
var import_node_crypto = require("crypto");
|
|
40977
|
-
function htmlPageSecurityHeaders() {
|
|
40978
|
-
const nonce = (0, import_node_crypto.randomBytes)(16).toString("base64");
|
|
40979
|
-
return {
|
|
40980
|
-
nonce,
|
|
40981
|
-
headers: {
|
|
40982
|
-
"Content-Security-Policy": `default-src 'none'; script-src 'nonce-${nonce}'; style-src 'unsafe-inline'; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'`,
|
|
40983
|
-
"X-Frame-Options": "DENY",
|
|
40984
|
-
"Referrer-Policy": "no-referrer",
|
|
40985
|
-
"X-Content-Type-Options": "nosniff"
|
|
40986
|
-
}
|
|
40987
|
-
};
|
|
40988
|
-
}
|
|
40989
|
-
|
|
40990
41195
|
// src/connector/siwe-oauth.ts
|
|
40991
41196
|
var FLOW_TTL_MS = 10 * 60 * 1e3;
|
|
40992
41197
|
var CODE_TTL_MS = 60 * 1e3;
|
|
@@ -41348,7 +41553,11 @@ var NETWORK_DEFAULTS = {
|
|
|
41348
41553
|
},
|
|
41349
41554
|
mainnet: {
|
|
41350
41555
|
rpcUrl: "https://ethereum-rpc.publicnode.com",
|
|
41351
|
-
|
|
41556
|
+
// Cutover 2026-09-08 — see sdk/src/constants/chunks/network-configs.ts for the full
|
|
41557
|
+
// reasoning. Widening, not a rename: ops.gvnr.xyz serves the same broker and cannot be
|
|
41558
|
+
// retired while installed copies call it. The sepolia entry above deliberately stays on
|
|
41559
|
+
// ops-test.gvnr.xyz — there is no ops-test.diamondhands.credit twin (open decision 2).
|
|
41560
|
+
serviceEndpoint: "https://ops.diamondhands.credit",
|
|
41352
41561
|
litNetwork: "chipotle",
|
|
41353
41562
|
// On-chain PKPValidation generation, mainnet (validatorForVersion(3) is the ONLY
|
|
41354
41563
|
// registered validator — verified live 2026-08-05). Without this the SDK defaults
|
|
@@ -57621,7 +57830,17 @@ function getSepoliaConfig() {
|
|
|
57621
57830
|
function getMainnetConfig() {
|
|
57622
57831
|
return {
|
|
57623
57832
|
mode: "service",
|
|
57624
|
-
|
|
57833
|
+
// Cutover 2026-09-08: the product's own domain. `ops.gvnr.xyz` still serves the same
|
|
57834
|
+
// broker and always will — every already-installed copy of this package calls it, so
|
|
57835
|
+
// it can never be retired. This changes what NEW installs default to, nothing else.
|
|
57836
|
+
//
|
|
57837
|
+
// Safe only because the server accepts the new audience ALREADY: the SDK derives the
|
|
57838
|
+
// login audience from this endpoint (`server-session.ts` — `loginAudience ??
|
|
57839
|
+
// serviceEndpoint`) and lit-ops-server FAILS CLOSED on an unknown one. Verified live
|
|
57840
|
+
// before this edit: DH_ACCEPTED_LOGIN_AUDIENCES on the deployed revision lists
|
|
57841
|
+
// https://ops.diamondhands.credit. Publishing this ahead of that would lock out every
|
|
57842
|
+
// client that installed it.
|
|
57843
|
+
serviceEndpoint: "https://ops.diamondhands.credit",
|
|
57625
57844
|
chainId: 1,
|
|
57626
57845
|
name: "mainnet",
|
|
57627
57846
|
// No default RPC: mainnet runs in service mode (serviceEndpoint above), so
|
|
@@ -84950,9 +85169,6 @@ function registerBoundaryInfoResource(server, getB) {
|
|
|
84950
85169
|
);
|
|
84951
85170
|
}
|
|
84952
85171
|
|
|
84953
|
-
// src/version.ts
|
|
84954
|
-
var SERVER_VERSION = "0.5.11";
|
|
84955
|
-
|
|
84956
85172
|
// src/server.ts
|
|
84957
85173
|
var SERVER_INSTRUCTIONS = "Diamond Hands MCP \u2014 Bitcoin-collateralized borrowing. Before promising ANY flow, read the boundary://info resource and honor its `capabilities` block: it states which network this server is on, whether money is real (practiceWorld), whether writes are enabled (and the true reason when they are not), and which signer modes this build actually offers \u2014 never describe a flow outside it. State the network and whether funds are real when the user first acts. Authorization is chosen by conversation via the signer_setup tool (when listed); writes always require confirmed:true after showing the human-readable card. For walkthroughs consult the guide tool / guide:// resources instead of inventing steps; when a tool refuses, relay its stated reason and remedy \u2014 do not improvise alternatives. When a network_switch tool is listed, the network can change mid-session \u2014 after ANY switch, re-read boundary://info and state the new network and money reality to the user before doing anything else. When the user asks to disconnect / log out / sign out / forget or remove their wallet, call signer_setup action 'disconnect' (the full flush) \u2014 never treat 'reset-borrower' as a disconnect; it only swaps identity. READING DATA: a payload's fields and notes are authoritative \u2014 state what they say, never speculate past them, and when the data does not carry something, say 'the data does not carry X'. Field meanings live in guide topic 'reading-data'; `reading` notes inside a result are interpretation instructions for that exact payload \u2014 follow them over any prior assumption.";
|
|
84958
85174
|
var CONNECTOR_INSTRUCTIONS = SERVER_INSTRUCTIONS + " HOSTED CONNECTOR TIER: this server is the hosted claude.ai connector. Signer modes are external-wallet ONLY \u2014 keystore mode is ABSENT from this build (structurally, not disabled); the server never holds a key, and every fund-moving action needs a fresh signature from the user's own wallet. Each tenant's world is isolated by wallet identity; network_switch moves ONLY this tenant, within the networks this deployment serves (the refusal states the rollout truth). The login session lives in server memory only \u2014 a server restart or idle eviction means signing in again; that is the no-data-at-rest property, not a fault. Trust ledger and cadence: guide topic 'connector'.";
|
|
@@ -85453,6 +85669,13 @@ function composeConnector(opts, rawPublicOrigin) {
|
|
|
85453
85669
|
}
|
|
85454
85670
|
};
|
|
85455
85671
|
}
|
|
85672
|
+
if (opts.serveLandingPage) {
|
|
85673
|
+
app.get("/", (_req, res) => {
|
|
85674
|
+
const { nonce, headers } = htmlPageSecurityHeaders({ "img-src": [BACKGROUND_IMAGE_ORIGIN, "data:"] });
|
|
85675
|
+
for (const [k, v] of Object.entries(headers)) res.setHeader(k, v);
|
|
85676
|
+
res.type("text/html; charset=utf-8").send(renderLandingPage({ publicOrigin, networks: allowedNetworks, version: SERVER_VERSION, nonce }));
|
|
85677
|
+
});
|
|
85678
|
+
}
|
|
85456
85679
|
app.use((_req, res) => deny(res, 404, "not found \u2014 the MCP endpoint is /mcp"));
|
|
85457
85680
|
const sweeper = setInterval(() => sweepService(), 6e4);
|
|
85458
85681
|
sweeper.unref();
|
package/dist/connector.js
CHANGED
|
@@ -40812,6 +40812,226 @@ source of truth.
|
|
|
40812
40812
|
`;
|
|
40813
40813
|
}
|
|
40814
40814
|
|
|
40815
|
+
// src/connector/landing-page.ts
|
|
40816
|
+
var FAVICON_SVG = `<svg width="512" height="512" viewBox="-6 -11 88 88" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Diamond Hands"><path d="M1.08325 20.7041L37.9038 64.4967L74.2886 20.7041L61.8699 0.877686H13.502L1.08325 20.7041Z" fill="#C9F284" stroke="#34440E" stroke-width="1.75559"/><path d="M13.9385 0.877441L37.9045 64.2785" stroke="#34440E" stroke-width="1.75559"/><path d="M61.6553 0.877441L37.9071 64.4964" stroke="#34440E" stroke-width="1.75559"/><path d="M1.08276 20.7029H74.2882" stroke="#34440E" stroke-width="1.75559"/></svg>`;
|
|
40817
|
+
var FAVICON_DATA_URI = `data:image/svg+xml,${encodeURIComponent(FAVICON_SVG).replace(/'/g, "%27")}`;
|
|
40818
|
+
var BACKGROUND_IMAGE_ORIGIN = "https://images.gvnr.xyz";
|
|
40819
|
+
var BACKGROUND_IMAGE_URL = `${BACKGROUND_IMAGE_ORIGIN}/images/layout/backgroundCorleoneb.jpg`;
|
|
40820
|
+
var escapeHtml = (s) => s.replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]);
|
|
40821
|
+
function moneyReality(networks2) {
|
|
40822
|
+
const mainnet = networks2.includes("mainnet");
|
|
40823
|
+
const sepolia = networks2.includes("sepolia");
|
|
40824
|
+
if (mainnet && sepolia) {
|
|
40825
|
+
return {
|
|
40826
|
+
label: "REAL MONEY on mainnet \xB7 practice funds on sepolia",
|
|
40827
|
+
detail: "This deployment serves both networks. Mainnet moves real BTC and real UCD; sepolia is the test network and its funds are not real. Ask which network you are on before acting."
|
|
40828
|
+
};
|
|
40829
|
+
}
|
|
40830
|
+
if (mainnet) {
|
|
40831
|
+
return {
|
|
40832
|
+
label: "REAL MONEY \u2014 Ethereum mainnet",
|
|
40833
|
+
detail: "This deployment serves mainnet only. Every fund-moving operation moves real BTC and real UCD, and each one needs a fresh signature from your own wallet."
|
|
40834
|
+
};
|
|
40835
|
+
}
|
|
40836
|
+
return {
|
|
40837
|
+
label: "PRACTICE FUNDS \u2014 sepolia test network",
|
|
40838
|
+
detail: "This deployment serves sepolia only. The contracts and ceremonies are real, the money is not. Nothing here can move mainnet funds."
|
|
40839
|
+
};
|
|
40840
|
+
}
|
|
40841
|
+
function renderLandingPage(input) {
|
|
40842
|
+
const { publicOrigin, networks: networks2, version: version2, nonce } = input;
|
|
40843
|
+
const origin2 = escapeHtml(publicOrigin);
|
|
40844
|
+
const money = moneyReality(networks2);
|
|
40845
|
+
const config = JSON.stringify({ mcpServers: { "diamond-hands": { type: "http", url: `${publicOrigin}/mcp` } } }, null, 2);
|
|
40846
|
+
return `<!doctype html>
|
|
40847
|
+
<html lang="en">
|
|
40848
|
+
<head>
|
|
40849
|
+
<meta charset="utf-8">
|
|
40850
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
40851
|
+
<title>Diamond Hands \u2014 MCP endpoint</title>
|
|
40852
|
+
<link rel="icon" type="image/svg+xml" href="${FAVICON_DATA_URI}">
|
|
40853
|
+
<link rel="apple-touch-icon" href="${FAVICON_DATA_URI}">
|
|
40854
|
+
<style>
|
|
40855
|
+
* { margin:0; padding:0; box-sizing:border-box; }
|
|
40856
|
+
/* House treatment (ops.gvnr.xyz, brando.gvnr.xyz): the image fills the viewport,
|
|
40857
|
+
centred and cropped, and the PAGE never scrolls. */
|
|
40858
|
+
html, body { width:100%; height:100%; overflow:hidden; }
|
|
40859
|
+
body {
|
|
40860
|
+
background: url('${BACKGROUND_IMAGE_URL}') center center / cover no-repeat fixed;
|
|
40861
|
+
color:#f3f4f6;
|
|
40862
|
+
font:15px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
|
|
40863
|
+
}
|
|
40864
|
+
/* NO full-page scrim: the photograph is the point, so darkness lives only behind the
|
|
40865
|
+
text that needs to stay legible. The content scrolls INSIDE the viewport rather than
|
|
40866
|
+
the page scrolling, so a short window never clips anything and the image never moves. */
|
|
40867
|
+
.scroll { height:100%; overflow-y:auto; overscroll-behavior:contain; }
|
|
40868
|
+
main { max-width:41rem; margin:0 auto; padding:1.9rem 1.25rem 2rem;
|
|
40869
|
+
text-shadow:0 1px 3px rgba(0,0,0,.85); }
|
|
40870
|
+
/* Wide viewports: the lower half goes side-by-side so the whole page fits without the
|
|
40871
|
+
viewport scrolling \u2014 the house treatment is a full-bleed image, not a long page. */
|
|
40872
|
+
@media (min-width: 62rem) and (min-height: 34rem) {
|
|
40873
|
+
main { max-width:62rem; }
|
|
40874
|
+
.cols { display:grid; grid-template-columns:1fr 1fr; gap:0 1.6rem; align-items:start; }
|
|
40875
|
+
.cols h2:first-child { margin-top:0; }
|
|
40876
|
+
}
|
|
40877
|
+
h1 { font-size:1.35rem; margin:0 0 .25rem; letter-spacing:-.01em; }
|
|
40878
|
+
.sub { color:#dfe3ea; margin:0 0 1.1rem; font-size:14px; }
|
|
40879
|
+
.card { background:rgba(6,8,12,.62); border:1px solid rgba(255,255,255,.16);
|
|
40880
|
+
border-radius:10px; padding:.75rem .95rem; margin:0 0 .8rem;
|
|
40881
|
+
backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); }
|
|
40882
|
+
.money { border-left:3px solid #f59e0b; }
|
|
40883
|
+
.money strong { display:block; margin-bottom:.15rem; }
|
|
40884
|
+
h2 { font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:#cbd2dc;
|
|
40885
|
+
margin:1.1rem 0 .45rem; font-weight:600; }
|
|
40886
|
+
pre { margin:0; padding:.7rem .9rem; background:rgba(0,0,0,.66);
|
|
40887
|
+
border:1px solid rgba(255,255,255,.16); border-radius:8px; overflow-x:auto;
|
|
40888
|
+
font-size:12.5px; line-height:1.45; text-shadow:none;
|
|
40889
|
+
font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }
|
|
40890
|
+
code { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:.92em; }
|
|
40891
|
+
table { border-collapse:collapse; width:100%; font-size:13.5px; }
|
|
40892
|
+
td { padding:.3rem .6rem .3rem 0; border-bottom:1px solid rgba(255,255,255,.12); vertical-align:top; }
|
|
40893
|
+
td:first-child { color:#cbd2dc; white-space:nowrap; width:10.5rem; }
|
|
40894
|
+
tr:last-child td { border-bottom:0; }
|
|
40895
|
+
a { color:inherit; text-decoration:underline; text-underline-offset:2px; }
|
|
40896
|
+
.row { display:flex; align-items:center; gap:.6rem; margin-bottom:.4rem; font-size:13px; }
|
|
40897
|
+
button { font:inherit; font-size:12.5px; padding:.25rem .65rem;
|
|
40898
|
+
border:1px solid rgba(255,255,255,.24); border-radius:6px;
|
|
40899
|
+
background:rgba(0,0,0,.55); color:#f3f4f6; cursor:pointer; text-shadow:none; }
|
|
40900
|
+
button:hover { background:rgba(0,0,0,.75); }
|
|
40901
|
+
footer { color:#cbd2dc; font-size:12.5px; margin-top:1.1rem; padding-top:.7rem;
|
|
40902
|
+
border-top:1px solid rgba(255,255,255,.14); }
|
|
40903
|
+
[hidden] { display:none !important; }
|
|
40904
|
+
#reveal-wrap { margin:0 0 .4rem; }
|
|
40905
|
+
#reveal { display:inline-block; padding:.4rem .85rem; border-radius:6px;
|
|
40906
|
+
border:1px solid rgba(255,255,255,.26); background:rgba(6,8,12,.62);
|
|
40907
|
+
backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
|
|
40908
|
+
text-decoration:none; font-size:13.5px; text-shadow:none; cursor:pointer; }
|
|
40909
|
+
#reveal:hover { background:rgba(6,8,12,.85); border-color:rgba(255,255,255,.4); }
|
|
40910
|
+
#reveal::after { content:" \u2193"; opacity:.7; }
|
|
40911
|
+
</style>
|
|
40912
|
+
</head>
|
|
40913
|
+
<body>
|
|
40914
|
+
<div class="scroll">
|
|
40915
|
+
<main>
|
|
40916
|
+
<h1>Diamond Hands \u2014 MCP endpoint</h1>
|
|
40917
|
+
<p class="sub">This host is a <strong>Model Context Protocol</strong> server, not a website.
|
|
40918
|
+
There is no app to use here. If you are a person, the app is at
|
|
40919
|
+
<a href="https://app.diamondhands.credit/">app.diamondhands.credit</a>.</p>
|
|
40920
|
+
|
|
40921
|
+
<!-- Revealed BY SCRIPT, hidden in the served markup \u2014 the inverse of #details below.
|
|
40922
|
+
With no JS this stays hidden and the details stay open, so the page degrades to
|
|
40923
|
+
everything-visible rather than to a trigger that does nothing. -->
|
|
40924
|
+
<p id="reveal-wrap" hidden><a href="#details" id="reveal" role="button">View MCP installation details</a></p>
|
|
40925
|
+
|
|
40926
|
+
<div id="details">
|
|
40927
|
+
<div class="card money">
|
|
40928
|
+
<strong>${escapeHtml(money.label)}</strong>
|
|
40929
|
+
${escapeHtml(money.detail)}
|
|
40930
|
+
</div>
|
|
40931
|
+
|
|
40932
|
+
<div class="cols">
|
|
40933
|
+
<section>
|
|
40934
|
+
<h2>Connect an agent</h2>
|
|
40935
|
+
<div class="row">
|
|
40936
|
+
<span style="color:var(--muted);font-size:13px">Add this to your MCP client configuration:</span>
|
|
40937
|
+
<button id="copy" type="button">Copy</button>
|
|
40938
|
+
</div>
|
|
40939
|
+
<pre id="cfg">${escapeHtml(config)}</pre>
|
|
40940
|
+
|
|
40941
|
+
<h2>How authorization works</h2>
|
|
40942
|
+
<div class="card">
|
|
40943
|
+
Identity is a <strong>wallet</strong>, not an account: OAuth 2.1 with dynamic client
|
|
40944
|
+
registration (RFC 7591) and PKCE, where the login is an Ethereum signature (EIP-4361).
|
|
40945
|
+
No passwords, no user database. The bearer token proves <em>session identity only</em> \u2014
|
|
40946
|
+
it signs nothing and can never move funds; every fund-moving step raises its own approval
|
|
40947
|
+
in your own wallet. Session state is in memory, so a restart means signing in again.
|
|
40948
|
+
</div>
|
|
40949
|
+
</section>
|
|
40950
|
+
|
|
40951
|
+
<section>
|
|
40952
|
+
<h2>Endpoints</h2>
|
|
40953
|
+
<div class="card">
|
|
40954
|
+
<table>
|
|
40955
|
+
<tr><td>MCP</td><td><code>${origin2}/mcp</code> \u2014 streamable HTTP</td></tr>
|
|
40956
|
+
<tr><td>Networks served</td><td><code>${escapeHtml(networks2.join(", "))}</code></td></tr>
|
|
40957
|
+
<tr><td>Registration</td><td><a href="/auth.md">/auth.md</a> \u2014 how an agent registers and signs in</td></tr>
|
|
40958
|
+
<tr><td>Resource metadata</td><td><a href="/.well-known/oauth-protected-resource">/.well-known/oauth-protected-resource</a></td></tr>
|
|
40959
|
+
<tr><td>Auth server metadata</td><td><a href="/.well-known/oauth-authorization-server">/.well-known/oauth-authorization-server</a></td></tr>
|
|
40960
|
+
</table>
|
|
40961
|
+
</div>
|
|
40962
|
+
|
|
40963
|
+
</section>
|
|
40964
|
+
</div>
|
|
40965
|
+
|
|
40966
|
+
<footer>
|
|
40967
|
+
<code>@gvnrdao/dh-mcp</code> v${escapeHtml(version2)} \xB7 origin <code>${origin2}</code>
|
|
40968
|
+
</footer>
|
|
40969
|
+
</div>
|
|
40970
|
+
</main>
|
|
40971
|
+
</div>
|
|
40972
|
+
<script nonce="${escapeHtml(nonce)}">
|
|
40973
|
+
// Progressive disclosure, applied by SCRIPT rather than baked into the markup: the
|
|
40974
|
+
// details ship visible, and only a browser that can re-open them is allowed to close
|
|
40975
|
+
// them. A page whose whole content sits behind a trigger that needs JS is a page that
|
|
40976
|
+
// shows two sentences and nothing else when the script does not run.
|
|
40977
|
+
(function () {
|
|
40978
|
+
var details = document.getElementById('details');
|
|
40979
|
+
var wrap = document.getElementById('reveal-wrap');
|
|
40980
|
+
var link = document.getElementById('reveal');
|
|
40981
|
+
if (!details || !wrap || !link) return;
|
|
40982
|
+
details.hidden = true;
|
|
40983
|
+
wrap.hidden = false;
|
|
40984
|
+
link.addEventListener('click', function (e) {
|
|
40985
|
+
e.preventDefault();
|
|
40986
|
+
wrap.hidden = true;
|
|
40987
|
+
details.hidden = false;
|
|
40988
|
+
});
|
|
40989
|
+
})();
|
|
40990
|
+
|
|
40991
|
+
document.getElementById('copy').addEventListener('click', function () {
|
|
40992
|
+
var t = document.getElementById('cfg').textContent;
|
|
40993
|
+
navigator.clipboard.writeText(t).then(function () {
|
|
40994
|
+
var b = document.getElementById('copy');
|
|
40995
|
+
b.textContent = 'Copied'; setTimeout(function () { b.textContent = 'Copy'; }, 1400);
|
|
40996
|
+
});
|
|
40997
|
+
});
|
|
40998
|
+
</script>
|
|
40999
|
+
</body>
|
|
41000
|
+
</html>
|
|
41001
|
+
`;
|
|
41002
|
+
}
|
|
41003
|
+
|
|
41004
|
+
// src/util/page-headers.ts
|
|
41005
|
+
var import_node_crypto = require("crypto");
|
|
41006
|
+
function htmlPageSecurityHeaders(extra) {
|
|
41007
|
+
const nonce = (0, import_node_crypto.randomBytes)(16).toString("base64");
|
|
41008
|
+
const base = [
|
|
41009
|
+
`default-src 'none'`,
|
|
41010
|
+
`script-src 'nonce-${nonce}'`,
|
|
41011
|
+
`style-src 'unsafe-inline'`,
|
|
41012
|
+
`connect-src 'self'`,
|
|
41013
|
+
`base-uri 'none'`,
|
|
41014
|
+
`form-action 'none'`,
|
|
41015
|
+
`frame-ancestors 'none'`
|
|
41016
|
+
];
|
|
41017
|
+
for (const [directive, sources] of Object.entries(extra ?? {})) {
|
|
41018
|
+
if (sources.length === 0) continue;
|
|
41019
|
+
base.push(`${directive} ${sources.join(" ")}`);
|
|
41020
|
+
}
|
|
41021
|
+
return {
|
|
41022
|
+
nonce,
|
|
41023
|
+
headers: {
|
|
41024
|
+
"Content-Security-Policy": base.join("; "),
|
|
41025
|
+
"X-Frame-Options": "DENY",
|
|
41026
|
+
"Referrer-Policy": "no-referrer",
|
|
41027
|
+
"X-Content-Type-Options": "nosniff"
|
|
41028
|
+
}
|
|
41029
|
+
};
|
|
41030
|
+
}
|
|
41031
|
+
|
|
41032
|
+
// src/version.ts
|
|
41033
|
+
var SERVER_VERSION = "0.5.12";
|
|
41034
|
+
|
|
40815
41035
|
// src/connector/siwe-oauth.ts
|
|
40816
41036
|
var import_node_crypto2 = require("crypto");
|
|
40817
41037
|
var import_ethers = require("ethers");
|
|
@@ -40861,7 +41081,7 @@ button { font-size: 1rem; padding: 0.6rem 1.2rem; cursor: pointer; margin-right:
|
|
|
40861
41081
|
</head>
|
|
40862
41082
|
<body>
|
|
40863
41083
|
<h1>Sign in to Diamond Hands</h1>
|
|
40864
|
-
<p><span class="cname" dir="ltr">${
|
|
41084
|
+
<p><span class="cname" dir="ltr">${escapeHtml2(clientName)}</span> is asking to connect. Signing in proves you own a wallet address \u2014 it authorizes nothing on-chain and can never move funds.</p>
|
|
40865
41085
|
<p class="dest">When you sign, this connection is handed to <code dir="ltr">${renderRedirectHost(redirectHost)}</code>. Anyone can register a client under any name, so read the host, not the name \u2014 and read it from the <b>bold end</b>, which is the part that decides who actually owns it. If you do not recognize it, close this page; nothing has happened yet.</p>
|
|
40866
41086
|
<button id="connect">Browser wallet</button>
|
|
40867
41087
|
<button id="wc">Mobile wallet (QR)</button>
|
|
@@ -40937,7 +41157,7 @@ document.getElementById("wc").addEventListener("click", async () => {
|
|
|
40937
41157
|
</body>
|
|
40938
41158
|
</html>`;
|
|
40939
41159
|
}
|
|
40940
|
-
function
|
|
41160
|
+
function escapeHtml2(s) {
|
|
40941
41161
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
40942
41162
|
}
|
|
40943
41163
|
var MAX_CLIENT_NAME_CHARS = 64;
|
|
@@ -40958,7 +41178,7 @@ function splitRedirectHost(host) {
|
|
|
40958
41178
|
function renderRedirectHost(host) {
|
|
40959
41179
|
const { head, elided, tail } = splitRedirectHost(host);
|
|
40960
41180
|
const cut = elided === 0 ? "" : `<span class="host-cut">\u2026+${elided} chars\u2026</span>`;
|
|
40961
|
-
return `<span class="host-head">${
|
|
41181
|
+
return `<span class="host-head">${escapeHtml2(head)}</span>${cut}<span class="host-tail">${escapeHtml2(tail)}</span>`;
|
|
40962
41182
|
}
|
|
40963
41183
|
function clampClientName(name) {
|
|
40964
41184
|
const points = [...name];
|
|
@@ -40966,21 +41186,6 @@ function clampClientName(name) {
|
|
|
40966
41186
|
return `${points.slice(0, MAX_CLIENT_NAME_CHARS - 1).join("")}\u2026`;
|
|
40967
41187
|
}
|
|
40968
41188
|
|
|
40969
|
-
// src/util/page-headers.ts
|
|
40970
|
-
var import_node_crypto = require("crypto");
|
|
40971
|
-
function htmlPageSecurityHeaders() {
|
|
40972
|
-
const nonce = (0, import_node_crypto.randomBytes)(16).toString("base64");
|
|
40973
|
-
return {
|
|
40974
|
-
nonce,
|
|
40975
|
-
headers: {
|
|
40976
|
-
"Content-Security-Policy": `default-src 'none'; script-src 'nonce-${nonce}'; style-src 'unsafe-inline'; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'`,
|
|
40977
|
-
"X-Frame-Options": "DENY",
|
|
40978
|
-
"Referrer-Policy": "no-referrer",
|
|
40979
|
-
"X-Content-Type-Options": "nosniff"
|
|
40980
|
-
}
|
|
40981
|
-
};
|
|
40982
|
-
}
|
|
40983
|
-
|
|
40984
41189
|
// src/connector/siwe-oauth.ts
|
|
40985
41190
|
var FLOW_TTL_MS = 10 * 60 * 1e3;
|
|
40986
41191
|
var CODE_TTL_MS = 60 * 1e3;
|
|
@@ -41342,7 +41547,11 @@ var NETWORK_DEFAULTS = {
|
|
|
41342
41547
|
},
|
|
41343
41548
|
mainnet: {
|
|
41344
41549
|
rpcUrl: "https://ethereum-rpc.publicnode.com",
|
|
41345
|
-
|
|
41550
|
+
// Cutover 2026-09-08 — see sdk/src/constants/chunks/network-configs.ts for the full
|
|
41551
|
+
// reasoning. Widening, not a rename: ops.gvnr.xyz serves the same broker and cannot be
|
|
41552
|
+
// retired while installed copies call it. The sepolia entry above deliberately stays on
|
|
41553
|
+
// ops-test.gvnr.xyz — there is no ops-test.diamondhands.credit twin (open decision 2).
|
|
41554
|
+
serviceEndpoint: "https://ops.diamondhands.credit",
|
|
41346
41555
|
litNetwork: "chipotle",
|
|
41347
41556
|
// On-chain PKPValidation generation, mainnet (validatorForVersion(3) is the ONLY
|
|
41348
41557
|
// registered validator — verified live 2026-08-05). Without this the SDK defaults
|
|
@@ -57615,7 +57824,17 @@ function getSepoliaConfig() {
|
|
|
57615
57824
|
function getMainnetConfig() {
|
|
57616
57825
|
return {
|
|
57617
57826
|
mode: "service",
|
|
57618
|
-
|
|
57827
|
+
// Cutover 2026-09-08: the product's own domain. `ops.gvnr.xyz` still serves the same
|
|
57828
|
+
// broker and always will — every already-installed copy of this package calls it, so
|
|
57829
|
+
// it can never be retired. This changes what NEW installs default to, nothing else.
|
|
57830
|
+
//
|
|
57831
|
+
// Safe only because the server accepts the new audience ALREADY: the SDK derives the
|
|
57832
|
+
// login audience from this endpoint (`server-session.ts` — `loginAudience ??
|
|
57833
|
+
// serviceEndpoint`) and lit-ops-server FAILS CLOSED on an unknown one. Verified live
|
|
57834
|
+
// before this edit: DH_ACCEPTED_LOGIN_AUDIENCES on the deployed revision lists
|
|
57835
|
+
// https://ops.diamondhands.credit. Publishing this ahead of that would lock out every
|
|
57836
|
+
// client that installed it.
|
|
57837
|
+
serviceEndpoint: "https://ops.diamondhands.credit",
|
|
57619
57838
|
chainId: 1,
|
|
57620
57839
|
name: "mainnet",
|
|
57621
57840
|
// No default RPC: mainnet runs in service mode (serviceEndpoint above), so
|
|
@@ -84944,9 +85163,6 @@ function registerBoundaryInfoResource(server, getB) {
|
|
|
84944
85163
|
);
|
|
84945
85164
|
}
|
|
84946
85165
|
|
|
84947
|
-
// src/version.ts
|
|
84948
|
-
var SERVER_VERSION = "0.5.11";
|
|
84949
|
-
|
|
84950
85166
|
// src/server.ts
|
|
84951
85167
|
var SERVER_INSTRUCTIONS = "Diamond Hands MCP \u2014 Bitcoin-collateralized borrowing. Before promising ANY flow, read the boundary://info resource and honor its `capabilities` block: it states which network this server is on, whether money is real (practiceWorld), whether writes are enabled (and the true reason when they are not), and which signer modes this build actually offers \u2014 never describe a flow outside it. State the network and whether funds are real when the user first acts. Authorization is chosen by conversation via the signer_setup tool (when listed); writes always require confirmed:true after showing the human-readable card. For walkthroughs consult the guide tool / guide:// resources instead of inventing steps; when a tool refuses, relay its stated reason and remedy \u2014 do not improvise alternatives. When a network_switch tool is listed, the network can change mid-session \u2014 after ANY switch, re-read boundary://info and state the new network and money reality to the user before doing anything else. When the user asks to disconnect / log out / sign out / forget or remove their wallet, call signer_setup action 'disconnect' (the full flush) \u2014 never treat 'reset-borrower' as a disconnect; it only swaps identity. READING DATA: a payload's fields and notes are authoritative \u2014 state what they say, never speculate past them, and when the data does not carry something, say 'the data does not carry X'. Field meanings live in guide topic 'reading-data'; `reading` notes inside a result are interpretation instructions for that exact payload \u2014 follow them over any prior assumption.";
|
|
84952
85168
|
var CONNECTOR_INSTRUCTIONS = SERVER_INSTRUCTIONS + " HOSTED CONNECTOR TIER: this server is the hosted claude.ai connector. Signer modes are external-wallet ONLY \u2014 keystore mode is ABSENT from this build (structurally, not disabled); the server never holds a key, and every fund-moving action needs a fresh signature from the user's own wallet. Each tenant's world is isolated by wallet identity; network_switch moves ONLY this tenant, within the networks this deployment serves (the refusal states the rollout truth). The login session lives in server memory only \u2014 a server restart or idle eviction means signing in again; that is the no-data-at-rest property, not a fault. Trust ledger and cadence: guide topic 'connector'.";
|
|
@@ -85447,6 +85663,13 @@ function composeConnector(opts, rawPublicOrigin) {
|
|
|
85447
85663
|
}
|
|
85448
85664
|
};
|
|
85449
85665
|
}
|
|
85666
|
+
if (opts.serveLandingPage) {
|
|
85667
|
+
app.get("/", (_req, res) => {
|
|
85668
|
+
const { nonce, headers } = htmlPageSecurityHeaders({ "img-src": [BACKGROUND_IMAGE_ORIGIN, "data:"] });
|
|
85669
|
+
for (const [k, v] of Object.entries(headers)) res.setHeader(k, v);
|
|
85670
|
+
res.type("text/html; charset=utf-8").send(renderLandingPage({ publicOrigin, networks: allowedNetworks, version: SERVER_VERSION, nonce }));
|
|
85671
|
+
});
|
|
85672
|
+
}
|
|
85450
85673
|
app.use((_req, res) => deny(res, 404, "not found \u2014 the MCP endpoint is /mcp"));
|
|
85451
85674
|
const sweeper = setInterval(() => sweepService(), 6e4);
|
|
85452
85675
|
sweeper.unref();
|
|
@@ -85491,7 +85714,7 @@ async function startConnectorService(opts) {
|
|
|
85491
85714
|
if (addr === null || typeof addr === "string") throw new Error("connector service: no bound address");
|
|
85492
85715
|
const authority = host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
|
|
85493
85716
|
const publicOrigin = opts.publicOrigin ?? `http://${authority}:${addr.port}`;
|
|
85494
|
-
const composed = composeConnector(opts, publicOrigin);
|
|
85717
|
+
const composed = composeConnector({ ...opts, serveLandingPage: true }, publicOrigin);
|
|
85495
85718
|
httpServer.on("request", composed.app);
|
|
85496
85719
|
return {
|
|
85497
85720
|
url: `http://${host}:${addr.port}/mcp`,
|
package/dist/index.js
CHANGED
|
@@ -40638,7 +40638,11 @@ var NETWORK_DEFAULTS = {
|
|
|
40638
40638
|
},
|
|
40639
40639
|
mainnet: {
|
|
40640
40640
|
rpcUrl: "https://ethereum-rpc.publicnode.com",
|
|
40641
|
-
|
|
40641
|
+
// Cutover 2026-09-08 — see sdk/src/constants/chunks/network-configs.ts for the full
|
|
40642
|
+
// reasoning. Widening, not a rename: ops.gvnr.xyz serves the same broker and cannot be
|
|
40643
|
+
// retired while installed copies call it. The sepolia entry above deliberately stays on
|
|
40644
|
+
// ops-test.gvnr.xyz — there is no ops-test.diamondhands.credit twin (open decision 2).
|
|
40645
|
+
serviceEndpoint: "https://ops.diamondhands.credit",
|
|
40642
40646
|
litNetwork: "chipotle",
|
|
40643
40647
|
// On-chain PKPValidation generation, mainnet (validatorForVersion(3) is the ONLY
|
|
40644
40648
|
// registered validator — verified live 2026-08-05). Without this the SDK defaults
|
|
@@ -56902,7 +56906,17 @@ function getSepoliaConfig() {
|
|
|
56902
56906
|
function getMainnetConfig() {
|
|
56903
56907
|
return {
|
|
56904
56908
|
mode: "service",
|
|
56905
|
-
|
|
56909
|
+
// Cutover 2026-09-08: the product's own domain. `ops.gvnr.xyz` still serves the same
|
|
56910
|
+
// broker and always will — every already-installed copy of this package calls it, so
|
|
56911
|
+
// it can never be retired. This changes what NEW installs default to, nothing else.
|
|
56912
|
+
//
|
|
56913
|
+
// Safe only because the server accepts the new audience ALREADY: the SDK derives the
|
|
56914
|
+
// login audience from this endpoint (`server-session.ts` — `loginAudience ??
|
|
56915
|
+
// serviceEndpoint`) and lit-ops-server FAILS CLOSED on an unknown one. Verified live
|
|
56916
|
+
// before this edit: DH_ACCEPTED_LOGIN_AUDIENCES on the deployed revision lists
|
|
56917
|
+
// https://ops.diamondhands.credit. Publishing this ahead of that would lock out every
|
|
56918
|
+
// client that installed it.
|
|
56919
|
+
serviceEndpoint: "https://ops.diamondhands.credit",
|
|
56906
56920
|
chainId: 1,
|
|
56907
56921
|
name: "mainnet",
|
|
56908
56922
|
// No default RPC: mainnet runs in service mode (serviceEndpoint above), so
|
|
@@ -81011,12 +81025,25 @@ document.getElementById("generate").onclick = () => submit(true);
|
|
|
81011
81025
|
|
|
81012
81026
|
// src/util/page-headers.ts
|
|
81013
81027
|
var import_node_crypto6 = require("crypto");
|
|
81014
|
-
function htmlPageSecurityHeaders() {
|
|
81028
|
+
function htmlPageSecurityHeaders(extra) {
|
|
81015
81029
|
const nonce = (0, import_node_crypto6.randomBytes)(16).toString("base64");
|
|
81030
|
+
const base = [
|
|
81031
|
+
`default-src 'none'`,
|
|
81032
|
+
`script-src 'nonce-${nonce}'`,
|
|
81033
|
+
`style-src 'unsafe-inline'`,
|
|
81034
|
+
`connect-src 'self'`,
|
|
81035
|
+
`base-uri 'none'`,
|
|
81036
|
+
`form-action 'none'`,
|
|
81037
|
+
`frame-ancestors 'none'`
|
|
81038
|
+
];
|
|
81039
|
+
for (const [directive, sources] of Object.entries(extra ?? {})) {
|
|
81040
|
+
if (sources.length === 0) continue;
|
|
81041
|
+
base.push(`${directive} ${sources.join(" ")}`);
|
|
81042
|
+
}
|
|
81016
81043
|
return {
|
|
81017
81044
|
nonce,
|
|
81018
81045
|
headers: {
|
|
81019
|
-
"Content-Security-Policy":
|
|
81046
|
+
"Content-Security-Policy": base.join("; "),
|
|
81020
81047
|
"X-Frame-Options": "DENY",
|
|
81021
81048
|
"Referrer-Policy": "no-referrer",
|
|
81022
81049
|
"X-Content-Type-Options": "nosniff"
|
|
@@ -84247,7 +84274,7 @@ function registerBoundaryInfoResource(server, getB) {
|
|
|
84247
84274
|
}
|
|
84248
84275
|
|
|
84249
84276
|
// src/version.ts
|
|
84250
|
-
var SERVER_VERSION = "0.5.
|
|
84277
|
+
var SERVER_VERSION = "0.5.12";
|
|
84251
84278
|
|
|
84252
84279
|
// src/server.ts
|
|
84253
84280
|
var SERVER_INSTRUCTIONS = "Diamond Hands MCP \u2014 Bitcoin-collateralized borrowing. Before promising ANY flow, read the boundary://info resource and honor its `capabilities` block: it states which network this server is on, whether money is real (practiceWorld), whether writes are enabled (and the true reason when they are not), and which signer modes this build actually offers \u2014 never describe a flow outside it. State the network and whether funds are real when the user first acts. Authorization is chosen by conversation via the signer_setup tool (when listed); writes always require confirmed:true after showing the human-readable card. For walkthroughs consult the guide tool / guide:// resources instead of inventing steps; when a tool refuses, relay its stated reason and remedy \u2014 do not improvise alternatives. When a network_switch tool is listed, the network can change mid-session \u2014 after ANY switch, re-read boundary://info and state the new network and money reality to the user before doing anything else. When the user asks to disconnect / log out / sign out / forget or remove their wallet, call signer_setup action 'disconnect' (the full flush) \u2014 never treat 'reset-borrower' as a disconnect; it only swaps identity. READING DATA: a payload's fields and notes are authoritative \u2014 state what they say, never speculate past them, and when the data does not carry something, say 'the data does not carry X'. Field meanings live in guide topic 'reading-data'; `reading` notes inside a result are interpretation instructions for that exact payload \u2014 follow them over any prior assumption.";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gvnrdao/dh-mcp",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.12",
|
|
4
4
|
"description": "MCP server for the Diamond Hands protocol",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@anthropic-ai/mcpb": "2.1.2",
|
|
57
|
-
"@gvnrdao/dh-sdk": "^0.0.
|
|
57
|
+
"@gvnrdao/dh-sdk": "^0.0.337",
|
|
58
58
|
"@types/express": "5.0.3",
|
|
59
59
|
"@types/jest": "29.5.12",
|
|
60
60
|
"@types/node": "20.14.10",
|