opencode-immune 1.0.30 → 1.0.31

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.
Files changed (2) hide show
  1. package/dist/plugin.js +13 -6
  2. package/package.json +1 -1
package/dist/plugin.js CHANGED
@@ -615,10 +615,12 @@ async function fetchLatestHarnessRelease(repo, token) {
615
615
  const tagName = data.tag_name;
616
616
  if (!tagName)
617
617
  return null;
618
- // Find the harness.tar.gz asset
619
- const asset = data.assets?.find((a) => a.name === "harness.tar.gz");
618
+ // Find the correct harness asset based on OS
619
+ const isWindows = process.platform === "win32";
620
+ const assetName = isWindows ? "harness-windows.tar.gz" : "harness.tar.gz";
621
+ const asset = data.assets?.find((a) => a.name === assetName);
620
622
  if (!asset) {
621
- console.warn(`[opencode-immune] Harness sync: release ${tagName} has no harness.tar.gz asset`);
623
+ console.warn(`[opencode-immune] Harness sync: release ${tagName} has no ${assetName} asset`);
622
624
  return null;
623
625
  }
624
626
  return {
@@ -684,17 +686,22 @@ function extractTarGz(archivePath, destDir) {
684
686
  /**
685
687
  * Recursively copy all files from src to dest, creating directories as needed.
686
688
  * Overwrites existing files.
689
+ * skipRootFiles: file names to skip ONLY when dest === rootDest (top-level copy target).
687
690
  */
688
- async function copyDirRecursive(src, dest, skipFiles) {
691
+ async function copyDirRecursive(src, dest, skipRootFiles, rootDest) {
692
+ const effectiveRoot = rootDest ?? dest;
689
693
  const entries = await (0, promises_1.readdir)(src, { withFileTypes: true });
690
694
  await (0, promises_1.mkdir)(dest, { recursive: true });
691
695
  for (const entry of entries) {
692
- if (skipFiles?.has(entry.name))
696
+ // Skip files only at the root destination level
697
+ if (skipRootFiles && dest === effectiveRoot && entry.name === ".gitignore") {
698
+ console.log(`[opencode-immune] Harness sync: skipping root .gitignore`);
693
699
  continue;
700
+ }
694
701
  const srcPath = (0, path_1.join)(src, entry.name);
695
702
  const destPath = (0, path_1.join)(dest, entry.name);
696
703
  if (entry.isDirectory()) {
697
- await copyDirRecursive(srcPath, destPath);
704
+ await copyDirRecursive(srcPath, destPath, skipRootFiles, effectiveRoot);
698
705
  }
699
706
  else {
700
707
  await (0, promises_1.mkdir)((0, path_1.dirname)(destPath), { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-immune",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "OpenCode plugin: session recovery, auto-retry, multi-cycle automation, context monitoring",
5
5
  "exports": {
6
6
  "./server": "./dist/plugin.js"