mcp-3d-printer-server 1.2.24 → 1.2.26

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 (96) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/CONTRIBUTORS.md +5 -1
  3. package/README.md +64 -29
  4. package/dist/ams-mapping.d.ts +38 -0
  5. package/dist/ams-mapping.js +125 -0
  6. package/dist/bambu-network-bridge.d.ts +200 -0
  7. package/dist/bambu-network-bridge.js +881 -0
  8. package/dist/bambu-network-certs.d.ts +13 -0
  9. package/dist/bambu-network-certs.js +152 -0
  10. package/dist/control-reply.d.ts +21 -0
  11. package/dist/control-reply.js +44 -0
  12. package/dist/counterpart/camera-sources.d.ts +16 -0
  13. package/dist/counterpart/camera-sources.js +138 -0
  14. package/dist/counterpart/camera-stream.d.ts +66 -0
  15. package/dist/counterpart/camera-stream.js +246 -0
  16. package/dist/counterpart/camera-tools.d.ts +247 -0
  17. package/dist/counterpart/camera-tools.js +35 -0
  18. package/dist/counterpart/contract.d.ts +21 -5
  19. package/dist/counterpart/contract.js +8 -2
  20. package/dist/counterpart/route.d.ts +31 -0
  21. package/dist/counterpart/route.js +70 -0
  22. package/dist/counterpart/service.d.ts +60 -4
  23. package/dist/counterpart/service.js +142 -16
  24. package/dist/design-guidance.d.ts +26 -0
  25. package/dist/design-guidance.js +177 -0
  26. package/dist/fulu-orca.d.ts +7 -0
  27. package/dist/fulu-orca.js +18 -2
  28. package/dist/index.js +528 -72
  29. package/dist/printers/bambu-filaments.d.ts +68 -0
  30. package/dist/printers/bambu-filaments.js +262 -0
  31. package/dist/printers/bambu.d.ts +99 -6
  32. package/dist/printers/bambu.js +478 -72
  33. package/dist/printers/creality.d.ts +2 -1
  34. package/dist/printers/creality.js +5 -1
  35. package/dist/printers/generic-base.d.ts +11 -6
  36. package/dist/printers/generic-base.js +21 -25
  37. package/dist/printers/klipper.d.ts +2 -1
  38. package/dist/printers/klipper.js +10 -7
  39. package/dist/printers/octoprint.d.ts +2 -1
  40. package/dist/printers/octoprint.js +15 -8
  41. package/dist/printers/printer-factory.d.ts +1 -1
  42. package/dist/printers/printer-factory.js +3 -3
  43. package/dist/printers/prusa.js +0 -1
  44. package/dist/safety/confirmation.d.ts +11 -16
  45. package/dist/safety/confirmation.js +8 -32
  46. package/dist/safety/hidden-hms.d.ts +32 -0
  47. package/dist/safety/hidden-hms.js +405 -0
  48. package/dist/safety/limits.d.ts +8 -2
  49. package/dist/safety/limits.js +14 -5
  50. package/dist/safety/print-file.d.ts +5 -0
  51. package/dist/safety/print-file.js +156 -19
  52. package/dist/safety/printer-state.d.ts +59 -8
  53. package/dist/safety/printer-state.js +174 -39
  54. package/dist/slicer/bambu-cli.d.ts +6 -2
  55. package/dist/slicer/bambu-cli.js +19 -12
  56. package/dist/slicer/layer-pauses.d.ts +47 -0
  57. package/dist/slicer/layer-pauses.js +130 -0
  58. package/dist/slicer/slicer-error.d.ts +11 -1
  59. package/dist/slicer/slicer-error.js +16 -2
  60. package/dist/stl/stl-manipulator.d.ts +27 -1
  61. package/dist/stl/stl-manipulator.js +216 -76
  62. package/dist/studio-print-options.d.ts +57 -0
  63. package/dist/studio-print-options.js +179 -0
  64. package/package.json +25 -4
  65. package/server.json +2 -2
  66. package/src/ams-mapping.ts +132 -0
  67. package/src/bambu-network-bridge.ts +1075 -0
  68. package/src/bambu-network-certs.ts +154 -0
  69. package/src/control-reply.ts +41 -0
  70. package/src/counterpart/camera-sources.ts +102 -0
  71. package/src/counterpart/camera-stream.ts +195 -0
  72. package/src/counterpart/camera-tools.ts +35 -0
  73. package/src/counterpart/contract.ts +12 -4
  74. package/src/counterpart/route.ts +82 -0
  75. package/src/counterpart/service.ts +150 -16
  76. package/src/design-guidance.ts +188 -0
  77. package/src/fulu-orca.ts +18 -2
  78. package/src/index.ts +546 -87
  79. package/src/printers/bambu-filaments.ts +346 -0
  80. package/src/printers/bambu.ts +506 -81
  81. package/src/printers/creality.ts +8 -3
  82. package/src/printers/generic-base.ts +33 -40
  83. package/src/printers/klipper.ts +12 -8
  84. package/src/printers/octoprint.ts +16 -9
  85. package/src/printers/printer-factory.ts +3 -3
  86. package/src/printers/prusa.ts +0 -1
  87. package/src/safety/confirmation.ts +15 -38
  88. package/src/safety/hidden-hms.ts +406 -0
  89. package/src/safety/limits.ts +15 -5
  90. package/src/safety/print-file.ts +139 -17
  91. package/src/safety/printer-state.ts +179 -40
  92. package/src/slicer/bambu-cli.ts +22 -13
  93. package/src/slicer/layer-pauses.ts +143 -0
  94. package/src/slicer/slicer-error.ts +21 -2
  95. package/src/stl/stl-manipulator.ts +254 -84
  96. package/src/studio-print-options.ts +201 -0
@@ -0,0 +1,406 @@
1
+ // GENERATED by scripts/generate-hidden-hms.mjs from Bambu Studio v02.08.02.61
2
+ // (commit 926a7192574bcb9b3a732e1ec59a46d79cb45466, resources/hms/hms_en_<serial prefix>.json).
3
+ // Codes Bambu lists for a serial prefix with empty text in every entry. Do not edit by hand.
4
+ export const HIDDEN_HMS_SOURCE = {
5
+ studioTag: "v02.08.02.61",
6
+ studioCommit: "926a7192574bcb9b3a732e1ec59a46d79cb45466",
7
+ /** Per table: Bambu's device_hms version and the SHA-256 of the English file used. */
8
+ tables: {
9
+ "093": { version: 202508191204, sha256: "7801fd6c355854b62ecb62ee32727b4e5dcca908841dbcfd5e5de45b3dfd1c25" },
10
+ "094": { version: 202503231214, sha256: "047c15e2140738ec08258b74536e6cb996cddf0c586c5c39e2318e54125a9e76" },
11
+ "20P": { version: 202511162200, sha256: "e4f067d027b9bcbb9bbf6cb90f41f11130cf4d83dffd3dee101db7826dc808c3" },
12
+ "22E": { version: 202510142200, sha256: "87426021aea2bd4e8d721e46e1c86808fd7c6fc06f52baf6d952ead9e8d14d1e" },
13
+ "239": { version: 202506171403, sha256: "c1d23d5302756d57df5cb9bc795d95fc54ef1db7565dca1f04b69a024886426a" },
14
+ "31B": { version: 202511162200, sha256: "dcf63657bff5451f0715ea3c032efe482279bc8cbc28cb9b8ae51c7354826574" },
15
+ },
16
+ } as const;
17
+
18
+ export const HIDDEN_HMS: Readonly<Record<string, readonly string[]>> = {
19
+ "093": [
20
+ "0300180000000000",
21
+ "050001000001000A",
22
+ "0500010000020003",
23
+ "0500010000020008",
24
+ "0500010000020009",
25
+ "0500010000030009",
26
+ "0500030000010053",
27
+ "0500030000020010",
28
+ "0500030000020011",
29
+ "0500030000020012",
30
+ "0500030000020013",
31
+ "0500030000020014",
32
+ "0500030000020015",
33
+ "0500030000020016",
34
+ "0500030000020017",
35
+ "0500030000020018",
36
+ "0500030000030007",
37
+ "0500040000020020",
38
+ "0500050000010008",
39
+ "0500050000010009",
40
+ "050005000001000A",
41
+ "050005000001000B",
42
+ "050005000001000C",
43
+ "0500050000020030",
44
+ "0500060000020005",
45
+ "0500060000020007",
46
+ "0500060000020008",
47
+ "0500060000020011",
48
+ "0500060000020012",
49
+ "0500060000020013",
50
+ "0500060000020014",
51
+ "0500060000020021",
52
+ "0500060000020022",
53
+ "0500060000020023",
54
+ "0500060000020024",
55
+ "0500060000020041",
56
+ "0500060000020043",
57
+ "0500060000020044",
58
+ "0500060000020051",
59
+ "0500060000020053",
60
+ "0500060000020054",
61
+ "0500060000020061",
62
+ "0500060000020062",
63
+ "05000600000200A0",
64
+ "05000600000200A1",
65
+ "0C00010000010018",
66
+ "0C0001000002000E",
67
+ "0C00010000020015",
68
+ "0C00010000020016",
69
+ "0C00010000020019",
70
+ "0C0001000002001A",
71
+ "0C0001000002001B",
72
+ "0C00040000020006",
73
+ ],
74
+ "094": [
75
+ "0300180000000000",
76
+ "0300260000000000",
77
+ "050001000001000A",
78
+ "0500010000020003",
79
+ "0500010000020008",
80
+ "0500010000020009",
81
+ "0500010000030009",
82
+ "0500030000020010",
83
+ "0500030000020011",
84
+ "0500030000020012",
85
+ "0500030000020013",
86
+ "0500030000020014",
87
+ "0500030000020015",
88
+ "0500030000020016",
89
+ "0500030000020017",
90
+ "0500030000020018",
91
+ "0500030000030007",
92
+ "0500040000020020",
93
+ "0500050000010008",
94
+ "0500050000010009",
95
+ "050005000001000A",
96
+ "050005000001000B",
97
+ "050005000001000C",
98
+ "0500060000020001",
99
+ "0500060000020002",
100
+ "0500060000020003",
101
+ "0500060000020005",
102
+ "0500060000020006",
103
+ "0500060000020007",
104
+ "0500060000020008",
105
+ "0500060000020011",
106
+ "0500060000020012",
107
+ "0500060000020013",
108
+ "0500060000020014",
109
+ "0500060000020021",
110
+ "0500060000020022",
111
+ "0500060000020023",
112
+ "0500060000020024",
113
+ "0500060000020041",
114
+ "0500060000020042",
115
+ "0500060000020043",
116
+ "0500060000020044",
117
+ "0500060000020051",
118
+ "0500060000020052",
119
+ "0500060000020053",
120
+ "0500060000020054",
121
+ "0500060000020061",
122
+ "0500060000020062",
123
+ "05000600000200A0",
124
+ "05000600000200A1",
125
+ "0C00010000020015",
126
+ "0C00010000020016",
127
+ "0C00010000020019",
128
+ "0C0001000002001A",
129
+ "0C0001000002001B",
130
+ "0C00040000020006",
131
+ ],
132
+ "20P": [
133
+ "0300180000000000",
134
+ "0300260000000000",
135
+ "050001000001000A",
136
+ "0500010000020003",
137
+ "0500010000020008",
138
+ "0500010000020009",
139
+ "050001000002000B",
140
+ "050001000002000F",
141
+ "0500010000020010",
142
+ "0500010000020011",
143
+ "0500010000030009",
144
+ "0500020000030009",
145
+ "050002000003000A",
146
+ "050002000003000B",
147
+ "050002000003000C",
148
+ "0500030000010053",
149
+ "0500030000020010",
150
+ "0500030000020011",
151
+ "0500030000020012",
152
+ "0500030000020013",
153
+ "0500030000020014",
154
+ "0500030000020015",
155
+ "0500030000020016",
156
+ "0500030000020017",
157
+ "0500030000020018",
158
+ "0500030000020019",
159
+ "0500030000020050",
160
+ "0500030000020051",
161
+ "0500030000020052",
162
+ "0500030000020053",
163
+ "0500030000020054",
164
+ "0500030000030007",
165
+ "0500040000010056",
166
+ "0500040000010060",
167
+ "0500040000010061",
168
+ "0500040000020020",
169
+ "0500050000010008",
170
+ "0500050000010009",
171
+ "050005000001000A",
172
+ "050005000001000B",
173
+ "050005000001000C",
174
+ "0500050000020023",
175
+ "0500050000020030",
176
+ "0500060000020005",
177
+ "0500060000020006",
178
+ "0500060000020007",
179
+ "0500060000020008",
180
+ "0500060000020009",
181
+ "0500060000020011",
182
+ "0500060000020012",
183
+ "0500060000020013",
184
+ "0500060000020014",
185
+ "0500060000020015",
186
+ "0500060000020021",
187
+ "0500060000020022",
188
+ "0500060000020023",
189
+ "0500060000020024",
190
+ "0500060000020025",
191
+ "0500060000020035",
192
+ "0500060000020041",
193
+ "0500060000020042",
194
+ "0500060000020044",
195
+ "0500060000020045",
196
+ "0500060000020051",
197
+ "0500060000020052",
198
+ "0500060000020054",
199
+ "0500060000020061",
200
+ "0500060000020062",
201
+ "0500060000020070",
202
+ "0500060000020071",
203
+ "05000600000200A0",
204
+ "05000600000200A1",
205
+ "0500070000020001",
206
+ "0500070000020002",
207
+ "0500070000020003",
208
+ "0500070000020101",
209
+ "0500070000020201",
210
+ "0503000000030027",
211
+ "0503000000030028",
212
+ "0503000000030029",
213
+ "0C00010000010018",
214
+ "0C0001000002000E",
215
+ "0C00010000020015",
216
+ "0C00010000020016",
217
+ "0C00010000020019",
218
+ "0C0001000002001A",
219
+ "0C0001000002001B",
220
+ "0C0003000003001A",
221
+ "0C00040000020006",
222
+ ],
223
+ "22E": [
224
+ "0300180000000000",
225
+ "050001000001000A",
226
+ "0500010000020003",
227
+ "0500010000020008",
228
+ "0500010000020009",
229
+ "0500010000030009",
230
+ "0500030000010053",
231
+ "0500030000020010",
232
+ "0500030000020011",
233
+ "0500030000020012",
234
+ "0500030000020013",
235
+ "0500030000020014",
236
+ "0500030000020015",
237
+ "0500030000020016",
238
+ "0500030000020017",
239
+ "0500030000020018",
240
+ "0500030000030007",
241
+ "0500040000010056",
242
+ "0500040000020020",
243
+ "0500050000010008",
244
+ "0500050000010009",
245
+ "050005000001000A",
246
+ "050005000001000B",
247
+ "050005000001000C",
248
+ "0500050000020030",
249
+ "0500060000020005",
250
+ "0500060000020007",
251
+ "0500060000020008",
252
+ "0500060000020011",
253
+ "0500060000020012",
254
+ "0500060000020013",
255
+ "0500060000020014",
256
+ "0500060000020021",
257
+ "0500060000020022",
258
+ "0500060000020023",
259
+ "0500060000020024",
260
+ "0500060000020044",
261
+ "0500060000020054",
262
+ "0500060000020061",
263
+ "0500060000020062",
264
+ "05000600000200A0",
265
+ "05000600000200A1",
266
+ "0500070000020001",
267
+ "0500070000020002",
268
+ "0500070000020003",
269
+ "0500070000020101",
270
+ "0500070000020201",
271
+ "0503000000030027",
272
+ "0503000000030028",
273
+ "0503000000030029",
274
+ "0C00010000010018",
275
+ "0C0001000002000E",
276
+ "0C00010000020015",
277
+ "0C00010000020016",
278
+ "0C00010000020019",
279
+ "0C0001000002001A",
280
+ "0C0001000002001B",
281
+ "0C00040000020006",
282
+ ],
283
+ "239": [
284
+ "0300180000000000",
285
+ "0300260000000000",
286
+ "0500010000020003",
287
+ "0500010000020008",
288
+ "0500010000020009",
289
+ "0500010000030009",
290
+ "0500030000020010",
291
+ "0500030000020011",
292
+ "0500030000020012",
293
+ "0500030000020013",
294
+ "0500030000020014",
295
+ "0500030000020015",
296
+ "0500030000020016",
297
+ "0500030000020017",
298
+ "0500030000020018",
299
+ "0500030000030007",
300
+ "0500040000020020",
301
+ "0500050000010008",
302
+ "0500050000010009",
303
+ "050005000001000A",
304
+ "050005000001000B",
305
+ "050005000001000C",
306
+ "0500060000020005",
307
+ "0500060000020006",
308
+ "0500060000020007",
309
+ "0500060000020008",
310
+ "0500060000020011",
311
+ "0500060000020012",
312
+ "0500060000020013",
313
+ "0500060000020014",
314
+ "0500060000020021",
315
+ "0500060000020022",
316
+ "0500060000020023",
317
+ "0500060000020024",
318
+ "0500060000020041",
319
+ "0500060000020042",
320
+ "0500060000020043",
321
+ "0500060000020044",
322
+ "0500060000020051",
323
+ "0500060000020052",
324
+ "0500060000020053",
325
+ "0500060000020054",
326
+ "0500060000020061",
327
+ "0500060000020062",
328
+ "05000600000200A0",
329
+ "05000600000200A1",
330
+ "0C00010000020015",
331
+ "0C00010000020016",
332
+ "0C00010000020019",
333
+ "0C0001000002001A",
334
+ "0C0001000002001B",
335
+ "0C00040000020006",
336
+ ],
337
+ "31B": [
338
+ "0300180000000000",
339
+ "0300260000000000",
340
+ "050001000001000A",
341
+ "0500010000020003",
342
+ "0500010000020008",
343
+ "0500010000020009",
344
+ "0500010000030009",
345
+ "0500030000010053",
346
+ "0500030000020010",
347
+ "0500030000020011",
348
+ "0500030000020012",
349
+ "0500030000020013",
350
+ "0500030000020014",
351
+ "0500030000020015",
352
+ "0500030000020016",
353
+ "0500030000020017",
354
+ "0500030000020018",
355
+ "0500030000030007",
356
+ "0500040000010056",
357
+ "0500040000020020",
358
+ "0500050000010008",
359
+ "0500050000010009",
360
+ "050005000001000A",
361
+ "050005000001000B",
362
+ "050005000001000C",
363
+ "0500050000020030",
364
+ "0500060000020005",
365
+ "0500060000020006",
366
+ "0500060000020007",
367
+ "0500060000020008",
368
+ "0500060000020011",
369
+ "0500060000020012",
370
+ "0500060000020013",
371
+ "0500060000020014",
372
+ "0500060000020021",
373
+ "0500060000020022",
374
+ "0500060000020023",
375
+ "0500060000020024",
376
+ "0500060000020041",
377
+ "0500060000020042",
378
+ "0500060000020043",
379
+ "0500060000020044",
380
+ "0500060000020051",
381
+ "0500060000020052",
382
+ "0500060000020053",
383
+ "0500060000020054",
384
+ "0500060000020061",
385
+ "0500060000020062",
386
+ "05000600000200A0",
387
+ "05000600000200A1",
388
+ "0500070000020001",
389
+ "0500070000020002",
390
+ "0500070000020003",
391
+ "0500070000020101",
392
+ "0500070000020201",
393
+ "0503000000030027",
394
+ "0503000000030028",
395
+ "0503000000030029",
396
+ "0C00010000010018",
397
+ "0C0001000002000E",
398
+ "0C00010000020015",
399
+ "0C00010000020016",
400
+ "0C00010000020019",
401
+ "0C0001000002001A",
402
+ "0C0001000002001B",
403
+ "0C0003000003001A",
404
+ "0C00040000020006",
405
+ ],
406
+ };
@@ -31,6 +31,15 @@ export const MACHINE_LIMITS: Readonly<Record<string, {nozzle: number; bed: numbe
31
31
  x2d: {nozzle:300,bed:120,chamber:65,volume:[256,256,260]},
32
32
  };
33
33
 
34
+ /** Printers with two physical nozzles. Bambu Studio numbers the right/main nozzle 0
35
+ * (MAIN_EXTRUDER_ID) and the left/deputy nozzle 1 (DEPUTY_EXTRUDER_ID), and reports one
36
+ * virtual external-spool slot per nozzle: 255 (VIRTUAL_TRAY_MAIN_ID) and 254
37
+ * (VIRTUAL_TRAY_DEPUTY_ID). The single-nozzle H2S is deliberately absent. */
38
+ export const DUAL_NOZZLE_MODELS: ReadonlySet<string> = new Set(['h2d','h2dpro','h2c','x2d']);
39
+ export function isDualNozzleModel(model: unknown): boolean {
40
+ const normalized = normalizeModel(model);
41
+ return normalized !== undefined && DUAL_NOZZLE_MODELS.has(normalized);
42
+ }
34
43
  export function normalizeModel(value: unknown): string | undefined {
35
44
  if (typeof value !== 'string') return undefined;
36
45
  let model = value.trim().toLowerCase().replace(/^bambu\s*(?:lab\s*)?/, '').replace(/[\s_-]/g, '');
@@ -50,11 +59,6 @@ const MATERIAL_LIMITS: Readonly<Record<string, number>> = {
50
59
  HIPS:300, PP:300, POM:250, PET:350, PA:350, PC:350, PPA:350, PPS:350,
51
60
  'SUPPORT-PLA':290, 'SUPPORT-PA':350,
52
61
  };
53
- /** Independent nozzle policy ceiling for a declared material, or undefined when unknown. */
54
- export function materialNozzleCeiling(value: unknown): number | undefined {
55
- const material = normalizeMaterial(value);
56
- return material ? MATERIAL_LIMITS[material] : undefined;
57
- }
58
62
  export function normalizeMaterial(value: unknown): string | undefined {
59
63
  if (typeof value !== 'string') return undefined;
60
64
  const material = value.trim().toUpperCase().replace(/^BAMBU(?: LAB)?\s+/, '').replace(/^GENERIC\s+/, '');
@@ -96,3 +100,9 @@ export function validateTemperature(component: 'nozzle'|'bed'|'chamber', value:
96
100
  export function validateStartupPurgeTemperature(value: unknown, model: string, materials: string[]): number {
97
101
  return validate('nozzle',value,model,materials,true);
98
102
  }
103
+
104
+ /** Independent nozzle policy ceiling for a declared material, or undefined when unknown. */
105
+ export function materialNozzleCeiling(value: unknown): number | undefined {
106
+ const material = normalizeMaterial(value);
107
+ return material ? MATERIAL_LIMITS[material] : undefined;
108
+ }