bambu-printer-mcp 1.1.65 → 1.1.67
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 +40 -6
- package/dist/3mf_parser.d.ts +12 -1
- package/dist/3mf_parser.js +47 -17
- package/dist/counterpart/remote.js +4 -0
- package/dist/design-app-setup.d.ts +384 -0
- package/dist/design-app-setup.js +654 -0
- package/dist/fusion-mcp-bridge.d.ts +11 -2
- package/dist/fusion-mcp-bridge.js +9 -4
- package/dist/index.js +57 -8
- package/dist/tool-annotations.js +4 -0
- package/package.json +1 -1
- package/src/3mf_parser.ts +51 -17
- package/src/counterpart/remote.ts +4 -0
- package/src/design-app-setup.ts +640 -0
- package/src/fusion-mcp-bridge.ts +9 -4
- package/src/index.ts +56 -8
- package/src/tool-annotations.ts +4 -0
package/README.md
CHANGED
|
@@ -1139,7 +1139,7 @@ Inspect the slicer settings embedded in a saved 3MF template or in an extracted
|
|
|
1139
1139
|
}
|
|
1140
1140
|
```
|
|
1141
1141
|
|
|
1142
|
-
This returns a compact summary of the high-signal settings such as printer preset, default print profile, filament profiles, layer height, infill density, shell counts, support mode, and bed type. It accepts either `source_path` or `template_name`. For 3MF inputs it also writes the extracted settings blob to a temp path so the result can be reused directly, and returns `own_process`. With `source_path`, pass the slice's other arguments too (`slicer_profile`, `template_name`, `template_3mf_path`, `layer_height`, `wall_loops`, `sparse_infill_density`, `quality`, `strength`). `own_process` is then true when that `slice_stl` call prints the process the 3MF carries (a designer's project) unchanged.
|
|
1142
|
+
This returns a compact summary of the high-signal settings such as printer preset, default print profile, filament profiles, layer height, infill density, shell counts, support mode, and bed type. It accepts either `source_path` or `template_name`. For 3MF inputs it also writes the extracted settings blob to a temp path so the result can be reused directly, and returns `own_process`. With `source_path`, pass the slice's other arguments too (`slicer_profile`, `template_name`, `template_3mf_path`, `layer_height`, `wall_loops`, `sparse_infill_density`, `quality`, `strength`). `own_process` is then true when that `slice_stl` call prints the process the 3MF carries (a designer's project) unchanged. A 3MF with no slicer settings returns `raw_key_count` 0 and no extracted path; a file that can't be read is an error.
|
|
1143
1143
|
|
|
1144
1144
|
#### slice_with_template
|
|
1145
1145
|
|
|
@@ -1254,6 +1254,18 @@ Blender. Set the command to your full `uvx` path and the argument array to
|
|
|
1254
1254
|
`["blender-mcp"]`. The Claude Desktop extension also offers these two optional
|
|
1255
1255
|
settings. Printer tools work without Blender configured.
|
|
1256
1256
|
|
|
1257
|
+
`blender_mcp_setup` checks the MCP for Blender add-on that the configured
|
|
1258
|
+
package needs, when the bridge is that package run with `uvx`: which add-on file
|
|
1259
|
+
Blender loads (for the running Blender's version), its protocol and the one the
|
|
1260
|
+
package expects, whether Blender is listening, and the running add-on's own
|
|
1261
|
+
`get_addon_status`. It changes nothing. With `{"update": true}` it stages the
|
|
1262
|
+
add-on with the package's own installer (`mcp-for-blender install-addon`) at the
|
|
1263
|
+
inspected version, checks that the installed and staged files are both regular
|
|
1264
|
+
MCP for Blender add-ons and that the staged one carries the expected protocol,
|
|
1265
|
+
keeps the old file as a backup next to it, and renames the new one into place.
|
|
1266
|
+
It never starts, stops or edits Blender: re-enable the add-on or restart Blender
|
|
1267
|
+
to load it. Another bridge reports `supported: false` and keeps its own installer.
|
|
1268
|
+
|
|
1257
1269
|
1. Call `blender_mcp_status` with `{"connect": true}` to initialize the server
|
|
1258
1270
|
and discover its tools and input schemas. A connected MCP server does not
|
|
1259
1271
|
by itself prove that the Blender addon is running.
|
|
@@ -1318,14 +1330,36 @@ Design a part from scratch in Autodesk Fusion through
|
|
|
1318
1330
|
free personal-use licence, are yours: this server never installs or requires
|
|
1319
1331
|
Fusion, and printer tools work without it.
|
|
1320
1332
|
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1333
|
+
The bridge and its setup pin [DMontgomery40/fusion360-mcp-server](https://github.com/DMontgomery40/fusion360-mcp-server) at commit
|
|
1334
|
+
`86a3016a5a5b`: faust-machines' server and add-in with document binding, which
|
|
1335
|
+
`fusion_mcp_new_design`'s `bind_document` needs, while that change is reviewed
|
|
1336
|
+
upstream.
|
|
1337
|
+
|
|
1338
|
+
On macOS, `fusion_mcp_setup` sets it up. Without arguments it reports, changing
|
|
1339
|
+
nothing: whether Fusion is installed, whether the add-in in
|
|
1340
|
+
`~/Library/Application Support/Autodesk/Autodesk Fusion 360/API/AddIns/Fusion360MCP`
|
|
1341
|
+
is at the pin and runs on startup, whether the login item that gives Fusion
|
|
1342
|
+
`FUSION_MCP_PORT` is installed, and whether this server has its Fusion settings.
|
|
1343
|
+
With `{"install": true}` it installs what is missing:
|
|
1344
|
+
|
|
1345
|
+
- the add-in from the pinned commit's archive, after checking every file against
|
|
1346
|
+
its SHA-256 (a symlink, an extra file or a changed byte installs nothing), set
|
|
1347
|
+
to **Run on Startup**. An add-in already at the pin is left in place;
|
|
1348
|
+
- a login LaunchAgent, `com.scantomake.mac.fusion-port`, that runs
|
|
1349
|
+
`launchctl setenv FUSION_MCP_PORT 9877` at login, because Fusion opened from the
|
|
1350
|
+
Dock never reads this server's env file;
|
|
1351
|
+
- the settings this server is missing, added to its own `.env` after a copy of
|
|
1352
|
+
the file. A configured `FUSION_MCP_COMMAND` is kept with its arguments, so a
|
|
1353
|
+
reviewed local runtime isn't replaced. The running server uses them at once.
|
|
1354
|
+
|
|
1355
|
+
It never starts or quits Fusion; `fusion_mcp_status` checks the connection. On
|
|
1356
|
+
other systems, or by hand: copy the repository's `addon/` folder at that commit
|
|
1357
|
+
to the AddIns folder above, set it to **Run on Startup**, and add these settings
|
|
1358
|
+
next to the Blender ones in your env file:
|
|
1325
1359
|
|
|
1326
1360
|
```bash
|
|
1327
1361
|
FUSION_MCP_COMMAND=uvx
|
|
1328
|
-
FUSION_MCP_ARGS='["--from","git+https://github.com/
|
|
1362
|
+
FUSION_MCP_ARGS='["--from","git+https://github.com/DMontgomery40/fusion360-mcp-server@86a3016a5a5b","fusion360-mcp-server","--mode","socket"]'
|
|
1329
1363
|
FUSION_MCP_TIMEOUT_MS=180000
|
|
1330
1364
|
FUSION_MCP_HOST=localhost
|
|
1331
1365
|
# The default here; Blender's MCP add-on holds the add-in's own default, 9876.
|
package/dist/3mf_parser.d.ts
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { ThreeMFData, CollarCharmAnalysis, ThreeMFAmsRequirements, ThreeMFPlateObjects } from './types.js';
|
|
2
|
+
/** Whether a 3MF carries a slicer settings file at all (readable or not). */
|
|
3
|
+
export declare function hasSlicerSettingsFile(filePath: string): Promise<boolean>;
|
|
2
4
|
export { ThreeMFData };
|
|
3
5
|
export declare function parse3MF(filePath: string): Promise<ThreeMFData>;
|
|
4
6
|
/** Whether a 3MF carries its own Bambu Studio/Orca process (a designer's project, not a bare mesh archive). */
|
|
5
7
|
export declare function hasBambuProjectSettings(filePath: string): Promise<boolean>;
|
|
6
|
-
|
|
8
|
+
/** Runs one operation; the directory of every settings file extracted during it is removed when it settles. */
|
|
9
|
+
export declare function withExtractedSettingsCleanup<T>(operation: () => Promise<T>): Promise<T>;
|
|
10
|
+
/**
|
|
11
|
+
* Writes a 3MF's slicer settings to a file of their own and returns its path. Each extraction gets its own directory,
|
|
12
|
+
* removed when the surrounding withExtractedSettingsCleanup operation settles. `keep` is for a path handed back to the
|
|
13
|
+
* caller: it is named by content, so repeat calls reuse one file, and written whole before it is renamed into place.
|
|
14
|
+
*/
|
|
15
|
+
export declare function extractBambuTemplateSettings(filePath: string, outputDir: string, options?: {
|
|
16
|
+
keep?: boolean;
|
|
17
|
+
}): Promise<string>;
|
|
7
18
|
export declare function analyzeCollarCharm3MF(filePath: string, plateIndex?: number): Promise<CollarCharmAnalysis>;
|
|
8
19
|
export declare function getCollarCharmRolePolicy(): {
|
|
9
20
|
colors: {
|
package/dist/3mf_parser.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import JSZip from 'jszip';
|
|
2
2
|
import { parseStringPromise } from 'xml2js';
|
|
3
3
|
import * as fs from 'fs/promises';
|
|
4
|
-
import {
|
|
4
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
5
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
6
|
+
import * as path from 'node:path';
|
|
5
7
|
// Parses Bambu Studio's JSON config data
|
|
6
8
|
function parseBambuJSONConfig(jsonData) {
|
|
7
9
|
const config = {};
|
|
@@ -76,14 +78,21 @@ function parseBambuJSONConfig(jsonData) {
|
|
|
76
78
|
}
|
|
77
79
|
return config;
|
|
78
80
|
}
|
|
81
|
+
/** The files a 3MF's slicer settings are read from, first found wins. */
|
|
82
|
+
const SLICER_SETTINGS_FILES = [
|
|
83
|
+
'Metadata/project_settings.config',
|
|
84
|
+
'Metadata/Slic3r_PE.config',
|
|
85
|
+
'Metadata/model_settings.config',
|
|
86
|
+
'Metadata/slice_info.config'
|
|
87
|
+
];
|
|
88
|
+
/** Whether a 3MF carries a slicer settings file at all (readable or not). */
|
|
89
|
+
export async function hasSlicerSettingsFile(filePath) {
|
|
90
|
+
const zip = await JSZip.loadAsync(await fs.readFile(filePath));
|
|
91
|
+
return SLICER_SETTINGS_FILES.some(name => zip.file(name));
|
|
92
|
+
}
|
|
79
93
|
async function parseBambuConfig(zip) {
|
|
80
94
|
// Look for common Bambu config file names
|
|
81
|
-
const potentialFiles =
|
|
82
|
-
'Metadata/project_settings.config',
|
|
83
|
-
'Metadata/Slic3r_PE.config',
|
|
84
|
-
'Metadata/model_settings.config',
|
|
85
|
-
'Metadata/slice_info.config'
|
|
86
|
-
];
|
|
95
|
+
const potentialFiles = SLICER_SETTINGS_FILES;
|
|
87
96
|
let configFile = null;
|
|
88
97
|
let configContent = '';
|
|
89
98
|
for (const name of potentialFiles) {
|
|
@@ -234,23 +243,44 @@ export async function hasBambuProjectSettings(filePath) {
|
|
|
234
243
|
return false;
|
|
235
244
|
}
|
|
236
245
|
}
|
|
237
|
-
|
|
246
|
+
const extractionScope = new AsyncLocalStorage();
|
|
247
|
+
/** Runs one operation; the directory of every settings file extracted during it is removed when it settles. */
|
|
248
|
+
export async function withExtractedSettingsCleanup(operation) {
|
|
249
|
+
const dirs = [];
|
|
250
|
+
try {
|
|
251
|
+
return await extractionScope.run(dirs, operation);
|
|
252
|
+
}
|
|
253
|
+
finally {
|
|
254
|
+
await Promise.all(dirs.map(dir => fs.rm(dir, { recursive: true, force: true }).catch(() => undefined)));
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Writes a 3MF's slicer settings to a file of their own and returns its path. Each extraction gets its own directory,
|
|
259
|
+
* removed when the surrounding withExtractedSettingsCleanup operation settles. `keep` is for a path handed back to the
|
|
260
|
+
* caller: it is named by content, so repeat calls reuse one file, and written whole before it is renamed into place.
|
|
261
|
+
*/
|
|
262
|
+
export async function extractBambuTemplateSettings(filePath, outputDir, options = {}) {
|
|
238
263
|
const data = await fs.readFile(filePath);
|
|
239
264
|
const zip = await JSZip.loadAsync(data);
|
|
240
|
-
const potentialFiles =
|
|
241
|
-
'Metadata/project_settings.config',
|
|
242
|
-
'Metadata/Slic3r_PE.config',
|
|
243
|
-
'Metadata/model_settings.config',
|
|
244
|
-
'Metadata/slice_info.config'
|
|
245
|
-
];
|
|
265
|
+
const potentialFiles = SLICER_SETTINGS_FILES;
|
|
246
266
|
for (const name of potentialFiles) {
|
|
247
267
|
const file = zip.file(name);
|
|
248
268
|
if (!file)
|
|
249
269
|
continue;
|
|
250
270
|
const content = await file.async('string');
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
271
|
+
if (options.keep) {
|
|
272
|
+
const digest = createHash('sha256').update(content).digest('hex').slice(0, 16);
|
|
273
|
+
const outputPath = path.join(outputDir, `${digest}_${name.replace(/\//g, '_')}`);
|
|
274
|
+
const partial = `${outputPath}.${randomUUID()}.partial`;
|
|
275
|
+
await fs.writeFile(partial, content, 'utf8');
|
|
276
|
+
await fs.rename(partial, outputPath);
|
|
277
|
+
return outputPath;
|
|
278
|
+
}
|
|
279
|
+
// Its own directory for every extraction, so two slices at once (of different projects or the same one)
|
|
280
|
+
// never share, overwrite or half-read one settings file.
|
|
281
|
+
const dir = await fs.mkdtemp(path.join(outputDir, 'slicer-settings-'));
|
|
282
|
+
extractionScope.getStore()?.push(dir);
|
|
283
|
+
const outputPath = path.join(dir, name.replace(/\//g, '_'));
|
|
254
284
|
await fs.writeFile(outputPath, content, 'utf8');
|
|
255
285
|
return outputPath;
|
|
256
286
|
}
|
|
@@ -18,6 +18,8 @@ export const REMOTE_SCOPES = {
|
|
|
18
18
|
counterpart_printer_info: "read",
|
|
19
19
|
counterpart_print_progress: "read",
|
|
20
20
|
fusion_mcp_status: "read",
|
|
21
|
+
blender_mcp_setup: "read", // checks only; update raises it
|
|
22
|
+
fusion_mcp_setup: "read", // checks only; install raises it
|
|
21
23
|
// design
|
|
22
24
|
slice_stl: "design",
|
|
23
25
|
lay_flat: "design",
|
|
@@ -69,6 +71,8 @@ export const REMOTE_SCOPES = {
|
|
|
69
71
|
const RAISED_BY = {
|
|
70
72
|
fusion_mcp_status: { launch: "design" }, // starts Fusion on this computer
|
|
71
73
|
blender_mcp_status: { connect: "design" }, // connects to Blender
|
|
74
|
+
blender_mcp_setup: { update: "raw" }, // replaces the add-on in the person's Blender
|
|
75
|
+
fusion_mcp_setup: { install: "raw" }, // installs into the person's Fusion, a login item and this server's .env
|
|
72
76
|
};
|
|
73
77
|
/**
|
|
74
78
|
* Overrides of a server's own configuration (both printer MCPs use the same names): the printer it targets, its
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/** What these tools reach outside the server: tests replace every field. */
|
|
2
|
+
export type SetupSystem = {
|
|
3
|
+
platform: NodeJS.Platform;
|
|
4
|
+
home: string;
|
|
5
|
+
/** Where staged downloads and installer output go before they are checked. */
|
|
6
|
+
tmp: string;
|
|
7
|
+
uid: number;
|
|
8
|
+
/** The working directory dotenv read `.env` from when the server started. */
|
|
9
|
+
cwd: string;
|
|
10
|
+
run(file: string, args: string[], options?: {
|
|
11
|
+
env?: NodeJS.ProcessEnv;
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
cwd?: string;
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
}): Promise<{
|
|
16
|
+
stdout: string;
|
|
17
|
+
}>;
|
|
18
|
+
download(url: string, signal?: AbortSignal): Promise<Buffer>;
|
|
19
|
+
/** Whether something accepts a TCP connection on host:port within a second. */
|
|
20
|
+
listening(host: string, port: number): Promise<boolean>;
|
|
21
|
+
/** Installed Autodesk Fusion apps found by bundle identifier (Spotlight). */
|
|
22
|
+
fusionByBundleId(): Promise<string[]>;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* What a setup subprocess (uvx and the Blender package it runs, tar, launchctl) may see: the basic login
|
|
26
|
+
* environment, uv's own settings and the Blender bridge's, never printer access codes or other server secrets,
|
|
27
|
+
* as the Blender bridge's own environment.
|
|
28
|
+
*/
|
|
29
|
+
export declare function setupEnvironment(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
30
|
+
export declare const defaultSetupSystem: SetupSystem;
|
|
31
|
+
/** The add-on's own default port; BLENDER_HOST and BLENDER_PORT move it, as they do for the Blender MCP server. */
|
|
32
|
+
export declare const BLENDER_ADDON_DEFAULT_PORT = 9876;
|
|
33
|
+
/** The running add-on's answer to get_addon_status, as far as setup needs it. */
|
|
34
|
+
export type BlenderAddonHandshake = {
|
|
35
|
+
up_to_date?: boolean;
|
|
36
|
+
protocol_version?: number | null;
|
|
37
|
+
expected_protocol_version?: number;
|
|
38
|
+
blender_version?: string | null;
|
|
39
|
+
};
|
|
40
|
+
/** get_addon_status's result, structured or as JSON text; a failed call throws with the add-on's own words. */
|
|
41
|
+
export declare function parseAddonHandshake(reply: {
|
|
42
|
+
isError?: boolean;
|
|
43
|
+
structuredContent?: unknown;
|
|
44
|
+
content?: {
|
|
45
|
+
type: string;
|
|
46
|
+
text?: string;
|
|
47
|
+
}[];
|
|
48
|
+
}): BlenderAddonHandshake | undefined;
|
|
49
|
+
export type BlenderSetupReport = {
|
|
50
|
+
/** False when the configured bridge isn't the upstream MCP for Blender package run with uvx; see reason. */
|
|
51
|
+
supported: boolean;
|
|
52
|
+
reason?: "not-configured" | "custom-command" | "custom-package";
|
|
53
|
+
package?: string;
|
|
54
|
+
package_version?: string;
|
|
55
|
+
/** The add-on protocol the configured package needs. */
|
|
56
|
+
expected_protocol?: number;
|
|
57
|
+
/** Something answers on the add-on's port: Blender is running with the add-on started. */
|
|
58
|
+
listening: boolean;
|
|
59
|
+
/** The running add-on's handshake; null when it doesn't report one or couldn't be read (see live_error). Only read while listening. */
|
|
60
|
+
live?: BlenderAddonHandshake | null;
|
|
61
|
+
/** Why the running add-on's handshake couldn't be read. */
|
|
62
|
+
live_error?: string;
|
|
63
|
+
/** The add-on file Blender loads, and its protocol (null when the file has none). */
|
|
64
|
+
target?: {
|
|
65
|
+
path: string;
|
|
66
|
+
protocol: number | null;
|
|
67
|
+
} | null;
|
|
68
|
+
/** Why there is no target. */
|
|
69
|
+
target_problem?: "not-installed" | "several-modules";
|
|
70
|
+
/** What the person can do, in plain words, when the add-on can't be checked or updated here (reason, target_problem). */
|
|
71
|
+
message?: string;
|
|
72
|
+
/** The installed file's protocol is what the package expects. */
|
|
73
|
+
current?: boolean;
|
|
74
|
+
/** Set by update. */
|
|
75
|
+
replaced?: boolean;
|
|
76
|
+
backup?: string;
|
|
77
|
+
};
|
|
78
|
+
/** One add-on module per Blender version folder; other versions are separate installs. */
|
|
79
|
+
export declare function selectBlenderAddonTarget(files: {
|
|
80
|
+
path?: unknown;
|
|
81
|
+
protocol?: unknown;
|
|
82
|
+
}[], blenderVersion?: string | null): {
|
|
83
|
+
target: {
|
|
84
|
+
path: string;
|
|
85
|
+
protocol: number | null;
|
|
86
|
+
};
|
|
87
|
+
} | {
|
|
88
|
+
problem: "not-installed" | "several-modules";
|
|
89
|
+
};
|
|
90
|
+
export declare class BlenderAddonSetup {
|
|
91
|
+
/** The running add-on's get_addon_status through this server's Blender bridge; undefined when it has none. */
|
|
92
|
+
private readonly handshake;
|
|
93
|
+
private readonly system;
|
|
94
|
+
private readonly env;
|
|
95
|
+
constructor(
|
|
96
|
+
/** The running add-on's get_addon_status through this server's Blender bridge; undefined when it has none. */
|
|
97
|
+
handshake: () => Promise<BlenderAddonHandshake | undefined>, system?: SetupSystem, env?: NodeJS.ProcessEnv);
|
|
98
|
+
private inspect;
|
|
99
|
+
/** What is installed, what the package expects, and what the running add-on says. Changes nothing. */
|
|
100
|
+
check(): Promise<BlenderSetupReport>;
|
|
101
|
+
/**
|
|
102
|
+
* Replaces the installed add-on file with the one the configured package's own installer stages, pinned to the
|
|
103
|
+
* inspected version. The existing file must be a regular local MCP for Blender add-on; the staged one must carry
|
|
104
|
+
* the expected protocol. The old file is kept as a backup next to it, and the new one is renamed into place.
|
|
105
|
+
* Blender keeps running the add-on it loaded until it is re-enabled or restarted.
|
|
106
|
+
*/
|
|
107
|
+
/** `signal` ends the request: the installer is stopped and nothing is replaced once it is aborted. */
|
|
108
|
+
update(signal?: AbortSignal): Promise<BlenderSetupReport>;
|
|
109
|
+
private readonly serial;
|
|
110
|
+
private replace;
|
|
111
|
+
}
|
|
112
|
+
export declare const BLENDER_SETUP_OUTPUT_SCHEMA: {
|
|
113
|
+
readonly type: "object";
|
|
114
|
+
readonly properties: {
|
|
115
|
+
readonly supported: {
|
|
116
|
+
readonly type: "boolean";
|
|
117
|
+
readonly description: "The configured bridge is the upstream MCP for Blender package run with uvx, so this tool can check and update its add-on.";
|
|
118
|
+
};
|
|
119
|
+
readonly reason: {
|
|
120
|
+
readonly type: "string";
|
|
121
|
+
readonly enum: readonly ["not-configured", "custom-command", "custom-package"];
|
|
122
|
+
};
|
|
123
|
+
readonly package: {
|
|
124
|
+
readonly type: "string";
|
|
125
|
+
readonly description: "The package as BLENDER_MCP_ARGS names it.";
|
|
126
|
+
};
|
|
127
|
+
readonly package_version: {
|
|
128
|
+
readonly type: "string";
|
|
129
|
+
};
|
|
130
|
+
readonly expected_protocol: {
|
|
131
|
+
readonly type: "integer";
|
|
132
|
+
readonly description: "The add-on protocol the package needs.";
|
|
133
|
+
};
|
|
134
|
+
readonly listening: {
|
|
135
|
+
readonly type: "boolean";
|
|
136
|
+
readonly description: "The add-on answers on BLENDER_HOST:BLENDER_PORT (default localhost:9876): Blender is running with it started.";
|
|
137
|
+
};
|
|
138
|
+
readonly live: {
|
|
139
|
+
readonly type: readonly ["object", "null"];
|
|
140
|
+
readonly description: "The running add-on's get_addon_status (up_to_date, protocol_version, expected_protocol_version, blender_version); null when it has none or it couldn't be read. Only while listening.";
|
|
141
|
+
};
|
|
142
|
+
readonly live_error: {
|
|
143
|
+
readonly type: "string";
|
|
144
|
+
readonly description: "Why the running add-on's handshake couldn't be read.";
|
|
145
|
+
};
|
|
146
|
+
readonly target: {
|
|
147
|
+
readonly type: readonly ["object", "null"];
|
|
148
|
+
readonly properties: {
|
|
149
|
+
readonly path: {
|
|
150
|
+
readonly type: "string";
|
|
151
|
+
};
|
|
152
|
+
readonly protocol: {
|
|
153
|
+
readonly type: readonly ["integer", "null"];
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
readonly required: readonly ["path", "protocol"];
|
|
157
|
+
readonly description: "The add-on file Blender loads (for the running Blender's version, when it reports one).";
|
|
158
|
+
};
|
|
159
|
+
readonly target_problem: {
|
|
160
|
+
readonly type: "string";
|
|
161
|
+
readonly enum: readonly ["not-installed", "several-modules"];
|
|
162
|
+
};
|
|
163
|
+
readonly message: {
|
|
164
|
+
readonly type: "string";
|
|
165
|
+
readonly description: "What the person can do, in plain words, when the add-on can't be checked or updated here (with reason or target_problem). Clients show it as it is.";
|
|
166
|
+
};
|
|
167
|
+
readonly current: {
|
|
168
|
+
readonly type: "boolean";
|
|
169
|
+
readonly description: "The installed file carries the expected protocol. A running Blender may still have the old add-on loaded: see live.";
|
|
170
|
+
};
|
|
171
|
+
readonly replaced: {
|
|
172
|
+
readonly type: "boolean";
|
|
173
|
+
readonly description: "update: the file was replaced. Blender runs the new add-on once it is re-enabled or Blender restarts.";
|
|
174
|
+
};
|
|
175
|
+
readonly backup: {
|
|
176
|
+
readonly type: "string";
|
|
177
|
+
readonly description: "update: the previous add-on file, kept next to it.";
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
readonly required: readonly ["supported", "listening"];
|
|
181
|
+
};
|
|
182
|
+
/** The add-in and server commit Counterpart's Fusion design passes were accepted on (document binding, PRD §8.9). */
|
|
183
|
+
export declare const FUSION_ADDIN_REPOSITORY = "DMontgomery40/fusion360-mcp-server";
|
|
184
|
+
export declare const FUSION_ADDIN_COMMIT = "86a3016a5a5b4a705228acc2f3b75aff7dcfd758";
|
|
185
|
+
/** SHA-256 of every file in the add-in (`addon/`) at that commit. Setup installs nothing else. */
|
|
186
|
+
export declare const FUSION_ADDIN_FILES: Readonly<Record<string, string>>;
|
|
187
|
+
export type FusionAddinPin = {
|
|
188
|
+
repository: string;
|
|
189
|
+
commit: string;
|
|
190
|
+
files: Readonly<Record<string, string>>;
|
|
191
|
+
};
|
|
192
|
+
export declare const FUSION_ADDIN_PIN: FusionAddinPin;
|
|
193
|
+
/** A login agent that gives Fusion the add-in's port however Fusion is opened (a GUI app never reads this .env). */
|
|
194
|
+
export declare const FUSION_PORT_AGENT_LABEL = "com.scantomake.mac.fusion-port";
|
|
195
|
+
export type FusionSetupReport = {
|
|
196
|
+
platform: string;
|
|
197
|
+
/** Setup installs on macOS only. */
|
|
198
|
+
supported: boolean;
|
|
199
|
+
fusion: {
|
|
200
|
+
installed: boolean;
|
|
201
|
+
path: string | null;
|
|
202
|
+
};
|
|
203
|
+
pin: {
|
|
204
|
+
repository: string;
|
|
205
|
+
commit: string;
|
|
206
|
+
};
|
|
207
|
+
addin: {
|
|
208
|
+
path: string;
|
|
209
|
+
installed: boolean;
|
|
210
|
+
matches_pin: boolean;
|
|
211
|
+
run_on_startup: boolean;
|
|
212
|
+
};
|
|
213
|
+
port: number;
|
|
214
|
+
port_agent: {
|
|
215
|
+
path: string;
|
|
216
|
+
installed: boolean;
|
|
217
|
+
};
|
|
218
|
+
/** FUSION_MCP_COMMAND is set for this server. */
|
|
219
|
+
configured: boolean;
|
|
220
|
+
/** The .env this server read at start, when there is one. */
|
|
221
|
+
env_file: string | null;
|
|
222
|
+
/** Add-in at the pin, port agent installed and the bridge configured. Fusion itself may still need opening. */
|
|
223
|
+
ready: boolean;
|
|
224
|
+
/** When not ready: what is missing and what to do, in plain words clients show as they are. */
|
|
225
|
+
message?: string;
|
|
226
|
+
/** Set by install. */
|
|
227
|
+
installed?: {
|
|
228
|
+
addin: "installed" | "already-current";
|
|
229
|
+
port_agent: "installed" | "already-current";
|
|
230
|
+
env: "written" | "already-configured" | "no-env-file";
|
|
231
|
+
env_backup?: string;
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
export declare class FusionAddinSetup {
|
|
235
|
+
/** FUSION_MCP_PORT, as the bridge resolves it. */
|
|
236
|
+
private readonly port;
|
|
237
|
+
/** The bridge arguments for the pinned server, written with the add-in so the two always match. */
|
|
238
|
+
private readonly serverArgs;
|
|
239
|
+
private readonly system;
|
|
240
|
+
private readonly env;
|
|
241
|
+
private readonly pin;
|
|
242
|
+
constructor(
|
|
243
|
+
/** FUSION_MCP_PORT, as the bridge resolves it. */
|
|
244
|
+
port: () => number,
|
|
245
|
+
/** The bridge arguments for the pinned server, written with the add-in so the two always match. */
|
|
246
|
+
serverArgs: readonly string[], system?: SetupSystem, env?: NodeJS.ProcessEnv, pin?: FusionAddinPin);
|
|
247
|
+
private get addinsFolder();
|
|
248
|
+
private get addinFolder();
|
|
249
|
+
private get portAgent();
|
|
250
|
+
private findFusion;
|
|
251
|
+
/** Each pinned file at its pinned bytes; the manifest may carry only setup's runOnStartup change. Fusion's own caches are ignored. */
|
|
252
|
+
private installedMatchesPin;
|
|
253
|
+
private portAgentPlist;
|
|
254
|
+
/**
|
|
255
|
+
* The agent is installed when it sets this port and launchd has it loaded in the login session: a file whose load
|
|
256
|
+
* failed is installed again. An agent written for another port is replaced by install.
|
|
257
|
+
*/
|
|
258
|
+
private portAgentInstalled;
|
|
259
|
+
/** What is installed. Changes nothing. */
|
|
260
|
+
check(): Promise<FusionSetupReport>;
|
|
261
|
+
/** The pinned add-in, downloaded and checked file by file: every entry a regular file or folder, nothing extra, nothing missing. */
|
|
262
|
+
private downloadAddin;
|
|
263
|
+
private installAddin;
|
|
264
|
+
/** Writes the agent and loads it in the person's login session, where its RunAtLoad sets FUSION_MCP_PORT. */
|
|
265
|
+
private installPortAgent;
|
|
266
|
+
/**
|
|
267
|
+
* Adds the bridge settings this server is missing to its own .env, after a copy of the file. A configured
|
|
268
|
+
* FUSION_MCP_COMMAND is kept with its arguments: it may be a reviewed local runtime. The running server takes
|
|
269
|
+
* the new settings at once.
|
|
270
|
+
*/
|
|
271
|
+
private writeSettings;
|
|
272
|
+
/** Installs the pinned add-in set to run on startup, the port login item, and this server's missing bridge settings. */
|
|
273
|
+
/** `signal` ends the request: the download and tar are stopped, and nothing more is written once it is aborted. */
|
|
274
|
+
install(signal?: AbortSignal): Promise<FusionSetupReport>;
|
|
275
|
+
private readonly serial;
|
|
276
|
+
private installMissing;
|
|
277
|
+
}
|
|
278
|
+
export declare const FUSION_SETUP_OUTPUT_SCHEMA: {
|
|
279
|
+
readonly type: "object";
|
|
280
|
+
readonly properties: {
|
|
281
|
+
readonly platform: {
|
|
282
|
+
readonly type: "string";
|
|
283
|
+
};
|
|
284
|
+
readonly supported: {
|
|
285
|
+
readonly type: "boolean";
|
|
286
|
+
readonly description: "Setup installs on macOS only.";
|
|
287
|
+
};
|
|
288
|
+
readonly fusion: {
|
|
289
|
+
readonly type: "object";
|
|
290
|
+
readonly properties: {
|
|
291
|
+
readonly installed: {
|
|
292
|
+
readonly type: "boolean";
|
|
293
|
+
};
|
|
294
|
+
readonly path: {
|
|
295
|
+
readonly type: readonly ["string", "null"];
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
readonly required: readonly ["installed", "path"];
|
|
299
|
+
};
|
|
300
|
+
readonly pin: {
|
|
301
|
+
readonly type: "object";
|
|
302
|
+
readonly properties: {
|
|
303
|
+
readonly repository: {
|
|
304
|
+
readonly type: "string";
|
|
305
|
+
};
|
|
306
|
+
readonly commit: {
|
|
307
|
+
readonly type: "string";
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
readonly required: readonly ["repository", "commit"];
|
|
311
|
+
};
|
|
312
|
+
readonly addin: {
|
|
313
|
+
readonly type: "object";
|
|
314
|
+
readonly properties: {
|
|
315
|
+
readonly path: {
|
|
316
|
+
readonly type: "string";
|
|
317
|
+
};
|
|
318
|
+
readonly installed: {
|
|
319
|
+
readonly type: "boolean";
|
|
320
|
+
};
|
|
321
|
+
readonly matches_pin: {
|
|
322
|
+
readonly type: "boolean";
|
|
323
|
+
};
|
|
324
|
+
readonly run_on_startup: {
|
|
325
|
+
readonly type: "boolean";
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
readonly required: readonly ["path", "installed", "matches_pin", "run_on_startup"];
|
|
329
|
+
};
|
|
330
|
+
readonly port: {
|
|
331
|
+
readonly type: "integer";
|
|
332
|
+
};
|
|
333
|
+
readonly port_agent: {
|
|
334
|
+
readonly type: "object";
|
|
335
|
+
readonly properties: {
|
|
336
|
+
readonly path: {
|
|
337
|
+
readonly type: "string";
|
|
338
|
+
};
|
|
339
|
+
readonly installed: {
|
|
340
|
+
readonly type: "boolean";
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
readonly required: readonly ["path", "installed"];
|
|
344
|
+
};
|
|
345
|
+
readonly configured: {
|
|
346
|
+
readonly type: "boolean";
|
|
347
|
+
readonly description: "FUSION_MCP_COMMAND is set for this server.";
|
|
348
|
+
};
|
|
349
|
+
readonly env_file: {
|
|
350
|
+
readonly type: readonly ["string", "null"];
|
|
351
|
+
readonly description: "The .env this server read at start, when there is one.";
|
|
352
|
+
};
|
|
353
|
+
readonly ready: {
|
|
354
|
+
readonly type: "boolean";
|
|
355
|
+
readonly description: "The add-in is at the pin and runs on startup, the port login item is installed and the bridge is configured. Fusion may still need opening: see fusion_mcp_status.";
|
|
356
|
+
};
|
|
357
|
+
readonly message: {
|
|
358
|
+
readonly type: "string";
|
|
359
|
+
readonly description: "When not ready: what is missing and what to do, in plain words. Clients show it as it is.";
|
|
360
|
+
};
|
|
361
|
+
readonly installed: {
|
|
362
|
+
readonly type: "object";
|
|
363
|
+
readonly description: "install: what it did.";
|
|
364
|
+
readonly properties: {
|
|
365
|
+
readonly addin: {
|
|
366
|
+
readonly type: "string";
|
|
367
|
+
readonly enum: readonly ["installed", "already-current"];
|
|
368
|
+
};
|
|
369
|
+
readonly port_agent: {
|
|
370
|
+
readonly type: "string";
|
|
371
|
+
readonly enum: readonly ["installed", "already-current"];
|
|
372
|
+
};
|
|
373
|
+
readonly env: {
|
|
374
|
+
readonly type: "string";
|
|
375
|
+
readonly enum: readonly ["written", "already-configured", "no-env-file"];
|
|
376
|
+
};
|
|
377
|
+
readonly env_backup: {
|
|
378
|
+
readonly type: "string";
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
readonly required: readonly ["platform", "supported", "fusion", "pin", "addin", "port", "port_agent", "configured", "env_file", "ready"];
|
|
384
|
+
};
|