@locusai/sdk 0.4.2 → 0.4.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"claude-runner.d.ts","sourceRoot":"","sources":["../../src/ai/claude-runner.ts"],"names":[],"mappings":"AAGA,qBAAa,YAAY;IAErB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,KAAK;gBADL,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,MAAsB;IAGvC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;CA4C1D"}
1
+ {"version":3,"file":"claude-runner.d.ts","sourceRoot":"","sources":["../../src/ai/claude-runner.ts"],"names":[],"mappings":"AAGA,qBAAa,YAAY;IAErB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,KAAK;gBADL,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,MAAsB;IAGvC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;CAkD1D"}
@@ -18,6 +18,8 @@ export class ClaudeRunner {
18
18
  const claude = spawn("claude", args, {
19
19
  cwd: this.projectPath,
20
20
  stdio: ["pipe", "pipe", "pipe"],
21
+ env: process.env,
22
+ shell: true,
21
23
  });
22
24
  let output = "";
23
25
  let errorOutput = "";
@@ -29,14 +31,14 @@ export class ClaudeRunner {
29
31
  errorOutput += data.toString();
30
32
  process.stderr.write(data.toString());
31
33
  });
32
- claude.on("error", (err) => reject(new Error(`Failed to start Claude CLI: ${err.message}`)));
34
+ claude.on("error", (err) => reject(new Error(`Failed to start Claude CLI (shell: true): ${err.message}. Please ensure the 'claude' command is available in your PATH.`)));
33
35
  claude.on("close", (code) => {
34
36
  if (code === 0)
35
37
  resolve(output);
36
38
  else {
37
39
  const detail = errorOutput.trim();
38
40
  const message = detail
39
- ? `Claude CLI error: ${detail}`
41
+ ? `Claude CLI error (exit code ${code}): ${detail}`
40
42
  : `Claude CLI exited with code ${code}. Please ensure the Claude CLI is installed and you are logged in (run 'claude' manually to check).`;
41
43
  reject(new Error(message));
42
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../src/core/indexer.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAS;gBAEd,WAAW,EAAE,MAAM;IAK/B;;;OAGG;IACG,KAAK,CACT,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EACtC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,GACxD,OAAO,CAAC,aAAa,CAAC;IAkEzB,SAAS,IAAI,aAAa,GAAG,IAAI;IAWjC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;CAOtC"}
1
+ {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../src/core/indexer.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAS;gBAEd,WAAW,EAAE,MAAM;IAK/B;;;OAGG;IACG,KAAK,CACT,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EACtC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,GACxD,OAAO,CAAC,aAAa,CAAC;IAsFzB,SAAS,IAAI,aAAa,GAAG,IAAI;IAWjC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;CAOtC"}
@@ -19,10 +19,30 @@ export class CodebaseIndexer {
19
19
  if (onProgress)
20
20
  onProgress("Generating file tree...");
21
21
  // 1. Get a comprehensive but clean file tree
22
+ const gitmodulesPath = join(this.projectPath, ".gitmodules");
23
+ const submoduleIgnores = [];
24
+ if (existsSync(gitmodulesPath)) {
25
+ try {
26
+ const content = readFileSync(gitmodulesPath, "utf-8");
27
+ const lines = content.split("\n");
28
+ for (const line of lines) {
29
+ const match = line.match(/^\s*path\s*=\s*(.*)$/);
30
+ const path = match?.[1]?.trim();
31
+ if (path) {
32
+ submoduleIgnores.push(`${path}/**`);
33
+ submoduleIgnores.push(`**/${path}/**`);
34
+ }
35
+ }
36
+ }
37
+ catch {
38
+ // Fallback if .gitmodules exists but can't be read or parsed
39
+ }
40
+ }
22
41
  const files = await globby(["**/*"], {
23
42
  cwd: this.projectPath,
24
43
  gitignore: true,
25
44
  ignore: [
45
+ ...submoduleIgnores,
26
46
  "**/node_modules/**",
27
47
  "**/dist/**",
28
48
  "**/build/**",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@locusai/sdk",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@anthropic-ai/sdk": "^0.71.2",
44
- "@locusai/shared": "^0.4.2",
44
+ "@locusai/shared": "^0.4.4",
45
45
  "axios": "^1.13.2",
46
46
  "events": "^3.3.0",
47
47
  "globby": "^14.0.2"
@@ -19,6 +19,8 @@ export class ClaudeRunner {
19
19
  const claude = spawn("claude", args, {
20
20
  cwd: this.projectPath,
21
21
  stdio: ["pipe", "pipe", "pipe"],
22
+ env: process.env,
23
+ shell: true,
22
24
  });
23
25
 
24
26
  let output = "";
@@ -34,14 +36,18 @@ export class ClaudeRunner {
34
36
  });
35
37
 
36
38
  claude.on("error", (err) =>
37
- reject(new Error(`Failed to start Claude CLI: ${err.message}`))
39
+ reject(
40
+ new Error(
41
+ `Failed to start Claude CLI (shell: true): ${err.message}. Please ensure the 'claude' command is available in your PATH.`
42
+ )
43
+ )
38
44
  );
39
45
  claude.on("close", (code) => {
40
46
  if (code === 0) resolve(output);
41
47
  else {
42
48
  const detail = errorOutput.trim();
43
49
  const message = detail
44
- ? `Claude CLI error: ${detail}`
50
+ ? `Claude CLI error (exit code ${code}): ${detail}`
45
51
  : `Claude CLI exited with code ${code}. Please ensure the Claude CLI is installed and you are logged in (run 'claude' manually to check).`;
46
52
  reject(new Error(message));
47
53
  }
@@ -32,10 +32,30 @@ export class CodebaseIndexer {
32
32
  if (onProgress) onProgress("Generating file tree...");
33
33
 
34
34
  // 1. Get a comprehensive but clean file tree
35
+ const gitmodulesPath = join(this.projectPath, ".gitmodules");
36
+ const submoduleIgnores: string[] = [];
37
+ if (existsSync(gitmodulesPath)) {
38
+ try {
39
+ const content = readFileSync(gitmodulesPath, "utf-8");
40
+ const lines = content.split("\n");
41
+ for (const line of lines) {
42
+ const match = line.match(/^\s*path\s*=\s*(.*)$/);
43
+ const path = match?.[1]?.trim();
44
+ if (path) {
45
+ submoduleIgnores.push(`${path}/**`);
46
+ submoduleIgnores.push(`**/${path}/**`);
47
+ }
48
+ }
49
+ } catch {
50
+ // Fallback if .gitmodules exists but can't be read or parsed
51
+ }
52
+ }
53
+
35
54
  const files = await globby(["**/*"], {
36
55
  cwd: this.projectPath,
37
56
  gitignore: true,
38
57
  ignore: [
58
+ ...submoduleIgnores,
39
59
  "**/node_modules/**",
40
60
  "**/dist/**",
41
61
  "**/build/**",