clavarium 0.2.55-beta.1 → 0.2.56-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.
package/deploy/install.sh CHANGED
@@ -605,7 +605,7 @@ $BIND
605
605
  @api path /api/* /c/api/*
606
606
  handle @api {
607
607
  header Content-Type "application/json; charset=utf-8"
608
- respond "{\"error\":\"Clavarium is being updated or restarted: it comes back by itself in a moment.\",\"down\":true}" 503
608
+ respond "{\"error\":\"Clavarium did not answer just now -- it may be busy or restarting. It comes back by itself; try again in a moment.\",\"down\":true}" 503
609
609
  }
610
610
  handle {
611
611
  root * /var/lib/clavarium/maintenance
@@ -140,7 +140,7 @@ export const MAINTENANCE_BLOCK = [
140
140
  '\t\t\t\t@api path /api/* /c/api/*',
141
141
  '\t\t\t\thandle @api {',
142
142
  '\t\t\t\t\theader Content-Type "application/json; charset=utf-8"',
143
- '\t\t\t\t\trespond "{\\"error\\":\\"Clavarium is being updated or restarted: it comes back by itself in a moment.\\",\\"down\\":true}" 503',
143
+ '\t\t\t\t\trespond "{\\"error\\":\\"Clavarium did not answer just now -- it may be busy or restarting. It comes back by itself; try again in a moment.\\",\\"down\\":true}" 503',
144
144
  '\t\t\t\t}',
145
145
  '\t\t\t\thandle {',
146
146
  `\t\t\t\t\troot * ${MAINTENANCE_DIR}`,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.55-beta.1",
3
+ "version": "0.2.56-beta.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.55-beta.1",
9
+ "version": "0.2.56-beta.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
@@ -14,7 +14,7 @@
14
14
  "clavarium-binder": "0.1.8-next.1",
15
15
  "clavarium-docket": "0.1.1",
16
16
  "clavarium-parley": "0.17.11-next.1",
17
- "clavarium-tether": "0.1.0-next.11",
17
+ "clavarium-tether": "0.1.0-next.12",
18
18
  "mermaid": "11.17.2",
19
19
  "node-pty": "^1.1.0",
20
20
  "pdfjs-dist": "6.4.299",
@@ -755,9 +755,9 @@
755
755
  }
756
756
  },
757
757
  "node_modules/clavarium-tether": {
758
- "version": "0.1.0-next.11",
759
- "resolved": "https://registry.npmjs.org/clavarium-tether/-/clavarium-tether-0.1.0-next.11.tgz",
760
- "integrity": "sha512-GiLaCXmANy8OsiTacZIe5n+UUK+Lw33QzonZkU+vTVSx8X5g4fF4hzUkfRmpXWMDVWMuvTvptL/qIrJNbXJ9+Q==",
758
+ "version": "0.1.0-next.12",
759
+ "resolved": "https://registry.npmjs.org/clavarium-tether/-/clavarium-tether-0.1.0-next.12.tgz",
760
+ "integrity": "sha512-3lbTV27WEyVLEHze8xbsTzA9iBGv6VxPMIGY20zzpeCb9JGZ2rU7cq8sk7VcWyPpoqSnBh3SyvXqA3LoM0zYmA==",
761
761
  "license": "MIT",
762
762
  "bin": {
763
763
  "tether": "bin/cli.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.55-beta.1",
3
+ "version": "0.2.56-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.",
@@ -47,7 +47,7 @@
47
47
  "clavarium-binder": "0.1.8-next.1",
48
48
  "clavarium-docket": "0.1.1",
49
49
  "clavarium-parley": "0.17.11-next.1",
50
- "clavarium-tether": "0.1.0-next.11",
50
+ "clavarium-tether": "0.1.0-next.12",
51
51
  "mermaid": "11.17.2",
52
52
  "node-pty": "^1.1.0",
53
53
  "pdfjs-dist": "6.4.299",
@@ -10,12 +10,12 @@
10
10
  * instead the keeper reveals it to the connector alone, host-side, and acts on
11
11
  * the agent's behalf within the level and rules the person set.
12
12
  *
13
- * ONE ACCOUNT, ONE TOKEN, SEVERAL TARGETS. A Google consent for mail+calendar+
14
- * contacts yields a single refresh token; this makes one host-only secret and a
15
- * Tether target per kind, each naming that secret. Microsoft's Thunderbird client
16
- * carries only the mail scope here, so a Microsoft consent makes the mail target
17
- * alone (calendar and files over Graph need a deployment's own OAuth app, added
18
- * later as config.clientId + an own client secret).
13
+ * ONE ACCOUNT, ONE TOKEN, SEVERAL TARGETS. A consent for mail+calendar+contacts
14
+ * yields a single refresh token; this makes one host-only secret and a Tether
15
+ * target per kind, each naming that secret. Both providers borrow an open-source
16
+ * desktop client verified for all three: Google uses GNOME Online Accounts' over
17
+ * IMAP + CalDAV/CardDAV, Microsoft uses its Graph client (mail, calendar and
18
+ * contacts all over Microsoft Graph).
19
19
  *
20
20
  * A CREATED TARGET IS GIVEN TO NO ONE. The person grants it per conversation, at
21
21
  * its own level, from the page (Assets > Access) -- like git: one mailbox, many
@@ -42,7 +42,7 @@ const KIND = {
42
42
  contacts: { connector: 'contacts', kind: 'contacts', title: 'Contacts', needsUser: true },
43
43
  };
44
44
  /* What each provider's built-in (Thunderbird) client grants a refresh token for. */
45
- const SUPPORTED = { google: ['mail', 'calendar', 'contacts'], microsoft: ['mail'] };
45
+ const SUPPORTED = { google: ['mail', 'calendar', 'contacts'], microsoft: ['mail', 'calendar', 'contacts'] };
46
46
 
47
47
  const emailOk = (s) => /^[^\s@]{1,64}@[^\s@]{1,190}\.[^\s@]{2,}$/.test(s);
48
48
  /* A deterministic, valid secret name for an account's token: a short slug of the
package/server/oauth.mjs CHANGED
@@ -73,15 +73,17 @@ export const PROVIDERS = {
73
73
  pkce: true,
74
74
  consentExtra: {},
75
75
  offlineScope: 'offline_access',
76
- /* Mail (and SMTP) are outlook.office.com resources; calendar/files over
77
- Graph are a different resource and a separate token -- added when those
78
- connectors arrive, not mixed into one mail request. */
76
+ /* Microsoft over Graph: GNOME Online Accounts' client is a Graph client,
77
+ so mail, calendar and contacts all go through graph.microsoft.com (the
78
+ mail connector uses its Graph path for Microsoft). mail.send is needed
79
+ to send. GOA's client is verified for all of these. */
79
80
  scopes: {
80
- mail: 'https://outlook.office.com/IMAP.AccessAsUser.All',
81
- smtp: 'https://outlook.office.com/SMTP.Send',
81
+ mail: 'mail.readwrite mail.send',
82
+ calendar: 'calendars.readwrite',
83
+ contacts: 'contacts.readwrite',
82
84
  },
83
85
  thunderbird: {
84
- clientId: '9e5f94bc-e8a4-4e73-b8be-63364c29d753',
86
+ clientId: 'b155a604-3c31-4079-93b0-6bb6aa9d5464',
85
87
  clientSecret: null,
86
88
  },
87
89
  },
package/web/app.js CHANGED
@@ -6166,6 +6166,8 @@
6166
6166
  a live Connexion (dynamic connector, token kept on the server): this jumps
6167
6167
  straight to adding one. */
6168
6168
  const MAILBOX_PROVIDER = { google: 'Google', microsoft: 'Microsoft' };
6169
+ /* Which kinds each provider can be connected for (from the server). */
6170
+ let accountSupported = { google: ['mail', 'calendar', 'contacts'], microsoft: ['mail'] };
6169
6171
  $('mailbox-to-connexion').addEventListener('click', () => { assetsAdding = 'connexion'; void paintAssets(); });
6170
6172
  /* CONNECT AN ACCOUNT (Connexions): a live link through Tether. The person signs
6171
6173
  in in their own browser; the token is kept on the server, never in a machine.
@@ -6174,16 +6176,15 @@
6174
6176
  const form = $('connexion-new');
6175
6177
  form.dataset.provider = provider;
6176
6178
  for (const b of $('connexion-provider').querySelectorAll('button')) b.setAttribute('aria-pressed', String(b.dataset.provider === provider));
6177
- const google = provider === 'google';
6178
- for (const id of ['connexion-calendar', 'connexion-contacts']) { const c = $(id); if (!google) c.checked = false; c.disabled = !google; }
6179
- $('connexion-calendar-label').classList.toggle('off', !google);
6180
- $('connexion-contacts-label').classList.toggle('off', !google);
6179
+ const kinds = accountSupported[provider] ?? ['mail'];
6180
+ for (const [id, k] of [['connexion-calendar', 'calendar'], ['connexion-contacts', 'contacts']]) { const c = $(id); const ok = kinds.includes(k); if (!ok) c.checked = false; c.disabled = !ok; $(`${id}-label`).classList.toggle('off', !ok); }
6181
6181
  $('connexion-paste').hidden = true;
6182
6182
  $('connexion-error').hidden = true;
6183
6183
  const who = MAILBOX_PROVIDER[provider];
6184
- $('connexion-notice').textContent = google
6185
- ? "Clavarium signs in with GNOME Online Accounts' app — that is what Google sees. Mail, calendar and contacts can be connected together."
6186
- : 'Clavarium signs in as Thunderbird — that is what Microsoft sees. Mail for now; calendar and contacts are coming.';
6184
+ const all = kinds.includes('calendar') && kinds.includes('contacts');
6185
+ $('connexion-notice').textContent = provider === 'google'
6186
+ ? `Clavarium signs in with GNOME Online Accounts' app — that is what Google sees.${all ? ' Mail, calendar and contacts can be connected together.' : ''}`
6187
+ : `Clavarium signs in with GNOME Online Accounts' app — that is what Microsoft sees.${all ? ' Mail, calendar and contacts together, over Microsoft Graph.' : ''}`;
6187
6188
  $('connexion-open').textContent = `Open the ${who} sign-in page`;
6188
6189
  };
6189
6190
  for (const b of $('connexion-provider').querySelectorAll('button')) b.addEventListener('click', () => setConnexionProvider(b.dataset.provider));
@@ -6214,6 +6215,7 @@
6214
6215
  await paintAssets();
6215
6216
  });
6216
6217
  setConnexionProvider('google');
6218
+ getJson('/accounts', null).then((d) => { if (d?.supported) { accountSupported = d.supported; setConnexionProvider($('connexion-new').dataset.provider || 'google'); } });
6217
6219
  $('list-new').addEventListener('submit', async (event) => {
6218
6220
  event.preventDefault();
6219
6221
  $('assets-error').hidden = true;
package/web/style.css CHANGED
@@ -1122,8 +1122,10 @@ header .ic, #folders .ic { width: 18px; height: 18px; fill: none; stroke: curren
1122
1122
  .as-group-name { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; justify-content: flex-start; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 3px 6px; }
1123
1123
  .as-group-name:hover { border-color: var(--line); }
1124
1124
  .as-group-name[aria-current="true"] { background: var(--panel); border-color: var(--line); }
1125
- .as-gear { flex: 0 0 auto; width: 30px; height: 30px; min-width: 0 !important; min-height: 0 !important; padding: 0; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--ink2); font-size: 1rem; opacity: 0; }
1126
- .as-group-head:hover .as-gear, .as-group-name[aria-current="true"] + .as-gear { opacity: 1; }
1125
+ .as-gear { flex: 0 0 auto; width: 30px; height: 30px; min-width: 0 !important; min-height: 0 !important; padding: 0; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--ink2); font-size: 1rem; opacity: 1; }
1126
+ /* On a mouse, keep it quiet until the group is hovered or open; on touch (no
1127
+ hover) it must stay visible, or it can never be reached. */
1128
+ @media (hover: hover) { .as-gear { opacity: 0; } .as-group-head:hover .as-gear, .as-group-name[aria-current="true"] + .as-gear { opacity: 1; } }
1127
1129
  .as-gear:hover { border-color: var(--line); color: var(--ink); }
1128
1130
  .as-group-members { display: flex; flex-direction: column; gap: 2px; }
1129
1131
  /* Give the group: a block per conversation, a row per asset at its own level. */