@artemiskit/core 0.1.6 → 0.2.2
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 +116 -0
- package/dist/adapters/types.d.ts +8 -1
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/artifacts/types.d.ts +39 -0
- package/dist/artifacts/types.d.ts.map +1 -1
- package/dist/cost/index.d.ts +5 -0
- package/dist/cost/index.d.ts.map +1 -0
- package/dist/cost/pricing.d.ts +67 -0
- package/dist/cost/pricing.d.ts.map +1 -0
- package/dist/evaluators/combined.d.ts +10 -0
- package/dist/evaluators/combined.d.ts.map +1 -0
- package/dist/evaluators/index.d.ts +4 -0
- package/dist/evaluators/index.d.ts.map +1 -1
- package/dist/evaluators/inline.d.ts +22 -0
- package/dist/evaluators/inline.d.ts.map +1 -0
- package/dist/evaluators/llm-grader.d.ts.map +1 -1
- package/dist/evaluators/not-contains.d.ts +10 -0
- package/dist/evaluators/not-contains.d.ts.map +1 -0
- package/dist/evaluators/similarity.d.ts +16 -0
- package/dist/evaluators/similarity.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13212 -12018
- package/dist/scenario/discovery.d.ts +72 -0
- package/dist/scenario/discovery.d.ts.map +1 -0
- package/dist/scenario/index.d.ts +1 -0
- package/dist/scenario/index.d.ts.map +1 -1
- package/dist/scenario/schema.d.ts +1253 -9
- package/dist/scenario/schema.d.ts.map +1 -1
- package/dist/storage/local.d.ts +44 -2
- package/dist/storage/local.d.ts.map +1 -1
- package/dist/storage/types.d.ts +62 -0
- package/dist/storage/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/types.ts +8 -1
- package/src/artifacts/types.ts +39 -0
- package/src/cost/index.ts +14 -0
- package/src/cost/pricing.ts +450 -0
- package/src/evaluators/combined.test.ts +172 -0
- package/src/evaluators/combined.ts +95 -0
- package/src/evaluators/index.ts +12 -0
- package/src/evaluators/inline.test.ts +409 -0
- package/src/evaluators/inline.ts +393 -0
- package/src/evaluators/llm-grader.ts +45 -13
- package/src/evaluators/not-contains.test.ts +105 -0
- package/src/evaluators/not-contains.ts +45 -0
- package/src/evaluators/similarity.test.ts +333 -0
- package/src/evaluators/similarity.ts +258 -0
- package/src/index.ts +3 -0
- package/src/scenario/discovery.test.ts +153 -0
- package/src/scenario/discovery.ts +277 -0
- package/src/scenario/index.ts +1 -0
- package/src/scenario/schema.ts +47 -2
- package/src/storage/local.test.ts +243 -0
- package/src/storage/local.ts +162 -2
- package/src/storage/types.ts +73 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scenario discovery - find scenario files by directory scanning and glob patterns
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Options for scenario discovery
|
|
6
|
+
*/
|
|
7
|
+
export interface DiscoveryOptions {
|
|
8
|
+
/** File extensions to include (default: ['.yaml', '.yml']) */
|
|
9
|
+
extensions?: string[];
|
|
10
|
+
/** Maximum directory depth to scan (default: 10) */
|
|
11
|
+
maxDepth?: number;
|
|
12
|
+
/** Patterns to exclude (glob-like, e.g., 'node_modules', '*.draft.yaml') */
|
|
13
|
+
exclude?: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Discover scenario files in a directory
|
|
17
|
+
*
|
|
18
|
+
* @param dirPath - Path to the directory to scan
|
|
19
|
+
* @param options - Discovery options
|
|
20
|
+
* @returns Array of absolute paths to scenario files
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* // Scan a directory for all .yaml and .yml files
|
|
25
|
+
* const files = await discoverScenarios('./scenarios');
|
|
26
|
+
*
|
|
27
|
+
* // Scan with custom options
|
|
28
|
+
* const files = await discoverScenarios('./tests', {
|
|
29
|
+
* extensions: ['.yaml'],
|
|
30
|
+
* maxDepth: 3,
|
|
31
|
+
* exclude: ['drafts', '*.skip.yaml']
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function discoverScenarios(dirPath: string, options?: DiscoveryOptions): Promise<string[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Match scenario files using glob-like patterns
|
|
38
|
+
*
|
|
39
|
+
* Supports basic glob patterns:
|
|
40
|
+
* - `*` matches any characters except path separator
|
|
41
|
+
* - `**` matches any characters including path separator (recursive)
|
|
42
|
+
* - `?` matches single character
|
|
43
|
+
*
|
|
44
|
+
* @param pattern - Glob pattern to match
|
|
45
|
+
* @param basePath - Base path to resolve relative patterns (default: cwd)
|
|
46
|
+
* @returns Array of absolute paths to matching scenario files
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* // Match all yaml files in scenarios directory
|
|
51
|
+
* const files = await matchScenarioGlob('scenarios/*.yaml');
|
|
52
|
+
*
|
|
53
|
+
* // Match recursively
|
|
54
|
+
* const files = await matchScenarioGlob('tests/**\/*.yaml');
|
|
55
|
+
*
|
|
56
|
+
* // Match specific patterns
|
|
57
|
+
* const files = await matchScenarioGlob('scenarios/auth-*.yaml');
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function matchScenarioGlob(pattern: string, basePath?: string): Promise<string[]>;
|
|
61
|
+
/**
|
|
62
|
+
* Resolve a scenario path argument which can be:
|
|
63
|
+
* - A single file path
|
|
64
|
+
* - A directory path
|
|
65
|
+
* - A glob pattern
|
|
66
|
+
*
|
|
67
|
+
* @param pathArg - Path argument from CLI
|
|
68
|
+
* @param basePath - Base path for relative resolution
|
|
69
|
+
* @returns Array of resolved scenario file paths
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveScenarioPaths(pathArg: string, basePath?: string): Promise<string[]>;
|
|
72
|
+
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/scenario/discovery.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAiED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,MAAM,EAAE,CAAC,CAkBnB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,MAAsB,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CAmFnB;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,MAAsB,GAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CA0BnB"}
|
package/dist/scenario/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scenario/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scenario/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|