github-llm-council 2.0.8 → 2.0.9

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/bin/cli.js +8 -26
  2. package/package.json +3 -2
package/bin/cli.js CHANGED
@@ -2,43 +2,25 @@
2
2
 
3
3
  import { spawn } from 'node:child_process';
4
4
  import { fileURLToPath } from 'node:url';
5
- import { existsSync } from 'node:fs';
6
5
  import path from 'node:path';
6
+ import resolve from 'resolve';
7
7
 
8
8
  const __filename = fileURLToPath(import.meta.url);
9
9
  const __dirname = path.dirname(__filename);
10
-
11
- // Find @github/copilot by walking up the filesystem from our package location
12
- // This bypasses Node.js exports restrictions that block require.resolve()
13
- function findCopilotCliPath(startDir) {
14
- let dir = startDir;
15
- const root = path.parse(dir).root;
16
-
17
- while (dir !== root) {
18
- // Check node_modules/@github/copilot/npm-loader.js
19
- const copilotPath = path.join(dir, 'node_modules', '@github', 'copilot', 'npm-loader.js');
20
- if (existsSync(copilotPath)) {
21
- return copilotPath;
22
- }
23
- // Also check sibling in node_modules (for hoisted packages in npx cache)
24
- const siblingPath = path.join(dir, '@github', 'copilot', 'npm-loader.js');
25
- if (existsSync(siblingPath)) {
26
- return siblingPath;
27
- }
28
- dir = path.dirname(dir);
29
- }
30
- return null;
31
- }
10
+ const packageRoot = path.join(__dirname, '..');
32
11
 
33
12
  // Resolve the @github/copilot CLI loader path
13
+ // Uses 'resolve' package to bypass Node.js exports restrictions
34
14
  // Returns null if not found
35
15
  function resolveCopilotCliPath() {
36
16
  if (process.env.COPILOT_MOCK === '1') {
37
17
  return null; // Mock mode doesn't need the CLI
38
18
  }
39
- // Start from our package root (parent of bin/)
40
- const packageRoot = path.join(__dirname, '..');
41
- return findCopilotCliPath(packageRoot);
19
+ try {
20
+ return resolve.sync('@github/copilot/npm-loader.js', { basedir: packageRoot });
21
+ } catch {
22
+ return null;
23
+ }
42
24
  }
43
25
 
44
26
  const copilotCliPath = resolveCopilotCliPath();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-llm-council",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "description": "Watch multiple AI models debate side-by-side using GitHub Copilot",
5
5
  "type": "module",
6
6
  "main": "dist/src/server.js",
@@ -49,7 +49,8 @@
49
49
  "@github/copilot": "^0.0.384",
50
50
  "@github/copilot-sdk": "^0.1.13",
51
51
  "express": "^5.2.1",
52
- "open": "^11.0.0"
52
+ "open": "^11.0.0",
53
+ "resolve": "^1.22.11"
53
54
  },
54
55
  "devDependencies": {
55
56
  "@playwright/test": "^1.57.0",