@bulolo/hermes-link 0.2.8 → 0.2.9

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.
@@ -3585,14 +3585,36 @@ function buildPairingPage(options) {
3585
3585
  </div>
3586
3586
  <script>
3587
3587
  async function pair() {
3588
- const token = document.getElementById('token').textContent;
3588
+ const token = document.getElementById('token').textContent.trim();
3589
+ const btn = document.querySelector('button');
3590
+ btn.disabled = true;
3591
+ btn.textContent = 'Pairing...';
3589
3592
  try {
3590
- const res = await fetch('http://127.0.0.1:${options.port}/api/v1/bootstrap');
3591
- if (res.ok) {
3593
+ const res = await fetch('/api/v1/auth/device-session', {
3594
+ method: 'POST',
3595
+ headers: {
3596
+ 'Authorization': 'Bearer ' + token,
3597
+ 'Content-Type': 'application/json'
3598
+ },
3599
+ body: JSON.stringify({
3600
+ device_label: navigator.userAgent.slice(0, 64),
3601
+ device_platform: 'web'
3602
+ })
3603
+ });
3604
+ const data = await res.json();
3605
+ if (res.ok && data.access_token) {
3592
3606
  document.getElementById('status').style.display = 'block';
3607
+ document.getElementById('status').innerHTML =
3608
+ 'Paired! Access token:<br><code style="font-size:0.75rem;word-break:break-all">' +
3609
+ data.access_token.token + '</code>';
3610
+ btn.textContent = 'Paired';
3611
+ } else {
3612
+ throw new Error(data.error?.message || JSON.stringify(data));
3593
3613
  }
3594
3614
  } catch (e) {
3595
- alert('Connection failed: ' + e.message);
3615
+ btn.disabled = false;
3616
+ btn.textContent = 'Pair This Device';
3617
+ alert('Pairing failed: ' + e.message);
3596
3618
  }
3597
3619
  }
3598
3620
  </script>
package/dist/cli/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  saveConfig,
24
24
  startLinkService,
25
25
  writeJsonFile
26
- } from "../chunk-Q546CZFY.js";
26
+ } from "../chunk-GHAP2EHA.js";
27
27
 
28
28
  // src/cli/index.ts
29
29
  import { mkdir as mkdir3 } from "fs/promises";
package/dist/http/app.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startLinkService
3
- } from "../chunk-Q546CZFY.js";
3
+ } from "../chunk-GHAP2EHA.js";
4
4
  export {
5
5
  startLinkService
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bulolo/hermes-link",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Hermes Link companion service and CLI for connecting hermes-agent through zhiji",
5
5
  "license": "MIT",
6
6
  "type": "module",