-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.html
More file actions
440 lines (414 loc) · 13.8 KB
/
Copy pathsettings.html
File metadata and controls
440 lines (414 loc) · 13.8 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Settings — SovereignTrust</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&family=DM+Sans:wght@300;400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/css/main.css">
<script src="/js/auth.js"></script>
<script>requireAuth();</script>
<style>
/* ── Toggle switch ──────────────────────────────────── */
.toggle-row {
display: flex;
align-items: flex-start;
gap: 16px;
padding: 16px 0;
border-bottom: 1px solid var(--grey-light);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-info { flex: 1; min-width: 0; }
.toggle-label {
font-size: 15px;
font-weight: 500;
color: var(--navy);
margin-bottom: 3px;
}
.toggle-desc {
font-size: 13px;
color: var(--text-muted);
font-weight: 300;
line-height: 1.5;
}
.toggle-switch {
position: relative;
flex-shrink: 0;
width: 44px;
height: 24px;
margin-top: 2px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
position: absolute;
inset: 0;
background: var(--grey-light);
border-radius: 99px;
cursor: pointer;
transition: background 0.2s;
}
.toggle-slider::before {
content: '';
position: absolute;
width: 18px;
height: 18px;
left: 3px;
top: 3px;
background: #fff;
border-radius: 50%;
transition: transform 0.2s;
box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--navy); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-row.disabled { opacity: 0.45; pointer-events: none; }
.advanced-section {
margin-top: 12px;
padding: 20px;
background: var(--cream);
border: 1px solid var(--grey-light);
border-radius: var(--radius-md);
}
.advanced-section-title {
font-size: 12px;
font-weight: 500;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--text-muted);
margin-bottom: 4px;
}
/* ── Main settings layout ───────────────────────────── */
.settings-wrap {
max-width: 680px;
margin: 48px auto 80px;
padding: 0 24px;
}
.settings-section {
background: var(--white);
border: 1px solid var(--grey-light);
border-radius: var(--radius-lg);
padding: 32px;
margin-bottom: 24px;
box-shadow: var(--shadow-sm);
}
.settings-section h2 {
font-size: 20px;
color: var(--navy);
margin-bottom: 6px;
}
.settings-section .section-desc {
font-size: 14px;
color: var(--text-muted);
font-weight: 300;
margin-bottom: 28px;
line-height: 1.6;
}
.provider-grid {
display: grid;
gap: 12px;
}
.provider-card {
display: flex;
align-items: flex-start;
gap: 16px;
padding: 18px 20px;
border: 2px solid var(--grey-light);
border-radius: var(--radius-md);
cursor: pointer;
transition: border-color 0.18s, background 0.18s;
background: var(--cream);
position: relative;
}
.provider-card:hover { border-color: var(--navy-light); }
.provider-card.selected {
border-color: var(--navy);
background: var(--navy-pale);
}
.provider-card input[type="radio"] {
margin-top: 3px;
accent-color: var(--navy);
flex-shrink: 0;
width: 18px;
height: 18px;
cursor: pointer;
}
.provider-info { flex: 1; min-width: 0; }
.provider-name {
font-size: 15px;
font-weight: 500;
color: var(--navy);
display: flex;
align-items: center;
gap: 8px;
}
.provider-badge {
font-size: 11px;
font-weight: 500;
padding: 2px 8px;
border-radius: 99px;
letter-spacing: 0.04em;
text-transform: uppercase;
}
.badge-default { background: var(--gold-pale); color: var(--gold); }
.badge-fast { background: #E8F5E9; color: #2D6A4F; }
.badge-powerful{ background: var(--navy-pale); color: var(--navy); }
.provider-desc {
font-size: 13px;
color: var(--text-muted);
margin-top: 4px;
font-weight: 300;
line-height: 1.5;
}
.settings-actions {
display: flex;
align-items: center;
gap: 16px;
margin-top: 28px;
flex-wrap: wrap;
}
.btn-save {
background: var(--navy);
color: var(--white);
border: none;
border-radius: var(--radius-md);
padding: 12px 28px;
font-family: 'DM Sans', sans-serif;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: background 0.18s;
}
.btn-save:hover { background: var(--navy-light); }
.save-confirm {
font-size: 13px;
color: var(--success);
font-weight: 500;
display: none;
}
.save-confirm.show { display: inline; }
.settings-header {
margin-bottom: 32px;
}
.settings-header h1 {
font-size: 28px;
color: var(--navy);
margin-bottom: 8px;
}
.settings-header p {
font-size: 15px;
color: var(--text-muted);
font-weight: 300;
}
</style>
</head>
<body>
<nav>
<a class="nav-logo" href="/">
<div class="nav-logo-mark">S</div>
<div class="nav-logo-text">Sovereign Trust</div>
</a>
<div class="nav-links" id="navLinks">
<a class="nav-link" href="/education.html">Education</a>
<a class="nav-link" href="/dashboard.html">Dashboard</a>
<a class="nav-link active" href="/settings.html">Settings</a>
<a class="nav-link" href="/login.html">Sign in</a>
<a class="nav-cta" href="/register.html">Create Account</a>
</div>
<button class="nav-hamburger" onclick="toggleMobileMenu()" aria-label="Open menu">
<span></span><span></span><span></span>
</button>
</nav>
<div class="settings-wrap">
<div class="settings-header">
<h1>Settings</h1>
<p>Manage your account preferences and assistant configuration.</p>
</div>
<!-- AI ASSISTANT -->
<div class="settings-section">
<h2>AI Assistant</h2>
<p class="section-desc">
Choose which AI powers the Leela chat assistant. Leela AI is the default — it uses
Leela's own trust-knowledge library and provides citations from its source documents.
Other providers use your WEB6 account and are subject to standard rate limits.
</p>
<div class="provider-grid" id="providerGrid">
<label class="provider-card" data-provider="leelaai">
<input type="radio" name="provider" value="leelaai">
<div class="provider-info">
<div class="provider-name">
✨ Leela AI
<span class="provider-badge badge-default">Default</span>
</div>
<div class="provider-desc">
Leela's spiritual intelligence model, grounded in its own trust-document knowledge base.
Responses include citations from the source library. Best for trust-specific guidance.
</div>
</div>
</label>
<label class="provider-card" data-provider="openai">
<input type="radio" name="provider" value="openai">
<div class="provider-info">
<div class="provider-name">
🤖 OpenAI — GPT-4o
<span class="provider-badge badge-powerful">Powerful</span>
</div>
<div class="provider-desc">
OpenAI's flagship model via the WEB6 OASIS API. Strong general reasoning and
language quality. Routed through your WEB6 account.
</div>
</div>
</label>
<label class="provider-card" data-provider="anthropic">
<input type="radio" name="provider" value="anthropic">
<div class="provider-info">
<div class="provider-name">
🧠 Anthropic — Claude Sonnet
<span class="provider-badge badge-powerful">Powerful</span>
</div>
<div class="provider-desc">
Anthropic's Claude Sonnet model via WEB6. Excellent at following nuanced
instructions and producing well-structured explanations.
</div>
</div>
</label>
<label class="provider-card" data-provider="groq">
<input type="radio" name="provider" value="groq">
<div class="provider-info">
<div class="provider-name">
⚡ Groq — Llama 3.3 70B
<span class="provider-badge badge-fast">Fast</span>
</div>
<div class="provider-desc">
Llama 3.3 70B served on Groq's LPU hardware via WEB6. Significantly faster
response times. Good for quick questions.
</div>
</div>
</label>
</div>
<div class="settings-actions">
<button class="btn-save" onclick="saveSettings()">Save preferences</button>
<span class="save-confirm" id="saveConfirm">✓ Saved</span>
</div>
</div>
<!-- WEB6 / ADVANCED -->
<div class="settings-section">
<h2>WEB6 & Advanced Features</h2>
<p class="section-desc">
Control how Leela routes requests and which advanced OASIS reasoning features are active.
WEB6 routing sends requests through the OASIS WEB6 API layer — required for FAHRN and Holonic Braid.
Direct mode calls the selected provider's API without the WEB6 layer (faster for Leela AI).
</p>
<div class="toggle-row">
<div class="toggle-info">
<div class="toggle-label">Route through WEB6</div>
<div class="toggle-desc">
When on, all provider requests are sent through the OASIS WEB6 API — enabling avatar context,
semantic caching, and the features below. When off, Leela AI is called directly (other providers
still use WEB6 as they have no direct key configured here).
</div>
</div>
<label class="toggle-switch">
<input type="checkbox" id="toggleWeb6">
<span class="toggle-slider"></span>
</label>
</div>
<div class="advanced-section">
<div class="advanced-section-title">WEB6 reasoning features (require WEB6 routing)</div>
<div class="toggle-row" id="rowFahrn">
<div class="toggle-info">
<div class="toggle-label">FAHRN — Fractal Adaptive Holonic Reasoning Network</div>
<div class="toggle-desc">
Runs a multi-agent reasoning-network dispatch before calling the provider. FAHRN scores
sub-agents by task type (<em>trust-guidance</em>) and injects an execution plan into the
system context — improving answer quality for complex queries at the cost of latency.
</div>
</div>
<label class="toggle-switch">
<input type="checkbox" id="toggleFahrn">
<span class="toggle-slider"></span>
</label>
</div>
<div class="toggle-row" id="rowBraid">
<div class="toggle-info">
<div class="toggle-label">Holonic Braid — shared reasoning graph</div>
<div class="toggle-desc">
Fetches the collective Holonic BRAID reasoning graph for the <em>trust-guidance</em> task
type and injects it into the system context. Enriches responses with patterns learned across
the OASIS holonic network.
</div>
</div>
<label class="toggle-switch">
<input type="checkbox" id="toggleBraid">
<span class="toggle-slider"></span>
</label>
</div>
</div>
<div class="settings-actions">
<button class="btn-save" onclick="saveSettings()">Save preferences</button>
<span class="save-confirm" id="saveConfirm2">✓ Saved</span>
</div>
</div>
</div>
<script src="/js/app.js"></script>
<script>
(function () {
const PROVIDER_KEY = 'st_ai_provider';
const WEB6_KEY = 'st_use_web6';
const FAHRN_KEY = 'st_use_fahrn';
const BRAID_KEY = 'st_use_holonic_braid';
function getBool(key, def) {
try { const v = localStorage.getItem(key); return v === null ? def : v === 'true'; } catch { return def; }
}
// ── Provider radio cards ──────────────────────────────
const savedProvider = (() => { try { return localStorage.getItem(PROVIDER_KEY) || 'leelaai'; } catch { return 'leelaai'; } })();
const cards = document.querySelectorAll('.provider-card');
cards.forEach(card => {
const input = card.querySelector('input[type="radio"]');
if (card.dataset.provider === savedProvider) {
input.checked = true;
card.classList.add('selected');
}
input.addEventListener('change', () => {
cards.forEach(c => c.classList.remove('selected'));
card.classList.add('selected');
});
});
// ── Toggle switches ───────────────────────────────────
const web6El = document.getElementById('toggleWeb6');
const fahrnEl = document.getElementById('toggleFahrn');
const braidEl = document.getElementById('toggleBraid');
const rowFahrn = document.getElementById('rowFahrn');
const rowBraid = document.getElementById('rowBraid');
web6El.checked = getBool(WEB6_KEY, false);
fahrnEl.checked = getBool(FAHRN_KEY, false);
braidEl.checked = getBool(BRAID_KEY, false);
function syncAdvanced() {
const on = web6El.checked;
rowFahrn.classList.toggle('disabled', !on);
rowBraid.classList.toggle('disabled', !on);
}
syncAdvanced();
web6El.addEventListener('change', syncAdvanced);
// ── Save ──────────────────────────────────────────────
window.saveSettings = function () {
const checked = document.querySelector('input[name="provider"]:checked');
if (checked) {
try { localStorage.setItem(PROVIDER_KEY, checked.value); } catch {}
}
try {
localStorage.setItem(WEB6_KEY, String(web6El.checked));
localStorage.setItem(FAHRN_KEY, String(fahrnEl.checked));
localStorage.setItem(BRAID_KEY, String(braidEl.checked));
} catch {}
['saveConfirm', 'saveConfirm2'].forEach(id => {
const el = document.getElementById(id);
if (!el) return;
el.classList.add('show');
setTimeout(() => el.classList.remove('show'), 2500);
});
};
})();
</script>
</body>
</html>