@proxysoul/soulforge 1.6.1 → 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.1",
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",
@@ -312725,22 +312725,26 @@ class RepoMap {
312725
312725
  this.onProgress?.(toIndex.length, toIndex.length);
312726
312726
  }
312727
312727
  if (toIndex.length > 0 || stale.length > 0) {
312728
+ this.onProgress?.(-1, -1);
312729
+ await tick();
312728
312730
  await this.resolveUnresolvedRefs();
312731
+ this.onProgress?.(-1, -1);
312729
312732
  await tick();
312730
312733
  await this.resolveIdentifierRefs();
312731
- this.onProgress?.(-1, -1);
312734
+ this.onProgress?.(-2, -2);
312732
312735
  await tick();
312733
312736
  await this.buildCallGraph();
312737
+ this.onProgress?.(-3, -3);
312734
312738
  await tick();
312735
312739
  await this.buildEdges();
312736
312740
  this.linkTestFiles();
312737
312741
  this.rescueOrphans();
312738
- this.onProgress?.(-2, -2);
312742
+ this.onProgress?.(-4, -4);
312739
312743
  await tick();
312740
312744
  await this.computePageRank();
312741
312745
  await tick();
312742
312746
  }
312743
- this.onProgress?.(-3, -3);
312747
+ this.onProgress?.(-5, -5);
312744
312748
  await tick();
312745
312749
  await this.buildCoChanges();
312746
312750
  await tick();
@@ -313253,6 +313257,8 @@ class RepoMap {
313253
313257
  }
313254
313258
  });
313255
313259
  tx();
313260
+ if (i2 % 2000 === 0)
313261
+ this.onProgress?.(-1, -1);
313256
313262
  if (i2 + BATCH < unresolvedIds.length)
313257
313263
  await tick();
313258
313264
  }
@@ -313280,6 +313286,8 @@ class RepoMap {
313280
313286
  }
313281
313287
  });
313282
313288
  tx();
313289
+ if (i2 % 1000 === 0)
313290
+ this.onProgress?.(-1, -1);
313283
313291
  if (i2 + BATCH < unresolved.length)
313284
313292
  await tick();
313285
313293
  }
@@ -313807,7 +313815,8 @@ class RepoMap {
313807
313815
  }
313808
313816
  const pairCounts = new Map;
313809
313817
  const commits = logOutput.split("---COMMIT---").filter((s) => s.trim());
313810
- for (const commit of commits) {
313818
+ for (let ci = 0;ci < commits.length; ci++) {
313819
+ const commit = commits[ci];
313811
313820
  const files = commit.split(`
313812
313821
  `).map((l) => l.trim()).filter((l) => l && pathToId.has(l));
313813
313822
  if (files.length < 2 || files.length > MAX_COCHANGE_FILES_PER_COMMIT)
@@ -313820,23 +313829,31 @@ class RepoMap {
313820
313829
  pairCounts.set(key, (pairCounts.get(key) ?? 0) + 1);
313821
313830
  }
313822
313831
  }
313832
+ if (ci % 50 === 0)
313833
+ this.onProgress?.(-5, -5);
313823
313834
  }
313824
313835
  if (pairCounts.size === 0)
313825
313836
  return;
313837
+ this.onProgress?.(-5, -5);
313826
313838
  const insert = this.db.prepare("INSERT OR REPLACE INTO cochanges (file_id_a, file_id_b, count) VALUES (?, ?, ?)");
313827
- const tx = this.db.transaction(() => {
313828
- for (const [key, count] of pairCounts) {
313829
- if (count < 2)
313830
- continue;
313831
- const [a, b] = key.split("\x00");
313832
- const idA = pathToId.get(a);
313833
- const idB = pathToId.get(b);
313834
- if (idA !== undefined && idB !== undefined) {
313835
- 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
+ }
313836
313851
  }
313837
- }
313838
- });
313839
- tx();
313852
+ });
313853
+ tx();
313854
+ if (i2 % 1e4 === 0)
313855
+ this.onProgress?.(-5, -5);
313856
+ }
313840
313857
  }
313841
313858
  getCoChangePartners(fileIds) {
313842
313859
  if (fileIds.size === 0)
@@ -314342,6 +314359,8 @@ class RepoMap {
314342
314359
  }
314343
314360
  });
314344
314361
  tx();
314362
+ if (batchStart % (BATCH_SIZE * 10) === 0)
314363
+ this.onProgress?.(-2, -2);
314345
314364
  if (batchStart + BATCH_SIZE < filesWithImports.length)
314346
314365
  await tick();
314347
314366
  }
@@ -24454,22 +24454,26 @@ class RepoMap {
24454
24454
  this.onProgress?.(toIndex.length, toIndex.length);
24455
24455
  }
24456
24456
  if (toIndex.length > 0 || stale.length > 0) {
24457
+ this.onProgress?.(-1, -1);
24458
+ await tick();
24457
24459
  await this.resolveUnresolvedRefs();
24460
+ this.onProgress?.(-1, -1);
24458
24461
  await tick();
24459
24462
  await this.resolveIdentifierRefs();
24460
- this.onProgress?.(-1, -1);
24463
+ this.onProgress?.(-2, -2);
24461
24464
  await tick();
24462
24465
  await this.buildCallGraph();
24466
+ this.onProgress?.(-3, -3);
24463
24467
  await tick();
24464
24468
  await this.buildEdges();
24465
24469
  this.linkTestFiles();
24466
24470
  this.rescueOrphans();
24467
- this.onProgress?.(-2, -2);
24471
+ this.onProgress?.(-4, -4);
24468
24472
  await tick();
24469
24473
  await this.computePageRank();
24470
24474
  await tick();
24471
24475
  }
24472
- this.onProgress?.(-3, -3);
24476
+ this.onProgress?.(-5, -5);
24473
24477
  await tick();
24474
24478
  await this.buildCoChanges();
24475
24479
  await tick();
@@ -24982,6 +24986,8 @@ class RepoMap {
24982
24986
  }
24983
24987
  });
24984
24988
  tx();
24989
+ if (i4 % 2000 === 0)
24990
+ this.onProgress?.(-1, -1);
24985
24991
  if (i4 + BATCH < unresolvedIds.length)
24986
24992
  await tick();
24987
24993
  }
@@ -25009,6 +25015,8 @@ class RepoMap {
25009
25015
  }
25010
25016
  });
25011
25017
  tx();
25018
+ if (i4 % 1000 === 0)
25019
+ this.onProgress?.(-1, -1);
25012
25020
  if (i4 + BATCH < unresolved.length)
25013
25021
  await tick();
25014
25022
  }
@@ -25536,7 +25544,8 @@ class RepoMap {
25536
25544
  }
25537
25545
  const pairCounts = new Map;
25538
25546
  const commits = logOutput.split("---COMMIT---").filter((s2) => s2.trim());
25539
- for (const commit of commits) {
25547
+ for (let ci = 0;ci < commits.length; ci++) {
25548
+ const commit = commits[ci];
25540
25549
  const files = commit.split(`
25541
25550
  `).map((l3) => l3.trim()).filter((l3) => l3 && pathToId.has(l3));
25542
25551
  if (files.length < 2 || files.length > MAX_COCHANGE_FILES_PER_COMMIT)
@@ -25549,23 +25558,31 @@ class RepoMap {
25549
25558
  pairCounts.set(key2, (pairCounts.get(key2) ?? 0) + 1);
25550
25559
  }
25551
25560
  }
25561
+ if (ci % 50 === 0)
25562
+ this.onProgress?.(-5, -5);
25552
25563
  }
25553
25564
  if (pairCounts.size === 0)
25554
25565
  return;
25566
+ this.onProgress?.(-5, -5);
25555
25567
  const insert = this.db.prepare("INSERT OR REPLACE INTO cochanges (file_id_a, file_id_b, count) VALUES (?, ?, ?)");
25556
- const tx = this.db.transaction(() => {
25557
- for (const [key2, count] of pairCounts) {
25558
- if (count < 2)
25559
- continue;
25560
- const [a2, b3] = key2.split("\x00");
25561
- const idA = pathToId.get(a2);
25562
- const idB = pathToId.get(b3);
25563
- if (idA !== undefined && idB !== undefined) {
25564
- 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
+ }
25565
25580
  }
25566
- }
25567
- });
25568
- tx();
25581
+ });
25582
+ tx();
25583
+ if (i4 % 1e4 === 0)
25584
+ this.onProgress?.(-5, -5);
25585
+ }
25569
25586
  }
25570
25587
  getCoChangePartners(fileIds) {
25571
25588
  if (fileIds.size === 0)
@@ -26071,6 +26088,8 @@ class RepoMap {
26071
26088
  }
26072
26089
  });
26073
26090
  tx();
26091
+ if (batchStart % (BATCH_SIZE * 10) === 0)
26092
+ this.onProgress?.(-2, -2);
26074
26093
  if (batchStart + BATCH_SIZE < filesWithImports.length)
26075
26094
  await tick();
26076
26095
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proxysoul/soulforge",
3
- "version": "1.6.1",
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",