@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/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
- // Development-only code - removed in production builds
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
- // Dynamically load inspector script
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
@@ -32,6 +32,7 @@ interface McpConfigOptions {
32
32
  }
33
33
  //#endregion
34
34
  //#region client/constants/types.d.ts
35
+
35
36
  /**
36
37
  * ACP (Agent Client Protocol) options for configuring agent behavior
37
38
  */
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ interface McpConfigOptions {
32
32
  }
33
33
  //#endregion
34
34
  //#region client/constants/types.d.ts
35
+
35
36
  /**
36
37
  * ACP (Agent Client Protocol) options for configuring agent behavior
37
38
  */
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
- // Development-only code - removed in production builds
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
- // Dynamically load inspector script
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpc-tech/unplugin-dev-inspector-mcp",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "description": "Universal dev inspector plugin for React/Vue - inspect component sources and API calls in any bundler",
5
5
  "type": "module",
6
6
  "license": "MIT",