mcp-3d-printer-server 1.0.1 → 1.0.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/README.md +5 -1
- package/dist/index.js +0 -0
- package/dist/printers/bambu.d.ts +12 -15
- package/dist/printers/bambu.js +193 -236
- package/dist/printers/printer-factory.d.ts +0 -1
- package/dist/printers/printer-factory.js +6 -4
- package/dist/types.d.ts +0 -6
- package/dist/types.js +0 -20
- package/package.json +4 -2
- package/src/printers/bambu.ts +211 -286
- package/src/printers/printer-factory.ts +7 -4
- package/src/types.ts +0 -19
package/src/types.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
|
-
import { BambuPrinter } from "bambu-js";
|
|
3
2
|
|
|
4
3
|
// Define shared types for the printer implementations
|
|
5
4
|
export type BambuFTP = {
|
|
@@ -25,25 +24,7 @@ export abstract class PrinterImplementation {
|
|
|
25
24
|
abstract setTemperature(host: string, port: string, apiKey: string, component: string, temperature: number): Promise<any>;
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
// Store for Bambu printers
|
|
29
|
-
export class BambuPrinterStore {
|
|
30
|
-
private printers: Map<string, InstanceType<typeof BambuPrinter>> = new Map();
|
|
31
27
|
|
|
32
|
-
get(host: string, serial: string, token: string): InstanceType<typeof BambuPrinter> {
|
|
33
|
-
const key = `${host}-${serial}`;
|
|
34
|
-
if (!this.printers.has(key)) {
|
|
35
|
-
const printer = new BambuPrinter(host, serial, token);
|
|
36
|
-
this.printers.set(key, printer);
|
|
37
|
-
}
|
|
38
|
-
return this.printers.get(key)!;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
async disconnectAll(): Promise<void> {
|
|
42
|
-
for (const printer of this.printers.values()) {
|
|
43
|
-
await printer.disconnect();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
28
|
|
|
48
29
|
export interface SectionBounds {
|
|
49
30
|
minX: number; minY: number; minZ: number;
|