evil-omo 3.16.1 → 3.17.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.
Files changed (55) hide show
  1. package/LICENSE.md +82 -82
  2. package/README.ja.md +353 -353
  3. package/README.ko.md +347 -347
  4. package/README.md +51 -51
  5. package/README.ru.md +374 -374
  6. package/README.zh-cn.md +352 -352
  7. package/bin/evil-omo.js +201 -201
  8. package/bin/platform.d.ts +14 -14
  9. package/bin/platform.js +82 -82
  10. package/bin/platform.test.ts +218 -218
  11. package/dist/agents/gpt-apply-patch-guard.d.ts +2 -0
  12. package/dist/agents/hephaestus/gpt-5-3-codex.d.ts +0 -1
  13. package/dist/cli/doctor/checks/system.d.ts +15 -2
  14. package/dist/cli/index.js +6726 -931
  15. package/dist/features/skill-mcp-manager/connection.d.ts +3 -4
  16. package/dist/features/skill-mcp-manager/http-client.d.ts +17 -3
  17. package/dist/features/skill-mcp-manager/manager.d.ts +2 -3
  18. package/dist/features/skill-mcp-manager/stdio-client.d.ts +16 -3
  19. package/dist/features/skill-mcp-manager/types.d.ts +16 -6
  20. package/dist/features/tmux-subagent/manager.d.ts +1 -0
  21. package/dist/hooks/atlas/session-last-agent.d.ts +10 -1
  22. package/dist/hooks/auto-update-checker/constants.d.ts +17 -2
  23. package/dist/hooks/auto-update-checker/hook.d.ts +22 -1
  24. package/dist/hooks/comment-checker/cli-runner.d.ts +4 -1
  25. package/dist/hooks/keyword-detector/hook.d.ts +1 -1
  26. package/dist/hooks/read-image-resizer/image-resizer.d.ts +3 -1
  27. package/dist/hooks/rules-injector/injector.d.ts +12 -0
  28. package/dist/index.js +14228 -7462
  29. package/dist/openclaw/dispatcher.d.ts +3 -12
  30. package/dist/openclaw/reply-listener-discord.d.ts +4 -0
  31. package/dist/openclaw/reply-listener-injection.d.ts +10 -0
  32. package/dist/openclaw/reply-listener-log.d.ts +2 -0
  33. package/dist/openclaw/reply-listener-paths.d.ts +7 -0
  34. package/dist/openclaw/reply-listener-process.d.ts +4 -0
  35. package/dist/openclaw/reply-listener-spawn.d.ts +5 -0
  36. package/dist/openclaw/reply-listener-startup.d.ts +12 -0
  37. package/dist/openclaw/reply-listener-state.d.ts +29 -0
  38. package/dist/openclaw/reply-listener-telegram.d.ts +4 -0
  39. package/dist/openclaw/reply-listener.d.ts +5 -18
  40. package/dist/openclaw/runtime-dispatch.d.ts +17 -0
  41. package/dist/openclaw/types.d.ts +4 -0
  42. package/dist/plugin/command-execute-before.d.ts +3 -1
  43. package/dist/plugin/tool-registry.d.ts +23 -0
  44. package/dist/plugin-handlers/agent-priority-order.d.ts +11 -0
  45. package/dist/shared/agent-display-names.d.ts +5 -0
  46. package/dist/shared/compaction-marker.d.ts +1 -0
  47. package/dist/shared/migration/migrations-sidecar.d.ts +41 -0
  48. package/dist/shared/plugin-identity.d.ts +4 -2
  49. package/dist/shared/posthog-activity-state.d.ts +8 -0
  50. package/dist/shared/posthog.d.ts +14 -0
  51. package/dist/shared/shell-env.d.ts +6 -2
  52. package/dist/testing/module-mock-lifecycle.d.ts +21 -0
  53. package/dist/tools/session-manager/tools.d.ts +19 -1
  54. package/package.json +13 -12
  55. package/postinstall.mjs +133 -133
package/bin/evil-omo.js CHANGED
@@ -1,202 +1,202 @@
1
- #!/usr/bin/env node
2
- // bin/evil-omo.js
3
- // Wrapper script that detects platform and spawns the correct binary
4
-
5
- import { spawnSync } from "node:child_process";
6
- import { resolve } from "node:path";
7
- import { existsSync, readFileSync } from "node:fs";
8
- import { createRequire } from "node:module";
9
- import { fileURLToPath } from "node:url";
10
- import { getPlatformPackageCandidates, getBinaryPath } from "./platform.js";
11
-
12
- const require = createRequire(import.meta.url);
13
- const PLUGIN_NAME = "evil-omo";
14
- const FORCE_BASELINE_ENV = "EVIL_OMO_FORCE_BASELINE";
15
- const LEGACY_FORCE_BASELINE_ENV = "OH_MY_OPENCODE_FORCE_BASELINE";
16
- const BUNDLED_CLI_ENTRYPOINT = fileURLToPath(new URL("../dist/cli/index.js", import.meta.url));
17
-
18
- /**
19
- * Detect libc family on Linux
20
- * @returns {string | null} 'glibc', 'musl', or null if detection fails
21
- */
22
- function getLibcFamily() {
23
- if (process.platform !== "linux") {
24
- return undefined; // Not needed on non-Linux
25
- }
26
-
27
- try {
28
- const detectLibc = require("detect-libc");
29
- return detectLibc.familySync();
30
- } catch {
31
- // detect-libc not available
32
- return null;
33
- }
34
- }
35
-
36
- function supportsAvx2() {
37
- if (process.arch !== "x64") {
38
- return null;
39
- }
40
-
41
- if (process.env[FORCE_BASELINE_ENV] === "1" || process.env[LEGACY_FORCE_BASELINE_ENV] === "1") {
42
- return false;
43
- }
44
-
45
- if (process.platform === "linux") {
46
- try {
47
- const cpuInfo = readFileSync("/proc/cpuinfo", "utf8").toLowerCase();
48
- return cpuInfo.includes("avx2");
49
- } catch {
50
- return null;
51
- }
52
- }
53
-
54
- if (process.platform === "darwin") {
55
- const probe = spawnSync("sysctl", ["-n", "machdep.cpu.leaf7_features"], {
56
- encoding: "utf8",
57
- });
58
-
59
- if (probe.error || probe.status !== 0) {
60
- return null;
61
- }
62
-
63
- return probe.stdout.toUpperCase().includes("AVX2");
64
- }
65
-
66
- return null;
67
- }
68
-
69
- function getSignalExitCode(signal) {
70
- const signalCodeByName = {
71
- SIGINT: 2,
72
- SIGILL: 4,
73
- SIGKILL: 9,
74
- SIGTERM: 15,
75
- };
76
-
77
- return 128 + (signalCodeByName[signal] ?? 1);
78
- }
79
-
80
- export function shouldUseBundledCli(versions = process.versions) {
81
- return Boolean(versions?.bun);
82
- }
83
-
84
- export function getBundledCliEntrypoint() {
85
- return BUNDLED_CLI_ENTRYPOINT;
86
- }
87
-
88
- export function resolveBundledCliRuntime(
89
- versions = process.versions,
90
- execPath = process.execPath,
91
- spawnImpl = spawnSync,
92
- ) {
93
- if (shouldUseBundledCli(versions)) {
94
- return execPath;
95
- }
96
-
97
- const probe = spawnImpl("bun", ["--version"], {
98
- encoding: "utf8",
99
- stdio: "pipe",
100
- });
101
-
102
- if (probe.error || probe.status !== 0) {
103
- return null;
104
- }
105
-
106
- return "bun";
107
- }
108
-
109
- export function runBundledCli(args, spawnImpl = spawnSync, runtime = process.execPath) {
110
- return spawnImpl(runtime, [getBundledCliEntrypoint(), ...args], {
111
- stdio: "inherit",
112
- });
113
- }
114
-
115
- function isDirectExecution() {
116
- return Boolean(process.argv[1]) && resolve(process.argv[1]) === fileURLToPath(import.meta.url);
117
- }
118
-
119
- function main() {
120
- const bundledCliRuntime = resolveBundledCliRuntime();
121
- if (bundledCliRuntime && existsSync(getBundledCliEntrypoint())) {
122
- const result = runBundledCli(process.argv.slice(2), spawnSync, bundledCliRuntime);
123
-
124
- if (!result.error) {
125
- if (result.signal) {
126
- process.exit(getSignalExitCode(result.signal));
127
- }
128
-
129
- process.exit(result.status ?? 1);
130
- }
131
- }
132
-
133
- const { platform, arch } = process;
134
- const libcFamily = getLibcFamily();
135
- const avx2Supported = supportsAvx2();
136
-
137
- let packageCandidates;
138
- try {
139
- packageCandidates = getPlatformPackageCandidates({
140
- platform,
141
- arch,
142
- libcFamily,
143
- preferBaseline: avx2Supported === false,
144
- });
145
- } catch (error) {
146
- console.error(`\n${PLUGIN_NAME}: ${error.message}\n`);
147
- process.exit(1);
148
- }
149
-
150
- const resolvedBinaries = packageCandidates
151
- .map((pkg) => {
152
- try {
153
- return { pkg, binPath: require.resolve(getBinaryPath(pkg, platform)) };
154
- } catch {
155
- return null;
156
- }
157
- })
158
- .filter((entry) => entry !== null);
159
-
160
- if (resolvedBinaries.length === 0) {
161
- console.error(`\n${PLUGIN_NAME}: Platform binary not installed.`);
162
- console.error(`\nYour platform: ${platform}-${arch}${libcFamily === "musl" ? "-musl" : ""}`);
163
- console.error(`Expected packages (in order): ${packageCandidates.join(", ")}`);
164
- console.error(`\nTo fix, run:`);
165
- console.error(` npm install ${packageCandidates[0]}\n`);
166
- process.exit(1);
167
- }
168
-
169
- for (let index = 0; index < resolvedBinaries.length; index += 1) {
170
- const currentBinary = resolvedBinaries[index];
171
- const hasFallback = index < resolvedBinaries.length - 1;
172
- const result = spawnSync(currentBinary.binPath, process.argv.slice(2), {
173
- stdio: "inherit",
174
- });
175
-
176
- if (result.error) {
177
- if (hasFallback) {
178
- continue;
179
- }
180
-
181
- console.error(`\n${PLUGIN_NAME}: Failed to execute binary.`);
182
- console.error(`Error: ${result.error.message}\n`);
183
- process.exit(2);
184
- }
185
-
186
- if (result.signal === "SIGILL" && hasFallback) {
187
- continue;
188
- }
189
-
190
- if (result.signal) {
191
- process.exit(getSignalExitCode(result.signal));
192
- }
193
-
194
- process.exit(result.status ?? 1);
195
- }
196
-
197
- process.exit(1);
198
- }
199
-
200
- if (isDirectExecution()) {
201
- main();
1
+ #!/usr/bin/env node
2
+ // bin/evil-omo.js
3
+ // Wrapper script that detects platform and spawns the correct binary
4
+
5
+ import { spawnSync } from "node:child_process";
6
+ import { resolve } from "node:path";
7
+ import { existsSync, readFileSync } from "node:fs";
8
+ import { createRequire } from "node:module";
9
+ import { fileURLToPath } from "node:url";
10
+ import { getPlatformPackageCandidates, getBinaryPath } from "./platform.js";
11
+
12
+ const require = createRequire(import.meta.url);
13
+ const PLUGIN_NAME = "evil-omo";
14
+ const FORCE_BASELINE_ENV = "EVIL_OMO_FORCE_BASELINE";
15
+ const LEGACY_FORCE_BASELINE_ENV = "OH_MY_OPENCODE_FORCE_BASELINE";
16
+ const BUNDLED_CLI_ENTRYPOINT = fileURLToPath(new URL("../dist/cli/index.js", import.meta.url));
17
+
18
+ /**
19
+ * Detect libc family on Linux
20
+ * @returns {string | null} 'glibc', 'musl', or null if detection fails
21
+ */
22
+ function getLibcFamily() {
23
+ if (process.platform !== "linux") {
24
+ return undefined; // Not needed on non-Linux
25
+ }
26
+
27
+ try {
28
+ const detectLibc = require("detect-libc");
29
+ return detectLibc.familySync();
30
+ } catch {
31
+ // detect-libc not available
32
+ return null;
33
+ }
34
+ }
35
+
36
+ function supportsAvx2() {
37
+ if (process.arch !== "x64") {
38
+ return null;
39
+ }
40
+
41
+ if (process.env[FORCE_BASELINE_ENV] === "1" || process.env[LEGACY_FORCE_BASELINE_ENV] === "1") {
42
+ return false;
43
+ }
44
+
45
+ if (process.platform === "linux") {
46
+ try {
47
+ const cpuInfo = readFileSync("/proc/cpuinfo", "utf8").toLowerCase();
48
+ return cpuInfo.includes("avx2");
49
+ } catch {
50
+ return null;
51
+ }
52
+ }
53
+
54
+ if (process.platform === "darwin") {
55
+ const probe = spawnSync("sysctl", ["-n", "machdep.cpu.leaf7_features"], {
56
+ encoding: "utf8",
57
+ });
58
+
59
+ if (probe.error || probe.status !== 0) {
60
+ return null;
61
+ }
62
+
63
+ return probe.stdout.toUpperCase().includes("AVX2");
64
+ }
65
+
66
+ return null;
67
+ }
68
+
69
+ function getSignalExitCode(signal) {
70
+ const signalCodeByName = {
71
+ SIGINT: 2,
72
+ SIGILL: 4,
73
+ SIGKILL: 9,
74
+ SIGTERM: 15,
75
+ };
76
+
77
+ return 128 + (signalCodeByName[signal] ?? 1);
78
+ }
79
+
80
+ export function shouldUseBundledCli(versions = process.versions) {
81
+ return Boolean(versions?.bun);
82
+ }
83
+
84
+ export function getBundledCliEntrypoint() {
85
+ return BUNDLED_CLI_ENTRYPOINT;
86
+ }
87
+
88
+ export function resolveBundledCliRuntime(
89
+ versions = process.versions,
90
+ execPath = process.execPath,
91
+ spawnImpl = spawnSync,
92
+ ) {
93
+ if (shouldUseBundledCli(versions)) {
94
+ return execPath;
95
+ }
96
+
97
+ const probe = spawnImpl("bun", ["--version"], {
98
+ encoding: "utf8",
99
+ stdio: "pipe",
100
+ });
101
+
102
+ if (probe.error || probe.status !== 0) {
103
+ return null;
104
+ }
105
+
106
+ return "bun";
107
+ }
108
+
109
+ export function runBundledCli(args, spawnImpl = spawnSync, runtime = process.execPath) {
110
+ return spawnImpl(runtime, [getBundledCliEntrypoint(), ...args], {
111
+ stdio: "inherit",
112
+ });
113
+ }
114
+
115
+ function isDirectExecution() {
116
+ return Boolean(process.argv[1]) && resolve(process.argv[1]) === fileURLToPath(import.meta.url);
117
+ }
118
+
119
+ function main() {
120
+ const bundledCliRuntime = resolveBundledCliRuntime();
121
+ if (bundledCliRuntime && existsSync(getBundledCliEntrypoint())) {
122
+ const result = runBundledCli(process.argv.slice(2), spawnSync, bundledCliRuntime);
123
+
124
+ if (!result.error) {
125
+ if (result.signal) {
126
+ process.exit(getSignalExitCode(result.signal));
127
+ }
128
+
129
+ process.exit(result.status ?? 1);
130
+ }
131
+ }
132
+
133
+ const { platform, arch } = process;
134
+ const libcFamily = getLibcFamily();
135
+ const avx2Supported = supportsAvx2();
136
+
137
+ let packageCandidates;
138
+ try {
139
+ packageCandidates = getPlatformPackageCandidates({
140
+ platform,
141
+ arch,
142
+ libcFamily,
143
+ preferBaseline: avx2Supported === false,
144
+ });
145
+ } catch (error) {
146
+ console.error(`\n${PLUGIN_NAME}: ${error.message}\n`);
147
+ process.exit(1);
148
+ }
149
+
150
+ const resolvedBinaries = packageCandidates
151
+ .map((pkg) => {
152
+ try {
153
+ return { pkg, binPath: require.resolve(getBinaryPath(pkg, platform)) };
154
+ } catch {
155
+ return null;
156
+ }
157
+ })
158
+ .filter((entry) => entry !== null);
159
+
160
+ if (resolvedBinaries.length === 0) {
161
+ console.error(`\n${PLUGIN_NAME}: Platform binary not installed.`);
162
+ console.error(`\nYour platform: ${platform}-${arch}${libcFamily === "musl" ? "-musl" : ""}`);
163
+ console.error(`Expected packages (in order): ${packageCandidates.join(", ")}`);
164
+ console.error(`\nTo fix, run:`);
165
+ console.error(` npm install ${packageCandidates[0]}\n`);
166
+ process.exit(1);
167
+ }
168
+
169
+ for (let index = 0; index < resolvedBinaries.length; index += 1) {
170
+ const currentBinary = resolvedBinaries[index];
171
+ const hasFallback = index < resolvedBinaries.length - 1;
172
+ const result = spawnSync(currentBinary.binPath, process.argv.slice(2), {
173
+ stdio: "inherit",
174
+ });
175
+
176
+ if (result.error) {
177
+ if (hasFallback) {
178
+ continue;
179
+ }
180
+
181
+ console.error(`\n${PLUGIN_NAME}: Failed to execute binary.`);
182
+ console.error(`Error: ${result.error.message}\n`);
183
+ process.exit(2);
184
+ }
185
+
186
+ if (result.signal === "SIGILL" && hasFallback) {
187
+ continue;
188
+ }
189
+
190
+ if (result.signal) {
191
+ process.exit(getSignalExitCode(result.signal));
192
+ }
193
+
194
+ process.exit(result.status ?? 1);
195
+ }
196
+
197
+ process.exit(1);
198
+ }
199
+
200
+ if (isDirectExecution()) {
201
+ main();
202
202
  }
package/bin/platform.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- export declare function getPlatformPackage(options: {
2
- platform: string;
3
- arch: string;
4
- libcFamily?: string | null;
5
- }): string;
6
-
7
- export declare function getPlatformPackageCandidates(options: {
8
- platform: string;
9
- arch: string;
10
- libcFamily?: string | null;
11
- preferBaseline?: boolean;
12
- }): string[];
13
-
14
- export declare function getBinaryPath(pkg: string, platform: string): string;
1
+ export declare function getPlatformPackage(options: {
2
+ platform: string;
3
+ arch: string;
4
+ libcFamily?: string | null;
5
+ }): string;
6
+
7
+ export declare function getPlatformPackageCandidates(options: {
8
+ platform: string;
9
+ arch: string;
10
+ libcFamily?: string | null;
11
+ preferBaseline?: boolean;
12
+ }): string[];
13
+
14
+ export declare function getBinaryPath(pkg: string, platform: string): string;
package/bin/platform.js CHANGED
@@ -1,82 +1,82 @@
1
- // bin/platform.js
2
- // Shared platform detection module - used by wrapper and postinstall
3
-
4
- /**
5
- * Get the platform-specific package name
6
- * @param {{ platform: string, arch: string, libcFamily?: string | null, packageBaseName?: string }} options
7
- * @returns {string} Package name like "evil-omo-darwin-arm64"
8
- * @throws {Error} If libc cannot be detected on Linux
9
- */
10
- export function getPlatformPackage({ platform, arch, libcFamily, packageBaseName = "evil-omo" }) {
11
- let suffix = "";
12
- if (platform === "linux") {
13
- if (libcFamily === null || libcFamily === undefined) {
14
- throw new Error(
15
- "Could not detect libc on Linux. " +
16
- "Please ensure detect-libc is installed or report this issue."
17
- );
18
- }
19
- if (libcFamily === "musl") {
20
- suffix = "-musl";
21
- }
22
- }
23
-
24
- // Map platform names: win32 -> windows (for package name)
25
- const os = platform === "win32" ? "windows" : platform;
26
- return `${packageBaseName}-${os}-${arch}${suffix}`;
27
- }
28
-
29
- /** @param {{ platform: string, arch: string, libcFamily?: string | null, preferBaseline?: boolean, packageBaseName?: string }} options */
30
- export function getPlatformPackageCandidates({ platform, arch, libcFamily, preferBaseline = false, packageBaseName = "evil-omo" }) {
31
- const primaryPackage = getPlatformPackage({ platform, arch, libcFamily, packageBaseName });
32
- const baselinePackage = getBaselinePlatformPackage({ platform, arch, libcFamily, packageBaseName });
33
-
34
- if (!baselinePackage) {
35
- return [primaryPackage];
36
- }
37
-
38
- return preferBaseline ? [baselinePackage, primaryPackage] : [primaryPackage, baselinePackage];
39
- }
40
-
41
- /** @param {{ platform: string, arch: string, libcFamily?: string | null, packageBaseName?: string }} options */
42
- function getBaselinePlatformPackage({ platform, arch, libcFamily, packageBaseName = "evil-omo" }) {
43
- if (arch !== "x64") {
44
- return null;
45
- }
46
-
47
- if (platform === "darwin") {
48
- return `${packageBaseName}-darwin-x64-baseline`;
49
- }
50
-
51
- if (platform === "win32") {
52
- return `${packageBaseName}-windows-x64-baseline`;
53
- }
54
-
55
- if (platform === "linux") {
56
- if (libcFamily === null || libcFamily === undefined) {
57
- throw new Error(
58
- "Could not detect libc on Linux. " +
59
- "Please ensure detect-libc is installed or report this issue."
60
- );
61
- }
62
-
63
- if (libcFamily === "musl") {
64
- return `${packageBaseName}-linux-x64-musl-baseline`;
65
- }
66
-
67
- return `${packageBaseName}-linux-x64-baseline`;
68
- }
69
-
70
- return null;
71
- }
72
-
73
- /**
74
- * Get the path to the binary within a platform package
75
- * @param {string} pkg Package name
76
- * @param {string} platform Process platform
77
- * @returns {string} Relative path like "evil-omo-darwin-arm64/bin/evil-omo"
78
- */
79
- export function getBinaryPath(pkg, platform) {
80
- const ext = platform === "win32" ? ".exe" : "";
81
- return `${pkg}/bin/evil-omo${ext}`;
82
- }
1
+ // bin/platform.js
2
+ // Shared platform detection module - used by wrapper and postinstall
3
+
4
+ /**
5
+ * Get the platform-specific package name
6
+ * @param {{ platform: string, arch: string, libcFamily?: string | null, packageBaseName?: string }} options
7
+ * @returns {string} Package name like "evil-omo-darwin-arm64"
8
+ * @throws {Error} If libc cannot be detected on Linux
9
+ */
10
+ export function getPlatformPackage({ platform, arch, libcFamily, packageBaseName = "evil-omo" }) {
11
+ let suffix = "";
12
+ if (platform === "linux") {
13
+ if (libcFamily === null || libcFamily === undefined) {
14
+ throw new Error(
15
+ "Could not detect libc on Linux. " +
16
+ "Please ensure detect-libc is installed or report this issue."
17
+ );
18
+ }
19
+ if (libcFamily === "musl") {
20
+ suffix = "-musl";
21
+ }
22
+ }
23
+
24
+ // Map platform names: win32 -> windows (for package name)
25
+ const os = platform === "win32" ? "windows" : platform;
26
+ return `${packageBaseName}-${os}-${arch}${suffix}`;
27
+ }
28
+
29
+ /** @param {{ platform: string, arch: string, libcFamily?: string | null, preferBaseline?: boolean, packageBaseName?: string }} options */
30
+ export function getPlatformPackageCandidates({ platform, arch, libcFamily, preferBaseline = false, packageBaseName = "evil-omo" }) {
31
+ const primaryPackage = getPlatformPackage({ platform, arch, libcFamily, packageBaseName });
32
+ const baselinePackage = getBaselinePlatformPackage({ platform, arch, libcFamily, packageBaseName });
33
+
34
+ if (!baselinePackage) {
35
+ return [primaryPackage];
36
+ }
37
+
38
+ return preferBaseline ? [baselinePackage, primaryPackage] : [primaryPackage, baselinePackage];
39
+ }
40
+
41
+ /** @param {{ platform: string, arch: string, libcFamily?: string | null, packageBaseName?: string }} options */
42
+ function getBaselinePlatformPackage({ platform, arch, libcFamily, packageBaseName = "evil-omo" }) {
43
+ if (arch !== "x64") {
44
+ return null;
45
+ }
46
+
47
+ if (platform === "darwin") {
48
+ return `${packageBaseName}-darwin-x64-baseline`;
49
+ }
50
+
51
+ if (platform === "win32") {
52
+ return `${packageBaseName}-windows-x64-baseline`;
53
+ }
54
+
55
+ if (platform === "linux") {
56
+ if (libcFamily === null || libcFamily === undefined) {
57
+ throw new Error(
58
+ "Could not detect libc on Linux. " +
59
+ "Please ensure detect-libc is installed or report this issue."
60
+ );
61
+ }
62
+
63
+ if (libcFamily === "musl") {
64
+ return `${packageBaseName}-linux-x64-musl-baseline`;
65
+ }
66
+
67
+ return `${packageBaseName}-linux-x64-baseline`;
68
+ }
69
+
70
+ return null;
71
+ }
72
+
73
+ /**
74
+ * Get the path to the binary within a platform package
75
+ * @param {string} pkg Package name
76
+ * @param {string} platform Process platform
77
+ * @returns {string} Relative path like "evil-omo-darwin-arm64/bin/evil-omo"
78
+ */
79
+ export function getBinaryPath(pkg, platform) {
80
+ const ext = platform === "win32" ? ".exe" : "";
81
+ return `${pkg}/bin/evil-omo${ext}`;
82
+ }