@bryan-thompson/inspector-assessment-client 1.25.5 → 1.25.6
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/assets/{OAuthCallback-Dl4GYls3.js → OAuthCallback-D6y8tFfF.js} +1 -1
- package/dist/assets/{OAuthDebugCallback-BdJ38Z-r.js → OAuthDebugCallback-DHegnqTa.js} +1 -1
- package/dist/assets/{index-pfUiTdQb.js → index-Cu02Ah3g.js} +4 -4
- package/dist/index.html +1 -1
- package/lib/lib/moduleScoring.d.ts +2 -2
- package/lib/lib/moduleScoring.d.ts.map +1 -1
- package/lib/lib/moduleScoring.js +3 -2
- package/lib/services/assessment/lib/claudeCodeBridge.d.ts +37 -2
- package/lib/services/assessment/lib/claudeCodeBridge.d.ts.map +1 -1
- package/lib/services/assessment/lib/claudeCodeBridge.js +144 -5
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as useToast, r as reactExports, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-
|
|
1
|
+
import { u as useToast, r as reactExports, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-Cu02Ah3g.js";
|
|
2
2
|
const OAuthCallback = ({ onConnect }) => {
|
|
3
3
|
const { toast } = useToast();
|
|
4
4
|
const hasProcessedRef = reactExports.useRef(false);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-
|
|
1
|
+
import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-Cu02Ah3g.js";
|
|
2
2
|
const OAuthDebugCallback = ({ onConnect }) => {
|
|
3
3
|
reactExports.useEffect(() => {
|
|
4
4
|
let isProcessed = false;
|
|
@@ -16320,7 +16320,7 @@ object({
|
|
|
16320
16320
|
token_type_hint: string().optional()
|
|
16321
16321
|
}).strip();
|
|
16322
16322
|
const name = "@bryan-thompson/inspector-assessment-client";
|
|
16323
|
-
const version$1 = "1.25.
|
|
16323
|
+
const version$1 = "1.25.6";
|
|
16324
16324
|
const packageJson = {
|
|
16325
16325
|
name,
|
|
16326
16326
|
version: version$1
|
|
@@ -45217,7 +45217,7 @@ const useTheme = () => {
|
|
|
45217
45217
|
[theme, setThemeWithSideEffect]
|
|
45218
45218
|
);
|
|
45219
45219
|
};
|
|
45220
|
-
const version = "1.25.
|
|
45220
|
+
const version = "1.25.6";
|
|
45221
45221
|
var [createTooltipContext] = createContextScope("Tooltip", [
|
|
45222
45222
|
createPopperScope
|
|
45223
45223
|
]);
|
|
@@ -48774,13 +48774,13 @@ const App = () => {
|
|
|
48774
48774
|
) });
|
|
48775
48775
|
if (window.location.pathname === "/oauth/callback") {
|
|
48776
48776
|
const OAuthCallback = React.lazy(
|
|
48777
|
-
() => __vitePreload(() => import("./OAuthCallback-
|
|
48777
|
+
() => __vitePreload(() => import("./OAuthCallback-D6y8tFfF.js"), true ? [] : void 0)
|
|
48778
48778
|
);
|
|
48779
48779
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
|
|
48780
48780
|
}
|
|
48781
48781
|
if (window.location.pathname === "/oauth/callback/debug") {
|
|
48782
48782
|
const OAuthDebugCallback = React.lazy(
|
|
48783
|
-
() => __vitePreload(() => import("./OAuthDebugCallback-
|
|
48783
|
+
() => __vitePreload(() => import("./OAuthDebugCallback-DHegnqTa.js"), true ? [] : void 0)
|
|
48784
48784
|
);
|
|
48785
48785
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
|
|
48786
48786
|
}
|
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/mcp.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>MCP Inspector</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-Cu02Ah3g.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-cHhcEXbr.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
@@ -20,7 +20,7 @@ export declare function normalizeModuleKey(moduleName: string): string;
|
|
|
20
20
|
export declare function calculateModuleScore(result: unknown): number | null;
|
|
21
21
|
/**
|
|
22
22
|
* Current inspector-assessment version for event compatibility checking.
|
|
23
|
-
*
|
|
23
|
+
* Dynamically imported from package.json to stay in sync.
|
|
24
24
|
*/
|
|
25
|
-
export declare const INSPECTOR_VERSION
|
|
25
|
+
export declare const INSPECTOR_VERSION: string;
|
|
26
26
|
//# sourceMappingURL=moduleScoring.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moduleScoring.d.ts","sourceRoot":"","sources":["../../src/lib/moduleScoring.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"moduleScoring.d.ts","sourceRoot":"","sources":["../../src/lib/moduleScoring.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CA6BnE;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAsB,CAAC"}
|
package/lib/lib/moduleScoring.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Shared utilities for calculating module scores and normalizing module names.
|
|
5
5
|
* Used by both the AssessmentOrchestrator (client) and CLI runners (scripts).
|
|
6
6
|
*/
|
|
7
|
+
import packageJson from "../../package.json";
|
|
7
8
|
/**
|
|
8
9
|
* Normalize module name to snake_case key for consistent machine parsing.
|
|
9
10
|
* Examples: "Functionality" -> "functionality", "Error Handling" -> "error_handling"
|
|
@@ -51,6 +52,6 @@ export function calculateModuleScore(result) {
|
|
|
51
52
|
}
|
|
52
53
|
/**
|
|
53
54
|
* Current inspector-assessment version for event compatibility checking.
|
|
54
|
-
*
|
|
55
|
+
* Dynamically imported from package.json to stay in sync.
|
|
55
56
|
*/
|
|
56
|
-
export const INSPECTOR_VERSION =
|
|
57
|
+
export const INSPECTOR_VERSION = packageJson.version;
|
|
@@ -22,6 +22,14 @@ export interface ClaudeCodeResponse {
|
|
|
22
22
|
error?: string;
|
|
23
23
|
executionTimeMs?: number;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* HTTP transport configuration for connecting to mcp-auditor API
|
|
27
|
+
*/
|
|
28
|
+
export interface HttpTransportConfig {
|
|
29
|
+
baseUrl: string;
|
|
30
|
+
apiKey?: string;
|
|
31
|
+
headers?: Record<string, string>;
|
|
32
|
+
}
|
|
25
33
|
/**
|
|
26
34
|
* Configuration for Claude Code Bridge
|
|
27
35
|
*/
|
|
@@ -29,6 +37,8 @@ export interface ClaudeCodeBridgeConfig {
|
|
|
29
37
|
enabled: boolean;
|
|
30
38
|
timeout?: number;
|
|
31
39
|
maxRetries?: number;
|
|
40
|
+
transport?: "cli" | "http";
|
|
41
|
+
httpConfig?: HttpTransportConfig;
|
|
32
42
|
features: {
|
|
33
43
|
intelligentTestGeneration?: boolean;
|
|
34
44
|
aupSemanticAnalysis?: boolean;
|
|
@@ -97,6 +107,11 @@ export declare const DEFAULT_CLAUDE_CODE_CONFIG: ClaudeCodeBridgeConfig;
|
|
|
97
107
|
* Full configuration with all features enabled
|
|
98
108
|
*/
|
|
99
109
|
export declare const FULL_CLAUDE_CODE_CONFIG: ClaudeCodeBridgeConfig;
|
|
110
|
+
/**
|
|
111
|
+
* HTTP transport configuration using mcp-auditor as Claude API proxy
|
|
112
|
+
* Requires mcp-auditor server running on the specified baseUrl
|
|
113
|
+
*/
|
|
114
|
+
export declare const HTTP_CLAUDE_CODE_CONFIG: ClaudeCodeBridgeConfig;
|
|
100
115
|
/**
|
|
101
116
|
* Claude Code Bridge
|
|
102
117
|
* Executes Claude CLI for intelligent analysis during MCP assessments
|
|
@@ -111,17 +126,37 @@ export declare class ClaudeCodeBridge {
|
|
|
111
126
|
* Note: annotationInference is an alias for behaviorInference
|
|
112
127
|
*/
|
|
113
128
|
isFeatureEnabled(feature: keyof ClaudeCodeBridgeConfig["features"]): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Get the current transport type
|
|
131
|
+
*/
|
|
132
|
+
getTransport(): "cli" | "http";
|
|
133
|
+
/**
|
|
134
|
+
* Check availability based on transport type
|
|
135
|
+
* For CLI: checks if claude binary exists
|
|
136
|
+
* For HTTP: assumes available (validated on first request)
|
|
137
|
+
*/
|
|
138
|
+
private checkAvailability;
|
|
114
139
|
/**
|
|
115
140
|
* Check if Claude CLI is available on the system
|
|
116
141
|
*/
|
|
117
|
-
private
|
|
142
|
+
private checkCliAvailability;
|
|
143
|
+
/**
|
|
144
|
+
* Check HTTP endpoint health (async version for runtime checks)
|
|
145
|
+
* Can be called to verify HTTP transport is working
|
|
146
|
+
*/
|
|
147
|
+
checkHttpHealth(): Promise<boolean>;
|
|
118
148
|
/**
|
|
119
149
|
* Execute Claude CLI with a prompt
|
|
120
150
|
* Uses execFileSync to avoid shell injection vulnerabilities
|
|
121
151
|
*/
|
|
122
152
|
private executeClaudeCommand;
|
|
123
153
|
/**
|
|
124
|
-
* Execute
|
|
154
|
+
* Execute via HTTP transport using mcp-auditor's Claude API proxy
|
|
155
|
+
* Requires mcp-auditor server with /api/claude/messages endpoint
|
|
156
|
+
*/
|
|
157
|
+
private executeHttpCommand;
|
|
158
|
+
/**
|
|
159
|
+
* Execute with retries - supports both CLI and HTTP transports
|
|
125
160
|
*/
|
|
126
161
|
private executeWithRetry;
|
|
127
162
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claudeCodeBridge.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/lib/claudeCodeBridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE;QACR,yBAAyB,CAAC,EAAE,OAAO,CAAC;QACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,uBAAuB,CAAC,EAAE,OAAO,CAAC;QAClC,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MA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AAC;KAC1B,GACA,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC;IAgD1C;;OAEG;IACG,qBAAqB,CACzB,IAAI,EAAE,IAAI,EACV,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAuCvC;;;OAGG;IACG,sBAAsB,CAC1B,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IAqC5C;;OAEG;IACG,mBAAmB,CACvB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;QACT,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,WAAW,EAAE,MAAM,EAAE,CAAC;KACvB,GAAG,IAAI,CAAC;CA0CV"}
|
|
@@ -43,6 +43,27 @@ export const FULL_CLAUDE_CODE_CONFIG = {
|
|
|
43
43
|
documentationQuality: true,
|
|
44
44
|
},
|
|
45
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* HTTP transport configuration using mcp-auditor as Claude API proxy
|
|
48
|
+
* Requires mcp-auditor server running on the specified baseUrl
|
|
49
|
+
*/
|
|
50
|
+
export const HTTP_CLAUDE_CODE_CONFIG = {
|
|
51
|
+
enabled: true,
|
|
52
|
+
transport: "http",
|
|
53
|
+
httpConfig: {
|
|
54
|
+
baseUrl: "http://localhost:8085",
|
|
55
|
+
},
|
|
56
|
+
timeout: 30000,
|
|
57
|
+
maxRetries: 2,
|
|
58
|
+
features: {
|
|
59
|
+
intelligentTestGeneration: true,
|
|
60
|
+
aupSemanticAnalysis: true,
|
|
61
|
+
behaviorInference: true,
|
|
62
|
+
annotationInference: true,
|
|
63
|
+
documentationAssessment: true,
|
|
64
|
+
documentationQuality: true,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
46
67
|
/**
|
|
47
68
|
* Claude Code Bridge
|
|
48
69
|
* Executes Claude CLI for intelligent analysis during MCP assessments
|
|
@@ -54,10 +75,13 @@ export class ClaudeCodeBridge {
|
|
|
54
75
|
constructor(config, logger) {
|
|
55
76
|
this.config = config;
|
|
56
77
|
this.logger = logger;
|
|
57
|
-
this.isAvailable = this.
|
|
58
|
-
if (!this.isAvailable) {
|
|
78
|
+
this.isAvailable = this.checkAvailability();
|
|
79
|
+
if (!this.isAvailable && this.config.transport !== "http") {
|
|
59
80
|
this.logger?.warn("Claude CLI not available - features will be disabled");
|
|
60
81
|
}
|
|
82
|
+
if (this.config.transport === "http") {
|
|
83
|
+
this.logger?.info(`Claude Code Bridge using HTTP transport: ${this.config.httpConfig?.baseUrl || "not configured"}`);
|
|
84
|
+
}
|
|
61
85
|
}
|
|
62
86
|
/**
|
|
63
87
|
* Check if a specific feature is enabled
|
|
@@ -74,10 +98,35 @@ export class ClaudeCodeBridge {
|
|
|
74
98
|
}
|
|
75
99
|
return this.config.features[feature] === true;
|
|
76
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Get the current transport type
|
|
103
|
+
*/
|
|
104
|
+
getTransport() {
|
|
105
|
+
return this.config.transport || "cli";
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Check availability based on transport type
|
|
109
|
+
* For CLI: checks if claude binary exists
|
|
110
|
+
* For HTTP: assumes available (validated on first request)
|
|
111
|
+
*/
|
|
112
|
+
checkAvailability() {
|
|
113
|
+
// HTTP transport: assume available, will fail on first request if not
|
|
114
|
+
// This is because we can't do async checks in constructor
|
|
115
|
+
if (this.config.transport === "http") {
|
|
116
|
+
// Validate httpConfig is present
|
|
117
|
+
if (!this.config.httpConfig?.baseUrl) {
|
|
118
|
+
this.logger?.warn("HTTP transport configured but baseUrl is missing - features will be disabled");
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
// CLI transport: check if claude binary exists
|
|
124
|
+
return this.checkCliAvailability();
|
|
125
|
+
}
|
|
77
126
|
/**
|
|
78
127
|
* Check if Claude CLI is available on the system
|
|
79
128
|
*/
|
|
80
|
-
|
|
129
|
+
checkCliAvailability() {
|
|
81
130
|
try {
|
|
82
131
|
execSync("which claude", { stdio: "pipe", timeout: 5000 });
|
|
83
132
|
return true;
|
|
@@ -86,6 +135,28 @@ export class ClaudeCodeBridge {
|
|
|
86
135
|
return false;
|
|
87
136
|
}
|
|
88
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Check HTTP endpoint health (async version for runtime checks)
|
|
140
|
+
* Can be called to verify HTTP transport is working
|
|
141
|
+
*/
|
|
142
|
+
async checkHttpHealth() {
|
|
143
|
+
if (this.config.transport !== "http" || !this.config.httpConfig?.baseUrl) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
try {
|
|
147
|
+
const controller = new AbortController();
|
|
148
|
+
const timeoutId = setTimeout(() => controller.abort(), 5000);
|
|
149
|
+
const response = await fetch(`${this.config.httpConfig.baseUrl}/api/health`, {
|
|
150
|
+
method: "GET",
|
|
151
|
+
signal: controller.signal,
|
|
152
|
+
});
|
|
153
|
+
clearTimeout(timeoutId);
|
|
154
|
+
return response.ok;
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
89
160
|
/**
|
|
90
161
|
* Execute Claude CLI with a prompt
|
|
91
162
|
* Uses execFileSync to avoid shell injection vulnerabilities
|
|
@@ -118,13 +189,81 @@ export class ClaudeCodeBridge {
|
|
|
118
189
|
}
|
|
119
190
|
}
|
|
120
191
|
/**
|
|
121
|
-
* Execute
|
|
192
|
+
* Execute via HTTP transport using mcp-auditor's Claude API proxy
|
|
193
|
+
* Requires mcp-auditor server with /api/claude/messages endpoint
|
|
194
|
+
*/
|
|
195
|
+
async executeHttpCommand(prompt) {
|
|
196
|
+
const startTime = Date.now();
|
|
197
|
+
if (!this.config.httpConfig) {
|
|
198
|
+
return {
|
|
199
|
+
success: false,
|
|
200
|
+
output: "",
|
|
201
|
+
error: "HTTP transport configured but httpConfig is missing",
|
|
202
|
+
executionTimeMs: Date.now() - startTime,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
const { baseUrl, apiKey, headers } = this.config.httpConfig;
|
|
206
|
+
const timeout = this.config.timeout || 30000;
|
|
207
|
+
try {
|
|
208
|
+
const controller = new AbortController();
|
|
209
|
+
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
210
|
+
const response = await fetch(`${baseUrl}/api/claude/messages`, {
|
|
211
|
+
method: "POST",
|
|
212
|
+
headers: {
|
|
213
|
+
"Content-Type": "application/json",
|
|
214
|
+
...(apiKey && { Authorization: `Bearer ${apiKey}` }),
|
|
215
|
+
...headers,
|
|
216
|
+
},
|
|
217
|
+
body: JSON.stringify({
|
|
218
|
+
messages: [{ role: "user", content: prompt }],
|
|
219
|
+
maxTokens: 4096,
|
|
220
|
+
stream: false,
|
|
221
|
+
}),
|
|
222
|
+
signal: controller.signal,
|
|
223
|
+
});
|
|
224
|
+
clearTimeout(timeoutId);
|
|
225
|
+
if (!response.ok) {
|
|
226
|
+
const errorText = await response.text().catch(() => "Unknown error");
|
|
227
|
+
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
228
|
+
}
|
|
229
|
+
const data = (await response.json());
|
|
230
|
+
// Handle various response formats from the API
|
|
231
|
+
const output = data.content ||
|
|
232
|
+
data.text ||
|
|
233
|
+
data.message?.content ||
|
|
234
|
+
JSON.stringify(data);
|
|
235
|
+
return {
|
|
236
|
+
success: true,
|
|
237
|
+
output: typeof output === "string" ? output.trim() : JSON.stringify(output),
|
|
238
|
+
executionTimeMs: Date.now() - startTime,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
const errorMessage = error instanceof Error
|
|
243
|
+
? error.name === "AbortError"
|
|
244
|
+
? `Request timeout after ${timeout}ms`
|
|
245
|
+
: error.message
|
|
246
|
+
: String(error);
|
|
247
|
+
return {
|
|
248
|
+
success: false,
|
|
249
|
+
output: "",
|
|
250
|
+
error: errorMessage,
|
|
251
|
+
executionTimeMs: Date.now() - startTime,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Execute with retries - supports both CLI and HTTP transports
|
|
122
257
|
*/
|
|
123
258
|
async executeWithRetry(prompt) {
|
|
124
259
|
const maxRetries = this.config.maxRetries || 1;
|
|
260
|
+
const isHttpTransport = this.config.transport === "http";
|
|
125
261
|
let lastError = null;
|
|
126
262
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
127
|
-
|
|
263
|
+
// Use appropriate transport
|
|
264
|
+
const response = isHttpTransport
|
|
265
|
+
? await this.executeHttpCommand(prompt)
|
|
266
|
+
: this.executeClaudeCommand(prompt);
|
|
128
267
|
if (response.success) {
|
|
129
268
|
return response;
|
|
130
269
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bryan-thompson/inspector-assessment-client",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.6",
|
|
4
4
|
"description": "Client-side application for the Enhanced MCP Inspector with assessment capabilities",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bryan Thompson <bryan@triepod.ai>",
|