@inspectr/mcplab 1.28.3 → 1.28.4
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-DZoA-93O.js +258 -0
- package/dist/app/assets/index-aPA0WpCV.css +1 -0
- package/dist/app/index.html +2 -2
- package/dist/app-server/assistant-events.d.ts +28 -8
- package/dist/app-server/runs-store.d.ts +1 -0
- package/dist/app-server/runs-store.d.ts.map +1 -1
- package/dist/app-server/runs-store.js +1 -0
- package/dist/app-server/runs-store.js.map +1 -1
- package/dist/app-server/scenario-assistant-domain.d.ts +156 -130
- package/dist/app-server/tool-analysis-domain.d.ts +167 -179
- package/dist/app-server/tool-analysis-domain.d.ts.map +1 -1
- package/dist/app-server/tool-analysis-domain.js +14 -4
- package/dist/app-server/tool-analysis-domain.js.map +1 -1
- package/dist/app-server/tool-analysis-storage.d.ts +1 -0
- package/dist/app-server/tool-analysis-storage.d.ts.map +1 -1
- package/dist/app-server/tool-analysis-storage.js +20 -1
- package/dist/app-server/tool-analysis-storage.js.map +1 -1
- package/dist/app-server/tool-definition-improvement.d.ts +41 -0
- package/dist/app-server/tool-definition-improvement.d.ts.map +1 -0
- package/dist/app-server/tool-definition-improvement.js +78 -0
- package/dist/app-server/tool-definition-improvement.js.map +1 -0
- package/dist/app-server/tool-definition-quality.d.ts +96 -0
- package/dist/app-server/tool-definition-quality.d.ts.map +1 -0
- package/dist/app-server/tool-definition-quality.js +237 -0
- package/dist/app-server/tool-definition-quality.js.map +1 -0
- package/dist/app-server/types.d.ts +25 -25
- package/package.json +1 -1
- package/dist/app/assets/index-Bug5M-yX.js +0 -258
- package/dist/app/assets/index-CVe_v-Bh.css +0 -1
|
@@ -5,154 +5,180 @@ import type { AssistantSseEvent } from './assistant-events.js';
|
|
|
5
5
|
import { readLibraries } from './libraries-store.js';
|
|
6
6
|
export { truncateJson } from './assistant-common.js';
|
|
7
7
|
interface ScenarioAssistantContextInput {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}>;
|
|
23
|
-
extractRules: Array<{
|
|
24
|
-
name: string;
|
|
25
|
-
pattern: string;
|
|
26
|
-
}>;
|
|
27
|
-
};
|
|
28
|
-
availableServers?: Array<{
|
|
29
|
-
name: string;
|
|
30
|
-
url?: string;
|
|
8
|
+
scenario: {
|
|
9
|
+
id: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
prompt: string;
|
|
12
|
+
serverNames: string[];
|
|
13
|
+
evalRules: Array<{
|
|
14
|
+
type: string;
|
|
15
|
+
value?: string | number | boolean;
|
|
16
|
+
sequence?: string[];
|
|
17
|
+
path?: string;
|
|
18
|
+
equals?: string | number | boolean;
|
|
19
|
+
tool?: string;
|
|
20
|
+
label?: string;
|
|
21
|
+
prompt?: string;
|
|
31
22
|
}>;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
model: string;
|
|
23
|
+
extractRules: Array<{
|
|
24
|
+
name: string;
|
|
25
|
+
pattern: string;
|
|
36
26
|
}>;
|
|
27
|
+
};
|
|
28
|
+
availableServers?: Array<{
|
|
29
|
+
name: string;
|
|
30
|
+
url?: string;
|
|
31
|
+
}>;
|
|
32
|
+
availableAgents?: Array<{
|
|
33
|
+
name: string;
|
|
34
|
+
provider: string;
|
|
35
|
+
model: string;
|
|
36
|
+
}>;
|
|
37
37
|
}
|
|
38
38
|
interface ScenarioAssistantSuggestionBundle {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
39
|
+
prompt?: {
|
|
40
|
+
replacement: string;
|
|
41
|
+
rationale?: string;
|
|
42
|
+
};
|
|
43
|
+
evalRules?: {
|
|
44
|
+
replacement: Array<{
|
|
45
|
+
type: string;
|
|
46
|
+
value?: string | number | boolean;
|
|
47
|
+
sequence?: string[];
|
|
48
|
+
path?: string;
|
|
49
|
+
equals?: string | number | boolean;
|
|
50
|
+
tool?: string;
|
|
51
|
+
label?: string;
|
|
52
|
+
prompt?: string;
|
|
53
|
+
}>;
|
|
54
|
+
rationale?: string;
|
|
55
|
+
};
|
|
56
|
+
extractRules?: {
|
|
57
|
+
replacement: Array<{
|
|
58
|
+
name: string;
|
|
59
|
+
pattern: string;
|
|
60
|
+
}>;
|
|
61
|
+
rationale?: string;
|
|
62
|
+
};
|
|
63
|
+
notes?: string[];
|
|
64
64
|
}
|
|
65
65
|
interface ScenarioAssistantEvalRuleSuggestion {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
type: string;
|
|
67
|
+
value?: string | number | boolean;
|
|
68
|
+
sequence?: string[];
|
|
69
|
+
path?: string;
|
|
70
|
+
equals?: string | number | boolean;
|
|
71
|
+
tool?: string;
|
|
72
|
+
label?: string;
|
|
73
|
+
prompt?: string;
|
|
74
74
|
}
|
|
75
75
|
interface AssistantPendingToolCall {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
id: string;
|
|
77
|
+
server: string;
|
|
78
|
+
tool: string;
|
|
79
|
+
publicToolName: string;
|
|
80
|
+
arguments: unknown;
|
|
81
|
+
status: 'pending' | 'approved' | 'denied' | 'error';
|
|
82
|
+
createdAt: string;
|
|
83
|
+
resultPreview?: string;
|
|
84
|
+
error?: string;
|
|
85
85
|
}
|
|
86
86
|
interface AssistantChatMessage {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
id: string;
|
|
88
|
+
role: 'user' | 'assistant' | 'tool' | 'system';
|
|
89
|
+
text: string;
|
|
90
|
+
createdAt: string;
|
|
91
|
+
suggestions?: ScenarioAssistantSuggestionBundle;
|
|
92
|
+
pendingToolCallId?: string;
|
|
93
|
+
pendingToolCallIds?: string[];
|
|
94
|
+
toolRequestServer?: string;
|
|
95
|
+
toolRequestName?: string;
|
|
96
|
+
toolRequestPublicName?: string;
|
|
97
97
|
}
|
|
98
98
|
export interface ScenarioAssistantSession {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
99
|
+
id: string;
|
|
100
|
+
createdAt: number;
|
|
101
|
+
lastTouchedAt: number;
|
|
102
|
+
configPath?: string;
|
|
103
|
+
selectedAssistantAgentName: string;
|
|
104
|
+
context: ScenarioAssistantContextInput;
|
|
105
|
+
agentConfig: AgentConfig;
|
|
106
|
+
mcp: McpClientManager;
|
|
107
|
+
tools: ToolDef[];
|
|
108
|
+
toolPublicMap: Map<
|
|
109
|
+
string,
|
|
110
|
+
{
|
|
111
|
+
server: string;
|
|
112
|
+
tool: string;
|
|
113
|
+
}
|
|
114
|
+
>;
|
|
115
|
+
pendingToolCalls: AssistantPendingToolCall[];
|
|
116
|
+
chatMessages: AssistantChatMessage[];
|
|
117
|
+
llmMessages: LlmMessage[];
|
|
118
|
+
warnings: string[];
|
|
119
|
+
systemPromptCache?: string;
|
|
120
|
+
events: AssistantSseEvent[];
|
|
121
|
+
clients: Set<ServerResponse>;
|
|
119
122
|
}
|
|
120
|
-
export declare function cleanupAssistantSessions(
|
|
123
|
+
export declare function cleanupAssistantSessions(
|
|
124
|
+
sessions: Map<string, ScenarioAssistantSession>,
|
|
125
|
+
now?: number
|
|
126
|
+
): void;
|
|
121
127
|
export declare function touchAssistantSession(session: ScenarioAssistantSession): void;
|
|
122
128
|
export declare function assistantSessionView(session: ScenarioAssistantSession): {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
id: string;
|
|
130
|
+
createdAt: string;
|
|
131
|
+
updatedAt: string;
|
|
132
|
+
selectedAssistantAgentName: string;
|
|
133
|
+
model: string;
|
|
134
|
+
provider: 'openai' | 'anthropic' | 'azure_openai';
|
|
135
|
+
warnings: string[];
|
|
136
|
+
toolsLoaded: number;
|
|
137
|
+
toolServers: string[];
|
|
138
|
+
messages: AssistantChatMessage[];
|
|
139
|
+
pendingToolCalls: AssistantPendingToolCall[];
|
|
134
140
|
};
|
|
135
|
-
export declare function preloadAssistantTools(
|
|
141
|
+
export declare function preloadAssistantTools(
|
|
142
|
+
session: ScenarioAssistantSession,
|
|
143
|
+
serversByName: Record<string, EvalConfig['servers'][string]>,
|
|
144
|
+
selectedServerNames: string[],
|
|
145
|
+
options?: {
|
|
136
146
|
serverAuthHeaders?: Record<string, Record<string, string>>;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export declare function
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
}
|
|
148
|
+
): Promise<void>;
|
|
149
|
+
export declare function normalizeScenarioAssistantEvalRules(
|
|
150
|
+
replacement: ScenarioAssistantEvalRuleSuggestion[]
|
|
151
|
+
): ScenarioAssistantEvalRuleSuggestion[];
|
|
152
|
+
export declare function continueAssistantTurn(
|
|
153
|
+
session: ScenarioAssistantSession,
|
|
154
|
+
signal?: AbortSignal
|
|
155
|
+
): Promise<{
|
|
156
|
+
session: ReturnType<typeof assistantSessionView>;
|
|
157
|
+
response: {
|
|
158
|
+
type: 'assistant_message' | 'tool_call_request';
|
|
159
|
+
text: string;
|
|
160
|
+
suggestions?: ScenarioAssistantSuggestionBundle;
|
|
161
|
+
pendingToolCall?: AssistantPendingToolCall;
|
|
162
|
+
pendingToolCalls?: AssistantPendingToolCall[];
|
|
163
|
+
};
|
|
148
164
|
}>;
|
|
149
|
-
export declare function executeAssistantToolCall(
|
|
165
|
+
export declare function executeAssistantToolCall(
|
|
166
|
+
session: ScenarioAssistantSession,
|
|
167
|
+
pending: AssistantPendingToolCall,
|
|
168
|
+
signal?: AbortSignal
|
|
169
|
+
): Promise<unknown>;
|
|
150
170
|
export declare function summarizeToolResultForAssistant(result: unknown): string;
|
|
151
|
-
export declare function resolveAssistantAgentFromConfig(
|
|
152
|
-
|
|
171
|
+
export declare function resolveAssistantAgentFromConfig(
|
|
172
|
+
config: EvalConfig,
|
|
173
|
+
selectedAssistantAgentName: string
|
|
174
|
+
): AgentConfig;
|
|
175
|
+
export declare function resolveAssistantAgentFromLibraries(
|
|
176
|
+
libraries: ReturnType<typeof readLibraries>,
|
|
177
|
+
selectedAssistantAgentName: string
|
|
178
|
+
): AgentConfig;
|
|
153
179
|
export declare function pickDefaultAssistantAgentName(params: {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
180
|
+
requested?: string;
|
|
181
|
+
settingsDefault?: string;
|
|
182
|
+
agentNames: string[];
|
|
157
183
|
}): string;
|
|
158
|
-
//# sourceMappingURL=scenario-assistant-domain.d.ts.map
|
|
184
|
+
//# sourceMappingURL=scenario-assistant-domain.d.ts.map
|