@superblocksteam/vite-plugin-file-sync 2.0.67-next.1 → 2.0.68-next.0
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/ai-service/agent/tools/apis/analysis.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/analysis.js +4 -0
- package/dist/ai-service/agent/tools/apis/analysis.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-executor.d.ts +9 -1
- package/dist/ai-service/agent/tools/apis/api-executor.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-executor.js +4 -1
- package/dist/ai-service/agent/tools/apis/api-executor.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts +1 -0
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js +1 -1
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.d.ts +5 -0
- package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.js +9 -1
- package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/read.d.ts +1 -1
- package/dist/ai-service/index.d.ts +23 -2
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +99 -0
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/judge/debug-browser.d.ts +8 -0
- package/dist/ai-service/judge/debug-browser.d.ts.map +1 -0
- package/dist/ai-service/judge/debug-browser.js +79 -0
- package/dist/ai-service/judge/debug-browser.js.map +1 -0
- package/dist/ai-service/judge/index.d.ts +12 -0
- package/dist/ai-service/judge/index.d.ts.map +1 -0
- package/dist/ai-service/judge/index.js +11 -0
- package/dist/ai-service/judge/index.js.map +1 -0
- package/dist/ai-service/judge/integration/mcp-client.d.ts +82 -0
- package/dist/ai-service/judge/integration/mcp-client.d.ts.map +1 -0
- package/dist/ai-service/judge/integration/mcp-client.js +276 -0
- package/dist/ai-service/judge/integration/mcp-client.js.map +1 -0
- package/dist/ai-service/judge/integration/playwright-bridge.d.ts +142 -0
- package/dist/ai-service/judge/integration/playwright-bridge.d.ts.map +1 -0
- package/dist/ai-service/judge/integration/playwright-bridge.js +217 -0
- package/dist/ai-service/judge/integration/playwright-bridge.js.map +1 -0
- package/dist/ai-service/judge/judge-eval-http.d.ts +3 -0
- package/dist/ai-service/judge/judge-eval-http.d.ts.map +1 -0
- package/dist/ai-service/judge/judge-eval-http.js +541 -0
- package/dist/ai-service/judge/judge-eval-http.js.map +1 -0
- package/dist/ai-service/judge/judge-eval-service-runner.d.ts +35 -0
- package/dist/ai-service/judge/judge-eval-service-runner.d.ts.map +1 -0
- package/dist/ai-service/judge/judge-eval-service-runner.js +124 -0
- package/dist/ai-service/judge/judge-eval-service-runner.js.map +1 -0
- package/dist/ai-service/judge/judge-executor.d.ts +65 -0
- package/dist/ai-service/judge/judge-executor.d.ts.map +1 -0
- package/dist/ai-service/judge/judge-executor.js +334 -0
- package/dist/ai-service/judge/judge-executor.js.map +1 -0
- package/dist/ai-service/judge/judge-service.d.ts +161 -0
- package/dist/ai-service/judge/judge-service.d.ts.map +1 -0
- package/dist/ai-service/judge/judge-service.js +241 -0
- package/dist/ai-service/judge/judge-service.js.map +1 -0
- package/dist/ai-service/judge/prompts/evaluation-criteria.d.ts +37 -0
- package/dist/ai-service/judge/prompts/evaluation-criteria.d.ts.map +1 -0
- package/dist/ai-service/judge/prompts/evaluation-criteria.js +283 -0
- package/dist/ai-service/judge/prompts/evaluation-criteria.js.map +1 -0
- package/dist/ai-service/judge/prompts/system-prompt.d.ts +30 -0
- package/dist/ai-service/judge/prompts/system-prompt.d.ts.map +1 -0
- package/dist/ai-service/judge/prompts/system-prompt.js +212 -0
- package/dist/ai-service/judge/prompts/system-prompt.js.map +1 -0
- package/dist/ai-service/judge/storage/csv-storage.d.ts +99 -0
- package/dist/ai-service/judge/storage/csv-storage.d.ts.map +1 -0
- package/dist/ai-service/judge/storage/csv-storage.js +274 -0
- package/dist/ai-service/judge/storage/csv-storage.js.map +1 -0
- package/dist/ai-service/judge/storage/index.d.ts +9 -0
- package/dist/ai-service/judge/storage/index.d.ts.map +1 -0
- package/dist/ai-service/judge/storage/index.js +7 -0
- package/dist/ai-service/judge/storage/index.js.map +1 -0
- package/dist/ai-service/judge/storage/interface.d.ts +51 -0
- package/dist/ai-service/judge/storage/interface.d.ts.map +1 -0
- package/dist/ai-service/judge/storage/interface.js +8 -0
- package/dist/ai-service/judge/storage/interface.js.map +1 -0
- package/dist/ai-service/judge/storage/types.d.ts +54 -0
- package/dist/ai-service/judge/storage/types.d.ts.map +1 -0
- package/dist/ai-service/judge/storage/types.js +7 -0
- package/dist/ai-service/judge/storage/types.js.map +1 -0
- package/dist/ai-service/judge/tools/index.d.ts +22 -0
- package/dist/ai-service/judge/tools/index.d.ts.map +1 -0
- package/dist/ai-service/judge/tools/index.js +29 -0
- package/dist/ai-service/judge/tools/index.js.map +1 -0
- package/dist/ai-service/judge/tools/playwright-action.d.ts +18 -0
- package/dist/ai-service/judge/tools/playwright-action.d.ts.map +1 -0
- package/dist/ai-service/judge/tools/playwright-action.js +171 -0
- package/dist/ai-service/judge/tools/playwright-action.js.map +1 -0
- package/dist/ai-service/judge/tools/submit-feedback.d.ts +41 -0
- package/dist/ai-service/judge/tools/submit-feedback.d.ts.map +1 -0
- package/dist/ai-service/judge/tools/submit-feedback.js +150 -0
- package/dist/ai-service/judge/tools/submit-feedback.js.map +1 -0
- package/dist/ai-service/judge/types.d.ts +169 -0
- package/dist/ai-service/judge/types.d.ts.map +1 -0
- package/dist/ai-service/judge/types.js +8 -0
- package/dist/ai-service/judge/types.js.map +1 -0
- package/dist/ai-service/llm/interaction/adapters/vercel.d.ts.map +1 -1
- package/dist/ai-service/llm/interaction/adapters/vercel.js.map +1 -1
- package/dist/ai-service/llm/interaction/provider.d.ts +10 -9
- package/dist/ai-service/llm/interaction/provider.d.ts.map +1 -1
- package/dist/ai-service/llmobs/middleware/stream-text.d.ts +8 -8
- package/dist/ai-service/llmobs/middleware/stream-text.d.ts.map +1 -1
- package/dist/ai-service/llmobs/middleware/stream-text.js.map +1 -1
- package/dist/ai-service/llmobs/tracer.d.ts.map +1 -1
- package/dist/ai-service/llmobs/tracer.js +2 -1
- package/dist/ai-service/llmobs/tracer.js.map +1 -1
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.d.ts +53 -0
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.d.ts.map +1 -0
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.js +541 -0
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.js.map +1 -0
- package/dist/ai-service/mcp/playwright-server.d.ts +114 -0
- package/dist/ai-service/mcp/playwright-server.d.ts.map +1 -0
- package/dist/ai-service/mcp/playwright-server.js +109 -0
- package/dist/ai-service/mcp/playwright-server.js.map +1 -0
- package/dist/server-rpc/client.js +1 -1
- package/dist/server-rpc/client.js.map +1 -1
- package/dist/socket-manager.d.ts.map +1 -1
- package/dist/socket-manager.js +8 -0
- package/dist/socket-manager.js.map +1 -1
- package/package.json +7 -6
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSV-based storage implementation for judge evaluations.
|
|
3
|
+
*
|
|
4
|
+
* Stores evaluation results in a CSV file with the following columns:
|
|
5
|
+
* - timestamp: ISO 8601 timestamp
|
|
6
|
+
* - promptId: Prompt identifier
|
|
7
|
+
* - branchName: Git branch name
|
|
8
|
+
* - commitSha: Git commit SHA
|
|
9
|
+
* - appId: Application identifier
|
|
10
|
+
* - prompt: The actual prompt text
|
|
11
|
+
* - passed: Boolean pass/fail status
|
|
12
|
+
* - score: Overall score (0-100)
|
|
13
|
+
* - feedback: Summary feedback text
|
|
14
|
+
*
|
|
15
|
+
* CSV format provides simple, human-readable storage suitable for analysis
|
|
16
|
+
* in spreadsheet applications or data processing tools.
|
|
17
|
+
*
|
|
18
|
+
* Configuration:
|
|
19
|
+
* The storage location can be configured via the JUDGE_STORAGE_PATH environment variable:
|
|
20
|
+
* - Directory path: `JUDGE_STORAGE_PATH=~/eval` (creates evaluations.csv inside)
|
|
21
|
+
* - Full file path: `JUDGE_STORAGE_PATH=~/eval/results.csv`
|
|
22
|
+
* - Supports ~ expansion for home directory
|
|
23
|
+
* - Default: `<appRoot>/.superblocks/judge-evaluations/evaluations.csv`
|
|
24
|
+
*/
|
|
25
|
+
import { promises as fs } from "fs";
|
|
26
|
+
import path from "path";
|
|
27
|
+
/**
|
|
28
|
+
* Default storage directory relative to project root.
|
|
29
|
+
*/
|
|
30
|
+
const DEFAULT_STORAGE_DIR = ".superblocks/judge-evaluations";
|
|
31
|
+
/**
|
|
32
|
+
* CSV header row.
|
|
33
|
+
*/
|
|
34
|
+
const CSV_HEADER = "timestamp,promptId,branchName,commitSha,appId,prompt,passed,score,feedback\n";
|
|
35
|
+
/**
|
|
36
|
+
* CSV-based implementation of JudgeStorage.
|
|
37
|
+
*
|
|
38
|
+
* Thread-safe through file system atomic operations.
|
|
39
|
+
* Appends new evaluations to maintain chronological order.
|
|
40
|
+
*/
|
|
41
|
+
export class CsvJudgeStorage {
|
|
42
|
+
filePath;
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new CSV storage instance.
|
|
45
|
+
*
|
|
46
|
+
* @param storageDir - Directory for storage (default: .superblocks/judge-evaluations)
|
|
47
|
+
* @param filename - CSV filename (default: evaluations.csv)
|
|
48
|
+
*/
|
|
49
|
+
constructor(storageDir = DEFAULT_STORAGE_DIR, filename = "evaluations.csv") {
|
|
50
|
+
this.filePath = path.join(storageDir, filename);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Ensures the storage directory and file exist.
|
|
54
|
+
*
|
|
55
|
+
* Creates directory if needed and initializes CSV with header row.
|
|
56
|
+
*/
|
|
57
|
+
async ensureStorageExists() {
|
|
58
|
+
const dir = path.dirname(this.filePath);
|
|
59
|
+
// Create directory if it doesn't exist
|
|
60
|
+
await fs.mkdir(dir, { recursive: true });
|
|
61
|
+
// Check if file exists
|
|
62
|
+
try {
|
|
63
|
+
await fs.access(this.filePath);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// File doesn't exist, create with header
|
|
67
|
+
await fs.writeFile(this.filePath, CSV_HEADER, "utf8");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Escapes a value for CSV format.
|
|
72
|
+
*
|
|
73
|
+
* Handles quotes and commas by wrapping in double quotes and escaping
|
|
74
|
+
* internal quotes.
|
|
75
|
+
*/
|
|
76
|
+
escapeCsvValue(value) {
|
|
77
|
+
const str = String(value);
|
|
78
|
+
// If value contains comma, quote, or newline, wrap in quotes and escape quotes
|
|
79
|
+
if (str.includes(",") || str.includes('"') || str.includes("\n")) {
|
|
80
|
+
return `"${str.replace(/"/g, '""')}"`;
|
|
81
|
+
}
|
|
82
|
+
return str;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Converts a StoredEvaluation to a CSV row.
|
|
86
|
+
*/
|
|
87
|
+
toCsvRow(evaluation) {
|
|
88
|
+
const { timestamp, promptId, branchName, commitSha, appId, prompt, evaluation: result, } = evaluation;
|
|
89
|
+
const values = [
|
|
90
|
+
this.escapeCsvValue(timestamp),
|
|
91
|
+
this.escapeCsvValue(promptId),
|
|
92
|
+
this.escapeCsvValue(branchName),
|
|
93
|
+
this.escapeCsvValue(commitSha),
|
|
94
|
+
this.escapeCsvValue(appId),
|
|
95
|
+
this.escapeCsvValue(prompt),
|
|
96
|
+
this.escapeCsvValue(result.passed),
|
|
97
|
+
this.escapeCsvValue(result.overallScore),
|
|
98
|
+
this.escapeCsvValue(result.summary),
|
|
99
|
+
];
|
|
100
|
+
return values.join(",") + "\n";
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Parses a CSV row into a StoredEvaluation.
|
|
104
|
+
*
|
|
105
|
+
* Note: This is a simplified parser that doesn't handle all CSV edge cases.
|
|
106
|
+
* For production use with complex data, consider a proper CSV parsing library.
|
|
107
|
+
*/
|
|
108
|
+
fromCsvRow(row) {
|
|
109
|
+
// Skip empty rows or header
|
|
110
|
+
if (!row.trim() || row.startsWith("timestamp,")) {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
// Simple CSV parsing (doesn't handle all edge cases)
|
|
114
|
+
const values = [];
|
|
115
|
+
let current = "";
|
|
116
|
+
let inQuotes = false;
|
|
117
|
+
for (let i = 0; i < row.length; i++) {
|
|
118
|
+
const char = row[i];
|
|
119
|
+
if (char === '"') {
|
|
120
|
+
// Check for escaped quote
|
|
121
|
+
if (inQuotes && row[i + 1] === '"') {
|
|
122
|
+
current += '"';
|
|
123
|
+
i++; // Skip next quote
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
inQuotes = !inQuotes;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
else if (char === "," && !inQuotes) {
|
|
130
|
+
values.push(current);
|
|
131
|
+
current = "";
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
current += char;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// Add last value
|
|
138
|
+
values.push(current);
|
|
139
|
+
if (values.length < 9) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
const [timestamp, promptId, branchName, commitSha, appId, prompt, passed, score, feedback,] = values;
|
|
143
|
+
// Validate all required fields are present
|
|
144
|
+
if (!timestamp ||
|
|
145
|
+
!promptId ||
|
|
146
|
+
!branchName ||
|
|
147
|
+
!commitSha ||
|
|
148
|
+
!appId ||
|
|
149
|
+
!prompt ||
|
|
150
|
+
!passed ||
|
|
151
|
+
!score ||
|
|
152
|
+
feedback === undefined) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
timestamp,
|
|
157
|
+
promptId,
|
|
158
|
+
branchName,
|
|
159
|
+
commitSha,
|
|
160
|
+
appId,
|
|
161
|
+
prompt,
|
|
162
|
+
evaluation: {
|
|
163
|
+
passed: passed === "true",
|
|
164
|
+
overallScore: parseFloat(score) || 0,
|
|
165
|
+
summary: feedback,
|
|
166
|
+
criteriaEvaluations: [], // Not stored in CSV for simplicity
|
|
167
|
+
suggestions: [], // Not stored in CSV for simplicity
|
|
168
|
+
tokensUsed: { input: 0, output: 0, cached: 0, total: 0 }, // Not stored in CSV
|
|
169
|
+
evaluationDurationMs: 0, // Not stored in CSV
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Saves an evaluation result to the CSV file.
|
|
175
|
+
*
|
|
176
|
+
* Appends a new row to the file. Creates file and directory if needed.
|
|
177
|
+
*/
|
|
178
|
+
async saveEvaluation(evaluation) {
|
|
179
|
+
await this.ensureStorageExists();
|
|
180
|
+
const row = this.toCsvRow(evaluation);
|
|
181
|
+
await fs.appendFile(this.filePath, row, "utf8");
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Reads all evaluations from the CSV file.
|
|
185
|
+
*/
|
|
186
|
+
async readAllEvaluations() {
|
|
187
|
+
try {
|
|
188
|
+
await this.ensureStorageExists();
|
|
189
|
+
const content = await fs.readFile(this.filePath, "utf8");
|
|
190
|
+
const rows = content.split("\n");
|
|
191
|
+
const evaluations = [];
|
|
192
|
+
for (const row of rows) {
|
|
193
|
+
const evaluation = this.fromCsvRow(row);
|
|
194
|
+
if (evaluation) {
|
|
195
|
+
evaluations.push(evaluation);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return evaluations;
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
// File doesn't exist or can't be read
|
|
202
|
+
return [];
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Filters evaluations based on query parameters.
|
|
207
|
+
*/
|
|
208
|
+
applyQuery(evaluations, query) {
|
|
209
|
+
if (!query) {
|
|
210
|
+
return evaluations;
|
|
211
|
+
}
|
|
212
|
+
let filtered = evaluations;
|
|
213
|
+
if (query.promptId !== undefined) {
|
|
214
|
+
filtered = filtered.filter((e) => e.promptId === query.promptId);
|
|
215
|
+
}
|
|
216
|
+
if (query.branchName !== undefined) {
|
|
217
|
+
filtered = filtered.filter((e) => e.branchName === query.branchName);
|
|
218
|
+
}
|
|
219
|
+
if (query.appId !== undefined) {
|
|
220
|
+
filtered = filtered.filter((e) => e.appId === query.appId);
|
|
221
|
+
}
|
|
222
|
+
if (query.passed !== undefined) {
|
|
223
|
+
filtered = filtered.filter((e) => e.evaluation.passed === query.passed);
|
|
224
|
+
}
|
|
225
|
+
if (query.minScore !== undefined) {
|
|
226
|
+
filtered = filtered.filter((e) => e.evaluation.overallScore >= query.minScore);
|
|
227
|
+
}
|
|
228
|
+
if (query.startDate !== undefined) {
|
|
229
|
+
filtered = filtered.filter((e) => e.timestamp >= query.startDate);
|
|
230
|
+
}
|
|
231
|
+
if (query.endDate !== undefined) {
|
|
232
|
+
filtered = filtered.filter((e) => e.timestamp <= query.endDate);
|
|
233
|
+
}
|
|
234
|
+
// Sort by timestamp (newest first)
|
|
235
|
+
filtered.sort((a, b) => b.timestamp.localeCompare(a.timestamp));
|
|
236
|
+
if (query.limit !== undefined) {
|
|
237
|
+
filtered = filtered.slice(0, query.limit);
|
|
238
|
+
}
|
|
239
|
+
return filtered;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Retrieves all evaluations matching the query.
|
|
243
|
+
*/
|
|
244
|
+
async getEvaluations(query) {
|
|
245
|
+
const all = await this.readAllEvaluations();
|
|
246
|
+
return this.applyQuery(all, query);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Retrieves evaluations for a specific prompt.
|
|
250
|
+
*/
|
|
251
|
+
async getEvaluationsByPrompt(promptId) {
|
|
252
|
+
return this.getEvaluations({ promptId });
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Retrieves evaluations for a specific branch.
|
|
256
|
+
*/
|
|
257
|
+
async getEvaluationsByBranch(branchName) {
|
|
258
|
+
return this.getEvaluations({ branchName });
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Deletes all stored evaluations.
|
|
262
|
+
*
|
|
263
|
+
* Removes the CSV file. Use with caution.
|
|
264
|
+
*/
|
|
265
|
+
async clear() {
|
|
266
|
+
try {
|
|
267
|
+
await fs.unlink(this.filePath);
|
|
268
|
+
}
|
|
269
|
+
catch {
|
|
270
|
+
// File doesn't exist, nothing to clear
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
//# sourceMappingURL=csv-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csv-storage.js","sourceRoot":"","sources":["../../../../src/ai-service/judge/storage/csv-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB;;GAEG;AACH,MAAM,mBAAmB,GAAG,gCAAgC,CAAC;AAE7D;;GAEG;AACH,MAAM,UAAU,GACd,8EAA8E,CAAC;AAEjF;;;;;GAKG;AACH,MAAM,OAAO,eAAe;IACT,QAAQ,CAAS;IAElC;;;;;OAKG;IACH,YACE,aAAqB,mBAAmB,EACxC,WAAmB,iBAAiB;QAEpC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,mBAAmB;QAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAExC,uCAAuC;QACvC,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS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,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAAC,KAAuB;QAC1C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC5C,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAAC,QAAgB;QAC3C,OAAO,IAAI,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAC1B,UAAkB;QAElB,OAAO,IAAI,CAAC,cAAc,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,KAAK;QACT,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAAC,MAAM,CAAC;YACP,uCAAuC;QACzC,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Judge evaluation storage.
|
|
3
|
+
*
|
|
4
|
+
* Provides abstraction for persisting and retrieving evaluation results.
|
|
5
|
+
*/
|
|
6
|
+
export { CsvJudgeStorage } from "./csv-storage.js";
|
|
7
|
+
export type { JudgeStorage } from "./interface.js";
|
|
8
|
+
export type { StoredEvaluation, EvaluationQuery } from "./types.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/judge/storage/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ai-service/judge/storage/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage abstraction for judge evaluation results.
|
|
3
|
+
*
|
|
4
|
+
* Defines the interface for persisting and retrieving evaluation results.
|
|
5
|
+
* Implementations can use different backends (CSV, database, cloud storage).
|
|
6
|
+
*/
|
|
7
|
+
import type { StoredEvaluation, EvaluationQuery } from "./types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Storage interface for judge evaluations.
|
|
10
|
+
*
|
|
11
|
+
* Provides methods for saving and querying evaluation results.
|
|
12
|
+
* Implementations must ensure thread-safe operation for concurrent access.
|
|
13
|
+
*/
|
|
14
|
+
export interface JudgeStorage {
|
|
15
|
+
/**
|
|
16
|
+
* Saves an evaluation result.
|
|
17
|
+
*
|
|
18
|
+
* @param evaluation - The evaluation to persist
|
|
19
|
+
* @throws Error if storage operation fails
|
|
20
|
+
*/
|
|
21
|
+
saveEvaluation(evaluation: StoredEvaluation): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves all evaluations matching the query.
|
|
24
|
+
*
|
|
25
|
+
* @param query - Optional filters to apply
|
|
26
|
+
* @returns Array of matching evaluations, sorted by timestamp (newest first)
|
|
27
|
+
*/
|
|
28
|
+
getEvaluations(query?: EvaluationQuery): Promise<StoredEvaluation[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves evaluations for a specific prompt.
|
|
31
|
+
*
|
|
32
|
+
* @param promptId - The prompt identifier
|
|
33
|
+
* @returns Array of evaluations for the prompt, sorted by timestamp (newest first)
|
|
34
|
+
*/
|
|
35
|
+
getEvaluationsByPrompt(promptId: string): Promise<StoredEvaluation[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves evaluations for a specific branch.
|
|
38
|
+
*
|
|
39
|
+
* @param branchName - The git branch name
|
|
40
|
+
* @returns Array of evaluations for the branch, sorted by timestamp (newest first)
|
|
41
|
+
*/
|
|
42
|
+
getEvaluationsByBranch(branchName: string): Promise<StoredEvaluation[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Deletes all stored evaluations.
|
|
45
|
+
*
|
|
46
|
+
* Use with caution - this operation is irreversible.
|
|
47
|
+
* @throws Error if deletion fails
|
|
48
|
+
*/
|
|
49
|
+
clear(): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/judge/storage/interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,cAAc,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5D;;;;;OAKG;IACH,cAAc,CAAC,KAAK,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAErE;;;;;OAKG;IACH,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAEtE;;;;;OAKG;IACH,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAExE;;;;;OAKG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage abstraction for judge evaluation results.
|
|
3
|
+
*
|
|
4
|
+
* Defines the interface for persisting and retrieving evaluation results.
|
|
5
|
+
* Implementations can use different backends (CSV, database, cloud storage).
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/ai-service/judge/storage/interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for judge evaluation storage.
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure of persisted evaluation results.
|
|
5
|
+
*/
|
|
6
|
+
import type { JudgeEvaluation } from "../types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Stored evaluation result with metadata.
|
|
9
|
+
*
|
|
10
|
+
* Extends the base JudgeEvaluation with additional tracking information:
|
|
11
|
+
* - timestamp: When the evaluation was performed
|
|
12
|
+
* - promptId: Identifier for the prompt being evaluated
|
|
13
|
+
* - branchName: Git branch where evaluation occurred
|
|
14
|
+
* - appId: Application identifier
|
|
15
|
+
* - commitSha: Git commit SHA
|
|
16
|
+
* - prompt: The actual prompt text
|
|
17
|
+
*/
|
|
18
|
+
export interface StoredEvaluation {
|
|
19
|
+
/** ISO 8601 timestamp of when the evaluation was performed */
|
|
20
|
+
timestamp: string;
|
|
21
|
+
/** Unique identifier for the prompt being evaluated */
|
|
22
|
+
promptId: string;
|
|
23
|
+
/** Git branch name where the evaluation occurred */
|
|
24
|
+
branchName: string;
|
|
25
|
+
/** Application identifier */
|
|
26
|
+
appId: string;
|
|
27
|
+
/** Git commit SHA */
|
|
28
|
+
commitSha: string;
|
|
29
|
+
/** The actual prompt text that was evaluated */
|
|
30
|
+
prompt: string;
|
|
31
|
+
/** The complete evaluation result */
|
|
32
|
+
evaluation: JudgeEvaluation;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Query filters for retrieving evaluations.
|
|
36
|
+
*/
|
|
37
|
+
export interface EvaluationQuery {
|
|
38
|
+
/** Filter by prompt ID */
|
|
39
|
+
promptId?: string;
|
|
40
|
+
/** Filter by branch name */
|
|
41
|
+
branchName?: string;
|
|
42
|
+
/** Filter by app ID */
|
|
43
|
+
appId?: string;
|
|
44
|
+
/** Filter by pass/fail status */
|
|
45
|
+
passed?: boolean;
|
|
46
|
+
/** Filter by minimum score */
|
|
47
|
+
minScore?: number;
|
|
48
|
+
/** Filter by date range (ISO 8601 timestamps) */
|
|
49
|
+
startDate?: string;
|
|
50
|
+
endDate?: string;
|
|
51
|
+
/** Maximum number of results to return */
|
|
52
|
+
limit?: number;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/judge/storage/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAElB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IAEjB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IAEnB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IAEd,qBAAqB;IACrB,SAAS,EAAE,MAAM,CAAC;IAElB,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IAEf,qCAAqC;IACrC,UAAU,EAAE,eAAe,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,4BAA4B;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,iCAAiC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ai-service/judge/storage/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Judge tools module exports.
|
|
3
|
+
*
|
|
4
|
+
* Provides tools for browser automation and evaluation submission
|
|
5
|
+
* used by the judge system.
|
|
6
|
+
*/
|
|
7
|
+
import type { PlaywrightBridge } from "../integration/playwright-bridge.js";
|
|
8
|
+
import type { ToolSet } from "ai";
|
|
9
|
+
/**
|
|
10
|
+
* Builds the complete toolset for the judge.
|
|
11
|
+
*
|
|
12
|
+
* Creates and configures all tools available to the judge
|
|
13
|
+
* for evaluating the generated application.
|
|
14
|
+
*
|
|
15
|
+
* @param playwrightBridge - Bridge to Playwright MCP server
|
|
16
|
+
* @param context - Judge execution context
|
|
17
|
+
* @returns Configured toolset for judge
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildJudgeTools(playwrightBridge: PlaywrightBridge): Promise<ToolSet>;
|
|
20
|
+
export { playwrightActionToolFactory } from "./playwright-action.js";
|
|
21
|
+
export { submitFeedbackToolFactory, isEvaluationComplete, } from "./submit-feedback.js";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/judge/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAElC;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,gBAAgB,EAAE,gBAAgB,GACjC,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Judge tools module exports.
|
|
3
|
+
*
|
|
4
|
+
* Provides tools for browser automation and evaluation submission
|
|
5
|
+
* used by the judge system.
|
|
6
|
+
*/
|
|
7
|
+
import { ToolRegistry } from "../../agent/tools2/registry.js";
|
|
8
|
+
import { playwrightActionToolFactory } from "./playwright-action.js";
|
|
9
|
+
import { submitFeedbackToolFactory } from "./submit-feedback.js";
|
|
10
|
+
/**
|
|
11
|
+
* Builds the complete toolset for the judge.
|
|
12
|
+
*
|
|
13
|
+
* Creates and configures all tools available to the judge
|
|
14
|
+
* for evaluating the generated application.
|
|
15
|
+
*
|
|
16
|
+
* @param playwrightBridge - Bridge to Playwright MCP server
|
|
17
|
+
* @param context - Judge execution context
|
|
18
|
+
* @returns Configured toolset for judge
|
|
19
|
+
*/
|
|
20
|
+
export async function buildJudgeTools(playwrightBridge) {
|
|
21
|
+
const registry = new ToolRegistry();
|
|
22
|
+
registry.register(playwrightActionToolFactory, playwrightBridge);
|
|
23
|
+
registry.register(submitFeedbackToolFactory, {});
|
|
24
|
+
const tools = await registry.getToolsRecord();
|
|
25
|
+
return tools;
|
|
26
|
+
}
|
|
27
|
+
export { playwrightActionToolFactory } from "./playwright-action.js";
|
|
28
|
+
export { submitFeedbackToolFactory, isEvaluationComplete, } from "./submit-feedback.js";
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ai-service/judge/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAIjE;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,gBAAkC;IAElC,MAAM,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;IAEpC,QAAQ,CAAC,QAAQ,CAAC,2BAA2B,EAAE,gBAAgB,CAAC,CAAC;IACjE,QAAQ,CAAC,QAAQ,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;IAEjD,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,cAAc,EAAE,CAAC;IAC9C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Playwright action tool for browser automation via MCP.
|
|
3
|
+
*
|
|
4
|
+
* Provides the judge with browser automation capabilities
|
|
5
|
+
* to interact with and evaluate the generated application.
|
|
6
|
+
*/
|
|
7
|
+
import type { PlaywrightBridge } from "../integration/playwright-bridge.js";
|
|
8
|
+
/**
|
|
9
|
+
* Creates a Playwright action tool factory.
|
|
10
|
+
*
|
|
11
|
+
* This tool allows the judge to perform browser automation
|
|
12
|
+
* actions through the Playwright MCP server.
|
|
13
|
+
*/
|
|
14
|
+
export declare const playwrightActionToolFactory: import("../../agent/tools2/types.js").ToolFactory<PlaywrightBridge, import("../../agent/tools2/types.js").Tool<{
|
|
15
|
+
action: "fill" | "evaluate" | "navigate" | "click" | "screenshot" | "getText" | "waitForSelector" | "getUrl" | "reload";
|
|
16
|
+
params?: Record<string, any> | undefined;
|
|
17
|
+
}, any>>;
|
|
18
|
+
//# sourceMappingURL=playwright-action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright-action.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/judge/tools/playwright-action.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAuB5E;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B;;;QAkKvC,CAAC"}
|