clavarium 0.2.138-beta.1 → 0.2.139-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 +6 -2
- package/config/launch/codex.sh +2 -2
- package/config/launch/screen-watch.mjs +32 -2
- package/npm-shrinkwrap.json +10 -10
- package/package.json +3 -3
- package/web/style.css +5 -3
|
@@ -53,10 +53,14 @@ if [ -f "$chat/server.mjs" ]; then
|
|
|
53
53
|
|| echo "launch: the chat will not say when Claude Code works without a word" >&2
|
|
54
54
|
fi
|
|
55
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
|
|
56
|
+
# here: not signed in, its sign-in started by itself, its link sent to the person's chat, the code they paste
|
|
57
|
+
# there typed back (02-11, tried on a real Claude Code); an update installed told to the agent, which restarts
|
|
57
58
|
# when it suits it (never in the middle of its work). A tool that changes its words: only these lines change.
|
|
58
59
|
node "$(dirname "$0")/screen-watch.mjs" \
|
|
59
|
-
'
|
|
60
|
+
'type:Not logged in · Run /login=/login' \
|
|
61
|
+
'keys:Select login method:=Enter' \
|
|
62
|
+
'link:https://(claude\.ai|claude\.com|console\.anthropic\.com)/\S*oauth\S*' \
|
|
63
|
+
'code:Paste code here' \
|
|
60
64
|
'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
65
|
</dev/null >/dev/null 2>&1 &
|
|
62
66
|
exec "$@"
|
package/config/launch/codex.sh
CHANGED
|
@@ -29,8 +29,8 @@ node "$here/toml-block.mjs" .codex/config.toml tools "$block" \
|
|
|
29
29
|
# WHAT ITS SCREEN ASKS, read by the generic screen-watch -- Codex's own words: its sign-in link (and the
|
|
30
30
|
# code beside it) sent to the person's chat; an update told to the agent, which restarts when it suits it.
|
|
31
31
|
node "$here/screen-watch.mjs" \
|
|
32
|
-
'link:https://auth\.openai\.com
|
|
33
|
-
'link:https://chatgpt\.com
|
|
32
|
+
'link:https://auth\.openai\.com/\S+' \
|
|
33
|
+
'link:https://chatgpt\.com/\S*auth\S*' \
|
|
34
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
35
|
</dev/null >/dev/null 2>&1 &
|
|
36
36
|
exec "$@"
|
|
@@ -11,16 +11,21 @@
|
|
|
11
11
|
* The agent decides when it suits it -- never restarted in the middle of its work (02-11).
|
|
12
12
|
* keys:PATTERN=K a question with one answer always: the keys K typed (Enter, Down, Up, Escape, 1, y...),
|
|
13
13
|
* once per screen. Only what its launcher wrote: nothing else is ever typed.
|
|
14
|
+
* type:PATTERN=TEXT the same with a few words (a command such as /login), then Enter; once per screen.
|
|
15
|
+
* code:PATTERN the tool waits for a code the person gets after signing in: the next message they write
|
|
16
|
+
* in the chat that looks like one (no space, 10 to 300 signs) is typed there, then Enter.
|
|
14
17
|
* Only the last LINES lines are read: what the tool prints of its own work above never counts.
|
|
15
18
|
*/
|
|
16
19
|
import { spawnSync } from 'node:child_process';
|
|
20
|
+
import { readFileSync, statSync } from 'node:fs';
|
|
17
21
|
|
|
18
22
|
const LINES = 12; const EVERY_MS = 3000;
|
|
19
23
|
const KEYS = new Set(['Enter', 'Down', 'Up', 'Left', 'Right', 'Escape', 'Tab', 'y', 'n', '1', '2', '3']);
|
|
20
24
|
export function rulesOf(args) {
|
|
21
25
|
return args.flatMap((a) => {
|
|
22
|
-
const m = /^(link|notice|keys):(.+)$/s.exec(a); if (!m) return [];
|
|
26
|
+
const m = /^(link|notice|keys|type|code):(.+)$/s.exec(a); if (!m) return [];
|
|
23
27
|
let pattern = m[2]; let value = null;
|
|
28
|
+
if (m[1] === 'type') { const at = pattern.lastIndexOf('='); if (at < 1) return []; value = pattern.slice(at + 1).slice(0, 80); pattern = pattern.slice(0, at); if (!value.trim()) return []; }
|
|
24
29
|
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
30
|
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
31
|
try { return [{ kind: m[1], re: new RegExp(pattern, 'i'), value }]; } catch { return []; }
|
|
@@ -28,7 +33,12 @@ export function rulesOf(args) {
|
|
|
28
33
|
}
|
|
29
34
|
/* -> what to do on this screen: [{ kind, match, value }], each once (seen: a Set kept between looks). */
|
|
30
35
|
export function actionsOn(screen, rules, seen) {
|
|
31
|
-
|
|
36
|
+
/* A long link the tool's screen broke over several lines (full lines, no space): put back in one. */
|
|
37
|
+
const raw = String(screen).replace(/\s+$/u, '').split('\n').map((l) => l.replace(/\s+$/u, ''));
|
|
38
|
+
const width = Math.max(0, ...raw.map((l) => l.length));
|
|
39
|
+
const joined = [];
|
|
40
|
+
for (const l of raw) { const prev = joined.at(-1); if (prev !== undefined && width > 40 && prev.length >= width - 1 && /^\S+$/.test(prev.split(' ').at(-1)) && /^\S+$/.test(l) && /https?:\/\//.test(prev)) joined[joined.length - 1] = prev + l; else joined.push(l); }
|
|
41
|
+
const bottom = joined.slice(-LINES).join('\n');
|
|
32
42
|
const out = [];
|
|
33
43
|
for (const r of rules) {
|
|
34
44
|
const m = r.re.exec(bottom); if (!m) continue;
|
|
@@ -53,13 +63,33 @@ if (main) {
|
|
|
53
63
|
const pane = process.env.SCREEN_WATCH_PANE ?? '=main:';
|
|
54
64
|
const chat = process.env.PARLEY_DIR ?? '/work/.parley';
|
|
55
65
|
const seen = new Set();
|
|
66
|
+
/* Waiting for a code: the person's chat, from where it stood when the tool asked (to-agent.jsonl). */
|
|
67
|
+
let awaiting = null;
|
|
68
|
+
const inbox = `${chat}/to-agent.jsonl`;
|
|
69
|
+
const codeFrom = () => { try { return statSync(inbox).size; } catch { return 0; } };
|
|
70
|
+
const typeCode = () => {
|
|
71
|
+
if (awaiting === null) return;
|
|
72
|
+
let text = ''; try { const b = readFileSync(inbox); text = b.subarray(awaiting).toString('utf8'); } catch { return; }
|
|
73
|
+
for (const line of text.split('\n').filter(Boolean)) {
|
|
74
|
+
let m; try { m = JSON.parse(line); } catch { continue; }
|
|
75
|
+
const code = String(m?.text ?? '').trim();
|
|
76
|
+
if (/^[A-Za-z0-9_#.~+/=-]{10,300}$/.test(code)) {
|
|
77
|
+
spawnSync('tmux', [...tmux, 'send-keys', '-t', pane, '-l', '--', code], { timeout: 5000 });
|
|
78
|
+
spawnSync('tmux', [...tmux, 'send-keys', '-t', pane, 'Enter'], { timeout: 5000 });
|
|
79
|
+
awaiting = null; return;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
56
83
|
const look = () => {
|
|
84
|
+
typeCode();
|
|
57
85
|
const r = spawnSync('tmux', [...tmux, 'capture-pane', '-p', '-t', pane], { encoding: 'utf8', timeout: 5000 });
|
|
58
86
|
if (r.status !== 0) return;
|
|
59
87
|
for (const a of actionsOn(r.stdout, rules, seen)) {
|
|
60
88
|
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
89
|
if (a.kind === 'notice') spawnSync('docket', ['remind', '--in', '1m', a.value, '--dir', process.env.DOCKET_DIR ?? '/work/.docket'], { timeout: 10_000 });
|
|
62
90
|
if (a.kind === 'keys') for (const k of a.value) spawnSync('tmux', [...tmux, 'send-keys', '-t', pane, k], { timeout: 5000 });
|
|
91
|
+
if (a.kind === 'type') { spawnSync('tmux', [...tmux, 'send-keys', '-t', pane, '-l', '--', a.value], { timeout: 5000 }); spawnSync('tmux', [...tmux, 'send-keys', '-t', pane, 'Enter'], { timeout: 5000 }); }
|
|
92
|
+
if (a.kind === 'code') { awaiting = codeFrom(); spawnSync('parley', ['tell', 'Once signed in, paste here the code the page gives you.', '--dir', chat], { timeout: 10_000 }); }
|
|
63
93
|
}
|
|
64
94
|
};
|
|
65
95
|
/* Its life is the tool's: started just before the launcher becomes the tool (exec), it ends with it. */
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.139-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.139-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.
|
|
14
|
+
"clavarium-binder": "0.1.58-next.1",
|
|
15
15
|
"clavarium-docket": "0.1.2-next.2",
|
|
16
|
-
"clavarium-parley": "0.17.
|
|
16
|
+
"clavarium-parley": "0.17.44-next.1",
|
|
17
17
|
"clavarium-tether": "0.1.0-next.48",
|
|
18
18
|
"mammoth": "1.13.0",
|
|
19
19
|
"mermaid": "11.17.2",
|
|
@@ -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.58-next.1",
|
|
765
|
+
"resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.58-next.1.tgz",
|
|
766
|
+
"integrity": "sha512-Xswbzm4LHd/yV8cdG2eCuXyM96NAuW5IaOBXT0A8oha2qlohHNPWa+cdRiaIhgxo2H0YAyZjseu0cG/kbFDRRQ==",
|
|
767
767
|
"license": "MIT",
|
|
768
768
|
"bin": {
|
|
769
769
|
"binder": "bin/binder.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.44-next.1",
|
|
791
|
+
"resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.44-next.1.tgz",
|
|
792
|
+
"integrity": "sha512-2ISMxfdSZbZzht4n5ug3fRRFHyFPHlZYfVqDZXGr/fxpD1pmF9UXRnjDX4nGmaRegS1AtCGtDI2D3w5HXvL9Yw==",
|
|
793
793
|
"license": "MIT",
|
|
794
794
|
"bin": {
|
|
795
795
|
"parley": "bin/parley.mjs",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.139-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,9 +44,9 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@xterm/addon-fit": "^0.11.0",
|
|
46
46
|
"@xterm/xterm": "^6.0.0",
|
|
47
|
-
"clavarium-binder": "0.1.
|
|
47
|
+
"clavarium-binder": "0.1.58-next.1",
|
|
48
48
|
"clavarium-docket": "0.1.2-next.2",
|
|
49
|
-
"clavarium-parley": "0.17.
|
|
49
|
+
"clavarium-parley": "0.17.44-next.1",
|
|
50
50
|
"clavarium-tether": "0.1.0-next.48",
|
|
51
51
|
"mammoth": "1.13.0",
|
|
52
52
|
"mermaid": "11.17.2",
|
package/web/style.css
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
--brass: #d2a94e; --on-brass: #1b1405; --ok: #5fc39d; --warn: #e39a5c; --danger: #ee7f79; --wait: #5aa9f0;
|
|
6
6
|
/* Brass as the colour of text or of a small sign: darker on a light screen, to be read. */
|
|
7
7
|
--brass-ink: #d2a94e;
|
|
8
|
+
--button: #222c38; /* declared in both themes (02-11, the charter): no fallback scattered in the rules */
|
|
8
9
|
--sans: system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
9
10
|
}
|
|
10
11
|
/* A light screen, for whoever reads better dark on light. The terminal gets
|
|
@@ -21,7 +22,8 @@ html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
|
|
|
21
22
|
body { font: .875rem var(--sans); }
|
|
22
23
|
body { height: 100dvh; padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0); }
|
|
23
24
|
[hidden] { display: none !important; }
|
|
24
|
-
button { font: 600 .8125rem var(--sans); color: var(--ink); background: var(--button
|
|
25
|
+
button { font: 600 .8125rem var(--sans); color: var(--ink); background: var(--button); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; cursor: pointer; }
|
|
26
|
+
button:disabled { opacity: .5; cursor: default; } /* one look for a button that cannot be pressed (the charter) */
|
|
25
27
|
/* The main button (02-11): its words and outline in brass, no fill -- quieter, like a suggestion. */
|
|
26
28
|
button.primary { background: transparent; border-color: var(--brass); color: var(--brass-ink); }
|
|
27
29
|
button.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--brass) 12%, transparent); }
|
|
@@ -194,7 +196,7 @@ html[data-door="device"] #room { height: 100%; }
|
|
|
194
196
|
.chip[data-access="offline"] { color: var(--warn); border-color: var(--warn); }
|
|
195
197
|
#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
198
|
#signin-text { flex: 1; min-width: 160px; }
|
|
197
|
-
a.button { font: 600 .8125rem var(--sans); text-decoration: none; border-radius:
|
|
199
|
+
a.button { font: 600 .8125rem var(--sans); text-decoration: none; border-radius: 8px; padding: 7px 11px; background: transparent; border: 1px solid var(--brass); color: var(--brass-ink); }
|
|
198
200
|
#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
201
|
/* On a narrow screen the key row wraps instead of hiding its end, and
|
|
200
202
|
dictation comes first: by voice is how a phone is used. */
|
|
@@ -2173,7 +2175,7 @@ body.as-dragging #assets-rows .as-row { touch-action: none; }
|
|
|
2173
2175
|
/* THE CONVERSATIONS AS CARDS (02-11): playing cards, one per conversation, and one to add. */
|
|
2174
2176
|
#list-title { cursor: pointer; }
|
|
2175
2177
|
#deck { overflow-y: auto; }
|
|
2176
|
-
.deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; padding: 14px
|
|
2178
|
+
.deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; padding: 14px 16px 24px; }
|
|
2177
2179
|
.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
2180
|
.conv-card:hover, .conv-card:focus-visible { transform: translateY(-3px); border-color: var(--brass); }
|
|
2179
2181
|
.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; }
|