clavarium 0.2.133-beta.1 → 0.2.134-beta.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/suggest.mjs +5 -1
- package/web/app.js +9 -1
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.134-beta.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.134-beta.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.
|
|
14
|
+
"clavarium-binder": "0.1.49-next.1",
|
|
15
15
|
"clavarium-docket": "0.1.1",
|
|
16
16
|
"clavarium-parley": "0.17.35-next.1",
|
|
17
17
|
"clavarium-tether": "0.1.0-next.46",
|
|
@@ -761,9 +761,9 @@
|
|
|
761
761
|
}
|
|
762
762
|
},
|
|
763
763
|
"node_modules/clavarium-binder": {
|
|
764
|
-
"version": "0.1.
|
|
765
|
-
"resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.
|
|
766
|
-
"integrity": "sha512-
|
|
764
|
+
"version": "0.1.49-next.1",
|
|
765
|
+
"resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.49-next.1.tgz",
|
|
766
|
+
"integrity": "sha512-PyPXP5C66Xs98pNvI6BDjVNeoB/PF3IdUsbcMCXWGhVm4uM68OfKBC6Ph9eWRBHg/hiS5eiBt6fydZgZLCHZOw==",
|
|
767
767
|
"license": "MIT",
|
|
768
768
|
"bin": {
|
|
769
769
|
"binder": "bin/binder.mjs",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.134-beta.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,7 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@xterm/addon-fit": "^0.11.0",
|
|
46
46
|
"@xterm/xterm": "^6.0.0",
|
|
47
|
-
"clavarium-binder": "0.1.
|
|
47
|
+
"clavarium-binder": "0.1.49-next.1",
|
|
48
48
|
"clavarium-docket": "0.1.1",
|
|
49
49
|
"clavarium-parley": "0.17.35-next.1",
|
|
50
50
|
"clavarium-tether": "0.1.0-next.46",
|
package/server/suggest.mjs
CHANGED
|
@@ -10,6 +10,10 @@ export const CATALOGUE = Object.freeze({
|
|
|
10
10
|
'postpone-week': { label: 'Postpone a week', on: 'card' },
|
|
11
11
|
'urgency-up': { label: 'More urgent', on: 'card' },
|
|
12
12
|
'urgency-down': { label: 'Less urgent', on: 'card' },
|
|
13
|
+
/* Two endings (02-11), archived either way (restored in a click), never deleted here: done, or dropped --
|
|
14
|
+
no longer of use, a duplicate, made by mistake -- which says so in a note. */
|
|
15
|
+
'done-archive': { label: 'Done, archive it', on: 'card' },
|
|
16
|
+
drop: { label: 'No longer relevant, archive it', on: 'card' },
|
|
13
17
|
'reply-mail': { label: 'Draft the reply to the mail', on: 'agent', ask: 'Draft a reply to the mail attached to this card. Keep it as a draft: show it to me before anything is sent.' },
|
|
14
18
|
'make-event': { label: 'Put it in the calendar', on: 'agent', ask: 'Create the calendar event this card speaks of (ask me before it is created).' },
|
|
15
19
|
split: { label: 'Split into smaller cards', on: 'agent', ask: 'Split this card into a few smaller cards, each one step, in the same binder.' },
|
|
@@ -51,7 +55,7 @@ export function cardText(record, list) {
|
|
|
51
55
|
fields ? `Fields: ${fields}` : '', attached ? `Attached: ${attached}` : '', `Today: ${new Date().toISOString().slice(0, 10)}`].filter(Boolean).join('\n');
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
export const SUGGEST_SYSTEM = `You suggest quick actions for a to-do card. Choose AT MOST 3 keys from this list, the most useful first, only those that clearly fit the card: ${KEYS.map((k) => `${k} (${CATALOGUE[k].label})`).join(', ')}. Answer ONLY with JSON: [{"key": "...", "why": "a reason of 2 to 6 words, in the card's language"}]. No other text.`;
|
|
58
|
+
export const SUGGEST_SYSTEM = `You suggest quick actions for a to-do card. Choose AT MOST 3 keys from this list, the most useful first, only those that clearly fit the card: ${KEYS.map((k) => `${k} (${CATALOGUE[k].label})`).join(', ')}. Suggest done-archive when the work is finished; drop when the card no longer matters, is a duplicate, or looks made by mistake. Answer ONLY with JSON: [{"key": "...", "why": "a reason of 2 to 6 words, in the card's language"}]. No other text.`;
|
|
55
59
|
|
|
56
60
|
/* -> [{ key, label, why, on, ask? }] -- the model's choice when it answers, else the rules'. */
|
|
57
61
|
export async function suggest(record, list, { chat = null, now = Date.now() } = {}) {
|
package/web/app.js
CHANGED
|
@@ -5246,7 +5246,7 @@
|
|
|
5246
5246
|
/* Where it is: a step of this page's Back (below). */
|
|
5247
5247
|
place: at, onPlace: steps?.onPlace, onBack: steps?.onBack,
|
|
5248
5248
|
/* ACT (02-11): quick actions suggested for a card (server/suggest.mjs); done here. */
|
|
5249
|
-
...(DEVICE ? {} : { actions: (r, l) => cardActions(r, l, whose), discuss: (r, l) => discussCard(r, l, whose) }),
|
|
5249
|
+
...(DEVICE ? {} : { actions: (r, l) => cardActions(r, l, whose), discuss: (r, l) => discussCard(r, l, whose), endings: (r, l, kind) => endCard(r, l, kind) }),
|
|
5250
5250
|
});
|
|
5251
5251
|
binderViews.add({ box: holder.firstElementChild, view });
|
|
5252
5252
|
watchBinders();
|
|
@@ -5255,10 +5255,18 @@
|
|
|
5255
5255
|
/* The conversation that carries a card: an assistant among its owners, else the one the binder is given to. */
|
|
5256
5256
|
const carrierOf = (r, whose) => (r.owners ?? []).find((o) => o.startsWith('conversation:'))?.slice('conversation:'.length) || whose();
|
|
5257
5257
|
const dayAfter = (days) => { const d = new Date(Date.now() + days * 86_400_000); return new Date(d.getTime() - d.getTimezoneOffset() * 60_000).toISOString().slice(0, 10); };
|
|
5258
|
+
/* A card's two endings, archived either way: done (to its done state), or dropped (a note says so). */
|
|
5259
|
+
async function endCard(r, l, kind, why = '') {
|
|
5260
|
+
if (kind === 'done') { const end = (l.states ?? []).find((x) => x.done); if (end) await binderCall('move', { id: r.id, state: end.id }); }
|
|
5261
|
+
else await binderCall('note', { id: r.id, text: `Dropped: no longer relevant${why ? ` (${why})` : ''}.` });
|
|
5262
|
+
await binderCall('archive', { id: r.id });
|
|
5263
|
+
}
|
|
5258
5264
|
async function cardActions(r, l, whose) {
|
|
5259
5265
|
const got = await post(`${API}/binder/suggest`, { id: r.id }).catch(() => null);
|
|
5260
5266
|
return (got?.actions ?? []).map((a) => ({ label: a.label, why: a.why, run: async () => {
|
|
5261
5267
|
if (a.key === 'done') { const end = (l.states ?? []).find((x) => x.done); if (end) await binderCall('move', { id: r.id, state: end.id }); return; }
|
|
5268
|
+
if (a.key === 'done-archive') { await endCard(r, l, 'done'); return; }
|
|
5269
|
+
if (a.key === 'drop') { await endCard(r, l, 'drop', a.why); return; }
|
|
5262
5270
|
if (a.key === 'postpone-day' || a.key === 'postpone-week') { await binderCall('edit', { id: r.id, due: dayAfter(a.key === 'postpone-day' ? 1 : 7) }); return; }
|
|
5263
5271
|
if (a.key === 'urgency-up' || a.key === 'urgency-down') { const u = Number(r.fields?.urgence ?? 50); await binderCall('edit', { id: r.id, fields: { urgence: Math.max(0, Math.min(100, u + (a.key === 'urgency-up' ? 20 : -20))) } }); return; }
|
|
5264
5272
|
/* Work for an assistant: asked in its chat, where the person follows and approves. */
|