clavarium 0.2.135-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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.135-next.1",
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.135-next.1",
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.33",
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.33",
759
- "resolved": "https://registry.npmjs.org/clavarium-tether/-/clavarium-tether-0.1.0-next.33.tgz",
760
- "integrity": "sha512-gcXJ1H1fYaAg5/JrXKG/yeV0RH4zNS/uUPPXPK0wLpRR0T0aHq34ZitciDoG5ZxOVRze423kTP84gVtLd3nXVw==",
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.135-next.1",
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.33",
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
@@ -4480,6 +4480,23 @@
4480
4480
  };
4481
4481
  draw(Array.isArray(t.config?.authorizedKinds) ? t.config.authorizedKinds : null);
4482
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
+ }
4483
4500
  if (chosen.siblings?.length) {
4484
4501
  const a = el('p', 'as-assoc hint');
4485
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
@@ -1940,3 +1940,5 @@ details.commit > pre { margin: 6px 0 0 1.6em; white-space: pre-wrap; overflow-wr
1940
1940
  .dm-acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
1941
1941
  .dm-acts .dm-dots { padding-inline: .7em; }
1942
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; }