clavarium 0.2.67-next.1 → 0.2.68-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.67-next.1",
3
+ "version": "0.2.68-next.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.67-next.1",
9
+ "version": "0.2.68-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.67-next.1",
3
+ "version": "0.2.68-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.",
package/server/main.mjs CHANGED
@@ -504,7 +504,7 @@ export async function startHome({ port, host, dataDir, mntDir = dataDir, gitRese
504
504
  /* Settings, Updates: what the updater (deploy/updater.mjs, as root) wrote, and how to ask it. */
505
505
  const updates = new Updates({ host: asHost, version: platform.version, store: new Store(`${dataDir}/updates.json`), alerts, ...(updateState ? { stateFile: updateState } : {}), ...(updateConf ? { confFile: updateConf } : {}) });
506
506
  const stopUpdates = updates.watch();
507
- const setup = new Setup({ store: new Store(`${dataDir}/flows.json`), version: platform.version, conversations: all, resources: folders, secrets, devices, shortcuts, wakeups, answerer, talk, gitKeeper, gitAccess, mailboxes, signin, network, guide, ...(setupPollMs ? { pollMs: setupPollMs } : {}) });
507
+ const setup = new Setup({ store: new Store(`${dataDir}/flows.json`), version: platform.version, conversations: all, resources: folders, secrets, devices, shortcuts, wakeups, answerer, talk, gitKeeper, gitAccess, mailboxes, signin, network, guide, tethers, ...(setupPollMs ? { pollMs: setupPollMs } : {}) });
508
508
  /* This server's disk and memory, and the reserve no machine may eat into: see capacity.mjs. */
509
509
  const capacity = new Capacity({ run: asHost, store: new Store(`${dataDir}/server.json`), conversations: all, shelf, ...(serverRoomMs === undefined ? {} : { roomMs: serverRoomMs }),
510
510
  /* Under the reserve: the machine that takes the most put to sleep, the owner told, and its chat. */
package/server/setup.mjs CHANGED
@@ -300,6 +300,17 @@ export class Setup {
300
300
  nodes.push({ id: `secret:${s.name}`, kind: 'secret', name: s.name, sub: 'secret' });
301
301
  for (const c of s.conversations) links.push({ from: `conversation:${c}`, to: `secret:${s.name}`, rights: 'x' });
302
302
  }
303
+ /* Live Tether connexions, shown like any asset: a mailbox among mailboxes, a
304
+ calendar, an address book -- with the conversations they were given to. */
305
+ const TCAT = { mail: 'mailbox', calendar: 'agenda', contacts: 'contacts' };
306
+ for (const t of p.tethers?.store?.().targets() ?? []) {
307
+ const kind = TCAT[t.kind] ?? 'mailbox';
308
+ nodes.push({ id: `connexion:${t.id}`, kind, name: t.title, sub: `${t.kind} (live)`, tether: true, record: t });
309
+ for (const [agent, grant] of Object.entries(t.grants ?? {})) {
310
+ if (!agent.startsWith('conversation:')) continue;
311
+ links.push({ from: agent, to: `connexion:${t.id}`, rights: grant?.level === 'watch' ? 'r' : 'rw' });
312
+ }
313
+ }
303
314
  const labels = new Set();
304
315
  for (const d of devices) {
305
316
  nodes.push({ id: `device:${d.id}`, kind: 'device', name: d.label, sub: 'paired' });
package/web/links.js CHANGED
@@ -24,7 +24,7 @@
24
24
  (() => {
25
25
  const SVG = 'http://www.w3.org/2000/svg';
26
26
  /* Each kind's icon, from the set of the chat (Lucide, see icons.js): the same drawing on every screen, whatever its fonts. */
27
- const KIND_ICON = { device: 'smartphone', conversation: 'square-terminal', folder: 'folder', git: 'git-branch', mailbox: 'mail', secret: 'key-round' };
27
+ const KIND_ICON = { device: 'smartphone', conversation: 'square-terminal', folder: 'folder', git: 'git-branch', mailbox: 'mail', agenda: 'calendar', contacts: 'users', secret: 'key-round' };
28
28
  /* An icon of that set, or, until it is there, nothing in its place. */
29
29
  const ic = (name, cls = 'lk-svg') => window.clavariumIcons?.icon(name, cls) ?? null;
30
30
  const kindIcon = (kind) => h('span', { class: 'lk-ic', 'aria-hidden': 'true' }, ic(KIND_ICON[kind]));
@@ -112,14 +112,19 @@
112
112
  return j;
113
113
  }
114
114
  /* A link given or changed. `rights` as grants.mjs writes them. */
115
+ /* A live Tether connexion is given to a conversation at a level; the map gives
116
+ it at "watch" (read only) and sends finer levels to Assets. */
117
+ const tetherId = (b) => b.record?.id ?? b.id.replace(/^connexion:/, '');
115
118
  async function give(l, rights, extra = {}) {
116
119
  const a = node(l.from); const b = node(l.to);
120
+ if (b.tether) return request('/tether/level', { target: tetherId(b), agent: `conversation:${a.name}`, level: rights.includes('w') ? 'free' : 'watch' });
117
121
  if (a.kind === 'device') return request(`/devices/${nameOf(a.id)}/give`, { asset: b.id, rights });
118
122
  if (b.kind === 'secret') return request(`/conversations/${encodeURIComponent(a.name)}/secrets`, { secret: b.name, attached: true });
119
123
  return request(`/conversations/${encodeURIComponent(a.name)}/resources`, { resource: b.name, access: rights.includes('w') ? 'write' : 'read', ...extra });
120
124
  }
121
125
  async function takeAway(l) {
122
126
  const a = node(l.from); const b = node(l.to);
127
+ if (b.tether) return request('/tether/level', { target: tetherId(b), agent: `conversation:${a.name}`, level: 'none' });
123
128
  if (a.kind === 'device') return request(`/devices/${nameOf(a.id)}/take`, { asset: b.id });
124
129
  if (b.kind === 'secret') return request(`/conversations/${encodeURIComponent(a.name)}/secrets`, { secret: b.name, attached: false });
125
130
  return request(`/conversations/${encodeURIComponent(a.name)}/resources`, { resource: b.name, access: 'none' });
@@ -582,6 +587,7 @@
582
587
  const a = node(l.from); const b = node(l.to);
583
588
  if (b.kind === 'conversation') return { type: 'parts' };
584
589
  if (b.kind === 'secret') return { type: 'fixed', text: 'Use: handed to its tool as a variable and a file, the next time it starts.' };
590
+ if (b.tether) return { type: 'fixed', text: 'Given at a level (watch / propose / frame / free). Set the level in Assets.' };
585
591
  if (b.kind === 'mailbox') return { type: 'fixed', text: 'Read only: a mailbox is never written here.' };
586
592
  return { type: 'levels', write: b.kind === 'git' && a.kind === 'conversation' ? 'Commits; sending stays under your rules' : 'Add, change, delete' };
587
593
  }