clavarium 0.2.63-next.1 → 0.2.64-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.
- package/npm-shrinkwrap.json +6 -6
- package/package.json +2 -2
- package/server/secrets.mjs +5 -3
- package/web/app.js +5 -44
- package/web/index.html +9 -25
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.64-next.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "clavarium",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.64-next.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.9-next.1",
|
|
17
|
-
"clavarium-tether": "0.1.0-next.
|
|
17
|
+
"clavarium-tether": "0.1.0-next.6",
|
|
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.
|
|
759
|
-
"resolved": "https://registry.npmjs.org/clavarium-tether/-/clavarium-tether-0.1.0-next.
|
|
760
|
-
"integrity": "sha512-
|
|
758
|
+
"version": "0.1.0-next.6",
|
|
759
|
+
"resolved": "https://registry.npmjs.org/clavarium-tether/-/clavarium-tether-0.1.0-next.6.tgz",
|
|
760
|
+
"integrity": "sha512-5pdFLoc9QTfFab4ZJUz+0x28UtnljvaS3KgKZnYagSfQxiS8Oq3IxrJd0IfIr5ms77DkHgIILBAJCoV5+F7shg==",
|
|
761
761
|
"license": "MIT",
|
|
762
762
|
"dependencies": {
|
|
763
763
|
"ssh2": "1.17.0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.64-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.",
|
|
@@ -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.9-next.1",
|
|
50
|
-
"clavarium-tether": "0.1.0-next.
|
|
50
|
+
"clavarium-tether": "0.1.0-next.6",
|
|
51
51
|
"mermaid": "11.17.2",
|
|
52
52
|
"node-pty": "^1.1.0",
|
|
53
53
|
"pdfjs-dist": "6.4.299",
|
package/server/secrets.mjs
CHANGED
|
@@ -105,9 +105,11 @@ export class Secrets {
|
|
|
105
105
|
#given(conversation) { return this.#store.all().filter((s) => this.#handed(conversation, s.name) && !this.#expired(s)); }
|
|
106
106
|
|
|
107
107
|
/* Names, where they are attached, the expiry. Never a value. `days`: whole
|
|
108
|
-
days left (null without an expiry); `expired`: no longer delivered.
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
days left (null without an expiry); `expired`: no longer delivered. A
|
|
109
|
+
host-only secret (an account token the server holds) is left out -- it is
|
|
110
|
+
never given to a machine, so the page never lists it; `held` includes it. */
|
|
111
|
+
list({ held = false } = {}) {
|
|
112
|
+
return this.#store.all().filter((s) => held || !s.hostOnly).map((s) => ({ name: s.name, conversations: this.#users(s.name), createdAt: s.createdAt,
|
|
111
113
|
expires: s.expires ?? null, days: s.expires ? daysTo(s.expires, this.#now()) : null, expired: this.#expired(s), ...(s.hostOnly ? { hostOnly: true } : {}),
|
|
112
114
|
...(s.ephemeral ? { ephemeral: true, expiresAt: s.expiresAt, expiresInMs: Math.max(0, Date.parse(s.expiresAt) - this.#now().getTime()) } : {}) }));
|
|
113
115
|
}
|
package/web/app.js
CHANGED
|
@@ -3195,7 +3195,7 @@
|
|
|
3195
3195
|
if (mine.length === 0 && !add) continue;
|
|
3196
3196
|
const section = el('section', 'as-kind'); section.dataset.kind = kind;
|
|
3197
3197
|
const head = el('div', 'as-kind-head'); head.append(el('h3', '', title));
|
|
3198
|
-
if (add) head.append(roundPlus(`Add ${{ git: 'a repository', folder: 'a folder', mailbox: 'a mailbox', secret: 'a secret', list: LISTS_WORD.a }[kind]}`, () => add(kind)));
|
|
3198
|
+
if (add) head.append(roundPlus(`Add ${{ git: 'a repository', folder: 'a folder', mailbox: 'a mailbox', connexion: 'a connexion', secret: 'a secret', list: LISTS_WORD.a }[kind]}`, () => add(kind)));
|
|
3199
3199
|
section.append(head);
|
|
3200
3200
|
if (mine.length === 0) section.append(el('p', 'hint as-none', 'None yet'));
|
|
3201
3201
|
for (const item of mine) {
|
|
@@ -5909,7 +5909,6 @@
|
|
|
5909
5909
|
|
|
5910
5910
|
$('mailbox-new').addEventListener('submit', async (event) => {
|
|
5911
5911
|
event.preventDefault();
|
|
5912
|
-
if ($('mailbox-new').dataset.provider !== 'imap') return;
|
|
5913
5912
|
$('mailbox-error').hidden = true;
|
|
5914
5913
|
const button = $('mailbox-new').querySelector('button[type=submit]');
|
|
5915
5914
|
button.disabled = true; button.textContent = 'Reading the mailbox...';
|
|
@@ -5920,49 +5919,11 @@
|
|
|
5920
5919
|
button.disabled = false; button.textContent = 'Add';
|
|
5921
5920
|
await paintAssets();
|
|
5922
5921
|
});
|
|
5923
|
-
/*
|
|
5924
|
-
|
|
5925
|
-
|
|
5922
|
+
/* New mailbox is now the classic IMAP file-copy alone. Gmail and Microsoft are
|
|
5923
|
+
a live Connexion (dynamic connector, token kept on the server): this jumps
|
|
5924
|
+
straight to adding one. */
|
|
5926
5925
|
const MAILBOX_PROVIDER = { google: 'Google', microsoft: 'Microsoft' };
|
|
5927
|
-
|
|
5928
|
-
const form = $('mailbox-new');
|
|
5929
|
-
form.dataset.provider = provider;
|
|
5930
|
-
for (const b of $('mailbox-provider').querySelectorAll('button')) b.setAttribute('aria-pressed', String(b.dataset.provider === provider));
|
|
5931
|
-
const oauth = provider !== 'imap';
|
|
5932
|
-
form.querySelector('.mailbox-imap').hidden = oauth;
|
|
5933
|
-
form.querySelector('.mailbox-oauth').hidden = !oauth;
|
|
5934
|
-
$('mailbox-paste').hidden = true;
|
|
5935
|
-
$('mailbox-error').hidden = true;
|
|
5936
|
-
if (oauth) {
|
|
5937
|
-
const who = MAILBOX_PROVIDER[provider];
|
|
5938
|
-
$('mailbox-notice').textContent = `Clavarium signs in as Thunderbird — that is what ${who} will see. You sign in in your own browser; Clavarium never sees your password.`;
|
|
5939
|
-
$('mailbox-open').textContent = `Open the ${who} sign-in page`;
|
|
5940
|
-
$('mailbox-email').placeholder = provider === 'google' ? 'your Gmail address' : 'your Microsoft address';
|
|
5941
|
-
}
|
|
5942
|
-
};
|
|
5943
|
-
for (const b of $('mailbox-provider').querySelectorAll('button')) b.addEventListener('click', () => setMailboxProvider(b.dataset.provider));
|
|
5944
|
-
$('mailbox-open').addEventListener('click', async () => {
|
|
5945
|
-
$('mailbox-error').hidden = true;
|
|
5946
|
-
const btn = $('mailbox-open'); btn.disabled = true;
|
|
5947
|
-
try {
|
|
5948
|
-
const { url } = await post(`${API}/mailboxes/consent`, { name: $('mailbox-name').value.trim(), provider: $('mailbox-new').dataset.provider, user: $('mailbox-email').value.trim() });
|
|
5949
|
-
window.open(url, '_blank', 'noopener');
|
|
5950
|
-
$('mailbox-paste').hidden = false;
|
|
5951
|
-
$('mailbox-code').focus();
|
|
5952
|
-
} catch (error) { $('mailbox-error').textContent = error.message; $('mailbox-error').hidden = false; }
|
|
5953
|
-
btn.disabled = false;
|
|
5954
|
-
});
|
|
5955
|
-
$('mailbox-connect').addEventListener('click', async () => {
|
|
5956
|
-
$('mailbox-error').hidden = true;
|
|
5957
|
-
const btn = $('mailbox-connect'); const was = btn.textContent; btn.disabled = true; btn.textContent = 'Connecting...';
|
|
5958
|
-
try {
|
|
5959
|
-
await post(`${API}/mailboxes/connect`, { redirected: $('mailbox-code').value.trim() });
|
|
5960
|
-
assetOpen = `mailbox:${$('mailbox-name').value.trim()}`; assetsAdding = '';
|
|
5961
|
-
$('mailbox-new').reset(); setMailboxProvider('imap');
|
|
5962
|
-
} catch (error) { $('mailbox-error').textContent = error.message; $('mailbox-error').hidden = false; }
|
|
5963
|
-
btn.disabled = false; btn.textContent = was;
|
|
5964
|
-
await paintAssets();
|
|
5965
|
-
});
|
|
5926
|
+
$('mailbox-to-connexion').addEventListener('click', () => { assetsAdding = 'connexion'; void paintAssets(); });
|
|
5966
5927
|
/* CONNECT AN ACCOUNT (Connexions): a live link through Tether. The person signs
|
|
5967
5928
|
in in their own browser; the token is kept on the server, never in a machine.
|
|
5968
5929
|
Google covers mail+calendar+contacts in one go; Microsoft, mail only here. */
|
package/web/index.html
CHANGED
|
@@ -515,34 +515,18 @@
|
|
|
515
515
|
<p id="git-keys-empty" class="hint">No key yet: "New key" in Add a repository makes one.</p>
|
|
516
516
|
</div>
|
|
517
517
|
<div id="mailbox-box" class="as-form" data-kind="mailbox"><h3>New mailbox</h3>
|
|
518
|
-
<div class="hint">
|
|
518
|
+
<div class="hint">A classic IMAP mailbox, its recent messages copied as files, read only. <details class="more"><summary>Before attaching it</summary><span>Kept up to date in a folder a conversation can read and never write. The mailbox itself is never changed. Mail is written by strangers: attach it only where the tool may read what anyone can send you.</span></details></div>
|
|
519
|
+
<p class="hint mailbox-to-cnx">Gmail or Microsoft? Connect a live link instead — the agent reads and writes within the rights you give, and the account's token stays on the server. <button type="button" id="mailbox-to-connexion" class="as-link">Add a connexion</button></p>
|
|
519
520
|
<form id="mailbox-new" autocomplete="off" data-provider="imap">
|
|
520
521
|
<label for="mailbox-name">Folder name</label>
|
|
521
522
|
<input id="mailbox-name" maxlength="32" pattern="[a-z]([a-z0-9-]{0,30}[a-z0-9])?" placeholder="inbox" spellcheck="false" autocapitalize="off" required>
|
|
522
|
-
<
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
</
|
|
527
|
-
<div class="mailbox-
|
|
528
|
-
<
|
|
529
|
-
<div class="row"><input id="mailbox-host" placeholder="imap.example.com" spellcheck="false" autocapitalize="off"><input id="mailbox-port" inputmode="numeric" placeholder="993" aria-label="Port" size="5"></div>
|
|
530
|
-
<label for="mailbox-user">User</label>
|
|
531
|
-
<input id="mailbox-user" spellcheck="false" autocapitalize="off" autocomplete="off">
|
|
532
|
-
<label for="mailbox-password">Password</label>
|
|
533
|
-
<div class="row"><input id="mailbox-password" type="password" autocomplete="new-password">
|
|
534
|
-
<button type="submit" class="primary">Add</button></div>
|
|
535
|
-
</div>
|
|
536
|
-
<div class="mailbox-oauth" hidden>
|
|
537
|
-
<label for="mailbox-email">Email address</label>
|
|
538
|
-
<input id="mailbox-email" type="email" spellcheck="false" autocapitalize="off" autocomplete="off" placeholder="your email address">
|
|
539
|
-
<p class="hint" id="mailbox-notice"></p>
|
|
540
|
-
<div class="row"><button type="button" id="mailbox-open" class="primary">Open the sign-in page</button></div>
|
|
541
|
-
<div id="mailbox-paste" hidden>
|
|
542
|
-
<label for="mailbox-code">After you allow, the page will not load — copy its full address and paste it here</label>
|
|
543
|
-
<div class="row"><input id="mailbox-code" spellcheck="false" autocapitalize="off" placeholder="http://127.0.0.1..."><button type="button" id="mailbox-connect" class="primary">Connect</button></div>
|
|
544
|
-
</div>
|
|
545
|
-
</div>
|
|
523
|
+
<label for="mailbox-host">Mail server (IMAP, TLS)</label>
|
|
524
|
+
<div class="row"><input id="mailbox-host" placeholder="imap.example.com" spellcheck="false" autocapitalize="off"><input id="mailbox-port" inputmode="numeric" placeholder="993" aria-label="Port" size="5"></div>
|
|
525
|
+
<label for="mailbox-user">User</label>
|
|
526
|
+
<input id="mailbox-user" spellcheck="false" autocapitalize="off" autocomplete="off">
|
|
527
|
+
<label for="mailbox-password">Password</label>
|
|
528
|
+
<div class="row"><input id="mailbox-password" type="password" autocomplete="new-password">
|
|
529
|
+
<button type="submit" class="primary">Add</button></div>
|
|
546
530
|
<p id="mailbox-error" class="error" role="alert" hidden></p>
|
|
547
531
|
</form>
|
|
548
532
|
</div>
|