chrome-devtools-mcp-for-extension 0.16.5 → 0.17.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/profile-resolver.ts
|
|
2
|
-
// Phase 1 (v0.15.0) + v0.15.1 (MCP_CLIENT_ID support)
|
|
2
|
+
// Phase 1 (v0.15.0) + v0.15.1 (MCP_CLIENT_ID support) + v0.17.0 (Hierarchical profiles)
|
|
3
3
|
// - Hybrid priority (CLI > MCP_USER_DATA_DIR > MCP_PROJECT_ID > AUTO > DEFAULT)
|
|
4
4
|
// - Auto-detection (git root -> nearest package.json -> cwd)
|
|
5
5
|
// - Realpath normalization
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// - Short SHA-256 hash (8 chars)
|
|
8
8
|
// - CI detection => ephemeral session profile (unless MCP_PERSIST_PROFILES)
|
|
9
9
|
// - Client ID isolation (MCP_CLIENT_ID environment variable)
|
|
10
|
+
// - Hierarchical structure: {project}/{client}/{channel} (v0.17.0)
|
|
10
11
|
// - Minimal console.error() logging of decision
|
|
11
12
|
import fs from 'node:fs';
|
|
12
13
|
import os from 'node:os';
|
|
@@ -90,8 +91,8 @@ export function resolveUserDataDir(opts) {
|
|
|
90
91
|
// 3) ENV: MCP_PROJECT_ID (project-scoped persistent profile)
|
|
91
92
|
const projectId = sanitize(opts.env.MCP_PROJECT_ID || '');
|
|
92
93
|
if (projectId) {
|
|
93
|
-
const key =
|
|
94
|
-
const p = projectProfilePath(key, channel);
|
|
94
|
+
const key = projectId; // v0.17.0: clientId removed from projectKey
|
|
95
|
+
const p = projectProfilePath(key, clientId, channel);
|
|
95
96
|
const result = {
|
|
96
97
|
path: p,
|
|
97
98
|
reason: 'MCP_PROJECT_ID',
|
|
@@ -113,8 +114,8 @@ export function resolveUserDataDir(opts) {
|
|
|
113
114
|
console.error(`[profiles] AUTO detection: name="${name}"`);
|
|
114
115
|
const realRoot = realpathSafe(root);
|
|
115
116
|
const hash = shortHash(realRoot);
|
|
116
|
-
const key = `${sanitize(name)}_${hash}
|
|
117
|
-
const p = projectProfilePath(key, channel);
|
|
117
|
+
const key = `${sanitize(name)}_${hash}`; // v0.17.0: clientId removed from projectKey
|
|
118
|
+
const p = projectProfilePath(key, clientId, channel);
|
|
118
119
|
const result = {
|
|
119
120
|
path: p,
|
|
120
121
|
reason: 'AUTO',
|
|
@@ -130,8 +131,8 @@ export function resolveUserDataDir(opts) {
|
|
|
130
131
|
catch (e) {
|
|
131
132
|
console.error(`[profiles] AUTO detection FAILED: ${e}`);
|
|
132
133
|
// 5) DEFAULT fallback
|
|
133
|
-
const key =
|
|
134
|
-
const p = projectProfilePath(key, channel);
|
|
134
|
+
const key = 'project-default'; // v0.17.0: clientId removed from projectKey
|
|
135
|
+
const p = projectProfilePath(key, clientId, channel);
|
|
135
136
|
const result = {
|
|
136
137
|
path: p,
|
|
137
138
|
reason: 'DEFAULT',
|
|
@@ -150,8 +151,9 @@ function isCI(env) {
|
|
|
150
151
|
// Common CI signals
|
|
151
152
|
return env.CI === 'true' || env.GITHUB_ACTIONS === 'true';
|
|
152
153
|
}
|
|
153
|
-
function projectProfilePath(projectKey, channel) {
|
|
154
|
-
|
|
154
|
+
function projectProfilePath(projectKey, clientId, channel) {
|
|
155
|
+
// v0.17.0: Hierarchical structure - {project}/{client}/{channel}
|
|
156
|
+
const base = path.join(CACHE_ROOT, 'profiles', projectKey, clientId, channel);
|
|
155
157
|
return pathNormalize(base);
|
|
156
158
|
}
|
|
157
159
|
function shortHash(s) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrome-devtools-mcp-for-extension",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "MCP server for Chrome extension development with Web Store automation. Fork of chrome-devtools-mcp with extension-specific tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./build/src/index.js",
|