promptfoo 0.113.0 → 0.113.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/dist/package.json +28 -30
- package/dist/src/app/assets/{index-BBF3o-At.js → index-DDgDcSbp.js} +176 -176
- package/dist/src/app/assets/{index.es-CIVyj4Ly.js → index.es-CTuWilQA.js} +1 -1
- package/dist/src/app/assets/{source-map-support-DmE-TbSd.js → source-map-support-CMD9DZ3t.js} +1 -1
- package/dist/src/app/assets/{sync-DKyeSqmb.js → sync-DXeGLZqh.js} +1 -1
- package/dist/src/app/index.html +1 -1
- package/dist/src/commands/auth.d.ts.map +1 -1
- package/dist/src/commands/auth.js +2 -0
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/cache.d.ts.map +1 -1
- package/dist/src/commands/cache.js +1 -0
- package/dist/src/commands/cache.js.map +1 -1
- package/dist/src/commands/config.d.ts.map +1 -1
- package/dist/src/commands/config.js +3 -0
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/delete.d.ts.map +1 -1
- package/dist/src/commands/delete.js +1 -0
- package/dist/src/commands/delete.js.map +1 -1
- package/dist/src/commands/eval.d.ts.map +1 -1
- package/dist/src/commands/eval.js +2 -0
- package/dist/src/commands/eval.js.map +1 -1
- package/dist/src/commands/export.d.ts.map +1 -1
- package/dist/src/commands/export.js +1 -0
- package/dist/src/commands/export.js.map +1 -1
- package/dist/src/commands/generate/dataset.d.ts.map +1 -1
- package/dist/src/commands/generate/dataset.js +2 -0
- package/dist/src/commands/generate/dataset.js.map +1 -1
- package/dist/src/commands/import.d.ts.map +1 -1
- package/dist/src/commands/import.js +1 -0
- package/dist/src/commands/import.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +1 -0
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/list.d.ts.map +1 -1
- package/dist/src/commands/list.js +3 -0
- package/dist/src/commands/list.js.map +1 -1
- package/dist/src/commands/share.d.ts.map +1 -1
- package/dist/src/commands/share.js +3 -2
- package/dist/src/commands/share.js.map +1 -1
- package/dist/src/commands/show.d.ts.map +1 -1
- package/dist/src/commands/show.js +4 -0
- package/dist/src/commands/show.js.map +1 -1
- package/dist/src/commands/view.d.ts.map +1 -1
- package/dist/src/commands/view.js +1 -0
- package/dist/src/commands/view.js.map +1 -1
- package/dist/src/configTypes.d.ts +0 -1
- package/dist/src/configTypes.d.ts.map +1 -1
- package/dist/src/evaluator.js +1 -1
- package/dist/src/evaluator.js.map +1 -1
- package/dist/src/evaluatorHelpers.js +3 -3
- package/dist/src/evaluatorHelpers.js.map +1 -1
- package/dist/src/globalConfig/accounts.d.ts.map +1 -1
- package/dist/src/globalConfig/accounts.js +0 -1
- package/dist/src/globalConfig/accounts.js.map +1 -1
- package/dist/src/globalConfig/globalConfig.d.ts +1 -1
- package/dist/src/globalConfig/globalConfig.d.ts.map +1 -1
- package/dist/src/globalConfig/globalConfig.js +9 -17
- package/dist/src/globalConfig/globalConfig.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/main.js +1 -1
- package/dist/src/main.js.map +1 -1
- package/dist/src/onboarding.js +1 -1
- package/dist/src/onboarding.js.map +1 -1
- package/dist/src/providers/bam.d.ts +22 -16
- package/dist/src/providers/bam.d.ts.map +1 -1
- package/dist/src/providers/bedrock.js +1 -1
- package/dist/src/providers/bedrock.js.map +1 -1
- package/dist/src/providers/bedrockKnowledgeBase.js +1 -1
- package/dist/src/providers/bedrockKnowledgeBase.js.map +1 -1
- package/dist/src/providers/http.d.ts.map +1 -1
- package/dist/src/providers/http.js +17 -5
- package/dist/src/providers/http.js.map +1 -1
- package/dist/src/providers/sagemaker.js +1 -1
- package/dist/src/providers/sagemaker.js.map +1 -1
- package/dist/src/redteam/commands/discover.d.ts +117 -79
- package/dist/src/redteam/commands/discover.d.ts.map +1 -1
- package/dist/src/redteam/commands/discover.js +139 -179
- package/dist/src/redteam/commands/discover.js.map +1 -1
- package/dist/src/redteam/commands/generate.d.ts.map +1 -1
- package/dist/src/redteam/commands/generate.js +10 -11
- package/dist/src/redteam/commands/generate.js.map +1 -1
- package/dist/src/redteam/commands/init.js +1 -1
- package/dist/src/redteam/commands/init.js.map +1 -1
- package/dist/src/redteam/commands/poison.d.ts.map +1 -1
- package/dist/src/redteam/commands/poison.js +1 -0
- package/dist/src/redteam/commands/poison.js.map +1 -1
- package/dist/src/redteam/commands/report.d.ts.map +1 -1
- package/dist/src/redteam/commands/report.js +1 -0
- package/dist/src/redteam/commands/report.js.map +1 -1
- package/dist/src/redteam/commands/run.d.ts.map +1 -1
- package/dist/src/redteam/commands/run.js +1 -0
- package/dist/src/redteam/commands/run.js.map +1 -1
- package/dist/src/redteam/commands/setup.d.ts.map +1 -1
- package/dist/src/redteam/commands/setup.js +1 -0
- package/dist/src/redteam/commands/setup.js.map +1 -1
- package/dist/src/redteam/constants.d.ts +1 -1
- package/dist/src/redteam/constants.d.ts.map +1 -1
- package/dist/src/redteam/constants.js +1 -1
- package/dist/src/redteam/constants.js.map +1 -1
- package/dist/src/redteam/index.d.ts.map +1 -1
- package/dist/src/redteam/index.js +11 -9
- package/dist/src/redteam/index.js.map +1 -1
- package/dist/src/redteam/plugins/index.js +1 -1
- package/dist/src/redteam/plugins/index.js.map +1 -1
- package/dist/src/redteam/plugins/intent.d.ts +1 -1
- package/dist/src/redteam/plugins/intent.d.ts.map +1 -1
- package/dist/src/redteam/plugins/intent.js +44 -22
- package/dist/src/redteam/plugins/intent.js.map +1 -1
- package/dist/src/redteam/providers/crescendo/index.d.ts.map +1 -1
- package/dist/src/redteam/providers/crescendo/index.js +7 -2
- package/dist/src/redteam/providers/crescendo/index.js.map +1 -1
- package/dist/src/redteam/providers/goat.js +1 -1
- package/dist/src/redteam/providers/goat.js.map +1 -1
- package/dist/src/redteam/providers/iterative.d.ts.map +1 -1
- package/dist/src/redteam/providers/iterative.js +1 -1
- package/dist/src/redteam/providers/iterative.js.map +1 -1
- package/dist/src/redteam/providers/iterativeTree.js +1 -1
- package/dist/src/redteam/providers/iterativeTree.js.map +1 -1
- package/dist/src/server/routes/user.js +1 -1
- package/dist/src/server/routes/user.js.map +1 -1
- package/dist/src/server/server.js +1 -1
- package/dist/src/server/server.js.map +1 -1
- package/dist/src/telemetry.d.ts +12 -6
- package/dist/src/telemetry.d.ts.map +1 -1
- package/dist/src/telemetry.js +75 -78
- package/dist/src/telemetry.js.map +1 -1
- package/dist/src/util/config/load.js +4 -4
- package/dist/src/util/config/load.js.map +1 -1
- package/dist/src/util/testCaseReader.js +9 -9
- package/dist/src/util/testCaseReader.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +28 -30
|
@@ -1,97 +1,135 @@
|
|
|
1
1
|
import { type Command } from 'commander';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type { ApiProvider } from '../../types';
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
target: z.ZodOptional<z.ZodString>;
|
|
8
|
-
preview: z.ZodBoolean;
|
|
9
|
-
turns: z.ZodOptional<z.ZodNumber>;
|
|
10
|
-
overwrite: z.ZodBoolean;
|
|
3
|
+
import type { ApiProvider, Prompt, UnifiedConfig } from '../../types';
|
|
4
|
+
export declare const TargetPurposeDiscoveryStateSchema: z.ZodObject<{
|
|
5
|
+
currentQuestionIndex: z.ZodNumber;
|
|
6
|
+
answers: z.ZodArray<z.ZodString, "many">;
|
|
11
7
|
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
config?: string | undefined;
|
|
15
|
-
output?: string | undefined;
|
|
16
|
-
target?: string | undefined;
|
|
17
|
-
turns?: number | undefined;
|
|
8
|
+
currentQuestionIndex: number;
|
|
9
|
+
answers: string[];
|
|
18
10
|
}, {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
11
|
+
currentQuestionIndex: number;
|
|
12
|
+
answers: string[];
|
|
13
|
+
}>;
|
|
14
|
+
export declare const TargetPurposeDiscoveryRequestSchema: z.ZodObject<{
|
|
15
|
+
state: z.ZodObject<{
|
|
16
|
+
currentQuestionIndex: z.ZodNumber;
|
|
17
|
+
answers: z.ZodArray<z.ZodString, "many">;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
currentQuestionIndex: number;
|
|
20
|
+
answers: string[];
|
|
21
|
+
}, {
|
|
22
|
+
currentQuestionIndex: number;
|
|
23
|
+
answers: string[];
|
|
24
|
+
}>;
|
|
25
|
+
task: z.ZodLiteral<"target-purpose-discovery">;
|
|
26
|
+
version: z.ZodString;
|
|
27
|
+
email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
version: string;
|
|
30
|
+
state: {
|
|
31
|
+
currentQuestionIndex: number;
|
|
32
|
+
answers: string[];
|
|
33
|
+
};
|
|
34
|
+
task: "target-purpose-discovery";
|
|
35
|
+
email?: string | null | undefined;
|
|
32
36
|
}, {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
version: string;
|
|
38
|
+
state: {
|
|
39
|
+
currentQuestionIndex: number;
|
|
40
|
+
answers: string[];
|
|
41
|
+
};
|
|
42
|
+
task: "target-purpose-discovery";
|
|
43
|
+
email?: string | null | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const DiscoveredPurposeSchema: z.ZodObject<{
|
|
46
|
+
purpose: z.ZodNullable<z.ZodString>;
|
|
47
|
+
limitations: z.ZodNullable<z.ZodString>;
|
|
48
|
+
user: z.ZodNullable<z.ZodString>;
|
|
49
|
+
tools: z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
purpose: string | null;
|
|
52
|
+
user: string | null;
|
|
53
|
+
tools: Record<string, any>[] | null;
|
|
54
|
+
limitations: string | null;
|
|
46
55
|
}, {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
purpose: string | null;
|
|
57
|
+
user: string | null;
|
|
58
|
+
tools: Record<string, any>[] | null;
|
|
59
|
+
limitations: string | null;
|
|
60
|
+
}>;
|
|
61
|
+
export declare const TargetPurposeDiscoveryResponseSchema: z.ZodObject<{
|
|
62
|
+
done: z.ZodBoolean;
|
|
63
|
+
question: z.ZodOptional<z.ZodString>;
|
|
64
|
+
purpose: z.ZodOptional<z.ZodObject<{
|
|
65
|
+
purpose: z.ZodNullable<z.ZodString>;
|
|
66
|
+
limitations: z.ZodNullable<z.ZodString>;
|
|
67
|
+
user: z.ZodNullable<z.ZodString>;
|
|
68
|
+
tools: z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>, "many">>;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
purpose: string | null;
|
|
71
|
+
user: string | null;
|
|
72
|
+
tools: Record<string, any>[] | null;
|
|
73
|
+
limitations: string | null;
|
|
74
|
+
}, {
|
|
75
|
+
purpose: string | null;
|
|
76
|
+
user: string | null;
|
|
77
|
+
tools: Record<string, any>[] | null;
|
|
78
|
+
limitations: string | null;
|
|
79
|
+
}>>;
|
|
80
|
+
state: z.ZodObject<{
|
|
81
|
+
currentQuestionIndex: z.ZodNumber;
|
|
82
|
+
answers: z.ZodArray<z.ZodString, "many">;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
currentQuestionIndex: number;
|
|
85
|
+
answers: string[];
|
|
86
|
+
}, {
|
|
87
|
+
currentQuestionIndex: number;
|
|
88
|
+
answers: string[];
|
|
89
|
+
}>;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
done: boolean;
|
|
92
|
+
state: {
|
|
93
|
+
currentQuestionIndex: number;
|
|
94
|
+
answers: string[];
|
|
95
|
+
};
|
|
96
|
+
purpose?: {
|
|
97
|
+
purpose: string | null;
|
|
98
|
+
user: string | null;
|
|
99
|
+
tools: Record<string, any>[] | null;
|
|
100
|
+
limitations: string | null;
|
|
101
|
+
} | undefined;
|
|
102
|
+
question?: string | undefined;
|
|
60
103
|
}, {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
104
|
+
done: boolean;
|
|
105
|
+
state: {
|
|
106
|
+
currentQuestionIndex: number;
|
|
107
|
+
answers: string[];
|
|
108
|
+
};
|
|
109
|
+
purpose?: {
|
|
110
|
+
purpose: string | null;
|
|
111
|
+
user: string | null;
|
|
112
|
+
tools: Record<string, any>[] | null;
|
|
113
|
+
limitations: string | null;
|
|
114
|
+
} | undefined;
|
|
115
|
+
question?: string | undefined;
|
|
116
|
+
}>;
|
|
117
|
+
export type DiscoveredPurpose = z.infer<typeof DiscoveredPurposeSchema>;
|
|
118
|
+
export declare const ArgsSchema: z.ZodEffects<z.ZodObject<{
|
|
119
|
+
config: z.ZodOptional<z.ZodString>;
|
|
120
|
+
target: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
122
|
config?: string | undefined;
|
|
71
|
-
output?: string | undefined;
|
|
72
123
|
target?: string | undefined;
|
|
73
|
-
turns?: number | undefined;
|
|
74
124
|
}, {
|
|
75
|
-
preview: boolean;
|
|
76
|
-
overwrite: boolean;
|
|
77
125
|
config?: string | undefined;
|
|
78
|
-
output?: string | undefined;
|
|
79
126
|
target?: string | undefined;
|
|
80
|
-
turns?: number | undefined;
|
|
81
127
|
}>, {
|
|
82
|
-
preview: boolean;
|
|
83
|
-
overwrite: boolean;
|
|
84
128
|
config?: string | undefined;
|
|
85
|
-
output?: string | undefined;
|
|
86
129
|
target?: string | undefined;
|
|
87
|
-
turns?: number | undefined;
|
|
88
130
|
}, {
|
|
89
|
-
preview: boolean;
|
|
90
|
-
overwrite: boolean;
|
|
91
131
|
config?: string | undefined;
|
|
92
|
-
output?: string | undefined;
|
|
93
132
|
target?: string | undefined;
|
|
94
|
-
turns?: number | undefined;
|
|
95
133
|
}>;
|
|
96
134
|
export declare const DEFAULT_TURN_COUNT = 5;
|
|
97
135
|
/**
|
|
@@ -102,10 +140,10 @@ export declare const DEFAULT_TURN_COUNT = 5;
|
|
|
102
140
|
* @param maxTurns - The maximum number of turns to run the discovery process.
|
|
103
141
|
* @returns The purpose of the target.
|
|
104
142
|
*/
|
|
105
|
-
export declare function doTargetPurposeDiscovery(target: ApiProvider,
|
|
106
|
-
export declare function mergePurposes(humanDefinedPurpose: string, discoveredPurpose: string): string;
|
|
143
|
+
export declare function doTargetPurposeDiscovery(target: ApiProvider, prompt?: Prompt): Promise<DiscoveredPurpose | undefined>;
|
|
144
|
+
export declare function mergePurposes(humanDefinedPurpose: string | undefined, discoveredPurpose: Record<string, any> | undefined): string;
|
|
107
145
|
/**
|
|
108
146
|
* Registers the `discover` command with the CLI.
|
|
109
147
|
*/
|
|
110
|
-
export declare function discoverCommand(program: Command): void;
|
|
148
|
+
export declare function discoverCommand(program: Command, defaultConfig: Partial<UnifiedConfig>, defaultConfigPath: string | undefined): void;
|
|
111
149
|
//# sourceMappingURL=discover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../../../src/redteam/commands/discover.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../../../src/redteam/commands/discover.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAOtE,eAAO,MAAM,iCAAiC;;;;;;;;;EAG5C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK9C,CAAC;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAKlC,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK/C,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;EASnB,CAAC;AAOL,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,WAAW,EACnB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CA2GxC;AAED,wBAAgB,aAAa,CAC3B,mBAAmB,EAAE,MAAM,GAAG,SAAS,EACvC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,UAqBnD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,EACrC,iBAAiB,EAAE,MAAM,GAAG,SAAS,QAqItC"}
|