heartcode 0.1.59 → 0.1.62

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/src/settings.html CHANGED
@@ -94,6 +94,8 @@
94
94
  .theme-btn:hover { color: var(--text); }
95
95
  .theme-btn svg { width: 18px; height: 18px; }
96
96
  main { padding: 36px 44px 72px; width: 100%; max-width: 1640px; min-width: 0; }
97
+ @media (max-width: 1500px) { main { padding-left: 24px; padding-right: 24px; } } /* a laptop: the models table fits without scrolling sideways */
98
+ @media (min-width: 861px) and (max-width: 1400px) { .app { grid-template-columns: 208px minmax(0, 1fr); } main { padding-left: 16px; padding-right: 16px; } } /* a small laptop (1280): a narrower sidebar too */
97
99
  .page { display: none; }
98
100
  .page.on { display: block; animation: page-in .22s ease-out; }
99
101
  @keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@@ -308,6 +310,7 @@
308
310
  .prov-h .by-name button, .prov-h > button.small { height: 28px; }
309
311
  dialog#gone { width: min(560px, 92vw); }
310
312
  dialog#h-test { width: min(560px, 92vw); }
313
+ dialog#small-screen { width: min(420px, calc(100vw - 32px)); }
311
314
  dialog#gone h2 { color: var(--err); font-family: inherit; font-size: 18px; }
312
315
  dialog#gone::backdrop { background: rgba(0, 0, 0, .75); }
313
316
  .hello-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@@ -428,7 +431,7 @@
428
431
  .mt-more-pill button:hover:not(:disabled) { background: var(--hover); }
429
432
  .mt-more-pill button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
430
433
  .mt-more-pill button:disabled { color: var(--faint); cursor: default; }
431
- .mt, .mt-h.mt-hpick { min-width: 1766px; } /* the columns below, their gaps and padding: the header, the selection bar and the rows line up (the rows are drawn a screenful at a time, so this can't come from them) */
434
+ .mt, .mt-h.mt-hpick { min-width: 1024px; } /* the columns below, their gaps and padding: the header, the selection bar and the rows line up (the rows are drawn a screenful at a time, so this can't come from them) */
432
435
  .mt-h input[type=checkbox], .mtable input[type=checkbox] { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); cursor: pointer; }
433
436
  .mtable li.picked { background: var(--brand-soft); }
434
437
  .mt-rules { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
@@ -450,8 +453,9 @@
450
453
  .pill .again:hover:not(:disabled) { color: var(--text); }
451
454
  .pill.on { border-color: var(--accent); background: var(--accent-soft); }
452
455
  .pill.on .again { border-left-color: color-mix(in srgb, var(--accent) 40%, transparent); }
453
- .mt-h, .mtable li { display: grid; grid-template-columns: 14px 18px 40px minmax(200px, 1fr) 104px 450px 62px 46px 66px 56px 76px 76px 76px 112px 86px 124px; /* the last: Test · Request · Edit · ✕, as wide as they are */ align-items: center; column-gap: 6px; padding: 8px 18px; }
456
+ .mt-h, .mtable li { display: grid; grid-template-columns: 14px 16px 28px minmax(120px, 1fr) 80px 148px 52px 26px 26px 26px 44px 44px 44px 94px 74px 104px; /* the last: Test · Request · Edit · ✕, as wide as they are */ align-items: center; column-gap: 4px; padding: 8px 12px; }
454
457
  .mt-h button.mid, .mtable .mid { text-align: center; }
458
+ @media (min-width: 861px) and (max-width: 1400px) { .mt-h, .mtable li { padding-left: 6px; padding-right: 6px; } .mt, .mt-h.mt-hpick { min-width: 1012px; } } /* a small laptop (1280): narrower rows */
455
459
  .mt-h > :nth-child(15), .mtable .try { padding-left: 12px; } /* Works?: a little room after the right-aligned price */
456
460
  .mtable li .acts { justify-content: flex-start; }
457
461
  .mt-h { border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--faint); padding-top: 10px; padding-bottom: 10px; background: var(--panel2); }
@@ -480,14 +484,13 @@
480
484
  .hp .sw { display: inline-block; width: 30px; height: 18px; margin: 0 4px 0 0; }
481
485
  .hp .sw i::after { width: 12px; height: 12px; }
482
486
  .hp .sw input:checked + i::after { transform: translateX(12px); }
483
- .mtable li .hp .jp { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; font-size: 11.5px; font-weight: 400; color: var(--faint); white-space: nowrap; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .1s; }
487
+ .mtable li .hp .jp { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px; padding: 0; border-radius: 7px; border: 1px solid var(--line-strong); background: transparent; color: var(--faint); cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .1s; }
488
+ .mtable li .hp .jp .icon { width: 14px; height: 14px; }
484
489
  .mtable li .hp .jp:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
485
490
  .mtable li .hp .jp:active:not(:disabled) { transform: scale(.95); }
486
491
  .mtable li .hp .jp:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
487
- .mtable li .hp .jp.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text); font-weight: 500; }
488
- .mtable li .hp .jp.on::before { content: '✓'; color: var(--accent); font-weight: 700; }
492
+ .mtable li .hp .jp.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
489
493
  .mtable li .hp .jp.sug { border-style: dashed; border-color: var(--accent); color: var(--accent); }
490
- .mtable li .hp .jp.sug::before { content: '+'; font-weight: 700; }
491
494
  .mtable li .hp.off .jp:not(.sug) { opacity: .6; }
492
495
  /* the helper suggestions, waiting for a yes: beside the list's buttons */
493
496
  .hsug { display: inline-flex; align-items: center; gap: 6px; padding: 2px 3px 2px 10px; border: 1px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); color: var(--text); white-space: nowrap; }
@@ -511,6 +514,7 @@
511
514
  .mtable .try.going .msg { animation: pulse 1.4s ease-in-out infinite; }
512
515
  @media (prefers-reduced-motion: reduce) { .mtable .try.going .msg { animation: none; } }
513
516
  .mtable .rk { color: var(--muted); }
517
+ .mt-h .icon { width: 15px; height: 15px; vertical-align: -3px; } /* a column named by its icon (its name on hover) */
514
518
  .mtable .rk b { color: var(--text); font-weight: 600; margin-right: 5px; }
515
519
  .mtable .rk.top b { color: inherit; }
516
520
  .mtable .rk.top { color: var(--ok); font-weight: 600; }
@@ -566,16 +570,23 @@
566
570
  .mt-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
567
571
  .h-order { display: inline-flex; align-items: center; gap: 8px; margin-right: 4px; }
568
572
  .h-order .mt-setl { white-space: nowrap; }
573
+ .h-order select { height: 30px; padding-top: 0; padding-bottom: 0; font-size: 12.5px; width: auto; } /* as tall as the buttons beside it */
569
574
  .mt-actions .seg { height: 32px; }
570
575
  .mt-actions .seg label { padding: 0 11px; font-size: 12.5px; }
571
576
  .mt-sets { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 12px 18px 4px; } /* with the filters below: one toolbar, 8px between its two lines */
572
- .mt-mode-sets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
577
+ .mt-mode-sets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
573
578
  .mt-set { display: flex; align-items: center; gap: 8px; min-width: 0; }
574
- .mt-setl { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
575
- .mt-setc { display: flex; align-items: center; gap: 8px; }
579
+ .mt-setl { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
580
+ .mt-setl .icon { width: 14px; height: 14px; color: var(--faint); }
581
+ .mt-div { width: 1px; height: 22px; background: var(--line-strong); margin: 0 4px; } /* between the fail-over settings and the helpers' */
582
+ .mt-mode-sets .h-order select { height: 34px; }
583
+ .mt-mode-sets .seg { height: 34px; }
584
+ .mt-mode-sets .seg label { padding: 0 11px; font-size: 12.5px; }
585
+ @media (min-width: 861px) and (max-width: 1400px) { .mt-mode-sets { column-gap: 6px; } .mt-mode-sets .seg label { padding: 0 7px; font-size: 12px; } .mt-div { margin: 0; } .mt-setc input[type=number], .mt-setc input.tries { width: calc(4ch + 18px); padding-inline: 6px; } } /* a small laptop (1280): the settings stay on one line */
586
+ .mt-setc { display: flex; align-items: center; gap: 6px; }
576
587
  .mt-setc select { width: auto; min-width: 0; height: 34px; padding-top: 0; padding-bottom: 0; line-height: 32px; }
577
- .mt-setc input[type=number] { width: 56px; height: 34px; }
578
- .mt-setc input.tries { width: 56px; }
588
+ .mt-setc input[type=number] { width: 50px; height: 34px; }
589
+ .mt-setc input.tries { width: calc(4ch + 24px); } /* up to 4 digits (Stalled goes to 1800) */
579
590
  .mt-setc input[type=number] { appearance: textfield; -moz-appearance: textfield; text-align: center; } /* typed: no spinner taking the digits' room */
580
591
  .mt-setc input[type=number]::-webkit-inner-spin-button, .mt-setc input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
581
592
  .mt-setc .unit { color: var(--muted); font-size: 13px; }
@@ -585,7 +596,7 @@
585
596
  .mt-row .f-search { flex: 1 1 140px; min-width: 130px; }
586
597
  .mt-line { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; font-size: 13px; color: var(--muted); }
587
598
  .mt-line .count { white-space: nowrap; }
588
- .mt-sets[inert], .mt-row[inert], .mt-hwrap[inert], .mt-actions[inert] { opacity: .5; transition: opacity .15s; }
599
+ .mt-sets[inert], .mt-row[inert], .mt-hwrap[inert], .mt-actions[inert], .mt-actions > [inert] { opacity: .5; transition: opacity .15s; }
589
600
  .mt-line .count b { color: var(--text); }
590
601
  .mt-hpick .mt-pickbar { grid-column: 3 / -1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
591
602
  .mt-hpick { background: var(--brand-soft); }
@@ -621,6 +632,9 @@
621
632
  .mtable li .acts button.danger:hover:not(:disabled) { color: var(--err); }
622
633
  .f-tog { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13px; cursor: pointer; user-select: none; }
623
634
  .f-tog:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 60%, var(--panel)); }
635
+ .f-tog .icon { width: 14px; height: 14px; color: var(--faint); }
636
+ .f-tog:has(input:checked) .icon { color: var(--accent); }
637
+ @media (max-width: 1860px) { .mt-setl .lt, .f-tog .lt, .hbar button .lt { display: none; } .f-tog { padding: 0 9px; } .hbar button.ghost { border-color: var(--line-strong); } } /* a laptop: the controls' icons only (each says what it is on hover): three rows still */
624
638
  .f-tog input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; pointer-events: none; } /* the pill is the switch; the box stays for the keyboard */
625
639
  .f-tog:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
626
640
  .f-tog { position: relative; color: var(--muted); }
@@ -662,6 +676,9 @@
662
676
  /* every other tooltip (titles): at once, the page's own look */
663
677
  #hint { position: fixed; z-index: 31; max-width: 340px; padding: 7px 10px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 12px; line-height: 1.45; box-shadow: var(--shadow-pop); pointer-events: none; opacity: 0; transition: opacity .06s; white-space: pre-line; }
664
678
  #hint.show { opacity: 1; }
679
+ /* a time limit moved to fit another one just set: flashes a moment */
680
+ .mt-sets input.moved { animation: moved 2.4s ease-out; }
681
+ @keyframes moved { 0%, 40% { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); } 100% { box-shadow: none; } }
665
682
  .with-q { display: inline-flex; align-items: center; gap: 5px; }
666
683
  .q { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; cursor: help; }
667
684
  .q:hover, .q:focus-visible { color: var(--text); border-color: var(--muted); outline: none; }
@@ -674,7 +691,7 @@
674
691
  #tip .tjob { font-weight: 650; font-size: 13.5px; }
675
692
  #tip .tcover { color: var(--muted); margin-top: 6px; line-height: 1.5; }
676
693
  #tip .thint { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--accent); font-weight: 600; }
677
- #toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 8px); padding: 10px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 500; box-shadow: var(--shadow-pop); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100% - 32px); z-index: 10; }
694
+ #toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 8px); padding: 10px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 500; box-shadow: var(--shadow-pop); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: min(560px, calc(100% - 32px)); z-index: 10; white-space: pre-line; }
678
695
  #toast.show { opacity: 1; transform: translate(-50%, 0); }
679
696
  #toast.err { background: var(--err); color: #fff; }
680
697
  /* what's running (tests, loading): a strip at the top of the panel it's about, updated in place */
@@ -714,7 +731,7 @@
714
731
  nav a.on::before { display: none; } /* a strip of tabs: the highlighted one is enough */
715
732
  nav a .count, .using, .nav-group { display: none; }
716
733
  .theme-btn { top: 10px; right: 12px; }
717
- .mt-line { width: 100%; }
734
+ .mt-line { width: 100%; flex-wrap: wrap; } /* its buttons go to a second line, not past the screen's edge */
718
735
  .mt-line button.primary { margin-left: auto; }
719
736
  main { padding: 20px 16px 60px; }
720
737
  .steps { grid-template-columns: 1fr; }
@@ -860,7 +877,7 @@
860
877
  <!-- Providers & models -->
861
878
  <section class="page" id="page-providers">
862
879
  <div class="head">
863
- <div><h1>Providers</h1><p class="lead">Click a model to add it to your list, or tick several. HeartCode tries your list in order: #1 first, the next when one fails.</p></div>
880
+ <div><h1>Providers</h1><p class="lead">Click a model to add it to the list, or tick several. HeartCode tries the list in order: #1 first, the next when one fails.</p></div>
864
881
  <div class="head-actions"><button id="p-mine" type="button"></button><button class="primary" id="p-open">+ Add a provider</button></div>
865
882
  </div>
866
883
  <div class="steps" id="steps"></div>
@@ -883,18 +900,18 @@
883
900
 
884
901
  <!-- Your models: all at once, sortable -->
885
902
  <section class="page" id="page-models">
886
- <div class="head"><div><h1>Your models</h1><p class="lead" id="mt-lead"></p></div><div class="mt-actions" id="mt-actions"></div></div>
903
+ <div class="head"><div><h1>Models</h1><p class="lead" id="mt-lead"></p></div><div class="mt-actions" id="mt-actions"></div></div>
887
904
  <div class="card mt-card" id="mt"></div>
888
905
  </section>
889
906
 
890
907
  <!-- Notifications -->
891
908
  <section class="page" id="page-notify">
892
- <div class="head"><div><h1>Notifications</h1><p class="lead">A message on your phone when HeartCode finishes a task, fails, or needs you, so you can step away while it works.</p></div></div>
909
+ <div class="head"><div><h1>Notifications</h1><p class="lead">A phone message when HeartCode finishes a task, fails, or needs an answer: no need to watch it work.</p></div></div>
893
910
  <div class="cols">
894
911
  <div class="stack">
895
912
  <div class="card">
896
913
  <h2>Telegram</h2>
897
- <p class="sub">Through a bot of your own: only you get its messages.</p>
914
+ <p class="sub">Through a private bot: only its owner gets its messages.</p>
898
915
  <div id="tg-setup"></div>
899
916
  </div>
900
917
  </div>
@@ -910,10 +927,10 @@
910
927
 
911
928
  <!-- Logging -->
912
929
  <section class="page" id="page-logging">
913
- <div class="head"><div><h1>Logs</h1><p class="lead">What HeartCode writes down, for finding out what went wrong. Off unless you switch it on.</p></div><div class="disk" id="l-disk"></div></div>
930
+ <div class="head"><div><h1>Logs</h1><p class="lead">What HeartCode writes down, for finding out what went wrong. Off until switched on.</p></div><div class="disk" id="l-disk"></div></div>
914
931
  <div class="card">
915
932
  <div class="kinds-top">
916
- <div><h2 style="margin:0">What to log</h2><p class="sub" style="margin:4px 0 0">Each kind on its own, all off unless you switch one on. A running HeartCode takes a change in at once. Written to <span class="mono" id="l-where"></span>, a folder per run.</p></div>
933
+ <div><h2 style="margin:0">What to log</h2><p class="sub" style="margin:4px 0 0">Each kind on its own, all off until switched on. A running HeartCode takes a change in at once. Written to <span class="mono" id="l-where"></span>, a folder per run.</p></div>
917
934
  <button class="small" id="l-alloff">All off</button>
918
935
  </div>
919
936
  <div class="kinds" id="l-kinds"></div>
@@ -921,7 +938,7 @@
921
938
  <label for="l-days"><b>Keep logs for</b></label>
922
939
  <input type="number" id="l-days" min="1" max="3650" step="1" value="3">
923
940
  <span>days</span>
924
- <span class="muted">Older ones (every kind) are deleted when HeartCode starts, and right away when you change this. API keys are never written.</span>
941
+ <span class="muted">Older ones (every kind) are deleted when HeartCode starts, and right away when this changes. API keys are never written.</span>
925
942
  </div>
926
943
  </div>
927
944
  <div class="card reqs-card">
@@ -943,16 +960,16 @@
943
960
 
944
961
  <!-- General: one column, a card per topic, every setting saved as it changes -->
945
962
  <section class="page" id="page-general">
946
- <div class="head"><div><h1>General</h1><p class="lead">How HeartCode works for you. Every change saves on its own, and a running HeartCode picks it up right away.</p></div></div>
963
+ <div class="head"><div><h1>General</h1><p class="lead">How HeartCode works. Every change saves on its own, and a running HeartCode picks it up right away.</p></div></div>
947
964
  <div class="settings-col">
948
965
  <div class="card">
949
966
  <h2>Permissions</h2>
950
- <p class="sub">What HeartCode may do without asking you first. <span class="mono">Shift+Tab</span> in HeartCode switches between these too.</p>
967
+ <p class="sub">What HeartCode may do without asking first. <span class="mono">Shift+Tab</span> in HeartCode switches between these too.</p>
951
968
  <div class="choices three" id="g-perm"></div>
952
969
  </div>
953
970
  <div class="card">
954
971
  <h2>Terminal colors</h2>
955
- <p class="sub">Your own colors on top of one: theme.json in <a href="#files">Advanced → Files</a>.</p>
972
+ <p class="sub">Custom colors on top of one: theme.json in <a href="#files">Advanced → Files</a>.</p>
956
973
  <div class="choices four" id="g-theme"></div>
957
974
  </div>
958
975
  <div class="card">
@@ -972,7 +989,7 @@
972
989
  </div>
973
990
  <div class="card">
974
991
  <h2>Voice input</h2>
975
- <p class="sub">Press Space in an empty input box (or type /voice) and talk: your words show in the box as you speak, and Enter sends them. Esc cancels.</p>
992
+ <p class="sub">Press Space in an empty input box (or type /voice) and talk: the words show in the box while speaking, and Enter sends them. Esc cancels.</p>
976
993
  <div class="setting">
977
994
  <label class="t" for="v-src"><b>Transcribe with</b><span id="v-src-about"></span></label>
978
995
  <select id="v-src"></select>
@@ -988,7 +1005,7 @@
988
1005
  </div>
989
1006
  <div class="card">
990
1007
  <h2>External tools</h2>
991
- <p class="sub">Some features need a tool on your machine. Ready ones are ticked; the rest say what to install.</p>
1008
+ <p class="sub">Some features need a tool on this machine. Ready ones are ticked; the rest say what to install.</p>
992
1009
  <div id="g-caps"></div>
993
1010
  </div>
994
1011
  <div class="card wide">
@@ -1033,7 +1050,7 @@
1033
1050
  <div class="k-install r-bar">
1034
1051
  <div class="seg" id="r-kinds" role="radiogroup" aria-label="Kind of prompt"></div>
1035
1052
  <input type="search" id="r-search" placeholder="Search all prompts" aria-label="Search all prompts">
1036
- <label class="f-tog" title="Only the prompts you changed"><input type="checkbox" id="r-mine">Changed by you</label>
1053
+ <label class="f-tog" title="Only the changed prompts"><input type="checkbox" id="r-mine">Changed</label>
1037
1054
  </div>
1038
1055
  <div class="md">
1039
1056
  <div class="list"><div class="items" id="r-items"></div></div>
@@ -1043,7 +1060,7 @@
1043
1060
 
1044
1061
  <!-- MCP servers -->
1045
1062
  <section class="page" id="page-mcp">
1046
- <div class="head"><div><h1>MCP servers</h1><p class="lead">Programs that give the model more tools: a browser, a database, your issue tracker. Off: HeartCode doesn't start it or offer it to the model.</p></div><button class="primary" id="c-open">+ Add a server</button></div>
1063
+ <div class="head"><div><h1>MCP servers</h1><p class="lead">Programs that give the model more tools: a browser, a database, an issue tracker. Off: HeartCode doesn't start it or offer it to the model.</p></div><button class="primary" id="c-open">+ Add a server</button></div>
1047
1064
  <div class="stack">
1048
1065
  <div class="card" id="c-list"></div>
1049
1066
  <details class="card" id="c-raw"><summary style="cursor:pointer;font-weight:600">Edit mcp.json directly</summary><p class="sub" style="margin-top:10px">For what the form doesn't have: environment variables (<span class="mono">"env"</span>), headers, and so on.</p><div id="c-file"></div></details>
@@ -1052,7 +1069,7 @@
1052
1069
 
1053
1070
  <!-- Skills -->
1054
1071
  <section class="page" id="page-skills">
1055
- <div class="head"><div><h1>Skills</h1><p class="lead">Ready-made prompts. You type one as <span class="mono">/skill:name</span>, or the model uses it when it fits.</p></div><div class="head-actions"><button id="k-import">Import from other tools</button><button class="primary" id="k-new">+ New skill</button></div></div>
1072
+ <div class="head"><div><h1>Skills</h1><p class="lead">Ready-made prompts, typed as <span class="mono">/skill:name</span>, or used by the model when it fits.</p></div><div class="head-actions"><button id="k-import">Import from other tools</button><button class="primary" id="k-new">+ New skill</button></div></div>
1056
1073
  <div class="k-install" id="k-install-card" title="A GitHub repo (owner/repo or its link) or a link to a SKILL.md. Same as /install_skill in HeartCode; installed for every project.">
1057
1074
  <span class="k-install-l">Install a skill</span>
1058
1075
  <input type="text" id="k-url" placeholder="owner/repo, a GitHub link, or a SKILL.md link" spellcheck="false" aria-label="GitHub repo or SKILL.md link">
@@ -1083,7 +1100,7 @@
1083
1100
  <div class="hint">Empty: as found (models.dev, the server, or what HeartCode learns). Measure asks the server.</div>
1084
1101
  <label class="opt"><div class="t"><b>Tool calls</b><span>Reads, edits and runs things itself. Off: HeartCode guides it step by step.</span></div><span class="sw"><input type="checkbox" id="ms-tools"><i></i></span></label>
1085
1102
  <label class="opt"><div class="t"><b>Thinking</b><span>Thinks before it answers (the effort setting applies).</span></div><span class="sw"><input type="checkbox" id="ms-thinking"><i></i></span></label>
1086
- <label class="opt"><div class="t"><b>Images</b><span>Reads screenshots and pictures you send.</span></div><span class="sw"><input type="checkbox" id="ms-images"><i></i></span></label>
1103
+ <label class="opt"><div class="t"><b>Images</b><span>Reads screenshots and pictures.</span></div><span class="sw"><input type="checkbox" id="ms-images"><i></i></span></label>
1087
1104
  <label class="opt"><div class="t"><b>Streaming</b><span>Its reply shows as it's written. Off: all at once at the end.</span></div><span class="sw"><input type="checkbox" id="ms-stream"><i></i></span></label>
1088
1105
  <div class="actions"><button id="ms-cancel" type="button">Cancel</button><button class="primary" id="ms-save" type="button">Save</button></div>
1089
1106
  </form>
@@ -1100,7 +1117,7 @@
1100
1117
  <input type="password" id="p-key" autocomplete="off" placeholder="paste it here (none for a server on this machine, like Ollama)">
1101
1118
  <div class="hint">Kept in config.json on this machine. This page only shows its first and last characters.</div>
1102
1119
  <div id="p-more" hidden>
1103
- <label class="opt" style="margin-top:16px"><div class="t"><b>Load its model list</b><span>On: its models are asked from the provider. Off: never asked; only the models you add by name show (the box next to its name).</span></div><span class="sw"><input type="checkbox" id="p-list-on"><i></i></span></label>
1120
+ <label class="opt" style="margin-top:16px"><div class="t"><b>Load its model list</b><span>On: its models are asked from the provider. Off: never asked; only the models added by name show (the box next to its name).</span></div><span class="sw"><input type="checkbox" id="p-list-on"><i></i></span></label>
1104
1121
  <div class="actions" id="p-added"></div>
1105
1122
  </div>
1106
1123
  <div class="actions"><button class="danger" id="p-delete" hidden>Delete provider</button><span class="spacer"></span><button id="p-cancel">Cancel</button><button class="primary" id="p-save">Add provider</button></div>
@@ -1124,11 +1141,16 @@
1124
1141
  <div class="actions"><span class="spacer"></span><button id="imp-cancel" type="button">Cancel</button><button class="primary" id="imp-go" type="button">Import selected</button></div>
1125
1142
  </dialog>
1126
1143
  <dialog id="h-test" aria-labelledby="h-test-title">
1127
- <h2 id="h-test-title">Test your models first</h2>
1128
- <p class="sub">Helpers are picked from the models that answer a short test. None of yours has answered one yet.</p>
1144
+ <h2 id="h-test-title">Test the models first</h2>
1145
+ <p class="sub">Helpers are picked from the models that answer a short test. None has answered one yet.</p>
1129
1146
  <p class="sub" id="h-test-cost"></p>
1130
1147
  <div class="actions"><span class="spacer"></span><button id="h-test-no" type="button" class="ghost">Cancel</button><button id="h-test-go" type="button" class="primary">Test all, then pick</button></div>
1131
1148
  </dialog>
1149
+ <dialog id="small-screen" aria-labelledby="small-screen-title">
1150
+ <h2 id="small-screen-title">Works best on a desktop</h2>
1151
+ <p class="sub">This page has wide tables (models, their abilities and tests). On a phone they need a lot of sideways scrolling. Everything still works here.</p>
1152
+ <div class="actions"><span class="spacer"></span><button id="small-screen-ok" type="button" class="primary">Got it</button></div>
1153
+ </dialog>
1132
1154
  <dialog id="gone" aria-labelledby="gone-title">
1133
1155
  <h2 id="gone-title">Disconnected</h2>
1134
1156
  <p class="sub">HeartCode's settings page was turned off, so nothing here can be changed or saved now.</p>
@@ -1153,7 +1175,7 @@
1153
1175
  <dialog id="pr" aria-labelledby="pr-title">
1154
1176
  <form>
1155
1177
  <h2 id="pr-title">Order providers</h2>
1156
- <p class="sub">Drag the providers into order, best first. Your models are then sorted by it.</p>
1178
+ <p class="sub">Drag the providers into order, best first. Models are then sorted by it.</p>
1157
1179
  <ol id="pr-list"></ol>
1158
1180
  <div class="actions"><button id="pr-cancel" type="button">Cancel</button><button class="primary" id="pr-save" type="button">Save</button></div>
1159
1181
  </form>
@@ -1236,6 +1258,15 @@ const ICON = {
1236
1258
  terminal: 'M4 17l6-5-6-5M12 19h8',
1237
1259
  upload: 'M12 21V9M7 14l5-5 5 5M5 3h14',
1238
1260
  arrow: 'M5 12h14M13 6l6 6-6 6',
1261
+ code: 'M16 18l6-6-6-6M8 6l-6 6 6 6',
1262
+ monitor: 'M3 4h18v12H3zM8 20h8M12 16v4',
1263
+ tag: 'M20.6 13.4l-7.2 7.2a2 2 0 0 1-2.8 0L2 12V2h10l8.6 8.6a2 2 0 0 1 0 2.8zM7 7h.01',
1264
+ pause: 'M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM10 9v6M14 9v6',
1265
+ hourglass: 'M6 2h12M6 22h12M7 2c0 5 10 6 10 10S7 17 7 22M17 2c0 5-10 6-10 10s10 5 10 10',
1266
+ zap: 'M13 2L3 14h9l-1 8 10-12h-9z',
1267
+ mountain: 'M3 20L9.5 9l4 6.5 2.5-4 5 8.5z',
1268
+ image: 'M3 5h18v14H3zM8.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM21 15l-5-5L5 19',
1269
+ bulb: 'M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7V16h8v-1.3A7 7 0 0 0 12 2z',
1239
1270
  }
1240
1271
  const ic = (name, cls = '') => {
1241
1272
  const el = document.createElement('span')
@@ -1257,7 +1288,7 @@ const BUTTON_ICONS = [
1257
1288
  [/^test|^send a test/i, 'play', 'k-test'], [/^request|^show the raw/i, 'eye', 'k-info'], [/^edit|^set up/i, 'pencil', 'k-edit'],
1258
1289
  [/^remove|^delete|^disconnect/i, 'trash', 'k-del'], [/^stop/i, 'stop', 'k-del'], [/^refresh|^retry|^get from models|^look it up|^reset/i, 'refresh', 'k-refresh'],
1259
1290
  [/^provider ranking/i, 'bars', 'k-info'], [/^clear|^select none/i, 'x', 'k-info'], [/^invert/i, 'swap', 'k-info'], [/^connect|^sign in/i, 'link', 'k-test'],
1260
- [/^your models/i, 'list', 'k-info'], [/^collapse|^expand/i, 'list', 'k-info'], [/^turn off/i, 'x', 'k-del'],
1291
+ [/^models \(/i, 'list', 'k-info'], [/^order providers/i, 'bars', 'k-info'], [/^update model info/i, 'refresh', 'k-refresh'], [/^collapse|^expand/i, 'list', 'k-info'], [/^turn off/i, 'x', 'k-del'],
1261
1292
  ]
1262
1293
  // card titles: their icon and color
1263
1294
  const TITLE_ICONS = [
@@ -1291,6 +1322,16 @@ new MutationObserver(() => {
1291
1322
  queueMicrotask(() => ((decorating = false), decorate()))
1292
1323
  }).observe(document.documentElement, { childList: true, subtree: true, characterData: true })
1293
1324
  // the sidebar's parts and the pages' titles: their tiles
1325
+ // a phone (or a narrow window): said once that the page is made for a desktop; dismissed, not again in this browser
1326
+ addEventListener('DOMContentLoaded', () => {
1327
+ let seen = false
1328
+ try { seen = localStorage.getItem('heart-small-screen-ok') === '1' } catch {}
1329
+ if (seen || !matchMedia('(max-width: 860px)').matches) return
1330
+ const d = $('small-screen')
1331
+ $('small-screen-ok').onclick = () => d.close()
1332
+ d.addEventListener('close', () => { try { localStorage.setItem('heart-small-screen-ok', '1') } catch {} })
1333
+ d.showModal()
1334
+ })
1294
1335
  addEventListener('DOMContentLoaded', () => {
1295
1336
  for (const a of document.querySelectorAll('nav a[data-page]')) {
1296
1337
  const [name, tone] = PART[a.dataset.page] ?? ['list', 'slate']
@@ -1306,12 +1347,12 @@ addEventListener('DOMContentLoaded', () => {
1306
1347
  const put = (el, ...kids) => el.replaceChildren(...kids.flat(Infinity).filter((x) => x != null && x !== false))
1307
1348
  let S = null
1308
1349
  let toastTimer
1309
- function toast(text, err = false) {
1350
+ function toast(text, err = false, ms = err ? 6000 : 2400) {
1310
1351
  const t = $('toast')
1311
1352
  t.textContent = text
1312
1353
  t.className = 'show' + (err ? ' err' : '')
1313
1354
  clearTimeout(toastTimer)
1314
- toastTimer = setTimeout(() => (t.className = ''), err ? 6000 : 2400)
1355
+ toastTimer = setTimeout(() => (t.className = ''), ms)
1315
1356
  }
1316
1357
  // What's running (a test, lists loading, models.dev), shown at the top of the panels it's about
1317
1358
  // while it runs: job(id, { what, where, done, total, detail, stop }) to show or update it (no total:
@@ -1383,11 +1424,11 @@ const DOING = {
1383
1424
  '/api/provider/delete': 'Deleting the provider',
1384
1425
  '/api/provider/list': 'Saving the model list setting',
1385
1426
  '/api/provider/on': 'Switching the provider',
1386
- '/api/order': 'Saving your models',
1387
- '/api/mcp/login': 'Signing in — your browser will open',
1427
+ '/api/order': 'Saving the models',
1428
+ '/api/mcp/login': 'Signing in — a browser window will open',
1388
1429
  '/api/telegram/connect': 'Checking the token with Telegram',
1389
1430
  '/api/telegram/test': 'Sending a test message',
1390
- '/api/search/test': 'Trying a search on your SearXNG',
1431
+ '/api/search/test': 'Trying a search on SearXNG',
1391
1432
  '/api/rankings': null, // with models.dev, in its strip
1392
1433
  '/api/models-dev': null, // its own strip
1393
1434
  }
@@ -1463,7 +1504,7 @@ function showPage() {
1463
1504
  addEventListener('hashchange', showPage)
1464
1505
  // A sidebar item with several pages (data-tabs): a tab bar on top of each of them. Each page keeps
1465
1506
  // its own address (#providers, #statusbar, #files…), so links to one still open it.
1466
- const TAB_NAMES = { models: 'Your list', providers: 'Providers', general: 'Settings', statusbar: 'Status bar', logging: 'Logs', files: 'Files' }
1507
+ const TAB_NAMES = { models: 'List', providers: 'Providers', general: 'Settings', statusbar: 'Status bar', logging: 'Logs', files: 'Files' }
1467
1508
  const TAB_COUNTS = { providers: 'n-providers' } // a count shown on the tab, not the sidebar item
1468
1509
  for (const a of document.querySelectorAll('nav a[data-tabs]')) {
1469
1510
  const tabs = a.dataset.tabs.split(' ')
@@ -1606,7 +1647,7 @@ function openForm(p = null) {
1606
1647
  $('p-form').querySelector('.sub').hidden = Boolean(p)
1607
1648
  if (p) {
1608
1649
  $('p-list-on').checked = p.list
1609
- put($('p-added'), p.added.length ? [h('span', { className: 'muted', style: 'font-size:13px', textContent: `${p.added.length} model${p.added.length === 1 ? '' : 's'} you added by name` }), h('button', { className: 'small danger', textContent: 'Forget them', onclick: () => ($('p-form').close(), clearAdded(p)) })] : [])
1650
+ put($('p-added'), p.added.length ? [h('span', { className: 'muted', style: 'font-size:13px', textContent: `${p.added.length} model${p.added.length === 1 ? '' : 's'} added by name` }), h('button', { className: 'small danger', textContent: 'Forget them', onclick: () => ($('p-form').close(), clearAdded(p)) })] : [])
1610
1651
  }
1611
1652
  drawPresets()
1612
1653
  $('p-form').showModal()
@@ -1615,7 +1656,7 @@ function openForm(p = null) {
1615
1656
  const closeForm = () => $('p-form').close()
1616
1657
  $('p-delete').onclick = () => {
1617
1658
  const p = editing
1618
- if (!p || !confirm(`Delete the provider "${p.name}"? Its models leave your list too.`)) return
1659
+ if (!p || !confirm(`Delete the provider "${p.name}"? Its models leave the list too.`)) return
1619
1660
  closeForm()
1620
1661
  act('/api/provider/delete', { name: p.name }, `deleted ${p.name}`)
1621
1662
  }
@@ -1702,7 +1743,7 @@ $('m-search').oninput = (e) => ((modelQuery = e.target.value), (searchOpen = tru
1702
1743
  const kTok = (n) => (n >= 1e6 ? `${Number((n / 1e6).toFixed(2))}M` : n >= 1000 ? `${Math.round(n / 1000)}k` : String(n))
1703
1744
  const usd = (x) => (x === 0 ? 'free' : `$${x < 0.01 ? x.toFixed(4) : x < 1 ? x.toFixed(3).replace(/0$/, '') : x.toFixed(2)}`)
1704
1745
  // where what a model can do comes from (the Your models table)
1705
- const FROM = { 'models.dev': 'from models.dev', you: 'set by you', tested: 'tested' }
1746
+ const FROM = { 'models.dev': 'from models.dev', you: 'set by hand', tested: 'tested' }
1706
1747
  // Test: one short message to the model, to see that it really answers (the key, access to it, its
1707
1748
  // name, the server). The result stays under it until the page is reloaded.
1708
1749
  const TRIES = {} // "provider/model" → { going } | { ok, ms, reply, at } | { ok: false, status, error, at } (from the server)
@@ -1712,8 +1753,8 @@ const MEANS = {
1712
1753
  works: 'it answered',
1713
1754
  400: '400: the provider refused the request as sent (often: a model that isn\'t a chat model)',
1714
1755
  401: '401: the key isn\'t accepted',
1715
- 402: '402: it needs payment or credits on your account',
1716
- 403: '403: no access to this model with your plan or key',
1756
+ 402: '402: it needs payment or credits on the account',
1757
+ 403: '403: no access to this model with this plan or key',
1717
1758
  404: '404: the provider has no model by this name',
1718
1759
  408: '408: the provider timed out',
1719
1760
  410: '410: the model was taken down',
@@ -1735,7 +1776,7 @@ const outcome = (r) => (!r || r.going ? null : r.ok ? 'works' : r.status ? Strin
1735
1776
  function triedCell(t) {
1736
1777
  const r = TRIES[keyOf(t)]
1737
1778
  const secs = (r?.ms != null ? ` · ${(r.ms / 1000).toFixed(1)}s` : '') + (r?.at ? ` · tested ${new Date(r.at).toLocaleString()}` : '')
1738
- const [cls, text, about] = !r ? ['', 'not tested', 'send it a short message to see that it really answers (your key, access to it, its name)']
1779
+ const [cls, text, about] = !r ? ['', 'not tested', 'send it a short message to see that it really answers (the key, access to it, its name)']
1739
1780
  : r.going ? ['going', 'testing…', 'sending it a short message']
1740
1781
  : r.ok && r.toolsOk === false ? ['ok', `✓ ${(r.ms / 1000).toFixed(1)}s · ✗ tools`, `it answers ("${r.reply}"), but it couldn't do a small job with a tool, so it's a poor choice for work: ${r.toolsWhy}${secs}`]
1741
1782
  : r.ok ? ['ok', `✓ ${(r.ms / 1000).toFixed(1)}s`, `works: it answered "${r.reply}"${r.toolsOk ? ', and did a small job with a tool' : ''}${secs}`]
@@ -1836,7 +1877,7 @@ function showRun(run) {
1836
1877
  // models.dev looked up again: one model (its Retry), or all of yours with their rankings (Update model info)
1837
1878
  const retry = (t) => h('button', { className: 'small', textContent: 'Retry', title: 'look it up in models.dev again', onclick: (e) => (e.stopPropagation(), lookUp(t)) })
1838
1879
  async function lookUp(t) {
1839
- job('models.dev', { where: ['catalog', 'table'], what: t ? `Looking up ${t.model} in models.dev` : 'Updating your models: models.dev and LMArena', detail: t ? 'context, tool calls, thinking, images' : 'context, tool calls, thinking, images, price; scores' })
1880
+ job('models.dev', { where: ['catalog', 'table'], what: t ? `Looking up ${t.model} in models.dev` : 'Updating the models: models.dev and LMArena', detail: t ? 'context, tool calls, thinking, images' : 'context, tool calls, thinking, images, price; scores' })
1840
1881
  if (!t) (lookingUp = true), mineSoon()
1841
1882
  const [r, scored] = await Promise.all([act('/api/models-dev', t ? { provider: t.provider, model: t.model } : {}), t ? null : act('/api/rankings', {})])
1842
1883
  if (!t) (lookingUp = false), mineSoon()
@@ -1854,8 +1895,8 @@ function openSetup(t) {
1854
1895
  $('ms-title').textContent = t.model
1855
1896
  $('ms-from').textContent = {
1856
1897
  assumed: "models.dev doesn't know this model. Tell HeartCode what it can do; until then it assumes tool calls, streaming and a ~128k window.",
1857
- 'models.dev': 'From models.dev. Change anything that isn\'t right for how you reach it.',
1858
- you: 'Set by you.',
1898
+ 'models.dev': 'From models.dev. Change anything that isn\'t right for how it\'s reached.',
1899
+ you: 'Set by hand.',
1859
1900
  tested: 'From an earlier test. Change anything that isn\'t right.',
1860
1901
  }[x.source] ?? ''
1861
1902
  $('ms-context').value = x.set?.context ?? ''
@@ -1967,17 +2008,17 @@ function drawProviders(s) {
1967
2008
  const none = !s.providers.length
1968
2009
  // the steps: always on the page (nothing jumps when one is done), ticked off as you go
1969
2010
  put($('steps'), [
1970
- ['Add a provider', 'the service with your models', s.providers.length ? 'done' : 'now'],
2011
+ ['Add a provider', 'the service with the models', s.providers.length ? 'done' : 'now'],
1971
2012
  ['Choose models', 'click one, or tick several and add them', order.length ? 'done' : s.providers.length ? 'now' : ''],
1972
- ['Start HeartCode', 'heart, in your project', order.length ? 'now' : ''],
2013
+ ['Start HeartCode', 'heart, in a project folder', order.length ? 'now' : ''],
1973
2014
  ].map(([t, d, cls], i) => h('div', { className: 'step ' + cls }, h('span', { className: 'num', textContent: cls === 'done' ? '✓' : i + 1 }), h('div', {}, h('b', { textContent: t }), d))))
1974
2015
  $('steps').hidden = order.length > 0 // the first start only
1975
2016
  $('p-work').hidden = none
1976
2017
  // your list, at the top: how many, and the way to its page (the order, what to do when one fails)
1977
2018
  const shown = shownOrder()
1978
2019
  $('p-mine').hidden = !shown.length
1979
- $('p-mine').textContent = `Your models (${shown.length}) →`
1980
- $('p-mine').title = shown.length ? `HeartCode uses ${shown[0].provider} · ${shown[0].model}. Open the Your models page: the order, and what happens when one fails` : ''
2020
+ $('p-mine').textContent = `Models (${shown.length}) →`
2021
+ $('p-mine').title = shown.length ? `HeartCode uses ${shown[0].provider} · ${shown[0].model}. Open Models: the order, and what happens when one fails` : ''
1981
2022
  fillHeight()
1982
2023
 
1983
2024
  // every provider's models, A to Z; one click adds it (the first one becomes #1). Built
@@ -2100,7 +2141,7 @@ function showRow(provider, id, said) {
2100
2141
  // Off your list, the one in use too: the next one becomes #1, or none is left (asked first, then).
2101
2142
  const removeMine = (provider, id) => {
2102
2143
  const rest = S.order.filter((t) => t.provider !== provider || t.model !== id)
2103
- if (!rest.length && !confirm(`Take off ${id}? It's your only model: HeartCode then has none to use until you choose one.`)) return
2144
+ if (!rest.length && !confirm(`Take off ${id}? It's the only model: HeartCode then has none to use until one is chosen.`)) return
2104
2145
  return saveOrder(rest, !rest.length ? `${id} removed: no model chosen now` : placeOf(provider, id) === 0 ? `${id} removed: HeartCode now uses ${rest[0].provider} · ${rest[0].model}` : `${id} removed`)
2105
2146
  }
2106
2147
  const addModel = (provider, id) => {
@@ -2119,7 +2160,7 @@ const withOff = (shown) => {
2119
2160
  return [...S.order.map((t) => (isOff(t.provider) ? t : rest.next().value)).filter(Boolean), ...rest]
2120
2161
  }
2121
2162
  function rowTail(provider, id) {
2122
- if (placeOf(provider, id) >= 0 && isOff(provider)) return h('span', { className: 'tag', textContent: 'in your list · off', title: `${provider} is switched off: HeartCode skips its models (and Your models doesn't show them) until it's on` })
2163
+ if (placeOf(provider, id) >= 0 && isOff(provider)) return h('span', { className: 'tag', textContent: 'in the list · off', title: `${provider} is switched off: HeartCode skips its models (and Models doesn't show them) until it's on` })
2123
2164
  const at = shownOrder().findIndex((t) => t.provider === provider && t.model === id) // its place among the ones HeartCode uses
2124
2165
  const now = inUse()
2125
2166
  return now?.provider === provider && now.model === id ? h('span', { className: 'tag brand', textContent: `#${at + 1} in use` }) : at >= 0 ? h('span', { className: 'tag brand', textContent: `#${at + 1} fallback` }) : h('span', { className: 'add', textContent: S.order.length ? '+ Add' : 'Use' })
@@ -2214,9 +2255,9 @@ $('hello-close').onclick = () => $('hello').close()
2214
2255
  // every model added to a provider by name forgotten; the ones in your list leave it too
2215
2256
  async function clearAdded(p) {
2216
2257
  const inList = S.order.filter((t) => t.provider === p.name && p.added.includes(t.model))
2217
- if (!confirm(`Forget the ${p.added.length} model${p.added.length === 1 ? '' : 's'} you added to ${p.name}?${inList.length ? ` ${inList.length} of them ${inList.length === 1 ? 'is' : 'are'} in your list and will leave it.` : ''}`)) return
2258
+ if (!confirm(`Forget the ${p.added.length} model${p.added.length === 1 ? '' : 's'} added to ${p.name} by name?${inList.length ? ` ${inList.length} of them ${inList.length === 1 ? 'is' : 'are'} in the list and will leave it.` : ''}`)) return
2218
2259
  if (inList.length && !(await saveOrder(S.order.filter((t) => !inList.includes(t))))) return
2219
- act('/api/provider/added', { name: p.name, all: true }, `${p.name}: the models you added are forgotten`)
2260
+ act('/api/provider/added', { name: p.name, all: true }, `${p.name}: the models added by name are forgotten`)
2220
2261
  }
2221
2262
  const CAT_ROW = 40 // a model's row: its name, and what it can do beside it
2222
2263
  // The models ticked (provider → Set of ids): kept while you search, so ones ticked for one search
@@ -2251,7 +2292,7 @@ function drawPicks() {
2251
2292
  const take = () => {
2252
2293
  const off = new Set(toTake.map(keyOf))
2253
2294
  const rest = S.order.filter((t) => !off.has(keyOf(t)))
2254
- if (!confirm(`Take ${toTake.length} model${toTake.length === 1 ? '' : 's'} off your list?${!rest.length ? ' None is left then: HeartCode has no model to use until you choose one.' : keyOf(rest[0]) !== keyOf(S.order[0]) ? ` HeartCode then uses ${rest[0].provider} · ${rest[0].model}.` : ''}`)) return
2295
+ if (!confirm(`Take ${toTake.length} model${toTake.length === 1 ? '' : 's'} off the list?${!rest.length ? ' None is left then: HeartCode has no model to use until one is chosen.' : keyOf(rest[0]) !== keyOf(S.order[0]) ? ` HeartCode then uses ${rest[0].provider} · ${rest[0].model}.` : ''}`)) return
2255
2296
  PICKED_CAT.clear()
2256
2297
  saveOrder(rest, `${toTake.length} removed`)
2257
2298
  }
@@ -2261,8 +2302,8 @@ function drawPicks() {
2261
2302
  h('span', { className: 'n', textContent: `${all.length} selected` }),
2262
2303
  h('button', { className: 'small ghost', textContent: 'Clear', onclick: () => (PICKED_CAT.clear(), drawPicks()) }),
2263
2304
  h('button', { className: 'small', textContent: `Test ${all.length}`, title: 'send each ticked model "Hello" and see which answer', onclick: () => helloAll(all) }),
2264
- toTake.length ? h('button', { className: 'small danger', textContent: `Remove ${toTake.length} from your list`, onclick: take }) : null,
2265
- toAdd.length ? h('button', { className: 'small primary', textContent: `Add ${toAdd.length} to your list`, onclick: () => (PICKED_CAT.clear(), saveOrder([...S.order, ...toAdd], `${toAdd.length} added: your list has ${S.order.length + toAdd.length} models`)) }) : null)
2305
+ toTake.length ? h('button', { className: 'small danger', textContent: `Remove ${toTake.length} from the list`, onclick: take }) : null,
2306
+ toAdd.length ? h('button', { className: 'small primary', textContent: `Add ${toAdd.length} to the list`, onclick: () => (PICKED_CAT.clear(), saveOrder([...S.order, ...toAdd], `${toAdd.length} added: the list has ${S.order.length + toAdd.length} models`)) }) : null)
2266
2307
  if (was !== $('picks').hidden) fillHeight() // the list gives it room
2267
2308
  }
2268
2309
  function buildCatalog(s) {
@@ -2280,7 +2321,7 @@ function buildCatalog(s) {
2280
2321
  h('button', { className: 'mrow', 'data-provider': p.name, 'data-model': id, onclick: () => (placeOf(p.name, id) === undefined ? addModel(p.name, id) : removeMine(p.name, id)) },
2281
2322
  h('span', { className: 'id', title: id }, id, canCell(m.details?.[id], S.order[placeOf(p.name, id)])),
2282
2323
  isFree(m.details?.[id]) ? h('span', { className: 'tag ok', textContent: 'free', title: `${p.name}'s model list says $0` }) : null,
2283
- own ? h('span', { className: 'tag', textContent: 'not in its list' }) : p.added.includes(id) ? h('span', { className: 'tag', textContent: 'added by you' }) : null,
2324
+ own ? h('span', { className: 'tag', textContent: 'not in its list' }) : p.added.includes(id) ? h('span', { className: 'tag', textContent: 'added by name' }) : null,
2284
2325
  rowTail(p.name, id))
2285
2326
  // its tick box (to add or take off several at once), and one you added: ✕ forgets it (it leaves your list too)
2286
2327
  const tick = (id) => h('input', { type: 'checkbox', className: 'pick', checked: pickedOf(p.name).has(id), 'data-model': id, 'aria-label': `select ${id}`, onchange: (e) => (e.target.checked ? pickedOf(p.name).add(id) : pickedOf(p.name).delete(id), drawPicks()) })
@@ -2288,7 +2329,7 @@ function buildCatalog(s) {
2288
2329
  h('button', { className: 'small try', textContent: 'Test', title: `send ${id} "Hello" and see what was sent and what came back`, onclick: () => hello(p.name, id) }),
2289
2330
  !p.added.includes(id) ? null :
2290
2331
  h('button', { className: 'forget', textContent: '✕', title: 'forget this model', 'aria-label': `forget ${id}`, onclick: async () => {
2291
- if (placeOf(p.name, id) !== undefined && !confirm(`Forget ${id}? It leaves your list too.`)) return
2332
+ if (placeOf(p.name, id) !== undefined && !confirm(`Forget ${id}? It leaves the list too.`)) return
2292
2333
  if (placeOf(p.name, id) !== undefined) await saveOrder(S.order.filter((t) => t.provider !== p.name || t.model !== id), `${id} removed`)
2293
2334
  act('/api/provider/added', { name: p.name, model: id, remove: true }, `forgot ${id}`)
2294
2335
  } }))
@@ -2299,7 +2340,7 @@ function buildCatalog(s) {
2299
2340
  const id = box.value.trim()
2300
2341
  if (!id) return
2301
2342
  const at = placeOf(p.name, id)
2302
- if (at !== undefined) return showRow(p.name, id, `${id} is already in your list (#${at + 1})`)
2343
+ if (at !== undefined) return showRow(p.name, id, `${id} is already in the list (#${at + 1})`)
2303
2344
  if (listed.has(id) || yours.includes(id)) return showRow(p.name, id, `${p.name} already has ${id}: click it to add it`)
2304
2345
  box.value = ''
2305
2346
  addModel(p.name, id)
@@ -2321,7 +2362,7 @@ function buildCatalog(s) {
2321
2362
  h('span', { className: 'tag inlist' }),
2322
2363
  h('span', { className: 'meta mono', textContent: p.baseUrl, title: `${p.baseUrl} · key ${p.key || 'none'}` })),
2323
2364
  h('form', { className: 'by-name', onsubmit: addByName },
2324
- h('input', { type: 'text', name: 'name', placeholder: 'model name', 'aria-label': `add a model to ${p.name} by its name`, title: `a model's exact name: added to your list, also one ${p.name} doesn't list` }),
2365
+ h('input', { type: 'text', name: 'name', placeholder: 'model name', 'aria-label': `add a model to ${p.name} by its name`, title: `a model's exact name: added to the list, also one ${p.name} doesn't list` }),
2325
2366
  h('button', { className: 'small', textContent: 'Add' })),
2326
2367
  h('button', { className: 'small', textContent: 'Edit', title: 'its address and key, its model list, delete it', onclick: () => openForm(p) })),
2327
2368
  // what's listed first; loading and errors under it (the models already shown stay where they are)
@@ -2337,7 +2378,7 @@ function buildCatalog(s) {
2337
2378
  m.off && !ids.length ? h('div', { className: 'cat-note', textContent: "Its list is off: add a model by its name, in the box above." }) : null,
2338
2379
  m.loading ? h('div', { className: 'cat-note', textContent: 'Loading its models…' }) : null)
2339
2380
  }))
2340
- if (freeOnly && !$('p-list').querySelector('section')) put($('p-list'), h('div', { className: 'cat-note', textContent: "None of your providers lists a model at $0. (A provider whose model list has no prices can't say what's free: Free only leaves those out.)" }))
2381
+ if (freeOnly && !$('p-list').querySelector('section')) put($('p-list'), h('div', { className: 'cat-note', textContent: "No provider lists a model at $0. (A provider whose model list has no prices can't say what's free: Free only leaves those out.)" }))
2341
2382
  }
2342
2383
  // --- Your models page: the list as a table; sorted by several columns at once (each a tie-break
2343
2384
  // for the ones before it), the sort kept in this browser ---
@@ -2349,7 +2390,7 @@ const can = (t) => ({ tools: t.tested ? t.tested.mode === 'tools' : t.known?.too
2349
2390
  const COLS = {
2350
2391
  model: { label: 'Model', first: 'up', get: (t) => t.model, words: ['A→Z', 'Z→A'] },
2351
2392
  // a provider's priority: your ranking's first is the highest
2352
- provider: { label: 'Provider', first: 'down', get: (t) => -(RANKED.get(t.provider) ?? 1e6), words: ['your ranking, reversed', 'your ranking'] },
2393
+ provider: { label: 'Provider', first: 'down', get: (t) => -(RANKED.get(t.provider) ?? 1e6), words: ['the ranking, reversed', 'the ranking'] },
2353
2394
  context: { label: 'Context', first: 'down', get: (t) => t.tested?.context ?? t.known?.context ?? null, words: ['smallest first', 'biggest first'] },
2354
2395
  abilities: { label: 'Abilities', first: 'down', get: (t) => Object.values(can(t)).filter(Boolean).length, words: ['fewest first', 'most first'] },
2355
2396
  tools: { label: 'Tools', first: 'down', get: (t) => can(t).tools, words: ['without first', 'with first'] },
@@ -2436,7 +2477,7 @@ const dirText = (key, dir) => COLS[key].words[dir === 'up' ? 0 : 1] + (key === '
2436
2477
  // Filters on the Your models page: which models are shown (and tested by "Test N shown", counted,
2437
2478
  // sorted, selected by "select all", saved first by Save list). Combined: a model shows when it passes
2438
2479
  // all of them. Kept with the page's choices.
2439
- const NO_FILTER = { text: '', provider: '', works: '', context: 0, tools: false, thinking: false, images: false, free: false, helpers: false }
2480
+ const NO_FILTER = { text: '', provider: '', works: '', context: 0, tools: false, thinking: false, images: false, free: false }
2440
2481
  let FILTER = { ...NO_FILTER }
2441
2482
  let filtersLoaded = false
2442
2483
  const filtering = () => Object.keys(NO_FILTER).some((k) => FILTER[k] !== NO_FILTER[k])
@@ -2456,7 +2497,6 @@ function passes(t, skip) {
2456
2497
  const c = can(t)
2457
2498
  if ((f.tools && !c.tools) || (f.thinking && !c.thinking) || (f.images && !c.images)) return false
2458
2499
  if (f.free && !(t.price?.input === 0 && t.price?.output === 0)) return false
2459
- if (f.helpers && !helpers()[keyOf(t)] && !HSUG?.[keyOf(t)]) return false // and the ones suggested, while they are
2460
2500
  return true
2461
2501
  }
2462
2502
  const setFilter = (change) => {
@@ -2477,7 +2517,7 @@ let filterBar = null
2477
2517
  function filterBarOf(order, counts = {}) {
2478
2518
  if (!filterBar) {
2479
2519
  let typing = 0
2480
- const toggle = (key, label, about) => h('label', { className: 'f-tog', title: about }, h('input', { type: 'checkbox', 'data-f': key, onchange: (e) => setFilter({ [key]: e.target.checked }) }), label)
2520
+ const toggle = (key, label, about, icon) => h('label', { className: 'f-tog', title: `${label}: ${about}` }, h('input', { type: 'checkbox', 'data-f': key, 'aria-label': label, onchange: (e) => setFilter({ [key]: e.target.checked }) }), ic(icon), h('span', { className: 'lt', textContent: label }))
2481
2521
  filterBar = h('div', { className: 'mt-filters' },
2482
2522
  h('label', { className: 'f-search' },
2483
2523
  h('span', { className: 'f-icon', 'aria-hidden': 'true', textContent: '⌕' }),
@@ -2487,11 +2527,10 @@ function filterBarOf(order, counts = {}) {
2487
2527
  h('select', { className: 'f-context', 'aria-label': 'Filter by context window', onchange: (e) => setFilter({ context: Number(e.target.value) }) },
2488
2528
  CONTEXTS.map(([v, l]) => h('option', { value: v, textContent: v ? `Context ${l}` : l }))),
2489
2529
  h('span', { className: 'f-togs' },
2490
- toggle('tools', 'Tools', 'only models that call tools'),
2491
- toggle('thinking', 'Thinking', 'only models that think'),
2492
- toggle('images', 'Images', 'only models that see images'),
2493
- toggle('free', 'Free', 'only models that cost nothing, in and out'),
2494
- toggle('helpers', 'Helpers', 'only your helpers (the models #1 can start for side jobs), and the ones suggested')))
2530
+ toggle('tools', 'Tools', 'only models that call tools', 'wrench'),
2531
+ toggle('thinking', 'Thinking', 'only models that think', 'bulb'),
2532
+ toggle('images', 'Images', 'only models that see images', 'image'),
2533
+ toggle('free', 'Free', 'only models that cost nothing, in and out', 'tag')))
2495
2534
  }
2496
2535
  const bar = filterBar
2497
2536
  const focused = (el) => document.activeElement === el
@@ -2528,10 +2567,10 @@ function drawMine(s) {
2528
2567
  const n = (x) => x.toLocaleString()
2529
2568
 
2530
2569
  // --- what you do to the list ---
2531
- // the order you see, saved as yours; the sort then goes (your own order from here on: drag on)
2570
+ // the order you see, saved as yours. Saved with Save list: the sort and filters stay as they are, so
2571
+ // the page looks the same next time. A row dragged: the sort goes (your own order from there on)
2532
2572
  const keep = (list, moved) => {
2533
- SORT = []
2534
- savePref('sorts', SORT)
2573
+ if (moved) (SORT = []), savePref('sorts', SORT)
2535
2574
  return saveOrder(withOff(list), list[0] !== order[0] ? `${moved ? '' : 'list saved: '}HeartCode now uses ${list[0].provider} · ${list[0].model}` : 'list saved')
2536
2575
  }
2537
2576
  // a row dragged (in the order shown, sorted or not). Filtered: it moves among the ones shown; the
@@ -2551,83 +2590,100 @@ function drawMine(s) {
2551
2590
  // Save list: the models HeartCode uses become the ones shown, in the order shown. Filtered: only
2552
2591
  // those (asked first; the others stay under Providers, to add back any time)
2553
2592
  const saveList = () => {
2554
- if (filtered && !confirm(`HeartCode will use only these ${n(view.length)}, in this order.\n\nThe other ${n(order.length - view.length)} stay under Providers: add any back whenever you like.`)) return
2593
+ if (filtered && !confirm(`HeartCode will use only these ${n(view.length)}, in this order.\n\nThe other ${n(order.length - view.length)} stay under Providers: add any back at any time.`)) return
2555
2594
  return keep(view)
2556
2595
  }
2557
2596
  const removePicked = () => {
2558
2597
  const rest = order.filter((t) => !PICKED.has(keyOf(t)))
2559
2598
  const k = order.length - rest.length
2560
- if (!confirm(`Take ${k} model${k === 1 ? '' : 's'} off your list?${!rest.length ? ' None is left then: HeartCode has no model to use until you choose one.' : rest[0] !== order[0] ? ` HeartCode then uses ${rest[0].provider} · ${rest[0].model}.` : ''} (They stay under their providers.)`)) return
2599
+ if (!confirm(`Take ${k} model${k === 1 ? '' : 's'} off the list?${!rest.length ? ' None is left then: HeartCode has no model to use until one is chosen.' : rest[0] !== order[0] ? ` HeartCode then uses ${rest[0].provider} · ${rest[0].model}.` : ''} (They stay under their providers.)`)) return
2561
2600
  PICKED.clear()
2562
2601
  saveOrder(withOff(rest), `${k} removed${rest.length ? '' : ': no model chosen now'}`)
2563
2602
  }
2564
2603
  const pickedList = order.filter((t) => PICKED.has(keyOf(t)))
2565
2604
 
2566
2605
  // --- the page's header: how a model is picked (left), what's known about the models (right) ---
2567
- $('mt-lead').textContent = 'The models HeartCode uses, in your order: #1 answers, the next one when it fails.'
2606
+ $('mt-lead').textContent = 'The models HeartCode uses: #1 answers; when a model fails, another takes over (the best-ranked one not tried yet). Hover a setting to see what it does.'
2568
2607
  const busy = locked()
2569
- $('mt-actions').inert = busy
2608
+ $('mt-actions').inert = false // Save list works at any time; the rest wait while something runs (below)
2570
2609
  // the order helpers are picked in when #1 starts them: your list's, or your provider ranking's
2571
2610
  const helperOrder = (by) => api('/api/helper-order', { by, rank: RANK }).then((r) => ((S.helperOrder = r.helperOrder), drawMine(S)), (e) => toast(e.message, true))
2572
- const orderBy = h('span', { className: 'h-order' }, h('span', { className: 'mt-setl', textContent: 'Helpers picked' }),
2573
- h('div', { className: 'seg', role: 'radiogroup', 'aria-label': 'The order helpers are picked in' },
2574
- [['own', 'in your order', 'when #1 starts helpers, it picks from them in your list\'s order (the first one that fits the job)'], ['provider', 'by provider', 'when #1 starts helpers, it picks from them by your provider ranking (Order providers), each provider\'s in your list\'s order. Your list itself stays as it is']].map(([v, t, about]) =>
2575
- h('label', { className: (S.helperOrder ?? 'own') === v ? 'on' : '', title: about },
2576
- h('input', { type: 'radio', name: 'helper-order', checked: (S.helperOrder ?? 'own') === v, onchange: () => helperOrder(v) }), t))))
2611
+ // who chooses the helpers: HeartCode (from the tests and the rankings, again when those change) or you
2612
+ const chooser = h('label', { className: 'h-order', title: 'Helpers\nWho picks the helpers: the models #1 can hand side jobs to (looking at a screenshot, a review, a part of the plan).\n\nAutomatic: HeartCode picks them, and what each is for, from the tests and the rankings, and picks again when those change.\nManual: you switch them on, and pick their jobs, in the Helper column.' },
2613
+ h('span', { className: 'mt-setl' }, ic('sparkles'), h('span', { className: 'lt', textContent: 'Helpers' })),
2614
+ h('select', { id: 'h-auto', onchange: (e) => setAuto(e.target.value === 'auto', e.target) },
2615
+ [['auto', 'Automatic'], ['manual', 'Manual']].map(([v, t]) => h('option', { value: v, textContent: t, selected: (S.helpersAuto ? 'auto' : 'manual') === v }))))
2616
+ const orderBy = h('span', { className: 'h-order', title: 'Used\nWhich helper #1 takes first when several fit a job.\n\nBy score: the best-ranked in public rankings (the default).\nIn list order: the first in your list.\nBy provider: by your provider ranking (Order providers).' }, h('span', { className: 'mt-setl' }, ic('bars'), h('span', { className: 'lt', textContent: 'Used' })),
2617
+ h('div', { className: 'seg', role: 'radiogroup', 'aria-label': 'The order helpers are used in' },
2618
+ [['own', 'in list order', 'when #1 starts a helper, it takes the first one that fits the job, in the list\'s order'], ['provider', 'by provider', 'when #1 starts a helper, it takes them by the provider ranking (Order providers), each provider\'s in the list\'s order. The list itself stays as it is'], ['score', 'by score', 'when #1 starts a helper, it takes the best ranked first: its best place in LMArena\'s public rankings for coding, web apps, long real tasks and hard prompts (Update model info). Models not ranked come after, in the list\'s order']].map(([v, t, about]) =>
2619
+ h('label', { className: (S.helperOrder ?? 'score') === v ? 'on' : '', title: about },
2620
+ h('input', { type: 'radio', name: 'helper-order', checked: (S.helperOrder ?? 'score') === v, disabled: v === 'provider' && !order.some((t) => t.provider !== order[0]?.provider), onchange: () => helperOrder(v) }), t))))
2577
2621
  put($('mt-actions'),
2578
- order.some((t) => t.provider !== order[0]?.provider) ? orderBy : null, // one provider: nothing to order by
2579
- ((why) => h('span', { title: why ?? '' }, h('button', { className: 'small', textContent: 'Order providers', disabled: Boolean(why), title: why ? '' : 'drag your providers into order; the Provider column sorts by it', onclick: openRanking })))( // disabled: why, on a span (a disabled button shows no tooltip in every browser)
2580
- !order.some((t) => t.provider !== order[0]?.provider) ? 'All your models are from one provider: nothing to order' : null),
2581
- h('button', { className: 'small', textContent: 'Update model info', disabled: !order.length, title: `what each model can do (context, tools, thinking, images, price) from models.dev, and its places in LMArena's public rankings (coding, web apps, vision${S.rankings ? `; rankings from ${new Date(S.rankings.fetched).toLocaleDateString()}` : ''})`, onclick: () => lookUp() }))
2622
+ ((why) => h('span', { title: why ?? '' }, h('button', { className: 'small', textContent: 'Order providers', disabled: Boolean(why), title: why ? '' : 'drag the providers into order; the Provider column sorts by it', onclick: openRanking })))( // disabled: why, on a span (a disabled button shows no tooltip in every browser)
2623
+ !order.some((t) => t.provider !== order[0]?.provider) ? 'All the models are from one provider: nothing to order' : null),
2624
+ h('button', { className: 'small', textContent: 'Update model info', disabled: !order.length, title: `what each model can do (context, tools, thinking, images, price) from models.dev, and its places in LMArena's public rankings (coding, web apps, vision${S.rankings ? `; rankings from ${new Date(S.rankings.fetched).toLocaleDateString()}` : ''})`, onclick: () => lookUp() }),
2625
+ h('button', { className: 'small', textContent: filtered ? `Test ${n(shown.length)}` : 'Test all', disabled: testingAll || !shown.length, title: `send ${filtered ? 'the models shown' : 'each model'} a short message to see which really answer, and how fast`, onclick: () => tryAll(filtered ? shown : order) }),
2626
+ // always there: the list as it's shown (sorted, filtered), saved whenever
2627
+ h('button', { className: 'small primary', textContent: filtered ? `Use only these ${n(view.length)}` : 'Save list', disabled: !view.length, title: filtered ? `HeartCode uses only these ${n(view.length)}, in the order shown (the others stay under Providers)` : 'save the list as shown: HeartCode uses them in this order (#1 first)', onclick: saveList }))
2628
+ for (const b of $('mt-actions').children) if (!b.classList.contains('primary')) b.inert = busy // all but Save list wait while something runs
2582
2629
 
2583
- // --- the list's settings: one line, a short label beside each control ---
2630
+ // --- row 2, the list's settings: when a model fails (left), the helpers (right); an icon and a short label each ---
2584
2631
  const ro = s.rotation
2585
- const cell = (label, about, ...control) => h('label', { className: 'mt-set', title: about }, h('span', { className: 'mt-setl', textContent: label }), h('span', { className: 'mt-setc' }, ...control))
2632
+ // about: its tooltip, in plain words (the label is its first line)
2633
+ const cell = (icon, label, about, ...control) => h('label', { className: 'mt-set', title: `${label}\n${about}` }, h('span', { className: 'mt-setl' }, ic(icon), h('span', { className: 'lt', textContent: label })), h('span', { className: 'mt-setc' }, ...control))
2586
2634
  // a whole number setting (seconds), with its limits from the server (SPEED_LIMITS)
2587
2635
  const LIMITS = { replyStart: [5, 600], replyIdle: [10, 1800] }
2588
- const num = (name, label, said) => h('input', { type: 'number', className: 'tries', 'aria-label': label, min: LIMITS[name][0], max: LIMITS[name][1], value: S.settings[name], onchange: (e) => {
2636
+ // a time limit saved; the ones that depend on it (Give up, Stalled, Tests wait) may move to fit: said
2637
+ // for longer, and the boxes that moved flash
2638
+ const saveTime = async (name, v, said) => {
2639
+ const r = await act('/api/setting', { name, value: v })
2640
+ if (!r) return
2641
+ if (!r.notes?.length) return toast(said)
2642
+ toast([said, ...r.notes.map((x) => x.text)].join('\n'), false, 9000)
2643
+ for (const x of r.notes) document.querySelector(`.mt-sets input[data-name="${x.name}"]`)?.classList.add('moved')
2644
+ }
2645
+ const num = (name, label, said) => h('input', { type: 'number', className: 'tries', 'data-name': name, 'aria-label': label, min: LIMITS[name][0], max: LIMITS[name][1], value: S.settings[name], onchange: (e) => {
2589
2646
  const v = Math.round(Number(e.target.value))
2590
2647
  const [lo, hi] = LIMITS[name]
2591
2648
  if (!(v >= lo && v <= hi)) return (e.target.value = S.settings[name]), toast(`a whole number, ${lo} to ${hi}`, true)
2592
- act('/api/setting', { name, value: v }, said(v))
2649
+ saveTime(name, v, said(v))
2593
2650
  } })
2594
- const secsCell = (label, name, about, unit, said) => cell(label, about, num(name, label, said), h('span', { className: 'unit', textContent: unit }))
2651
+ const secsCell = (icon, label, name, about, unit, said) => cell(icon, label, about, num(name, label, said), h('span', { className: 'unit', textContent: unit }))
2595
2652
  const settings = h('div', { className: 'mt-sets', inert: busy },
2596
2653
  h('div', { className: 'mt-mode-sets' },
2597
- cell('If one fails', ro.on === 'retries' ? 'a rate limit or outage: that model gets that many tries in all before the next one; any other error moves on at once' : "any error moves on at once, to the next model (after an error from its provider: another provider's first)",
2654
+ cell('swap', 'If one fails', 'What happens when a model errors, doesn\'t answer in time, or is rate-limited.\n\nSwitch model: another of your models takes over at once (the best-ranked one not tried yet).\nRetry it first: when the model is only busy or briefly down (a rate limit, an outage), the same one is tried again, up to the number of tries set here; any other error switches at once.',
2598
2655
  h('select', { onchange: (e) => saveOrder(S.order, 'saved', { on: e.target.value }) },
2599
- [['failure', 'go to the next'], ['retries', 'retry it first']].map(([v, t]) => h('option', { value: v, textContent: t, selected: ro.on === v }))),
2600
- ro.on === 'retries' ? h('input', { type: 'number', className: 'tries', 'aria-label': 'tries', title: 'tries of the same model first (rate limits, outages)', min: 1, max: 20, value: ro.retries, onchange: (e) => saveOrder(S.order, 'saved', { retries: Number(e.target.value) }) }) : null),
2601
- secsCell('Give up after', 'replyStart', "a model that hasn't started answering (text, thinking or a tool call) in this many seconds counts as failed (a streamed reply: a model set up without streaming waits for its whole reply)", 'sec', (v) => `a model that hasn't started answering in ${v}s counts as failed`),
2602
- secsCell('Stalled after', 'replyIdle', 'a reply that stops sending anything for this many seconds is stalled: tried again, or the next model', 'sec', (v) => `a reply silent for ${v}s counts as stalled`),
2603
- cell('Tests wait', 'how long a test waits for each answer',
2604
- h('input', { type: 'number', className: 'tries', min: 1, max: 600, step: 1, value: S.settings.testTimeout ?? 10, 'aria-label': 'Test timeout in seconds', onchange: (e) => {
2656
+ [['failure', 'switch model'], ['retries', 'retry it first']].map(([v, t]) => h('option', { value: v, textContent: t, selected: ro.on === v }))),
2657
+ ro.on === 'retries' ? h('input', { type: 'number', className: 'tries', 'aria-label': 'tries', title: 'Tries\nHow many times in all the same model is tried when it\'s busy or briefly down, before another model takes over.', min: 1, max: 20, value: ro.retries, onchange: (e) => saveOrder(S.order, 'saved', { retries: Number(e.target.value) }) }) : null),
2658
+ secsCell('clock', 'Give up', 'replyStart', "How long a model gets to start answering.\n\nAfter HeartCode asks, the first word, thought or tool call must come within this many seconds. If nothing comes, the model counts as failed and another one takes over.\n\nRaise it if your providers are slow but do answer (fewer switches). Lower it to move on faster from models that hang.\nStalled and Tests wait are never shorter than this: they move up with it.", 's', (v) => `a model that hasn't started answering in ${v}s counts as failed`),
2659
+ secsCell('pause', 'Stalled', 'replyIdle', "How long a reply may go quiet once it has started.\n\nA model that keeps sending (text or thinking) is never cut off, however long it takes. One that sends nothing at all for this many seconds counts as stalled: it's asked again, or another model takes over.\n\nAt least as long as Give up (a pause mid-reply has the same causes as a slow start).", 's', (v) => `a reply silent for ${v}s counts as stalled`),
2660
+ cell('hourglass', 'Tests wait', "Only for the Test buttons on this page, not for real work.\n\nHow long each model gets to answer a short test message. No answer by then shows as \"no answer\" in Works?.\n\nAt least as long as Give up, so a test doesn't call a model broken that real work would still wait for.",
2661
+ h('input', { type: 'number', className: 'tries', 'data-name': 'testTimeout', min: 1, max: 600, step: 1, value: S.settings.testTimeout, 'aria-label': 'Test timeout in seconds', onchange: (e) => {
2605
2662
  const v = Math.round(Number(e.target.value))
2606
- if (!(v >= 1 && v <= 600)) return (e.target.value = S.settings.testTimeout ?? 10), toast('a whole number of seconds, 1 to 600', true)
2607
- act('/api/setting', { name: 'testTimeout', value: v }, `tests wait ${v} second${v === 1 ? '' : 's'} for an answer`)
2608
- } }), h('span', { className: 'unit', textContent: 'sec' })),
2609
- cell('New message to', 'the model a new message goes to first',
2663
+ if (!(v >= 1 && v <= 600)) return (e.target.value = S.settings.testTimeout), toast('a whole number of seconds, 1 to 600', true)
2664
+ saveTime('testTimeout', v, `tests wait ${v} second${v === 1 ? '' : 's'} for an answer`)
2665
+ } }), h('span', { className: 'unit', textContent: 's' })),
2666
+ cell('send', 'New message', 'Which model a new message goes to first.\n\n#1: always the top of the list.\nLast working: the one that answered last (useful while #1 keeps failing).',
2610
2667
  h('select', { onchange: (e) => saveOrder(S.order, 'saved', { next: e.target.value }) },
2611
- [['first', '#1'], ['stay', 'the last that worked']].map(([v, t]) => h('option', { value: v, textContent: t, selected: ro.next === v })))),
2612
- cell('Helpers', 'who picks the helpers (the Helper column): HeartCode, from the models that answered their test and the rankings, again whenever those change; or you, with the pills',
2613
- h('select', { id: 'h-auto', onchange: (e) => setAuto(e.target.value === 'auto', e.target) },
2614
- [['auto', 'picked for you'], ['manual', 'you pick']].map(([v, t]) => h('option', { value: v, textContent: t, selected: (S.helpersAuto ? 'auto' : 'manual') === v }))))))
2668
+ [['first', '#1'], ['stay', 'last working']].map(([v, t]) => h('option', { value: v, textContent: t, selected: ro.next === v })))),
2669
+ h('span', { className: 'mt-div', 'aria-hidden': 'true' }),
2670
+ chooser, orderBy))
2615
2671
 
2616
2672
  // --- beside the filters: what's shown · what you do with it (the sorts show in the column heads) ---
2617
2673
  const line = h('div', { className: 'mt-line' },
2618
- h('span', { className: 'count', title: SORT.length ? `sorted by ${SORT.map(({ key, dir }) => `${COLS[key].label} ${COLS[key].words[dir === 'up' ? 0 : 1]}`).join(', then ')}; ties keep your order` : '' }, filtered ? [h('b', { textContent: n(shown.length) }), ` of ${n(order.length)}`] : [h('b', { textContent: n(order.length) }), ` model${order.length === 1 ? '' : 's'}`]),
2619
- filtering() || SORT.length ? h('button', { className: 'small ghost', textContent: 'Clear', title: 'every filter and the sort off: your whole list, in your order', onclick: clearView }) : null,
2620
- order.length > 1 ? drawHelperBar() : null,
2621
- h('button', { className: 'small', textContent: filtered ? `Test ${n(shown.length)}` : 'Test all', disabled: testingAll || !shown.length, title: `send ${filtered ? 'the models shown' : 'each model'} a short message to see which really answer, and how fast`, onclick: () => tryAll(filtered ? shown : order) }),
2622
- // not on the helpers' view: they're not a list to keep only
2623
- filtered && FILTER.helpers ? null : h('button', { className: 'small primary', textContent: filtered ? `Use only these ${n(view.length)}` : 'Save list', disabled: !view.length || order.length < 2, title: filtered ? `HeartCode uses only these ${n(view.length)}, in the order shown (the others stay under Providers)` : 'save your list as shown: HeartCode uses them in this order (#1 first)', onclick: saveList }))
2674
+ h('span', { className: 'count', title: SORT.length ? `sorted by ${SORT.map(({ key, dir }) => `${COLS[key].label} ${COLS[key].words[dir === 'up' ? 0 : 1]}`).join(', then ')}; ties keep the list order` : '' }, filtered ? [h('b', { textContent: n(shown.length) }), ` of ${n(order.length)}`] : [h('b', { textContent: n(order.length) }), ` model${order.length === 1 ? '' : 's'}`]),
2675
+ // the sorting off in one click (the filters stay); with filters on too, Clear all turns both off
2676
+ SORT.length ? h('button', { className: 'small ghost', textContent: 'Clear sort', title: 'every sort off: the list in its own order again (the filters stay)', onclick: () => setSort([]) }) : null,
2677
+ filtering() ? h('button', { className: 'small ghost', textContent: 'Clear all', title: 'every filter and the sort off: the whole list, in order', onclick: clearView }) : null,
2678
+ order.length > 1 ? drawHelperBar() : null)
2624
2679
 
2625
2680
  // --- the table ---
2626
2681
  const all = view.length > 0 && view.every((t) => PICKED.has(keyOf(t)))
2627
- const head = (key, align) => {
2682
+ // icon: a narrow column named by an icon (its name in the tooltip)
2683
+ const head = (key, align, icon) => {
2628
2684
  const at = SORT.findIndex((x) => x.key === key)
2629
- return h('button', { type: 'button', className: (at >= 0 ? 'on ' : '') + (align || ''), title: `sort by ${COLS[key].label.toLowerCase()} (after the ones already sorted by) · click again: reversed · again: off`, onclick: (e) => clickSort(key, e.currentTarget) },
2630
- COLS[key].label, at >= 0 ? h('span', { className: 'dir', textContent: ` ${SORT[at].dir === 'up' ? '↑' : '↓'}${SORT.length > 1 ? at + 1 : ''}` }) : '')
2685
+ return h('button', { type: 'button', className: (at >= 0 ? 'on ' : '') + (align || ''), 'aria-label': COLS[key].label, title: `${icon ? `${COLS[key].label}: ` : ''}sort by ${COLS[key].label.toLowerCase()} (after the ones already sorted by) · click again: reversed · again: off`, onclick: (e) => clickSort(key, e.currentTarget) },
2686
+ icon ? ic(icon) : COLS[key].label, at >= 0 ? h('span', { className: 'dir', textContent: ` ${SORT[at].dir === 'up' ? '↑' : '↓'}${SORT.length > 1 ? at + 1 : ''}` }) : '')
2631
2687
  }
2632
2688
  const selectAll = h('input', { type: 'checkbox', checked: all, indeterminate: PICKED.size > 0 && !all, title: all ? 'select none' : 'select all shown', 'aria-label': 'select all shown', onchange: () => (all ? PICKED.clear() : view.forEach((t) => PICKED.add(keyOf(t))), (lastPicked = null), drawMine(S)) })
2633
2689
  // the columns' names; with models selected, what to do with them instead (the checkbox stays)
@@ -2640,7 +2696,7 @@ function drawMine(s) {
2640
2696
  h('button', { className: 'small ghost', textContent: 'Invert', title: "select the ones shown that aren't selected, unselect the ones that are", onclick: () => (view.forEach((t) => (PICKED.has(keyOf(t)) ? PICKED.delete(keyOf(t)) : PICKED.add(keyOf(t)))), (lastPicked = null), drawMine(S)) }),
2641
2697
  h('button', { className: 'small ghost', textContent: 'Select none', onclick: () => (PICKED.clear(), drawMine(S)) })))
2642
2698
  : h('div', { className: 'mt mt-h' }, h('span'), selectAll,
2643
- h('span', { textContent: '#', title: 'its place in your list' }), head('model'), head('provider'), h('span', { textContent: 'Helper', title: '#1 can hand a part of a task to a helper. Switch a model on, and pick what it\'s good at (hover a pill to see what it covers): #1 is told, and picks by it. None switched on: helpers run on the model that answers.' }), head('context', 'num'), head('tools', 'mid'), head('thinking', 'mid'), head('images', 'mid'), head('coding', 'num'), head('web', 'num'), head('vision', 'num'), head('price', 'num'), head('works'), h('span', { className: 'num', textContent: '' }))
2699
+ h('span', { textContent: '#', title: 'its place in the list' }), head('model'), head('provider'), h('span', { textContent: 'Helper', title: '#1 can hand a part of a task to a helper. Switch a model on, and pick what it\'s good at: UI & visuals, Code & logic, Big & hard, Quick & cheap (hover an icon to see what it covers): #1 is told, and picks by it. None switched on: helpers run on the model that answers.' }), head('context', 'num'), head('tools', 'mid', 'wrench'), head('thinking', 'mid', 'bulb'), head('images', 'mid', 'image'), head('coding', 'num', 'code'), head('web', 'num', 'globe'), head('vision', 'num', 'eye'), head('price', 'num'), head('works'), h('span', { className: 'num', textContent: '' }))
2644
2700
  const table = view.length ? h('ol', { className: 'mtable' + (view.length < 2 || busy ? '' : ' drag') }) : null
2645
2701
  // ticked or not; with Shift, every row from the last one ticked to this one
2646
2702
  const pick = (i, e) => {
@@ -2683,7 +2739,7 @@ function drawMine(s) {
2683
2739
  h('button', { type: 'button', className: 'mt-more-l', 'aria-label': 'scroll the table left', title: 'more columns to the left', onclick: (e) => slide(e.currentTarget, -1) }, '‹'),
2684
2740
  h('span', { textContent: 'More columns' }),
2685
2741
  h('button', { type: 'button', className: 'mt-more-r', 'aria-label': 'scroll the table right', title: 'more columns to the right (or Shift + scroll, or swipe)', onclick: (e) => slide(e.currentTarget, 1) }, '›'))))
2686
- : empty('No models in your list yet. ', h('a', { href: '#providers', textContent: 'Choose some under Providers' }), '.'))
2742
+ : empty('No models in the list yet. ', h('a', { href: '#providers', textContent: 'Choose some under Providers' }), '.'))
2687
2743
  if (typing && document.activeElement !== typing) {
2688
2744
  typing.focus({ preventScroll: true })
2689
2745
  if (caret !== null && typing.setSelectionRange) typing.setSelectionRange(caret, caret)
@@ -2712,15 +2768,15 @@ const yes = (v) => h('span', { className: (v ? 'yes' : 'no') + ' mid', textConte
2712
2768
  const RANK_OF = { coding: 'coding', web: 'web apps (WebDev)', vision: 'vision' }
2713
2769
  const rankCell = (t, k) => {
2714
2770
  const r = t.ranks?.[k]
2715
- if (!r) return h('span', { className: 'num rk', textContent: '–', title: S.rankings ? `not in LMArena's ${RANK_OF[k]} ranking` : 'no scores yet: Update model info, at the top' })
2716
- return h('span', { className: 'num rk' + (r.rank / r.of <= 0.1 ? ' top' : ''), title: `${r.score != null ? `score ${r.score}${r.votes ? ` from ${r.votes.toLocaleString()} votes` : ''}, ` : ''}#${r.rank} of ${r.of} models in LMArena's ${RANK_OF[k]} ranking (as "${r.as}")${r.score == null ? '. Update model info for the scores' : ''}` },
2717
- r.score != null ? h('b', { textContent: r.score }) : '', `#${r.rank}`)
2771
+ if (!r) return h('span', { className: 'num rk', textContent: '–', title: S.rankings ? `${COLS[k].label}: not in LMArena's ${RANK_OF[k]} ranking` : 'no scores yet: Update model info, at the top' })
2772
+ return h('span', { className: 'num rk' + (r.rank / r.of <= 0.1 ? ' top' : ''), title: `${COLS[k].label}: ${r.score != null ? `score ${r.score}${r.votes ? ` from ${r.votes.toLocaleString()} votes` : ''}, ` : ''}#${r.rank} of ${r.of} models in LMArena's ${RANK_OF[k]} ranking (as "${r.as}")${r.score == null ? '. Update model info for the scores' : ''}` },
2773
+ `#${r.rank}`)
2718
2774
  }
2719
2775
  const src = (t) => {
2720
2776
  const x = t.tested
2721
2777
  if (!x) return h('div', { className: 'src', textContent: 'looking it up…' })
2722
2778
  if (x.source === 'assumed') return h('div', { className: 'src warn', title: "models.dev doesn't know it: Retry, or set up what it can do" }, 'not found', retry(t), h('button', { className: 'small', textContent: 'Set up', onclick: () => openSetup(t) }))
2723
- return h('div', { className: 'src' }, Object.keys(x.set ?? {}).length ? 'set by you' : x.source === 'models.dev' ? 'models.dev' : FROM[x.source], h('button', { className: 'small', textContent: 'Edit', onclick: () => openSetup(t) }))
2779
+ return h('div', { className: 'src' }, Object.keys(x.set ?? {}).length ? 'set by hand' : x.source === 'models.dev' ? 'models.dev' : FROM[x.source], h('button', { className: 'small', textContent: 'Edit', onclick: () => openSetup(t) }))
2724
2780
  }
2725
2781
  // a row of the table: one model of your list, in the order shown (at: its place in your order)
2726
2782
  const money = (x) => (x == null ? '–' : x === 0 ? '$0' : usd(x))
@@ -2777,25 +2833,27 @@ function helperCell(t, at) {
2777
2833
  const sug = HSUG?.[k] ?? []
2778
2834
  const busy = locked()
2779
2835
  return h('span', { className: 'hp' + (jobs ? '' : ' off') },
2780
- h('span', { className: SAVING.has(`${k}|on`) ? 'saving' : '', title: jobs ? 'a helper: #1 can start it for side jobs (click: not a helper)' : Object.keys(helpers()).length ? 'not a helper (click: #1 can start it for side jobs)' : 'no helpers ticked: #1 can start any of your models (click: only the ones you tick)' },
2836
+ h('span', { className: SAVING.has(`${k}|on`) ? 'saving' : '', title: jobs ? 'a helper: #1 can start it for side jobs (click: not a helper)' : Object.keys(helpers()).length ? 'not a helper (click: #1 can start it for side jobs)' : 'no helpers ticked: #1 can start any model in the list (click: only ticked ones)' },
2781
2837
  sw({ checked: Boolean(jobs), disabled: busy, 'aria-label': `${t.model} is a helper`, onchange: (e) => setHelper(k, e.target.checked ? (jobs ?? []) : null, 'on') })),
2782
2838
  Object.entries(S.jobs ?? {}).map(([j, [label, , covers]]) => {
2783
2839
  const has = Boolean(jobs?.includes(j))
2784
2840
  const sugd = !has && sug.includes(j)
2785
- const pill = h('button', { type: 'button', className: 'jp' + (has ? ' on' : sugd ? ' sug' : '') + (SAVING.has(`${k}|${j}`) ? ' saving' : ''), disabled: busy, 'aria-pressed': String(has), 'aria-label': `${label}: ${covers}`, onclick: () => setHelper(k, has ? jobs.filter((x) => x !== j) : [...(jobs ?? []), j], j) }, label)
2841
+ const pill = h('button', { type: 'button', className: 'jp' + (has ? ' on' : sugd ? ' sug' : '') + (SAVING.has(`${k}|${j}`) ? ' saving' : ''), disabled: busy, 'aria-pressed': String(has), 'aria-label': `${label}: ${covers}`, onclick: () => setHelper(k, has ? jobs.filter((x) => x !== j) : [...(jobs ?? []), j], j) }, ic(JOB_ICON[j]))
2786
2842
  // what the pill means, and what a click does here
2787
2843
  return withTip(pill, () => [
2788
- at === 0 ? h('div', { className: 'tcover', textContent: '#1 answers you; as a helper it\'s started when another of your models is answering.' }) : null,
2789
- h('div', { className: 'tjob', textContent: label }),
2844
+ at === 0 ? h('div', { className: 'tcover', textContent: '#1 answers; as a helper it\'s started when another model is answering.' }) : null,
2845
+ h('div', { className: 'tjob', textContent: `${label}${has ? ' · picked' : sugd ? ' · suggested' : ''}` }),
2790
2846
  h('div', { className: 'tcover', textContent: covers }),
2791
2847
  sugd ? h('div', { className: 'tcover', textContent: `Suggested from ${SUGGEST_WHY[j]}.` }) : null,
2792
- S.helpersAuto && has ? h('div', { className: 'tcover', textContent: 'Picked for you, from the rankings and the tests.' }) : null,
2793
- h('div', { className: 'thint', textContent: (has ? `Click: ${t.model} isn't picked for this any more` : `Click: #1 gives these jobs to ${t.model}${jobs ? '' : ' (it becomes a helper)'}`) + (S.helpersAuto ? ' · from then on, you pick' : '') }),
2848
+ S.helpersAuto && has ? h('div', { className: 'tcover', textContent: 'Chosen automatically, from the rankings and the tests.' }) : null,
2849
+ h('div', { className: 'thint', textContent: (has ? `Click: ${t.model} isn't picked for this any more` : `Click: #1 gives these jobs to ${t.model}${jobs ? '' : ' (it becomes a helper)'}`) + (S.helpersAuto ? ' · from then on: Manual' : '') }),
2794
2850
  ])
2795
2851
  }))
2796
2852
  }
2853
+ // each job's icon (its name and what it covers: the tooltip)
2854
+ const JOB_ICON = { ui: 'monitor', code: 'code', hard: 'mountain', quick: 'zap' }
2797
2855
  // what each pill's suggestions go by (said in its tooltip)
2798
- const SUGGEST_WHY = { ui: 'its place in the top half of the web-app ranking (LMArena)', code: 'its place in the top half of the coding ranking (LMArena)', hard: 'it thinks with a context of 128k or more, or its place in the top half of the ranking for long real tasks or the hardest prompts (LMArena)', quick: 'its test: as fast as the middle one of yours or faster (or nothing else fits it)' }
2856
+ const SUGGEST_WHY = { ui: 'its place in the top half of the web-app ranking (LMArena)', code: 'its place in the top half of the coding ranking (LMArena)', hard: 'it thinks with a context of 128k or more, or its place in the top half of the ranking for long real tasks or the hardest prompts (LMArena)', quick: 'its test: as fast as the middle one or faster (or nothing else fits it)' }
2799
2857
  // Helpers are picked from the models that answered their test: how many did
2800
2858
  const working = () => S.order.filter((t) => TRIES[keyOf(t)]?.ok && !TRIES[keyOf(t)].going).length
2801
2859
  // No test yet: ask before testing them all (each gets a short message, which a paid model charges for);
@@ -2805,7 +2863,7 @@ function testFirst(then) {
2805
2863
  const n = (x) => x.toLocaleString()
2806
2864
  const paid = S.order.filter((t) => t.price && (t.price.input > 0 || t.price.output > 0)).length
2807
2865
  const unknown = S.order.filter((t) => !t.price).length
2808
- $('h-test-cost').textContent = `Test all sends each of your ${n(S.order.length)} models a short message. ${paid ? `${n(paid)} of them aren't free: each charges for its few tokens. ` : ''}${unknown ? `${n(unknown)} have no price we know of, and may charge too. ` : ''}When it's done, helpers are ${then === 'suggest' ? 'suggested' : 'picked'} from the ones that worked.`
2866
+ $('h-test-cost').textContent = `Test all sends each of the ${n(S.order.length)} models a short message. ${paid ? `${n(paid)} of them aren't free: each charges for its few tokens. ` : ''}${unknown ? `${n(unknown)} have no price we know of, and may charge too. ` : ''}When it's done, helpers are ${then === 'suggest' ? 'suggested' : 'picked'} from the ones that worked.`
2809
2867
  $('h-test-go').onclick = () => {
2810
2868
  $('h-test').close()
2811
2869
  afterTests = then
@@ -2838,8 +2896,8 @@ async function suggestNow(b) {
2838
2896
  if (b) b.disabled = false
2839
2897
  if (!r) return
2840
2898
  HSUG = Object.keys(r.suggest).length ? r.suggest : null
2841
- if (!HSUG) return toast(working() ? 'Nothing more to suggest' : 'None of your models worked in the test: nothing to pick from', !working())
2842
- setFilter({ helpers: true }) // your helpers and the suggested ones, together: not lost among the rest
2899
+ if (!HSUG) return toast(working() ? 'Nothing more to suggest' : 'No model worked in the test: nothing to pick from', !working())
2900
+ drawMine(S) // shown dashed in the Helper column, in the list as it is: nothing filtered
2843
2901
  }
2844
2902
  // The toolbar's helpers part: suggestions waiting (take all · dismiss), or Suggest helpers and Clear
2845
2903
  // helpers. Each saves at once, its own button saying so.
@@ -2847,7 +2905,7 @@ function drawHelperBar() {
2847
2905
  helperBar ??= h('span', { className: 'hbar' })
2848
2906
  const order = S.order
2849
2907
  const n = Object.keys(helpers()).length
2850
- const busy = (b) => Object.assign(b, { disabled: true, textContent: 'Saving…' })
2908
+ const busy = (b) => Object.assign(b, { disabled: true, textContent: 'Saving…' }) // its icon and label give way
2851
2909
  put(helperBar,
2852
2910
  HSUG ? h('span', { className: 'hsug', title: 'shown dashed in the Helper column: click one to take just that' }, ic('sparkles'),
2853
2911
  h('span', { textContent: `${Object.keys(HSUG).length} suggested` }),
@@ -2860,12 +2918,12 @@ function drawHelperBar() {
2860
2918
  saveHelpers(next, [], `${took.length} model${took.length === 1 ? ' is a helper' : 's are helpers'} now`).then(() => drawMine(S))
2861
2919
  } }),
2862
2920
  h('button', { className: 'small ghost', textContent: 'Dismiss', onclick: () => ((HSUG = null), drawMine(S)) })) : null,
2863
- !HSUG && !S.helpersAuto ? h('button', { className: 'small', title: working() ? `suggest helpers from the ${working()} models that answered their test (their provider switched on), each with what it's good at that it doesn't have yet (from the rankings, its test, thinking and context): you see them first, then take them or not` : 'suggest helpers: your models are tested first (helpers are picked from the ones that answer)', onclick: (e) => (working() ? suggestNow(e.currentTarget) : testFirst('suggest')) }, ic('sparkles'), 'Suggest helpers') : null,
2864
- !HSUG && n ? h('button', { className: 'small ghost', textContent: 'Clear helpers', title: `none of your models a helper (${n} now): #1 can then start any of your models again, as before`, onclick: (e) => {
2865
- if (!confirm(`Clear your ${n} helper${n === 1 ? '' : 's'}? #1 can then start any of your models again, as before.`)) return
2921
+ !HSUG && !S.helpersAuto ? h('button', { className: 'small', title: working() ? `suggest helpers from the ${working()} models that answered their test (their provider switched on), each with what it's good at that it doesn't have yet (from the rankings, its test, thinking and context): marked dashed in the Helper column, to take or not; the list isn't filtered` : 'suggest helpers: the models are tested first (helpers are picked from the ones that answer)', onclick: (e) => (working() ? suggestNow(e.currentTarget) : testFirst('suggest')), 'aria-label': 'Suggest helpers' }, ic('sparkles'), h('span', { className: 'lt', textContent: 'Suggest helpers' })) : null,
2922
+ !HSUG && n ? h('button', { className: 'small ghost', 'aria-label': 'Clear helpers', title: `Clear helpers: no model a helper (${n} now): #1 can then start any model again, as before`, onclick: (e) => {
2923
+ if (!confirm(`Clear the ${n} helper${n === 1 ? '' : 's'}? #1 can then start any model again, as before.`)) return
2866
2924
  busy(e.currentTarget)
2867
- saveHelpers({}, [], 'no helpers: #1 can start any of your models again').then(() => (FILTER.helpers ? setFilter({ helpers: false }) : drawMine(S))) // no helpers left to show only
2868
- } }) : null)
2925
+ saveHelpers({}, [], 'no helpers: #1 can start any model again').then(() => drawMine(S))
2926
+ } }, ic('x'), h('span', { className: 'lt', textContent: 'Clear helpers' })) : null)
2869
2927
  return helperBar
2870
2928
  }
2871
2929
 
@@ -2878,12 +2936,12 @@ function tableRow(t, at, pick) {
2878
2936
  // where what it can do comes from, when that's worth a look: not known to models.dev (a guess), or set by you
2879
2937
  const tag = !x ? h('span', { className: 'tag', textContent: '…', title: 'looking it up in models.dev' })
2880
2938
  : x.source === 'assumed' ? h('button', { type: 'button', className: 'tag warn', textContent: 'unknown', title: "models.dev doesn't know it: what it can do is a guess. Click to set it up", onclick: () => openSetup(t) })
2881
- : Object.keys(x.set ?? {}).length ? h('button', { type: 'button', className: 'tag', textContent: 'edited', title: 'what it can do: set by you (click to change)', onclick: () => openSetup(t) }) : null
2939
+ : Object.keys(x.set ?? {}).length ? h('button', { type: 'button', className: 'tag', textContent: 'edited', title: 'what it can do: set by hand (click to change)', onclick: () => openSetup(t) }) : null
2882
2940
  const busy = locked()
2883
2941
  return h('li', { className: 'in' + (picked ? ' picked' : '') + (isOff(t.provider) ? ' off' : ''), 'data-key': `${t.provider}/${t.model}`, title: isOff(t.provider) ? `${t.provider} is switched off: HeartCode skips this model until it's on` : '' },
2884
2942
  h('span', { className: 'grip', textContent: '⋮⋮', 'aria-hidden': 'true' }),
2885
2943
  h('input', { type: 'checkbox', checked: picked, disabled: busy, 'aria-label': `select ${t.model}`, title: 'select (Shift: and every row up to the last one selected)', onclick: (e) => (e.preventDefault(), pick(e)) }),
2886
- h('span', { className: 'n', textContent: `#${at + 1}`, title: SORT.length || filtering() ? 'its place in your list' : '' }),
2944
+ h('span', { className: 'n', textContent: `#${at + 1}`, title: SORT.length || filtering() ? 'its place in the list' : '' }),
2887
2945
  h('span', { className: 'm' }, h('span', { className: 'name', textContent: t.model, title: t.model }), tag),
2888
2946
  h('span', { className: 'p', textContent: isOff(t.provider) ? `${t.provider} · off` : t.provider, title: t.provider }),
2889
2947
  helperCell(t, at),
@@ -2896,7 +2954,7 @@ function tableRow(t, at, pick) {
2896
2954
  h('button', { type: 'button', className: 'small ghost ib k-test row-test', disabled: going || busy, title: going ? 'testing…' : 'Test: send it a short message to see that it really answers', 'aria-label': `test ${t.model}`, onclick: () => tryModel(t) }, ic(going ? 'clock' : 'play')),
2897
2955
  h('button', { type: 'button', className: 'small ghost ib k-info', title: 'Request: send it "Hello" and see exactly what was sent and what came back', 'aria-label': `raw request to ${t.model}`, onclick: () => hello(t.provider, t.model) }, ic('eye')),
2898
2956
  h('button', { type: 'button', className: 'small ghost ib k-edit', disabled: busy, title: 'Edit what it can do: context, tool calls, thinking, images (or look it up in models.dev again)', 'aria-label': `edit ${t.model}`, onclick: () => openSetup(t) }, ic('pencil')),
2899
- h('button', { type: 'button', className: 'small ghost ib k-del', disabled: busy, title: 'Remove it from your list (it stays under its provider)', 'aria-label': `remove ${t.model}`, onclick: () => removeMine(t.provider, t.model) }, ic('trash'))))
2957
+ h('button', { type: 'button', className: 'small ghost ib k-del', disabled: busy, title: 'Remove it from the list (it stays under its provider)', 'aria-label': `remove ${t.model}`, onclick: () => removeMine(t.provider, t.model) }, ic('trash'))))
2900
2958
  }
2901
2959
 
2902
2960
  // your list changed: the rows and counts it touches, in place
@@ -2910,7 +2968,7 @@ function markCatalog() {
2910
2968
  const n = S.order.filter((t) => t.provider === sec.dataset.provider).length
2911
2969
  const tag = sec.querySelector('.inlist')
2912
2970
  tag.hidden = !n
2913
- tag.textContent = `${n} in your list${inUse()?.provider === sec.dataset.provider ? ' · in use' : ''}`
2971
+ tag.textContent = `${n} in the list${inUse()?.provider === sec.dataset.provider ? ' · in use' : ''}`
2914
2972
  }
2915
2973
  drawPicks()
2916
2974
  }
@@ -2918,12 +2976,12 @@ function markCatalog() {
2918
2976
  function drawUsing(s) {
2919
2977
  const o = s.order.filter((t) => !isOff(t.provider))
2920
2978
  $('using').hidden = page() === 'providers' // there it's on the page itself
2921
- put($('using'), o.length ? [h('span', { className: 'k', textContent: 'HeartCode uses' }), h('b', { textContent: o[0].model }), h('span', { className: 'k', textContent: `${o[0].provider}${o.length > 1 ? ` · ${o.length - 1} fallback${o.length > 2 ? 's' : ''}` : ''}` })] : s.order.length ? [h('span', { className: 'k', textContent: 'The providers of all your models are switched off' }), h('a', { href: '#providers', textContent: 'Switch one on' })] : [h('span', { className: 'k', textContent: 'No model chosen yet' }), h('a', { href: '#providers', textContent: 'Choose one' })])
2979
+ put($('using'), o.length ? [h('span', { className: 'k', textContent: 'HeartCode uses' }), h('b', { textContent: o[0].model }), h('span', { className: 'k', textContent: `${o[0].provider}${o.length > 1 ? ` · ${o.length - 1} fallback${o.length > 2 ? 's' : ''}` : ''}` })] : s.order.length ? [h('span', { className: 'k', textContent: 'The providers of all the models are switched off' }), h('a', { href: '#providers', textContent: 'Switch one on' })] : [h('span', { className: 'k', textContent: 'No model chosen yet' }), h('a', { href: '#providers', textContent: 'Choose one' })])
2922
2980
  }
2923
2981
 
2924
2982
  // --- General ---
2925
2983
  const PERM_INFO = { all: ['Everything', 'Edits files and runs commands without asking'], commands: ['Edits only', 'Edits files; asks before running commands'], ask: ['Ask first', 'Asks before every edit and command'] }
2926
- const THEME_INFO = { dark: ["Your terminal's background", ['#1f2328', '#d4d4d8', '#ff6b9d', '#7aa2f7']], light: ['White background', ['#fafbfc', '#24292f', '#d6336c', '#0969da']], midnight: ['Deep blue background', ['#1a1b26', '#c0caf5', '#ff7ab2', '#7aa2f7']], mono: ['No colors: bold and dim', ['#000000', '#bbbbbb', '#ffffff', '#777777']] }
2984
+ const THEME_INFO = { dark: ["The terminal's background", ['#1f2328', '#d4d4d8', '#ff6b9d', '#7aa2f7']], light: ['White background', ['#fafbfc', '#24292f', '#d6336c', '#0969da']], midnight: ['Deep blue background', ['#1a1b26', '#c0caf5', '#ff7ab2', '#7aa2f7']], mono: ['No colors: bold and dim', ['#000000', '#bbbbbb', '#ffffff', '#777777']] }
2927
2985
  const TOGGLE_INFO = { autoCompact: 'Compact long conversations', director: 'Let the model set things up', format: 'Format files after edits', lsp: 'Language server checks', updateCheck: 'Check for updates', mouse: 'HeartCode takes the mouse' }
2928
2986
  function choices(id, list, cur, name) {
2929
2987
  put($(id), list.map(([v, title, desc, colors]) => h('label', { className: 'choice' + (v === cur ? ' on' : '') },
@@ -2965,9 +3023,9 @@ function drawVoice(s) {
2965
3023
  put($('v-src'), h('option', { value: '', textContent: 'This machine (whisper-cli)' }), names.map((n) => h('option', { value: n, textContent: `${n} (its transcription API)` })))
2966
3024
  $('v-src').value = v.provider && names.includes(v.provider) ? v.provider : ''
2967
3025
  const remote = Boolean($('v-src').value)
2968
- $('v-src-about').textContent = remote ? 'Sent to that provider to turn into text: fast, needs its key.' : 'Runs on your computer: private, free, slower. Needs whisper-cli and a model.'
3026
+ $('v-src-about').textContent = remote ? 'Sent to that provider to turn into text: fast, needs its key.' : 'Runs on this computer: private, free, slower. Needs whisper-cli and a model.'
2969
3027
  $('v-model-about').textContent = remote ? 'Its speech-to-text model, like whisper-large-v3 (Groq) or whisper-1 (OpenAI).' : 'A whisper model file (ggml-….bin). Empty: the best one in ~/.whisper-models.'
2970
- $('v-lang-about').textContent = remote ? 'What you speak, like en or bn. Empty: worked out from what you say.' : 'What you speak, like en or bn; auto works it out. Empty: English.'
3028
+ $('v-lang-about').textContent = remote ? 'The language spoken, like en or bn. Empty: worked out from the speech.' : 'The language spoken, like en or bn; auto works it out. Empty: English.'
2971
3029
  $('v-model').placeholder = remote ? 'whisper-large-v3' : 'auto'
2972
3030
  $('v-lang').placeholder = remote ? 'auto' : 'en'
2973
3031
  for (const [id, k] of [['v-model', 'model'], ['v-lang', 'language']]) if (document.activeElement !== $(id)) $(id).value = v[k] ?? ''
@@ -2988,7 +3046,7 @@ $('v-lang').onchange = () => saveVoice('voice language saved')
2988
3046
  // is typed in its own row: a box with Test and Add while there's none (or Change was pressed), else the
2989
3047
  // address with Change, Test and Remove.
2990
3048
  const ENGINE_INFO = {
2991
- searxng: 'Your own instance: private, and no other site\'s limits. Its JSON API is used when it has it on.',
3049
+ searxng: 'A self-hosted instance: private, and no other site\'s limits. Its JSON API is used when it has it on.',
2992
3050
  searx: 'Many engines at once, through public instances from searx.space. Broad; some instances are busy.',
2993
3051
  duckduckgo: 'Broad results from its HTML page. Blocked on some networks.',
2994
3052
  mwmbl: 'An open, non-profit index of its own. Fast; smaller than the big engines.',
@@ -2996,11 +3054,11 @@ const ENGINE_INFO = {
2996
3054
  npm: 'Packages: for libraries and tools. Up to 3 results.',
2997
3055
  github: 'Repositories: for projects and examples. Up to 3 results.',
2998
3056
  }
2999
- const wsInput = h('input', { type: 'text', placeholder: 'http://192.168.1.10:8888 or https://search.example.com', spellcheck: false, autocomplete: 'off', 'aria-label': 'Your SearXNG address' })
3057
+ const wsInput = h('input', { type: 'text', placeholder: 'http://192.168.1.10:8888 or https://search.example.com', spellcheck: false, autocomplete: 'off', 'aria-label': 'SearXNG address' })
3000
3058
  let wsEditing = false
3001
3059
  const wsCancel = () => ((wsEditing = false), wsInput.blur(), drawSearch(S))
3002
3060
  const wsSave = async (url) => {
3003
- const r = await act('/api/search', { searxng: url }, url.trim() ? 'your SearXNG saved: it is asked first' : 'your SearXNG removed')
3061
+ const r = await act('/api/search', { searxng: url }, url.trim() ? 'SearXNG saved: it is asked first' : 'SearXNG removed')
3004
3062
  if (r) (wsEditing = false), wsInput.blur(), S && drawSearch(S)
3005
3063
  }
3006
3064
  const wsTest = async (url) => {
@@ -3061,9 +3119,9 @@ function drawNotify(s) {
3061
3119
  const focused = document.activeElement === $('tg-token')
3062
3120
  if (!t.connected) {
3063
3121
  put($('tg-setup'), h('ol', { className: 'tg-steps' },
3064
- h('li', {}, 'In Telegram, open ', h('a', { href: 'https://t.me/BotFather', target: '_blank', rel: 'noopener', textContent: '@BotFather' }), ', send ', h('span', { className: 'mono', textContent: '/newbot' }), ', pick a name, and copy the token it gives you.'),
3122
+ h('li', {}, 'In Telegram, open ', h('a', { href: 'https://t.me/BotFather', target: '_blank', rel: 'noopener', textContent: '@BotFather' }), ', send ', h('span', { className: 'mono', textContent: '/newbot' }), ', pick a name, and copy the token it gives.'),
3065
3123
  h('li', {}, tokenRow('Paste the token here')),
3066
- h('li', { className: t.bot ? '' : 'muted' }, t.bot ? ['Open ', h('a', { href: `https://t.me/${t.bot}`, target: '_blank', rel: 'noopener', textContent: `@${t.bot}` }), ' and press ', h('b', { textContent: 'Start' }), ' (or send it any message), then ', h('button', { className: 'small', type: 'button', textContent: 'Find my chat', onclick: () => tgConnect(true) })] : 'Then press Start in your bot, so HeartCode knows where to send.')))
3124
+ h('li', { className: t.bot ? '' : 'muted' }, t.bot ? ['Open ', h('a', { href: `https://t.me/${t.bot}`, target: '_blank', rel: 'noopener', textContent: `@${t.bot}` }), ' and press ', h('b', { textContent: 'Start' }), ' (or send it any message), then ', h('button', { className: 'small', type: 'button', textContent: 'Find the chat', onclick: () => tgConnect(true) })] : 'Then press Start in the bot, so HeartCode knows where to send.')))
3067
3125
  $('tg-token').value = typed
3068
3126
  if (focused) $('tg-token').focus()
3069
3127
  } else {
@@ -3083,13 +3141,13 @@ function drawNotify(s) {
3083
3141
  const TG_EVENT_INFO = {
3084
3142
  done: 'The task, how long it took, and the answer.',
3085
3143
  failed: 'The task and the error.',
3086
- waiting: 'The question or permission it stopped at, so you can come back and answer.',
3144
+ waiting: 'The question or permission it stopped at, to come back to and answer.',
3087
3145
  }
3088
3146
  async function tgConnect(again = false) {
3089
3147
  const token = again === true ? '' : $('tg-token')?.value.trim()
3090
3148
  const r = await act('/api/telegram/connect', { token })
3091
3149
  if (!r) return
3092
- toast(r.found ? `Connected: sending to ${r.found}` : r.telegram?.bot ? `Token works. Now press Start in @${r.telegram.bot}, then Find my chat` : 'Saved')
3150
+ toast(r.found ? `Connected: sending to ${r.found}` : r.telegram?.bot ? `Token works. Now press Start in @${r.telegram.bot}, then Find the chat` : 'Saved')
3093
3151
  }
3094
3152
 
3095
3153
  // --- Logging: the two switches, how much of each request; the requests logged (live) ---
@@ -3288,7 +3346,7 @@ async function openReq(r) {
3288
3346
  h('div', { className: 'l1', style: 'display:flex;gap:8px;align-items:center;flex-wrap:wrap' }, resultTag(d), h('b', { className: 'mono', textContent: d.model }), placeTag(d)),
3289
3347
  h('dl', { className: 'kv' },
3290
3348
  row('When', new Date(d.at).toLocaleString()), row('Provider', d.provider), row('Address', d.url),
3291
- row('Where in your list', d.of > 1 ? `#${d.place} of ${d.of}${d.place > 1 ? ' (a fallback: the ones before it failed)' : ''}` : null),
3349
+ row('Where in the list', d.of > 1 ? `#${d.place} of ${d.of}${d.place > 1 ? ' (a fallback: the ones before it failed)' : ''}` : null),
3292
3350
  row('For', d.purpose === 'test' ? 'testing the model' : d.purpose === 'btw' ? 'a /btw question' : 'the conversation'), row('Tab', d.tab),
3293
3351
  row('Took', secs(d.ms)), row('First token after', secs(d.firstTokenMs)), row('Tokens', tokensOf(d.usage)), row('Finished because', d.finishReason),
3294
3352
  row('HTTP status', d.status), row('File', `${S?.logs.requests ?? ''}/${r.run}/${r.file}`)),
@@ -3325,7 +3383,7 @@ const PROMPT_KINDS = [
3325
3383
  ['agent', 'Notes & replies', 'What HeartCode adds or answers while the model works', (p) => !p.title && p.id.startsWith('agent/') && !p.id.startsWith('agent/tool-')],
3326
3384
  ['guided', 'Guided mode', 'For models without tool calls: they write their actions as text', (p) => !p.title && p.id.startsWith('guided/')],
3327
3385
  ['compact', 'Summaries', 'Compacting a long conversation into a summary', (p) => p.id.startsWith('compact/')],
3328
- ['tests', 'Tests', 'What Test asks your models', (p) => p.id.startsWith('tests/')],
3386
+ ['tests', 'Tests', 'What Test asks the models', (p) => p.id.startsWith('tests/')],
3329
3387
  ]
3330
3388
  // a prompt's name to read: "output-cut" → "Output cut", a tool's by the tool's own name ("tool-read_file" → "read_file")
3331
3389
  const promptName = (p) => {
@@ -3347,20 +3405,20 @@ function drawPrompts(s) {
3347
3405
  const all = s.prompts.filter(is)
3348
3406
  return h('label', { className: v === promptKind && !promptQuery ? 'on' : '', title: about },
3349
3407
  h('input', { type: 'radio', name: 'r-kind', checked: v === promptKind, onchange: () => ((promptKind = v), (promptQuery = $('r-search').value = ''), (SEL.prompts = null), drawPrompts(S)) }),
3350
- t, h('span', { className: 'r-count', textContent: String(all.length) }), all.some((p) => p.changed) ? h('span', { className: 'dot', title: 'some changed by you' }) : null)
3408
+ t, h('span', { className: 'r-count', textContent: String(all.length) }), all.some((p) => p.changed) ? h('span', { className: 'dot', title: 'some changed' }) : null)
3351
3409
  }))
3352
3410
  const aboutOf = (p) => promptParts(p).about || (p.id.startsWith('agent/tool-') ? `What the model is told the ${promptName(p)} tool does` : '')
3353
- const item = (p) => ({ id: p.id, title: promptName(p), sub: aboutOf(p), badge: p.changed ? h('span', { className: 'tag brand', textContent: 'yours' }) : null, p })
3411
+ const item = (p) => ({ id: p.id, title: promptName(p), sub: aboutOf(p), badge: p.changed ? h('span', { className: 'tag brand', textContent: 'changed' }) : null, p })
3354
3412
  const shown = s.prompts.filter(match)
3355
3413
  const groups = promptQuery ? PROMPT_KINDS.map(([, t, , is]) => ({ title: t, items: shown.filter(is).map(item) })) : [{ items: shown.map(item) }]
3356
3414
  masterDetail('prompts', $('r-items'), $('r-detail'), groups, (x) => {
3357
- if (!x) return h('div', { className: 'card' }, h('h2', { textContent: promptMine ? 'None changed yet' : 'No prompt matches' }), h('p', { className: 'sub', textContent: promptMine ? "You're using HeartCode's prompts as they come. Change one and save it: it shows here." : 'Try other words, or clear the search.' }))
3415
+ if (!x) return h('div', { className: 'card' }, h('h2', { textContent: promptMine ? 'None changed yet' : 'No prompt matches' }), h('p', { className: 'sub', textContent: promptMine ? "HeartCode's prompts are used as they come. A prompt changed and saved shows here." : 'Try other words, or clear the search.' }))
3358
3416
  const p = x.p
3359
3417
  const { vars } = promptParts(p)
3360
3418
  const about = aboutOf(p)
3361
3419
  const kind = kindOf(p)
3362
3420
  const ta = editor('prompts', p.id, p.text)
3363
- const undo = h('button', { className: 'ghost', textContent: 'Undo my changes', onclick: () => (saved('prompts', p.id), drawPrompts(S)) })
3421
+ const undo = h('button', { className: 'ghost', textContent: 'Undo the changes', onclick: () => (saved('prompts', p.id), drawPrompts(S)) })
3364
3422
  const unsaved = h('span', { className: 'tag need', textContent: 'not saved' })
3365
3423
  const dirty = () => {
3366
3424
  const changed = DRAFTS.prompts[p.id] !== undefined
@@ -3383,9 +3441,9 @@ function drawPrompts(s) {
3383
3441
  h('div', { className: 'k-head' },
3384
3442
  h('h2', { textContent: promptName(p) }),
3385
3443
  h('span', { className: 'tag brand', textContent: kind?.[1] ?? '' }),
3386
- h('span', { className: 'tag', textContent: p.changed ? 'yours' : "HeartCode's" }),
3444
+ h('span', { className: 'tag', textContent: p.changed ? 'changed' : "HeartCode's" }),
3387
3445
  unsaved),
3388
- h('div', { className: 'k-path mono', textContent: p.changed ? `${p.id} · yours in ${s.home}/prompts/${p.id.split('/')[0]}.md` : p.id }),
3446
+ h('div', { className: 'k-path mono', textContent: p.changed ? `${p.id} · changed, in ${s.home}/prompts/${p.id.split('/')[0]}.md` : p.id }),
3389
3447
  about ? [h('label', { className: 'f', textContent: 'What it is' }), h('p', { className: 'r-about', textContent: about })] : null,
3390
3448
  vars.length ? [h('label', { className: 'f', textContent: 'Placeholders' }),
3391
3449
  h('div', { className: 'r-vars', onmouseleave: () => (hint.textContent = HINT) }, vars.map(({ v, text }) => h('button', { className: 'r-var mono', textContent: `{{${v}}}`, 'aria-label': `Put {{${v}}} in the prompt${text ? `: ${text}` : ''}`, onmouseenter: () => show(v, text), onfocus: () => show(v, text), onclick: () => insert(v) }))),
@@ -3396,7 +3454,7 @@ function drawPrompts(s) {
3396
3454
  h('button', { className: 'primary', textContent: 'Save', onclick: () => saveItem('prompts', p.id, '/api/prompt', { id: p.id, text: ta.value }, 'saved: used from the next message') }),
3397
3455
  undo,
3398
3456
  h('span', { className: 'spacer' }),
3399
- p.changed ? h('button', { textContent: "Reset to HeartCode's", onclick: () => confirm("Put HeartCode's prompt back? Yours is deleted.") && saveItem('prompts', p.id, '/api/prompt', { id: p.id, text: null }, "HeartCode's prompt again") }) : null))
3457
+ p.changed ? h('button', { textContent: "Reset to HeartCode's", onclick: () => confirm("Put HeartCode's prompt back? The changed one is deleted.") && saveItem('prompts', p.id, '/api/prompt', { id: p.id, text: null }, "HeartCode's prompt again") }) : null))
3400
3458
  }, { tabs: false })
3401
3459
  }
3402
3460
 
@@ -3429,7 +3487,7 @@ function drawMcp(s) {
3429
3487
  put($('c-list'), h('h2', { textContent: 'Servers' }), h('p', { className: 'sub', textContent: 'Remote ones (a URL) may need signing in; local ones don\'t. Tick a flag off to start it without that flag; switch a server off to keep it without using it.' }),
3430
3488
  s.mcp.length ? s.mcp.map((m) => h('div', { className: 'opt mcp-row' },
3431
3489
  tile(m.remote ? 'globe' : m.name.includes('chrome') || m.name.includes('browser') ? 'globe' : m.name.includes('computer') ? 'cpu' : 'plug', m.on ? 'teal' : 'gray'),
3432
- h('div', { className: 't' }, h('b', {}, m.name, ' ', h('span', { className: 'tag', textContent: m.from }), m.remote ? authTag(m.auth) : null), m.description ? h('span', { textContent: m.description }) : null, h('div', { className: 'mono muted', style: 'word-break:break-all;margin-top:3px', textContent: m.what }), m.from === 'yours' && !m.remote ? mcpFlags(m) : null),
3490
+ h('div', { className: 't' }, h('b', {}, m.name, ' ', h('span', { className: 'tag', textContent: m.from === 'yours' ? 'custom' : m.from }), m.remote ? authTag(m.auth) : null), m.description ? h('span', { textContent: m.description }) : null, h('div', { className: 'mono muted', style: 'word-break:break-all;margin-top:3px', textContent: m.what }), m.from === 'yours' && !m.remote ? mcpFlags(m) : null),
3433
3491
  m.remote ? h('button', { className: 'small', textContent: m.auth === 'in' ? 'Sign in again' : 'Sign in', onclick: () => act('/api/mcp/login', { name: m.name }, `signed in to ${m.name}`) }) : null,
3434
3492
  m.from === 'yours' ? h('button', { className: 'small danger', textContent: 'Remove', onclick: () => confirm(`Remove the MCP server ${m.name}?`) && act('/api/mcp/remove', { name: m.name }, `removed ${m.name}`) }) : null,
3435
3493
  sw({ checked: m.on, 'aria-label': `${m.name} on`, onchange: (e) => act('/api/mcp/toggle', { name: m.name, on: e.target.checked }, `${m.name}: ${e.target.checked ? 'on' : 'off'}`) }))) : h('div', { className: 'empty', textContent: 'No MCP servers.' }))
@@ -3440,8 +3498,8 @@ function drawMcp(s) {
3440
3498
  }
3441
3499
 
3442
3500
  // --- skills: a form (name, who uses it, what it's for, the prompt); SKILL.md is made from it ---
3443
- const USES = [['both', 'You and the model', 'type /skill:name, or the model uses it when it fits'], ['me', 'Only you', 'only when you type /skill:name'], ['model', 'Only the model', "when it fits; you don't type it"], ['always', 'Always on', 'in every message: how to work, not a task']]
3444
- const USE_TAG = { both: 'you + model', me: 'only you', model: 'model', always: 'always on' } // who uses it, in a word or two (the list and the panel)
3501
+ const USES = [['both', 'Typed or the model', 'typed as /skill:name, or used by the model when it fits'], ['me', 'Only typed', 'only when typed as /skill:name'], ['model', 'Only the model', 'when it fits; not typed'], ['always', 'Always on', 'in every message: how to work, not a task']]
3502
+ const USE_TAG = { both: 'typed + model', me: 'typed only', model: 'model', always: 'always on' } // who uses it, in a word or two (the list and the panel)
3445
3503
  function parseSkill(text) {
3446
3504
  const m = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/.exec(text)
3447
3505
  const out = { description: '', use: 'both', extra: [], body: (m ? m[2] : text).replace(/^\s*\n/, '') }
@@ -3458,8 +3516,8 @@ const NEW = { name: '', description: '', use: 'both', extra: [], body: '' }
3458
3516
  function newSkill() {
3459
3517
  const f = skillForm('+new', NEW, { isNew: true })
3460
3518
  const first = !S.skills.length
3461
- put($('k-form'), h('h2', { id: 'k-title', textContent: first ? 'Make your first skill' : 'New skill' }),
3462
- first ? h('p', { className: 'sub', textContent: 'A skill is a prompt you use again and again, like "review this" or "write the release notes". Skills from Claude Code and others: /import in HeartCode.' }) : null,
3519
+ put($('k-form'), h('h2', { id: 'k-title', textContent: first ? 'Make the first skill' : 'New skill' }),
3520
+ first ? h('p', { className: 'sub', textContent: 'A skill is a prompt used again and again, like "review this" or "write the release notes". Skills from Claude Code and others: /import in HeartCode.' }) : null,
3463
3521
  f.el,
3464
3522
  h('div', { className: 'actions' },
3465
3523
  h('button', { textContent: 'Cancel', onclick: () => $('k-form').close() }),
@@ -3485,10 +3543,10 @@ function skillForm(id, start, { isNew, readOnly }) {
3485
3543
  const uses = h('div', {}, h('div', { className: 'seg', role: 'radiogroup', 'aria-label': 'Who uses it' }, USES.map(([v, t, sub]) => h('label', { className: d.use === v ? 'on' : '', title: sub },
3486
3544
  h('input', { type: 'radio', name: `use-${id}`, checked: d.use === v, disabled: readOnly, onchange: () => ((d.use = v), touch(), (useAbout.textContent = sub), uses.querySelectorAll('.seg label').forEach((c) => c.classList.toggle('on', c.querySelector('input').checked))) }),
3487
3545
  t))), useAbout)
3488
- const body = grow(h('textarea', { className: 'editor', spellcheck: false, readOnly, value: d.body, placeholder: 'What the model should do. $ARGUMENTS is what you type after /skill:name: "/skill:review the login page" gives "the login page".', oninput: (e) => ((d.body = e.target.value), touch()) }), 220)
3546
+ const body = grow(h('textarea', { className: 'editor', spellcheck: false, readOnly, value: d.body, placeholder: 'What the model should do. $ARGUMENTS is the text typed after /skill:name: "/skill:review the login page" gives "the login page".', oninput: (e) => ((d.body = e.target.value), touch()) }), 220)
3489
3547
  return { d, el: [
3490
3548
  h('div', { className: 'row' },
3491
- isNew ? h('div', { className: 'grow' }, h('label', { className: 'f', textContent: "Name: you'll type /skill:name" }), field('name', { placeholder: 'review' })) : null,
3549
+ isNew ? h('div', { className: 'grow' }, h('label', { className: 'f', textContent: 'Name: typed as /skill:name' }), field('name', { placeholder: 'review' })) : null,
3492
3550
  h('div', { className: 'grow', style: 'flex:3' }, h('label', { className: 'f', textContent: 'What it does (the model reads this to know when to use it)' }), about)),
3493
3551
  h('label', { className: 'f', textContent: 'Who uses it' }), uses,
3494
3552
  h('label', { className: 'f', textContent: 'The prompt' }), body,
@@ -3554,8 +3612,8 @@ function drawSkills(s) {
3554
3612
  if (e.key === 'Enter') install()
3555
3613
  }
3556
3614
  $('k-import').onclick = openImport
3557
- masterDetail('skills', $('k-items'), $('k-detail'), [{ title: mine.length && theirs.length ? 'Yours' : '', items: mine.map(item) }, { title: 'From projects', items: theirs.map(item) }], (x) => {
3558
- if (!x) return h('div', { className: 'card' }, h('h2', { textContent: 'No skills yet' }), h('p', { className: 'sub', textContent: 'A skill is a prompt you use again and again, like "review this" or "write the release notes". Make one with + New skill, install one above, or bring them from Claude Code and others with Import from other tools.' }))
3615
+ masterDetail('skills', $('k-items'), $('k-detail'), [{ title: mine.length && theirs.length ? 'Custom' : '', items: mine.map(item) }, { title: 'From projects', items: theirs.map(item) }], (x) => {
3616
+ if (!x) return h('div', { className: 'card' }, h('h2', { textContent: 'No skills yet' }), h('p', { className: 'sub', textContent: 'A skill is a prompt used again and again, like "review this" or "write the release notes". Make one with + New skill, install one above, or bring them from Claude Code and others with Import from other tools.' }))
3559
3617
  const k = x.k
3560
3618
  const f = skillForm(k.name, parseSkill(k.text), { readOnly: !k.mine })
3561
3619
  const files = k.files ?? []
@@ -3563,7 +3621,7 @@ function drawSkills(s) {
3563
3621
  h('div', { className: 'k-head' },
3564
3622
  h('h2', { className: 'mono', textContent: '/skill:' + k.name }),
3565
3623
  h('span', { className: 'tag brand', textContent: USE_TAG[k.use] ?? k.use, title: (USES.find(([v]) => v === k.use) ?? [])[2] ?? '' }),
3566
- h('span', { className: 'tag', textContent: k.mine ? 'yours' : 'from a project: read only' }),
3624
+ h('span', { className: 'tag', textContent: k.mine ? 'custom' : 'from a project: read only' }),
3567
3625
  files.length ? h('span', { className: 'tag', textContent: `${files.length} file${files.length === 1 ? '' : 's'}` }) : null),
3568
3626
  h('div', { className: 'k-path mono', textContent: k.path ?? '' }),
3569
3627
  f.el,
@@ -3723,7 +3781,7 @@ function render(s) {
3723
3781
  // server can be older than a change made here a moment ago)
3724
3782
  if (!filtersLoaded) SORT = Array.isArray(p.sorts) ? p.sorts.filter((x) => COLS[x?.key]) : Array.isArray(p.sort) ? p.sort.filter((x) => COLS[x?.key]).map(flip) : []
3725
3783
  RANK = Array.isArray(p.rank) ? p.rank.filter((x) => typeof x === 'string') : []
3726
- if (!filtersLoaded) (filtersLoaded = true), (FILTER = { ...NO_FILTER, ...(p.filters && typeof p.filters === 'object' ? p.filters : {}) }) // after that the page's own are the latest
3784
+ if (!filtersLoaded) (filtersLoaded = true), (FILTER = { ...NO_FILTER, ...Object.fromEntries(Object.entries(p.filters && typeof p.filters === 'object' ? p.filters : {}).filter(([k]) => k in NO_FILTER)) }) // after that the page's own are the latest (a filter that's gone, like the old Helpers one, isn't kept)
3727
3785
  }
3728
3786
  S = s
3729
3787
  for (const [key, r] of Object.entries(TRIES)) if (!r.going && placeOf(...key.split(/\/(.*)/s)) === undefined) delete TRIES[key] // off your list: its result too
@@ -3746,7 +3804,7 @@ showPage()
3746
3804
  drawPresets()
3747
3805
  if (!token) put($('page-providers'), h('h1', { textContent: 'Open the link HeartCode printed' }), h('p', { className: 'lead', textContent: 'It has the key to this page: /settings in HeartCode, or heart settings.' }))
3748
3806
  else {
3749
- job('state', { where: ['page'], what: 'Loading your settings', detail: 'providers, models, logging, prompts, MCP servers, skills' })
3807
+ job('state', { where: ['page'], what: 'Loading the settings', detail: 'providers, models, logging, prompts, MCP servers, skills' })
3750
3808
  api('/api/state').then(render, (e) => toast(e.message, true)).finally(() => job('state'))
3751
3809
  .then(() => api('/api/tests', {}))
3752
3810
  .then(({ results, run }) => (Object.assign(TRIES, results), showRun(run)))