clavarium 0.2.42-beta.1 → 0.2.43-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.42-beta.1",
3
+ "version": "0.2.43-beta.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.42-beta.1",
9
+ "version": "0.2.43-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.42-beta.1",
3
+ "version": "0.2.43-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,31 +966,17 @@
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
- /* 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. */
969
+ /* ONE FLAT POINT per conversation, its colour the state -- the worst that applies: a machine problem (red),
970
+ the agent waits for you (blue), the agent at work (gold, pulsing), the machine busy (amber, pulsing),
971
+ fine (green), asleep (a hollow ring). The same point, same colours, sums a folded group below. */
972
972
  const machineState = (c) => (c.asleep ? 'off' : (c.phase === 'failed' || healthNeeds(c)) ? 'problem'
973
973
  : (holds(c) || ['building', 'restarting', 'moving'].includes(c.phase)) ? 'busy' : 'online');
974
974
  const agentState = (c) => (c.asleep ? 'sleep' : (talkNeeds(c) || c.answerer?.needs) ? 'wait'
975
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
- };
988
- const statePoint = (state) => { const d = document.createElement('span'); d.className = 'state-dot'; d.dataset.state = state; return d; };
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
976
  const STATE_WORDS = { problem: 'a problem', wait: 'waits for you', work: 'at work', busy: 'busy', ok: 'fine', sleep: 'asleep' };
992
977
  const rollup = (c) => { const m = machineState(c); const a = agentState(c);
993
978
  return (m === 'off' ? 'sleep' : m === 'problem' ? 'problem' : a === 'wait' ? 'wait' : a === 'work' ? 'work' : m === 'busy' ? 'busy' : 'ok'); };
979
+ const statePoint = (state) => { const d = document.createElement('span'); d.className = 'state-dot'; d.dataset.state = state; return d; };
994
980
  const STATE_ORDER = ['problem', 'wait', 'work', 'busy', 'ok', 'sleep'];
995
981
  function stateSummary(list) {
996
982
  const count = Object.fromEntries(STATE_ORDER.map((k) => [k, 0]));
@@ -1073,7 +1059,7 @@
1073
1059
  b.append(when); b.dataset.when = 'true';
1074
1060
  } else b.append(title, ...(plain ? [] : [sub]));
1075
1061
  /* Its state: one point, on the right. */
1076
- b.append(stateIndicator(c));
1062
+ const point = statePoint(rollup(c)); point.title = STATE_WORDS[point.dataset.state]; b.append(point);
1077
1063
  /* Found by a search while hidden: said. */
1078
1064
  if (c.hidden === true && query) { const mark = document.createElement('small'); mark.className = 'shared-mark'; mark.textContent = 'hidden'; b.append(mark); }
1079
1065
  /* Several models answer its simple questions; or they stopped, and it waits for its owner. */
package/web/style.css CHANGED
@@ -34,41 +34,26 @@ 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, 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; }
37
+ /* ITS STATE, one point on the right of its row, its colour the worst that
38
+ applies: a machine problem (red), the agent waits for you (blue), the agent
39
+ at work (gold, pulsing), the machine busy (amber, pulsing), fine (green),
40
+ asleep (a hollow ring). The same point, same colours, sums a folded group. */
41
+ .item { position: relative; padding-right: 26px; }
42
42
  .state-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-sizing: border-box; background: var(--ok); }
43
43
  .state-dot[data-state="problem"] { background: var(--danger); }
44
44
  .state-dot[data-state="wait"] { background: var(--wait); }
45
45
  .state-dot[data-state="work"] { background: var(--brass); }
46
- .state-dot[data-state="busy"] { background: var(--warn); }
46
+ .state-dot[data-state="busy"] { background: var(--ink2); }
47
47
  .state-dot[data-state="sleep"] { background: transparent; border: 1.5px solid var(--ink2); }
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); }
48
+ .item > .state-dot { position: absolute; right: 10px; top: 13px; }
49
+ .item > .state-dot[data-state="work"], .item > .state-dot[data-state="busy"] { animation: breathe 1.7s ease-in-out infinite; }
60
50
  /* Folded: up to four points, how its conversations are. */
61
51
  .state-sum { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; flex-shrink: 0; }
62
52
  /* Unfolded: it comes in gently, once. */
63
53
  .unfolding { animation: unfold .18s ease-out; }
64
54
  @keyframes unfold { from { opacity: 0; transform: translateY(-6px); } }
65
- @keyframes pulse { 50% { opacity: .25; } }
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
- }
55
+ @keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.85); } }
56
+ @media (prefers-reduced-motion: reduce) { .item > .state-dot, .unfolding { animation: none !important; } }
72
57
  .choices { display: flex; flex-wrap: wrap; gap: 6px; }
73
58
  .choices button[aria-checked="true"] { border-color: var(--brass); background: rgba(210, 169, 78, .16); }
74
59
  .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }