clavarium 0.2.245-next.1 → 0.2.247-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.245-next.1",
3
+ "version": "0.2.247-next.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.245-next.1",
9
+ "version": "0.2.247-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.245-next.1",
3
+ "version": "0.2.247-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.",
@@ -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
@@ -5259,6 +5259,8 @@
5259
5259
  const got = await post(`${API}/binder/suggest`, { id: r.id }).catch(() => null);
5260
5260
  return (got?.actions ?? []).map((a) => ({ label: a.label, why: a.why, run: async () => {
5261
5261
  if (a.key === 'done') { const end = (l.states ?? []).find((x) => x.done); if (end) await binderCall('move', { id: r.id, state: end.id }); return; }
5262
+ if (a.key === 'done-archive') { const end = (l.states ?? []).find((x) => x.done); if (end) await binderCall('move', { id: r.id, state: end.id }); await binderCall('archive', { id: r.id }); return; }
5263
+ if (a.key === 'drop') { await binderCall('note', { id: r.id, text: `Dropped: no longer relevant${a.why ? ` (${a.why})` : ''}.` }); await binderCall('archive', { id: r.id }); return; }
5262
5264
  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
5265
  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
5266
  /* Work for an assistant: asked in its chat, where the person follows and approves. */