free-coding-models 0.5.57 → 0.5.59

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.
@@ -48,8 +48,8 @@
48
48
  <link rel="preconnect" href="https://fonts.googleapis.com">
49
49
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
50
50
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
51
- <script type="module" crossorigin src="/assets/index-BoJ4r2gC.js"></script>
52
- <link rel="stylesheet" crossorigin href="/assets/index-BkK1gdJN.css">
51
+ <script type="module" crossorigin src="/assets/index-C_ZdUGrS.js"></script>
52
+ <link rel="stylesheet" crossorigin href="/assets/index-wI9xrm0w.css">
53
53
  </head>
54
54
  <body>
55
55
  <div id="root"></div>
@@ -1015,6 +1015,40 @@ export default function RouterView({ onClose, onToast, favorites }) {
1015
1015
  </div>
1016
1016
  )}
1017
1017
 
1018
+ {/* Passive quota (t2): per-provider live quota from response headers.
1019
+ 📖 Updated every /stats poll (5s). See provider-quota-fetchers.js. */}
1020
+ {stats?.quota && Object.keys(stats.quota).length > 0 && (
1021
+ <div className={styles.section} style={{ marginTop: 12 }}>
1022
+ <h3 className={styles.sectionTitle}>
1023
+ 📊 Provider Quota
1024
+ <span className={styles.miniPgHint}>live from response headers (no extra requests)</span>
1025
+ </h3>
1026
+ <div className={styles.quotaGrid}>
1027
+ {Object.entries(stats.quota)
1028
+ .sort((a, b) => (a[1]?.percent ?? 100) - (b[1]?.percent ?? 100))
1029
+ .map(([providerKey, snap]) => {
1030
+ const pct = snap?.percent ?? 0
1031
+ const color = pct <= 10 ? '#dc2626' : pct <= 25 ? '#f59e0b' : '#16a34a'
1032
+ const window = snap?.windowType && snap.windowType !== 'unknown' ? snap.windowType : ''
1033
+ const source = snap?.source === 'header' ? '🛰️' : '🔌'
1034
+ return (
1035
+ <div key={providerKey} className={styles.quotaCell} title={`${providerKey}: ${snap?.remaining ?? '?'}/${snap?.limit ?? '?'} (${pct}%) ${window ? `[${window}]` : ''}`}>
1036
+ <span className={styles.quotaSource}>{source}</span>
1037
+ <span className={styles.quotaName}>{providerKey}</span>
1038
+ <div className={styles.quotaBar}>
1039
+ <div
1040
+ className={styles.quotaFill}
1041
+ style={{ width: `${pct}%`, background: color }}
1042
+ />
1043
+ </div>
1044
+ <span className={styles.quotaPct} style={{ color }}>{pct}%</span>
1045
+ </div>
1046
+ )
1047
+ })}
1048
+ </div>
1049
+ </div>
1050
+ )}
1051
+
1018
1052
  {/* Server health (small chip at the bottom for visibility) */}
1019
1053
  <div className={styles.section} style={{ marginBottom: 0, marginTop: 16 }}>
1020
1054
  <span className={styles.saveStatus}>
@@ -1124,4 +1124,57 @@
1124
1124
  .miniPgStopBtn {
1125
1125
  background: var(--error, #ff5a5a);
1126
1126
  color: #fff;
1127
+ }
1128
+
1129
+ /* ── Passive quota (t2) ───────────────────────────────────────────────── */
1130
+
1131
+ .quotaGrid {
1132
+ display: grid;
1133
+ grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
1134
+ gap: 8px;
1135
+ margin-top: 8px;
1136
+ }
1137
+
1138
+ .quotaCell {
1139
+ display: grid;
1140
+ grid-template-columns: 18px 1fr auto;
1141
+ align-items: center;
1142
+ gap: 4px 8px;
1143
+ padding: 6px 10px;
1144
+ border-radius: 6px;
1145
+ background: rgba(255, 255, 255, 0.04);
1146
+ border: 1px solid rgba(255, 255, 255, 0.08);
1147
+ }
1148
+
1149
+ .quotaSource {
1150
+ font-size: 14px;
1151
+ text-align: center;
1152
+ }
1153
+
1154
+ .quotaName {
1155
+ font-size: 12px;
1156
+ font-weight: 600;
1157
+ opacity: 0.9;
1158
+ text-transform: lowercase;
1159
+ font-family: var(--mono, ui-monospace, SFMono-Regular, monospace);
1160
+ }
1161
+
1162
+ .quotaBar {
1163
+ grid-column: 1 / -1;
1164
+ height: 4px;
1165
+ background: rgba(255, 255, 255, 0.08);
1166
+ border-radius: 2px;
1167
+ overflow: hidden;
1168
+ }
1169
+
1170
+ .quotaFill {
1171
+ height: 100%;
1172
+ transition: width 0.4s ease-out;
1173
+ }
1174
+
1175
+ .quotaPct {
1176
+ font-size: 12px;
1177
+ font-weight: 700;
1178
+ font-variant-numeric: tabular-nums;
1179
+ text-align: right;
1127
1180
  }