clavarium 0.2.24-next.7 → 0.2.25-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,19 +1,19 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.24-next.7",
3
+ "version": "0.2.25-next.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.24-next.7",
9
+ "version": "0.2.25-next.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
13
13
  "@xterm/xterm": "^6.0.0",
14
- "clavarium-binder": "0.1.1",
14
+ "clavarium-binder": "0.1.2-next.2",
15
15
  "clavarium-docket": "0.1.1",
16
- "clavarium-parley": "0.15.0",
16
+ "clavarium-parley": "0.16.0-next.1",
17
17
  "mermaid": "11.17.2",
18
18
  "node-pty": "^1.1.0",
19
19
  "pdfjs-dist": "6.4.299",
@@ -688,9 +688,9 @@
688
688
  }
689
689
  },
690
690
  "node_modules/clavarium-binder": {
691
- "version": "0.1.1",
692
- "resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.1.tgz",
693
- "integrity": "sha512-9osufAKNzKUcE6CEQBgJn/frYp6qdjwRYRCy3Fn/zIyQVOb/F/mr4r/WmymMy+knUCeTzwGZjWHD5WIpPMQz7A==",
691
+ "version": "0.1.2-next.2",
692
+ "resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.2-next.2.tgz",
693
+ "integrity": "sha512-lYYwLYs3UAr0taHkhfrHpJ4AN+l5T6AnDIh6hCoO+bLjicQRbt5yA7HVDSERoOqUMMzWCg3CcGkgRXFWUBzB9w==",
694
694
  "license": "MIT",
695
695
  "bin": {
696
696
  "binder": "bin/binder.mjs",
@@ -714,9 +714,9 @@
714
714
  }
715
715
  },
716
716
  "node_modules/clavarium-parley": {
717
- "version": "0.15.0",
718
- "resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.15.0.tgz",
719
- "integrity": "sha512-PPU5EI+A28w1jq1hlm1SfYWa2v4flfINsfUmQvyzC2zg9L9jf9kkrr/3WhCJYrpg97kIZcp8fPz/DZdxPkUx1g==",
717
+ "version": "0.16.0-next.1",
718
+ "resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.16.0-next.1.tgz",
719
+ "integrity": "sha512-oqNm28LJo5HZ8d1tCUTUblQZr+tSA6OjVJjWEZpZ7ue32XEf6F8MeeWUVIeahsXNqSvYLMW69w89fCnphGrYTA==",
720
720
  "license": "MIT",
721
721
  "bin": {
722
722
  "parley": "bin/parley.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.24-next.7",
3
+ "version": "0.2.25-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.",
@@ -44,9 +44,9 @@
44
44
  "dependencies": {
45
45
  "@xterm/addon-fit": "^0.11.0",
46
46
  "@xterm/xterm": "^6.0.0",
47
- "clavarium-binder": "0.1.1",
47
+ "clavarium-binder": "0.1.2-next.2",
48
48
  "clavarium-docket": "0.1.1",
49
- "clavarium-parley": "0.15.0",
49
+ "clavarium-parley": "0.16.0-next.1",
50
50
  "mermaid": "11.17.2",
51
51
  "node-pty": "^1.1.0",
52
52
  "pdfjs-dist": "6.4.299",
package/server/guide.mjs CHANGED
@@ -125,6 +125,8 @@ export function ownText({ name, tool, workKept, resources = [], chat, online, se
125
125
  if (chat) out.push('- What wakes you (a file arrived, the clock, a call) waits in your docket: when told "run docket", run it, do each, then docket done ID or docket failed ID "why". To be reminded later: docket remind --at "2026-10-23 09:00" (or --in 2h, --cron "0 9 * * 1") "what for". docket --help says all.');
126
126
  /* Its lists (binders.mjs): kept on the server, asked for through .binder; a person approves. */
127
127
  out.push('- Lists kept with the person (batches, tasks, customers...): binder shows those you were given; add, note, attach, move them; a gate waits for the person\'s tick. binder --help says all.');
128
+ /* Its binder of batches is shown beside the chat (web/app.js): the person ticks there. */
129
+ if (chat) out.push('- When you work in batches: keep them in a binder of batches, shown beside the chat. None yet: make it once (binder new batches; MCP: new-list, template batches). Then one card each (binder add Batches "title"), kept up to date; start only those the person ticked.');
128
130
  out.push(online === false ? '- Internet: off.' : '- Internet: on.');
129
131
  if (secrets.length) out.push(`- Secrets given, by name only: ${list(secrets.map((s) => plain(s, 40)))}.`);
130
132
  const own = lines.map((l) => plain(l)).filter(Boolean).slice(0, LINES_MAX);
package/web/app.js CHANGED
@@ -2502,6 +2502,60 @@
2502
2502
  });
2503
2503
  const replies = await loadReplies();
2504
2504
  if (thread && threadOf === name) thread.replies = replies;
2505
+ if (!DEVICE) { tasksChanges = -1; void paintTasks(name); watchTasks(); }
2506
+ }
2507
+ /* ITS BATCHES, BESIDE ITS CHAT: Parley's panel, fed from the binder of batches given to
2508
+ this conversation (Binder's "batches" template). Its tool keeps them there (binder); the
2509
+ owner ticks those it may start (Binder's approval), and a click opens the card in its Binders
2510
+ tab. No such binder: no panel, no button. Folded or not: kept per conversation. */
2511
+ const TASKS_TEMPLATE = 'batches';
2512
+ const TASKS_TONE = { doing: 'active', yours: 'attention' };
2513
+ let tasksTimer = null; let tasksChanges = -1;
2514
+ const tasksFolded = (name) => { try { const v = JSON.parse(localStorage.getItem('clavarium-tasks-folded') ?? '{}')[name]; return typeof v === 'boolean' ? v : null; } catch { return null; } };
2515
+ const keepTasksFolded = (name, on) => { try { const all = JSON.parse(localStorage.getItem('clavarium-tasks-folded') ?? '{}'); all[name] = on; localStorage.setItem('clavarium-tasks-folded', JSON.stringify(all)); } catch { /* a private window */ } };
2516
+ /* Its binder of batches: the first of that template it was given, not archived. */
2517
+ async function batchesOf(name) {
2518
+ const lists = await binderCall('lists', {});
2519
+ if (!lists.ok || !Array.isArray(lists.data)) return undefined;
2520
+ return lists.data.find((l) => !l.archived && l.template === TASKS_TEMPLATE && l.grants?.[`conversation:${name}`]) ?? null;
2521
+ }
2522
+ async function paintTasks(name) {
2523
+ if (DEVICE || !thread || threadOf !== name) return;
2524
+ const list = await batchesOf(name);
2525
+ if (list === undefined || !thread || threadOf !== name) return;
2526
+ if (!list) { thread.side = null; return; }
2527
+ const shown = await binderCall('show', { list: list.id });
2528
+ if (!shown.ok || !thread || threadOf !== name) return;
2529
+ const states = new Map(shown.data.list.states.map((st) => [st.id, st]));
2530
+ const nameOf = (id) => binderPeople.find((p) => p.id === id)?.name ?? id.replace(/^[a-z]+:/, '');
2531
+ const items = shown.data.records.map((r) => ({
2532
+ id: r.id, title: r.title, state: states.get(r.state)?.name ?? '', done: Boolean(states.get(r.state)?.done), checked: r.approved === true,
2533
+ /* Its own conversation owning it goes without saying. */
2534
+ owner: r.owners.filter((o) => o !== `conversation:${name}`).map(nameOf).join(', '), tone: TASKS_TONE[r.state] ?? '' }));
2535
+ thread.side = { onFold: (on) => keepTasksFolded(name, on), title: list.title, items, folded: tasksFolded(name) ?? false,
2536
+ /* What waits for the owner's tick: counted on the bar's button, as on the Binders tab. */
2537
+ count: items.filter((x) => !x.done && !x.checked).length,
2538
+ tick: async (id, yes) => { const r = await binderCall('approve', { id, yes }); if (!r.ok) throw new Error(r.text); void paintTasks(name); },
2539
+ open: (id) => void openTaskCard(name, id) };
2540
+ }
2541
+ /* A card opened in its Binders tab, once that tab drew its binder. */
2542
+ async function openTaskCard(name, id) {
2543
+ if (current !== name) return;
2544
+ goTab('lists');
2545
+ for (let i = 0; i < 50 && !(listsView && listsOf === name); i++) await new Promise((r) => setTimeout(r, 100));
2546
+ if (listsView && listsOf === name) await listsView.open?.(id);
2547
+ }
2548
+ /* Read again when the binders changed (a number that moves with each change), and only then. */
2549
+ function watchTasks() {
2550
+ if (tasksTimer) return;
2551
+ tasksTimer = setInterval(async () => {
2552
+ if (!thread) { clearInterval(tasksTimer); tasksTimer = null; return; }
2553
+ if (document.hidden) return;
2554
+ const now = await getJson('/binder/people', null);
2555
+ if (!now || now.changes === tasksChanges) return;
2556
+ tasksChanges = now.changes; binderPeople = now.people;
2557
+ void paintTasks(threadOf);
2558
+ }, 4000);
2505
2559
  }
2506
2560
  /* DRAWINGS AND CODE IN THE CHAT, by libraries served here at fixed
2507
2561
  versions (package.json), loaded only when one is shown. A drawing is