clavarium 0.2.156-beta.1 → 0.2.157-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/api.mjs +5 -1
- package/server/gitpush.mjs +152 -51
- package/server/settingswords.mjs +33 -0
- package/server/talk.mjs +4 -3
- package/web/app.js +356 -65
- package/web/index.html +334 -283
- package/web/style.css +69 -14
- package/web/voice-core.js +25 -0
- package/web/voice.js +9 -3
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.157-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.157-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
14
|
"clavarium-binder": "0.1.60-next.1",
|
|
15
15
|
"clavarium-docket": "0.1.2-next.2",
|
|
16
|
-
"clavarium-parley": "0.17.
|
|
16
|
+
"clavarium-parley": "0.17.66-next.1",
|
|
17
17
|
"clavarium-tether": "0.1.0-next.49",
|
|
18
18
|
"mammoth": "1.13.0",
|
|
19
19
|
"mermaid": "11.17.2",
|
|
@@ -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.66-next.1",
|
|
791
|
+
"resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.66-next.1.tgz",
|
|
792
|
+
"integrity": "sha512-dSvtC4uYpTT87AMufUEwa8LBVsQ6peNBah72AEp6yhj6OCNGoxiHmLUPKop/Q7QZBqBO38ZGzAMgqt+KIpRDDQ==",
|
|
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.157-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.",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@xterm/xterm": "^6.0.0",
|
|
47
47
|
"clavarium-binder": "0.1.60-next.1",
|
|
48
48
|
"clavarium-docket": "0.1.2-next.2",
|
|
49
|
-
"clavarium-parley": "0.17.
|
|
49
|
+
"clavarium-parley": "0.17.66-next.1",
|
|
50
50
|
"clavarium-tether": "0.1.0-next.49",
|
|
51
51
|
"mammoth": "1.13.0",
|
|
52
52
|
"mermaid": "11.17.2",
|
package/server/api.mjs
CHANGED
|
@@ -59,6 +59,8 @@
|
|
|
59
59
|
* POST /api/updates/apply { version }: update to the version that is out (in the background)
|
|
60
60
|
* POST /api/updates/back { version }: go back to a release that is kept (in the background)
|
|
61
61
|
* GET /api/git/<name>/outgoing?target=<branch>&branch=<branch> what would go from the agent's branch, to that branch of the remote
|
|
62
|
+
* GET /api/git/<name>/known To send at once: what is known here, no remote asked, no repository read
|
|
63
|
+
* GET /api/git/<name>/outgoing-all To send: one fetch, one read, the branches that moved last reviewed
|
|
62
64
|
* GET /api/git/<name>/graph the branch diagram: branches and their last commits
|
|
63
65
|
* GET /api/git/<name>/commit?id=<sha> one commit, as a review shows it (&base=<sha>: the commits from base to it)
|
|
64
66
|
* POST /api/git/<name>/push {head, target?, sure?}: exactly that reviewed commit, to exactly that branch
|
|
@@ -381,10 +383,12 @@ export async function handleApi(request, response, conversations, headers, resou
|
|
|
381
383
|
const answered = /^\/api\/conversations\/([^/]+)\/answerer\/log$/.exec(pathname);
|
|
382
384
|
if (answered && answerer) return send(200, answerer.log(decodeURIComponent(answered[1]))), true;
|
|
383
385
|
/* A repository: where its commits go, and what would go now. */
|
|
384
|
-
const repo = /^\/api\/git\/([a-z0-9-]{1,32})(\/outgoing|\/keep)?$/.exec(pathname);
|
|
386
|
+
const repo = /^\/api\/git\/([a-z0-9-]{1,32})(\/outgoing|\/outgoing-all|\/known|\/keep)?$/.exec(pathname);
|
|
385
387
|
const drawn = /^\/api\/git\/([a-z0-9-]{1,32})\/(graph|commit)$/.exec(pathname);
|
|
386
388
|
if (drawn && gitReview) return send(200, drawn[2] === 'graph' ? await gitReview.graph(drawn[1]) : await gitReview.commit(drawn[1], query.get('id'), query.get('base'))), true;
|
|
387
389
|
if (repo && repo[2] === '/keep' && gitKeeper) return send(200, gitKeeper.about(repo[1])), true;
|
|
390
|
+
if (repo && repo[2] === '/known' && gitReview) return send(200, await gitReview.known(repo[1])), true;
|
|
391
|
+
if (repo && repo[2] === '/outgoing-all' && gitReview) return send(200, await gitReview.outgoingAll(repo[1])), true;
|
|
388
392
|
if (repo && gitReview) return send(200, repo[2] ? await gitReview.outgoing(repo[1], { target: query.get('target') ?? undefined, branch: query.get('branch') ?? undefined }) : gitReview.settings(repo[1])), true;
|
|
389
393
|
const watched = /^\/api\/conversations\/([^/]+)\/signin$/.exec(pathname);
|
|
390
394
|
if (watched && signin) {
|
package/server/gitpush.mjs
CHANGED
|
@@ -40,6 +40,8 @@ export const UNCHANGED_MAX = 50;
|
|
|
40
40
|
/* A commit message is shown up to this many characters, and the cut is said. */
|
|
41
41
|
export const MESSAGE_MAX = 4000;
|
|
42
42
|
export const REVIEWS_KEPT = 20;
|
|
43
|
+
/* To send: besides the branch that moved last, how many others of a repository are looked at. */
|
|
44
|
+
export const BRANCHES_MORE = 7;
|
|
43
45
|
/* The branch diagram: so many commits, so many of the remote's branches. */
|
|
44
46
|
export const GRAPH_COMMITS = 40;
|
|
45
47
|
export const GRAPH_BRANCHES = 20;
|
|
@@ -69,6 +71,9 @@ export function escaped(text) {
|
|
|
69
71
|
(c) => (c === '\n' || c === '\t' ? c : `\\u{${c.codePointAt(0).toString(16)}}`));
|
|
70
72
|
}
|
|
71
73
|
|
|
74
|
+
/* A review's fields when there is nothing to show. */
|
|
75
|
+
const nothingOut = (remote) => ({ branches: [], agentBranches: [], dropped: [], targetExists: false, remoteTip: null, head: null, commits: [], count: 0, stat: '', diff: '', cut: false, guards: null, remote });
|
|
76
|
+
|
|
72
77
|
export class GitReview {
|
|
73
78
|
#store; #vault; #resources; #local; #access; #runner; #now; #listeners = []; #waivers = () => ({});
|
|
74
79
|
/* The refresh of each repository on its way: { run, waitMs }, by name. */
|
|
@@ -280,6 +285,8 @@ export class GitReview {
|
|
|
280
285
|
}
|
|
281
286
|
if (made) await this.#resources.shareOrigin(r.name).catch(() => {});
|
|
282
287
|
await this.#learnDefault(r, remote).catch(() => {});
|
|
288
|
+
/* When the reference was last brought up to date: the list shown at once says "as of" it. */
|
|
289
|
+
this.#store.put({ ...this.#record(r.name), name: r.name, fetchedAt: this.#now().toISOString() });
|
|
283
290
|
return said({ ok: true, message: 'Up to date with the remote.', rewritten, made, brought });
|
|
284
291
|
}
|
|
285
292
|
|
|
@@ -361,7 +368,7 @@ export class GitReview {
|
|
|
361
368
|
const asked = target === undefined || target === null || target === '' ? undefined : asBranch(target);
|
|
362
369
|
const pick = branch === undefined || branch === null || branch === '' ? undefined : asBranch(branch);
|
|
363
370
|
const remote = this.#remoteOf(r) ?? null;
|
|
364
|
-
const nothing =
|
|
371
|
+
const nothing = nothingOut(remote);
|
|
365
372
|
if (remote) {
|
|
366
373
|
const fresh = await this.refresh(r.name, { waitMs: REVIEW_WAIT_MS });
|
|
367
374
|
if (!fresh.ok) return { ...nothing, state: 'unreachable', branch: pick ?? null, target: asked ?? null, message: `The remote did not answer as expected: ${fresh.message}` };
|
|
@@ -372,61 +379,155 @@ export class GitReview {
|
|
|
372
379
|
throw error;
|
|
373
380
|
}
|
|
374
381
|
try {
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
const dropped = got.dropped.map((d) => ({ name: escaped(d.name), why: d.why }));
|
|
379
|
-
if (agentBranches.length === 0) return { ...nothing, dropped, state: 'empty', branch: null, target: asked ?? null, message: 'No branch of this repository can be sent: see the names that were not taken.' };
|
|
380
|
-
const chosen = pick ? agentBranches.find((b) => b.name === pick) : agentBranches[0];
|
|
382
|
+
const listed = this.#listed(r, got);
|
|
383
|
+
if (listed.agentBranches.length === 0) return { ...nothing, dropped: listed.dropped, state: 'empty', branch: null, target: asked ?? null, message: 'No branch of this repository can be sent: see the names that were not taken.' };
|
|
384
|
+
const chosen = pick ? listed.agentBranches.find((b) => b.name === pick) : listed.agentBranches[0];
|
|
381
385
|
if (!chosen) throw new Refusal(404, `The agent's repository has no branch ${pick}.`);
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
386
|
+
return await this.#look(r, got, listed, chosen, asked);
|
|
387
|
+
} finally { got.remove(); }
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/* TO SEND, A WHOLE REPOSITORY AT ONCE: one fetch (shared with any on
|
|
391
|
+
its way), ONE read of the agent's repository, then each of its
|
|
392
|
+
branches that moved last (up to 1 + `more`) compared in that same
|
|
393
|
+
workspace. The page asked one review per branch before, and each
|
|
394
|
+
read the whole repository again through the host program: the read
|
|
395
|
+
of the whole history, checked object by object, is what takes time,
|
|
396
|
+
not the comparison. { state: 'read' | 'empty' | 'unreachable',
|
|
397
|
+
message, remote, agentBranches, dropped, rows: [as outgoing()], more,
|
|
398
|
+
asOf }; `more`: how many branches were not looked at. A branch whose
|
|
399
|
+
comparison failed is a row { state: 'error', branch, message }. */
|
|
400
|
+
async outgoingAll(name, { more = BRANCHES_MORE } = {}) {
|
|
401
|
+
const r = this.#repository(name);
|
|
402
|
+
const remote = this.#remoteOf(r) ?? null;
|
|
403
|
+
const base = { remote, agentBranches: [], dropped: [], rows: [], more: 0, asOf: this.#now().toISOString() };
|
|
404
|
+
if (remote) {
|
|
405
|
+
const fresh = await this.refresh(r.name, { waitMs: REVIEW_WAIT_MS });
|
|
406
|
+
if (!fresh.ok) return { ...base, state: 'unreachable', message: `The remote did not answer as expected: ${fresh.message}` };
|
|
407
|
+
}
|
|
408
|
+
let got;
|
|
409
|
+
try { got = await this.#read(r); } catch (error) {
|
|
410
|
+
if (error instanceof GitFailure && error.kind === 'empty') return { ...base, state: 'empty', message: 'Nothing has been committed on a branch in this repository yet.' };
|
|
411
|
+
throw error;
|
|
412
|
+
}
|
|
413
|
+
try {
|
|
414
|
+
const listed = this.#listed(r, got);
|
|
415
|
+
if (listed.agentBranches.length === 0) return { ...base, ...listed, state: 'empty', message: 'No branch of this repository can be sent: see the names that were not taken.' };
|
|
416
|
+
const chosen = listed.agentBranches.slice(0, 1 + Math.max(0, Math.floor(Number(more) || 0)));
|
|
417
|
+
const rows = [];
|
|
418
|
+
for (const b of chosen) {
|
|
419
|
+
try { rows.push(await this.#look(r, got, listed, b, undefined)); } catch (error) {
|
|
420
|
+
rows.push({ ...nothingOut(remote), state: 'error', branch: b.name, target: b.name, kind: error?.kind ?? null, message: error instanceof Refusal ? error.message : 'It could not be read.' });
|
|
416
421
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
const commitsText = n === null ? 'Commits (their number could not be counted)' : `${n} commit(s)`;
|
|
420
|
-
const message = state === 'up-to-date' ? `Everything committed here is already there, in ${to}.`
|
|
421
|
-
: state === 'diverged' ? `The remote's ${to} has ${behind ?? 'some'} commit(s) that this repository does not have: the tool must bring them in first (pull), then this can be sent.`
|
|
422
|
-
: !remoteTip ? (n !== 0 ? `${commitsText} would be sent to ${to}, a new branch on the remote.` : `${to} would be made on the remote, at a commit it already has: no new commit.`)
|
|
423
|
-
: `${commitsText} would be sent to ${to}.`;
|
|
424
|
-
if (state === 'ahead') this.#keep(r.name, { branch: chosen.name, head, target: to, remoteTip, count: n ?? undefined, confirm: shown.guards.confirm, at: asOf });
|
|
425
|
-
return { ...nothing, ...base0, ...shown, branches, targetExists: Boolean(remoteTip), remoteTip, state, message };
|
|
426
|
-
} finally { release(); }
|
|
422
|
+
}
|
|
423
|
+
return { ...base, ...listed, state: 'read', message: '', rows, more: listed.agentBranches.length - chosen.length, asOf: this.#now().toISOString() };
|
|
427
424
|
} finally { got.remove(); }
|
|
428
425
|
}
|
|
429
426
|
|
|
427
|
+
/* WHAT IS KNOWN HERE, AT ONCE: no remote asked, no repository read. The
|
|
428
|
+
agent's branches as the last read saw them, the remote's as the last
|
|
429
|
+
fetch left them in the reference, and for each branch the outcome of
|
|
430
|
+
its last review -- kept only while neither tip moved since. A branch
|
|
431
|
+
that moved is 'unknown' until the next review (its commits are in the
|
|
432
|
+
agent's machine: only a read brings them). { remote, readAt,
|
|
433
|
+
fetchedAt, branches, rows: [{ branch, head, movedAt, target,
|
|
434
|
+
remoteTip, targetExists, state, count, lookedAt }], more }. Nothing
|
|
435
|
+
here may be sent: Send reads and fetches again (send()). */
|
|
436
|
+
async known(name, { more = BRANCHES_MORE } = {}) {
|
|
437
|
+
const r = this.#repository(name);
|
|
438
|
+
const remote = this.#remoteOf(r) ?? null;
|
|
439
|
+
const record = this.#record(r.name);
|
|
440
|
+
const reference = this.#reference(r.name);
|
|
441
|
+
const remoteTips = remote && this.#resources.hasOrigin(r.name) ? await this.#tipsIn(reference).catch(() => new Map()) : new Map();
|
|
442
|
+
const all = Object.entries(record.tips ?? {}).map(([b, tip]) => ({ name: b, id: tip.id, movedAt: tip.movedAt ?? null }))
|
|
443
|
+
.sort((a, b) => String(b.movedAt).localeCompare(String(a.movedAt)) || a.name.localeCompare(b.name));
|
|
444
|
+
const chosen = all.slice(0, 1 + Math.max(0, Math.floor(Number(more) || 0)));
|
|
445
|
+
const rows = [];
|
|
446
|
+
for (const b of chosen) {
|
|
447
|
+
const last = record.looked?.[b.name];
|
|
448
|
+
const target = last?.target ?? b.name;
|
|
449
|
+
const remoteTip = remoteTips.get(target) ?? null;
|
|
450
|
+
const same = last && last.head === b.id && (last.remoteTip ?? null) === remoteTip;
|
|
451
|
+
let state = 'unknown';
|
|
452
|
+
if (!remote) state = 'no-remote';
|
|
453
|
+
else if (same) state = last.state;
|
|
454
|
+
/* Already on the remote's branch: seen in the reference alone. */
|
|
455
|
+
else if (remoteTip && (remoteTip === b.id || (await this.#has(reference, b.id) && await this.#isAncestor(reference, b.id, remoteTip)))) state = 'up-to-date';
|
|
456
|
+
rows.push({ branch: b.name, head: b.id, movedAt: b.movedAt, target, remoteTip, targetExists: Boolean(remoteTip), state, count: same ? last.count ?? null : state === 'up-to-date' ? 0 : null, lookedAt: last?.at ?? null });
|
|
457
|
+
}
|
|
458
|
+
return { remote, readAt: record.readAt ?? null, fetchedAt: record.fetchedAt ?? null, branches: [...remoteTips.keys()].sort().slice(0, BRANCHES_MAX), rows, more: all.length - chosen.length };
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/* The agent's branches of one read, the one that moved last first. */
|
|
462
|
+
#listed(r, got) {
|
|
463
|
+
const tips = this.tips(r.name);
|
|
464
|
+
const agentBranches = got.branches.map((b) => ({ name: b.name, id: b.id, movedAt: tips[b.name]?.movedAt ?? null }))
|
|
465
|
+
.sort((a, b) => String(b.movedAt).localeCompare(String(a.movedAt)) || a.name.localeCompare(b.name));
|
|
466
|
+
return { agentBranches, dropped: got.dropped.map((d) => ({ name: escaped(d.name), why: d.why })) };
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/* The outcome of a review, kept by branch for the list shown at once (known()). */
|
|
470
|
+
#remember(name, out, agentBranches) {
|
|
471
|
+
const record = this.#record(name);
|
|
472
|
+
const looked = {};
|
|
473
|
+
for (const b of agentBranches) if (record.looked?.[b.name]) looked[b.name] = record.looked[b.name];
|
|
474
|
+
looked[out.branch] = { head: out.head, target: out.target, remoteTip: out.remoteTip ?? null, state: out.state, count: out.count ?? null, at: out.asOf };
|
|
475
|
+
this.#store.put({ ...record, looked });
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/* One branch of a read, compared with the remote's: see outgoing(). */
|
|
479
|
+
async #look(r, got, { agentBranches, dropped }, chosen, asked) {
|
|
480
|
+
const remote = this.#remoteOf(r) ?? null;
|
|
481
|
+
const nothing = nothingOut(remote);
|
|
482
|
+
const ws = got.path;
|
|
483
|
+
const head = chosen.id;
|
|
484
|
+
const to = asked ?? chosen.name;
|
|
485
|
+
const asOf = this.#now().toISOString();
|
|
486
|
+
const base0 = { agentBranches, dropped, branch: chosen.name, target: to, head, remote, asOf };
|
|
487
|
+
if (!remote) {
|
|
488
|
+
const shown = await this.#compare(ws, { head, base: EMPTY_TREE, range: [head], negatives: [] });
|
|
489
|
+
return { ...nothing, ...base0, ...shown, state: 'no-remote', message: 'No address is set to send these commits to.' };
|
|
490
|
+
}
|
|
491
|
+
const reference = this.#reference(r.name);
|
|
492
|
+
const release = await this.#runner.lock(reference, REVIEW_WAIT_MS);
|
|
493
|
+
try {
|
|
494
|
+
this.#runner.borrow(ws, reference);
|
|
495
|
+
const remoteTips = await this.#tipsIn(reference);
|
|
496
|
+
const branches = [...remoteTips.keys()].sort().slice(0, BRANCHES_MAX);
|
|
497
|
+
const remoteTip = remoteTips.get(to) ?? null;
|
|
498
|
+
let shown; let behind = null; let inRemote = false; let containsRemote = true;
|
|
499
|
+
if (remoteTip) {
|
|
500
|
+
shown = await this.#compare(ws, { head, base: remoteTip, range: [head], negatives: [remoteTip] });
|
|
501
|
+
/* The state rests on ancestry, asked directly, never on a
|
|
502
|
+
count: a count that failed must not read as 0, "already
|
|
503
|
+
there", nor as "nothing behind". */
|
|
504
|
+
inRemote = await this.#ancestry(ws, head, remoteTip);
|
|
505
|
+
containsRemote = await this.#ancestry(ws, remoteTip, head);
|
|
506
|
+
const b = await this.#runner.in(ws, ['rev-list', '--count', '--end-of-options', remoteTip, `^${head}`], { deadlineMs: 120_000 });
|
|
507
|
+
const text = b.stdout.toString('latin1').trim();
|
|
508
|
+
behind = b.code === 0 && !b.killed && /^\d+$/.test(text) ? Number(text) : null;
|
|
509
|
+
} else {
|
|
510
|
+
/* A new branch: what would travel is what the remote has on
|
|
511
|
+
no branch at all; the changes are shown from where the
|
|
512
|
+
agent's branch left the remote's branch of its own name. */
|
|
513
|
+
const same = remoteTips.get(chosen.name);
|
|
514
|
+
const fork = same ? (await this.#runner.in(ws, ['merge-base', '--end-of-options', head, same])).stdout.toString('latin1').trim() : '';
|
|
515
|
+
shown = await this.#compare(ws, { head, base: isId(fork) ? fork : EMPTY_TREE, range: [head], negatives: [...remoteTips.values()] });
|
|
516
|
+
}
|
|
517
|
+
const state = !remoteTip ? 'ahead' : inRemote ? 'up-to-date' : !containsRemote ? 'diverged' : 'ahead';
|
|
518
|
+
const n = shown.count;
|
|
519
|
+
const commitsText = n === null ? 'Commits (their number could not be counted)' : `${n} commit(s)`;
|
|
520
|
+
const message = state === 'up-to-date' ? `Everything committed here is already there, in ${to}.`
|
|
521
|
+
: state === 'diverged' ? `The remote's ${to} has ${behind ?? 'some'} commit(s) that this repository does not have: the tool must bring them in first (pull), then this can be sent.`
|
|
522
|
+
: !remoteTip ? (n !== 0 ? `${commitsText} would be sent to ${to}, a new branch on the remote.` : `${to} would be made on the remote, at a commit it already has: no new commit.`)
|
|
523
|
+
: `${commitsText} would be sent to ${to}.`;
|
|
524
|
+
if (state === 'ahead') this.#keep(r.name, { branch: chosen.name, head, target: to, remoteTip, count: n ?? undefined, confirm: shown.guards.confirm, at: asOf });
|
|
525
|
+
const out = { ...nothing, ...base0, ...shown, branches, targetExists: Boolean(remoteTip), remoteTip, state, message };
|
|
526
|
+
this.#remember(r.name, out, agentBranches);
|
|
527
|
+
return out;
|
|
528
|
+
} finally { release(); }
|
|
529
|
+
}
|
|
530
|
+
|
|
430
531
|
/* The workspace of one read, with the remote's history lent to it when
|
|
431
532
|
there is one, for `work(ws, remoteTips)`; deleted after. */
|
|
432
533
|
async #withRead(r, work) {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* THE WORDS OF THE SETTINGS PAGES in French (settings redesign, 05-11); English is in the page (web/index.html,
|
|
2
|
+
web/app.js, uiSaid). Served with the chat screen's words (/api/talk/words, talk.mjs), as Features' are, so the
|
|
3
|
+
owner's own words may replace any of them. French says « vous ». One short line each. */
|
|
4
|
+
export const SETTINGS_WORDS_FR = {
|
|
5
|
+
'set-tab-general': 'Général', 'set-tab-device': 'Cet appareil', 'set-tab-resources': 'Ressources', 'set-tab-access': 'Accès',
|
|
6
|
+
'set-tab-chat': 'Chat et voix', 'set-tab-automatic': 'Automatique', 'set-tab-diagnostics': 'Diagnostics', 'set-tab-advanced': 'Avancé',
|
|
7
|
+
'set-ch-general': 'Général', 'set-ch-machine': 'Machine', 'set-ch-access': 'Accès', 'set-ch-sharing': 'Partage', 'set-ch-chat': 'Chat',
|
|
8
|
+
'set-ch-wakeups': 'Réveils', 'set-ch-answerer': 'Répondeur', 'set-ch-health': 'Santé', 'set-ch-advanced': 'Avancé',
|
|
9
|
+
'set-ch-s-general': 'Général', 'set-ch-s-about': 'À propos', 'set-ch-s-screen': 'Écran', 'set-ch-s-alerts': 'Alertes',
|
|
10
|
+
'set-ch-s-resources': 'Ressources', 'set-ch-s-operators': 'Administrateurs', 'set-ch-s-network': 'Réseau', 'set-ch-s-remote-screen': 'Écran à distance',
|
|
11
|
+
'set-ch-s-words': 'Écran du chat', 'set-ch-s-dictation': 'Dictée', 'set-ch-s-shortcuts': 'Raccourcis', 'set-ch-s-thread': 'Événements du chat',
|
|
12
|
+
'set-ch-s-updates': 'Mises à jour', 'set-ch-s-binders': 'Classeurs', 'set-ch-s-events': 'Activité', 'set-ch-s-logs': 'Journaux',
|
|
13
|
+
'set-ch-s-usage': 'Usage', 'set-ch-s-backup': 'Sauvegarde', 'set-ch-s-advanced': 'Avancé',
|
|
14
|
+
'set-check-updates': 'Chercher une mise à jour', 'set-activity': 'Activité', 'set-restart-dots': 'Redémarrer…', 'set-terminal': 'Terminal',
|
|
15
|
+
'set-search': 'Chercher', 'set-why': 'Pourquoi',
|
|
16
|
+
'set-memory': 'Mémoire', 'set-disk': 'Disque', 'set-cpu': 'Processeur',
|
|
17
|
+
'set-free-of': '{free} libres sur {total}', 'set-left-of': '{free} restants sur {total}', 'set-highest': 'au plus {n} % en 1 h',
|
|
18
|
+
'set-core': '1 cœur', 'set-cores': '{n} cœurs',
|
|
19
|
+
'set-update-out': '{v} est sortie', 'set-up-to-date': 'À jour · {v}', 'set-wifi-on': 'Wi-Fi · {name}', 'set-wifi-off': 'Wi-Fi non utilisé', 'set-cable': 'Câble',
|
|
20
|
+
'set-not-well': 'ne va pas bien', 'set-box-away': '{name} hors ligne',
|
|
21
|
+
'set-just-now': 'à l\'instant', 'set-min-ago': 'il y a {n} min', 'set-h-ago': 'il y a {n} h', 'set-days-ago': 'il y a {n} jours',
|
|
22
|
+
'set-on': 'Activé', 'set-off': 'Désactivé', 'set-none': 'Aucun', 'set-changed': '{n} modifiés', 'set-as-given': 'Comme livrés',
|
|
23
|
+
'set-lang-device': 'La langue de chaque appareil', 'set-res-now': 'Mémoire {m} % · disque {d} %',
|
|
24
|
+
'set-binders-max': 'Les agents en font {n} au plus', 'set-admin-1': '1 administrateur', 'set-admins': '{n} administrateurs',
|
|
25
|
+
'set-backup-now': 'Exporter · importer', 'set-git-key': '1 clé git', 'set-git-keys': '{n} clés git', 'set-restart': 'redémarrer',
|
|
26
|
+
'set-logs-now': 'Clavarium, machines, système',
|
|
27
|
+
'set-dict-backup': 'Secours en service', 'set-dict-expired': 'Clé expirée', 'set-dict-with-backup': 'avec secours', 'set-dict-server': 'réglée sur le serveur',
|
|
28
|
+
'set-attached': '{n} joints', 'set-secret': '1 secret', 'set-secrets': '{n} secrets', 'set-offline': 'hors ligne',
|
|
29
|
+
'set-device': '1 appareil', 'set-devices': '{n} appareils', 'set-no-device': 'Aucun appareil', 'set-chat': 'Chat',
|
|
30
|
+
'set-wakeups-on': '{on} sur {n} actifs', 'set-asleep': 'Endormie', 'set-not-looked': 'Pas encore regardée',
|
|
31
|
+
'set-running-well': 'En marche · rien d\'anormal', 'set-conv-advanced': 'Archiver · remettre à neuf · supprimer',
|
|
32
|
+
};
|
|
33
|
+
export const settingsWords = (lang) => (String(lang ?? '').toLowerCase().split('-')[0] === 'fr' ? { ...SETTINGS_WORDS_FR } : {});
|
package/server/talk.mjs
CHANGED
|
@@ -63,6 +63,7 @@ import { randomUUID, createHash } from 'node:crypto';
|
|
|
63
63
|
import { mkdirSync, lstatSync, rmSync, readFileSync, writeFileSync, readdirSync } from 'node:fs';
|
|
64
64
|
import { install, Parley, WAKE, reread, texts, fill, LANGUAGES, SHOWN_MAX, FILES_MAX } from 'clavarium-parley/host';
|
|
65
65
|
import { featureWords } from './features.mjs';
|
|
66
|
+
import { settingsWords } from './settingswords.mjs';
|
|
66
67
|
import { importFile } from './files.mjs';
|
|
67
68
|
import { KEYS } from 'clavarium-parley/ui';
|
|
68
69
|
import { Refusal, SESSION } from './conversations.mjs';
|
|
@@ -268,9 +269,9 @@ export class Talk {
|
|
|
268
269
|
const lang = s.lang === 'device' ? String(device ?? 'en') : s.lang;
|
|
269
270
|
const words = texts(lang, s.own);
|
|
270
271
|
this.#lastLang = words.lang;
|
|
271
|
-
/* The words of Features (features.mjs) for this language, the owner's own over them as over the others. */
|
|
272
|
-
const more = featureWords(words.lang);
|
|
273
|
-
for (const [key, value] of Object.entries(s.own ?? {})) if (key.startsWith('features-') && typeof value === 'string') more[key] = value.slice(0, 500);
|
|
272
|
+
/* The words of Features (features.mjs) and of the settings pages (settingswords.mjs) for this language, the owner's own over them as over the others. */
|
|
273
|
+
const more = { ...featureWords(words.lang), ...settingsWords(words.lang) };
|
|
274
|
+
for (const [key, value] of Object.entries(s.own ?? {})) if ((key.startsWith('features-') || key.startsWith('set-')) && typeof value === 'string') more[key] = value.slice(0, 500);
|
|
274
275
|
return { ...more, ...words };
|
|
275
276
|
}
|
|
276
277
|
|