bambu-printer-mcp 1.1.47 → 1.1.48
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 +116 -2
- package/dist/blender-mcp-bridge.d.ts +15 -0
- package/dist/blender-mcp-bridge.js +21 -3
- package/dist/counterpart/info.d.ts +10 -0
- package/dist/counterpart/info.js +34 -0
- package/dist/counterpart/make-3mf.d.ts +16 -0
- package/dist/counterpart/make-3mf.js +219 -0
- package/dist/counterpart/progress.d.ts +28 -0
- package/dist/counterpart/progress.js +254 -0
- package/dist/counterpart/schemas.d.ts +322 -0
- package/dist/counterpart/schemas.js +124 -0
- package/dist/fusion-mcp-bridge.d.ts +182 -0
- package/dist/fusion-mcp-bridge.js +557 -0
- package/dist/index.js +192 -12
- package/dist/printers/bambu-stages.d.ts +7 -0
- package/dist/printers/bambu-stages.js +89 -0
- package/dist/printers/bambu.d.ts +76 -4
- package/dist/printers/bambu.js +297 -37
- package/dist/printers/camera-models.d.ts +7 -0
- package/dist/printers/camera-models.js +18 -0
- package/dist/safety/hms-messages.d.ts +42 -0
- package/dist/safety/hms-messages.js +6194 -0
- package/dist/safety/printer-state.d.ts +18 -0
- package/dist/safety/printer-state.js +3 -3
- package/dist/slicer/process-overrides.d.ts +12 -0
- package/dist/slicer/process-overrides.js +33 -0
- package/dist/slicer/remote-slicer.js +2 -0
- package/dist/stl/stl-manipulator.d.ts +2 -0
- package/dist/stl/stl-manipulator.js +19 -0
- package/package.json +1 -1
- package/src/blender-mcp-bridge.ts +22 -3
- package/src/counterpart/info.ts +36 -0
- package/src/counterpart/make-3mf.ts +220 -0
- package/src/counterpart/progress.ts +254 -0
- package/src/counterpart/schemas.ts +154 -0
- package/src/fusion-mcp-bridge.ts +545 -0
- package/src/index.ts +199 -12
- package/src/printers/bambu-stages.ts +90 -0
- package/src/printers/bambu.ts +315 -37
- package/src/printers/camera-models.ts +18 -0
- package/src/safety/hms-messages.ts +6198 -0
- package/src/safety/printer-state.ts +4 -4
- package/src/slicer/process-overrides.ts +42 -0
- package/src/slicer/remote-slicer.ts +2 -0
- package/src/stl/stl-manipulator.ts +22 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* counterpart_print_progress for Bambu printers: maps one merged MQTT report
|
|
3
|
+
* to the counterpart/1 result (PRD §8.4, Bambu row). Pure, so tests and the
|
|
4
|
+
* tool share it. Display data only: never a safety decision.
|
|
5
|
+
*/
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { BAMBU_STAGES } from "../printers/bambu-stages.js";
|
|
8
|
+
import { HMS_MESSAGES, HMS_MESSAGES_SOURCE, PRINT_ERROR_MESSAGES } from "../safety/hms-messages.js";
|
|
9
|
+
import { isDualNozzleModel, normalizeModel } from "../safety/limits.js";
|
|
10
|
+
import { finiteNumber, hmsCode, isHiddenNotice } from "../safety/printer-state.js";
|
|
11
|
+
import { COUNTERPART_CONTRACT } from "./schemas.js";
|
|
12
|
+
/** print_error / fail_reason 0300400C: "The task was canceled." in every bundled Bambu Studio table. */
|
|
13
|
+
export const TASK_CANCELLED = 0x0300400c;
|
|
14
|
+
/** Models whose chamber_temper is a real sensor; P1/A1 report a constant. H2-class models use the CTC value. */
|
|
15
|
+
const CHAMBER_SENSOR_MODELS = new Set(["x1", "x1c", "x1e"]);
|
|
16
|
+
/** Bambu Studio DevHMS.h HMSMessageLevel: 1 fatal, 2 serious, 3 common, 4 info. */
|
|
17
|
+
const HMS_SEVERITIES = { 1: "fatal", 2: "error", 3: "warning", 4: "info" };
|
|
18
|
+
const STATES = {
|
|
19
|
+
IDLE: "idle", PREPARE: "preparing", SLICING: "preparing", RUNNING: "printing",
|
|
20
|
+
PAUSE: "paused", FINISH: "finished", FAILED: "failed",
|
|
21
|
+
};
|
|
22
|
+
function text(value) {
|
|
23
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
24
|
+
}
|
|
25
|
+
/** Bambu reports a user cancel as FAILED with 0300400C in print_error, or (X2D) in fail_reason. */
|
|
26
|
+
export function isCancelledReport(raw) {
|
|
27
|
+
return raw.gcode_state === "FAILED" &&
|
|
28
|
+
(finiteNumber(raw.print_error) === TASK_CANCELLED || finiteNumber(raw.fail_reason) === TASK_CANCELLED);
|
|
29
|
+
}
|
|
30
|
+
/** gcode_state → counterpart/1 state. A connected printer with no or an unknown gcode_state is busy. */
|
|
31
|
+
export function bambuState(raw) {
|
|
32
|
+
if (isCancelledReport(raw))
|
|
33
|
+
return "cancelled";
|
|
34
|
+
const state = typeof raw.gcode_state === "string" ? STATES[raw.gcode_state.toUpperCase()] : undefined;
|
|
35
|
+
return state ?? "busy";
|
|
36
|
+
}
|
|
37
|
+
/** 16 hex digits (attr then code) as Bambu writes them: AAAA_BBBB_CCCC_DDDD. */
|
|
38
|
+
export function formatHmsCode(hex) {
|
|
39
|
+
return `${hex.slice(0, 4)}_${hex.slice(4, 8)}_${hex.slice(8, 12)}_${hex.slice(12, 16)}`;
|
|
40
|
+
}
|
|
41
|
+
/** Bambu's page for an HMS code, as Bambu Studio's get_hms_wiki_url builds it, without the device serial. */
|
|
42
|
+
export function hmsUrl(hex) {
|
|
43
|
+
return `https://e.bambulab.com/index.php?e=${hex}&s=device_hms&lang=en`;
|
|
44
|
+
}
|
|
45
|
+
/** The table text for this printer's serial prefix, else the text most tables use. */
|
|
46
|
+
export function tableText(table, code, serial) {
|
|
47
|
+
const entry = table[code];
|
|
48
|
+
if (entry === undefined || typeof entry === "string")
|
|
49
|
+
return entry;
|
|
50
|
+
return entry[serial.trim().toUpperCase().slice(0, 3)] ?? entry["*"];
|
|
51
|
+
}
|
|
52
|
+
/** Bambu Studio's words for stg_cur. Like MachineObject::get_curr_stage, none without a stage list. */
|
|
53
|
+
export function stageWords(raw) {
|
|
54
|
+
const stage = finiteNumber(raw.stg_cur);
|
|
55
|
+
if (stage === undefined || !Number.isInteger(stage) || stage < 0)
|
|
56
|
+
return undefined;
|
|
57
|
+
if (!Array.isArray(raw.stg) || raw.stg.length === 0)
|
|
58
|
+
return undefined;
|
|
59
|
+
return BAMBU_STAGES[stage];
|
|
60
|
+
}
|
|
61
|
+
function undocumented(code) {
|
|
62
|
+
return `Printer reported ${code}; Bambu Studio ${HMS_MESSAGES_SOURCE.studioTag} has no description for it.`;
|
|
63
|
+
}
|
|
64
|
+
/** print_error and hms[] as problems, in report order, without duplicates. */
|
|
65
|
+
export function bambuProblems(raw, serial, model) {
|
|
66
|
+
const problems = [];
|
|
67
|
+
const seen = new Set();
|
|
68
|
+
const add = (problem) => { if (!seen.has(problem.code)) {
|
|
69
|
+
seen.add(problem.code);
|
|
70
|
+
problems.push(problem);
|
|
71
|
+
} };
|
|
72
|
+
const error = finiteNumber(raw.print_error);
|
|
73
|
+
// 0300400C only records a cancel; it is the state, not a problem.
|
|
74
|
+
if (error !== undefined && Number.isInteger(error) && error > 0 && error <= 0xffffffff && error !== TASK_CANCELLED) {
|
|
75
|
+
const code = error.toString(16).padStart(8, "0").toUpperCase();
|
|
76
|
+
add({ code, severity: "error", message: tableText(PRINT_ERROR_MESSAGES, code, serial) ?? undocumented(code) });
|
|
77
|
+
}
|
|
78
|
+
for (const reported of Array.isArray(raw.hms) ? raw.hms : []) {
|
|
79
|
+
const entry = hmsCode(reported);
|
|
80
|
+
if (!entry) {
|
|
81
|
+
add({ code: "HMS_MALFORMED", severity: "error", message: "The printer reported an HMS entry that cannot be read." });
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const code = formatHmsCode(entry.hex);
|
|
85
|
+
if (isHiddenNotice(serial, model, entry)) {
|
|
86
|
+
add({ code, severity: "info", message: "Bambu lists this code for this printer without a description; the printer and Bambu Studio do not show it.", url: hmsUrl(entry.hex) });
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
add({
|
|
90
|
+
code,
|
|
91
|
+
severity: HMS_SEVERITIES[entry.severity] ?? "error",
|
|
92
|
+
message: tableText(HMS_MESSAGES, entry.hex, serial) ?? undocumented(code),
|
|
93
|
+
url: hmsUrl(entry.hex),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return problems;
|
|
97
|
+
}
|
|
98
|
+
const round1 = (value) => Math.round(value * 10) / 10;
|
|
99
|
+
function temperature(actual, target) {
|
|
100
|
+
const current = finiteNumber(actual), wanted = finiteNumber(target);
|
|
101
|
+
return current !== undefined && wanted !== undefined ? { actual: round1(current), target: round1(wanted) } : undefined;
|
|
102
|
+
}
|
|
103
|
+
function chamber(raw, model) {
|
|
104
|
+
// CTC packs the current temperature in the low 16 bits and the target in the high 16 bits.
|
|
105
|
+
const ctc = raw.device?.ctc?.info?.temp;
|
|
106
|
+
if (typeof ctc === "number" && Number.isInteger(ctc) && ctc >= 0 && ctc <= 0xffffffff)
|
|
107
|
+
return ctc & 0xffff;
|
|
108
|
+
const sensor = finiteNumber(raw.chamber_temper);
|
|
109
|
+
return CHAMBER_SENSOR_MODELS.has(normalizeModel(model) ?? "") && sensor !== undefined ? round1(sensor) : undefined;
|
|
110
|
+
}
|
|
111
|
+
function rgb(value) {
|
|
112
|
+
return typeof value === "string" && /^#?[0-9a-f]{6}([0-9a-f]{2})?$/i.test(value)
|
|
113
|
+
? `#${value.replace(/^#/, "").slice(0, 6).toUpperCase()}` : undefined;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The active extruder of a V2 report (H2D, H2C, X2D): Bambu Studio
|
|
117
|
+
* DevExtruderSystem.cpp ParseV2_0 reads its index from device.extruder.state
|
|
118
|
+
* bits 4-7 and that entry's packed temp and snow fields.
|
|
119
|
+
*/
|
|
120
|
+
function activeExtruder(raw) {
|
|
121
|
+
const extruder = raw.device?.extruder;
|
|
122
|
+
const state = finiteNumber(extruder?.state);
|
|
123
|
+
if (!Array.isArray(extruder?.info) || state === undefined || !Number.isInteger(state) || state < 0)
|
|
124
|
+
return undefined;
|
|
125
|
+
const current = (state >> 4) & 0xf;
|
|
126
|
+
return extruder.info.find((entry) => finiteNumber(entry?.id) === current);
|
|
127
|
+
}
|
|
128
|
+
function packed(value) {
|
|
129
|
+
const number = finiteNumber(value);
|
|
130
|
+
return number !== undefined && Number.isInteger(number) && number >= 0 && number <= 0xffffffff ? number : undefined;
|
|
131
|
+
}
|
|
132
|
+
/** V2 reports pack the active nozzle's current temperature in the low 16 bits and its target in the high 16. */
|
|
133
|
+
function nozzleTemperature(raw) {
|
|
134
|
+
const temp = packed(activeExtruder(raw)?.temp);
|
|
135
|
+
if (temp !== undefined)
|
|
136
|
+
return { actual: temp & 0xffff, target: temp >>> 16 };
|
|
137
|
+
return temperature(raw.nozzle_temper, raw.nozzle_target_temper);
|
|
138
|
+
}
|
|
139
|
+
function amsTray(raw, amsId, slotId) {
|
|
140
|
+
const units = Array.isArray(raw.ams?.ams) ? raw.ams.ams : [];
|
|
141
|
+
const unit = units.find((candidate, index) => (finiteNumber(candidate?.id) ?? index) === amsId);
|
|
142
|
+
const trays = Array.isArray(unit?.tray) ? unit.tray : [];
|
|
143
|
+
return trays.find((candidate, index) => (finiteNumber(candidate?.id) ?? index) === slotId);
|
|
144
|
+
}
|
|
145
|
+
/** The external spool's report: per-nozzle vir_slot entries (254 deputy/left, 255 main/right), else legacy vt_tray. */
|
|
146
|
+
function externalTray(raw, id) {
|
|
147
|
+
if (Array.isArray(raw.vir_slot)) {
|
|
148
|
+
const slot = raw.vir_slot.find((entry) => finiteNumber(entry?.id) === id) ?? (raw.vir_slot.length === 1 ? raw.vir_slot[0] : undefined);
|
|
149
|
+
if (slot)
|
|
150
|
+
return slot;
|
|
151
|
+
}
|
|
152
|
+
return raw.vt_tray && typeof raw.vt_tray === "object" ? raw.vt_tray : undefined;
|
|
153
|
+
}
|
|
154
|
+
function described(slot, tray) {
|
|
155
|
+
const material = text(tray?.tray_type);
|
|
156
|
+
const color = material ? rgb(tray?.tray_color) : undefined;
|
|
157
|
+
return { slot, ...(material ? { material } : {}), ...(color ? { color } : {}) };
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* The loaded filament. slot is the index ams_slots uses: amsId*4+tray for an
|
|
161
|
+
* AMS, the unit id (128+) for an AMS-HT, and "ext" for a single-nozzle
|
|
162
|
+
* printer's external spool ("254"/"255" per nozzle on dual-nozzle printers).
|
|
163
|
+
*/
|
|
164
|
+
function activeFilament(raw, model) {
|
|
165
|
+
const dualNozzle = isDualNozzleModel(model);
|
|
166
|
+
const extruder = activeExtruder(raw);
|
|
167
|
+
const snow = packed(extruder?.snow);
|
|
168
|
+
if (extruder && snow !== undefined) {
|
|
169
|
+
if (snow === 0xffff)
|
|
170
|
+
return undefined;
|
|
171
|
+
const amsId = (snow >> 8) & 0xff, slotId = snow & 0xff;
|
|
172
|
+
if (amsId === 254 || amsId === 255)
|
|
173
|
+
return described(dualNozzle ? String(amsId) : "ext", externalTray(raw, amsId));
|
|
174
|
+
if (amsId >= 0x80 && amsId <= 0x87)
|
|
175
|
+
return described(String(amsId), amsTray(raw, amsId, slotId));
|
|
176
|
+
return described(String(amsId * 4 + slotId), amsTray(raw, amsId, slotId));
|
|
177
|
+
}
|
|
178
|
+
// V1 (DevExtruderSystem.cpp ParseV1_0): tray_now 255 none, 254 the external spool,
|
|
179
|
+
// 0x80-0x87 an AMS-HT unit, else amsId*4+tray.
|
|
180
|
+
const trayNow = finiteNumber(raw.ams?.tray_now);
|
|
181
|
+
if (trayNow === undefined || !Number.isInteger(trayNow) || trayNow < 0 || trayNow >= 255)
|
|
182
|
+
return undefined;
|
|
183
|
+
if (trayNow === 254)
|
|
184
|
+
return described("ext", externalTray(raw, 254));
|
|
185
|
+
if (trayNow >= 0x80 && trayNow <= 0x87) {
|
|
186
|
+
const units = Array.isArray(raw.ams?.ams) ? raw.ams.ams : [];
|
|
187
|
+
const unit = units.find(candidate => finiteNumber(candidate?.id) === trayNow);
|
|
188
|
+
const trays = Array.isArray(unit?.tray) ? unit.tray : [];
|
|
189
|
+
// An AMS-HT has one tray; Bambu Studio addresses it as tray_now & 3.
|
|
190
|
+
return described(String(trayNow), amsTray(raw, trayNow, trayNow & 0x3) ?? (trays.length === 1 ? trays[0] : undefined));
|
|
191
|
+
}
|
|
192
|
+
return described(String(trayNow), amsTray(raw, Math.floor(trayNow / 4), trayNow % 4));
|
|
193
|
+
}
|
|
194
|
+
/** A printer file path's basename (the jobName raw G-code prints return), as KAN-216 reads it. */
|
|
195
|
+
export function remoteJobName(value) {
|
|
196
|
+
const name = text(value);
|
|
197
|
+
if (!name)
|
|
198
|
+
return undefined;
|
|
199
|
+
return path.posix.basename(name.replace(/\\/g, "/").replace(/^\d+:/, "")) || undefined;
|
|
200
|
+
}
|
|
201
|
+
function job(raw, state) {
|
|
202
|
+
if (state === "idle" || state === "busy" || state === "offline")
|
|
203
|
+
return undefined;
|
|
204
|
+
// subtask_name is the project name; a raw G-code print reports only its file path.
|
|
205
|
+
const name = text(raw.subtask_name) ?? remoteJobName(raw.gcode_file);
|
|
206
|
+
if (!name)
|
|
207
|
+
return undefined;
|
|
208
|
+
const result = { name };
|
|
209
|
+
// LAN prints on P1/X1/A1 report task_id "0"; that identifies no job.
|
|
210
|
+
const taskId = typeof raw.task_id === "number" ? String(raw.task_id) : text(raw.task_id);
|
|
211
|
+
if (taskId && taskId !== "0")
|
|
212
|
+
result.id = taskId;
|
|
213
|
+
const progress = finiteNumber(raw.mc_percent);
|
|
214
|
+
if (progress !== undefined && progress >= 0 && progress <= 100)
|
|
215
|
+
result.progress = progress;
|
|
216
|
+
// mc_remaining_time is in minutes.
|
|
217
|
+
const remaining = finiteNumber(raw.mc_remaining_time);
|
|
218
|
+
if (remaining !== undefined && remaining >= 0)
|
|
219
|
+
result.remainingSec = Math.round(remaining * 60);
|
|
220
|
+
const total = finiteNumber(raw.total_layer_num), layer = finiteNumber(raw.layer_num);
|
|
221
|
+
if (total !== undefined && Number.isInteger(total) && total > 0) {
|
|
222
|
+
result.totalLayers = total;
|
|
223
|
+
if (layer !== undefined && Number.isInteger(layer) && layer >= 0)
|
|
224
|
+
result.layer = layer;
|
|
225
|
+
}
|
|
226
|
+
const stage = stageWords(raw);
|
|
227
|
+
if (stage)
|
|
228
|
+
result.stage = stage;
|
|
229
|
+
return result;
|
|
230
|
+
}
|
|
231
|
+
/** One merged MQTT report and the time it arrived → counterpart/1 progress. */
|
|
232
|
+
export function bambuProgress(raw, options) {
|
|
233
|
+
const model = options.model ?? "";
|
|
234
|
+
const state = bambuState(raw);
|
|
235
|
+
const result = { contract: COUNTERPART_CONTRACT, observedAt: new Date(options.receivedAt).toISOString(), state, problems: [] };
|
|
236
|
+
const printJob = job(raw, state);
|
|
237
|
+
if (printJob)
|
|
238
|
+
result.job = printJob;
|
|
239
|
+
const nozzle = nozzleTemperature(raw);
|
|
240
|
+
const bed = temperature(raw.bed_temper, raw.bed_target_temper);
|
|
241
|
+
const chamberTemperature = chamber(raw, model);
|
|
242
|
+
if (nozzle || bed || chamberTemperature !== undefined) {
|
|
243
|
+
result.temps = { ...(nozzle ? { nozzle } : {}), ...(bed ? { bed } : {}), ...(chamberTemperature !== undefined ? { chamber: chamberTemperature } : {}) };
|
|
244
|
+
}
|
|
245
|
+
const filament = activeFilament(raw, model);
|
|
246
|
+
if (filament)
|
|
247
|
+
result.activeFilament = filament;
|
|
248
|
+
result.problems = bambuProblems(raw, options.serial, model);
|
|
249
|
+
return result;
|
|
250
|
+
}
|
|
251
|
+
/** No report arrived: the printer is unreachable over MQTT. */
|
|
252
|
+
export function offlineProgress(observedAt) {
|
|
253
|
+
return { contract: COUNTERPART_CONTRACT, observedAt: new Date(observedAt).toISOString(), state: "offline", problems: [] };
|
|
254
|
+
}
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Counterpart tool contract (counterpart/1): output schemas shared by the
|
|
3
|
+
* tool list and the tests. mcp-3D-printer-server declares the same results.
|
|
4
|
+
* Extra properties stay allowed so either server can add fields without
|
|
5
|
+
* breaking clients that validate against an older schema.
|
|
6
|
+
*/
|
|
7
|
+
export declare const COUNTERPART_CONTRACT = "counterpart/1";
|
|
8
|
+
export declare const PRINTER_KINDS: readonly ["bambu", "octoprint", "klipper", "prusa", "duet", "repetier", "creality"];
|
|
9
|
+
export declare const PRINT_STATES: readonly ["idle", "preparing", "printing", "paused", "finished", "failed", "cancelled", "offline", "busy"];
|
|
10
|
+
export declare const PROBLEM_SEVERITIES: readonly ["fatal", "error", "warning", "info"];
|
|
11
|
+
export type PrintState = typeof PRINT_STATES[number];
|
|
12
|
+
export type ProblemSeverity = typeof PROBLEM_SEVERITIES[number];
|
|
13
|
+
export type Problem = {
|
|
14
|
+
code: string;
|
|
15
|
+
severity: ProblemSeverity;
|
|
16
|
+
message: string;
|
|
17
|
+
url?: string;
|
|
18
|
+
};
|
|
19
|
+
export type Temperature = {
|
|
20
|
+
actual: number;
|
|
21
|
+
target: number;
|
|
22
|
+
};
|
|
23
|
+
export type PrintProgress = {
|
|
24
|
+
contract: typeof COUNTERPART_CONTRACT;
|
|
25
|
+
observedAt: string;
|
|
26
|
+
state: PrintState;
|
|
27
|
+
job?: {
|
|
28
|
+
name: string;
|
|
29
|
+
id?: string;
|
|
30
|
+
progress?: number;
|
|
31
|
+
elapsedSec?: number;
|
|
32
|
+
remainingSec?: number;
|
|
33
|
+
layer?: number;
|
|
34
|
+
totalLayers?: number;
|
|
35
|
+
stage?: string;
|
|
36
|
+
};
|
|
37
|
+
temps?: {
|
|
38
|
+
nozzle?: Temperature;
|
|
39
|
+
bed?: Temperature;
|
|
40
|
+
chamber?: number;
|
|
41
|
+
};
|
|
42
|
+
activeFilament?: {
|
|
43
|
+
slot?: string;
|
|
44
|
+
material?: string;
|
|
45
|
+
color?: string;
|
|
46
|
+
};
|
|
47
|
+
problems: Problem[];
|
|
48
|
+
};
|
|
49
|
+
export type PrinterInfo = {
|
|
50
|
+
contract: typeof COUNTERPART_CONTRACT;
|
|
51
|
+
server: {
|
|
52
|
+
name: string;
|
|
53
|
+
version: string;
|
|
54
|
+
};
|
|
55
|
+
printer: {
|
|
56
|
+
kind: typeof PRINTER_KINDS[number];
|
|
57
|
+
model?: string;
|
|
58
|
+
serial?: string;
|
|
59
|
+
host: string;
|
|
60
|
+
name?: string;
|
|
61
|
+
};
|
|
62
|
+
capabilities: {
|
|
63
|
+
progress: boolean;
|
|
64
|
+
layers: boolean;
|
|
65
|
+
camera: "bambu-tcp" | "rtsp" | "http-snapshot" | "none";
|
|
66
|
+
filaments: "ams" | "single" | "none";
|
|
67
|
+
pause: boolean;
|
|
68
|
+
resume: boolean;
|
|
69
|
+
cancel: boolean;
|
|
70
|
+
print3mf: boolean;
|
|
71
|
+
gcode: boolean;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export declare const PRINTER_INFO_OUTPUT_SCHEMA: {
|
|
75
|
+
type: "object";
|
|
76
|
+
properties: {
|
|
77
|
+
contract: {
|
|
78
|
+
type: string;
|
|
79
|
+
const: string;
|
|
80
|
+
};
|
|
81
|
+
server: {
|
|
82
|
+
type: string;
|
|
83
|
+
properties: {
|
|
84
|
+
name: {
|
|
85
|
+
type: string;
|
|
86
|
+
};
|
|
87
|
+
version: {
|
|
88
|
+
type: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
required: string[];
|
|
92
|
+
};
|
|
93
|
+
printer: {
|
|
94
|
+
type: string;
|
|
95
|
+
properties: {
|
|
96
|
+
kind: {
|
|
97
|
+
type: string;
|
|
98
|
+
enum: ("bambu" | "octoprint" | "klipper" | "prusa" | "duet" | "repetier" | "creality")[];
|
|
99
|
+
};
|
|
100
|
+
model: {
|
|
101
|
+
type: string;
|
|
102
|
+
};
|
|
103
|
+
serial: {
|
|
104
|
+
type: string;
|
|
105
|
+
};
|
|
106
|
+
host: {
|
|
107
|
+
type: string;
|
|
108
|
+
};
|
|
109
|
+
name: {
|
|
110
|
+
type: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
required: string[];
|
|
114
|
+
};
|
|
115
|
+
capabilities: {
|
|
116
|
+
type: string;
|
|
117
|
+
properties: {
|
|
118
|
+
progress: {
|
|
119
|
+
type: string;
|
|
120
|
+
};
|
|
121
|
+
layers: {
|
|
122
|
+
type: string;
|
|
123
|
+
};
|
|
124
|
+
camera: {
|
|
125
|
+
type: string;
|
|
126
|
+
enum: string[];
|
|
127
|
+
};
|
|
128
|
+
filaments: {
|
|
129
|
+
type: string;
|
|
130
|
+
enum: string[];
|
|
131
|
+
};
|
|
132
|
+
pause: {
|
|
133
|
+
type: string;
|
|
134
|
+
};
|
|
135
|
+
resume: {
|
|
136
|
+
type: string;
|
|
137
|
+
};
|
|
138
|
+
cancel: {
|
|
139
|
+
type: string;
|
|
140
|
+
};
|
|
141
|
+
print3mf: {
|
|
142
|
+
type: string;
|
|
143
|
+
};
|
|
144
|
+
gcode: {
|
|
145
|
+
type: string;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
required: string[];
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
required: string[];
|
|
152
|
+
};
|
|
153
|
+
export declare const PRINT_PROGRESS_OUTPUT_SCHEMA: {
|
|
154
|
+
type: "object";
|
|
155
|
+
properties: {
|
|
156
|
+
contract: {
|
|
157
|
+
type: string;
|
|
158
|
+
const: string;
|
|
159
|
+
};
|
|
160
|
+
observedAt: {
|
|
161
|
+
type: string;
|
|
162
|
+
description: string;
|
|
163
|
+
};
|
|
164
|
+
state: {
|
|
165
|
+
type: string;
|
|
166
|
+
enum: ("failed" | "cancelled" | "idle" | "offline" | "preparing" | "printing" | "paused" | "finished" | "busy")[];
|
|
167
|
+
};
|
|
168
|
+
job: {
|
|
169
|
+
type: string;
|
|
170
|
+
properties: {
|
|
171
|
+
name: {
|
|
172
|
+
type: string;
|
|
173
|
+
};
|
|
174
|
+
id: {
|
|
175
|
+
type: string;
|
|
176
|
+
};
|
|
177
|
+
progress: {
|
|
178
|
+
type: string;
|
|
179
|
+
minimum: number;
|
|
180
|
+
maximum: number;
|
|
181
|
+
};
|
|
182
|
+
elapsedSec: {
|
|
183
|
+
type: string;
|
|
184
|
+
minimum: number;
|
|
185
|
+
};
|
|
186
|
+
remainingSec: {
|
|
187
|
+
type: string;
|
|
188
|
+
minimum: number;
|
|
189
|
+
};
|
|
190
|
+
layer: {
|
|
191
|
+
type: string;
|
|
192
|
+
minimum: number;
|
|
193
|
+
};
|
|
194
|
+
totalLayers: {
|
|
195
|
+
type: string;
|
|
196
|
+
minimum: number;
|
|
197
|
+
};
|
|
198
|
+
stage: {
|
|
199
|
+
type: string;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
required: string[];
|
|
203
|
+
};
|
|
204
|
+
temps: {
|
|
205
|
+
type: string;
|
|
206
|
+
properties: {
|
|
207
|
+
nozzle: {
|
|
208
|
+
type: string;
|
|
209
|
+
properties: {
|
|
210
|
+
actual: {
|
|
211
|
+
type: string;
|
|
212
|
+
};
|
|
213
|
+
target: {
|
|
214
|
+
type: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
required: string[];
|
|
218
|
+
};
|
|
219
|
+
bed: {
|
|
220
|
+
type: string;
|
|
221
|
+
properties: {
|
|
222
|
+
actual: {
|
|
223
|
+
type: string;
|
|
224
|
+
};
|
|
225
|
+
target: {
|
|
226
|
+
type: string;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
required: string[];
|
|
230
|
+
};
|
|
231
|
+
chamber: {
|
|
232
|
+
type: string;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
activeFilament: {
|
|
237
|
+
type: string;
|
|
238
|
+
properties: {
|
|
239
|
+
slot: {
|
|
240
|
+
type: string;
|
|
241
|
+
};
|
|
242
|
+
material: {
|
|
243
|
+
type: string;
|
|
244
|
+
};
|
|
245
|
+
color: {
|
|
246
|
+
type: string;
|
|
247
|
+
pattern: string;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
problems: {
|
|
252
|
+
type: string;
|
|
253
|
+
items: {
|
|
254
|
+
type: string;
|
|
255
|
+
properties: {
|
|
256
|
+
code: {
|
|
257
|
+
type: string;
|
|
258
|
+
};
|
|
259
|
+
severity: {
|
|
260
|
+
type: string;
|
|
261
|
+
enum: ("error" | "info" | "fatal" | "warning")[];
|
|
262
|
+
};
|
|
263
|
+
message: {
|
|
264
|
+
type: string;
|
|
265
|
+
};
|
|
266
|
+
url: {
|
|
267
|
+
type: string;
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
required: string[];
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
required: string[];
|
|
275
|
+
};
|
|
276
|
+
export declare const MAKE_3MF_OUTPUT_SCHEMA: {
|
|
277
|
+
type: "object";
|
|
278
|
+
properties: {
|
|
279
|
+
contract: {
|
|
280
|
+
type: string;
|
|
281
|
+
const: string;
|
|
282
|
+
};
|
|
283
|
+
path: {
|
|
284
|
+
type: string;
|
|
285
|
+
description: string;
|
|
286
|
+
};
|
|
287
|
+
objects: {
|
|
288
|
+
type: string;
|
|
289
|
+
minimum: number;
|
|
290
|
+
description: string;
|
|
291
|
+
};
|
|
292
|
+
filaments: {
|
|
293
|
+
type: string;
|
|
294
|
+
minimum: number;
|
|
295
|
+
description: string;
|
|
296
|
+
};
|
|
297
|
+
parts: {
|
|
298
|
+
type: string;
|
|
299
|
+
items: {
|
|
300
|
+
type: string;
|
|
301
|
+
properties: {
|
|
302
|
+
name: {
|
|
303
|
+
type: string;
|
|
304
|
+
};
|
|
305
|
+
stl_path: {
|
|
306
|
+
type: string;
|
|
307
|
+
};
|
|
308
|
+
filament: {
|
|
309
|
+
type: string;
|
|
310
|
+
minimum: number;
|
|
311
|
+
};
|
|
312
|
+
triangles: {
|
|
313
|
+
type: string;
|
|
314
|
+
minimum: number;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
required: string[];
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
required: string[];
|
|
322
|
+
};
|