golem-cc 3.0.0 → 3.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.
Files changed (2) hide show
  1. package/bin/golem-shim.mjs +13 -13
  2. package/package.json +1 -1
@@ -1,36 +1,36 @@
1
1
  #!/usr/bin/env node
2
2
  import { existsSync } from 'node:fs';
3
3
  import { join, dirname } from 'node:path';
4
- import { execFileSync } from 'node:child_process';
4
+ import { fileURLToPath, pathToFileURL } from 'node:url';
5
+
6
+ const __dirname = dirname(fileURLToPath(import.meta.url));
5
7
 
6
8
  // Walk up from cwd to find .golem/bin/golem.mjs
7
9
  function findGolemProject(startDir) {
8
10
  let currentDir = startDir;
9
11
  while (true) {
10
- const golemPath = join(currentDir, '.golem', 'bin', 'golem.mjs');
11
- if (existsSync(golemPath)) {
12
- return { projectRoot: currentDir, golemPath };
12
+ if (existsSync(join(currentDir, '.golem', 'bin', 'golem.mjs'))) {
13
+ return currentDir;
13
14
  }
14
15
  if (currentDir === '/') return null;
15
16
  currentDir = dirname(currentDir);
16
17
  }
17
18
  }
18
19
 
19
- const result = findGolemProject(process.cwd());
20
+ const projectRoot = findGolemProject(process.cwd());
20
21
 
21
- if (!result) {
22
+ if (!projectRoot) {
22
23
  console.error('No golem project found. Run `pnpm dlx golem-cc` to set one up.');
23
24
  process.exit(1);
24
25
  }
25
26
 
26
- const { projectRoot, golemPath } = result;
27
-
28
27
  if (process.env.GOLEM_DEBUG === '1') {
29
28
  console.log(`[golem-shim] Resolved project root: ${projectRoot}`);
30
29
  }
31
30
 
32
- try {
33
- execFileSync('node', [golemPath, ...process.argv.slice(2)], { stdio: 'inherit' });
34
- } catch (error) {
35
- process.exit(error.status ?? 1);
36
- }
31
+ // chdir to project root so the CLI resolves config/plans/specs correctly
32
+ process.chdir(projectRoot);
33
+
34
+ // Import the CLI from our own package so dependencies (commander, chalk, ora)
35
+ // resolve from the global install's node_modules, not the project's.
36
+ await import(pathToFileURL(join(__dirname, '..', '.golem', 'bin', 'golem.mjs')).href);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "golem-cc",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Project-scoped autonomous coding agent framework for Claude Code CLI",
5
5
  "type": "module",
6
6
  "bin": {