oh-my-opencode-linux-x64-musl-baseline 4.7.4 → 4.8.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.
@@ -5,6 +5,7 @@ import { join } from "node:path";
5
5
 
6
6
  const wrapperPackageRoot = process.env.OMO_WRAPPER_PACKAGE_ROOT;
7
7
  const lazyCodexInvocationNames = new Set(["lazycodex", "lazycodex-ai"]);
8
+ const lazyCodexInstallerCommands = new Set(["install", "setup", "update", "uninstall", "cleanup"]);
8
9
 
9
10
  if (!wrapperPackageRoot) {
10
11
  console.error("oh-my-opencode: OMO_WRAPPER_PACKAGE_ROOT is required to launch the packaged CLI.");
@@ -25,7 +26,52 @@ function exitFromResult(result, failureLabel) {
25
26
  process.exit(result.status ?? 1);
26
27
  }
27
28
 
28
- if (lazyCodexInvocationNames.has(process.env.OMO_INVOCATION_NAME ?? "")) {
29
+ function shouldRunLazyCodexInstaller() {
30
+ const args = process.argv.slice(2);
31
+ const command = readInstallerCommand(args);
32
+ const platformArg = readPlatformArg(args);
33
+ if (lazyCodexInvocationNames.has(process.env.OMO_INVOCATION_NAME ?? "")) {
34
+ if ((command === "install" || command === "setup") && platformArg !== undefined && platformArg !== "codex") {
35
+ return false;
36
+ }
37
+ return command === undefined ||
38
+ command === "--help" ||
39
+ command === "-h" ||
40
+ command === "--version" ||
41
+ command === "-v" ||
42
+ lazyCodexInstallerCommands.has(command);
43
+ }
44
+
45
+ return (command === "install" || command === "setup") && platformArg === "codex";
46
+ }
47
+
48
+ function readInstallerCommand(args) {
49
+ for (let index = 0; index < args.length; index += 1) {
50
+ const arg = args[index];
51
+ if (arg === "--platform" || arg === "--repo-root") {
52
+ index += 1;
53
+ continue;
54
+ }
55
+ if (arg.startsWith("-")) continue;
56
+ return arg;
57
+ }
58
+ return undefined;
59
+ }
60
+
61
+ function readPlatformArg(args) {
62
+ for (let index = 0; index < args.length; index += 1) {
63
+ const arg = args[index];
64
+ if (arg === "--platform") {
65
+ return args[index + 1];
66
+ }
67
+ if (arg.startsWith("--platform=")) {
68
+ return arg.slice("--platform=".length);
69
+ }
70
+ }
71
+ return undefined;
72
+ }
73
+
74
+ if (shouldRunLazyCodexInstaller()) {
29
75
  const lazyCodexInstallerPath = join(wrapperPackageRoot, "packages", "omo-codex", "scripts", "install-local.mjs");
30
76
 
31
77
  if (!existsSync(lazyCodexInstallerPath)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode-linux-x64-musl-baseline",
3
- "version": "4.7.4",
3
+ "version": "4.8.0",
4
4
  "description": "Platform-specific binary for oh-my-opencode (linux-x64-musl-baseline, no AVX2)",
5
5
  "license": "MIT",
6
6
  "repository": {