@proxysoul/soulforge 1.6.2 → 1.6.3

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/index.js CHANGED
@@ -57814,7 +57814,7 @@ var package_default;
57814
57814
  var init_package = __esm(() => {
57815
57815
  package_default = {
57816
57816
  name: "@proxysoul/soulforge",
57817
- version: "1.6.2",
57817
+ version: "1.6.3",
57818
57818
  description: "Graph-powered code intelligence \u2014 multi-agent coding with codebase-aware AI",
57819
57819
  repository: {
57820
57820
  type: "git",
@@ -313815,7 +313815,8 @@ class RepoMap {
313815
313815
  }
313816
313816
  const pairCounts = new Map;
313817
313817
  const commits = logOutput.split("---COMMIT---").filter((s) => s.trim());
313818
- for (const commit of commits) {
313818
+ for (let ci = 0;ci < commits.length; ci++) {
313819
+ const commit = commits[ci];
313819
313820
  const files = commit.split(`
313820
313821
  `).map((l) => l.trim()).filter((l) => l && pathToId.has(l));
313821
313822
  if (files.length < 2 || files.length > MAX_COCHANGE_FILES_PER_COMMIT)
@@ -313828,23 +313829,31 @@ class RepoMap {
313828
313829
  pairCounts.set(key, (pairCounts.get(key) ?? 0) + 1);
313829
313830
  }
313830
313831
  }
313832
+ if (ci % 50 === 0)
313833
+ this.onProgress?.(-5, -5);
313831
313834
  }
313832
313835
  if (pairCounts.size === 0)
313833
313836
  return;
313837
+ this.onProgress?.(-5, -5);
313834
313838
  const insert = this.db.prepare("INSERT OR REPLACE INTO cochanges (file_id_a, file_id_b, count) VALUES (?, ?, ?)");
313835
- const tx = this.db.transaction(() => {
313836
- for (const [key, count] of pairCounts) {
313837
- if (count < 2)
313838
- continue;
313839
- const [a, b] = key.split("\x00");
313840
- const idA = pathToId.get(a);
313841
- const idB = pathToId.get(b);
313842
- if (idA !== undefined && idB !== undefined) {
313843
- insert.run(idA, idB, count);
313839
+ const BATCH = 5000;
313840
+ const entries = [...pairCounts.entries()].filter(([, count]) => count >= 2);
313841
+ for (let i2 = 0;i2 < entries.length; i2 += BATCH) {
313842
+ const batch = entries.slice(i2, i2 + BATCH);
313843
+ const tx = this.db.transaction(() => {
313844
+ for (const [key, count] of batch) {
313845
+ const [a, b] = key.split("\x00");
313846
+ const idA = pathToId.get(a);
313847
+ const idB = pathToId.get(b);
313848
+ if (idA !== undefined && idB !== undefined) {
313849
+ insert.run(idA, idB, count);
313850
+ }
313844
313851
  }
313845
- }
313846
- });
313847
- tx();
313852
+ });
313853
+ tx();
313854
+ if (i2 % 1e4 === 0)
313855
+ this.onProgress?.(-5, -5);
313856
+ }
313848
313857
  }
313849
313858
  getCoChangePartners(fileIds) {
313850
313859
  if (fileIds.size === 0)
@@ -25544,7 +25544,8 @@ class RepoMap {
25544
25544
  }
25545
25545
  const pairCounts = new Map;
25546
25546
  const commits = logOutput.split("---COMMIT---").filter((s2) => s2.trim());
25547
- for (const commit of commits) {
25547
+ for (let ci = 0;ci < commits.length; ci++) {
25548
+ const commit = commits[ci];
25548
25549
  const files = commit.split(`
25549
25550
  `).map((l3) => l3.trim()).filter((l3) => l3 && pathToId.has(l3));
25550
25551
  if (files.length < 2 || files.length > MAX_COCHANGE_FILES_PER_COMMIT)
@@ -25557,23 +25558,31 @@ class RepoMap {
25557
25558
  pairCounts.set(key2, (pairCounts.get(key2) ?? 0) + 1);
25558
25559
  }
25559
25560
  }
25561
+ if (ci % 50 === 0)
25562
+ this.onProgress?.(-5, -5);
25560
25563
  }
25561
25564
  if (pairCounts.size === 0)
25562
25565
  return;
25566
+ this.onProgress?.(-5, -5);
25563
25567
  const insert = this.db.prepare("INSERT OR REPLACE INTO cochanges (file_id_a, file_id_b, count) VALUES (?, ?, ?)");
25564
- const tx = this.db.transaction(() => {
25565
- for (const [key2, count] of pairCounts) {
25566
- if (count < 2)
25567
- continue;
25568
- const [a2, b3] = key2.split("\x00");
25569
- const idA = pathToId.get(a2);
25570
- const idB = pathToId.get(b3);
25571
- if (idA !== undefined && idB !== undefined) {
25572
- insert.run(idA, idB, count);
25568
+ const BATCH = 5000;
25569
+ const entries = [...pairCounts.entries()].filter(([, count]) => count >= 2);
25570
+ for (let i4 = 0;i4 < entries.length; i4 += BATCH) {
25571
+ const batch = entries.slice(i4, i4 + BATCH);
25572
+ const tx = this.db.transaction(() => {
25573
+ for (const [key2, count] of batch) {
25574
+ const [a2, b3] = key2.split("\x00");
25575
+ const idA = pathToId.get(a2);
25576
+ const idB = pathToId.get(b3);
25577
+ if (idA !== undefined && idB !== undefined) {
25578
+ insert.run(idA, idB, count);
25579
+ }
25573
25580
  }
25574
- }
25575
- });
25576
- tx();
25581
+ });
25582
+ tx();
25583
+ if (i4 % 1e4 === 0)
25584
+ this.onProgress?.(-5, -5);
25585
+ }
25577
25586
  }
25578
25587
  getCoChangePartners(fileIds) {
25579
25588
  if (fileIds.size === 0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proxysoul/soulforge",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "Graph-powered code intelligence — multi-agent coding with codebase-aware AI",
5
5
  "repository": {
6
6
  "type": "git",