bambu-printer-mcp 1.1.50 → 1.1.52
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 +33 -8
- package/dist/ams-mapping.d.ts +19 -0
- package/dist/ams-mapping.js +49 -0
- package/dist/bambu-network-bridge.d.ts +86 -9
- package/dist/bambu-network-bridge.js +284 -4
- package/dist/control-reply.d.ts +21 -0
- package/dist/control-reply.js +44 -0
- package/dist/counterpart/info.js +1 -0
- package/dist/counterpart/route.d.ts +37 -0
- package/dist/counterpart/route.js +78 -0
- package/dist/counterpart/schemas.d.ts +4 -0
- package/dist/counterpart/schemas.js +1 -0
- package/dist/design-guidance.d.ts +26 -0
- package/dist/design-guidance.js +177 -0
- package/dist/fusion-mcp-bridge.d.ts +8 -4
- package/dist/fusion-mcp-bridge.js +36 -10
- package/dist/index.js +219 -54
- package/dist/printers/bambu.d.ts +38 -13
- package/dist/printers/bambu.js +204 -69
- package/dist/printers/camera-sources.d.ts +8 -0
- package/dist/printers/camera-sources.js +66 -0
- package/dist/printers/camera-stream.d.ts +65 -0
- package/dist/printers/camera-stream.js +227 -0
- package/dist/printers/camera-tools.d.ts +192 -0
- package/dist/printers/camera-tools.js +29 -0
- package/dist/printers/camera-wire.d.ts +7 -0
- package/dist/printers/camera-wire.js +40 -0
- package/dist/safety/print-file.d.ts +3 -0
- package/dist/safety/print-file.js +11 -2
- package/dist/safety/printer-state.d.ts +7 -0
- package/dist/safety/printer-state.js +11 -1
- package/dist/slicer/layer-pauses.d.ts +47 -0
- package/dist/slicer/layer-pauses.js +130 -0
- package/dist/stl/stl-manipulator.d.ts +40 -1
- package/dist/stl/stl-manipulator.js +253 -83
- package/package.json +2 -1
- package/src/ams-mapping.ts +52 -0
- package/src/bambu-network-bridge.ts +311 -8
- package/src/control-reply.ts +41 -0
- package/src/counterpart/info.ts +1 -0
- package/src/counterpart/route.ts +91 -0
- package/src/counterpart/schemas.ts +2 -0
- package/src/design-guidance.ts +188 -0
- package/src/fusion-mcp-bridge.ts +30 -10
- package/src/index.ts +213 -57
- package/src/printers/bambu.ts +194 -60
- package/src/printers/camera-sources.ts +53 -0
- package/src/printers/camera-stream.ts +165 -0
- package/src/printers/camera-tools.ts +29 -0
- package/src/printers/camera-wire.ts +39 -0
- package/src/safety/print-file.ts +12 -2
- package/src/safety/printer-state.ts +11 -1
- package/src/slicer/layer-pauses.ts +143 -0
- package/src/stl/stl-manipulator.ts +298 -93
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
+
};
|
|
12
|
+
var _CameraStream_instances, _CameraStream_source, _CameraStream_timer, _CameraStream_generation, _CameraStream_processing, _CameraStream_lastAccepted, _CameraStream_latest, _CameraStream_references, _CameraStream_waiters, _CameraStream_stopped, _CameraStream_reconnected, _CameraStream_reason, _CameraStream_seq, _CameraStream_wake, _CameraStream_connect, _CameraStream_lost, _CameraStream_accept, _CameraStream_encoded, _CameraStream_result, _CameraStreams_streams, _CameraStreams_sequence;
|
|
13
|
+
/** One camera source per printer; bounded frames and native thumbnail processing. */
|
|
14
|
+
import sharp from "sharp";
|
|
15
|
+
sharp.cache({ memory: 8, files: 0, items: 32 });
|
|
16
|
+
export function thumbnailChange(a, b) {
|
|
17
|
+
let total = 0;
|
|
18
|
+
for (let i = 0; i < a.length; i++)
|
|
19
|
+
total += Math.abs(a[i] - b[i]);
|
|
20
|
+
return total / (a.length * 255);
|
|
21
|
+
}
|
|
22
|
+
export class CameraStream {
|
|
23
|
+
constructor(options, nextSeq, now = Date.now) {
|
|
24
|
+
_CameraStream_instances.add(this);
|
|
25
|
+
this.options = options;
|
|
26
|
+
this.nextSeq = nextSeq;
|
|
27
|
+
this.now = now;
|
|
28
|
+
this.startedAt = new Date().toISOString();
|
|
29
|
+
_CameraStream_source.set(this, void 0);
|
|
30
|
+
_CameraStream_timer.set(this, void 0);
|
|
31
|
+
_CameraStream_generation.set(this, 0);
|
|
32
|
+
_CameraStream_processing.set(this, false);
|
|
33
|
+
_CameraStream_lastAccepted.set(this, -Infinity);
|
|
34
|
+
_CameraStream_latest.set(this, void 0);
|
|
35
|
+
// Keep thumbnails of frames actually delivered, not every camera frame. A quiet view may keep
|
|
36
|
+
// comparing with its first frame for hours; a rolling JPEG history would repeatedly resend it.
|
|
37
|
+
_CameraStream_references.set(this, new Map());
|
|
38
|
+
_CameraStream_waiters.set(this, new Set());
|
|
39
|
+
_CameraStream_stopped.set(this, false);
|
|
40
|
+
_CameraStream_reconnected.set(this, false);
|
|
41
|
+
_CameraStream_reason.set(this, void 0);
|
|
42
|
+
_CameraStream_seq.set(this, 0);
|
|
43
|
+
this.transport = options.transport;
|
|
44
|
+
this.fps = options.fps;
|
|
45
|
+
}
|
|
46
|
+
get stopped() { return __classPrivateFieldGet(this, _CameraStream_stopped, "f"); }
|
|
47
|
+
start() { this.touch(); __classPrivateFieldGet(this, _CameraStream_instances, "m", _CameraStream_connect).call(this); }
|
|
48
|
+
touch(idleTimeoutMs) {
|
|
49
|
+
if (__classPrivateFieldGet(this, _CameraStream_stopped, "f"))
|
|
50
|
+
return;
|
|
51
|
+
if (idleTimeoutMs !== undefined)
|
|
52
|
+
this.options.idleTimeoutMs = idleTimeoutMs;
|
|
53
|
+
clearTimeout(__classPrivateFieldGet(this, _CameraStream_timer, "f"));
|
|
54
|
+
__classPrivateFieldSet(this, _CameraStream_timer, setTimeout(() => this.stop(), this.options.idleTimeoutMs), "f");
|
|
55
|
+
__classPrivateFieldGet(this, _CameraStream_timer, "f").unref();
|
|
56
|
+
}
|
|
57
|
+
stop() {
|
|
58
|
+
var _a;
|
|
59
|
+
if (__classPrivateFieldGet(this, _CameraStream_stopped, "f"))
|
|
60
|
+
return;
|
|
61
|
+
__classPrivateFieldSet(this, _CameraStream_stopped, true, "f");
|
|
62
|
+
__classPrivateFieldSet(this, _CameraStream_generation, (_a = __classPrivateFieldGet(this, _CameraStream_generation, "f"), _a++, _a), "f");
|
|
63
|
+
clearTimeout(__classPrivateFieldGet(this, _CameraStream_timer, "f"));
|
|
64
|
+
__classPrivateFieldGet(this, _CameraStream_source, "f")?.close();
|
|
65
|
+
__classPrivateFieldSet(this, _CameraStream_source, undefined, "f");
|
|
66
|
+
__classPrivateFieldSet(this, _CameraStream_latest, undefined, "f");
|
|
67
|
+
__classPrivateFieldGet(this, _CameraStream_references, "f").clear();
|
|
68
|
+
__classPrivateFieldGet(this, _CameraStream_instances, "m", _CameraStream_wake).call(this);
|
|
69
|
+
}
|
|
70
|
+
async frame(options = {}) {
|
|
71
|
+
const since = options.sinceSeq ?? 0, deadline = Date.now() + (options.waitMs ?? 0);
|
|
72
|
+
this.touch();
|
|
73
|
+
for (;;) {
|
|
74
|
+
options.signal?.throwIfAborted();
|
|
75
|
+
if (__classPrivateFieldGet(this, _CameraStream_reason, "f"))
|
|
76
|
+
return { status: "unavailable", seq: __classPrivateFieldGet(this, _CameraStream_seq, "f"), reason: __classPrivateFieldGet(this, _CameraStream_reason, "f") };
|
|
77
|
+
if (__classPrivateFieldGet(this, _CameraStream_stopped, "f"))
|
|
78
|
+
return { status: "stopped", seq: __classPrivateFieldGet(this, _CameraStream_seq, "f") };
|
|
79
|
+
const latest = __classPrivateFieldGet(this, _CameraStream_latest, "f");
|
|
80
|
+
if (latest && latest.seq > since) {
|
|
81
|
+
const reference = __classPrivateFieldGet(this, _CameraStream_references, "f").get(since);
|
|
82
|
+
const change = reference ? thumbnailChange(latest.thumb, reference) : 1;
|
|
83
|
+
if (options.changedOnly === false || change >= (options.minChange ?? 0.02))
|
|
84
|
+
return __classPrivateFieldGet(this, _CameraStream_instances, "m", _CameraStream_result).call(this, latest, change, options.maxWidth, options.maxBytes);
|
|
85
|
+
}
|
|
86
|
+
const left = deadline - Date.now();
|
|
87
|
+
if (left <= 0)
|
|
88
|
+
return { status: "unchanged", seq: since, ...(latest ? { capturedAt: new Date(latest.at).toISOString() } : {}) };
|
|
89
|
+
await new Promise(resolve => {
|
|
90
|
+
const done = () => { clearTimeout(timer); __classPrivateFieldGet(this, _CameraStream_waiters, "f").delete(done); options.signal?.removeEventListener("abort", done); resolve(); };
|
|
91
|
+
const timer = setTimeout(done, left);
|
|
92
|
+
__classPrivateFieldGet(this, _CameraStream_waiters, "f").add(done);
|
|
93
|
+
options.signal?.addEventListener("abort", done, { once: true });
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async latest(waitMs) {
|
|
98
|
+
const result = await this.frame({ waitMs, changedOnly: false });
|
|
99
|
+
return result.status === "frame" ? Buffer.from(result.base64, "base64") : undefined;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
_CameraStream_source = new WeakMap(), _CameraStream_timer = new WeakMap(), _CameraStream_generation = new WeakMap(), _CameraStream_processing = new WeakMap(), _CameraStream_lastAccepted = new WeakMap(), _CameraStream_latest = new WeakMap(), _CameraStream_references = new WeakMap(), _CameraStream_waiters = new WeakMap(), _CameraStream_stopped = new WeakMap(), _CameraStream_reconnected = new WeakMap(), _CameraStream_reason = new WeakMap(), _CameraStream_seq = new WeakMap(), _CameraStream_instances = new WeakSet(), _CameraStream_wake = function _CameraStream_wake() { for (const wake of [...__classPrivateFieldGet(this, _CameraStream_waiters, "f")])
|
|
103
|
+
wake(); }, _CameraStream_connect = function _CameraStream_connect() {
|
|
104
|
+
var _a;
|
|
105
|
+
const generation = __classPrivateFieldSet(this, _CameraStream_generation, (_a = __classPrivateFieldGet(this, _CameraStream_generation, "f"), ++_a), "f");
|
|
106
|
+
let buffered, live = !this.options.skipFirstFrame;
|
|
107
|
+
const current = () => !__classPrivateFieldGet(this, _CameraStream_stopped, "f") && generation === __classPrivateFieldGet(this, _CameraStream_generation, "f");
|
|
108
|
+
try {
|
|
109
|
+
const source = this.options.open({
|
|
110
|
+
onFrame: bytes => {
|
|
111
|
+
if (!current())
|
|
112
|
+
return;
|
|
113
|
+
// P1/A1 replay their stale buffered frame, sometimes more than once.
|
|
114
|
+
if (!live) {
|
|
115
|
+
if (!buffered) {
|
|
116
|
+
buffered = bytes;
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (bytes.equals(buffered))
|
|
120
|
+
return;
|
|
121
|
+
buffered = undefined;
|
|
122
|
+
live = true;
|
|
123
|
+
}
|
|
124
|
+
if (__classPrivateFieldGet(this, _CameraStream_processing, "f") || this.now() - __classPrivateFieldGet(this, _CameraStream_lastAccepted, "f") < 1000 / this.fps)
|
|
125
|
+
return;
|
|
126
|
+
__classPrivateFieldSet(this, _CameraStream_lastAccepted, this.now(), "f");
|
|
127
|
+
__classPrivateFieldSet(this, _CameraStream_processing, true, "f");
|
|
128
|
+
void __classPrivateFieldGet(this, _CameraStream_instances, "m", _CameraStream_accept).call(this, bytes, generation).catch(() => { if (current())
|
|
129
|
+
__classPrivateFieldGet(this, _CameraStream_instances, "m", _CameraStream_lost).call(this, "unreachable"); })
|
|
130
|
+
.finally(() => { __classPrivateFieldSet(this, _CameraStream_processing, false, "f"); });
|
|
131
|
+
},
|
|
132
|
+
onError: error => { if (current())
|
|
133
|
+
__classPrivateFieldGet(this, _CameraStream_instances, "m", _CameraStream_lost).call(this, /auth|payload size|401|403/i.test(error.message) ? "auth" : "unreachable"); },
|
|
134
|
+
onEnd: () => { if (current())
|
|
135
|
+
__classPrivateFieldGet(this, _CameraStream_instances, "m", _CameraStream_lost).call(this, "unreachable"); },
|
|
136
|
+
});
|
|
137
|
+
// A transport may fail synchronously. Never keep its abandoned source after reconnect/stop.
|
|
138
|
+
if (current())
|
|
139
|
+
__classPrivateFieldSet(this, _CameraStream_source, source, "f");
|
|
140
|
+
else
|
|
141
|
+
source.close();
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
if (current())
|
|
145
|
+
__classPrivateFieldGet(this, _CameraStream_instances, "m", _CameraStream_lost).call(this, "unreachable");
|
|
146
|
+
}
|
|
147
|
+
}, _CameraStream_lost = function _CameraStream_lost(reason) {
|
|
148
|
+
var _a;
|
|
149
|
+
__classPrivateFieldSet(this, _CameraStream_generation, (_a = __classPrivateFieldGet(this, _CameraStream_generation, "f"), _a++, _a), "f");
|
|
150
|
+
__classPrivateFieldGet(this, _CameraStream_source, "f")?.close();
|
|
151
|
+
__classPrivateFieldSet(this, _CameraStream_source, undefined, "f");
|
|
152
|
+
if (!__classPrivateFieldGet(this, _CameraStream_reconnected, "f") && reason !== "auth") {
|
|
153
|
+
__classPrivateFieldSet(this, _CameraStream_reconnected, true, "f");
|
|
154
|
+
__classPrivateFieldGet(this, _CameraStream_instances, "m", _CameraStream_connect).call(this);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
__classPrivateFieldSet(this, _CameraStream_reason, reason, "f");
|
|
158
|
+
this.stop();
|
|
159
|
+
}, _CameraStream_accept = async function _CameraStream_accept(bytes, generation) {
|
|
160
|
+
if (bytes.length > 5000000)
|
|
161
|
+
throw Error("Camera JPEG too large");
|
|
162
|
+
const decoder = sharp(bytes, { limitInputPixels: 8000000 });
|
|
163
|
+
const metadata = await decoder.metadata();
|
|
164
|
+
const thumb = await decoder.resize(32, 18, { fit: "fill" }).greyscale().raw().toBuffer();
|
|
165
|
+
if (__classPrivateFieldGet(this, _CameraStream_stopped, "f") || generation !== __classPrivateFieldGet(this, _CameraStream_generation, "f"))
|
|
166
|
+
return;
|
|
167
|
+
__classPrivateFieldSet(this, _CameraStream_latest, { seq: __classPrivateFieldSet(this, _CameraStream_seq, this.nextSeq(), "f"), bytes, thumb, at: this.now(), width: metadata.width, height: metadata.height, scaled: new Map() }, "f");
|
|
168
|
+
__classPrivateFieldGet(this, _CameraStream_instances, "m", _CameraStream_wake).call(this);
|
|
169
|
+
}, _CameraStream_encoded = async function _CameraStream_encoded(frame, width, maxBytes) {
|
|
170
|
+
// Start near the byte target instead of always encoding a full-size frame that will be
|
|
171
|
+
// discarded. Source JPEG density is a cheap conservative estimate, not a size guarantee.
|
|
172
|
+
if (maxBytes && frame.bytes.length > maxBytes)
|
|
173
|
+
width = Math.min(width, Math.max(1, Math.floor(frame.width * Math.sqrt(maxBytes / frame.bytes.length) * 0.8)));
|
|
174
|
+
// At most four native encodes. The final 1-pixel fallback guarantees a bounded result
|
|
175
|
+
// even for pathological entropy; quality stays 70 and aspect ratio is preserved.
|
|
176
|
+
for (let attempt = 0; attempt < 4; attempt++) {
|
|
177
|
+
const encoded = await sharp(frame.bytes, { limitInputPixels: 8000000 }).resize({ width, withoutEnlargement: true }).jpeg({ quality: 70 }).toBuffer({ resolveWithObject: true });
|
|
178
|
+
if (!maxBytes || encoded.data.length <= maxBytes)
|
|
179
|
+
return encoded;
|
|
180
|
+
width = attempt === 2 ? 1 : Math.max(1, Math.floor(width * Math.min(0.8, Math.sqrt(maxBytes / encoded.data.length) * 0.9)));
|
|
181
|
+
}
|
|
182
|
+
throw new Error("Camera frame could not fit max_bytes");
|
|
183
|
+
}, _CameraStream_result = async function _CameraStream_result(frame, change, maxWidth, maxBytes) {
|
|
184
|
+
let bytes = frame.bytes, width = frame.width, height = frame.height;
|
|
185
|
+
if ((maxWidth && width > maxWidth) || (maxBytes && bytes.length > maxBytes)) {
|
|
186
|
+
const key = `${maxWidth ?? width}:${maxBytes ?? 0}`;
|
|
187
|
+
let scaled = frame.scaled.get(key);
|
|
188
|
+
if (!scaled) {
|
|
189
|
+
scaled = __classPrivateFieldGet(this, _CameraStream_instances, "m", _CameraStream_encoded).call(this, frame, Math.min(width, maxWidth ?? width), maxBytes);
|
|
190
|
+
if (frame.scaled.size < 4)
|
|
191
|
+
frame.scaled.set(key, scaled);
|
|
192
|
+
}
|
|
193
|
+
const resized = await scaled;
|
|
194
|
+
bytes = resized.data;
|
|
195
|
+
width = resized.info.width;
|
|
196
|
+
height = resized.info.height;
|
|
197
|
+
}
|
|
198
|
+
if (__classPrivateFieldGet(this, _CameraStream_stopped, "f"))
|
|
199
|
+
return __classPrivateFieldGet(this, _CameraStream_reason, "f") ? { status: "unavailable", seq: __classPrivateFieldGet(this, _CameraStream_seq, "f"), reason: __classPrivateFieldGet(this, _CameraStream_reason, "f") } : { status: "stopped", seq: __classPrivateFieldGet(this, _CameraStream_seq, "f") };
|
|
200
|
+
__classPrivateFieldGet(this, _CameraStream_references, "f").set(frame.seq, frame.thumb);
|
|
201
|
+
if (__classPrivateFieldGet(this, _CameraStream_references, "f").size > 256)
|
|
202
|
+
__classPrivateFieldGet(this, _CameraStream_references, "f").delete(__classPrivateFieldGet(this, _CameraStream_references, "f").keys().next().value);
|
|
203
|
+
return { status: "frame", seq: frame.seq, capturedAt: new Date(frame.at).toISOString(), width, height, format: "image/jpeg", base64: bytes.toString("base64"), change };
|
|
204
|
+
};
|
|
205
|
+
export class CameraStreams {
|
|
206
|
+
constructor(now = Date.now) {
|
|
207
|
+
this.now = now;
|
|
208
|
+
_CameraStreams_streams.set(this, new Map());
|
|
209
|
+
_CameraStreams_sequence.set(this, 0);
|
|
210
|
+
}
|
|
211
|
+
get(key) { return __classPrivateFieldGet(this, _CameraStreams_streams, "f").get(key); }
|
|
212
|
+
start(key, options) {
|
|
213
|
+
const existing = this.get(key);
|
|
214
|
+
if (existing && !existing.stopped) {
|
|
215
|
+
existing.touch(options.idleTimeoutMs);
|
|
216
|
+
return { stream: existing, status: "running" };
|
|
217
|
+
}
|
|
218
|
+
const stream = new CameraStream(options, () => { var _a; return __classPrivateFieldSet(this, _CameraStreams_sequence, (_a = __classPrivateFieldGet(this, _CameraStreams_sequence, "f"), ++_a), "f"); }, this.now);
|
|
219
|
+
__classPrivateFieldGet(this, _CameraStreams_streams, "f").set(key, stream);
|
|
220
|
+
stream.start();
|
|
221
|
+
return { stream, status: "started" };
|
|
222
|
+
}
|
|
223
|
+
stop(key) { this.get(key)?.stop(); }
|
|
224
|
+
stopAll() { for (const stream of __classPrivateFieldGet(this, _CameraStreams_streams, "f").values())
|
|
225
|
+
stream.stop(); __classPrivateFieldGet(this, _CameraStreams_streams, "f").clear(); }
|
|
226
|
+
}
|
|
227
|
+
_CameraStreams_streams = new WeakMap(), _CameraStreams_sequence = new WeakMap();
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
export declare const CAMERA_STREAM_TOOLS: ({
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {
|
|
7
|
+
bambu_model: {
|
|
8
|
+
type: string;
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
fps: {
|
|
12
|
+
type: string;
|
|
13
|
+
minimum: number;
|
|
14
|
+
maximum: number;
|
|
15
|
+
default: number;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
idle_timeout_ms: {
|
|
19
|
+
type: string;
|
|
20
|
+
minimum: number;
|
|
21
|
+
maximum: number;
|
|
22
|
+
default: number;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
host: {
|
|
26
|
+
type: string;
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
bambu_serial: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
bambu_token: {
|
|
34
|
+
type: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
additionalProperties: boolean;
|
|
39
|
+
};
|
|
40
|
+
outputSchema: {
|
|
41
|
+
type: "object";
|
|
42
|
+
properties: {
|
|
43
|
+
status: {
|
|
44
|
+
type: string;
|
|
45
|
+
enum: string[];
|
|
46
|
+
const?: undefined;
|
|
47
|
+
};
|
|
48
|
+
transport: {
|
|
49
|
+
type: string;
|
|
50
|
+
enum: string[];
|
|
51
|
+
};
|
|
52
|
+
fps: {
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
55
|
+
startedAt: {
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
required: string[];
|
|
60
|
+
};
|
|
61
|
+
} | {
|
|
62
|
+
name: string;
|
|
63
|
+
description: string;
|
|
64
|
+
inputSchema: {
|
|
65
|
+
type: "object";
|
|
66
|
+
properties: {
|
|
67
|
+
since_seq: {
|
|
68
|
+
type: string;
|
|
69
|
+
minimum: number;
|
|
70
|
+
default: number;
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
wait_ms: {
|
|
74
|
+
type: string;
|
|
75
|
+
minimum: number;
|
|
76
|
+
maximum: number;
|
|
77
|
+
default: number;
|
|
78
|
+
description: string;
|
|
79
|
+
};
|
|
80
|
+
max_width: {
|
|
81
|
+
type: string;
|
|
82
|
+
minimum: number;
|
|
83
|
+
maximum: number;
|
|
84
|
+
description: string;
|
|
85
|
+
};
|
|
86
|
+
max_bytes: {
|
|
87
|
+
type: string;
|
|
88
|
+
minimum: number;
|
|
89
|
+
maximum: number;
|
|
90
|
+
description: string;
|
|
91
|
+
};
|
|
92
|
+
changed_only: {
|
|
93
|
+
type: string;
|
|
94
|
+
default: boolean;
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
97
|
+
min_change: {
|
|
98
|
+
type: string;
|
|
99
|
+
minimum: number;
|
|
100
|
+
maximum: number;
|
|
101
|
+
default: number;
|
|
102
|
+
description: string;
|
|
103
|
+
};
|
|
104
|
+
host: {
|
|
105
|
+
type: string;
|
|
106
|
+
description: string;
|
|
107
|
+
};
|
|
108
|
+
bambu_serial: {
|
|
109
|
+
type: string;
|
|
110
|
+
description: string;
|
|
111
|
+
};
|
|
112
|
+
bambu_token: {
|
|
113
|
+
type: string;
|
|
114
|
+
description: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
additionalProperties: boolean;
|
|
118
|
+
};
|
|
119
|
+
outputSchema: {
|
|
120
|
+
type: "object";
|
|
121
|
+
properties: {
|
|
122
|
+
status: {
|
|
123
|
+
type: string;
|
|
124
|
+
enum: string[];
|
|
125
|
+
};
|
|
126
|
+
seq: {
|
|
127
|
+
type: string;
|
|
128
|
+
minimum: number;
|
|
129
|
+
};
|
|
130
|
+
capturedAt: {
|
|
131
|
+
type: string;
|
|
132
|
+
};
|
|
133
|
+
width: {
|
|
134
|
+
type: string;
|
|
135
|
+
};
|
|
136
|
+
height: {
|
|
137
|
+
type: string;
|
|
138
|
+
};
|
|
139
|
+
format: {
|
|
140
|
+
type: string;
|
|
141
|
+
const: string;
|
|
142
|
+
};
|
|
143
|
+
base64: {
|
|
144
|
+
type: string;
|
|
145
|
+
};
|
|
146
|
+
change: {
|
|
147
|
+
type: string;
|
|
148
|
+
};
|
|
149
|
+
reason: {
|
|
150
|
+
type: string;
|
|
151
|
+
enum: string[];
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
required: string[];
|
|
155
|
+
};
|
|
156
|
+
} | {
|
|
157
|
+
name: string;
|
|
158
|
+
description: string;
|
|
159
|
+
inputSchema: {
|
|
160
|
+
type: "object";
|
|
161
|
+
properties: {
|
|
162
|
+
host: {
|
|
163
|
+
type: string;
|
|
164
|
+
description: string;
|
|
165
|
+
};
|
|
166
|
+
bambu_serial: {
|
|
167
|
+
type: string;
|
|
168
|
+
description: string;
|
|
169
|
+
};
|
|
170
|
+
bambu_token: {
|
|
171
|
+
type: string;
|
|
172
|
+
description: string;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
additionalProperties: boolean;
|
|
176
|
+
};
|
|
177
|
+
outputSchema: {
|
|
178
|
+
type: "object";
|
|
179
|
+
properties: {
|
|
180
|
+
status: {
|
|
181
|
+
type: string;
|
|
182
|
+
const: string;
|
|
183
|
+
enum?: undefined;
|
|
184
|
+
};
|
|
185
|
+
transport?: undefined;
|
|
186
|
+
fps?: undefined;
|
|
187
|
+
startedAt?: undefined;
|
|
188
|
+
};
|
|
189
|
+
required: string[];
|
|
190
|
+
};
|
|
191
|
+
})[];
|
|
192
|
+
export declare function cameraNumber(value: unknown, fallback: number, min: number, max: number, name: string, integer?: boolean): number;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Additive stream tools; discovery is the capability check for older clients. */
|
|
2
|
+
const routing = {
|
|
3
|
+
host: { type: "string", description: "Printer LAN host or IP; defaults to the configured Bambu host." },
|
|
4
|
+
bambu_serial: { type: "string", description: "Printer serial number; defaults to the configured serial and identifies its shared stream." },
|
|
5
|
+
bambu_token: { type: "string", description: "Printer LAN access code; defaults to the configured access code." },
|
|
6
|
+
};
|
|
7
|
+
const frameSchema = {
|
|
8
|
+
type: "object", properties: {
|
|
9
|
+
status: { type: "string", enum: ["frame", "unchanged", "stopped", "unavailable"] }, seq: { type: "integer", minimum: 0 },
|
|
10
|
+
capturedAt: { type: "string" }, width: { type: "integer" }, height: { type: "integer" },
|
|
11
|
+
format: { type: "string", const: "image/jpeg" }, base64: { type: "string" }, change: { type: "number" },
|
|
12
|
+
reason: { type: "string", enum: ["no-camera", "auth", "unreachable"] },
|
|
13
|
+
}, required: ["status", "seq"],
|
|
14
|
+
};
|
|
15
|
+
export const CAMERA_STREAM_TOOLS = [
|
|
16
|
+
{ name: "camera_stream_start", description: "Start or renew one persistent camera connection for this printer. Call only while watched; it closes automatically after idle_timeout_ms without a viewer request. camera_snapshot then reuses its latest frame. No printer motion or print commands.",
|
|
17
|
+
inputSchema: { type: "object", properties: { ...routing, bambu_model: { type: "string", description: "Bambu model used to select the camera transport; defaults to BAMBU_MODEL." }, fps: { type: "number", minimum: 0.2, maximum: 2, default: 1, description: "Maximum processed frames per second. The first viewer sets the rate until the stream closes." }, idle_timeout_ms: { type: "integer", minimum: 5000, maximum: 120000, default: 30000, description: "Close the shared connection after this many milliseconds without a viewer request." } }, additionalProperties: false },
|
|
18
|
+
outputSchema: { type: "object", properties: { status: { type: "string", enum: ["started", "running"] }, transport: { type: "string", enum: ["tcp-6000", "rtsps-322"] }, fps: { type: "number" }, startedAt: { type: "string" } }, required: ["status", "transport", "fps", "startedAt"] } },
|
|
19
|
+
{ name: "camera_frame", description: "Read the shared camera stream, optionally waiting up to 10 seconds. Returns JPEG only when newer than since_seq and visibly changed (32×18 grayscale difference). Retain the last delivered frame's seq on unchanged. max_width resizes JPEG to the viewer. Does not start a stopped stream.",
|
|
20
|
+
inputSchema: { type: "object", properties: { ...routing, since_seq: { type: "integer", minimum: 0, default: 0, description: "Sequence of the last delivered JPEG; retain it when a result is unchanged." }, wait_ms: { type: "integer", minimum: 0, maximum: 10000, default: 0, description: "Maximum time to await a newer changed frame; zero returns immediately." }, max_width: { type: "integer", minimum: 1, maximum: 4096, description: "Optional maximum JPEG width in pixels, preserving aspect ratio and never enlarging." }, max_bytes: { type: "integer", minimum: 4096, maximum: 5000000, description: "Optional maximum encoded JPEG bytes. Downscales further at quality 70 when needed; base64 adds about one third plus protocol overhead. Use 42000 for a two-second 30 KB/s viewer budget." }, changed_only: { type: "boolean", default: true, description: "Return JPEG only when its thumbnail differs enough from the last delivered frame." }, min_change: { type: "number", minimum: 0, maximum: 1, default: 0.02, description: "Minimum mean absolute grayscale thumbnail difference, normalized from zero to one." } }, additionalProperties: false }, outputSchema: frameSchema },
|
|
21
|
+
{ name: "camera_stream_stop", description: "Close this printer's camera connection and free its cached frames. Other printers keep their own streams. Active viewers may restart it; normally let the idle timeout close a shared stream.",
|
|
22
|
+
inputSchema: { type: "object", properties: routing, additionalProperties: false }, outputSchema: { type: "object", properties: { status: { type: "string", const: "stopped" } }, required: ["status"] } },
|
|
23
|
+
];
|
|
24
|
+
export function cameraNumber(value, fallback, min, max, name, integer = false) {
|
|
25
|
+
const n = value === undefined ? fallback : value;
|
|
26
|
+
if (typeof n !== "number" || !Number.isFinite(n) || n < min || n > max || (integer && !Number.isSafeInteger(n)))
|
|
27
|
+
throw new Error(`${name} must be ${integer ? "an integer" : "a number"} from ${min} to ${max}`);
|
|
28
|
+
return n;
|
|
29
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split the A1/P1 camera stream on port 6000 into JPEG frames. Each frame is
|
|
3
|
+
* a 16-byte header (payload size LE, itrack, flags, reserved) and the JPEG.
|
|
4
|
+
*/
|
|
5
|
+
export declare function cameraFrameParser(onFrame: (jpeg: Buffer) => void, onError: (error: Error) => void): (chunk: Buffer) => void;
|
|
6
|
+
/** The existing Bambu camera authentication packet, shared by snapshots and streams. */
|
|
7
|
+
export declare function cameraAuth(token: string): Buffer;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split the A1/P1 camera stream on port 6000 into JPEG frames. Each frame is
|
|
3
|
+
* a 16-byte header (payload size LE, itrack, flags, reserved) and the JPEG.
|
|
4
|
+
*/
|
|
5
|
+
export function cameraFrameParser(onFrame, onError) {
|
|
6
|
+
let buffered = Buffer.alloc(0);
|
|
7
|
+
let failed = false;
|
|
8
|
+
return chunk => {
|
|
9
|
+
if (failed)
|
|
10
|
+
return;
|
|
11
|
+
buffered = Buffer.concat([buffered, chunk]);
|
|
12
|
+
while (buffered.length >= 16) {
|
|
13
|
+
const payloadSize = buffered.readUInt32LE(0);
|
|
14
|
+
if (payloadSize <= 0 || payloadSize > 5000000) {
|
|
15
|
+
failed = true;
|
|
16
|
+
onError(new Error(`camera_snapshot: unreasonable payload size ${payloadSize} from header; auth likely failed.`));
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (buffered.length < 16 + payloadSize)
|
|
20
|
+
return;
|
|
21
|
+
const jpeg = buffered.subarray(16, 16 + payloadSize);
|
|
22
|
+
buffered = buffered.subarray(16 + payloadSize);
|
|
23
|
+
if (jpeg[0] !== 0xff || jpeg[1] !== 0xd8) {
|
|
24
|
+
failed = true;
|
|
25
|
+
onError(new Error(`camera_snapshot: payload does not start with JPEG SOI (FF D8); got ${jpeg[0].toString(16)} ${jpeg[1].toString(16)}.`));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
onFrame(Buffer.from(jpeg));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** The existing Bambu camera authentication packet, shared by snapshots and streams. */
|
|
33
|
+
export function cameraAuth(token) {
|
|
34
|
+
const auth = Buffer.alloc(80, 0);
|
|
35
|
+
auth.writeUInt32LE(0x40, 0);
|
|
36
|
+
auth.writeUInt32LE(0x3000, 4);
|
|
37
|
+
auth.write("bblp", 16, 4, "ascii");
|
|
38
|
+
auth.write(token, 48, Math.min(32, Buffer.byteLength(token, "ascii")), "ascii");
|
|
39
|
+
return auth;
|
|
40
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ProjectFilament } from "../ams-mapping.js";
|
|
1
2
|
export interface PrintFileInspection {
|
|
2
3
|
model: string;
|
|
3
4
|
nozzleDiameters: number[];
|
|
@@ -14,6 +15,8 @@ export interface PrintFileInspection {
|
|
|
14
15
|
nozzleFlows?: string[];
|
|
15
16
|
/** Physical nozzle index for each declared filament, composed from the selected plate headers. */
|
|
16
17
|
filamentNozzleIndices?: number[];
|
|
18
|
+
/** Every project filament as project_settings.config declares it, for PrintParams.ams_mapping_info. */
|
|
19
|
+
projectFilaments?: ProjectFilament[];
|
|
17
20
|
}
|
|
18
21
|
/** Inspect the exact selected plate. This does not simulate firmware or arbitrary motion:
|
|
19
22
|
* only declared object bounds are checked, never purge/homing/wipe travel coordinates.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { readBoundedPrintFile, loadSafe3mfArchive } from './archive.js';
|
|
3
|
+
import { projectFilaments } from "../ams-mapping.js";
|
|
3
4
|
import { MACHINE_LIMITS, isDualNozzleModel, normalizeMaterial, normalizeModel, validateStartupPurgeTemperature, validateTemperature } from './limits.js';
|
|
4
5
|
const NUMBER = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/;
|
|
5
6
|
const fail = (message) => { throw new Error(`Print safety: ${message}`); };
|
|
@@ -531,7 +532,15 @@ export async function inspectPrintFile(filePath, options) {
|
|
|
531
532
|
continue;
|
|
532
533
|
}
|
|
533
534
|
if (['M104', 'M109', 'M140', 'M190', 'M141', 'M191'].includes(code)) {
|
|
534
|
-
const args = parameters(argumentsText, 'A');
|
|
535
|
+
const args = parameters(argumentsText, code === 'M104' ? 'AM' : 'A');
|
|
536
|
+
// Studio 2.9's GCodeWriter marks layer-temperature changes with bare M.
|
|
537
|
+
// Accept only its exact S-target / optional T form; targets and tool
|
|
538
|
+
// selectors still pass through the independent thermal checks below.
|
|
539
|
+
if (args.has('M')) {
|
|
540
|
+
if (!Number.isNaN(args.get('M')) || !args.has('S') || [...args.keys()].some(key => !'MST'.includes(key)))
|
|
541
|
+
fail('unsupported M104 layer-change temperature parameters');
|
|
542
|
+
args.delete('M');
|
|
543
|
+
}
|
|
535
544
|
// Official A1 and A1 mini start G-code waits with M109 S<target> H<limit>
|
|
536
545
|
// (S25 H140, S100 H170, S220 H300). H is not a heater target: S stays the
|
|
537
546
|
// checked target, so H is accepted only within those vendor bounds.
|
|
@@ -748,5 +757,5 @@ export async function inspectPrintFile(filePath, options) {
|
|
|
748
757
|
return fail('selected G-code contains no printable commands');
|
|
749
758
|
if (!used.size)
|
|
750
759
|
materials.forEach((_, index) => used.add(index));
|
|
751
|
-
return { model, nozzleDiameters, materials, usedFilamentPositions: [...used].sort((a, b) => a - b), plateInternalPath, sha256, maxNozzleTemperature, maxBedTemperature, maxChamberTemperature, bedType, selectsAms, nozzleTypes, nozzleFlows, filamentNozzleIndices };
|
|
760
|
+
return { model, nozzleDiameters, materials, usedFilamentPositions: [...used].sort((a, b) => a - b), plateInternalPath, sha256, maxNozzleTemperature, maxBedTemperature, maxChamberTemperature, bedType, selectsAms, nozzleTypes, nozzleFlows, filamentNozzleIndices, ...(Array.isArray(project.filament_type) ? { projectFilaments: projectFilaments(project) } : {}) };
|
|
752
761
|
}
|
|
@@ -81,6 +81,13 @@ export declare function isHiddenNotice(serial: string, model: string, entry: Hms
|
|
|
81
81
|
export declare function hiddenHmsNotices(raw: unknown, serial: string, model: string): string[];
|
|
82
82
|
/** Cleared-code keys of reported hidden entries; clearing never removes them, so they are not re-acknowledged. */
|
|
83
83
|
export declare function hiddenHmsKeys(raw: unknown, serial: string, model: string): string[];
|
|
84
|
+
/**
|
|
85
|
+
* 0300_8013, "Printing was paused by the user" / "paused due to the pause command added to the
|
|
86
|
+
* printing file" (hms-messages.ts): the printer's report of a deliberate pause, which Resume clears.
|
|
87
|
+
* A paused P1S reports it as print_error, so it is not an error for resuming a paused job.
|
|
88
|
+
*/
|
|
89
|
+
export declare const PAUSE_NOTICE = 50364435;
|
|
90
|
+
export declare function isPauseNotice(raw: Record<string, any>, requireIdle: boolean): boolean;
|
|
84
91
|
/** Verifies reported configuration, not a physical nozzle/spool inspection. */
|
|
85
92
|
export declare function validatePrinterState(status: any, requirements: PrinterStateRequirements): ValidatedPrinterState;
|
|
86
93
|
/** Manual M104 cannot remap filament slots. Validate the material already at the nozzle. */
|
|
@@ -316,6 +316,16 @@ function logHiddenNotices(raw, serial, model) {
|
|
|
316
316
|
console.error(`Printer ${serial} reports ${hmsLabel(entry.hex)}, which Bambu lists for it without text and never shows as a fault; it does not block operations.`);
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
+
/**
|
|
320
|
+
* 0300_8013, "Printing was paused by the user" / "paused due to the pause command added to the
|
|
321
|
+
* printing file" (hms-messages.ts): the printer's report of a deliberate pause, which Resume clears.
|
|
322
|
+
* A paused P1S reports it as print_error, so it is not an error for resuming a paused job.
|
|
323
|
+
*/
|
|
324
|
+
export const PAUSE_NOTICE = 0x03008013;
|
|
325
|
+
export function isPauseNotice(raw, requireIdle) {
|
|
326
|
+
const state = typeof raw?.gcode_state === "string" ? raw.gcode_state.toUpperCase() : "";
|
|
327
|
+
return !requireIdle && state === "PAUSE" && finiteNumber(raw?.print_error) === PAUSE_NOTICE;
|
|
328
|
+
}
|
|
319
329
|
function validateErrors(raw, requireIdle, serial, model) {
|
|
320
330
|
const state = typeof raw.gcode_state === "string" ? raw.gcode_state.toUpperCase() : "UNKNOWN";
|
|
321
331
|
const terminal = isCancelledX2DJob(raw, model) || isFinishedP1SJob(raw, model);
|
|
@@ -323,7 +333,7 @@ function validateErrors(raw, requireIdle, serial, model) {
|
|
|
323
333
|
throw new Error(`Printer state ${state} is not safely idle.`);
|
|
324
334
|
if (!requireIdle && !["IDLE", "FINISH", "RUNNING", "PAUSE"].includes(state) && !terminal)
|
|
325
335
|
throw new Error(`Printer state ${state} is unknown or failed.`);
|
|
326
|
-
if (finiteNumber(raw.print_error) !== 0)
|
|
336
|
+
if (finiteNumber(raw.print_error) !== 0 && !isPauseNotice(raw, requireIdle))
|
|
327
337
|
throw new Error("Printer reports a print error or did not report its error state.");
|
|
328
338
|
if (!Array.isArray(raw.hms))
|
|
329
339
|
throw new Error("Printer HMS error state is missing or malformed.");
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pause-at-layer for Bambu-compatible slicer CLIs ("Add pause" in Bambu Studio
|
|
3
|
+
* and OrcaSlicer). The slicer writes the machine's own machine_pause_gcode
|
|
4
|
+
* (M400 U1 on Bambu printers) before the chosen layer, so the printer pauses
|
|
5
|
+
* by itself there and waits for Resume; no remote command is involved.
|
|
6
|
+
*
|
|
7
|
+
* The CLI takes these as --load-custom-gcodes <json> (CustomGCode::Info). It
|
|
8
|
+
* does not apply the pauses a project 3MF already carries in
|
|
9
|
+
* Metadata/custom_gcode_per_print_z.xml, so those are read here and passed the
|
|
10
|
+
* same way. A pause's print_z must be the exact top of its layer: a height
|
|
11
|
+
* between layers lands on the layer below.
|
|
12
|
+
*/
|
|
13
|
+
/** CustomGCode::Type, in the order bbs_3mf.cpp writes it as an integer. */
|
|
14
|
+
declare const CUSTOM_GCODE_TYPES: readonly ["ColorChange", "PausePrint", "ToolChange", "Template", "Custom", "Unknown"];
|
|
15
|
+
export type CustomGcodeType = (typeof CUSTOM_GCODE_TYPES)[number];
|
|
16
|
+
export interface CustomGcodeItem {
|
|
17
|
+
type: CustomGcodeType;
|
|
18
|
+
print_z: number;
|
|
19
|
+
color: string;
|
|
20
|
+
extruder: number;
|
|
21
|
+
extra: string;
|
|
22
|
+
}
|
|
23
|
+
export interface CustomGcodeInfo {
|
|
24
|
+
mode: string;
|
|
25
|
+
gcodes: CustomGcodeItem[];
|
|
26
|
+
}
|
|
27
|
+
/** 1-based layer numbers, as Bambu Studio's and OrcaSlicer's preview slider count them. */
|
|
28
|
+
export declare function parsePauseLayers(value: unknown): number[] | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The custom G-codes (pauses, colour changes, ...) a project 3MF stores for
|
|
31
|
+
* one plate (1-based), as Bambu Studio and OrcaSlicer save them.
|
|
32
|
+
*/
|
|
33
|
+
export declare function readProjectCustomGcodes(threeMfPath: string, plate?: number): Promise<CustomGcodeInfo | undefined>;
|
|
34
|
+
/** The plate's G-code text inside a sliced 3MF. */
|
|
35
|
+
export declare function readPlateGcode(threeMfPath: string, plate?: number): Promise<string | undefined>;
|
|
36
|
+
/** Each layer's top Z in order, from the slicer's "; Z_HEIGHT:" markers. */
|
|
37
|
+
export declare function layerTops(gcode: string): number[];
|
|
38
|
+
/**
|
|
39
|
+
* The 1-based layers whose block holds a pause: the slicer's "; PAUSE_PRINTING"
|
|
40
|
+
* marker or the machine's pause G-code on its own line.
|
|
41
|
+
*/
|
|
42
|
+
export declare function pausedLayers(gcode: string, pauseGcode?: string): number[];
|
|
43
|
+
/** The machine_pause_gcode a sliced file was made with (its config block), else Bambu's M400 U1. */
|
|
44
|
+
export declare function machinePauseGcode(gcode: string): string;
|
|
45
|
+
/** Project custom G-codes plus a pause before each requested layer, at that layer's exact top. */
|
|
46
|
+
export declare function customGcodesWithPauses(tops: number[], layers: number[], project?: CustomGcodeInfo): CustomGcodeInfo;
|
|
47
|
+
export {};
|