bambu-printer-mcp 1.1.34 → 1.1.35

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 CHANGED
@@ -326,7 +326,7 @@ Bambu Lab printers do not use a conventional REST API. Instead, they expose two
326
326
 
327
327
  ### What this fork fixes
328
328
 
329
- This package works around two protocol-level issues in the underlying `bambu-js` library.
329
+ This package works around two protocol-level issues in the `bambu-js` library it previously used, and no longer depends on `bambu-js` at all: file transfers and listings use `basic-ftp` directly, and printer commands use `bambu-node`.
330
330
 
331
331
  **Bug 1: FTP double-path error in bambu-js.**
332
332
 
@@ -113,10 +113,6 @@ export declare class BambuImplementation {
113
113
  files: string[];
114
114
  directories: Record<string, string[]>;
115
115
  }>;
116
- getFile(host: string, serial: string, token: string, filename: string): Promise<{
117
- name: string;
118
- exists: boolean;
119
- }>;
120
116
  uploadFile(host: string, serial: string, token: string, filePath: string, filename: string, print: boolean, bambuModel?: string, upload?: (snapshot: string, destination: string, assertActive: () => void) => Promise<void>): Promise<{
121
117
  status: string;
122
118
  uploaded: boolean;
@@ -12,7 +12,6 @@ import { bridgeAmsMapping2Entry, bridgeAmsMappingValue, externalTrayForNozzle, d
12
12
  import { describeHmsKey, hiddenHmsKeys, hiddenHmsNotices, reportedHmsKey, unchippedNozzles, validatePrinterState, manualHeatingRequirements } from "../safety/printer-state.js";
13
13
  import { withPrinterOperation, withPrintSnapshot, uniquePrintName, normalizedRemotePath, cancelPendingPrinterOperations } from "../safety/artifact.js";
14
14
  import { Client as FTPClient } from "basic-ftp";
15
- import { BambuPrinter } from "bambu-js";
16
15
  import * as mqtt from "mqtt";
17
16
  import { BambuClient, GCodeFileCommand, GCodeLineCommand, PushAllCommand, UpdateFanCommand, UpdateLightCommand, UpdateStateCommand, } from "bambu-node";
18
17
  /**
@@ -1256,21 +1255,6 @@ export class BambuImplementation {
1256
1255
  directories: filesByDirectory,
1257
1256
  };
1258
1257
  }
1259
- async getFile(host, serial, token, filename) {
1260
- const printer = new BambuPrinter(host, serial, token);
1261
- const normalized = filename.replace(/^\/+/, "");
1262
- const directory = path.posix.dirname(normalized) === "." ? "cache" : path.posix.dirname(normalized);
1263
- const baseName = path.posix.basename(normalized);
1264
- let exists = false;
1265
- await printer.manipulateFiles(async (context) => {
1266
- const entries = await context.readDir(directory);
1267
- exists = entries.includes(baseName);
1268
- });
1269
- return {
1270
- name: `${directory}/${baseName}`,
1271
- exists,
1272
- };
1273
- }
1274
1258
  async uploadFile(host, serial, token, filePath, filename, print, bambuModel, upload) {
1275
1259
  const remotePath = normalizedRemotePath(filename);
1276
1260
  if (!print) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bambu-printer-mcp",
3
- "version": "1.1.34",
3
+ "version": "1.1.35",
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": {
@@ -49,7 +49,6 @@
49
49
  "license": "GPL-2.0",
50
50
  "dependencies": {
51
51
  "@modelcontextprotocol/sdk": "^1.32.1",
52
- "bambu-js": "^2.2.2",
53
52
  "bambu-node": "3.22.21",
54
53
  "basic-ftp": "^6.2.3",
55
54
  "dotenv": "^16.3.1",
@@ -12,7 +12,6 @@ import { bridgeAmsMapping2Entry, bridgeAmsMappingValue, externalTrayForNozzle, d
12
12
  import { describeHmsKey, hiddenHmsKeys, hiddenHmsNotices, reportedHmsKey, unchippedNozzles, validatePrinterState, manualHeatingRequirements, type PrinterStateRequirements } from "../safety/printer-state.js";
13
13
  import { withPrinterOperation, withPrintSnapshot, uniquePrintName, normalizedRemotePath, cancelPendingPrinterOperations } from "../safety/artifact.js";
14
14
  import { Client as FTPClient } from "basic-ftp";
15
- import { BambuPrinter } from "bambu-js";
16
15
  import * as mqtt from "mqtt";
17
16
  import {
18
17
  BambuClient,
@@ -1453,26 +1452,6 @@ export class BambuImplementation {
1453
1452
  };
1454
1453
  }
1455
1454
 
1456
- async getFile(host: string, serial: string, token: string, filename: string) {
1457
- const printer = new BambuPrinter(host, serial, token);
1458
-
1459
- const normalized = filename.replace(/^\/+/, "");
1460
- const directory = path.posix.dirname(normalized) === "." ? "cache" : path.posix.dirname(normalized);
1461
- const baseName = path.posix.basename(normalized);
1462
-
1463
- let exists = false;
1464
-
1465
- await printer.manipulateFiles(async (context) => {
1466
- const entries = await context.readDir(directory);
1467
- exists = entries.includes(baseName);
1468
- });
1469
-
1470
- return {
1471
- name: `${directory}/${baseName}`,
1472
- exists,
1473
- };
1474
- }
1475
-
1476
1455
  async uploadFile(
1477
1456
  host: string, serial: string, token: string, filePath: string,
1478
1457
  filename: string, print: boolean, bambuModel?: string,