@meowlynxsea/koi 0.2.15 → 0.2.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meowlynxsea/koi",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
4
4
  "description": "A coding agent built on Pi SDK with TUI + Bun runtime",
5
5
  "module": "src/main.tsx",
6
6
  "type": "module",
@@ -36,8 +36,11 @@ export default module.default;
36
36
  // Find the actual node_modules path
37
37
  // In global install, koi is at: C:\Users\Acro\node_modules\@meowlynxsea\koi
38
38
  // Platform modules are at: C:\Users\Acro\node_modules\@opentui\core-win32-x64
39
- const parentDir = dirname(rootDir);
40
- console.log(`[DEBUG] parentDir (dirname(rootDir)): ${parentDir}`);
39
+ // rootDir is: C:\Users\Acro\node_modules\@meowlynxsea\koi
40
+ // dirname(rootDir) is: C:\Users\Acro\node_modules\@meowlynxsea (WRONG)
41
+ // We need to go up two levels to get: C:\Users\Acro\node_modules
42
+ const parentDir = dirname(dirname(rootDir));
43
+ console.log(`[DEBUG] parentDir (dirname(dirname(rootDir))): ${parentDir}`);
41
44
 
42
45
  // Check if parentDir has the expected structure
43
46
  const parentNodeModulesCheck = join(parentDir, "@opentui");
@@ -114,3 +117,16 @@ if (existsSync(indexHmk8xzt3Path)) {
114
117
  }
115
118
 
116
119
  console.log("\nPostinstall complete.");
120
+
121
+ // Fix main.js: replace scoped package imports with relative paths for Windows compatibility
122
+ const mainJsPath = join(rootDir, "dist", "main.js");
123
+ if (existsSync(mainJsPath)) {
124
+ let content = readFileSync(mainJsPath, "utf-8");
125
+ // Replace: import(`@opentui/core-${platform}-${arch}/index.js`)
126
+ // With: import(`./node_modules/@opentui/core-${platform}-${arch}/index.js`)
127
+ if (content.includes("`@opentui/core-")) {
128
+ content = content.replace(/`@opentui\/core-/g, "`./node_modules/@opentui/core-");
129
+ writeFileSync(mainJsPath, content);
130
+ console.log("Fixed dynamic imports in main.js for Windows compatibility");
131
+ }
132
+ }