request-wallet-sign 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/bin/index.js +17 -5
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -474,6 +474,9 @@ export function buildHtml(req, port, networkUrl, opts = {}) {
474
474
  .network-info.tunnel { background: #0d1e16; border-color: #1e5f3a; }
475
475
  .network-info.tunnel a { color: #4ade80; }
476
476
  .cross-device { margin-top: 1.25rem; }
477
+ .cd-link { display: inline-block; margin-top: 0.75rem; color: #64748b; font-size: 0.8rem;
478
+ text-decoration: underline; cursor: pointer; }
479
+ .cd-link:hover { color: #94a3b8; }
477
480
  .net-caveat { margin-top: 0.5rem; padding: 0.5rem 0.75rem; border-radius: 8px;
478
481
  background: #2a1e08; border: 1px solid #5f4a1e; color: #fbbf24;
479
482
  font-size: 0.75rem; line-height: 1.4; }
@@ -534,10 +537,13 @@ export function buildHtml(req, port, networkUrl, opts = {}) {
534
537
  </div>
535
538
  <button class="icon-btn" id="cd-check-btn" style="display:none">Check reachability</button>
536
539
  <div id="cd-status" class="net-caveat" style="display:none"></div>
537
- ${networkUrl ? `<div class="network-info">
538
- <span>📱 Same network:</span>
539
- <a href="${escHtml(networkUrl)}" target="_blank">${escHtml(networkUrl)}</a>
540
- <button class="icon-btn" id="copy-url-btn">⧉ Copy</button>
540
+ ${networkUrl ? `<a href="#" id="cd-lan-toggle" class="cd-link">Or use a local-network address instead</a>
541
+ <div id="cd-lan" style="display:none">
542
+ <div class="network-info">
543
+ <span>📱 Same network:</span>
544
+ <a href="${escHtml(networkUrl)}" target="_blank">${escHtml(networkUrl)}</a>
545
+ <button class="icon-btn" id="copy-url-btn">⧉ Copy</button>
546
+ </div>
541
547
  </div>` : ''}
542
548
  </div>
543
549
  </div>
@@ -992,7 +998,7 @@ async function startTunnel() {
992
998
  const btn = document.getElementById('cross-device-btn');
993
999
  document.getElementById('cd-panel').style.display = 'block';
994
1000
  btn.disabled = true;
995
- btn.innerHTML = '<span class="spinner"></span>Starting secure tunnel…';
1001
+ btn.innerHTML = '<span class="spinner"></span>Opening tunnel…';
996
1002
  try {
997
1003
  const res = await fetch('/tunnel/start', { method: 'POST' }).then(r => r.json());
998
1004
  if (res.url) {
@@ -1025,6 +1031,12 @@ const cdBtn = document.getElementById('cross-device-btn');
1025
1031
  if (cdBtn) cdBtn.addEventListener('click', startTunnel);
1026
1032
  const cdCheck = document.getElementById('cd-check-btn');
1027
1033
  if (cdCheck) cdCheck.addEventListener('click', checkTunnel);
1034
+ const cdLanToggle = document.getElementById('cd-lan-toggle');
1035
+ if (cdLanToggle) cdLanToggle.addEventListener('click', e => {
1036
+ e.preventDefault();
1037
+ document.getElementById('cd-lan').style.display = 'block';
1038
+ cdLanToggle.style.display = 'none';
1039
+ });
1028
1040
  const copyTunnelBtn = document.getElementById('copy-tunnel-btn');
1029
1041
  if (copyTunnelBtn) copyTunnelBtn.addEventListener('click', e =>
1030
1042
  copyText(document.getElementById('cd-tunnel-link').href, e.currentTarget));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "request-wallet-sign",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Let AI agents surface wallet signing requests to users via a local browser page",
5
5
  "type": "module",
6
6
  "engines": {