cxstatusline 0.10.0 → 0.10.1
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/dist/cxstatusline.js +40 -14
- package/package.json +1 -1
package/dist/cxstatusline.js
CHANGED
|
@@ -59007,8 +59007,8 @@ function runRefreshCommand(cacheKey2, deps) {
|
|
|
59007
59007
|
return 0;
|
|
59008
59008
|
}
|
|
59009
59009
|
// src/version-info.ts
|
|
59010
|
-
var VERSION = "0.10.
|
|
59011
|
-
var SOURCE_COMMIT = /^[0-9a-f]{40}$/.test("
|
|
59010
|
+
var VERSION = "0.10.1";
|
|
59011
|
+
var SOURCE_COMMIT = /^[0-9a-f]{40}$/.test("cb2f6799d53ce95398331bae1cea4f96d2c9641e") ? "cb2f6799d53ce95398331bae1cea4f96d2c9641e" : null;
|
|
59012
59012
|
var SOURCE_DIRTY = false;
|
|
59013
59013
|
|
|
59014
59014
|
// src/context.ts
|
|
@@ -59149,7 +59149,7 @@ function realContext(env3, io) {
|
|
|
59149
59149
|
}
|
|
59150
59150
|
|
|
59151
59151
|
// src/patch/run.ts
|
|
59152
|
-
import { appendFileSync, mkdirSync as mkdirSync8 } from "node:fs";
|
|
59152
|
+
import { appendFileSync, mkdirSync as mkdirSync8, rmSync as rmSync6 } from "node:fs";
|
|
59153
59153
|
import { join as join18 } from "node:path";
|
|
59154
59154
|
|
|
59155
59155
|
// src/lock.ts
|
|
@@ -63147,7 +63147,7 @@ function unchangedPair(ctx, manifest, artifact, tag) {
|
|
|
63147
63147
|
if (!release || release.tag !== tag || release.archiveSha256 !== artifact.sha256)
|
|
63148
63148
|
return null;
|
|
63149
63149
|
const installed = release.manifest;
|
|
63150
|
-
const identical = record2.codexVersion === manifest.codexVersion && record2.provenance.cxVersion === manifest.cxVersion && record2.provenance.platform === artifact.platform && record2.provenance.patchVersion === manifest.patchVersion && record2.provenance.patchSha256 === manifest.patchSha256 && record2.provenance.upstreamCommit === manifest.upstreamCommit && installed.cxVersion === manifest.cxVersion && installed.codexVersion === manifest.codexVersion && installed.patchSha256 === manifest.patchSha256 && installed.upstreamCommit === manifest.upstreamCommit;
|
|
63150
|
+
const identical = record2.codexVersion === manifest.codexVersion && (manifest.cxVersion === undefined || record2.provenance.cxVersion === manifest.cxVersion) && record2.provenance.platform === artifact.platform && record2.provenance.patchVersion === manifest.patchVersion && record2.provenance.patchSha256 === manifest.patchSha256 && record2.provenance.upstreamCommit === manifest.upstreamCommit && (manifest.cxVersion === undefined || installed.cxVersion === manifest.cxVersion) && installed.codexVersion === manifest.codexVersion && installed.patchSha256 === manifest.patchSha256 && installed.upstreamCommit === manifest.upstreamCommit;
|
|
63151
63151
|
if (!identical)
|
|
63152
63152
|
return null;
|
|
63153
63153
|
const directory = activeGeneration(ctx.paths);
|
|
@@ -65006,11 +65006,37 @@ async function runUpdate(ctx, opts = {}, transport = {}) {
|
|
|
65006
65006
|
}
|
|
65007
65007
|
const installed = readInstallation(ctx.paths)?.codexVersion ?? loadState(ctx).patched_from;
|
|
65008
65008
|
const current = installed ? parseSemver(installed) : null;
|
|
65009
|
-
|
|
65009
|
+
const targetSemver = parseSemver(target);
|
|
65010
|
+
if (current && compareSemver(current, targetSemver) > 0) {
|
|
65010
65011
|
ctx.say(`Installed Codex ${installed} is newer than the latest supported ${opts.compile ? "patch" : "prebuilt"} (${target}); leaving it unchanged.`);
|
|
65011
65012
|
return 0;
|
|
65012
65013
|
}
|
|
65013
|
-
if (
|
|
65014
|
+
if (current && compareSemver(current, targetSemver) === 0 && !opts.force) {
|
|
65015
|
+
const record2 = readInstallation(ctx.paths);
|
|
65016
|
+
if (!opts.compile && record2 && record2.provenance.source === "prebuilt") {
|
|
65017
|
+
try {
|
|
65018
|
+
const expected = {
|
|
65019
|
+
codexVersion: target,
|
|
65020
|
+
platform: platformFor(process.platform, process.arch)
|
|
65021
|
+
};
|
|
65022
|
+
const prepared = await preparePrebuilt(ctx, expected, transport);
|
|
65023
|
+
if (prepared.kind === "unchanged") {
|
|
65024
|
+
ctx.say(`Codex is already up to date (${installed}).`);
|
|
65025
|
+
return 0;
|
|
65026
|
+
}
|
|
65027
|
+
rmSync6(prepared.pair.directory, { recursive: true, force: true });
|
|
65028
|
+
} catch {}
|
|
65029
|
+
} else if (opts.compile && record2 && record2.provenance.source === "compiled") {
|
|
65030
|
+
const patchRef = resolvePatch(manifest, targetSemver);
|
|
65031
|
+
const currentPatch = record2.provenance.patchVersion ?? 1;
|
|
65032
|
+
const targetPatch = patchRef?.patchVersion ?? 1;
|
|
65033
|
+
if (currentPatch >= targetPatch) {
|
|
65034
|
+
ctx.say(`Codex is already up to date (${installed}).`);
|
|
65035
|
+
return 0;
|
|
65036
|
+
}
|
|
65037
|
+
}
|
|
65038
|
+
}
|
|
65039
|
+
if (opts.isTTY && !opts.force && !opts.compile && (!current || compareSemver(current, targetSemver) < 0)) {
|
|
65014
65040
|
const action = await (opts.promptUpdate ?? promptUpdate)({ latest: target, highestAvailable: target });
|
|
65015
65041
|
if (action === "cancel") {
|
|
65016
65042
|
ctx.say("Update cancelled.");
|
|
@@ -65863,7 +65889,7 @@ function runPolicy(ctx, argv, io2) {
|
|
|
65863
65889
|
}
|
|
65864
65890
|
|
|
65865
65891
|
// src/commands/revert.ts
|
|
65866
|
-
import { existsSync as existsSync15, lstatSync as lstatSync7, readdirSync as readdirSync4, rmSync as
|
|
65892
|
+
import { existsSync as existsSync15, lstatSync as lstatSync7, readdirSync as readdirSync4, rmSync as rmSync7, symlinkSync as symlinkSync2 } from "node:fs";
|
|
65867
65893
|
import { join as join21 } from "node:path";
|
|
65868
65894
|
function safeIsSymlink(p2) {
|
|
65869
65895
|
try {
|
|
@@ -65886,7 +65912,7 @@ function revert(ctx) {
|
|
|
65886
65912
|
function removeGenerations(ctx, actions) {
|
|
65887
65913
|
const { currentGeneration, generationsDir } = ctx.paths;
|
|
65888
65914
|
if (existsSync15(currentGeneration) || safeIsSymlink(currentGeneration)) {
|
|
65889
|
-
|
|
65915
|
+
rmSync7(currentGeneration, { recursive: true, force: true });
|
|
65890
65916
|
actions.push(`removed generation pointer ${currentGeneration}`);
|
|
65891
65917
|
}
|
|
65892
65918
|
if (!existsSync15(generationsDir))
|
|
@@ -65897,12 +65923,12 @@ function removeGenerations(ctx, actions) {
|
|
|
65897
65923
|
actions.push(`${dir} is not a cxstatusline generation; left in place`);
|
|
65898
65924
|
continue;
|
|
65899
65925
|
}
|
|
65900
|
-
|
|
65926
|
+
rmSync7(dir, { recursive: true, force: true });
|
|
65901
65927
|
removed += 1;
|
|
65902
65928
|
}
|
|
65903
65929
|
actions.push(`removed ${removed} cxstatusline generation${removed === 1 ? "" : "s"} from ${generationsDir}`);
|
|
65904
65930
|
if (readdirSync4(generationsDir).length === 0)
|
|
65905
|
-
|
|
65931
|
+
rmSync7(generationsDir, { recursive: true, force: true });
|
|
65906
65932
|
}
|
|
65907
65933
|
var OWNED_LIBEXEC_PREFIXES = ["current.", "staging-", "download-", "compiled-"];
|
|
65908
65934
|
function removeStagingDebris(ctx, actions) {
|
|
@@ -65911,7 +65937,7 @@ function removeStagingDebris(ctx, actions) {
|
|
|
65911
65937
|
return;
|
|
65912
65938
|
const debris = readdirSync4(libexecDir).filter((n) => OWNED_LIBEXEC_PREFIXES.some((p2) => n.startsWith(p2)));
|
|
65913
65939
|
for (const name of debris)
|
|
65914
|
-
|
|
65940
|
+
rmSync7(join21(libexecDir, name), { recursive: true, force: true });
|
|
65915
65941
|
if (debris.length > 0) {
|
|
65916
65942
|
actions.push(`removed ${debris.length} leftover staging entr${debris.length === 1 ? "y" : "ies"} from ${libexecDir}`);
|
|
65917
65943
|
}
|
|
@@ -65925,7 +65951,7 @@ function revertLocked(ctx) {
|
|
|
65925
65951
|
const w2 = ctx.paths.wrapperPath;
|
|
65926
65952
|
if (existsSync15(w2) || safeIsSymlink(w2)) {
|
|
65927
65953
|
if (isOurWrapper(w2)) {
|
|
65928
|
-
|
|
65954
|
+
rmSync7(w2);
|
|
65929
65955
|
actions.push(`removed wrapper ${w2}`);
|
|
65930
65956
|
if (state.launcher_restore?.kind === "symlink") {
|
|
65931
65957
|
symlinkSync2(state.launcher_restore.target, w2);
|
|
@@ -65940,11 +65966,11 @@ function revertLocked(ctx) {
|
|
|
65940
65966
|
removeGenerations(ctx, actions);
|
|
65941
65967
|
removeStagingDebris(ctx, actions);
|
|
65942
65968
|
if (existsSync15(ctx.paths.patchedBin)) {
|
|
65943
|
-
|
|
65969
|
+
rmSync7(ctx.paths.patchedBin);
|
|
65944
65970
|
actions.push(`removed patched binary ${ctx.paths.patchedBin}`);
|
|
65945
65971
|
}
|
|
65946
65972
|
if (existsSync15(ctx.paths.patchedCodeModeHost)) {
|
|
65947
|
-
|
|
65973
|
+
rmSync7(ctx.paths.patchedCodeModeHost);
|
|
65948
65974
|
actions.push(`removed Code Mode host ${ctx.paths.patchedCodeModeHost}`);
|
|
65949
65975
|
}
|
|
65950
65976
|
try {
|