clavarium 0.2.232-beta.1 → 0.2.233-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/deploy/updater.mjs +1 -1
- package/npm-shrinkwrap.json +14 -14
- package/package.json +4 -4
- package/server/profile.mjs +9 -3
package/deploy/updater.mjs
CHANGED
|
@@ -152,7 +152,7 @@ export const SUDOERS = '/etc/sudoers.d/clavarium';
|
|
|
152
152
|
/* What sudo is told, tried in this order: the first its version takes without a word wins. Some sudo builds do
|
|
153
153
|
not know « syslog » (found 01-11 on a real server: « unknown setting: 'syslog' » on every call); they keep
|
|
154
154
|
the session lines quiet at least. A line of ours their sudo does not take is replaced. */
|
|
155
|
-
export const QUIET_SETTINGS = ['!syslog, !pam_session', '!pam_session'];
|
|
155
|
+
export const QUIET_SETTINGS = ['!syslog, !pam_session', '!pam_session', '!syslog']; /* sudo-rs (Ubuntu 25.10+) refuses pam_session: !syslog alone tried after */
|
|
156
156
|
export const quietLine = (account, setting = QUIET_SETTINGS[0]) => `Defaults:${account} ${setting}`;
|
|
157
157
|
const QUIET_COMMENT = '# Added by the Clavarium updater: its probes every few seconds are not written to the system log.';
|
|
158
158
|
/* `told(outcome)`: what is in place after this turn, for Settings (sudo-quiet.json beside the state, server/updates.mjs):
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.233-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.233-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.2-next.
|
|
14
|
+
"clavarium-binder": "0.1.65-next.1",
|
|
15
|
+
"clavarium-docket": "0.1.2-next.3",
|
|
16
16
|
"clavarium-parley": "0.17.95-next.1",
|
|
17
|
-
"clavarium-tether": "0.1.0-next.
|
|
17
|
+
"clavarium-tether": "0.1.0-next.77",
|
|
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.65-next.1",
|
|
765
|
+
"resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.65-next.1.tgz",
|
|
766
|
+
"integrity": "sha512-tUyR6SNNR12zgdSd6ODWo7sDK8gf+yr67WFNitDoXrFu5imlQcbE1HYYarUe6rq5WJXOYxXaoVrbpRAksU4Mwg==",
|
|
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.2-next.
|
|
778
|
-
"resolved": "https://registry.npmjs.org/clavarium-docket/-/clavarium-docket-0.1.2-next.
|
|
779
|
-
"integrity": "sha512-
|
|
777
|
+
"version": "0.1.2-next.3",
|
|
778
|
+
"resolved": "https://registry.npmjs.org/clavarium-docket/-/clavarium-docket-0.1.2-next.3.tgz",
|
|
779
|
+
"integrity": "sha512-UNm3mtqv2SMcEBkP6M+ki760+SjQYQHJwGvaEYoCajx68LUw41gAMXNaqVpawsgRfk0TRPk3nRnfol5mhilZXA==",
|
|
780
780
|
"license": "MIT",
|
|
781
781
|
"bin": {
|
|
782
782
|
"docket": "bin/docket.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.77",
|
|
804
|
+
"resolved": "https://registry.npmjs.org/clavarium-tether/-/clavarium-tether-0.1.0-next.77.tgz",
|
|
805
|
+
"integrity": "sha512-rJ1lkgRmtGtw/mGN72o1jC77ELuI75dS5V+0u+D9xCzSaYixePQloslakR1TXn4XSvjYTdMK3A02/dmksadQRQ==",
|
|
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.233-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.",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@xterm/addon-fit": "^0.11.0",
|
|
47
47
|
"@xterm/xterm": "^6.0.0",
|
|
48
|
-
"clavarium-binder": "0.1.
|
|
49
|
-
"clavarium-docket": "0.1.2-next.
|
|
48
|
+
"clavarium-binder": "0.1.65-next.1",
|
|
49
|
+
"clavarium-docket": "0.1.2-next.3",
|
|
50
50
|
"clavarium-parley": "0.17.95-next.1",
|
|
51
|
-
"clavarium-tether": "0.1.0-next.
|
|
51
|
+
"clavarium-tether": "0.1.0-next.77",
|
|
52
52
|
"mammoth": "1.13.0",
|
|
53
53
|
"mermaid": "11.17.2",
|
|
54
54
|
"node-pty": "^1.1.0",
|
package/server/profile.mjs
CHANGED
|
@@ -12,6 +12,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
12
12
|
export const PROFILE_MIN_S = 2;
|
|
13
13
|
export const PROFILE_MAX_S = 30;
|
|
14
14
|
export const PROFILE_TOP = 15;
|
|
15
|
+
export const SAMPLE_US = 10_000;
|
|
15
16
|
const APP = fileURLToPath(new URL('..', import.meta.url));
|
|
16
17
|
|
|
17
18
|
/* Where a function is, short: within the application from its folder, a package by its name, else the file's name. */
|
|
@@ -70,7 +71,8 @@ export class Profiler {
|
|
|
70
71
|
session.connect();
|
|
71
72
|
try {
|
|
72
73
|
await session.post('Profiler.enable');
|
|
73
|
-
|
|
74
|
+
/* 100 samples a second: light on a busy server (18-11: at 1000 a second, the owner's busy server stopped answering). */
|
|
75
|
+
await session.post('Profiler.setSamplingInterval', { interval: SAMPLE_US });
|
|
74
76
|
await session.post('Profiler.start');
|
|
75
77
|
const began = process.cpuUsage();
|
|
76
78
|
await this.#wait(s * 1000);
|
|
@@ -95,11 +97,14 @@ export const SLOW_P50_MS = 200;
|
|
|
95
97
|
export const AUTO_EVERY_MS = 30 * 60_000;
|
|
96
98
|
export const AUTO_KEPT = 5;
|
|
97
99
|
export const AUTO_SECONDS = 10;
|
|
100
|
+
/* Never in its first minutes (18-11: 0.2.232 measured itself during the updater's health watch on the owner's slow
|
|
101
|
+
server, and did not answer in time: put back). */
|
|
102
|
+
export const AUTO_AFTER_START_MS = 15 * 60_000;
|
|
98
103
|
export class AutoProfile {
|
|
99
|
-
#profiler; #file; #now; #delay; #log; #last = 0; #timer = null;
|
|
104
|
+
#profiler; #file; #now; #delay; #log; #last = 0; #timer = null; #started;
|
|
100
105
|
/* `delay()`: the loop's delay of the last minute, { p50, p99 } in ms, then started again (a histogram of its own). */
|
|
101
106
|
constructor({ profiler, file, now = () => Date.now(), delay, log = (line) => console.log(line) }) {
|
|
102
|
-
this.#profiler = profiler; this.#file = file; this.#now = now; this.#delay = delay; this.#log = log;
|
|
107
|
+
this.#profiler = profiler; this.#file = file; this.#now = now; this.#delay = delay; this.#log = log; this.#started = now();
|
|
103
108
|
const kept = this.kept(); this.#last = kept[0] ? Date.parse(kept[0].at) || 0 : 0;
|
|
104
109
|
}
|
|
105
110
|
kept() { const v = this.#file?.get(); return Array.isArray(v?.profiles) ? v.profiles : []; }
|
|
@@ -107,6 +112,7 @@ export class AutoProfile {
|
|
|
107
112
|
stop() { clearInterval(this.#timer); }
|
|
108
113
|
async check() {
|
|
109
114
|
const d = this.#delay();
|
|
115
|
+
if (this.#now() - this.#started < AUTO_AFTER_START_MS) return null;
|
|
110
116
|
if (!d || !(d.p50 > SLOW_P50_MS)) return null;
|
|
111
117
|
if (this.#now() - this.#last < AUTO_EVERY_MS) return null;
|
|
112
118
|
this.#last = this.#now();
|