forked from DigammaF/AxiomEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
975 lines (821 loc) · 36.3 KB
/
index.html
File metadata and controls
975 lines (821 loc) · 36.3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AXIOM // DECENTRALIZED TRUTH</title>
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#00f0ff">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Axiom">
<style>
:root {
--bg-color: #050505;
--term-bg: #0a0f14;
--neon-cyan: #00f0ff;
--neon-green: #22c55e;
--neon-pink: #ff0055;
--text-color: #e0e0e0;
--dim-color: #555;
--font-main: 'Courier New', Courier, monospace;
}
body {
background-color: var(--bg-color);
color: var(--text-color);
font-family: var(--font-main);
margin: 0;
padding: 0;
overflow-x: hidden;
background-image:
linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
background-size: 100% 2px, 3px 100%;
}
body::before {
content: " ";
display: block;
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
background-size: 100% 4px;
z-index: 999;
pointer-events: none;
}
.container {
max-width: 900px;
margin: 0 auto;
padding: 20px;
position: relative;
z-index: 1;
}
header {
text-align: center;
padding: 3rem 0;
border-bottom: 1px solid var(--dim-color);
}
h1 {
font-size: 4rem;
margin: 0;
text-transform: uppercase;
letter-spacing: 5px;
color: var(--text-color);
text-shadow: 2px 2px 0px var(--neon-cyan);
}
h1 span {
color: var(--neon-cyan);
}
header p {
font-size: 0.9rem;
color: var(--neon-cyan);
text-transform: uppercase;
letter-spacing: 2px;
}
.terminal-wrapper {
background-color: var(--term-bg);
border: 1px solid var(--neon-cyan);
box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
padding: 20px;
margin: 2rem 0 1rem 0;
border-radius: 4px;
position: relative;
}
.terminal-header {
font-size: 0.8rem;
color: var(--dim-color);
margin-bottom: 15px;
border-bottom: 1px dashed var(--dim-color);
padding-bottom: 5px;
display: flex;
justify-content: space-between;
}
.status-light {
display: inline-block;
width: 8px;
height: 8px;
background-color: var(--neon-green);
border-radius: 50%;
margin-right: 5px;
box-shadow: 0 0 5px var(--neon-green);
}
.terminal-display {
min-height: 180px;
max-height: 260px;
overflow-y: auto;
font-size: 0.9rem;
margin-bottom: 15px;
color: var(--text-color);
}
.log-entry { margin-bottom: 5px; }
.log-time { color: var(--dim-color); margin-right: 10px; }
.log-cyan { color: var(--neon-cyan); }
.log-green { color: var(--neon-green); }
.log-pink { color: var(--neon-pink); }
.log-red { color: #ff4444; }
.input-line {
display: flex;
align-items: center;
border-top: 1px solid var(--dim-color);
padding-top: 10px;
}
.prompt {
color: var(--neon-green);
margin-right: 10px;
font-weight: bold;
}
input[type="text"] {
background: transparent;
border: none;
color: var(--neon-cyan);
font-family: var(--font-main);
font-size: 1.1rem;
flex-grow: 1;
outline: none;
}
button.exec-btn {
background: var(--neon-cyan);
color: #000;
border: none;
padding: 5px 15px;
font-family: var(--font-main);
font-weight: bold;
cursor: pointer;
text-transform: uppercase;
}
button.exec-btn:hover {
background: #fff;
box-shadow: 0 0 10px var(--neon-cyan);
}
section {
padding: 2rem 0;
border-bottom: 1px solid #222;
}
h2 {
font-size: 2rem;
color: var(--neon-cyan);
border-left: 5px solid var(--neon-cyan);
padding-left: 15px;
margin-bottom: 1.5rem;
text-transform: uppercase;
}
.card {
background: rgba(20, 20, 20, 0.8);
border: 1px solid #333;
padding: 1.5rem;
transition: all 0.3s ease;
}
.card:hover {
border-color: var(--neon-cyan);
transform: translateX(5px);
}
.card h3 {
margin-top: 0;
color: #fff;
}
.btn {
display: inline-block;
border: 1px solid var(--neon-cyan);
color: var(--neon-cyan);
padding: 10px 20px;
text-decoration: none;
margin-top: 10px;
text-transform: uppercase;
font-size: 0.9rem;
transition: 0.2s;
}
.btn:hover {
background: var(--neon-cyan);
color: #000;
box-shadow: 0 0 15px var(--neon-cyan);
}
.download-grid, .community-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
margin-top: 1rem;
}
footer {
text-align: center;
padding: 3rem;
color: var(--dim-color);
font-size: 0.8rem;
border-top: 1px solid #222;
}
footer a { color: var(--dim-color); text-decoration: none; }
footer a:hover { color: var(--neon-cyan); }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-cyan); }
.user-guide-section { margin-bottom: 2rem; }
.user-guide-rendered { font-size: 0.9rem; line-height: 1.5; }
.user-guide-rendered h1, .user-guide-rendered h2, .user-guide-rendered h3 { color: var(--neon-cyan); margin-top: 1rem; margin-bottom: 0.5rem; }
.user-guide-rendered h1 { font-size: 1.2rem; } .user-guide-rendered h2 { font-size: 1.1rem; } .user-guide-rendered h3 { font-size: 1rem; }
.user-guide-rendered p { margin: 0.5rem 0; color: var(--text-color); }
.user-guide-rendered ul, .user-guide-rendered ol { margin: 0.5rem 0; padding-left: 1.5rem; }
.user-guide-rendered li { margin: 0.25rem 0; }
.user-guide-rendered code, .user-guide-rendered pre { background: rgba(10, 15, 20, 0.9); color: var(--neon-green); padding: 2px 6px; border-radius: 3px; font-size: 0.85em; }
.user-guide-rendered pre { display: block; padding: 10px; overflow-x: auto; }
.user-guide-rendered a { color: var(--neon-cyan); text-decoration: none; }
.user-guide-rendered a:hover { text-decoration: underline; }
.user-guide-rendered hr { border: none; border-top: 1px solid #333; margin: 1rem 0; }
.user-guide-rendered table { border-collapse: collapse; width: 100%; margin: 0.5rem 0; font-size: 0.85rem; }
.user-guide-rendered th, .user-guide-rendered td { border: 1px solid #333; padding: 6px 8px; text-align: left; }
.user-guide-rendered th { color: var(--neon-cyan); }
/* Knowledge canvas layout */
.canvas-wrapper {
background: rgba(5, 5, 5, 0.9);
border: 1px solid #222;
box-shadow: 0 0 15px rgba(0, 240, 255, 0.08);
border-radius: 4px;
padding: 15px 18px 18px 18px;
margin-bottom: 2rem;
}
.canvas-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
font-size: 0.85rem;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--dim-color);
}
.canvas-header span.label {
color: var(--neon-cyan);
}
.canvas-filters {
display: flex;
flex-wrap: wrap;
gap: 10px;
font-size: 0.8rem;
margin-bottom: 10px;
}
.canvas-filters label {
display: flex;
align-items: center;
gap: 4px;
background: rgba(10, 15, 20, 0.9);
border: 1px solid #222;
padding: 4px 8px;
border-radius: 3px;
}
.canvas-filters select,
.canvas-filters input[type="checkbox"] {
background: transparent;
border: none;
color: var(--neon-cyan);
font-family: var(--font-main);
font-size: 0.8rem;
}
.canvas-filters select:focus {
outline: none;
}
.results-grid {
display: grid;
grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr);
gap: 12px;
min-height: 220px;
max-height: 420px;
}
@media (max-width: 900px) {
.results-grid {
grid-template-columns: 1fr;
}
}
.results-column {
background: rgba(8, 12, 16, 0.95);
border: 1px solid #111;
padding: 10px;
overflow-y: auto;
}
.results-column h3 {
margin: 0 0 8px 0;
font-size: 0.85rem;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--neon-cyan);
}
.fact-card {
border: 1px solid #222;
padding: 8px 9px;
margin-bottom: 8px;
font-size: 0.8rem;
background: rgba(5, 8, 12, 0.95);
}
.fact-card .meta {
font-size: 0.7rem;
color: var(--dim-color);
margin-bottom: 4px;
}
.fact-card .meta span.tag {
margin-right: 6px;
}
.fact-card .content {
margin-bottom: 4px;
}
.fact-card .source {
font-size: 0.7rem;
color: var(--dim-color);
}
.fact-card .fact-timestamp {
font-size: 0.75rem;
color: var(--neon-cyan);
margin-bottom: 4px;
}
.mesh-node {
display: inline-block;
padding: 4px 8px;
margin: 2px 3px;
border-radius: 12px;
border: 1px solid #222;
font-size: 0.75rem;
background: rgba(5, 12, 18, 0.95);
}
.mesh-node.core {
border-color: var(--neon-cyan);
color: var(--neon-cyan);
box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}
.mesh-node.edge {
border-color: var(--neon-pink);
color: var(--neon-pink);
}
.mesh-edge-meta {
display: block;
font-size: 0.65rem;
color: var(--dim-color);
}
.empty-state {
font-size: 0.8rem;
color: var(--dim-color);
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>AXIOM<span class="blink">_</span></h1>
<p>Decentralized Knowledge Ledger // v0.2.2-beta.1<span class="blink">_</span>beta</p>
</header>
<section id="user-guide" class="card user-guide-section">
<h2>// INTERFACE_GUIDE</h2>
<div id="user-guide-content" class="user-guide-rendered"></div>
</section>
<div class="terminal-wrapper">
<div class="terminal-header">
<span><span class="status-light"></span>CONNECTED: LOCAL_HOST::8009</span>
<span>ENCRYPTION: ENABLED</span>
</div>
<div class="terminal-display" id="output">
<div class="log-entry"><span class="log-time">SYS_INIT</span> <span class="log-cyan">Welcome to Axiom Web Interface.</span></div>
<div class="log-entry"><span class="log-time">READY</span> <span class="log-green">Node connection established. Waiting for query...</span></div>
</div>
<div class="canvas-wrapper">
<div class="canvas-header">
<span class="label">// KNOWLEDGE_CANVAS</span>
<span id="canvasStatus">Idle. Awaiting query.</span>
</div>
<div class="canvas-filters">
<label>
LIMIT
<select id="resultLimit">
<option value="10">10</option>
<option value="20" selected>20</option>
<option value="50">50</option>
</select>
</label>
<label>
<input type="checkbox" id="exactMatch">
EXACT_MATCH
</label>
<label>
<input type="checkbox" id="includeUncorroborated" checked>
INCLUDE_UNCORROBORATED
</label>
</div>
<div class="results-grid">
<div class="results-column" id="factsColumn">
<h3>// LEDGER_RESULTS</h3>
<div id="factsPanel" class="empty-state">
No query yet. Results will appear here.
</div>
</div>
<div class="results-column" id="meshColumn">
<h3>// LEXICAL_MESH</h3>
<div id="meshPanel" class="empty-state">
Concept graph will appear here after a query.
</div>
</div>
</div>
</div>
<div class="input-line">
<span class="prompt">USER@AXIOM:~$</span>
<input type="text" id="queryInput" placeholder="Enter keyword to query the ledger..." autocomplete="off">
<button class="exec-btn" onclick="runQuery()">EXECUTE</button>
<button id="muteToggle" class="mode-btn" onclick="toggleMute()" style="background:transparent; border:1px solid #00f0ff; color:#00f0ff; padding: 5px 10px; font-size:10px; margin-left: 15px; cursor:pointer;">MUTE [OFF]</button>
</div>
</div>
<main>
<section id="mission">
<h2>// MISSION_STATEMENT</h2>
<div class="card">
<h3>Bootstrap Test</h3>
<p>Type: --> connect https://vics-imac-1.tail37b4f2.ts.net <-- in the "USER@AXIOM:~$" terminal to connect to the P2P bootstrap nodes.</p>
<p>Or Connect Locally by downloading the latest release or running python build_standalone.py and then using your local URL/ tailscale funnel.</p>
<p>Search anything to test out AXIOM ENGINE.
<p>In an age of digital noise, shared truth is decaying. Axiom is an autonomous, decentralized organism designed to discover, verify, and preserve objective knowledge.</p>
<p>NOT a company. NOT a search engine. A permanent public utility for truth, immune to censorship and manipulation.</p>
</div>
</section>
<section id="download">
<h2>// CLIENT_ACCESS</h2>
<div class="card">
<h3>INITIATE LINK</h3>
<p>The Axiom Client is your secure gateway. Ask any question, get a verifiable answer sourced from the mesh network.</p>
<div class="download-grid">
<a href="https://github.com/vicsanity623/AxiomEngine/releases/download/voice/Axiom_Node_v0.2.2-beta.1_x86_64.dmg" class="btn">[DOWNLOAD] macOS (Intel/ARM)</a>
<a href="#" class="btn">[DOWNLOAD] Windows</a>
<a href="#" class="btn">[DOWNLOAD] Linux</a>
</div>
</div>
</section>
<section id="run-a-node">
<h2>// OPERATOR_MODE</h2>
<div class="card">
<h3>RUN A NODE. DEFEND THE TRUTH.</h3>
<p>Contribute idle resources to verify facts. Support the digital commonwealth. All software is open-source (PPL).</p>
<a href="https://github.com/vicsanity623/AxiomEngine" class="btn">GITHUB REPO -></a>
</div>
</section>
<section id="community">
<h2>// HIVE_MIND</h2>
<div class="card">
<h3>JOIN THE COLLECTIVE</h3>
<div class="community-grid">
<a href="#" class="btn">DISCORD SERVER</a>
<a href="#" class="btn">REDDIT CHANNEL</a>
</div>
</div>
</section>
</main>
<footer>
<p>AXIOM PROTOCOL // OPEN SOURCE (PPL) // 2026</p>
<p>
<a href="https://github.com/vicsanity623/AxiomEngine">SOURCE</a> |
<a href="https://github.com/vicsanity623/AxiomEngine/DAO_CHARTER.md">CHARTER</a> |
</p>
</footer>
</div>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script type="text/markdown" id="user-guide-md">
# Axiom Web Interface — User Guide
This guide explains how to use the **AXIOM** web interface to query the decentralized knowledge ledger and inspect results.
---
## 1. Overview
The page is a single **AXIOM AGENT** window that combines:
- **Console** — Command-style input and Axiom's spoken/written answers.
- **Knowledge Canvas** — Ledger results and Lexical Mesh for the query concept.
- **Filters** — Limit, exact match, and uncorroborated-inclusion options.
---
## 2. Connecting to a Node
- **Default:** The page connects to `http://127.0.0.1:8009` (local node).
- **To switch node:** Type `connect https://your-node-url.example.com` or `connect http://127.0.0.1:8010` and press Enter. The header updates to show the active connection.
- **HTTPS:** If the page is served over HTTPS, use `connect https://...`; browsers block mixed content.
---
## 3. Asking a Question (Chat)
- Type any question or topic in the **USER@AXIOM:~$** field (e.g. `epstein files`, `economy`, `what is the lexical mesh`).
- Press **Enter** or click **EXECUTE**.
- **AXIOM >>** shows the node's answer. Voice is **off** by default; click **MUTE [OFF]** to turn it **on** if you want speech.
---
## 4. Knowledge Canvas (Ledger + Mesh)
After each query, two panels update:
- **// LEDGER_RESULTS** — Matching facts: status, trust score, fragment flags, **timestamp line** (e.g. "On Sunday, Sep 15, 2026 it was verified that…"), fact text, and source URL. The timestamp is the stable fact-check reference if the source link dies.
- **// LEXICAL_MESH** — Concepts linked to the query term (word relations and strengths).
**Filters:** LIMIT (10/20/50), EXACT_MATCH, INCLUDE_UNCORROBORATED.
---
## 5. Voice (Speech Synthesis)
- **Default:** Voice is **off** (muted) when the page first loads.
- **Toggle:** Click **MUTE [OFF]** to turn voice **on** (button becomes **MUTE [ON]**). Click again to mute. Your choice is remembered (localStorage).
---
## 6. Fact-Check Timestamps
Each fact card shows a timestamp line:
- **Trusted:** *"On [Weekday], [Mon], [DD], [YYYY] it was verified that…"*
- **Uncorroborated:** *"As of [Weekday], [Mon], [DD], [YYYY] uncorroborated claims state that…"*
- **Disputed:** *"As of [Weekday], [Mon], [DD], [YYYY] disputed claims state that…"*
The date comes from the fact's ingest time on the node.
---
## 7. Quick Reference
| Action | How |
|--------|-----|
| Query the ledger | Type a question, press Enter or EXECUTE. |
| Change node | `connect https://…` or `connect http://…` |
| Toggle voice | Click MUTE [OFF] / MUTE [ON]. |
| More/fewer facts | Change LIMIT (10 / 20 / 50). |
| Stricter matches | Check EXACT_MATCH. |
| Hide uncorroborated | Uncheck INCLUDE_UNCORROBORATED. |
---
*AXIOM // Decentralized Knowledge Ledger // Open Source (PPL)*
</script>
<script>
const input = document.getElementById('queryInput');
const output = document.getElementById('output');
const nodeHeader = document.querySelector('.terminal-header span');
const EXECUTE_BTN = document.querySelector('.exec-btn');
const canvasStatus = document.getElementById('canvasStatus');
const resultLimitEl = document.getElementById('resultLimit');
const exactMatchEl = document.getElementById('exactMatch');
const includeUncorroboratedEl = document.getElementById('includeUncorroborated');
const factsPanel = document.getElementById('factsPanel');
const meshPanel = document.getElementById('meshPanel');
function deriveSearchToken(raw) {
const parts = String(raw || "")
.split(/\s+/)
.map(p => p.trim())
.filter(Boolean);
if (!parts.length) return "";
const blacklist = new Set(["think", "axiom", "about", "the", "a", "an", "of"]);
let candidates = parts.filter(w => w.length > 3 && !blacklist.has(w.toLowerCase()));
if (!candidates.length) {
candidates = parts;
}
// Prefer the last strong token (often the real subject, e.g. "trump" in "think trump")
return candidates[candidates.length - 1].toLowerCase();
}
// --- GLOBAL STATE ---
let isMuted = true; // Default: voice OFF on first load; user can toggle on
function speak(text) {
const synth = window.speechSynthesis;
if (!synth || isMuted) return; // Check Muted state before even starting
// If speech is already running, cancel it to prevent overlapping voices
synth.cancel();
const utterance = new SpeechSynthesisUtterance(text);
// Robot Calibration
utterance.pitch = 0.6;
utterance.rate = 0.9;
const voices = synth.getVoices();
const robotVoice = voices.find(v => v.name.includes("Daniel") || v.name.includes("Google UK English Male"));
if (robotVoice) utterance.voice = robotVoice;
synth.speak(utterance);
}
function toggleMute() {
isMuted = !isMuted;
localStorage.setItem('axiom_muted', isMuted);
updateMuteButtonDisplay();
// Send status update back to the Node (Optional, but good for logging)
// We use the currently active node URL for this communication
const nodeUrl = localStorage.getItem("axiom_node_url") || "http://127.0.0.1:8009";
fetch(`${nodeUrl}/sys_status?muted=${isMuted}`); // Assuming you might add this route later, otherwise safe to ignore.
log(`[SYS_INIT] Speech Synthesis: ${isMuted ? 'MUTED' : 'ACTIVE'}`, 'log-dim');
// If muting, immediately cancel any currently speaking audio
if (isMuted && window.speechSynthesis) {
window.speechSynthesis.cancel();
}
}
function updateMuteButtonDisplay() {
const btn = document.getElementById('muteToggle');
if (!btn) return;
if (isMuted) {
btn.innerText = "MUTE [OFF]";
btn.style.color = "#ff0055"; // Pink when muted
} else {
btn.innerText = "MUTE [ON]";
btn.style.color = "#00f0ff"; // Cyan when active
}
}
// --- CORE LOGIC ---
input.addEventListener("keypress", function(event) {
if (event.key === "Enter") {
runQuery();
}
});
function log(msg, colorClass="") {
const time = new Date().toLocaleTimeString('en-US', {hour12: false});
const div = document.createElement('div');
div.className = 'log-entry';
div.innerHTML = `<span class="log-time">[${time}]</span> <span class="${colorClass}">${msg}</span>`;
output.appendChild(div);
output.scrollTop = output.scrollHeight;
}
async function runQuery() {
const term = input.value.trim();
if (!term) return;
// CONNECT COMMAND LOGIC
if (term.startsWith("connect ")) {
let newUrl = term.split(" ")[1].replace(/\/$/, "");
if (window.location.protocol === 'https:' && !newUrl.startsWith('https://')) {
log("SECURITY UPGRADE: Forcing HTTPS for Secure Context", "log-dim");
newUrl = newUrl.replace('http://', 'https://');
if (!newUrl.startsWith('https://')) newUrl = 'https://' + newUrl;
}
localStorage.setItem("axiom_node_url", newUrl);
log(`NODE LINK UPDATED: ${newUrl}`, "log-green");
document.querySelector('.terminal-header span').innerHTML =
`<span class="status-light"></span>CONNECTED: ${newUrl.replace(/^https?:\/\//, "")}`;
input.value = "";
return;
}
log(`INITIATING INFERENCE: "${term}"...`, 'log-cyan');
const concept = deriveSearchToken(term);
if (concept) {
canvasStatus.textContent = `Querying ledger + mesh for "${concept}"...`;
} else {
canvasStatus.textContent = `Querying ledger + mesh...`;
}
input.value = "";
input.disabled = true;
const githubDefault = "https://vics-imac-1.tail137b4f2.ts.net";
const localDefault = "http://127.0.0.1:8009";
const activeNode = localStorage.getItem("axiom_node_url") ||
(window.location.hostname.includes("github.io") ? githubDefault : localDefault);
try {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 4000);
const response = await fetch(`${activeNode}/think?query=${encodeURIComponent(term)}`);
clearTimeout(timeoutId);
const data = await response.json();
if (data.response) {
log(`AXIOM >> ${data.response}`, 'log-green');
speak(data.response); // ACTIVATE THE MOUTH!
// In parallel, fetch ledger + mesh results for the canvas.
const options = {
limit: parseInt(resultLimitEl.value, 10) || 20,
exact: exactMatchEl.checked,
includeUncorroborated: includeUncorroboratedEl.checked,
};
if (concept) {
try {
await updateKnowledgeCanvas(activeNode, concept, options);
} catch (e) {
log("WARN: Unable to render full knowledge canvas for this query.", "log-dim");
canvasStatus.textContent = "Canvas update failed for this query.";
}
} else {
canvasStatus.textContent = "Canvas idle. No concept keyword derived from query.";
}
} else {
log(`QUERY FAILED: No structured response from Node.`, 'log-red');
canvasStatus.textContent = "No response payload from node.";
}
} catch (error) {
if (window.location.protocol === 'https:' && activeNode.startsWith('http://')) {
log("CRITICAL: Browser blocked insecure link (Mixed Content).", "log-red");
log("FIX: Type 'connect https://<your-tailscale-url>'", "log-cyan");
} else {
log(`WARN: NODE [${activeNode}] UNREACHABLE.`, "log-red");
log("HINT: Ensure 'tailscale funnel 8009' is running on iMac.", "log-dim");
}
setTimeout(() => {
log("Simulation: Scanning Distributed Hash Table...", "log-cyan");
}, 800);
canvasStatus.textContent = "Node unreachable. Check connection or bootstrap settings.";
}
input.disabled = false;
input.focus();
}
async function updateKnowledgeCanvas(nodeUrl, term, options) {
const factsUrl = `${nodeUrl}/local_query?term=${encodeURIComponent(term)}&include_uncorroborated=${options.includeUncorroborated}`;
const meshUrl = `${nodeUrl}/mesh_query?term=${encodeURIComponent(term)}`;
const [factsRes, meshRes] = await Promise.allSettled([
fetch(factsUrl),
fetch(meshUrl),
]);
let facts = [];
if (factsRes.status === "fulfilled" && factsRes.value.ok) {
const data = await factsRes.value.json();
facts = Array.isArray(data.results) ? data.results : [];
}
let mesh = null;
if (meshRes.status === "fulfilled" && meshRes.value.ok) {
mesh = await meshRes.value.json();
}
renderFacts(term, facts, options);
renderMesh(term, mesh);
const factCount = facts.length;
canvasStatus.textContent = `Canvas ready: ${Math.min(factCount, options.limit)} of ${factCount} fact(s) + lexical mesh for "${term}".`;
}
function formatFactTimestamp(isoUtc, status) {
if (!isoUtc) return "";
let d;
try {
d = new Date(isoUtc);
if (isNaN(d.getTime())) return "";
} catch (e) {
return "";
}
const days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
const weekday = days[d.getUTCDay()];
const mon = months[d.getUTCMonth()];
const day = d.getUTCDate();
const year = d.getUTCFullYear();
const dateStr = `${weekday}, ${mon} ${day}, ${year}`;
const s = (status || "").toLowerCase();
if (s === "trusted") return `On ${dateStr} it was verified that`;
if (s === "disputed") return `As of ${dateStr} disputed claims state that`;
return `As of ${dateStr} uncorroborated claims state that`;
}
function renderFacts(term, facts, options) {
if (!factsPanel) return;
factsPanel.innerHTML = "";
let filtered = facts;
if (options.exact) {
const needle = term.toLowerCase();
filtered = facts.filter(f =>
String(f.fact_content || "").toLowerCase().includes(needle)
);
}
const limited = filtered.slice(0, options.limit);
if (!limited.length) {
factsPanel.className = "empty-state";
factsPanel.textContent = "No ledger matches for this query under current filters.";
return;
}
factsPanel.className = "";
for (const fact of limited) {
const card = document.createElement("div");
card.className = "fact-card";
const status = (fact.status || "unknown").toUpperCase();
const trust = fact.trust_score ?? "?";
const state = fact.fragment_state || "unknown";
const timestampLine = formatFactTimestamp(fact.ingest_timestamp_utc, fact.status);
let stateLabel = "";
if (state === "confirmed_fragment") stateLabel = "FRAGMENT!";
else if (state === "suspected_fragment") stateLabel = "FRAGMENT?";
card.innerHTML = `
<div class="meta">
<span class="tag">[${status}]</span>
<span class="tag">TRUST=${trust}</span>
${stateLabel ? `<span class="tag">${stateLabel}</span>` : ""}
</div>
${timestampLine ? `<div class="fact-timestamp">${timestampLine}</div>` : ""}
<div class="content">${fact.fact_content || ""}</div>
<div class="source">${fact.source_url || ""}</div>
`;
factsPanel.appendChild(card);
}
}
function renderMesh(term, mesh) {
if (!meshPanel) return;
meshPanel.innerHTML = "";
if (!mesh || !mesh.associations || !mesh.associations.length) {
meshPanel.className = "empty-state";
meshPanel.textContent = "No strong mesh associations found for this query yet.";
return;
}
meshPanel.className = "";
const core = document.createElement("div");
core.className = "mesh-node core";
core.textContent = term;
meshPanel.appendChild(core);
for (const edge of mesh.associations) {
const node = document.createElement("div");
node.className = "mesh-node edge";
const other =
edge.word_a && edge.word_a.toLowerCase() !== term.toLowerCase()
? edge.word_a
: edge.word_b;
node.textContent = other || "(unknown)";
const meta = document.createElement("span");
meta.className = "mesh-edge-meta";
meta.textContent = `${edge.relation_type || "context"} · strength=${edge.strength}`;
node.appendChild(meta);
meshPanel.appendChild(node);
}
}
// --- INITIALIZE MUTE STATE & UI (voice OFF by default) ---
window.onload = () => {
const savedNode = localStorage.getItem("axiom_node_url");
if (savedNode) {
const displayUrl = savedNode.replace(/^https?:\/\//, "");
document.querySelector('.terminal-header span').innerHTML =
`<span class="status-light"></span>CONNECTED: ${displayUrl}`;
}
const savedMute = localStorage.getItem('axiom_muted');
if (savedMute === null) {
isMuted = true;
localStorage.setItem('axiom_muted', 'true');
} else {
isMuted = savedMute === 'true';
}
updateMuteButtonDisplay();
log(`[SYS_INIT] Speech Synthesis: ${isMuted ? 'MUTED' : 'ACTIVE'}`, 'log-dim');
const guideMd = document.getElementById('user-guide-md');
const guideContent = document.getElementById('user-guide-content');
if (guideMd && guideContent && typeof marked !== 'undefined') {
guideContent.innerHTML = marked.parse(guideMd.textContent.trim());
}
};
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('./sw.js')
.then(reg => console.log('Axiom SW Registered'))
.catch(err => console.log('Axiom SW Failed', err));
});
}
</script>
</body>
</html>