codex-token-tracker-nodejs16 0.2.1

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.
@@ -0,0 +1,674 @@
1
+ :root {
2
+ color-scheme: light dark;
3
+ --bg: #ffffff;
4
+ --card: #fafafa;
5
+ --card-hover: #f4f4f5;
6
+ --border: #e5e5e5;
7
+ --text: #0b0b0b;
8
+ --text-2: #52514e;
9
+ --muted: #898781;
10
+ --accent: #6366f1;
11
+ --accent-soft: rgba(99, 102, 241, 0.12);
12
+ --good: #0ca30c;
13
+ --warning: #fab219;
14
+ --serious: #ec835a;
15
+ --critical: #d03b3b;
16
+ --track: #ececec;
17
+ --shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
18
+ --radius: 10px;
19
+ --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
20
+ --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
21
+ }
22
+
23
+ @media (prefers-color-scheme: dark) {
24
+ :root {
25
+ --bg: #141416;
26
+ --card: #1c1c1f;
27
+ --card-hover: #232327;
28
+ --border: #2a2a2e;
29
+ --text: #f5f5f4;
30
+ --text-2: #c3c2b7;
31
+ --muted: #898781;
32
+ --accent: #7c7ff5;
33
+ --accent-soft: rgba(124, 127, 245, 0.16);
34
+ --track: #2c2c30;
35
+ --shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
36
+ }
37
+ }
38
+
39
+ * {
40
+ box-sizing: border-box;
41
+ }
42
+
43
+ html,
44
+ body {
45
+ margin: 0;
46
+ padding: 0;
47
+ background: var(--bg);
48
+ color: var(--text);
49
+ font-family: var(--font);
50
+ font-size: 12.5px;
51
+ line-height: 1.4;
52
+ -webkit-font-smoothing: antialiased;
53
+ user-select: none;
54
+ overflow: hidden;
55
+ }
56
+
57
+ #root {
58
+ height: 100vh;
59
+ display: flex;
60
+ flex-direction: column;
61
+ }
62
+
63
+ .app {
64
+ height: 100%;
65
+ display: flex;
66
+ flex-direction: column;
67
+ }
68
+
69
+ .scroll {
70
+ flex: 1;
71
+ overflow-y: auto;
72
+ padding: 10px 12px 12px;
73
+ display: flex;
74
+ flex-direction: column;
75
+ gap: 10px;
76
+ }
77
+
78
+ .scroll::-webkit-scrollbar {
79
+ width: 6px;
80
+ }
81
+ .scroll::-webkit-scrollbar-thumb {
82
+ background: var(--border);
83
+ border-radius: 3px;
84
+ }
85
+
86
+ /* header */
87
+ .header {
88
+ display: flex;
89
+ align-items: center;
90
+ gap: 8px;
91
+ padding: 10px 12px 8px;
92
+ border-bottom: 1px solid var(--border);
93
+ -webkit-app-region: drag;
94
+ }
95
+ .header button,
96
+ .header .pill {
97
+ -webkit-app-region: no-drag;
98
+ }
99
+ .brand {
100
+ display: flex;
101
+ align-items: center;
102
+ gap: 8px;
103
+ font-weight: 600;
104
+ font-size: 13px;
105
+ }
106
+ .brand .logo {
107
+ width: 18px;
108
+ height: 18px;
109
+ border-radius: 5px;
110
+ background: var(--accent);
111
+ display: grid;
112
+ place-items: center;
113
+ }
114
+ .brand .logo svg {
115
+ width: 11px;
116
+ height: 11px;
117
+ }
118
+ .spacer {
119
+ flex: 1;
120
+ }
121
+ .pill {
122
+ display: inline-flex;
123
+ align-items: center;
124
+ gap: 5px;
125
+ padding: 2px 8px;
126
+ border-radius: 999px;
127
+ border: 1px solid var(--border);
128
+ background: var(--card);
129
+ color: var(--text-2);
130
+ font-size: 11px;
131
+ max-width: 150px;
132
+ white-space: nowrap;
133
+ overflow: hidden;
134
+ text-overflow: ellipsis;
135
+ }
136
+ .pill.live::before {
137
+ content: "";
138
+ width: 6px;
139
+ height: 6px;
140
+ border-radius: 50%;
141
+ background: var(--good);
142
+ box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.5);
143
+ animation: pulse 1.6s infinite;
144
+ }
145
+ @keyframes pulse {
146
+ 0% {
147
+ box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.45);
148
+ }
149
+ 70% {
150
+ box-shadow: 0 0 0 6px rgba(12, 163, 12, 0);
151
+ }
152
+ 100% {
153
+ box-shadow: 0 0 0 0 rgba(12, 163, 12, 0);
154
+ }
155
+ }
156
+
157
+ /* buttons */
158
+ button {
159
+ font: inherit;
160
+ color: inherit;
161
+ cursor: pointer;
162
+ border: 1px solid var(--border);
163
+ background: var(--card);
164
+ border-radius: 7px;
165
+ padding: 4px 9px;
166
+ font-size: 11.5px;
167
+ transition: background 0.12s;
168
+ }
169
+ button:hover {
170
+ background: var(--card-hover);
171
+ }
172
+ button.primary {
173
+ background: var(--accent);
174
+ border-color: var(--accent);
175
+ color: #fff;
176
+ }
177
+ button.primary:hover {
178
+ filter: brightness(1.08);
179
+ }
180
+ button.ghost {
181
+ border-color: transparent;
182
+ background: transparent;
183
+ color: var(--text-2);
184
+ padding: 3px 6px;
185
+ }
186
+ button.ghost:hover {
187
+ background: var(--card-hover);
188
+ color: var(--text);
189
+ }
190
+ .seg {
191
+ display: inline-flex;
192
+ border: 1px solid var(--border);
193
+ border-radius: 7px;
194
+ overflow: hidden;
195
+ }
196
+ .seg button {
197
+ border: 0;
198
+ border-radius: 0;
199
+ background: transparent;
200
+ padding: 3px 8px;
201
+ color: var(--text-2);
202
+ }
203
+ .seg button.active {
204
+ background: var(--accent-soft);
205
+ color: var(--accent);
206
+ font-weight: 600;
207
+ }
208
+
209
+ /* cards */
210
+ .card {
211
+ background: var(--card);
212
+ border: 1px solid var(--border);
213
+ border-radius: var(--radius);
214
+ padding: 10px 12px;
215
+ position: relative;
216
+ }
217
+ .card-title {
218
+ display: flex;
219
+ align-items: center;
220
+ justify-content: space-between;
221
+ font-size: 10.5px;
222
+ text-transform: uppercase;
223
+ letter-spacing: 0.06em;
224
+ color: var(--muted);
225
+ margin-bottom: 8px;
226
+ }
227
+ .card-title .hint {
228
+ text-transform: none;
229
+ letter-spacing: 0;
230
+ font-weight: 400;
231
+ }
232
+
233
+ /* KPIs */
234
+ .hero {
235
+ display: flex;
236
+ align-items: baseline;
237
+ gap: 8px;
238
+ }
239
+ .hero .value {
240
+ font-size: 30px;
241
+ font-weight: 650;
242
+ letter-spacing: -0.02em;
243
+ line-height: 1.05;
244
+ }
245
+ .hero .unit {
246
+ color: var(--muted);
247
+ font-size: 12px;
248
+ }
249
+ .kpis {
250
+ display: grid;
251
+ grid-template-columns: repeat(3, 1fr);
252
+ gap: 8px;
253
+ margin-top: 10px;
254
+ }
255
+ .kpi {
256
+ border-top: 1px solid var(--border);
257
+ padding-top: 6px;
258
+ }
259
+ .kpi .label {
260
+ color: var(--muted);
261
+ font-size: 10.5px;
262
+ }
263
+ .kpi .value {
264
+ font-size: 15px;
265
+ font-weight: 600;
266
+ font-variant-numeric: tabular-nums;
267
+ }
268
+ .breakdown {
269
+ display: flex;
270
+ gap: 10px;
271
+ margin-top: 8px;
272
+ color: var(--text-2);
273
+ font-size: 11px;
274
+ flex-wrap: wrap;
275
+ }
276
+ .breakdown b {
277
+ color: var(--text);
278
+ font-weight: 600;
279
+ font-variant-numeric: tabular-nums;
280
+ }
281
+ .remote-row {
282
+ margin-top: 8px;
283
+ padding-top: 6px;
284
+ border-top: 1px dashed var(--border);
285
+ display: flex;
286
+ justify-content: space-between;
287
+ color: var(--text-2);
288
+ font-size: 11px;
289
+ }
290
+
291
+ /* live */
292
+ .live-head {
293
+ display: flex;
294
+ align-items: center;
295
+ gap: 8px;
296
+ min-width: 0;
297
+ }
298
+ .live-head .project {
299
+ font-weight: 600;
300
+ white-space: nowrap;
301
+ overflow: hidden;
302
+ text-overflow: ellipsis;
303
+ }
304
+ .live-head .model {
305
+ color: var(--muted);
306
+ font-family: var(--mono);
307
+ font-size: 11px;
308
+ white-space: nowrap;
309
+ }
310
+ .tps {
311
+ display: flex;
312
+ align-items: baseline;
313
+ gap: 6px;
314
+ margin-top: 6px;
315
+ }
316
+ .tps .value {
317
+ font-size: 26px;
318
+ font-weight: 650;
319
+ letter-spacing: -0.02em;
320
+ font-variant-numeric: tabular-nums;
321
+ }
322
+ .tps .unit {
323
+ color: var(--muted);
324
+ }
325
+ .tps .burst {
326
+ margin-left: auto;
327
+ color: var(--text-2);
328
+ font-size: 11px;
329
+ font-variant-numeric: tabular-nums;
330
+ }
331
+ .meter {
332
+ margin-top: 8px;
333
+ }
334
+ .meter .row {
335
+ display: flex;
336
+ justify-content: space-between;
337
+ font-size: 11px;
338
+ color: var(--text-2);
339
+ margin-bottom: 3px;
340
+ }
341
+ .meter .row b {
342
+ color: var(--text);
343
+ font-weight: 600;
344
+ font-variant-numeric: tabular-nums;
345
+ }
346
+ .track {
347
+ height: 6px;
348
+ border-radius: 3px;
349
+ background: var(--track);
350
+ overflow: hidden;
351
+ }
352
+ .track .fill {
353
+ height: 100%;
354
+ border-radius: 3px;
355
+ background: var(--accent);
356
+ transition: width 0.4s ease;
357
+ }
358
+ .track .fill.warning {
359
+ background: var(--warning);
360
+ }
361
+ .track .fill.critical {
362
+ background: var(--critical);
363
+ }
364
+ .empty {
365
+ color: var(--muted);
366
+ font-size: 12px;
367
+ }
368
+
369
+ /* heatmap */
370
+ .heatmap-wrap {
371
+ position: relative;
372
+ overflow: visible;
373
+ }
374
+ .heatmap svg {
375
+ display: block;
376
+ overflow: visible;
377
+ }
378
+ .heatmap text {
379
+ fill: var(--muted);
380
+ font-size: 9px;
381
+ font-family: var(--font);
382
+ }
383
+ .heatmap rect.cell {
384
+ rx: 2px;
385
+ transition: opacity 0.1s;
386
+ }
387
+ .heatmap rect.cell:hover {
388
+ stroke: var(--text);
389
+ stroke-width: 1px;
390
+ }
391
+ .legend {
392
+ display: flex;
393
+ align-items: center;
394
+ gap: 3px;
395
+ justify-content: flex-end;
396
+ margin-top: 6px;
397
+ color: var(--muted);
398
+ font-size: 10px;
399
+ }
400
+ .legend i {
401
+ width: 10px;
402
+ height: 10px;
403
+ border-radius: 2px;
404
+ display: inline-block;
405
+ }
406
+
407
+ /* models */
408
+ .model-row {
409
+ display: grid;
410
+ grid-template-columns: 10px 1fr auto;
411
+ align-items: center;
412
+ gap: 8px;
413
+ padding: 4px 4px;
414
+ border-radius: 6px;
415
+ min-width: 0;
416
+ }
417
+ .model-row:hover {
418
+ background: var(--card-hover);
419
+ }
420
+ .model-row .swatch {
421
+ width: 10px;
422
+ height: 10px;
423
+ border-radius: 3px;
424
+ }
425
+ .model-row .name {
426
+ font-family: var(--mono);
427
+ font-size: 11px;
428
+ white-space: nowrap;
429
+ overflow: hidden;
430
+ text-overflow: ellipsis;
431
+ }
432
+ .model-row .name .est {
433
+ font-family: var(--font);
434
+ color: var(--muted);
435
+ border: 1px solid var(--border);
436
+ border-radius: 4px;
437
+ padding: 0 4px;
438
+ margin-left: 5px;
439
+ font-size: 9.5px;
440
+ }
441
+ .model-row .nums {
442
+ display: flex;
443
+ gap: 8px;
444
+ color: var(--text-2);
445
+ font-size: 11px;
446
+ font-variant-numeric: tabular-nums;
447
+ }
448
+ .model-row .nums b {
449
+ color: var(--text);
450
+ font-weight: 600;
451
+ }
452
+ .model-bar {
453
+ grid-column: 2 / span 2;
454
+ height: 4px;
455
+ border-radius: 2px;
456
+ background: var(--track);
457
+ overflow: hidden;
458
+ margin-top: -1px;
459
+ }
460
+ .model-bar i {
461
+ display: block;
462
+ height: 100%;
463
+ border-radius: 2px;
464
+ }
465
+
466
+ /* tooltip */
467
+ .tooltip {
468
+ position: fixed;
469
+ z-index: 10;
470
+ pointer-events: none;
471
+ background: var(--text);
472
+ color: var(--bg);
473
+ padding: 6px 8px;
474
+ border-radius: 6px;
475
+ font-size: 11px;
476
+ line-height: 1.35;
477
+ box-shadow: var(--shadow);
478
+ max-width: 220px;
479
+ white-space: nowrap;
480
+ }
481
+ .tooltip b {
482
+ font-weight: 600;
483
+ }
484
+
485
+ /* auth */
486
+ .auth-box {
487
+ display: flex;
488
+ flex-direction: column;
489
+ gap: 6px;
490
+ }
491
+ .code {
492
+ font-family: var(--mono);
493
+ font-size: 18px;
494
+ letter-spacing: 0.12em;
495
+ font-weight: 600;
496
+ text-align: center;
497
+ padding: 6px;
498
+ border: 1px dashed var(--border);
499
+ border-radius: 8px;
500
+ background: var(--bg);
501
+ }
502
+ .error {
503
+ color: var(--critical);
504
+ font-size: 11px;
505
+ }
506
+ .row {
507
+ display: flex;
508
+ align-items: center;
509
+ gap: 6px;
510
+ }
511
+
512
+ /* footer */
513
+ .footer {
514
+ border-top: 1px solid var(--border);
515
+ padding: 7px 12px;
516
+ display: flex;
517
+ align-items: center;
518
+ gap: 8px;
519
+ color: var(--muted);
520
+ font-size: 10.5px;
521
+ }
522
+ .footer .status {
523
+ white-space: nowrap;
524
+ overflow: hidden;
525
+ text-overflow: ellipsis;
526
+ }
527
+ .footer .status.err {
528
+ color: var(--critical);
529
+ }
530
+
531
+ /* --- sources / agents / live limits --- */
532
+ .chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
533
+ .chips-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-right: 2px; }
534
+ .chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); display: inline-flex; gap: 5px; align-items: center; background: var(--surface-2, transparent); }
535
+ .chip b { color: var(--text); font-weight: 600; }
536
+ .tag { font-size: 10px; line-height: 14px; padding: 0 6px; border-radius: 6px; background: rgba(99, 102, 241, 0.14); color: #6366f1; margin-left: 6px; text-transform: lowercase; vertical-align: middle; white-space: nowrap; }
537
+ .badge-err { font-size: 10px; line-height: 14px; padding: 0 6px; border-radius: 6px; background: rgba(208, 59, 59, 0.15); color: #d03b3b; margin-left: 6px; vertical-align: middle; }
538
+ .limits-extra { margin-top: 10px; font-size: 11px; color: var(--muted); }
539
+ .limits-extra .row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
540
+ .limits-extra .row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
541
+ .limits-extra .row b { color: var(--text); font-weight: 500; white-space: nowrap; }
542
+ .source-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 10px; }
543
+ .source-line .dot { width: 6px; height: 6px; border-radius: 50%; background: #0ca30c; flex: none; }
544
+ .source-line.stale .dot { background: #fab219; }
545
+ .source-line .err-hint { color: #d03b3b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
546
+
547
+ /* --- update banner --- */
548
+ .update-bar {
549
+ display: flex;
550
+ align-items: center;
551
+ gap: 8px;
552
+ margin: 10px 12px 0;
553
+ padding: 8px 10px;
554
+ border: 1px solid var(--border);
555
+ border-radius: 8px;
556
+ background: rgba(99, 102, 241, 0.09);
557
+ font-size: 11px;
558
+ color: var(--text);
559
+ }
560
+ .update-bar .msg {
561
+ flex: 1;
562
+ min-width: 0;
563
+ overflow: hidden;
564
+ text-overflow: ellipsis;
565
+ white-space: nowrap;
566
+ }
567
+ .update-bar.failed { background: rgba(208, 59, 59, 0.1); }
568
+ .update-bar.done { background: rgba(12, 163, 12, 0.1); }
569
+ .update-bar button { flex: none; }
570
+ .update-bar .cmd {
571
+ font-family: var(--mono);
572
+ font-size: 10px;
573
+ color: var(--muted);
574
+ user-select: text;
575
+ }
576
+
577
+ /* --- full sync --- */
578
+ button.icon-btn {
579
+ display: inline-flex;
580
+ align-items: center;
581
+ justify-content: center;
582
+ padding: 3px;
583
+ border-radius: 6px;
584
+ color: var(--muted);
585
+ }
586
+ button.icon-btn:hover:not(:disabled) {
587
+ color: var(--text);
588
+ }
589
+ button:disabled {
590
+ cursor: default;
591
+ opacity: 0.6;
592
+ }
593
+ .sync-icon {
594
+ width: 13px;
595
+ height: 13px;
596
+ flex: none;
597
+ }
598
+ .sync-icon.spinning {
599
+ animation: sync-spin 0.9s linear infinite;
600
+ color: var(--accent);
601
+ }
602
+ @keyframes sync-spin {
603
+ to {
604
+ transform: rotate(360deg);
605
+ }
606
+ }
607
+ @media (prefers-reduced-motion: reduce) {
608
+ .sync-icon.spinning {
609
+ animation-duration: 2.4s;
610
+ }
611
+ }
612
+ .sync-bar {
613
+ display: flex;
614
+ align-items: center;
615
+ gap: 8px;
616
+ margin: 10px 12px 0;
617
+ padding: 8px 10px;
618
+ border: 1px solid var(--border);
619
+ border-radius: 8px;
620
+ background: var(--accent-soft);
621
+ font-size: 11px;
622
+ color: var(--text);
623
+ }
624
+ .sync-bar .msg {
625
+ flex: 1;
626
+ min-width: 0;
627
+ overflow: hidden;
628
+ text-overflow: ellipsis;
629
+ white-space: nowrap;
630
+ }
631
+ .sync-bar.done { background: rgba(12, 163, 12, 0.1); }
632
+ .sync-bar.failed { background: rgba(208, 59, 59, 0.1); color: var(--critical); }
633
+ /* the result lists every agent it found — let it wrap onto a second line rather than truncate */
634
+ .sync-bar.done .msg,
635
+ .sync-bar.failed .msg {
636
+ white-space: normal;
637
+ overflow: visible;
638
+ }
639
+ .sync-row {
640
+ margin-top: 8px;
641
+ padding-top: 8px;
642
+ border-top: 1px solid var(--border);
643
+ }
644
+ button.sync-btn {
645
+ display: inline-flex;
646
+ align-items: center;
647
+ gap: 5px;
648
+ padding: 3px 8px;
649
+ border-color: var(--border);
650
+ }
651
+ .sync-row .hint {
652
+ flex: 1;
653
+ min-width: 0;
654
+ text-align: right;
655
+ font-size: 10.5px;
656
+ color: var(--muted);
657
+ overflow: hidden;
658
+ text-overflow: ellipsis;
659
+ white-space: nowrap;
660
+ }
661
+
662
+ /* --- dev build badge --- */
663
+ .badge-dev {
664
+ flex: none;
665
+ margin-left: 8px;
666
+ padding: 1px 6px;
667
+ border-radius: 5px;
668
+ font-size: 9.5px;
669
+ font-weight: 700;
670
+ letter-spacing: 0.06em;
671
+ text-transform: uppercase;
672
+ color: #fff;
673
+ background: var(--serious);
674
+ }