promptfoo 0.112.5 → 0.112.7
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/dist/package.json +13 -13
- package/dist/src/app/assets/{index-CtILcypo.js → index-hWJZsnu2.js} +141 -141
- package/dist/src/app/assets/{index.es-D1K8VDHD.js → index.es-Dr2D4Md0.js} +1 -1
- package/dist/src/app/assets/{source-map-support-C0aSbjFf.js → source-map-support-DvBN-NgF.js} +1 -1
- package/dist/src/app/assets/{sync-BE-MyvTb.js → sync-CL_B8KZP.js} +1 -1
- package/dist/src/app/index.html +1 -1
- package/dist/src/commands/eval.d.ts.map +1 -1
- package/dist/src/commands/eval.js +5 -0
- package/dist/src/commands/eval.js.map +1 -1
- package/dist/src/evaluatorHelpers.d.ts.map +1 -1
- package/dist/src/evaluatorHelpers.js +18 -1
- package/dist/src/evaluatorHelpers.js.map +1 -1
- package/dist/src/matchers.d.ts.map +1 -1
- package/dist/src/matchers.js +20 -2
- package/dist/src/matchers.js.map +1 -1
- package/dist/src/providers/anthropic/messages.d.ts.map +1 -1
- package/dist/src/providers/anthropic/messages.js +1 -0
- package/dist/src/providers/anthropic/messages.js.map +1 -1
- package/dist/src/providers/azure/chat.d.ts +0 -1
- package/dist/src/providers/azure/chat.d.ts.map +1 -1
- package/dist/src/providers/azure/chat.js +1 -1
- package/dist/src/providers/azure/chat.js.map +1 -1
- package/dist/src/providers/bedrock.d.ts.map +1 -1
- package/dist/src/providers/bedrock.js +1 -0
- package/dist/src/providers/bedrock.js.map +1 -1
- package/dist/src/providers/google/ai.studio.d.ts.map +1 -1
- package/dist/src/providers/google/ai.studio.js +1 -0
- package/dist/src/providers/google/ai.studio.js.map +1 -1
- package/dist/src/providers/google/vertex.d.ts.map +1 -1
- package/dist/src/providers/google/vertex.js +1 -0
- package/dist/src/providers/google/vertex.js.map +1 -1
- package/dist/src/providers/mcp/client.d.ts +3 -0
- package/dist/src/providers/mcp/client.d.ts.map +1 -1
- package/dist/src/providers/mcp/client.js +68 -9
- package/dist/src/providers/mcp/client.js.map +1 -1
- package/dist/src/providers/openai/chat.d.ts.map +1 -1
- package/dist/src/providers/openai/chat.js +1 -0
- package/dist/src/providers/openai/chat.js.map +1 -1
- package/dist/src/providers/perplexity.d.ts +75 -0
- package/dist/src/providers/perplexity.d.ts.map +1 -0
- package/dist/src/providers/perplexity.js +154 -0
- package/dist/src/providers/perplexity.js.map +1 -0
- package/dist/src/providers/registry.d.ts.map +1 -1
- package/dist/src/providers/registry.js +4 -9
- package/dist/src/providers/registry.js.map +1 -1
- package/dist/src/providers/scriptBasedProvider.js +1 -1
- package/dist/src/providers/scriptBasedProvider.js.map +1 -1
- package/dist/src/redteam/commands/generate.d.ts.map +1 -1
- package/dist/src/redteam/commands/generate.js +13 -0
- package/dist/src/redteam/commands/generate.js.map +1 -1
- package/dist/src/redteam/constants.d.ts +20 -5
- package/dist/src/redteam/constants.d.ts.map +1 -1
- package/dist/src/redteam/constants.js +97 -6
- package/dist/src/redteam/constants.js.map +1 -1
- package/dist/src/redteam/graders.d.ts.map +1 -1
- package/dist/src/redteam/graders.js +3 -0
- package/dist/src/redteam/graders.js.map +1 -1
- package/dist/src/redteam/index.d.ts.map +1 -1
- package/dist/src/redteam/index.js +1 -1
- package/dist/src/redteam/index.js.map +1 -1
- package/dist/src/redteam/plugins/harmful/graders.d.ts +4 -0
- package/dist/src/redteam/plugins/harmful/graders.d.ts.map +1 -1
- package/dist/src/redteam/plugins/harmful/graders.js +49 -1
- package/dist/src/redteam/plugins/harmful/graders.js.map +1 -1
- package/dist/src/redteam/plugins/index.d.ts.map +1 -1
- package/dist/src/redteam/plugins/index.js +2 -0
- package/dist/src/redteam/plugins/index.js.map +1 -1
- package/dist/src/redteam/plugins/mcp.d.ts +14 -0
- package/dist/src/redteam/plugins/mcp.d.ts.map +1 -0
- package/dist/src/redteam/plugins/mcp.js +64 -0
- package/dist/src/redteam/plugins/mcp.js.map +1 -0
- package/dist/src/redteam/providers/crescendo/index.d.ts +2 -1
- package/dist/src/redteam/providers/crescendo/index.d.ts.map +1 -1
- package/dist/src/redteam/providers/crescendo/index.js +11 -14
- package/dist/src/redteam/providers/crescendo/index.js.map +1 -1
- package/dist/src/redteam/providers/goat.d.ts +6 -0
- package/dist/src/redteam/providers/goat.d.ts.map +1 -1
- package/dist/src/redteam/providers/goat.js +36 -2
- package/dist/src/redteam/providers/goat.js.map +1 -1
- package/dist/src/redteam/providers/iterativeTree.d.ts +13 -7
- package/dist/src/redteam/providers/iterativeTree.d.ts.map +1 -1
- package/dist/src/redteam/providers/iterativeTree.js +49 -27
- package/dist/src/redteam/providers/iterativeTree.js.map +1 -1
- package/dist/src/redteam/types.d.ts +1 -0
- package/dist/src/redteam/types.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +10 -10
- package/dist/src/util/file.d.ts +1 -2
- package/dist/src/util/file.d.ts.map +1 -1
- package/dist/src/util/file.js +4 -7
- package/dist/src/util/file.js.map +1 -1
- package/dist/src/util/formatDuration.d.ts +7 -0
- package/dist/src/util/formatDuration.d.ts.map +1 -0
- package/dist/src/util/formatDuration.js +27 -0
- package/dist/src/util/formatDuration.js.map +1 -0
- package/dist/src/validators/redteam.d.ts +5 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
|
@@ -23720,7 +23720,6 @@ export declare const TestSuiteConfigSchema: z.ZodObject<{
|
|
|
23720
23720
|
})[];
|
|
23721
23721
|
maxConcurrency?: number | undefined;
|
|
23722
23722
|
entities?: string[] | undefined;
|
|
23723
|
-
numTests?: number | undefined;
|
|
23724
23723
|
provider?: string | {
|
|
23725
23724
|
id?: string | undefined;
|
|
23726
23725
|
config?: any;
|
|
@@ -23825,6 +23824,7 @@ export declare const TestSuiteConfigSchema: z.ZodObject<{
|
|
|
23825
23824
|
callClassificationApi?: ((args_0: string, ...args: unknown[]) => Promise<import("./providers").ProviderClassificationResponse>) | undefined;
|
|
23826
23825
|
} | undefined;
|
|
23827
23826
|
delay?: number | undefined;
|
|
23827
|
+
numTests?: number | undefined;
|
|
23828
23828
|
injectVar?: string | undefined;
|
|
23829
23829
|
language?: string | undefined;
|
|
23830
23830
|
purpose?: string | undefined;
|
|
@@ -23837,7 +23837,6 @@ export declare const TestSuiteConfigSchema: z.ZodObject<{
|
|
|
23837
23837
|
})[] | undefined;
|
|
23838
23838
|
maxConcurrency?: number | undefined;
|
|
23839
23839
|
entities?: string[] | undefined;
|
|
23840
|
-
numTests?: number | undefined;
|
|
23841
23840
|
provider?: string | {
|
|
23842
23841
|
id?: string | undefined;
|
|
23843
23842
|
config?: any;
|
|
@@ -23942,6 +23941,7 @@ export declare const TestSuiteConfigSchema: z.ZodObject<{
|
|
|
23942
23941
|
callClassificationApi?: ((args_0: string, ...args: unknown[]) => Promise<import("./providers").ProviderClassificationResponse>) | undefined;
|
|
23943
23942
|
} | undefined;
|
|
23944
23943
|
delay?: number | undefined;
|
|
23944
|
+
numTests?: number | undefined;
|
|
23945
23945
|
injectVar?: string | undefined;
|
|
23946
23946
|
language?: string | undefined;
|
|
23947
23947
|
purpose?: string | undefined;
|
|
@@ -23958,7 +23958,6 @@ export declare const TestSuiteConfigSchema: z.ZodObject<{
|
|
|
23958
23958
|
})[] | undefined;
|
|
23959
23959
|
maxConcurrency?: number | undefined;
|
|
23960
23960
|
entities?: string[] | undefined;
|
|
23961
|
-
numTests?: number | undefined;
|
|
23962
23961
|
provider?: string | {
|
|
23963
23962
|
id?: string | undefined;
|
|
23964
23963
|
config?: any;
|
|
@@ -24063,6 +24062,7 @@ export declare const TestSuiteConfigSchema: z.ZodObject<{
|
|
|
24063
24062
|
callClassificationApi?: ((args_0: string, ...args: unknown[]) => Promise<import("./providers").ProviderClassificationResponse>) | undefined;
|
|
24064
24063
|
} | undefined;
|
|
24065
24064
|
delay?: number | undefined;
|
|
24065
|
+
numTests?: number | undefined;
|
|
24066
24066
|
injectVar?: string | undefined;
|
|
24067
24067
|
language?: string | undefined;
|
|
24068
24068
|
purpose?: string | undefined;
|
|
@@ -25637,7 +25637,6 @@ export declare const TestSuiteConfigSchema: z.ZodObject<{
|
|
|
25637
25637
|
})[] | undefined;
|
|
25638
25638
|
maxConcurrency?: number | undefined;
|
|
25639
25639
|
entities?: string[] | undefined;
|
|
25640
|
-
numTests?: number | undefined;
|
|
25641
25640
|
provider?: string | {
|
|
25642
25641
|
id?: string | undefined;
|
|
25643
25642
|
config?: any;
|
|
@@ -25742,6 +25741,7 @@ export declare const TestSuiteConfigSchema: z.ZodObject<{
|
|
|
25742
25741
|
callClassificationApi?: ((args_0: string, ...args: unknown[]) => Promise<import("./providers").ProviderClassificationResponse>) | undefined;
|
|
25743
25742
|
} | undefined;
|
|
25744
25743
|
delay?: number | undefined;
|
|
25744
|
+
numTests?: number | undefined;
|
|
25745
25745
|
injectVar?: string | undefined;
|
|
25746
25746
|
language?: string | undefined;
|
|
25747
25747
|
purpose?: string | undefined;
|
|
@@ -32120,7 +32120,6 @@ export declare const UnifiedConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
|
|
|
32120
32120
|
})[];
|
|
32121
32121
|
maxConcurrency?: number | undefined;
|
|
32122
32122
|
entities?: string[] | undefined;
|
|
32123
|
-
numTests?: number | undefined;
|
|
32124
32123
|
provider?: string | {
|
|
32125
32124
|
id?: string | undefined;
|
|
32126
32125
|
config?: any;
|
|
@@ -32225,6 +32224,7 @@ export declare const UnifiedConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
|
|
|
32225
32224
|
callClassificationApi?: ((args_0: string, ...args: unknown[]) => Promise<import("./providers").ProviderClassificationResponse>) | undefined;
|
|
32226
32225
|
} | undefined;
|
|
32227
32226
|
delay?: number | undefined;
|
|
32227
|
+
numTests?: number | undefined;
|
|
32228
32228
|
injectVar?: string | undefined;
|
|
32229
32229
|
language?: string | undefined;
|
|
32230
32230
|
purpose?: string | undefined;
|
|
@@ -32237,7 +32237,6 @@ export declare const UnifiedConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
|
|
|
32237
32237
|
})[] | undefined;
|
|
32238
32238
|
maxConcurrency?: number | undefined;
|
|
32239
32239
|
entities?: string[] | undefined;
|
|
32240
|
-
numTests?: number | undefined;
|
|
32241
32240
|
provider?: string | {
|
|
32242
32241
|
id?: string | undefined;
|
|
32243
32242
|
config?: any;
|
|
@@ -32342,6 +32341,7 @@ export declare const UnifiedConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
|
|
|
32342
32341
|
callClassificationApi?: ((args_0: string, ...args: unknown[]) => Promise<import("./providers").ProviderClassificationResponse>) | undefined;
|
|
32343
32342
|
} | undefined;
|
|
32344
32343
|
delay?: number | undefined;
|
|
32344
|
+
numTests?: number | undefined;
|
|
32345
32345
|
injectVar?: string | undefined;
|
|
32346
32346
|
language?: string | undefined;
|
|
32347
32347
|
purpose?: string | undefined;
|
|
@@ -32358,7 +32358,6 @@ export declare const UnifiedConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
|
|
|
32358
32358
|
})[] | undefined;
|
|
32359
32359
|
maxConcurrency?: number | undefined;
|
|
32360
32360
|
entities?: string[] | undefined;
|
|
32361
|
-
numTests?: number | undefined;
|
|
32362
32361
|
provider?: string | {
|
|
32363
32362
|
id?: string | undefined;
|
|
32364
32363
|
config?: any;
|
|
@@ -32463,6 +32462,7 @@ export declare const UnifiedConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
|
|
|
32463
32462
|
callClassificationApi?: ((args_0: string, ...args: unknown[]) => Promise<import("./providers").ProviderClassificationResponse>) | undefined;
|
|
32464
32463
|
} | undefined;
|
|
32465
32464
|
delay?: number | undefined;
|
|
32465
|
+
numTests?: number | undefined;
|
|
32466
32466
|
injectVar?: string | undefined;
|
|
32467
32467
|
language?: string | undefined;
|
|
32468
32468
|
purpose?: string | undefined;
|
|
@@ -36836,7 +36836,6 @@ export declare const UnifiedConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
|
|
|
36836
36836
|
})[] | undefined;
|
|
36837
36837
|
maxConcurrency?: number | undefined;
|
|
36838
36838
|
entities?: string[] | undefined;
|
|
36839
|
-
numTests?: number | undefined;
|
|
36840
36839
|
provider?: string | {
|
|
36841
36840
|
id?: string | undefined;
|
|
36842
36841
|
config?: any;
|
|
@@ -36941,6 +36940,7 @@ export declare const UnifiedConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
|
|
|
36941
36940
|
callClassificationApi?: ((args_0: string, ...args: unknown[]) => Promise<import("./providers").ProviderClassificationResponse>) | undefined;
|
|
36942
36941
|
} | undefined;
|
|
36943
36942
|
delay?: number | undefined;
|
|
36943
|
+
numTests?: number | undefined;
|
|
36944
36944
|
injectVar?: string | undefined;
|
|
36945
36945
|
language?: string | undefined;
|
|
36946
36946
|
purpose?: string | undefined;
|
|
@@ -39691,7 +39691,6 @@ export declare const UnifiedConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
|
|
|
39691
39691
|
})[] | undefined;
|
|
39692
39692
|
maxConcurrency?: number | undefined;
|
|
39693
39693
|
entities?: string[] | undefined;
|
|
39694
|
-
numTests?: number | undefined;
|
|
39695
39694
|
provider?: string | {
|
|
39696
39695
|
id?: string | undefined;
|
|
39697
39696
|
config?: any;
|
|
@@ -39796,6 +39795,7 @@ export declare const UnifiedConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
|
|
|
39796
39795
|
callClassificationApi?: ((args_0: string, ...args: unknown[]) => Promise<import("./providers").ProviderClassificationResponse>) | undefined;
|
|
39797
39796
|
} | undefined;
|
|
39798
39797
|
delay?: number | undefined;
|
|
39798
|
+
numTests?: number | undefined;
|
|
39799
39799
|
injectVar?: string | undefined;
|
|
39800
39800
|
language?: string | undefined;
|
|
39801
39801
|
purpose?: string | undefined;
|
|
@@ -42546,7 +42546,6 @@ export declare const UnifiedConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
|
|
|
42546
42546
|
})[] | undefined;
|
|
42547
42547
|
maxConcurrency?: number | undefined;
|
|
42548
42548
|
entities?: string[] | undefined;
|
|
42549
|
-
numTests?: number | undefined;
|
|
42550
42549
|
provider?: string | {
|
|
42551
42550
|
id?: string | undefined;
|
|
42552
42551
|
config?: any;
|
|
@@ -42651,6 +42650,7 @@ export declare const UnifiedConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
|
|
|
42651
42650
|
callClassificationApi?: ((args_0: string, ...args: unknown[]) => Promise<import("./providers").ProviderClassificationResponse>) | undefined;
|
|
42652
42651
|
} | undefined;
|
|
42653
42652
|
delay?: number | undefined;
|
|
42653
|
+
numTests?: number | undefined;
|
|
42654
42654
|
injectVar?: string | undefined;
|
|
42655
42655
|
language?: string | undefined;
|
|
42656
42656
|
purpose?: string | undefined;
|
package/dist/src/util/file.d.ts
CHANGED
|
@@ -22,9 +22,8 @@ export declare function maybeLoadFromExternalFile(filePath: string | object | Fu
|
|
|
22
22
|
* When using a cloud configuration, the current working directory is always used instead of the context's base path.
|
|
23
23
|
*
|
|
24
24
|
* @param filePath - The relative or absolute file path to resolve.
|
|
25
|
-
* @param contextBasePath - The base path from the context (typically the directory containing the config file).
|
|
26
25
|
* @param isCloudConfig - Whether this is a cloud configuration.
|
|
27
26
|
* @returns The resolved absolute file path.
|
|
28
27
|
*/
|
|
29
|
-
export declare function getResolvedRelativePath(filePath: string,
|
|
28
|
+
export declare function getResolvedRelativePath(filePath: string, isCloudConfig?: boolean): string;
|
|
30
29
|
//# sourceMappingURL=file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/util/file.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAIhC;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,QAAQ,CAAC,WAAW,CAYnE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,OAuChG;AAED
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/util/file.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAIhC;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,QAAQ,CAAC,WAAW,CAYnE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,OAuChG;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAQzF"}
|
package/dist/src/util/file.js
CHANGED
|
@@ -113,18 +113,15 @@ function maybeLoadFromExternalFile(filePath) {
|
|
|
113
113
|
* When using a cloud configuration, the current working directory is always used instead of the context's base path.
|
|
114
114
|
*
|
|
115
115
|
* @param filePath - The relative or absolute file path to resolve.
|
|
116
|
-
* @param contextBasePath - The base path from the context (typically the directory containing the config file).
|
|
117
116
|
* @param isCloudConfig - Whether this is a cloud configuration.
|
|
118
117
|
* @returns The resolved absolute file path.
|
|
119
118
|
*/
|
|
120
|
-
function getResolvedRelativePath(filePath,
|
|
121
|
-
// If it's already an absolute path, return it as is
|
|
122
|
-
if (path.isAbsolute(filePath)) {
|
|
119
|
+
function getResolvedRelativePath(filePath, isCloudConfig) {
|
|
120
|
+
// If it's already an absolute path, or not a cloud config, return it as is
|
|
121
|
+
if (path.isAbsolute(filePath) || !isCloudConfig) {
|
|
123
122
|
return filePath;
|
|
124
123
|
}
|
|
125
|
-
// If using a cloud config, always use process.cwd() instead of contextBasePath
|
|
126
|
-
const basePath = isCloudConfig === true ? process.cwd() : contextBasePath || process.cwd();
|
|
127
124
|
// Join the basePath and filePath to get the resolved path
|
|
128
|
-
return path.join(
|
|
125
|
+
return path.join(process.cwd(), filePath);
|
|
129
126
|
}
|
|
130
127
|
//# sourceMappingURL=file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../../src/util/file.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,oEAYC;AAcD,8DAuCC;
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../../src/util/file.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,oEAYC;AAcD,8DAuCC;AAUD,0DAQC;AA9FD,yCAAmD;AACnD,uCAAyB;AACzB,sDAA2B;AAC3B,wDAAgC;AAChC,2CAA6B;AAC7B,2DAAmC;AAEnC;;;GAGG;AACH,SAAgB,4BAA4B;IAC1C,MAAM,GAAG,GAAG,kBAAQ,CAAC,SAAS,CAAC;QAC7B,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;IAEH,gDAAgD;IAChD,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE;QACnB,GAAG,OAAO,CAAC,GAAG;QACd,GAAG,kBAAQ,CAAC,MAAM,EAAE,GAAG;KACxB,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,yBAAyB,CAAC,QAAuD;IAC/F,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC3B,MAAM,OAAO,GAAQ,yBAAyB,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACpC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,sCAAsC;IACtC,MAAM,gBAAgB,GAAG,4BAA4B,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAEnF,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAQ,CAAC,QAAQ,IAAI,EAAE,EAAE,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAClG,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpD,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9D,OAAO,iBAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,IAAA,YAAQ,EAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,2CAA2C;QAC3C,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAA8B,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnF,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CAAC,QAAgB,EAAE,aAAuB;IAC/E,2EAA2E;IAC3E,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QAChD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,0DAA0D;IAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a duration in seconds into a human-readable string
|
|
3
|
+
* @param seconds Total duration in seconds
|
|
4
|
+
* @returns Formatted string like "2h 5m 30s" or "45s" depending on duration
|
|
5
|
+
*/
|
|
6
|
+
export declare function formatDuration(seconds: number): string;
|
|
7
|
+
//# sourceMappingURL=formatDuration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDuration.d.ts","sourceRoot":"","sources":["../../../src/util/formatDuration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAwBtD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatDuration = formatDuration;
|
|
4
|
+
/**
|
|
5
|
+
* Formats a duration in seconds into a human-readable string
|
|
6
|
+
* @param seconds Total duration in seconds
|
|
7
|
+
* @returns Formatted string like "2h 5m 30s" or "45s" depending on duration
|
|
8
|
+
*/
|
|
9
|
+
function formatDuration(seconds) {
|
|
10
|
+
const totalSeconds = Math.floor(seconds);
|
|
11
|
+
if (totalSeconds < 60) {
|
|
12
|
+
return `${totalSeconds}s`;
|
|
13
|
+
}
|
|
14
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
15
|
+
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
|
16
|
+
const remainingSeconds = totalSeconds % 60;
|
|
17
|
+
let result = '';
|
|
18
|
+
if (hours > 0) {
|
|
19
|
+
result += `${hours}h `;
|
|
20
|
+
}
|
|
21
|
+
if (minutes > 0 || hours > 0) {
|
|
22
|
+
result += `${minutes}m `;
|
|
23
|
+
}
|
|
24
|
+
result += `${remainingSeconds}s`;
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=formatDuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatDuration.js","sourceRoot":"","sources":["../../../src/util/formatDuration.ts"],"names":[],"mappings":";;AAKA,wCAwBC;AA7BD;;;;GAIG;AACH,SAAgB,cAAc,CAAC,OAAe;IAC5C,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEzC,IAAI,YAAY,GAAG,EAAE,EAAE,CAAC;QACtB,OAAO,GAAG,YAAY,GAAG,CAAC;IAC5B,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACvD,MAAM,gBAAgB,GAAG,YAAY,GAAG,EAAE,CAAC;IAE3C,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,MAAM,IAAI,GAAG,KAAK,IAAI,CAAC;IACzB,CAAC;IAED,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC;IAC3B,CAAC;IAED,MAAM,IAAI,GAAG,gBAAgB,GAAG,CAAC;IAEjC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -110,9 +110,9 @@ export declare const RedteamGenerateOptionsSchema: z.ZodObject<{
|
|
|
110
110
|
output?: string | undefined;
|
|
111
111
|
burpEscapeJson?: boolean | undefined;
|
|
112
112
|
progressBar?: boolean | undefined;
|
|
113
|
-
numTests?: number | undefined;
|
|
114
113
|
provider?: string | undefined;
|
|
115
114
|
delay?: number | undefined;
|
|
115
|
+
numTests?: number | undefined;
|
|
116
116
|
addPlugins?: string[] | undefined;
|
|
117
117
|
addStrategies?: string[] | undefined;
|
|
118
118
|
injectVar?: string | undefined;
|
|
@@ -139,9 +139,9 @@ export declare const RedteamGenerateOptionsSchema: z.ZodObject<{
|
|
|
139
139
|
force?: boolean | undefined;
|
|
140
140
|
burpEscapeJson?: boolean | undefined;
|
|
141
141
|
progressBar?: boolean | undefined;
|
|
142
|
-
numTests?: number | undefined;
|
|
143
142
|
provider?: string | undefined;
|
|
144
143
|
delay?: number | undefined;
|
|
144
|
+
numTests?: number | undefined;
|
|
145
145
|
addPlugins?: string[] | undefined;
|
|
146
146
|
addStrategies?: string[] | undefined;
|
|
147
147
|
injectVar?: string | undefined;
|
|
@@ -676,7 +676,6 @@ export declare const RedteamConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
676
676
|
})[];
|
|
677
677
|
maxConcurrency?: number | undefined;
|
|
678
678
|
entities?: string[] | undefined;
|
|
679
|
-
numTests?: number | undefined;
|
|
680
679
|
provider?: string | {
|
|
681
680
|
id?: string | undefined;
|
|
682
681
|
config?: any;
|
|
@@ -781,6 +780,7 @@ export declare const RedteamConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
781
780
|
callClassificationApi?: ((args_0: string, ...args: unknown[]) => Promise<import("..").ProviderClassificationResponse>) | undefined;
|
|
782
781
|
} | undefined;
|
|
783
782
|
delay?: number | undefined;
|
|
783
|
+
numTests?: number | undefined;
|
|
784
784
|
injectVar?: string | undefined;
|
|
785
785
|
language?: string | undefined;
|
|
786
786
|
purpose?: string | undefined;
|
|
@@ -793,7 +793,6 @@ export declare const RedteamConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
793
793
|
})[] | undefined;
|
|
794
794
|
maxConcurrency?: number | undefined;
|
|
795
795
|
entities?: string[] | undefined;
|
|
796
|
-
numTests?: number | undefined;
|
|
797
796
|
provider?: string | {
|
|
798
797
|
id?: string | undefined;
|
|
799
798
|
config?: any;
|
|
@@ -898,6 +897,7 @@ export declare const RedteamConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
898
897
|
callClassificationApi?: ((args_0: string, ...args: unknown[]) => Promise<import("..").ProviderClassificationResponse>) | undefined;
|
|
899
898
|
} | undefined;
|
|
900
899
|
delay?: number | undefined;
|
|
900
|
+
numTests?: number | undefined;
|
|
901
901
|
injectVar?: string | undefined;
|
|
902
902
|
language?: string | undefined;
|
|
903
903
|
purpose?: string | undefined;
|
|
@@ -914,7 +914,6 @@ export declare const RedteamConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
914
914
|
})[] | undefined;
|
|
915
915
|
maxConcurrency?: number | undefined;
|
|
916
916
|
entities?: string[] | undefined;
|
|
917
|
-
numTests?: number | undefined;
|
|
918
917
|
provider?: string | {
|
|
919
918
|
id?: string | undefined;
|
|
920
919
|
config?: any;
|
|
@@ -1019,6 +1018,7 @@ export declare const RedteamConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1019
1018
|
callClassificationApi?: ((args_0: string, ...args: unknown[]) => Promise<import("..").ProviderClassificationResponse>) | undefined;
|
|
1020
1019
|
} | undefined;
|
|
1021
1020
|
delay?: number | undefined;
|
|
1021
|
+
numTests?: number | undefined;
|
|
1022
1022
|
injectVar?: string | undefined;
|
|
1023
1023
|
language?: string | undefined;
|
|
1024
1024
|
purpose?: string | undefined;
|