clavarium 0.2.429-next.1 → 0.2.431-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.
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/server/conversations.mjs +22 -7
- package/server/settingswords.mjs +2 -1
- package/web/app.js +45 -17
- package/web/index.html +3 -1
- package/web/style.css +8 -2
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.431-next.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.431-next.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/package.json
CHANGED
package/server/conversations.mjs
CHANGED
|
@@ -278,7 +278,7 @@ export class Conversations {
|
|
|
278
278
|
return this.#store.all().sort((a, b) => order.indexOf(a.name) - order.indexOf(b.name)).map((c) => {
|
|
279
279
|
const tool = this.#tools.find((t) => t.id === c.tool);
|
|
280
280
|
/* An AI tool has an instruction file; a shell has none: what is dictated there is never marked. */
|
|
281
|
-
return { ...c, rank: order.indexOf(c.name), ...(c.group ? { groupRank: groups.indexOf(c.group) } : {}), toolLabel: tool?.label ?? c.tool, memoryMinMb: tool?.memoryMb, resumes: Boolean(tool?.resume), rights: Boolean(tool?.rights), ai: Boolean(tool?.instructions), voiceMark: Boolean(tool?.instructions) && c.voiceMark !== false, cpus: c.cpus ?? 1, hostCpus: availableParallelism() };
|
|
281
|
+
return { ...c, ...(c.lentTo && !this.#borrowed.has(c.name) ? { lentTo: undefined } : {}), rank: order.indexOf(c.name), ...(c.group ? { groupRank: groups.indexOf(c.group) } : {}), toolLabel: tool?.label ?? c.tool, memoryMinMb: tool?.memoryMb, resumes: Boolean(tool?.resume), rights: Boolean(tool?.rights), ai: Boolean(tool?.instructions), voiceMark: Boolean(tool?.instructions) && c.voiceMark !== false, cpus: c.cpus ?? 1, hostCpus: availableParallelism() };
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
284
|
|
|
@@ -1031,7 +1031,8 @@ export class Conversations {
|
|
|
1031
1031
|
async #copying(from, to, c, tool, building, open = () => {}) {
|
|
1032
1032
|
const dir = mkdtempSync(join(tmpdir(), 'clv-copy-'));
|
|
1033
1033
|
const carried = join(dir, 'state.tar.gz');
|
|
1034
|
-
let woke = false;
|
|
1034
|
+
let woke = false; let putBack = 'sleep';
|
|
1035
|
+
const back = () => (putBack === 'stop' ? this.machineAction(from, 'stop', { wait: true }) : this.sleep(from));
|
|
1035
1036
|
try {
|
|
1036
1037
|
/* Said as it goes, once a second at most: a long copy is seen moving (13-11, "on ne sait pas si ça marche"). */
|
|
1037
1038
|
let said = 0;
|
|
@@ -1040,12 +1041,16 @@ export class Conversations {
|
|
|
1040
1041
|
this.#store.patch(to, { step: `Copying ${tool.label}'s memory` });
|
|
1041
1042
|
const state = await this.#vms.state(from, { fresh: true }).catch(() => undefined);
|
|
1042
1043
|
if (state !== 'Running') {
|
|
1043
|
-
|
|
1044
|
+
/* Put back as it was found (14-11: one stopped was left asleep, its memory held). */
|
|
1045
|
+
putBack = state === 'Stopped' ? 'stop' : 'sleep';
|
|
1046
|
+
this.#store.patch(to, { step: `Copying ${tool.label}'s memory: ${putBack === 'stop' ? 'starting its original (it was stopped)' : 'waking its original'}` });
|
|
1044
1047
|
await this.room({ kind: 'start', name: from, memoryMb: Number(c.memoryMb) || tool.memoryMb });
|
|
1045
1048
|
/* Woken outside a wake, it is still marked asleep: borrowed, so that the server's sweep of sleepers
|
|
1046
1049
|
holding memory (capacity.mjs, reclaimSleepers) does not put it back to sleep while it is read --
|
|
1047
1050
|
the reading would end cut (13-11: exit 255). */
|
|
1048
1051
|
this.#borrowed.add(from);
|
|
1052
|
+
/* Its page says so while it is read (not « Stopped » or « Asleep »): cleared once put back. */
|
|
1053
|
+
this.#store.patch(from, { lentTo: this.#store.get(to)?.title ?? to });
|
|
1049
1054
|
const started = await this.#vms.start(from);
|
|
1050
1055
|
if (started.code !== 0) throw new Error(`its original's machine did not start: ${firstLine(started.stderr) || `exit ${started.code}`}.`);
|
|
1051
1056
|
woke = true;
|
|
@@ -1063,10 +1068,18 @@ export class Conversations {
|
|
|
1063
1068
|
out.stream.on('data', (d) => { read += d.length; lastAt = Date.now(); say(`Copying ${tool.label}'s memory: ${sizeWords(read)} read`); });
|
|
1064
1069
|
/* Nothing comes for a while: said, with how long; for too long, the reading is ended and why said --
|
|
1065
1070
|
never an endless wait nobody can read (14-11: stuck at "36 KB read"). */
|
|
1071
|
+
/* Quiet for 30 s: its machine asked, once, what its reading does -- the file it is on and its state
|
|
1072
|
+
(D: waiting on the disk), its load, its free memory -- or said not to answer at all. Said with the
|
|
1073
|
+
wait, and in the end's why (14-11: stuck at 36 KB on the owner's server, never here). */
|
|
1074
|
+
let seen = '';
|
|
1075
|
+
const probe = 'for p in $(pgrep -x tar); do f=$(ls -l /proc/$p/fd 2>/dev/null | grep -o "/home/[^ ]*" | tail -1); echo "tar $(cut -d" " -f3 /proc/$p/stat) ${f#$HOME/}"; done; '
|
|
1076
|
+
+ 'echo "load $(cut -d" " -f1 /proc/loadavg)"; awk \'/MemAvailable/{print "free " int($2/1024) " MB"}\' /proc/meminfo';
|
|
1077
|
+
const ask = () => { seen = '…'; this.#vms.exec(from, ['sh', '-c', probe], { timeoutMs: 20_000 }).then((r) => { seen = r.code === 0 ? (r.stdout || '').trim().split('\n').join(', ').slice(0, 200) : 'its machine did not answer'; }, () => { seen = 'its machine did not answer'; }); };
|
|
1066
1078
|
const watch = setInterval(() => {
|
|
1067
1079
|
const quiet = Math.round((Date.now() - lastAt) / 1000);
|
|
1068
1080
|
if (quiet >= COPY_QUIET_MS / 1000) { stalled = true; child.kill('SIGKILL'); return; }
|
|
1069
|
-
if (quiet >=
|
|
1081
|
+
if (quiet >= 30 && !seen) ask();
|
|
1082
|
+
if (quiet >= 15) say(`Copying ${tool.label}'s memory: ${sizeWords(read)} read, nothing more for ${quiet} s${seen && seen !== '…' ? ` (${seen})` : ''}`);
|
|
1070
1083
|
}, 5000);
|
|
1071
1084
|
const failed = new Promise((ok) => child.on('error', () => ok(-1)));
|
|
1072
1085
|
const file = createWriteStream(carried, { mode: 0o600 });
|
|
@@ -1074,15 +1087,16 @@ export class Conversations {
|
|
|
1074
1087
|
code = await Promise.race([new Promise((ok) => child.on('close', ok)), failed]).finally(() => clearInterval(watch));
|
|
1075
1088
|
if (stalled) {
|
|
1076
1089
|
const now = await this.#vms.state(from, { fresh: true }).catch(() => undefined);
|
|
1077
|
-
throw new Error(`its original stopped sending its tool's memory (${sizeWords(read)} read, then nothing for ${COPY_QUIET_MS / 60_000} min; its machine is ${now ?? 'in a state that could not be read'})`);
|
|
1090
|
+
throw new Error(`its original stopped sending its tool's memory (${sizeWords(read)} read, then nothing for ${COPY_QUIET_MS / 60_000} min; its machine is ${now ?? 'in a state that could not be read'}${seen && seen !== '…' ? `; it said: ${seen}` : ''})`);
|
|
1078
1091
|
}
|
|
1079
1092
|
await new Promise((ok) => (file.writableFinished ? ok() : file.on('finish', ok)));
|
|
1080
1093
|
if (code !== 255) break;
|
|
1081
1094
|
}
|
|
1082
1095
|
if (code !== 0) throw new Error(`its tool's memory could not be read (exit ${code}${firstLine(child.said) ? `: ${firstLine(child.said)}` : ''}).`);
|
|
1083
1096
|
/* Read: its original back to sleep at once, before the copy's machine is made. */
|
|
1084
|
-
if (woke) { await
|
|
1097
|
+
if (woke) { await back().catch(() => {}); woke = false; }
|
|
1085
1098
|
this.#borrowed.delete(from);
|
|
1099
|
+
if (this.#store.get(from)?.lentTo) this.#store.patch(from, { lentTo: undefined });
|
|
1086
1100
|
}
|
|
1087
1101
|
open(true);
|
|
1088
1102
|
await building;
|
|
@@ -1114,8 +1128,9 @@ export class Conversations {
|
|
|
1114
1128
|
return undefined;
|
|
1115
1129
|
} finally {
|
|
1116
1130
|
rmSync(dir, { recursive: true, force: true });
|
|
1117
|
-
if (woke) await
|
|
1131
|
+
if (woke) await back().catch(() => {});
|
|
1118
1132
|
this.#borrowed.delete(from);
|
|
1133
|
+
if (this.#store.get(from)?.lentTo) this.#store.patch(from, { lentTo: undefined });
|
|
1119
1134
|
}
|
|
1120
1135
|
}
|
|
1121
1136
|
|
package/server/settingswords.mjs
CHANGED
|
@@ -135,7 +135,8 @@ export const SETTINGS_WORDS_FR = {
|
|
|
135
135
|
'set-list-not-filed': 'Sans groupe', 'set-list-asks': 'vous demande', 'set-list-waits': 'vous attend',
|
|
136
136
|
'set-list-asks-for': 'le répondeur vous demande', 'set-list-answered': 'a répondu à votre place',
|
|
137
137
|
'set-list-wakeup': '1 réveil', 'set-list-wakeups': '{n} réveils', 'set-list-hidden': 'cachée',
|
|
138
|
-
'set-list-asleep': 'en veille', 'set-list-
|
|
138
|
+
'set-list-asleep': 'en veille', 'set-list-stopped': 'arrêtée',
|
|
139
|
+
'set-lent-page': 'Lue pour sa copie « {t} » · rien à faire', 'set-carry-down': 'Elle doit tourner pour exporter ou importer', 'set-list-starting': 'démarre', 'set-list-restarting': 'redémarre',
|
|
139
140
|
'set-list-moving': 'déplace son travail', 'set-list-failed': 'en échec', 'set-list-you': 'Vous : {text}',
|
|
140
141
|
'set-list-fewer': 'En montrer moins', 'set-list-more': 'En montrer {n} de plus',
|
|
141
142
|
'set-list-hide-hidden': 'Masquer les {n} cachées', 'set-list-n-hidden': '{n} cachées',
|
package/web/app.js
CHANGED
|
@@ -522,7 +522,7 @@
|
|
|
522
522
|
const old = document.getElementById('room')?.querySelector(':scope > header');
|
|
523
523
|
if (old) old.replaceWith(DEVICE
|
|
524
524
|
? KIT.TopBar({ variant: 'main', title: $('name'), actions: [...old.children].filter((n) => n.id !== 'name') })
|
|
525
|
-
: KIT.TopBar({ variant: 'main', fold: $('fold'), back: { element: $('back'), label: 'Conversations' }, state: $('state'), title: $('name'), actions: [$('views')] }));
|
|
525
|
+
: KIT.TopBar({ variant: 'main', fold: $('fold'), back: { element: $('back'), label: 'Conversations' }, state: $('state'), title: $('name'), actions: [$('jobs-room'), $('views')] }));
|
|
526
526
|
}
|
|
527
527
|
/* A room (the device page has none): its dot, its name, under it who speaks now (only then); on its right who is
|
|
528
528
|
in it (07-11: small stacked avatars, a click opens the list) then its settings, in the same group of views a
|
|
@@ -1224,6 +1224,8 @@
|
|
|
1224
1224
|
return;
|
|
1225
1225
|
}
|
|
1226
1226
|
/* STOPPED BY ITS OWNER: it stays stopped until somebody starts it. */
|
|
1227
|
+
/* Read for a copy just now (#221): started or woken without its tool, put back as it was after -- said, not « Stopped ». */
|
|
1228
|
+
if (c && c.lentTo && !socket && c.phase === 'ready') { say('read for a copy', 'connecting'); show(uiSaid('set-lent-page', 'Read for its copy « {t} » · nothing to do', { t: c.lentTo })); $('notice-spin').hidden = false; return; }
|
|
1227
1229
|
if (c && c.stopped === true && !socket && c.phase === 'ready') { say('stopped', 'waiting'); show(uiSaid('set-stopped-page', 'Stopped. It starts when you start it.'), uiSaid('set-m-start', 'Start'), connect); return; }
|
|
1228
1230
|
if (c && c.phase === 'moving') { disconnect(); say('moving', 'connecting'); show(`Moving its work: ${c.step ?? 'working'}... The tool is stopped meanwhile and starts again by itself.`); $('notice-spin').hidden = false; return; }
|
|
1229
1231
|
if (c && c.phase === 'failed') { disconnect(); say('failed', 'ended'); show(c.error ?? 'This conversation could not be built.', DEVICE ? undefined : 'Build it again', () => void rebuild()); return; }
|
|
@@ -1330,9 +1332,10 @@
|
|
|
1330
1332
|
/* ONE FLAT POINT per conversation, its colour the state -- the worst that applies: a machine problem (red),
|
|
1331
1333
|
the agent waits for you (blue), the agent at work (gold, pulsing), the machine busy (amber, pulsing),
|
|
1332
1334
|
fine (green), asleep (a hollow ring). The same point, same colours, sums a folded group below. */
|
|
1333
|
-
|
|
1335
|
+
/* Stopped is off as asleep is (14-11: a stopped one had the green point of one that runs). */
|
|
1336
|
+
const machineState = (c) => (c.asleep || c.stopped === true ? 'off' : (c.phase === 'failed' || healthNeeds(c)) ? 'problem'
|
|
1334
1337
|
: (holds(c) || ['building', 'restarting', 'moving'].includes(c.phase)) ? 'busy' : 'online');
|
|
1335
|
-
const agentState = (c) => (c.asleep ? 'sleep' : (talkNeeds(c) || c.answerer?.needs) ? 'wait'
|
|
1338
|
+
const agentState = (c) => (c.asleep || c.stopped === true ? 'sleep' : (talkNeeds(c) || c.answerer?.needs) ? 'wait'
|
|
1336
1339
|
: c.talk?.state === 'working' ? 'work' : c.talk?.state === 'done' ? 'done' : 'idle');
|
|
1337
1340
|
const STATE_WORDS = KIT.STATE_WORDS;
|
|
1338
1341
|
const rollup = (c) => { const m = machineState(c); const a = agentState(c);
|
|
@@ -1433,9 +1436,9 @@
|
|
|
1433
1436
|
/* Under way: the step the panel shows, in its words (the tool named once). */
|
|
1434
1437
|
const under = c.phase === 'building' && /^(Copying|Taking|Putting|Giving)\b/.test(c.step ?? '') ? c.step : c.progress && ['building', 'restarting', 'ready'].includes(c.phase) ? stepNow(c.progress, c.toolLabel) : '';
|
|
1435
1438
|
/* What it is doing, when it says something: its tool is not named on every row. */
|
|
1436
|
-
const now = under || (holds(c) && c.phase !== 'building' ? (c.progress.kind === 'build' ? uiSaid('set-list-starting', 'starting') : uiSaid('set-list-restarting', 'restarting')) : c.phase === 'ready' ? (c.asleep ? uiSaid('set-list-asleep', 'asleep') : '') : c.phase === 'building' ? (c.step ?? 'building') : c.phase === 'moving' ? uiSaid('set-list-moving', 'moving its work') : c.phase === 'restarting' ? uiSaid('set-list-restarting', 'restarting') : uiSaid('set-list-failed', 'failed'));
|
|
1439
|
+
const now = under || (holds(c) && c.phase !== 'building' ? (c.progress.kind === 'build' ? uiSaid('set-list-starting', 'starting') : uiSaid('set-list-restarting', 'restarting')) : c.phase === 'ready' ? (c.asleep ? uiSaid('set-list-asleep', 'asleep') : c.stopped === true ? uiSaid('set-list-stopped', 'stopped') : '') : c.phase === 'building' ? (c.step ?? 'building') : c.phase === 'moving' ? uiSaid('set-list-moving', 'moving its work') : c.phase === 'restarting' ? uiSaid('set-list-restarting', 'restarting') : uiSaid('set-list-failed', 'failed'));
|
|
1437
1440
|
/* The line of its tool only when it says something: under way, asleep, failed -- not "Claude Code" again and again. */
|
|
1438
|
-
const plain = c.phase === 'ready' && !c.asleep && !under && !holds(c);
|
|
1441
|
+
const plain = c.phase === 'ready' && !c.asleep && c.stopped !== true && !under && !holds(c);
|
|
1439
1442
|
const chips = [];
|
|
1440
1443
|
/* Found by a search while hidden: said. */
|
|
1441
1444
|
if (c.hidden === true && query) chips.push({ text: uiSaid('set-list-hidden', 'hidden'), cls: 'shared-mark', tone: 'note' });
|
|
@@ -1934,7 +1937,7 @@
|
|
|
1934
1937
|
async function refresh() {
|
|
1935
1938
|
clearTimeout(pollTimer);
|
|
1936
1939
|
try {
|
|
1937
|
-
const mark = (x) => (x ? `${x.phase}/${x.asleep === true}/${holds(x)}/${Boolean(x.machine)}/${x.stopped === true}` : '');
|
|
1940
|
+
const mark = (x) => (x ? `${x.phase}/${x.asleep === true}/${holds(x)}/${Boolean(x.machine)}/${x.stopped === true}/${Boolean(x.lentTo)}` : '');
|
|
1938
1941
|
const before = mark(conversations.find((x) => x.name === current));
|
|
1939
1942
|
if (DEVICE) {
|
|
1940
1943
|
const mePath = () => `${API}/me?c=${encodeURIComponent(current)}`;
|
|
@@ -1993,12 +1996,18 @@
|
|
|
1993
1996
|
async function paintJobs() {
|
|
1994
1997
|
try { const r = await fetch(`${API}/jobs`); if (!r.ok) return; jobsNow = await r.json(); } catch { return; }
|
|
1995
1998
|
const failed = jobsNow.done.filter((j) => j.result === 'failed' && String(j.endedAt) > jobsSeen()).length;
|
|
1996
|
-
const badge = $('jobs-open');
|
|
1997
1999
|
const n = jobsNow.running.length;
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2000
|
+
/* Two places, one state: by the list's title, and in the bar of the conversation open (its list folded
|
|
2001
|
+
away, or a phone's, a screen of its own) -- shorter there, the bar is narrow. */
|
|
2002
|
+
for (const [id, words] of [['jobs-open', n ? `${n} under way` : `${failed} failed`], ['jobs-room', n ? String(n) : '!']]) {
|
|
2003
|
+
const badge = $(id);
|
|
2004
|
+
badge.hidden = !n && !failed;
|
|
2005
|
+
badge.dataset.tone = !n && failed ? 'bad' : '';
|
|
2006
|
+
badge.textContent = words;
|
|
2007
|
+
badge.title = n ? `Under way: ${jobsNow.running.map((j) => j.what).join(' · ')}` : 'Failed: tap to see what';
|
|
2008
|
+
badge.setAttribute('aria-label', n ? `${n} under way` : `${failed} failed`);
|
|
2009
|
+
}
|
|
2010
|
+
if (n || failed) $('back').dataset.jobs = n ? 'on' : 'bad'; else delete $('back').dataset.jobs;
|
|
2002
2011
|
if (!$('jobs').hidden) paintJobsList();
|
|
2003
2012
|
}
|
|
2004
2013
|
function paintJobsList() {
|
|
@@ -2018,15 +2027,22 @@
|
|
|
2018
2027
|
if (!parts.length) parts.push(Object.assign(document.createElement('p'), { className: 'hint', textContent: 'Nothing under way.' }));
|
|
2019
2028
|
$('jobs').replaceChildren(...parts);
|
|
2020
2029
|
}
|
|
2021
|
-
function closeJobs() { $('jobs').hidden = true;
|
|
2022
|
-
|
|
2030
|
+
function closeJobs() { $('jobs').hidden = true; for (const id of ['jobs-open', 'jobs-room']) $(id).setAttribute('aria-expanded', 'false'); }
|
|
2031
|
+
for (const id of ['jobs-open', 'jobs-room']) $(id).addEventListener('click', () => {
|
|
2023
2032
|
if (!$('jobs').hidden) { closeJobs(); return; }
|
|
2024
|
-
paintJobsList();
|
|
2033
|
+
paintJobsList();
|
|
2034
|
+
/* Under the badge tapped, kept within the screen. */
|
|
2035
|
+
const at = $(id).getBoundingClientRect(); const pop = $('jobs');
|
|
2036
|
+
pop.hidden = false;
|
|
2037
|
+
pop.style.top = `${Math.round(at.bottom + 6)}px`;
|
|
2038
|
+
pop.style.left = `${Math.round(Math.max(8, Math.min(at.left, window.innerWidth - pop.offsetWidth - 8)))}px`;
|
|
2039
|
+
$(id).setAttribute('aria-expanded', 'true');
|
|
2025
2040
|
try { localStorage.setItem(JOBS_SEEN, new Date().toISOString()); } catch { /* kept for this visit only */ }
|
|
2026
|
-
if (!jobsNow.running.length) $('jobs-open').hidden = true;
|
|
2041
|
+
if (!jobsNow.running.length) { $('jobs-open').hidden = true; $('jobs-room').hidden = true; delete $('back').dataset.jobs; }
|
|
2027
2042
|
});
|
|
2028
|
-
document.addEventListener('click', (event) => { if (!$('jobs').hidden && !event.target.closest('#jobs, #jobs-open')) closeJobs(); });
|
|
2029
|
-
|
|
2043
|
+
document.addEventListener('click', (event) => { if (!$('jobs').hidden && !event.target.closest('#jobs, #jobs-open, #jobs-room')) closeJobs(); });
|
|
2044
|
+
/* Escape closes the list, and only it: never the conversation under it too (14-11: the page went to « No conversation »). */
|
|
2045
|
+
document.addEventListener('keydown', (event) => { if (event.key === 'Escape' && !$('jobs').hidden) { event.stopImmediatePropagation(); event.preventDefault(); closeJobs(); } }, true);
|
|
2030
2046
|
|
|
2031
2047
|
/* ---------- A NEW CONVERSATION: a page of its own, as Settings ----------
|
|
2032
2048
|
"+ New" opens it beside the list (the whole screen on a phone), with an
|
|
@@ -2652,7 +2668,19 @@
|
|
|
2652
2668
|
}
|
|
2653
2669
|
/* Its tool's memory, exported as one file, or put back from one (#351): the person's own act, from here. */
|
|
2654
2670
|
$('carry-box').hidden = DEVICE || !here;
|
|
2671
|
+
/* Its machine must run to be read: stopped or asleep, said there, with the one button that starts it
|
|
2672
|
+
(14-11: a raw « Its machine is not running » came back as the file). */
|
|
2673
|
+
const down = here?.stopped === true || here?.asleep === true;
|
|
2655
2674
|
$('carry-export').href = `${API}/conversations/${encodeURIComponent(current)}/export`;
|
|
2675
|
+
$('carry-export').toggleAttribute('aria-disabled', down);
|
|
2676
|
+
$('carry-export').onclick = down ? (event) => { event.preventDefault(); } : null;
|
|
2677
|
+
$('carry-import').disabled = down;
|
|
2678
|
+
$('carry-said').hidden = !down;
|
|
2679
|
+
if (down) {
|
|
2680
|
+
const start = Object.assign(document.createElement('button'), { type: 'button', className: 'inline', textContent: here.asleep === true ? uiSaid('set-wake-it', 'Wake it') : uiSaid('set-m-start', 'Start') });
|
|
2681
|
+
start.addEventListener('click', () => { leavePanel(); connect(); });
|
|
2682
|
+
$('carry-said').replaceChildren(uiSaid('set-carry-down', 'It must run to export or import.'), ' ', start);
|
|
2683
|
+
}
|
|
2656
2684
|
$('carry-import').onclick = () => $('carry-file').click();
|
|
2657
2685
|
$('carry-file').onchange = () => {
|
|
2658
2686
|
const file = $('carry-file').files?.[0]; $('carry-file').value = '';
|
package/web/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<link rel="stylesheet" href="/vendor/diff2html.css">
|
|
15
15
|
<div id="app" data-place="conversations">
|
|
16
16
|
<aside id="list" hidden>
|
|
17
|
-
<div class="top"><b id="list-title" title="Conversations">Clavarium</b><!-- WHAT IT IS DOING (jobs.mjs, 14-11): shown only while something runs, or failed unseen. --><button type="button" id="jobs-open" class="jobs-badge" hidden aria-expanded="false" aria-controls="jobs"></button><span class="top-acts"><button type="button" id="list-pin" class="icon-btn" aria-pressed="false" aria-label="Keep the list open" title="Keep the list open: it no longer folds when a conversation is opened"><svg class="ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 17v5"/><path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z"/></svg></button><button type="button" id="install-top" class="icon-btn" hidden aria-label="Install as an app" title="Install as an app: its own icon, full screen, no browser bar"><svg class="ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3v12"/><path d="m7 10 5 5 5-5"/><path d="M5 21h14"/></svg></button><button type="button" id="search-open" class="icon-btn" aria-label="Search conversations" title="Search (/ or Ctrl+K)" aria-expanded="false" aria-controls="search"><svg class="ic" viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg></button><button type="button" id="new" class="icon-btn new-btn" aria-label="New conversation" title="New conversation"><svg class="ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14"/><path d="M5 12h14"/></svg></button></span
|
|
17
|
+
<div class="top"><b id="list-title" title="Conversations">Clavarium</b><!-- WHAT IT IS DOING (jobs.mjs, 14-11): shown only while something runs, or failed unseen. --><button type="button" id="jobs-open" class="jobs-badge" hidden aria-expanded="false" aria-controls="jobs"></button><span class="top-acts"><button type="button" id="list-pin" class="icon-btn" aria-pressed="false" aria-label="Keep the list open" title="Keep the list open: it no longer folds when a conversation is opened"><svg class="ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 17v5"/><path d="M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z"/></svg></button><button type="button" id="install-top" class="icon-btn" hidden aria-label="Install as an app" title="Install as an app: its own icon, full screen, no browser bar"><svg class="ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3v12"/><path d="m7 10 5 5 5-5"/><path d="M5 21h14"/></svg></button><button type="button" id="search-open" class="icon-btn" aria-label="Search conversations" title="Search (/ or Ctrl+K)" aria-expanded="false" aria-controls="search"><svg class="ic" viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg></button><button type="button" id="new" class="icon-btn new-btn" aria-label="New conversation" title="New conversation"><svg class="ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14"/><path d="M5 12h14"/></svg></button></span></div>
|
|
18
18
|
<!-- SEARCH, discreet: opened by the magnifier, "/" or Ctrl+K; filters as it is typed. -->
|
|
19
19
|
<div id="search" role="search" hidden><input id="search-field" type="search" placeholder="Search" aria-label="Search conversations: name, folder, identifier, tool" autocomplete="off" spellcheck="false" maxlength="60" aria-controls="items"></div>
|
|
20
20
|
<!-- Needs you and Recent: copies of rows of the list below, by when they were last used (app.js, paint). -->
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
<button type="button" id="fold" aria-label="Hide the list of conversations" aria-pressed="false" title="Hide or show the list of conversations">«</button>
|
|
47
47
|
<span id="state" data-state="connecting" role="status">connecting</span>
|
|
48
48
|
<b id="name"></b>
|
|
49
|
+
<button type="button" id="jobs-room" class="jobs-badge jobs-room" hidden aria-expanded="false" aria-controls="jobs"></button>
|
|
49
50
|
<!-- THE BAR: its chat, its terminal, what it was given, its binders (once it has one), its settings (G). -->
|
|
50
51
|
<div id="views" class="views" role="group" aria-label="What to see">
|
|
51
52
|
<button type="button" id="view-chat" aria-pressed="false" title="Its chat"><svg class="ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414 .586l-2.202 2.202A.71 .71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"/></svg><span>Chat</span></button>
|
|
@@ -1499,6 +1500,7 @@
|
|
|
1499
1500
|
<script src="/vendor/diff2html.js"></script>
|
|
1500
1501
|
<script src="/gitgraph.js"></script>
|
|
1501
1502
|
<script src="/links.js"></script>
|
|
1503
|
+
<div id="jobs" class="jobs-pop" role="dialog" aria-label="Under way" hidden></div>
|
|
1502
1504
|
<script src="/features.js"></script>
|
|
1503
1505
|
<script src="/kit.js"></script>
|
|
1504
1506
|
<script src="/mail-view.js"></script>
|
package/web/style.css
CHANGED
|
@@ -1426,11 +1426,16 @@ select.pill { appearance: auto; }
|
|
|
1426
1426
|
#list .top-acts { display: flex; align-items: center; gap: 6px; }
|
|
1427
1427
|
#list-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
|
1428
1428
|
/* What it is doing (14-11): a small badge by the title, its list folded under it. */
|
|
1429
|
-
#list .top { position: relative; }
|
|
1430
1429
|
.jobs-badge { display: inline-flex; align-items: center; gap: 6px; flex: none; margin-left: 8px; margin-right: auto; padding: 2px 10px; min-height: 0; border: 1px solid var(--brass); border-radius: 999px; background: transparent; color: var(--brass-ink); font-size: .75rem; font-weight: 600; white-space: nowrap; }
|
|
1431
1430
|
.jobs-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
|
|
1431
|
+
.jobs-room { margin: 0; padding: 2px 4px; gap: 4px; border-color: transparent; }
|
|
1432
|
+
/* A phone's bar has no room for it: a dot on its way back to the list, where the badge is. */
|
|
1433
|
+
@media (max-width: 480px) { .jobs-room { display: none !important; } }
|
|
1434
|
+
#back[data-jobs] { position: relative; }
|
|
1435
|
+
#back[data-jobs]::after { content: ""; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); }
|
|
1436
|
+
#back[data-jobs="bad"]::after { background: var(--danger); }
|
|
1432
1437
|
.jobs-badge[data-tone="bad"] { border-color: var(--danger); color: var(--danger); }
|
|
1433
|
-
.jobs-pop { position:
|
|
1438
|
+
.jobs-pop { position: fixed; z-index: 60; width: min(340px, calc(100vw - 16px)); max-height: 60vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgb(0 0 0 / .35); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
|
|
1434
1439
|
.jobs-pop h3 { margin: 2px 0 0; font-size: .8125rem; }
|
|
1435
1440
|
.jobs-pop .job { display: grid; grid-template-columns: 16px 1fr; gap: 2px 8px; text-align: left; background: transparent; border: 0; padding: 4px 0; color: var(--ink); font: inherit; font-size: .8125rem; cursor: pointer; }
|
|
1436
1441
|
.jobs-pop .job small { grid-column: 2; color: var(--ink2); overflow-wrap: anywhere; }
|
|
@@ -3072,3 +3077,4 @@ button.kit-switch[aria-checked="true"]::after { left: 18px; background: var(--ok
|
|
|
3072
3077
|
/* At hand (13-11): a switch's name never under its buttons -- the name keeps its width, the buttons wrap. */
|
|
3073
3078
|
.hand-switches .set-row > .set-what { flex: none; }
|
|
3074
3079
|
.hand-switches .set-row > .set-control { flex: 0 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
|
|
3080
|
+
a.button[aria-disabled] { opacity: .5; pointer-events: none; }
|