autodev-cli 1.4.151 → 1.4.153
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/media/gimp/gimp_mcp_client.py +204 -0
- package/media/gimp/gimp_mcp_server.py +306 -211
- package/out/commands/mcp.js +36 -30
- package/out/commands/mcp.js.map +1 -1
- package/out/configManager.js +39 -8
- package/out/configManager.js.map +1 -1
- package/out/core/gimpClientSource.d.ts +4 -0
- package/out/core/gimpClientSource.js +221 -0
- package/out/core/gimpClientSource.js.map +1 -0
- package/out/core/gimpPluginInstall.d.ts +36 -13
- package/out/core/gimpPluginInstall.js +150 -78
- package/out/core/gimpPluginInstall.js.map +1 -1
- package/out/core/gimpPluginSource.d.ts +3 -3
- package/out/core/gimpPluginSource.js +310 -215
- package/out/core/gimpPluginSource.js.map +1 -1
- package/out/core/mcpCatalog.d.ts +25 -17
- package/out/core/mcpCatalog.js +69 -36
- package/out/core/mcpCatalog.js.map +1 -1
- package/out/core/mcpCatalogMigrate.d.ts +9 -1
- package/out/core/mcpCatalogMigrate.js +34 -22
- package/out/core/mcpCatalogMigrate.js.map +1 -1
- package/package.json +1 -1
package/out/core/mcpCatalog.d.ts
CHANGED
|
@@ -20,22 +20,18 @@ export interface McpCatalogEntry {
|
|
|
20
20
|
notes: string[];
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* Display placeholder for the gimp client path BEFORE install (path unknown).
|
|
24
|
+
* `serverSpecFor('gimp', …)` with no resolved client path emits this so the
|
|
25
|
+
* catalog/detect JSON never bakes in a machine-specific path — and, crucially,
|
|
26
|
+
* never the broken raw-github upstream client. It also lets the migration
|
|
27
|
+
* recognise a not-yet-resolved gimp entry and upgrade it once GIMP is detected.
|
|
26
28
|
*/
|
|
27
|
-
export declare const GIMP_CLIENT_PLACEHOLDER = "<
|
|
29
|
+
export declare const GIMP_CLIENT_PLACEHOLDER = "<GIMP config>/mcp/gimp_mcp_client.py";
|
|
28
30
|
/**
|
|
29
|
-
* The
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* stdio server (it lazily connects to GIMP on localhost:9876, so it starts even
|
|
33
|
-
* without GIMP running). Verified end-to-end (valid MCP initialize handshake,
|
|
34
|
-
* clean exit). `mcp==1.2.0` is load-bearing — current mcp releases break this
|
|
35
|
-
* client on a removed `description=` kwarg.
|
|
31
|
+
* The pinned mcp SDK version the client runs under. Load-bearing — current mcp
|
|
32
|
+
* releases break the client on a removed `description=` kwarg. `uv run --with
|
|
33
|
+
* mcp==1.2.0 <client>` installs exactly this into an ephemeral env.
|
|
36
34
|
*/
|
|
37
|
-
export declare const GIMP_MCP_COMMIT = "49c46dd6146cb7393b42a9ecda630583b3117b33";
|
|
38
|
-
export declare const GIMP_MCP_CLIENT_URL = "https://raw.githubusercontent.com/libreearth/gimp-mcp/49c46dd6146cb7393b42a9ecda630583b3117b33/gimp_mcp_client.py";
|
|
39
35
|
export declare const GIMP_MCP_PIN = "mcp==1.2.0";
|
|
40
36
|
/** Per-platform install hint for the `uv`/`uvx` toolchain (never `pip install uv`). */
|
|
41
37
|
export declare function uvInstallHint(platform: NodeJS.Platform): string;
|
|
@@ -60,14 +56,26 @@ export declare const BLENDER_LAB_FROM = "git+https://projects.blender.org/lab/bl
|
|
|
60
56
|
* from Blender Lab" add-on. NEVER bare `uvx blender-mcp` (no --from) — that
|
|
61
57
|
* pulls the incompatible community PyPI package. (The exact launcher form is
|
|
62
58
|
* under review; the args are the load-bearing part the migration re-resolves.)
|
|
63
|
-
* - GIMP: the
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
59
|
+
* - GIMP: the LOCALLY-INSTALLED, user-verified client run by bare `uv`
|
|
60
|
+
* (`uv run --with mcp==1.2.0 <clientPath>`) on every platform. `clientPath`
|
|
61
|
+
* is the client installGimpPlugin() writes to <GIMP-config>/<ver>/mcp/. Pass
|
|
62
|
+
* the resolved path via `opts.gimpClientPath`; without it we emit the display
|
|
63
|
+
* placeholder (never the broken raw-github upstream client). Experimental.
|
|
67
64
|
*/
|
|
68
65
|
export declare function serverSpecFor(app: CreativeAppId, platform: NodeJS.Platform, opts?: {
|
|
69
66
|
gimpClientPath?: string;
|
|
70
67
|
}): McpJsonEntry;
|
|
68
|
+
/** The client-path argument carried by a gimp .mcp.json entry, whatever the command form. */
|
|
69
|
+
export declare function gimpClientArgOf(entry: {
|
|
70
|
+
command?: string;
|
|
71
|
+
args?: string[];
|
|
72
|
+
}): string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Is `arg` a CONCRETE local client path — a real filesystem path we must not
|
|
75
|
+
* clobber (a user's own checkout, or the client we already installed)? False for
|
|
76
|
+
* the display placeholder and for ANY URL (incl. the broken raw-github client).
|
|
77
|
+
*/
|
|
78
|
+
export declare function isConcreteGimpClientArg(arg: string | undefined): boolean;
|
|
71
79
|
/** Build the catalog for a given platform (install hints are platform-specific). */
|
|
72
80
|
export declare function getCatalog(platform: NodeJS.Platform): McpCatalogEntry[];
|
|
73
81
|
/** Lookup a single catalog entry. */
|
package/out/core/mcpCatalog.js
CHANGED
|
@@ -10,32 +10,29 @@
|
|
|
10
10
|
// flagged experimental because upstream ships no packaged launcher — see below.
|
|
11
11
|
// ---------------------------------------------------------------------------
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.BLENDER_LAB_FROM = exports.GIMP_MCP_PIN = exports.
|
|
13
|
+
exports.BLENDER_LAB_FROM = exports.GIMP_MCP_PIN = exports.GIMP_CLIENT_PLACEHOLDER = void 0;
|
|
14
14
|
exports.uvInstallHint = uvInstallHint;
|
|
15
15
|
exports.pythonInstallHint = pythonInstallHint;
|
|
16
16
|
exports.gitInstallHint = gitInstallHint;
|
|
17
17
|
exports.serverSpecFor = serverSpecFor;
|
|
18
|
+
exports.gimpClientArgOf = gimpClientArgOf;
|
|
19
|
+
exports.isConcreteGimpClientArg = isConcreteGimpClientArg;
|
|
18
20
|
exports.getCatalog = getCatalog;
|
|
19
21
|
exports.catalogEntry = catalogEntry;
|
|
20
22
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
23
|
+
* Display placeholder for the gimp client path BEFORE install (path unknown).
|
|
24
|
+
* `serverSpecFor('gimp', …)` with no resolved client path emits this so the
|
|
25
|
+
* catalog/detect JSON never bakes in a machine-specific path — and, crucially,
|
|
26
|
+
* never the broken raw-github upstream client. It also lets the migration
|
|
27
|
+
* recognise a not-yet-resolved gimp entry and upgrade it once GIMP is detected.
|
|
24
28
|
*/
|
|
25
|
-
exports.GIMP_CLIENT_PLACEHOLDER = '<
|
|
29
|
+
exports.GIMP_CLIENT_PLACEHOLDER = '<GIMP config>/mcp/gimp_mcp_client.py';
|
|
26
30
|
/**
|
|
27
|
-
* The
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* stdio server (it lazily connects to GIMP on localhost:9876, so it starts even
|
|
31
|
-
* without GIMP running). Verified end-to-end (valid MCP initialize handshake,
|
|
32
|
-
* clean exit). `mcp==1.2.0` is load-bearing — current mcp releases break this
|
|
33
|
-
* client on a removed `description=` kwarg.
|
|
31
|
+
* The pinned mcp SDK version the client runs under. Load-bearing — current mcp
|
|
32
|
+
* releases break the client on a removed `description=` kwarg. `uv run --with
|
|
33
|
+
* mcp==1.2.0 <client>` installs exactly this into an ephemeral env.
|
|
34
34
|
*/
|
|
35
|
-
exports.GIMP_MCP_COMMIT = '49c46dd6146cb7393b42a9ecda630583b3117b33';
|
|
36
|
-
exports.GIMP_MCP_CLIENT_URL = `https://raw.githubusercontent.com/libreearth/gimp-mcp/${exports.GIMP_MCP_COMMIT}/gimp_mcp_client.py`;
|
|
37
35
|
exports.GIMP_MCP_PIN = 'mcp==1.2.0';
|
|
38
|
-
const GIMP_GIT_ARGS = ['run', '--with', exports.GIMP_MCP_PIN, exports.GIMP_MCP_CLIENT_URL];
|
|
39
36
|
/** Per-platform install hint for the `uv`/`uvx` toolchain (never `pip install uv`). */
|
|
40
37
|
function uvInstallHint(platform) {
|
|
41
38
|
if (platform === 'win32') {
|
|
@@ -84,10 +81,11 @@ const BLENDER_LAB_ARGS = ['--from', exports.BLENDER_LAB_FROM, '--with', 'mcp<2',
|
|
|
84
81
|
* from Blender Lab" add-on. NEVER bare `uvx blender-mcp` (no --from) — that
|
|
85
82
|
* pulls the incompatible community PyPI package. (The exact launcher form is
|
|
86
83
|
* under review; the args are the load-bearing part the migration re-resolves.)
|
|
87
|
-
* - GIMP: the
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
84
|
+
* - GIMP: the LOCALLY-INSTALLED, user-verified client run by bare `uv`
|
|
85
|
+
* (`uv run --with mcp==1.2.0 <clientPath>`) on every platform. `clientPath`
|
|
86
|
+
* is the client installGimpPlugin() writes to <GIMP-config>/<ver>/mcp/. Pass
|
|
87
|
+
* the resolved path via `opts.gimpClientPath`; without it we emit the display
|
|
88
|
+
* placeholder (never the broken raw-github upstream client). Experimental.
|
|
91
89
|
*/
|
|
92
90
|
function serverSpecFor(app, platform, opts) {
|
|
93
91
|
if (app === 'blender') {
|
|
@@ -95,15 +93,41 @@ function serverSpecFor(app, platform, opts) {
|
|
|
95
93
|
// official Blender Lab `--from git+…lab…` client.
|
|
96
94
|
return { command: 'uvx', args: [...BLENDER_LAB_ARGS] };
|
|
97
95
|
}
|
|
98
|
-
// gimp —
|
|
99
|
-
//
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
// gimp — run the locally-installed client via `uv` with the pinned mcp SDK.
|
|
97
|
+
// Same command shape on every platform; only the client path differs.
|
|
98
|
+
const client = (opts?.gimpClientPath && opts.gimpClientPath.trim()) || exports.GIMP_CLIENT_PLACEHOLDER;
|
|
99
|
+
return { command: 'uv', args: ['run', '--with', exports.GIMP_MCP_PIN, client] };
|
|
100
|
+
}
|
|
101
|
+
/** The client-path argument carried by a gimp .mcp.json entry, whatever the command form. */
|
|
102
|
+
function gimpClientArgOf(entry) {
|
|
103
|
+
const args = Array.isArray(entry.args) ? entry.args : [];
|
|
104
|
+
if (entry.command === 'python' || entry.command === 'python3') {
|
|
105
|
+
return args[0];
|
|
106
|
+
}
|
|
107
|
+
if (entry.command === 'uv') {
|
|
108
|
+
return args[args.length - 1];
|
|
109
|
+
}
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Is `arg` a CONCRETE local client path — a real filesystem path we must not
|
|
114
|
+
* clobber (a user's own checkout, or the client we already installed)? False for
|
|
115
|
+
* the display placeholder and for ANY URL (incl. the broken raw-github client).
|
|
116
|
+
*/
|
|
117
|
+
function isConcreteGimpClientArg(arg) {
|
|
118
|
+
if (typeof arg !== 'string' || arg.length === 0) {
|
|
119
|
+
return false;
|
|
103
120
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
121
|
+
if (arg === exports.GIMP_CLIENT_PLACEHOLDER) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
if (/^https?:\/\//i.test(arg)) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
if (/raw\.githubusercontent\.com/i.test(arg)) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
return true;
|
|
107
131
|
}
|
|
108
132
|
/** Build the catalog for a given platform (install hints are platform-specific). */
|
|
109
133
|
function getCatalog(platform) {
|
|
@@ -135,25 +159,34 @@ function getCatalog(platform) {
|
|
|
135
159
|
serverName: 'gimp',
|
|
136
160
|
prerequisites: [{ id: 'uv', installHint: uvInstallHint(platform) }],
|
|
137
161
|
postSetup: [
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
'Requires GIMP 3.
|
|
162
|
+
`Plugin + client are installed automatically into your GIMP 3.x config (${gimpPluginDir(platform)}) — you copy nothing. Re-run any time with: autodev mcp gimp-install-plugin`,
|
|
163
|
+
"In GIMP: Tools → MCP → Start MCP Server (or Filters → Development → Start MCP Server), and KEEP the 'GIMP MCP Server' window open — it holds the plug-in process alive and the :9876 socket. One click per GIMP session (the window may hide behind other apps; use the taskbar).",
|
|
164
|
+
'Requires GIMP 3.x (the plugin uses the GIMP 3.0 Python API).',
|
|
141
165
|
"Port 9876 collides with Blender — don't run both MCP servers at once.",
|
|
142
166
|
],
|
|
143
167
|
notes: [
|
|
144
|
-
|
|
145
|
-
`The client
|
|
168
|
+
`Log: ${gimpLogPath(platform)} (Store/MSIX GIMP also mirrors a copy inside its sandbox LocalCache).`,
|
|
169
|
+
`The client runs via \`uv run --with ${exports.GIMP_MCP_PIN} <installed client>\`; the ${exports.GIMP_MCP_PIN} pin is load-bearing (current mcp releases break the client on a removed description= kwarg).`,
|
|
170
|
+
'GIMP 3.2.4 can crash (access-violation) on TextLayer merge_down/merge_filter — rasterize text via Gimp.Layer.new_from_visible first, then filter/merge the raster copy.',
|
|
146
171
|
],
|
|
147
172
|
},
|
|
148
173
|
];
|
|
149
174
|
}
|
|
150
|
-
/** GIMP 3.
|
|
175
|
+
/** GIMP 3.x config directory, per OS (where plug-ins/ and mcp/ get installed). */
|
|
151
176
|
function gimpPluginDir(platform) {
|
|
152
177
|
return platform === 'win32'
|
|
153
|
-
? '%APPDATA%\\GIMP\\3.x\\
|
|
178
|
+
? '%APPDATA%\\GIMP\\3.x\\'
|
|
179
|
+
: platform === 'darwin'
|
|
180
|
+
? '~/Library/Application Support/GIMP/3.x/'
|
|
181
|
+
: '~/.config/GIMP/3.x/';
|
|
182
|
+
}
|
|
183
|
+
/** GIMP MCP server log path, per OS (dual-written by the plug-in). */
|
|
184
|
+
function gimpLogPath(platform) {
|
|
185
|
+
return platform === 'win32'
|
|
186
|
+
? '%APPDATA%\\GIMP\\3.x\\gimp_mcp_server.log'
|
|
154
187
|
: platform === 'darwin'
|
|
155
|
-
? '~/Library/Application Support/GIMP/3.x/
|
|
156
|
-
: '~/.config/GIMP/3.x/
|
|
188
|
+
? '~/Library/Application Support/GIMP/3.x/gimp_mcp_server.log'
|
|
189
|
+
: '~/.config/GIMP/3.x/gimp_mcp_server.log';
|
|
157
190
|
}
|
|
158
191
|
/** Lookup a single catalog entry. */
|
|
159
192
|
function catalogEntry(app, platform) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpCatalog.js","sourceRoot":"","sources":["../../src/core/mcpCatalog.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,2EAA2E;AAC3E,gFAAgF;AAChF,wEAAwE;AACxE,EAAE;AACF,uEAAuE;AACvE,+EAA+E;AAC/E,gFAAgF;AAChF,8EAA8E;;;
|
|
1
|
+
{"version":3,"file":"mcpCatalog.js","sourceRoot":"","sources":["../../src/core/mcpCatalog.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,2EAA2E;AAC3E,gFAAgF;AAChF,wEAAwE;AACxE,EAAE;AACF,uEAAuE;AACvE,+EAA+E;AAC/E,gFAAgF;AAChF,8EAA8E;;;AA4C9E,sCAQC;AAGD,8CAIC;AAGD,wCAIC;AA4BD,sCAcC;AAGD,0CAKC;AAOD,0DAMC;AAGD,gCAyCC;AAqBD,oCAIC;AA3KD;;;;;;GAMG;AACU,QAAA,uBAAuB,GAAG,sCAAsC,CAAC;AAE9E;;;;GAIG;AACU,QAAA,YAAY,GAAG,YAAY,CAAC;AAEzC,uFAAuF;AACvF,SAAgB,aAAa,CAAC,QAAyB;IACrD,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO,oFAAoF,CAAC;IAC9F,CAAC;IACD,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,yEAAyE,CAAC;IACnF,CAAC;IACD,OAAO,iDAAiD,CAAC;AAC3D,CAAC;AAED,8CAA8C;AAC9C,SAAgB,iBAAiB,CAAC,QAAyB;IACzD,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QAAC,OAAO,8EAA8E,CAAC;IAAC,CAAC;IACpH,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C;QAAC,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,EAAE,CAAC,CAAC;IAAC,CAAC;IAC5D,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
export interface MigrateOpts {
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the local gimp client path for this machine, or null when GIMP 3.x is
|
|
4
|
+
* absent. Defaults to resolveGimpClientPath() (real detection). Injectable for
|
|
5
|
+
* tests. When null, a gimp entry that needs upgrading is left as-is.
|
|
6
|
+
*/
|
|
7
|
+
resolveGimpClient?: () => string | null;
|
|
8
|
+
}
|
|
1
9
|
/**
|
|
2
10
|
* Re-resolve stale creative-app user entries in <root>/.mcp.json from the current
|
|
3
11
|
* catalog. Persists the upgraded set back to .mcp.json when anything changed and
|
|
4
12
|
* logs each upgrade. Returns true iff at least one entry was migrated.
|
|
5
13
|
*/
|
|
6
|
-
export declare function migrateCreativeMcpEntries(root: string, platform: NodeJS.Platform, log?: (m: string) => void): boolean;
|
|
14
|
+
export declare function migrateCreativeMcpEntries(root: string, platform: NodeJS.Platform, log?: (m: string) => void, opts?: MigrateOpts): boolean;
|
|
@@ -12,11 +12,14 @@
|
|
|
12
12
|
// It is deliberately narrow:
|
|
13
13
|
// - blender : ALWAYS re-resolved if command/args drift from the catalog spec
|
|
14
14
|
// (Blender has no user-customizable fields, so replacing is safe).
|
|
15
|
-
// - gimp :
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
15
|
+
// - gimp : the ONE thing we never clobber is a user's concrete local client
|
|
16
|
+
// (python[3] <path>, or `uv run … <concrete local path>`). Anything
|
|
17
|
+
// else — the old <…> placeholder stub, OR the BROKEN raw-github
|
|
18
|
+
// upstream client (raw.githubusercontent.com/…/gimp_mcp_client.py)
|
|
19
|
+
// — is upgraded to `uv run --with mcp==1.2.0 <LOCAL client path>`
|
|
20
|
+
// using the client installGimpPlugin() writes on this machine. If
|
|
21
|
+
// GIMP is not installed we can't compute that path, so we leave the
|
|
22
|
+
// entry as-is (we never NEWLY write the broken raw URL).
|
|
20
23
|
// `enabled`, `env`, and `_meta` are preserved; the match is name-based so entries
|
|
21
24
|
// written before any `_meta.catalogId` tag existed still migrate. Non-creative
|
|
22
25
|
// entries (built-ins, filesystem's <ALLOWED_DIR>, custom user servers) are never
|
|
@@ -25,6 +28,7 @@
|
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.migrateCreativeMcpEntries = migrateCreativeMcpEntries;
|
|
27
30
|
const mcpCatalog_1 = require("./mcpCatalog");
|
|
31
|
+
const gimpPluginInstall_1 = require("./gimpPluginInstall");
|
|
28
32
|
const projectMcp_1 = require("./projectMcp");
|
|
29
33
|
/** Creative catalog ids we re-resolve (single source: mcpCatalog). */
|
|
30
34
|
const CREATIVE_IDS = ['blender', 'gimp'];
|
|
@@ -40,24 +44,21 @@ function _argsEqual(a, b) {
|
|
|
40
44
|
return true;
|
|
41
45
|
}
|
|
42
46
|
/**
|
|
43
|
-
* A gimp entry the migration must PRESERVE:
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
+
* A gimp entry the migration must PRESERVE: it already points at a CONCRETE local
|
|
48
|
+
* client (a real filesystem path, not the placeholder and not a URL) — either a
|
|
49
|
+
* user's own checkout or the client we already installed. Everything else (the
|
|
50
|
+
* placeholder stub, the broken raw-github URL, or a bare command) is upgradeable.
|
|
47
51
|
*/
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
const first = Array.isArray(e.args) ? e.args[0] : undefined;
|
|
53
|
-
return typeof first === 'string' && first.length > 0 && first !== mcpCatalog_1.GIMP_CLIENT_PLACEHOLDER;
|
|
52
|
+
function _isGimpConcreteLocal(e) {
|
|
53
|
+
return (0, mcpCatalog_1.isConcreteGimpClientArg)((0, mcpCatalog_1.gimpClientArgOf)(e));
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* Re-resolve stale creative-app user entries in <root>/.mcp.json from the current
|
|
57
57
|
* catalog. Persists the upgraded set back to .mcp.json when anything changed and
|
|
58
58
|
* logs each upgrade. Returns true iff at least one entry was migrated.
|
|
59
59
|
*/
|
|
60
|
-
function migrateCreativeMcpEntries(root, platform, log) {
|
|
60
|
+
function migrateCreativeMcpEntries(root, platform, log, opts) {
|
|
61
|
+
const resolveGimpClient = opts?.resolveGimpClient ?? (() => (0, gimpPluginInstall_1.resolveGimpClientPath)());
|
|
61
62
|
let userMcp;
|
|
62
63
|
try {
|
|
63
64
|
userMcp = (0, projectMcp_1.loadProjectUserMcp)(root);
|
|
@@ -74,11 +75,22 @@ function migrateCreativeMcpEntries(root, platform, log) {
|
|
|
74
75
|
// under this name is not ours to touch.
|
|
75
76
|
if (typeof entry.command !== 'string')
|
|
76
77
|
continue;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
let spec;
|
|
79
|
+
if (id === 'gimp') {
|
|
80
|
+
// Never clobber a user's concrete local client (or the one we installed).
|
|
81
|
+
if (_isGimpConcreteLocal(entry))
|
|
82
|
+
continue;
|
|
83
|
+
// Otherwise (placeholder stub / broken raw-github URL / bare command) upgrade
|
|
84
|
+
// to the locally-installed client — but only if we can resolve one. Without a
|
|
85
|
+
// detected GIMP we leave the entry as-is (never NEWLY write the broken URL).
|
|
86
|
+
const clientPath = resolveGimpClient();
|
|
87
|
+
if (!clientPath)
|
|
88
|
+
continue;
|
|
89
|
+
spec = (0, mcpCatalog_1.serverSpecFor)('gimp', platform, { gimpClientPath: clientPath });
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
spec = (0, mcpCatalog_1.serverSpecFor)(id, platform);
|
|
93
|
+
}
|
|
82
94
|
// Idempotent — already the catalog spec, nothing to do.
|
|
83
95
|
if (entry.command === spec.command && _argsEqual(entry.args, spec.args))
|
|
84
96
|
continue;
|
|
@@ -91,7 +103,7 @@ function migrateCreativeMcpEntries(root, platform, log) {
|
|
|
91
103
|
changed = true;
|
|
92
104
|
log?.(id === 'blender'
|
|
93
105
|
? 'ConfigManager: migrated blender MCP server to the Blender Lab client'
|
|
94
|
-
: 'ConfigManager: migrated gimp MCP server to the
|
|
106
|
+
: 'ConfigManager: migrated gimp MCP server to the locally-installed client (uv run)');
|
|
95
107
|
}
|
|
96
108
|
if (changed) {
|
|
97
109
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpCatalogMigrate.js","sourceRoot":"","sources":["../../src/core/mcpCatalogMigrate.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,kFAAkF;AAClF,iFAAiF;AACjF,EAAE;AACF,gFAAgF;AAChF,kFAAkF;AAClF,6BAA6B;AAC7B,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,
|
|
1
|
+
{"version":3,"file":"mcpCatalogMigrate.js","sourceRoot":"","sources":["../../src/core/mcpCatalogMigrate.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,kFAAkF;AAClF,iFAAiF;AACjF,EAAE;AACF,gFAAgF;AAChF,kFAAkF;AAClF,6BAA6B;AAC7B,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,kFAAkF;AAClF,8EAA8E;AAC9E,iFAAiF;AACjF,gFAAgF;AAChF,gFAAgF;AAChF,kFAAkF;AAClF,uEAAuE;AACvE,kFAAkF;AAClF,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,8EAA8E;;AAyC9E,8DA0DC;AAjGD,6CAA2G;AAC3G,2DAA4D;AAC5D,6CAA8G;AAE9G,sEAAsE;AACtE,MAAM,YAAY,GAAoB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAW1D,SAAS,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