@inspectr/mcplab 1.14.0 → 1.14.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.
@@ -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-B3_k1eZO.js"></script>
19
+ <script type="module" crossorigin src="/assets/index-P8sMM8bG.js"></script>
20
20
  <link rel="stylesheet" crossorigin href="/assets/index-C3E9mFQO.css">
21
21
  </head>
22
22
 
@@ -3,128 +3,179 @@ import type { AppSettings } from './types.js';
3
3
  import type { parseBody, asHtml, 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 { discoverMcpToolsForServers, runToolAnalysisJob, ToolAnalysisJob } from './tool-analysis-domain.js';
7
- import type { cleanupOAuthDebuggerSessions, oauthDebuggerSessionView, createOAuthDebuggerSession, startOrResumeOAuthDebuggerSession, submitManualCallbackToSession, submitBrowserCallbackToSession, stopOAuthDebuggerSession, oauthDebuggerExportMarkdown, oauthDebuggerExportRawTrace, OAuthDebuggerSession } from './oauth-debugger-domain.js';
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 { cleanupAssistantSessions, touchAssistantSession, assistantSessionView, pickDefaultAssistantAgentName, resolveAssistantAgentFromConfig, resolveAssistantAgentFromLibraries, ScenarioAssistantSession } from './scenario-assistant-domain.js';
10
- import type { listSnapshots, buildSnapshotFromRun, saveSnapshot, loadSnapshot, compareRunToSnapshot, applySnapshotPolicyToRunResult } from '../snapshot.js';
11
- import type { getRunResults, listRuns, getScenarioRunTraceRecords, selectScenarioIds } from './runs-store.js';
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 { ResultsJson, EvalConfig, ExecutableEvalConfig, chatWithAgent } from '@inspectr/mcplab-core';
51
+ import type {
52
+ ResultsJson,
53
+ EvalConfig,
54
+ ExecutableEvalConfig,
55
+ chatWithAgent
56
+ } from '@inspectr/mcplab-core';
17
57
  export interface AppRouteRequestContext {
18
- req: IncomingMessage;
19
- res: ServerResponse;
20
- pathname: string;
21
- method: string;
22
- settings: AppSettings;
58
+ req: IncomingMessage;
59
+ res: ServerResponse;
60
+ pathname: string;
61
+ method: string;
62
+ settings: AppSettings;
23
63
  }
24
64
  export interface ActiveJobState {
25
- get(): string | null;
26
- set(value: string | null): void;
65
+ get(): string | null;
66
+ set(value: string | null): void;
27
67
  }
28
68
  export interface RunQueueState {
29
- activeJobId: string | null;
30
- queue: string[];
31
- isAdvancingQueue: boolean;
69
+ activeJobId: string | null;
70
+ queue: string[];
71
+ isAdvancingQueue: boolean;
32
72
  }
33
73
  export interface HttpDeps {
34
- parseBody: typeof parseBody;
35
- asHtml: typeof asHtml;
36
- asJson: typeof asJson;
37
- asText: typeof asText;
74
+ parseBody: typeof parseBody;
75
+ asHtml: typeof asHtml;
76
+ asJson: typeof asJson;
77
+ asText: typeof asText;
38
78
  }
39
79
  export interface JobStreamDeps {
40
- addJobEvent: typeof addJobEvent;
41
- sendSseEvent: typeof sendSseEvent;
80
+ addJobEvent: typeof addJobEvent;
81
+ sendSseEvent: typeof sendSseEvent;
42
82
  }
43
83
  export interface LibraryDeps {
44
- readLibraries: typeof readLibraries;
84
+ readLibraries: typeof readLibraries;
45
85
  }
46
86
  export interface ToolAnalysisDeps extends LibraryDeps {
47
- discoverMcpToolsForServers: typeof discoverMcpToolsForServers;
48
- runToolAnalysisJob: typeof runToolAnalysisJob;
87
+ discoverMcpToolsForServers: typeof discoverMcpToolsForServers;
88
+ runToolAnalysisJob: typeof runToolAnalysisJob;
49
89
  }
50
90
  export interface AssistantDeps extends LibraryDeps {
51
- cleanupAssistantSessions: typeof cleanupAssistantSessions;
52
- touchAssistantSession: typeof touchAssistantSession;
53
- assistantSessionView: typeof assistantSessionView;
54
- ensureInsideRoot: typeof ensureInsideRoot;
55
- pickDefaultAssistantAgentName: typeof pickDefaultAssistantAgentName;
56
- resolveAssistantAgentFromConfig: typeof resolveAssistantAgentFromConfig;
57
- resolveAssistantAgentFromLibraries: typeof resolveAssistantAgentFromLibraries;
91
+ cleanupAssistantSessions: typeof cleanupAssistantSessions;
92
+ touchAssistantSession: typeof touchAssistantSession;
93
+ assistantSessionView: typeof assistantSessionView;
94
+ ensureInsideRoot: typeof ensureInsideRoot;
95
+ pickDefaultAssistantAgentName: typeof pickDefaultAssistantAgentName;
96
+ resolveAssistantAgentFromConfig: typeof resolveAssistantAgentFromConfig;
97
+ resolveAssistantAgentFromLibraries: typeof resolveAssistantAgentFromLibraries;
58
98
  }
59
99
  export interface ResultAssistantDeps extends LibraryDeps {
60
- pickDefaultAssistantAgentName: typeof pickDefaultAssistantAgentName;
61
- resolveAssistantAgentFromLibraries: typeof resolveAssistantAgentFromLibraries;
62
- preloadResultAssistantTools: typeof import('./result-assistant-domain.js').preloadResultAssistantTools;
63
- continueResultAssistantTurn: typeof import('./result-assistant-domain.js').continueResultAssistantTurn;
64
- executeResultAssistantToolCall: typeof import('./result-assistant-domain.js').executeResultAssistantToolCall;
65
- summarizeToolResultForResultAssistant: typeof import('./result-assistant-domain.js').summarizeToolResultForResultAssistant;
100
+ pickDefaultAssistantAgentName: typeof pickDefaultAssistantAgentName;
101
+ resolveAssistantAgentFromLibraries: typeof resolveAssistantAgentFromLibraries;
102
+ preloadResultAssistantTools: typeof import('./result-assistant-domain.js').preloadResultAssistantTools;
103
+ continueResultAssistantTurn: typeof import('./result-assistant-domain.js').continueResultAssistantTurn;
104
+ executeResultAssistantToolCall: typeof import('./result-assistant-domain.js').executeResultAssistantToolCall;
105
+ summarizeToolResultForResultAssistant: typeof import('./result-assistant-domain.js').summarizeToolResultForResultAssistant;
66
106
  }
67
107
  export interface ScenarioAssistantDeps extends LibraryDeps {
68
- cleanupAssistantSessions: typeof cleanupAssistantSessions;
69
- touchAssistantSession: typeof touchAssistantSession;
70
- assistantSessionView: typeof assistantSessionView;
71
- ensureInsideRoot: typeof ensureInsideRoot;
72
- pickDefaultAssistantAgentName: typeof pickDefaultAssistantAgentName;
73
- resolveAssistantAgentFromConfig: typeof resolveAssistantAgentFromConfig;
74
- resolveAssistantAgentFromLibraries: typeof resolveAssistantAgentFromLibraries;
75
- preloadAssistantTools: typeof import('./scenario-assistant-domain.js').preloadAssistantTools;
76
- continueAssistantTurn: typeof import('./scenario-assistant-domain.js').continueAssistantTurn;
77
- executeAssistantToolCall: typeof import('./scenario-assistant-domain.js').executeAssistantToolCall;
78
- summarizeToolResultForAssistant: typeof import('./scenario-assistant-domain.js').summarizeToolResultForAssistant;
108
+ cleanupAssistantSessions: typeof cleanupAssistantSessions;
109
+ touchAssistantSession: typeof touchAssistantSession;
110
+ assistantSessionView: typeof assistantSessionView;
111
+ ensureInsideRoot: typeof ensureInsideRoot;
112
+ pickDefaultAssistantAgentName: typeof pickDefaultAssistantAgentName;
113
+ resolveAssistantAgentFromConfig: typeof resolveAssistantAgentFromConfig;
114
+ resolveAssistantAgentFromLibraries: typeof resolveAssistantAgentFromLibraries;
115
+ preloadAssistantTools: typeof import('./scenario-assistant-domain.js').preloadAssistantTools;
116
+ continueAssistantTurn: typeof import('./scenario-assistant-domain.js').continueAssistantTurn;
117
+ executeAssistantToolCall: typeof import('./scenario-assistant-domain.js').executeAssistantToolCall;
118
+ summarizeToolResultForAssistant: typeof import('./scenario-assistant-domain.js').summarizeToolResultForAssistant;
79
119
  }
80
120
  export interface OAuthDebuggerDeps extends LibraryDeps {
81
- cleanupOAuthDebuggerSessions: typeof cleanupOAuthDebuggerSessions;
82
- oauthDebuggerSessionView: typeof oauthDebuggerSessionView;
83
- createOAuthDebuggerSession: typeof createOAuthDebuggerSession;
84
- startOrResumeOAuthDebuggerSession: typeof startOrResumeOAuthDebuggerSession;
85
- submitManualCallbackToSession: typeof submitManualCallbackToSession;
86
- submitBrowserCallbackToSession: typeof submitBrowserCallbackToSession;
87
- stopOAuthDebuggerSession: typeof stopOAuthDebuggerSession;
88
- oauthDebuggerExportMarkdown: typeof oauthDebuggerExportMarkdown;
89
- oauthDebuggerExportRawTrace: typeof oauthDebuggerExportRawTrace;
121
+ cleanupOAuthDebuggerSessions: typeof cleanupOAuthDebuggerSessions;
122
+ oauthDebuggerSessionView: typeof oauthDebuggerSessionView;
123
+ createOAuthDebuggerSession: typeof createOAuthDebuggerSession;
124
+ startOrResumeOAuthDebuggerSession: typeof startOrResumeOAuthDebuggerSession;
125
+ submitManualCallbackToSession: typeof submitManualCallbackToSession;
126
+ submitBrowserCallbackToSession: typeof submitBrowserCallbackToSession;
127
+ stopOAuthDebuggerSession: typeof stopOAuthDebuggerSession;
128
+ oauthDebuggerExportMarkdown: typeof oauthDebuggerExportMarkdown;
129
+ oauthDebuggerExportRawTrace: typeof oauthDebuggerExportRawTrace;
90
130
  }
91
131
  export interface SnapshotDeps {
92
- listSnapshots: typeof listSnapshots;
93
- buildSnapshotFromRun: typeof buildSnapshotFromRun;
94
- saveSnapshot: typeof saveSnapshot;
95
- loadSnapshot: typeof loadSnapshot;
96
- compareRunToSnapshot: typeof compareRunToSnapshot;
97
- getRunResults: typeof getRunResults;
98
- decodeEvalId: typeof decodeEvalId;
99
- readConfigRecord: typeof readConfigRecord;
132
+ listSnapshots: typeof listSnapshots;
133
+ buildSnapshotFromRun: typeof buildSnapshotFromRun;
134
+ saveSnapshot: typeof saveSnapshot;
135
+ loadSnapshot: typeof loadSnapshot;
136
+ compareRunToSnapshot: typeof compareRunToSnapshot;
137
+ getRunResults: typeof getRunResults;
138
+ decodeEvalId: typeof decodeEvalId;
139
+ readConfigRecord: typeof readConfigRecord;
100
140
  }
101
141
  export interface ConfigDeps {
102
- listConfigs: typeof listConfigs;
103
- safeFileName: typeof safeFileName;
104
- ensureInsideRoot: typeof ensureInsideRoot;
105
- decodeEvalId: typeof decodeEvalId;
106
- readConfigRecord: typeof readConfigRecord;
107
- readConfigRecordOrInvalid: typeof readConfigRecordOrInvalid;
142
+ listConfigs: typeof listConfigs;
143
+ safeFileName: typeof safeFileName;
144
+ ensureInsideRoot: typeof ensureInsideRoot;
145
+ decodeEvalId: typeof decodeEvalId;
146
+ readConfigRecord: typeof readConfigRecord;
147
+ readConfigRecordOrInvalid: typeof readConfigRecordOrInvalid;
108
148
  }
109
149
  export interface RunDeps {
110
- ensureInsideRoot: typeof ensureInsideRoot;
111
- listRuns: typeof listRuns;
112
- getRunResults: typeof getRunResults;
113
- getScenarioRunTraceRecords: typeof getScenarioRunTraceRecords;
114
- selectScenarioIds: typeof selectScenarioIds;
115
- expandConfigForAgents: (config: EvalConfig, requestedAgents?: string[]) => ExecutableEvalConfig;
116
- resolveRunSelectedAgents: (config: EvalConfig, requestedAgents?: string[]) => string[] | undefined;
117
- loadSnapshot: typeof loadSnapshot;
118
- compareRunToSnapshot: typeof compareRunToSnapshot;
119
- applySnapshotPolicyToRunResult: typeof applySnapshotPolicyToRunResult;
120
- readLibraries: typeof readLibraries;
121
- pickDefaultAssistantAgentName: typeof pickDefaultAssistantAgentName;
122
- resolveAssistantAgentFromLibraries: typeof resolveAssistantAgentFromLibraries;
123
- chatWithAgent: typeof chatWithAgent;
124
- pkgVersion: string;
125
- }
126
- export interface AppRouteDeps extends HttpDeps, JobStreamDeps, ToolAnalysisDeps, OAuthDebuggerDeps, ResultAssistantDeps, ScenarioAssistantDeps, SnapshotDeps, ConfigDeps, RunDeps {
150
+ ensureInsideRoot: typeof ensureInsideRoot;
151
+ listRuns: typeof listRuns;
152
+ getRunResults: typeof getRunResults;
153
+ getScenarioRunTraceRecords: typeof getScenarioRunTraceRecords;
154
+ selectScenarioIds: typeof selectScenarioIds;
155
+ expandConfigForAgents: (config: EvalConfig, requestedAgents?: string[]) => ExecutableEvalConfig;
156
+ resolveRunSelectedAgents: (
157
+ config: EvalConfig,
158
+ requestedAgents?: string[]
159
+ ) => string[] | undefined;
160
+ loadSnapshot: typeof loadSnapshot;
161
+ compareRunToSnapshot: typeof compareRunToSnapshot;
162
+ applySnapshotPolicyToRunResult: typeof applySnapshotPolicyToRunResult;
163
+ readLibraries: typeof readLibraries;
164
+ pickDefaultAssistantAgentName: typeof pickDefaultAssistantAgentName;
165
+ resolveAssistantAgentFromLibraries: typeof resolveAssistantAgentFromLibraries;
166
+ chatWithAgent: typeof chatWithAgent;
167
+ pkgVersion: string;
127
168
  }
169
+ export interface AppRouteDeps
170
+ extends HttpDeps,
171
+ JobStreamDeps,
172
+ ToolAnalysisDeps,
173
+ OAuthDebuggerDeps,
174
+ ResultAssistantDeps,
175
+ ScenarioAssistantDeps,
176
+ SnapshotDeps,
177
+ ConfigDeps,
178
+ RunDeps {}
128
179
  export type ToolAnalysisJobsMap = Map<string, ToolAnalysisJob>;
129
180
  export type OAuthDebuggerSessionsMap = Map<string, OAuthDebuggerSession>;
130
181
  export type OAuthRuntimeSessionsMap = Map<string, OAuthRuntimeSession>;
@@ -132,4 +183,4 @@ export type AssistantSessionsMap = Map<string, ScenarioAssistantSession>;
132
183
  export type RunsResults = ResultsJson;
133
184
  export type RunsList = RunSummary[];
134
185
  export type ConfigRecords = ConfigRecord[];
135
- //# sourceMappingURL=app-context.d.ts.map
186
+ //# sourceMappingURL=app-context.d.ts.map
@@ -3,4 +3,4 @@ export declare function asJson(res: ServerResponse, code: number, body: unknown)
3
3
  export declare function asHtml(res: ServerResponse, code: number, body: string): void;
4
4
  export declare function asText(res: ServerResponse, code: number, body: string): void;
5
5
  export declare function parseBody(req: IncomingMessage): Promise<any>;
6
- //# sourceMappingURL=http.d.ts.map
6
+ //# sourceMappingURL=http.d.ts.map