bambu-printer-mcp 1.1.77 → 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.
package/CONTRIBUTORS.md CHANGED
@@ -57,3 +57,5 @@ Special thanks to [FULU Foundation](https://www.fulu.org/), [Louis Rossmann](htt
57
57
  This is community recognition, separate from code authorship in this repository. The optional FULU bridge uses Bambu's networking runtime; see the [FULU setup guide](./docs/FULU.md) for the direct LAN alternative and current validation limits.
58
58
 
59
59
  Thanks to the [MQTT.js contributors](https://github.com/mqttjs/MQTT.js/releases/tag/v5.16.1), [proxy-addr maintainers](https://github.com/jshttp/proxy-addr/releases/tag/v2.0.8), and [source-map-js maintainers](https://github.com/7rulnik/source-map-js) for the reconnect and security fixes incorporated in 1.1.31. This recognizes upstream dependency work separately from authorship in this repository.
60
+
61
+ Thanks to the [OrcaSlicer contributors](https://github.com/OrcaSlicer/OrcaSlicer/releases/tag/v2.5.0) for the published 2.5.0 source and macOS build used to reproduce and validate shared nozzle-flow metadata. This credits upstream software and contracts; it does not claim hardware verification or authorship of this repository’s fix.
@@ -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); };
@@ -334,6 +334,22 @@ export async function inspectPrintFile(filePath, options) {
334
334
  return undefined;
335
335
  if (entries.length === nozzleDiameters.length)
336
336
  return entries;
337
+ // Orca 2.5 ConfigOptionVector::get_at repeats a singleton volume type.
338
+ // Require the sliced plate's complete physical selection to corroborate
339
+ // it; project defaults alone and the nozzle_flow alias cannot fill gaps.
340
+ if (keys[0] === 'nozzle_volume_type' && dualNozzle && nozzleDiameters.length === 2 && entries.length === 1) {
341
+ const selected = (key) => consistent(metadataValues(headers, [key]), value => {
342
+ const values = normalizedEntries(value);
343
+ return values?.length === 2 ? values : undefined;
344
+ }, `selected ${key.replace(/_/g, ' ')}`);
345
+ const ids = selected('printer_extruder_id');
346
+ const variants = selected('printer_extruder_variant');
347
+ const extruders = selected('extruder_type');
348
+ if (ids.some((id, index) => id !== String(index + 1)) ||
349
+ variants.some((variant, index) => variant !== `${extruders[index]}_${entries[0]}`))
350
+ return undefined;
351
+ return [entries[0], entries[0]];
352
+ }
337
353
  if (!variantRows)
338
354
  return undefined;
339
355
  // Bambu GUI projects may store nozzle types per extruder variant, while
@@ -374,7 +390,8 @@ export async function inspectPrintFile(filePath, options) {
374
390
  return resolved;
375
391
  }, keys[0].replace(/_/g, ' ')) : undefined;
376
392
  };
377
- const nozzleFlows = nozzleMetadata(['nozzle_flow', 'nozzle_volume_type']);
393
+ const flowDeclarations = [nozzleMetadata(['nozzle_flow']), nozzleMetadata(['nozzle_volume_type'])].filter(value => value !== undefined);
394
+ const nozzleFlows = flowDeclarations.length ? consistent(flowDeclarations, normalizedEntries, 'nozzle flow') : undefined;
378
395
  const nozzleTypes = nozzleMetadata(['nozzle_type'], true);
379
396
  const materials = consistent(metadataValues(metadata, ['filament_type']), value => {
380
397
  const values = list(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bambu-printer-mcp",
3
- "version": "1.1.77",
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); };
@@ -274,6 +274,20 @@ export async function inspectPrintFile(filePath: string, options: {model:string;
274
274
  const entries=normalizedEntries(value);
275
275
  if(!entries) return undefined;
276
276
  if(entries.length===nozzleDiameters.length) return entries;
277
+ // Orca 2.5 ConfigOptionVector::get_at repeats a singleton volume type.
278
+ // Require the sliced plate's complete physical selection to corroborate
279
+ // it; project defaults alone and the nozzle_flow alias cannot fill gaps.
280
+ if(keys[0]==='nozzle_volume_type' && dualNozzle && nozzleDiameters.length===2 && entries.length===1) {
281
+ const selected=(key:string)=>consistent(metadataValues(headers,[key]),value=>{
282
+ const values=normalizedEntries(value);return values?.length===2?values:undefined;
283
+ },`selected ${key.replace(/_/g,' ')}`);
284
+ const ids=selected('printer_extruder_id');
285
+ const variants=selected('printer_extruder_variant');
286
+ const extruders=selected('extruder_type');
287
+ if(ids.some((id,index)=>id!==String(index+1)) ||
288
+ variants.some((variant,index)=>variant!==`${extruders[index]}_${entries[0]}`)) return undefined;
289
+ return [entries[0],entries[0]];
290
+ }
277
291
  if(!variantRows) return undefined;
278
292
  // Bambu GUI projects may store nozzle types per extruder variant, while
279
293
  // diameters and selected flow types are per physical extruder. Never truncate
@@ -305,7 +319,8 @@ export async function inspectPrintFile(filePath: string, options: {model:string;
305
319
  return resolved;
306
320
  },keys[0].replace(/_/g,' ')) : undefined;
307
321
  };
308
- const nozzleFlows=nozzleMetadata(['nozzle_flow','nozzle_volume_type']);
322
+ const flowDeclarations=[nozzleMetadata(['nozzle_flow']),nozzleMetadata(['nozzle_volume_type'])].filter(value=>value!==undefined);
323
+ const nozzleFlows=flowDeclarations.length?consistent(flowDeclarations,normalizedEntries,'nozzle flow'):undefined;
309
324
  const nozzleTypes=nozzleMetadata(['nozzle_type'],true);
310
325
  const materials=consistent(metadataValues(metadata,['filament_type']),value=>{
311
326
  const values=list(value);return values.length && values.every(v=>!!normalizeMaterial(v))?values.map(v=>normalizeMaterial(v)!):undefined;