@opennodes/registry 0.1.36 → 0.1.38

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opennodes/registry",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
4
4
  "description": "OpenNodes (ONP) reference registry: node registration with proof-of-resource qualification (Stage A/B/C), transparent ranking, enforceable estimates, catalog importers (OpenRouter, Hugging Face, models.dev, Ollama), MCP surface, and the web app (catalog, chat, advisor, Node Builder)",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -43,7 +43,7 @@
43
43
  "access": "public"
44
44
  },
45
45
  "dependencies": {
46
- "@opennodes/core": "0.1.14",
46
+ "@opennodes/core": "0.1.16",
47
47
  "pg": "^8.13.1"
48
48
  }
49
49
  }
@@ -542,6 +542,9 @@
542
542
 
543
543
  <script>
544
544
  const $ = (s) => document.querySelector(s);
545
+ // The model card moves between the list's detail pane and its own page; held here so that clearing
546
+ // the pane ("No offerings match") cannot destroy it.
547
+ const MODEL_CARD = document.getElementById('model-card');
545
548
  const api = (p, opts) => fetch(p, opts).then(async (r) => { const b = await r.json().catch(() => ({})); if (!r.ok) throw new Error(b.detail || r.status); return b; });
546
549
  const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
547
550
  const fmt = (n) => n == null ? '—' : (typeof n === 'number' ? (Math.round(n * 1000) / 1000) : n);
@@ -581,7 +584,7 @@ function route() {
581
584
  document.querySelectorAll('nav a.tab').forEach((a) => a.classList.toggle('active', a.dataset.view === view || (view === 'model' && a.dataset.view === 'models') || (view === 'node' && a.dataset.view === 'nodes')));
582
585
  window.scrollTo(0, 0);
583
586
  if (view === 'models') search();
584
- if (view === 'model' && arg) { $('#view-model').appendChild($('#model-card')); loadModel(arg); }
587
+ if (view === 'model' && arg) { $('#view-model').appendChild(MODEL_CARD); loadModel(arg); }
585
588
  if (view === 'chat') loadChatTargets();
586
589
  if (view === 'rankings') loadRankings();
587
590
  if (view === 'nodes') loadNodes();
@@ -693,7 +696,7 @@ function renderList(offerings) {
693
696
  $('#m-list').innerHTML = offerings.map(renderItem).join('')
694
697
  || '<p class="sub">No offerings match. A fresh registry fills up via catalog imports and node registrations.</p>';
695
698
  document.querySelectorAll('.mitem').forEach((el) => el.addEventListener('click', () => selectModel(el)));
696
- const current = $('#model-card')?.dataset.artifact;
699
+ const current = MODEL_CARD.dataset.artifact;
697
700
  document.querySelectorAll('.mitem').forEach((el) => el.classList.toggle('sel', el.dataset.artifact === current));
698
701
  }
699
702
 
@@ -716,7 +719,7 @@ async function search() {
716
719
  renderList(offerings);
717
720
  updatePager();
718
721
  // keep the current selection when still listed, else select the first result
719
- const current = $('#model-card')?.dataset.artifact;
722
+ const current = MODEL_CARD.dataset.artifact;
720
723
  const keep = current && [...document.querySelectorAll('.mitem')].find((el) => el.dataset.artifact === current);
721
724
  const target = keep ?? document.querySelector('.mitem');
722
725
  if (target) selectModel(target);
@@ -772,7 +775,7 @@ function selectModel(el) {
772
775
  document.querySelectorAll('.mitem').forEach((x) => x.classList.toggle('sel', x === el));
773
776
  listedOffering = lastResults.find((o) => `${o.node_id}/${o.offering_id}` === el.dataset.key) ?? null;
774
777
  const host = $('#m-detail');
775
- if (!host.contains($('#model-card'))) { host.innerHTML = ''; host.appendChild($('#model-card')); }
778
+ if (!host.contains(MODEL_CARD)) { host.innerHTML = ''; host.appendChild(MODEL_CARD); }
776
779
  loadModel(el.dataset.artifact);
777
780
  }
778
781
 
@@ -912,7 +915,7 @@ function renderScore(artifact) {
912
915
  }
913
916
 
914
917
  async function loadModel(artifact) {
915
- $('#model-card').dataset.artifact = artifact;
918
+ MODEL_CARD.dataset.artifact = artifact;
916
919
  $('#md-crumb').innerHTML = '<a href="#/">Models</a> / ' + esc(artifact);
917
920
  $('#md-title').textContent = '…';
918
921
  $('#md-offerings').innerHTML = '';
@@ -1108,7 +1111,7 @@ async function showHostedAlternatives(first, artifact) {
1108
1111
  found.set(o.node_id + '/' + o.offering_id, o);
1109
1112
  }
1110
1113
  }
1111
- if ($('#model-card').dataset.artifact !== artifact) return; // the visitor moved on
1114
+ if (MODEL_CARD.dataset.artifact !== artifact) return; // the visitor moved on
1112
1115
  const tierOrder = { attested: 4, verified: 3, community: 2, unverified: 1 };
1113
1116
  const picks = [...found.values()].sort((a, b) =>
1114
1117
  (tierOrder[b.tier] ?? 0) - (tierOrder[a.tier] ?? 0)