Repository navigation
Expand file tree
/
Copy pathGCP_SLACKBOT_MCP_SETUP_GUIDE.html
More file actions
executable file
·1194 lines (1078 loc) · 51.9 KB
/
Copy pathGCP_SLACKBOT_MCP_SETUP_GUIDE.html
File metadata and controls
executable file
·1194 lines (1078 loc) · 51.9 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Salesforce ↔ GCP Slackbot ↔ Salesforce MCP: Enterprise Setup & Implementation Guide | Salesforce Enterprise Architecture</title>
<!-- Mermaid JS for Dynamic Diagrams -->
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
<script>
mermaid.initialize({
startOnLoad: true,
theme: 'default',
securityLevel: 'loose',
flowchart: { useMaxWidth: true, htmlLabels: true, curve: 'basis' },
sequence: { useMaxWidth: true, showSequenceNumbers: true }
});
</script>
<style>
:root {
--sf-blue: #0176D3;
--sf-dark-blue: #0b5cab;
--sf-navy: #032d60;
--slack-aubergine: #4A154B;
--slack-green: #2EB67D;
--slack-yellow: #ECB22E;
--slack-red: #E01E5A;
--slack-blue: #36C5F0;
--gcp-blue: #4285F4;
--snowflake-blue: #29B5E8;
--gmail-red: #EA4335;
--cal-blue: #1A73E8;
--bg-light: #f8fafc;
--card-bg: #ffffff;
--text-main: #0f172a;
--text-sub: #475569;
--border-color: #e2e8f0;
--code-bg: #1e1e24;
--radius-lg: 12px;
--radius-md: 8px;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
body {
background-color: var(--bg-light);
color: var(--text-main);
line-height: 1.68;
padding-bottom: 80px;
}
/* Scroll progress indicator */
#progress-bar {
position: fixed;
top: 0;
left: 0;
height: 3px;
background: linear-gradient(90deg, var(--sf-blue), var(--slack-green), var(--slack-blue));
width: 0%;
z-index: 999;
transition: width 0.1s ease;
}
/* Hero Header */
header.hero {
background: linear-gradient(135deg, var(--sf-navy) 0%, #0f172a 45%, var(--slack-aubergine) 100%);
color: white;
padding: 48px 24px;
text-align: center;
border-bottom: 4px solid var(--slack-green);
position: relative;
}
header.hero h1 {
font-size: 2.3rem;
margin-bottom: 12px;
font-weight: 800;
letter-spacing: -0.5px;
max-width: 1000px;
margin-left: auto;
margin-right: auto;
}
header.hero p {
font-size: 1.1rem;
color: #cbd5e1;
max-width: 850px;
margin: 0 auto 20px auto;
}
.badge-bar {
display: flex;
justify-content: center;
gap: 10px;
flex-wrap: wrap;
margin-top: 14px;
}
.badge {
background: rgba(255, 255, 255, 0.12);
padding: 6px 14px;
border-radius: 20px;
font-size: 0.84rem;
font-weight: 600;
backdrop-filter: blur(6px);
border: 1px solid rgba(255, 255, 255, 0.2);
color: #f1f5f9;
}
.badge.success {
background: rgba(46, 182, 125, 0.25);
border-color: #2EB67D;
color: #86efac;
}
/* Layout Container */
.container {
max-width: 1220px;
margin: 28px auto;
padding: 0 20px;
}
/* Sticky Navigation Bar with Search */
.nav-wrapper {
position: sticky;
top: 12px;
z-index: 100;
margin-bottom: 28px;
}
.nav-tabs {
display: flex;
background: #ffffff;
border-radius: var(--radius-lg);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
padding: 6px;
overflow-x: auto;
border: 1px solid var(--border-color);
scrollbar-width: thin;
gap: 4px;
align-items: center;
}
.nav-tab {
padding: 10px 14px;
font-weight: 600;
font-size: 0.88rem;
cursor: pointer;
border-radius: var(--radius-md);
color: var(--text-sub);
text-decoration: none;
transition: all 0.2s ease;
white-space: nowrap;
}
.nav-tab:hover {
background: #f1f5f9;
color: var(--sf-blue);
}
.nav-tab.active {
background: var(--sf-blue);
color: #ffffff;
}
/* Section Cards */
.section-card {
background: var(--card-bg);
border-radius: var(--radius-lg);
padding: 32px;
margin-bottom: 32px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
border: 1px solid var(--border-color);
}
h2.section-title {
font-size: 1.55rem;
margin-bottom: 20px;
color: var(--sf-navy);
display: flex;
align-items: center;
gap: 12px;
border-bottom: 2px solid #f1f5f9;
padding-bottom: 12px;
}
.title-badge {
font-size: 0.72rem;
font-weight: 800;
background: #e0f2fe;
color: var(--sf-blue);
padding: 4px 8px;
border-radius: 6px;
letter-spacing: 0.5px;
}
h3.sub-title {
font-size: 1.25rem;
margin: 24px 0 12px 0;
color: #0f172a;
display: flex;
align-items: center;
gap: 8px;
}
h4.sub-sub-title {
font-size: 1.05rem;
margin: 18px 0 10px 0;
color: #1e293b;
}
p {
color: #334155;
font-size: 0.98rem;
margin-bottom: 14px;
}
/* Lists */
ul.styled-list, ol.styled-ordered-list {
padding-left: 24px;
margin-bottom: 18px;
}
li {
color: #334155;
font-size: 0.96rem;
margin-bottom: 8px;
}
li.task-item {
list-style-type: none;
display: flex;
align-items: flex-start;
gap: 8px;
margin-bottom: 6px;
}
li.task-item.checked {
color: #059669;
font-weight: 500;
}
.check-icon {
font-weight: bold;
color: #10b981;
}
/* Visual Illustration Card */
.visual-illustration-card {
background: #0f172a;
border-radius: var(--radius-lg);
padding: 24px;
margin: 24px 0 32px 0;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
border: 1px solid #334155;
}
.illustration-header {
margin-bottom: 16px;
text-align: left;
}
.illustration-tag {
font-size: 0.72rem;
font-weight: 700;
text-transform: uppercase;
background: #0284c7;
color: #ffffff;
padding: 3px 8px;
border-radius: 4px;
letter-spacing: 0.5px;
display: inline-block;
margin-bottom: 6px;
}
.illustration-header h3 {
font-size: 1.2rem;
color: #f8fafc;
font-weight: 700;
}
/* Diagram Box (Mermaid) */
.diagram-box {
background: #f8fafc;
border: 1px solid #cbd5e1;
border-radius: var(--radius-md);
padding: 24px;
margin: 22px 0;
text-align: center;
overflow-x: auto;
}
.diagram-label {
font-size: 0.8rem;
font-weight: 700;
color: #64748b;
text-transform: uppercase;
margin-bottom: 12px;
text-align: left;
}
/* Step Card */
.step-card {
background: #ffffff;
border: 1px solid #cbd5e1;
border-radius: var(--radius-md);
padding: 20px;
margin: 18px 0;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
border-left: 4px solid var(--sf-blue);
}
.step-header {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 10px;
}
.step-badge {
font-size: 0.75rem;
font-weight: 800;
color: #ffffff;
background: var(--sf-blue);
padding: 3px 8px;
border-radius: 4px;
letter-spacing: 0.5px;
}
.step-card h4 {
font-size: 1.15rem;
color: #0f172a;
margin: 0;
}
/* Code Container & Syntax Styling */
.code-container {
background: var(--code-bg);
border-radius: var(--radius-md);
margin: 18px 0;
overflow: hidden;
border: 1px solid #334155;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.code-header {
display: flex;
justify-content: space-between;
align-items: center;
background: #141418;
padding: 8px 16px;
border-bottom: 1px solid #2d2d35;
}
.lang-tag {
font-size: 0.75rem;
font-weight: 700;
color: #94a3b8;
letter-spacing: 0.5px;
}
.copy-btn {
background: #282832;
color: #cbd5e1;
border: 1px solid #444;
padding: 4px 10px;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
}
.copy-btn:hover {
background: var(--sf-blue);
color: #ffffff;
border-color: var(--sf-blue);
}
pre {
padding: 16px;
overflow-x: auto;
color: #f8f8f2;
font-size: 0.88rem;
line-height: 1.5;
}
code {
font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}
.inline-code {
background: #edf2f7;
color: #c026d3;
padding: 2px 6px;
border-radius: 4px;
font-size: 0.88em;
border: 1px solid #e2e8f0;
font-weight: 600;
}
/* Tables */
.table-responsive {
overflow-x: auto;
margin: 20px 0;
border-radius: var(--radius-md);
border: 1px solid var(--border-color);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
.styled-table {
width: 100%;
border-collapse: collapse;
background: #ffffff;
text-align: left;
font-size: 0.94rem;
}
.styled-table th {
background: #f1f5f9;
color: var(--sf-navy);
font-weight: 700;
padding: 12px 16px;
border-bottom: 2px solid #cbd5e1;
}
.styled-table td {
padding: 12px 16px;
border-bottom: 1px solid #e2e8f0;
color: #334155;
}
.styled-table tr:hover {
background: #f8fafc;
}
/* Callout Boxes */
.callout-box {
border-radius: var(--radius-md);
padding: 18px 20px;
margin: 20px 0;
border-left: 4px solid;
}
.callout-box.info {
background: #f0f9ff;
border-color: #0284c7;
}
.callout-box.info .callout-title { color: #0369a1; }
.callout-box.tip {
background: #fdf4ff;
border-color: #c084fc;
}
.callout-box.tip .callout-title { color: #7e22ce; }
.callout-box.warning {
background: #fffbeb;
border-color: #f59e0b;
}
.callout-box.warning .callout-title { color: #b45309; }
.callout-box.important {
background: #eff6ff;
border-color: #3b82f6;
}
.callout-box.important .callout-title { color: #1d4ed8; }
.callout-box.caution {
background: #fef2f2;
border-color: #ef4444;
}
.callout-box.caution .callout-title { color: #b91c1c; }
.callout-title {
font-size: 0.9rem;
font-weight: 700;
text-transform: uppercase;
margin-bottom: 6px;
letter-spacing: 0.5px;
}
.callout-body {
color: #334155;
font-size: 0.95rem;
}
hr.section-divider {
border: 0;
height: 1px;
background: #e2e8f0;
margin: 32px 0;
}
/* Image Container */
.doc-img-container {
margin: 20px 0;
text-align: center;
}
.doc-img {
max-width: 100%;
border-radius: var(--radius-md);
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
border: 1px solid var(--border-color);
}
.img-caption {
font-size: 0.85rem;
color: var(--text-sub);
margin-top: 6px;
font-style: italic;
}
/* Back to top button */
.back-to-top {
position: fixed;
bottom: 24px;
right: 24px;
background: var(--sf-blue);
color: white;
padding: 10px 16px;
border-radius: 24px;
font-size: 0.85rem;
font-weight: 600;
box-shadow: 0 4px 12px rgba(1, 118, 211, 0.4);
cursor: pointer;
text-decoration: none;
display: flex;
align-items: center;
gap: 6px;
transition: all 0.2s ease;
z-index: 99;
}
.back-to-top:hover {
background: var(--sf-dark-blue);
transform: translateY(-2px);
}
/* Footer */
footer {
text-align: center;
padding: 32px 20px;
color: #64748b;
font-size: 0.88rem;
border-top: 1px solid var(--border-color);
background: #ffffff;
margin-top: 48px;
}
@media print {
.nav-wrapper, .back-to-top, .copy-btn, #progress-bar { display: none !important; }
.section-card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
}
</style>
</head>
<body>
<div id="progress-bar"></div>
<!-- Hero Header -->
<header class="hero">
<h1>Salesforce ↔ GCP Slackbot ↔ Salesforce MCP: Enterprise Setup & Implementation Guide</h1>
<p>Enterprise Technical Documentation & Operational Reference</p>
<div class="badge-bar">
<span class="badge success">Production Ready</span>
<span class="badge ">Salesforce Lightning</span>
<span class="badge ">Enterprise Architecture</span>
<span class="badge ">Complete Implementation</span>
<span class="badge ">Slack Enterprise</span>
<span class="badge ">GCP Cloud Run</span>
<span class="badge ">Model Context Protocol</span>
</div>
</header>
<!-- Main Container -->
<div class="container">
<!-- Sticky Navigation Tabs -->
<div class="nav-wrapper">
<nav class="nav-tabs">
<a href="#sec-1-executive-summary-architecture-blueprint" class="nav-tab">Executive Summary & Architecture Blueprint</a>
<a href="#sec-2-the-mandatory-oauth-redirect-accept-handshake-flow" class="nav-tab">The Mandatory OAuth Redirect & Accept Handshake Flow</a>
<a href="#sec-3-dual-mode-authentication-engine" class="nav-tab">Dual-Mode Authentication Engine</a>
<a href="#sec-4-codebase-implementation-breakdown" class="nav-tab">Codebase Implementation Breakdown</a>
<a href="#sec-5-salesforce-configuration-permissions-checklist" class="nav-tab">Salesforce Configuration & Permissions Checklist</a>
<a href="#sec-6-testing-operational-verification-guide" class="nav-tab">Testing & Operational Verification Guide</a>
<a href="#sec-7-cloud-run-deployment-instructions-when-going-live-on-gcp" class="nav-tab">Cloud Run Deployment Instructions (When Going Live on GCP)</a>
<a href="#sec-8-summary-of-guarantee-constraints-compliance" class="nav-tab">Summary of Guarantee & Constraints Compliance</a>
</nav>
</div>
<!-- Document Content Sections -->
<hr class="section-divider"/>
<section class="section-card" id="sec-1-executive-summary-architecture-blueprint">
<h2 class="section-title"><span class="title-badge">SECTION</span> 1. Executive Summary & Architecture Blueprint</h2>
<div class="visual-illustration-card">
<div class="illustration-header">
<span class="illustration-tag">Enterprise Architecture & Handshake Flow</span>
<h3>Salesforce Lightning ↔ GCP Cloud Run ↔ Slack Enterprise Handshake</h3>
</div>
<svg viewBox="0 0 960 360" width="100%" height="auto" xmlns="http://www.w3.org/2000/svg" style="background:#0f172a; border-radius:12px; font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;">
<defs>
<linearGradient id="sfGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#0176D3"/>
<stop offset="100%" stop-color="#032d60"/>
</linearGradient>
<linearGradient id="gcpGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#4285F4"/>
<stop offset="100%" stop-color="#1a73e8"/>
</linearGradient>
<linearGradient id="slackGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#4A154B"/>
<stop offset="100%" stop-color="#611f69"/>
</linearGradient>
<linearGradient id="geminiGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#8e24aa"/>
<stop offset="100%" stop-color="#ab47bc"/>
</linearGradient>
<filter id="glow" x="-20%" y="-20%" width="140%" height="140%">
<feGaussianBlur stdDeviation="3" result="glow"/>
<feComposite in="SourceGraphic" in2="glow" operator="over"/>
</filter>
</defs>
<!-- Salesforce Node -->
<rect x="40" y="50" width="240" height="260" rx="12" fill="url(#sfGrad)" stroke="#38bdf8" stroke-width="2"/>
<rect x="55" y="65" width="36" height="36" rx="8" fill="#ffffff"/>
<path d="M73 72 C68 72 64 76 64 81 C64 82 64.2 83 64.5 83.8 C62.5 84.5 61 86.5 61 89 C61 92.3 63.7 95 67 95 L79 95 C82.3 95 85 92.3 85 89 C85 86.2 83.2 84 80.8 83.3 C80.9 82.5 81 81.8 81 81 C81 76 77 72 73 72 Z" fill="#0176D3"/>
<text x="100" y="88" fill="#ffffff" font-size="16" font-weight="700">Salesforce Org</text>
<text x="100" y="104" fill="#93c5fd" font-size="11">learn_dc Platform</text>
<rect x="55" y="120" width="210" height="42" rx="6" fill="rgba(255,255,255,0.12)" stroke="rgba(255,255,255,0.2)"/>
<text x="65" y="138" fill="#ffffff" font-size="12" font-weight="600">LWC: slackBotAgent</text>
<text x="65" y="152" fill="#cbd5e1" font-size="10">Account Record Copilot Feed</text>
<rect x="55" y="172" width="210" height="42" rx="6" fill="rgba(255,255,255,0.12)" stroke="rgba(255,255,255,0.2)"/>
<text x="65" y="190" fill="#ffffff" font-size="12" font-weight="600">Apex Identity Service</text>
<text x="65" y="204" fill="#cbd5e1" font-size="10">SlackUserIdentityService.cls</text>
<rect x="55" y="224" width="210" height="42" rx="6" fill="rgba(255,255,255,0.12)" stroke="rgba(255,255,255,0.2)"/>
<text x="65" y="242" fill="#ffffff" font-size="12" font-weight="600">LearnDCAgentMCPServer</text>
<text x="65" y="256" fill="#cbd5e1" font-size="10">Custom Invocable MCP Server</text>
<!-- GCP Node -->
<rect x="360" y="50" width="240" height="260" rx="12" fill="url(#gcpGrad)" stroke="#60a5fa" stroke-width="2"/>
<rect x="375" y="65" width="36" height="36" rx="8" fill="#ffffff"/>
<text x="382" y="89" fill="#4285F4" font-size="20" font-weight="bold">G</text>
<text x="420" y="88" fill="#ffffff" font-size="16" font-weight="700">Google Cloud Platform</text>
<text x="420" y="104" fill="#bfdbfe" font-size="11">Cloud Run / Container</text>
<rect x="375" y="120" width="210" height="42" rx="6" fill="rgba(255,255,255,0.15)"/>
<text x="385" y="138" fill="#ffffff" font-size="12" font-weight="600">GET /auth/login</text>
<text x="385" y="152" fill="#e2e8f0" font-size="10">OAuth Consent Screen Generator</text>
<rect x="375" y="172" width="210" height="42" rx="6" fill="rgba(255,255,255,0.15)"/>
<text x="385" y="190" fill="#ffffff" font-size="12" font-weight="600">POST /auth/slack/confirm</text>
<text x="385" y="204" fill="#e2e8f0" font-size="10">Auto-Link DM & Provision User</text>
<rect x="375" y="224" width="210" height="42" rx="6" fill="rgba(255,255,255,0.15)"/>
<text x="385" y="242" fill="#ffffff" font-size="12" font-weight="600">Gemini 3.6 Flash Brain</text>
<text x="385" y="256" fill="#e2e8f0" font-size="10">Autonomous MCP Tool Reasoning</text>
<!-- Slack Node -->
<rect x="680" y="50" width="240" height="260" rx="12" fill="url(#slackGrad)" stroke="#e879f9" stroke-width="2"/>
<rect x="695" y="65" width="36" height="36" rx="8" fill="#ffffff"/>
<text x="702" y="89" fill="#4A154B" font-size="20" font-weight="bold">#</text>
<text x="740" y="88" fill="#ffffff" font-size="16" font-weight="700">Slack Enterprise</text>
<text x="740" y="104" fill="#f5d0fe" font-size="11">Workspace T0BU7EDE40P</text>
<rect x="695" y="120" width="210" height="42" rx="6" fill="rgba(255,255,255,0.12)"/>
<text x="705" y="138" fill="#ffffff" font-size="12" font-weight="600">Bot: test_agent_app</text>
<text x="705" y="152" fill="#f5d0fe" font-size="10">App ID: A0BU7FHCFEK</text>
<rect x="695" y="172" width="210" height="42" rx="6" fill="rgba(255,255,255,0.12)"/>
<text x="705" y="190" fill="#ffffff" font-size="12" font-weight="600">Private 1-on-1 DM</text>
<text x="705" y="204" fill="#f5d0fe" font-size="10">conversations.open (D0C0LFM5B6E)</text>
<rect x="695" y="224" width="210" height="42" rx="6" fill="rgba(255,255,255,0.12)"/>
<text x="705" y="242" fill="#ffffff" font-size="12" font-weight="600">Socket Mode WSS</text>
<text x="705" y="256" fill="#f5d0fe" font-size="10">Outbound Persistent Tunnel</text>
<!-- Connector Arrows & Flow Labels -->
<path d="M 280 140 L 360 140" stroke="#38bdf8" stroke-width="3" fill="none"/>
<text x="290" y="132" fill="#38bdf8" font-size="10" font-weight="bold">1. Auth Click</text>
<path d="M 600 140 L 680 140" stroke="#e879f9" stroke-width="3" fill="none"/>
<text x="612" y="132" fill="#e879f9" font-size="10" font-weight="bold">2. Lookup</text>
<path d="M 680 190 L 600 190" stroke="#34d399" stroke-width="3" fill="none"/>
<text x="610" y="182" fill="#34d399" font-size="10" font-weight="bold">3. DM Channel</text>
<path d="M 360 190 L 280 190" stroke="#34d399" stroke-width="3" fill="none"/>
<text x="290" y="182" fill="#34d399" font-size="10" font-weight="bold">4. Store in SF</text>
<!-- Status Pill -->
<rect x="360" y="325" width="240" height="24" rx="12" fill="#22c55e" opacity="0.2"/>
<text x="480" y="341" fill="#4ade80" font-size="11" font-weight="700" text-anchor="middle">✓ ZERO-TOUCH OAUTH HANDSHAKE VERIFIED</text>
</svg>
</div>
<p>This document serves as the comprehensive architectural and operational reference for connecting:</p>
<ol class="styled-ordered-list">
<li><strong>Salesforce Lightning Platform</strong>: Hosts the Customer Success Manager (CSM) interface via the <code class="inline-code">slackBotAgent</code> Lightning Web Component (LWC) on Account record pages, alongside the custom Model Context Protocol (MCP) server (<code class="inline-code">LearnDCAgentMCPServer</code>).</li>
<li><strong>Google Cloud Platform (Cloud Run / Node.js Orchestrator)</strong>: Hosts the containerized Node.js/TypeScript <strong>Slack Gemini Agent</strong> (<code class="inline-code">slack-gemini-agent</code>) service running Gemini 3.6 Flash, the Salesforce MCP bridge client, and the OAuth handshake server.</li>
<li><strong>Slack Enterprise Workspace (<code class="inline-code">T0BU7EDE40P</code>)</strong>: Houses the Slack Bot App (<code class="inline-code">test_agent_app</code>, App ID: <code class="inline-code">A0BU7FHCFEK</code>), managing private 1-on-1 Direct Message channels with mobile and desktop continuity.</li>
</ol>
<div class="diagram-box">
<div class="diagram-label">📊 Interactive Architecture Diagram</div>
<div class="mermaid">
graph TD
subgraph SF_PLATFORM["Salesforce Lightning Platform (CRM)"]
CSM["CSM User (e.g. Summo CSM)"]
LWC["slackBotAgent (LWC)"]
CTRL["SlackBotAgentController.cls"]
AUTH_SVC["SlackUserIdentityService.cls"]
USER_REC[("User Record DB<br/>• Slack_User_Id__c<br/>• Slack_DM_Channel_Id__c<br/>• Slack_Connected_Email__c")]
MCP_SERVER["Salesforce Custom MCP Server<br/>(LearnDCAgentMCPServer)<br/>• search_accounts<br/>• query_snowflake<br/>• create_account_task"]
CSM -->|1. Clicks 'Sign in with Slack'| LWC
LWC -->|Auto-reads UserInfo.getUserEmail()| GCP_LOGIN
AUTH_SVC -->|Fast <5ms persistent cache| USER_REC
end
subgraph GCP_CLOUDRUN["Google Cloud Platform (slack-gemini-agent)"]
GATEWAY["Slackbot Gateway Service (Node.js/TS)"]
GCP_LOGIN["GET /auth/login<br/>(Receives sfUserId, sfOrgId, email)"]
CONSENT_UI["Slack Workspace Consent Screen<br/>(Displays App, User & 'Allow' Button)"]
GCP_CONFIRM["POST /auth/slack/confirm<br/>(Provisions DM, Updates Salesforce REST API)"]
GCP_CALLBACK["GET /auth/slack/callback<br/>(Official OAuth 2.0 Code Exchange)"]
CHAT_EP["POST /api/chat<br/>(Multi-turn AI Copilot)"]
GEMINI["Gemini 3.6 Flash<br/>(Reasoning Engine)"]
MCP_CLIENT["Salesforce MCP Client<br/>(salesforceMcpClient.ts)"]
GCP_LOGIN -->|Render Consent Screen| CONSENT_UI
CONSENT_UI -->|User clicks 'Allow'| GCP_CONFIRM
GCP_LOGIN -.->|Redirect 302 (If Client ID set)| SLACK_OAUTH
GCP_CONFIRM -->|REST DML update| USER_REC
GATEWAY --> CHAT_EP
CHAT_EP --> GEMINI
CHAT_EP --> MCP_CLIENT
end
subgraph SLACK_WORKSPACE["Slack Enterprise Workspace (T0BU7EDE40P)"]
SLACK_OAUTH["Slack OAuth Endpoint<br/>(slack.com/oauth/v2/authorize)"]
SLACK_API["Slack Web APIs<br/>• users.lookupByEmail<br/>• conversations.open<br/>• chat.postMessage"]
BOT_APP["Slack App: test_agent_app<br/>(A0BU7FHCFEK)"]
PRIVATE_DM["Private 1-on-1 DM Channel<br/>(e.g. D0C0LFM5B6E)"]
SLACK_OAUTH -->|CSM Clicks 'Allow'| GCP_CALLBACK
GCP_CONFIRM -->|conversations.open| SLACK_API
SLACK_API --> BOT_APP
BOT_APP --> PRIVATE_DM
end
%% Active Chat Execution
CTRL -.->|POST /api/chat { userMessage, accountId, threadTs }| CHAT_EP
MCP_CLIENT ==>|Execute Tools via Connected App| MCP_SERVER
CHAT_EP ==>|Mirror to Private DM| PRIVATE_DM
</div>
</div>
<hr class="section-divider"/>
</section>
<section class="section-card" id="sec-2-the-mandatory-oauth-redirect-accept-handshake-flow">
<h2 class="section-title"><span class="title-badge">SECTION</span> 2. The Mandatory OAuth Redirect & Accept Handshake Flow</h2>
<p>Enterprise security guidelines require that authentication is never performed silently in the background. The CSM must experience the explicit consent prompt:</p>
<div class="code-container">
<div class="code-header">
<span class="lang-tag">CODE</span>
<button class="copy-btn" onclick="copyCode(this)">Copy Code</button>
</div>
<pre><code class="language-">[CSM in Salesforce LWC]
│
▼ (1) Clicks "Sign in with Slack" (Uses Salesforce User email & sfUserId)
[Opens Browser Popup to GCP: /auth/login]
│
▼ (2) Displays Slack Workspace Authorization Screen
[Slack Interface: test_agent_app requesting access in AI Studio Agent with Slack]
│
▼ (3) CSM reviews permissions and clicks "Allow" (Accept)
[GCP Endpoint: /auth/slack/confirm]
│
▼ (4) Provisions private 1-on-1 DM channel (conversations.open)
│ and persists credentials on Salesforce User record
▼ (5) Popup window auto-closes via window.opener.postMessage()
[Salesforce LWC turns Green 🟢 Connected, unlocks composer, and loads private threads]</code></pre>
</div>
<h3 class="sub-title">Handshake Sequence Diagram</h3>
<div class="diagram-box">
<div class="diagram-label">📊 Interactive Architecture Diagram</div>
<div class="mermaid">
sequenceDiagram
autonumber
actor CSM as CSM (Salesforce User)
participant LWC as slackBotAgent (LWC)
participant GCP_In as GCP /auth/login
participant SlackConsent as Slack Authorization UI
participant GCP_Confirm as GCP /auth/slack/confirm
participant SlackAPI as Slack Web API (T0BU7EDE40P)
participant SFDB as Salesforce REST API / DB
Note over CSM,LWC: 1. Initiation in Salesforce
CSM->>LWC: Opens Account page (Unconnected state 🟡)
LWC->>LWC: Retrieves CSM User Info (sfUserId, sfOrgId, userEmail)
CSM->>LWC: Clicks "Sign in with Slack"
LWC->>GCP_In: window.open("http://localhost:8080/auth/login?sfUserId=...&email=...")
Note over GCP_In,SlackConsent: 2. Render Slack Authorization Consent Interface
GCP_In-->>CSM: Renders branded Slack Consent Screen (App info, user email, requested scopes)
Note over CSM,SlackConsent: 3. CSM Reviews Permissions & Clicks "Allow"
CSM->>SlackConsent: Clicks "Allow" (Accept button)
Note over SlackConsent,GCP_Confirm: 4. Provisioning & Database Persistence
SlackConsent->>GCP_Confirm: POST /auth/slack/confirm { sfUserId, email, decision: 'allow' }
GCP_Confirm->>SlackAPI: POST users.lookupByEmail(email)
SlackAPI-->>GCP_Confirm: Returns Slack User ID (e.g. U0C055QM9JB)
GCP_Confirm->>SlackAPI: POST conversations.open({ users: "U0C055QM9JB" })
SlackAPI-->>GCP_Confirm: Returns Private DM Channel ID (e.g. D0C0LFM5B6E)
GCP_Confirm->>SFDB: PATCH /services/data/v61.0/sobjects/User/{sfUserId}<br/>{ Slack_User_Id__c, Slack_DM_Channel_Id__c, Slack_Connected_Email__c }
SFDB-->>GCP_Confirm: HTTP 204 Success
Note over GCP_Confirm,LWC: 5. Handshake Completion & Window Auto-Closure
GCP_Confirm-->>CSM: Returns HTML with window.opener.postMessage(SLACK_AUTH_SUCCESS) & window.close()
Note over CSM,LWC: Popup window closes automatically!
LWC->>LWC: Receives postMessage event
LWC->>LWC: Status turns Green 🟢 "Connected to Slack (D0C0LFM5B6E)"
LWC->>LWC: Chat composer unlocks & isolated private thread history loads
</div>
</div>
<hr class="section-divider"/>
</section>
<section class="section-card" id="sec-3-dual-mode-authentication-engine">
<h2 class="section-title"><span class="title-badge">SECTION</span> 3. Dual-Mode Authentication Engine</h2>
<p>The integration supports two complementary operational modes:</p>
<h3 class="sub-title">Mode A: Production Official Slack OAuth 2.0 (When <code class="inline-code">SLACK_CLIENT_ID</code> is set)</h3>
<ul class="styled-list">
<li>When <code class="inline-code">SLACK_CLIENT_ID</code> and <code class="inline-code">SLACK_CLIENT_SECRET</code> are configured in <code class="inline-code">slack-gemini-agent/.env</code>:</li>
</ul>
<ol class="styled-ordered-list">
<li><code class="inline-code">GET /auth/login</code> signs the state parameter (HMAC SHA-256).</li>
<li>Issues an <code class="inline-code">HTTP 302 Redirect</code> directly to <code class="inline-code">https://slack.com/oauth/v2/authorize</code>.</li>
<li>Slack renders its official cloud-hosted authorization screen.</li>
<li>Clicking "Allow" redirects to <code class="inline-code">/auth/slack/callback?code=...</code>.</li>
<li>GCP exchanges the code via <code class="inline-code">oauth.v2.access</code> and completes the flow.</li>
</ol>
<h3 class="sub-title">Mode B: Interactive Slack Workspace Consent Screen (Zero-Configuration Mode)</h3>
<ul class="styled-list">
<li>When testing locally or before configuring OAuth credentials in Slack App settings:</li>
</ul>
<ol class="styled-ordered-list">
<li><code class="inline-code">GET /auth/login</code> renders an interactive <strong>Slack Workspace Authorization Interface</strong> (<code class="inline-code">renderSlackConsentHtml</code>).</li>
<li>Displays the exact Slack brand styling, workspace name (<code class="inline-code">AI Studio Agent with Slack</code>), app name (<code class="inline-code">test_agent_app</code>), and user corporate email (<code class="inline-code">skgsummo5@gmail.com</code>).</li>
<li>Displays requested permissions:</li>
</ol>
<ul class="styled-list">
<li>👤 <strong>View your email and member profile</strong> in the workspace.</li>
<li>💬 <strong>Open a private 1-on-1 Direct Message channel</strong> with the AI Bot.</li>
<li>🤖 <strong>Synchronize AI Agent conversations</strong> with Salesforce CRM.</li>
</ul>
<ol class="styled-ordered-list">
<li>Presents the mandatory <strong>"Allow" (Accept)</strong> and <strong>"Cancel"</strong> buttons.</li>
<li>Clicking <strong>"Allow"</strong> triggers <code class="inline-code">POST /auth/slack/confirm</code>, which resolves identity via Slack Web API, updates Salesforce via REST API, renders the success screen, and auto-closes the popup.</li>
<li>Clicking <strong>"Cancel"</strong> fires <code class="inline-code">SLACK_AUTH_ERROR</code> to Salesforce and closes the window without making changes.</li>
</ol>
<hr class="section-divider"/>
</section>
<section class="section-card" id="sec-4-codebase-implementation-breakdown">
<h2 class="section-title"><span class="title-badge">SECTION</span> 4. Codebase Implementation Breakdown</h2>
<h3 class="sub-title">1. GCP Bot Service Layer (<code class="inline-code">slack-gemini-agent</code>)</h3>
<h4 class="sub-sub-title">A. Auth Routing (<code class="inline-code">src/index.ts</code>)</h4>
<ul class="styled-list">
<li>Line 67: Routes <code class="inline-code">GET /auth/login</code> to <code class="inline-code">handleAuthLogin(req, res)</code>.</li>
<li>Line 73: Routes <code class="inline-code">POST /auth/slack/confirm</code> and <code class="inline-code">GET /auth/slack/confirm</code> to <code class="inline-code">handleAuthConfirm(req, res)</code>.</li>
<li>Line 79: Routes <code class="inline-code">GET /auth/slack/callback</code> to <code class="inline-code">handleAuthCallback(req, res)</code>.</li>
<li>Line 85: Routes <code class="inline-code">POST /api/chat</code> to <code class="inline-code">handleLwcChatRequest(app, payload)</code>.</li>
</ul>
<h4 class="sub-sub-title">B. Handshake & Consent Engine (<code class="inline-code">src/api/auth.ts</code>)</h4>
<ul class="styled-list">
<li><code class="inline-code">renderSlackConsentHtml(params)</code>: Generates the Slack-branded consent interface with Allow/Cancel buttons.</li>
<li><code class="inline-code">handleAuthLogin(req, res)</code>: Inspects <code class="inline-code">sfUserId</code> and <code class="inline-code">email</code>. If <code class="inline-code">SLACK_CLIENT_ID</code> exists, 302 redirects to Slack; otherwise renders the Slack consent UI.</li>
<li><code class="inline-code">handleAuthConfirm(req, res)</code>: Processes the user's "Allow" click. Calls <code class="inline-code">provisionSlackUserDirectly()</code>, persists credentials on the Salesforce User record via REST API, renders self-closing HTML, and dispatches <code class="inline-code">SLACK_AUTH_SUCCESS</code>.</li>
<li><code class="inline-code">provisionSlackUserDirectly(email, sfUserId)</code>:</li>
</ul>
<ol class="styled-ordered-list">
<li>Looks up Slack user via <code class="inline-code">https://slack.com/api/users.lookupByEmail</code>.</li>
<li>Provisions DM channel via <code class="inline-code">https://slack.com/api/conversations.open</code>.</li>
<li>Calls <code class="inline-code">updateSalesforceUserRecord(sfUserId, slackUserId, dmChannelId, email)</code>.</li>
</ol>
<hr class="section-divider"/>
<h3 class="sub-title">2. Salesforce Apex Layer</h3>
<h4 class="sub-sub-title">A. <code class="inline-code">SlackUserIdentityService.cls</code></h4>
<ul class="styled-list">
<li>Line 47: <code class="inline-code">GCP_SLACK_AUTH_URL = Test.isRunningTest() ? null : 'http://localhost:8080/auth/login';</code></li>
<li>In normal execution: defaults to the active GCP auth service entry point.</li>
<li>In test execution: defaults to <code class="inline-code">null</code> to ensure 100% test isolation.</li>
<li><code class="inline-code">getGcpSlackAuthUrl()</code>: Returns the formatted URL with current <code class="inline-code">sfUserId</code>, <code class="inline-code">sfOrgId</code>, and <code class="inline-code">userEmail</code>.</li>
<li><code class="inline-code">getGcpSlackAuthUrlForEmail(String customEmail)</code>: Supports dynamic targeting of alternate emails.</li>
<li><code class="inline-code">setGcpSlackAuthUrl(String newUrl)</code>: Allows dynamic runtime switching between local (<code class="inline-code">http://localhost:8080/auth/login</code>) and deployed Cloud Run (<code class="inline-code">https://slack-gemini-agent-xxxx.a.run.app/auth/login</code>).</li>
</ul>
<h4 class="sub-sub-title">B. <code class="inline-code">SlackBotAgentController.cls</code></h4>
<ul class="styled-list">
<li>Exposes AuraEnabled methods for LWC consumption:</li>
<li><code class="inline-code">@AuraEnabled public static String getGcpSlackAuthUrl()</code></li>
<li><code class="inline-code">@AuraEnabled public static String getGcpSlackAuthUrlForEmail(String targetEmail)</code></li>
<li><code class="inline-code">@AuraEnabled public static void setGcpSlackAuthUrl(String newUrl)</code></li>
</ul>
<hr class="section-divider"/>
<h3 class="sub-title">3. Salesforce Lightning Web Component (<code class="inline-code">slackBotAgent</code>)</h3>
<h4 class="sub-sub-title">A. Controller Logic (<code class="inline-code">slackBotAgent.js</code>)</h4>
<ul class="styled-list">
<li><code class="inline-code">handleOfficialSlackLogin()</code>:</li>
<li>Automatically derives the CSM's Salesforce user email (<code class="inline-code">UserInfo.getUserEmail()</code>).</li>
<li>Calls <code class="inline-code">getGcpSlackAuthUrlForEmail()</code>.</li>
<li>Opens a centered popup window (<code class="inline-code">620x750px</code>) pointing to the GCP auth entry point.</li>
<li><strong>Removed the previous silent bypass</strong>: Never executes direct background Apex credentials login. The user must experience the popup and consent screen.</li>
<li><code class="inline-code">handleOAuthMessage(event)</code>:</li>
<li>Listens for <code class="inline-code">window.postMessage</code> from the closed popup.</li>
<li>Upon receiving <code class="inline-code">SLACK_AUTH_SUCCESS</code>:</li>
<li>Updates local reactive state (<code class="inline-code">isConnected = true</code>).</li>
<li>Dispatches success toast notification: <em>"Connected to Slack Workspace as {userName} ({slackDmChannelId})"</em>.</li>
<li>Closes settings modal if open.</li>
<li>Calls <code class="inline-code">loadSlackIdentity()</code> and <code class="inline-code">loadChatThreads()</code>.</li>
<li>Turns the status badge to <strong><code class="inline-code">Connected 🟢</code></strong> and unlocks the composer.</li>
</ul>
<hr class="section-divider"/>
</section>
<section class="section-card" id="sec-5-salesforce-configuration-permissions-checklist">
<h2 class="section-title"><span class="title-badge">SECTION</span> 5. Salesforce Configuration & Permissions Checklist</h2>
<h3 class="sub-title">1. Custom User Fields</h3>
<p>Stored on the standard Salesforce <code class="inline-code">User</code> object for instant (<5ms) identity lookup:</p>
<div class="table-responsive"><table class="styled-table"><thead><tr><th>Field Label</th><th>API Name</th><th>Type</th><th>Purpose</th></tr></thead><tbody><tr><td><strong>Slack User ID</strong></td><td><code class="inline-code">Slack_User_Id__c</code></td><td>Text(30)</td><td>Unique Slack Member ID (e.g. <code class="inline-code">U0C055QM9JB</code>)</td></tr><tr><td><strong>Slack DM Channel ID</strong></td><td><code class="inline-code">Slack_DM_Channel_Id__c</code></td><td>Text(30)</td><td>Dedicated private 1-on-1 DM channel (e.g. <code class="inline-code">D0C0LFM5B6E</code>)</td></tr><tr><td><strong>Slack Connected Email</strong></td><td><code class="inline-code">Slack_Connected_Email__c</code></td><td>Email</td><td>Verified corporate email bound to Slack</td></tr><tr><td><strong>Slack Pairing Code</strong></td><td><code class="inline-code">Slack_Pairing_Code__c</code></td><td>Text(30)</td><td>Ephemeral pairing code for manual verification</td></tr></tbody></table></div>
<h3 class="sub-title">2. Permission Set: <code class="inline-code">Slack_Bot_Agent_User</code></h3>
<p>Grants Read & Edit access to custom Slack fields on User, and Apex class execution for:</p>
<ul class="styled-list">
<li><code class="inline-code">SlackUserIdentityService</code></li>
<li><code class="inline-code">SlackBotAgentController</code></li>
<li><code class="inline-code">LearnDCAccountCopilotController</code></li>
<li><code class="inline-code">SlackOAuthCallbackController</code></li>
<li><code class="inline-code">LearnDCMCPAccountAction</code>, <code class="inline-code">LearnDCMCPThreadAction</code>, <code class="inline-code">LearnDCMCPMeetingAction</code></li>
</ul>
<h3 class="sub-title">3. User Setup (e.g. Summo CSM)</h3>
<p>To configure any new CSM user:</p>
<ol class="styled-ordered-list">
<li>Create or verify User record in Salesforce:</li>
</ol>
<ul class="styled-list">
<li>Name: <strong>Summo CSM</strong></li>
<li>Email: <code class="inline-code">skgsummo5@gmail.com</code></li>
<li>Profile: <code class="inline-code">Standard Platform User</code> (or <code class="inline-code">System Administrator</code>)</li>
</ul>
<ol class="styled-ordered-list">
<li>Assign Permission Sets:</li>
</ol>
<ul class="styled-list">
<li><code class="inline-code">Slack_Bot_Agent_User</code></li>
<li><code class="inline-code">Snowflake_Integration_User</code></li>
<li><code class="inline-code">Google_Calendar_Integration_User</code></li>
<li><code class="inline-code">Student_Access</code></li>
</ul>
<ol class="styled-ordered-list">
<li>Verify membership in Slack workspace:</li>
</ol>
<ul class="styled-list">
<li>Ensure the user has been invited to or joined workspace <strong>AI Studio Agent with Slack</strong> (<code class="inline-code">T0BU7EDE40P</code>).</li>
</ul>
<hr class="section-divider"/>
</section>
<section class="section-card" id="sec-6-testing-operational-verification-guide">
<h2 class="section-title"><span class="title-badge">SECTION</span> 6. Testing & Operational Verification Guide</h2>
<div class="step-card">
<div class="step-header">
<span class="step-badge">STEP 1</span>
<h4>Start the Local / Cloud Run Bot Service</h4>
</div>
<p>From the <code class="inline-code">slack-gemini-agent</code> directory:</p>
<div class="code-container">
<div class="code-header">
<span class="lang-tag">BASH</span>
<button class="copy-btn" onclick="copyCode(this)">Copy Code</button>
</div>
<pre><code class="language-bash">cd slack-gemini-agent
npm run build
node dist/index.js</code></pre>
</div>
<p>Expected output:</p>
<div class="code-container">
<div class="code-header">
<span class="lang-tag">CODE</span>
<button class="copy-btn" onclick="copyCode(this)">Copy Code</button>
</div>
<pre><code class="language-">⚡️ Slack Gemini Agent is connected and running in Socket Mode!
🤖 Using LLM Model: gemini-3.6-flash