bambu-printer-mcp 1.1.78 → 1.1.79

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.
@@ -658,6 +658,10 @@ export class BambuNetworkBridge {
658
658
  await pump();
659
659
  await new Promise(resolve => setTimeout(resolve, timing.pollMs));
660
660
  }
661
+ // A delayed wake can cross the deadline while replies are queued in the host.
662
+ // Drain once more before inspecting replies or disconnecting.
663
+ assertActive();
664
+ await pump();
661
665
  };
662
666
  const certificateReadyWithin = async (ms) => {
663
667
  const deadline = Date.now() + ms;
@@ -668,6 +672,8 @@ export class BambuNetworkBridge {
668
672
  return true;
669
673
  await new Promise(resolve => setTimeout(resolve, timing.pollMs));
670
674
  } while (Date.now() < deadline);
675
+ assertActive();
676
+ await pump();
671
677
  return certificateReady;
672
678
  };
673
679
  await this.ensureAgent(options);
@@ -853,6 +859,11 @@ export class BambuNetworkBridge {
853
859
  if (!done())
854
860
  await new Promise(resolve => setTimeout(resolve, timing.pollMs));
855
861
  }
862
+ // Read replies queued during the last sleep, even if it overshot the deadline.
863
+ if (!done()) {
864
+ assertActive();
865
+ await pump();
866
+ }
856
867
  return done();
857
868
  };
858
869
  const settle = async (ms) => { await waitFor(() => false, ms); };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bambu-printer-mcp",
3
- "version": "1.1.78",
3
+ "version": "1.1.79",
4
4
  "description": "MCP server for Bambu Lab 3D printers with STL manipulation, slicing, and print management",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -796,6 +796,10 @@ export class BambuNetworkBridge {
796
796
  await pump();
797
797
  await new Promise(resolve => setTimeout(resolve, timing.pollMs));
798
798
  }
799
+ // A delayed wake can cross the deadline while replies are queued in the host.
800
+ // Drain once more before inspecting replies or disconnecting.
801
+ assertActive();
802
+ await pump();
799
803
  };
800
804
  const certificateReadyWithin = async (ms: number) => {
801
805
  const deadline = Date.now() + ms;
@@ -805,6 +809,8 @@ export class BambuNetworkBridge {
805
809
  if (certificateReady) return true;
806
810
  await new Promise(resolve => setTimeout(resolve, timing.pollMs));
807
811
  } while (Date.now() < deadline);
812
+ assertActive();
813
+ await pump();
808
814
  return certificateReady;
809
815
  };
810
816
 
@@ -998,6 +1004,8 @@ export class BambuNetworkBridge {
998
1004
  await pump();
999
1005
  if (!done()) await new Promise(resolve => setTimeout(resolve, timing.pollMs));
1000
1006
  }
1007
+ // Read replies queued during the last sleep, even if it overshot the deadline.
1008
+ if (!done()) { assertActive(); await pump(); }
1001
1009
  return done();
1002
1010
  };
1003
1011
  const settle = async (ms: number) => { await waitFor(() => false, ms); };