@locusai/sdk 0.4.3 → 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.
- package/dist/core/indexer.d.ts.map +1 -1
- package/dist/core/indexer.js +20 -0
- package/package.json +2 -2
- package/src/core/indexer.ts +20 -0
|
@@ -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;
|
|
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"}
|
package/dist/core/indexer.js
CHANGED
|
@@ -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.
|
|
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.
|
|
44
|
+
"@locusai/shared": "^0.4.4",
|
|
45
45
|
"axios": "^1.13.2",
|
|
46
46
|
"events": "^3.3.0",
|
|
47
47
|
"globby": "^14.0.2"
|
package/src/core/indexer.ts
CHANGED
|
@@ -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/**",
|