@artemiskit/core 0.1.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 +48 -0
- package/dist/adapters/factory.d.ts +23 -0
- package/dist/adapters/factory.d.ts.map +1 -0
- package/dist/adapters/index.d.ts +7 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/registry.d.ts +56 -0
- package/dist/adapters/registry.d.ts.map +1 -0
- package/dist/adapters/types.d.ts +151 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/artifacts/index.d.ts +6 -0
- package/dist/artifacts/index.d.ts.map +1 -0
- package/dist/artifacts/manifest.d.ts +19 -0
- package/dist/artifacts/manifest.d.ts.map +1 -0
- package/dist/artifacts/types.d.ts +368 -0
- package/dist/artifacts/types.d.ts.map +1 -0
- package/dist/evaluators/contains.d.ts +10 -0
- package/dist/evaluators/contains.d.ts.map +1 -0
- package/dist/evaluators/exact.d.ts +10 -0
- package/dist/evaluators/exact.d.ts.map +1 -0
- package/dist/evaluators/fuzzy.d.ts +10 -0
- package/dist/evaluators/fuzzy.d.ts.map +1 -0
- package/dist/evaluators/index.d.ts +24 -0
- package/dist/evaluators/index.d.ts.map +1 -0
- package/dist/evaluators/json-schema.d.ts +11 -0
- package/dist/evaluators/json-schema.d.ts.map +1 -0
- package/dist/evaluators/llm-grader.d.ts +11 -0
- package/dist/evaluators/llm-grader.d.ts.map +1 -0
- package/dist/evaluators/regex.d.ts +10 -0
- package/dist/evaluators/regex.d.ts.map +1 -0
- package/dist/evaluators/types.d.ts +29 -0
- package/dist/evaluators/types.d.ts.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26021 -0
- package/dist/provenance/environment.d.ts +12 -0
- package/dist/provenance/environment.d.ts.map +1 -0
- package/dist/provenance/git.d.ts +9 -0
- package/dist/provenance/git.d.ts.map +1 -0
- package/dist/provenance/index.d.ts +6 -0
- package/dist/provenance/index.d.ts.map +1 -0
- package/dist/redaction/index.d.ts +3 -0
- package/dist/redaction/index.d.ts.map +1 -0
- package/dist/redaction/redactor.d.ts +79 -0
- package/dist/redaction/redactor.d.ts.map +1 -0
- package/dist/redaction/types.d.ts +120 -0
- package/dist/redaction/types.d.ts.map +1 -0
- package/dist/runner/executor.d.ts +11 -0
- package/dist/runner/executor.d.ts.map +1 -0
- package/dist/runner/index.d.ts +7 -0
- package/dist/runner/index.d.ts.map +1 -0
- package/dist/runner/runner.d.ts +13 -0
- package/dist/runner/runner.d.ts.map +1 -0
- package/dist/runner/types.d.ts +57 -0
- package/dist/runner/types.d.ts.map +1 -0
- package/dist/scenario/index.d.ts +7 -0
- package/dist/scenario/index.d.ts.map +1 -0
- package/dist/scenario/parser.d.ts +17 -0
- package/dist/scenario/parser.d.ts.map +1 -0
- package/dist/scenario/schema.d.ts +945 -0
- package/dist/scenario/schema.d.ts.map +1 -0
- package/dist/scenario/variables.d.ts +19 -0
- package/dist/scenario/variables.d.ts.map +1 -0
- package/dist/storage/factory.d.ts +13 -0
- package/dist/storage/factory.d.ts.map +1 -0
- package/dist/storage/index.d.ts +8 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/local.d.ts +20 -0
- package/dist/storage/local.d.ts.map +1 -0
- package/dist/storage/supabase.d.ts +21 -0
- package/dist/storage/supabase.d.ts.map +1 -0
- package/dist/storage/types.d.ts +86 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/utils/errors.d.ts +25 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +21 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/package.json +56 -0
- package/src/adapters/factory.ts +75 -0
- package/src/adapters/index.ts +7 -0
- package/src/adapters/registry.ts +143 -0
- package/src/adapters/types.ts +184 -0
- package/src/artifacts/index.ts +6 -0
- package/src/artifacts/manifest.test.ts +206 -0
- package/src/artifacts/manifest.ts +136 -0
- package/src/artifacts/types.ts +426 -0
- package/src/evaluators/contains.test.ts +58 -0
- package/src/evaluators/contains.ts +41 -0
- package/src/evaluators/exact.test.ts +48 -0
- package/src/evaluators/exact.ts +33 -0
- package/src/evaluators/fuzzy.test.ts +50 -0
- package/src/evaluators/fuzzy.ts +39 -0
- package/src/evaluators/index.ts +53 -0
- package/src/evaluators/json-schema.ts +98 -0
- package/src/evaluators/llm-grader.ts +100 -0
- package/src/evaluators/regex.test.ts +73 -0
- package/src/evaluators/regex.ts +43 -0
- package/src/evaluators/types.ts +37 -0
- package/src/index.ts +31 -0
- package/src/provenance/environment.ts +18 -0
- package/src/provenance/git.ts +48 -0
- package/src/provenance/index.ts +6 -0
- package/src/redaction/index.ts +23 -0
- package/src/redaction/redactor.test.ts +258 -0
- package/src/redaction/redactor.ts +246 -0
- package/src/redaction/types.ts +135 -0
- package/src/runner/executor.ts +251 -0
- package/src/runner/index.ts +7 -0
- package/src/runner/runner.ts +153 -0
- package/src/runner/types.ts +60 -0
- package/src/scenario/index.ts +7 -0
- package/src/scenario/parser.test.ts +99 -0
- package/src/scenario/parser.ts +108 -0
- package/src/scenario/schema.ts +176 -0
- package/src/scenario/variables.test.ts +150 -0
- package/src/scenario/variables.ts +60 -0
- package/src/storage/factory.ts +52 -0
- package/src/storage/index.ts +8 -0
- package/src/storage/local.test.ts +165 -0
- package/src/storage/local.ts +194 -0
- package/src/storage/supabase.ts +151 -0
- package/src/storage/types.ts +98 -0
- package/src/utils/errors.ts +76 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/logger.ts +59 -0
- package/tsconfig.json +13 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/provenance/environment.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,kBAAkB,IAAI;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAMA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/provenance/git.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAoBpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provenance/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { BUILTIN_PATTERNS, BUILTIN_REGEX_PATTERNS, DEFAULT_REDACTION_PATTERNS, RedactionConfigSchema, type BuiltinPatternName, type CaseRedactionDetails, type RedactionConfig, type RedactionMetadata, type RedactionOptions, type RedactionResult, } from './types';
|
|
2
|
+
export { Redactor, createDefaultRedactor, createNoOpRedactor, createRedactionOptions, hashText, redactText, redactWithHash, resolvePatterns, } from './redactor';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/redaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,QAAQ,EACR,UAAU,EACV,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type RedactionConfig, type RedactionOptions, type RedactionResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve pattern strings to RegExp objects
|
|
4
|
+
* Supports built-in pattern names and custom regex strings
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolvePatterns(patterns: string[]): {
|
|
7
|
+
regex: RegExp;
|
|
8
|
+
name: string;
|
|
9
|
+
}[];
|
|
10
|
+
/**
|
|
11
|
+
* Create RedactionOptions from RedactionConfig
|
|
12
|
+
*/
|
|
13
|
+
export declare function createRedactionOptions(config: RedactionConfig): RedactionOptions;
|
|
14
|
+
/**
|
|
15
|
+
* Apply redaction to a text string
|
|
16
|
+
*/
|
|
17
|
+
export declare function redactText(text: string, patterns: (string | RegExp)[], replacement?: string): RedactionResult;
|
|
18
|
+
/**
|
|
19
|
+
* Generate a SHA-256 hash of the original text
|
|
20
|
+
* Useful for audit trails where you need to verify content without storing it
|
|
21
|
+
*/
|
|
22
|
+
export declare function hashText(text: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Redact text and return both redacted version and hash of original
|
|
25
|
+
*/
|
|
26
|
+
export declare function redactWithHash(text: string, patterns: (string | RegExp)[], replacement?: string): RedactionResult & {
|
|
27
|
+
originalHash: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Main Redactor class for applying redaction with consistent configuration
|
|
31
|
+
*/
|
|
32
|
+
export declare class Redactor {
|
|
33
|
+
private options;
|
|
34
|
+
private resolvedPatterns;
|
|
35
|
+
constructor(config: RedactionConfig);
|
|
36
|
+
/**
|
|
37
|
+
* Check if redaction is enabled
|
|
38
|
+
*/
|
|
39
|
+
get enabled(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Get pattern names being used
|
|
42
|
+
*/
|
|
43
|
+
get patternNames(): string[];
|
|
44
|
+
/**
|
|
45
|
+
* Get the replacement string
|
|
46
|
+
*/
|
|
47
|
+
get replacement(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Redact a prompt string
|
|
50
|
+
*/
|
|
51
|
+
redactPrompt(prompt: string): RedactionResult;
|
|
52
|
+
/**
|
|
53
|
+
* Redact a response string
|
|
54
|
+
*/
|
|
55
|
+
redactResponse(response: string): RedactionResult;
|
|
56
|
+
/**
|
|
57
|
+
* Redact metadata object values
|
|
58
|
+
*/
|
|
59
|
+
redactMetadata<T extends Record<string, unknown>>(metadata: T): T;
|
|
60
|
+
/**
|
|
61
|
+
* Redact any text with current configuration
|
|
62
|
+
*/
|
|
63
|
+
redact(text: string): RedactionResult;
|
|
64
|
+
/**
|
|
65
|
+
* Redact and get hash of original
|
|
66
|
+
*/
|
|
67
|
+
redactAndHash(text: string): RedactionResult & {
|
|
68
|
+
originalHash: string;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Create a no-op redactor that doesn't redact anything
|
|
73
|
+
*/
|
|
74
|
+
export declare function createNoOpRedactor(): Redactor;
|
|
75
|
+
/**
|
|
76
|
+
* Create a redactor with default patterns
|
|
77
|
+
*/
|
|
78
|
+
export declare function createDefaultRedactor(): Redactor;
|
|
79
|
+
//# sourceMappingURL=redactor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redactor.d.ts","sourceRoot":"","sources":["../../src/redaction/redactor.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CAmBrF;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,GAAG,gBAAgB,CAYhF;AAED;;GAEG;AACH,wB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
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Built-in redaction pattern names
|
|
4
|
+
*/
|
|
5
|
+
export declare const BUILTIN_PATTERNS: {
|
|
6
|
+
/** Email addresses */
|
|
7
|
+
readonly EMAIL: "email";
|
|
8
|
+
/** Phone numbers (various formats) */
|
|
9
|
+
readonly PHONE: "phone";
|
|
10
|
+
/** Credit card numbers */
|
|
11
|
+
readonly CREDIT_CARD: "credit_card";
|
|
12
|
+
/** Social Security Numbers */
|
|
13
|
+
readonly SSN: "ssn";
|
|
14
|
+
/** API keys (common formats) */
|
|
15
|
+
readonly API_KEY: "api_key";
|
|
16
|
+
/** IPv4 addresses */
|
|
17
|
+
readonly IPV4: "ipv4";
|
|
18
|
+
/** JWT tokens */
|
|
19
|
+
readonly JWT: "jwt";
|
|
20
|
+
/** AWS access keys */
|
|
21
|
+
readonly AWS_KEY: "aws_key";
|
|
22
|
+
/** Generic secrets (password=, secret=, etc.) */
|
|
23
|
+
readonly SECRETS: "secrets";
|
|
24
|
+
};
|
|
25
|
+
export type BuiltinPatternName = (typeof BUILTIN_PATTERNS)[keyof typeof BUILTIN_PATTERNS];
|
|
26
|
+
/**
|
|
27
|
+
* Regex patterns for built-in redaction
|
|
28
|
+
*/
|
|
29
|
+
export declare const BUILTIN_REGEX_PATTERNS: Record<BuiltinPatternName, RegExp>;
|
|
30
|
+
/**
|
|
31
|
+
* Default patterns to use when redaction is enabled without specific patterns
|
|
32
|
+
*/
|
|
33
|
+
export declare const DEFAULT_REDACTION_PATTERNS: BuiltinPatternName[];
|
|
34
|
+
/**
|
|
35
|
+
* Redaction configuration schema for scenarios
|
|
36
|
+
*/
|
|
37
|
+
export declare const RedactionConfigSchema: z.ZodObject<{
|
|
38
|
+
/** Enable redaction */
|
|
39
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
40
|
+
/** Built-in pattern names or custom regex patterns */
|
|
41
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
42
|
+
/** Redact prompt content */
|
|
43
|
+
redactPrompts: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
44
|
+
/** Redact response content */
|
|
45
|
+
redactResponses: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
46
|
+
/** Redact metadata fields */
|
|
47
|
+
redactMetadata: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
48
|
+
/** Custom replacement string */
|
|
49
|
+
replacement: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
redactPrompts: boolean;
|
|
53
|
+
redactResponses: boolean;
|
|
54
|
+
redactMetadata: boolean;
|
|
55
|
+
replacement: string;
|
|
56
|
+
patterns?: string[] | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
enabled?: boolean | undefined;
|
|
59
|
+
patterns?: string[] | undefined;
|
|
60
|
+
redactPrompts?: boolean | undefined;
|
|
61
|
+
redactResponses?: boolean | undefined;
|
|
62
|
+
redactMetadata?: boolean | undefined;
|
|
63
|
+
replacement?: string | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
export type RedactionConfig = z.infer<typeof RedactionConfigSchema>;
|
|
66
|
+
/**
|
|
67
|
+
* Redaction options used at runtime
|
|
68
|
+
*/
|
|
69
|
+
export interface RedactionOptions {
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
patterns: (string | RegExp)[];
|
|
72
|
+
redactPrompts: boolean;
|
|
73
|
+
redactResponses: boolean;
|
|
74
|
+
redactMetadata: boolean;
|
|
75
|
+
replacement: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Result of a redaction operation
|
|
79
|
+
*/
|
|
80
|
+
export interface RedactionResult {
|
|
81
|
+
/** The redacted text */
|
|
82
|
+
text: string;
|
|
83
|
+
/** Whether any redaction was applied */
|
|
84
|
+
wasRedacted: boolean;
|
|
85
|
+
/** Count of redactions made */
|
|
86
|
+
redactionCount: number;
|
|
87
|
+
/** Types of patterns that matched */
|
|
88
|
+
matchedPatterns: string[];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Metadata about redaction in a manifest
|
|
92
|
+
*/
|
|
93
|
+
export interface RedactionMetadata {
|
|
94
|
+
/** Whether redaction was enabled */
|
|
95
|
+
enabled: boolean;
|
|
96
|
+
/** Patterns used (names only, not actual regex) */
|
|
97
|
+
patternsUsed: string[];
|
|
98
|
+
/** Replacement string used */
|
|
99
|
+
replacement: string;
|
|
100
|
+
/** Summary of what was redacted */
|
|
101
|
+
summary: {
|
|
102
|
+
promptsRedacted: number;
|
|
103
|
+
responsesRedacted: number;
|
|
104
|
+
totalRedactions: number;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Redaction details for a single case result
|
|
109
|
+
*/
|
|
110
|
+
export interface CaseRedactionDetails {
|
|
111
|
+
/** Whether this case had redaction applied */
|
|
112
|
+
redacted: boolean;
|
|
113
|
+
/** Whether prompt was redacted */
|
|
114
|
+
promptRedacted: boolean;
|
|
115
|
+
/** Whether response was redacted */
|
|
116
|
+
responseRedacted: boolean;
|
|
117
|
+
/** Number of redactions in this case */
|
|
118
|
+
redactionCount: number;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/redaction/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B,sBAAsB;;IAEtB,sCAAsC;;IAEtC,0BAA0B;;IAE1B,8BAA8B;;IAE9B,gCAAgC;;IAEhC,qBAAqB;;IAErB,iBAAiB;;IAEjB,sBAAsB;;IAEtB,iDAAiD;;CAEzC,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,gBAAgB,CA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M,CAAC;KACzB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,8CAA8C;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,kCAAkC;IAClC,cAAc,EAAE,OAAO,CAAC;IACxB,oCAAoC;IACpC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test case executor
|
|
3
|
+
*/
|
|
4
|
+
import type { CaseResult } from '../artifacts/types';
|
|
5
|
+
import type { TestCase } from '../scenario/schema';
|
|
6
|
+
import type { ExecutorContext } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* Execute a single test case
|
|
9
|
+
*/
|
|
10
|
+
export declare function executeCase(testCase: TestCase, context: ExecutorContext): Promise<CaseResult>;
|
|
11
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/runner/executor.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAqB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAwE/C;;GAEG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,UAAU,CAAC,CAoCrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runner/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scenario runner - main entry point for running test scenarios
|
|
3
|
+
*/
|
|
4
|
+
import type { RunOptions, RunResult } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Run a test scenario
|
|
7
|
+
*/
|
|
8
|
+
export declare function runScenario(options: RunOptions): Promise<RunResult>;
|
|
9
|
+
/**
|
|
10
|
+
* Run multiple scenarios
|
|
11
|
+
*/
|
|
12
|
+
export declare function runScenarios(optionsList: RunOptions[]): Promise<RunResult[]>;
|
|
13
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/runner/runner.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAErD;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAqHzE;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CASlF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runner types and interfaces
|
|
3
|
+
*/
|
|
4
|
+
import type { ModelClient } from '../adapters/types';
|
|
5
|
+
import type { CaseResult, ResolvedConfig, RunManifest } from '../artifacts/types';
|
|
6
|
+
import type { RedactionConfig } from '../redaction/types';
|
|
7
|
+
import type { Scenario } from '../scenario/schema';
|
|
8
|
+
/**
|
|
9
|
+
* Options for running a scenario
|
|
10
|
+
*/
|
|
11
|
+
export interface RunOptions {
|
|
12
|
+
/** The scenario to run */
|
|
13
|
+
scenario: Scenario;
|
|
14
|
+
/** Model client to use */
|
|
15
|
+
client: ModelClient;
|
|
16
|
+
/** Project name for the manifest */
|
|
17
|
+
project?: string;
|
|
18
|
+
/** Resolved configuration with source tracking */
|
|
19
|
+
resolvedConfig?: ResolvedConfig;
|
|
20
|
+
/** Filter cases by tags */
|
|
21
|
+
tags?: string[];
|
|
22
|
+
/** Number of concurrent requests */
|
|
23
|
+
concurrency?: number;
|
|
24
|
+
/** Timeout per case in milliseconds */
|
|
25
|
+
timeout?: number;
|
|
26
|
+
/** Number of retries per case */
|
|
27
|
+
retries?: number;
|
|
28
|
+
/** Redaction configuration (CLI overrides scenario) */
|
|
29
|
+
redaction?: RedactionConfig;
|
|
30
|
+
/** Callback for each case result */
|
|
31
|
+
onCaseComplete?: (result: CaseResult, index: number, total: number) => void;
|
|
32
|
+
/** Callback for progress updates */
|
|
33
|
+
onProgress?: (message: string) => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Result of a scenario run
|
|
37
|
+
*/
|
|
38
|
+
export interface RunResult {
|
|
39
|
+
/** The generated manifest */
|
|
40
|
+
manifest: RunManifest;
|
|
41
|
+
/** Individual case results */
|
|
42
|
+
cases: CaseResult[];
|
|
43
|
+
/** Whether all cases passed */
|
|
44
|
+
success: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Context passed to case executor
|
|
48
|
+
*/
|
|
49
|
+
export interface ExecutorContext {
|
|
50
|
+
client: ModelClient;
|
|
51
|
+
scenario: Scenario;
|
|
52
|
+
timeout?: number;
|
|
53
|
+
retries?: number;
|
|
54
|
+
/** Redaction configuration for this execution */
|
|
55
|
+
redaction?: RedactionConfig;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/runner/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,E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,CAAC,EAAE,eAAe,CAAC;CAC7B"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scenario parser for YAML files
|
|
3
|
+
*/
|
|
4
|
+
import { type Scenario } from './schema';
|
|
5
|
+
/**
|
|
6
|
+
* Parse a scenario from a YAML file
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseScenarioFile(filePath: string): Promise<Scenario>;
|
|
9
|
+
/**
|
|
10
|
+
* Parse a scenario from a YAML string
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseScenarioString(content: string, source?: string): Scenario;
|
|
13
|
+
/**
|
|
14
|
+
* Validate a scenario object
|
|
15
|
+
*/
|
|
16
|
+
export declare function validateScenario(scenario: unknown): Scenario;
|
|
17
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/scenario/parser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,UAAU,CAAC;AA6BzD;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAY3E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAgC9E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAc5D"}
|