-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfireclaw-patch.patch
More file actions
2602 lines (2591 loc) · 90.6 KB
/
Copy pathfireclaw-patch.patch
File metadata and controls
2602 lines (2591 loc) · 90.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
From d90bae30f1aa43deedbc2dcb65c4880afa7aa2dc Mon Sep 17 00:00:00 2001
From: FireClaw Agent <agent@fireclaw.local>
Date: Fri, 24 Apr 2026 17:09:02 +0530
Subject: [PATCH] feat(fireclaw): multi-provider API key system + WhatsApp
topbar + bundled web-login fallback (rebase-safe)
Squashes 4 prior fork commits into one rebase-safe refactor. All extension logic lives in dedicated fireclaw/ namespaces (ui/src/ui/fireclaw/, ui/src/styles/fireclaw.css, src/gateway/server-methods/fireclaw-web-fallback.ts). Hot upstream files (app-render.ts, app-render.helpers.ts, web.ts, layout.css) are touched only by tiny import + mount hooks (or not at all) so weekly upstream rebases stay near-conflict-free.
Includes: multi-provider API key registry (16 providers), curated model catalogs, WhatsApp topbar dropdown, GitHub Actions Docker workflow for ghcr.io/akashmahlaz/openclaw:fireclaw-latest.
---
.github/workflows/docker-fireclaw.yml | 60 +
.../server-methods/fireclaw-web-fallback.ts | 23 +
src/gateway/server-methods/web.ts | 10 +-
ui/src/styles.css | 2 +
ui/src/styles/fireclaw.css | 1046 +++++++++++++++++
ui/src/ui/app-render.helpers.ts | 5 +-
ui/src/ui/app-render.ts | 11 +-
ui/src/ui/app-view-state.ts | 11 +
ui/src/ui/app.ts | 12 +
ui/src/ui/controllers/api-key.ts | 221 ++++
ui/src/ui/controllers/provider-registry.ts | 284 +++++
ui/src/ui/fireclaw/api-key-ui.ts | 240 ++++
ui/src/ui/fireclaw/whatsapp-topbar.ts | 493 ++++++++
13 files changed, 2405 insertions(+), 13 deletions(-)
create mode 100644 .github/workflows/docker-fireclaw.yml
create mode 100644 src/gateway/server-methods/fireclaw-web-fallback.ts
create mode 100644 ui/src/styles/fireclaw.css
create mode 100644 ui/src/ui/controllers/api-key.ts
create mode 100644 ui/src/ui/controllers/provider-registry.ts
create mode 100644 ui/src/ui/fireclaw/api-key-ui.ts
create mode 100644 ui/src/ui/fireclaw/whatsapp-topbar.ts
diff --git a/.github/workflows/docker-fireclaw.yml b/.github/workflows/docker-fireclaw.yml
new file mode 100644
index 0000000000..b661826dc2
--- /dev/null
+++ b/.github/workflows/docker-fireclaw.yml
@@ -0,0 +1,60 @@
+name: Build FireClaw Docker Image
+
+on:
+ push:
+ branches:
+ - feat/multi-provider-api-key-system-v2
+ - main
+ workflow_dispatch:
+
+concurrency:
+ group: docker-fireclaw-${{ github.ref_name }}
+ cancel-in-progress: true
+
+env:
+ REGISTRY: ghcr.io
+ IMAGE_NAME: ${{ github.repository }}
+
+jobs:
+ build-and-push:
+ runs-on: ubuntu-24.04
+ permissions:
+ contents: read
+ packages: write
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Login to GitHub Container Registry
+ uses: docker/login-action@v3
+ with:
+ registry: ${{ env.REGISTRY }}
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Extract metadata
+ id: meta
+ uses: docker/metadata-action@v5
+ with:
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
+ tags: |
+ type=raw,value=latest,enable={{is_default_branch}}
+ type=raw,value=fireclaw-latest
+ type=sha,prefix=fireclaw-
+
+ - name: Build and push
+ uses: docker/build-push-action@v6
+ with:
+ context: .
+ push: true
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
+ cache-from: type=gha
+ cache-to: type=gha,mode=max
+ build-args: |
+ OPENCLAW_EXTENSIONS=whatsapp openai anthropic google groq mistral openrouter deepseek together fireworks perplexity xai minimax qwen
diff --git a/src/gateway/server-methods/fireclaw-web-fallback.ts b/src/gateway/server-methods/fireclaw-web-fallback.ts
new file mode 100644
index 0000000000..047f0da2e6
--- /dev/null
+++ b/src/gateway/server-methods/fireclaw-web-fallback.ts
@@ -0,0 +1,23 @@
+// FireClaw fork extension — web login provider resolver with bundled-plugin fallback.
+// Upstream's listChannelPlugins() only returns *configured* plugins, but the web QR
+// onboarding flow needs to enumerate bundled-but-not-yet-configured plugins (chicken
+// and egg: you set up WhatsApp via QR, but it can't load until configured).
+// Kept in a dedicated file so upstream rebases of web.ts don't collide with this patch.
+
+import { listChannelPlugins } from "../../channels/plugins/index.js";
+import { listBundledChannelPlugins } from "../../channels/plugins/bundled.js";
+
+const WEB_LOGIN_METHODS = new Set(["web.login.start", "web.login.wait"]);
+
+const pluginRegistersWebLogin = (plugin: { gatewayMethods?: readonly string[] }) =>
+ (plugin.gatewayMethods ?? []).some((method) => WEB_LOGIN_METHODS.has(method));
+
+export const resolveWebLoginProvider = () => {
+ // First check loaded (configured) plugins.
+ const loaded = listChannelPlugins().find(pluginRegistersWebLogin);
+ if (loaded) {return loaded;}
+ // Fall back to bundled plugins so web QR setup works before the channel
+ // has been explicitly configured. This is required for first-time WhatsApp
+ // onboarding via the web UI.
+ return listBundledChannelPlugins().find(pluginRegistersWebLogin) ?? null;
+};
diff --git a/src/gateway/server-methods/web.ts b/src/gateway/server-methods/web.ts
index d9128b4bdd..86d67a54dd 100644
--- a/src/gateway/server-methods/web.ts
+++ b/src/gateway/server-methods/web.ts
@@ -1,4 +1,3 @@
-import { listChannelPlugins } from "../../channels/plugins/index.js";
import type { ChannelId } from "../../channels/plugins/types.public.js";
import {
ErrorCodes,
@@ -9,13 +8,8 @@ import {
} from "../protocol/index.js";
import { formatForLog } from "../ws-log.js";
import type { GatewayRequestHandlers, RespondFn } from "./types.js";
-
-const WEB_LOGIN_METHODS = new Set(["web.login.start", "web.login.wait"]);
-
-const resolveWebLoginProvider = () =>
- listChannelPlugins().find((plugin) =>
- (plugin.gatewayMethods ?? []).some((method) => WEB_LOGIN_METHODS.has(method)),
- ) ?? null;
+// FireClaw fork extension — keep upstream-file delta minimal for rebases.
+import { resolveWebLoginProvider } from "./fireclaw-web-fallback.js";
function resolveAccountId(params: unknown): string | undefined {
return typeof (params as { accountId?: unknown }).accountId === "string"
diff --git a/ui/src/styles.css b/ui/src/styles.css
index 23fc6a55c8..73ec0db50c 100644
--- a/ui/src/styles.css
+++ b/ui/src/styles.css
@@ -8,6 +8,8 @@
@import "./styles/cron-quick-create.css";
@import "./styles/usage.css";
@import "./styles/dreams.css";
+/* FireClaw fork extension styles. Kept in a dedicated file so upstream rebases of layout.css do not collide with our patches. */
+@import "./styles/fireclaw.css";
@import "@create-markdown/preview/themes/system.css";
.cm-preview {
diff --git a/ui/src/styles/fireclaw.css b/ui/src/styles/fireclaw.css
new file mode 100644
index 0000000000..3365b38d18
--- /dev/null
+++ b/ui/src/styles/fireclaw.css
@@ -0,0 +1,1046 @@
+/* FireClaw fork extension styles. Kept in a dedicated file so upstream rebases of layout.css do not collide with our patches. */
+
+.wa-dropdown-wrapper {
+ position: relative;
+ display: inline-flex;
+}
+
+.wa-dropdown-trigger {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ min-height: 38px;
+ padding: 0 12px 0 14px;
+ border: 1px solid color-mix(in srgb, #25D366 25%, var(--border));
+ border-radius: var(--radius-full);
+ background: color-mix(in srgb, #25D366 6%, var(--bg-elevated));
+ color: var(--text);
+ font-size: 13px;
+ font-weight: 600;
+ cursor: pointer;
+ transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
+}
+
+.wa-dropdown-trigger:hover {
+ background: color-mix(in srgb, #25D366 12%, var(--bg-elevated));
+ border-color: color-mix(in srgb, #25D366 50%, var(--border));
+ box-shadow: 0 2px 8px color-mix(in srgb, #25D366 15%, transparent);
+}
+
+.wa-dropdown-trigger--connected {
+ border-color: color-mix(in srgb, #25D366 40%, var(--border));
+}
+
+.wa-dropdown-trigger__dot {
+ position: relative;
+ width: 10px;
+ height: 10px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+}
+
+.wa-dot {
+ display: inline-block;
+ border-radius: 50%;
+}
+
+.wa-dot--connected {
+ position: relative;
+ width: 10px;
+ height: 10px;
+ background: #25D366;
+ border-radius: 50%;
+ box-shadow: 0 0 0 2px color-mix(in srgb, #25D366 20%, transparent);
+}
+
+.wa-dot--connected-ping {
+ position: absolute;
+ inset: 0;
+ width: 10px;
+ height: 10px;
+ border-radius: 50%;
+ background: #25D366;
+ opacity: 0.6;
+ animation: wa-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
+}
+
+.wa-dot--disconnected {
+ width: 10px;
+ height: 10px;
+ background: #f59e0b;
+ border-radius: 50%;
+ box-shadow: 0 0 0 2px color-mix(in srgb, #f59e0b 20%, transparent);
+}
+
+.wa-dot--web {
+ width: 10px;
+ height: 10px;
+ background: #3b82f6;
+ border-radius: 50%;
+ box-shadow: 0 0 0 2px color-mix(in srgb, #3b82f6 20%, transparent);
+}
+
+.wa-dot--telegram {
+ width: 10px;
+ height: 10px;
+ background: #0ea5e9;
+ border-radius: 50%;
+ box-shadow: 0 0 0 2px color-mix(in srgb, #0ea5e9 20%, transparent);
+}
+
+@keyframes wa-ping {
+ 75%, 100% { transform: scale(2); opacity: 0; }
+}
+
+.wa-dropdown-trigger__icon { color: #25D366; flex-shrink: 0; }
+.wa-dropdown-trigger__label { letter-spacing: -0.01em; white-space: nowrap; }
+
+.wa-dropdown-trigger__count {
+ font-size: 11px;
+ font-weight: 500;
+ color: var(--text-muted);
+ background: var(--bg);
+ padding: 1px 6px;
+ border-radius: 10px;
+}
+
+.wa-dropdown-trigger__chevron {
+ flex-shrink: 0;
+ color: var(--text-muted);
+ transition: transform 200ms ease;
+}
+
+.wa-dropdown-trigger__chevron--open { transform: rotate(180deg); }
+
+/* Backdrop */
+.wa-dropdown-backdrop {
+ position: fixed;
+ inset: 0;
+ z-index: 9998;
+}
+
+/* Panel */
+.wa-dropdown-panel {
+ position: absolute;
+ top: calc(100% + 8px);
+ right: 0;
+ z-index: 9999;
+ width: 340px;
+ max-height: 480px;
+ overflow-y: auto;
+ background: var(--bg-elevated);
+ border: 1px solid var(--border);
+ border-radius: 12px;
+ box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
+ padding: 4px 0;
+ animation: wa-dropdown-enter 180ms ease;
+}
+
+@keyframes wa-dropdown-enter {
+ from { opacity: 0; transform: translateY(-6px) scale(0.97); }
+ to { opacity: 1; transform: translateY(0) scale(1); }
+}
+
+/* Header */
+.wa-dropdown-header {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 12px 16px 8px;
+}
+
+.wa-dropdown-header__title {
+ flex: 1;
+ font-size: 13px;
+ font-weight: 700;
+ color: var(--text);
+ letter-spacing: -0.01em;
+ text-transform: uppercase;
+}
+
+.wa-dropdown-close,
+.wa-dropdown-back {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 26px;
+ height: 26px;
+ border: none;
+ border-radius: 6px;
+ background: transparent;
+ color: var(--text-muted);
+ font-size: 18px;
+ cursor: pointer;
+ transition: background 120ms ease;
+}
+
+.wa-dropdown-close:hover,
+.wa-dropdown-back:hover {
+ background: var(--bg);
+ color: var(--text);
+}
+
+/* Channel items */
+.wa-dropdown-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 10px 16px;
+ border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
+ transition: background 120ms ease;
+}
+
+.wa-dropdown-item:hover {
+ background: color-mix(in srgb, var(--bg) 60%, transparent);
+}
+
+.wa-dropdown-item--live {
+ background: color-mix(in srgb, #25D366 4%, transparent);
+}
+
+.wa-dropdown-item__left {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
+
+.wa-dropdown-item__dot {
+ position: relative;
+ width: 10px;
+ height: 10px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+}
+
+.wa-dropdown-item__info {
+ display: flex;
+ flex-direction: column;
+ gap: 1px;
+}
+
+.wa-dropdown-item__name {
+ font-size: 13px;
+ font-weight: 600;
+ color: var(--text);
+}
+
+.wa-dropdown-item__detail {
+ font-size: 11px;
+ color: var(--text-muted);
+}
+
+.wa-dropdown-item__right {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+}
+
+/* Badges */
+.wa-dropdown-badge {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ padding: 3px 8px;
+ border-radius: 10px;
+ font-size: 11px;
+ font-weight: 600;
+}
+
+.wa-dropdown-badge--live {
+ background: color-mix(in srgb, #25D366 12%, transparent);
+ color: #25D366;
+}
+
+.wa-dropdown-badge--offline {
+ background: color-mix(in srgb, var(--text-muted) 10%, transparent);
+ color: var(--text-muted);
+}
+
+/* Action buttons in rows */
+.wa-dropdown-action {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ padding: 4px 8px;
+ border: none;
+ border-radius: 6px;
+ background: transparent;
+ color: var(--text-muted);
+ font-size: 12px;
+ font-weight: 600;
+ cursor: pointer;
+ transition: background 120ms ease, color 120ms ease;
+}
+
+.wa-dropdown-action:hover {
+ background: var(--bg);
+ color: var(--text);
+}
+
+.wa-dropdown-action--connect {
+ background: color-mix(in srgb, #25D366 10%, transparent);
+ color: #25D366;
+ padding: 4px 12px;
+ border-radius: 10px;
+}
+
+.wa-dropdown-action--connect:hover {
+ background: color-mix(in srgb, #25D366 20%, transparent);
+}
+
+/* Status bar under channel */
+.wa-dropdown-statusbar {
+ display: flex;
+ gap: 12px;
+ padding: 4px 16px 8px 36px;
+ font-size: 11px;
+ color: var(--text-muted);
+}
+
+.wa-dropdown-statusbar--error {
+ color: #f59e0b;
+}
+
+.wa-dropdown-statusbar__item {
+ white-space: nowrap;
+}
+
+/* Footer */
+.wa-dropdown-footer {
+ padding: 8px 16px 10px;
+}
+
+.wa-dropdown-footer__link {
+ display: inline;
+ border: none;
+ background: transparent;
+ color: var(--text-muted);
+ font-size: 12px;
+ font-weight: 500;
+ cursor: pointer;
+ padding: 0;
+ transition: color 120ms ease;
+}
+
+.wa-dropdown-footer__link:hover {
+ color: var(--text);
+}
+
+/* Messages */
+.wa-dropdown-message {
+ font-size: 12px;
+ color: #f59e0b;
+ padding: 6px 16px 10px;
+ line-height: 1.4;
+}
+
+/* ── QR View ── */
+.wa-dropdown-qr-steps {
+ padding: 8px 16px 12px;
+}
+
+.wa-dropdown-qr-step {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ padding: 6px 0;
+ font-size: 13px;
+ color: var(--text);
+}
+
+.wa-dropdown-qr-step__num {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 22px;
+ height: 22px;
+ border-radius: 50%;
+ background: color-mix(in srgb, #25D366 12%, transparent);
+ color: #25D366;
+ font-size: 12px;
+ font-weight: 700;
+ flex-shrink: 0;
+}
+
+.wa-dropdown-qr-img {
+ display: flex;
+ justify-content: center;
+ padding: 12px 16px;
+}
+
+.wa-dropdown-qr-img img {
+ background: #fff;
+ padding: 12px;
+ border-radius: 10px;
+ image-rendering: pixelated;
+}
+
+.wa-dropdown-qr-loading,
+.wa-dropdown-qr-waiting {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 8px;
+ padding: 16px;
+ font-size: 13px;
+ color: var(--text-muted);
+}
+
+.wa-dropdown-qr-success {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 8px;
+ padding: 24px 16px;
+ text-align: center;
+}
+
+.wa-dropdown-qr-success p {
+ font-size: 15px;
+ font-weight: 600;
+ color: #25D366;
+ margin: 0;
+}
+
+/* Spinner */
+.wa-qr-modal__spinner {
+ width: 16px;
+ height: 16px;
+ border: 2px solid var(--border);
+ border-top-color: #25D366;
+ border-radius: 50%;
+ animation: wa-spin 0.8s linear infinite;
+ flex-shrink: 0;
+}
+
+@keyframes wa-spin {
+ to { transform: rotate(360deg); }
+}
+
+/* ── Settings View ── */
+.wa-dropdown-settings-info {
+ padding: 8px 16px;
+}
+
+.wa-dropdown-settings-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 5px 0;
+ font-size: 12px;
+}
+
+.wa-dropdown-settings-row__label {
+ color: var(--text-muted);
+}
+
+.wa-dropdown-settings-row__value {
+ color: var(--text);
+ font-weight: 500;
+}
+
+.wa-dropdown-settings-actions {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ padding: 10px 16px 14px;
+}
+
+.wa-dropdown-settings-btn {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 8px;
+ padding: 8px 14px;
+ border: 1px solid var(--border);
+ border-radius: 8px;
+ background: transparent;
+ font-size: 13px;
+ font-weight: 500;
+ cursor: pointer;
+ transition: background 120ms ease, border-color 120ms ease;
+}
+
+.wa-dropdown-settings-btn:hover {
+ background: var(--bg);
+}
+
+.wa-dropdown-settings-btn--relink {
+ color: #25D366;
+ border-color: color-mix(in srgb, #25D366 30%, var(--border));
+}
+
+.wa-dropdown-settings-btn--relink:hover {
+ background: color-mix(in srgb, #25D366 8%, transparent);
+}
+
+.wa-dropdown-settings-btn--disconnect {
+ color: #ef4444;
+ border-color: color-mix(in srgb, #ef4444 20%, var(--border));
+}
+
+.wa-dropdown-settings-btn--disconnect:hover {
+ background: color-mix(in srgb, #ef4444 8%, transparent);
+}
+
+.wa-dropdown-settings-btn:disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+}
+
+.wa-dropdown-settings-section {
+ padding: 8px 12px;
+ border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
+}
+
+.wa-dropdown-settings-section__title {
+ font-size: 10px;
+ font-weight: 600;
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+ color: var(--text-secondary, #888);
+ margin-bottom: 6px;
+ display: block;
+}
+
+.wa-dropdown-settings-select {
+ width: 100%;
+ padding: 5px 8px;
+ border-radius: 6px;
+ border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
+ background: var(--bg-input, rgba(255, 255, 255, 0.04));
+ color: inherit;
+ font-size: 12px;
+ cursor: pointer;
+ outline: none;
+ margin-top: 2px;
+}
+
+.wa-dropdown-settings-select:focus {
+ border-color: var(--accent, #25D366);
+}
+
+.wa-dropdown-settings-allowform {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ margin-top: 8px;
+}
+
+.wa-dropdown-settings-input {
+ width: 100%;
+ padding: 5px 8px;
+ border-radius: 6px;
+ border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
+ background: var(--bg-input, rgba(255, 255, 255, 0.04));
+ color: inherit;
+ font-size: 12px;
+ outline: none;
+ box-sizing: border-box;
+}
+
+.wa-dropdown-settings-input:focus {
+ border-color: var(--accent, #25D366);
+}
+
+.wa-dropdown-settings-input::placeholder {
+ color: var(--text-tertiary, #666);
+}
+
+.wa-dropdown-settings-btn--save {
+ background: var(--accent, #25D366);
+ color: #fff;
+ border-color: transparent;
+ font-weight: 500;
+}
+
+.wa-dropdown-settings-btn--save:hover {
+ background: color-mix(in srgb, var(--accent, #25D366) 85%, #000);
+}
+
+/* ── API Key Button & Popover ── */
+.api-key-wrapper {
+ position: relative;
+ display: inline-flex;
+}
+
+.api-key-btn {
+ position: relative;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 34px;
+ height: 34px;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-full);
+ background: var(--bg-elevated);
+ color: var(--text-muted);
+ cursor: pointer;
+ transition: border-color var(--duration-fast) ease, color var(--duration-fast) ease, background var(--duration-fast) ease;
+}
+
+.api-key-btn--missing {
+ border-color: color-mix(in srgb, #f59e0b 40%, var(--border));
+ color: #f59e0b;
+}
+
+.api-key-btn--configured {
+ border-color: color-mix(in srgb, #22c55e 30%, var(--border));
+ color: #22c55e;
+}
+
+.api-key-btn__badge {
+ position: absolute;
+ top: -4px;
+ right: -4px;
+ width: 14px;
+ height: 14px;
+ border-radius: 50%;
+ background: #f59e0b;
+ color: #fff;
+ font-size: 9px;
+ font-weight: 700;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ line-height: 1;
+}
+
+.api-key-btn:hover {
+ border-color: var(--color-accent, #6366f1);
+ color: var(--color-accent, #6366f1);
+ background: color-mix(in srgb, var(--color-accent, #6366f1) 8%, var(--bg-elevated));
+}
+
+.api-key-btn[aria-expanded="true"] {
+ border-color: var(--color-accent, #6366f1);
+ color: var(--color-accent, #6366f1);
+}
+
+.api-key-popover {
+ position: fixed;
+ top: 60px;
+ right: 16px;
+ z-index: 1000;
+ width: 300px;
+ padding: 16px;
+ background: var(--bg-elevated);
+ border: 1px solid var(--border);
+ border-radius: var(--radius-md, 8px);
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
+}
+
+.api-key-popover__header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 4px;
+}
+
+.api-key-popover__title {
+ font-size: 14px;
+ font-weight: 600;
+ color: var(--text);
+}
+
+.api-key-popover__close {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 24px;
+ height: 24px;
+ border: none;
+ border-radius: var(--radius-sm, 4px);
+ background: transparent;
+ color: var(--text-muted);
+ font-size: 18px;
+ cursor: pointer;
+}
+
+.api-key-popover__close:hover {
+ background: var(--bg);
+ color: var(--text);
+}
+
+.api-key-popover__status {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 8px 10px;
+ border-radius: var(--radius-sm, 4px);
+ font-size: 12px;
+ margin-bottom: 12px;
+ line-height: 1.4;
+}
+
+.api-key-popover__status--ok {
+ background: color-mix(in srgb, #22c55e 10%, var(--bg));
+ color: #22c55e;
+}
+
+.api-key-popover__status--missing {
+ background: color-mix(in srgb, #f59e0b 10%, var(--bg));
+ color: #f59e0b;
+}
+
+.api-key-popover__status-dot {
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ flex-shrink: 0;
+}
+
+.api-key-popover__status--ok .api-key-popover__status-dot {
+ background: #22c55e;
+}
+
+.api-key-popover__status--missing .api-key-popover__status-dot {
+ background: #f59e0b;
+}
+
+.api-key-popover__desc {
+ font-size: 12px;
+ color: var(--text-muted);
+ margin: 0 0 12px;
+ line-height: 1.4;
+}
+
+.api-key-popover__field {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ margin-bottom: 10px;
+}
+
+.api-key-popover__label {
+ font-size: 12px;
+ font-weight: 500;
+ color: var(--text-muted);
+}
+
+.api-key-popover__field select,
+.api-key-popover__field input {
+ height: 34px;
+ padding: 0 10px;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-sm, 4px);
+ background: var(--bg);
+ color: var(--text);
+ font-size: 13px;
+}
+
+.api-key-popover__field select:focus,
+.api-key-popover__field input:focus {
+ outline: none;
+ border-color: var(--color-accent, #6366f1);
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent, #6366f1) 20%, transparent);
+}
+
+.api-key-popover__msg {
+ font-size: 12px;
+ margin-bottom: 8px;
+ padding: 6px 8px;
+ border-radius: var(--radius-sm, 4px);
+}
+
+.api-key-popover__msg--error {
+ background: color-mix(in srgb, #ef4444 10%, var(--bg));
+ color: #ef4444;
+}
+
+.api-key-popover__msg--success {
+ background: color-mix(in srgb, #22c55e 10%, var(--bg));
+ color: #22c55e;
+}
+
+.api-key-popover__save {
+ width: 100%;
+ height: 34px;
+ border: none;
+ border-radius: var(--radius-sm, 4px);
+ background: var(--color-accent, #6366f1);
+ color: #fff;
+ font-size: 13px;
+ font-weight: 600;
+ cursor: pointer;
+ transition: opacity var(--duration-fast) ease;
+}
+
+.api-key-popover__save:hover:not(:disabled) {
+ opacity: 0.9;
+}
+
+.api-key-popover__save:disabled {
+ opacity: 0.5;
+ cursor: not-allowed;
+}
+
+/* ── Multi-Provider Panel ── */
+.api-key-popover--wide {
+ width: 380px;
+ max-height: 520px;
+ display: flex;
+ flex-direction: column;
+}
+
+.api-key-popover__back {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 24px;
+ height: 24px;
+ border: none;
+ border-radius: var(--radius-sm, 4px);
+ background: transparent;
+ color: var(--text-muted);
+ font-size: 16px;
+ cursor: pointer;
+ margin-right: 4px;
+ padding: 0;
+}
+.api-key-popover__back:hover {
+ background: var(--bg);
+ color: var(--text);
+}
+
+/* Suggestion Banner */
+.api-key-suggestion {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 10px 12px;
+ border-radius: var(--radius-sm, 4px);
+ background: linear-gradient(135deg, color-mix(in srgb, #a855f7 12%, var(--bg)), color-mix(in srgb, #6366f1 8%, var(--bg)));
+ border: 1px solid color-mix(in srgb, #a855f7 20%, var(--border));
+ font-size: 12px;
+ color: var(--text);
+ margin-bottom: 12px;
+ line-height: 1.4;
+}
+.api-key-suggestion__icon {
+ font-size: 16px;
+ flex-shrink: 0;
+}
+
+/* Provider List */