talk-to-copilot 1.0.0 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "talk-to-copilot",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Voice + screenshot input wrapper for GitHub Copilot CLI — use your mic and screen instead of typing",
5
5
  "bin": {
6
6
  "ttc": "bin/ttc"
@@ -10,13 +10,18 @@ const os = require('os');
10
10
 
11
11
  if (os.platform() !== 'darwin' && os.platform() !== 'linux') process.exit(0);
12
12
 
13
- const prebuildDir = path.join(__dirname, '..', 'node_modules', 'node-pty', 'prebuilds');
14
- if (!fs.existsSync(prebuildDir)) process.exit(0);
13
+ // Use require.resolve to find node-pty regardless of hoisting / install location
14
+ let nodePtyDir;
15
+ try {
16
+ nodePtyDir = path.dirname(require.resolve('node-pty/package.json'));
17
+ } catch {
18
+ process.exit(0); // node-pty not found, nothing to fix
19
+ }
15
20
 
16
21
  const platform = `${os.platform()}-${os.arch()}`;
17
22
  const targets = [
18
- path.join(prebuildDir, platform, 'spawn-helper'),
19
- path.join(prebuildDir, platform, 'pty.node'),
23
+ path.join(nodePtyDir, 'prebuilds', platform, 'spawn-helper'),
24
+ path.join(nodePtyDir, 'prebuilds', platform, 'pty.node'),
20
25
  ];
21
26
 
22
27
  let fixed = 0;