clavarium 0.2.480-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.480-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.480-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.480-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');
package/web/style.css CHANGED
@@ -2311,6 +2311,9 @@ details.commit > pre { margin: 6px 0 0 1.6em; white-space: pre-wrap; overflow-wr
2311
2311
  .mcp-client { margin: .4rem 0; }
2312
2312
  .mcp-client summary { cursor: pointer; color: var(--ink2); }
2313
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; }
2314
2317
  .mcp-client-field input { width: 100%; box-sizing: border-box; min-width: 0; }
2315
2318
  .mcp-custom { display: flex; flex-direction: column; gap: 4px; margin: .4rem 0 .8rem; }
2316
2319
  .mcp-custom-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }