@anmol-srv/sigil 0.13.0 → 0.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +396 -335
- package/dist/daemon.js +168 -133
- package/dist/hooks/post-tool-use.js +23 -22
- package/dist/hooks/session-end.js +67 -66
- package/dist/hooks/stop.js +71 -70
- package/dist/hooks/user-prompt-submit.js +45 -44
- package/dist/server.js +48 -44
- package/package.json +4 -3
- package/src/db/drivers/index.js +41 -0
- package/src/db/drivers/local-postgres.js +23 -0
- package/src/db/drivers/url.js +155 -0
- package/src/db/drivers/url.test.js +94 -0
- package/src/db/migrations/20260601000006_add-entity-name-trigram-index.cjs +25 -0
- package/src/gui/web/app.css +203 -17
- package/src/gui/web/app.js +54 -11
- package/src/gui/web/design/colors_and_type.css +2 -2
- package/src/gui/web/index.html +40 -4
- package/src/gui/web/setup.js +47 -3
package/src/gui/web/app.css
CHANGED
|
@@ -245,7 +245,7 @@ h3.section-sub {
|
|
|
245
245
|
font-size: var(--t-base);
|
|
246
246
|
font-weight: 500;
|
|
247
247
|
cursor: pointer;
|
|
248
|
-
transition: background
|
|
248
|
+
transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
|
|
249
249
|
white-space: nowrap;
|
|
250
250
|
}
|
|
251
251
|
.btn:hover { background: var(--bg-surface-2); border-color: var(--border-strong); }
|
|
@@ -343,7 +343,7 @@ h3.section-sub {
|
|
|
343
343
|
.table-wrap {
|
|
344
344
|
background: var(--bg-surface);
|
|
345
345
|
border: 1px solid var(--border);
|
|
346
|
-
overflow:
|
|
346
|
+
overflow-x: auto;
|
|
347
347
|
}
|
|
348
348
|
table { width: 100%; border-collapse: collapse; }
|
|
349
349
|
th, td {
|
|
@@ -362,7 +362,7 @@ thead th {
|
|
|
362
362
|
letter-spacing: 0.06em;
|
|
363
363
|
padding: var(--s-2) var(--s-4);
|
|
364
364
|
}
|
|
365
|
-
tbody tr { transition: background
|
|
365
|
+
tbody tr { transition: background var(--dur-1) var(--ease); }
|
|
366
366
|
tbody tr:hover { background: var(--bg-surface-2); }
|
|
367
367
|
tbody tr:last-child td { border-bottom: none; }
|
|
368
368
|
td.mono { font-family: var(--font-mono); font-size: var(--t-sm); }
|
|
@@ -420,7 +420,7 @@ form textarea,
|
|
|
420
420
|
background: var(--bg-canvas);
|
|
421
421
|
color: var(--fg);
|
|
422
422
|
font: var(--t-base) var(--font-mono);
|
|
423
|
-
transition: border-color
|
|
423
|
+
transition: border-color var(--dur-1) var(--ease);
|
|
424
424
|
}
|
|
425
425
|
form textarea { padding: var(--s-2) var(--s-3); height: auto; min-height: 80px; resize: vertical; }
|
|
426
426
|
form select,
|
|
@@ -428,6 +428,7 @@ form select,
|
|
|
428
428
|
form input:focus, form select:focus, form textarea:focus,
|
|
429
429
|
.onboarding-content input:focus, .onboarding-content select:focus,
|
|
430
430
|
.input:focus { outline: none; border-color: var(--accent); }
|
|
431
|
+
::placeholder { color: var(--fg-3); opacity: 1; }
|
|
431
432
|
|
|
432
433
|
form .row-2col,
|
|
433
434
|
.onboarding-content .row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
|
|
@@ -442,19 +443,22 @@ form .actions { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
|
|
|
442
443
|
.onboarding-content #ob-llm-fields,
|
|
443
444
|
.onboarding-content #ob-emb-fields { max-width: 560px; }
|
|
444
445
|
|
|
445
|
-
pre
|
|
446
|
+
/* Shared box treatment for both pre (code output) and div (confirm prompts) */
|
|
447
|
+
.result {
|
|
446
448
|
background: var(--bg-canvas);
|
|
447
449
|
border: 1px solid var(--border);
|
|
448
450
|
padding: var(--s-3) var(--s-4);
|
|
451
|
+
margin: var(--s-4) 0 0;
|
|
452
|
+
}
|
|
453
|
+
pre.result {
|
|
449
454
|
font: var(--t-sm) var(--font-mono);
|
|
450
455
|
white-space: pre-wrap;
|
|
451
456
|
word-break: break-word;
|
|
452
457
|
max-height: 320px;
|
|
453
458
|
overflow: auto;
|
|
454
|
-
margin: var(--s-4) 0 0;
|
|
455
459
|
}
|
|
456
|
-
|
|
457
|
-
|
|
460
|
+
.result.ok { border-color: rgba(78,196,108,0.30); }
|
|
461
|
+
.result.err { border-color: rgba(226,100,100,0.30); }
|
|
458
462
|
|
|
459
463
|
/* ════════════════════════════════════════════════════════════════════════
|
|
460
464
|
Badges + status pills
|
|
@@ -549,7 +553,7 @@ pre.result.err { border-color: rgba(226,100,100,0.30); }
|
|
|
549
553
|
.trace-block-h { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); font-weight: 600; margin-bottom: var(--s-2); }
|
|
550
554
|
.kvline { display: inline-block; margin-right: var(--s-4); font-size: var(--t-sm); }
|
|
551
555
|
.kvline .muted { margin-right: 4px; }
|
|
552
|
-
.synth { background: var(--
|
|
556
|
+
.synth { background: var(--brand-tint); border: 1px solid rgba(0, 132, 255, 0.30); padding: var(--s-3) var(--s-4); font-size: var(--t-base); line-height: 1.55; }
|
|
553
557
|
.trace-json { background: var(--bg-surface); border: 1px solid var(--border); padding: var(--s-3); font: var(--t-xs) var(--font-mono); white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; margin: var(--s-2) 0 0; }
|
|
554
558
|
|
|
555
559
|
.trace-table-wrap { border: 1px solid var(--border); overflow-x: auto; }
|
|
@@ -698,7 +702,7 @@ table.trace-table td.audm-cell { font-size: var(--t-xs); color: var(--fg-2); whi
|
|
|
698
702
|
background: var(--bg-canvas);
|
|
699
703
|
border: 1px solid var(--border-2);
|
|
700
704
|
cursor: pointer;
|
|
701
|
-
transition: border-color
|
|
705
|
+
transition: border-color var(--dur-1) var(--ease);
|
|
702
706
|
}
|
|
703
707
|
.radio-card:hover { border-color: var(--accent); }
|
|
704
708
|
.radio-card input { width: auto; height: auto; margin-top: 3px; accent-color: var(--accent); }
|
|
@@ -831,7 +835,7 @@ table.trace-table td.audm-cell { font-size: var(--t-xs); color: var(--fg-2); whi
|
|
|
831
835
|
background: var(--bg-surface);
|
|
832
836
|
border: 1px solid var(--border);
|
|
833
837
|
cursor: pointer;
|
|
834
|
-
transition: border-color
|
|
838
|
+
transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
|
|
835
839
|
}
|
|
836
840
|
.provider-card:hover { border-color: var(--border-strong); }
|
|
837
841
|
.provider-card.selected {
|
|
@@ -952,7 +956,7 @@ footer .footer-inner {
|
|
|
952
956
|
.setup-progress { margin-top: var(--s-4); }
|
|
953
957
|
.setup-progress-bar {
|
|
954
958
|
height: 8px;
|
|
955
|
-
border-radius:
|
|
959
|
+
border-radius: var(--radius-1);
|
|
956
960
|
background: var(--surface-2);
|
|
957
961
|
border: 1px solid var(--border);
|
|
958
962
|
overflow: hidden;
|
|
@@ -962,8 +966,8 @@ footer .footer-inner {
|
|
|
962
966
|
height: 100%;
|
|
963
967
|
width: 0;
|
|
964
968
|
background: var(--accent);
|
|
965
|
-
border-radius:
|
|
966
|
-
transition: width .35s ease;
|
|
969
|
+
border-radius: var(--radius-1);
|
|
970
|
+
transition: width .35s var(--ease);
|
|
967
971
|
}
|
|
968
972
|
.setup-progress-label {
|
|
969
973
|
margin-top: var(--s-2);
|
|
@@ -986,8 +990,8 @@ footer .footer-inner {
|
|
|
986
990
|
list-style: none;
|
|
987
991
|
background: var(--bg-surface-2, var(--surface-2));
|
|
988
992
|
border: 1px solid var(--border-strong, var(--border));
|
|
989
|
-
border-radius:
|
|
990
|
-
box-shadow:
|
|
993
|
+
border-radius: var(--radius-2);
|
|
994
|
+
box-shadow: var(--shadow-pop);
|
|
991
995
|
}
|
|
992
996
|
.combo-list li {
|
|
993
997
|
display: flex;
|
|
@@ -995,7 +999,7 @@ footer .footer-inner {
|
|
|
995
999
|
justify-content: space-between;
|
|
996
1000
|
gap: 16px;
|
|
997
1001
|
padding: 7px 10px;
|
|
998
|
-
border-radius:
|
|
1002
|
+
border-radius: var(--radius-1);
|
|
999
1003
|
cursor: pointer;
|
|
1000
1004
|
}
|
|
1001
1005
|
.combo-list li:hover { background: var(--accent); color: var(--accent-fg); }
|
|
@@ -1003,3 +1007,185 @@ footer .footer-inner {
|
|
|
1003
1007
|
.combo-id { font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.85rem; }
|
|
1004
1008
|
.combo-name { color: var(--fg-3); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
|
|
1005
1009
|
.combo-empty { cursor: default; color: var(--fg-3); }
|
|
1010
|
+
|
|
1011
|
+
/* ── Landing splash — branded boot screen, fades out after the setup check ── */
|
|
1012
|
+
.landing {
|
|
1013
|
+
position: fixed;
|
|
1014
|
+
inset: 0;
|
|
1015
|
+
z-index: 1000;
|
|
1016
|
+
display: flex;
|
|
1017
|
+
align-items: center;
|
|
1018
|
+
justify-content: center;
|
|
1019
|
+
background: var(--bg-0, #08090b);
|
|
1020
|
+
opacity: 1;
|
|
1021
|
+
transition: opacity 0.5s ease;
|
|
1022
|
+
}
|
|
1023
|
+
.landing[hidden] { display: none; }
|
|
1024
|
+
.landing.fade-out { opacity: 0; pointer-events: none; }
|
|
1025
|
+
.landing-inner {
|
|
1026
|
+
display: flex;
|
|
1027
|
+
flex-direction: column;
|
|
1028
|
+
align-items: center;
|
|
1029
|
+
gap: var(--s-3);
|
|
1030
|
+
text-align: center;
|
|
1031
|
+
}
|
|
1032
|
+
.landing-mark { animation: landing-pulse 2.2s ease-in-out infinite; }
|
|
1033
|
+
.landing-name {
|
|
1034
|
+
font-size: 2rem;
|
|
1035
|
+
font-weight: 700;
|
|
1036
|
+
letter-spacing: -0.02em;
|
|
1037
|
+
color: var(--fg-1, #ffffff);
|
|
1038
|
+
}
|
|
1039
|
+
.landing-tagline { color: var(--fg-3); font-size: 0.95rem; }
|
|
1040
|
+
.landing-spinner {
|
|
1041
|
+
margin-top: var(--s-4);
|
|
1042
|
+
width: 22px;
|
|
1043
|
+
height: 22px;
|
|
1044
|
+
border-radius: 50%;
|
|
1045
|
+
border: 2px solid var(--border-strong, rgba(255, 255, 255, 0.15));
|
|
1046
|
+
border-top-color: var(--accent);
|
|
1047
|
+
animation: landing-spin 0.8s linear infinite;
|
|
1048
|
+
}
|
|
1049
|
+
@keyframes landing-spin { to { transform: rotate(360deg); } }
|
|
1050
|
+
@keyframes landing-pulse {
|
|
1051
|
+
0%, 100% { transform: scale(1); opacity: 0.9; }
|
|
1052
|
+
50% { transform: scale(1.06); opacity: 1; }
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
/* ════════════════════════════════════════════════════════════════════════
|
|
1056
|
+
RESPONSIVE ADAPTATIONS
|
|
1057
|
+
Breakpoints: 768px (tablet / narrow laptop), 480px (small phone).
|
|
1058
|
+
Touch targets: pointer:coarse handles touch independently of screen size.
|
|
1059
|
+
Desktop layout is unchanged; all rules below layer on top.
|
|
1060
|
+
════════════════════════════════════════════════════════════════════════ */
|
|
1061
|
+
|
|
1062
|
+
/* ── Touch target uplift — applies at any screen size with a coarse pointer ── */
|
|
1063
|
+
@media (pointer: coarse) {
|
|
1064
|
+
.btn { min-height: 40px; }
|
|
1065
|
+
.btn.small { min-height: 36px; }
|
|
1066
|
+
.btn.large { min-height: 48px; }
|
|
1067
|
+
.chip { min-height: 40px; }
|
|
1068
|
+
nav a { min-height: 44px; }
|
|
1069
|
+
.copy-btn { min-height: 32px; min-width: 32px; }
|
|
1070
|
+
.modal-close { min-height: 44px; min-width: 44px; }
|
|
1071
|
+
.trace-head { min-height: 44px; }
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
/* ── ≤ 768px — tablet / landscape phone ───────────────────────────────────── */
|
|
1075
|
+
@media (max-width: 768px) {
|
|
1076
|
+
|
|
1077
|
+
/* Nav: scroll horizontally instead of wrapping to a second line */
|
|
1078
|
+
nav {
|
|
1079
|
+
overflow-x: auto;
|
|
1080
|
+
-webkit-overflow-scrolling: touch;
|
|
1081
|
+
scrollbar-width: none;
|
|
1082
|
+
flex-shrink: 1;
|
|
1083
|
+
min-width: 0;
|
|
1084
|
+
}
|
|
1085
|
+
nav::-webkit-scrollbar { display: none; }
|
|
1086
|
+
nav a { white-space: nowrap; flex-shrink: 0; }
|
|
1087
|
+
|
|
1088
|
+
/* Reduce page horizontal padding */
|
|
1089
|
+
main { padding: var(--s-5) var(--s-4) var(--s-7); }
|
|
1090
|
+
|
|
1091
|
+
/* Section heads: stack title above action buttons */
|
|
1092
|
+
.section-head {
|
|
1093
|
+
flex-direction: column;
|
|
1094
|
+
align-items: flex-start;
|
|
1095
|
+
gap: var(--s-3);
|
|
1096
|
+
padding-bottom: var(--s-4);
|
|
1097
|
+
margin-bottom: var(--s-4);
|
|
1098
|
+
}
|
|
1099
|
+
.section-head .actions { align-self: flex-start; }
|
|
1100
|
+
|
|
1101
|
+
/* KV rows: stack key above value for long monospace values */
|
|
1102
|
+
.kv .row {
|
|
1103
|
+
grid-template-columns: 1fr;
|
|
1104
|
+
gap: 2px;
|
|
1105
|
+
padding: var(--s-3) var(--s-4);
|
|
1106
|
+
}
|
|
1107
|
+
.kv .row .k {
|
|
1108
|
+
font-size: var(--t-xs);
|
|
1109
|
+
text-transform: uppercase;
|
|
1110
|
+
letter-spacing: 0.04em;
|
|
1111
|
+
color: var(--fg-4);
|
|
1112
|
+
}
|
|
1113
|
+
.kv .row .v { font-size: var(--t-sm); }
|
|
1114
|
+
|
|
1115
|
+
/* Two-column form rows collapse to single column */
|
|
1116
|
+
form .row-2col,
|
|
1117
|
+
.onboarding-content .row-2col { grid-template-columns: 1fr; }
|
|
1118
|
+
|
|
1119
|
+
/* Forms: allow full width (remove 560px cap) */
|
|
1120
|
+
.view form.panel,
|
|
1121
|
+
.onboarding-content .wizard-step .field,
|
|
1122
|
+
.onboarding-content #ob-db-url,
|
|
1123
|
+
.onboarding-content #ob-db-fields,
|
|
1124
|
+
.onboarding-content #ob-llm-fields,
|
|
1125
|
+
.onboarding-content #ob-emb-fields { max-width: 100%; }
|
|
1126
|
+
|
|
1127
|
+
/* Modal: full width with viewport margin */
|
|
1128
|
+
.modal { padding: var(--s-7) var(--s-3) var(--s-3); }
|
|
1129
|
+
.modal-body { max-width: 100%; }
|
|
1130
|
+
|
|
1131
|
+
/* Onboarding: collapse sidebar — progress bar + h1 orient the user */
|
|
1132
|
+
.onboarding { grid-template-columns: 1fr; }
|
|
1133
|
+
.onboarding-sidebar { display: none; }
|
|
1134
|
+
.onboarding-content {
|
|
1135
|
+
padding: var(--s-5) var(--s-5) var(--s-7);
|
|
1136
|
+
max-width: 100%;
|
|
1137
|
+
}
|
|
1138
|
+
.onboarding-content h1 { font-size: var(--t-2xl); }
|
|
1139
|
+
|
|
1140
|
+
/* Provider cards: allow wrapping to fewer columns on narrower screens */
|
|
1141
|
+
.provider-card-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
|
|
1142
|
+
|
|
1143
|
+
/* Stat grid: tighter minimum so 2 stats can sit side-by-side at 768px */
|
|
1144
|
+
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
/* ── ≤ 480px — small phone ─────────────────────────────────────────────────── */
|
|
1148
|
+
@media (max-width: 480px) {
|
|
1149
|
+
|
|
1150
|
+
/* Header: tighter padding, hide version badge to free nav space */
|
|
1151
|
+
.header-inner { padding: 0 var(--s-3); }
|
|
1152
|
+
.brand { padding-right: var(--s-3); margin-right: var(--s-3); }
|
|
1153
|
+
.brand-badge { display: none; }
|
|
1154
|
+
|
|
1155
|
+
/* Reduce page padding further */
|
|
1156
|
+
main { padding: var(--s-4) var(--s-3) var(--s-6); }
|
|
1157
|
+
.onboarding-content { padding: var(--s-4) var(--s-3) var(--s-5); }
|
|
1158
|
+
|
|
1159
|
+
/* Stat grid: single column */
|
|
1160
|
+
.stat-grid { grid-template-columns: 1fr; }
|
|
1161
|
+
|
|
1162
|
+
/* Activity list: hide namespace and duration to give summary more room */
|
|
1163
|
+
.trace-ns { display: none; }
|
|
1164
|
+
.trace-dur { display: none; }
|
|
1165
|
+
|
|
1166
|
+
/* Wizard actions: stack Continue above Back, both full-width */
|
|
1167
|
+
.wizard-actions {
|
|
1168
|
+
flex-direction: column-reverse;
|
|
1169
|
+
gap: var(--s-2);
|
|
1170
|
+
}
|
|
1171
|
+
.wizard-actions .spacer { display: none; }
|
|
1172
|
+
#setup-back,
|
|
1173
|
+
#setup-run { width: 100%; justify-content: center; }
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/* ════════════════════════════════════════════════════════════════════════
|
|
1177
|
+
REDUCED MOTION
|
|
1178
|
+
Kill all animation and transition durations when the OS requests it.
|
|
1179
|
+
0.01ms keeps JS animationend/transitionend listeners firing correctly
|
|
1180
|
+
while making motion imperceptible.
|
|
1181
|
+
════════════════════════════════════════════════════════════════════════ */
|
|
1182
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1183
|
+
*,
|
|
1184
|
+
*::before,
|
|
1185
|
+
*::after {
|
|
1186
|
+
animation-duration: 0.01ms !important;
|
|
1187
|
+
animation-iteration-count: 1 !important;
|
|
1188
|
+
transition-duration: 0.01ms !important;
|
|
1189
|
+
scroll-behavior: auto !important;
|
|
1190
|
+
}
|
|
1191
|
+
}
|
package/src/gui/web/app.js
CHANGED
|
@@ -136,7 +136,7 @@ async function refreshKb() {
|
|
|
136
136
|
]);
|
|
137
137
|
const hot = data.hotFacts || [];
|
|
138
138
|
$('#hot-facts').innerHTML = hot.length
|
|
139
|
-
? hot.map((f) => `<li>${escape(f.content.slice(0, 140))}<span class="muted" style="margin-left:
|
|
139
|
+
? hot.map((f) => `<li>${escape(f.content.slice(0, 140))}<span class="muted" style="margin-left:var(--s-2);">${f.accessCount}×</span></li>`).join('')
|
|
140
140
|
: '<li class="muted">no hot facts yet</li>';
|
|
141
141
|
} catch (err) {
|
|
142
142
|
$('#kb-pane').innerHTML = `<div class="row"><div class="k">error</div><div class="v">${escape(err.message)}</div></div>`;
|
|
@@ -250,7 +250,7 @@ async function openSwitcher(kind) {
|
|
|
250
250
|
$('#cfg-switch-cards').innerHTML = cfgSwitch.providers.map((p) => `
|
|
251
251
|
<label class="provider-card" data-cfg-id="${escape(p.id)}">
|
|
252
252
|
<span class="check"></span>
|
|
253
|
-
<span class="name">${escape(p.label)}${p.recommended ? ' <span class="badge info" style="margin-left:
|
|
253
|
+
<span class="name">${escape(p.label)}${p.recommended ? ' <span class="badge info" style="margin-left:var(--s-2);">RECOMMENDED</span>' : ''}</span>
|
|
254
254
|
<span class="hint">${escape(p.hint)}</span>
|
|
255
255
|
</label>`).join('');
|
|
256
256
|
} catch (err) {
|
|
@@ -264,7 +264,7 @@ function cfgSwitchFields(p) {
|
|
|
264
264
|
if (cfgSwitch.step === 'llm') return p.fields || [];
|
|
265
265
|
const f = [];
|
|
266
266
|
if (p.keyed && !p.sharedKeyAvailable) f.push({ name: 'apiKey', label: `${p.label} API key`, type: 'password', placeholder: 'paste key' });
|
|
267
|
-
if (p.id === 'ollama') f.push({ name: 'host', label: 'Ollama host', type: 'text', placeholder: 'http://localhost:11434' });
|
|
267
|
+
if (p.id === 'ollama') f.push({ name: 'host', label: 'Ollama host', type: 'text', placeholder: 'http://localhost:11434', optional: true });
|
|
268
268
|
return f;
|
|
269
269
|
}
|
|
270
270
|
|
|
@@ -313,6 +313,33 @@ $('#cfg-switch-apply')?.addEventListener('click', async () => {
|
|
|
313
313
|
}
|
|
314
314
|
});
|
|
315
315
|
|
|
316
|
+
// ── Settings: danger zone — factory reset ────────────────────────────
|
|
317
|
+
$('#cfg-reset')?.addEventListener('click', () => {
|
|
318
|
+
const host = $('#reset-confirm');
|
|
319
|
+
if (!host) return;
|
|
320
|
+
const wipeMemory = $('#reset-wipe-memory')?.checked !== false;
|
|
321
|
+
host.innerHTML = `
|
|
322
|
+
<div class="result err" style="margin:0;">
|
|
323
|
+
<strong>Reset Sigil?</strong>
|
|
324
|
+
<div class="muted" style="margin:6px 0;">Disconnects every agent${wipeMemory ? ', wipes all stored memory,' : ''} and clears your config. You'll go back to setup. (The database itself is kept — use <code>sigil reset</code> in a terminal for a full DB teardown.)</div>
|
|
325
|
+
<div class="flex-row" style="margin-top:8px;">
|
|
326
|
+
<button type="button" class="btn danger" data-reset-go>Yes, reset</button>
|
|
327
|
+
<button type="button" class="btn" data-reset-cancel>Cancel</button>
|
|
328
|
+
</div>
|
|
329
|
+
</div>`;
|
|
330
|
+
host.querySelector('[data-reset-cancel]').addEventListener('click', () => { host.innerHTML = ''; });
|
|
331
|
+
host.querySelector('[data-reset-go]').addEventListener('click', async (e) => {
|
|
332
|
+
e.target.disabled = true; e.target.textContent = 'Resetting…';
|
|
333
|
+
try {
|
|
334
|
+
const r = await rpc('setup.factoryReset', { wipeMemory });
|
|
335
|
+
toast({ variant: 'success', message: `Reset complete — disconnected ${r.disconnected?.length || 0} agent(s)${wipeMemory ? `, wiped ${r.tablesWiped || 0} tables` : ''}.` });
|
|
336
|
+
setTimeout(() => window.location.reload(), 800);
|
|
337
|
+
} catch (err) {
|
|
338
|
+
host.innerHTML = `<div class="result err" style="margin:0;">✗ ${escape(err.message)}</div>`;
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
|
|
316
343
|
async function restartAndClose(out) {
|
|
317
344
|
out.textContent += '\nApplying — restarting daemon…';
|
|
318
345
|
try { await rpc('restartDaemon', {}); } catch { /* expected: connection drops on exit */ }
|
|
@@ -716,16 +743,16 @@ document.addEventListener('click', (e) => {
|
|
|
716
743
|
return;
|
|
717
744
|
}
|
|
718
745
|
const a = e.target.closest('[data-activate]');
|
|
719
|
-
if (a) rpc('device.activate', { id: Number(a.dataset.activate) }).then(refreshDevices).catch((err) =>
|
|
746
|
+
if (a) rpc('device.activate', { id: Number(a.dataset.activate) }).then(refreshDevices).catch((err) => toast({ variant: 'error', message: err.message }));
|
|
720
747
|
const cb = e.target.closest('[data-revoke-code]');
|
|
721
|
-
if (cb) rpc('pair.revoke', { id: Number(cb.dataset.revokeCode) }).then(refreshDevices).catch((err) =>
|
|
748
|
+
if (cb) rpc('pair.revoke', { id: Number(cb.dataset.revokeCode) }).then(refreshDevices).catch((err) => toast({ variant: 'error', message: err.message }));
|
|
722
749
|
});
|
|
723
750
|
|
|
724
751
|
$('#revoke-confirm')?.addEventListener('click', async () => {
|
|
725
752
|
if (revokeTargetId == null) return;
|
|
726
753
|
const reason = $('input[name="revoke-reason"]:checked').value;
|
|
727
754
|
try { await rpc('device.revoke', { id: revokeTargetId, reason }); closeModal('revoke-modal'); refreshDevices(); }
|
|
728
|
-
catch (err) {
|
|
755
|
+
catch (err) { toast({ variant: 'error', message: err.message }); }
|
|
729
756
|
});
|
|
730
757
|
|
|
731
758
|
// Highlight selected radio card in revoke modal
|
|
@@ -752,7 +779,7 @@ new MutationObserver(() => { if ($('#dev-modal').hidden) { setTimeout(resetDevMo
|
|
|
752
779
|
.observe($('#dev-modal'), { attributes: true, attributeFilter: ['hidden'] });
|
|
753
780
|
|
|
754
781
|
$('#dev-create')?.addEventListener('click', async () => {
|
|
755
|
-
const name = $('#dev-name').value.trim(); if (!name)
|
|
782
|
+
const name = $('#dev-name').value.trim(); if (!name) { toast({ variant: 'error', message: 'Device name is required.' }); return; }
|
|
756
783
|
const role = $('#dev-role').value;
|
|
757
784
|
const ttl = Number($('#dev-ttl').value) || 600;
|
|
758
785
|
const ns = $('#dev-ns').value.trim();
|
|
@@ -769,14 +796,30 @@ $('#dev-create')?.addEventListener('click', async () => {
|
|
|
769
796
|
$('#dev-result-master').firstChild.textContent = (data.masterNodeId || '(iroh not running)') + ' ';
|
|
770
797
|
$('#dev-result-cmd').textContent = cmd;
|
|
771
798
|
$('#dev-result-expiry').textContent = data.expiresAt;
|
|
772
|
-
} catch (err) {
|
|
799
|
+
} catch (err) { toast({ variant: 'error', message: err.message || 'Create pairing code failed.' }); }
|
|
773
800
|
});
|
|
774
801
|
|
|
775
802
|
// ════════════════════════════════════════════════════════════════════
|
|
776
803
|
// BOOT
|
|
777
804
|
// ════════════════════════════════════════════════════════════════════
|
|
805
|
+
// Branded landing splash: stays up while we check ~/.sigil (via setup.state)
|
|
806
|
+
// and route to setup or the dashboard, then fades out. A minimum dwell keeps
|
|
807
|
+
// it from flashing on a fast check.
|
|
808
|
+
function dismissLanding() {
|
|
809
|
+
const el = $('#landing');
|
|
810
|
+
if (!el) return;
|
|
811
|
+
el.classList.add('fade-out');
|
|
812
|
+
setTimeout(() => { el.hidden = true; }, 550);
|
|
813
|
+
}
|
|
814
|
+
async function runLanding() {
|
|
815
|
+
const started = Date.now();
|
|
816
|
+
try { await initSetup(); } catch { /* initSetup handles its own errors */ }
|
|
817
|
+
const MIN_MS = 1100;
|
|
818
|
+
setTimeout(dismissLanding, Math.max(0, MIN_MS - (Date.now() - started)));
|
|
819
|
+
}
|
|
820
|
+
|
|
778
821
|
const initial = (window.location.hash || '#health').slice(1);
|
|
779
822
|
setRoute(validRoutes.includes(initial) ? initial : 'health');
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
823
|
+
runLanding();
|
|
824
|
+
setInterval(() => { if (!document.hidden) refreshHealth(); }, 5000);
|
|
825
|
+
document.addEventListener('visibilitychange', () => { if (!document.hidden) refreshHealth(); });
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
restrained status color. Import this file to inherit all tokens.
|
|
5
5
|
============================================================ */
|
|
6
6
|
|
|
7
|
-
/*
|
|
8
|
-
@import
|
|
7
|
+
/* Webfonts are loaded via <link> tags in index.html for parallel fetch.
|
|
8
|
+
@import here would block parsing until this file is fully loaded first. */
|
|
9
9
|
|
|
10
10
|
:root {
|
|
11
11
|
/* ========================================================
|
package/src/gui/web/index.html
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
6
6
|
<title>Sigil</title>
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/static/design/sigil-mark.svg">
|
|
8
|
+
<!-- Geist fonts: preconnect + parallel fetch (no blocking @import in CSS) -->
|
|
9
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
10
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
11
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap">
|
|
8
12
|
<!-- Sigil design system tokens (color, type, spacing, geometry) — loaded
|
|
9
13
|
BEFORE app.css so the dashboard re-skins onto the brand. -->
|
|
10
14
|
<link rel="stylesheet" href="/static/design/colors_and_type.css">
|
|
@@ -14,6 +18,19 @@
|
|
|
14
18
|
<!-- Toast stack — central status/error feedback (see toast.js) -->
|
|
15
19
|
<div id="toasts" class="toast-stack" aria-live="polite"></div>
|
|
16
20
|
|
|
21
|
+
<!-- ════════════════════════════════════════════════════════════════════
|
|
22
|
+
LANDING — branded splash shown on launch while we check ~/.sigil for an
|
|
23
|
+
existing setup, then fades to reveal setup (first run) or the dashboard.
|
|
24
|
+
════════════════════════════════════════════════════════════════════ -->
|
|
25
|
+
<div id="landing" class="landing">
|
|
26
|
+
<div class="landing-inner">
|
|
27
|
+
<img class="landing-mark" src="/static/design/sigil-mark.svg" alt="Sigil" width="72" height="72">
|
|
28
|
+
<div class="landing-name">Sigil</div>
|
|
29
|
+
<div class="landing-tagline">Local-first memory for your AI agents</div>
|
|
30
|
+
<div class="landing-spinner" aria-hidden="true"></div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
17
34
|
<!-- ════════════════════════════════════════════════════════════════════
|
|
18
35
|
NATIVE SETUP (config-store driven; replaces the legacy wizard above)
|
|
19
36
|
Stepped progress bar — no terminal logs. See src/gui/web/setup.js.
|
|
@@ -250,10 +267,10 @@
|
|
|
250
267
|
<pre id="cfg-switch-result" class="result" style="display:none"></pre>
|
|
251
268
|
</div>
|
|
252
269
|
|
|
253
|
-
<!--
|
|
270
|
+
<!-- Config snapshot (advanced, collapsed) -->
|
|
254
271
|
<details class="panel" style="padding: var(--s-5);">
|
|
255
|
-
<summary style="cursor:pointer;">Advanced —
|
|
256
|
-
<p class="muted text-sm">
|
|
272
|
+
<summary style="cursor:pointer;">Advanced — configuration (<code>~/.sigil/config.json</code>)</summary>
|
|
273
|
+
<p class="muted text-sm">Secrets are shown as "configured", never the value.</p>
|
|
257
274
|
<div class="table-wrap">
|
|
258
275
|
<table id="env-table">
|
|
259
276
|
<thead><tr><th>Key</th><th>Value</th></tr></thead>
|
|
@@ -261,6 +278,25 @@
|
|
|
261
278
|
</table>
|
|
262
279
|
</div>
|
|
263
280
|
</details>
|
|
281
|
+
|
|
282
|
+
<!-- ── Danger zone ──────────────────────────────────────────── -->
|
|
283
|
+
<div class="section-head" style="margin-top: var(--s-6);">
|
|
284
|
+
<div class="title-block">
|
|
285
|
+
<h2>Danger zone</h2>
|
|
286
|
+
<p>Reset Sigil — disconnect every agent, optionally wipe stored memory, and start setup over.</p>
|
|
287
|
+
</div>
|
|
288
|
+
</div>
|
|
289
|
+
<div class="panel" style="padding: var(--s-5);">
|
|
290
|
+
<label class="field" style="flex-direction:row; align-items:center; gap: var(--s-2);">
|
|
291
|
+
<input type="checkbox" id="reset-wipe-memory" checked>
|
|
292
|
+
<span class="label" style="text-transform:none; letter-spacing:0;">Also wipe stored memory (all facts & embeddings)</span>
|
|
293
|
+
</label>
|
|
294
|
+
<div id="reset-result" class="result" style="display:none; margin-top: var(--s-3);"></div>
|
|
295
|
+
<div class="flex-row" style="margin-top: var(--s-3);">
|
|
296
|
+
<div id="reset-confirm"></div>
|
|
297
|
+
<button type="button" class="btn danger" id="cfg-reset">Reset Sigil…</button>
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
264
300
|
</section>
|
|
265
301
|
|
|
266
302
|
<!-- ── RPC ──────────────────────────────────────────────────── -->
|
package/src/gui/web/setup.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { rpc } from './api.js';
|
|
14
14
|
import { toast } from './toast.js';
|
|
15
|
+
import { connectorCard } from './components.js';
|
|
15
16
|
|
|
16
17
|
const $ = (s, r = document) => r.querySelector(s);
|
|
17
18
|
const esc = (v) => String(v ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
@@ -20,6 +21,7 @@ const STEP_DESC = {
|
|
|
20
21
|
database: 'Where memory lives',
|
|
21
22
|
llm: 'Fact extraction + reasoning',
|
|
22
23
|
embedding: 'Semantic search',
|
|
24
|
+
connectors: 'Editors & tools that share this brain',
|
|
23
25
|
identity: 'Personalize + smoke-test',
|
|
24
26
|
};
|
|
25
27
|
|
|
@@ -140,6 +142,7 @@ async function enterStep(stepId) {
|
|
|
140
142
|
if (stepId === 'database') return renderDatabaseStep();
|
|
141
143
|
if (stepId === 'llm') return renderProviderStep('llm');
|
|
142
144
|
if (stepId === 'embedding') return renderProviderStep('embedding');
|
|
145
|
+
if (stepId === 'connectors') return renderConnectorsStep();
|
|
143
146
|
if (stepId === 'identity') return renderIdentityStep();
|
|
144
147
|
renderComingSoon();
|
|
145
148
|
}
|
|
@@ -213,7 +216,7 @@ function confirmExternal(url) {
|
|
|
213
216
|
return new Promise((resolve) => {
|
|
214
217
|
const host = (() => { try { return new URL(url).host; } catch { return 'that server'; } })();
|
|
215
218
|
const el = $('#setup-confirm');
|
|
216
|
-
el.innerHTML = `<div class="result
|
|
219
|
+
el.innerHTML = `<div class="result">
|
|
217
220
|
<strong>Create database & run migrations on ${esc(host)}?</strong>
|
|
218
221
|
<div class="muted" style="margin:6px 0;">Sigil will create the database if missing, enable pgvector, and apply its schema.</div>
|
|
219
222
|
<div class="flex-row" style="margin-top:8px;">
|
|
@@ -237,7 +240,7 @@ async function renderProviderStep(stepId) {
|
|
|
237
240
|
$('#setup-run').addEventListener('click', () => runProviderStep(stepId));
|
|
238
241
|
const det = await rpc('setup.detect', { step: stepId }, { quiet: true }).catch(() => ({ providers: [] }));
|
|
239
242
|
providers = det.providers || [];
|
|
240
|
-
$('#setup-providers').innerHTML = providers.map((p) => card('prov', p.id, `${esc(p.label)}${p.recommended ? ' <span class="badge info" style="margin-left:
|
|
243
|
+
$('#setup-providers').innerHTML = providers.map((p) => card('prov', p.id, `${esc(p.label)}${p.recommended ? ' <span class="badge info" style="margin-left:var(--s-2);">RECOMMENDED</span>' : ''}`, p.hint)).join('');
|
|
241
244
|
$$all('#setup-providers [data-prov]').forEach((c) => c.addEventListener('click', () => selectProvider(stepId, c.dataset.prov)));
|
|
242
245
|
const rec = providers.find((p) => p.recommended) || providers[0];
|
|
243
246
|
if (rec) selectProvider(stepId, rec.id);
|
|
@@ -250,7 +253,7 @@ function providerFields(stepId, p) {
|
|
|
250
253
|
let note = '';
|
|
251
254
|
if (p.keyed && !p.sharedKeyAvailable) fields.push({ name: 'apiKey', label: `${p.label} API key`, type: 'password', placeholder: 'paste key' });
|
|
252
255
|
else if (p.keyed && p.sharedKeyAvailable) note = 'Reuses the API key from your LLM step.';
|
|
253
|
-
if (p.id === 'ollama') fields.push({ name: 'host', label: 'Ollama host', type: 'text', placeholder: 'http://localhost:11434' });
|
|
256
|
+
if (p.id === 'ollama') fields.push({ name: 'host', label: 'Ollama host', type: 'text', placeholder: 'http://localhost:11434', optional: true });
|
|
254
257
|
return { fields, note };
|
|
255
258
|
}
|
|
256
259
|
|
|
@@ -333,6 +336,47 @@ function runProviderStep(stepId) {
|
|
|
333
336
|
runStep(stepId, { provider: selectedProvider, ...collectFields() });
|
|
334
337
|
}
|
|
335
338
|
|
|
339
|
+
// ── Connectors step (multi-toggle list) ──────────────────────────────────────
|
|
340
|
+
async function renderConnectorsStep() {
|
|
341
|
+
shell({
|
|
342
|
+
title: 'Connect your coding agents.',
|
|
343
|
+
lede: 'Sigil installs memory hooks into the AI tools you already use — one shared brain across Claude Code, Cursor, Codex, Kiro, and more. Connect any you want; you can change this any time in Settings.',
|
|
344
|
+
body: '<div class="connector-grid" id="setup-connectors"><div class="muted">detecting installed tools…</div></div>',
|
|
345
|
+
});
|
|
346
|
+
// Connectors are optional — Continue is always enabled.
|
|
347
|
+
$('#setup-run').disabled = false;
|
|
348
|
+
$('#setup-run').addEventListener('click', () => runStep('connectors', {}));
|
|
349
|
+
await loadSetupConnectors();
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
async function loadSetupConnectors() {
|
|
353
|
+
const host = $('#setup-connectors');
|
|
354
|
+
if (!host) return;
|
|
355
|
+
try {
|
|
356
|
+
const { connectors } = await rpc('listConnectors');
|
|
357
|
+
host.innerHTML = '';
|
|
358
|
+
if (!connectors.length) { host.innerHTML = '<div class="muted">no agents detected on this machine</div>'; return; }
|
|
359
|
+
connectors.forEach((c) => host.appendChild(connectorCard(c, onSetupConnectorAction)));
|
|
360
|
+
} catch (err) {
|
|
361
|
+
host.innerHTML = `<div class="muted">could not load agents: ${esc(err.message)}</div>`;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
async function onSetupConnectorAction(id, action) {
|
|
366
|
+
const host = $('#setup-connectors');
|
|
367
|
+
const card = host?.querySelector(`[data-id="${id}"]`);
|
|
368
|
+
if (action === 'disconnect') {
|
|
369
|
+
try { await rpc('disconnectConnector', { id }); toast({ variant: 'success', message: `${id} disconnected` }); }
|
|
370
|
+
catch (err) { toast({ variant: 'error', message: err.message, hint: err.hint, code: err.code }); }
|
|
371
|
+
return loadSetupConnectors();
|
|
372
|
+
}
|
|
373
|
+
// connect / retry
|
|
374
|
+
if (card) card.replaceWith(connectorCard({ id, label: id, hint: '', uiState: 'connecting' }, onSetupConnectorAction));
|
|
375
|
+
try { await rpc('connectConnector', { id }); toast({ variant: 'success', message: `${id} connected` }); }
|
|
376
|
+
catch (err) { toast({ variant: 'error', message: err.message || `could not connect ${id}`, hint: err.hint, code: err.code }); }
|
|
377
|
+
return loadSetupConnectors();
|
|
378
|
+
}
|
|
379
|
+
|
|
336
380
|
// ── Identity step (form) ─────────────────────────────────────────────────────
|
|
337
381
|
function renderIdentityStep() {
|
|
338
382
|
shell({
|