opencode-immune 1.0.85 → 1.0.86
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/plugin/server.js +2 -33
- package/package.json +1 -1
package/dist/plugin/server.js
CHANGED
|
@@ -5518,31 +5518,6 @@ async function fileHash(filePath) {
|
|
|
5518
5518
|
return "";
|
|
5519
5519
|
}
|
|
5520
5520
|
}
|
|
5521
|
-
async function fileExists(filePath) {
|
|
5522
|
-
try {
|
|
5523
|
-
await stat(filePath);
|
|
5524
|
-
return true;
|
|
5525
|
-
} catch {
|
|
5526
|
-
return false;
|
|
5527
|
-
}
|
|
5528
|
-
}
|
|
5529
|
-
async function getHarnessIntegrityIssue(directory) {
|
|
5530
|
-
try {
|
|
5531
|
-
const configPath = join(directory, "opencode.json");
|
|
5532
|
-
const raw = await readFile(configPath, "utf-8");
|
|
5533
|
-
const config = JSON.parse(raw);
|
|
5534
|
-
const plugins = Array.isArray(config.plugin) ? config.plugin : [];
|
|
5535
|
-
const usesLoader = plugins.includes(".opencode/plugin-loader.cjs") || plugins.includes(".opencode\\plugin-loader.cjs");
|
|
5536
|
-
if (!usesLoader) return null;
|
|
5537
|
-
const loaderPath = join(directory, ".opencode", "plugin-loader.cjs");
|
|
5538
|
-
if (!await fileExists(loaderPath)) {
|
|
5539
|
-
return "opencode.json references .opencode/plugin-loader.cjs but the file is missing";
|
|
5540
|
-
}
|
|
5541
|
-
} catch {
|
|
5542
|
-
return null;
|
|
5543
|
-
}
|
|
5544
|
-
return null;
|
|
5545
|
-
}
|
|
5546
5521
|
function parseImmunePluginSpec(value) {
|
|
5547
5522
|
const trimmed = value.trim();
|
|
5548
5523
|
const match = trimmed.match(/^opencode-immune(?:@(.+))?$/);
|
|
@@ -5651,19 +5626,13 @@ async function syncHarness(state) {
|
|
|
5651
5626
|
const release = await fetchLatestHarnessRelease(state.input.directory, repo, token);
|
|
5652
5627
|
if (!release) return;
|
|
5653
5628
|
const localVersion = await readLocalHarnessVersion(state.input.directory);
|
|
5654
|
-
|
|
5655
|
-
if (localVersion === release.tagName && !integrityIssue) {
|
|
5629
|
+
if (localVersion === release.tagName) {
|
|
5656
5630
|
pluginLog.info(
|
|
5657
5631
|
`[opencode-immune] Harness sync: already up to date (${release.tagName})`
|
|
5658
5632
|
);
|
|
5659
5633
|
return;
|
|
5660
5634
|
}
|
|
5661
|
-
if (localVersion
|
|
5662
|
-
pluginLog.warn(
|
|
5663
|
-
`[opencode-immune] Harness sync: integrity issue detected for ${release.tagName}: ${integrityIssue}. Reinstalling harness files from release.`
|
|
5664
|
-
);
|
|
5665
|
-
}
|
|
5666
|
-
if (localVersion && localVersion !== release.tagName) {
|
|
5635
|
+
if (localVersion) {
|
|
5667
5636
|
const versionOrder = compareHarnessVersions(localVersion, release.tagName);
|
|
5668
5637
|
if (versionOrder === null) {
|
|
5669
5638
|
pluginLog.warn(
|