clavarium 0.2.423-next.1 → 0.2.424-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.423-next.1",
3
+ "version": "0.2.424-next.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.423-next.1",
9
+ "version": "0.2.424-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.423-next.1",
3
+ "version": "0.2.424-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.",
@@ -102,7 +102,7 @@ const sizeSaid = (c, asked = {}) => {
102
102
  const firstLine = (text) => String(text ?? '').trim().split('\n').filter(Boolean).pop()?.slice(0, 200) ?? '';
103
103
 
104
104
  export class Conversations {
105
- #layout; #store; #vms; #tools; #stopDelayMs; #timers = new Map(); #watching = new Map(); #fresh = new Set(); #mountAgain = new Set(); #holding = new Set(); #uid; #gid;
105
+ #layout; #store; #vms; #tools; #stopDelayMs; #timers = new Map(); #watching = new Map(); #fresh = new Set(); #mountAgain = new Set(); #holding = new Set(); #borrowed = new Set(); #uid; #gid;
106
106
  /* THE ONE ACTION RUNNING ON EACH MACHINE (machineAction), by name: a start, a stop, a restart, a
107
107
  sleep, a resize, a force stop. A second one is refused while it runs; Force stop ends it and
108
108
  takes its place. */
@@ -1033,6 +1033,10 @@ export class Conversations {
1033
1033
  const state = await this.#vms.state(from, { fresh: true }).catch(() => undefined);
1034
1034
  if (state !== 'Running') {
1035
1035
  await this.room({ kind: 'start', name: from, memoryMb: Number(c.memoryMb) || tool.memoryMb });
1036
+ /* Woken outside a wake, it is still marked asleep: borrowed, so that the server's sweep of sleepers
1037
+ holding memory (capacity.mjs, reclaimSleepers) does not put it back to sleep while it is read --
1038
+ the reading would end cut (13-11: exit 255). */
1039
+ this.#borrowed.add(from);
1036
1040
  const started = await this.#vms.start(from);
1037
1041
  if (started.code !== 0) throw new Error(`its original's machine did not start: ${firstLine(started.stderr) || `exit ${started.code}`}.`);
1038
1042
  woke = true;
@@ -1073,6 +1077,7 @@ export class Conversations {
1073
1077
  } finally {
1074
1078
  rmSync(dir, { recursive: true, force: true });
1075
1079
  if (woke) await this.sleep(from).catch(() => {});
1080
+ this.#borrowed.delete(from);
1076
1081
  }
1077
1082
  }
1078
1083
 
@@ -1634,7 +1639,8 @@ export class Conversations {
1634
1639
  awake() { return this.#store.all().filter((c) => c.phase === 'ready' && c.asleep !== true && c.stopped !== true).map((c) => c.name); }
1635
1640
  /* Put to sleep, and nothing else: not one being built (02-11: a reset machine was taken for a sleeper and
1636
1641
  suspended mid-build), not a failed one. */
1637
- asleep() { return this.#store.all().filter((c) => c.phase === 'ready' && c.asleep === true).map((c) => c.name); }
1642
+ /* (One woken the time a copy reads it -- #borrowed -- is not asleep then: its memory is never "reclaimed" under it.) */
1643
+ asleep() { return this.#store.all().filter((c) => c.phase === 'ready' && c.asleep === true && !this.#borrowed.has(c.name)).map((c) => c.name); }
1638
1644
 
1639
1645
  /* Whether the machine of a conversation runs right now. */
1640
1646
  async running(name) { return (await this.#vms.state(name)) === 'Running'; }
package/web/style.css CHANGED
@@ -3057,3 +3057,6 @@ button.kit-switch[aria-checked="true"]::after { left: 18px; background: var(--ok
3057
3057
  html:not([data-door="device"]) #room > header .views button { gap: 4px; padding-inline: 7px; }
3058
3058
  html:not([data-door="device"]) #room > header .views .count { min-width: 1.2em; padding: 1px 4px; }
3059
3059
  }
3060
+ /* At hand (13-11): a switch's name never under its buttons -- the name keeps its width, the buttons wrap. */
3061
+ .hand-switches .set-row > .set-what { flex: none; }
3062
+ .hand-switches .set-row > .set-control { flex: 0 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }