coding-agent-benchmarks 0.2.1 → 0.3.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/README.md +171 -10
- package/dist/User.d.ts +10 -0
- package/dist/User.d.ts.map +1 -0
- package/dist/User.js +3 -0
- package/dist/User.js.map +1 -0
- package/dist/adapters/claudeCodeCLI.d.ts +1 -1
- package/dist/adapters/claudeCodeCLI.d.ts.map +1 -1
- package/dist/adapters/claudeCodeCLI.js +44 -32
- package/dist/adapters/claudeCodeCLI.js.map +1 -1
- package/dist/adapters/copilotCLI.d.ts.map +1 -1
- package/dist/adapters/copilotCLI.js +28 -16
- package/dist/adapters/copilotCLI.js.map +1 -1
- package/dist/config/defaultScenarios.d.ts +6 -0
- package/dist/config/defaultScenarios.d.ts.map +1 -0
- package/dist/config/defaultScenarios.js +209 -0
- package/dist/config/defaultScenarios.js.map +1 -0
- package/dist/config/environment.d.ts +51 -0
- package/dist/config/environment.d.ts.map +1 -0
- package/dist/config/environment.js +57 -0
- package/dist/config/environment.js.map +1 -0
- package/dist/config/parser.d.ts +6 -0
- package/dist/config/parser.d.ts.map +1 -0
- package/dist/config/parser.js +87 -0
- package/dist/config/parser.js.map +1 -0
- package/dist/evaluator.d.ts +4 -9
- package/dist/evaluator.d.ts.map +1 -1
- package/dist/evaluator.js +4 -12
- package/dist/evaluator.js.map +1 -1
- package/dist/examples/file-upload-example.d.ts +2 -0
- package/dist/examples/file-upload-example.d.ts.map +1 -0
- package/dist/examples/file-upload-example.js +37 -0
- package/dist/examples/file-upload-example.js.map +1 -0
- package/dist/examples/typedEventEmitterExample.d.ts +5 -0
- package/dist/examples/typedEventEmitterExample.d.ts.map +1 -0
- package/dist/examples/typedEventEmitterExample.js +44 -0
- package/dist/examples/typedEventEmitterExample.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/registration/database.d.ts +13 -0
- package/dist/registration/database.d.ts.map +1 -0
- package/dist/registration/database.js +35 -0
- package/dist/registration/database.js.map +1 -0
- package/dist/registration/email.d.ts +17 -0
- package/dist/registration/email.d.ts.map +1 -0
- package/dist/registration/email.js +40 -0
- package/dist/registration/email.js.map +1 -0
- package/dist/registration/emailService.d.ts +13 -0
- package/dist/registration/emailService.d.ts.map +1 -0
- package/dist/registration/emailService.js +26 -0
- package/dist/registration/emailService.js.map +1 -0
- package/dist/registration/example.d.ts +2 -0
- package/dist/registration/example.d.ts.map +1 -0
- package/dist/registration/example.js +37 -0
- package/dist/registration/example.js.map +1 -0
- package/dist/registration/index.d.ts +7 -0
- package/dist/registration/index.d.ts.map +1 -0
- package/dist/registration/index.js +15 -0
- package/dist/registration/index.js.map +1 -0
- package/dist/registration/password.d.ts +3 -0
- package/dist/registration/password.d.ts.map +1 -0
- package/dist/registration/password.js +27 -0
- package/dist/registration/password.js.map +1 -0
- package/dist/registration/passwordHasher.d.ts +8 -0
- package/dist/registration/passwordHasher.d.ts.map +1 -0
- package/dist/registration/passwordHasher.js +39 -0
- package/dist/registration/passwordHasher.js.map +1 -0
- package/dist/registration/registrationService.d.ts +14 -0
- package/dist/registration/registrationService.d.ts.map +1 -0
- package/dist/registration/registrationService.js +49 -0
- package/dist/registration/registrationService.js.map +1 -0
- package/dist/registration/service.d.ts +14 -0
- package/dist/registration/service.d.ts.map +1 -0
- package/dist/registration/service.js +48 -0
- package/dist/registration/service.js.map +1 -0
- package/dist/registration/types.d.ts +22 -0
- package/dist/registration/types.d.ts.map +1 -0
- package/dist/registration/types.js +3 -0
- package/dist/registration/types.js.map +1 -0
- package/dist/registration/userRepository.d.ts +12 -0
- package/dist/registration/userRepository.d.ts.map +1 -0
- package/dist/registration/userRepository.js +28 -0
- package/dist/registration/userRepository.js.map +1 -0
- package/dist/registration/validator.d.ts +7 -0
- package/dist/registration/validator.d.ts.map +1 -0
- package/dist/registration/validator.js +44 -0
- package/dist/registration/validator.js.map +1 -0
- package/dist/registration/validators.d.ts +5 -0
- package/dist/registration/validators.d.ts.map +1 -0
- package/dist/registration/validators.js +60 -0
- package/dist/registration/validators.js.map +1 -0
- package/dist/reporter.d.ts.map +1 -1
- package/dist/reporter.js +59 -34
- package/dist/reporter.js.map +1 -1
- package/dist/runner.js +2 -1
- package/dist/runner.js.map +1 -1
- package/dist/sync/cache.d.ts +14 -0
- package/dist/sync/cache.d.ts.map +1 -0
- package/dist/sync/cache.js +73 -0
- package/dist/sync/cache.js.map +1 -0
- package/dist/sync/index.d.ts +7 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +20 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/resolver.d.ts +12 -0
- package/dist/sync/resolver.d.ts.map +1 -0
- package/dist/sync/resolver.js +43 -0
- package/dist/sync/resolver.js.map +1 -0
- package/dist/sync/service.d.ts +20 -0
- package/dist/sync/service.d.ts.map +1 -0
- package/dist/sync/service.js +162 -0
- package/dist/sync/service.js.map +1 -0
- package/dist/sync/source.d.ts +21 -0
- package/dist/sync/source.d.ts.map +1 -0
- package/dist/sync/source.js +58 -0
- package/dist/sync/source.js.map +1 -0
- package/dist/sync/types.d.ts +56 -0
- package/dist/sync/types.d.ts.map +1 -0
- package/dist/sync/types.js +21 -0
- package/dist/sync/types.js.map +1 -0
- package/dist/types.d.ts +6 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/baselineManager.d.ts +2 -1
- package/dist/utils/baselineManager.d.ts.map +1 -1
- package/dist/utils/baselineManager.js +1 -0
- package/dist/utils/baselineManager.js.map +1 -1
- package/dist/utils/cache.d.ts +11 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +28 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/config-merger.d.ts +11 -0
- package/dist/utils/config-merger.d.ts.map +1 -0
- package/dist/utils/config-merger.js +36 -0
- package/dist/utils/config-merger.js.map +1 -0
- package/dist/utils/configParser.d.ts +9 -0
- package/dist/utils/configParser.d.ts.map +1 -0
- package/dist/utils/configParser.js +51 -0
- package/dist/utils/configParser.js.map +1 -0
- package/dist/utils/database-providers.d.ts +23 -0
- package/dist/utils/database-providers.d.ts.map +1 -0
- package/dist/utils/database-providers.js +48 -0
- package/dist/utils/database-providers.js.map +1 -0
- package/dist/utils/errorHandler.d.ts +10 -0
- package/dist/utils/errorHandler.d.ts.map +1 -0
- package/dist/utils/errorHandler.js +58 -0
- package/dist/utils/errorHandler.js.map +1 -0
- package/dist/utils/fetchUserData.d.ts +11 -0
- package/dist/utils/fetchUserData.d.ts.map +1 -0
- package/dist/utils/fetchUserData.js +31 -0
- package/dist/utils/fetchUserData.js.map +1 -0
- package/dist/utils/file-upload-handler.d.ts +46 -0
- package/dist/utils/file-upload-handler.d.ts.map +1 -0
- package/dist/utils/file-upload-handler.js +110 -0
- package/dist/utils/file-upload-handler.js.map +1 -0
- package/dist/utils/gitUtils.d.ts +2 -1
- package/dist/utils/gitUtils.d.ts.map +1 -1
- package/dist/utils/gitUtils.js +85 -18
- package/dist/utils/gitUtils.js.map +1 -1
- package/dist/utils/statistics.d.ts +9 -0
- package/dist/utils/statistics.d.ts.map +1 -0
- package/dist/utils/statistics.js +26 -0
- package/dist/utils/statistics.js.map +1 -0
- package/dist/utils/storage-providers.d.ts +24 -0
- package/dist/utils/storage-providers.d.ts.map +1 -0
- package/dist/utils/storage-providers.js +38 -0
- package/dist/utils/storage-providers.js.map +1 -0
- package/dist/utils/transformArray.d.ts +18 -0
- package/dist/utils/transformArray.d.ts.map +1 -0
- package/dist/utils/transformArray.js +21 -0
- package/dist/utils/transformArray.js.map +1 -0
- package/dist/utils/typedEventEmitter.d.ts +18 -0
- package/dist/utils/typedEventEmitter.d.ts.map +1 -0
- package/dist/utils/typedEventEmitter.js +62 -0
- package/dist/utils/typedEventEmitter.js.map +1 -0
- package/dist/utils/userUtils.d.ts +9 -0
- package/dist/utils/userUtils.d.ts.map +1 -0
- package/dist/utils/userUtils.js +14 -0
- package/dist/utils/userUtils.js.map +1 -0
- package/dist/validators/llmJudge.d.ts +1 -1
- package/dist/validators/llmJudge.d.ts.map +1 -1
- package/dist/validators/llmJudge.js +40 -41
- package/dist/validators/llmJudge.js.map +1 -1
- package/package.json +1 -1
package/dist/utils/gitUtils.js
CHANGED
|
@@ -2,9 +2,44 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Git utilities for tracking file changes
|
|
4
4
|
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
exports.isGitRepository = exports.getGitRoot = exports.getChangedFilesDiff = exports.getChangedFiles = exports.parseGitStatus = exports.getGitStatusPorcelain = void 0;
|
|
7
40
|
const child_process_1 = require("child_process");
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const path = __importStar(require("path"));
|
|
8
43
|
/**
|
|
9
44
|
* Get git status in porcelain format
|
|
10
45
|
* @param workspaceRoot The workspace root directory
|
|
@@ -12,10 +47,10 @@ const child_process_1 = require("child_process");
|
|
|
12
47
|
*/
|
|
13
48
|
const getGitStatusPorcelain = (workspaceRoot) => {
|
|
14
49
|
try {
|
|
15
|
-
return (0, child_process_1.execSync)(
|
|
50
|
+
return (0, child_process_1.execSync)("git status --porcelain", {
|
|
16
51
|
cwd: workspaceRoot,
|
|
17
|
-
encoding:
|
|
18
|
-
stdio: [
|
|
52
|
+
encoding: "utf-8",
|
|
53
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
19
54
|
});
|
|
20
55
|
}
|
|
21
56
|
catch (error) {
|
|
@@ -29,7 +64,10 @@ exports.getGitStatusPorcelain = getGitStatusPorcelain;
|
|
|
29
64
|
* @returns Array of file paths that were changed
|
|
30
65
|
*/
|
|
31
66
|
const parseGitStatus = (statusOutput) => {
|
|
32
|
-
const lines = statusOutput
|
|
67
|
+
const lines = statusOutput
|
|
68
|
+
.trim()
|
|
69
|
+
.split("\n")
|
|
70
|
+
.filter((line) => line.length > 0);
|
|
33
71
|
const files = [];
|
|
34
72
|
for (const line of lines) {
|
|
35
73
|
// Git porcelain format: XY filename
|
|
@@ -38,8 +76,8 @@ const parseGitStatus = (statusOutput) => {
|
|
|
38
76
|
if (line.length > 3) {
|
|
39
77
|
const filename = line.substring(3).trim();
|
|
40
78
|
// Handle renamed files (format: "old -> new")
|
|
41
|
-
if (filename.includes(
|
|
42
|
-
const newFilename = filename.split(
|
|
79
|
+
if (filename.includes(" -> ")) {
|
|
80
|
+
const newFilename = filename.split(" -> ")[1];
|
|
43
81
|
files.push(newFilename);
|
|
44
82
|
}
|
|
45
83
|
else {
|
|
@@ -64,11 +102,12 @@ exports.getChangedFiles = getChangedFiles;
|
|
|
64
102
|
* Get files that changed between two git status snapshots
|
|
65
103
|
* @param before Git status output before operation
|
|
66
104
|
* @param after Git status output after operation
|
|
105
|
+
* @param workspaceRoot The workspace root to resolve directory contents
|
|
67
106
|
* @returns Array of file paths that were added or modified
|
|
68
107
|
*/
|
|
69
|
-
const getChangedFilesDiff = (before, after) => {
|
|
70
|
-
const beforeLines = new Set(before.split(
|
|
71
|
-
const afterLines = after.split(
|
|
108
|
+
const getChangedFilesDiff = (before, after, workspaceRoot) => {
|
|
109
|
+
const beforeLines = new Set(before.split("\n").filter(Boolean));
|
|
110
|
+
const afterLines = after.split("\n").filter(Boolean);
|
|
72
111
|
const newOrModified = [];
|
|
73
112
|
for (const line of afterLines) {
|
|
74
113
|
if (!beforeLines.has(line)) {
|
|
@@ -76,8 +115,13 @@ const getChangedFilesDiff = (before, after) => {
|
|
|
76
115
|
const match = /^.{3}(.+)$/.exec(line);
|
|
77
116
|
if (match) {
|
|
78
117
|
const filePath = match[1];
|
|
79
|
-
//
|
|
80
|
-
if (
|
|
118
|
+
// If it's a directory, list files inside it
|
|
119
|
+
if (filePath.endsWith("/") && workspaceRoot) {
|
|
120
|
+
const dirPath = path.join(workspaceRoot, filePath);
|
|
121
|
+
const filesInDir = listFilesRecursively(dirPath, workspaceRoot);
|
|
122
|
+
newOrModified.push(...filesInDir);
|
|
123
|
+
}
|
|
124
|
+
else if (!filePath.endsWith("/")) {
|
|
81
125
|
newOrModified.push(filePath);
|
|
82
126
|
}
|
|
83
127
|
}
|
|
@@ -86,19 +130,42 @@ const getChangedFilesDiff = (before, after) => {
|
|
|
86
130
|
return newOrModified;
|
|
87
131
|
};
|
|
88
132
|
exports.getChangedFilesDiff = getChangedFilesDiff;
|
|
133
|
+
/**
|
|
134
|
+
* Recursively list all files in a directory
|
|
135
|
+
* @param dirPath Absolute path to directory
|
|
136
|
+
* @param workspaceRoot Workspace root for relative path calculation
|
|
137
|
+
* @returns Array of relative file paths
|
|
138
|
+
*/
|
|
139
|
+
const listFilesRecursively = (dirPath, workspaceRoot) => {
|
|
140
|
+
const files = [];
|
|
141
|
+
if (!fs.existsSync(dirPath)) {
|
|
142
|
+
return files;
|
|
143
|
+
}
|
|
144
|
+
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
145
|
+
for (const entry of entries) {
|
|
146
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
147
|
+
if (entry.isDirectory()) {
|
|
148
|
+
files.push(...listFilesRecursively(fullPath, workspaceRoot));
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
files.push(path.relative(workspaceRoot, fullPath));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return files;
|
|
155
|
+
};
|
|
89
156
|
/**
|
|
90
157
|
* Get the git root directory
|
|
91
158
|
* @returns Absolute path to git root
|
|
92
159
|
*/
|
|
93
160
|
const getGitRoot = () => {
|
|
94
161
|
try {
|
|
95
|
-
return (0, child_process_1.execSync)(
|
|
96
|
-
encoding:
|
|
97
|
-
stdio: [
|
|
162
|
+
return (0, child_process_1.execSync)("git rev-parse --show-toplevel", {
|
|
163
|
+
encoding: "utf-8",
|
|
164
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
98
165
|
}).trim();
|
|
99
166
|
}
|
|
100
167
|
catch (error) {
|
|
101
|
-
throw new Error(
|
|
168
|
+
throw new Error("Not inside a git repository");
|
|
102
169
|
}
|
|
103
170
|
};
|
|
104
171
|
exports.getGitRoot = getGitRoot;
|
|
@@ -109,10 +176,10 @@ exports.getGitRoot = getGitRoot;
|
|
|
109
176
|
*/
|
|
110
177
|
const isGitRepository = (directory) => {
|
|
111
178
|
try {
|
|
112
|
-
(0, child_process_1.execSync)(
|
|
179
|
+
(0, child_process_1.execSync)("git rev-parse --git-dir", {
|
|
113
180
|
cwd: directory,
|
|
114
|
-
encoding:
|
|
115
|
-
stdio: [
|
|
181
|
+
encoding: "utf-8",
|
|
182
|
+
stdio: ["pipe", "pipe", "ignore"],
|
|
116
183
|
});
|
|
117
184
|
return true;
|
|
118
185
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitUtils.js","sourceRoot":"","sources":["../../src/utils/gitUtils.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"gitUtils.js","sourceRoot":"","sources":["../../src/utils/gitUtils.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iDAAyC;AACzC,uCAAyB;AACzB,2CAA6B;AAE7B;;;;GAIG;AACI,MAAM,qBAAqB,GAAG,CAAC,aAAqB,EAAU,EAAE;IACrE,IAAI,CAAC;QACH,OAAO,IAAA,wBAAQ,EAAC,wBAAwB,EAAE;YACxC,GAAG,EAAE,aAAa;YAClB,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;SAChC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,6BAA6B,KAAK,EAAE,CAAC,CAAC;IACxD,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,qBAAqB,yBAUhC;AAEF;;;;GAIG;AACI,MAAM,cAAc,GAAG,CAAC,YAAoB,EAAY,EAAE;IAC/D,MAAM,KAAK,GAAG,YAAY;SACvB,IAAI,EAAE;SACN,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,MA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ings":"AAAA,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,mBAAmB,GAAI,SAAS,SAAS,MAAM,EAAE,KAAG,UAwBhE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateStatistics = void 0;
|
|
4
|
+
const calculateStatistics = (numbers) => {
|
|
5
|
+
if (numbers.length === 0) {
|
|
6
|
+
throw new Error('Cannot calculate statistics for an empty array');
|
|
7
|
+
}
|
|
8
|
+
const sum = numbers.reduce((acc, num) => acc + num, 0);
|
|
9
|
+
const average = sum / numbers.length;
|
|
10
|
+
const sorted = [...numbers].sort((a, b) => a - b);
|
|
11
|
+
const mid = Math.floor(sorted.length / 2);
|
|
12
|
+
const median = sorted.length % 2 === 0
|
|
13
|
+
? (sorted[mid - 1] + sorted[mid]) / 2
|
|
14
|
+
: sorted[mid];
|
|
15
|
+
const min = Math.min(...numbers);
|
|
16
|
+
const max = Math.max(...numbers);
|
|
17
|
+
return {
|
|
18
|
+
sum,
|
|
19
|
+
average,
|
|
20
|
+
median,
|
|
21
|
+
min,
|
|
22
|
+
max,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
exports.calculateStatistics = calculateStatistics;
|
|
26
|
+
//# sourceMappingURL=statistics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statistics.js","sourceRoot":"","sources":["../../src/utils/statistics.ts"],"names":[],"mappings":";;;AAQO,MAAM,mBAAmB,GAAG,CAAC,OAA0B,EAAc,EAAE;IAC5E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAErC,MAAM,MAAM,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC;QACpC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC;QACrC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAEhB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IACjC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IAEjC,OAAO;QACL,GAAG;QACH,OAAO;QACP,MAAM;QACN,GAAG;QACH,GAAG;KACJ,CAAC;AACJ,CAAC,CAAC;AAxBW,QAAA,mBAAmB,uBAwB9B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CloudStorageProvider } from './file-upload-handler';
|
|
2
|
+
export declare class S3StorageProvider implements CloudStorageProvider {
|
|
3
|
+
private readonly bucket;
|
|
4
|
+
private readonly region;
|
|
5
|
+
private readonly accessKeyId;
|
|
6
|
+
private readonly secretAccessKey;
|
|
7
|
+
constructor(bucket: string, region: string, accessKeyId: string, secretAccessKey: string);
|
|
8
|
+
upload(file: Buffer, filename: string): Promise<string>;
|
|
9
|
+
}
|
|
10
|
+
export declare class GCSStorageProvider implements CloudStorageProvider {
|
|
11
|
+
private readonly bucket;
|
|
12
|
+
private readonly projectId;
|
|
13
|
+
private readonly credentials;
|
|
14
|
+
constructor(bucket: string, projectId: string, credentials: Record<string, unknown>);
|
|
15
|
+
upload(file: Buffer, filename: string): Promise<string>;
|
|
16
|
+
}
|
|
17
|
+
export declare class AzureBlobStorageProvider implements CloudStorageProvider {
|
|
18
|
+
private readonly containerName;
|
|
19
|
+
private readonly accountName;
|
|
20
|
+
private readonly accountKey;
|
|
21
|
+
constructor(containerName: string, accountName: string, accountKey: string);
|
|
22
|
+
upload(file: Buffer, filename: string): Promise<string>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=storage-providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-providers.d.ts","sourceRoot":"","sources":["../../src/utils/storage-providers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,qBAAa,iBAAkB,YAAW,oBAAoB;IAE1D,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAHf,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM;IAGpC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAG9D;AAED,qBAAa,kBAAmB,YAAW,oBAAoB;IAE3D,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAFX,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAGjD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAG9D;AAED,qBAAa,wBAAyB,YAAW,oBAAoB;IAEjE,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAFV,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM;IAG/B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAG9D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AzureBlobStorageProvider = exports.GCSStorageProvider = exports.S3StorageProvider = void 0;
|
|
4
|
+
class S3StorageProvider {
|
|
5
|
+
constructor(bucket, region, accessKeyId, secretAccessKey) {
|
|
6
|
+
this.bucket = bucket;
|
|
7
|
+
this.region = region;
|
|
8
|
+
this.accessKeyId = accessKeyId;
|
|
9
|
+
this.secretAccessKey = secretAccessKey;
|
|
10
|
+
}
|
|
11
|
+
async upload(file, filename) {
|
|
12
|
+
return `s3://${this.bucket}/${filename}`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.S3StorageProvider = S3StorageProvider;
|
|
16
|
+
class GCSStorageProvider {
|
|
17
|
+
constructor(bucket, projectId, credentials) {
|
|
18
|
+
this.bucket = bucket;
|
|
19
|
+
this.projectId = projectId;
|
|
20
|
+
this.credentials = credentials;
|
|
21
|
+
}
|
|
22
|
+
async upload(file, filename) {
|
|
23
|
+
return `gs://${this.bucket}/${filename}`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.GCSStorageProvider = GCSStorageProvider;
|
|
27
|
+
class AzureBlobStorageProvider {
|
|
28
|
+
constructor(containerName, accountName, accountKey) {
|
|
29
|
+
this.containerName = containerName;
|
|
30
|
+
this.accountName = accountName;
|
|
31
|
+
this.accountKey = accountKey;
|
|
32
|
+
}
|
|
33
|
+
async upload(file, filename) {
|
|
34
|
+
return `https://${this.accountName}.blob.core.windows.net/${this.containerName}/${filename}`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.AzureBlobStorageProvider = AzureBlobStorageProvider;
|
|
38
|
+
//# sourceMappingURL=storage-providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-providers.js","sourceRoot":"","sources":["../../src/utils/storage-providers.ts"],"names":[],"mappings":";;;AAEA,MAAa,iBAAiB;IAC5B,YACmB,MAAc,EACd,MAAc,EACd,WAAmB,EACnB,eAAuB;QAHvB,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAQ;QACd,gBAAW,GAAX,WAAW,CAAQ;QACnB,oBAAe,GAAf,eAAe,CAAQ;IACvC,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,IAAY,EAAE,QAAgB;QACzC,OAAO,QAAQ,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,CAAC;IAC3C,CAAC;CACF;AAXD,8CAWC;AAED,MAAa,kBAAkB;IAC7B,YACmB,MAAc,EACd,SAAiB,EACjB,WAAoC;QAFpC,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAQ;QACjB,gBAAW,GAAX,WAAW,CAAyB;IACpD,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,IAAY,EAAE,QAAgB;QACzC,OAAO,QAAQ,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,CAAC;IAC3C,CAAC;CACF;AAVD,gDAUC;AAED,MAAa,wBAAwB;IACnC,YACmB,aAAqB,EACrB,WAAmB,EACnB,UAAkB;QAFlB,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAQ;QACnB,eAAU,GAAV,UAAU,CAAQ;IAClC,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,IAAY,EAAE,QAAgB;QACzC,OAAO,WAAW,IAAI,CAAC,WAAW,0BAA0B,IAAI,CAAC,aAAa,IAAI,QAAQ,EAAE,CAAC;IAC/F,CAAC;CACF;AAVD,4DAUC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface FilterCriteria<T> {
|
|
2
|
+
readonly predicate: (item: T) => boolean;
|
|
3
|
+
}
|
|
4
|
+
export interface TransformArrayOptions<T, R> {
|
|
5
|
+
readonly mapper: (item: T, index: number, array: readonly T[]) => R;
|
|
6
|
+
readonly filter?: FilterCriteria<T>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Transforms an array of objects using a mapper function and optional filter criteria.
|
|
10
|
+
*
|
|
11
|
+
* @template T - The type of input array elements
|
|
12
|
+
* @template R - The type of output array elements
|
|
13
|
+
* @param array - The input array to transform
|
|
14
|
+
* @param options - Transformation options including mapper and optional filter
|
|
15
|
+
* @returns A new transformed array
|
|
16
|
+
*/
|
|
17
|
+
export declare const transformArray: <T, R>(array: readonly T[], options: TransformArrayOptions<T, R>) => readonly R[];
|
|
18
|
+
//# sourceMappingURL=transformArray.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformArray.d.ts","sourceRoot":"","sources":["../../src/utils/transformArray.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;CAC1C;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,CAAC,CAAC;IACpE,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;CACrC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,EACjC,OAAO,SAAS,CAAC,EAAE,EACnB,SAAS,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,KACnC,SAAS,CAAC,EAQZ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformArray = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Transforms an array of objects using a mapper function and optional filter criteria.
|
|
6
|
+
*
|
|
7
|
+
* @template T - The type of input array elements
|
|
8
|
+
* @template R - The type of output array elements
|
|
9
|
+
* @param array - The input array to transform
|
|
10
|
+
* @param options - Transformation options including mapper and optional filter
|
|
11
|
+
* @returns A new transformed array
|
|
12
|
+
*/
|
|
13
|
+
const transformArray = (array, options) => {
|
|
14
|
+
const { mapper, filter } = options;
|
|
15
|
+
const filteredArray = filter
|
|
16
|
+
? array.filter(filter.predicate)
|
|
17
|
+
: array;
|
|
18
|
+
return filteredArray.map(mapper);
|
|
19
|
+
};
|
|
20
|
+
exports.transformArray = transformArray;
|
|
21
|
+
//# sourceMappingURL=transformArray.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformArray.js","sourceRoot":"","sources":["../../src/utils/transformArray.ts"],"names":[],"mappings":";;;AASA;;;;;;;;GAQG;AACI,MAAM,cAAc,GAAG,CAC5B,KAAmB,EACnB,OAAoC,EACtB,EAAE;IAChB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAEnC,MAAM,aAAa,GAAG,MAAM;QAC1B,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;QAChC,CAAC,CAAC,KAAK,CAAC;IAEV,OAAO,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC,CAAC;AAXW,QAAA,cAAc,kBAWzB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type-safe event emitter with strongly-typed event payloads
|
|
3
|
+
*/
|
|
4
|
+
type EventMap = Record<string, (...args: any[]) => void>;
|
|
5
|
+
type EventKey<T extends EventMap> = string & keyof T;
|
|
6
|
+
type EventListener<T extends EventMap, K extends EventKey<T>> = T[K];
|
|
7
|
+
export declare class TypedEventEmitter<T extends EventMap> {
|
|
8
|
+
private listeners;
|
|
9
|
+
on<K extends EventKey<T>>(eventName: K, listener: EventListener<T, K>): this;
|
|
10
|
+
once<K extends EventKey<T>>(eventName: K, listener: EventListener<T, K>): this;
|
|
11
|
+
off<K extends EventKey<T>>(eventName: K, listener: EventListener<T, K>): this;
|
|
12
|
+
emit<K extends EventKey<T>>(eventName: K, ...args: Parameters<EventListener<T, K>>): boolean;
|
|
13
|
+
removeAllListeners<K extends EventKey<T>>(eventName?: K): this;
|
|
14
|
+
listenerCount<K extends EventKey<T>>(eventName: K): number;
|
|
15
|
+
eventNames(): Array<EventKey<T>>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=TypedEventEmitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypedEventEmitter.d.ts","sourceRoot":"","sources":["../../src/utils/TypedEventEmitter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC,CAAC;AAEzD,KAAK,QAAQ,CAAC,CAAC,SAAS,QAAQ,IAAI,MAAM,GAAG,MAAM,CAAC,CAAC;AACrD,KAAK,aAAa,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAErE,qBAAa,iBAAiB,CAAC,CAAC,SAAS,QAAQ;IAC/C,OAAO,CAAC,SAAS,CACL;IAEZ,EAAE,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI;IAQ5E,IAAI,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI;IAS9E,GAAG,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI;IAW7E,IAAI,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,CAAC,EACZ,GAAG,IAAI,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GACvC,OAAO;IAaV,kBAAkB,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI;IAS9D,aAAa,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,MAAM;IAI1D,UAAU,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;CAGjC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Type-safe event emitter with strongly-typed event payloads
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TypedEventEmitter = void 0;
|
|
7
|
+
class TypedEventEmitter {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.listeners = new Map();
|
|
10
|
+
}
|
|
11
|
+
on(eventName, listener) {
|
|
12
|
+
if (!this.listeners.has(eventName)) {
|
|
13
|
+
this.listeners.set(eventName, new Set());
|
|
14
|
+
}
|
|
15
|
+
this.listeners.get(eventName).add(listener);
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
once(eventName, listener) {
|
|
19
|
+
const onceWrapper = ((...args) => {
|
|
20
|
+
this.off(eventName, onceWrapper);
|
|
21
|
+
listener(...args);
|
|
22
|
+
});
|
|
23
|
+
return this.on(eventName, onceWrapper);
|
|
24
|
+
}
|
|
25
|
+
off(eventName, listener) {
|
|
26
|
+
const eventListeners = this.listeners.get(eventName);
|
|
27
|
+
if (eventListeners) {
|
|
28
|
+
eventListeners.delete(listener);
|
|
29
|
+
if (eventListeners.size === 0) {
|
|
30
|
+
this.listeners.delete(eventName);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
emit(eventName, ...args) {
|
|
36
|
+
const eventListeners = this.listeners.get(eventName);
|
|
37
|
+
if (!eventListeners || eventListeners.size === 0) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
eventListeners.forEach((listener) => {
|
|
41
|
+
listener(...args);
|
|
42
|
+
});
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
removeAllListeners(eventName) {
|
|
46
|
+
if (eventName) {
|
|
47
|
+
this.listeners.delete(eventName);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this.listeners.clear();
|
|
51
|
+
}
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
listenerCount(eventName) {
|
|
55
|
+
return this.listeners.get(eventName)?.size ?? 0;
|
|
56
|
+
}
|
|
57
|
+
eventNames() {
|
|
58
|
+
return Array.from(this.listeners.keys());
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.TypedEventEmitter = TypedEventEmitter;
|
|
62
|
+
//# sourceMappingURL=TypedEventEmitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypedEventEmitter.js","sourceRoot":"","sources":["../../src/utils/TypedEventEmitter.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAQH,MAAa,iBAAiB;IAA9B;QACU,cAAS,GACf,IAAI,GAAG,EAAE,CAAC;IA8Dd,CAAC;IA5DC,EAAE,CAAwB,SAAY,EAAE,QAA6B;QACnE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAE,CAAC,GAAG,CAAC,QAAyC,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAwB,SAAY,EAAE,QAA6B;QACrE,MAAM,WAAW,GAAG,CAAC,CAAC,GAAG,IAAqC,EAAE,EAAE;YAChE,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,WAAkC,CAAC,CAAC;YACxD,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;QACpB,CAAC,CAAwB,CAAC;QAE1B,OAAO,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACzC,CAAC;IAED,GAAG,CAAwB,SAAY,EAAE,QAA6B;QACpE,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACrD,IAAI,cAAc,EAAE,CAAC;YACnB,cAAc,CAAC,MAAM,CAAC,QAAyC,CAAC,CAAC;YACjE,IAAI,cAAc,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;gBAC9B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CACF,SAAY,EACZ,GAAG,IAAqC;QAExC,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACrD,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACjD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,cAAc,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YACjC,QAAgC,CAAC,GAAG,IAAI,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,kBAAkB,CAAwB,SAAa;QACrD,IAAI,SAAS,EAAE,CAAC;YACd,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACnC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAwB,SAAY;QAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,UAAU;QACR,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;CACF;AAhED,8CAgEC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { User } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves a user by ID from a Map
|
|
4
|
+
* @param userMap Map containing users indexed by ID
|
|
5
|
+
* @param userId User ID to look up
|
|
6
|
+
* @returns The user object if found, undefined otherwise
|
|
7
|
+
*/
|
|
8
|
+
export declare const getUserById: (userMap: ReadonlyMap<string, User>, userId: string) => User | undefined;
|
|
9
|
+
//# sourceMappingURL=userUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userUtils.d.ts","sourceRoot":"","sources":["../../src/utils/userUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GACtB,SAAS,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,EAClC,QAAQ,MAAM,KACb,IAAI,GAAG,SAET,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUserById = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves a user by ID from a Map
|
|
6
|
+
* @param userMap Map containing users indexed by ID
|
|
7
|
+
* @param userId User ID to look up
|
|
8
|
+
* @returns The user object if found, undefined otherwise
|
|
9
|
+
*/
|
|
10
|
+
const getUserById = (userMap, userId) => {
|
|
11
|
+
return userMap.get(userId);
|
|
12
|
+
};
|
|
13
|
+
exports.getUserById = getUserById;
|
|
14
|
+
//# sourceMappingURL=userUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userUtils.js","sourceRoot":"","sources":["../../src/utils/userUtils.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACI,MAAM,WAAW,GAAG,CACzB,OAAkC,EAClC,MAAc,EACI,EAAE;IACpB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC7B,CAAC,CAAC;AALW,QAAA,WAAW,eAKtB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* LLM-as-Judge validator using GitHub Models API
|
|
3
3
|
*/
|
|
4
|
-
import { CodeValidator, TestScenario, ValidationResult } from
|
|
4
|
+
import { CodeValidator, TestScenario, ValidationResult } from "../types";
|
|
5
5
|
export declare class LLMJudgeValidator implements CodeValidator {
|
|
6
6
|
readonly type: "llm-judge";
|
|
7
7
|
private workspaceRoot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llmJudge.d.ts","sourceRoot":"","sources":["../../src/validators/llmJudge.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"llmJudge.d.ts","sourceRoot":"","sources":["../../src/validators/llmJudge.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EACL,aAAa,EACb,YAAY,EACZ,gBAAgB,EAEjB,MAAM,UAAU,CAAC;AA6DlB,qBAAa,iBAAkB,YAAW,aAAa;IACrD,SAAgB,IAAI,EAAG,WAAW,CAAU;IAC5C,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,YAAY,CAAS;gBAEjB,aAAa,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,MAAyB;IAMpE;;OAEG;IACG,QAAQ,CACZ,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,gBAAgB,CAAC;IA8E5B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA+B3B;;OAEG;YACW,UAAU;IA4ExB;;OAEG;IACG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAYjE"}
|