@mcpc-tech/unplugin-dev-inspector-mcp 0.0.27 → 0.0.28
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/client/dist/inspector.iife.js +327 -327
- package/dist/index.cjs +20 -2
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -70,7 +70,22 @@ const createDevInspectorPlugin = (name, transformFactory) => {
|
|
|
70
70
|
},
|
|
71
71
|
load(id) {
|
|
72
72
|
if (id === "\0" + virtualModuleName) return `
|
|
73
|
-
//
|
|
73
|
+
// ===== Tool Registry (self-contained) =====
|
|
74
|
+
const __toolRegistry = new Map();
|
|
75
|
+
|
|
76
|
+
export function registerInspectorTool(tool) {
|
|
77
|
+
if (__toolRegistry.has(tool.name)) {
|
|
78
|
+
console.warn('[dev-inspector] Tool "' + tool.name + '" already registered, overwriting...');
|
|
79
|
+
}
|
|
80
|
+
__toolRegistry.set(tool.name, tool);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Internal: used by the inspector's useMcp hook
|
|
84
|
+
export function __getRegisteredTools() {
|
|
85
|
+
return Array.from(__toolRegistry.values());
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// ===== Inspector Setup =====
|
|
74
89
|
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
75
90
|
// Create inspector element
|
|
76
91
|
const inspector = document.createElement('dev-inspector-mcp');
|
|
@@ -84,7 +99,10 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
|
84
99
|
showInspectorBar: ${options.showInspectorBar ?? true}
|
|
85
100
|
};
|
|
86
101
|
|
|
87
|
-
//
|
|
102
|
+
// Make registry accessible to inspector
|
|
103
|
+
window.__getInspectorTools = __getRegisteredTools;
|
|
104
|
+
|
|
105
|
+
// Load inspector script
|
|
88
106
|
const script = document.createElement('script');
|
|
89
107
|
const config = window.__DEV_INSPECTOR_CONFIG__;
|
|
90
108
|
let baseUrl = 'http://' + config.host + ':' + config.port + config.base;
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -66,7 +66,22 @@ const createDevInspectorPlugin = (name, transformFactory) => {
|
|
|
66
66
|
},
|
|
67
67
|
load(id) {
|
|
68
68
|
if (id === "\0" + virtualModuleName) return `
|
|
69
|
-
//
|
|
69
|
+
// ===== Tool Registry (self-contained) =====
|
|
70
|
+
const __toolRegistry = new Map();
|
|
71
|
+
|
|
72
|
+
export function registerInspectorTool(tool) {
|
|
73
|
+
if (__toolRegistry.has(tool.name)) {
|
|
74
|
+
console.warn('[dev-inspector] Tool "' + tool.name + '" already registered, overwriting...');
|
|
75
|
+
}
|
|
76
|
+
__toolRegistry.set(tool.name, tool);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Internal: used by the inspector's useMcp hook
|
|
80
|
+
export function __getRegisteredTools() {
|
|
81
|
+
return Array.from(__toolRegistry.values());
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// ===== Inspector Setup =====
|
|
70
85
|
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
71
86
|
// Create inspector element
|
|
72
87
|
const inspector = document.createElement('dev-inspector-mcp');
|
|
@@ -80,7 +95,10 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
|
80
95
|
showInspectorBar: ${options.showInspectorBar ?? true}
|
|
81
96
|
};
|
|
82
97
|
|
|
83
|
-
//
|
|
98
|
+
// Make registry accessible to inspector
|
|
99
|
+
window.__getInspectorTools = __getRegisteredTools;
|
|
100
|
+
|
|
101
|
+
// Load inspector script
|
|
84
102
|
const script = document.createElement('script');
|
|
85
103
|
const config = window.__DEV_INSPECTOR_CONFIG__;
|
|
86
104
|
let baseUrl = 'http://' + config.host + ':' + config.port + config.base;
|
package/package.json
CHANGED