@maiaos/node 0.1.0-canary.64 → 0.1.0-canary.65
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/LICENSE +21 -0
- package/README.md +17 -6
- package/dist/bin/maia-node-main.mjs +4561 -2224
- package/dist/bin/maia-node-main.mjs.map +3 -3
- package/dist/bin/maia-node.NOTICES.txt +150 -13
- package/dist/bin/maia-node.cdx.json +263 -107
- package/dist/bin/maia-node.meta.json +1 -1
- package/dist/bin/maia-node.mjs +67 -11
- package/dist/bin/maia-node.release.json +36 -40
- package/dist/bin/maia-process-host-linux-x64 +0 -0
- package/dist/bin/maia-process-host-linux-x64.build.json +6 -6
- package/dist/bin/maia-web.release.digest.json +1 -0
- package/dist/bin/panel/assets/index-BijqBI2o.js +30 -0
- package/dist/bin/panel/assets/index-JMSUmGQv.css +1 -0
- package/dist/bin/panel/index.html +14 -0
- package/package.json +8 -7
- package/dist/bin/maia-process-host-darwin-arm64 +0 -0
- package/dist/bin/maia-process-host-darwin-arm64.build.json +0 -59
package/dist/bin/maia-node.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Enables Node's compile cache in the state folder, then loads the bundle, so
|
|
3
3
|
// Node reuses the compiled bundle instead of parsing 4 MB of source again.
|
|
4
|
-
//
|
|
5
|
-
// cache off (one line on stderr).
|
|
6
|
-
|
|
4
|
+
// `compile_cache = false` under [node] in config.toml, or a folder not private
|
|
5
|
+
// to this user, turns the cache off (one line on stderr). The deprecated
|
|
6
|
+
// MAIA_NODE_COMPILE_CACHE=0 does the same while this build honors it. Keep all
|
|
7
|
+
// other logic out of this file.
|
|
8
|
+
import { lstatSync, mkdirSync, readFileSync, writeSync } from "node:fs";
|
|
7
9
|
import { constants, enableCompileCache } from "node:module";
|
|
8
10
|
import { homedir } from "node:os";
|
|
9
|
-
import { isAbsolute, join } from "node:path";
|
|
11
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
10
12
|
import process from "node:process";
|
|
11
13
|
import { URL } from "node:url";
|
|
12
14
|
|
|
@@ -16,6 +18,14 @@ const state =
|
|
|
16
18
|
? join(homedir(), "Library", "Application Support", "Maia")
|
|
17
19
|
: join(isAbsolute(xdg) ? xdg : join(homedir(), ".local", "state"), "maia");
|
|
18
20
|
const directory = join(state, "compile-cache");
|
|
21
|
+
/** @param {string} text */
|
|
22
|
+
const say = (text) => {
|
|
23
|
+
try {
|
|
24
|
+
writeSync(2, `${text}\n`);
|
|
25
|
+
} catch {
|
|
26
|
+
// A closed stderr must not stop the Node.
|
|
27
|
+
}
|
|
28
|
+
};
|
|
19
29
|
const problem = () => {
|
|
20
30
|
try {
|
|
21
31
|
mkdirSync(directory, { mode: 0o700, recursive: true });
|
|
@@ -30,15 +40,61 @@ const problem = () => {
|
|
|
30
40
|
return error instanceof Error ? error.message : String(error);
|
|
31
41
|
}
|
|
32
42
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
? undefined
|
|
36
|
-
: problem();
|
|
37
|
-
if (found !== undefined) {
|
|
43
|
+
/** @param {string | URL} path @returns {string} */
|
|
44
|
+
const read = (path) => {
|
|
38
45
|
try {
|
|
39
|
-
|
|
46
|
+
return readFileSync(path, "utf8");
|
|
40
47
|
} catch {
|
|
41
|
-
|
|
48
|
+
return "";
|
|
42
49
|
}
|
|
50
|
+
};
|
|
51
|
+
// The Node checks the whole file at start; here one line is enough.
|
|
52
|
+
const fileTurnsCacheOff = () => {
|
|
53
|
+
const home = resolve(process.env.MAIA_HOME ?? join(homedir(), ".maia"));
|
|
54
|
+
let table = "";
|
|
55
|
+
return read(join(home, "config.toml"))
|
|
56
|
+
.split(/\r?\n/u)
|
|
57
|
+
.some((raw) => {
|
|
58
|
+
const line = raw.trim();
|
|
59
|
+
table = /^\[([A-Za-z0-9_-]+)\]\s*(?:#.*)?$/u.exec(line)?.[1] ?? table;
|
|
60
|
+
return (
|
|
61
|
+
table === "node" && /^compile_cache\s*=\s*false\s*(?:#.*)?$/u.test(line)
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
// Keep equal to the last canary of COMPILE_CACHE_ALIAS, and the line to
|
|
66
|
+
// DEPRECATED_VARIABLES_CANARY_LINE, in @maiaos/agent; a test starts this
|
|
67
|
+
// launcher on both sides of it.
|
|
68
|
+
const LAST_CANARY = 65;
|
|
69
|
+
const aliasHonored = () => {
|
|
70
|
+
let version = "";
|
|
71
|
+
try {
|
|
72
|
+
const manifest = /** @type {{ application?: { version?: unknown } }} */ (
|
|
73
|
+
JSON.parse(read(new URL("maia-node.release.json", import.meta.url)))
|
|
74
|
+
);
|
|
75
|
+
version = String(manifest.application?.version);
|
|
76
|
+
} catch {
|
|
77
|
+
// No manifest means no known build, so the variable has no effect.
|
|
78
|
+
}
|
|
79
|
+
const canary = /^0\.1\.0-canary\.([1-9][0-9]*)$/u.exec(version)?.[1];
|
|
80
|
+
return (
|
|
81
|
+
version === "0.0.0" ||
|
|
82
|
+
(canary !== undefined && Number(canary) <= LAST_CANARY)
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
const variable = "MAIA_NODE_COMPILE_CACHE";
|
|
86
|
+
const alias =
|
|
87
|
+
process.env[variable] !== undefined && aliasHonored()
|
|
88
|
+
? process.env[variable]
|
|
89
|
+
: undefined;
|
|
90
|
+
if (alias !== undefined) {
|
|
91
|
+
say(
|
|
92
|
+
`${variable} is deprecated and a later canary ignores it. It still wins over node.compile_cache in config.toml for now; set node.compile_cache in config.toml and unset ${variable}.`,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
const off = alias === undefined ? fileTurnsCacheOff() : alias === "0";
|
|
96
|
+
const found = off || process.platform === "win32" ? undefined : problem();
|
|
97
|
+
if (found !== undefined) {
|
|
98
|
+
say(`maia-node: compile cache off: ${directory}: ${found}`);
|
|
43
99
|
}
|
|
44
100
|
await import(new URL("maia-node-main.mjs", import.meta.url).href);
|
|
@@ -2,74 +2,80 @@
|
|
|
2
2
|
"application": {
|
|
3
3
|
"name": "@maiaos/node",
|
|
4
4
|
"path": "services/node/dist/bin/maia-node.mjs",
|
|
5
|
-
"sha256": "
|
|
6
|
-
"version": "0.1.0-canary.
|
|
5
|
+
"sha256": "427ec9ccb6d46cec65e6f3c96e9fdcf2537173ef8c778d97827488b327082835",
|
|
6
|
+
"version": "0.1.0-canary.65"
|
|
7
7
|
},
|
|
8
8
|
"artifacts": [
|
|
9
9
|
{
|
|
10
|
-
"bytes":
|
|
10
|
+
"bytes": 5063766,
|
|
11
11
|
"path": "services/node/dist/bin/maia-node-main.mjs",
|
|
12
12
|
"role": "application-main",
|
|
13
|
-
"sha256": "
|
|
13
|
+
"sha256": "375aa08d189044f1c38cedaa9e49459cab06c189764b8752bafddc905b84d631"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
"bytes":
|
|
16
|
+
"bytes": 6467146,
|
|
17
17
|
"path": "services/node/dist/bin/maia-node-main.mjs.map",
|
|
18
18
|
"role": "source-map",
|
|
19
|
-
"sha256": "
|
|
19
|
+
"sha256": "0e7b9bf8e48d1e58d63c4dd150cb8e7afa42e37951cf366f4ff434446344ed5f"
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
"bytes":
|
|
22
|
+
"bytes": 61820,
|
|
23
23
|
"path": "services/node/dist/bin/maia-node.cdx.json",
|
|
24
24
|
"role": "sbom",
|
|
25
|
-
"sha256": "
|
|
25
|
+
"sha256": "c4b5e6bca654a8330df00180ca9cf3e443179b6821cf025a8f8c4bb45086bded"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
"bytes":
|
|
28
|
+
"bytes": 3111494,
|
|
29
29
|
"path": "services/node/dist/bin/maia-node.meta.json",
|
|
30
30
|
"role": "build-metafile",
|
|
31
|
-
"sha256": "
|
|
31
|
+
"sha256": "b427e9d6d9784cebc2dccdb05d2e9402b7bac2550ad6e92622095e8f521681b3"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
"bytes":
|
|
34
|
+
"bytes": 3799,
|
|
35
35
|
"path": "services/node/dist/bin/maia-node.mjs",
|
|
36
36
|
"role": "application",
|
|
37
|
-
"sha256": "
|
|
37
|
+
"sha256": "427ec9ccb6d46cec65e6f3c96e9fdcf2537173ef8c778d97827488b327082835"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
"bytes":
|
|
40
|
+
"bytes": 216675,
|
|
41
41
|
"path": "services/node/dist/bin/maia-node.NOTICES.txt",
|
|
42
42
|
"role": "notices",
|
|
43
|
-
"sha256": "
|
|
43
|
+
"sha256": "7f94b9cbe2bbd7d3ebcd8db3a1745958f285eab6352c4909c5834189c70ffe94"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
"bytes":
|
|
47
|
-
"path": "services/node/dist/bin/maia-process-host-
|
|
46
|
+
"bytes": 81960,
|
|
47
|
+
"path": "services/node/dist/bin/maia-process-host-linux-x64",
|
|
48
48
|
"role": "native-helper",
|
|
49
|
-
"sha256": "
|
|
49
|
+
"sha256": "222d4c8f7891cb43e3d387cf5f22a6ccfad94846daa4fb14c0f9af5912102e39"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
|
-
"bytes":
|
|
53
|
-
"path": "services/node/dist/bin/maia-process-host-
|
|
52
|
+
"bytes": 2135,
|
|
53
|
+
"path": "services/node/dist/bin/maia-process-host-linux-x64.build.json",
|
|
54
54
|
"role": "native-build-metadata",
|
|
55
|
-
"sha256": "
|
|
55
|
+
"sha256": "ee3f42e248e6dafe6525839ea9d162d0c7dcb90590af4118f1cdba3c2b69f82d"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
|
-
"bytes":
|
|
59
|
-
"path": "services/node/dist/bin/
|
|
60
|
-
"role": "
|
|
61
|
-
"sha256": "
|
|
58
|
+
"bytes": 832381,
|
|
59
|
+
"path": "services/node/dist/bin/panel/assets/index-BijqBI2o.js",
|
|
60
|
+
"role": "panel",
|
|
61
|
+
"sha256": "9ba8d52887375902901b53274bb652bd0a8da94abb6ed1d272409789b8780d29"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
"bytes":
|
|
65
|
-
"path": "services/node/dist/bin/
|
|
66
|
-
"role": "
|
|
67
|
-
"sha256": "
|
|
64
|
+
"bytes": 22844,
|
|
65
|
+
"path": "services/node/dist/bin/panel/assets/index-JMSUmGQv.css",
|
|
66
|
+
"role": "panel",
|
|
67
|
+
"sha256": "89b5899ec89c5452201407265a05b41ae3199e69eb240dbe06a55715b0b5d315"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"bytes": 433,
|
|
71
|
+
"path": "services/node/dist/bin/panel/index.html",
|
|
72
|
+
"role": "panel",
|
|
73
|
+
"sha256": "09bb469077ba9646a6e2788ec79f3367d57718fe8dc2e723f306734cfe928107"
|
|
68
74
|
}
|
|
69
75
|
],
|
|
70
76
|
"footprint": {
|
|
71
|
-
"artifactCount":
|
|
72
|
-
"boundArtifactBytes":
|
|
77
|
+
"artifactCount": 11,
|
|
78
|
+
"boundArtifactBytes": 15864453,
|
|
73
79
|
"combinedCeiling": "not_accepted",
|
|
74
80
|
"status": "measured_without_accepted_ceiling",
|
|
75
81
|
"unmeasured": [
|
|
@@ -84,15 +90,6 @@
|
|
|
84
90
|
},
|
|
85
91
|
"generator": "services/node/scripts/build-executable.mjs",
|
|
86
92
|
"nativeArtifacts": [
|
|
87
|
-
{
|
|
88
|
-
"artifactPath": "services/node/dist/bin/maia-process-host-darwin-arm64",
|
|
89
|
-
"buildMetadataPath": "services/node/dist/bin/maia-process-host-darwin-arm64.build.json",
|
|
90
|
-
"missingReleaseEvidence": [
|
|
91
|
-
"macos-hardened-runtime-helper-signature"
|
|
92
|
-
],
|
|
93
|
-
"releaseQualified": false,
|
|
94
|
-
"targetTriple": "darwin-arm64"
|
|
95
|
-
},
|
|
96
93
|
{
|
|
97
94
|
"artifactPath": "services/node/dist/bin/maia-process-host-linux-x64",
|
|
98
95
|
"buildMetadataPath": "services/node/dist/bin/maia-process-host-linux-x64.build.json",
|
|
@@ -106,7 +103,6 @@
|
|
|
106
103
|
"release": {
|
|
107
104
|
"missingEvidence": [
|
|
108
105
|
"linux-helper-release-signature",
|
|
109
|
-
"macos-hardened-runtime-helper-signature",
|
|
110
106
|
"npm-clean-install-boundary",
|
|
111
107
|
"npm-node-package-closure",
|
|
112
108
|
"npm-node-tarball-integrity",
|
|
Binary file
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"artifact": {
|
|
3
|
-
"bytes":
|
|
3
|
+
"bytes": 81960,
|
|
4
4
|
"path": "services/node/dist/bin/maia-process-host-linux-x64",
|
|
5
|
-
"sha256": "
|
|
5
|
+
"sha256": "222d4c8f7891cb43e3d387cf5f22a6ccfad94846daa4fb14c0f9af5912102e39"
|
|
6
6
|
},
|
|
7
7
|
"compiler": {
|
|
8
8
|
"flags": [
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
},
|
|
53
53
|
"source": {
|
|
54
54
|
"files": {
|
|
55
|
-
"services/node/native/process-host/common.c": "
|
|
55
|
+
"services/node/native/process-host/common.c": "dddaadda17f014335bdd3f71ccfbd007613a5b185b287b7663863abe29f2d5a2",
|
|
56
56
|
"services/node/native/process-host/sha256.c": "eaa187b451c5276f7df0c0e3e26dc05cae0eee659926550b85aad69b68ae7cd3",
|
|
57
|
-
"services/node/native/process-host/linux.c": "
|
|
58
|
-
"services/node/native/process-host/protocol.h": "
|
|
57
|
+
"services/node/native/process-host/linux.c": "ba52a850f133605497b88458075669351e252f2467a3b21c65ebfc5917b9c25f",
|
|
58
|
+
"services/node/native/process-host/protocol.h": "c1b97046c62b1b56e80e3d319c395282806d085b16322faa299f45ceb6c127a6",
|
|
59
59
|
"services/node/native/process-host/sha256.h": "b2a686bbe44f7a67b14b9550fd5166db560fbb23104654ae818a92a69b07f819"
|
|
60
60
|
},
|
|
61
|
-
"revision": "
|
|
61
|
+
"revision": "fbf283632899988e47ceefd642019a7de7348dd1"
|
|
62
62
|
},
|
|
63
63
|
"targetTriple": "linux-x64"
|
|
64
64
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"asset": "maia-web-0.1.0-canary.65.tgz", "bytes": 15122911, "sha256": "5113569952765328f1cbda883c80089ac28b1c608359ea1d6b9d20036e32c7d0", "version": "0.1.0-canary.65"}
|