@mostra/runtime 0.5.0 → 0.6.0
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/README.md +3 -2
- package/dist/bin.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{instance-CYvNd7mP.js → instance-Da8UG_Qd.js} +15 -16
- package/dist/{instance-CYvNd7mP.js.map → instance-Da8UG_Qd.js.map} +1 -1
- package/package.json +5 -5
- package/src/home/platform.ts +7 -15
- package/src/service/unit.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mostra/runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "The Mostra runtime: the supervisor that owns a home, its ledger, its child processes and the host protocol server (mostra-runtime host|daemon).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "The Mostra Authors",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@hono/node-server": "2.1.3",
|
|
38
38
|
"@mdx-js/mdx": "3.1.1",
|
|
39
|
-
"@mostra/protocol": "0.
|
|
39
|
+
"@mostra/protocol": "0.6.0",
|
|
40
40
|
"@tailwindcss/vite": "4.3.3",
|
|
41
41
|
"@vitejs/plugin-react": "6.1.1",
|
|
42
42
|
"better-sqlite3": "13.0.3",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"zod": "4.6.6"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@mostra/shell": "0.
|
|
57
|
+
"@mostra/shell": "0.6.0",
|
|
58
58
|
"@mostra/tools": "0.0.0",
|
|
59
|
-
"@mostra/verify": "0.
|
|
59
|
+
"@mostra/verify": "0.6.0",
|
|
60
60
|
"@mostra/warm": "0.0.0",
|
|
61
|
-
"@mostra/worker": "0.
|
|
61
|
+
"@mostra/worker": "0.6.0",
|
|
62
62
|
"@types/better-sqlite3": "9.6.0",
|
|
63
63
|
"@types/node": "24.19.1",
|
|
64
64
|
"@types/semver": "7.8.0",
|
package/src/home/platform.ts
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The unsupported-platform gate (D35, D146, RT-07). Every entry point calls it before it touches
|
|
3
|
-
* the home: Mostra runs on macOS and
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* WP-W3 removes the switch.
|
|
3
|
+
* the home: Mostra runs on macOS, Linux and Windows, on x64 and arm64, and fails closed elsewhere.
|
|
4
|
+
* Windows was built behind a development switch by WP-W1 to WP-W3, and is supported since WP-W3
|
|
5
|
+
* like the others.
|
|
7
6
|
*/
|
|
8
7
|
import { createDiagnostic, type Diagnostic } from "@mostra/protocol";
|
|
9
8
|
import { OS } from "../platform/index.ts";
|
|
10
9
|
|
|
11
|
-
const OPERATING_SYSTEMS: readonly string[] = ["darwin", "linux"];
|
|
10
|
+
const OPERATING_SYSTEMS: readonly string[] = ["darwin", "linux", "win32"];
|
|
12
11
|
const ARCHITECTURES: readonly string[] = ["x64", "arm64"];
|
|
13
12
|
|
|
14
|
-
/** The development switch that admits Windows until WP-W3 (D146). */
|
|
15
|
-
export const WINDOWS_DEV_SWITCH = "MOSTRA_DEV_WINDOWS";
|
|
16
|
-
|
|
17
13
|
/** The platform as `<os>-<arch>`, as `InstanceInfo.platform` reports it. */
|
|
18
14
|
export function platformName(platform: string = OS, arch: string = process.arch): string {
|
|
19
15
|
return `${platform}-${arch}`;
|
|
@@ -21,22 +17,18 @@ export function platformName(platform: string = OS, arch: string = process.arch)
|
|
|
21
17
|
|
|
22
18
|
/**
|
|
23
19
|
* Returns `MOSTRA_PLATFORM_UNSUPPORTED` for a platform Mostra doesn't run on, or `undefined` for
|
|
24
|
-
* a supported one.
|
|
20
|
+
* a supported one.
|
|
25
21
|
*/
|
|
26
22
|
export function checkPlatform(
|
|
27
23
|
platform: string = OS,
|
|
28
24
|
arch: string = process.arch,
|
|
29
|
-
env: Readonly<Record<string, string | undefined>> = process.env,
|
|
30
25
|
): Diagnostic | undefined {
|
|
31
|
-
if (ARCHITECTURES.includes(arch))
|
|
32
|
-
if (OPERATING_SYSTEMS.includes(platform)) return undefined;
|
|
33
|
-
if (platform === "win32" && env[WINDOWS_DEV_SWITCH] === "1") return undefined;
|
|
34
|
-
}
|
|
26
|
+
if (ARCHITECTURES.includes(arch) && OPERATING_SYSTEMS.includes(platform)) return undefined;
|
|
35
27
|
const name =
|
|
36
28
|
platform === "win32"
|
|
37
29
|
? `Windows (${platformName(platform, arch)})`
|
|
38
30
|
: platformName(platform, arch);
|
|
39
31
|
return createDiagnostic("MOSTRA_PLATFORM_UNSUPPORTED", {
|
|
40
|
-
message: `Mostra doesn't run on ${name}; it supports macOS and
|
|
32
|
+
message: `Mostra doesn't run on ${name}; it supports macOS, Linux and Windows on x64 and arm64.`,
|
|
41
33
|
});
|
|
42
34
|
}
|
package/src/service/unit.ts
CHANGED
|
@@ -121,11 +121,11 @@ export function serviceFor(spec: ServiceSpec): ServiceStatus {
|
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
123
|
* What a Windows task passes on besides the user's logon environment, which Task Scheduler gives
|
|
124
|
-
* it: the
|
|
125
|
-
*
|
|
124
|
+
* it: the helper a checkout names, and the locale and time zone, as the POSIX units carry theirs.
|
|
125
|
+
* Nothing secret.
|
|
126
126
|
*/
|
|
127
127
|
function windowsServiceVariables(env: Environment): [string, string][] {
|
|
128
|
-
return ["
|
|
128
|
+
return ["MOSTRA_WIN_HELPER", "LANG", "TZ"].flatMap((name) => {
|
|
129
129
|
const value = env[name];
|
|
130
130
|
return value ? [[name, value] as [string, string]] : [];
|
|
131
131
|
});
|