clavarium 0.2.134-next.1 → 0.2.136-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/api.mjs +10 -0
- package/web/app.js +19 -1
- package/web/style.css +7 -3
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.136-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.136-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.41-next.1",
|
|
15
15
|
"clavarium-docket": "0.1.1",
|
|
16
16
|
"clavarium-parley": "0.17.20-next.1",
|
|
17
|
-
"clavarium-tether": "0.1.0-next.
|
|
17
|
+
"clavarium-tether": "0.1.0-next.34",
|
|
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.34",
|
|
759
|
+
"resolved": "https://registry.npmjs.org/clavarium-tether/-/clavarium-tether-0.1.0-next.34.tgz",
|
|
760
|
+
"integrity": "sha512-6AOHSkdeHE+K5W9NK3q282Hwx9QcETaxNAJb6rDyrEa8ddAHKjKkokJDsAYB/xjRI8Z0txl8GpQb0f4sfFC43Q==",
|
|
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.
|
|
3
|
+
"version": "0.2.136-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.41-next.1",
|
|
48
48
|
"clavarium-docket": "0.1.1",
|
|
49
49
|
"clavarium-parley": "0.17.20-next.1",
|
|
50
|
-
"clavarium-tether": "0.1.0-next.
|
|
50
|
+
"clavarium-tether": "0.1.0-next.34",
|
|
51
51
|
"mermaid": "11.17.2",
|
|
52
52
|
"node-pty": "^1.1.0",
|
|
53
53
|
"pdfjs-dist": "6.4.299",
|
package/server/api.mjs
CHANGED
|
@@ -443,6 +443,16 @@ export async function handleApi(request, response, conversations, headers, resou
|
|
|
443
443
|
keeper runs as the owner (person), never as an agent. */
|
|
444
444
|
const tetherOp = /^\/api\/tether\/(level|allow|unallow|decide|remove-target|stop|resume)$/.exec(pathname);
|
|
445
445
|
if (tetherOp && tethers) { const r = await tethers.act(tetherOp[1], body, ''); if (!r.ok) throw new Refusal(400, r.text); return send(200, r.data ?? { ok: true }), true; }
|
|
446
|
+
/* A mailbox's signature (Markdown), added under what the agent sends from it. */
|
|
447
|
+
if (pathname === '/api/tether/signature' && tethers) {
|
|
448
|
+
const t = tethers.store().target(String(body.target ?? ''));
|
|
449
|
+
if (!t || t.kind !== 'mail') throw new Refusal(404, 'No such mailbox.');
|
|
450
|
+
const signature = String(body.signature ?? '').replace(/\r\n?/g, '\n').trim();
|
|
451
|
+
if (signature.length > 2000) throw new Refusal(400, 'A signature is 2000 characters at most.');
|
|
452
|
+
const { signature: _old, ...config } = t.config ?? {};
|
|
453
|
+
tethers.store().putTarget({ ...t, config: signature ? { ...config, signature } : config });
|
|
454
|
+
return send(200, { ok: true, signature }), true;
|
|
455
|
+
}
|
|
446
456
|
if (pathname === '/api/shortcuts' && shortcuts) return send(201, shortcuts.add(body)), true;
|
|
447
457
|
if (pathname === '/api/secrets' && secrets) { const made = secrets.set(body); setup?.secretAdded(made.name); return send(201, made), true; }
|
|
448
458
|
/* Asset groups (groups.mjs): a folder-style tidy-up, not a right. */
|
package/web/app.js
CHANGED
|
@@ -4221,7 +4221,8 @@
|
|
|
4221
4221
|
if (c.bcc?.length) w.facts.push(['bcc', chips(c.bcc, ext)]);
|
|
4222
4222
|
if (c.at) w.facts.push(['⏰', `Leaves ${dayWords(c.at)}${hhmm(c.at) ? `, ${hhmm(c.at)}` : ''} — waits in Drafts until then`]);
|
|
4223
4223
|
if (c.files?.length) w.facts.push(['📎', `Joined: ${filesLine(c.files)}`]);
|
|
4224
|
-
|
|
4224
|
+
/* The body as it will read: the Markdown marks taken off. */
|
|
4225
|
+
if (c.body) w.quote = c.body.replace(/\*\*(\S[^*\n]*?)\*\*/g, '$1').replace(/__(\S[^_\n]*?)__/g, '$1').replace(/(^|[^*\w])\*(\S[^*\n]*?)\*(?!\w)/g, '$1$2').replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g, '$1 ($2)').replace(/^#{1,6}\s+/gm, '');
|
|
4225
4226
|
} else if (c.kind === 'calendar') {
|
|
4226
4227
|
const ev = c.action === 'create' ? c : { ...about, ...Object.fromEntries(Object.entries(c).filter(([k]) => ['title', 'start', 'end', 'where'].includes(k))) };
|
|
4227
4228
|
const answer = { accept: 'Accept', yes: 'Accept', decline: 'Decline', no: 'Decline', refuse: 'Decline', tentative: 'Maybe', maybe: 'Maybe' }[String(c.answer ?? '').toLowerCase()] ?? '';
|
|
@@ -4479,6 +4480,23 @@
|
|
|
4479
4480
|
};
|
|
4480
4481
|
draw(Array.isArray(t.config?.authorizedKinds) ? t.config.authorizedKinds : null);
|
|
4481
4482
|
}
|
|
4483
|
+
/* A mailbox: its signature, in Markdown, added under what the agent sends. */
|
|
4484
|
+
if (t.kind === 'mail') {
|
|
4485
|
+
const box = el('div', 'as-signature');
|
|
4486
|
+
const lab = el('label', '', 'Signature'); lab.htmlFor = `sig-${t.id}`;
|
|
4487
|
+
const ta = document.createElement('textarea'); ta.id = `sig-${t.id}`; ta.rows = 3; ta.value = t.config?.signature ?? ''; ta.placeholder = 'Added under every mail the agent sends from this mailbox (Markdown: **bold**, links…)';
|
|
4488
|
+
const save = el('button', '', 'Save'); save.type = 'button';
|
|
4489
|
+
const said = el('small', 'hint', '');
|
|
4490
|
+
save.addEventListener('click', async () => {
|
|
4491
|
+
save.disabled = true;
|
|
4492
|
+
try { await post(`${API}/tether/signature`, { target: t.id, signature: ta.value }); said.textContent = ta.value.trim() ? 'Saved.' : 'Removed.'; t.config = { ...(t.config ?? {}), signature: ta.value.trim() }; }
|
|
4493
|
+
catch (e) { said.textContent = e.message; }
|
|
4494
|
+
save.disabled = false;
|
|
4495
|
+
});
|
|
4496
|
+
const row = el('div', 'row'); row.append(save, said);
|
|
4497
|
+
box.append(lab, ta, row);
|
|
4498
|
+
detail.append(box);
|
|
4499
|
+
}
|
|
4482
4500
|
if (chosen.siblings?.length) {
|
|
4483
4501
|
const a = el('p', 'as-assoc hint');
|
|
4484
4502
|
a.append(el('b', '', 'Linked'), document.createTextNode(` to the same account: ${chosen.siblings.join(', ')}. They share the account's sign-in (kept on the server); rights are given separately.`));
|
package/web/style.css
CHANGED
|
@@ -1912,8 +1912,10 @@ details.commit > pre { margin: 6px 0 0 1.6em; white-space: pre-wrap; overflow-wr
|
|
|
1912
1912
|
.curve-legend-oom { color: var(--danger); }
|
|
1913
1913
|
|
|
1914
1914
|
/* A request of the AI as a card (#190). */
|
|
1915
|
-
.dm-card { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 12px; cursor: pointer; position: relative; }
|
|
1916
|
-
.dm-
|
|
1915
|
+
.dm-card.given-row { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 6px; padding: 10px 12px; cursor: pointer; position: relative; text-align: left; }
|
|
1916
|
+
.dm-card > * { align-self: stretch; text-align: left; }
|
|
1917
|
+
.dm-card > .dm-risk, .dm-card > .dm-acts { align-self: stretch; }
|
|
1918
|
+
.dm-top { display: flex; justify-content: flex-start; gap: 8px; align-items: center; font-size: .82rem; color: var(--ink2); }
|
|
1917
1919
|
.dm-ico { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: rgba(127,127,127,.15); font-size: .8rem; flex: none; }
|
|
1918
1920
|
.dm-chev { margin-left: auto; font-size: 1.2rem; line-height: 1; transition: transform .15s; }
|
|
1919
1921
|
.dm-card.open .dm-chev { transform: rotate(90deg); }
|
|
@@ -1925,7 +1927,7 @@ details.commit > pre { margin: 6px 0 0 1.6em; white-space: pre-wrap; overflow-wr
|
|
|
1925
1927
|
.dm-day-w { background: var(--brass); color: #fff; font-size: .66rem; font-weight: 700; letter-spacing: .06em; padding: 1px 0; }
|
|
1926
1928
|
.dm-day-n { font-size: 1.15rem; font-weight: 700; padding: 1px 0 3px; }
|
|
1927
1929
|
.dm-risk { padding: 5px 9px; border-radius: 8px; background: rgba(217, 154, 30, .16); color: inherit; font-size: .86rem; font-weight: 600; }
|
|
1928
|
-
.dm-facts { display: grid; grid-template-columns: 1.6em 1fr; gap: 3px 6px; font-size: .9rem; }
|
|
1930
|
+
.dm-facts { display: grid; justify-content: start; justify-items: start; grid-template-columns: 1.6em minmax(0, 1fr); gap: 3px 6px; font-size: .9rem; }
|
|
1929
1931
|
.dm-k { color: var(--ink2); text-align: center; }
|
|
1930
1932
|
.dm-v { min-width: 0; overflow-wrap: anywhere; }
|
|
1931
1933
|
.dm-chips { display: inline-flex; flex-wrap: wrap; gap: 3px; }
|
|
@@ -1938,3 +1940,5 @@ details.commit > pre { margin: 6px 0 0 1.6em; white-space: pre-wrap; overflow-wr
|
|
|
1938
1940
|
.dm-acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
|
|
1939
1941
|
.dm-acts .dm-dots { padding-inline: .7em; }
|
|
1940
1942
|
.dm-undo { display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: .9rem; padding: 4px 0; }
|
|
1943
|
+
.as-signature { display: flex; flex-direction: column; gap: 6px; margin: .6rem 0; }
|
|
1944
|
+
.as-signature textarea { width: 100%; font: inherit; }
|