@levr-one/cli 0.11.5 → 0.11.6
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.
|
@@ -642,6 +642,8 @@ const HARNESSES = [
|
|
|
642
642
|
docsUrl: "https://github.com/openai/codex",
|
|
643
643
|
verifiedVersion: "0.154.0",
|
|
644
644
|
verifiedOn: "2026-09-17",
|
|
645
|
+
configDirEnv: "CODEX_HOME",
|
|
646
|
+
configDirReplaces: "~/.codex",
|
|
645
647
|
detectSignals: [
|
|
646
648
|
{
|
|
647
649
|
platform: "darwin",
|
|
@@ -784,14 +786,20 @@ function defaultEnv() {
|
|
|
784
786
|
};
|
|
785
787
|
}
|
|
786
788
|
/**
|
|
787
|
-
*
|
|
788
|
-
*
|
|
789
|
-
*
|
|
790
|
-
*
|
|
789
|
+
* A config path or signal with `~` expanded. When the harness's `configDirEnv`
|
|
790
|
+
* is set to a non-empty value, the prefix it stands for (`configDirReplaces`,
|
|
791
|
+
* `~` by default) resolves to that directory instead (ENG-6696, ENG-6761). A
|
|
792
|
+
* relative value resolves against `env.cwd`, the directory a spawned client
|
|
793
|
+
* CLI runs in, so the probe and the client read one file.
|
|
791
794
|
*/
|
|
792
|
-
function
|
|
795
|
+
function expandConfigPath(p, harness, env) {
|
|
793
796
|
const dir = harness.configDirEnv ? env.vars?.[harness.configDirEnv] : void 0;
|
|
794
|
-
|
|
797
|
+
if (dir) {
|
|
798
|
+
const prefix = harness.configDirReplaces ?? "~";
|
|
799
|
+
if (p === prefix) return resolve(env.cwd, dir);
|
|
800
|
+
if (p.startsWith(`${prefix}/`) || p.startsWith(`${prefix}\\`)) return join(resolve(env.cwd, dir), p.slice(prefix.length + 1));
|
|
801
|
+
}
|
|
802
|
+
return expandTilde(p, env.homedir);
|
|
795
803
|
}
|
|
796
804
|
/** Expand a leading `~` / `~/…` to the given home directory. */
|
|
797
805
|
function expandTilde(p, home) {
|
|
@@ -822,7 +830,7 @@ function resolveConfigPath(harness, env, scope = defaultScope(harness)) {
|
|
|
822
830
|
if (def.projectPath) return join(resolveProjectRoot(env).root, ...def.projectPath.split("/"));
|
|
823
831
|
const loc = locationFor(harness, env.platform, scope);
|
|
824
832
|
if (!loc) return void 0;
|
|
825
|
-
return
|
|
833
|
+
return expandConfigPath(loc.configPath, harness, env);
|
|
826
834
|
}
|
|
827
835
|
/**
|
|
828
836
|
* Nearest ancestor of `cwd` containing `.git`, or `undefined`.
|
|
@@ -1024,11 +1032,12 @@ function whichSync(bin, env) {
|
|
|
1024
1032
|
return whichPathSync(bin, env) !== void 0;
|
|
1025
1033
|
}
|
|
1026
1034
|
/** Does one `installSignals` entry match on this machine? Supports
|
|
1027
|
-
* `which:<bin>`, `~`-prefixed paths, and absolute (app-bundle) paths.
|
|
1028
|
-
*
|
|
1029
|
-
|
|
1035
|
+
* `which:<bin>`, `~`-prefixed paths, and absolute (app-bundle) paths.
|
|
1036
|
+
* `expand` turns a `~` path into the one this harness reads — see
|
|
1037
|
+
* {@link expandConfigPath}. */
|
|
1038
|
+
function signalMatches(signal, env, expand = (p) => expandTilde(p, env.homedir)) {
|
|
1030
1039
|
if (signal.startsWith("which:")) return whichSync(signal.slice(6), env);
|
|
1031
|
-
return existsSync(signal.startsWith("~") ?
|
|
1040
|
+
return existsSync(signal.startsWith("~") ? expand(signal) : signal);
|
|
1032
1041
|
}
|
|
1033
1042
|
/**
|
|
1034
1043
|
* The value our server key currently holds for this scope, or `undefined`.
|
|
@@ -1541,7 +1550,7 @@ function detectScope(harness, env, def, opts) {
|
|
|
1541
1550
|
function detectOne(harness, env, opts) {
|
|
1542
1551
|
const scopes = harness.scopes.map((def) => detectScope(harness, env, def, opts));
|
|
1543
1552
|
const available = scopes.some((s) => s.available);
|
|
1544
|
-
const installed = detectSignalsFor(harness, env.platform).some((s) => signalMatches(s, env,
|
|
1553
|
+
const installed = detectSignalsFor(harness, env.platform).some((s) => signalMatches(s, env, (p) => expandConfigPath(p, harness, env))) || scopes.some((s) => s.configPath !== "" && existsSync(s.configPath));
|
|
1545
1554
|
const fallback = scopes.find((s) => s.scope === defaultScope(harness));
|
|
1546
1555
|
return {
|
|
1547
1556
|
id: harness.id,
|
package/dist/cli.js
CHANGED
|
@@ -209,7 +209,7 @@ Examples:
|
|
|
209
209
|
aliases: { y: "yes" }
|
|
210
210
|
},
|
|
211
211
|
loader: async () => {
|
|
212
|
-
const { mcpAddHandler } = await import("./addHandler-
|
|
212
|
+
const { mcpAddHandler } = await import("./addHandler-DJqJGqz3.js");
|
|
213
213
|
return mcpAddHandler;
|
|
214
214
|
}
|
|
215
215
|
});
|
|
@@ -876,7 +876,7 @@ Examples:
|
|
|
876
876
|
|
|
877
877
|
//#endregion
|
|
878
878
|
//#region package.json
|
|
879
|
-
var version = "0.11.
|
|
879
|
+
var version = "0.11.6";
|
|
880
880
|
|
|
881
881
|
//#endregion
|
|
882
882
|
//#region src/app.ts
|