promptgraph-mcp 2.8.1 → 2.8.2

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/github-import.js +16 -9
  2. package/package.json +1 -1
package/github-import.js CHANGED
@@ -675,18 +675,25 @@ export async function importFromGitHubLight(repoUrl) {
675
675
  if (fs.existsSync(destBase)) fs.rmSync(destBase, { recursive: true, force: true });
676
676
  fs.mkdirSync(destBase, { recursive: true });
677
677
 
678
+ const CONCURRENT = 5;
679
+ let dlIdx = 0;
678
680
  let downloaded = 0;
679
- for (const file of mdFiles) {
680
- const destPath = path.join(destBase, file.fullPath);
681
- fs.mkdirSync(path.dirname(destPath), { recursive: true });
682
- try {
683
- const content = await streamDownload(file.download_url);
684
- fs.writeFileSync(destPath, content);
685
- downloaded++;
686
- } catch {
687
- // skip failed downloads
681
+ const dlErr = [];
682
+ async function dlWorker() {
683
+ while (dlIdx < mdFiles.length) {
684
+ const file = mdFiles[dlIdx++];
685
+ const destPath = path.join(destBase, file.fullPath);
686
+ fs.mkdirSync(path.dirname(destPath), { recursive: true });
687
+ try {
688
+ const content = await streamDownload(file.download_url);
689
+ fs.writeFileSync(destPath, content);
690
+ downloaded++;
691
+ } catch (e) {
692
+ dlErr.push(e.message?.slice(0, 80) || 'download failed');
693
+ }
688
694
  }
689
695
  }
696
+ await Promise.all(Array.from({ length: Math.min(CONCURRENT, mdFiles.length) }, () => dlWorker()));
690
697
 
691
698
  if (downloaded === 0) {
692
699
  fs.rmSync(destBase, { recursive: true, force: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptgraph-mcp",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
4
4
  "files": [
5
5
  "*.js",
6
6
  "commands/",