clavarium 0.2.137-beta.1 → 0.2.138-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.
- package/config/launch/claude-code.sh +32 -19
- package/config/launch/codex.sh +36 -0
- package/config/launch/json-set.mjs +5 -2
- package/config/launch/mcp-relay.mjs +98 -0
- package/config/launch/screen-watch.mjs +69 -0
- package/config/launch/toml-block.mjs +26 -0
- package/config/launch/vibe.sh +39 -0
- package/config/tools.json +57 -0
- package/npm-shrinkwrap.json +18 -18
- package/package.json +5 -5
- package/server/api.mjs +18 -1
- package/server/guide.mjs +2 -0
- package/server/main.mjs +15 -1
- package/server/talk.mjs +10 -0
- package/web/app.js +44 -2
- package/web/index.html +7 -1
- package/web/style.css +30 -8
|
@@ -17,33 +17,46 @@ esac
|
|
|
17
17
|
[ $# -gt 0 ] || { echo "launch: no command to run" >&2; exit 64; }
|
|
18
18
|
node "$(dirname "$0")/json-set.mjs" .claude/settings.json "$keys" \
|
|
19
19
|
|| echo "launch: the settings of Claude Code were not changed: it may ask before acting" >&2
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
# ITS FIRST QUESTIONS ANSWERED BEFORE THEY ARE ASKED (02-11): the welcome (theme, tips) taken as seen, and its
|
|
21
|
+
# work folder trusted -- in its own file, as it records them itself; nothing to answer in the terminal.
|
|
22
|
+
node "$(dirname "$0")/json-set.mjs" .claude.json '{"hasCompletedOnboarding": true, "projects": {"/work": {"hasTrustDialogAccepted": true}}}' \
|
|
23
|
+
|| echo "launch: Claude Code may ask its first questions in the terminal" >&2
|
|
24
|
+
# ITS TOOLS (MCP), EACH THROUGH THE RELAY (02-11): a tool updated on the machine is taken up between two of
|
|
25
|
+
# its requests -- whatever the tool, the session never restarted, nothing for the agent to do. Declared
|
|
26
|
+
# once, by Claude Code itself (its other servers kept); an older declaration without the relay is replaced.
|
|
27
|
+
# Looked for in its settings first, since asking Claude Code takes seconds. Nothing stops the start.
|
|
28
|
+
relay="$(dirname "$0")/mcp-relay.mjs"
|
|
29
|
+
tool() { # NAME FOLDER COMMAND ARGS...
|
|
30
|
+
name="$1"; folder="$2"; shift 2
|
|
31
|
+
if grep -q "\"$folder\"" "$HOME/.claude.json" 2>/dev/null && grep -q "mcp-relay.mjs" "$HOME/.claude.json" 2>/dev/null \
|
|
32
|
+
&& node -e 'const d=require(process.argv[1]);const s=d.mcpServers?.[process.argv[2]];const a=JSON.stringify(s?.args??[]);process.exit(a.includes("mcp-relay.mjs")&&a.includes(JSON.stringify(process.argv[3]))?0:1)' "$HOME/.claude.json" "$name" "$1" 2>/dev/null; then return 0; fi
|
|
33
|
+
claude mcp remove --scope user "$name" >/dev/null 2>&1
|
|
34
|
+
claude mcp add --scope user "$name" -- node "$relay" "$@" >/dev/null 2>&1 \
|
|
35
|
+
|| echo "launch: $name was not given to Claude Code as tools: the command $name still works" >&2
|
|
36
|
+
}
|
|
37
|
+
# Parley, the chat of the conversation, when it has one: the version installed on the machine (parley-mcp),
|
|
38
|
+
# else the copy beside the chat.
|
|
24
39
|
chat="${PARLEY_DIR:-/work/.parley}"
|
|
25
|
-
if [ -f "$chat/server.mjs" ]
|
|
26
|
-
|
|
27
|
-
|| echo "launch: Parley was not given to Claude Code as tools: the command parley still works" >&2
|
|
40
|
+
if [ -f "$chat/server.mjs" ]; then
|
|
41
|
+
if command -v parley-mcp >/dev/null 2>&1; then tool parley "$chat" parley-mcp --dir "$chat"; else tool parley "$chat" node "$chat/server.mjs" --dir "$chat"; fi
|
|
28
42
|
fi
|
|
29
|
-
#
|
|
30
|
-
# reminders it sets itself. The same as the command "docket", installed in every machine.
|
|
43
|
+
# Its docket, with its chat: what woke it, to say done or failed; the reminders it sets itself.
|
|
31
44
|
docket="/work/.docket"
|
|
32
|
-
if [ -f "$chat/server.mjs" ] && command -v docket-mcp >/dev/null 2>&1
|
|
33
|
-
|
|
34
|
-
|| echo "launch: Docket was not given to Claude Code as tools: the command docket still works" >&2
|
|
35
|
-
fi
|
|
36
|
-
# ITS TETHER AS ITS OWN TOOLS (MCP): the accesses it was given -- a mailbox, a calendar, an address
|
|
37
|
-
# book, an online folder, a machine over SSH. The server holds the keys; it acts within its rights.
|
|
45
|
+
if [ -f "$chat/server.mjs" ] && command -v docket-mcp >/dev/null 2>&1; then tool docket "$docket" docket-mcp --dir "$docket"; fi
|
|
46
|
+
# Its tether: the accesses it was given (a mailbox, a calendar, a folder, a machine over SSH).
|
|
38
47
|
tether="/work/.tether"
|
|
39
|
-
if command -v tether-mcp >/dev/null 2>&1
|
|
40
|
-
claude mcp add --scope user tether -- tether-mcp --dir "$tether" >/dev/null 2>&1 \
|
|
41
|
-
|| echo "launch: Tether was not given to Claude Code as tools: the command tether still works" >&2
|
|
42
|
-
fi
|
|
48
|
+
if command -v tether-mcp >/dev/null 2>&1; then tool tether "$tether" tether-mcp --dir "$tether"; fi
|
|
43
49
|
# ITS PULSE: Claude Code's own hooks say to the chat that it acts, and when its turn ends, so that
|
|
44
50
|
# the person sees "Working..." while it works without a word (parley pulse; nothing posted).
|
|
45
51
|
if [ -f "$chat/server.mjs" ]; then
|
|
46
52
|
node "$(dirname "$0")/claude-pulse.mjs" "$chat" \
|
|
47
53
|
|| echo "launch: the chat will not say when Claude Code works without a word" >&2
|
|
48
54
|
fi
|
|
55
|
+
# WHAT ITS SCREEN ASKS (02-11), read by the generic screen-watch -- Claude Code's own words, here and only
|
|
56
|
+
# here: its sign-in link sent to the person's chat; an update installed told to the agent, which restarts
|
|
57
|
+
# when it suits it (never in the middle of its work). A tool that changes its words: only these lines change.
|
|
58
|
+
node "$(dirname "$0")/screen-watch.mjs" \
|
|
59
|
+
'link:https://(claude\.ai|claude\.com|console\.anthropic\.com)/[^ ]*oauth[^ ]*' \
|
|
60
|
+
'notice:(update|updated|installed)[^\n]{0,80}restart=Your tool was updated: when nothing runs, touch /work/.parley/restart-asked to take it up.' \
|
|
61
|
+
</dev/null >/dev/null 2>&1 &
|
|
49
62
|
exec "$@"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# THE LAUNCHER OF CODEX (OpenAI), run by Clavarium in its machine at each start (config/tools.json,
|
|
3
|
+
# "launch"), from the read-only /tools. Arguments: the rights chosen by the owner (full, ask), then the
|
|
4
|
+
# command to run, as Clavarium made it. All that is Codex's own is here, and only here (02-11).
|
|
5
|
+
mode="$1"; shift
|
|
6
|
+
case "$mode" in full|ask) ;; *) echo "launch: the first argument is full or ask" >&2; exit 64 ;; esac
|
|
7
|
+
[ $# -gt 0 ] || { echo "launch: no command to run" >&2; exit 64; }
|
|
8
|
+
here="$(dirname "$0")"; relay="$here/mcp-relay.mjs"
|
|
9
|
+
chat="${PARLEY_DIR:-/work/.parley}"; docket="/work/.docket"; tether="/work/.tether"
|
|
10
|
+
# ITS SETTINGS (~/.codex/config.toml), in a block of their own, the rest kept: its work folder trusted (no
|
|
11
|
+
# question at its first start), and its tools (MCP) each through the relay -- a tool updated on the
|
|
12
|
+
# machine taken up between two requests, never a restart.
|
|
13
|
+
block='[projects."/work"]
|
|
14
|
+
trust_level = "trusted"'
|
|
15
|
+
if [ -f "$chat/server.mjs" ] && command -v parley-mcp >/dev/null 2>&1; then block="$block
|
|
16
|
+
[mcp_servers.parley]
|
|
17
|
+
command = \"node\"
|
|
18
|
+
args = [\"$relay\", \"parley-mcp\", \"--dir\", \"$chat\"]"; fi
|
|
19
|
+
if [ -f "$chat/server.mjs" ] && command -v docket-mcp >/dev/null 2>&1; then block="$block
|
|
20
|
+
[mcp_servers.docket]
|
|
21
|
+
command = \"node\"
|
|
22
|
+
args = [\"$relay\", \"docket-mcp\", \"--dir\", \"$docket\"]"; fi
|
|
23
|
+
if command -v tether-mcp >/dev/null 2>&1; then block="$block
|
|
24
|
+
[mcp_servers.tether]
|
|
25
|
+
command = \"node\"
|
|
26
|
+
args = [\"$relay\", \"tether-mcp\", \"--dir\", \"$tether\"]"; fi
|
|
27
|
+
node "$here/toml-block.mjs" .codex/config.toml tools "$block" \
|
|
28
|
+
|| echo "launch: Codex may ask its first questions, and has not its tools (MCP)" >&2
|
|
29
|
+
# WHAT ITS SCREEN ASKS, read by the generic screen-watch -- Codex's own words: its sign-in link (and the
|
|
30
|
+
# code beside it) sent to the person's chat; an update told to the agent, which restarts when it suits it.
|
|
31
|
+
node "$here/screen-watch.mjs" \
|
|
32
|
+
'link:https://auth\.openai\.com/[^ ]+' \
|
|
33
|
+
'link:https://chatgpt\.com/[^ ]*auth[^ ]*' \
|
|
34
|
+
'notice:update available[^\n]{0,120}=Your tool has an update: when nothing runs, touch /work/.parley/restart-asked to take it up.' \
|
|
35
|
+
</dev/null >/dev/null 2>&1 &
|
|
36
|
+
exec "$@"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* json-set FILE KEYS: sets KEYS (a JSON object; null takes a key out) in the
|
|
2
|
-
* JSON file FILE of the home, every other key kept
|
|
2
|
+
* JSON file FILE of the home, every other key kept -- inside objects too (02-11:
|
|
3
|
+
* {"projects": {"/work": {...}}} keeps the other projects and their other keys). Written only when it
|
|
3
4
|
* changes, readable by its owner alone. A file that is not a JSON object is
|
|
4
5
|
* not touched (exit 3): a person's settings are never overwritten by a guess.
|
|
5
6
|
*
|
|
@@ -21,7 +22,9 @@ try { data = JSON.parse(readFileSync(at, 'utf8')); } catch (error) {
|
|
|
21
22
|
}
|
|
22
23
|
if (!data || typeof data !== 'object' || Array.isArray(data)) { console.error(`json-set: ${file} is not a JSON object: left as it is`); process.exit(3); }
|
|
23
24
|
const was = JSON.stringify(data);
|
|
24
|
-
|
|
25
|
+
const plain = (v) => v && typeof v === 'object' && !Array.isArray(v);
|
|
26
|
+
const merge = (into, from) => { for (const [k, v] of Object.entries(from)) { if (v === null) delete into[k]; else if (plain(v) && plain(into[k])) merge(into[k], v); else into[k] = v; } };
|
|
27
|
+
merge(data, keys);
|
|
25
28
|
if (JSON.stringify(data) !== was) {
|
|
26
29
|
mkdirSync(dirname(at), { recursive: true, mode: 0o700 });
|
|
27
30
|
writeFileSync(`${at}.new`, `${JSON.stringify(data, null, 2)}\n`, { mode: 0o600 });
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/* TAKEN UP WITHOUT A RESTART (02-11), FOR EVERY TOOL OF EVERY CONVERSATION: the launcher gives Claude Code
|
|
2
|
+
* each MCP server through this relay -- `node mcp-relay.mjs COMMAND ARGS...` -- so a tool updated on the
|
|
3
|
+
* machine is taken up between two requests, whatever the tool, with nothing for the agent to do. Its
|
|
4
|
+
* version is the package.json of the package its command comes from.
|
|
5
|
+
*
|
|
6
|
+
* (Below, the relay as each Clavarium tool also carries it.)
|
|
7
|
+
* An MCP server lives as long as the session that started it: a new
|
|
8
|
+
* version installed under it was not seen until the session itself was restarted ("on ne peut pas mettre à
|
|
9
|
+
* jour un composant sans redémarrer la session ?"). So the server runs as a child of this relay; between two
|
|
10
|
+
* requests, when the version installed on disk is no longer the child's, the relay starts the new one, says
|
|
11
|
+
* hello to it as the session did, and tells the session its tools may have changed. Nothing is lost: a
|
|
12
|
+
* request in flight is answered by the child it went to, the next goes to the new one. */
|
|
13
|
+
import { spawn } from 'node:child_process';
|
|
14
|
+
import { readFileSync } from 'node:fs';
|
|
15
|
+
import { createInterface } from 'node:readline';
|
|
16
|
+
|
|
17
|
+
/* -> the version installed now, read from package.json (null if unreadable: keep the child). */
|
|
18
|
+
export const installedVersion = (packageJson) => { try { return String(JSON.parse(readFileSync(packageJson, 'utf8')).version ?? '') || null; } catch { return null; } };
|
|
19
|
+
|
|
20
|
+
export function relay({ command = process.execPath, args, packageJson, input = process.stdin, output = process.stdout, spawner = spawn, version = installedVersion, log = () => {} }) {
|
|
21
|
+
let child = null; let running = null; let hello = null; let helloDone = false;
|
|
22
|
+
const pending = new Set(); const queue = [];
|
|
23
|
+
const send = (m) => output.write(`${JSON.stringify(m)}\n`);
|
|
24
|
+
const start = () => {
|
|
25
|
+
running = version(packageJson);
|
|
26
|
+
const c = spawner(command, args, { stdio: ['pipe', 'pipe', 'inherit'], env: { ...process.env, MCP_RELAYED: '1' } });
|
|
27
|
+
child = c;
|
|
28
|
+
createInterface({ input: c.stdout }).on('line', (line) => {
|
|
29
|
+
let m; try { m = JSON.parse(line); } catch { return; }
|
|
30
|
+
if (m && typeof m.id === 'string' && m.id.startsWith('relay:')) return; /* its answer to our own hello */
|
|
31
|
+
if (m && m.id !== undefined) pending.delete(m.id);
|
|
32
|
+
output.write(`${line}\n`);
|
|
33
|
+
if (pending.size === 0) flush();
|
|
34
|
+
});
|
|
35
|
+
c.on('exit', () => {
|
|
36
|
+
if (child !== c) return;
|
|
37
|
+
child = null;
|
|
38
|
+
/* It stopped under a request: answered, never left waiting; the next one starts it again. */
|
|
39
|
+
for (const id of pending) send({ jsonrpc: '2.0', id, error: { code: -32603, message: 'The tool stopped; try again.' } });
|
|
40
|
+
pending.clear(); flush();
|
|
41
|
+
});
|
|
42
|
+
return c;
|
|
43
|
+
};
|
|
44
|
+
const greet = (c) => {
|
|
45
|
+
if (!hello) return;
|
|
46
|
+
c.stdin.write(`${JSON.stringify({ ...hello, id: `relay:${Date.now()}` })}\n`);
|
|
47
|
+
c.stdin.write(`${JSON.stringify({ jsonrpc: '2.0', method: 'notifications/initialized' })}\n`);
|
|
48
|
+
};
|
|
49
|
+
/* Between requests: the new version if there is one (once nothing is in flight), then what waited. */
|
|
50
|
+
const needsNew = () => { if (!child) return true; if (!helloDone) return false; const now = version(packageJson); return Boolean(now && now !== running); };
|
|
51
|
+
const flush = () => {
|
|
52
|
+
while (queue.length) {
|
|
53
|
+
if (needsNew()) {
|
|
54
|
+
if (pending.size > 0) return;
|
|
55
|
+
const old = child; const was = running;
|
|
56
|
+
const c = start(); greet(c);
|
|
57
|
+
log(`relay: ${was} -> ${running}`);
|
|
58
|
+
try { old?.stdin.end(); old?.kill(); } catch { /* gone already */ }
|
|
59
|
+
if (helloDone) send({ jsonrpc: '2.0', method: 'notifications/tools/list_changed' });
|
|
60
|
+
}
|
|
61
|
+
const m = queue.shift();
|
|
62
|
+
if (m.id !== undefined) pending.add(m.id);
|
|
63
|
+
child.stdin.write(`${JSON.stringify(m)}\n`);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
start();
|
|
67
|
+
createInterface({ input }).on('line', (line) => {
|
|
68
|
+
let m; try { m = JSON.parse(line); } catch { return; }
|
|
69
|
+
if (!m || typeof m !== 'object') return;
|
|
70
|
+
if (m.method === 'initialize') { hello = m; }
|
|
71
|
+
if (m.method === 'notifications/initialized') helloDone = true;
|
|
72
|
+
queue.push(m);
|
|
73
|
+
flush();
|
|
74
|
+
});
|
|
75
|
+
input.on('end', () => { try { child?.stdin.end(); } catch { /* gone */ } });
|
|
76
|
+
return { get child() { return child; }, get version() { return running; } };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* The package a command comes from: its file followed to the end of its links, then up to a package.json. */
|
|
80
|
+
import { realpathSync, existsSync, statSync } from 'node:fs';
|
|
81
|
+
import { delimiter, dirname, join, isAbsolute } from 'node:path';
|
|
82
|
+
import { fileURLToPath } from 'node:url';
|
|
83
|
+
export function packageOf(command, path = process.env.PATH ?? '') {
|
|
84
|
+
const found = isAbsolute(command) ? command : path.split(delimiter).map((d) => join(d, command)).find((f) => { try { return statSync(f).isFile(); } catch { return false; } });
|
|
85
|
+
if (!found) return null;
|
|
86
|
+
let at; try { at = dirname(realpathSync(found)); } catch { return null; }
|
|
87
|
+
for (let i = 0; i < 6; i++) { if (existsSync(join(at, 'package.json'))) return join(at, 'package.json'); const up = dirname(at); if (up === at) break; at = up; }
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const HERE = fileURLToPath(import.meta.url);
|
|
91
|
+
const main = (() => { try { return realpathSync(process.argv[1] ?? '') === realpathSync(HERE); } catch { return false; } })();
|
|
92
|
+
if (main) {
|
|
93
|
+
const [command, ...args] = process.argv.slice(2);
|
|
94
|
+
if (!command) { process.stderr.write('mcp-relay: COMMAND [ARGS...]\n'); process.exit(64); }
|
|
95
|
+
/* A node script given by its path (node /x/server.mjs): its package is that of the script. */
|
|
96
|
+
const target = /(^|\/)node$/.test(command) && args[0] ? args[0] : command;
|
|
97
|
+
relay({ command, args, packageJson: packageOf(target) ?? '/nonexistent/package.json' });
|
|
98
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* screen-watch RULE... : a generic reader of the tool's terminal (02-11). Every few seconds it reads the
|
|
2
|
+
* bottom of the screen of the tool (tmux) and acts on what a launcher said to look for -- nothing here
|
|
3
|
+
* knows a tool: its launcher (claude-code.sh, a codex.sh...) gives the rules, so a tool that changes its
|
|
4
|
+
* words is followed by changing its launcher alone.
|
|
5
|
+
*
|
|
6
|
+
* A rule: KIND:PATTERN[=VALUE], PATTERN a JavaScript regular expression (flag i).
|
|
7
|
+
* link:PATTERN a link on the screen (the match): sent in the chat, to be opened by the person
|
|
8
|
+
* (a sign-in, say); once per link.
|
|
9
|
+
* notice:PATTERN=TEXT something the agent should know (an update installed, to be taken up by a
|
|
10
|
+
* restart): TEXT given to the agent, as a reminder it is woken by (docket); once per screen.
|
|
11
|
+
* The agent decides when it suits it -- never restarted in the middle of its work (02-11).
|
|
12
|
+
* keys:PATTERN=K a question with one answer always: the keys K typed (Enter, Down, Up, Escape, 1, y...),
|
|
13
|
+
* once per screen. Only what its launcher wrote: nothing else is ever typed.
|
|
14
|
+
* Only the last LINES lines are read: what the tool prints of its own work above never counts.
|
|
15
|
+
*/
|
|
16
|
+
import { spawnSync } from 'node:child_process';
|
|
17
|
+
|
|
18
|
+
const LINES = 12; const EVERY_MS = 3000;
|
|
19
|
+
const KEYS = new Set(['Enter', 'Down', 'Up', 'Left', 'Right', 'Escape', 'Tab', 'y', 'n', '1', '2', '3']);
|
|
20
|
+
export function rulesOf(args) {
|
|
21
|
+
return args.flatMap((a) => {
|
|
22
|
+
const m = /^(link|notice|keys):(.+)$/s.exec(a); if (!m) return [];
|
|
23
|
+
let pattern = m[2]; let value = null;
|
|
24
|
+
if (m[1] === 'notice') { const at = pattern.lastIndexOf('='); if (at < 1) return []; value = pattern.slice(at + 1).trim().slice(0, 300); pattern = pattern.slice(0, at); if (!value) return []; }
|
|
25
|
+
if (m[1] === 'keys') { const at = pattern.lastIndexOf('='); if (at < 1) return []; value = pattern.slice(at + 1).split(',').filter((k) => KEYS.has(k)); pattern = pattern.slice(0, at); if (!value.length) return []; }
|
|
26
|
+
try { return [{ kind: m[1], re: new RegExp(pattern, 'i'), value }]; } catch { return []; }
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/* -> what to do on this screen: [{ kind, match, value }], each once (seen: a Set kept between looks). */
|
|
30
|
+
export function actionsOn(screen, rules, seen) {
|
|
31
|
+
const bottom = String(screen).replace(/\s+$/u, '').split('\n').slice(-LINES).join('\n');
|
|
32
|
+
const out = [];
|
|
33
|
+
for (const r of rules) {
|
|
34
|
+
const m = r.re.exec(bottom); if (!m) continue;
|
|
35
|
+
const key = `${r.kind}:${r.kind === 'link' ? m[0] : bottom}`;
|
|
36
|
+
if (seen.has(key)) continue;
|
|
37
|
+
/* A notice once an hour at most: its own words on the screen never bring it back in a loop. */
|
|
38
|
+
if (r.kind === 'notice' && Date.now() - (r.last ?? 0) < 60 * 60_000) { seen.add(key); continue; }
|
|
39
|
+
if (r.kind === 'notice') r.last = Date.now();
|
|
40
|
+
/* With a link, the lines around it (a code to type there, often): the person sees what the tool said. */
|
|
41
|
+
const lines = bottom.split('\n'); const i = lines.findIndex((l) => l.includes(m[0].split('\n')[0]));
|
|
42
|
+
const around = r.kind === 'link' && i >= 0 ? lines.slice(Math.max(0, i - 2), i + 4).map((l) => l.trim()).filter(Boolean).join('\n') : '';
|
|
43
|
+
seen.add(key); out.push({ kind: r.kind, match: m[0], value: r.value, around });
|
|
44
|
+
}
|
|
45
|
+
if (seen.size > 200) for (const k of [...seen].slice(0, 100)) seen.delete(k);
|
|
46
|
+
return out;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const main = process.argv[1]?.endsWith('screen-watch.mjs');
|
|
50
|
+
if (main) {
|
|
51
|
+
const rules = rulesOf(process.argv.slice(2));
|
|
52
|
+
const tmux = ['-L', process.env.SCREEN_WATCH_SOCKET ?? 'clavarium'];
|
|
53
|
+
const pane = process.env.SCREEN_WATCH_PANE ?? '=main:';
|
|
54
|
+
const chat = process.env.PARLEY_DIR ?? '/work/.parley';
|
|
55
|
+
const seen = new Set();
|
|
56
|
+
const look = () => {
|
|
57
|
+
const r = spawnSync('tmux', [...tmux, 'capture-pane', '-p', '-t', pane], { encoding: 'utf8', timeout: 5000 });
|
|
58
|
+
if (r.status !== 0) return;
|
|
59
|
+
for (const a of actionsOn(r.stdout, rules, seen)) {
|
|
60
|
+
if (a.kind === 'link') spawnSync('parley', ['tell', `Your tool asks you to open this link: ${a.match}${a.around && a.around !== a.match ? `\n\n\`\`\`\n${a.around}\n\`\`\`` : ''}`, '--dir', chat], { timeout: 10_000 });
|
|
61
|
+
if (a.kind === 'notice') spawnSync('docket', ['remind', '--in', '1m', a.value, '--dir', process.env.DOCKET_DIR ?? '/work/.docket'], { timeout: 10_000 });
|
|
62
|
+
if (a.kind === 'keys') for (const k of a.value) spawnSync('tmux', [...tmux, 'send-keys', '-t', pane, k], { timeout: 5000 });
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
/* Its life is the tool's: started just before the launcher becomes the tool (exec), it ends with it. */
|
|
66
|
+
const tool = process.ppid;
|
|
67
|
+
const alive = () => { try { process.kill(tool, 0); return true; } catch { return false; } };
|
|
68
|
+
if (rules.length) setInterval(() => { if (!alive()) process.exit(0); look(); }, EVERY_MS);
|
|
69
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* toml-block FILE NAME [TEXT]: keeps, in the TOML file FILE of the home, one block of its own --
|
|
2
|
+
* "# >>> clavarium NAME" ... "# <<< clavarium NAME" -- written anew with TEXT (its tables), every other
|
|
3
|
+
* line kept as the person or the tool wrote it. No TEXT: the block taken out. Written only when it
|
|
4
|
+
* changes, readable by its owner alone (02-11: Codex, Vibe -- their settings are TOML).
|
|
5
|
+
* Only tables go in a block (a key outside a table would land in the table above it).
|
|
6
|
+
*/
|
|
7
|
+
import { readFileSync, writeFileSync, mkdirSync, renameSync } from 'node:fs';
|
|
8
|
+
import { dirname, join, isAbsolute } from 'node:path';
|
|
9
|
+
import { homedir } from 'node:os';
|
|
10
|
+
|
|
11
|
+
const [file, name, text = ''] = process.argv.slice(2);
|
|
12
|
+
if (!file || !name || isAbsolute(file) || file.split('/').includes('..') || !/^[a-z0-9-]+$/.test(name)) { console.error('usage: toml-block <file in the home> <name> [text]'); process.exit(64); }
|
|
13
|
+
const at = join(homedir(), file);
|
|
14
|
+
let was = '';
|
|
15
|
+
try { was = readFileSync(at, 'utf8'); } catch (error) { if (error.code !== 'ENOENT') { console.error(`toml-block: ${file} cannot be read`); process.exit(3); } }
|
|
16
|
+
const open = `# >>> clavarium ${name}`; const close = `# <<< clavarium ${name}`;
|
|
17
|
+
const lines = was.split('\n'); const kept = []; let inside = false;
|
|
18
|
+
for (const l of lines) { if (l === open) { inside = true; continue; } if (l === close) { inside = false; continue; } if (!inside) kept.push(l); }
|
|
19
|
+
let out = kept.join('\n').replace(/\n+$/, '');
|
|
20
|
+
if (text.trim()) out = `${out ? `${out}\n\n` : ''}${open}\n${text.trim()}\n${close}`;
|
|
21
|
+
out = out ? `${out}\n` : '';
|
|
22
|
+
if (out !== was) {
|
|
23
|
+
mkdirSync(dirname(at), { recursive: true, mode: 0o700 });
|
|
24
|
+
writeFileSync(`${at}.new`, out, { mode: 0o600 });
|
|
25
|
+
renameSync(`${at}.new`, at);
|
|
26
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# THE LAUNCHER OF VIBE (Mistral), run by Clavarium in its machine at each start (config/tools.json,
|
|
3
|
+
# "launch"), from the read-only /tools. Arguments: the rights chosen by the owner (full, ask), then the
|
|
4
|
+
# command to run, as Clavarium made it. All that is Vibe's own is here, and only here (02-11).
|
|
5
|
+
mode="$1"; shift
|
|
6
|
+
case "$mode" in full|ask) ;; *) echo "launch: the first argument is full or ask" >&2; exit 64 ;; esac
|
|
7
|
+
[ $# -gt 0 ] || { echo "launch: no command to run" >&2; exit 64; }
|
|
8
|
+
here="$(dirname "$0")"; relay="$here/mcp-relay.mjs"
|
|
9
|
+
chat="${PARLEY_DIR:-/work/.parley}"; docket="/work/.docket"; tether="/work/.tether"
|
|
10
|
+
# ITS KEY: a secret named MISTRAL_API_KEY given to the conversation is in its environment; Vibe reads it
|
|
11
|
+
# there, and asks nothing. Without it, Vibe asks for it in its terminal at its first start.
|
|
12
|
+
# ITS TOOLS (MCP) in its settings (~/.vibe/config.toml), a block of their own, each through the relay.
|
|
13
|
+
block=''
|
|
14
|
+
if [ -f "$chat/server.mjs" ] && command -v parley-mcp >/dev/null 2>&1; then block="$block
|
|
15
|
+
[[mcp_servers]]
|
|
16
|
+
name = \"parley\"
|
|
17
|
+
transport = \"stdio\"
|
|
18
|
+
command = \"node\"
|
|
19
|
+
args = [\"$relay\", \"parley-mcp\", \"--dir\", \"$chat\"]"; fi
|
|
20
|
+
if [ -f "$chat/server.mjs" ] && command -v docket-mcp >/dev/null 2>&1; then block="$block
|
|
21
|
+
[[mcp_servers]]
|
|
22
|
+
name = \"docket\"
|
|
23
|
+
transport = \"stdio\"
|
|
24
|
+
command = \"node\"
|
|
25
|
+
args = [\"$relay\", \"docket-mcp\", \"--dir\", \"$docket\"]"; fi
|
|
26
|
+
if command -v tether-mcp >/dev/null 2>&1; then block="$block
|
|
27
|
+
[[mcp_servers]]
|
|
28
|
+
name = \"tether\"
|
|
29
|
+
transport = \"stdio\"
|
|
30
|
+
command = \"node\"
|
|
31
|
+
args = [\"$relay\", \"tether-mcp\", \"--dir\", \"$tether\"]"; fi
|
|
32
|
+
node "$here/toml-block.mjs" .vibe/config.toml tools "$block" \
|
|
33
|
+
|| echo "launch: Vibe has not its tools (MCP)" >&2
|
|
34
|
+
# WHAT ITS SCREEN ASKS, read by the generic screen-watch -- Vibe's own words: an update told to the
|
|
35
|
+
# agent, which restarts when it suits it.
|
|
36
|
+
node "$here/screen-watch.mjs" \
|
|
37
|
+
'notice:(new version|update) (is )?available[^\n]{0,120}=Your tool has an update: when nothing runs, touch /work/.parley/restart-asked to take it up.' \
|
|
38
|
+
</dev/null >/dev/null 2>&1 &
|
|
39
|
+
exec "$@"
|
package/config/tools.json
CHANGED
|
@@ -174,6 +174,63 @@
|
|
|
174
174
|
"@openai/codex"
|
|
175
175
|
],
|
|
176
176
|
"npm-writable"
|
|
177
|
+
],
|
|
178
|
+
"launch": "codex.sh"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"id": "vibe",
|
|
182
|
+
"instructions": ".vibe/AGENTS.md",
|
|
183
|
+
"label": "Mistral Vibe",
|
|
184
|
+
"launch": "vibe.sh",
|
|
185
|
+
"command": [
|
|
186
|
+
"vibe"
|
|
187
|
+
],
|
|
188
|
+
"resume": [
|
|
189
|
+
"vibe",
|
|
190
|
+
"--continue"
|
|
191
|
+
],
|
|
192
|
+
"memoryMb": 2048,
|
|
193
|
+
"rights": {
|
|
194
|
+
"full": [
|
|
195
|
+
"--auto-approve"
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
"install": [
|
|
199
|
+
[
|
|
200
|
+
"sudo",
|
|
201
|
+
"-n",
|
|
202
|
+
"apt-get",
|
|
203
|
+
"install",
|
|
204
|
+
"-y",
|
|
205
|
+
"-q",
|
|
206
|
+
"--no-install-recommends",
|
|
207
|
+
"python3-venv"
|
|
208
|
+
],
|
|
209
|
+
[
|
|
210
|
+
"sudo",
|
|
211
|
+
"-n",
|
|
212
|
+
"python3",
|
|
213
|
+
"-m",
|
|
214
|
+
"venv",
|
|
215
|
+
"/opt/vibe"
|
|
216
|
+
],
|
|
217
|
+
[
|
|
218
|
+
"sudo",
|
|
219
|
+
"-n",
|
|
220
|
+
"/opt/vibe/bin/pip",
|
|
221
|
+
"install",
|
|
222
|
+
"-q",
|
|
223
|
+
"--disable-pip-version-check",
|
|
224
|
+
"mistral-vibe"
|
|
225
|
+
],
|
|
226
|
+
[
|
|
227
|
+
"sudo",
|
|
228
|
+
"-n",
|
|
229
|
+
"ln",
|
|
230
|
+
"-sf",
|
|
231
|
+
"/opt/vibe/bin/vibe",
|
|
232
|
+
"/usr/local/bin/vibe"
|
|
233
|
+
]
|
|
177
234
|
]
|
|
178
235
|
},
|
|
179
236
|
{
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.138-beta.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.138-beta.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
|
13
13
|
"@xterm/xterm": "^6.0.0",
|
|
14
|
-
"clavarium-binder": "0.1.
|
|
15
|
-
"clavarium-docket": "0.1.
|
|
16
|
-
"clavarium-parley": "0.17.
|
|
17
|
-
"clavarium-tether": "0.1.0-next.
|
|
14
|
+
"clavarium-binder": "0.1.57-next.1",
|
|
15
|
+
"clavarium-docket": "0.1.2-next.2",
|
|
16
|
+
"clavarium-parley": "0.17.43-next.1",
|
|
17
|
+
"clavarium-tether": "0.1.0-next.48",
|
|
18
18
|
"mammoth": "1.13.0",
|
|
19
19
|
"mermaid": "11.17.2",
|
|
20
20
|
"node-pty": "^1.1.0",
|
|
@@ -761,9 +761,9 @@
|
|
|
761
761
|
}
|
|
762
762
|
},
|
|
763
763
|
"node_modules/clavarium-binder": {
|
|
764
|
-
"version": "0.1.
|
|
765
|
-
"resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.
|
|
766
|
-
"integrity": "sha512-
|
|
764
|
+
"version": "0.1.57-next.1",
|
|
765
|
+
"resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.57-next.1.tgz",
|
|
766
|
+
"integrity": "sha512-FvIgcCM7hJMDs1P1aQjwYqs2YypDgDKL54CL34rCaf0VejsUGHMYukSZgzDLQ4y8Bw/m8884p7Ap+j3jyZF31w==",
|
|
767
767
|
"license": "MIT",
|
|
768
768
|
"bin": {
|
|
769
769
|
"binder": "bin/binder.mjs",
|
|
@@ -774,9 +774,9 @@
|
|
|
774
774
|
}
|
|
775
775
|
},
|
|
776
776
|
"node_modules/clavarium-docket": {
|
|
777
|
-
"version": "0.1.
|
|
778
|
-
"resolved": "https://registry.npmjs.org/clavarium-docket/-/clavarium-docket-0.1.
|
|
779
|
-
"integrity": "sha512-
|
|
777
|
+
"version": "0.1.2-next.2",
|
|
778
|
+
"resolved": "https://registry.npmjs.org/clavarium-docket/-/clavarium-docket-0.1.2-next.2.tgz",
|
|
779
|
+
"integrity": "sha512-d1D7BX+g3UkiIebom9+F61wGJHVwiV/H02sg7Y9AIzd3UwSvmJC3ZwdHTQC3ELBnCmRuth6/bNt0fB3u79lKtQ==",
|
|
780
780
|
"license": "MIT",
|
|
781
781
|
"bin": {
|
|
782
782
|
"docket": "bin/docket.mjs",
|
|
@@ -787,9 +787,9 @@
|
|
|
787
787
|
}
|
|
788
788
|
},
|
|
789
789
|
"node_modules/clavarium-parley": {
|
|
790
|
-
"version": "0.17.
|
|
791
|
-
"resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.
|
|
792
|
-
"integrity": "sha512-
|
|
790
|
+
"version": "0.17.43-next.1",
|
|
791
|
+
"resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.43-next.1.tgz",
|
|
792
|
+
"integrity": "sha512-jMpEPwn6gUPrdQM0pzXBSnDIaX7CHDO5bYWYSZLxuVT7vOvbd5GbRGrFfDNUnEB/ZJQHcLnpBH+A08vnTIGCgQ==",
|
|
793
793
|
"license": "MIT",
|
|
794
794
|
"bin": {
|
|
795
795
|
"parley": "bin/parley.mjs",
|
|
@@ -800,9 +800,9 @@
|
|
|
800
800
|
}
|
|
801
801
|
},
|
|
802
802
|
"node_modules/clavarium-tether": {
|
|
803
|
-
"version": "0.1.0-next.
|
|
804
|
-
"resolved": "https://registry.npmjs.org/clavarium-tether/-/clavarium-tether-0.1.0-next.
|
|
805
|
-
"integrity": "sha512-
|
|
803
|
+
"version": "0.1.0-next.48",
|
|
804
|
+
"resolved": "https://registry.npmjs.org/clavarium-tether/-/clavarium-tether-0.1.0-next.48.tgz",
|
|
805
|
+
"integrity": "sha512-1u20NVKTNEWpBBj7gA80ig1LOO3cMpZkdw7U//yjXoKAMVoHWkYn7TZOLQZlSJwS7VYrC2cYhlAX96D18DDEgA==",
|
|
806
806
|
"license": "MIT",
|
|
807
807
|
"bin": {
|
|
808
808
|
"tether": "bin/cli.mjs",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.138-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.",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@xterm/addon-fit": "^0.11.0",
|
|
46
46
|
"@xterm/xterm": "^6.0.0",
|
|
47
|
-
"clavarium-binder": "0.1.
|
|
48
|
-
"clavarium-docket": "0.1.
|
|
49
|
-
"clavarium-parley": "0.17.
|
|
50
|
-
"clavarium-tether": "0.1.0-next.
|
|
47
|
+
"clavarium-binder": "0.1.57-next.1",
|
|
48
|
+
"clavarium-docket": "0.1.2-next.2",
|
|
49
|
+
"clavarium-parley": "0.17.43-next.1",
|
|
50
|
+
"clavarium-tether": "0.1.0-next.48",
|
|
51
51
|
"mammoth": "1.13.0",
|
|
52
52
|
"mermaid": "11.17.2",
|
|
53
53
|
"node-pty": "^1.1.0",
|
package/server/api.mjs
CHANGED
|
@@ -398,7 +398,24 @@ export async function handleApi(request, response, conversations, headers, resou
|
|
|
398
398
|
const body = await readBody(request, pathname === '/api/setup/preview' || pathname === '/api/setup/import' ? SETUP_BODY_MAX : BODY_MAX);
|
|
399
399
|
/* What was done, once it was done: said in What happened (events.mjs), for those worth saying. */
|
|
400
400
|
if (events) { const answer = send; send = (status, out) => { if (status < 300) { try { events.fromRequest(pathname, body, identity, out); } catch { /* never in the way */ } } answer(status, out); }; }
|
|
401
|
-
if (pathname === '/api/conversations') {
|
|
401
|
+
if (pathname === '/api/conversations') {
|
|
402
|
+
await conversations.admit?.(body);
|
|
403
|
+
const made = conversations.create(body);
|
|
404
|
+
/* Its chat on from the start (02-11), unless asked otherwise ("More": Chat off); a work folder on the
|
|
405
|
+
machine's disk has no place for it. */
|
|
406
|
+
if (body?.chat !== false && talk) {
|
|
407
|
+
/* Its work folder exists once it is built: the chat is put in then (a few minutes at most). */
|
|
408
|
+
const name = made.name; const until = Date.now() + 30 * 60_000;
|
|
409
|
+
const tryOn = async () => {
|
|
410
|
+
const c = conversations.list().find((x) => x.name === name);
|
|
411
|
+
if (!c || Date.now() > until) return;
|
|
412
|
+
if (c.phase === 'ready') { try { await talk.set(name, true); void guide?.changed(name).catch(() => {}); } catch { /* left off: its settings turn it on */ } return; }
|
|
413
|
+
setTimeout(() => { void tryOn(); }, 2000).unref?.();
|
|
414
|
+
};
|
|
415
|
+
void tryOn();
|
|
416
|
+
}
|
|
417
|
+
return send(201, made), true;
|
|
418
|
+
}
|
|
402
419
|
/* The lists: every answer is 200, a refusal said in it ({ ok: false, text }), as the keeper says it to a tool. */
|
|
403
420
|
if (pathname === '/api/binder' && binders) return send(200, binders.act(body.op, body.args, identity)), true;
|
|
404
421
|
/* Quick actions on a card: suggested from its content (suggest.mjs), done by the page. */
|
package/server/guide.mjs
CHANGED
|
@@ -121,6 +121,8 @@ export function ownText({ name, tool, workKept, resources = [], chat, online, se
|
|
|
121
121
|
if (chat) out.push('- The chat shows Markdown (lists, tables, "> [!IMPORTANT]") and pictures of /work: .');
|
|
122
122
|
/* The thread is kept whole: after a restart, its end is read, and further back on demand. */
|
|
123
123
|
if (chat && reread) out.push(`- After a restart: ${plain(reread, 60)}, the end of the chat; it says how to read further back.`);
|
|
124
|
+
/* 02-11: the one command a tool may ask of the server. */
|
|
125
|
+
if (chat) out.push('- To be restarted (new tools to take up, or anything stuck): finish what runs, then `touch /work/.parley/restart-asked`; the server restarts you once your turn ends, and your work picks up where it was.');
|
|
124
126
|
/* Its docket (dockets.mjs): what wakes it waits there until it says done or failed. */
|
|
125
127
|
if (chat) out.push('- What wakes you (a file arrived, the clock, a call) waits in your docket: when told "run docket", run it, do each, then docket done ID or docket failed ID "why". To be reminded later: docket remind --at "2026-10-23 09:00" (or --in 2h, --cron "0 9 * * 1") "what for". docket --help says all.');
|
|
126
128
|
/* Its lists (binders.mjs): kept on the server, asked for through .binder; a person approves. */
|
package/server/main.mjs
CHANGED
|
@@ -524,6 +524,20 @@ export async function startHome({ port, host, dataDir, mntDir = dataDir, gitRese
|
|
|
524
524
|
try { if (talk.event(name, { kind: 'tools-updated', text: 'Tools updated: restart it to use them all. Its work picks up where it was.', topic: 'Tools', actions: ['restart'] })) toolbox.told(name); } catch { /* its chat is off */ }
|
|
525
525
|
}
|
|
526
526
|
});
|
|
527
|
+
/* A TOOL THAT ASKS TO BE RESTARTED (02-11: to take up its tools, after an update): restarted by this server
|
|
528
|
+
once its turn has ended (its pulse no longer busy), said in its chat; once per ten minutes at most. */
|
|
529
|
+
const restartedAt = new Map();
|
|
530
|
+
const restartTimer = setInterval(() => {
|
|
531
|
+
for (const name of all.awake()) {
|
|
532
|
+
if (!talk.restartAsked(name)) continue;
|
|
533
|
+
if (talk.pulse(name)?.busy) continue;
|
|
534
|
+
talk.restartTaken(name);
|
|
535
|
+
if (Date.now() - (restartedAt.get(name) ?? 0) < 10 * 60_000) continue;
|
|
536
|
+
restartedAt.set(name, Date.now());
|
|
537
|
+
try { talk.event(name, { kind: 'restarted', text: 'Restarted as it asked: its work picks up where it was.', topic: 'Restarted' }); } catch { /* its chat is off */ }
|
|
538
|
+
void all.restart(name).catch(() => {});
|
|
539
|
+
}
|
|
540
|
+
}, 15_000); restartTimer.unref?.();
|
|
527
541
|
/* The health of each machine, and folders that came loose put back: see health.mjs. */
|
|
528
542
|
const health = new Health({ vms, conversations: all, resources: folders, seen: new Store(`${dataDir}/health-seen.json`), ...(healthSettleMs === undefined ? {} : { settleMs: healthSettleMs }) });
|
|
529
543
|
const stopHealth = health.start(healthEveryMs);
|
|
@@ -625,7 +639,7 @@ export async function startHome({ port, host, dataDir, mntDir = dataDir, gitRese
|
|
|
625
639
|
speak: (text) => speech.speak(text),
|
|
626
640
|
log: (line) => events.add({ kind: 'server', text: line }) });
|
|
627
641
|
const { server, listening } = serve(port, all, folders, { gate, originOk, shortcuts, voice, sharing, door, secrets, network, signin, mailboxes, gitReview, platform, answerer, wakeups, alerts, talk, gitAccess, gitKeeper, shelf, health, setup, guide, capacity, updates, instance, certificate, team, reacting, machinesMove, serverLogs, history, events, wifi, binders, meshcentral, tethers, accounts, groups, boxes, bundles: new Bundles({ dir: `${dataDir}/imports`, folder: (name) => folders.folder(name) }), repair: (name) => repairTerminal(name) });
|
|
628
|
-
server.on('close', () => { closing = true; stopBinders(); stopTethers(); clearInterval(historyTimer); clearInterval(secretsTimer); history.save(); stopVmWatch(); stopShelf(); stopHealth(); stopUpdates(); stopWatch(); clearInterval(mailTimer); clearInterval(expiryTimer); clearInterval(answerTimer); clearInterval(wakeTimer); clearInterval(docketTimer); dockets.stop(); clearInterval(gitTimer); talk.stop(); });
|
|
642
|
+
server.on('close', () => { closing = true; stopBinders(); stopTethers(); clearInterval(historyTimer); clearInterval(secretsTimer); history.save(); stopVmWatch(); stopShelf(); stopHealth(); stopUpdates(); stopWatch(); clearInterval(mailTimer); clearInterval(restartTimer); clearInterval(expiryTimer); clearInterval(answerTimer); clearInterval(wakeTimer); clearInterval(docketTimer); dockets.stop(); clearInterval(gitTimer); talk.stop(); });
|
|
629
643
|
let closing = false;
|
|
630
644
|
boxes.attach(server, WebSocketServer);
|
|
631
645
|
for (const c of all.list()) talk.speakers(c.name, boxes.speakersOf(c.name));
|
package/server/talk.mjs
CHANGED
|
@@ -140,6 +140,8 @@ export const SYSTEM_MAX = 50;
|
|
|
140
140
|
branch: the owner allowed each one. The owner may move a kind to another
|
|
141
141
|
level (Settings); nothing else of a line changes with it. */
|
|
142
142
|
export const LEVELS = Object.freeze(['needs-you', 'news', 'trace']);
|
|
143
|
+
/* The file a tool puts beside its chat to be restarted (see restartAsked). */
|
|
144
|
+
export const RESTART_ASKED = 'restart-asked';
|
|
143
145
|
export const EVENT_LEVELS = Object.freeze({
|
|
144
146
|
sent: 'news',
|
|
145
147
|
refused: 'needs-you',
|
|
@@ -384,6 +386,14 @@ export class Talk {
|
|
|
384
386
|
/* Is its chat on? (cheap: the record alone) */
|
|
385
387
|
isOn(name) { return this.#store.get(name)?.on === true; }
|
|
386
388
|
|
|
389
|
+
/* ITS TOOL ASKS TO BE RESTARTED (02-11): a file it puts in its chat's folder (RESTART_ASKED); the server
|
|
390
|
+
restarts it once its turn has ended -- the one command a tool may ask of the server, nothing typed. */
|
|
391
|
+
restartAsked(name) {
|
|
392
|
+
if (this.#store.get(name)?.on !== true) return false;
|
|
393
|
+
try { return lstatSync(join(this.#dir(name), RESTART_ASKED), { throwIfNoEntry: false })?.isFile() === true; } catch { return false; }
|
|
394
|
+
}
|
|
395
|
+
restartTaken(name) { try { rmSync(join(this.#dir(name), RESTART_ASKED), { force: true }); } catch { /* gone already */ } }
|
|
396
|
+
|
|
387
397
|
/* Its tool's pulse (Parley): { busy, at }, or null. Where the chat is off: null. */
|
|
388
398
|
pulse(name) {
|
|
389
399
|
if (this.#store.get(name)?.on !== true) return null;
|
package/web/app.js
CHANGED
|
@@ -1659,9 +1659,9 @@
|
|
|
1659
1659
|
newError('', '');
|
|
1660
1660
|
creating = true; $('newconv-create').disabled = true;
|
|
1661
1661
|
try {
|
|
1662
|
-
const made = await post(`${API}/conversations`, { title, ...(id ? { name: id } : {}), ...(group ? { group } : {}), tool: chosenTool, workOnDisk: newOnDisk(), ...(memoryMb && memoryMb !== least ? { memoryMb } : {}), ...(cpus && cpus !== 1 ? { cpus } : {}), ...(diskGb && diskGb !== 8 ? { diskGb } : {}) });
|
|
1662
|
+
const made = await post(`${API}/conversations`, { title, ...(id ? { name: id } : {}), ...(group ? { group } : {}), tool: chosenTool, workOnDisk: newOnDisk(), ...(document.getElementById('newconv-chat')?.checked === false ? { chat: false } : {}), ...(memoryMb && memoryMb !== least ? { memoryMb } : {}), ...(cpus && cpus !== 1 ? { cpus } : {}), ...(diskGb && diskGb !== 8 ? { diskGb } : {}) });
|
|
1663
1663
|
$('newconv-name').value = ''; $('newconv-id').value = ''; $('newconv-id').placeholder = 'website-redesign'; $('newconv-group').value = '';
|
|
1664
|
-
$('newconv-work').querySelector('[data-work="kept"]').click(); $('newconv-more').open = false;
|
|
1664
|
+
$('newconv-work').querySelector('[data-work="kept"]').click(); $('newconv-more').open = false; { const ch = document.getElementById('newconv-chat'); if (ch) ch.checked = true; }
|
|
1665
1665
|
await refresh();
|
|
1666
1666
|
/* The new one is selected: the page gives way to it, with no step of it left behind. */
|
|
1667
1667
|
select(made.name);
|
|
@@ -4959,6 +4959,46 @@
|
|
|
4959
4959
|
await paintAssets();
|
|
4960
4960
|
}
|
|
4961
4961
|
async function openAssets() { await openAssetsPlace(); }
|
|
4962
|
+
/* ---------- the conversations as cards (02-11) ---------- */
|
|
4963
|
+
/* ONE CONVERSATION AS A CARD, as a playing card: its name and its state on a plate, a picture of its own
|
|
4964
|
+
(its colours drawn from its name, its initial), its agent and its tool, its last word. Reusable: any
|
|
4965
|
+
page that shows conversations as things to pick or move takes it. `onOpen(c)`. */
|
|
4966
|
+
function convCard(c, onOpen) {
|
|
4967
|
+
let h = 0; for (const ch of String(c.name)) h = (h * 31 + ch.codePointAt(0)) >>> 0;
|
|
4968
|
+
const hue = h % 360;
|
|
4969
|
+
const card = el('button', 'conv-card'); card.type = 'button'; card.dataset.name = c.name;
|
|
4970
|
+
const state = c.asleep ? 'asleep' : c.talk?.state === 'waiting' || (c.talk?.waiting ?? 0) > 0 ? 'waits' : c.phase === 'ready' ? 'ready' : 'busy';
|
|
4971
|
+
const plate = el('span', 'conv-card-plate'); const dot = el('span', 'conv-card-dot'); dot.dataset.state = state;
|
|
4972
|
+
plate.append(dot, el('b', '', shownName(c)));
|
|
4973
|
+
const art = el('span', 'conv-card-art'); art.style.setProperty('--h', String(hue));
|
|
4974
|
+
art.append(el('span', 'conv-card-initial', (shownName(c).trim()[0] ?? '?').toUpperCase()));
|
|
4975
|
+
const kind = el('span', 'conv-card-type', [c.chatName, c.toolLabel ?? c.tool].filter(Boolean).join(' · '));
|
|
4976
|
+
const text = el('span', 'conv-card-text');
|
|
4977
|
+
if (c.talk?.lastText) text.append(el('i', '', c.talk.lastText));
|
|
4978
|
+
text.append(el('small', '', c.asleep ? 'Asleep' : state === 'waits' ? 'Waits for you' : c.talk?.lastAt ? cardAgo(c.talk.lastAt) : c.phase === 'ready' ? 'Ready' : (c.step || c.phase || '')));
|
|
4979
|
+
card.append(plate, art, kind, text);
|
|
4980
|
+
card.setAttribute('aria-label', `${shownName(c)}, ${kind.textContent}`);
|
|
4981
|
+
card.addEventListener('click', () => onOpen(c));
|
|
4982
|
+
return card;
|
|
4983
|
+
}
|
|
4984
|
+
const cardAgo = (at) => { const s = Math.max(0, (Date.now() - Date.parse(at)) / 1000); return s < 90 ? 'Just now' : s < 5400 ? `${Math.round(s / 60)} min ago` : s < 129600 ? `${Math.round(s / 3600)} h ago` : `${Math.round(s / 86400)} days ago`; };
|
|
4985
|
+
function paintDeck() {
|
|
4986
|
+
$('deck-title').textContent = appName;
|
|
4987
|
+
const list = [...conversations];
|
|
4988
|
+
const add = el('button', 'conv-card conv-card-new'); add.type = 'button';
|
|
4989
|
+
add.append(el('span', 'conv-card-plus', '+'), el('small', '', 'New conversation'));
|
|
4990
|
+
add.addEventListener('click', () => { void openNew(); });
|
|
4991
|
+
$('deck-cards').replaceChildren(...list.map((c) => convCard(c, (x) => { leavePlace(); select(x.name); })), add);
|
|
4992
|
+
$('deck-cards').hidden = list.length === 0; $('deck-empty').hidden = list.length > 0;
|
|
4993
|
+
}
|
|
4994
|
+
function openDeck(push = true) { if (DEVICE) return; enterPlace('deck', push); paintDeck(); }
|
|
4995
|
+
$('deck-close').addEventListener('click', () => leavePlace());
|
|
4996
|
+
$('deck-empty-new').addEventListener('click', () => { void openNew(); });
|
|
4997
|
+
/* Import a configuration: the import of the map (Access, Flows), a file chosen at once. */
|
|
4998
|
+
$('deck-empty-import').addEventListener('click', () => { void openAccessPage('map', { mode: 'flows' }).then(() => document.getElementById('flows-import')?.click()).catch(() => {}); });
|
|
4999
|
+
$('list-title').addEventListener('click', () => openDeck());
|
|
5000
|
+
$('list-title').setAttribute('role', 'button'); $('list-title').tabIndex = 0;
|
|
5001
|
+
$('list-title').addEventListener('keydown', (e) => { if (e.key === 'Enter') openDeck(); });
|
|
4962
5002
|
/* ---------- private repositories: how this server gets in ---------- */
|
|
4963
5003
|
/* The host of an address, whatever its form (user@host:path has no URL form). */
|
|
4964
5004
|
const hostOf = (from) => { try { return new URL(from).hostname; } catch { return /@([^:/]+):/.exec(String(from))?.[1] ?? String(from); } };
|
|
@@ -5130,6 +5170,7 @@
|
|
|
5130
5170
|
$('access').hidden = which !== 'access';
|
|
5131
5171
|
$('settings').hidden = which !== 'settings';
|
|
5132
5172
|
$('assets').hidden = which !== 'assets';
|
|
5173
|
+
$('deck').hidden = which !== 'deck';
|
|
5133
5174
|
$('newconv').hidden = which !== 'new';
|
|
5134
5175
|
if (which !== 'access') composing = false;
|
|
5135
5176
|
/* What the conversation had open (its tab) waits under the place, as it was. */
|
|
@@ -5445,6 +5486,7 @@
|
|
|
5445
5486
|
if (home && wanted !== current && conversations.some((c) => c.name === wanted)) select(wanted);
|
|
5446
5487
|
const open = q.get('open') ?? '';
|
|
5447
5488
|
if (open === 'new') { await openNew({ push: false }); return; }
|
|
5489
|
+
if (open === 'deck') { openDeck(false); return; }
|
|
5448
5490
|
if (open === 'settings') {
|
|
5449
5491
|
await openSettings({ push: false });
|
|
5450
5492
|
/* A link to one chapter of Settings (?open=settings&at=resources): that one opened, and shown. */
|
package/web/index.html
CHANGED
|
@@ -480,6 +480,11 @@
|
|
|
480
480
|
right: who uses it, its state, its settings. The forms that make
|
|
481
481
|
one, and a repository's remote, wait in #assets-forms and are moved
|
|
482
482
|
into the detail when asked for. -->
|
|
483
|
+
<div id="deck" class="sheet as-place" hidden>
|
|
484
|
+
<div class="panel-top"><b id="deck-title">Conversations</b><button type="button" id="deck-close" class="as-link place-back">‹ Back</button></div>
|
|
485
|
+
<div id="deck-cards" class="deck"></div>
|
|
486
|
+
<div id="deck-empty" class="deck-empty" hidden><p>No conversation yet.</p><div class="deck-empty-acts"><button type="button" id="deck-empty-new" class="primary">+ Create a conversation</button><button type="button" id="deck-empty-import">Import a configuration</button></div></div>
|
|
487
|
+
</div>
|
|
483
488
|
<div id="assets" class="sheet as-place" hidden>
|
|
484
489
|
<div class="panel-top"><b>Assets</b><button type="button" id="assets-close" class="as-link place-back">‹ Conversations</button></div>
|
|
485
490
|
<p id="assets-error" class="error" role="alert" hidden></p>
|
|
@@ -1019,12 +1024,13 @@
|
|
|
1019
1024
|
<details class="more"><summary>Which one?</summary>A code project that installs packages: its disk. Can be changed later.</details>
|
|
1020
1025
|
</div>
|
|
1021
1026
|
<details class="chapter" id="newconv-more">
|
|
1022
|
-
<summary><span class="chapter-title">More</span><span class="chapter-about">Identifier, memory, cores, disk.</span></summary>
|
|
1027
|
+
<summary><span class="chapter-title">More</span><span class="chapter-about">Identifier, memory, cores, disk, chat.</span></summary>
|
|
1023
1028
|
<div class="chapter-body">
|
|
1024
1029
|
<div class="set-row"><div class="set-what"><label for="newconv-id">Identifier</label><small>Its machine and address. Never changes</small><span id="newconv-id-error" class="err" role="alert" hidden></span></div><div class="set-control"><input id="newconv-id" maxlength="32" pattern="[a-z]([a-z0-9\-]{0,30}[a-z0-9])?" placeholder="website-redesign" spellcheck="false" autocapitalize="none"></div></div>
|
|
1025
1030
|
<div class="set-row"><div class="set-what"><label for="newconv-memory">Memory</label><small id="newconv-memory-least"></small><span id="newconv-memory-error" class="err" role="alert" hidden></span></div><div class="set-control"><select id="newconv-memory"></select></div></div>
|
|
1026
1031
|
<div class="set-row"><div class="set-what"><label for="newconv-cpus">Cores</label><small>Shared with the server's machines</small></div><div class="set-control"><select id="newconv-cpus"></select></div></div>
|
|
1027
1032
|
<div class="set-row"><div class="set-what"><label for="newconv-disk">Disk</label><small>For code kept on the machine; a disk only grows</small></div><div class="set-control"><select id="newconv-disk"></select></div></div>
|
|
1033
|
+
<div class="set-row"><div class="set-what"><label for="newconv-chat">Chat</label><small>Talk with its tool in a chat. Off: its terminal only</small></div><div class="set-control"><input type="checkbox" id="newconv-chat" checked></div></div>
|
|
1028
1034
|
</div>
|
|
1029
1035
|
</details>
|
|
1030
1036
|
</div>
|
package/web/style.css
CHANGED
|
@@ -23,7 +23,7 @@ body { height: 100dvh; padding: env(safe-area-inset-top, 0) 0 env(safe-area-inse
|
|
|
23
23
|
[hidden] { display: none !important; }
|
|
24
24
|
button { font: 600 .8125rem var(--sans); color: var(--ink); background: var(--button, #222c38); border: 1px solid var(--line); border-radius: 7px; padding: 7px 11px; cursor: pointer; }
|
|
25
25
|
/* The main button (02-11): its words and outline in brass, no fill -- quieter, like a suggestion. */
|
|
26
|
-
button.primary { background: transparent; border-color: var(--brass); color: var(--brass); }
|
|
26
|
+
button.primary { background: transparent; border-color: var(--brass); color: var(--brass-ink); }
|
|
27
27
|
button.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--brass) 12%, transparent); }
|
|
28
28
|
button:focus-visible, input:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
|
|
29
29
|
/* The list on the left, the three places under it, the conversation beside them. */
|
|
@@ -111,7 +111,7 @@ main { position: relative; flex: 1; min-height: 0; }
|
|
|
111
111
|
#notice button { padding: 10px 18px; font-size: .9375rem; }
|
|
112
112
|
footer { display: flex; gap: 6px; padding: 6px 8px; background: var(--bar); border-top: 1px solid var(--line); overflow-x: auto; }
|
|
113
113
|
footer button { flex: 0 0 auto; min-width: 44px; padding: 9px 12px; }
|
|
114
|
-
footer button.wide { flex: 1 0 auto; background: transparent; border-color: var(--brass); color: var(--brass); }
|
|
114
|
+
footer button.wide { flex: 1 0 auto; background: transparent; border-color: var(--brass); color: var(--brass-ink); }
|
|
115
115
|
@media (max-width: 700px) {
|
|
116
116
|
#app { grid-template-columns: minmax(0, 1fr); }
|
|
117
117
|
#list, #room { grid-column: 1; grid-row: 1; border-right: 0; }
|
|
@@ -194,7 +194,7 @@ html[data-door="device"] #room { height: 100%; }
|
|
|
194
194
|
.chip[data-access="offline"] { color: var(--warn); border-color: var(--warn); }
|
|
195
195
|
#signin-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; background: rgba(210, 169, 78, .14); border-bottom: 1px solid var(--brass); font-size: .8125rem; }
|
|
196
196
|
#signin-text { flex: 1; min-width: 160px; }
|
|
197
|
-
a.button { font: 600 .8125rem var(--sans); text-decoration: none; border-radius: 7px; padding: 7px 11px; background: transparent; border: 1px solid var(--brass); color: var(--brass); }
|
|
197
|
+
a.button { font: 600 .8125rem var(--sans); text-decoration: none; border-radius: 7px; padding: 7px 11px; background: transparent; border: 1px solid var(--brass); color: var(--brass-ink); }
|
|
198
198
|
#signin-form input { flex: 1; min-width: 130px; font: .875rem var(--sans); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; }
|
|
199
199
|
/* On a narrow screen the key row wraps instead of hiding its end, and
|
|
200
200
|
dictation comes first: by voice is how a phone is used. */
|
|
@@ -245,7 +245,7 @@ footer button.careful { border-style: dashed; color: var(--ink2); }
|
|
|
245
245
|
#viewer .row { align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
246
246
|
#viewer .sp { flex: 1; }
|
|
247
247
|
#viewer #preview-name { overflow-wrap: anywhere; }
|
|
248
|
-
#viewer a.button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 8px; background: transparent; border: 1px solid var(--brass); color: var(--brass); font-weight: 600; text-decoration: none; }
|
|
248
|
+
#viewer a.button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 8px; background: transparent; border: 1px solid var(--brass); color: var(--brass-ink); font-weight: 600; text-decoration: none; }
|
|
249
249
|
#viewer button { min-height: 40px; }
|
|
250
250
|
#viewer p { margin: 0; }
|
|
251
251
|
#preview-body { overflow: auto; flex: 1; min-height: 0; }
|
|
@@ -379,7 +379,7 @@ footer button.careful { border-style: dashed; color: var(--ink2); }
|
|
|
379
379
|
#viewer .md-switch button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink2); font-weight: 600; }
|
|
380
380
|
#viewer .md-switch button[aria-pressed="true"] { background: var(--bar); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
|
|
381
381
|
#preview-body .md-view { display: block; container: none; min-height: 0; padding: 0 2px 24px; font-size: .9375rem; line-height: 1.55;
|
|
382
|
-
--parley-bg: var(--panel); --parley-text: var(--ink); --parley-dim: var(--ink2); --parley-line: var(--line); --parley-agent: var(--bar); --parley-action: var(--brass); --parley-measure: 80ch; }
|
|
382
|
+
--parley-bg: var(--panel); --parley-text: var(--ink); --parley-dim: var(--ink2); --parley-line: var(--line); --parley-agent: var(--bar); --parley-action: var(--brass-ink); --parley-measure: 80ch; }
|
|
383
383
|
:root[data-theme="light"] #preview-body .md-view { --parley-action: #8a5d00; }
|
|
384
384
|
#preview-body .md-view .parley-md { max-width: 80ch; }
|
|
385
385
|
#preview-body .md-view .parley-md > * + * { margin-top: .8em; }
|
|
@@ -446,7 +446,7 @@ footer button.careful { border-style: dashed; color: var(--ink2); }
|
|
|
446
446
|
#chat-off p { margin: 0 0 10px; font-size: 1rem; }
|
|
447
447
|
#chat-off p + p { color: var(--ink2); }
|
|
448
448
|
#simple[data-chat] { display: flex; flex-direction: column; overflow: hidden; padding: 10px 14px 12px; }
|
|
449
|
-
#simple-thread { flex: 1; min-height: 0; --parley-bg: var(--bg); --parley-text: var(--ink); --parley-dim: var(--ink2); --parley-line: var(--line); --parley-agent: var(--panel); --parley-person: var(--bar); --parley-ask: var(--brass); --parley-action: var(--brass); --parley-on-action: #1b1405; --parley-live: var(--danger); }
|
|
449
|
+
#simple-thread { flex: 1; min-height: 0; --parley-bg: var(--bg); --parley-text: var(--ink); --parley-dim: var(--ink2); --parley-line: var(--line); --parley-agent: var(--panel); --parley-person: var(--bar); --parley-ask: var(--brass-ink); --parley-action: var(--brass-ink); --parley-on-action: #1b1405; --parley-live: var(--danger); }
|
|
450
450
|
|
|
451
451
|
|
|
452
452
|
/* Private repositories: how the server gets in, and the keys made here. */
|
|
@@ -1953,7 +1953,7 @@ details.chapter[data-attention] > summary .chapter-title::after, #settings-nav b
|
|
|
1953
1953
|
/* Its whole height: a long card neither runs past its ground nor under what follows it (Assets). */
|
|
1954
1954
|
.binder-holder > .binder, .as-binder { flex-shrink: 0; }
|
|
1955
1955
|
body .binder-holder .binder { --binder-bg: var(--bg); --binder-text: var(--ink); --binder-dim: var(--ink2); --binder-line: var(--line); --binder-panel: var(--panel);
|
|
1956
|
-
--binder-action: var(--brass); --binder-on-action: #1b1405; --binder-ok: var(--ok); --binder-ask: var(--warn); --binder-danger: var(--danger); }
|
|
1956
|
+
--binder-action: var(--brass-ink); --binder-on-action: #1b1405; --binder-ok: var(--ok); --binder-ask: var(--warn); --binder-danger: var(--danger); }
|
|
1957
1957
|
.binder-holder .binder-new-list, .binder-holder .binder-empty .binder-primary { display: none; }
|
|
1958
1958
|
/* One list opened in Assets: no row of tabs for it alone. */
|
|
1959
1959
|
.as-binder .binder-top { display: none; }
|
|
@@ -2021,7 +2021,7 @@ details.commit > pre { margin: 6px 0 0 1.6em; white-space: pre-wrap; overflow-wr
|
|
|
2021
2021
|
Download stands out. Full screen: the file takes the whole screen. */
|
|
2022
2022
|
#viewer .ico { display: inline-flex; align-items: center; justify-content: center; width: 38px; min-width: 38px; height: 34px; padding: 0; }
|
|
2023
2023
|
#viewer .ico svg { width: 18px; height: 18px; }
|
|
2024
|
-
#viewer .ico.primary { background: transparent; border-color: var(--brass); color: var(--brass); }
|
|
2024
|
+
#viewer .ico.primary { background: transparent; border-color: var(--brass); color: var(--brass-ink); }
|
|
2025
2025
|
#viewer #preview-copy[data-done="true"] { color: var(--ok); border-color: currentColor; }
|
|
2026
2026
|
#viewer #preview-full[aria-pressed="true"] { border-color: var(--brass); }
|
|
2027
2027
|
#viewer.viewer-full { padding: 0; }
|
|
@@ -2169,3 +2169,25 @@ body.as-dragging #assets-rows .as-row { touch-action: none; }
|
|
|
2169
2169
|
.sheet-table th { position: sticky; background: var(--bar); color: var(--ink2); font-weight: 600; }
|
|
2170
2170
|
.sheet-table thead th { top: 0; z-index: 1; } .sheet-table tbody th { left: 0; }
|
|
2171
2171
|
.doc-frame { width: 100%; min-height: 70vh; border: 0; border-radius: 8px; background: transparent; }
|
|
2172
|
+
|
|
2173
|
+
/* THE CONVERSATIONS AS CARDS (02-11): playing cards, one per conversation, and one to add. */
|
|
2174
|
+
#list-title { cursor: pointer; }
|
|
2175
|
+
#deck { overflow-y: auto; }
|
|
2176
|
+
.deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; padding: 14px 2px 24px; }
|
|
2177
|
+
.conv-card { position: relative; aspect-ratio: 63 / 88; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(160deg, var(--bar), var(--panel)); color: var(--ink); text-align: left; font: inherit; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); cursor: pointer; transition: transform .15s, border-color .15s; min-height: 0; }
|
|
2178
|
+
.conv-card:hover, .conv-card:focus-visible { transform: translateY(-3px); border-color: var(--brass); }
|
|
2179
|
+
.conv-card-plate { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); min-width: 0; }
|
|
2180
|
+
.conv-card-plate b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
|
|
2181
|
+
.conv-card-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ink2); }
|
|
2182
|
+
.conv-card-dot[data-state="ready"] { background: var(--ok); } .conv-card-dot[data-state="waits"] { background: var(--wait); } .conv-card-dot[data-state="busy"] { background: var(--ink2); }
|
|
2183
|
+
.conv-card-dot[data-state="asleep"] { background: transparent; border: 1.5px solid var(--ink2); } .conv-card-dot[data-state="problem"] { background: var(--danger); }
|
|
2184
|
+
.conv-card-art { flex: 1.2; min-height: 0; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: linear-gradient(135deg, hsl(var(--h) 38% 30%), hsl(calc(var(--h) + 40) 42% 14%)); }
|
|
2185
|
+
.conv-card-initial { font: 700 2.4rem/1 var(--sans); color: rgba(255, 255, 255, .82); }
|
|
2186
|
+
.conv-card-type { font-size: .74rem; color: var(--ink2); padding: 2px 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2187
|
+
.conv-card-text { flex: .9; min-height: 0; display: flex; flex-direction: column; gap: 3px; padding: 2px 6px; font-size: .78rem; color: var(--ink2); overflow: hidden; }
|
|
2188
|
+
.conv-card-text i { font-style: normal; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
2189
|
+
.conv-card-new { align-items: center; justify-content: center; border-style: dashed; border-width: 1.5px; background: transparent; box-shadow: none; color: var(--ink2); }
|
|
2190
|
+
.conv-card-plus { font-size: 2.6rem; line-height: 1; color: var(--brass); }
|
|
2191
|
+
.deck-empty { text-align: center; padding: 48px 16px; color: var(--ink2); }
|
|
2192
|
+
.deck-empty-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
|
|
2193
|
+
@media (max-width: 520px) { .deck { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
|