@opennodes/registry 0.1.17 → 0.1.18
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 +2 -2
- package/src/search.js +4 -0
- package/src/web/index.html +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opennodes/registry",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
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.
|
|
46
|
+
"@opennodes/core": "0.1.3",
|
|
47
47
|
"pg": "^8.13.1"
|
|
48
48
|
}
|
|
49
49
|
}
|
package/src/search.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Offering search + transparent ranking (ONP-3 §5–6).
|
|
2
|
+
import { inJurisdiction } from '@opennodes/core';
|
|
2
3
|
|
|
3
4
|
export const RANK_COMPONENTS = { price: 0.35, tier: 0.35, probe_success: 0.30 };
|
|
4
5
|
const TIER_SCORE = { unverified: 0, community: 0.4, verified: 0.8, attested: 1.0 };
|
|
@@ -39,6 +40,8 @@ export async function collectOfferings(store) {
|
|
|
39
40
|
binding: offering.binding,
|
|
40
41
|
pricing: offering.pricing,
|
|
41
42
|
data_policy: offering.data_policy ?? null,
|
|
43
|
+
// Where the operator says it is (ONP-2 node.operator.country, node.regions); imports carry none.
|
|
44
|
+
jurisdiction: { country: card.node?.operator?.country ?? null, regions: card.node?.regions ?? [] },
|
|
42
45
|
// Allocated hardware for THIS offering (offering-level override wins over the
|
|
43
46
|
// node-level description) — same artifact on different vendors runs on different
|
|
44
47
|
// silicon, and clients deserve to see which. Always basis-labeled, never measured.
|
|
@@ -76,6 +79,7 @@ export async function searchOfferingsPaged(store, query) {
|
|
|
76
79
|
}
|
|
77
80
|
if (q('max_input_price')) items = items.filter((o) => (o.pricing.input_per_mtok ?? Infinity) <= Number(q('max_input_price')));
|
|
78
81
|
if (q('scheme')) items = items.filter((o) => o.pricing.schemes.includes(q('scheme')));
|
|
82
|
+
if (q('jurisdiction')) items = items.filter((o) => inJurisdiction(o, q('jurisdiction')));
|
|
79
83
|
if (q('tier')) {
|
|
80
84
|
const order = ['unverified', 'community', 'verified', 'attested'];
|
|
81
85
|
const min = order.indexOf(q('tier'));
|
package/src/web/index.html
CHANGED
|
@@ -219,6 +219,7 @@
|
|
|
219
219
|
<div class="toolbar">
|
|
220
220
|
<input type="text" id="f-q" placeholder="Search models, families, nodes…">
|
|
221
221
|
<span class="switchrow" id="f-verified" title="identity-fingerprinted · context-verified · continuously probed"><span class="switch"></span><b style="font-size:0.78rem">Verified only</b></span>
|
|
222
|
+
<span class="switchrow" id="f-eea" title="operators that declare a country in the EU, Iceland, Liechtenstein or Norway; imported listings declare none"><span class="switch"></span><b style="font-size:0.78rem">EU/EEA</b></span>
|
|
222
223
|
<select id="f-modality">
|
|
223
224
|
<option value="">any modality</option>
|
|
224
225
|
<option>text</option><option>multimodal</option><option>image</option>
|
|
@@ -236,6 +237,7 @@
|
|
|
236
237
|
<div class="toolbar" style="margin-top:0.4rem">
|
|
237
238
|
<select id="adv-preset"><option value="">balanced</option><option value="cheap">cheapest</option><option value="fast">fastest</option><option value="quality">best quality</option><option value="private">privacy-first</option></select>
|
|
238
239
|
<span class="switchrow" id="adv-verified"><span class="switch"></span><b style="font-size:0.78rem">Verified only</b></span>
|
|
240
|
+
<span class="switchrow" id="adv-eea" title="only operators that declare an EU/EEA country"><span class="switch"></span><b style="font-size:0.78rem">EU/EEA</b></span>
|
|
239
241
|
<button class="btn" id="adv-go">Recommend</button>
|
|
240
242
|
<span class="prov">Deterministic: same catalog + task + policy → same answer, with the score components shown. The <code>onp mcp</code> / gateway advisors extract features locally and never send your prompt; this box sends the text to this registry.</span>
|
|
241
243
|
</div>
|
|
@@ -556,6 +558,7 @@ document.querySelectorAll('.toggle').forEach((b) => b.addEventListener('click',
|
|
|
556
558
|
b.classList.toggle('on'); b.classList.contains('on') ? sup.add(b.dataset.sup) : sup.delete(b.dataset.sup); search();
|
|
557
559
|
}));
|
|
558
560
|
$('#f-verified').addEventListener('click', () => { $('#f-verified').classList.toggle('on'); search(); });
|
|
561
|
+
$('#f-eea').addEventListener('click', () => { $('#f-eea').classList.toggle('on'); search(); });
|
|
559
562
|
let debounce;
|
|
560
563
|
for (const id of ['f-q', 'f-price']) $('#' + id).addEventListener('input', () => { clearTimeout(debounce); debounce = setTimeout(search, 250); });
|
|
561
564
|
for (const id of ['f-modality', 'f-sort']) $('#' + id).addEventListener('change', search);
|
|
@@ -608,6 +611,7 @@ async function search() {
|
|
|
608
611
|
if ($('#f-q').value) p.set('q', $('#f-q').value);
|
|
609
612
|
if ($('#f-modality').value) p.set('modality', $('#f-modality').value);
|
|
610
613
|
if ($('#f-verified').classList.contains('on')) p.set('tier', 'verified');
|
|
614
|
+
if ($('#f-eea').classList.contains('on')) p.set('jurisdiction', 'eea');
|
|
611
615
|
if ($('#f-price').value) p.set('max_input_price', $('#f-price').value);
|
|
612
616
|
if (sup.size) p.set('supports', [...sup].join(','));
|
|
613
617
|
p.set('sort', $('#f-sort').value);
|
|
@@ -630,6 +634,7 @@ async function search() {
|
|
|
630
634
|
|
|
631
635
|
/* ---------- advisor (ONP-3 §5b) ---------- */
|
|
632
636
|
$('#adv-verified').addEventListener('click', () => $('#adv-verified').classList.toggle('on'));
|
|
637
|
+
$('#adv-eea').addEventListener('click', () => $('#adv-eea').classList.toggle('on'));
|
|
633
638
|
$('#adv-go').addEventListener('click', runAdvisor);
|
|
634
639
|
$('#adv-task').addEventListener('keydown', (e) => { if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) runAdvisor(); });
|
|
635
640
|
async function runAdvisor() {
|
|
@@ -638,6 +643,7 @@ async function runAdvisor() {
|
|
|
638
643
|
const policy = { limit: 3 };
|
|
639
644
|
if ($('#adv-preset').value) policy.preset = $('#adv-preset').value;
|
|
640
645
|
if ($('#adv-verified').classList.contains('on')) policy.min_tier = 'verified';
|
|
646
|
+
if ($('#adv-eea').classList.contains('on')) policy.jurisdiction = 'eea';
|
|
641
647
|
$('#adv-out').innerHTML = '<p class="sub">ranking…</p>';
|
|
642
648
|
try {
|
|
643
649
|
const r = await api('/v0/recommend', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ task, policy }) });
|