@inspectr/mcplab 1.11.0 → 1.12.1
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/app/assets/index-Djwh_08m.js +249 -0
- package/dist/app/index.html +1 -1
- package/dist/app-server/app-context.d.ts +140 -89
- package/dist/app-server/oauth-session-manager.d.ts +50 -44
- package/dist/app-server/runs-routes.d.ts +54 -29
- package/dist/app-server/runs-routes.js +7 -1
- package/dist/app-server/runs-routes.js.map +1 -1
- package/package.json +4 -4
- package/dist/app/assets/index-CCDgY_NR.js +0 -249
package/dist/app/index.html
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<meta name="twitter:card" content="summary_large_image" />
|
|
17
17
|
<meta name="twitter:site" content="@Inspectr" />
|
|
18
18
|
<meta name="twitter:image" content="" />
|
|
19
|
-
<script type="module" crossorigin src="/assets/index-
|
|
19
|
+
<script type="module" crossorigin src="/assets/index-Djwh_08m.js"></script>
|
|
20
20
|
<link rel="stylesheet" crossorigin href="/assets/index-cqsnfkao.css">
|
|
21
21
|
</head>
|
|
22
22
|
|
|
@@ -3,127 +3,178 @@ import type { AppSettings } from './types.js';
|
|
|
3
3
|
import type { parseBody, asJson, asText } from './http.js';
|
|
4
4
|
import type { addJobEvent, sendSseEvent } from './jobs.js';
|
|
5
5
|
import type { readLibraries } from './libraries-store.js';
|
|
6
|
-
import type {
|
|
7
|
-
|
|
6
|
+
import type {
|
|
7
|
+
discoverMcpToolsForServers,
|
|
8
|
+
runToolAnalysisJob,
|
|
9
|
+
ToolAnalysisJob
|
|
10
|
+
} from './tool-analysis-domain.js';
|
|
11
|
+
import type {
|
|
12
|
+
cleanupOAuthDebuggerSessions,
|
|
13
|
+
oauthDebuggerSessionView,
|
|
14
|
+
createOAuthDebuggerSession,
|
|
15
|
+
startOrResumeOAuthDebuggerSession,
|
|
16
|
+
submitManualCallbackToSession,
|
|
17
|
+
submitBrowserCallbackToSession,
|
|
18
|
+
stopOAuthDebuggerSession,
|
|
19
|
+
oauthDebuggerExportMarkdown,
|
|
20
|
+
oauthDebuggerExportRawTrace,
|
|
21
|
+
OAuthDebuggerSession
|
|
22
|
+
} from './oauth-debugger-domain.js';
|
|
8
23
|
import type { OAuthRuntimeSession } from './oauth-runtime-domain.js';
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
|
|
24
|
+
import type {
|
|
25
|
+
cleanupAssistantSessions,
|
|
26
|
+
touchAssistantSession,
|
|
27
|
+
assistantSessionView,
|
|
28
|
+
pickDefaultAssistantAgentName,
|
|
29
|
+
resolveAssistantAgentFromConfig,
|
|
30
|
+
resolveAssistantAgentFromLibraries,
|
|
31
|
+
ScenarioAssistantSession
|
|
32
|
+
} from './scenario-assistant-domain.js';
|
|
33
|
+
import type {
|
|
34
|
+
listSnapshots,
|
|
35
|
+
buildSnapshotFromRun,
|
|
36
|
+
saveSnapshot,
|
|
37
|
+
loadSnapshot,
|
|
38
|
+
compareRunToSnapshot,
|
|
39
|
+
applySnapshotPolicyToRunResult
|
|
40
|
+
} from '../snapshot.js';
|
|
41
|
+
import type {
|
|
42
|
+
getRunResults,
|
|
43
|
+
listRuns,
|
|
44
|
+
getScenarioRunTraceRecords,
|
|
45
|
+
selectScenarioIds
|
|
46
|
+
} from './runs-store.js';
|
|
12
47
|
import type { decodeEvalId, ensureInsideRoot, safeFileName } from './store-utils.js';
|
|
13
48
|
import type { readConfigRecord, readConfigRecordOrInvalid, listConfigs } from './config-store.js';
|
|
14
49
|
import type { RunSummary } from './runs-store.js';
|
|
15
50
|
import type { ConfigRecord } from './config-store.js';
|
|
16
|
-
import type {
|
|
51
|
+
import type {
|
|
52
|
+
ResultsJson,
|
|
53
|
+
EvalConfig,
|
|
54
|
+
ExecutableEvalConfig,
|
|
55
|
+
chatWithAgent
|
|
56
|
+
} from '@inspectr/mcplab-core';
|
|
17
57
|
export interface AppRouteRequestContext {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
58
|
+
req: IncomingMessage;
|
|
59
|
+
res: ServerResponse;
|
|
60
|
+
pathname: string;
|
|
61
|
+
method: string;
|
|
62
|
+
settings: AppSettings;
|
|
23
63
|
}
|
|
24
64
|
export interface ActiveJobState {
|
|
25
|
-
|
|
26
|
-
|
|
65
|
+
get(): string | null;
|
|
66
|
+
set(value: string | null): void;
|
|
27
67
|
}
|
|
28
68
|
export interface RunQueueState {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
69
|
+
activeJobId: string | null;
|
|
70
|
+
queue: string[];
|
|
71
|
+
isAdvancingQueue: boolean;
|
|
32
72
|
}
|
|
33
73
|
export interface HttpDeps {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
74
|
+
parseBody: typeof parseBody;
|
|
75
|
+
asJson: typeof asJson;
|
|
76
|
+
asText: typeof asText;
|
|
37
77
|
}
|
|
38
78
|
export interface JobStreamDeps {
|
|
39
|
-
|
|
40
|
-
|
|
79
|
+
addJobEvent: typeof addJobEvent;
|
|
80
|
+
sendSseEvent: typeof sendSseEvent;
|
|
41
81
|
}
|
|
42
82
|
export interface LibraryDeps {
|
|
43
|
-
|
|
83
|
+
readLibraries: typeof readLibraries;
|
|
44
84
|
}
|
|
45
85
|
export interface ToolAnalysisDeps extends LibraryDeps {
|
|
46
|
-
|
|
47
|
-
|
|
86
|
+
discoverMcpToolsForServers: typeof discoverMcpToolsForServers;
|
|
87
|
+
runToolAnalysisJob: typeof runToolAnalysisJob;
|
|
48
88
|
}
|
|
49
89
|
export interface AssistantDeps extends LibraryDeps {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
90
|
+
cleanupAssistantSessions: typeof cleanupAssistantSessions;
|
|
91
|
+
touchAssistantSession: typeof touchAssistantSession;
|
|
92
|
+
assistantSessionView: typeof assistantSessionView;
|
|
93
|
+
ensureInsideRoot: typeof ensureInsideRoot;
|
|
94
|
+
pickDefaultAssistantAgentName: typeof pickDefaultAssistantAgentName;
|
|
95
|
+
resolveAssistantAgentFromConfig: typeof resolveAssistantAgentFromConfig;
|
|
96
|
+
resolveAssistantAgentFromLibraries: typeof resolveAssistantAgentFromLibraries;
|
|
57
97
|
}
|
|
58
98
|
export interface ResultAssistantDeps extends LibraryDeps {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
99
|
+
pickDefaultAssistantAgentName: typeof pickDefaultAssistantAgentName;
|
|
100
|
+
resolveAssistantAgentFromLibraries: typeof resolveAssistantAgentFromLibraries;
|
|
101
|
+
preloadResultAssistantTools: typeof import('./result-assistant-domain.js').preloadResultAssistantTools;
|
|
102
|
+
continueResultAssistantTurn: typeof import('./result-assistant-domain.js').continueResultAssistantTurn;
|
|
103
|
+
executeResultAssistantToolCall: typeof import('./result-assistant-domain.js').executeResultAssistantToolCall;
|
|
104
|
+
summarizeToolResultForResultAssistant: typeof import('./result-assistant-domain.js').summarizeToolResultForResultAssistant;
|
|
65
105
|
}
|
|
66
106
|
export interface ScenarioAssistantDeps extends LibraryDeps {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
107
|
+
cleanupAssistantSessions: typeof cleanupAssistantSessions;
|
|
108
|
+
touchAssistantSession: typeof touchAssistantSession;
|
|
109
|
+
assistantSessionView: typeof assistantSessionView;
|
|
110
|
+
ensureInsideRoot: typeof ensureInsideRoot;
|
|
111
|
+
pickDefaultAssistantAgentName: typeof pickDefaultAssistantAgentName;
|
|
112
|
+
resolveAssistantAgentFromConfig: typeof resolveAssistantAgentFromConfig;
|
|
113
|
+
resolveAssistantAgentFromLibraries: typeof resolveAssistantAgentFromLibraries;
|
|
114
|
+
preloadAssistantTools: typeof import('./scenario-assistant-domain.js').preloadAssistantTools;
|
|
115
|
+
continueAssistantTurn: typeof import('./scenario-assistant-domain.js').continueAssistantTurn;
|
|
116
|
+
executeAssistantToolCall: typeof import('./scenario-assistant-domain.js').executeAssistantToolCall;
|
|
117
|
+
summarizeToolResultForAssistant: typeof import('./scenario-assistant-domain.js').summarizeToolResultForAssistant;
|
|
78
118
|
}
|
|
79
119
|
export interface OAuthDebuggerDeps extends LibraryDeps {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
120
|
+
cleanupOAuthDebuggerSessions: typeof cleanupOAuthDebuggerSessions;
|
|
121
|
+
oauthDebuggerSessionView: typeof oauthDebuggerSessionView;
|
|
122
|
+
createOAuthDebuggerSession: typeof createOAuthDebuggerSession;
|
|
123
|
+
startOrResumeOAuthDebuggerSession: typeof startOrResumeOAuthDebuggerSession;
|
|
124
|
+
submitManualCallbackToSession: typeof submitManualCallbackToSession;
|
|
125
|
+
submitBrowserCallbackToSession: typeof submitBrowserCallbackToSession;
|
|
126
|
+
stopOAuthDebuggerSession: typeof stopOAuthDebuggerSession;
|
|
127
|
+
oauthDebuggerExportMarkdown: typeof oauthDebuggerExportMarkdown;
|
|
128
|
+
oauthDebuggerExportRawTrace: typeof oauthDebuggerExportRawTrace;
|
|
89
129
|
}
|
|
90
130
|
export interface SnapshotDeps {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
131
|
+
listSnapshots: typeof listSnapshots;
|
|
132
|
+
buildSnapshotFromRun: typeof buildSnapshotFromRun;
|
|
133
|
+
saveSnapshot: typeof saveSnapshot;
|
|
134
|
+
loadSnapshot: typeof loadSnapshot;
|
|
135
|
+
compareRunToSnapshot: typeof compareRunToSnapshot;
|
|
136
|
+
getRunResults: typeof getRunResults;
|
|
137
|
+
decodeEvalId: typeof decodeEvalId;
|
|
138
|
+
readConfigRecord: typeof readConfigRecord;
|
|
99
139
|
}
|
|
100
140
|
export interface ConfigDeps {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
141
|
+
listConfigs: typeof listConfigs;
|
|
142
|
+
safeFileName: typeof safeFileName;
|
|
143
|
+
ensureInsideRoot: typeof ensureInsideRoot;
|
|
144
|
+
decodeEvalId: typeof decodeEvalId;
|
|
145
|
+
readConfigRecord: typeof readConfigRecord;
|
|
146
|
+
readConfigRecordOrInvalid: typeof readConfigRecordOrInvalid;
|
|
107
147
|
}
|
|
108
148
|
export interface RunDeps {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
149
|
+
ensureInsideRoot: typeof ensureInsideRoot;
|
|
150
|
+
listRuns: typeof listRuns;
|
|
151
|
+
getRunResults: typeof getRunResults;
|
|
152
|
+
getScenarioRunTraceRecords: typeof getScenarioRunTraceRecords;
|
|
153
|
+
selectScenarioIds: typeof selectScenarioIds;
|
|
154
|
+
expandConfigForAgents: (config: EvalConfig, requestedAgents?: string[]) => ExecutableEvalConfig;
|
|
155
|
+
resolveRunSelectedAgents: (
|
|
156
|
+
config: EvalConfig,
|
|
157
|
+
requestedAgents?: string[]
|
|
158
|
+
) => string[] | undefined;
|
|
159
|
+
loadSnapshot: typeof loadSnapshot;
|
|
160
|
+
compareRunToSnapshot: typeof compareRunToSnapshot;
|
|
161
|
+
applySnapshotPolicyToRunResult: typeof applySnapshotPolicyToRunResult;
|
|
162
|
+
readLibraries: typeof readLibraries;
|
|
163
|
+
pickDefaultAssistantAgentName: typeof pickDefaultAssistantAgentName;
|
|
164
|
+
resolveAssistantAgentFromLibraries: typeof resolveAssistantAgentFromLibraries;
|
|
165
|
+
chatWithAgent: typeof chatWithAgent;
|
|
166
|
+
pkgVersion: string;
|
|
126
167
|
}
|
|
168
|
+
export interface AppRouteDeps
|
|
169
|
+
extends HttpDeps,
|
|
170
|
+
JobStreamDeps,
|
|
171
|
+
ToolAnalysisDeps,
|
|
172
|
+
OAuthDebuggerDeps,
|
|
173
|
+
ResultAssistantDeps,
|
|
174
|
+
ScenarioAssistantDeps,
|
|
175
|
+
SnapshotDeps,
|
|
176
|
+
ConfigDeps,
|
|
177
|
+
RunDeps {}
|
|
127
178
|
export type ToolAnalysisJobsMap = Map<string, ToolAnalysisJob>;
|
|
128
179
|
export type OAuthDebuggerSessionsMap = Map<string, OAuthDebuggerSession>;
|
|
129
180
|
export type OAuthRuntimeSessionsMap = Map<string, OAuthRuntimeSession>;
|
|
@@ -131,4 +182,4 @@ export type AssistantSessionsMap = Map<string, ScenarioAssistantSession>;
|
|
|
131
182
|
export type RunsResults = ResultsJson;
|
|
132
183
|
export type RunsList = RunSummary[];
|
|
133
184
|
export type ConfigRecords = ConfigRecord[];
|
|
134
|
-
//# sourceMappingURL=app-context.d.ts.map
|
|
185
|
+
//# sourceMappingURL=app-context.d.ts.map
|
|
@@ -1,55 +1,61 @@
|
|
|
1
1
|
import type { OAuthDebuggerSessionsMap, OAuthRuntimeSessionsMap } from './app-context.js';
|
|
2
2
|
export interface OAuthEnsureServerResult {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
serverName: string;
|
|
4
|
+
status: 'ready' | 'auth_required' | 'not_oauth';
|
|
5
|
+
debugState?: 'reused' | 'refreshed' | 'auth_required' | 'not_oauth';
|
|
6
|
+
tokenExpiresAt?: string;
|
|
7
|
+
tokenExpiresInSeconds?: number;
|
|
8
|
+
runtimeSessionId?: string;
|
|
9
|
+
authorizationUrl?: string;
|
|
10
|
+
authorizeLaunchUrl?: string;
|
|
11
|
+
message?: string;
|
|
12
12
|
}
|
|
13
13
|
export interface OAuthEnsureServersResponse {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
servers: OAuthEnsureServerResult[];
|
|
15
|
+
allReady: boolean;
|
|
16
16
|
}
|
|
17
17
|
export interface OAuthAuthRequiredDetail {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
serverName: string;
|
|
19
|
+
runtimeSessionId?: string;
|
|
20
|
+
authorizationUrl?: string;
|
|
21
|
+
authorizeLaunchUrl?: string;
|
|
22
|
+
message: string;
|
|
23
23
|
}
|
|
24
24
|
export declare class OAuthAuthorizationRequiredError extends Error {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
readonly details: OAuthAuthRequiredDetail[];
|
|
26
|
+
constructor(details: OAuthAuthRequiredDetail[]);
|
|
27
27
|
}
|
|
28
28
|
export declare class OAuthSessionManager {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
29
|
+
private readonly params;
|
|
30
|
+
private states;
|
|
31
|
+
constructor(params: {
|
|
32
|
+
librariesDir: string;
|
|
33
|
+
runtimeSessions: OAuthRuntimeSessionsMap;
|
|
34
|
+
oauthDebuggerSessions: OAuthDebuggerSessionsMap;
|
|
35
|
+
refreshSkewMs?: number;
|
|
36
|
+
});
|
|
37
|
+
setLibrariesDir(next: string): void;
|
|
38
|
+
private get refreshSkewMs();
|
|
39
|
+
private getServerConfig;
|
|
40
|
+
private getState;
|
|
41
|
+
private updateStateFromTokenPayload;
|
|
42
|
+
private syncStateFromRuntimeSession;
|
|
43
|
+
private tokenExpiredOrNearExpiry;
|
|
44
|
+
refreshIfNeeded(serverName: string): Promise<boolean>;
|
|
45
|
+
private getExistingRuntimeView;
|
|
46
|
+
ensureServerAuthorized(serverName: string, hostHeader?: string): Promise<OAuthEnsureServerResult>;
|
|
47
|
+
ensureServersAuthorized(
|
|
48
|
+
serverNames: string[],
|
|
49
|
+
hostHeader?: string
|
|
50
|
+
): Promise<OAuthEnsureServersResponse>;
|
|
51
|
+
getAuthHeadersForServers(
|
|
52
|
+
serverNames: string[],
|
|
53
|
+
hostHeader?: string
|
|
54
|
+
): Promise<Record<string, Record<string, string>>>;
|
|
55
|
+
noteRuntimeSession(serverName: string, runtimeSessionId: string): void;
|
|
56
|
+
checkServersAuthStatus(serverNames: string[]): {
|
|
57
|
+
name: string;
|
|
58
|
+
status: 'ready' | 'auth_required' | 'not_oauth';
|
|
59
|
+
}[];
|
|
54
60
|
}
|
|
55
|
-
//# sourceMappingURL=oauth-session-manager.d.ts.map
|
|
61
|
+
//# sourceMappingURL=oauth-session-manager.d.ts.map
|
|
@@ -3,41 +3,66 @@ import { type EvalConfig } from '@inspectr/mcplab-core';
|
|
|
3
3
|
import type { SseEvent } from './jobs.js';
|
|
4
4
|
import type { RunQueueState, AppRouteDeps, AppRouteRequestContext } from './app-context.js';
|
|
5
5
|
import { type OAuthSessionManager } from './oauth-session-manager.js';
|
|
6
|
-
export type RunsRouteDeps = Pick<
|
|
6
|
+
export type RunsRouteDeps = Pick<
|
|
7
|
+
AppRouteDeps,
|
|
8
|
+
| 'parseBody'
|
|
9
|
+
| 'asJson'
|
|
10
|
+
| 'addJobEvent'
|
|
11
|
+
| 'sendSseEvent'
|
|
12
|
+
| 'ensureInsideRoot'
|
|
13
|
+
| 'listRuns'
|
|
14
|
+
| 'getRunResults'
|
|
15
|
+
| 'getScenarioRunTraceRecords'
|
|
16
|
+
| 'selectScenarioIds'
|
|
17
|
+
| 'expandConfigForAgents'
|
|
18
|
+
| 'resolveRunSelectedAgents'
|
|
19
|
+
| 'loadSnapshot'
|
|
20
|
+
| 'compareRunToSnapshot'
|
|
21
|
+
| 'applySnapshotPolicyToRunResult'
|
|
22
|
+
| 'readLibraries'
|
|
23
|
+
| 'pickDefaultAssistantAgentName'
|
|
24
|
+
| 'pkgVersion'
|
|
25
|
+
>;
|
|
7
26
|
type RunParams = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
27
|
+
configPath: string;
|
|
28
|
+
runsPerScenario: number;
|
|
29
|
+
scenarioId?: string;
|
|
30
|
+
scenarioIds?: string[];
|
|
31
|
+
requestedAgents?: string[];
|
|
32
|
+
applySnapshotEval: boolean;
|
|
33
|
+
runNote?: string;
|
|
34
|
+
oauthServerNames?: string[];
|
|
16
35
|
};
|
|
17
36
|
type RunJob = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
37
|
+
id: string;
|
|
38
|
+
status: 'queued' | 'blocked_auth' | 'running' | 'stopped' | 'completed' | 'error';
|
|
39
|
+
events: SseEvent[];
|
|
40
|
+
clients: Set<ServerResponse>;
|
|
41
|
+
abortController: AbortController;
|
|
42
|
+
runParams: RunParams;
|
|
43
|
+
blockedAuthServers?: string[];
|
|
25
44
|
};
|
|
26
|
-
export declare function mergeLibraryAgentsIntoConfig(
|
|
27
|
-
|
|
45
|
+
export declare function mergeLibraryAgentsIntoConfig(
|
|
46
|
+
config: EvalConfig,
|
|
47
|
+
libraryAgents: EvalConfig['agents']
|
|
48
|
+
): EvalConfig;
|
|
49
|
+
export declare function applyLibraryAgents(
|
|
50
|
+
loaded: {
|
|
28
51
|
config: EvalConfig;
|
|
29
52
|
hash: string;
|
|
30
|
-
},
|
|
53
|
+
},
|
|
54
|
+
libraryAgents: EvalConfig['agents']
|
|
55
|
+
): void;
|
|
31
56
|
export declare function handleRunsRoutes(params: {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
57
|
+
req: IncomingMessage;
|
|
58
|
+
res: ServerResponse;
|
|
59
|
+
pathname: string;
|
|
60
|
+
method: string;
|
|
61
|
+
settings: AppRouteRequestContext['settings'];
|
|
62
|
+
jobs: Map<string, RunJob>;
|
|
63
|
+
runQueueState: RunQueueState;
|
|
64
|
+
oauthSessionManager: OAuthSessionManager;
|
|
65
|
+
deps: RunsRouteDeps;
|
|
41
66
|
}): Promise<boolean>;
|
|
42
67
|
export {};
|
|
43
|
-
//# sourceMappingURL=runs-routes.d.ts.map
|
|
68
|
+
//# sourceMappingURL=runs-routes.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { existsSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
3
|
import { tmpdir } from 'node:os';
|
|
4
|
-
import { isAbsolute, join, resolve } from 'node:path';
|
|
4
|
+
import { isAbsolute, join, relative, resolve } from 'node:path';
|
|
5
5
|
import { McpClientManager, loadConfig, hashConfig, runAll, renderSummaryMarkdown } from '@inspectr/mcplab-core';
|
|
6
6
|
import { renderReport } from '@inspectr/mcplab-reporting';
|
|
7
7
|
import { OAuthAuthorizationRequiredError } from './oauth-session-manager.js';
|
|
@@ -749,6 +749,12 @@ async function executeRunJob(job, settings, jobs, runQueueState, oauthSessionMan
|
|
|
749
749
|
});
|
|
750
750
|
}
|
|
751
751
|
});
|
|
752
|
+
const relativeConfigPathRaw = relative(settings.evalsDir, configPath);
|
|
753
|
+
const relativeConfigPath = relativeConfigPathRaw.replace(/\\/g, '/').replace(/^\.\/+/, '');
|
|
754
|
+
results.metadata.config_path = relativeConfigPath || configPath;
|
|
755
|
+
if (loaded.config.name && loaded.config.name.trim().length > 0) {
|
|
756
|
+
results.metadata.config_name = loaded.config.name.trim();
|
|
757
|
+
}
|
|
752
758
|
addJobEvent(job, {
|
|
753
759
|
type: 'log',
|
|
754
760
|
ts: new Date().toISOString(),
|