clavarium 0.2.39-next.1 → 0.2.40-beta.1

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.
@@ -274,7 +274,7 @@ export class Updater {
274
274
  this.restart = restart ?? (() => this.#restart());
275
275
  /* What was seen when the server did not come up: its journal, its unit, who holds its port. */
276
276
  this.diagnose = diagnose ?? (() => this.#diagnose());
277
- this.health = health ?? ((release) => this.#health(release));
277
+ this.health = health ?? ((release, opts) => this.#health(release, opts));
278
278
  this.backup = backup ?? ((app) => this.#backup(app));
279
279
  this.restoreData = restoreData ?? ((app, archive) => this.#restoreData(app, archive));
280
280
  this.installPrivileged = installPrivileged ?? ((app) => this.#installPrivileged(app));
@@ -606,13 +606,16 @@ export class Updater {
606
606
  await this.installPrivileged(release.app);
607
607
  } catch (error) { return `it could not be put in place: ${error.message}`; }
608
608
  this.#step(action, version, 'Restarting');
609
- return this.#restartAndCheck(release);
609
+ /* Once the new server answers, the maintenance page is gone but a minute or two of
610
+ watching that it stays up is left: said as "Confirming", not "Restarting", so a page
611
+ back up does not look stuck restarting (deploy/updater.mjs, #health onUp). */
612
+ return this.#restartAndCheck(release, () => this.#step(action, version, 'Confirming'));
610
613
  }
611
614
  /* '' when it came up, or why not. */
612
- async #restartAndCheck(release) {
615
+ async #restartAndCheck(release, onUp) {
613
616
  const r = await this.restart().catch((e) => ({ code: 1, stderr: e.message }));
614
617
  if (r?.code) return `the server did not restart: ${lastLine(r)}`;
615
- const h = await this.health(release).catch((e) => e.message || 'no answer');
618
+ const h = await this.health(release, { onUp }).catch((e) => e.message || 'no answer');
616
619
  return h || '';
617
620
  }
618
621
 
@@ -802,7 +805,7 @@ export class Updater {
802
805
 
803
806
  /* Comes up (answers, from this release) within healthMs, then STAYS up: watched until watchMs after
804
807
  the restart; one restart by systemd is forgiven if it answers at the end, not two. */
805
- async #health(release) {
808
+ async #health(release, { onUp } = {}) {
806
809
  const { clock, sleep } = this.#o;
807
810
  const start = clock();
808
811
  const target = realpathSync(release.dir);
@@ -820,7 +823,8 @@ export class Updater {
820
823
  if (clock() - start > this.#o.healthMs) return said;
821
824
  await sleep(1000);
822
825
  }
823
- /* And it stays up. */
826
+ /* It answers, from this release: the maintenance page gives way. Now it must stay up. */
827
+ onUp?.();
824
828
  const until = Math.max(start + this.#o.watchMs, clock() + this.#o.settleMs);
825
829
  let restarts = 0;
826
830
  while (clock() < until) {
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.39-next.1",
3
+ "version": "0.2.40-beta.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.39-next.1",
9
+ "version": "0.2.40-beta.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
13
13
  "@xterm/xterm": "^6.0.0",
14
- "clavarium-binder": "0.1.6-next.1",
14
+ "clavarium-binder": "0.1.8-next.1",
15
15
  "clavarium-docket": "0.1.1",
16
- "clavarium-parley": "0.17.3-next.1",
16
+ "clavarium-parley": "0.17.4-next.1",
17
17
  "mermaid": "11.17.2",
18
18
  "node-pty": "^1.1.0",
19
19
  "pdfjs-dist": "6.4.299",
@@ -688,9 +688,9 @@
688
688
  }
689
689
  },
690
690
  "node_modules/clavarium-binder": {
691
- "version": "0.1.6-next.1",
692
- "resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.6-next.1.tgz",
693
- "integrity": "sha512-urE1ZZCYq9svQmQR1ailNX6r5OeBcT0wNDea498PMDRbmcUCOciqoF/1C3IGLT7z133eb4dOUEhVcbRE42/h3A==",
691
+ "version": "0.1.8-next.1",
692
+ "resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.8-next.1.tgz",
693
+ "integrity": "sha512-0ZvTgn4z3IzLWjVyt5H82tnrE4g4Zdh0eb0kKrpVYjJ8vEfun6CmzHFclce9lb7vH+CC5ozKETuTAmSVYkk+lg==",
694
694
  "license": "MIT",
695
695
  "bin": {
696
696
  "binder": "bin/binder.mjs",
@@ -714,9 +714,9 @@
714
714
  }
715
715
  },
716
716
  "node_modules/clavarium-parley": {
717
- "version": "0.17.3-next.1",
718
- "resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.3-next.1.tgz",
719
- "integrity": "sha512-wnaCSkDrcaZE/Tf1y7LI0NiYLnz9qAEjZwYeT+DSquvoMIDU43dugBuW7QdNyP1NB8knupaWqXH29oNSZ9n8jw==",
717
+ "version": "0.17.4-next.1",
718
+ "resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.4-next.1.tgz",
719
+ "integrity": "sha512-/rQy9WLP9/XndInawH6mIhS9RivA1IQmMpB5IhYMUflnLSWBvP096Z0TF3xB3u2X1e8uni4tar5Tua5hq/wjWg==",
720
720
  "license": "MIT",
721
721
  "bin": {
722
722
  "parley": "bin/parley.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.39-next.1",
3
+ "version": "0.2.40-beta.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "A conversation is a VM with a terminal in it. Everything else is a folder.",
@@ -44,9 +44,9 @@
44
44
  "dependencies": {
45
45
  "@xterm/addon-fit": "^0.11.0",
46
46
  "@xterm/xterm": "^6.0.0",
47
- "clavarium-binder": "0.1.6-next.1",
47
+ "clavarium-binder": "0.1.8-next.1",
48
48
  "clavarium-docket": "0.1.1",
49
- "clavarium-parley": "0.17.3-next.1",
49
+ "clavarium-parley": "0.17.4-next.1",
50
50
  "mermaid": "11.17.2",
51
51
  "node-pty": "^1.1.0",
52
52
  "pdfjs-dist": "6.4.299",
package/web/app.js CHANGED
@@ -111,8 +111,10 @@
111
111
  $('notice-spin').hidden = true; $('notice-steps').hidden = true;
112
112
  $('notice-head').hidden = true; delete notice.dataset.progress; delete notice.dataset.loading;
113
113
  };
114
- /* A terminal on its way: a neutral word and the wheel, nothing that sounds like a fault. */
115
- const loading = () => { show('Loading the terminal\u2026'); $('notice-spin').hidden = false; notice.dataset.loading = 'yes'; };
114
+ /* A terminal on its way: a neutral word and the wheel, nothing that sounds like a fault. It
115
+ covers only when the terminal is what is on screen -- not the chat already there, which a tab
116
+ resume (its channel reopened) used to blank behind "Loading the terminal..." (found 26-10). */
117
+ const loading = () => { if (tabNow() !== 'terminal') return; show('Loading the terminal\u2026'); $('notice-spin').hidden = false; notice.dataset.loading = 'yes'; };
116
118
  /* A restart: when the page first saw it (when the server did not say), and the clock that tells it. */
117
119
  const restartSeen = new Map(); let restartTicking = 0;
118
120
  /* A START TOLD STEP BY STEP (a build, a restart, a wake: `progress`, see
@@ -1672,6 +1674,9 @@
1672
1674
  function paintViews() {
1673
1675
  if (DEVICE) return;
1674
1676
  const now = tabNow();
1677
+ /* The "Loading the terminal..." veil belongs to the terminal: leaving it for the chat (or
1678
+ any other tab) takes the veil away, so a tab already there is not covered. */
1679
+ if (notice.dataset.loading && now !== 'terminal') notice.hidden = true;
1675
1680
  for (const [id, tab] of [['view-chat', 'chat'], ['view-terminal', 'terminal'], ['view-assets', 'assets'], ['view-lists', 'lists'], ['folders', 'settings']]) $(id).setAttribute('aria-pressed', String(now === tab));
1676
1681
  }
1677
1682
  /* THE FOUR TABS: Chat, Terminal, Assets, Settings. The one it opened on
@@ -4681,7 +4686,7 @@
4681
4686
  $('updates-state').textContent = running ? `${running.action === 'back' ? 'Going back to' : 'Updating to'} ${running.version}: ${running.step.toLowerCase()}...`
4682
4687
  : u.checkError ? 'Could not check just now.'
4683
4688
  : u.available ? `${u.available} is out.`
4684
- : u.checkedAt ? `Up to date · checked ${sinceWords(u.checkedAt)}` : 'Up to date';
4689
+ : u.checkedAt ? `Nothing newer to install · checked ${sinceWords(u.checkedAt)}` : 'Nothing newer to install';
4685
4690
  $('updates-check').disabled = Boolean(running);
4686
4691
  $('updates-offer').hidden = !u.available || Boolean(running);
4687
4692
  /* A version that already failed here is not offered as usual: tried again only on purpose, warned. */
package/web/gitgraph.js CHANGED
@@ -127,11 +127,14 @@
127
127
  /* Fixed columns, so the author, the time and the branches line up
128
128
  down the rows and read at a glance. All set as text, never markup. */
129
129
  const cell = (cls, tag, text) => { const e = document.createElement(tag); e.className = cls; e.textContent = text; return e; };
130
+ /* The message takes all the room it can and is cut only when it must;
131
+ the other columns are a fixed block on the right. */
130
132
  const subject = cell('gg-subject', 'span', c.subject || '(no message)'); subject.title = c.subject || '';
133
+ const meta = document.createElement('div'); meta.className = 'gg-meta';
131
134
  const author = cell('gg-author', 'span', c.author || '');
132
135
  const time = cell('gg-time', 'small', when(c.date, now));
133
136
  const sha = cell('gg-id', 'small', c.id.slice(0, 7));
134
- b.append(subject, author, time, sha);
137
+ const refs = document.createElement('div'); refs.className = 'gg-refs';
135
138
  /* Its branches: the agent's (filled), the remote's (outlined); the same name on both is one label. */
136
139
  const names = new Map();
137
140
  for (const ref of c.refs ?? []) names.set(ref.name, names.has(ref.name) && names.get(ref.name) !== ref.side ? 'both' : ref.side);
@@ -139,7 +142,7 @@
139
142
  const pill = document.createElement('span'); pill.className = `gg-ref gg-${side}`; pill.textContent = name;
140
143
  pill.style.setProperty('--c', colour(r.col));
141
144
  pill.title = side === 'agent' ? `The agent's ${name}` : side === 'remote' ? `The remote's ${name}` : `${name}, the same here and on the remote`;
142
- b.append(pill);
145
+ refs.append(pill);
143
146
  /* On the agent's tip of a branch that is not level with the remote:
144
147
  how far it is ahead and behind (shown only in the detailed view). */
145
148
  const n = side !== 'remote' && counts[name];
@@ -147,9 +150,11 @@
147
150
  const badge = document.createElement('small'); badge.className = 'gg-count';
148
151
  badge.textContent = `${n.ahead ? `↑${n.ahead}` : ''}${n.behind ? ` ↓${n.behind}` : ''}`.trim();
149
152
  badge.title = `${n.ahead} ahead of, ${n.behind} behind the remote`;
150
- b.append(badge);
153
+ refs.append(badge);
151
154
  }
152
155
  }
156
+ meta.append(author, time, sha, refs);
157
+ b.append(subject, meta);
153
158
  if (pick) b.addEventListener('click', () => pick(c));
154
159
  list.append(b);
155
160
  });
package/web/index.html CHANGED
@@ -372,6 +372,12 @@
372
372
  <!-- THE MAP (once "Who gets what"): every device, conversation and asset, and the rights between them (links.js). -->
373
373
  <div id="links" class="pane">
374
374
  <div id="links-legend" class="lk-legend"></div>
375
+ <!-- The column filters, kept out of the board's zoom so a crowded map does not shrink them (links.js). -->
376
+ <div id="links-filters" class="lk-filters">
377
+ <label class="lk-filter"><span>Devices</span><input type="search" class="lk-find" data-k="device" placeholder="Filter&hellip;" aria-label="Filter devices"></label>
378
+ <label class="lk-filter"><span>Conversations</span><input type="search" class="lk-find" data-k="conversation" placeholder="Filter&hellip;" aria-label="Filter conversations"></label>
379
+ <label class="lk-filter"><span>Assets</span><input type="search" class="lk-find" data-k="asset" placeholder="Filter&hellip;" aria-label="Filter assets"></label>
380
+ </div>
375
381
  <p id="links-hint" class="hint" aria-live="polite"></p>
376
382
  <p id="links-error" class="error" role="alert" hidden></p>
377
383
  <div id="links-card" class="lk-card" hidden aria-live="polite"></div>
@@ -714,7 +720,7 @@
714
720
  <div id="updates-settings" class="set-rows">
715
721
  <div class="set-row"><div class="set-what"><label for="updates-mode">Mode</label><small>When updates are installed</small></div><div class="set-control"><select id="updates-mode"><option value="auto">Automatic, in a window</option><option value="asap">As soon as out</option><option value="ask">Ask me</option><option value="off">Off</option></select></div></div>
716
722
  <div class="set-row" id="updates-window-row"><div class="set-what"><label for="updates-from" id="updates-window-label">Window</label><small>Hours when it may restart</small></div><div class="set-control"><span id="updates-window" class="updates-window"><input type="time" id="updates-from" aria-label="From"><span aria-hidden="true">to</span><input type="time" id="updates-to" aria-label="To"></span></div></div>
717
- <div class="set-row"><div class="set-what"><label for="updates-channel">Channel</label><small>Stable, or earlier builds</small></div><div class="set-control"><select id="updates-channel"><option value="next">Next (earliest tests)</option><option value="beta">Beta (nearly ready)</option><option value="latest">Stable</option></select></div></div>
723
+ <div class="set-row"><div class="set-what"><label for="updates-channel">Channel</label><small>Which builds to follow; you update only to a version newer than this one</small></div><div class="set-control"><select id="updates-channel"><option value="next">Next (earliest tests)</option><option value="beta">Beta (nearly ready)</option><option value="latest">Stable</option></select></div></div>
718
724
  <!-- What the front serves to a browser (server/certificate.mjs). -->
719
725
  <div class="set-row" id="updates-certificate-row" hidden><div class="set-what"><span>Certificate</span><small id="updates-certificate" role="status"></small></div></div>
720
726
  </div>
package/web/links.js CHANGED
@@ -69,6 +69,12 @@
69
69
  let allLines = true;
70
70
  try { allLines = localStorage.getItem('clavarium-links-all') !== '0'; } catch { /* none kept */ }
71
71
  let picked = null; let pinned = null; let focus = null; let drag = null; let pop = null; let popLink = null; let drawnMany = false;
72
+ /* A box is shown only if its column's filter is empty or its name holds what was typed: so a
73
+ crowded map (many assets) is narrowed to a few boxes, their links with them. The layout is
74
+ kept while typing (no reorder), and a filter cleared brings everything back. */
75
+ const filters = { device: '', conversation: '', asset: '' };
76
+ let laidOut = null;
77
+ const matches = (n, k) => { const f = (filters[k] || '').trim().toLowerCase(); return !f || n.name.toLowerCase().includes(f) || String(n.sub || '').toLowerCase().includes(f); };
72
78
  const ph = { screen: 'list', kind: 'device', id: null, adding: false, sheet: null };
73
79
  let traceOf = '*';
74
80
 
@@ -182,27 +188,35 @@
182
188
  }
183
189
  return best;
184
190
  }
185
- function paint() {
191
+ /* `relayout` false keeps the order found last: used while typing a filter, so boxes do not jump. */
192
+ function paint(relayout = true) {
186
193
  for (const b of document.querySelectorAll('#links-tabs [data-view]')) b.setAttribute('aria-selected', String(b.dataset.view === view));
187
194
  $('links-all').checked = allLines;
188
195
  legend();
189
196
  const bd = board();
190
197
  bd.className = `lk-board ${VIEWS[view].cols.length === 3 ? 'three' : 'two'}`;
191
198
  bd.querySelectorAll('.lk-col, .lk-knob').forEach((e) => e.remove()); closePop();
192
- const lists = layout();
199
+ if (relayout || !laidOut) laidOut = layout();
200
+ const lists = laidOut;
193
201
  VIEWS[view].cols.forEach((cols, ci) => {
194
202
  const col = h('div', { class: 'lk-col' });
195
203
  cols.forEach((k, i) => {
196
204
  if (i) col.append(h('div', { class: 'lk-gap' }));
197
- col.append(h('h3', { class: 'lk-colh' }, h('span', { text: TITLES[k] }), plus(k)));
198
- const list = lists[ci][i];
205
+ col.append(h('h3', { class: 'lk-colh' }, h('span', { class: 'lk-colt', text: TITLES[k] }), plus(k)));
206
+ const whole = lists[ci][i];
207
+ const list = whole.filter((n) => matches(n, k));
199
208
  for (const n of list) col.append(nodeEl(n));
200
- if (!list.length) col.append(empty(k));
209
+ if (!list.length) col.append(whole.length ? h('p', { class: 'hint lk-none', text: 'Nothing matches.' }) : empty(k));
201
210
  });
202
211
  bd.append(col);
203
212
  });
204
213
  fit(); draw(); hint(); paintPhone();
205
214
  }
215
+ /* The filters sit in a bar of their own, ABOVE the board and out of its zoom, so that fitting
216
+ a crowded map (which zooms it down) never shrinks them. Each narrows its column; the board
217
+ is repainted without a relayout (the inputs are not rebuilt, so the caret stays). */
218
+ const onFind = (e) => { filters[e.target.dataset.k] = e.target.value; paint(false); };
219
+ for (const inp of document.querySelectorAll('#links-filters .lk-find')) inp.addEventListener('input', onFind);
206
220
  /* How each kind is made: a device paired, a conversation created, an asset added. The same,
207
221
  from the small round "+" by each column's title (always there, however many it holds)
208
222
  and from an empty column. */
package/web/style.css CHANGED
@@ -1172,20 +1172,24 @@ header .ic, #folders .ic { width: 18px; height: 18px; fill: none; stroke: curren
1172
1172
  .gg-bar { display: flex; justify-content: flex-end; }
1173
1173
  .gg-toggle { font-size: .72rem; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink2); }
1174
1174
  .gg-toggle[aria-pressed="true"] { color: var(--ink); border-color: var(--gg-0); }
1175
- .gg { position: relative; min-width: max-content; }
1175
+ .gg { position: relative; width: 100%; }
1176
1176
  .gg-lines { position: absolute; left: 0; top: 0; }
1177
1177
  .gg-rows { display: flex; flex-direction: column; }
1178
- .gg-row { display: flex; align-items: center; gap: 12px; height: 30px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; text-align: left; font-weight: 400; white-space: nowrap; }
1179
- .gg-row:hover, .gg-row:focus-visible { background: var(--button, #222c38); }
1180
- /* Fixed columns, so the author and the branches line up down the rows. */
1181
- .gg-subject { flex: none; width: 30ch; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
1182
- .gg-author { flex: none; width: 12ch; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; }
1183
- .gg-time { flex: none; width: 9ch; color: var(--ink2); }
1184
- .gg-id { flex: none; width: 7ch; color: var(--ink2); font-family: ui-monospace, Menlo, Consolas, monospace; opacity: .8; }
1185
- .gg-count { flex: none; color: var(--ink2); font-weight: 700; font-size: .72rem; }
1178
+ .gg-row { display: flex; align-items: center; gap: 14px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; text-align: left; font-weight: 400; white-space: nowrap; width: 100%; }
1179
+ /* A faint highlight on the row the mouse is over, to follow it across a wide screen. */
1180
+ .gg-row:hover, .gg-row:focus-visible { background: color-mix(in srgb, var(--ink) 7%, transparent); }
1181
+ /* The message takes all the room it can; the other columns are a fixed block on the right. */
1182
+ .gg-subject { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
1183
+ .gg-meta { flex: none; display: flex; align-items: center; gap: 10px; }
1184
+ .gg-author { width: 11ch; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; }
1185
+ .gg-time { width: 8ch; color: var(--ink2); }
1186
+ .gg-id { width: 7ch; color: var(--ink2); font-family: ui-monospace, Menlo, Consolas, monospace; opacity: .8; }
1187
+ .gg-refs { width: 14ch; flex: none; display: flex; align-items: center; gap: 6px; overflow: hidden; }
1188
+ .gg-count { color: var(--ink2); font-weight: 700; font-size: .72rem; }
1186
1189
  /* The id, the time and the ahead/behind count come in only when asked. */
1187
1190
  .gg-id, .gg-time, .gg-count { display: none; }
1188
- .gg-detailed .gg-id, .gg-detailed .gg-time, .gg-detailed .gg-count { display: inline-block; }
1191
+ .gg-detailed .gg-id, .gg-detailed .gg-time { display: inline-block; }
1192
+ .gg-detailed .gg-count { display: inline; }
1189
1193
  .gg-row small { color: var(--ink2); }
1190
1194
  .gg-ref { font-size: .6875rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: var(--c); border: 1px solid var(--c); }
1191
1195
  .gg-agent, .gg-both { background: color-mix(in srgb, var(--c) 16%, transparent); }
@@ -1277,6 +1281,14 @@ select.pill { appearance: auto; }
1277
1281
  /* The title of a column of the map, and its round "+" (a new device, conversation, asset): always there. */
1278
1282
  .lk-col h3.lk-colh, .lk-phead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
1279
1283
  .lk-col h3.lk-colh .lk-add { width: 26px; height: 26px; font-size: .95rem; letter-spacing: 0; }
1284
+ /* The filters: their own bar above the board, out of its zoom, so they stay a usable size. */
1285
+ .lk-filters { display: flex; gap: 10px 16px; flex-wrap: wrap; margin: 2px 0 10px; }
1286
+ .lk-filter { display: flex; align-items: center; gap: 8px; flex: 1 1 200px; min-width: 160px; }
1287
+ .lk-filter > span { flex: none; font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
1288
+ .lk-filters .lk-find { flex: 1 1 auto; min-width: 0; font: inherit; font-size: .9rem; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); }
1289
+ .lk-filters .lk-find::placeholder { color: var(--ink2); }
1290
+ /* The phone shows a list of its own, not the board: the column filters do not apply there. */
1291
+ @media (max-width: 600px) { #links-filters { display: none; } }
1280
1292
  .lk-phead { margin: 4px 0 6px; }
1281
1293
  .as-kinds { display: flex; flex-wrap: wrap; gap: 8px; } .as-kinds button { display: inline-flex; align-items: center; gap: 8px; }
1282
1294