modestbench 0.8.0 → 0.9.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/CHANGELOG.md +13 -0
- package/README.md +37 -4
- package/dist/adapters/types.d.cts +1 -1
- package/dist/adapters/types.d.cts.map +1 -1
- package/dist/adapters/types.d.ts +1 -1
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/cli/commands/run.cjs +9 -5
- package/dist/cli/commands/run.cjs.map +1 -1
- package/dist/cli/commands/run.d.cts +1 -0
- package/dist/cli/commands/run.d.cts.map +1 -1
- package/dist/cli/commands/run.d.ts +1 -0
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +10 -6
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/index.cjs +7 -1
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +7 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/{core → config}/benchmark-schema.cjs +1 -1
- package/dist/config/benchmark-schema.cjs.map +1 -0
- package/dist/config/benchmark-schema.d.cts +913 -0
- package/dist/config/benchmark-schema.d.cts.map +1 -0
- package/dist/config/benchmark-schema.d.ts +913 -0
- package/dist/config/benchmark-schema.d.ts.map +1 -0
- package/dist/{core → config}/benchmark-schema.js +1 -1
- package/dist/config/benchmark-schema.js.map +1 -0
- package/dist/config/schema.cjs +188 -105
- package/dist/config/schema.cjs.map +1 -1
- package/dist/config/schema.d.cts +208 -80
- package/dist/config/schema.d.cts.map +1 -1
- package/dist/config/schema.d.ts +208 -80
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +187 -104
- package/dist/config/schema.js.map +1 -1
- package/dist/core/engine.cjs +50 -45
- package/dist/core/engine.cjs.map +1 -1
- package/dist/core/engine.d.cts.map +1 -1
- package/dist/core/engine.d.ts.map +1 -1
- package/dist/core/engine.js +50 -45
- package/dist/core/engine.js.map +1 -1
- package/dist/core/output-path-resolver.cjs +15 -1
- package/dist/core/output-path-resolver.cjs.map +1 -1
- package/dist/core/output-path-resolver.d.cts +8 -0
- package/dist/core/output-path-resolver.d.cts.map +1 -1
- package/dist/core/output-path-resolver.d.ts +8 -0
- package/dist/core/output-path-resolver.d.ts.map +1 -1
- package/dist/core/output-path-resolver.js +13 -0
- package/dist/core/output-path-resolver.js.map +1 -1
- package/dist/reporters/json.cjs +1 -1
- package/dist/reporters/json.cjs.map +1 -1
- package/dist/reporters/json.js +1 -1
- package/dist/reporters/json.js.map +1 -1
- package/dist/schema/modestbench-config.schema.json +94 -87
- package/dist/services/budget-evaluator.cjs +8 -6
- package/dist/services/budget-evaluator.cjs.map +1 -1
- package/dist/services/budget-evaluator.d.cts +2 -2
- package/dist/services/budget-evaluator.d.cts.map +1 -1
- package/dist/services/budget-evaluator.d.ts +2 -2
- package/dist/services/budget-evaluator.d.ts.map +1 -1
- package/dist/services/budget-evaluator.js +8 -6
- package/dist/services/budget-evaluator.js.map +1 -1
- package/dist/services/budget-resolver.cjs +214 -0
- package/dist/services/budget-resolver.cjs.map +1 -0
- package/dist/services/budget-resolver.d.cts +98 -0
- package/dist/services/budget-resolver.d.cts.map +1 -0
- package/dist/services/budget-resolver.d.ts +98 -0
- package/dist/services/budget-resolver.d.ts.map +1 -0
- package/dist/services/budget-resolver.js +203 -0
- package/dist/services/budget-resolver.js.map +1 -0
- package/dist/services/file-loader.cjs +1 -1
- package/dist/services/file-loader.cjs.map +1 -1
- package/dist/services/file-loader.js +1 -1
- package/dist/services/file-loader.js.map +1 -1
- package/dist/types/budgets.d.cts +31 -0
- package/dist/types/budgets.d.cts.map +1 -1
- package/dist/types/budgets.d.ts +31 -0
- package/dist/types/budgets.d.ts.map +1 -1
- package/dist/types/core.cjs.map +1 -1
- package/dist/types/core.d.cts +28 -75
- package/dist/types/core.d.cts.map +1 -1
- package/dist/types/core.d.ts +28 -75
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/core.js.map +1 -1
- package/package.json +18 -7
- package/src/adapters/types.ts +1 -1
- package/src/cli/commands/run.ts +17 -5
- package/src/cli/index.ts +8 -1
- package/src/{core → config}/benchmark-schema.ts +1 -1
- package/src/config/schema.ts +379 -302
- package/src/core/engine.ts +74 -69
- package/src/core/output-path-resolver.ts +14 -0
- package/src/reporters/json.ts +1 -1
- package/src/services/budget-evaluator.ts +13 -9
- package/src/services/budget-resolver.ts +254 -0
- package/src/services/file-loader.ts +1 -1
- package/src/types/budgets.ts +38 -0
- package/src/types/core.ts +64 -99
- package/dist/core/benchmark-schema.cjs.map +0 -1
- package/dist/core/benchmark-schema.d.cts +0 -139
- package/dist/core/benchmark-schema.d.cts.map +0 -1
- package/dist/core/benchmark-schema.d.ts +0 -139
- package/dist/core/benchmark-schema.d.ts.map +0 -1
- package/dist/core/benchmark-schema.js.map +0 -1
package/src/types/core.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
jsonReporterConfigSchema,
|
|
5
|
+
ModestBenchConfig,
|
|
6
|
+
ModestBenchConfigInput,
|
|
7
|
+
reporterConfigSchema,
|
|
8
|
+
} from '../config/schema.js';
|
|
1
9
|
// Budget-related types
|
|
2
10
|
import type {
|
|
3
11
|
AbsoluteBudget,
|
|
@@ -5,38 +13,16 @@ import type {
|
|
|
5
13
|
BaselineStorage,
|
|
6
14
|
BaselineSummaryData,
|
|
7
15
|
Budget,
|
|
16
|
+
BudgetPattern,
|
|
8
17
|
BudgetResult,
|
|
9
18
|
BudgetSummary,
|
|
10
19
|
BudgetViolation,
|
|
11
20
|
RelativeBudget,
|
|
21
|
+
ResolvedBudgets,
|
|
12
22
|
RunId,
|
|
13
23
|
TaskId,
|
|
14
24
|
} from './budgets.js';
|
|
15
25
|
|
|
16
|
-
export type {
|
|
17
|
-
AbsoluteBudget,
|
|
18
|
-
BaselineReference,
|
|
19
|
-
BaselineStorage,
|
|
20
|
-
BaselineSummaryData,
|
|
21
|
-
Budget,
|
|
22
|
-
BudgetResult,
|
|
23
|
-
BudgetSummary,
|
|
24
|
-
BudgetViolation,
|
|
25
|
-
RelativeBudget,
|
|
26
|
-
RunId,
|
|
27
|
-
TaskId,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// Re-export schema-derived types
|
|
31
|
-
export type {
|
|
32
|
-
BenchmarkDefinition,
|
|
33
|
-
BenchmarkDefinitionInput,
|
|
34
|
-
BenchmarkSuite,
|
|
35
|
-
BenchmarkSuiteInput,
|
|
36
|
-
BenchmarkTask,
|
|
37
|
-
BenchmarkTaskInput,
|
|
38
|
-
} from '../core/benchmark-schema.js';
|
|
39
|
-
|
|
40
26
|
/**
|
|
41
27
|
* Benchmark file structure after parsing
|
|
42
28
|
*/
|
|
@@ -51,21 +37,6 @@ export interface BenchmarkFile {
|
|
|
51
37
|
readonly metadata: FileMetadata;
|
|
52
38
|
}
|
|
53
39
|
|
|
54
|
-
/**
|
|
55
|
-
* ModestBench Core Types
|
|
56
|
-
*
|
|
57
|
-
* Defines the fundamental data structures used throughout the ModestBench
|
|
58
|
-
* system. These types represent benchmark results, metadata, configuration, and
|
|
59
|
-
* system state.
|
|
60
|
-
*
|
|
61
|
-
* Note: BenchmarkDefinition, BenchmarkSuite, and BenchmarkTask types are
|
|
62
|
-
* derived from Zod schemas and re-exported from benchmark-schema.ts for type
|
|
63
|
-
* safety and consistency.
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
// Re-export identifier helper functions
|
|
67
|
-
export { createRunId, createTaskId } from '../utils/identifiers.js';
|
|
68
|
-
|
|
69
40
|
/**
|
|
70
41
|
* Represents a complete benchmark run across multiple files
|
|
71
42
|
*/
|
|
@@ -98,6 +69,34 @@ export interface BenchmarkRun {
|
|
|
98
69
|
readonly tags?: string[];
|
|
99
70
|
}
|
|
100
71
|
|
|
72
|
+
export type {
|
|
73
|
+
AbsoluteBudget,
|
|
74
|
+
BaselineReference,
|
|
75
|
+
BaselineStorage,
|
|
76
|
+
BaselineSummaryData,
|
|
77
|
+
Budget,
|
|
78
|
+
BudgetPattern,
|
|
79
|
+
BudgetResult,
|
|
80
|
+
BudgetSummary,
|
|
81
|
+
BudgetViolation,
|
|
82
|
+
RelativeBudget,
|
|
83
|
+
ResolvedBudgets,
|
|
84
|
+
RunId,
|
|
85
|
+
TaskId,
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export type { ModestBenchConfig, ModestBenchConfigInput };
|
|
89
|
+
|
|
90
|
+
// Re-export schema-derived types
|
|
91
|
+
export type {
|
|
92
|
+
BenchmarkDefinition,
|
|
93
|
+
BenchmarkDefinitionInput,
|
|
94
|
+
BenchmarkSuite,
|
|
95
|
+
BenchmarkSuiteInput,
|
|
96
|
+
BenchmarkTask,
|
|
97
|
+
BenchmarkTaskInput,
|
|
98
|
+
} from '../config/benchmark-schema.js';
|
|
99
|
+
|
|
101
100
|
/**
|
|
102
101
|
* CI/CD environment information
|
|
103
102
|
*/
|
|
@@ -116,6 +115,21 @@ export interface CiInfo {
|
|
|
116
115
|
readonly pullRequest?: string;
|
|
117
116
|
}
|
|
118
117
|
|
|
118
|
+
/**
|
|
119
|
+
* ModestBench Core Types
|
|
120
|
+
*
|
|
121
|
+
* Defines the fundamental data structures used throughout the ModestBench
|
|
122
|
+
* system. These types represent benchmark results, metadata, configuration, and
|
|
123
|
+
* system state.
|
|
124
|
+
*
|
|
125
|
+
* Note: BenchmarkDefinition, BenchmarkSuite, and BenchmarkTask types are
|
|
126
|
+
* derived from Zod schemas and re-exported from benchmark-schema.ts for type
|
|
127
|
+
* safety and consistency.
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
// Re-export identifier helper functions
|
|
131
|
+
export { createRunId, createTaskId } from '../utils/identifiers.js';
|
|
132
|
+
|
|
119
133
|
/**
|
|
120
134
|
* CPU information
|
|
121
135
|
*/
|
|
@@ -277,6 +291,11 @@ export interface GitInfo {
|
|
|
277
291
|
readonly timestamp: Date;
|
|
278
292
|
}
|
|
279
293
|
|
|
294
|
+
/**
|
|
295
|
+
* Configuration options for the JSON reporter
|
|
296
|
+
*/
|
|
297
|
+
export type JsonReporterConfig = z.infer<typeof jsonReporterConfigSchema>;
|
|
298
|
+
|
|
280
299
|
/**
|
|
281
300
|
* Memory information
|
|
282
301
|
*/
|
|
@@ -290,68 +309,12 @@ export interface MemoryInfo {
|
|
|
290
309
|
}
|
|
291
310
|
|
|
292
311
|
/**
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
-
* The JSON Schema for this configuration is available at
|
|
296
|
-
* `dist/schema/modestbench-config.schema.json` after building the project.
|
|
312
|
+
* Reporter-specific configuration
|
|
297
313
|
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
* @example
|
|
302
|
-
*
|
|
303
|
-
* ```json
|
|
304
|
-
* {
|
|
305
|
-
* "$schema": "./node_modules/modestbench/dist/schema/modestbench-config.schema.json",
|
|
306
|
-
* "iterations": 1000,
|
|
307
|
-
* "reporters": ["human", "json"],
|
|
308
|
-
* "time": 5000
|
|
309
|
-
* }
|
|
310
|
-
* ```
|
|
314
|
+
* Provides typed configuration for known reporters. Unknown reporter configs
|
|
315
|
+
* are allowed via index signature.
|
|
311
316
|
*/
|
|
312
|
-
export
|
|
313
|
-
readonly $schema?: string | undefined;
|
|
314
|
-
/** Whether to stop on first failure */
|
|
315
|
-
readonly bail: boolean;
|
|
316
|
-
/** Name of baseline to use for relative budget comparisons */
|
|
317
|
-
readonly baseline?: string | undefined;
|
|
318
|
-
/** How to handle budget violations: 'fail', 'warn', or 'report' */
|
|
319
|
-
readonly budgetMode?: 'fail' | 'report' | 'warn' | undefined;
|
|
320
|
-
/** Performance budgets mapped by task identifier */
|
|
321
|
-
readonly budgets?: Record<string, unknown> | undefined;
|
|
322
|
-
/** Patterns to exclude from discovery */
|
|
323
|
-
readonly exclude: string[];
|
|
324
|
-
/** Tags to exclude from execution */
|
|
325
|
-
readonly excludeTags: string[];
|
|
326
|
-
/** Default number of iterations per task */
|
|
327
|
-
readonly iterations: number;
|
|
328
|
-
/** How to limit benchmark execution: 'time', 'iterations', 'any', or 'all' */
|
|
329
|
-
readonly limitBy: 'all' | 'any' | 'iterations' | 'time';
|
|
330
|
-
/** Custom metadata to attach to runs */
|
|
331
|
-
readonly metadata: Record<string, unknown>;
|
|
332
|
-
/** Output directory for reports (undefined means stdout for data reporters) */
|
|
333
|
-
readonly outputDir?: string;
|
|
334
|
-
/** Pattern(s) for discovering benchmark files */
|
|
335
|
-
readonly pattern: string | string[];
|
|
336
|
-
/** Whether to run in quiet mode */
|
|
337
|
-
readonly quiet: boolean;
|
|
338
|
-
/** Configuration for specific reporters */
|
|
339
|
-
readonly reporterConfig: Record<string, unknown>;
|
|
340
|
-
/** Reporters to use for output */
|
|
341
|
-
readonly reporters: string[];
|
|
342
|
-
/** Tags to include (if empty, include all) */
|
|
343
|
-
readonly tags: string[];
|
|
344
|
-
/** Threshold configuration for performance assertions */
|
|
345
|
-
readonly thresholds: ThresholdConfig;
|
|
346
|
-
/** Maximum time to spend on each task in milliseconds */
|
|
347
|
-
readonly time: number;
|
|
348
|
-
/** Timeout for individual tasks in milliseconds */
|
|
349
|
-
readonly timeout: number;
|
|
350
|
-
/** Whether to run in verbose mode */
|
|
351
|
-
readonly verbose: boolean;
|
|
352
|
-
/** Number of warmup iterations before measurement */
|
|
353
|
-
readonly warmup: number;
|
|
354
|
-
}
|
|
317
|
+
export type ReporterConfig = z.infer<typeof reporterConfigSchema>;
|
|
355
318
|
|
|
356
319
|
/**
|
|
357
320
|
* Summary statistics for a benchmark run
|
|
@@ -441,6 +404,8 @@ export interface TaskResult {
|
|
|
441
404
|
|
|
442
405
|
/**
|
|
443
406
|
* Threshold configuration for performance assertions
|
|
407
|
+
*
|
|
408
|
+
* TODO: Derive from thresholdConfigSchema via z.infer (see #15)
|
|
444
409
|
*/
|
|
445
410
|
export interface ThresholdConfig {
|
|
446
411
|
/** Maximum allowed margin of error percentage */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"benchmark-schema.js","sourceRoot":"","sources":["../../src/core/benchmark-schema.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,6BAAwB;AAIxB,oDAAqE;AAErE;;GAEG;AACH,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAChC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,UAAU,EACtC,EAAE,OAAO,EAAE,qBAAqB,EAAE,CACnC,CAAC;AAEF;;GAEG;AACH,MAAM,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,0CAA8B;SACnC,QAAQ,EAAE;SACV,QAAQ,CAAC,uCAAuC,CAAC;IACpD,EAAE,EAAE,iBAAiB,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC3D,QAAQ,EAAE,OAAC;SACR,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC;SAC/B,QAAQ,EAAE;SACV,QAAQ,CAAC,0CAA0C,CAAC;IACvD,IAAI,EAAE,OAAC;SACJ,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,uCAAuC,CAAC;CACrD,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,mBAAmB,GAAG,OAAC;KAC1B,KAAK,CAAC;IACL,yBAAyB;IACzB,iBAAiB,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;CAC9C,CAAC;KACD,IAAI,CAAC,yBAAyB,CAAC;KAC/B,QAAQ,CAAC,yDAAyD,CAAC,CAAC;AAEvE;;GAEG;AACH,MAAM,oBAAoB,GAAG,OAAC;KAC3B,MAAM,CAAC;IACN,UAAU,EAAE,OAAC;SACV,MAAM,CA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C1C,CAAC;aACD,QAAQ,CAAC,yCAAyC,CAAC;QACtD,IAAI,EAAE,OAAC;aACJ,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,EAAE;aACV,QAAQ,CAAC,uCAAuC,CAAC;KACrD,CAAC;IACF,2DAA2D;IAC3D,OAAC;SACE,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,iBAAiB,CAAC;SACrC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;QAChD,OAAO,EAAE,+BAA+B;KACzC,CAAC;SACD,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACrB,2EAA2E;QAC3E,MAAM,EAAE,SAAmD;QAC3D,QAAQ,EAAE,SAAgD;QAC1D,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,UAAU,EAAE,MAAM,CAAC,WAAW,CAC5B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAC1D;aACF;SACF;QACD,IAAI,EAAE,SAAiC;KACxC,CAAC,CAAC;CACN,CAAC;KACD,QAAQ,CACP,gFAAgF,CACjF,CAAC"}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ModestBench Benchmark File Schema
|
|
3
|
-
*
|
|
4
|
-
* Zod schemas for validating and parsing benchmark file structure. Supports
|
|
5
|
-
* both traditional suite-based format and simplified flat task definitions.
|
|
6
|
-
*
|
|
7
|
-
* Types are derived from schemas using z.infer (output) and z.input (input).
|
|
8
|
-
*/
|
|
9
|
-
import { z } from 'zod';
|
|
10
|
-
import type { ModestBenchConfig } from "../types/core.cjs";
|
|
11
|
-
/**
|
|
12
|
-
* Zod schema for a benchmark task - accepts either:
|
|
13
|
-
*
|
|
14
|
-
* 1. A full task object with fn, config, metadata, tags
|
|
15
|
-
* 2. A function directly (shorthand syntax)
|
|
16
|
-
*
|
|
17
|
-
* Input: function OR object Output: always normalized to object with fn
|
|
18
|
-
* property
|
|
19
|
-
*/
|
|
20
|
-
declare const benchmarkTaskSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
|
|
21
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
22
|
-
fn: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
|
|
23
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
24
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
-
}, z.core.$strip>, z.ZodPipe<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>, z.ZodTransform<{
|
|
26
|
-
fn: (...args: any[]) => unknown;
|
|
27
|
-
}, (...args: any[]) => unknown>>]>, z.ZodObject<{
|
|
28
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
29
|
-
fn: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
|
|
30
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
31
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
32
|
-
}, z.core.$strip>>;
|
|
33
|
-
/**
|
|
34
|
-
* Zod schema for validating benchmark suite structure
|
|
35
|
-
*/
|
|
36
|
-
declare const benchmarkSuiteSchema: z.ZodObject<{
|
|
37
|
-
benchmarks: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
|
|
38
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
39
|
-
fn: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
|
|
40
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
41
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
42
|
-
}, z.core.$strip>, z.ZodPipe<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>, z.ZodTransform<{
|
|
43
|
-
fn: (...args: any[]) => unknown;
|
|
44
|
-
}, (...args: any[]) => unknown>>]>, z.ZodObject<{
|
|
45
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
46
|
-
fn: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
|
|
47
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
48
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
-
}, z.core.$strip>>>;
|
|
50
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
51
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
52
|
-
setup: z.ZodOptional<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>>;
|
|
53
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
54
|
-
teardown: z.ZodOptional<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>>;
|
|
55
|
-
}, z.core.$strip>;
|
|
56
|
-
/**
|
|
57
|
-
* Zod schema for validating benchmark file structure.
|
|
58
|
-
*
|
|
59
|
-
* Supports two formats:
|
|
60
|
-
*
|
|
61
|
-
* 1. Suite format (supports config/metadata/tags): { suites: { 'Suite Name': {
|
|
62
|
-
* benchmarks: {...} } }, config: {...} }
|
|
63
|
-
* 2. Flat format (simple, tasks only - no config/metadata/tags): { 'task name': ()
|
|
64
|
-
* => {...} }
|
|
65
|
-
*
|
|
66
|
-
* The flat format is automatically transformed to suite format with a default
|
|
67
|
-
* suite.
|
|
68
|
-
*
|
|
69
|
-
* Input: flat Record<string, function> OR suite object Output: always
|
|
70
|
-
* normalized to suite format
|
|
71
|
-
*/
|
|
72
|
-
export declare const benchmarkFileSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
73
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
74
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
75
|
-
suites: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
76
|
-
benchmarks: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
|
|
77
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
78
|
-
fn: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
|
|
79
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
80
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
81
|
-
}, z.core.$strip>, z.ZodPipe<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>, z.ZodTransform<{
|
|
82
|
-
fn: (...args: any[]) => unknown;
|
|
83
|
-
}, (...args: any[]) => unknown>>]>, z.ZodObject<{
|
|
84
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
85
|
-
fn: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
|
|
86
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
87
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
|
-
}, z.core.$strip>>>;
|
|
89
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
90
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
91
|
-
setup: z.ZodOptional<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>>;
|
|
92
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
93
|
-
teardown: z.ZodOptional<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>>;
|
|
94
|
-
}, z.core.$strip>>;
|
|
95
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
96
|
-
}, z.core.$strip>, z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>>, z.ZodTransform<{
|
|
97
|
-
config: Partial<ModestBenchConfig> | undefined;
|
|
98
|
-
metadata: Record<string, unknown> | undefined;
|
|
99
|
-
suites: {
|
|
100
|
-
default: {
|
|
101
|
-
benchmarks: {
|
|
102
|
-
[k: string]: {
|
|
103
|
-
fn: (...args: any[]) => unknown;
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
tags: string[] | undefined;
|
|
109
|
-
}, Record<string, (...args: any[]) => unknown>>>]>;
|
|
110
|
-
/**
|
|
111
|
-
* Benchmark file definition (normalized) - internal representation Always in
|
|
112
|
-
* suite format
|
|
113
|
-
*/
|
|
114
|
-
export type BenchmarkDefinition = z.infer<typeof benchmarkFileSchema>;
|
|
115
|
-
/**
|
|
116
|
-
* Benchmark file definition (input) - what users write Can be either flat
|
|
117
|
-
* format (Record<string, function>) or suite format
|
|
118
|
-
*/
|
|
119
|
-
export type BenchmarkDefinitionInput = z.input<typeof benchmarkFileSchema>;
|
|
120
|
-
/**
|
|
121
|
-
* Benchmark suite (normalized) - internal representation
|
|
122
|
-
*/
|
|
123
|
-
export type BenchmarkSuite = z.infer<typeof benchmarkSuiteSchema>;
|
|
124
|
-
/**
|
|
125
|
-
* Benchmark suite (input) - what users write
|
|
126
|
-
*/
|
|
127
|
-
export type BenchmarkSuiteInput = z.input<typeof benchmarkSuiteSchema>;
|
|
128
|
-
/**
|
|
129
|
-
* Benchmark task (normalized) - internal representation Always an object with
|
|
130
|
-
* fn property
|
|
131
|
-
*/
|
|
132
|
-
export type BenchmarkTask = z.infer<typeof benchmarkTaskSchema>;
|
|
133
|
-
/**
|
|
134
|
-
* Benchmark task (input) - what users write Can be either a function or an
|
|
135
|
-
* object with fn property
|
|
136
|
-
*/
|
|
137
|
-
export type BenchmarkTaskInput = z.input<typeof benchmarkTaskSchema>;
|
|
138
|
-
export {};
|
|
139
|
-
//# sourceMappingURL=benchmark-schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"benchmark-schema.d.ts","sourceRoot":"","sources":["../../src/core/benchmark-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAAyB;AA8B1D;;;;;;;;GAQG;AACH,QAAA,MAAM,mBAAmB;;8BAhCoB,GAAG,EAAE,KAAK,OAAO,YAAjB,GAAG,EAAE,KAAK,OAAO;;;mDAAjB,GAAG,EAAE,KAAK,OAAO,YAAjB,GAAG,EAAE,KAAK,OAAO;kBAAjB,GAAG,EAAE,KAAK,OAAO;aAAjB,GAAG,EAAE,KAAK,OAAO;;8BAAjB,GAAG,EAAE,KAAK,OAAO,YAAjB,GAAG,EAAE,KAAK,OAAO;;;kBAsCQ,CAAC;AAEvE;;GAEG;AACH,Q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AAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ModestBench Benchmark File Schema
|
|
3
|
-
*
|
|
4
|
-
* Zod schemas for validating and parsing benchmark file structure. Supports
|
|
5
|
-
* both traditional suite-based format and simplified flat task definitions.
|
|
6
|
-
*
|
|
7
|
-
* Types are derived from schemas using z.infer (output) and z.input (input).
|
|
8
|
-
*/
|
|
9
|
-
import { z } from 'zod';
|
|
10
|
-
import type { ModestBenchConfig } from "../types/core.js";
|
|
11
|
-
/**
|
|
12
|
-
* Zod schema for a benchmark task - accepts either:
|
|
13
|
-
*
|
|
14
|
-
* 1. A full task object with fn, config, metadata, tags
|
|
15
|
-
* 2. A function directly (shorthand syntax)
|
|
16
|
-
*
|
|
17
|
-
* Input: function OR object Output: always normalized to object with fn
|
|
18
|
-
* property
|
|
19
|
-
*/
|
|
20
|
-
declare const benchmarkTaskSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
|
|
21
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
22
|
-
fn: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
|
|
23
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
24
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
-
}, z.core.$strip>, z.ZodPipe<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>, z.ZodTransform<{
|
|
26
|
-
fn: (...args: any[]) => unknown;
|
|
27
|
-
}, (...args: any[]) => unknown>>]>, z.ZodObject<{
|
|
28
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
29
|
-
fn: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
|
|
30
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
31
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
32
|
-
}, z.core.$strip>>;
|
|
33
|
-
/**
|
|
34
|
-
* Zod schema for validating benchmark suite structure
|
|
35
|
-
*/
|
|
36
|
-
declare const benchmarkSuiteSchema: z.ZodObject<{
|
|
37
|
-
benchmarks: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
|
|
38
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
39
|
-
fn: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
|
|
40
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
41
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
42
|
-
}, z.core.$strip>, z.ZodPipe<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>, z.ZodTransform<{
|
|
43
|
-
fn: (...args: any[]) => unknown;
|
|
44
|
-
}, (...args: any[]) => unknown>>]>, z.ZodObject<{
|
|
45
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
46
|
-
fn: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
|
|
47
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
48
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
-
}, z.core.$strip>>>;
|
|
50
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
51
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
52
|
-
setup: z.ZodOptional<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>>;
|
|
53
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
54
|
-
teardown: z.ZodOptional<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>>;
|
|
55
|
-
}, z.core.$strip>;
|
|
56
|
-
/**
|
|
57
|
-
* Zod schema for validating benchmark file structure.
|
|
58
|
-
*
|
|
59
|
-
* Supports two formats:
|
|
60
|
-
*
|
|
61
|
-
* 1. Suite format (supports config/metadata/tags): { suites: { 'Suite Name': {
|
|
62
|
-
* benchmarks: {...} } }, config: {...} }
|
|
63
|
-
* 2. Flat format (simple, tasks only - no config/metadata/tags): { 'task name': ()
|
|
64
|
-
* => {...} }
|
|
65
|
-
*
|
|
66
|
-
* The flat format is automatically transformed to suite format with a default
|
|
67
|
-
* suite.
|
|
68
|
-
*
|
|
69
|
-
* Input: flat Record<string, function> OR suite object Output: always
|
|
70
|
-
* normalized to suite format
|
|
71
|
-
*/
|
|
72
|
-
export declare const benchmarkFileSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
73
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
74
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
75
|
-
suites: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
76
|
-
benchmarks: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
|
|
77
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
78
|
-
fn: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
|
|
79
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
80
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
81
|
-
}, z.core.$strip>, z.ZodPipe<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>, z.ZodTransform<{
|
|
82
|
-
fn: (...args: any[]) => unknown;
|
|
83
|
-
}, (...args: any[]) => unknown>>]>, z.ZodObject<{
|
|
84
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
85
|
-
fn: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
|
|
86
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
87
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
|
-
}, z.core.$strip>>>;
|
|
89
|
-
config: z.ZodOptional<z.ZodType<Partial<ModestBenchConfig>, unknown, z.core.$ZodTypeInternals<Partial<ModestBenchConfig>, unknown>>>;
|
|
90
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
91
|
-
setup: z.ZodOptional<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>>;
|
|
92
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
93
|
-
teardown: z.ZodOptional<z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>>;
|
|
94
|
-
}, z.core.$strip>>;
|
|
95
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
96
|
-
}, z.core.$strip>, z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>>, z.ZodTransform<{
|
|
97
|
-
config: Partial<ModestBenchConfig> | undefined;
|
|
98
|
-
metadata: Record<string, unknown> | undefined;
|
|
99
|
-
suites: {
|
|
100
|
-
default: {
|
|
101
|
-
benchmarks: {
|
|
102
|
-
[k: string]: {
|
|
103
|
-
fn: (...args: any[]) => unknown;
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
tags: string[] | undefined;
|
|
109
|
-
}, Record<string, (...args: any[]) => unknown>>>]>;
|
|
110
|
-
/**
|
|
111
|
-
* Benchmark file definition (normalized) - internal representation Always in
|
|
112
|
-
* suite format
|
|
113
|
-
*/
|
|
114
|
-
export type BenchmarkDefinition = z.infer<typeof benchmarkFileSchema>;
|
|
115
|
-
/**
|
|
116
|
-
* Benchmark file definition (input) - what users write Can be either flat
|
|
117
|
-
* format (Record<string, function>) or suite format
|
|
118
|
-
*/
|
|
119
|
-
export type BenchmarkDefinitionInput = z.input<typeof benchmarkFileSchema>;
|
|
120
|
-
/**
|
|
121
|
-
* Benchmark suite (normalized) - internal representation
|
|
122
|
-
*/
|
|
123
|
-
export type BenchmarkSuite = z.infer<typeof benchmarkSuiteSchema>;
|
|
124
|
-
/**
|
|
125
|
-
* Benchmark suite (input) - what users write
|
|
126
|
-
*/
|
|
127
|
-
export type BenchmarkSuiteInput = z.input<typeof benchmarkSuiteSchema>;
|
|
128
|
-
/**
|
|
129
|
-
* Benchmark task (normalized) - internal representation Always an object with
|
|
130
|
-
* fn property
|
|
131
|
-
*/
|
|
132
|
-
export type BenchmarkTask = z.infer<typeof benchmarkTaskSchema>;
|
|
133
|
-
/**
|
|
134
|
-
* Benchmark task (input) - what users write Can be either a function or an
|
|
135
|
-
* object with fn property
|
|
136
|
-
*/
|
|
137
|
-
export type BenchmarkTaskInput = z.input<typeof benchmarkTaskSchema>;
|
|
138
|
-
export {};
|
|
139
|
-
//# sourceMappingURL=benchmark-schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"benchmark-schema.d.ts","sourceRoot":"","sources":["../../src/core/benchmark-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAyB;AA8B1D;;;;;;;;GAQG;AACH,QAAA,MAAM,mBAAmB;;8BAhCoB,GAAG,EAAE,KAAK,OAAO,YAAjB,GAAG,EAAE,KAAK,OAAO;;;mDAAjB,GAAG,EAAE,KAAK,OAAO,YAAjB,GAAG,EAAE,KAAK,OAAO;kBAAjB,GAAG,EAAE,KAAK,OAAO;aAAjB,GAAG,EAAE,KAAK,OAAO;;8BAAjB,GAAG,EAAE,KAAK,OAAO,YAAjB,GAAG,EAAE,KAAK,OAAO;;;kBAsCQ,CAAC;AAEvE;;GAEG;AACH,QAAA,MAAM,oBAAoB;;;kCA3CmB,GAAG,EAAE,KAAK,OAAO,YAAjB,GAAG,EAAE,KAAK,OAAO;;;uDAAjB,GAAG,EAAE,KAAK,OAAO,YAAjB,GAAG,EAAE,KAAK,OAAO;sBAAjB,GAAG,EAAE,KAAK,OAAO;iBAAjB,GAAG,EAAE,KAAK,OAAO;;kCAAjB,GAAG,EAAE,KAAK,OAAO,YAAjB,GAAG,EAAE,KAAK,OAAO;;;;;;+CAAjB,GAAG,EAAE,KAAK,OAAO,YAAjB,GAAG,EAAE,KAAK,OAAO;;kDAAjB,GA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