clavarium 0.2.100-beta.1 → 0.2.101-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/npm-shrinkwrap.json +6 -6
- package/package.json +2 -2
- package/server/tethers.mjs +1 -1
- package/web/app.js +16 -3
- package/web/style.css +7 -0
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.101-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.101-beta.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"clavarium-binder": "0.1.43-next.1",
|
|
15
15
|
"clavarium-docket": "0.1.1",
|
|
16
16
|
"clavarium-parley": "0.17.31-next.1",
|
|
17
|
-
"clavarium-tether": "0.1.0-next.
|
|
17
|
+
"clavarium-tether": "0.1.0-next.39",
|
|
18
18
|
"mermaid": "11.17.2",
|
|
19
19
|
"node-pty": "^1.1.0",
|
|
20
20
|
"pdfjs-dist": "6.4.299",
|
|
@@ -760,9 +760,9 @@
|
|
|
760
760
|
}
|
|
761
761
|
},
|
|
762
762
|
"node_modules/clavarium-tether": {
|
|
763
|
-
"version": "0.1.0-next.
|
|
764
|
-
"resolved": "https://registry.npmjs.org/clavarium-tether/-/clavarium-tether-0.1.0-next.
|
|
765
|
-
"integrity": "sha512
|
|
763
|
+
"version": "0.1.0-next.39",
|
|
764
|
+
"resolved": "https://registry.npmjs.org/clavarium-tether/-/clavarium-tether-0.1.0-next.39.tgz",
|
|
765
|
+
"integrity": "sha512-/lAKDuGu6rt/auXXq35M2KSXa7cd+xZjxnGdBDsRi3wmSTG63w672QTxRQgROzuPdKbv2OLsw0gjzNKdPvG2aQ==",
|
|
766
766
|
"license": "MIT",
|
|
767
767
|
"bin": {
|
|
768
768
|
"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.101-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.",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"clavarium-binder": "0.1.43-next.1",
|
|
48
48
|
"clavarium-docket": "0.1.1",
|
|
49
49
|
"clavarium-parley": "0.17.31-next.1",
|
|
50
|
-
"clavarium-tether": "0.1.0-next.
|
|
50
|
+
"clavarium-tether": "0.1.0-next.39",
|
|
51
51
|
"mermaid": "11.17.2",
|
|
52
52
|
"node-pty": "^1.1.0",
|
|
53
53
|
"pdfjs-dist": "6.4.299",
|
package/server/tethers.mjs
CHANGED
|
@@ -82,7 +82,7 @@ export class Tethers {
|
|
|
82
82
|
if (!who.startsWith(AGENT)) continue;
|
|
83
83
|
const name = who.slice(AGENT.length);
|
|
84
84
|
this.#seen.set(j.id, { name, verb: j.verb });
|
|
85
|
-
try { this.announce(name, { kind: 'tether-job', text: `To do in your browser: ${j.args?.name ? `flash ${j.args.name}` : 'flash a device'}.
|
|
85
|
+
try { this.announce(name, { kind: 'tether-job', text: `To do in your browser: ${j.args?.name ? `flash ${j.args.name}` : 'flash a device'}. Plug it in by USB here, then start.`, topic: 'Demande', tone: 'warn', actions: [`flash:${j.id}`] }); } catch { /* its chat is off */ }
|
|
86
86
|
}
|
|
87
87
|
for (const [id, info] of [...this.#seen]) {
|
|
88
88
|
if (live.has(id)) continue;
|
package/web/app.js
CHANGED
|
@@ -2617,7 +2617,7 @@
|
|
|
2617
2617
|
/* A message attached to a card (#180), from its menu: its id, as the card opens it again. */
|
|
2618
2618
|
...(!DEVICE ? { card: (m) => attachToCard({ kind: 'message', ref: m.id, title: String(m.short || m.text || '').replace(/\s+/g, ' ').trim().slice(0, 80) }) } : {}),
|
|
2619
2619
|
/* The buttons of a line of the machine: what this screen may do. */
|
|
2620
|
-
act: (id) => { if (id === 'seen-done') return; if (id === 'seen') void markSeen(); else if (id === 'memory') void openMemory(); else if (id === 'disk') void openDisk(); else if (id === 'room') seeTerminal(); else if (id === 'restart') void restartMachine(false); else if (id === 'terminal') seeTerminal(); else if (id.startsWith('allow:')) void decideTether(id.slice('allow:'.length), 'yes'); else if (id.startsWith('deny:')) void decideTether(id.slice('deny:'.length), 'no'); else if (id.startsWith('review:')) void openGit(id.slice('review:'.length)); else openCommits(id); },
|
|
2620
|
+
act: (id) => { if (id === 'seen-done') return; if (id === 'seen') void markSeen(); else if (id === 'memory') void openMemory(); else if (id === 'disk') void openDisk(); else if (id === 'room') seeTerminal(); else if (id === 'restart') void restartMachine(false); else if (id === 'terminal') seeTerminal(); else if (id.startsWith('allow:')) void decideTether(id.slice('allow:'.length), 'yes'); else if (id.startsWith('deny:')) void decideTether(id.slice('deny:'.length), 'no'); else if (id.startsWith('flash:')) void flashFromThread(id.slice('flash:'.length)); else if (id.startsWith('review:')) void openGit(id.slice('review:'.length)); else openCommits(id); },
|
|
2621
2621
|
/* What it opens over the thread (a picture, its media, a search...) is a step of this page's: one Back closes it. */
|
|
2622
2622
|
back: { open: (name, close) => nav.over(`chat-${name}`, () => close(), { stack: true }), closed: (step) => { if (step) nav.drop(step); } },
|
|
2623
2623
|
/* Files attached to a message: wherever the chat may be written in. */
|
|
@@ -2751,10 +2751,10 @@
|
|
|
2751
2751
|
/* "commits:<repository>.<to>.<from>.<n>": those commits, in the review ("See the 3 commits"). A commit a
|
|
2752
2752
|
line names (7 to 40 hexadecimal characters, a digit among them) is a link to its review, on a line about
|
|
2753
2753
|
a repository; the agent's own messages are never read for this. */
|
|
2754
|
-
const ACTIONS = { memory: 'More memory...', disk: 'Give it more disk...', room: 'See what takes room', restart: 'Restart...', terminal: 'See the terminal', review: 'Open the review', seen: '\u2713 Seen', allow: 'Accept', deny: 'Refuse' };
|
|
2754
|
+
const ACTIONS = { memory: 'More memory...', disk: 'Give it more disk...', room: 'See what takes room', restart: 'Restart...', terminal: 'See the terminal', review: 'Open the review', seen: '\u2713 Seen', allow: 'Accept', deny: 'Refuse', flash: 'Plug it in and start' };
|
|
2755
2755
|
const COMMITS = /^commits:([a-z0-9][a-z0-9-]*)\.([0-9a-f]{7,40})\.([0-9a-f]{7,40})\.(\d{1,4})$/;
|
|
2756
2756
|
/* A Tether call an agent asked the owner to allow, offered right in the thread: allow:<id> / deny:<id>. */
|
|
2757
|
-
const DEMANDE = /^(allow|deny):[0-9a-f-]{36}$/;
|
|
2757
|
+
const DEMANDE = /^(allow|deny|flash):[0-9a-f-]{36}$/;
|
|
2758
2758
|
const COMMIT = /^commit:([a-z0-9][a-z0-9-]*)\.([0-9a-f]{7,40})$/;
|
|
2759
2759
|
function openCommits(id) {
|
|
2760
2760
|
if (DEVICE) return;
|
|
@@ -4389,6 +4389,19 @@
|
|
|
4389
4389
|
Tether's own module runs here (/vendor/tether/jobs.js) and its end is the agent's answer.
|
|
4390
4390
|
Its element is kept from one paint to the next: the module draws in it while it runs. */
|
|
4391
4391
|
const jobPlaces = new Map();
|
|
4392
|
+
/* The same, from its button in the thread: the module draws in a panel over the page, closed once done. */
|
|
4393
|
+
async function flashFromThread(id) {
|
|
4394
|
+
const tether = await getJson('/tether', {});
|
|
4395
|
+
const job = (Array.isArray(tether.jobs) ? tether.jobs : []).find((j) => j.id === id);
|
|
4396
|
+
let panel = $('job-panel');
|
|
4397
|
+
if (!panel) { panel = el('div', 'card job-panel'); panel.id = 'job-panel'; panel.setAttribute('role', 'dialog'); document.body.append(panel); }
|
|
4398
|
+
panel.hidden = false;
|
|
4399
|
+
if (!job) { panel.replaceChildren(el('p', '', 'This flash ended already, or was cancelled.')); setTimeout(() => { panel.hidden = true; }, 3000); return; }
|
|
4400
|
+
const close = el('button', '', 'Close'); close.type = 'button'; close.addEventListener('click', () => { panel.hidden = true; });
|
|
4401
|
+
const card = jobCard(job, () => { void paintRoomAssets(); });
|
|
4402
|
+
panel.replaceChildren(card, close);
|
|
4403
|
+
card.querySelector('.action-row button.primary')?.click();
|
|
4404
|
+
}
|
|
4392
4405
|
function jobCard(job, after) {
|
|
4393
4406
|
if (!jobPlaces.has(job.id)) {
|
|
4394
4407
|
const card = el('div', 'card job-card'); card.dataset.job = job.id;
|
package/web/style.css
CHANGED
|
@@ -2063,3 +2063,10 @@ details.commit > pre { margin: 6px 0 0 1.6em; white-space: pre-wrap; overflow-wr
|
|
|
2063
2063
|
.as-group.as-drop-over { outline: 2px dashed var(--brass); outline-offset: 2px; border-radius: 10px; background: rgba(210, 169, 78, .07); }
|
|
2064
2064
|
body.as-dragging { user-select: none; -webkit-user-select: none; }
|
|
2065
2065
|
body.as-dragging #assets-rows .as-row { touch-action: none; }
|
|
2066
|
+
/* A flash started from its button in the thread: Tether's module draws its steps here, over the page. */
|
|
2067
|
+
.job-panel { position: fixed; z-index: 60; left: 50%; top: 18%; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; display: grid; gap: 10px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgb(0 0 0 / .45); }
|
|
2068
|
+
.job-panel > button { justify-self: end; }
|
|
2069
|
+
.job-panel .tether-flash { display: grid; gap: 8px; }
|
|
2070
|
+
.job-panel .tether-flash progress { width: 100%; }
|
|
2071
|
+
.job-panel .tether-flash-extra { display: grid; gap: 8px; }
|
|
2072
|
+
.job-panel .tether-flash-bad { color: var(--bad, #ff8a80); }
|