evil-omo 3.11.3 → 3.11.4
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/bin/{oh-my-opencode.js → evil-omo.js} +8 -5
- package/bin/platform.js +11 -8
- package/bin/platform.test.ts +20 -20
- package/dist/cli/config-manager/config-context.d.ts +1 -0
- package/dist/cli/doctor/constants.d.ts +1 -1
- package/dist/cli/index.js +364 -303
- package/dist/config/schema.d.ts +1 -1
- package/dist/{oh-my-opencode.schema.json → evil-omo.schema.json} +2 -2
- package/dist/features/claude-code-plugin-loader/types.d.ts +1 -1
- package/dist/hooks/auto-update-checker/constants.d.ts +2 -2
- package/dist/hooks/comment-checker/downloader.d.ts +1 -1
- package/dist/index.js +15317 -15225
- package/dist/shared/data-path.d.ts +2 -2
- package/dist/shared/external-plugin-detector.d.ts +1 -1
- package/dist/shared/plugin-identity.d.ts +19 -4
- package/dist/shared/system-directive.d.ts +5 -5
- package/package.json +14 -14
- package/postinstall.mjs +3 -2
- /package/dist/config/schema/{oh-my-opencode-config.d.ts → evil-omo-config.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// bin/
|
|
2
|
+
// bin/evil-omo.js
|
|
3
3
|
// Wrapper script that detects platform and spawns the correct binary
|
|
4
4
|
|
|
5
5
|
import { spawnSync } from "node:child_process";
|
|
@@ -8,6 +8,9 @@ import { createRequire } from "node:module";
|
|
|
8
8
|
import { getPlatformPackageCandidates, getBinaryPath } from "./platform.js";
|
|
9
9
|
|
|
10
10
|
const require = createRequire(import.meta.url);
|
|
11
|
+
const PLUGIN_NAME = "evil-omo";
|
|
12
|
+
const FORCE_BASELINE_ENV = "EVIL_OMO_FORCE_BASELINE";
|
|
13
|
+
const LEGACY_FORCE_BASELINE_ENV = "OH_MY_OPENCODE_FORCE_BASELINE";
|
|
11
14
|
|
|
12
15
|
/**
|
|
13
16
|
* Detect libc family on Linux
|
|
@@ -32,7 +35,7 @@ function supportsAvx2() {
|
|
|
32
35
|
return null;
|
|
33
36
|
}
|
|
34
37
|
|
|
35
|
-
if (process.env.
|
|
38
|
+
if (process.env[FORCE_BASELINE_ENV] === "1" || process.env[LEGACY_FORCE_BASELINE_ENV] === "1") {
|
|
36
39
|
return false;
|
|
37
40
|
}
|
|
38
41
|
|
|
@@ -85,7 +88,7 @@ function main() {
|
|
|
85
88
|
preferBaseline: avx2Supported === false,
|
|
86
89
|
});
|
|
87
90
|
} catch (error) {
|
|
88
|
-
console.error(`\
|
|
91
|
+
console.error(`\n${PLUGIN_NAME}: ${error.message}\n`);
|
|
89
92
|
process.exit(1);
|
|
90
93
|
}
|
|
91
94
|
|
|
@@ -100,7 +103,7 @@ function main() {
|
|
|
100
103
|
.filter((entry) => entry !== null);
|
|
101
104
|
|
|
102
105
|
if (resolvedBinaries.length === 0) {
|
|
103
|
-
console.error(`\
|
|
106
|
+
console.error(`\n${PLUGIN_NAME}: Platform binary not installed.`);
|
|
104
107
|
console.error(`\nYour platform: ${platform}-${arch}${libcFamily === "musl" ? "-musl" : ""}`);
|
|
105
108
|
console.error(`Expected packages (in order): ${packageCandidates.join(", ")}`);
|
|
106
109
|
console.error(`\nTo fix, run:`);
|
|
@@ -120,7 +123,7 @@ function main() {
|
|
|
120
123
|
continue;
|
|
121
124
|
}
|
|
122
125
|
|
|
123
|
-
console.error(`\
|
|
126
|
+
console.error(`\n${PLUGIN_NAME}: Failed to execute binary.`);
|
|
124
127
|
console.error(`Error: ${result.error.message}\n`);
|
|
125
128
|
process.exit(2);
|
|
126
129
|
}
|
package/bin/platform.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
// bin/platform.js
|
|
2
2
|
// Shared platform detection module - used by wrapper and postinstall
|
|
3
3
|
|
|
4
|
+
const PLATFORM_PACKAGE_PREFIX = "evil-omo";
|
|
5
|
+
const CLI_BINARY_NAME = "evil-omo";
|
|
6
|
+
|
|
4
7
|
/**
|
|
5
8
|
* Get the platform-specific package name
|
|
6
9
|
* @param {{ platform: string, arch: string, libcFamily?: string | null }} options
|
|
7
|
-
* @returns {string} Package name like "
|
|
10
|
+
* @returns {string} Package name like "evil-omo-darwin-arm64"
|
|
8
11
|
* @throws {Error} If libc cannot be detected on Linux
|
|
9
12
|
*/
|
|
10
13
|
export function getPlatformPackage({ platform, arch, libcFamily }) {
|
|
@@ -23,7 +26,7 @@ export function getPlatformPackage({ platform, arch, libcFamily }) {
|
|
|
23
26
|
|
|
24
27
|
// Map platform names: win32 -> windows (for package name)
|
|
25
28
|
const os = platform === "win32" ? "windows" : platform;
|
|
26
|
-
return
|
|
29
|
+
return `${PLATFORM_PACKAGE_PREFIX}-${os}-${arch}${suffix}`;
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
/** @param {{ platform: string, arch: string, libcFamily?: string | null, preferBaseline?: boolean }} options */
|
|
@@ -45,11 +48,11 @@ function getBaselinePlatformPackage({ platform, arch, libcFamily }) {
|
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
if (platform === "darwin") {
|
|
48
|
-
return
|
|
51
|
+
return `${PLATFORM_PACKAGE_PREFIX}-darwin-x64-baseline`;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
if (platform === "win32") {
|
|
52
|
-
return
|
|
55
|
+
return `${PLATFORM_PACKAGE_PREFIX}-windows-x64-baseline`;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
if (platform === "linux") {
|
|
@@ -61,10 +64,10 @@ function getBaselinePlatformPackage({ platform, arch, libcFamily }) {
|
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
if (libcFamily === "musl") {
|
|
64
|
-
return
|
|
67
|
+
return `${PLATFORM_PACKAGE_PREFIX}-linux-x64-musl-baseline`;
|
|
65
68
|
}
|
|
66
69
|
|
|
67
|
-
return
|
|
70
|
+
return `${PLATFORM_PACKAGE_PREFIX}-linux-x64-baseline`;
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
return null;
|
|
@@ -74,9 +77,9 @@ function getBaselinePlatformPackage({ platform, arch, libcFamily }) {
|
|
|
74
77
|
* Get the path to the binary within a platform package
|
|
75
78
|
* @param {string} pkg Package name
|
|
76
79
|
* @param {string} platform Process platform
|
|
77
|
-
* @returns {string} Relative path like "
|
|
80
|
+
* @returns {string} Relative path like "evil-omo-darwin-arm64/bin/evil-omo"
|
|
78
81
|
*/
|
|
79
82
|
export function getBinaryPath(pkg, platform) {
|
|
80
83
|
const ext = platform === "win32" ? ".exe" : "";
|
|
81
|
-
return `${pkg}/bin
|
|
84
|
+
return `${pkg}/bin/${CLI_BINARY_NAME}${ext}`;
|
|
82
85
|
}
|
package/bin/platform.test.ts
CHANGED
|
@@ -12,7 +12,7 @@ describe("getPlatformPackage", () => {
|
|
|
12
12
|
const result = getPlatformPackage(input);
|
|
13
13
|
|
|
14
14
|
// #then returns correct package name
|
|
15
|
-
expect(result).toBe("
|
|
15
|
+
expect(result).toBe("evil-omo-darwin-arm64");
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
test("returns darwin-x64 for macOS Intel", () => {
|
|
@@ -23,7 +23,7 @@ describe("getPlatformPackage", () => {
|
|
|
23
23
|
const result = getPlatformPackage(input);
|
|
24
24
|
|
|
25
25
|
// #then returns correct package name
|
|
26
|
-
expect(result).toBe("
|
|
26
|
+
expect(result).toBe("evil-omo-darwin-x64");
|
|
27
27
|
});
|
|
28
28
|
// #endregion
|
|
29
29
|
|
|
@@ -36,7 +36,7 @@ describe("getPlatformPackage", () => {
|
|
|
36
36
|
const result = getPlatformPackage(input);
|
|
37
37
|
|
|
38
38
|
// #then returns correct package name
|
|
39
|
-
expect(result).toBe("
|
|
39
|
+
expect(result).toBe("evil-omo-linux-x64");
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
test("returns linux-arm64 for Linux ARM64 with glibc", () => {
|
|
@@ -47,7 +47,7 @@ describe("getPlatformPackage", () => {
|
|
|
47
47
|
const result = getPlatformPackage(input);
|
|
48
48
|
|
|
49
49
|
// #then returns correct package name
|
|
50
|
-
expect(result).toBe("
|
|
50
|
+
expect(result).toBe("evil-omo-linux-arm64");
|
|
51
51
|
});
|
|
52
52
|
// #endregion
|
|
53
53
|
|
|
@@ -60,7 +60,7 @@ describe("getPlatformPackage", () => {
|
|
|
60
60
|
const result = getPlatformPackage(input);
|
|
61
61
|
|
|
62
62
|
// #then returns correct package name with musl suffix
|
|
63
|
-
expect(result).toBe("
|
|
63
|
+
expect(result).toBe("evil-omo-linux-x64-musl");
|
|
64
64
|
});
|
|
65
65
|
|
|
66
66
|
test("returns linux-arm64-musl for Alpine ARM64", () => {
|
|
@@ -71,7 +71,7 @@ describe("getPlatformPackage", () => {
|
|
|
71
71
|
const result = getPlatformPackage(input);
|
|
72
72
|
|
|
73
73
|
// #then returns correct package name with musl suffix
|
|
74
|
-
expect(result).toBe("
|
|
74
|
+
expect(result).toBe("evil-omo-linux-arm64-musl");
|
|
75
75
|
});
|
|
76
76
|
// #endregion
|
|
77
77
|
|
|
@@ -84,7 +84,7 @@ describe("getPlatformPackage", () => {
|
|
|
84
84
|
const result = getPlatformPackage(input);
|
|
85
85
|
|
|
86
86
|
// #then returns correct package name with 'windows' not 'win32'
|
|
87
|
-
expect(result).toBe("
|
|
87
|
+
expect(result).toBe("evil-omo-windows-x64");
|
|
88
88
|
});
|
|
89
89
|
// #endregion
|
|
90
90
|
|
|
@@ -112,38 +112,38 @@ describe("getPlatformPackage", () => {
|
|
|
112
112
|
describe("getBinaryPath", () => {
|
|
113
113
|
test("returns path without .exe for Unix platforms", () => {
|
|
114
114
|
// #given Unix platform package
|
|
115
|
-
const pkg = "
|
|
115
|
+
const pkg = "evil-omo-darwin-arm64";
|
|
116
116
|
const platform = "darwin";
|
|
117
117
|
|
|
118
118
|
// #when getting binary path
|
|
119
119
|
const result = getBinaryPath(pkg, platform);
|
|
120
120
|
|
|
121
121
|
// #then returns path without extension
|
|
122
|
-
expect(result).toBe("
|
|
122
|
+
expect(result).toBe("evil-omo-darwin-arm64/bin/evil-omo");
|
|
123
123
|
});
|
|
124
124
|
|
|
125
125
|
test("returns path with .exe for Windows", () => {
|
|
126
126
|
// #given Windows platform package
|
|
127
|
-
const pkg = "
|
|
127
|
+
const pkg = "evil-omo-windows-x64";
|
|
128
128
|
const platform = "win32";
|
|
129
129
|
|
|
130
130
|
// #when getting binary path
|
|
131
131
|
const result = getBinaryPath(pkg, platform);
|
|
132
132
|
|
|
133
133
|
// #then returns path with .exe extension
|
|
134
|
-
expect(result).toBe("
|
|
134
|
+
expect(result).toBe("evil-omo-windows-x64/bin/evil-omo.exe");
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
test("returns path without .exe for Linux", () => {
|
|
138
138
|
// #given Linux platform package
|
|
139
|
-
const pkg = "
|
|
139
|
+
const pkg = "evil-omo-linux-x64";
|
|
140
140
|
const platform = "linux";
|
|
141
141
|
|
|
142
142
|
// #when getting binary path
|
|
143
143
|
const result = getBinaryPath(pkg, platform);
|
|
144
144
|
|
|
145
145
|
// #then returns path without extension
|
|
146
|
-
expect(result).toBe("
|
|
146
|
+
expect(result).toBe("evil-omo-linux-x64/bin/evil-omo");
|
|
147
147
|
});
|
|
148
148
|
});
|
|
149
149
|
|
|
@@ -157,8 +157,8 @@ describe("getPlatformPackageCandidates", () => {
|
|
|
157
157
|
|
|
158
158
|
// #then returns modern first then baseline fallback
|
|
159
159
|
expect(result).toEqual([
|
|
160
|
-
"
|
|
161
|
-
"
|
|
160
|
+
"evil-omo-linux-x64",
|
|
161
|
+
"evil-omo-linux-x64-baseline",
|
|
162
162
|
]);
|
|
163
163
|
});
|
|
164
164
|
|
|
@@ -171,8 +171,8 @@ describe("getPlatformPackageCandidates", () => {
|
|
|
171
171
|
|
|
172
172
|
// #then returns musl modern first then musl baseline fallback
|
|
173
173
|
expect(result).toEqual([
|
|
174
|
-
"
|
|
175
|
-
"
|
|
174
|
+
"evil-omo-linux-x64-musl",
|
|
175
|
+
"evil-omo-linux-x64-musl-baseline",
|
|
176
176
|
]);
|
|
177
177
|
});
|
|
178
178
|
|
|
@@ -185,8 +185,8 @@ describe("getPlatformPackageCandidates", () => {
|
|
|
185
185
|
|
|
186
186
|
// #then baseline package is preferred first
|
|
187
187
|
expect(result).toEqual([
|
|
188
|
-
"
|
|
189
|
-
"
|
|
188
|
+
"evil-omo-windows-x64-baseline",
|
|
189
|
+
"evil-omo-windows-x64",
|
|
190
190
|
]);
|
|
191
191
|
});
|
|
192
192
|
|
|
@@ -198,6 +198,6 @@ describe("getPlatformPackageCandidates", () => {
|
|
|
198
198
|
const result = getPlatformPackageCandidates(input);
|
|
199
199
|
|
|
200
200
|
// #then baseline fallback is not included
|
|
201
|
-
expect(result).toEqual(["
|
|
201
|
+
expect(result).toEqual(["evil-omo-linux-arm64"]);
|
|
202
202
|
});
|
|
203
203
|
});
|
|
@@ -11,3 +11,4 @@ export declare function getConfigDir(): string;
|
|
|
11
11
|
export declare function getConfigJson(): string;
|
|
12
12
|
export declare function getConfigJsonc(): string;
|
|
13
13
|
export declare function getOmoConfigPath(): string;
|
|
14
|
+
export declare function getExistingOmoConfigPath(): string | null;
|
|
@@ -25,5 +25,5 @@ export declare const EXIT_CODES: {
|
|
|
25
25
|
readonly FAILURE: 1;
|
|
26
26
|
};
|
|
27
27
|
export declare const MIN_OPENCODE_VERSION = "1.0.150";
|
|
28
|
-
export declare const PACKAGE_NAME = "
|
|
28
|
+
export declare const PACKAGE_NAME = "evil-omo";
|
|
29
29
|
export declare const OPENCODE_BINARIES: readonly ["opencode", "opencode-desktop"];
|