@opennodes/registry 0.1.43 → 0.1.44

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/package.json +1 -1
  2. package/src/web/index.html +118 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opennodes/registry",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
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",
@@ -131,8 +131,27 @@
131
131
  #w-map { height: 440px; margin-bottom: 0.4rem; overflow: hidden; }
132
132
  #w-map .leaflet-popup-content { font-family: "Archivo", "Helvetica Neue", Arial, sans-serif; font-size: 0.8rem; line-height: 1.4; margin: 0.6rem 0.8rem; }
133
133
  #w-map .leaflet-popup-content .site + .site { border-top: 1px solid #D6DEE3; margin-top: 0.45rem; padding-top: 0.45rem; }
134
- .wlegend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.74rem; color: var(--muted); margin: 0 0 0.8rem; }
135
- .wlegend .dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; border: 2px solid currentColor; vertical-align: -0.1rem; margin-right: 0.3rem; }
134
+ .wstats { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; align-items: baseline; }
135
+ .wstats .stat b { font-size: 1.15rem; margin-right: 0.3rem; }
136
+ .wstats .stat { font-size: 0.8rem; color: var(--muted); }
137
+ details.wfold { margin: 0 0 0.8rem; }
138
+ details.wfold > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 0.6rem; font-weight: 600; font-size: 0.86rem; padding: 0.6rem 1rem; }
139
+ details.wfold > summary::-webkit-details-marker { display: none; }
140
+ details.wfold > summary::before { content: "+"; font-family: "IBM Plex Mono", monospace; color: var(--muted); width: 0.8rem; }
141
+ details.wfold[open] > summary::before { content: "–"; }
142
+ details.wfold > summary .prov { font-weight: 400; }
143
+ .wlegend { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.9rem 1.6rem; font-size: 0.78rem; color: var(--muted); padding: 0 1rem 0.9rem; }
144
+ .wlegend h4 { font-family: "IBM Plex Mono", monospace; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.08em; color: var(--faint); margin: 0 0 0.35rem; }
145
+ .wlegend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
146
+ .wlegend .dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; border: 2px solid currentColor; vertical-align: -0.1rem; margin-right: 0.4rem; }
147
+ #w-countries table.grid td { padding: 0.5rem 0.8rem; vertical-align: top; }
148
+ #w-countries tr.cgroup td { background: var(--line-2); font-family: "IBM Plex Mono", monospace; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); padding: 0.35rem 0.8rem; }
149
+ #w-countries tr.crow { cursor: pointer; }
150
+ #w-countries tr.crow:hover td { background: var(--line-2); }
151
+ #w-countries .cname b { display: block; }
152
+ #w-countries .provs { font-size: 0.78rem; color: var(--muted); }
153
+ .sitebar { display: flex; height: 0.4rem; width: 6rem; border-radius: 0.2rem; overflow: hidden; background: var(--line-2); margin-top: 0.25rem; }
154
+ .sitebar span { background: var(--accent); } .sitebar span + span { background: var(--warn); }
136
155
  .micro { font-family: "IBM Plex Mono", monospace; font-size: 0.58rem; font-weight: 600; letter-spacing: 0.04em; }
137
156
  .m-measured { color: var(--good); } .m-claimed { color: var(--faint); font-weight: 400; } .m-warn { color: var(--warn); }
138
157
  .prov { font-family: "IBM Plex Mono", monospace; font-size: 0.64rem; color: var(--faint); }
@@ -411,14 +430,37 @@
411
430
  </div>
412
431
  <div class="panel pad" id="w-summary" style="margin-bottom:0.8rem"></div>
413
432
  <div class="panel" id="w-map" hidden></div>
414
- <div class="wlegend" id="w-legend" hidden>
415
- <span><span class="dot" style="color:var(--good); background:var(--good)"></span>measured or attested</span>
416
- <span><span class="dot" style="color:var(--accent); background:var(--accent)"></span>documented</span>
417
- <span><span class="dot" style="color:var(--faint); background:var(--faint)"></span>claimed</span>
418
- <span><span class="dot" style="color:var(--muted)"></span>hollow: approximate point, only the region or country is known</span>
419
- <span><span class="dot" style="color:var(--warn); border-style:dashed"></span>dashed: planned</span>
420
- <span>Size: models served. Several sites in one city share a marker.</span>
421
- </div>
433
+ <details class="panel wfold" id="w-legend" data-fold="legend" open>
434
+ <summary>Legend <span class="prov">what the markers, chips and columns mean</span></summary>
435
+ <div class="wlegend">
436
+ <div><h4>MARKER COLOUR · EVIDENCE</h4><ul>
437
+ <li><span class="dot" style="color:var(--good); background:var(--good)"></span>measured or attested: registry probes or a signed, audited card</li>
438
+ <li><span class="dot" style="color:var(--accent); background:var(--accent)"></span>documented: the provider's own dated page</li>
439
+ <li><span class="dot" style="color:var(--faint); background:var(--faint)"></span>claimed: the provider or a news report says so</li>
440
+ </ul></div>
441
+ <div><h4>MARKER SHAPE</h4><ul>
442
+ <li><span class="dot" style="color:var(--muted)"></span>hollow: approximate point, only the region or country is known</li>
443
+ <li><span class="dot" style="color:var(--warn); border-style:dashed"></span>dashed: planned, not serving yet</li>
444
+ <li>Size grows with the models served. Several sites in one city share a marker; click it for each one.</li>
445
+ </ul></div>
446
+ <div><h4>RESIDENCY · WHAT THE PROVIDER PROMISES</h4><ul>
447
+ <li><span class="chip r-processing">PROCESSING</span> prompts, outputs and stored data stay in the area</li>
448
+ <li><span class="chip r-storage">STORAGE</span> data at rest stays; processing may not</li>
449
+ <li><span class="chip r-none">NO FIXED AREA</span> the provider says data may go anywhere</li>
450
+ <li><span class="chip r-unstated">NOT STATED</span> no public promise found</li>
451
+ <li><b>opt in</b>: a setting or regional endpoint you choose · <b>enterprise</b>: contract or paid plan only</li>
452
+ </ul></div>
453
+ <div><h4>COUNTS</h4><ul>
454
+ <li><b>Providers</b>: companies with at least one site in the country</li>
455
+ <li><b>Models listed</b>: distinct models a provider says it serves there. A dash means the provider names its sites but not which models run at each</li>
456
+ <li>Click a country to filter the map and the site table.</li>
457
+ </ul></div>
458
+ </div>
459
+ </details>
460
+ <details class="panel wfold" id="w-countries" data-fold="countries" open>
461
+ <summary>Countries <span class="prov" id="w-countries-count"></span></summary>
462
+ <div class="tablewrap" id="w-countries-table"></div>
463
+ </details>
422
464
  <div class="panel tablewrap" id="w-table"></div>
423
465
  <h2 id="w-res" style="margin-top:1.6rem">Residency commitments</h2>
424
466
  <p class="sub">What each provider officially promises about where prompts, outputs and stored data stay, with the page that says so, including routers and providers with no known sites. <b>default</b>: every customer; <b>opt in</b>: a setting, regional endpoint or region you choose; <b>enterprise</b>: contract or paid plan only. Curated from public pages; a promise is not proof (<a href="https://github.com/opennodes-io/opennodes/blob/main/spec/ONP-2-node-card.md#3b-residency--what-the-operator-promises-about-where-data-stays" target="_blank" rel="noopener">ONP-2 §3b</a>). Also as <a id="r-json" href="/v0/residency">JSON</a> and <a id="r-csv" href="/v0/residency?format=csv">CSV</a>.</p>
@@ -2240,17 +2282,21 @@ async function loadWhere() {
2240
2282
  $('#w-geojson').href = '/v0/locations' + (q ? q + '&' : '?') + 'format=geojson';
2241
2283
  try {
2242
2284
  const r = await api('/v0/locations' + q);
2243
- renderWhereMap(r.sites).catch((e) => { $('#w-map').hidden = true; $('#w-legend').hidden = true; console.warn('map:', e.message); });
2285
+ renderWhereMap(r.sites).catch((e) => { $('#w-map').hidden = true; console.warn('map:', e.message); });
2244
2286
  if (!whereCountriesLoaded && !q) {
2245
2287
  whereCountriesLoaded = true;
2246
2288
  $('#w-country').innerHTML = '<option value="">every country</option>'
2247
- + r.countries.map((c) => `<option value="${esc(c.country)}">${esc(c.country)} · ${c.sites} sites</option>`).join('');
2289
+ + r.countries.map((c) => `<option value="${esc(c.country)}">${esc(countryName(c.country))} · ${c.sites} sites</option>`).join('');
2248
2290
  }
2249
2291
  const s = r.summary;
2250
2292
  $('#w-counts').textContent = `${s.sites} sites · ${s.countries} countries`;
2251
- $('#w-summary').innerHTML = `<div style="display:flex; flex-wrap:wrap; gap:0.4rem 1.2rem; font-size:0.84rem">`
2252
- + r.countries.map((c) => `<span><b>${esc(c.country)}</b> ${c.providers} providers · ${c.sites} sites (${c.live_sites} live) · ${c.models} models</span>`).join('')
2253
- + `</div><p class="prov" style="margin:0.5rem 0 0">${fmtInt(s.located_offerings)} offerings in the registry declare where they run; ${fmtInt(s.unlocated_offerings)} do not. That gap is what this page exists to close.</p>`;
2293
+ const live = r.sites.filter((x) => x.status === 'live').length;
2294
+ const promised = r.sites.filter((x) => x.residency?.some((c) => c.commitment === 'processing')).length;
2295
+ const stat = (n, label) => `<span class="stat"><b>${fmtInt(n)}</b>${label}</span>`;
2296
+ $('#w-summary').innerHTML = `<div class="wstats">${stat(s.sites, 'sites')}${stat(live, 'live')}${stat(s.countries, 'countries')}`
2297
+ + `${stat(new Set(r.sites.map((x) => x.provider)).size, 'providers')}${stat(promised, 'sites with a processing promise')}</div>`
2298
+ + `<p class="prov" style="margin:0.5rem 0 0">${fmtInt(s.located_offerings)} offerings in the registry declare where they run; ${fmtInt(s.unlocated_offerings)} do not. That gap is what this page exists to close.</p>`;
2299
+ renderCountries(r.sites);
2254
2300
  const models = (x) => x.models.length
2255
2301
  ? `<div class="wmodels">${x.models.slice(0, 12).map((m) => `<span>${esc(m.name)}${m.lineage_origins ? ` <span class="lin">${esc(m.lineage_origins.join('/'))}</span>` : ''}</span>`).join('')}${x.models.length > 12 ? `<span class="prov">+${x.models.length - 12} more</span>` : ''}</div>`
2256
2302
  : `<span style="color:var(--muted); font-size:0.8rem">${esc(x.models_note ?? '—')}</span>`;
@@ -2272,6 +2318,62 @@ async function loadWhere() {
2272
2318
  </tr>`).join('') + '</tbody></table>' : '<p class="sub" style="padding:0.9rem 1rem; margin:0">No sites match these filters.</p>';
2273
2319
  } catch (e) { $('#w-table').innerHTML = '<p class="err">' + esc(e.message) + '</p>'; }
2274
2320
  }
2321
+ /* Countries table: grouped by continent, sites as live/planned, the providers by name. */
2322
+ const CONTINENT = Object.fromEntries([
2323
+ ['Americas', 'US CA MX BR AR CL CO PE UY CR PA'],
2324
+ ['Europe', 'AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MT NL NO PL PT RO RS SE SI SK UA TR'],
2325
+ ['Middle East and Africa', 'AE BH EG IL JO KE KW MA NG OM QA SA ZA'],
2326
+ ['Asia-Pacific', 'AU CN HK ID IN JP KR MY NZ PH PK SG TH TW VN KZ'],
2327
+ ].flatMap(([name, codes]) => codes.split(' ').map((c) => [c, name])));
2328
+ const CONTINENT_ORDER = ['Americas', 'Europe', 'Middle East and Africa', 'Asia-Pacific', 'Other'];
2329
+ let regionNames = null;
2330
+ try { regionNames = new Intl.DisplayNames(['en'], { type: 'region' }); } catch { /* old browser: codes only */ }
2331
+ const countryName = (code) => { try { return regionNames?.of(code) ?? code; } catch { return code; } };
2332
+ function renderCountries(sites) {
2333
+ const by = new Map();
2334
+ for (const s of sites) {
2335
+ const c = by.get(s.country) ?? { code: s.country, sites: 0, live: 0, planned: 0, providers: new Map(), models: new Set(), processing: 0 };
2336
+ c.sites++;
2337
+ if (s.status === 'live') c.live++; else if (s.status === 'planned') c.planned++;
2338
+ c.providers.set(s.provider, (c.providers.get(s.provider) ?? 0) + 1);
2339
+ for (const m of s.models) c.models.add(m.artifact ?? m.name);
2340
+ if (s.residency?.some((x) => x.commitment === 'processing')) c.processing++;
2341
+ by.set(s.country, c);
2342
+ }
2343
+ const rows = [...by.values()].sort((a, b) => b.sites - a.sites || a.code.localeCompare(b.code));
2344
+ const max = Math.max(1, ...rows.map((c) => c.sites));
2345
+ $('#w-countries-count').textContent = `${rows.length} ${rows.length === 1 ? 'country' : 'countries'}, most sites first`;
2346
+ const groups = CONTINENT_ORDER.map((g) => [g, rows.filter((c) => (CONTINENT[c.code] ?? 'Other') === g)]).filter(([, list]) => list.length);
2347
+ const providers = (c) => {
2348
+ const names = [...c.providers.entries()].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).map(([n, k]) => esc(n) + (k > 1 ? ` <span class="prov">×${k}</span>` : ''));
2349
+ return names.slice(0, 8).join(', ') + (names.length > 8 ? ` <span class="prov">+${names.length - 8} more</span>` : '');
2350
+ };
2351
+ $('#w-countries-table').innerHTML = rows.length ? `<table class="grid"><thead><tr>
2352
+ <th>COUNTRY</th><th>SITES</th><th>PROVIDERS</th><th>MODELS LISTED</th><th>PROCESSING PROMISE</th>
2353
+ </tr></thead><tbody>` + groups.map(([g, list]) => `<tr class="cgroup"><td colspan="5">${esc(g.toUpperCase())} · ${list.reduce((n, c) => n + c.sites, 0)} SITES</td></tr>`
2354
+ + list.map((c) => `<tr class="crow" data-country="${esc(c.code)}" title="Show only ${esc(countryName(c.code))}">
2355
+ <td class="cname"><b>${esc(countryName(c.code))}</b><span class="prov">${esc(c.code)}</span></td>
2356
+ <td class="mono" style="font-size:0.78rem; white-space:nowrap">${c.sites}${c.planned ? ` <span class="prov">(${c.planned} planned)</span>` : ''}
2357
+ <div class="sitebar"><span style="width:${(c.live / max) * 100}%"></span><span style="width:${(c.planned / max) * 100}%"></span></div></td>
2358
+ <td class="provs"><b style="color:var(--ink)">${c.providers.size}</b> · ${providers(c)}</td>
2359
+ <td class="mono" style="font-size:0.78rem">${c.models.size || '—'}</td>
2360
+ <td class="mono" style="font-size:0.78rem">${c.processing ? `${c.processing} of ${c.sites} sites` : '—'}</td>
2361
+ </tr>`).join('')).join('') + '</tbody></table>' : '<p class="sub" style="padding:0.9rem 1rem; margin:0">No sites match these filters.</p>';
2362
+ }
2363
+ $('#w-countries-table').addEventListener('click', (e) => {
2364
+ const row = e.target.closest('tr.crow');
2365
+ if (!row) return;
2366
+ const sel = $('#w-country');
2367
+ if (![...sel.options].some((o) => o.value === row.dataset.country)) sel.add(new Option(row.dataset.country, row.dataset.country));
2368
+ sel.value = sel.value === row.dataset.country ? '' : row.dataset.country;
2369
+ loadWhere();
2370
+ $('#w-map').scrollIntoView({ behavior: 'smooth', block: 'start' });
2371
+ });
2372
+ // Legend and countries: open or closed as the viewer last left them.
2373
+ for (const d of document.querySelectorAll('details.wfold')) {
2374
+ try { const v = localStorage.getItem('onp-where-' + d.dataset.fold); if (v) d.open = v === 'open'; } catch { /* storage blocked */ }
2375
+ d.addEventListener('toggle', () => { try { localStorage.setItem('onp-where-' + d.dataset.fold, d.open ? 'open' : 'closed'); } catch { /* storage blocked */ } });
2376
+ }
2275
2377
  /* Residency (ONP-2 §3b): one chip per commitment, with who gets it and the source. */
2276
2378
  const RES_LABEL = { processing: 'PROCESSING', storage: 'STORAGE', none: 'NO FIXED AREA', unstated: 'NOT STATED' };
2277
2379
  const AVAIL_LABEL = { opt_in: 'opt in', enterprise: 'enterprise' };
@@ -2338,7 +2440,7 @@ async function renderWhereMap(sites) {
2338
2440
  if (mapConfig === undefined) mapConfig = (await api('/v0/health')).map ?? null;
2339
2441
  if (!mapConfig) return;
2340
2442
  const L = await loadLeaflet();
2341
- $('#w-map').hidden = false; $('#w-legend').hidden = false;
2443
+ $('#w-map').hidden = false;
2342
2444
  const css = getComputedStyle(document.documentElement);
2343
2445
  const color = { claimed: css.getPropertyValue('--faint').trim(), documented: css.getPropertyValue('--accent').trim(),
2344
2446
  measured: css.getPropertyValue('--good').trim(), attested: css.getPropertyValue('--good').trim(), planned: css.getPropertyValue('--warn').trim() };