Repository navigation
Expand file tree
/
Copy pathfront.html
More file actions
827 lines (743 loc) · 38.8 KB
/
Copy pathfront.html
File metadata and controls
827 lines (743 loc) · 38.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Front Page — RAPP Agent Registry</title>
<meta name="description" content="One ranked list over every agent RAR hosts and every third-party skill it indexes. Every row shows why it ranked.">
<meta property="og:title" content="Front Page — RAPP Agent Registry">
<meta property="og:description" content="One ranked list over every agent RAR hosts and every third-party skill it indexes. Every row shows why it ranked.">
<meta property="og:type" content="website">
<!-- The browser probes /favicon.ico on every load and logs a 404 when it is
absent. An empty data: URI answers it without adding a request. -->
<link rel="icon" href="data:,">
<meta property="og:url" content="https://kody-w.github.io/RAR/front.html">
<style>
/* The palette, type scale and chrome are index.html's. This is a new surface
on the same site, not a new site. */
:root {
--bg: #0d1117;
--surface: #161b22;
--surface2: #21262d;
--border: #30363d;
--border-hover: #484f58;
--text: #e6edf3;
--text-dim: #8b949e;
--text-muted: #656d76;
--accent: #58a6ff;
--purple: #bc8cff;
--green: #3fb950;
--amber: #d29922;
--red: #f85149;
--radius: 10px;
--mono: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header {
background: var(--surface); border-bottom: 1px solid var(--border);
padding: 14px 32px; display: flex; align-items: center; justify-content: space-between;
gap: 12px; position: sticky; top: 0; z-index: 50;
}
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 700; }
.logo-mark {
background: linear-gradient(135deg, var(--accent), var(--purple));
color: #fff; width: 32px; height: 32px; border-radius: 8px;
display: flex; align-items: center; justify-content: center;
font-size: .85rem; font-weight: 800; flex: none;
}
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.adv-link {
background: var(--surface2); border: 1px solid var(--border); color: var(--text-dim);
padding: 6px 14px; border-radius: 6px; font-size: .78rem; font-weight: 600;
transition: all .15s;
}
.adv-link:hover { border-color: var(--border-hover); color: var(--text); text-decoration: none; }
.conn { display: flex; align-items: center; gap: 7px; font-size: .75rem; color: var(--text-muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); flex: none; }
.dot.live { background: var(--green); box-shadow: 0 0 0 3px rgba(63,185,80,.18); }
.dot.err { background: var(--red); box-shadow: 0 0 0 3px rgba(248,81,73,.18); }
.container { max-width: 1000px; margin: 0 auto; padding: 28px 24px 72px; }
/* ── masthead ─────────────────────────────────────────────────────────── */
.masthead { margin-bottom: 22px; }
.masthead h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
.masthead .lede { color: var(--text-dim); font-size: .95rem; max-width: 68ch; }
.counts {
display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
font-size: .78rem; color: var(--text-dim);
}
.count-block {
background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
padding: 7px 12px; font-variant-numeric: tabular-nums;
}
.count-block b { color: var(--text); font-weight: 700; }
.count-block.rar b { color: var(--accent); }
.count-block.sourced b { color: var(--purple); }
.count-note { color: var(--text-muted); font-size: .74rem; align-self: center; }
/* ── how ranking works — every word of it comes from the data ─────────── */
.explain { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; }
.explain > summary {
cursor: pointer; list-style: none; padding: 12px 16px;
font-size: .85rem; font-weight: 600; color: var(--text-dim);
display: flex; align-items: center; gap: 8px;
}
.explain > summary::-webkit-details-marker { display: none; }
.explain > summary::before { content: "\25B8"; transition: transform .2s; font-size: .8rem; }
.explain[open] > summary::before { transform: rotate(90deg); }
.explain > summary:hover { color: var(--text); }
.explain-body { padding: 0 16px 16px; font-size: .86rem; color: var(--text-dim); line-height: 1.65; }
.explain-body p { margin-bottom: 14px; }
.comp { display: grid; grid-template-columns: 96px 1fr; gap: 10px 14px; align-items: start; margin-bottom: 10px; }
.comp-head { display: flex; align-items: baseline; gap: 6px; }
.comp-key { font-family: var(--mono); font-size: .8rem; color: var(--text); }
.comp-w { font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--text); font-weight: 700; }
.comp-bar { height: 4px; border-radius: 2px; background: var(--surface2); overflow: hidden; margin-top: 6px; }
.comp-bar i { display: block; height: 100%; background: var(--accent); }
.comp-bar.sourced i { background: var(--purple); }
.comp-bar.both i { background: linear-gradient(90deg, var(--accent), var(--purple)); }
.comp-desc { font-size: .82rem; color: var(--text-dim); }
.comp-applies { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.explain-note { font-size: .78rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.explain-note p { margin-bottom: 8px; }
/* ── controls ─────────────────────────────────────────────────────────── */
.controls {
display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
padding: 12px 14px; margin-bottom: 6px;
background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
position: sticky; top: var(--rar-nav-height, 61px); z-index: 40;
}
.seg { display: flex; gap: 3px; background: var(--bg); padding: 3px; border-radius: 9px; }
.seg button {
padding: 5px 12px; border-radius: 7px; cursor: pointer; font-size: .8rem;
color: var(--text-dim); border: 1px solid transparent; transition: all .15s;
white-space: nowrap; user-select: none;
background: none; font-family: inherit; line-height: inherit;
}
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface2); color: var(--text); border-color: var(--border-hover); }
.seg button[data-origin="native"].active { color: var(--accent); border-color: rgba(88,166,255,.45); }
.seg button[data-origin="sourced"].active { color: var(--purple); border-color: rgba(188,140,255,.45); }
.seg button[data-audience="business"].active { color: #7ee787; border-color: rgba(126,231,135,.4); }
.seg button[data-audience="consumer"].active { color: #ffa657; border-color: rgba(255,166,87,.4); }
.filter-box { position: relative; flex: 1 1 190px; min-width: 160px; }
.filter-box input {
width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
padding: 7px 12px 7px 32px; color: var(--text); font-size: .85rem; outline: none;
font-family: inherit; transition: border-color .15s;
}
.filter-box input:focus { border-color: var(--accent); }
.filter-box input::placeholder { color: var(--text-muted); }
.filter-box .si { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; display: flex; }
.showing { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.showing b { color: var(--text-dim); }
.order-note {
width: 100%; font-size: .74rem; color: var(--text-muted);
border-top: 1px solid var(--border); padding-top: 9px;
}
/* ── the feed ─────────────────────────────────────────────────────────── */
.feed { list-style: none; }
.row {
display: grid; grid-template-columns: 46px 1fr 92px; gap: 0 12px;
padding: 12px 14px 12px 12px; border-bottom: 1px solid var(--border);
border-left: 3px solid transparent; scroll-margin-top: 130px;
}
.row:hover { background: var(--surface); }
/* Blue is RAR's own work, purple is somebody else's. A row that is both —
hosted here, credited upstream — reads purple and says so in its badges. */
.row.rar { border-left-color: rgba(88,166,255,.5); }
.row.sourced { border-left-color: rgba(188,140,255,.5); }
.row.pinned { background: rgba(88,166,255,.07); border-left-color: var(--accent); }
.rank {
font-variant-numeric: tabular-nums; font-size: 1.05rem; font-weight: 700;
color: var(--text-muted); text-align: right; padding-top: 1px;
}
.rank .hash { font-size: .7rem; font-weight: 400; }
.title-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.title { font-size: 1.02rem; font-weight: 600; color: var(--text); }
.title:hover { color: var(--accent); text-decoration: none; }
.badge {
font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}
.badge.rar { background: rgba(88,166,255,.13); color: var(--accent); border: 1px solid rgba(88,166,255,.35); }
.badge.sourced { background: rgba(188,140,255,.13); color: var(--purple); border: 1px solid rgba(188,140,255,.35); }
.badge.tier { background: var(--surface2); color: var(--text-dim); border: 1px solid var(--border); text-transform: none; letter-spacing: 0; font-weight: 600; }
.badge.tier-official { color: var(--green); border-color: rgba(63,185,80,.4); }
.badge.tier-verified { color: var(--accent); border-color: rgba(88,166,255,.4); }
.badge.tier-private { color: var(--amber); border-color: rgba(210,153,34,.4); }
.ref { font-family: var(--mono); font-size: .72rem; color: var(--text-muted); word-break: break-all; }
/* Clamped like index.html's cards: this is a ranked list, not a reading page,
and the full description is one click away at the row's own destination. */
.desc {
color: var(--text-dim); font-size: .86rem; line-height: 1.5; margin-top: 4px;
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* The why strings are the product. They sit in the row, never behind a hover. */
.why { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 8px; }
.why-label {
font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
color: var(--text-muted); margin-right: 2px;
}
.chip {
font-size: .74rem; padding: 2px 8px; border-radius: 5px;
background: var(--surface2); color: var(--text-dim); border: 1px solid var(--border);
}
.row.rar .chip { border-color: rgba(88,166,255,.22); }
.row.sourced .chip { border-color: rgba(188,140,255,.22); }
.chip.est { border-style: dashed; color: var(--text-muted); background: transparent; }
.meta { display: flex; flex-wrap: wrap; gap: 5px 10px; align-items: center; margin-top: 8px; font-size: .75rem; color: var(--text-muted); }
.meta .sep { color: var(--border-hover); }
.act {
background: none; border: 1px solid var(--border); color: var(--text-dim);
padding: 2px 9px; border-radius: 5px; font-size: .73rem; cursor: pointer;
font-family: inherit; transition: all .15s; line-height: 1.45;
}
.act:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.act.copied { border-color: var(--green); color: var(--green); }
/* A third party's numbers are always attributed to the third party. */
.srcline {
margin-top: 8px; padding: 7px 10px; border-radius: 7px;
background: rgba(188,140,255,.07); border: 1px solid rgba(188,140,255,.2);
font-size: .75rem; color: var(--text-dim);
}
.srcline b { color: var(--purple); font-weight: 600; }
.srcline .caveat { color: var(--text-muted); }
.score { text-align: right; padding-top: 2px; }
.score-num { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.row.rar .score-num { color: var(--accent); }
.row.sourced .score-num { color: var(--purple); }
.score-bar { height: 4px; border-radius: 2px; background: var(--surface2); overflow: hidden; margin: 5px 0 4px auto; width: 100%; }
.score-bar i { display: block; height: 100%; background: var(--text-dim); }
.row.rar .score-bar i { background: var(--accent); }
.row.sourced .score-bar i { background: var(--purple); }
.score-scale { font-size: .62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
/* ── states ───────────────────────────────────────────────────────────── */
.state { padding: 44px 20px; text-align: center; color: var(--text-muted); font-size: .9rem; }
.fail {
background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
padding: 26px 24px; margin-top: 4px;
}
.fail h2 { font-size: 1.05rem; color: var(--text); margin-bottom: 8px; font-weight: 650; }
.fail p { color: var(--text-dim); font-size: .88rem; margin-bottom: 14px; max-width: 72ch; }
.fail ol { margin: 0 0 14px 20px; color: var(--text-dim); font-size: .88rem; }
.fail li { margin-bottom: 9px; }
.fail code {
font-family: var(--mono); font-size: .8rem; background: var(--bg);
border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; color: var(--text);
display: inline-block; word-break: break-all;
}
.fail .tried {
margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
font-family: var(--mono); font-size: .72rem; color: var(--text-muted); line-height: 1.9;
word-break: break-all;
}
footer {
border-top: 1px solid var(--border); margin-top: 30px; padding-top: 20px;
font-size: .76rem; color: var(--text-muted); line-height: 1.7;
}
footer .src { font-family: var(--mono); font-size: .72rem; word-break: break-all; }
@media (max-width: 760px) {
header { padding: 12px 16px; }
.header-right { gap: 8px; }
.container { padding: 20px 14px 60px; }
.controls { position: static; }
.row { grid-template-columns: 30px 1fr; padding: 13px 8px; }
.rank { font-size: .9rem; }
.score { grid-column: 2; text-align: left; display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.score-bar { width: 70px; margin: 0; }
.comp { grid-template-columns: 1fr; gap: 2px; margin-bottom: 14px; }
.showing { margin-left: 0; }
}
</style>
<link rel="stylesheet" href="nav.css">
<script src="nav.js" defer></script>
</head>
<body>
<nav id="rar-nav" aria-label="Primary">
<a class="rar-brand" href="index.html"><span class="rar-brand-mark">R</span>RAPP Agent Repository</a>
<span class="rar-primary"><noscript><span class="rar-nav-fallback">
<a href="index.html">Browse</a><a href="distros.html">Distros</a><a href="skills.html">Skills</a><a href="install.html">Install</a><a href="front.html">Front page</a><a href="store.html">Advanced</a><a href="llms.txt">For AIs</a>
</span></noscript></span>
<details class="rar-more"><summary>More</summary><div class="rar-more-content">
<a href="discover.html">For Work</a>
<a href="metrics.html">Metrics</a>
</div></details>
</nav>
<header class="rar-page-header">
<div class="logo">
<div class="logo-mark">R</div>
<span>Front Page</span>
</div>
<div class="header-right">
<a class="adv-link" href="index.html">Browse</a>
<a class="adv-link" href="discover.html">For Work</a>
<a class="adv-link" href="metrics.html">Metrics</a>
<a class="adv-link" href="store.html">Advanced</a>
<span class="conn"><span class="dot" id="dot"></span><span id="conn-label">loading</span></span>
</div>
</header>
<div class="container">
<section class="masthead">
<h1>The front page of the agentic web</h1>
<p class="lede">
One ranked list over every agent this registry hosts and every third-party
skill it has crawled. The ranking is the point: each row carries the numbers
it was scored on, so you can disagree with the order for a stated reason.
</p>
<div class="counts" id="counts"></div>
</section>
<details class="explain" id="explain" style="display:none">
<summary>How this ranking works</summary>
<div class="explain-body" id="explain-body"></div>
</details>
<section class="controls" id="controls" style="display:none">
<div class="seg" id="seg-origin">
<button type="button" class="active" data-origin="all">Everything</button>
<button type="button" data-origin="native">RAR only</button>
<button type="button" data-origin="sourced">From a crawled source</button>
</div>
<div class="seg" id="seg-audience">
<button type="button" class="active" data-audience="all">Any audience</button>
<button type="button" data-audience="business">For work</button>
<button type="button" data-audience="consumer">Personal</button>
</div>
<div class="filter-box">
<span class="si"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 20 20"><circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" stroke-width="2" opacity="0.6"/><line x1="12" y1="12" x2="17" y2="17" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" opacity="0.5"/></svg></span>
<input type="text" id="q" placeholder="Filter by name, tag, description" autocomplete="off" spellcheck="false">
</div>
<span class="showing" id="showing"></span>
<div class="order-note" id="order-note"></div>
</section>
<ol class="feed" id="feed">
<li class="state" id="boot-state">Loading the ranked list…</li>
</ol>
<footer id="foot"></footer>
</div>
<script>
/* ────────────────────────────────────────────────────────────────────────
This page renders one file: api/v1/front.json. It computes no ranking of
its own — the order, the scores and the `why` strings are decided at build
time by scripts/build_front_page.py, so a reader here sees exactly what any
other consumer of the endpoint sees.
Relative first, so a fork, a mirror or a local checkout reads its own
ranking; raw.githubusercontent as the fallback, which is what makes a
file:// open work at all — a relative fetch from file:// is blocked by
every browser. If both fail the page says so and prints the commands that
fix it; it never leaves a spinner running over an empty shell.
──────────────────────────────────────────────────────────────────────── */
const RAW = 'https://raw.githubusercontent.com/kody-w/RAR/main';
const ENDPOINTS = ['api/v1/front.json', RAW + '/api/v1/front.json'];
let DATA = null;
let ITEMS = [];
let SOURCE_URL = '';
let MULTI_ORIGIN = false; // does this build hold more than one scoring population?
const state = { origin: 'all', audience: 'all', q: '', ref: '' };
const $ = id => document.getElementById(id);
const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g,
c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
const plural = (n, one, many) => n + ' ' + (n === 1 ? one : many);
function setConn(cls, label) {
$('dot').className = 'dot' + (cls ? ' ' + cls : '');
$('conn-label').textContent = label;
}
/* Provenance, not hosting, is what a reader needs to keep straight. An entry
the crawler found upstream keeps its credit even after the toaster
materialises it into a hosted agent here, so `source` — not `origin` — is
what decides whether a row is presented as somebody else's work. */
const isSourced = it => !!it.source;
const isHosted = it => it.origin !== 'aggregated';
/* ── hash routing ──────────────────────────────────────────────────────
Filters and the focused row live in the hash, so any view of this page is
a link somebody can paste. replaceState keeps typing in the filter box
from stacking one history entry per keystroke. */
function readHash() {
const h = location.hash.replace(/^#/, '');
if (!h) return;
for (const part of h.split('&')) {
const i = part.indexOf('=');
if (i < 0) continue;
const k = part.slice(0, i);
let v;
try { v = decodeURIComponent(part.slice(i + 1).replace(/\+/g, ' ')); }
catch (e) { v = part.slice(i + 1); }
// 'aggregated' was the earlier word for the same set; old links still work.
if (v === 'aggregated') v = 'sourced';
if (k === 'origin' && ['all', 'native', 'sourced'].includes(v)) state.origin = v;
else if (k === 'audience' && ['all', 'business', 'consumer'].includes(v)) state.audience = v;
else if (k === 'q') state.q = v;
else if (k === 'ref') state.ref = v;
}
}
function hashFor(overrides) {
const s = Object.assign({}, state, overrides || {});
const parts = [];
if (s.origin !== 'all') parts.push('origin=' + s.origin);
if (s.audience !== 'all') parts.push('audience=' + s.audience);
if (s.q) parts.push('q=' + encodeURIComponent(s.q));
if (s.ref) parts.push('ref=' + encodeURIComponent(s.ref));
return '#' + parts.join('&');
}
function writeHash() {
const h = hashFor();
if (h !== location.hash && !(h === '#' && !location.hash)) {
history.replaceState(null, '', location.pathname + location.search + h);
}
}
/* ── filtering ─────────────────────────────────────────────────────────── */
// An item with no audience verdict shows up under every audience, the rule
// index.html already uses: unclassified means unknown, not excluded.
function inAudience(it) {
if (state.audience === 'all') return true;
return !it.audience || it.audience === 'both' || it.audience === state.audience;
}
function haystack(it) {
if (it._hay === undefined) {
it._hay = [it.title, it.ref, it.description, it.category,
(it.tags || []).join(' '), it.source ? it.source.display_name : '']
.join(' ').toLowerCase();
}
return it._hay;
}
function visible() {
const terms = state.q.toLowerCase().split(/\s+/).filter(Boolean);
return ITEMS.filter(it => {
if (state.origin === 'native' && isSourced(it)) return false;
if (state.origin === 'sourced' && !isSourced(it)) return false;
if (!inAudience(it)) return false;
if (terms.length) {
const h = haystack(it);
if (!terms.every(t => h.includes(t))) return false;
}
return true;
});
}
/* ── rendering ─────────────────────────────────────────────────────────── */
const AUDIENCE_LABEL = { business: 'for work', consumer: 'personal', both: 'work or personal' };
function whyChip(text) {
// A component with no signal was filled with the population median. Marking
// those stops a median fill from reading as evidence somebody produced.
const est = /median/.test(text) || /^no /.test(text);
return '<span class="chip' + (est ? ' est' : '') + '">' + esc(text) + '</span>';
}
// RAR's own counters, labelled as RAR's.
function rarMeta(it) {
const r = (it.signals && it.signals.rar) || {};
const bits = [];
if (r.tier) bits.push('<span class="badge tier tier-' + esc(r.tier) + '">' + esc(r.tier) + '</span>');
if (it.category) bits.push(esc(it.category));
if (it.audience) bits.push(esc(AUDIENCE_LABEL[it.audience] || it.audience));
// Counts get RAR's name on them, because the row below may carry a second
// set of counts belonging to somebody else. Length is left to the why chips.
if (r.curator_n) bits.push('RAR reviews: ' + r.curator_n + (r.curator_mean ? ' at ' + r.curator_mean + '/5' : ''));
if (r.upvotes) bits.push('RAR upvotes: ' + r.upvotes);
if (r.comments) bits.push('RAR comments: ' + r.comments);
return bits;
}
// The source's counters, labelled as the source's. RAR's numbers and a
// source's numbers count different populations by different methods; they sit
// side by side here and are never added into one figure.
function sourceLine(it) {
const s = it.source || {};
const n = (it.signals && it.signals.source) || {};
const age = typeof n.published_age_days === 'number' ? n.published_age_days : n.age_days;
const facts = [];
if (typeof n.downloads === 'number') facts.push(plural(n.downloads, 'download', 'downloads'));
if (typeof n.rating === 'number' && n.rating) facts.push('rating ' + n.rating);
if (n.has_bundle) facts.push('ships a bundle');
if (n.featured) facts.push('featured there');
if (typeof age === 'number') facts.push('published ' + plural(age, 'day', 'days') + ' ago');
if (n.author) facts.push('by ' + n.author);
const name = esc(s.display_name || s.id || 'the source');
const home = s.home_url
? '<a href="' + esc(s.home_url) + '" target="_blank" rel="noopener">' + name + '</a>' : name;
return '<div class="srcline"><b>' + home + '</b> reports: ' +
(facts.length ? esc(facts.join(' · ')) : 'no counters published') + '. ' +
'<span class="caveat">Those are ' + name + ''s own numbers, not RAR's, and are never ' +
'added to RAR's' + (s.license ? '. Licence at the source: ' + esc(s.license) : '') + '.</span></div>';
}
function rowHtml(it) {
const sourced = isSourced(it);
const hosted = isHosted(it);
const srcName = sourced ? esc(it.source.display_name || it.source.id) : '';
// Three states, never confusable: RAR's own, RAR's copy of somebody's work,
// and an entry that only exists upstream.
let badges;
if (!sourced) badges = '<span class="badge rar">RAR agent</span>';
else if (hosted) badges = '<span class="badge rar">RAR agent</span>' +
'<span class="badge sourced">also at ' + srcName + '</span>';
else badges = '<span class="badge sourced">indexed at ' + srcName +
' · not hosted here</span>';
const meta = hosted
? rarMeta(it)
: [esc(it.category), it.audience ? esc(AUDIENCE_LABEL[it.audience] || it.audience) : ''].filter(Boolean);
const acts = [];
if (hosted && it.url) {
acts.push('<a class="act" href="' + esc(it.url) + '" target="_blank" rel="noopener">Open in RAR ↗</a>');
}
if (it.install) {
acts.push('<a class="act" href="' + esc(it.install) + '" target="_blank" rel="noopener">Agent file ↗</a>');
}
const away = sourced ? (it.source.url || it.source.home_url || (!hosted ? it.url : '')) : '';
if (away) {
acts.push('<a class="act" href="' + esc(away) + '" target="_blank" rel="noopener">Open at ' + srcName + ' ↗</a>');
}
acts.push('<button class="act" data-share="' + esc(it.ref) + '">Link to this</button>');
const pct = Math.max(2, Math.min(100, Number(it.score) || 0));
return '<li class="row ' + (sourced ? 'sourced' : 'rar') + (it.ref === state.ref ? ' pinned' : '') +
'" id="row-' + encodeURIComponent(it.ref) + '">' +
'<div class="rank"><span class="hash">#</span>' + it.rank + '</div>' +
'<div>' +
'<div class="title-line">' +
'<a class="title" href="' + esc(it.url || '#') + '" target="_blank" rel="noopener">' + esc(it.title) + '</a>' +
badges +
'<span class="ref">' + esc(it.ref) + '</span>' +
'</div>' +
'<div class="desc">' + esc(it.description) + '</div>' +
'<div class="why"><span class="why-label">why it ranks</span>' +
(it.why || []).map(whyChip).join('') +
'</div>' +
(sourced ? sourceLine(it) : '') +
'<div class="meta">' + meta.join('<span class="sep">·</span>') +
(meta.length && acts.length ? '<span class="sep">·</span>' : '') + acts.join('') +
'</div>' +
'</div>' +
'<div class="score">' +
'<div class="score-num">' + Number(it.score).toFixed(1) + '</div>' +
'<div class="score-bar"><i style="width:' + pct + '%"></i></div>' +
'<div class="score-scale">' + (MULTI_ORIGIN ? esc(it.origin) + ' scale' : 'score') + '</div>' +
'</div>' +
'</li>';
}
function render() {
const rows = visible();
const feed = $('feed');
if (!rows.length) {
feed.innerHTML = '<li class="state">Nothing matches that filter. ' +
'Clear the text filter, or switch back to Everything.</li>';
} else {
feed.innerHTML = rows.map(rowHtml).join('');
}
$('showing').innerHTML = 'showing <b>' + rows.length + '</b> of ' + ITEMS.length;
// The ordering rule is the engine's to state. Only the caveat about mixed
// scales is this page's, and it is only true while two populations are on
// screen at once — so it appears and disappears with them.
const note = $('order-note');
const parts = [];
if (DATA && DATA.ranking && DATA.ranking.order) parts.push(esc(DATA.ranking.order));
if (MULTI_ORIGIN && state.origin === 'all' && new Set(rows.map(r => r.origin)).size > 1) {
parts.push('Both populations are on screen: a score is comparable only within its own origin, ' +
'so filter to one to compare like with like.');
}
note.innerHTML = parts.join(' ');
note.style.display = parts.length ? '' : 'none';
}
function focusRow() {
if (!state.ref) return;
const el = document.getElementById('row-' + encodeURIComponent(state.ref));
if (el) el.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
/* ── the ranking explanation, rendered from the data ───────────────────
No weight is written into this page. If the engine changes a weight, adds
a component or adds a caveat, this section changes with it. */
const NOTE_ORDER = ['order', 'deduplication', 'median_fill', 'clock'];
function renderExplain(r) {
const parts = [];
if (r.explain) parts.push('<p>' + esc(r.explain) + '</p>');
for (const c of (r.components || [])) {
const pct = Math.round((c.weight || 0) * 100);
const cls = c.applies_to === 'aggregated' ? 'sourced' : c.applies_to === 'both' ? 'both' : '';
parts.push(
'<div class="comp">' +
'<div>' +
'<div class="comp-head"><span class="comp-key">' + esc(c.key) + '</span>' +
'<span class="comp-w">' + pct + '</span></div>' +
'<div class="comp-applies">' + esc(c.applies_to || '') + '</div>' +
'<div class="comp-bar ' + cls + '"><i style="width:' + pct + '%"></i></div>' +
'</div>' +
'<div class="comp-desc">' + esc(c.description || '') + '</div>' +
'</div>');
}
const notes = [];
if ((r.not_scored || []).length) {
notes.push('Deliberately not scored: ' + esc(r.not_scored.join(', ')) + '.');
}
// Every remaining prose field the engine ships gets printed, in a stable
// order, so a caveat added upstream shows up here without an edit.
Object.keys(r)
.filter(k => k !== 'explain' && typeof r[k] === 'string')
.sort((a, b) => ((NOTE_ORDER.indexOf(a) + 1) || 99) - ((NOTE_ORDER.indexOf(b) + 1) || 99))
.forEach(k => notes.push(esc(r[k])));
if (notes.length) {
parts.push('<div class="explain-note">' + notes.map(n => '<p>' + n + '</p>').join('') + '</div>');
}
$('explain-body').innerHTML = parts.join('');
$('explain').style.display = '';
}
/* Counts are printed as separate blocks, one per population, and never added
together — two counters that measure different things by different methods
do not make a third number. */
const COUNT_LABEL = {
native: 'agents hosted here',
aggregated: 'indexed upstream, not hosted here',
with_source_provenance: 'of them credited to a crawled source',
sources: 'crawled source',
ranked: 'rows on this page'
};
const COUNT_CLASS = { native: 'rar', aggregated: 'sourced', with_source_provenance: 'sourced' };
const COUNT_ORDER = ['native', 'aggregated', 'with_source_provenance', 'sources', 'ranked'];
function renderCounts(c) {
const keys = Object.keys(c)
.filter(k => typeof c[k] === 'number' && c[k] > 0)
.sort((a, b) => ((COUNT_ORDER.indexOf(a) + 1) || 99) - ((COUNT_ORDER.indexOf(b) + 1) || 99));
const blocks = keys.map(k => {
let label = COUNT_LABEL[k] || k.replace(/_/g, ' ');
if (k === 'sources') label = plural(c[k], 'crawled source', 'crawled sources').replace(/^\d+\s/, '');
return '<span class="count-block ' + (COUNT_CLASS[k] || '') + '"><b>' + c[k] + '</b> ' + esc(label) + '</span>';
});
blocks.push('<span class="count-note">Separate populations, kept separate — ' +
'their counters are never summed.</span>');
$('counts').innerHTML = blocks.join('');
}
/* ── fail-open ─────────────────────────────────────────────────────────
The honest failure is more useful than half a page: name what was tried,
and give the commands that actually fix it. */
function renderFailure(attempts) {
setConn('err', 'no data');
$('feed').innerHTML =
'<li class="fail">' +
'<h2>No ranking data loaded</h2>' +
'<p>This page renders one file, <code>api/v1/front.json</code>, and computes nothing ' +
'itself — so with that file out of reach there is no honest list to show you. ' +
'The ranking explanation ships inside it too, which is why this page will not invent ' +
'one. Any of these gets you the data:</p>' +
'<ol>' +
'<li>Serve the repository instead of opening the file directly — a browser blocks ' +
'a page on <code>file://</code> from reading files next to it:<br>' +
'<code>python3 -m http.server 8000</code> then open ' +
'<code>http://localhost:8000/front.html</code></li>' +
'<li>Build the endpoint, if this checkout has never produced one:<br>' +
'<code>python scripts/build_front_page.py</code></li>' +
'<li>Or read the published copy: ' +
'<a href="https://kody-w.github.io/RAR/front.html">kody-w.github.io/RAR/front.html</a> ' +
'— the raw endpoint is ' +
'<a href="' + RAW + '/api/v1/front.json">api/v1/front.json</a>.</li>' +
'</ol>' +
'<p>The rest of the registry does not depend on this page: ' +
'<a href="index.html">browse every agent</a>, or ' +
'<a href="discover.html">describe what you need</a>.</p>' +
'<div class="tried">tried:<br>' +
attempts.map(a => esc(a.url) + ' → ' + esc(a.error)).join('<br>') +
'</div>' +
'</li>';
$('foot').innerHTML = 'Front page of the RAPP Agent Registry. The ranking is produced by ' +
'<span class="src">scripts/build_front_page.py</span> and served as ' +
'<span class="src">api/v1/front.json</span>.';
}
/* ── events ────────────────────────────────────────────────────────────── */
$('seg-origin').addEventListener('click', e => {
const t = e.target.closest('[data-origin]');
if (!t) return;
state.origin = t.dataset.origin;
[...e.currentTarget.children].forEach(el => el.classList.toggle('active', el === t));
writeHash();
render();
});
$('seg-audience').addEventListener('click', e => {
const t = e.target.closest('[data-audience]');
if (!t) return;
state.audience = t.dataset.audience;
[...e.currentTarget.children].forEach(el => el.classList.toggle('active', el === t));
writeHash();
render();
});
let qTimer = null;
$('q').addEventListener('input', e => {
state.q = e.target.value.trim();
clearTimeout(qTimer);
qTimer = setTimeout(() => { writeHash(); render(); }, 110);
});
// One delegated listener rather than one per row.
$('feed').addEventListener('click', e => {
const btn = e.target.closest('[data-share]');
if (!btn) return;
state.ref = btn.dataset.share;
const hash = hashFor();
history.replaceState(null, '', location.pathname + location.search + hash);
document.querySelectorAll('.row.pinned').forEach(el => el.classList.remove('pinned'));
btn.closest('.row').classList.add('pinned');
// Clipboard is unavailable on file:// and needs a permission in some
// browsers; the shareable hash is in the address bar either way.
const done = ok => {
btn.classList.add('copied');
btn.textContent = ok ? 'Link copied' : 'Link in address bar';
setTimeout(() => { btn.classList.remove('copied'); btn.textContent = 'Link to this'; }, 1800);
};
try {
navigator.clipboard.writeText(location.origin + location.pathname + location.search + hash)
.then(() => done(true), () => done(false));
} catch (err) { done(false); }
});
window.addEventListener('hashchange', () => {
if (!DATA) return;
state.origin = 'all'; state.audience = 'all'; state.q = ''; state.ref = '';
readHash();
syncControls();
render();
focusRow();
});
function syncControls() {
document.querySelectorAll('#seg-origin [data-origin]').forEach(
el => el.classList.toggle('active', el.dataset.origin === state.origin));
document.querySelectorAll('#seg-audience [data-audience]').forEach(
el => el.classList.toggle('active', el.dataset.audience === state.audience));
$('q').value = state.q;
}
/* ── boot ──────────────────────────────────────────────────────────────── */
async function boot() {
const t0 = performance.now();
const attempts = [];
for (const url of ENDPOINTS) {
try {
const res = await fetch(url);
if (!res.ok) { attempts.push({ url, error: 'HTTP ' + res.status }); continue; }
const json = await res.json();
if (!json || json.schema !== 'rar-front-page/1.0' || !Array.isArray(json.items)) {
attempts.push({ url, error: 'not a rar-front-page/1.0 document' });
continue;
}
DATA = json;
SOURCE_URL = url;
break;
} catch (err) {
attempts.push({ url, error: (err && err.message) || 'fetch failed' });
}
}
if (!DATA) { renderFailure(attempts); return; }
ITEMS = DATA.items;
MULTI_ORIGIN = new Set(ITEMS.map(i => i.origin)).size > 1;
const ms = Math.round(performance.now() - t0);
setConn('live', ITEMS.length + ' ranked · ' + ms + ' ms');
renderCounts(DATA.counts || {});
if (DATA.ranking) renderExplain(DATA.ranking);
$('controls').style.display = '';
readHash();
syncControls();
render();
focusRow();
$('foot').innerHTML =
'Ranked ' + esc(DATA.generated || 'unknown') + ' by ' +
'<span class="src">scripts/build_front_page.py</span>, from this registry's own review, ' +
'discussion and crawl state. ' +
(DATA.policy ? esc(DATA.policy.charAt(0).toUpperCase() + DATA.policy.slice(1)) + '. ' : '') +
'<br>Read the same data yourself: <span class="src">' + esc(SOURCE_URL) + '</span>';
}
boot();
</script>
</body>
</html>