clavarium 0.2.41-beta.1 → 0.2.42-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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.41-beta.1",
3
+ "version": "0.2.42-beta.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.41-beta.1",
9
+ "version": "0.2.42-beta.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.41-beta.1",
3
+ "version": "0.2.42-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.",
package/web/app.js CHANGED
@@ -966,17 +966,35 @@
966
966
  full -- not marked "Seen"; a program stopped for lack of memory (its files safe) is only said. */
967
967
  const healthNeeds = (c) => c.phase === 'ready' && !c.asleep && (c.health?.problems ?? []).some((p) => (p.level === 'bad' || (p.level === 'warn' && ['memory', 'disk'].includes(p.kind) && !String(p.key).startsWith('oom:'))) && !(c.health.seen ?? []).includes(p.key));
968
968
  const needsYou = (c) => Boolean(talkNeeds(c) || c.answerer?.needs || c.phase === 'failed' || healthNeeds(c));
969
- /* ONE STATE PER CONVERSATION, one point for it: it needs you (red), something to watch (yellow: being built,
970
- restarted, moved), fine (green), asleep (a hollow ring). */
971
- const STATE_WORDS = { need: 'needs you', watch: 'to watch', ok: 'fine', sleep: 'asleep' };
972
- const stateOf = (c) => (needsYou(c) ? 'need' : c.asleep ? 'sleep' : holds(c) || ['building', 'restarting', 'moving'].includes(c.phase) ? 'watch' : 'ok');
969
+ /* TWO LAYERS per conversation: a point for its MACHINE (green on, amber busy, red a problem, hollow asleep)
970
+ and a ring around it for its AGENT (gold at work, blue waits for you, green finished). The agent asking or
971
+ waiting is the blue ring, not the red point -- red is kept for a machine that failed or is unwell. */
972
+ const machineState = (c) => (c.asleep ? 'off' : (c.phase === 'failed' || healthNeeds(c)) ? 'problem'
973
+ : (holds(c) || ['building', 'restarting', 'moving'].includes(c.phase)) ? 'busy' : 'online');
974
+ const agentState = (c) => (c.asleep ? 'sleep' : (talkNeeds(c) || c.answerer?.needs) ? 'wait'
975
+ : c.talk?.state === 'working' ? 'work' : c.talk?.state === 'done' ? 'done' : 'idle');
976
+ const MACHINE_WORDS = { online: '', busy: 'machine busy', problem: 'a problem', off: 'asleep' };
977
+ const AGENT_WORDS = { work: 'at work', wait: 'waits for you', done: 'finished', idle: '', sleep: '' };
978
+ const stateIndicator = (c) => {
979
+ const m = machineState(c); const a = agentState(c);
980
+ const ind = document.createElement('span'); ind.className = 'state-ind'; ind.dataset.machine = m; ind.dataset.agent = a;
981
+ const ring = document.createElement('span'); ring.className = 'state-ring';
982
+ const core = document.createElement('span'); core.className = 'state-core';
983
+ ind.append(ring, core); ind.setAttribute('role', 'img');
984
+ const words = [MACHINE_WORDS[m], AGENT_WORDS[a]].filter(Boolean).join(' · ') || 'idle';
985
+ ind.title = words; ind.setAttribute('aria-label', words);
986
+ return ind;
987
+ };
973
988
  const statePoint = (state) => { const d = document.createElement('span'); d.className = 'state-dot'; d.dataset.state = state; return d; };
974
- /* Folded, a heading says how its conversations are: at most four points, shared out like them -- every state
975
- there keeps at least one, the worst first -- and the same in words for a screen reader and the pointer. */
976
- const STATE_ORDER = ['need', 'watch', 'ok', 'sleep'];
989
+ /* Folded, a heading sums its conversations: one flat point each, same colours, no ring -- the worst kept first
990
+ (a problem, waits for you, at work, busy, fine, asleep) -- and the same in words for a screen reader. */
991
+ const STATE_WORDS = { problem: 'a problem', wait: 'waits for you', work: 'at work', busy: 'busy', ok: 'fine', sleep: 'asleep' };
992
+ const rollup = (c) => { const m = machineState(c); const a = agentState(c);
993
+ return (m === 'off' ? 'sleep' : m === 'problem' ? 'problem' : a === 'wait' ? 'wait' : a === 'work' ? 'work' : m === 'busy' ? 'busy' : 'ok'); };
994
+ const STATE_ORDER = ['problem', 'wait', 'work', 'busy', 'ok', 'sleep'];
977
995
  function stateSummary(list) {
978
996
  const count = Object.fromEntries(STATE_ORDER.map((k) => [k, 0]));
979
- for (const c of list) count[stateOf(c)] += 1;
997
+ for (const c of list) count[rollup(c)] += 1;
980
998
  const slots = Math.min(4, list.length);
981
999
  const present = STATE_ORDER.filter((k) => count[k] > 0);
982
1000
  const got = Object.fromEntries(STATE_ORDER.map((k) => [k, 0]));
@@ -1055,7 +1073,7 @@
1055
1073
  b.append(when); b.dataset.when = 'true';
1056
1074
  } else b.append(title, ...(plain ? [] : [sub]));
1057
1075
  /* Its state: one point, on the right. */
1058
- const point = statePoint(stateOf(c)); point.title = STATE_WORDS[point.dataset.state]; b.append(point); b.dataset.state = point.dataset.state;
1076
+ b.append(stateIndicator(c));
1059
1077
  /* Found by a search while hidden: said. */
1060
1078
  if (c.hidden === true && query) { const mark = document.createElement('small'); mark.className = 'shared-mark'; mark.textContent = 'hidden'; b.append(mark); }
1061
1079
  /* Several models answer its simple questions; or they stopped, and it waits for its owner. */
package/web/style.css CHANGED
@@ -2,7 +2,7 @@
2
2
  a narrow one, the list and the conversation are two screens. */
3
3
  :root {
4
4
  --bg: #0f141a; --bar: #161d26; --panel: #131a22; --line: #2b3745; --ink: #e7edf4; --ink2: #a3b1c2;
5
- --brass: #d2a94e; --on-brass: #1b1405; --ok: #5fc39d; --warn: #e39a5c; --danger: #ee7f79;
5
+ --brass: #d2a94e; --on-brass: #1b1405; --ok: #5fc39d; --warn: #e39a5c; --danger: #ee7f79; --wait: #5aa9f0;
6
6
  /* Brass as the colour of text or of a small sign: darker on a light screen, to be read. */
7
7
  --brass-ink: #d2a94e;
8
8
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
@@ -11,7 +11,7 @@
11
11
  colours of its own for it (app.js): a tool's "white" must stay readable. */
12
12
  :root[data-theme="light"] {
13
13
  --bg: #fbfbfa; --bar: #eef0f3; --panel: #ffffff; --line: #c5cdd8; --ink: #17202b; --ink2: #4f5d6d;
14
- --brass: #c79a3a; --on-brass: #1b1405; --ok: #1f7a5a; --warn: #a3581a; --danger: #b3261e; --button: #e6eaef; --brass-ink: #8a5d00;
14
+ --brass: #c79a3a; --on-brass: #1b1405; --ok: #1f7a5a; --warn: #a3581a; --danger: #b3261e; --wait: #2f7fd6; --button: #e6eaef; --brass-ink: #8a5d00;
15
15
  }
16
16
  * { box-sizing: border-box; }
17
17
  /* TEXT IS IN rem: one size at the root (set per device by app.js, as a
@@ -34,21 +34,41 @@ button:focus-visible, input:focus-visible { outline: 2px solid var(--brass); out
34
34
  .item[aria-current="true"] { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); }
35
35
  .item b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
36
36
  .item small { color: var(--ink2); }
37
- /* ITS STATE, one point on the right of its row: needs you, to watch, fine, asleep (a hollow ring). */
38
- .item { position: relative; padding-right: 26px; }
37
+ /* ITS STATE, on the right of its row: two layers at once -- a point for the
38
+ machine (green on, amber busy, red a problem, hollow asleep) and a ring
39
+ around it for the agent (gold at work, blue waits for you, green finished).
40
+ A flat point of the same colours sums a folded group, with no ring. */
41
+ .item { position: relative; padding-right: 28px; }
39
42
  .state-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-sizing: border-box; background: var(--ok); }
40
- .state-dot[data-state="need"] { background: var(--danger); }
41
- .state-dot[data-state="watch"] { background: var(--warn); }
43
+ .state-dot[data-state="problem"] { background: var(--danger); }
44
+ .state-dot[data-state="wait"] { background: var(--wait); }
45
+ .state-dot[data-state="work"] { background: var(--brass); }
46
+ .state-dot[data-state="busy"] { background: var(--warn); }
42
47
  .state-dot[data-state="sleep"] { background: transparent; border: 1.5px solid var(--ink2); }
43
- .item > .state-dot { position: absolute; right: 10px; top: 13px; }
44
- .item[data-state="watch"] > .state-dot { animation: pulse 1.6s ease-in-out infinite; }
48
+ /* The row indicator: a ring (agent) around a core (machine). */
49
+ .state-ind { position: relative; width: 16px; height: 16px; display: inline-grid; place-items: center; flex-shrink: 0; }
50
+ .item > .state-ind { position: absolute; right: 9px; top: 11px; }
51
+ .state-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; box-sizing: border-box; }
52
+ .state-core { width: 7px; height: 7px; border-radius: 50%; box-sizing: border-box; background: var(--ok); }
53
+ .state-ind[data-machine="busy"] .state-core { background: var(--warn); animation: breathe 1.5s ease-in-out infinite; }
54
+ .state-ind[data-machine="problem"] .state-core { background: var(--danger); }
55
+ .state-ind[data-machine="off"] .state-core { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink2); }
56
+ .state-ind[data-agent="work"] .state-ring { border-color: var(--brass); animation: breathe 1.9s ease-in-out infinite; }
57
+ .state-ind[data-agent="wait"] .state-ring { border-color: var(--wait); }
58
+ .state-ind[data-agent="done"] .state-ring { border-color: var(--ok); }
59
+ .state-ind[data-agent="sleep"] .state-ring { border-color: var(--line); }
45
60
  /* Folded: up to four points, how its conversations are. */
46
61
  .state-sum { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; flex-shrink: 0; }
47
62
  /* Unfolded: it comes in gently, once. */
48
63
  .unfolding { animation: unfold .18s ease-out; }
49
64
  @keyframes unfold { from { opacity: 0; transform: translateY(-6px); } }
50
65
  @keyframes pulse { 50% { opacity: .25; } }
51
- @media (prefers-reduced-motion: reduce) { .item > .state-dot, .unfolding { animation: none !important; } }
66
+ @keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.82); } }
67
+ /* Movement off: no pulse, and a dashed ring tells "at work" by shape instead. */
68
+ @media (prefers-reduced-motion: reduce) {
69
+ .state-core, .state-ring, .unfolding { animation: none !important; }
70
+ .state-ind[data-agent="work"] .state-ring { border-style: dashed; }
71
+ }
52
72
  .choices { display: flex; flex-wrap: wrap; gap: 6px; }
53
73
  .choices button[aria-checked="true"] { border-color: var(--brass); background: rgba(210, 169, 78, .16); }
54
74
  .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }