omni-notify-mcp 1.3.425 → 1.3.427

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,18 @@
1
+ "use strict";
2
+
3
+ const CHANNEL_KEYS = ["desktop", "telegram", "slack", "sms", "ntfy", "discord", "teams"];
4
+
5
+ function channelsOn(cfg) {
6
+ // NULL-OK: field cfg[key] is OPTIONAL and therefore it is ok to check for NULL
7
+ return CHANNEL_KEYS.filter((key) => cfg[key]?.enabled === true);
8
+ }
9
+
10
+ function masterMuted(cfg) {
11
+ return cfg.muteAll === true;
12
+ }
13
+
14
+ function firstRunNote(absent) {
15
+ return absent ? " (the file does not exist yet — open the panel and switch a channel on)" : "";
16
+ }
17
+
18
+ module.exports = { CHANNEL_KEYS, channelsOn, masterMuted, firstRunNote };
@@ -41,22 +41,44 @@ export function servingIdentity() {
41
41
  export function servingLine() {
42
42
  const me = servingIdentity();
43
43
  const line = `BN ${me.build} · pid ${me.pid} · started ${storedStamp(me.startedAt)}`;
44
- return `<div id="serving" class="idbar" data-be-tip="The process that answered this page — the build its own code was loaded from, its process id, and when that process started — and when this page's sign-in expires"><span class="srv">${line}</span><small id="expires" hidden></small></div>`;
44
+ return `<div id="serving" class="idbar" hidden data-be-tip="The process that answered this page — the build its own code was loaded from, its process id, and when that process started — and when this page's sign-in expires"><span class="srv">${line}</span><small id="expires" hidden></small></div>`;
45
45
  }
46
46
  /** The look every page of the door shares (#2873): BN's page and each service page the public gateway serves. */
47
- export const PAGE_STYLE = `:root{--bg:#fff;--fg:#111;--mut:#667;--line:#d8dce2;--me:#0b5fff;--agent:#eef1f5;--bad:#a40000}
48
- @media(prefers-color-scheme:dark){:root{--bg:#14171c;--fg:#e8eaed;--mut:#9aa3b0;--line:#2b313b;--agent:#222831;--me:#2f6df0;--bad:#ff8a80}}
49
- *{box-sizing:border-box}html,body{height:100%;margin:0}body{height:100dvh;font:16px system-ui,sans-serif;background:var(--bg);color:var(--fg);display:flex;flex-direction:column}
50
- header{display:flex;flex-wrap:wrap;align-items:center;gap:3px;padding:3px 8px;min-height:26px;border-bottom:1px solid var(--line)}
51
- header h1{font-size:14px;margin:0;flex:1 1 0;min-width:44px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
52
- header button{flex:none;padding:3px 7px;font-size:13px;white-space:nowrap}
47
+ export const PAGE_STYLE = `:root{--bg:#fff;--fg:#111;--mut:#5d6675;--line:#d0d6de;--me:#0b5fff;--agent:#eef1f5;--bad:#a40000;--ok:#1a7f37;--warn:#8a5a00;--warnbg:#fff4d6;--badbg:#fde8e6}
48
+ @media(prefers-color-scheme:dark){:root{--bg:#14171c;--fg:#e8eaed;--mut:#9aa3b0;--line:#2f3642;--agent:#222831;--me:#2f6df0;--bad:#ff8a80;--ok:#7ee2a8;--warn:#e3b341;--warnbg:#2c2410;--badbg:#301715}}
49
+ *{box-sizing:border-box}html,body{height:100%;margin:0}body{height:100dvh;font:15px/1.35 system-ui,sans-serif;background:var(--bg);color:var(--fg);display:flex;flex-direction:column}
50
+ header{flex:none;display:flex;align-items:center;gap:4px;height:32px;padding:0 6px;background:var(--agent);box-shadow:0 1px 0 var(--line);position:relative;z-index:1}
51
+ header h1{font-size:14px;margin:0 4px;flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
52
+ header button,header a.tab{flex:none;display:inline-flex;align-items:center;justify-content:center;gap:4px;height:32px;min-width:40px;padding:0 9px;font-size:13px;line-height:1;white-space:nowrap;text-decoration:none;color:var(--fg);border:solid transparent;border-width:3px 0;border-radius:10px;background:var(--bg) padding-box;box-shadow:inset 0 0 0 1px var(--line)}
53
+ header .here{background:var(--me) padding-box;box-shadow:none;color:#fff;font-weight:600}
54
+ header button.go{box-shadow:none}
55
+ header .tools{display:flex;align-items:center;gap:4px;flex:none}
53
56
  button{font:inherit;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:var(--agent);color:var(--fg)}
54
57
  button.go{background:var(--me);border-color:var(--me);color:#fff}button:disabled{opacity:.5}
58
+ header button.go{background:var(--me) padding-box}
55
59
  main{flex:1;min-height:0;overflow-y:auto;padding:10px 12px}
56
60
  input,textarea{font:inherit;width:100%;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--fg)}
57
61
  label{display:block;margin:10px 0 4px;color:var(--mut);font-size:14px}
62
+ .nline{flex:none;display:flex;flex-wrap:wrap;align-items:stretch;box-shadow:inset 0 -1px 0 var(--line);font-size:12px;line-height:16px}
63
+ .nline.gone{display:none}
64
+ .nsay{flex:1 1 0;min-width:0;min-height:24px;display:flex;flex-wrap:wrap;align-items:center;gap:0 6px;padding:4px 8px;border:0;border-radius:0;background:none;color:inherit;font:inherit;text-align:left}
65
+ .nword{flex:none;font-weight:700;letter-spacing:.02em;white-space:nowrap}
66
+ .ntext{flex:1 1 0;min-width:0;color:var(--mut);white-space:normal;overflow-wrap:anywhere}
67
+ .nx{flex:none;width:40px;min-height:24px;padding:0;border:0;border-radius:0;background:none;color:var(--mut);font-size:14px;line-height:1}
68
+ .ndetail{flex:1 1 100%;min-width:0;padding:6px 8px 8px;border-top:1px solid var(--line);background:var(--bg);font-size:13px;line-height:18px}
69
+ .ndetail p{margin:4px 0}.ndetail button{margin:4px 0}
70
+ .nline[data-severity=good] .nword{color:var(--ok)}.nline[data-severity=warning] .nword{color:var(--warn)}.nline[data-severity=error] .nword{color:var(--bad)}
71
+ .nline[data-severity=warning]{background:var(--warnbg)}.nline[data-severity=error]{background:var(--badbg)}
72
+ .facts{border-collapse:collapse;width:100%;margin:2px 0 6px}
73
+ .facts th,.facts td{border:1px solid var(--line);padding:3px 6px;text-align:left;vertical-align:top;font-weight:400;overflow-wrap:anywhere}
74
+ .facts th{color:var(--mut);white-space:nowrap;width:1%}
75
+ .facts thead th{font-weight:600;background:var(--agent);width:auto}
76
+ .facts .idrow{overflow:visible}.facts .conv-id{flex:1 1 0;white-space:normal;overflow:visible;overflow-wrap:anywhere}
77
+ #__bullseye-connection{position:static!important;order:-1}
78
+ header{order:-2}
58
79
  .convscroll{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
59
80
  .conv{border-collapse:separate;border-spacing:0;font-size:14px;table-layout:fixed}
81
+ .conv.stale tbody{opacity:.55}
60
82
  .conv th,.conv td{border-bottom:1px solid var(--line);border-right:1px solid var(--line);padding:6px 8px;text-align:left;vertical-align:middle;overflow:hidden}
61
83
  .conv th:last-child,.conv td:last-child{border-right:0}
62
84
  .conv thead th{color:var(--mut);font-size:12px;font-weight:600;letter-spacing:.03em;background:var(--agent);position:relative}
@@ -70,8 +92,10 @@ label{display:block;margin:10px 0 4px;color:var(--mut);font-size:14px}
70
92
  .conv tbody tr:focus-visible{outline:2px solid var(--me);outline-offset:-2px}
71
93
  .conv tbody tr.sel{background:rgba(11,95,255,.12)}
72
94
  .conv td{white-space:nowrap;text-overflow:ellipsis}
73
- .conv td.statecell{white-space:normal;overflow-wrap:normal}
95
+ .conv td.statecell{white-space:normal;overflow-wrap:normal;font-weight:600}
96
+ .conv td.statecell[data-state=closed]{color:var(--mut);font-weight:400}
74
97
  .conv td.timecell{font-size:12px;font-variant-numeric:tabular-nums}
98
+ .conv td.timecell .age{color:var(--mut)}.conv td.timecell .age::before{content:" · "}
75
99
  .conv td.checkcell,.conv th.checkcell{text-align:center;padding:4px 6px}
76
100
  .conv input[type=checkbox]{width:15px;height:15px;margin:0;cursor:pointer;vertical-align:middle}
77
101
  .conv td.actions{white-space:normal}
@@ -79,14 +103,13 @@ label{display:block;margin:10px 0 4px;color:var(--mut);font-size:14px}
79
103
  .idrow{display:flex;align-items:center;gap:6px;min-width:0;overflow:hidden}
80
104
  .actrow{display:flex;gap:8px;align-items:center;flex-wrap:wrap;min-width:0}
81
105
  .acts{display:flex;gap:4px;flex-wrap:wrap;margin:0}.acts button{padding:6px 8px;font-size:14px}
82
- .listbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 8px;padding:6px 8px;border:1px solid var(--line);border-radius:10px;background:var(--agent)}
83
- .listbar .count{font-size:13px;color:var(--mut);min-width:0;white-space:normal}
106
+ .listbar{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 8px}
107
+ .listbar .count{font-size:13px;color:var(--mut);min-width:0;white-space:nowrap}
84
108
  .listbar .spacer{flex:1 1 auto;min-width:0}
85
- .listbar button{padding:6px 10px;font-size:13px}
86
- .listbar .notice{flex:1 1 100%;font-size:13px;color:var(--mut);white-space:normal;overflow-wrap:anywhere;margin:0}
87
- .listbar .notice.err{color:var(--bad)}
109
+ .listbar button{padding:5px 10px;font-size:13px}
110
+ .listnote{margin:0 0 8px;border:1px solid var(--line);border-radius:8px;overflow:hidden}
88
111
  .listbar .pick{max-width:none}
89
- .phonesort{display:none}
112
+ .phonesort,.listbar .all{display:none}
90
113
  .bad{color:var(--bad)}
91
114
  .rowmeta{color:var(--mut);font-size:13px;white-space:normal;margin:1px 0}
92
115
  .idline{display:flex;align-items:center;gap:6px;min-width:0;margin:2px 0}
@@ -97,9 +120,8 @@ label{display:block;margin:10px 0 4px;color:var(--mut);font-size:14px}
97
120
  .timeline{display:flex;flex-wrap:wrap;gap:4px 12px;color:var(--mut);font-size:12px;white-space:normal;margin:1px 0}
98
121
  .timeline .t{font-variant-numeric:tabular-nums;white-space:nowrap}
99
122
  .convmeta{border:1px solid var(--line);border-radius:10px;padding:6px 10px;margin:0 0 10px}
100
- .idbar{flex:none;display:flex;align-items:baseline;gap:8px;padding:2px 8px;border-bottom:1px solid var(--line);color:var(--mut);font-size:11px;line-height:15px;white-space:nowrap;font-variant-numeric:tabular-nums}
101
- .idbar .srv{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
102
- .idbar #expires{flex:none}
123
+ .idbar{color:var(--mut);font-size:12px;line-height:16px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
124
+ .idbar #expires{display:block}
103
125
  .body{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%}
104
126
  .body p{margin:0 0 6px}.body p:last-child{margin-bottom:0}
105
127
  .body h1,.body h2,.body h3,.body h4,.body h5,.body h6{margin:10px 0 4px;line-height:1.25}
@@ -129,43 +151,140 @@ label{display:block;margin:10px 0 4px;color:var(--mut);font-size:14px}
129
151
  .pick input{flex:1 1 auto;min-width:0;max-width:240px;padding:6px}
130
152
  .pick small{flex:1 1 100%;color:var(--bad);font-size:12px;overflow-wrap:anywhere}
131
153
  @media(max-width:480px) and (pointer:coarse){
132
- header{flex:none;flex-wrap:nowrap;overflow-x:auto;gap:6px;padding:2px 8px;-webkit-overflow-scrolling:touch}
133
- header>*{flex:none}
134
- header h1{flex:0 1 auto;max-width:36vw}
135
- header button,header a{display:inline-flex;align-items:center;min-height:40px;padding:0 10px;font-size:14px;white-space:nowrap}
154
+ header{padding:0 4px}
155
+ header h1{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip-path:inset(50%)}
156
+ body.titled header h1{position:static;width:auto;height:auto;margin:0 4px;clip-path:none}
157
+ header .lbl{display:none}header .here .lbl,header .keep .lbl{display:inline}
158
+ header .grow{flex:1 1 0;min-width:0}
159
+ header button{min-height:0}
160
+ .nline{font-size:13px;line-height:18px}
161
+ .nsay,.nx{min-height:32px}
162
+ main{padding:8px}
136
163
  button,select{min-height:40px}
137
164
  input,select,textarea{font-size:16px}
138
165
  input:not([type=checkbox]):not([type=radio]),select{min-height:40px}
139
- .acts button,.listbar button,.tm .tmbar button{min-height:40px;font-size:14px}
140
- .copyid{min-height:40px;display:inline-flex;align-items:center;padding:0 10px}
166
+ .acts button,.tm .tmbar button{min-height:40px;font-size:14px}
167
+ .copyid{min-height:32px;min-width:40px;display:inline-flex;align-items:center;justify-content:center;padding:0 8px}
141
168
  .system a{display:inline-block;min-height:40px;line-height:40px}
142
- .conv,.conv thead,.conv tbody,.conv tr,.conv td,.conv th{display:block}
169
+ .listbar{flex-wrap:nowrap;gap:4px;height:32px;margin:0 0 8px}
170
+ .listbar button,.listbar select{flex:none;height:32px;min-height:32px;min-width:40px;padding:0 9px;font-size:13px;border-radius:8px}
171
+ .listbar .count,.listbar .clear{display:none}.listbar .all{display:inline-block}
172
+ .listbar .lbl{display:none}
173
+ .phonesort{display:flex;flex:0 1 auto;min-width:0;gap:4px;align-items:center}
174
+ .phonesort select{flex:0 1 auto;min-width:0;max-width:120px;border:1px solid var(--line);background:var(--agent);color:var(--fg)}
175
+ .conv,.conv tbody{display:block}
143
176
  .conv{width:100%!important;table-layout:auto}
144
- .conv colgroup{display:none}
145
- .conv thead th:not(.checkcell){display:none}
146
- .phonesort{display:flex;flex:1 1 100%;gap:8px;align-items:center}
147
- .phonesort select{flex:1 1 auto;min-width:0}
148
- .conv thead th.checkcell{display:flex;align-items:center;gap:8px;border:0;padding:0 8px}
149
- .conv thead th.checkcell::after{content:"Select all";font-size:13px;color:var(--mut)}
150
- .conv tbody tr{border:1px solid var(--line);border-radius:10px;margin:0 0 8px;padding:4px 8px}
151
- .conv td,.conv td:last-child{display:flex;gap:8px;align-items:baseline;border:0;padding:2px 0;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
152
- .conv td[data-label]::before{content:attr(data-label);flex:0 0 84px;color:var(--mut);font-size:12px}
177
+ .conv colgroup,.conv thead{display:none}
178
+ .conv tbody tr{display:grid;grid-template-columns:40px minmax(0,1fr) minmax(0,1fr);border:1px solid var(--line);border-radius:10px;margin:0 0 8px;overflow:hidden;background:var(--bg);-webkit-tap-highlight-color:transparent}
179
+ .conv tbody tr.sel{background:var(--agent);border-color:var(--me);box-shadow:inset 3px 0 0 var(--me)}
180
+ .conv td,.conv td:last-child{display:flex;gap:6px;align-items:baseline;min-width:0;border:0;border-bottom:1px solid var(--line);border-left:1px solid var(--line);padding:5px 8px;font-size:14px;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
181
+ .conv td[data-label]::before{content:attr(data-label);flex:none;min-width:38px;color:var(--mut);font-size:11px;letter-spacing:.04em;text-transform:uppercase}
182
+ .conv td.checkcell{grid-row:1/span 5;border-left:0;padding:0;align-items:stretch;background:var(--agent)}
183
+ .conv td.checkcell input{appearance:none;-webkit-appearance:none;width:40px;height:auto;min-height:44px;margin:0;border:0;border-radius:0;background:linear-gradient(var(--bg),var(--bg)) center/18px 18px no-repeat,linear-gradient(var(--mut),var(--mut)) center/22px 22px no-repeat}
184
+ .conv td.checkcell input:checked{background:linear-gradient(#fff,#fff) center/8px 8px no-repeat,linear-gradient(var(--me),var(--me)) center/22px 22px no-repeat}
185
+ .conv td.timecell{flex-wrap:wrap;gap:0 6px}.conv td.timecell .day,.conv td.timecell .ms,.conv td.timecell .age::before{display:none}
186
+ .conv td.timecell .age{order:1;color:var(--fg);white-space:nowrap}.conv td.timecell .at{order:2;color:var(--mut);font-size:12px;white-space:nowrap}
187
+ .conv td.k-process{grid-column:2/-1;order:4}.conv td.k-id{grid-column:2/-1;order:5;align-items:center}
188
+ .conv td.k-id .idrow{flex:1 1 0;overflow:visible}
189
+ .conv .conv-id{flex:1 1 0;white-space:normal;overflow:visible;overflow-wrap:anywhere}
190
+ .conv td.actions,.conv td.actions:last-child{grid-column:1/-1;order:6;display:block;border-left:0;border-bottom:0;padding:6px 8px}
153
191
  .conv td.actions::before{display:none}
154
- .conv td.actions{display:block}
155
- .conv td.checkcell{display:block;padding:4px 0}
156
- .conv input[type=checkbox]{width:40px;height:40px}
157
- .conv td.empty{display:block;text-align:center}
158
- #notification-status{display:flex!important;flex-wrap:wrap;align-items:center;gap:0 8px;margin:4px 8px!important;padding:2px 8px!important}
159
- #notification-status>p{flex:1 1 0;min-width:0;margin:2px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
160
- #notification-status details{flex:none}#notification-status details[open]{flex:1 1 100%}#notification-status summary{display:flex;align-items:center;min-height:40px}
192
+ .actrow{gap:6px}.acts{display:contents}.acts .bad{order:3;margin-left:auto}
161
193
  .pick,.pick select,.pick input{max-width:100%}
162
- .pick{flex:1 1 100%}
194
+ .actrow .pick{order:2;flex:1 1 80px}
195
+ .conv td.empty,.conv td.empty:last-child{grid-column:1/-1;display:block;border:0;text-align:center;padding:16px 8px}
196
+ .setup{flex-direction:column;flex-wrap:nowrap}
197
+ .setup button.go{min-height:44px}
163
198
  }
164
199
  [hidden]{display:none!important}`;
200
+ export const NOTICE_SCRIPT = String.raw `
201
+ function ago(at) { var s = Math.max(0, Math.round((Date.now() - at) / 1000)); return s < 60 ? s + "s" : s < 3600 ? Math.floor(s / 60) + "m" : s < 86400 ? Math.floor(s / 3600) + "h" : Math.floor(s / 86400) + "d"; }
202
+ function clockOf(at) { return new Date(at).toLocaleTimeString([], { hour12: false }); }
203
+ function agoSpan(at) { var span = el("span", "ago", ago(at) + " ago"); span.dataset.ago = String(at); return span; }
204
+ function tickAges() { document.querySelectorAll("[data-ago]").forEach(function (span) { var old = ago(Number(span.dataset.ago)) + " ago"; if (span.textContent !== old) span.textContent = old; }); }
205
+ function aged(before, at, after) { var words = el("span"); words.append(before, agoSpan(at), after || ""); return words; }
206
+ function plainWhy(err) { return err instanceof TypeError ? "no connection to BN" : err.message; }
207
+ function factsTable(rows) {
208
+ var table = el("table", "facts");
209
+ rows.forEach(function (row) { var tr = el("tr"), value = el("td"); if (row[1] instanceof Node) value.append(row[1]); else value.textContent = row[1]; tr.append(el("th", "", row[0]), value); table.append(tr); });
210
+ return table;
211
+ }
212
+ function noticeLine(host) {
213
+ var say = el("button", "nsay"), word = el("b", "nword"), text = el("span", "ntext"), x = el("button", "nx", "✕"), detail = el("div", "ndetail");
214
+ say.type = "button"; x.type = "button"; x.setAttribute("aria-label", "Dismiss"); detail.hidden = true;
215
+ say.append(word, text); host.classList.add("nline"); host.append(say, x, detail);
216
+ var line = { host: host, detail: detail, fill: null, dismissed: null }, key = "", shut = null, drawn = "";
217
+ line.set = function (mark, words, severity, facts) {
218
+ if (word.textContent !== mark) word.textContent = mark;
219
+ if (text.textContent !== words) text.textContent = words;
220
+ if (host.dataset.severity !== (severity || "")) host.dataset.severity = severity || "";
221
+ if (mark !== key) { key = mark; if (shut !== mark) { shut = null; host.classList.remove("gone"); } }
222
+ var now = mark + "|" + (facts || "");
223
+ if (!detail.hidden && line.fill !== null && now !== drawn) line.fill(detail);
224
+ drawn = now;
225
+ };
226
+ line.hide = function () { key = ""; shut = null; detail.hidden = true; host.classList.add("gone"); };
227
+ say.onclick = function () { if (line.fill === null) return; detail.hidden = !detail.hidden; say.setAttribute("aria-expanded", String(!detail.hidden)); if (!detail.hidden) line.fill(detail); };
228
+ x.onclick = function () { if (!detail.hidden) { detail.hidden = true; say.setAttribute("aria-expanded", "false"); return; } if (line.dismissed !== null && line.dismissed()) return; shut = key; host.classList.add("gone"); };
229
+ return line;
230
+ }
231
+ var liveLine = null, liveLast = null, live = { on: false };
232
+ function liveWatch(view) { live = view === null ? { on: false } : { on: true, verb: view.verb || "read", period: view.period || 0, says: view.says || null, facts: view.facts || null, at: 0, failedAt: 0, why: "", ended: "", notice: null }; livePaint(); }
233
+ function liveRead() { if (!live.on) return; live.at = Date.now(); live.failedAt = 0; live.why = ""; if (liveLast !== null) liveLast.dataset.ago = String(live.at); livePaint(); }
234
+ function liveFailed(why) { if (!live.on) return; if (!live.failedAt) live.failedAt = Date.now(); live.why = why; if (live.notice && live.notice.severity !== "error") live.notice = null; livePaint(); }
235
+ function liveEnded(why) { if (!live.on) return; live.ended = why; livePaint(); }
236
+ // GATE: how long a notice that reports something done stays on the status line before it gives the line back; a failure stays until it is closed.
237
+ var NOTICE_MS = 8000, noticeTimer = 0;
238
+ function liveNotice(text, severity) {
239
+ if (!live.on) return;
240
+ clearTimeout(noticeTimer);
241
+ var notice = text ? { text: text, severity: severity || "" } : null;
242
+ live.notice = notice;
243
+ if (notice !== null && notice.severity === "") noticeTimer = setTimeout(function () { if (live.notice === notice) { live.notice = null; livePaint(); } }, NOTICE_MS);
244
+ livePaint();
245
+ }
246
+ function liveStatus() {
247
+ if (live.ended) return { mark: "⏹ ENDED", severity: "", words: live.ended };
248
+ var late = live.period > 0 && live.at > 0 && Date.now() - live.at > 2 * live.period + 2000;
249
+ if (live.failedAt || late) return { mark: "⚠️ STALE", severity: "warning", words: (live.at ? live.verb + " " + ago(live.at) + " ago" : "nothing read yet") + (live.why ? " · " + live.why : "") };
250
+ if (!live.at) return { mark: "⏳ LOADING", severity: "", words: "" };
251
+ return { mark: "✅ LIVE", severity: "good", words: live.verb + " " + ago(live.at) + " ago" };
252
+ }
253
+ function livePaint() {
254
+ if (liveLine === null) return;
255
+ if (!live.on) { liveLine.hide(); return; }
256
+ var status = liveStatus(), said = live.says ? live.says() : "";
257
+ var words = live.notice ? live.notice.text : (said ? said + " · " : "") + status.words;
258
+ liveLine.set(status.mark, words, live.notice && live.notice.severity === "error" ? "error" : status.severity, (live.notice ? live.notice.text : "") + "|" + live.why + "|" + (live.at ? 1 : 0) + "|" + (live.failedAt ? 1 : 0));
259
+ }
260
+ function liveDetail(detail) {
261
+ var status = liveStatus(), rows = [["Status", status.mark]];
262
+ if (live.notice) rows.push(["Notice", live.notice.text]);
263
+ liveLast = live.at ? agoSpan(live.at) : null;
264
+ if (liveLast !== null) rows.push(["Last " + live.verb, liveLast]);
265
+ if (live.period) rows.push(["Refreshes", "every " + Math.round(live.period / 1000) + " s, and when you come back to this page"]);
266
+ if (live.failedAt) rows.push(["Failing since", aged(clockOf(live.failedAt) + " (", live.failedAt, ") — " + live.why)]);
267
+ if (live.facts) rows = rows.concat(live.facts());
268
+ var kept = document.getElementById("serving");
269
+ detail.replaceChildren(factsTable(rows));
270
+ if (kept !== null) detail.append(kept);
271
+ }
272
+ function liveStart(host) {
273
+ liveLine = noticeLine(host);
274
+ liveLine.fill = liveDetail;
275
+ liveLine.dismissed = function () { if (!live.notice) return false; live.notice = null; livePaint(); return true; };
276
+ var kept = document.getElementById("serving");
277
+ if (kept !== null) { kept.hidden = false; liveLine.detail.append(kept); }
278
+ setInterval(function () { livePaint(); tickAges(); }, 1000);
279
+ livePaint();
280
+ }
281
+ `;
165
282
  /** The sign-in half every page of the door shares (#2873): the kept session and its expiry, Logout, the sign-in screen and the
166
283
  * check of a kept session on load. The page around it defines `main`, `el(tag, cls, text)`, `show(name, heading)` and
167
284
  * `home()`, the screen a signed-in visitor lands on, and loads PASSKEY_SCRIPT before it. */
168
285
  export const SIGN_IN_SCRIPT = `var KEY = "bn-chat-token";
286
+ // GATE: how long the page waits before asking the gateway again about its sign-in after a failed check.
287
+ var RECHECK_MS = 3000;
169
288
  var token = "";
170
289
  var expiresAt = 0, expiryTimer;
171
290
  var btnLogout = document.getElementById("logout"), expiryNotice = document.getElementById("expires");
@@ -191,7 +310,14 @@ async function signIn(notice) {
191
310
  btnLogout.disabled = false;
192
311
  var door;
193
312
  try { door = await (await fetch("/passkey/state")).json(); }
194
- catch (e) { if (mine === view) main.append(el("div", "err", "The gateway did not say how to sign in: " + e.message)); return; }
313
+ catch (e) {
314
+ if (mine !== view) return;
315
+ window.bullseyeConnection.reconnecting("this page's connection to BN", RECHECK_MS);
316
+ main.append(el("div", "system", "⏳ Could not reach BN to ask how to sign in (" + plainWhy(e) + ") — asking again…"));
317
+ setTimeout(function () { if (mine === view) signIn(notice); }, RECHECK_MS);
318
+ return;
319
+ }
320
+ window.bullseyeConnection.live();
195
321
  if (mine !== view) return;
196
322
  var message = el("div", "err", notice || "");
197
323
  if (door.enrolled && !door.local) {
@@ -215,8 +341,6 @@ async function signIn(notice) {
215
341
  main.append(message);
216
342
  }
217
343
 
218
- // GATE: how long the page waits before asking the gateway again about its sign-in after a failed check.
219
- var RECHECK_MS = 3000;
220
344
  var gatewayDown = false;
221
345
  async function resumeSignIn() {
222
346
  var response = await fetch("/passkey/session", {headers:{authorization:"Bearer " + token}});
@@ -224,14 +348,15 @@ async function resumeSignIn() {
224
348
  if (response.status === 401) { signIn("Your sign-in expired or was revoked. Sign in again."); return; }
225
349
  if (!response.ok) throw new Error("the gateway answered " + response.status);
226
350
  var session = await response.json();
351
+ window.bullseyeConnection.live();
227
352
  keep(token, session.expiresIn === null ? 0 : Date.now() + session.expiresIn * 1000);
228
353
  home();
229
354
  }
230
355
  function recheckSignIn(err) {
231
356
  show("signin", "Sign in");
232
357
  gatewayDown = true;
233
- window.bullseyeConnection.reconnecting("the connection to the Notify service", RECHECK_MS);
234
- main.append(el("div", "system", "Could not reach the gateway (" + err.message + ") — your sign-in is kept; checking again…"));
358
+ window.bullseyeConnection.reconnecting("this page's connection to BN", RECHECK_MS);
359
+ main.append(el("div", "system", "⏳ Could not reach BN (" + plainWhy(err) + ") — your sign-in is kept; checking again…"));
235
360
  setTimeout(startSignIn, RECHECK_MS);
236
361
  }
237
362
  function startSignIn() { if (token) resumeSignIn().catch(recheckSignIn); else signIn(""); }`;
@@ -345,23 +470,23 @@ async function listView() {
345
470
  var folders = [];
346
471
  var foldersNote = "";
347
472
  try { folders = (await api("GET", "/v1/projects")).projects.filter(function (p) { return p.board; }).map(function (p) { return { name: p.name, path: p.path }; }); }
348
- catch (err) { if (err.message === "signed out") return; foldersNote = "The project folders could not be read — " + err.message + "."; }
473
+ catch (err) { if (err.message === "signed out") return; foldersNote = "The project folders could not be read — " + plainWhy(err) + "."; }
349
474
  if (mine !== view) return;
350
475
  var act = async function (button, method, path) {
351
476
  button.disabled = true;
352
477
  try { await api(method, path); await paint(); }
353
- catch (err) { if (err.message !== "signed out") { button.disabled = false; main.append(el("div", "err", err.message)); } }
478
+ catch (err) { if (err.message !== "signed out") { button.disabled = false; liveNotice("Not done — " + plainWhy(err), "error"); } }
354
479
  };
355
480
  var cols = [
356
481
  { key: "", check: true, name: "", min: 34, weight: 0 },
357
482
  { key: "project", name: "Project", min: 104, weight: 1.3 },
358
483
  { key: "state", name: "State", min: 96, weight: 1.1, state: true },
359
484
  { key: "origin", name: "From", min: 72, weight: 0.7 },
360
- { key: "provider", name: "Provider", min: 88, weight: 0.9 },
361
- { key: "id", name: "Conversation ID", min: 190, weight: 1.5 },
362
- { key: "process", name: "Process ID", min: 96, weight: 0.8 },
363
- { key: "opened", name: "Opened", min: 152, weight: 1, time: true },
364
- { key: "updated", name: "Updated", min: 152, weight: 1, time: true },
485
+ { key: "provider", name: "Provider", short: "CLI", min: 88, weight: 0.9 },
486
+ { key: "id", name: "Conversation ID", short: "ID", min: 190, weight: 1.5 },
487
+ { key: "process", name: "Process ID", short: "PID", min: 96, weight: 0.8 },
488
+ { key: "opened", name: "Opened", min: 200, weight: 1, time: true },
489
+ { key: "updated", name: "Updated", min: 200, weight: 1, time: true },
365
490
  { key: "actions", name: "Actions", min: 216, weight: 0, plain: true }
366
491
  ];
367
492
  var keyOf = function (col) { return col.key || "_check"; };
@@ -404,7 +529,7 @@ async function listView() {
404
529
  return "";
405
530
  };
406
531
 
407
- var scroll = null, table = null, headRow = null, body = null, countEl = null, noticeEl = null, selectAll = null, emptyRow = null, sortPick = null, sortDirBtn = null;
532
+ var scroll = null, table = null, headRow = null, body = null, countEl = null, noticeEl = null, selectAll = null, emptyRow = null, sortPick = null, sortDirBtn = null, allBtn = null, said = null;
408
533
  /** Whether this row's stop slot has anything to act on — the ONE rule both the row's button and the batch button use, so a row the batch would not act on is never offered as one it would. */
409
534
  var stoppable = function (c) {
410
535
  return c.state !== "closed";
@@ -489,8 +614,16 @@ async function listView() {
489
614
  return;
490
615
  }
491
616
  var cls = col.state ? "statecell" : col.time ? "timecell" : col.plain ? "actions" : "";
492
- var cell = el("td", cls);
493
- cell.dataset.label = col.name;
617
+ var cell = el("td", (cls + " k-" + col.key).trim());
618
+ cell.dataset.label = col.short || col.name;
619
+ if (col.time) {
620
+ var day = el("span", "day"), clock = el("span", "clock"), ms = el("span", "ms"), age = el("span", "age");
621
+ var at = el("span", "at"); at.append(day, clock, ms);
622
+ cell.append(at, age);
623
+ tr.append(cell);
624
+ node.cells.push({ td: cell, day: day, clock: clock, ms: ms, age: age, col: col });
625
+ return;
626
+ }
494
627
  if (col.key === "id") {
495
628
  var idrow = el("div", "idrow");
496
629
  var code = el("code", "conv-id");
@@ -504,7 +637,7 @@ async function listView() {
504
637
  // ONE action row for every session (#3614, #3916): Open, Stop, Delete, then the project slot.
505
638
  var actrow = el("div", "actrow");
506
639
  var acts = el("div", "acts");
507
- var open = el("button", "", "📂 Open");
640
+ var open = el("button", "go", "📂 Open");
508
641
  open.onclick = function (e) { e.stopPropagation(); go("term", node.c.id); };
509
642
  acts.append(open);
510
643
  // A conversation is STOPPED — its CLI ends, it runs no further turn and a later message resumes the same session.
@@ -515,7 +648,7 @@ async function listView() {
515
648
  };
516
649
  acts.append(halt);
517
650
  node.halt = halt;
518
- var drop = el("button", "bad", "Delete");
651
+ var drop = el("button", "bad", "🗑 Delete");
519
652
  drop.onclick = function (e) { e.stopPropagation(); act(drop, "POST", "/v1/conversations/" + node.c.id + "/delete"); };
520
653
  acts.append(drop);
521
654
  actrow.append(acts);
@@ -552,6 +685,15 @@ async function listView() {
552
685
  return;
553
686
  }
554
687
  if (col.key === "id") { if (cell.code.textContent !== c.id) cell.code.textContent = c.id; cell.code.title = c.id; return; }
688
+ if (col.time) {
689
+ var stamp = textOf(c, col), cut = /^([^ ]+ )([0-9:]{8})(.*)$/.exec(stamp);
690
+ if (cell.td.dataset.stamp !== stamp) { cell.td.dataset.stamp = stamp; cell.day.textContent = cut[1]; cell.clock.textContent = cut[2]; cell.ms.textContent = cut[3]; }
691
+ cell.age.dataset.ago = String(value(c, col.key));
692
+ var old = ago(value(c, col.key)) + " ago";
693
+ if (cell.age.textContent !== old) cell.age.textContent = old;
694
+ return;
695
+ }
696
+ if (col.state) cell.td.dataset.state = c.state;
555
697
  var text = textOf(c, col);
556
698
  if (cell.td.textContent !== text) cell.td.textContent = text;
557
699
  var tip = titleOf(c, col);
@@ -572,7 +714,7 @@ async function listView() {
572
714
  if (shown.length === 0) {
573
715
  if (emptyRow === null) {
574
716
  emptyRow = el("tr");
575
- var cell = el("td", "empty", "No conversations yet. Open one from the CLI page.");
717
+ var cell = el("td", "empty", "No conversations yet. + New Agent starts one.");
576
718
  cell.colSpan = cols.length;
577
719
  emptyRow.append(cell);
578
720
  }
@@ -586,10 +728,11 @@ async function listView() {
586
728
  var mark = th.querySelector(".sortmark");
587
729
  if (mark !== null) mark.textContent = sort.key !== col.key ? "↕" : sort.dir > 0 ? "▲" : sort.dir < 0 ? "▼" : "↕";
588
730
  });
589
- if (sortPick !== null) { sortPick.value = sort.key; sortDirBtn.textContent = sort.dir === 1 ? "▲ Ascending" : "▼ Descending"; sortDirBtn.setAttribute("aria-label", "Sort direction: " + (sort.dir === 1 ? "ascending" : "descending")); }
731
+ if (sortPick !== null) { sortPick.value = sort.key; sortDirBtn.replaceChildren(sort.dir === 1 ? "▲" : "▼", el("span", "lbl", sort.dir === 1 ? " Ascending" : " Descending")); sortDirBtn.setAttribute("aria-label", "Sort direction: " + (sort.dir === 1 ? "ascending" : "descending")); }
590
732
  var n = 0;
591
733
  shown.forEach(function (c) { if (picked[c.id]) n++; });
592
- countEl.textContent = n === 0 ? "Select conversations to act on them." : n + " selected";
734
+ countEl.textContent = n === 0 ? "" : n + " selected";
735
+ if (allBtn !== null) { allBtn.textContent = (n > 0 && n === shown.length ? "☑" : n > 0 ? "◪" : "☐") + " All"; allBtn.disabled = shown.length === 0; allBtn.setAttribute("aria-pressed", String(n > 0)); allBtn.setAttribute("aria-label", n > 0 ? "Clear the selection of " + n : "Select all conversations"); }
593
736
  if (selectAll !== null) { selectAll.checked = shown.length > 0 && n === shown.length; selectAll.indeterminate = n > 0 && n < shown.length; }
594
737
  [buttons.delete, buttons.clear].forEach(function (b) { if (b) b.disabled = n === 0; });
595
738
  // Stop is offered only when at least one picked row has something to stop (#3614): a conversation already stopped has none.
@@ -618,8 +761,7 @@ async function listView() {
618
761
  // a failure for refusing, which is what a 404 for an already-ended CLI would look like (#3614).
619
762
  var acts = which === "stop" ? chosen.filter(stoppable) : chosen;
620
763
  var untouched = chosen.filter(function (c) { return !acts.includes(c); });
621
- noticeEl.className = "notice";
622
- noticeEl.textContent = (which === "delete" ? "Deleting " : which === "stop" ? "Stopping " : "Working on ") + acts.length + (acts.length === 1 ? " conversation…" : " conversations…");
764
+ said.set("⏳ WORKING", (which === "delete" ? "Deleting " : which === "stop" ? "Stopping " : "Working on ") + acts.length + (acts.length === 1 ? " conversation…" : " conversations…"), "");
623
765
  var done = 0, failed = [];
624
766
  for (var i = 0; i < acts.length; i++) {
625
767
  markRowFailed(acts[i].id, null);
@@ -627,21 +769,22 @@ async function listView() {
627
769
  catch (err) { if (err.message === "signed out") return; failed.push({ id: acts[i].id, why: err.message }); }
628
770
  }
629
771
  picked = {}; anchor = null;
630
- await paint();
772
+ try { await paint(); }
773
+ catch (err) { if (err.message === "signed out") return; fail(err); }
631
774
  failed.forEach(function (f) { markRowFailed(f.id, f.why); });
632
775
  untouched.forEach(function (c) { markRowFailed(c.id, "Nothing to stop here — this conversation is already stopped."); });
633
- noticeEl.textContent = done + " of " + chosen.length + " " + word
634
- + (untouched.length ? " — " + untouched.length + (untouched.length === 1 ? " had" : " had") + " nothing to stop" : "")
635
- + (failed.length ? " — " + failed.length + (failed.length === 1 ? " was" : " were") + " not " + word + ", with the reason on " + (failed.length === 1 ? "its row" : "their rows") : "");
636
- noticeEl.className = failed.length ? "notice err" : "notice";
776
+ said.set(failed.length ? "⚠️ PARTIAL" : "✅ DONE", done + " of " + chosen.length + " " + word
777
+ + (untouched.length ? " — " + untouched.length + " had nothing to stop" : "")
778
+ + (failed.length ? " — " + failed.length + (failed.length === 1 ? " was" : " were") + " not " + word + ", with the reason on " + (failed.length === 1 ? "its row" : "their rows") : ""), failed.length ? "error" : "good");
637
779
  };
638
780
 
639
781
  var build = function () {
640
782
  main.replaceChildren();
641
783
  dom = {};
642
784
  var bar = el("div", "listbar");
643
- countEl = el("span", "count", "");
644
- bar.append(countEl, el("span", "spacer"));
785
+ allBtn = el("button", "all", "☐ All");
786
+ allBtn.onclick = function () { var any = shown.some(function (c) { return picked[c.id]; }); picked = {}; if (!any) shown.forEach(function (c) { picked[c.id] = true; }); anchor = null; render(); };
787
+ bar.append(allBtn);
645
788
  var phoneSort = el("div", "phonesort");
646
789
  sortPick = el("select"); sortPick.setAttribute("aria-label", "Sort conversations by");
647
790
  cols.forEach(function (col) { if (!col.key || col.plain) return; var o = el("option", "", col.name); o.value = col.key; sortPick.append(o); });
@@ -649,7 +792,6 @@ async function listView() {
649
792
  sortDirBtn = el("button", "", "");
650
793
  sortDirBtn.onclick = function () { sort = { key: sort.key, dir: sort.dir === 1 ? -1 : 1 }; render(); };
651
794
  phoneSort.append(sortPick, sortDirBtn);
652
- bar.append(phoneSort);
653
795
  var mkButton = function (label, cls, key) {
654
796
  var b = el("button", cls, label);
655
797
  b.disabled = true;
@@ -658,15 +800,16 @@ async function listView() {
658
800
  bar.append(b);
659
801
  return b;
660
802
  };
661
- mkButton("Stop", "", "stop");
662
- mkButton("Delete", "bad", "delete");
663
- buttons.clear = el("button", "", "Clear");
803
+ mkButton("⏹ Stop", "", "stop");
804
+ mkButton("🗑 Delete", "bad", "delete");
805
+ buttons.clear = el("button", "clear", "✕ Clear");
664
806
  buttons.clear.disabled = true;
665
807
  buttons.clear.onclick = function () { picked = {}; anchor = null; render(); };
666
- bar.append(buttons.clear);
667
- noticeEl = el("span", "notice", "");
668
- bar.append(noticeEl);
669
- main.append(bar);
808
+ countEl = el("span", "count", "");
809
+ bar.append(buttons.clear, countEl, el("span", "spacer"), phoneSort);
810
+ noticeEl = el("div", "notice listnote");
811
+ said = noticeLine(noticeEl); said.hide();
812
+ main.append(bar, noticeEl);
670
813
 
671
814
  scroll = el("div", "convscroll");
672
815
  table = el("table", "conv");
@@ -709,18 +852,33 @@ async function listView() {
709
852
  layout();
710
853
  };
711
854
 
855
+ var reads = 0;
712
856
  var paint = function () {
857
+ var turn = ++reads;
713
858
  return api("GET", "/v1/conversations").then(function (data) {
714
- if (mine !== view) return;
859
+ if (mine !== view || turn !== reads) return;
715
860
  rows = data.conversations.slice();
716
861
  if (table === null) build();
862
+ table.classList.remove("stale");
863
+ liveRead();
717
864
  render();
718
865
  });
719
866
  };
720
- var again = function () { timer = setTimeout(run, 8000); };
867
+ // GATE: how often the list is read again; a read that fails keeps the rows on screen, marked STALE with their age.
868
+ var LIST_REFRESH_MS = 8000;
869
+ liveWatch({ period: LIST_REFRESH_MS, says: function () { return table === null ? "" : rows.length + (rows.length === 1 ? " conversation" : " conversations"); } });
870
+ var again = function () { clearTimeout(timer); timer = setTimeout(run, LIST_REFRESH_MS); };
871
+ var back = function () { if (mine === view && document.visibilityState === "visible") { clearTimeout(timer); run(); } };
872
+ document.addEventListener("visibilitychange", back);
873
+ var leaving = setInterval(function () { if (mine !== view) { clearInterval(leaving); document.removeEventListener("visibilitychange", back); } }, 1000);
721
874
  var picking = function () { var at = document.activeElement; return at !== null && at.closest && at.closest(".pick") !== null; };
722
875
  var run = function () { if (mine !== view) return; if (picking()) { again(); return; } paint().then(again, function (err) { fail(err); again(); }); };
723
- var fail = function (err) { if (mine === view && err.message !== "signed out") { table = null; main.replaceChildren(el("div", "err", err.message)); } };
876
+ var fail = function (err) {
877
+ if (mine !== view || err.message === "signed out") return;
878
+ liveFailed(plainWhy(err));
879
+ if (table !== null) table.classList.add("stale");
880
+ else main.replaceChildren(el("p", "system", "⏳ The conversations have not been read yet (" + plainWhy(err) + ") — asking again…"));
881
+ };
724
882
  if (listResize !== null) window.removeEventListener("resize", listResize);
725
883
  listResize = function () { if (mine === view) layout(); };
726
884
  window.addEventListener("resize", listResize);
@@ -741,6 +899,7 @@ function show(name, heading) {
741
899
  btnLogout.hidden = name === "signin";
742
900
  expiryNotice.hidden = name === "signin";
743
901
  main.replaceChildren();
902
+ liveWatch(name === "signin" ? null : {});
744
903
  return view;
745
904
  }
746
905
  async function home() {
@@ -753,12 +912,13 @@ async function home() {
753
912
  if (res.status === 401) { signIn("You are signed out. Sign in again."); return; }
754
913
  if (!res.ok) throw new Error("The gateway answered " + res.status + ": " + await res.text());
755
914
  var opened = await res.json();
915
+ liveRead();
756
916
  if (mine === view) {
757
917
  var back = sessionStorage.getItem("bullseye-return-to");
758
918
  sessionStorage.removeItem("bullseye-return-to");
759
919
  location.replace(back !== null && back.charAt(0) === "/" && back.charAt(1) !== "/" && back.charAt(1) !== "\\" ? back : opened.page);
760
920
  }
761
- } catch (err) { if (!(err instanceof Error)) throw err; if (mine === view) said.replaceWith(el("div", "err", err.message)); }
921
+ } catch (err) { if (!(err instanceof Error)) throw err; if (mine === view) { liveFailed(plainWhy(err)); said.replaceWith(el("div", "err", "⚠️ " + TITLE + " did not open — " + plainWhy(err) + ". 🔄 Refresh asks again.")); } }
762
922
  }
763
923
  `;
764
924
  /** The page each service host of the public gateway serves (#2873): BN's look and BN's sign-in, then the page the
@@ -768,14 +928,16 @@ export function serviceHtml({ name, host }) {
768
928
  const safe = (text) => text.replace(/[&<>"']/g, (c) => `&#${c.charCodeAt(0)};`);
769
929
  const facts = JSON.stringify({ name }).replace(/</g, "\\u003c");
770
930
  return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
771
- <title>${safe(name)}</title>${ICON_HEAD}<style>${PAGE_STYLE}</style></head><body>
772
- <header><h1 id="title">${safe(name)}</h1><button id="refresh" hidden>🔄 Refresh</button><button id="logout" hidden>🚪 Logout</button></header>
773
- <div id="serving" class="idbar" data-be-tip="The process that answered this page — its process id, when it started and the sign-in build its code was loaded from — and when this page's sign-in expires"><span class="srv">${safe(host)} · pid ${me.pid} · started ${storedStamp(me.startedAt)} · sign-in BN ${safe(me.build)}</span><small id="expires" hidden></small></div>
931
+ <title>${safe(name)}</title>${ICON_HEAD}<style>${PAGE_STYLE}</style></head><body class="titled">
932
+ <header><h1 id="title">${safe(name)}</h1><span class="grow"></span><button id="refresh" class="keep" hidden>🔄<span class="lbl"> Refresh</span></button><button id="logout" class="keep" hidden>🚪<span class="lbl"> Logout</span></button></header>
933
+ <div id="status" role="status"></div><div id="serving" class="idbar" hidden data-be-tip="The process that answered this page — its process id, when it started and the sign-in build its code was loaded from — and when this page's sign-in expires"><span class="srv">${safe(host)} · pid ${me.pid} · started ${storedStamp(me.startedAt)} · sign-in BN ${safe(me.build)}</span><small id="expires" hidden></small></div>
774
934
  <main id="main"></main>
775
935
  <script>${CONNECTION_SOURCE}</script><script>var FACTS = ${facts}, TITLE = FACTS.name;
776
936
  ${PASSKEY_SCRIPT}
777
937
  ${SIGN_IN_SCRIPT}
778
938
  ${SERVICE_SCRIPT}
939
+ ${NOTICE_SCRIPT}
940
+ liveStart(document.getElementById("status"));
779
941
  startSignIn();
780
942
  </script></body></html>`;
781
943
  }
@@ -0,0 +1,20 @@
1
+ import { existsSync } from "fs";
2
+ import { createRequire } from "module";
3
+ import { dirname, join } from "path";
4
+ import { fileURLToPath } from "url";
5
+ const HERE = dirname(fileURLToPath(import.meta.url));
6
+ const loaded = new Map();
7
+ export function extensionModulePath(name) {
8
+ const found = [join(HERE, name), join(HERE, "..", name)].find((candidate) => existsSync(candidate));
9
+ if (found === undefined)
10
+ throw new Error(`${name} is not beside this build (${HERE}) — the build copies it from vscode-extension/${name}`);
11
+ return found;
12
+ }
13
+ export function extensionModule(name) {
14
+ const known = loaded.get(name);
15
+ if (known !== undefined)
16
+ return known;
17
+ const module = createRequire(import.meta.url)(extensionModulePath(name));
18
+ loaded.set(name, module);
19
+ return module;
20
+ }