@codrihub/memora 0.0.0-stage → 1.2.2

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.
@@ -0,0 +1,463 @@
1
+ <!DOCTYPE html>
2
+ <!-- Generated by web/scripts/build-pages.mjs. Do not edit. -->
3
+ <html lang="en" data-theme="dark">
4
+ <head>
5
+ <script>(function(){var d=document.documentElement,p='dark',q=null;
6
+ try{q=new URLSearchParams(location.search).get('theme')}catch(e){}
7
+ try{var v=localStorage.getItem('memora.theme');if(v==='dark'||v==='light'||v==='system')p=v}catch(e){}
8
+ if(q==='dark'||q==='light'||q==='system')p=q;
9
+ var m=window.matchMedia?matchMedia('(prefers-color-scheme: light)'):null;
10
+ function a(){var t=p==='system'?(m&&m.matches?'light':'dark'):p;d.setAttribute('data-theme',t);d.style.colorScheme=t;
11
+ var c=document.querySelector('meta[name=theme-color]');if(c)c.setAttribute('content',t==='light'?'#f3f5f9':'#0b0e14')}
12
+ a();document.addEventListener('DOMContentLoaded',a);if(p==='system'&&m){try{m.addEventListener('change',a)}catch(e){m.addListener&&m.addListener(a)}}})();</script>
13
+ <meta charset="UTF-8">
14
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
15
+ <meta name="robots" content="noindex,nofollow,noarchive,nosnippet,noimageindex">
16
+ <meta name="color-scheme" content="dark light">
17
+ <meta name="theme-color" content="#0b0e14">
18
+ <title>Sign in - Memora</title>
19
+ <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%221%201%2022%2022%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22mmg7m2054%22%20x1%3D%223%22%20y1%3D%223%22%20x2%3D%2221%22%20y2%3D%2221%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%235eead4%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2322d3ee%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22mmt7m2054%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%220%22%20y2%3D%2224%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%2317202e%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%230b0f17%22%2F%3E%3C%2FlinearGradient%3E%3CradialGradient%20id%3D%22mmc7m2054%22%20cx%3D%2250%25%22%20cy%3D%2250%25%22%20r%3D%2250%25%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23ffffff%22%2F%3E%3Cstop%20offset%3D%22.55%22%20stop-color%3D%22%23a5f3fc%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2322d3ee%22%2F%3E%3C%2FradialGradient%3E%3C%2Fdefs%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22none%22%3E%3Crect%20x%3D%221.5%22%20y%3D%221.5%22%20width%3D%2221%22%20height%3D%2221%22%20rx%3D%226.2%22%20fill%3D%22url(%23mmt7m2054)%22%2F%3E%3Crect%20x%3D%221.5%22%20y%3D%221.5%22%20width%3D%2221%22%20height%3D%2221%22%20rx%3D%226.2%22%20fill%3D%22none%22%20stroke%3D%22url(%23mmg7m2054)%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%22.8%22%2F%3E%3Cpath%20d%3D%22M7.2%2016.8V7.4l4.8%205.1%204.8-5.1v9.4%22%20fill%3D%22none%22%20stroke%3D%22url(%23mmg7m2054)%22%20stroke-width%3D%221.9%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Ccircle%20cx%3D%227.2%22%20cy%3D%2216.8%22%20r%3D%221.7%22%20fill%3D%22%235eead4%22%2F%3E%3Ccircle%20cx%3D%227.2%22%20cy%3D%227.4%22%20r%3D%221.7%22%20fill%3D%22%235eead4%22%2F%3E%3Ccircle%20cx%3D%2216.8%22%20cy%3D%227.4%22%20r%3D%221.7%22%20fill%3D%22%2322d3ee%22%2F%3E%3Ccircle%20cx%3D%2216.8%22%20cy%3D%2216.8%22%20r%3D%221.7%22%20fill%3D%22%2322d3ee%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212.5%22%20r%3D%223%22%20fill%3D%22%2322d3ee%22%20opacity%3D%22.22%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212.5%22%20r%3D%222%22%20fill%3D%22url(%23mmc7m2054)%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E">
20
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png">
21
+ <link rel="manifest" href="/manifest.webmanifest">
22
+ <style>
23
+ @font-face{font-family:'Memora Script';font-style:normal;font-weight:700;font-display:block;src:url(data:font/woff2;base64,d09GMgABAAAAAA/sABAAAAAAHHwAAA+QAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGjYbhwYcgk4GYD9TVEFUKgCBJBEICqMAnUsBNgIkA3ALOgAEIAWEVgcgDAcbcRijopyyciP4iwQOrxo/YUJJ0KGxLYMtMChiyWS84W/ql0UgbBZ6Di4wnBshySzP83/v5z73TelUewLYrDUcDki+zwpojAYT8WhpwME5w9Op/y7xBWpyiS9GoS1CmaYptJoj1Indp4sPuxPXFFgU4UiGMoyq87T9ziPxIzsBL2e31mxqv+oBPZDTdX5t1h5CCSG96Pf/2y+1czMbJldkoYKqKkLXmN35CwOfdif08ouMQjZClVgBudbVqBrfUynqfY1QtTVkJ/C41laa+xiZm7oMAOl1MkS2QwUalm4sgDWd5YHBXskEmXTfVZ5vWqHigHkezEsA+qx+qAfQ4QAaA2/xsXmgB5CwhIOhQzHgnDJ8zOsXKeRI6vMy+BLyAowuInzYAlIR1N7RezDB9hAABPzxx7/w3z7/sh2YmrBV4CrBpxWBEbHM5LokcjkwJ0qpJevSaGXRI8XILWNWxIqXsYvgZGQKc4jV7pwS5JW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g7gEuYJHILnJgmHaKRQL9DgIM3tv987fWMXJ+I2GxXwJ8Y0FUAPieXN2bLt59iWNg94AQYAAE+PkfTv9SRc2LlX07X3KYC0DmABg3AIzHAB3c6WDSTPtjM/uZbUA2xCAv90tlb83kT3v5pkpKp+V8D+/XOmNHwQxNG+kEIF8bp17Bb3X6H5T+6c+EnbbGucrj65pAg78ZBrcMXiucXmbMv23ZACxojgxAtgGYGwkRhzcSgxTHSKysZI3E0WRoJJ4w+0YQqHJ9IgiAtbxpcHRf6tOrz1wD2rVqMwTlYGOXBpUI0LyuX70ejVnVUwlVwgTS9CWqSKhXx4RpnCeP4VG1RTRgUIyOnob0HZTF2kWt2oHLhjWwaNSre5V69Q7LujRrOVRP9t5BVlrsm5Ce6fRmkxIqvkAN9jRgpK5qggrSEarATTerk1ekN69ggT3eq1eXJg4WNosty1agsL/ZgGydAzPBwVs1AzZJPtGgdiZHoXIPXdacMs0Ha7E6M+qYw/pfEpdvcRU=) format('woff2')}
24
+ .card .brand .brand-txt b{font-family:'Memora Script', 'Segoe Script', cursive;font-weight:700;font-size:28px;line-height:1.05;letter-spacing:0}
25
+
26
+
27
+ :root{
28
+ --bg:#0b0e14; --bg-glow:rgba(94,234,212,.08);
29
+ --panel:#12161f; --panel-2:#171c27; --line:#232a38; --line-2:#2c3546;
30
+ --fg:#e6e9ef; --muted:#8b98ad; --faint:#5d6a80;
31
+ --accent:#5eead4; --accent-2:#7dd3fc; --accent-hover:#7dd3fc; --on-accent:#0b0e14;
32
+ --accent-soft:rgba(94,234,212,.10); --accent-line:rgba(94,234,212,.32);
33
+ --primary:#08c6d4; --primary-hover:#2dd8e4; --on-primary:#03252a; --primary-soft:rgba(8,198,212,.16);
34
+ --warn:#fbbf24; --warn-soft:rgba(251,191,36,.10); --warn-line:rgba(251,191,36,.32); --warn-fg:#fcd34d;
35
+ --danger:#f87171; --danger-soft:rgba(248,113,113,.12); --danger-line:rgba(248,113,113,.32); --danger-fg:#fca5a5;
36
+ --ok:#4ade80; --ok-soft:rgba(74,222,128,.10); --ok-line:rgba(74,222,128,.30); --ok-fg:#86efac;
37
+ --code-bg:#0d1118; --code-fg:#e6e9ef; --chip:rgba(255,255,255,.05); --chip-hover:rgba(255,255,255,.10);
38
+ --input-bg:#171c27; --input-focus:#12161f;
39
+ --shadow:0 24px 60px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.03) inset;
40
+ --sweep:rgba(94,234,212,.95); --sweep-2:rgba(125,211,252,.9); --track:rgba(94,234,212,.16);
41
+ }
42
+ :root[data-theme="light"]{
43
+ --bg:#f3f5f9; --bg-glow:rgba(13,148,136,.07);
44
+ --panel:#ffffff; --panel-2:#f6f8fb; --line:#e1e6ee; --line-2:#cfd6e2;
45
+ --fg:#111827; --muted:#5b6678; --faint:#8a94a6;
46
+ --accent:#0d9488; --accent-2:#0369a1; --accent-hover:#0f766e; --on-accent:#ffffff;
47
+ --accent-soft:rgba(13,148,136,.08); --accent-line:rgba(13,148,136,.30);
48
+ --primary:#08c6d4; --primary-hover:#07b2bf; --on-primary:#03252a; --primary-soft:rgba(8,198,212,.14);
49
+ --warn:#b45309; --warn-soft:#fffbeb; --warn-line:#fcd9a0; --warn-fg:#92400e;
50
+ --danger:#dc2626; --danger-soft:#fef2f2; --danger-line:#fecaca; --danger-fg:#b91c1c;
51
+ --ok:#16a34a; --ok-soft:#f0fdf4; --ok-line:#bbf7d0; --ok-fg:#166534;
52
+ --code-bg:#f1f4f8; --code-fg:#0f172a; --chip:#ffffff; --chip-hover:#eef2f7;
53
+ --input-bg:#f8fafc; --input-focus:#ffffff;
54
+ --shadow:0 1px 2px rgba(16,24,40,.05), 0 18px 48px rgba(16,24,40,.10);
55
+ --sweep:rgba(13,148,136,.85); --sweep-2:rgba(3,105,161,.75); --track:rgba(13,148,136,.14);
56
+ }
57
+ *{margin:0;padding:0;box-sizing:border-box}
58
+ html,body{min-height:100%}
59
+ body{
60
+ font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
61
+ background-color:var(--bg); color:var(--fg);
62
+ background-image:
63
+ radial-gradient(circle at 12% 14%, var(--bg-glow) 0%, transparent 42%),
64
+ radial-gradient(circle at 88% 86%, var(--bg-glow) 0%, transparent 40%);
65
+ background-attachment:fixed;
66
+ display:grid; place-items:center; min-height:100vh; min-height:100dvh; padding:24px 16px;
67
+ -webkit-font-smoothing:antialiased;
68
+ }
69
+ svg{fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
70
+ a{color:var(--accent-2);text-decoration:none}
71
+ a:hover{text-decoration:underline}
72
+ code{font-family:ui-monospace,SFMono-Regular,'SF Mono',Menlo,Consolas,monospace}
73
+ [hidden]{display:none!important}
74
+
75
+ /* ---------- card ---------- */
76
+ .card{
77
+ width:100%; max-width:408px; position:relative; overflow:hidden;
78
+ background:var(--panel); border:1px solid var(--line); border-radius:16px;
79
+ box-shadow:var(--shadow); padding:30px 30px 22px;
80
+ }
81
+ .card::before,.card::after{content:'';position:absolute;top:0;height:2px;pointer-events:none}
82
+ .card::before{left:0;right:0;background:linear-gradient(90deg,transparent,var(--track) 20%,var(--track) 80%,transparent)}
83
+ .card::after{
84
+ left:0; width:45%;
85
+ background:linear-gradient(90deg,transparent,var(--sweep) 45%,var(--sweep-2) 60%,transparent);
86
+ transform:translateX(-110%); opacity:.85;
87
+ animation:sweep 3.6s cubic-bezier(.65,0,.35,1) infinite;
88
+ }
89
+ @keyframes sweep{0%{transform:translateX(-110%)}62%{transform:translateX(245%)}100%{transform:translateX(245%)}}
90
+
91
+ /* ---------- brand ---------- */
92
+ .brand{display:flex;align-items:center;gap:11px;margin-bottom:22px;animation:vin .22s ease-out both}
93
+ .card.splashing .brand{display:none}
94
+ .brand-mark{width:32px;height:32px;flex:none}
95
+ .brand-txt{display:flex;flex-direction:column;line-height:1.12;min-width:0}
96
+ .brand-txt b{font-size:16.5px;font-weight:800;letter-spacing:-.2px}
97
+ .brand-txt small{font-size:9.5px;font-weight:700;letter-spacing:.17em;text-transform:uppercase;color:var(--muted);margin-top:3px}
98
+
99
+ /* ---------- views ---------- */
100
+ .view{animation:vin .22s ease-out both}
101
+ .view.leaving{animation:vout .15s ease-in both}
102
+ @keyframes vin{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
103
+ @keyframes vout{from{opacity:1;transform:none}to{opacity:0;transform:translateY(-4px)}}
104
+ h1{font-size:19px;font-weight:700;letter-spacing:-.3px;margin-bottom:6px;line-height:1.25}
105
+ .eyebrow{font-size:12px;font-weight:600;color:var(--accent);margin-bottom:6px;letter-spacing:.01em}
106
+ .sub{font-size:13px;color:var(--muted);line-height:1.55;margin-bottom:20px}
107
+ .sub b{color:var(--fg);font-weight:600}
108
+ .note{font-size:12px;color:var(--muted);line-height:1.6;margin-top:12px}
109
+ .note code,.sub code{font-size:11.5px;color:var(--accent-2);background:var(--code-bg);border:1px solid var(--line);border-radius:5px;padding:1px 5px;white-space:nowrap}
110
+ .center{text-align:center}
111
+ .links{margin-top:16px;text-align:center;font-size:12.5px}
112
+ .links a{color:var(--muted)}
113
+ .links a:hover{color:var(--fg)}
114
+
115
+ /* ---------- splash ---------- */
116
+ .splash{display:flex;flex-direction:column;align-items:center;text-align:center;padding:6px 0 4px}
117
+ .splash .brand-mark{width:52px;height:52px;margin-bottom:14px;animation:breathe 2.4s ease-in-out infinite}
118
+ @keyframes breathe{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.04);opacity:.86}}
119
+ .splash h1{font-size:17px;margin-bottom:16px}
120
+ .checks{list-style:none;width:100%;max-width:260px;display:flex;flex-direction:column;gap:9px;text-align:left}
121
+ .checks li{display:flex;align-items:center;gap:10px;font-size:12.5px;color:var(--muted);opacity:.55;transition:opacity .2s,color .2s}
122
+ .checks li.run,.checks li.ok,.checks li.bad{opacity:1}
123
+ .checks li.ok{color:var(--fg)}
124
+ .checks li.bad{color:var(--danger-fg)}
125
+ .checks .ci{width:16px;height:16px;flex:none;display:grid;place-items:center;border-radius:50%;border:1.6px solid var(--line-2)}
126
+ .checks .ci svg{width:10px;height:10px;stroke-width:3;opacity:0;transform:scale(.6);transition:opacity .18s,transform .18s}
127
+ .checks li.run .ci{border-color:var(--line);border-top-color:var(--accent);animation:sp .8s linear infinite}
128
+ .checks li.ok .ci{border-color:var(--ok);background:var(--ok);color:var(--panel)}
129
+ .checks li.bad .ci{border-color:var(--danger);background:var(--danger);color:var(--panel)}
130
+ .checks li.ok .ci svg,.checks li.bad .ci svg{opacity:1;transform:none}
131
+ .checks .cv{margin-left:auto;font-size:11.5px;color:var(--muted)}
132
+ .splash .btn{max-width:260px;margin-top:18px}
133
+
134
+ /* ---------- fields ---------- */
135
+ .field{margin-bottom:16px}
136
+ .field label{display:block;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin-bottom:7px}
137
+ .inp{position:relative;display:flex;align-items:center}
138
+ .inp>svg{position:absolute;left:13px;width:15px;height:15px;color:var(--muted);pointer-events:none}
139
+ .inp input{
140
+ width:100%; height:46px; padding:0 44px 0 39px;
141
+ background:var(--input-bg); border:1px solid var(--line); border-radius:10px;
142
+ color:var(--fg); font-size:14px; font-family:inherit; outline:none;
143
+ transition:border-color .15s, background-color .15s, box-shadow .15s;
144
+ }
145
+ .inp input:focus{border-color:var(--accent);background:var(--input-focus);box-shadow:0 0 0 3px var(--accent-soft)}
146
+ .inp.ok input,.inp.ok input:focus{border-color:var(--ok)}
147
+ .inp.bad input,.inp.bad input:focus{border-color:var(--danger)}
148
+ .inp input::placeholder{color:var(--faint)}
149
+ .inp input:disabled{opacity:.5;cursor:not-allowed}
150
+ .inp .eye{position:absolute;right:8px;width:30px;height:30px;display:grid;place-items:center;border:none;background:none;color:var(--muted);border-radius:7px;cursor:pointer}
151
+ .inp .eye:hover{color:var(--fg);background:var(--chip-hover)}
152
+ .inp .eye svg{position:static;width:16px;height:16px}
153
+ .inp.code input{
154
+ padding:0 14px; height:54px; text-align:center; font-family:ui-monospace,SFMono-Regular,'SF Mono',Menlo,Consolas,monospace;
155
+ font-size:22px; font-weight:600; letter-spacing:.22em; text-transform:uppercase;
156
+ }
157
+ .inp.code input::placeholder{letter-spacing:.22em;font-weight:500}
158
+ .shake{animation:shake .32s ease}
159
+ @keyframes shake{20%,60%{transform:translateX(-5px)}40%,80%{transform:translateX(5px)}}
160
+
161
+ /* ---------- button ---------- */
162
+ .btn{
163
+ width:100%; height:44px; margin-top:6px; border:none; border-radius:10px;
164
+ background:var(--primary); color:var(--on-primary); font-size:14px; font-weight:700; font-family:inherit;
165
+ display:flex; align-items:center; justify-content:center; gap:8px; cursor:pointer;
166
+ transition:background-color .15s, transform .06s, opacity .15s;
167
+ }
168
+ .btn:hover:not(:disabled){background:var(--primary-hover)}
169
+ .btn:active:not(:disabled){transform:translateY(1px)}
170
+ .btn:disabled{opacity:.5;cursor:not-allowed}
171
+ .btn:focus-visible,.clibtn:focus-visible,a:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
172
+ .btn svg{width:16px;height:16px;stroke-width:2.2}
173
+ .btn.ghost{background:var(--chip);color:var(--fg);border:1px solid var(--line);font-weight:600}
174
+ .btn.ghost:hover:not(:disabled){background:var(--chip-hover)}
175
+ .spinner{width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:sp .7s linear infinite;display:none;opacity:.7}
176
+ @keyframes sp{to{transform:rotate(360deg)}}
177
+ .loading .spinner{display:block}
178
+ .loading .btn-ico{display:none}
179
+
180
+ /* ---------- alert ---------- */
181
+ .alert{
182
+ display:none; align-items:flex-start; gap:9px; margin-bottom:16px;
183
+ padding:10px 12px; border-radius:9px; font-size:12.5px; line-height:1.5;
184
+ background:var(--danger-soft); border:1px solid var(--danger-line); color:var(--danger-fg);
185
+ }
186
+ .alert.show{display:flex;animation:vin .18s ease-out both}
187
+ .alert.ok{background:var(--ok-soft);border-color:var(--ok-line);color:var(--ok-fg)}
188
+ .alert.warn{background:var(--warn-soft);border-color:var(--warn-line);color:var(--warn-fg)}
189
+ .alert svg{width:15px;height:15px;flex:none;margin-top:1px}
190
+
191
+ /* ---------- strength + rules ---------- */
192
+ .strength{height:3px;border-radius:3px;background:var(--line);margin-top:8px;overflow:hidden;display:none}
193
+ .strength.show{display:block}
194
+ .strength i{display:block;height:100%;width:0;background:var(--danger);transition:width .2s,background-color .2s}
195
+ .rules{font-size:11.5px;color:var(--muted);margin-top:7px;line-height:1.55}
196
+ .rules:empty{display:none}
197
+ .rules.ok{color:var(--ok)}
198
+ .rules.bad{color:var(--danger)}
199
+
200
+ /* ---------- window countdown banner ---------- */
201
+ .win{
202
+ display:flex; align-items:center; gap:10px; margin-bottom:18px; padding:10px 12px;
203
+ border-radius:10px; background:var(--ok-soft); border:1px solid var(--ok-line);
204
+ font-size:12px; color:var(--ok-fg); position:relative; overflow:hidden;
205
+ }
206
+ .win svg{width:15px;height:15px;flex:none}
207
+ .win .wtxt{flex:1;min-width:0}
208
+ .win b{font-variant-numeric:tabular-nums;font-weight:700}
209
+ .win .wbar{position:absolute;left:0;bottom:0;height:2px;width:100%;background:currentColor;opacity:.6;transition:width 1s linear}
210
+ .win.warn{background:var(--warn-soft);border-color:var(--warn-line);color:var(--warn-fg)}
211
+ .win.expired{background:var(--panel-2);border-color:var(--line);color:var(--muted)}
212
+
213
+ /* ---------- CLI command block ---------- */
214
+ .clicmd{margin:2px 0 4px;padding:12px;border-radius:12px;background:var(--panel-2);border:1px solid var(--line)}
215
+ .clilabel{font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin-bottom:8px}
216
+ .clirow{display:flex;align-items:stretch;gap:8px;min-width:0}
217
+ .clirow code{
218
+ flex:1; min-width:0; display:block; font-size:13px; color:var(--code-fg); background:var(--code-bg);
219
+ border:1px solid var(--line); border-radius:8px; padding:9px 11px; line-height:1.4;
220
+ overflow-x:auto; white-space:nowrap; user-select:all; scrollbar-width:thin;
221
+ }
222
+ .clirow code::before{content:'$ ';color:var(--faint);user-select:none}
223
+ .clibtn{
224
+ flex:none; font-size:12px; font-weight:600; padding:0 12px; font-family:inherit; border-radius:8px;
225
+ border:1px solid var(--line); background:var(--chip); color:var(--fg); cursor:pointer;
226
+ display:flex; align-items:center; gap:6px; transition:background-color .15s, color .15s;
227
+ }
228
+ .clibtn svg{width:13px;height:13px}
229
+ .clibtn:hover{background:var(--chip-hover)}
230
+ .clibtn.done{color:var(--ok)}
231
+
232
+ /* ---------- status icon panels ---------- */
233
+ .ico{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;margin-bottom:14px;
234
+ background:var(--danger-soft);border:1px solid var(--danger-line);color:var(--danger-fg)}
235
+ .ico svg{width:22px;height:22px}
236
+ .ico.warn{background:var(--warn-soft);border-color:var(--warn-line);color:var(--warn-fg)}
237
+ .ico.calm{background:var(--accent-soft);border-color:var(--accent-line);color:var(--accent)}
238
+ .waiting{display:flex;align-items:center;gap:9px;margin-top:14px;padding:10px 12px;border-radius:10px;
239
+ background:var(--panel-2);border:1px solid var(--line);font-size:12px;color:var(--muted);line-height:1.45}
240
+ .waiting .spin{width:13px;height:13px;border:2px solid var(--line-2);border-top-color:var(--accent);border-radius:50%;animation:sp .8s linear infinite;flex:none}
241
+ .checklist{list-style:none;margin:0 0 16px;border:1px solid var(--line);border-radius:10px;overflow:hidden}
242
+ .checklist li{display:flex;align-items:center;gap:10px;padding:10px 12px;font-size:12.5px;background:var(--panel-2)}
243
+ .checklist li+li{border-top:1px solid var(--line)}
244
+ .checklist li svg{width:15px;height:15px;flex:none;color:var(--muted)}
245
+ .checklist li span{flex:1}
246
+ .checklist li em{font-style:normal;font-size:11.5px;font-weight:600}
247
+ .checklist li.ok em{color:var(--ok)}
248
+ .checklist li.bad em{color:var(--danger)}
249
+ .checklist.about li{align-items:flex-start;line-height:1.45;color:var(--muted)}
250
+ .checklist.about li svg{margin-top:2px;color:var(--accent)}
251
+ .checklist.about li b{display:block;color:var(--fg);font-weight:650}
252
+ .steps-h{font-size:12px;font-weight:650;color:var(--fg);margin:0 0 8px}
253
+ .about-name{font-size:11.5px;color:var(--muted);line-height:1.5;margin:16px 0 0;padding-top:12px;border-top:1px solid var(--line);font-style:italic}
254
+
255
+ /* ---------- cooldown ---------- */
256
+ .timer{font-family:ui-monospace,SFMono-Regular,'SF Mono',Menlo,Consolas,monospace;font-size:34px;font-weight:700;letter-spacing:.04em;font-variant-numeric:tabular-nums;margin:2px 0 12px;color:var(--fg)}
257
+ .tbar{height:4px;border-radius:4px;background:var(--line);overflow:hidden;margin-bottom:14px}
258
+ .tbar i{display:block;height:100%;width:100%;background:var(--accent);transition:width 1s linear}
259
+
260
+ /* ---------- footer ---------- */
261
+ .foot{margin-top:20px;padding-top:14px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:10.5px;color:var(--muted)}
262
+ .foot span{display:flex;align-items:center;gap:6px;min-width:0}
263
+ .dot{width:6px;height:6px;border-radius:50%;background:var(--faint);flex:none;transition:background-color .2s,box-shadow .2s}
264
+ .dot.on{background:var(--ok);box-shadow:0 0 6px var(--ok)}
265
+ .dot.off{background:var(--danger);box-shadow:0 0 6px var(--danger)}
266
+ .foot .tag{letter-spacing:.02em;opacity:.85;white-space:nowrap}
267
+
268
+ @media (max-width:420px){
269
+ body{padding:14px 12px;place-items:start center}
270
+ .card{padding:24px 20px 18px;border-radius:14px;margin-top:max(0px,calc(50vh - 330px))}
271
+ .brand{margin-bottom:18px}
272
+ h1{font-size:18px}
273
+ .sub{margin-bottom:16px}
274
+ .timer{font-size:30px}
275
+ }
276
+ @media (max-width:380px){
277
+ .clibtn{padding:0 11px}
278
+ .clibtn span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
279
+ }
280
+ @media (prefers-reduced-motion:reduce){
281
+ *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
282
+ .card::after{display:none}
283
+ .checks li.run .ci,.waiting .spin,.spinner{animation:sp 1.6s linear infinite!important}
284
+ }
285
+
286
+ </style>
287
+ </head>
288
+ <body>
289
+ <main class="card splashing" id="card" aria-live="polite">
290
+ <div class="brand">
291
+ <svg class="brand-mark" viewBox="0 0 24 24" aria-hidden="true"><defs><linearGradient id="mmg7m2055" x1="3" y1="3" x2="21" y2="21" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#5eead4"/><stop offset="1" stop-color="#22d3ee"/></linearGradient><linearGradient id="mmt7m2055" x1="0" y1="0" x2="0" y2="24" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#17202e"/><stop offset="1" stop-color="#0b0f17"/></linearGradient><radialGradient id="mmc7m2055" cx="50%" cy="50%" r="50%"><stop offset="0" stop-color="#ffffff"/><stop offset=".55" stop-color="#a5f3fc"/><stop offset="1" stop-color="#22d3ee"/></radialGradient></defs><g fill="none" stroke="none"><rect x="1.5" y="1.5" width="21" height="21" rx="6.2" fill="url(#mmt7m2055)"/><rect x="1.5" y="1.5" width="21" height="21" rx="6.2" fill="none" stroke="url(#mmg7m2055)" stroke-opacity=".55" stroke-width=".8"/><path d="M7.2 16.8V7.4l4.8 5.1 4.8-5.1v9.4" fill="none" stroke="url(#mmg7m2055)" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/><circle cx="7.2" cy="16.8" r="1.7" fill="#5eead4"/><circle cx="7.2" cy="7.4" r="1.7" fill="#5eead4"/><circle cx="16.8" cy="7.4" r="1.7" fill="#22d3ee"/><circle cx="16.8" cy="16.8" r="1.7" fill="#22d3ee"/><circle cx="12" cy="12.5" r="3" fill="#22d3ee" opacity=".22"/><circle cx="12" cy="12.5" r="2" fill="url(#mmc7m2055)"/></g></svg>
292
+ <div class="brand-txt"><b>Memora</b><small>Second brain for your AI</small></div>
293
+ </div>
294
+
295
+ <div id="alert" class="alert" role="alert"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 8v5M12 16h.01"/></svg><span id="alertMsg"></span></div>
296
+
297
+ <!-- SPLASH: shown until routing completes -->
298
+ <section class="view splash" id="vSplash">
299
+ <svg class="brand-mark" viewBox="0 0 24 24" aria-hidden="true"><defs><linearGradient id="mmg7m2056" x1="3" y1="3" x2="21" y2="21" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#5eead4"/><stop offset="1" stop-color="#22d3ee"/></linearGradient><linearGradient id="mmt7m2056" x1="0" y1="0" x2="0" y2="24" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#17202e"/><stop offset="1" stop-color="#0b0f17"/></linearGradient><radialGradient id="mmc7m2056" cx="50%" cy="50%" r="50%"><stop offset="0" stop-color="#ffffff"/><stop offset=".55" stop-color="#a5f3fc"/><stop offset="1" stop-color="#22d3ee"/></radialGradient></defs><g fill="none" stroke="none"><rect x="1.5" y="1.5" width="21" height="21" rx="6.2" fill="url(#mmt7m2056)"/><rect x="1.5" y="1.5" width="21" height="21" rx="6.2" fill="none" stroke="url(#mmg7m2056)" stroke-opacity=".55" stroke-width=".8"/><path d="M7.2 16.8V7.4l4.8 5.1 4.8-5.1v9.4" fill="none" stroke="url(#mmg7m2056)" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/><circle cx="7.2" cy="16.8" r="1.7" fill="#5eead4"/><circle cx="7.2" cy="7.4" r="1.7" fill="#5eead4"/><circle cx="16.8" cy="7.4" r="1.7" fill="#22d3ee"/><circle cx="16.8" cy="16.8" r="1.7" fill="#22d3ee"/><circle cx="12" cy="12.5" r="3" fill="#22d3ee" opacity=".22"/><circle cx="12" cy="12.5" r="2" fill="url(#mmc7m2056)"/></g></svg>
300
+ <h1 id="splashTitle">Checking this instance&hellip;</h1>
301
+ <ul class="checks">
302
+ <li id="ckServer"><span class="ci"><svg viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg></span><span>Server reachable</span><span class="cv"></span></li>
303
+ <li id="ckReady"><span class="ci"><svg viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg></span><span>Vault and state ready</span><span class="cv"></span></li>
304
+ <li id="ckAccount"><span class="ci"><svg viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg></span><span>Account status</span><span class="cv"></span></li>
305
+ </ul>
306
+ <button type="button" class="btn ghost" id="retryBtn" hidden>Try again</button>
307
+ </section>
308
+
309
+ <!-- SIGN IN -->
310
+ <section class="view" id="vSignin" hidden>
311
+ <p class="eyebrow">Welcome back</p>
312
+ <h1>Sign in</h1>
313
+ <p class="sub">This vault is private. Sign in to see your nodes, the brain and agent activity.</p>
314
+ <form id="loginForm" autocomplete="on">
315
+ <div class="field"><label for="u">Username</label>
316
+ <div class="inp"><svg viewBox="0 0 24 24"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg><input id="u" name="username" type="text" placeholder="username" autocomplete="username" required spellcheck="false" autocapitalize="off"></div>
317
+ </div>
318
+ <div class="field"><label for="p">Password</label>
319
+ <div class="inp"><svg viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="10" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg><input id="p" name="password" type="password" placeholder="&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;" autocomplete="current-password" required><button type="button" class="eye" id="eye" aria-label="Show password"><svg viewBox="0 0 24 24"><path d="M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg></button></div>
320
+ </div>
321
+ <button class="btn" id="submitBtn" type="submit"><span class="spinner"></span><svg class="btn-ico" viewBox="0 0 24 24"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"/><path d="m10 17 5-5-5-5M15 12H3"/></svg><span id="btnTxt">Sign in</span></button>
322
+ </form>
323
+ <p class="links"><a href="#help" id="helpLink">Forgot password or need help?</a></p>
324
+ </section>
325
+
326
+ <!-- OAUTH CONSENT (an AI app connecting over MCP) -->
327
+ <section class="view" id="vOauth" hidden>
328
+ <div class="ico"><svg viewBox="0 0 24 24"><circle cx="8" cy="15" r="4"/><path d="m10.8 12.2 8.7-8.7M17 6l2.5 2.5M14.5 8.5l2 2"/></svg></div>
329
+ <p class="eyebrow">Connect an AI app</p>
330
+ <h1 id="oaTitle">Allow access?</h1>
331
+ <p class="sub" id="oaSub">Checking the request&hellip;</p>
332
+ <ul class="checklist" id="oaList">
333
+ <li><svg viewBox="0 0 24 24"><circle cx="8" cy="15" r="4"/><path d="m10.8 12.2 8.7-8.7M17 6l2.5 2.5M14.5 8.5l2 2"/></svg><span>Gets its own agent key: read and write nodes over MCP</span><em></em></li>
334
+ <li><svg viewBox="0 0 24 24"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/><path d="M12 11v3M12 17h.01"/></svg><span>Every call shows up live in the brain and Activity</span><em></em></li>
335
+ <li><svg viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="10" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg><span>Revoke it anytime in Agents &amp; API keys</span><em></em></li>
336
+ </ul>
337
+ <p class="note" id="oaWho"></p>
338
+ <div id="oaActs">
339
+ <button class="btn" id="oaAllow" type="button"><span class="spinner"></span><svg class="btn-ico" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg><span>Allow</span></button>
340
+ <button class="btn ghost" id="oaDeny" type="button" style="margin-top:8px">Cancel</button>
341
+ </div>
342
+ </section>
343
+
344
+ <!-- NOT SET UP -->
345
+ <section class="view" id="vSetup" hidden>
346
+ <h1>Welcome to Memora</h1>
347
+ <p class="sub">A self-hosted memory vault: your notes as plain Markdown, wired into a living brain that your AI agents read and write over MCP. What they learn stays.</p>
348
+ <ul class="checklist about">
349
+ <li><svg viewBox="0 0 24 24"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/><path d="M12 11v3M12 17h.01"/></svg><span><b>Vault</b> Your notes stay plain Markdown files, in a folder you choose</span><em></em></li>
350
+ <li><svg viewBox="0 0 24 24"><circle cx="6" cy="6" r="2.2"/><circle cx="18" cy="7" r="2.2"/><circle cx="12" cy="18" r="2.2"/><circle cx="12" cy="11" r="1.6"/><path d="M7.8 7.2 10.6 10M16.2 8.2 13.4 10.2M12 12.6v3.2"/></svg><span><b>Brain, Graph, Canvas</b> See how every note connects: in 3D, as a graph, or on a board</span><em></em></li>
351
+ <li><svg viewBox="0 0 24 24"><circle cx="8" cy="15" r="4"/><path d="m10.8 12.2 8.7-8.7M17 6l2.5 2.5M14.5 8.5l2 2"/></svg><span><b>Set up once, use everywhere</b> Claude, Cursor, ChatGPT and your own agents share one memory, each with its own key, instead of being taught the same things again</span><em></em></li>
352
+ <li><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></svg><span><b>From anywhere</b> on this machine, your local network, or the internet through a tunnel or reverse proxy</span><em></em></li>
353
+ </ul>
354
+ <p class="steps-h">Set it up in two steps</p>
355
+ <div class="clicmd">
356
+ <div class="clilabel" id="setupCmdLabel">1. Open the console on the server</div>
357
+ <div class="clirow"><code id="setupCmd">memora-cli</code><button type="button" class="clibtn" data-copy="setupCmd" aria-label="Copy command"><svg viewBox="0 0 24 24"><rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span>Copy</span></button></div>
358
+ </div>
359
+ <p class="note">2. Type <code id="tuiCmd">/guide</code> and follow the steps. This page moves on by itself.</p>
360
+ <div class="waiting"><span class="spin"></span><span>Waiting for setup&hellip;</span></div>
361
+ <p class="about-name">Memora is memory, advanced: built to remember what you and your AI learn, and to remember more the more you use it.</p>
362
+ </section>
363
+
364
+ <!-- WINDOW OPEN: CODE STEP -->
365
+ <section class="view" id="vCode" hidden>
366
+ <div class="win" data-win id="winCode"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg><span class="wtxt">Window open</span><i class="wbar"></i></div>
367
+ <h1 id="codeTitle">Enter the setup code</h1>
368
+ <p class="sub" id="codeSub">Enter the setup code shown in the server terminal.</p>
369
+ <form id="codeForm" autocomplete="off">
370
+ <div class="field"><label for="code" id="codeLabel">Setup code</label>
371
+ <div class="inp code" id="codeInp"><input id="code" name="one-time-code" type="text" inputmode="text" autocomplete="one-time-code" placeholder="XXXX-XXXX" maxlength="9" spellcheck="false" autocapitalize="characters" required></div>
372
+ </div>
373
+ <button class="btn" id="codeBtn" type="submit" disabled><span class="spinner"></span><svg class="btn-ico" viewBox="0 0 24 24"><path d="M5 12h14M13 6l6 6-6 6"/></svg><span id="codeBtnTxt">Continue</span></button>
374
+ </form>
375
+ <p class="note center">Lost the code? Type <code id="codeAgain">/web</code> in the console for a new one.</p>
376
+ </section>
377
+
378
+ <!-- WINDOW OPEN: ACCOUNT FORM (setup or reset) -->
379
+ <section class="view" id="vForm" hidden>
380
+ <div class="win" data-win id="winForm"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg><span class="wtxt">Window open</span><i class="wbar"></i></div>
381
+ <h1 id="formTitle">Create the owner account</h1>
382
+ <p class="sub" id="formSub">Choose a username and password for this vault.</p>
383
+ <form id="setForm" autocomplete="off">
384
+ <div class="field"><label for="su">Username</label>
385
+ <div class="inp" id="inp1"><svg viewBox="0 0 24 24"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg><input id="su" name="username" type="text" placeholder="username" autocomplete="username" required spellcheck="false" autocapitalize="off"></div>
386
+ </div>
387
+ <div class="field"><label for="sp">Password</label>
388
+ <div class="inp" id="inp3"><svg viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="10" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg><input id="sp" name="new-password" type="password" placeholder="&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;" autocomplete="new-password" required><button type="button" class="eye" id="eye2" aria-label="Show password"><svg viewBox="0 0 24 24"><path d="M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg></button></div>
389
+ <div class="strength" id="strength"><i></i></div>
390
+ <div class="rules" id="rules"></div>
391
+ </div>
392
+ <div class="field"><label for="sp2">Confirm password</label>
393
+ <div class="inp" id="inp2"><svg viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="10" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg><input id="sp2" name="confirm-password" type="password" placeholder="&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;" autocomplete="new-password" required><button type="button" class="eye" id="eye3" aria-label="Show confirm password"><svg viewBox="0 0 24 24"><path d="M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg></button></div>
394
+ <div class="rules" id="match"></div>
395
+ </div>
396
+ <button class="btn" id="setBtn" type="submit" disabled><span class="spinner"></span><svg class="btn-ico" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg><span id="setBtnTxt">Create account</span></button>
397
+ </form>
398
+ <p class="links"><a href="#" id="backToCode">&larr; Use a different code</a></p>
399
+ </section>
400
+
401
+ <!-- NOT READY -->
402
+ <section class="view" id="vNotReady" hidden>
403
+ <div class="ico warn"><svg viewBox="0 0 24 24"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/><path d="M12 11v3M12 17h.01"/></svg></div>
404
+ <h1>Instance not ready</h1>
405
+ <p class="sub">Setup stays locked until the server can write to its folders.</p>
406
+ <ul class="checklist">
407
+ <li id="nrVault"><svg viewBox="0 0 24 24"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/><path d="M12 11v3M12 17h.01"/></svg><span>Vault folder writable</span><em></em></li>
408
+ <li id="nrState"><svg viewBox="0 0 24 24"><circle cx="8" cy="15" r="4"/><path d="m10.8 12.2 8.7-8.7M17 6l2.5 2.5M14.5 8.5l2 2"/></svg><span>State folder writable</span><em></em></li>
409
+ </ul>
410
+ <div class="clicmd">
411
+ <div class="clilabel" id="nrCmdLabel">Check and fix on the server</div>
412
+ <div class="clirow"><code id="nrCmd">memora-cli</code><button type="button" class="clibtn" data-copy="nrCmd" aria-label="Copy command"><svg viewBox="0 0 24 24"><rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span>Copy</span></button></div>
413
+ </div>
414
+ <div class="waiting"><span class="spin"></span><span>Re-checking every few seconds&hellip;</span></div>
415
+ </section>
416
+
417
+ <!-- LOCKED (window expired unused) -->
418
+ <section class="view" id="vLocked" hidden>
419
+ <div class="ico"><svg viewBox="0 0 24 24"><rect x="4" y="10.5" width="16" height="10" rx="2.4"/><path d="M8 10.5V7a4 4 0 0 1 8 0v3.5"/><path d="M12 14.6v2.2"/></svg></div>
420
+ <h1>Access held</h1>
421
+ <p class="sub" id="lockWhy">The setup or reset window expired before it was completed. Access stays on hold until that finishes.</p>
422
+ <div class="clicmd">
423
+ <div class="clilabel" id="lockCmdLabel">Open the console on the server</div>
424
+ <div class="clirow"><code id="lockCmd">memora-cli</code><button type="button" class="clibtn" data-copy="lockCmd" aria-label="Copy command"><svg viewBox="0 0 24 24"><rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span>Copy</span></button></div>
425
+ </div>
426
+ <p class="note">Then type <code>/guide</code> to recover with a fresh one-time code.</p>
427
+ <div class="waiting"><span class="spin"></span><span>Waiting for a new window&hellip; this page continues on its own.</span></div>
428
+ </section>
429
+
430
+ <!-- COOLDOWN -->
431
+ <section class="view center" id="vCooldown" hidden>
432
+ <div class="ico calm" style="margin-left:auto;margin-right:auto"><svg viewBox="0 0 24 24"><circle cx="12" cy="13.5" r="7.5"/><path d="M12 10v3.8l2.4 1.6M9.5 3h5M12 3v3"/></svg></div>
433
+ <h1>Too many attempts</h1>
434
+ <p class="sub" style="margin-bottom:8px">Attempts from this device are paused for safety. Try again in</p>
435
+ <div class="timer" id="cdTime">0:00</div>
436
+ <div class="tbar"><i id="cdBar"></i></div>
437
+ <p class="note" style="margin-top:0">This page continues on its own when the pause ends.</p>
438
+ <p class="note" style="margin-top:14px">Was it you? End the pause now on the server: open <code>memora-cli</code> and type <code>/cooldowns</code>, or run</p>
439
+ <div class="clicmd">
440
+ <div class="clilabel" id="cdCmdLabel">End the pause on the server</div>
441
+ <div class="clirow"><code id="cdCmd">memora-cli clear-cooldowns</code><button type="button" class="clibtn" data-copy="cdCmd" aria-label="Copy command"><svg viewBox="0 0 24 24"><rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span>Copy</span></button></div>
442
+ </div>
443
+ </section>
444
+
445
+ <!-- HELP -->
446
+ <section class="view" id="vHelp" hidden>
447
+ <h1>Need help signing in?</h1>
448
+ <p class="sub">Passwords are reset from the Memora console on the server.</p>
449
+ <div class="clicmd">
450
+ <div class="clilabel" id="resetCmdLabel">Open the console on the server</div>
451
+ <div class="clirow"><code id="resetCmd">memora-cli</code><button type="button" class="clibtn" data-copy="resetCmd" aria-label="Copy command"><svg viewBox="0 0 24 24"><rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg><span>Copy</span></button></div>
452
+ </div>
453
+ <p class="note">Then type <code id="helpCmd">/reset</code>, or <code>/guide</code> for a walkthrough. This page moves on by itself.</p>
454
+ <p class="links"><a href="#" id="backLink">&larr; Back to sign in</a></p>
455
+ </section>
456
+
457
+ <footer class="foot"><span><i class="dot" id="dot"></i><span id="footState">checking</span></span><span class="tag">Memora by Codrihub Tech</span></footer>
458
+ </main>
459
+
460
+ <script>
461
+ (()=>{const r=e=>document.querySelector(e),c=e=>r(e),U=e=>new Promise(t=>window.setTimeout(t,e)),se=()=>window.performance?performance.now():Date.now(),j={splash:"#vSplash",signin:"#vSignin",help:"#vHelp",setup:"#vSetup",code:"#vCode",form:"#vForm",notready:"#vNotReady",locked:"#vLocked",cooldown:"#vCooldown",oauth:"#vOauth"};function E(e){return e==="help"?"signin":e==="form"?"code":e}const ae=r("#alert"),me=r("#alertMsg");function d(e,t=""){me.textContent=e,ae.className="alert show"+(t?" "+t:"")}function y(){ae.className="alert"}function O(e,t){const n=e??{};return typeof n.error=="string"?n.error:typeof n.message=="string"?n.message:t}function h(e,t,n,o){e.disabled=t,e.classList.toggle("loading",t),n&&o&&(o.textContent=n)}function I(e,t={}){const n={accept:"application/json",...t.headers};return fetch(e,{credentials:"same-origin",cache:"no-store",...t,headers:n})}function D(e,t){return I(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}const pe=/^\/(?:$|node\/|(?:brain|nodes|graph|canvas|tags|activity|agents|tools|access|settings|overview|welcome|home|vault|logs|keys|docs)(?:\/|$))/;function ie(e){if(!e||typeof e!="string"||e.length>2048||/[\u0000-\u001f\u007f]/.test(e)||/%(?:0[0-9a-f]|1[0-9a-f]|7f)/i.test(e))return null;try{const t=new URL(e,location.origin);return t.origin!==location.origin||t.protocol!=="http:"&&t.protocol!=="https:"||!t.pathname.startsWith("/")||t.pathname.startsWith("//")||t.pathname.includes("\\")||t.pathname==="/login"||t.pathname==="/logout"||t.username||t.password||!pe.test(t.pathname)?null:t.pathname+t.search+t.hash}catch{return null}}function ge(){const e=new URLSearchParams(location.search);return ie(e.get("r")??e.get("next"))}const N=(()=>{const e=new URLSearchParams(location.search);return e.has("oauth")?(e.delete("oauth"),e.toString()):null})();function X(e){(/^https:\/\//.test(e)||/^http:\/\/(localhost|127\.0\.0\.1|\[::1\])[:/?]/.test(e))&&(location.href=e)}async function we(){y(),M(!0);let e;try{e=await(await I("/api/oauth/request?"+N)).json()}catch{e={ok:!1,error_description:"Could not reach the server."}}const t=r("#oaActs");if(!e.ok||!e.client){r("#oaTitle").textContent="This connection request cannot be used",r("#oaSub").textContent=e.error_description||e.error||"The request is invalid.",r("#oaList").hidden=!0,t.hidden=!e.redirect,e.redirect&&(r("#oaAllow").hidden=!0,r("#oaDeny").textContent="Back to the app",r("#oaDeny").onclick=()=>X(e.redirect)),w("oauth");return}const n=e.client.name||"An MCP client";r("#oaTitle").textContent=`Allow ${n} to use Memora?`,r("#oaSub").textContent=`${n} will connect to this vault as an agent, then return to ${e.redirect_host||"the app"}.`,r("#oaWho").textContent=e.user?`Signed in as ${e.user}`:"";const o=async(s,a)=>{h(a,!0);try{const l=await(await D("/api/oauth/approve",{query:N,allow:s})).json().catch(()=>({}));if(l.redirect)return X(l.redirect);d(O(l,"Could not finish the connection"),"warn")}catch{d("Could not reach the server","warn")}h(a,!1)};r("#oaAllow").onclick=s=>void o(!0,s.currentTarget),r("#oaDeny").onclick=s=>void o(!1,s.currentTarget),w("oauth")}function $(e){if(N!==null){we();return}const t=ge()||ie(e)||"/";t==="/login"||t===location.pathname+location.search||location.replace(t)}function ce(e){const t=Math.max(0,Math.ceil(e));return Math.floor(t/60)+":"+String(t%60).padStart(2,"0")}function q(e,t,n){if(e!==429)return null;const o=t??{},s=Number(o.retry_after??n??0);return{...o,retry_after:Number.isFinite(s)?s:0}}let le="memora-cli setup";const ve=()=>le.trim().split(/\s+/)[0]||"memora-cli";let m="splash",ee=0;const be=r("#card");async function w(e){if(e===m)return;const t=++ee,n=m;m=e;const o=r(j[n]);if(o&&!o.hidden){if(o.classList.add("leaving"),await U(150),t!==ee)return;o.classList.remove("leaving"),o.hidden=!0}Object.entries(j).forEach(([i,l])=>{const p=r(l);p.classList.remove("leaving"),i!==e&&(p.hidden=!0)}),be.classList.toggle("splashing",e==="splash"),r(j[e]).hidden=!1;const a={signin:"#u",code:"#code",form:"#su"}[e];if(a){const i=c(a);try{i.focus({preventScroll:!0})}catch{i.focus()}}ke()}let Y={};const te={password_changed:"You were signed out because the password was changed on another device. Sign in with the new password.",signed_out_remotely:"You were signed out from another device. Sign in again to continue.",expired:"Your session expired. Sign in again to continue."};let H=new URLSearchParams(location.search).get("reason");function ne(){return H&&Object.prototype.hasOwnProperty.call(te,H)?te[H]:""}async function T(){try{const e=await I("/api/auth/state"),t=await e.json().catch(()=>null),n=q(e.status,t,e.headers.get("retry-after"));if(n)return{ok:!1,limited:n};if(!e.ok||!t||typeof t!="object")return{ok:!1};const o=t;return o.setup_hint&&(le=o.setup_hint),o.signed_out&&(H=o.signed_out),Y=o,{ok:!0,s:o}}catch{return{ok:!1}}}function M(e){r("#dot").className="dot "+(e?"on":"off"),r("#footState").textContent=e?"gateway online":"gateway unreachable"}function A(e){return(e.cooldown??0)>0?"cooldown":!!(e.armed||e.locked||e.bootstrap)&&e.ready===!1?"notready":e.armed?"code":e.locked?"locked":e.bootstrap?"setup":location.hash==="#help"?"help":"signin"}function g(e,t){const n=ve();switch(y(),e){case"signin":t.ready===!1?d("The server cannot write to its vault or state folder. Run "+n+" on the server to check it.","warn"):ne()&&d(ne(),"warn");break;case"help":r("#resetCmd").textContent=n;break;case"setup":r("#setupCmd").textContent=n;break;case"code":Me(t);break;case"notready":{const o=(s,a)=>{const i=r(s);i.className=a===!1?"bad":"ok",i.querySelector("em").textContent=a===!1?"Not writable":"OK"};o("#nrVault",t.checks?.vault),o("#nrState",t.checks?.state),r("#nrCmd").textContent=n;break}case"locked":r("#lockCmd").textContent=n,r("#lockWhy").textContent=t.bootstrap?"The setup window expired before the owner account was created. Access stays on hold until setup finishes.":"The reset window expired before the new password was saved. Access stays on hold until the reset finishes.";break;case"cooldown":R(t.cooldown??60);break;default:break}w(e)}let C=null;const ye=["setup","code","form","notready","locked","help"];function ke(){const e=ye.includes(m);e&&C===null&&(C=window.setInterval(()=>void Le(),3e3)),!e&&C!==null&&(clearInterval(C),C=null)}let V=!1;async function Le(){if(!V){V=!0;try{const e=await T();if(!e.ok){e.limited?.cooldown&&W(e.limited.retry_after??60);return}M(!0);const t=e.s;(m==="code"||m==="form")&&t.armed&&typeof t.expires_in=="number"&&G(t.expires_in,t.ttl);const n=A(t);(E(n)!==E(m)||n==="notready")&&g(n,t)}finally{V=!1}}}async function de(){const e=await T();e.ok?(M(!0),g(A(e.s),e.s)):e.limited?.cooldown&&W(e.limited.retry_after??60)}let k=null,P=null;function W(e){y(),R(e),w("cooldown")}function R(e){m!=="cooldown"&&m!=="splash"&&(P=m),k!==null&&clearInterval(k);const t=Math.max(1,e),n=Date.now()+e*1e3,o=r("#cdTime"),s=r("#cdBar"),a=()=>{const i=(n-Date.now())/1e3;o.textContent=ce(i),s.style.width=Math.max(0,Math.min(100,i/t*100))+"%",i<=0&&(k!==null&&clearInterval(k),k=null,Se())};a(),k=window.setInterval(a,500)}async function Se(){const e=P;P=null;const t=await T();if(!t.ok){t.limited?.cooldown?R(t.limited.retry_after??30):e&&w(e);return}const n=A(t.s);if(n==="cooldown"){R(t.s.cooldown??30),P=e;return}e&&E(e)===E(n)?w(e):g(n,t.s)}function Z(e){e.cooldown?W(e.retry_after||60):d("Too many requests. Wait a few seconds and try again.","warn")}const Te='<path d="M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/>',Ce='<path d="M9.9 5.2A10.6 10.6 0 0 1 12 5c6.4 0 10 7 10 7a18 18 0 0 1-3.2 4.1"/><path d="M6.1 6.4A18 18 0 0 0 2 12s3.6 7 10 7a10.5 10.5 0 0 0 4.3-.9"/><path d="M3 3l18 18"/><path d="M9.9 9.9a3 3 0 0 0 4.2 4.2"/>';function z(e,t){const n=r(e),o=c(t),s=n.querySelector("svg"),a=()=>{const i=o.type==="text";s&&(s.innerHTML=i?Ce:Te),n.title=i?"Hide password":"Show password",n.setAttribute("aria-label",n.title),n.style.color=i?"var(--accent-2)":""};return n.addEventListener("click",()=>{o.type=o.type==="password"?"text":"password",a();try{o.focus({preventScroll:!0})}catch{}}),a(),()=>{o.type="password",a()}}z("#eye","#p");const xe=z("#eye2","#sp"),Ee=z("#eye3","#sp2");r("#loginForm").addEventListener("submit",e=>{e.preventDefault(),(async()=>{y();const t=r("#submitBtn"),n=r("#btnTxt");h(t,!0,"Signing in...",n);try{const o=await D("/api/auth/login",{username:c("#u").value.trim(),password:c("#p").value}),s=await o.json().catch(()=>({})),a=q(o.status,s,o.headers.get("retry-after"));if(a){h(t,!1,"Sign in",n),Z(a);return}if(!o.ok){const i=o.status===401?"Wrong username or password.":o.status===503?"The server is busy. Try again in a moment.":O(s,"Sign-in failed ("+o.status+").");d(i),h(t,!1,"Sign in",n),c("#p").select();return}d("Signed in. Opening your vault...","ok"),$(s.redirect)}catch(o){d("Could not reach the server: "+o.message),h(t,!1,"Sign in",n)}})()});window.addEventListener("hashchange",()=>{E(m)==="signin"&&g(location.hash==="#help"?"help":"signin",Y)});r("#backLink").addEventListener("click",e=>{e.preventDefault(),history.pushState(null,"",location.pathname+location.search),g("signin",Y)});let x=null,ue=0,F=300,_=!1;function G(e,t){F=typeof t=="number"&&t>0?t:Math.max(F,e,1),ue=Date.now()+e*1e3,_=!1,x===null&&(x=window.setInterval(oe,1e3)),oe()}function K(){x!==null&&clearInterval(x),x=null}function oe(){const e=Math.max(0,Math.round((ue-Date.now())/1e3));document.querySelectorAll("[data-win]").forEach(t=>{const n=t.querySelector(".wtxt"),o=t.querySelector(".wbar");e<=0?(t.className="win expired",n.textContent="Window expired. Checking the server...",o.style.width="0%"):(t.className="win"+(e<=45?" warn":""),n.innerHTML="Window open, <b>"+ce(e)+"</b> left",o.style.width=Math.round(e/F*100)+"%")}),e<=0&&!_&&(_=!0,K(),r("#setBtn").disabled=!0,r("#codeBtn").disabled=!0,window.setTimeout(()=>void de(),1200))}async function he(e){K(),c("#code").value="";const t=await T(),n=t.ok?t.s:{};g(t.ok?A(n):"setup",n),d(e,"warn")}let f={mode:"bootstrap",min:10,user:null,code:""};const S=()=>f.mode==="reset"||f.mode==="reset-password",fe=e=>e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,8);function Me(e){f={mode:e.mode||(e.bootstrap?"bootstrap":"reset"),min:e.min_password_len||10,user:null,code:""};const t=S();r("#codeTitle").textContent=t?"Enter the reset code":"Enter the setup code",r("#codeSub").textContent="Enter the "+(t?"reset":"setup")+" code shown in the server terminal. One try only: a wrong code voids it.",r("#codeLabel").textContent=t?"Reset code":"Setup code";const n=c("#code");n.value="",n.disabled=!1,r("#codeInp").classList.remove("bad"),r("#codeBtn").disabled=!0,G(typeof e.expires_in=="number"?e.expires_in:300,e.ttl)}c("#code").addEventListener("input",()=>{const e=c("#code"),t=fe(e.value);e.value=t.length>4?t.slice(0,4)+"-"+t.slice(4):t,r("#codeInp").classList.remove("bad"),r("#codeBtn").disabled=t.length!==8||_});r("#codeForm").addEventListener("submit",e=>{e.preventDefault(),(async()=>{const t=fe(c("#code").value);if(t.length!==8)return;y();const n=r("#codeBtn"),o=r("#codeBtnTxt");h(n,!0,"Checking...",o);try{const s=await D("/api/auth/verify",{code:t}),a=await s.json().catch(()=>({}));h(n,!1,"Continue",o);const i=q(s.status,a,s.headers.get("retry-after"));if(i){Z(i);return}if(!s.ok||!a.ok){const l=O(a,"Code check failed ("+s.status+").");a.burned?await he(l):(d(l),window.setTimeout(()=>void de(),1500));return}f.code=t,a.mode&&(f.mode=a.mode),f.user=a.user??null,typeof a.expires_in=="number"&&G(a.expires_in),_e(),w("form")}catch(s){h(n,!1,"Continue",o),d("Could not reach the server: "+s.message)}})()});function _e(){const e=S();r("#formTitle").textContent=e?"Reset password":"Create the owner account",r("#formSub").textContent=e?"Set a new password for the owner. Change the username to rename the account.":"Choose a username and password for this vault.",r("#setBtnTxt").textContent=e?"Save new password":"Create account",c("#su").value=e&&f.user?f.user:"",c("#sp").value="",c("#sp2").value="",["#su","#sp","#sp2"].forEach(t=>c(t).disabled=!1),xe(),Ee(),["#inp1","#inp2","#inp3"].forEach(t=>r(t).classList.remove("ok","bad")),r("#setBtn").classList.remove("loading"),J()}function Ae(e){let t=0;return e.length>=10&&t++,e.length>=14&&t++,/[A-Z]/.test(e)&&/[a-z]/.test(e)&&t++,/\d/.test(e)&&t++,/[^A-Za-z0-9]/.test(e)&&t++,Math.min(t,4)}function J(){const e=f.min,t=c("#sp").value,n=c("#sp2").value,o=r("#strength"),s=o.querySelector("i"),a=r("#rules"),i=r("#inp3");if(!t)o.classList.remove("show"),a.textContent="",a.className="rules",i.classList.remove("ok","bad");else{o.classList.add("show");const b=Ae(t);s.style.width=[15,35,60,82,100][b]+"%",s.style.background=["var(--danger)","var(--danger)","var(--warn)","var(--ok)","var(--ok)"][b];const B=t.length>=e;a.textContent=B?"Length OK ("+t.length+" characters)":"At least "+e+" characters ("+t.length+" so far)",a.className="rules "+(B?"ok":"bad"),i.classList.toggle("ok",B),i.classList.toggle("bad",!B)}const l=r("#match"),p=r("#inp2");if(!n)l.textContent="",l.className="rules",p.classList.remove("ok","bad");else{const b=n===t;l.textContent=b?"Passwords match":"Passwords do not match",l.className="rules "+(b?"ok":"bad"),p.classList.toggle("ok",b),p.classList.toggle("bad",!b)}const v=t.length>=e&&n===t&&c("#su").value.trim().length>0;r("#setBtn").disabled=!v||_}["#sp","#sp2","#su"].forEach(e=>c(e).addEventListener("input",J));r("#backToCode").addEventListener("click",e=>{e.preventDefault(),y(),c("#code").value="",r("#codeBtn").disabled=!0,w("code")});r("#setForm").addEventListener("submit",e=>{e.preventDefault(),(async()=>{y();const t=r("#setBtn"),n=r("#setBtnTxt"),o=S()?"Save new password":"Create account",s=c("#su").value.trim(),a=c("#sp").value;if(!s)return d("Username required.");if(a.length<f.min)return d("Password must be at least "+f.min+" characters.");if(a!==c("#sp2").value)return d("Passwords do not match.");h(t,!0,"Saving...",n);try{const i=await D(S()?"/api/auth/reset":"/api/auth/bootstrap",{code:f.code,username:s,password:a}),l=await i.json().catch(()=>({})),p=q(i.status,l,i.headers.get("retry-after"));if(p){h(t,!1,o,n),Z(p);return}if(!i.ok){h(t,!1,o,n),J();const v=O(l,"Failed ("+i.status+").");l.burned?await he(v):d(v);return}if(K(),!l.redirect&&S()){const v=await T();g("signin",v.ok?v.s:{}),c("#u").value=s,c("#p").value="",d("Password saved. Sign in with the new password.","ok"),window.setTimeout(()=>c("#p").focus(),260);return}d(S()?"Password saved. Opening your vault...":"Account created. Opening your vault...","ok"),$(l.redirect)}catch(i){h(t,!1,o,n),d("Could not reach the server: "+i.message)}})()});document.querySelectorAll("[data-copy]").forEach(e=>{const t=e.querySelector("span");e.addEventListener("click",()=>{(async()=>{const n=document.getElementById(e.dataset.copy||""),o=(n?.textContent||"").trim();let s=!1;try{await navigator.clipboard.writeText(o),s=!0}catch{if(n){const a=document.createRange();a.selectNodeContents(n);const i=window.getSelection();i?.removeAllRanges(),i?.addRange(a);try{s=document.execCommand("copy")}catch{s=!1}}}t.textContent=s?"Copied":"Select",e.classList.toggle("done",s),window.setTimeout(()=>{t.textContent="Copy",e.classList.remove("done")},1500)})()})});const re=500;function u(e,t,n=""){const o=r(e);o.className=t,o.querySelector(".cv").textContent=n;const s=o.querySelector(".ci svg");s&&(s.innerHTML=t==="bad"?'<path d="M18 6 6 18M6 6l12 12"/>':'<path d="M20 6 9 17l-5-5"/>')}async function L(e){const t=e-se();t>0&&await U(t)}async function Be(){try{const e=await I("/api/auth/me");if(!e.ok)return{authenticated:!1};const t=await e.json().catch(()=>({}));return{authenticated:t.authenticated!==!1,redirect:t.redirect}}catch{return{authenticated:!1}}}function He(e){return e.armed?Pe(e)?"reset window open":"setup window open":e.locked?"on hold":e.bootstrap?"not set up":"ready"}const Pe=e=>e.mode==="reset"||e.mode==="reset-password";async function Q(){const e=se();r("#retryBtn").hidden=!0,r("#splashTitle").textContent="Checking this instance\u2026",u("#ckServer","run"),u("#ckReady",""),u("#ckAccount","");const[t,n]=await Promise.all([Be(),T()]);if(t.authenticated){u("#ckServer","ok"),u("#ckReady","ok"),u("#ckAccount","ok","signed in"),$(t.redirect);return}if(!n.ok){if(n.limited){const i=n.limited.retry_after||5;if(n.limited.cooldown){u("#ckServer","ok"),await L(e+re),W(i);return}return u("#ckServer","run","busy, retrying"),await U(Math.min(i,10)*1e3),Q()}await L(e+250),u("#ckServer","bad","no answer"),r("#splashTitle").textContent="Cannot reach the server",M(!1),r("#retryBtn").hidden=!1;return}const o=n.s;M(!0),await L(e+150),u("#ckServer","ok"),u("#ckReady","run"),await L(e+280);const s=[o.checks?.vault===!1?"vault":"",o.checks?.state===!1?"state":""].filter(Boolean),a=s.length?s.join(" + ")+" not writable":o.bootstrap?"not set up":o.vault_configured===!1?"vault not chosen":"";u("#ckReady",a?"bad":"ok",a),u("#ckAccount","run"),await L(e+400),u("#ckAccount",o.bootstrap||o.locked?"bad":"ok",He(o)),await L(e+re+60),g(A(o),o)}r("#retryBtn").addEventListener("click",()=>void Q());N!==null&&(r("#vSignin .eyebrow").textContent="Connect an AI app",r("#vSignin .sub").textContent="Sign in to let an AI app connect to this vault. You approve it on the next step.");Q();})();
462
+ </script></body>
463
+ </html>