@extension.dev/mcp 6.1.0 → 6.2.0
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +18 -0
- package/dist/module.js +226 -70
- package/dist/rslib-runtime.js +2 -0
- package/dist/src/lib/registry.d.ts +2 -2
- package/package.json +2 -1
- package/server.json +2 -2
- package/dist/src/lib/urls-origins.d.ts +0 -34
- package/dist/src/lib/urls-paths.d.ts +0 -56
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"name": "extension-mcp",
|
|
11
11
|
"source": "./",
|
|
12
12
|
"description": "MCP tools for browser extension development: scaffold from 60+ templates, run the dev server with HMR, inspect the live DOM and logs, and publish store-ready builds for Chrome, Edge, and Firefox.",
|
|
13
|
-
"version": "6.
|
|
13
|
+
"version": "6.2.0",
|
|
14
14
|
"category": "development",
|
|
15
15
|
"author": {
|
|
16
16
|
"name": "Cezar Augusto"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "extension-mcp",
|
|
3
3
|
"description": "MCP tools for browser extension development: scaffold from 60+ templates, run the dev server with HMR, inspect the live DOM and logs, and publish store-ready builds for Chrome, Edge, and Firefox. Ships /extension, /extension-add, /extension-debug, and /extension-publish commands.",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.2.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cezar Augusto",
|
|
7
7
|
"email": "hello@extension.dev",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.2.0
|
|
4
|
+
|
|
5
|
+
The URL layer stops being a copy. This server used to carry byte-identical
|
|
6
|
+
vendored mirrors of the fleet's origin resolver and path builders, kept honest
|
|
7
|
+
by a drift guard; it now depends on the published package instead.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **Depends on `@extension.dev/urls` instead of vendoring it.** The mirrors at
|
|
12
|
+
`lib/urls-origins.ts` and `lib/urls-paths.ts` are gone, and `registry.ts`,
|
|
13
|
+
`login-flow.ts`, and `create.ts` import the package directly. It is bundled
|
|
14
|
+
into `dist`, so the install footprint is unchanged: no new runtime
|
|
15
|
+
dependency, same standalone server.
|
|
16
|
+
- **`preview.extension.dev` resolves like every other fleet origin.** `preview`
|
|
17
|
+
is now a first-class origin in the shared resolver, so `EXTENSION_DEV_PREVIEW_URL`
|
|
18
|
+
is honored and an unset preview host follows the same local-vs-prod signal as
|
|
19
|
+
console, inspect, and registry rather than defaulting to production.
|
|
20
|
+
|
|
3
21
|
## 6.1.0
|
|
4
22
|
|
|
5
23
|
The create flow stops dead-ending at `run dev` and points you to the web to
|
package/dist/module.js
CHANGED
|
@@ -16,6 +16,223 @@ import node_http from "node:http";
|
|
|
16
16
|
import node_net from "node:net";
|
|
17
17
|
import { extensionInstall, extensionUninstall, getManagedBrowsersCacheRoot } from "extension-install";
|
|
18
18
|
import { promisify } from "node:util";
|
|
19
|
+
__webpack_require__.add({
|
|
20
|
+
"./node_modules/.pnpm/@extension.dev+urls@0.2.0/node_modules/@extension.dev/urls/dist/origins.cjs" (__unused_rspack_module, exports) {
|
|
21
|
+
var __nested_rspack_require_18_37__ = {};
|
|
22
|
+
(()=>{
|
|
23
|
+
__nested_rspack_require_18_37__.d = (exports1, definition)=>{
|
|
24
|
+
for(var key in definition)if (__nested_rspack_require_18_37__.o(definition, key) && !__nested_rspack_require_18_37__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: definition[key]
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
(()=>{
|
|
31
|
+
__nested_rspack_require_18_37__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
32
|
+
})();
|
|
33
|
+
(()=>{
|
|
34
|
+
__nested_rspack_require_18_37__.r = (exports1)=>{
|
|
35
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
36
|
+
value: 'Module'
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
39
|
+
value: true
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
var __nested_rspack_exports__ = {};
|
|
44
|
+
__nested_rspack_require_18_37__.r(__nested_rspack_exports__);
|
|
45
|
+
__nested_rspack_require_18_37__.d(__nested_rspack_exports__, {
|
|
46
|
+
DEV_LOCALHOST_ORIGINS: ()=>DEV_LOCALHOST_ORIGINS,
|
|
47
|
+
PROD_ORIGINS: ()=>PROD_ORIGINS,
|
|
48
|
+
isLocalOrigin: ()=>isLocalOrigin,
|
|
49
|
+
resolveOrigins: ()=>resolveOrigins
|
|
50
|
+
});
|
|
51
|
+
const PROD_ORIGINS = {
|
|
52
|
+
www: "https://www.extension.dev",
|
|
53
|
+
console: "https://console.extension.dev",
|
|
54
|
+
inspect: "https://inspect.extension.dev",
|
|
55
|
+
preview: "https://preview.extension.dev",
|
|
56
|
+
templates: "https://templates.extension.dev",
|
|
57
|
+
intelligence: "https://intelligence.extension.dev",
|
|
58
|
+
registry: "https://registry.extension.land",
|
|
59
|
+
media: "https://media.extension.land"
|
|
60
|
+
};
|
|
61
|
+
const DEV_LOCALHOST_ORIGINS = {
|
|
62
|
+
www: "http://localhost:3100",
|
|
63
|
+
console: "http://console.extension.localhost",
|
|
64
|
+
inspect: "http://inspect.extension.localhost",
|
|
65
|
+
preview: "http://preview.extension.localhost",
|
|
66
|
+
templates: "http://templates.extension.localhost",
|
|
67
|
+
intelligence: "http://intelligence.extension.localhost",
|
|
68
|
+
registry: "https://registry.extension.land",
|
|
69
|
+
media: "https://media.extension.land"
|
|
70
|
+
};
|
|
71
|
+
function strip(value) {
|
|
72
|
+
return String(value ?? "").trim().replace(/\/+$/, "");
|
|
73
|
+
}
|
|
74
|
+
function isLocalOrigin(url) {
|
|
75
|
+
const raw = strip(url);
|
|
76
|
+
if (!raw) return false;
|
|
77
|
+
let host;
|
|
78
|
+
try {
|
|
79
|
+
host = new URL(raw).hostname;
|
|
80
|
+
} catch {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
return "localhost" === host || "127.0.0.1" === host || "::1" === host || "[::1]" === host || "extension.localhost" === host || host.endsWith(".extension.localhost");
|
|
84
|
+
}
|
|
85
|
+
function resolveOrigins(overrides = {}, opts = {}) {
|
|
86
|
+
const devLike = isLocalOrigin(overrides.www) || isLocalOrigin(overrides.console) || isLocalOrigin(opts.hint);
|
|
87
|
+
const base = devLike ? DEV_LOCALHOST_ORIGINS : PROD_ORIGINS;
|
|
88
|
+
const pick = (key)=>strip(overrides[key]) || base[key];
|
|
89
|
+
return {
|
|
90
|
+
www: pick("www"),
|
|
91
|
+
console: pick("console"),
|
|
92
|
+
inspect: pick("inspect"),
|
|
93
|
+
preview: pick("preview"),
|
|
94
|
+
templates: pick("templates"),
|
|
95
|
+
intelligence: pick("intelligence"),
|
|
96
|
+
registry: pick("registry"),
|
|
97
|
+
media: pick("media")
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
exports.DEV_LOCALHOST_ORIGINS = __nested_rspack_exports__.DEV_LOCALHOST_ORIGINS;
|
|
101
|
+
exports.PROD_ORIGINS = __nested_rspack_exports__.PROD_ORIGINS;
|
|
102
|
+
exports.isLocalOrigin = __nested_rspack_exports__.isLocalOrigin;
|
|
103
|
+
exports.resolveOrigins = __nested_rspack_exports__.resolveOrigins;
|
|
104
|
+
for(var __webpack_i__ in __nested_rspack_exports__)if (-1 === [
|
|
105
|
+
"DEV_LOCALHOST_ORIGINS",
|
|
106
|
+
"PROD_ORIGINS",
|
|
107
|
+
"isLocalOrigin",
|
|
108
|
+
"resolveOrigins"
|
|
109
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __nested_rspack_exports__[__webpack_i__];
|
|
110
|
+
Object.defineProperty(exports, "__esModule", {
|
|
111
|
+
value: true
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
"./node_modules/.pnpm/@extension.dev+urls@0.2.0/node_modules/@extension.dev/urls/dist/paths.cjs" (__unused_rspack_module, exports) {
|
|
115
|
+
var __nested_rspack_require_18_37__ = {};
|
|
116
|
+
(()=>{
|
|
117
|
+
__nested_rspack_require_18_37__.d = (exports1, definition)=>{
|
|
118
|
+
for(var key in definition)if (__nested_rspack_require_18_37__.o(definition, key) && !__nested_rspack_require_18_37__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: definition[key]
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
})();
|
|
124
|
+
(()=>{
|
|
125
|
+
__nested_rspack_require_18_37__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
126
|
+
})();
|
|
127
|
+
(()=>{
|
|
128
|
+
__nested_rspack_require_18_37__.r = (exports1)=>{
|
|
129
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
130
|
+
value: 'Module'
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
133
|
+
value: true
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
})();
|
|
137
|
+
var __nested_rspack_exports__ = {};
|
|
138
|
+
__nested_rspack_require_18_37__.r(__nested_rspack_exports__);
|
|
139
|
+
__nested_rspack_require_18_37__.d(__nested_rspack_exports__, {
|
|
140
|
+
ConsoleProjectPage: ()=>ConsoleProjectPage,
|
|
141
|
+
consoleProjectPath: ()=>consoleProjectPath,
|
|
142
|
+
consoleWorkspacePath: ()=>consoleWorkspacePath,
|
|
143
|
+
inspectTabPath: ()=>inspectTabPath,
|
|
144
|
+
previewSharePath: ()=>previewSharePath,
|
|
145
|
+
templateTabPath: ()=>templateTabPath,
|
|
146
|
+
wwwDevicePath: ()=>wwwDevicePath,
|
|
147
|
+
wwwImportPath: ()=>wwwImportPath,
|
|
148
|
+
wwwNewPath: ()=>wwwNewPath,
|
|
149
|
+
wwwTemplatesPath: ()=>wwwTemplatesPath
|
|
150
|
+
});
|
|
151
|
+
const seg = (value)=>encodeURIComponent(String(value));
|
|
152
|
+
function join(base, sub) {
|
|
153
|
+
if (!sub) return base;
|
|
154
|
+
return `${base}/${sub.replace(/^\/+/, "")}`;
|
|
155
|
+
}
|
|
156
|
+
function consoleWorkspacePath(workspace, page = "") {
|
|
157
|
+
return join(`/${seg(workspace)}`, page);
|
|
158
|
+
}
|
|
159
|
+
function consoleProjectPath(ref, page = "") {
|
|
160
|
+
return join(`/${seg(ref.workspace)}/${seg(ref.project)}`, page);
|
|
161
|
+
}
|
|
162
|
+
const ConsoleProjectPage = {
|
|
163
|
+
overview: "",
|
|
164
|
+
onboard: "onboard",
|
|
165
|
+
activity: "activity",
|
|
166
|
+
builds: "builds",
|
|
167
|
+
build: (buildId, browser)=>browser ? `builds/${seg(buildId)}/${seg(browser)}` : `builds/${seg(buildId)}`,
|
|
168
|
+
releases: "releases",
|
|
169
|
+
releasesNew: "releases/new",
|
|
170
|
+
release: (releaseId)=>`releases/${seg(releaseId)}`,
|
|
171
|
+
stores: "stores",
|
|
172
|
+
storesNew: "stores/new",
|
|
173
|
+
store: (store)=>`stores/${seg(store)}`,
|
|
174
|
+
storeSubmissions: (store)=>`stores/${seg(store)}/submissions`,
|
|
175
|
+
storeSubmissionNew: (store)=>`stores/${seg(store)}/submissions/new`,
|
|
176
|
+
storeSubmission: (store, submissionId)=>`stores/${seg(store)}/submissions/${seg(submissionId)}`,
|
|
177
|
+
projectSettings: "project-settings",
|
|
178
|
+
projectSettingsSection: (section)=>`project-settings/${seg(section)}`,
|
|
179
|
+
accessTokens: "settings/access-tokens"
|
|
180
|
+
};
|
|
181
|
+
function withQuery(path, query) {
|
|
182
|
+
if (!query) return path;
|
|
183
|
+
const params = new URLSearchParams();
|
|
184
|
+
for (const [key, value] of Object.entries(query))if (null != value && "" !== value) params.set(key, String(value));
|
|
185
|
+
const qs = params.toString();
|
|
186
|
+
return qs ? `${path}?${qs}` : path;
|
|
187
|
+
}
|
|
188
|
+
function wwwNewPath(query) {
|
|
189
|
+
return withQuery("/new", query);
|
|
190
|
+
}
|
|
191
|
+
function wwwImportPath(query) {
|
|
192
|
+
return withQuery("/import", query);
|
|
193
|
+
}
|
|
194
|
+
function wwwDevicePath() {
|
|
195
|
+
return "/device";
|
|
196
|
+
}
|
|
197
|
+
function wwwTemplatesPath(slug) {
|
|
198
|
+
return slug ? `/templates/${seg(slug)}` : "/templates";
|
|
199
|
+
}
|
|
200
|
+
function templateTabPath(slug, tab = "preview") {
|
|
201
|
+
return "preview" === tab ? `/${seg(slug)}` : `/${seg(slug)}/${tab}`;
|
|
202
|
+
}
|
|
203
|
+
function inspectTabPath(tab = "preview") {
|
|
204
|
+
return "preview" === tab ? "/" : `/${tab}`;
|
|
205
|
+
}
|
|
206
|
+
function previewSharePath(previewId) {
|
|
207
|
+
return `/?preview=${seg(previewId)}`;
|
|
208
|
+
}
|
|
209
|
+
exports.ConsoleProjectPage = __nested_rspack_exports__.ConsoleProjectPage;
|
|
210
|
+
exports.consoleProjectPath = __nested_rspack_exports__.consoleProjectPath;
|
|
211
|
+
exports.consoleWorkspacePath = __nested_rspack_exports__.consoleWorkspacePath;
|
|
212
|
+
exports.inspectTabPath = __nested_rspack_exports__.inspectTabPath;
|
|
213
|
+
exports.previewSharePath = __nested_rspack_exports__.previewSharePath;
|
|
214
|
+
exports.templateTabPath = __nested_rspack_exports__.templateTabPath;
|
|
215
|
+
exports.wwwDevicePath = __nested_rspack_exports__.wwwDevicePath;
|
|
216
|
+
exports.wwwImportPath = __nested_rspack_exports__.wwwImportPath;
|
|
217
|
+
exports.wwwNewPath = __nested_rspack_exports__.wwwNewPath;
|
|
218
|
+
exports.wwwTemplatesPath = __nested_rspack_exports__.wwwTemplatesPath;
|
|
219
|
+
for(var __webpack_i__ in __nested_rspack_exports__)if (-1 === [
|
|
220
|
+
"ConsoleProjectPage",
|
|
221
|
+
"consoleProjectPath",
|
|
222
|
+
"consoleWorkspacePath",
|
|
223
|
+
"inspectTabPath",
|
|
224
|
+
"previewSharePath",
|
|
225
|
+
"templateTabPath",
|
|
226
|
+
"wwwDevicePath",
|
|
227
|
+
"wwwImportPath",
|
|
228
|
+
"wwwNewPath",
|
|
229
|
+
"wwwTemplatesPath"
|
|
230
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __nested_rspack_exports__[__webpack_i__];
|
|
231
|
+
Object.defineProperty(exports, "__esModule", {
|
|
232
|
+
value: true
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
});
|
|
19
236
|
var add_feature_namespaceObject = {};
|
|
20
237
|
__webpack_require__.r(add_feature_namespaceObject);
|
|
21
238
|
__webpack_require__.d(add_feature_namespaceObject, {
|
|
@@ -222,7 +439,7 @@ __webpack_require__.d(whoami_namespaceObject, {
|
|
|
222
439
|
handler: ()=>whoami_handler,
|
|
223
440
|
schema: ()=>whoami_schema
|
|
224
441
|
});
|
|
225
|
-
var package_namespaceObject = JSON.parse('{"rE":"6.
|
|
442
|
+
var package_namespaceObject = JSON.parse('{"rE":"6.1.0","El":{"OP":"4.0.16-canary.1784889479.74e12044"}}');
|
|
226
443
|
function credentialsPath() {
|
|
227
444
|
if ("win32" === process.platform) {
|
|
228
445
|
const base = process.env.APPDATA || process.env.LOCALAPPDATA || node_path.join(node_os.homedir(), "AppData", "Roaming");
|
|
@@ -295,77 +512,16 @@ function readValidCredentials(nowSeconds = Math.floor(Date.now() / 1000)) {
|
|
|
295
512
|
if (creds.expiresAt && creds.expiresAt <= nowSeconds) return null;
|
|
296
513
|
return creds;
|
|
297
514
|
}
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
inspect: "https://inspect.extension.dev",
|
|
302
|
-
templates: "https://templates.extension.dev",
|
|
303
|
-
intelligence: "https://intelligence.extension.dev",
|
|
304
|
-
registry: "https://registry.extension.land",
|
|
305
|
-
media: "https://media.extension.land"
|
|
306
|
-
};
|
|
307
|
-
const DEV_LOCALHOST_ORIGINS = {
|
|
308
|
-
www: "http://localhost:3100",
|
|
309
|
-
console: "http://console.extension.localhost",
|
|
310
|
-
inspect: "http://inspect.extension.localhost",
|
|
311
|
-
templates: "http://templates.extension.localhost",
|
|
312
|
-
intelligence: "http://intelligence.extension.localhost",
|
|
313
|
-
registry: "https://registry.extension.land",
|
|
314
|
-
media: "https://media.extension.land"
|
|
315
|
-
};
|
|
316
|
-
function strip(value) {
|
|
317
|
-
return String(value ?? "").trim().replace(/\/+$/, "");
|
|
318
|
-
}
|
|
319
|
-
function isLocalOrigin(url) {
|
|
320
|
-
const raw = strip(url);
|
|
321
|
-
if (!raw) return false;
|
|
322
|
-
let host;
|
|
323
|
-
try {
|
|
324
|
-
host = new URL(raw).hostname;
|
|
325
|
-
} catch {
|
|
326
|
-
return false;
|
|
327
|
-
}
|
|
328
|
-
return "localhost" === host || "127.0.0.1" === host || "::1" === host || "[::1]" === host || "extension.localhost" === host || host.endsWith(".extension.localhost");
|
|
329
|
-
}
|
|
330
|
-
function resolveOrigins(overrides = {}, opts = {}) {
|
|
331
|
-
const devLike = isLocalOrigin(overrides.www) || isLocalOrigin(overrides.console) || isLocalOrigin(opts.hint);
|
|
332
|
-
const base = devLike ? DEV_LOCALHOST_ORIGINS : PROD_ORIGINS;
|
|
333
|
-
const pick = (key)=>strip(overrides[key]) || base[key];
|
|
334
|
-
return {
|
|
335
|
-
www: pick("www"),
|
|
336
|
-
console: pick("console"),
|
|
337
|
-
inspect: pick("inspect"),
|
|
338
|
-
templates: pick("templates"),
|
|
339
|
-
intelligence: pick("intelligence"),
|
|
340
|
-
registry: pick("registry"),
|
|
341
|
-
media: pick("media")
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
const seg = (value)=>encodeURIComponent(String(value));
|
|
345
|
-
function urls_paths_join(base, sub) {
|
|
346
|
-
if (!sub) return base;
|
|
347
|
-
return `${base}/${sub.replace(/^\/+/, "")}`;
|
|
348
|
-
}
|
|
349
|
-
function consoleProjectPath(ref, page = "") {
|
|
350
|
-
return urls_paths_join(`/${seg(ref.workspace)}/${seg(ref.project)}`, page);
|
|
351
|
-
}
|
|
352
|
-
function withQuery(path, query) {
|
|
353
|
-
if (!query) return path;
|
|
354
|
-
const params = new URLSearchParams();
|
|
355
|
-
for (const [key, value] of Object.entries(query))if (null != value && "" !== value) params.set(key, String(value));
|
|
356
|
-
const qs = params.toString();
|
|
357
|
-
return qs ? `${path}?${qs}` : path;
|
|
358
|
-
}
|
|
359
|
-
function wwwNewPath(query) {
|
|
360
|
-
return withQuery("/new", query);
|
|
361
|
-
}
|
|
362
|
-
PROD_ORIGINS.registry;
|
|
515
|
+
const origins = __webpack_require__("./node_modules/.pnpm/@extension.dev+urls@0.2.0/node_modules/@extension.dev/urls/dist/origins.cjs");
|
|
516
|
+
const paths_0 = __webpack_require__("./node_modules/.pnpm/@extension.dev+urls@0.2.0/node_modules/@extension.dev/urls/dist/paths.cjs");
|
|
517
|
+
origins.PROD_ORIGINS.registry;
|
|
363
518
|
function mcpOrigins(apiHint) {
|
|
364
519
|
const www = String(apiHint || process.env.EXTENSION_DEV_API_URL || "").trim() || void 0;
|
|
365
|
-
return resolveOrigins({
|
|
520
|
+
return (0, origins.resolveOrigins)({
|
|
366
521
|
www,
|
|
367
522
|
console: process.env.EXTENSION_DEV_CONSOLE_URL,
|
|
368
523
|
inspect: process.env.EXTENSION_DEV_INSPECT_URL,
|
|
524
|
+
preview: process.env.EXTENSION_DEV_PREVIEW_URL,
|
|
369
525
|
registry: process.env.EXTENSION_DEV_REGISTRY_URL,
|
|
370
526
|
media: process.env.EXTENSION_MEDIA_ORIGIN
|
|
371
527
|
}, {
|
|
@@ -400,7 +556,7 @@ function registryFileUrl(ref, file) {
|
|
|
400
556
|
function consoleProjectUrl(ref, page, apiHint) {
|
|
401
557
|
const base = consoleBase(apiHint);
|
|
402
558
|
if (!ref) return base;
|
|
403
|
-
return `${base}${consoleProjectPath(ref, page)}`;
|
|
559
|
+
return `${base}${(0, paths_0.consoleProjectPath)(ref, page)}`;
|
|
404
560
|
}
|
|
405
561
|
async function fetchRegistryJson(url, fetchImpl = fetch) {
|
|
406
562
|
let res;
|
|
@@ -613,7 +769,7 @@ async function create_handler(args) {
|
|
|
613
769
|
const resolvedParent = args.parentDir ? node_path.resolve(args.parentDir) : process.cwd();
|
|
614
770
|
const gitInit = node_fs.existsSync(node_path.join(result.projectPath, ".git"));
|
|
615
771
|
const wwwOrigin = mcpOrigins().www;
|
|
616
|
-
const deployUrl = `${wwwOrigin}${wwwNewPath({
|
|
772
|
+
const deployUrl = `${wwwOrigin}${(0, paths_0.wwwNewPath)({
|
|
617
773
|
template: result.template
|
|
618
774
|
})}`;
|
|
619
775
|
return JSON.stringify({
|
|
@@ -6049,7 +6205,7 @@ async function dom_inspect_handler(args) {
|
|
|
6049
6205
|
return raw;
|
|
6050
6206
|
}
|
|
6051
6207
|
}
|
|
6052
|
-
const DEFAULT_API = PROD_ORIGINS.www;
|
|
6208
|
+
const DEFAULT_API = origins.PROD_ORIGINS.www;
|
|
6053
6209
|
function tokenTtlNote(workspaceSlug, projectSlug) {
|
|
6054
6210
|
const tokensUrl = workspaceSlug && projectSlug ? consoleProjectUrl({
|
|
6055
6211
|
workspace: workspaceSlug,
|
package/dist/rslib-runtime.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
var __webpack_modules__ = {};
|
|
1
2
|
var __webpack_module_cache__ = {};
|
|
2
3
|
function __webpack_require__(moduleId) {
|
|
3
4
|
var cachedModule = __webpack_module_cache__[moduleId];
|
|
@@ -8,6 +9,7 @@ function __webpack_require__(moduleId) {
|
|
|
8
9
|
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
9
10
|
return module.exports;
|
|
10
11
|
}
|
|
12
|
+
__webpack_require__.m = __webpack_modules__;
|
|
11
13
|
(()=>{
|
|
12
14
|
__webpack_require__.add = function(modules) {
|
|
13
15
|
Object.assign(__webpack_require__.m, modules);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Origins } from "
|
|
1
|
+
import { type Origins } from "@extension.dev/urls/origins";
|
|
2
2
|
export declare const REGISTRY_BASE_DEFAULT: string;
|
|
3
3
|
/**
|
|
4
4
|
* Resolve the fleet origins from the MCP's env vars, once per call. Console,
|
|
@@ -7,7 +7,7 @@ export declare const REGISTRY_BASE_DEFAULT: string;
|
|
|
7
7
|
* MCP hands back follows to the dev host (`console.extension.localhost`) instead
|
|
8
8
|
* of silently pointing at prod. Explicit per-host env vars still win. Falls back
|
|
9
9
|
* to production when nothing is set. The dev-derivation lives in
|
|
10
|
-
* `@
|
|
10
|
+
* `@extension.dev/urls` so it stays identical to what the apps resolve.
|
|
11
11
|
*/
|
|
12
12
|
export declare function mcpOrigins(apiHint?: string): Origins;
|
|
13
13
|
/** Base origin of the console dashboard, dev-aware (no trailing slash). */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@extension.dev/mcp",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.2.0",
|
|
5
5
|
"description": "MCP server that lets AI agents (Claude Code, Claude Desktop, Cursor, Copilot, Codex) build, run, inspect, and publish browser extensions. 33 tools for scaffolding, live DOM inspection, log streaming, and store-ready builds across Chrome, Edge, Firefox, Safari, and every Chromium- or Gecko-based browser (Brave, Opera, Vivaldi, Yandex, Waterfox, LibreWolf). Powered by extension.dev and Extension.js.",
|
|
6
6
|
"mcpName": "io.github.extensiondev/mcp",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
"ws": "^8.20.0"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
|
+
"@extension.dev/urls": "^0.2.0",
|
|
100
101
|
"@rslib/core": "^0.19.4",
|
|
101
102
|
"@types/cross-spawn": "^6.0.6",
|
|
102
103
|
"@types/node": "^25.2.0",
|
package/server.json
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
9
|
"websiteUrl": "https://extension.dev",
|
|
10
|
-
"version": "6.
|
|
10
|
+
"version": "6.2.0",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
15
15
|
"identifier": "@extension.dev/mcp",
|
|
16
|
-
"version": "6.
|
|
16
|
+
"version": "6.2.0",
|
|
17
17
|
"runtimeHint": "npx",
|
|
18
18
|
"transport": {
|
|
19
19
|
"type": "stdio"
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/** The set of app/service origins the fleet links between. */
|
|
2
|
-
export interface Origins {
|
|
3
|
-
www: string;
|
|
4
|
-
console: string;
|
|
5
|
-
inspect: string;
|
|
6
|
-
templates: string;
|
|
7
|
-
intelligence: string;
|
|
8
|
-
/** Public release-state JSON host (registry.extension.land). */
|
|
9
|
-
registry: string;
|
|
10
|
-
/** Content-addressed template corpus host (media.extension.land). */
|
|
11
|
-
media: string;
|
|
12
|
-
}
|
|
13
|
-
/** Production origins. The prod fallback for every resolver in the fleet. */
|
|
14
|
-
export declare const PROD_ORIGINS: Origins;
|
|
15
|
-
export declare const DEV_LOCALHOST_ORIGINS: Origins;
|
|
16
|
-
/**
|
|
17
|
-
* True for `localhost`, `127.0.0.1`, `[::1]`, or any `*.extension.localhost`
|
|
18
|
-
* host -- the shapes the dev proxy serves. Anything unparseable is treated as
|
|
19
|
-
* not-local so an odd value falls back to prod rather than leaking a dev host.
|
|
20
|
-
*/
|
|
21
|
-
export declare function isLocalOrigin(url: string | undefined | null): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Resolve the full origin set from a caller's overrides.
|
|
24
|
-
*
|
|
25
|
-
* Precedence per origin: explicit override -> derived base (dev vs prod) ->
|
|
26
|
-
* prod. The base is chosen by whether the environment looks local: if any of
|
|
27
|
-
* `www`/`console`/`hint` points at a local host, unset origins derive from the
|
|
28
|
-
* Caddy dev map instead of prod. This is what lets an operator set only
|
|
29
|
-
* `EXTENSION_DEV_API_URL=http://localhost:3100` and still get a console link at
|
|
30
|
-
* `console.extension.localhost` rather than one that silently points at prod.
|
|
31
|
-
*/
|
|
32
|
-
export declare function resolveOrigins(overrides?: Partial<Origins>, opts?: {
|
|
33
|
-
hint?: string;
|
|
34
|
-
}): Origins;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/** A project is addressed by its workspace slug + project slug across the fleet. */
|
|
2
|
-
export interface ProjectRef {
|
|
3
|
-
workspace: string;
|
|
4
|
-
project: string;
|
|
5
|
-
}
|
|
6
|
-
/** `/:workspace` (or a sub-page like `settings` / `settings/:section`). */
|
|
7
|
-
export declare function consoleWorkspacePath(workspace: string, page?: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* `/:workspace/:project/<page>`. Pass a page tail from `ConsoleProjectPage`
|
|
10
|
-
* (e.g. `ConsoleProjectPage.builds`) rather than hand-typing it, so a route
|
|
11
|
-
* rename is a one-line change here instead of a scattered string edit.
|
|
12
|
-
*/
|
|
13
|
-
export declare function consoleProjectPath(ref: ProjectRef, page?: string): string;
|
|
14
|
-
/**
|
|
15
|
-
* Named project-page tails. Values are the exact segments under
|
|
16
|
-
* `/:username/:reponame/` in console's route table; deep pages take ids.
|
|
17
|
-
*/
|
|
18
|
-
export declare const ConsoleProjectPage: {
|
|
19
|
-
readonly overview: "";
|
|
20
|
-
readonly onboard: "onboard";
|
|
21
|
-
readonly activity: "activity";
|
|
22
|
-
readonly builds: "builds";
|
|
23
|
-
readonly build: (buildId: string, browser?: string) => string;
|
|
24
|
-
readonly releases: "releases";
|
|
25
|
-
readonly releasesNew: "releases/new";
|
|
26
|
-
readonly release: (releaseId: string) => string;
|
|
27
|
-
readonly stores: "stores";
|
|
28
|
-
readonly storesNew: "stores/new";
|
|
29
|
-
readonly store: (store: string) => string;
|
|
30
|
-
readonly storeSubmissions: (store: string) => string;
|
|
31
|
-
readonly storeSubmissionNew: (store: string) => string;
|
|
32
|
-
readonly storeSubmission: (store: string, submissionId: string) => string;
|
|
33
|
-
readonly projectSettings: "project-settings";
|
|
34
|
-
readonly projectSettingsSection: (section: string) => string;
|
|
35
|
-
/** Where CLI/MCP tokens are minted and revoked. */
|
|
36
|
-
readonly accessTokens: "settings/access-tokens";
|
|
37
|
-
};
|
|
38
|
-
export type QueryValue = string | number | boolean | null | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* `/new?...` -- project creation. The public deep-link contract: external
|
|
41
|
-
* READMEs use `extension.dev/new?template=<slug>`, which www normalizes to
|
|
42
|
-
* `/import` preserving every param. Do not change the `template` key.
|
|
43
|
-
*/
|
|
44
|
-
export declare function wwwNewPath(query?: Record<string, QueryValue>): string;
|
|
45
|
-
/** `/import?...` -- the ported import/deploy flow templates' Deploy buttons target. */
|
|
46
|
-
export declare function wwwImportPath(query?: Record<string, QueryValue>): string;
|
|
47
|
-
/** `/device` -- CLI/MCP device-code consent. Lives on www, never console. */
|
|
48
|
-
export declare function wwwDevicePath(): string;
|
|
49
|
-
/** `/templates` and `/templates/:slug` -- externally linkable gallery entry on www. */
|
|
50
|
-
export declare function wwwTemplatesPath(slug?: string): string;
|
|
51
|
-
export type TemplateTab = "preview" | "instructions" | "source";
|
|
52
|
-
/** `/:slug` for the default `preview` tab, else `/:slug/<tab>`. */
|
|
53
|
-
export declare function templateTabPath(slug: string, tab?: TemplateTab): string;
|
|
54
|
-
export type InspectTab = "preview" | "details" | "source" | "trace";
|
|
55
|
-
/** `/` for the default `preview` tab, else `/details` / `/source` / `/trace`. */
|
|
56
|
-
export declare function inspectTabPath(tab?: InspectTab): string;
|