@artemiskit/sdk 0.3.1 → 0.4.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 +229 -0
- package/README.md +44 -1
- package/dist/artemiskit.d.ts +149 -0
- package/dist/artemiskit.d.ts.map +1 -0
- package/dist/builders/index.d.ts +352 -0
- package/dist/builders/index.d.ts.map +1 -0
- package/dist/builders/index.js +354 -0
- package/dist/contracts/index.d.ts +253 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +53 -0
- package/dist/guardian/action-validator.d.ts +92 -0
- package/dist/guardian/action-validator.d.ts.map +1 -0
- package/dist/guardian/circuit-breaker.d.ts +211 -0
- package/dist/guardian/circuit-breaker.d.ts.map +1 -0
- package/dist/guardian/guardian.d.ts +213 -0
- package/dist/guardian/guardian.d.ts.map +1 -0
- package/dist/guardian/guardrails.d.ts +107 -0
- package/dist/guardian/guardrails.d.ts.map +1 -0
- package/dist/guardian/index.d.ts +35 -0
- package/dist/guardian/index.d.ts.map +1 -0
- package/dist/guardian/intent-classifier.d.ts +81 -0
- package/dist/guardian/intent-classifier.d.ts.map +1 -0
- package/dist/guardian/interceptor.d.ts +141 -0
- package/dist/guardian/interceptor.d.ts.map +1 -0
- package/dist/guardian/policy.d.ts +52 -0
- package/dist/guardian/policy.d.ts.map +1 -0
- package/dist/guardian/semantic-validator.d.ts +61 -0
- package/dist/guardian/semantic-validator.d.ts.map +1 -0
- package/dist/guardian/types.d.ts +653 -0
- package/dist/guardian/types.d.ts.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44918 -28644
- package/dist/matchers/core.d.ts +81 -0
- package/dist/matchers/core.d.ts.map +1 -0
- package/dist/matchers/index.d.ts +6 -0
- package/dist/matchers/index.d.ts.map +1 -0
- package/dist/matchers/index.js +13 -59
- package/dist/matchers/jest.d.ts +46 -0
- package/dist/matchers/jest.d.ts.map +1 -0
- package/dist/matchers/jest.js +0 -46
- package/dist/matchers/vitest.d.ts +24 -0
- package/dist/matchers/vitest.d.ts.map +1 -0
- package/dist/matchers/vitest.js +0 -46
- package/dist/types-only.d.ts +31 -0
- package/dist/types-only.d.ts.map +1 -0
- package/dist/types-only.js +1 -0
- package/dist/types.d.ts +379 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/index.d.ts +112 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +58 -0
- package/package.json +19 -4
- package/src/__tests__/builders.test.ts +450 -0
- package/src/__tests__/circuit-breaker.test.ts +704 -0
- package/src/__tests__/compare.test.ts +469 -0
- package/src/__tests__/contracts.test.ts +354 -0
- package/src/__tests__/guardian-modes.test.ts +215 -0
- package/src/__tests__/guardrails.test.ts +404 -0
- package/src/__tests__/semantic-validator.test.ts +421 -0
- package/src/__tests__/utils.test.ts +324 -0
- package/src/__tests__/validate.test.ts +310 -0
- package/src/artemiskit.ts +479 -5
- package/src/builders/index.ts +700 -0
- package/src/contracts/index.ts +357 -0
- package/src/guardian/circuit-breaker.ts +74 -28
- package/src/guardian/guardian.ts +307 -20
- package/src/guardian/guardrails.ts +143 -1
- package/src/guardian/index.ts +35 -1
- package/src/guardian/interceptor.ts +87 -11
- package/src/guardian/semantic-validator.ts +399 -0
- package/src/guardian/types.ts +413 -2
- package/src/index.ts +258 -14
- package/src/types-only.ts +276 -0
- package/src/types.ts +186 -0
- package/src/utils/index.ts +225 -0
- package/tsconfig.json +2 -1
- package/adapters/openai/dist/index.js +0 -5625
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @artemiskit/sdk
|
|
3
|
+
* Core matcher implementations for Jest/Vitest integration
|
|
4
|
+
*/
|
|
5
|
+
import type { RedTeamResult, RunResult, StressResult } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* Matcher result interface compatible with Jest/Vitest
|
|
8
|
+
*/
|
|
9
|
+
export interface MatcherResult {
|
|
10
|
+
pass: boolean;
|
|
11
|
+
message: () => string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Check if a run result passed all test cases
|
|
15
|
+
*/
|
|
16
|
+
export declare function toPassAllCases(result: RunResult): MatcherResult;
|
|
17
|
+
/**
|
|
18
|
+
* Check if success rate meets threshold
|
|
19
|
+
*/
|
|
20
|
+
export declare function toHaveSuccessRate(result: RunResult, expectedRate: number): MatcherResult;
|
|
21
|
+
/**
|
|
22
|
+
* Check if all cases with specific tags passed
|
|
23
|
+
*/
|
|
24
|
+
export declare function toPassCasesWithTag(result: RunResult, tag: string): MatcherResult;
|
|
25
|
+
/**
|
|
26
|
+
* Check if median latency is within threshold
|
|
27
|
+
*/
|
|
28
|
+
export declare function toHaveMedianLatencyBelow(result: RunResult, maxLatencyMs: number): MatcherResult;
|
|
29
|
+
/**
|
|
30
|
+
* Check if P95 latency is within threshold
|
|
31
|
+
*/
|
|
32
|
+
export declare function toHaveP95LatencyBelow(result: RunResult, maxLatencyMs: number): MatcherResult;
|
|
33
|
+
/**
|
|
34
|
+
* Check if defense rate meets threshold
|
|
35
|
+
*/
|
|
36
|
+
export declare function toHaveDefenseRate(result: RedTeamResult, expectedRate: number): MatcherResult;
|
|
37
|
+
/**
|
|
38
|
+
* Check that no critical vulnerabilities were found
|
|
39
|
+
*/
|
|
40
|
+
export declare function toHaveNoCriticalVulnerabilities(result: RedTeamResult): MatcherResult;
|
|
41
|
+
/**
|
|
42
|
+
* Check that no high or critical vulnerabilities were found
|
|
43
|
+
*/
|
|
44
|
+
export declare function toHaveNoHighSeverityVulnerabilities(result: RedTeamResult): MatcherResult;
|
|
45
|
+
/**
|
|
46
|
+
* Check if red team test passed (default 95% defense rate)
|
|
47
|
+
*/
|
|
48
|
+
export declare function toPassRedTeam(result: RedTeamResult): MatcherResult;
|
|
49
|
+
/**
|
|
50
|
+
* Check if stress test success rate meets threshold
|
|
51
|
+
*/
|
|
52
|
+
export declare function toHaveStressSuccessRate(result: StressResult, expectedRate: number): MatcherResult;
|
|
53
|
+
/**
|
|
54
|
+
* Check if stress test achieved target RPS
|
|
55
|
+
*/
|
|
56
|
+
export declare function toAchieveRPS(result: StressResult, targetRPS: number): MatcherResult;
|
|
57
|
+
/**
|
|
58
|
+
* Check if stress test P95 latency is within threshold
|
|
59
|
+
*/
|
|
60
|
+
export declare function toHaveStressP95LatencyBelow(result: StressResult, maxLatencyMs: number): MatcherResult;
|
|
61
|
+
/**
|
|
62
|
+
* Check if stress test passed (default 95% success rate)
|
|
63
|
+
*/
|
|
64
|
+
export declare function toPassStressTest(result: StressResult): MatcherResult;
|
|
65
|
+
export declare const artemiskitMatchers: {
|
|
66
|
+
toPassAllCases: typeof toPassAllCases;
|
|
67
|
+
toHaveSuccessRate: typeof toHaveSuccessRate;
|
|
68
|
+
toPassCasesWithTag: typeof toPassCasesWithTag;
|
|
69
|
+
toHaveMedianLatencyBelow: typeof toHaveMedianLatencyBelow;
|
|
70
|
+
toHaveP95LatencyBelow: typeof toHaveP95LatencyBelow;
|
|
71
|
+
toHaveDefenseRate: typeof toHaveDefenseRate;
|
|
72
|
+
toHaveNoCriticalVulnerabilities: typeof toHaveNoCriticalVulnerabilities;
|
|
73
|
+
toHaveNoHighSeverityVulnerabilities: typeof toHaveNoHighSeverityVulnerabilities;
|
|
74
|
+
toPassRedTeam: typeof toPassRedTeam;
|
|
75
|
+
toHaveStressSuccessRate: typeof toHaveStressSuccessRate;
|
|
76
|
+
toAchieveRPS: typeof toAchieveRPS;
|
|
77
|
+
toHaveStressP95LatencyBelow: typeof toHaveStressP95LatencyBelow;
|
|
78
|
+
toPassStressTest: typeof toPassStressTest;
|
|
79
|
+
};
|
|
80
|
+
export type ArtemisKitMatchers = typeof artemiskitMatchers;
|
|
81
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/matchers/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA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CACzC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,MAAM,GACnB,aAAa,CAWf;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAiBpE;AAMD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;CAmB9B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @artemiskit/sdk
|
|
3
|
+
* Test matchers - core implementations without framework bindings
|
|
4
|
+
*/
|
|
5
|
+
export { artemiskitMatchers, type ArtemisKitMatchers, type MatcherResult, toPassAllCases, toHaveSuccessRate, toPassCasesWithTag, toHaveMedianLatencyBelow, toHaveP95LatencyBelow, toHaveDefenseRate, toHaveNoCriticalVulnerabilities, toHaveNoHighSeverityVulnerabilities, toPassRedTeam, toHaveStressSuccessRate, toAchieveRPS, toHaveStressP95LatencyBelow, toPassStressTest, } from './core';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/matchers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAElB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EAErB,iBAAiB,EACjB,+BAA+B,EAC/B,mCAAmC,EACnC,aAAa,EAEb,uBAAuB,EACvB,YAAY,EACZ,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,QAAQ,CAAC"}
|
package/dist/matchers/index.js
CHANGED
|
@@ -1,50 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
function __accessProp(key) {
|
|
8
|
-
return this[key];
|
|
9
|
-
}
|
|
10
|
-
var __toESMCache_node;
|
|
11
|
-
var __toESMCache_esm;
|
|
12
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
-
var canCache = mod != null && typeof mod === "object";
|
|
14
|
-
if (canCache) {
|
|
15
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
-
var cached = cache.get(mod);
|
|
17
|
-
if (cached)
|
|
18
|
-
return cached;
|
|
19
|
-
}
|
|
20
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
for (let key of __getOwnPropNames(mod))
|
|
23
|
-
if (!__hasOwnProp.call(to, key))
|
|
24
|
-
__defProp(to, key, {
|
|
25
|
-
get: __accessProp.bind(mod, key),
|
|
26
|
-
enumerable: true
|
|
27
|
-
});
|
|
28
|
-
if (canCache)
|
|
29
|
-
cache.set(mod, to);
|
|
30
|
-
return to;
|
|
31
|
-
};
|
|
32
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
33
|
-
var __returnValue = (v) => v;
|
|
34
|
-
function __exportSetter(name, newValue) {
|
|
35
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
36
|
-
}
|
|
37
|
-
var __export = (target, all) => {
|
|
38
|
-
for (var name in all)
|
|
39
|
-
__defProp(target, name, {
|
|
40
|
-
get: all[name],
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
set: __exportSetter.bind(all, name)
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
var __require = import.meta.require;
|
|
47
|
-
|
|
48
2
|
// src/matchers/core.ts
|
|
49
3
|
function formatManifestSummary(manifest) {
|
|
50
4
|
const { metrics } = manifest;
|
|
@@ -207,18 +161,18 @@ var artemiskitMatchers = {
|
|
|
207
161
|
toPassStressTest
|
|
208
162
|
};
|
|
209
163
|
export {
|
|
210
|
-
|
|
211
|
-
toPassRedTeam,
|
|
212
|
-
toPassCasesWithTag,
|
|
213
|
-
toPassAllCases,
|
|
214
|
-
toHaveSuccessRate,
|
|
215
|
-
toHaveStressSuccessRate,
|
|
216
|
-
toHaveStressP95LatencyBelow,
|
|
217
|
-
toHaveP95LatencyBelow,
|
|
218
|
-
toHaveNoHighSeverityVulnerabilities,
|
|
219
|
-
toHaveNoCriticalVulnerabilities,
|
|
220
|
-
toHaveMedianLatencyBelow,
|
|
221
|
-
toHaveDefenseRate,
|
|
164
|
+
artemiskitMatchers,
|
|
222
165
|
toAchieveRPS,
|
|
223
|
-
|
|
166
|
+
toHaveDefenseRate,
|
|
167
|
+
toHaveMedianLatencyBelow,
|
|
168
|
+
toHaveNoCriticalVulnerabilities,
|
|
169
|
+
toHaveNoHighSeverityVulnerabilities,
|
|
170
|
+
toHaveP95LatencyBelow,
|
|
171
|
+
toHaveStressP95LatencyBelow,
|
|
172
|
+
toHaveStressSuccessRate,
|
|
173
|
+
toHaveSuccessRate,
|
|
174
|
+
toPassAllCases,
|
|
175
|
+
toPassCasesWithTag,
|
|
176
|
+
toPassRedTeam,
|
|
177
|
+
toPassStressTest
|
|
224
178
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @artemiskit/sdk
|
|
3
|
+
* Jest integration - custom matchers for ArtemisKit
|
|
4
|
+
*/
|
|
5
|
+
import type { RedTeamResult, RunResult, StressResult } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* Jest matchers implementation
|
|
8
|
+
*/
|
|
9
|
+
export declare const jestMatchers: {
|
|
10
|
+
toPassAllCases(received: RunResult): import("./core").MatcherResult;
|
|
11
|
+
toHaveSuccessRate(received: RunResult, expectedRate: number): import("./core").MatcherResult;
|
|
12
|
+
toPassCasesWithTag(received: RunResult, tag: string): import("./core").MatcherResult;
|
|
13
|
+
toHaveMedianLatencyBelow(received: RunResult, maxLatencyMs: number): import("./core").MatcherResult;
|
|
14
|
+
toHaveP95LatencyBelow(received: RunResult, maxLatencyMs: number): import("./core").MatcherResult;
|
|
15
|
+
toHaveDefenseRate(received: RedTeamResult, expectedRate: number): import("./core").MatcherResult;
|
|
16
|
+
toHaveNoCriticalVulnerabilities(received: RedTeamResult): import("./core").MatcherResult;
|
|
17
|
+
toHaveNoHighSeverityVulnerabilities(received: RedTeamResult): import("./core").MatcherResult;
|
|
18
|
+
toPassRedTeam(received: RedTeamResult): import("./core").MatcherResult;
|
|
19
|
+
toHaveStressSuccessRate(received: StressResult, expectedRate: number): import("./core").MatcherResult;
|
|
20
|
+
toAchieveRPS(received: StressResult, targetRPS: number): import("./core").MatcherResult;
|
|
21
|
+
toHaveStressP95LatencyBelow(received: StressResult, maxLatencyMs: number): import("./core").MatcherResult;
|
|
22
|
+
toPassStressTest(received: StressResult): import("./core").MatcherResult;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* TypeScript declarations for Jest matchers
|
|
26
|
+
*/
|
|
27
|
+
declare global {
|
|
28
|
+
namespace jest {
|
|
29
|
+
interface Matchers<R> {
|
|
30
|
+
toPassAllCases(): R;
|
|
31
|
+
toHaveSuccessRate(expectedRate: number): R;
|
|
32
|
+
toPassCasesWithTag(tag: string): R;
|
|
33
|
+
toHaveMedianLatencyBelow(maxLatencyMs: number): R;
|
|
34
|
+
toHaveP95LatencyBelow(maxLatencyMs: number): R;
|
|
35
|
+
toHaveDefenseRate(expectedRate: number): R;
|
|
36
|
+
toHaveNoCriticalVulnerabilities(): R;
|
|
37
|
+
toHaveNoHighSeverityVulnerabilities(): R;
|
|
38
|
+
toPassRedTeam(): R;
|
|
39
|
+
toHaveStressSuccessRate(expectedRate: number): R;
|
|
40
|
+
toAchieveRPS(targetRPS: number): R;
|
|
41
|
+
toHaveStressP95LatencyBelow(maxLatencyMs: number): R;
|
|
42
|
+
toPassStressTest(): R;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=jest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.d.ts","sourceRoot":"","sources":["../../src/matchers/jest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAiBvE;;GAEG;AACH,eAAO,MAAM,YAAY;6BACE,SAAS;gCAIN,SAAS,gBAAgB,MAAM;iCAI9B,SAAS,OAAO,MAAM;uCAIhB,SAAS,gBAAgB,MAAM;oCAIlC,SAAS,gBAAgB,MAAM;gCAInC,aAAa,gBAAgB,MAAM;8CAIrB,aAAa;kDAIT,aAAa;4BAInC,aAAa;sCAIH,YAAY,gBAAgB,MAAM;2BAI7C,YAAY,aAAa,MAAM;0CAIhB,YAAY,gBAAgB,MAAM;+BAI7C,YAAY;CAGxC,CAAC;AAQF;;GAEG;AACH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,IAAI,CAAC;QACb,UAAU,QAAQ,CAAC,CAAC;YAElB,cAAc,IAAI,CAAC,CAAC;YACpB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,CAAC;YAC3C,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;YACnC,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,CAAC;YAClD,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,CAAC;YAG/C,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,CAAC;YAC3C,+BAA+B,IAAI,CAAC,CAAC;YACrC,mCAAmC,IAAI,CAAC,CAAC;YACzC,aAAa,IAAI,CAAC,CAAC;YAGnB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,CAAC;YACjD,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC,CAAC;YACnC,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,CAAC,CAAC;YACrD,gBAAgB,IAAI,CAAC,CAAC;SACvB;KACF;CACF"}
|
package/dist/matchers/jest.js
CHANGED
|
@@ -1,50 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
function __accessProp(key) {
|
|
8
|
-
return this[key];
|
|
9
|
-
}
|
|
10
|
-
var __toESMCache_node;
|
|
11
|
-
var __toESMCache_esm;
|
|
12
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
-
var canCache = mod != null && typeof mod === "object";
|
|
14
|
-
if (canCache) {
|
|
15
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
-
var cached = cache.get(mod);
|
|
17
|
-
if (cached)
|
|
18
|
-
return cached;
|
|
19
|
-
}
|
|
20
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
for (let key of __getOwnPropNames(mod))
|
|
23
|
-
if (!__hasOwnProp.call(to, key))
|
|
24
|
-
__defProp(to, key, {
|
|
25
|
-
get: __accessProp.bind(mod, key),
|
|
26
|
-
enumerable: true
|
|
27
|
-
});
|
|
28
|
-
if (canCache)
|
|
29
|
-
cache.set(mod, to);
|
|
30
|
-
return to;
|
|
31
|
-
};
|
|
32
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
33
|
-
var __returnValue = (v) => v;
|
|
34
|
-
function __exportSetter(name, newValue) {
|
|
35
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
36
|
-
}
|
|
37
|
-
var __export = (target, all) => {
|
|
38
|
-
for (var name in all)
|
|
39
|
-
__defProp(target, name, {
|
|
40
|
-
get: all[name],
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
set: __exportSetter.bind(all, name)
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
var __require = import.meta.require;
|
|
47
|
-
|
|
48
2
|
// src/matchers/core.ts
|
|
49
3
|
function formatManifestSummary(manifest) {
|
|
50
4
|
const { metrics } = manifest;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @artemiskit/sdk
|
|
3
|
+
* Vitest integration - custom matchers for ArtemisKit
|
|
4
|
+
*/
|
|
5
|
+
import type { RedTeamResult, RunResult, StressResult } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* Vitest matchers implementation
|
|
8
|
+
*/
|
|
9
|
+
export declare const vitestMatchers: {
|
|
10
|
+
toPassAllCases(received: RunResult): import("./core").MatcherResult;
|
|
11
|
+
toHaveSuccessRate(received: RunResult, expectedRate: number): import("./core").MatcherResult;
|
|
12
|
+
toPassCasesWithTag(received: RunResult, tag: string): import("./core").MatcherResult;
|
|
13
|
+
toHaveMedianLatencyBelow(received: RunResult, maxLatencyMs: number): import("./core").MatcherResult;
|
|
14
|
+
toHaveP95LatencyBelow(received: RunResult, maxLatencyMs: number): import("./core").MatcherResult;
|
|
15
|
+
toHaveDefenseRate(received: RedTeamResult, expectedRate: number): import("./core").MatcherResult;
|
|
16
|
+
toHaveNoCriticalVulnerabilities(received: RedTeamResult): import("./core").MatcherResult;
|
|
17
|
+
toHaveNoHighSeverityVulnerabilities(received: RedTeamResult): import("./core").MatcherResult;
|
|
18
|
+
toPassRedTeam(received: RedTeamResult): import("./core").MatcherResult;
|
|
19
|
+
toHaveStressSuccessRate(received: StressResult, expectedRate: number): import("./core").MatcherResult;
|
|
20
|
+
toAchieveRPS(received: StressResult, targetRPS: number): import("./core").MatcherResult;
|
|
21
|
+
toHaveStressP95LatencyBelow(received: StressResult, maxLatencyMs: number): import("./core").MatcherResult;
|
|
22
|
+
toPassStressTest(received: StressResult): import("./core").MatcherResult;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=vitest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vitest.d.ts","sourceRoot":"","sources":["../../src/matchers/vitest.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAiBvE;;GAEG;AACH,eAAO,MAAM,cAAc;6BACA,SAAS;gCAIN,SAAS,gBAAgB,MAAM;iCAI9B,SAAS,OAAO,MAAM;uCAIhB,SAAS,gBAAgB,MAAM;oCAIlC,SAAS,gBAAgB,MAAM;gCAInC,aAAa,gBAAgB,MAAM;8CAIrB,aAAa;kDAIT,aAAa;4BAInC,aAAa;sCAIH,YAAY,gBAAgB,MAAM;2BAI7C,YAAY,aAAa,MAAM;0CAIhB,YAAY,gBAAgB,MAAM;+BAI7C,YAAY;CAGxC,CAAC"}
|
package/dist/matchers/vitest.js
CHANGED
|
@@ -1,50 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
function __accessProp(key) {
|
|
8
|
-
return this[key];
|
|
9
|
-
}
|
|
10
|
-
var __toESMCache_node;
|
|
11
|
-
var __toESMCache_esm;
|
|
12
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
-
var canCache = mod != null && typeof mod === "object";
|
|
14
|
-
if (canCache) {
|
|
15
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
-
var cached = cache.get(mod);
|
|
17
|
-
if (cached)
|
|
18
|
-
return cached;
|
|
19
|
-
}
|
|
20
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
for (let key of __getOwnPropNames(mod))
|
|
23
|
-
if (!__hasOwnProp.call(to, key))
|
|
24
|
-
__defProp(to, key, {
|
|
25
|
-
get: __accessProp.bind(mod, key),
|
|
26
|
-
enumerable: true
|
|
27
|
-
});
|
|
28
|
-
if (canCache)
|
|
29
|
-
cache.set(mod, to);
|
|
30
|
-
return to;
|
|
31
|
-
};
|
|
32
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
33
|
-
var __returnValue = (v) => v;
|
|
34
|
-
function __exportSetter(name, newValue) {
|
|
35
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
36
|
-
}
|
|
37
|
-
var __export = (target, all) => {
|
|
38
|
-
for (var name in all)
|
|
39
|
-
__defProp(target, name, {
|
|
40
|
-
get: all[name],
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
set: __exportSetter.bind(all, name)
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
var __require = import.meta.require;
|
|
47
|
-
|
|
48
2
|
// src/matchers/core.ts
|
|
49
3
|
function formatManifestSummary(manifest) {
|
|
50
4
|
const { metrics } = manifest;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @artemiskit/sdk/types
|
|
3
|
+
* Types-only exports for consumers who only need type definitions
|
|
4
|
+
*
|
|
5
|
+
* Use this export when you only need types for type-checking
|
|
6
|
+
* without importing any runtime code.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import type {
|
|
11
|
+
* Scenario,
|
|
12
|
+
* TestCase,
|
|
13
|
+
* RunResult,
|
|
14
|
+
* ArtemisKitConfig
|
|
15
|
+
* } from '@artemiskit/sdk/types'
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export type { ArtemisKitConfig, RunOptions, RedTeamOptions, StressOptions, RunResult, RedTeamResult, StressResult, CaseStartEvent, CaseCompleteEvent, ProgressEvent, RedTeamMutationStartEvent, RedTeamMutationCompleteEvent, StressRequestCompleteEvent, CaseStartHandler, CaseCompleteHandler, ProgressHandler, RedTeamMutationStartHandler, RedTeamMutationCompleteHandler, StressRequestCompleteHandler, ArtemisKitEvents, ArtemisKitEventName, } from './types';
|
|
19
|
+
export type { Scenario, TestCase, Expected, Provider, ProviderConfig, ChatMessageType, Variables, } from '@artemiskit/core';
|
|
20
|
+
export type { CaseResult, CaseRedactionInfo, RunManifest, RunConfig, RunMetrics, RedTeamManifest, RedTeamConfig, RedTeamMetrics, RedTeamCaseResult, RedTeamStatus, RedTeamSeverity, StressManifest, StressConfig, StressMetrics, StressRequestResult, AnyManifest, ResolvedConfig, ConfigSource, ManifestRedactionInfo, CostEstimateInfo, GitInfo, ProvenanceInfo, } from '@artemiskit/core';
|
|
21
|
+
export type { ModelClient, ModelCapabilities, GenerateOptions, GenerateResult, TokenUsage, ChatMessage, FunctionDefinition, ToolDefinition, ToolCall, AdapterConfig, BaseAdapterConfig, OpenAIAdapterConfig, AzureOpenAIAdapterConfig, VercelAIAdapterConfig, AnthropicAdapterConfig, LangChainAdapterConfig, DeepAgentsAdapterConfig, ProviderType, } from '@artemiskit/core';
|
|
22
|
+
export type { Evaluator, EvaluatorContext, EvaluatorResult } from '@artemiskit/core';
|
|
23
|
+
export type { StorageAdapter, StorageConfig, RunListItem, ListOptions, ComparisonResult, BaselineMetadata, BaselineStorageAdapter, CaseResultRecord, CaseResultStatus, CaseResultQueryOptions, MetricsSnapshot, MetricsTrendOptions, TrendDataPoint, AnalyticsStorageAdapter, } from '@artemiskit/core';
|
|
24
|
+
export type { RedactionConfig } from '@artemiskit/core';
|
|
25
|
+
export type { Severity, SeverityInfo, CvssScore } from '@artemiskit/redteam';
|
|
26
|
+
export type { GuardianConfig, InterceptorConfig, ActionValidatorConfig, IntentClassifierConfig, GuardrailsConfig, RateLimiterConfig, GuardianMode, ViolationSeverity, ViolationAction, GuardrailType, Violation, GuardrailResult, PolicyRule, PolicyCondition, GuardianPolicy, CircuitBreakerConfig, RateLimitConfig, CostLimitConfig, ActionDefinition, ActionParameter, ParameterValidation, IntentClassification, IntentCategory, PIIDetection, PIIType, PIILocation, InjectionDetection, InjectionType, ContentFilterResult, ContentFlag, ContentCategory, GuardianMetrics, CircuitBreakerState, CostTracking, GuardianEventType, GuardianEvent, GuardianEventHandler, InterceptedRequest, InterceptedResponse, InterceptedToolCall, InterceptedAgentStep, FrameworkType, FrameworkIntegrationConfig, } from './guardian';
|
|
27
|
+
export type { ArtemisKitMatchers, MatcherResult } from './matchers';
|
|
28
|
+
export type { ProviderName, ExpectationType, AnyResult, ExtractRunCases, ExtractRedTeamCases, ExtractStressResults, ExtractManifest, DeepPartial, PartialScenario, RequireFields, OptionalFields, StrictAdapterConfig, } from './utils';
|
|
29
|
+
export type { AdapterContract, EvaluatorContract, StorageContract, AdapterFactory, EvaluatorFactory, StorageFactory, ArtemisKitPlugin, } from './contracts';
|
|
30
|
+
export type { ScenarioBuilder, TestCaseBuilder } from './builders';
|
|
31
|
+
//# sourceMappingURL=types-only.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-only.d.ts","sourceRoot":"","sources":["../src/types-only.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,YAAY,EAEV,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,aAAa,EAEb,SAAS,EACT,aAAa,EACb,YAAY,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