clavarium 0.2.479-next.1 → 0.2.481-next.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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.479-next.1",
3
+ "version": "0.2.481-next.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.479-next.1",
9
+ "version": "0.2.481-next.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.479-next.1",
3
+ "version": "0.2.481-next.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.",
@@ -196,7 +196,7 @@ export const SETTINGS_WORDS_FR = {
196
196
  'set-mcp-need': 'Collez le bloc, ou donnez nom et adresse.', 'set-mcp-tools': 'Outils', 'set-mcp-refresh': 'Actualiser', 'set-mcp-seen': 'Marquer comme vu',
197
197
  'set-mcp-none': 'Aucun outil listé pour l\'instant.', 'set-mcp-unreached': 'Injoignable : {why}', 'set-mcp-open': 'atteint l\'extérieur',
198
198
  'set-mcp-fresh': 'Nouveau : demandé jusqu\'à ce que vous l\'ayez vu',
199
- 'set-mcp-oauth': 'Se connecter', 'set-mcp-client': 'Identifiant client', 'set-mcp-client-need': 'Collez son identifiant et son secret, une fois.',
199
+ 'set-mcp-oauth': 'Se connecter', 'set-mcp-link': 'Ou ouvrez ce lien dans un autre navigateur :', 'set-mcp-link-copy': 'Copier', 'set-mcp-link-copied': 'Copié', 'set-mcp-link-open': 'Ouvrir', 'set-mcp-client': 'Identifiant client', 'set-mcp-client-need': 'Collez son identifiant et son secret, une fois.',
200
200
  /* Its client pasted once, the permissions asked, signed out (16-11). */
201
201
  'set-mcp-reconnect': 'Reconnecter', 'set-mcp-client-box': 'Identifiant et secret client', 'set-mcp-secret': 'Secret client',
202
202
  'set-mcp-scopes': 'Autorisations demandées', 'set-mcp-redirect': 'Adresse de retour de son appli', 'set-mcp-client-kept': 'Gardés sur le serveur. Aucune IA ne les voit.',
package/web/app.js CHANGED
@@ -5827,7 +5827,7 @@
5827
5827
  a new tool marked until seen (« Mark as seen »); then, for each conversation at Custom, what each kind may do. */
5828
5828
  /* A sign-in under way (its provider's tab open): the panel is painted again when this page is looked at again.
5829
5829
  The client form opened, and what the server said it needs, per server. */
5830
- let mcpSigningIn = ''; let mcpClientOpen = ''; const mcpClientNeed = new Map();
5830
+ let mcpSigningIn = ''; let mcpClientOpen = ''; const mcpClientNeed = new Map(); const mcpSignLink = new Map();
5831
5831
  const backFromSignin = () => { if (!mcpSigningIn || document.visibilityState !== 'visible') return; mcpSigningIn = ''; void repaintAsset(); };
5832
5832
  document.addEventListener('visibilitychange', backFromSignin);
5833
5833
  window.addEventListener('focus', backFromSignin);
@@ -5860,18 +5860,31 @@
5860
5860
  const redirect = el('input'); redirect.type = 'text'; redirect.readOnly = true; redirect.name = 'mcp-redirect';
5861
5861
  const said = el('p', 'hint mcp-client-said', uiSaid('set-mcp-client-kept', 'Kept on the server. No AI sees them.'));
5862
5862
  const asked = mcpClientNeed.get(t.id);
5863
- if (asked) { redirect.value = asked.redirect ?? ''; scopes.value = (asked.scopes ?? []).join(' '); }
5863
+ if (asked) { redirect.value = asked.redirect ?? ''; scopes.value = (asked.scopes ?? []).join(' '); clientId.value = asked.id ?? ''; }
5864
5864
  redirect.hidden = !redirect.value;
5865
5865
  clientBox.append(field('set-mcp-client', 'Client ID', clientId), field('set-mcp-secret', 'Client secret', clientSecret),
5866
5866
  field('set-mcp-scopes', 'Permissions asked', scopes), ...(redirect.value ? [field('set-mcp-redirect', 'Its app\'s redirect address', redirect)] : []), said);
5867
5867
  clientBox.addEventListener('toggle', () => { mcpClientOpen = clientBox.open ? t.id : ''; });
5868
+ /* The sign-in address, shown to copy or open in another browser (17-11). */
5869
+ const linkBox = el('div', 'mcp-sign-link');
5870
+ const linkText = el('input'); linkText.type = 'text'; linkText.readOnly = true; linkText.name = 'mcp-sign-link'; linkText.spellcheck = false;
5871
+ const linkCopy = el('button', '', uiSaid('set-mcp-link-copy', 'Copy')); linkCopy.type = 'button';
5872
+ const linkOpen = el('a', 'button', uiSaid('set-mcp-link-open', 'Open')); linkOpen.target = '_blank'; linkOpen.rel = 'noopener noreferrer';
5873
+ linkCopy.addEventListener('click', async () => { try { await navigator.clipboard.writeText(linkText.value); linkCopy.textContent = uiSaid('set-mcp-link-copied', 'Copied'); } catch { linkText.select(); } });
5874
+ linkText.addEventListener('focus', () => linkText.select());
5875
+ const linkRow = el('div', 'mcp-sign-link-row'); linkRow.append(linkText, linkCopy, linkOpen);
5876
+ linkBox.append(el('p', 'hint', uiSaid('set-mcp-link', 'Or open this link in another browser:')), linkRow);
5877
+ const showSignLink = (url) => { if (!/^https?:\/\//.test(String(url))) { linkBox.hidden = true; return; } linkText.value = url; linkOpen.href = url; linkBox.hidden = false; };
5878
+ showSignLink(mcpSignLink.get(t.id) ?? '');
5868
5879
  oauth.addEventListener('click', async () => {
5869
5880
  $(asErrId()).hidden = true;
5870
5881
  /* Opened now, empty; never told who opened it (the provider's page cannot reach this one). */
5871
5882
  let tab = null;
5872
- try { tab = window.open('', '_blank'); if (tab) tab.opener = null; } catch { tab = null; }
5883
+ try { tab = window.open('', '_blank'); } catch { tab = null; }
5884
+ try { if (tab) tab.opener = null; } catch { /* some browsers refuse it: the tab is still ours */ }
5873
5885
  oauth.disabled = true; oauth.setAttribute('aria-busy', 'true');
5874
5886
  const body = { target: t.id, lang: deviceLang(), back: location.pathname + location.search, tab: tab ? 'new' : 'same' };
5887
+ if (asked && clientId.value.trim()) asked.id = clientId.value.trim();
5875
5888
  if (clientId.value.trim()) body.clientId = clientId.value.trim();
5876
5889
  if (clientSecret.value.trim()) body.clientSecret = clientSecret.value.trim();
5877
5890
  if (asked && scopes.value.trim() !== (asked.scopes ?? []).join(' ')) body.scope = scopes.value.trim();
@@ -5882,11 +5895,13 @@
5882
5895
  const r = await post(`${API}/tether/mcp-oauth`, body);
5883
5896
  if (r?.url) {
5884
5897
  mcpSigningIn = t.id;
5898
+ /* Its address, also to copy: to sign in from another browser (17-11). */
5899
+ mcpSignLink.set(t.id, r.url); showSignLink(r.url);
5885
5900
  if (tab) tab.location.href = r.url; else { location.assign(r.url); return; }
5886
5901
  } else {
5887
5902
  try { tab?.close(); } catch { /* gone */ }
5888
5903
  if (r?.need === 'client') {
5889
- mcpClientNeed.set(t.id, { redirect: r.redirect, scopes: r.scopes, secret: r.secret });
5904
+ mcpClientNeed.set(t.id, { redirect: r.redirect, scopes: r.scopes, secret: r.secret, id: clientId.value.trim() });
5890
5905
  mcpClientOpen = t.id;
5891
5906
  sayAsErr(new Error(r.missing === 'secret' ? uiSaid('set-mcp-secret-need', 'Paste its client secret too.') : uiSaid('set-mcp-client-need', 'Paste its client ID and secret, once.')));
5892
5907
  await repaintAsset();
@@ -5924,7 +5939,7 @@
5924
5939
  if (signedOut) body.push(el('p', 'error mcp-out', uiSaid('set-mcp-out', '{name} is disconnected. Reconnect it.', { name: t.title })));
5925
5940
  else if (t.catalog?.error) body.push(el('p', 'error', uiSaid('set-mcp-unreached', 'Not reached: {why}', { why: t.catalog.error })));
5926
5941
  body.push(tools.length ? list : el('p', 'hint', uiSaid('set-mcp-none', 'No tools listed yet.')));
5927
- body.push(clientBox);
5942
+ body.push(linkBox, clientBox);
5928
5943
  out.push({ title: uiSaid('set-mcp-tools', 'Tools'), extra: [seen, oauth, refresh], body, cls: 'as-mcp-tools' });
5929
5944
  /* Custom: each kind of tool Yes / Ask / No, for each conversation set to it. */
5930
5945
  const custom = Object.entries(t.grants ?? {}).filter(([id, g]) => id.startsWith('conversation:') && g?.level === 'frame');
@@ -6364,10 +6379,20 @@
6364
6379
  if (answer.partial) notes.push(el('p', 'hint', uiSaid('set-ag-partial', 'Start times only, for now')));
6365
6380
  holder.replaceChildren(shown, list, ...notes);
6366
6381
  }
6382
+ /* WHILE A CALENDAR, A MAILBOX OR AN ADDRESS BOOK IS READ (17-11, the transitions persona): seen at once -- a turning
6383
+ sign, the word, and grey lines where the rows will come; read again over what is shown, a moving bar on top
6384
+ (style.css, [aria-busy]). Said once to a screen reader (role=status). */
6385
+ function readingNote(rows) {
6386
+ const box = el('div', 'as-reading'); box.setAttribute('role', 'status');
6387
+ const head = el('p', 'as-reading-head'); head.append(el('span', 'as-spin'), el('span', '', uiSaid('set-ag-reading', 'Reading…')));
6388
+ box.append(head);
6389
+ for (let i = 0; i < rows; i++) { const r = el('div', 'as-skel'); r.setAttribute('aria-hidden', 'true'); r.style.setProperty('--w', `${[78, 62, 86, 54][i % 4]}%`); box.append(r); }
6390
+ return box;
6391
+ }
6367
6392
  async function agendaFill(holder, target, opts) {
6368
6393
  const from = agendaFrom.get(target) ?? wallNow(agendaZone).slice(0, 10);
6369
6394
  holder.setAttribute('aria-busy', 'true');
6370
- if (!holder.childElementCount) holder.append(el('p', 'hint', uiSaid('set-ag-reading', 'Reading…')));
6395
+ if (!holder.childElementCount) holder.append(readingNote(4));
6371
6396
  const answer = await agendaRead(target, from, opts);
6372
6397
  holder.removeAttribute('aria-busy');
6373
6398
  if (!holder.isConnected) return;
@@ -6760,7 +6785,7 @@
6760
6785
  const body = box.querySelector('.mv-body');
6761
6786
  if (body.dataset.filled) return;
6762
6787
  body.dataset.filled = '1';
6763
- body.replaceChildren(el('p', 'hint', uiSaid('set-ag-reading', 'Reading…')));
6788
+ body.replaceChildren(readingNote(2));
6764
6789
  const got = await peekRead(`mail-read|${target}|${folder}|${m.id}`, 'mail-read', { target, id: m.id, folder }, uiSaid('set-mv-failed-one', 'This message could not be read.'));
6765
6790
  if (!body.isConnected) return;
6766
6791
  if (got.error) { delete body.dataset.filled; body.replaceChildren(el('p', 'error', got.error)); return; }
@@ -6804,7 +6829,7 @@
6804
6829
  async function mailFill(holder, target, opts) {
6805
6830
  const s = peekOf(target);
6806
6831
  holder.setAttribute('aria-busy', 'true');
6807
- if (!holder.childElementCount) holder.append(el('p', 'hint', uiSaid('set-ag-reading', 'Reading…')));
6832
+ if (!holder.childElementCount) holder.append(readingNote(4));
6808
6833
  const answer = await peekRead(`mail-list|${target}|${s.folder}|${s.text}`, 'mail-list', { target, folder: s.folder, text: s.text }, uiSaid('set-mv-failed', 'The mailbox could not be read.'), opts);
6809
6834
  holder.removeAttribute('aria-busy');
6810
6835
  if (!holder.isConnected) return;
@@ -6846,7 +6871,7 @@
6846
6871
  const body = box.querySelector('.mv-body');
6847
6872
  if (body.dataset.filled) return;
6848
6873
  body.dataset.filled = '1';
6849
- body.replaceChildren(el('p', 'hint', uiSaid('set-ag-reading', 'Reading…')));
6874
+ body.replaceChildren(readingNote(2));
6850
6875
  const got = await peekRead(`contact|${target}|${c.id}`, 'contact', { target, id: c.id }, uiSaid('set-ct-failed-one', 'This contact could not be read.'));
6851
6876
  if (!body.isConnected) return;
6852
6877
  if (got.error) { delete body.dataset.filled; body.replaceChildren(el('p', 'error', got.error)); return; }
@@ -6877,7 +6902,7 @@
6877
6902
  async function contactsFill(holder, target, opts) {
6878
6903
  const s = peekOf(target);
6879
6904
  holder.setAttribute('aria-busy', 'true');
6880
- if (!holder.childElementCount) holder.append(el('p', 'hint', uiSaid('set-ag-reading', 'Reading…')));
6905
+ if (!holder.childElementCount) holder.append(readingNote(4));
6881
6906
  const answer = await peekRead(`contacts|${target}|${s.text}`, 'contacts', { target, text: s.text }, uiSaid('set-ct-failed', 'The address book could not be read.'), opts);
6882
6907
  holder.removeAttribute('aria-busy');
6883
6908
  if (!holder.isConnected) return;
package/web/style.css CHANGED
@@ -789,6 +789,12 @@ svg.lk-links path.temp { stroke: var(--k-pick); stroke-dasharray: 4 4; }
789
789
  #nav button[aria-current="page"] .nav-ic { stroke: var(--brass); }
790
790
  /* On a wide screen the list above is the menu, always there (the « button shows it when folded): the bar holds only the places of the whole. A phone keeps it: there the list is a screen of its own. */
791
791
  @media (min-width: 701px) { #nav #nav-conversations { display: none; } }
792
+ /* Wide enough, the four places two by two (17-11: a lighter block under the list); narrow, one a line. */
793
+ @media (min-width: 701px) {
794
+ #nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 6.5rem), 1fr)); }
795
+ #nav button { gap: 8px; padding-inline: 8px; min-width: 0; }
796
+ #nav button > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
797
+ }
792
798
  @media (max-width: 700px) {
793
799
  /* A phone: a bar along the bottom, above the system's own strip; gone inside a conversation and while typing. */
794
800
  #nav { grid-row: 2; flex-direction: row; gap: 0; padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0)); border-right: 0; }
@@ -1259,6 +1265,18 @@ header .ic, #folders .ic { width: 18px; height: 18px; fill: none; stroke: curren
1259
1265
  .ag-bar button { padding: 4px 10px; }
1260
1266
  .as-agenda { display: flex; flex-direction: column; gap: 6px; }
1261
1267
  .as-agenda[aria-busy="true"] .ag-days { opacity: .6; }
1268
+ .as-reading { display: flex; flex-direction: column; gap: 8px; padding: 10px 2px; }
1269
+ .as-reading-head { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink2); font-size: .875rem; }
1270
+ .as-spin { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ink2) 30%, transparent); border-top-color: var(--brass); animation: as-spin .8s linear infinite; }
1271
+ .as-skel { height: 12px; width: var(--w, 70%); border-radius: 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--ink) 7%, transparent) 25%, color-mix(in srgb, var(--ink) 14%, transparent) 50%, color-mix(in srgb, var(--ink) 7%, transparent) 75%); background-size: 200% 100%; animation: as-shimmer 1.4s ease-in-out infinite; }
1272
+ /* Read again over what is shown: a bar moving along the top, the rows dimmed. */
1273
+ .as-agenda { position: relative; }
1274
+ .as-agenda[aria-busy="true"]:has(> :not(.as-reading))::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 3px; z-index: 1; background: linear-gradient(90deg, transparent, var(--brass), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: as-bar 1.1s ease-in-out infinite; }
1275
+ .as-agenda[aria-busy="true"] > :not(.as-reading) { opacity: .6; transition: opacity .2s; }
1276
+ @keyframes as-spin { to { transform: rotate(360deg); } }
1277
+ @keyframes as-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
1278
+ @keyframes as-bar { from { background-position: -40% 0; } to { background-position: 140% 0; } }
1279
+ @media (prefers-reduced-motion: reduce) { .as-spin, .as-skel, .as-agenda[aria-busy="true"]::before { animation: none; } }
1262
1280
  .ag-days { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bar); padding: 8px 12px; }
1263
1281
  .ag-day { display: flex; flex-direction: column; gap: 2px; }
1264
1282
  .ag-dayhead { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: .8125rem; color: var(--ink2); text-transform: capitalize; }
@@ -2293,6 +2311,9 @@ details.commit > pre { margin: 6px 0 0 1.6em; white-space: pre-wrap; overflow-wr
2293
2311
  .mcp-client { margin: .4rem 0; }
2294
2312
  .mcp-client summary { cursor: pointer; color: var(--ink2); }
2295
2313
  .mcp-client-field { display: flex; flex-direction: column; gap: 2px; margin: .4rem 0; }
2314
+ .mcp-sign-link { margin: .4rem 0; }
2315
+ .mcp-sign-link-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
2316
+ .mcp-sign-link-row input { flex: 1; min-width: 0; font-family: var(--mono, monospace); font-size: 12px; }
2296
2317
  .mcp-client-field input { width: 100%; box-sizing: border-box; min-width: 0; }
2297
2318
  .mcp-custom { display: flex; flex-direction: column; gap: 4px; margin: .4rem 0 .8rem; }
2298
2319
  .mcp-custom-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }