@langwatch/scenario 0.2.2 → 0.2.9

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/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
- import * as zod from 'zod';
2
- import { z } from 'zod';
3
1
  import * as ai from 'ai';
4
- import { CoreMessage, CoreToolMessage, LanguageModel } from 'ai';
2
+ import { CoreMessage, CoreUserMessage, CoreAssistantMessage, CoreToolMessage, LanguageModel } from 'ai';
3
+ import { z } from 'zod';
5
4
  import { Observable } from 'rxjs';
6
5
 
7
6
  declare enum AgentRole {
@@ -121,6 +120,8 @@ declare abstract class JudgeAgentAdapter implements AgentAdapter {
121
120
  abstract call(input: AgentInput): Promise<AgentReturnTypes>;
122
121
  }
123
122
 
123
+ declare const DEFAULT_MAX_TURNS = 10;
124
+ declare const DEFAULT_VERBOSE = false;
124
125
  /**
125
126
  * Configuration for a scenario.
126
127
  */
@@ -147,11 +148,19 @@ interface ScenarioConfig {
147
148
  */
148
149
  script?: ScriptStep[];
149
150
  /**
150
- * Whether to output verbose logging. Defaults to false.
151
+ * Whether to output verbose logging.
152
+ *
153
+ * If no value is provided, this defaults to {@link DEFAULT_VERBOSE}.
154
+ *
155
+ * @default {@link DEFAULT_VERBOSE}
151
156
  */
152
157
  verbose?: boolean;
153
158
  /**
154
- * The maximum number of turns to execute. Defaults to 20.
159
+ * The maximum number of turns to execute.
160
+ *
161
+ * If no value is provided, this defaults to {@link DEFAULT_MAX_TURNS}.
162
+ *
163
+ * @default {@link DEFAULT_MAX_TURNS}
155
164
  */
156
165
  maxTurns?: number;
157
166
  /**
@@ -322,7 +331,12 @@ interface ScenarioExecutionStateLike {
322
331
  * Retrieves the last user message from the execution state.
323
332
  * @returns The last user message.
324
333
  */
325
- lastUserMessage(): CoreMessage;
334
+ lastUserMessage(): CoreUserMessage;
335
+ /**
336
+ * Retrieves the last agent message from the execution state.
337
+ * @returns The last agent message.
338
+ */
339
+ lastAgentMessage(): CoreAssistantMessage;
326
340
  /**
327
341
  * Retrieves the last tool call message for a specific tool.
328
342
  * @param toolName - The name of the tool.
@@ -369,6 +383,33 @@ declare const scenarioProjectConfigSchema: z.ZodObject<{
369
383
  type ScenarioProjectConfig = z.infer<typeof scenarioProjectConfigSchema>;
370
384
  declare function defineConfig(config: ScenarioProjectConfig): ScenarioProjectConfig;
371
385
 
386
+ type domain_AgentAdapter = AgentAdapter;
387
+ declare const domain_AgentAdapter: typeof AgentAdapter;
388
+ type domain_AgentInput = AgentInput;
389
+ type domain_AgentReturnTypes = AgentReturnTypes;
390
+ type domain_AgentRole = AgentRole;
391
+ declare const domain_AgentRole: typeof AgentRole;
392
+ declare const domain_DEFAULT_MAX_TURNS: typeof DEFAULT_MAX_TURNS;
393
+ declare const domain_DEFAULT_TEMPERATURE: typeof DEFAULT_TEMPERATURE;
394
+ declare const domain_DEFAULT_VERBOSE: typeof DEFAULT_VERBOSE;
395
+ type domain_JudgeAgentAdapter = JudgeAgentAdapter;
396
+ declare const domain_JudgeAgentAdapter: typeof JudgeAgentAdapter;
397
+ type domain_ScenarioConfig = ScenarioConfig;
398
+ type domain_ScenarioConfigFinal = ScenarioConfigFinal;
399
+ type domain_ScenarioExecutionLike = ScenarioExecutionLike;
400
+ type domain_ScenarioExecutionStateLike = ScenarioExecutionStateLike;
401
+ type domain_ScenarioProjectConfig = ScenarioProjectConfig;
402
+ type domain_ScenarioResult = ScenarioResult;
403
+ type domain_ScriptStep = ScriptStep;
404
+ type domain_UserSimulatorAgentAdapter = UserSimulatorAgentAdapter;
405
+ declare const domain_UserSimulatorAgentAdapter: typeof UserSimulatorAgentAdapter;
406
+ declare const domain_allAgentRoles: typeof allAgentRoles;
407
+ declare const domain_defineConfig: typeof defineConfig;
408
+ declare const domain_scenarioProjectConfigSchema: typeof scenarioProjectConfigSchema;
409
+ declare namespace domain {
410
+ export { domain_AgentAdapter as AgentAdapter, type domain_AgentInput as AgentInput, type domain_AgentReturnTypes as AgentReturnTypes, domain_AgentRole as AgentRole, domain_DEFAULT_MAX_TURNS as DEFAULT_MAX_TURNS, domain_DEFAULT_TEMPERATURE as DEFAULT_TEMPERATURE, domain_DEFAULT_VERBOSE as DEFAULT_VERBOSE, domain_JudgeAgentAdapter as JudgeAgentAdapter, type domain_ScenarioConfig as ScenarioConfig, type domain_ScenarioConfigFinal as ScenarioConfigFinal, type domain_ScenarioExecutionLike as ScenarioExecutionLike, type domain_ScenarioExecutionStateLike as ScenarioExecutionStateLike, type domain_ScenarioProjectConfig as ScenarioProjectConfig, type domain_ScenarioResult as ScenarioResult, type domain_ScriptStep as ScriptStep, domain_UserSimulatorAgentAdapter as UserSimulatorAgentAdapter, domain_allAgentRoles as allAgentRoles, domain_defineConfig as defineConfig, domain_scenarioProjectConfigSchema as scenarioProjectConfigSchema };
411
+ }
412
+
372
413
  /**
373
414
  * Configuration for the inference parameters of a testing agent.
374
415
  */
@@ -593,6 +634,16 @@ declare const userSimulatorAgent: (config?: TestingAgentConfig) => {
593
634
  }>;
594
635
  };
595
636
 
637
+ type agents_FinishTestArgs = FinishTestArgs;
638
+ type agents_JudgeAgentConfig = JudgeAgentConfig;
639
+ type agents_TestingAgentConfig = TestingAgentConfig;
640
+ type agents_TestingAgentInferenceConfig = TestingAgentInferenceConfig;
641
+ declare const agents_judgeAgent: typeof judgeAgent;
642
+ declare const agents_userSimulatorAgent: typeof userSimulatorAgent;
643
+ declare namespace agents {
644
+ export { type agents_FinishTestArgs as FinishTestArgs, type agents_JudgeAgentConfig as JudgeAgentConfig, type agents_TestingAgentConfig as TestingAgentConfig, type agents_TestingAgentInferenceConfig as TestingAgentInferenceConfig, agents_judgeAgent as judgeAgent, agents_userSimulatorAgent as userSimulatorAgent };
645
+ }
646
+
596
647
  /**
597
648
  * Verdict enum represents the possible outcomes of a test scenario
598
649
  */
@@ -1157,11 +1208,20 @@ declare class ScenarioExecutionState implements ScenarioExecutionStateLike {
1157
1208
  */
1158
1209
  addMessage(message: CoreMessage): void;
1159
1210
  lastMessage(): CoreMessage;
1160
- lastUserMessage(): CoreMessage;
1211
+ lastUserMessage(): CoreUserMessage;
1212
+ lastAgentMessage(): CoreAssistantMessage;
1161
1213
  lastToolCall(toolName: string): CoreToolMessage;
1162
1214
  hasToolCall(toolName: string): boolean;
1163
1215
  }
1164
1216
 
1217
+ type execution_ScenarioExecution = ScenarioExecution;
1218
+ declare const execution_ScenarioExecution: typeof ScenarioExecution;
1219
+ type execution_ScenarioExecutionState = ScenarioExecutionState;
1220
+ declare const execution_ScenarioExecutionState: typeof ScenarioExecutionState;
1221
+ declare namespace execution {
1222
+ export { execution_ScenarioExecution as ScenarioExecution, execution_ScenarioExecutionState as ScenarioExecutionState };
1223
+ }
1224
+
1165
1225
  /**
1166
1226
  * High-level interface for running a scenario test.
1167
1227
  *
@@ -1213,6 +1273,11 @@ declare class ScenarioExecutionState implements ScenarioExecutionStateLike {
1213
1273
  */
1214
1274
  declare function run(cfg: ScenarioConfig): Promise<ScenarioResult>;
1215
1275
 
1276
+ declare const runner_run: typeof run;
1277
+ declare namespace runner {
1278
+ export { runner_run as run };
1279
+ }
1280
+
1216
1281
  /**
1217
1282
  * Scenario script DSL (Domain Specific Language) module.
1218
1283
  *
@@ -1302,69 +1367,18 @@ declare const succeed: (reasoning?: string) => ScriptStep;
1302
1367
  */
1303
1368
  declare const fail: (reasoning?: string) => ScriptStep;
1304
1369
 
1305
- declare const scenario: {
1306
- message: (message: ai.CoreMessage) => ScriptStep;
1307
- agent: (content?: string | ai.CoreMessage) => ScriptStep;
1308
- judge: (content?: string | ai.CoreMessage) => ScriptStep;
1309
- user: (content?: string | ai.CoreMessage) => ScriptStep;
1310
- proceed: (turns?: number, onTurn?: (state: ScenarioExecutionStateLike) => void | Promise<void>, onStep?: (state: ScenarioExecutionStateLike) => void | Promise<void>) => ScriptStep;
1311
- succeed: (reasoning?: string) => ScriptStep;
1312
- fail: (reasoning?: string) => ScriptStep;
1313
- run(cfg: ScenarioConfig): Promise<ScenarioResult>;
1314
- ScenarioExecution: typeof ScenarioExecution;
1315
- ScenarioExecutionState: typeof ScenarioExecutionState;
1316
- defineConfig(config: ScenarioProjectConfig): ScenarioProjectConfig;
1317
- DEFAULT_TEMPERATURE: 0;
1318
- scenarioProjectConfigSchema: zod.ZodObject<{
1319
- defaultModel: zod.ZodOptional<zod.ZodObject<{
1320
- model: zod.ZodType<ai.LanguageModelV1, zod.ZodTypeDef, ai.LanguageModelV1>;
1321
- temperature: zod.ZodDefault<zod.ZodOptional<zod.ZodNumber>>;
1322
- maxTokens: zod.ZodOptional<zod.ZodNumber>;
1323
- }, "strip", zod.ZodTypeAny, {
1324
- model: ai.LanguageModelV1;
1325
- temperature: number;
1326
- maxTokens?: number | undefined;
1327
- }, {
1328
- model: ai.LanguageModelV1;
1329
- temperature?: number | undefined;
1330
- maxTokens?: number | undefined;
1331
- }>>;
1332
- }, "strict", zod.ZodTypeAny, {
1333
- defaultModel?: {
1334
- model: ai.LanguageModelV1;
1335
- temperature: number;
1336
- maxTokens?: number | undefined;
1337
- } | undefined;
1338
- }, {
1339
- defaultModel?: {
1340
- model: ai.LanguageModelV1;
1341
- temperature?: number | undefined;
1342
- maxTokens?: number | undefined;
1343
- } | undefined;
1344
- }>;
1345
- AgentRole: typeof AgentRole;
1346
- allAgentRoles: readonly [AgentRole.USER, AgentRole.AGENT, AgentRole.JUDGE];
1347
- AgentAdapter: typeof AgentAdapter;
1348
- UserSimulatorAgentAdapter: typeof UserSimulatorAgentAdapter;
1349
- JudgeAgentAdapter: typeof JudgeAgentAdapter;
1350
- judgeAgent: (cfg: JudgeAgentConfig) => {
1351
- role: AgentRole.JUDGE;
1352
- criteria: string[];
1353
- call: (input: AgentInput) => Promise<never[] | {
1354
- success: boolean;
1355
- messages: ai.CoreMessage[];
1356
- reasoning: string;
1357
- metCriteria: string[];
1358
- unmetCriteria: string[];
1359
- }>;
1360
- };
1361
- userSimulatorAgent: (config?: TestingAgentConfig) => {
1362
- role: AgentRole.USER;
1363
- call: (input: AgentInput) => Promise<{
1364
- role: "user";
1365
- content: string;
1366
- }>;
1367
- };
1368
- };
1370
+ declare const script_agent: typeof agent;
1371
+ declare const script_fail: typeof fail;
1372
+ declare const script_judge: typeof judge;
1373
+ declare const script_message: typeof message;
1374
+ declare const script_proceed: typeof proceed;
1375
+ declare const script_succeed: typeof succeed;
1376
+ declare const script_user: typeof user;
1377
+ declare namespace script {
1378
+ export { script_agent as agent, script_fail as fail, script_judge as judge, script_message as message, script_proceed as proceed, script_succeed as succeed, script_user as user };
1379
+ }
1380
+
1381
+ type ScenarioApi = typeof agents & typeof domain & typeof execution & typeof runner & typeof script;
1382
+ declare const scenario: ScenarioApi;
1369
1383
 
1370
- export { AgentAdapter, type AgentInput, type AgentReturnTypes, AgentRole, DEFAULT_TEMPERATURE, type FinishTestArgs, JudgeAgentAdapter, type JudgeAgentConfig, type ScenarioConfig, type ScenarioConfigFinal, ScenarioExecution, type ScenarioExecutionLike, ScenarioExecutionState, type ScenarioExecutionStateLike, type ScenarioProjectConfig, type ScenarioResult, type ScriptStep, type TestingAgentConfig, type TestingAgentInferenceConfig, UserSimulatorAgentAdapter, agent, allAgentRoles, scenario as default, defineConfig, fail, judge, judgeAgent, message, proceed, run, scenario, scenarioProjectConfigSchema, succeed, user, userSimulatorAgent };
1384
+ export { AgentAdapter, type AgentInput, type AgentReturnTypes, AgentRole, DEFAULT_MAX_TURNS, DEFAULT_TEMPERATURE, DEFAULT_VERBOSE, type FinishTestArgs, JudgeAgentAdapter, type JudgeAgentConfig, type ScenarioConfig, type ScenarioConfigFinal, ScenarioExecution, type ScenarioExecutionLike, ScenarioExecutionState, type ScenarioExecutionStateLike, type ScenarioProjectConfig, type ScenarioResult, type ScriptStep, type TestingAgentConfig, type TestingAgentInferenceConfig, UserSimulatorAgentAdapter, agent, allAgentRoles, scenario as default, defineConfig, fail, judge, judgeAgent, message, proceed, run, scenario, scenarioProjectConfigSchema, succeed, user, userSimulatorAgent };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import * as zod from 'zod';
2
- import { z } from 'zod';
3
1
  import * as ai from 'ai';
4
- import { CoreMessage, CoreToolMessage, LanguageModel } from 'ai';
2
+ import { CoreMessage, CoreUserMessage, CoreAssistantMessage, CoreToolMessage, LanguageModel } from 'ai';
3
+ import { z } from 'zod';
5
4
  import { Observable } from 'rxjs';
6
5
 
7
6
  declare enum AgentRole {
@@ -121,6 +120,8 @@ declare abstract class JudgeAgentAdapter implements AgentAdapter {
121
120
  abstract call(input: AgentInput): Promise<AgentReturnTypes>;
122
121
  }
123
122
 
123
+ declare const DEFAULT_MAX_TURNS = 10;
124
+ declare const DEFAULT_VERBOSE = false;
124
125
  /**
125
126
  * Configuration for a scenario.
126
127
  */
@@ -147,11 +148,19 @@ interface ScenarioConfig {
147
148
  */
148
149
  script?: ScriptStep[];
149
150
  /**
150
- * Whether to output verbose logging. Defaults to false.
151
+ * Whether to output verbose logging.
152
+ *
153
+ * If no value is provided, this defaults to {@link DEFAULT_VERBOSE}.
154
+ *
155
+ * @default {@link DEFAULT_VERBOSE}
151
156
  */
152
157
  verbose?: boolean;
153
158
  /**
154
- * The maximum number of turns to execute. Defaults to 20.
159
+ * The maximum number of turns to execute.
160
+ *
161
+ * If no value is provided, this defaults to {@link DEFAULT_MAX_TURNS}.
162
+ *
163
+ * @default {@link DEFAULT_MAX_TURNS}
155
164
  */
156
165
  maxTurns?: number;
157
166
  /**
@@ -322,7 +331,12 @@ interface ScenarioExecutionStateLike {
322
331
  * Retrieves the last user message from the execution state.
323
332
  * @returns The last user message.
324
333
  */
325
- lastUserMessage(): CoreMessage;
334
+ lastUserMessage(): CoreUserMessage;
335
+ /**
336
+ * Retrieves the last agent message from the execution state.
337
+ * @returns The last agent message.
338
+ */
339
+ lastAgentMessage(): CoreAssistantMessage;
326
340
  /**
327
341
  * Retrieves the last tool call message for a specific tool.
328
342
  * @param toolName - The name of the tool.
@@ -369,6 +383,33 @@ declare const scenarioProjectConfigSchema: z.ZodObject<{
369
383
  type ScenarioProjectConfig = z.infer<typeof scenarioProjectConfigSchema>;
370
384
  declare function defineConfig(config: ScenarioProjectConfig): ScenarioProjectConfig;
371
385
 
386
+ type domain_AgentAdapter = AgentAdapter;
387
+ declare const domain_AgentAdapter: typeof AgentAdapter;
388
+ type domain_AgentInput = AgentInput;
389
+ type domain_AgentReturnTypes = AgentReturnTypes;
390
+ type domain_AgentRole = AgentRole;
391
+ declare const domain_AgentRole: typeof AgentRole;
392
+ declare const domain_DEFAULT_MAX_TURNS: typeof DEFAULT_MAX_TURNS;
393
+ declare const domain_DEFAULT_TEMPERATURE: typeof DEFAULT_TEMPERATURE;
394
+ declare const domain_DEFAULT_VERBOSE: typeof DEFAULT_VERBOSE;
395
+ type domain_JudgeAgentAdapter = JudgeAgentAdapter;
396
+ declare const domain_JudgeAgentAdapter: typeof JudgeAgentAdapter;
397
+ type domain_ScenarioConfig = ScenarioConfig;
398
+ type domain_ScenarioConfigFinal = ScenarioConfigFinal;
399
+ type domain_ScenarioExecutionLike = ScenarioExecutionLike;
400
+ type domain_ScenarioExecutionStateLike = ScenarioExecutionStateLike;
401
+ type domain_ScenarioProjectConfig = ScenarioProjectConfig;
402
+ type domain_ScenarioResult = ScenarioResult;
403
+ type domain_ScriptStep = ScriptStep;
404
+ type domain_UserSimulatorAgentAdapter = UserSimulatorAgentAdapter;
405
+ declare const domain_UserSimulatorAgentAdapter: typeof UserSimulatorAgentAdapter;
406
+ declare const domain_allAgentRoles: typeof allAgentRoles;
407
+ declare const domain_defineConfig: typeof defineConfig;
408
+ declare const domain_scenarioProjectConfigSchema: typeof scenarioProjectConfigSchema;
409
+ declare namespace domain {
410
+ export { domain_AgentAdapter as AgentAdapter, type domain_AgentInput as AgentInput, type domain_AgentReturnTypes as AgentReturnTypes, domain_AgentRole as AgentRole, domain_DEFAULT_MAX_TURNS as DEFAULT_MAX_TURNS, domain_DEFAULT_TEMPERATURE as DEFAULT_TEMPERATURE, domain_DEFAULT_VERBOSE as DEFAULT_VERBOSE, domain_JudgeAgentAdapter as JudgeAgentAdapter, type domain_ScenarioConfig as ScenarioConfig, type domain_ScenarioConfigFinal as ScenarioConfigFinal, type domain_ScenarioExecutionLike as ScenarioExecutionLike, type domain_ScenarioExecutionStateLike as ScenarioExecutionStateLike, type domain_ScenarioProjectConfig as ScenarioProjectConfig, type domain_ScenarioResult as ScenarioResult, type domain_ScriptStep as ScriptStep, domain_UserSimulatorAgentAdapter as UserSimulatorAgentAdapter, domain_allAgentRoles as allAgentRoles, domain_defineConfig as defineConfig, domain_scenarioProjectConfigSchema as scenarioProjectConfigSchema };
411
+ }
412
+
372
413
  /**
373
414
  * Configuration for the inference parameters of a testing agent.
374
415
  */
@@ -593,6 +634,16 @@ declare const userSimulatorAgent: (config?: TestingAgentConfig) => {
593
634
  }>;
594
635
  };
595
636
 
637
+ type agents_FinishTestArgs = FinishTestArgs;
638
+ type agents_JudgeAgentConfig = JudgeAgentConfig;
639
+ type agents_TestingAgentConfig = TestingAgentConfig;
640
+ type agents_TestingAgentInferenceConfig = TestingAgentInferenceConfig;
641
+ declare const agents_judgeAgent: typeof judgeAgent;
642
+ declare const agents_userSimulatorAgent: typeof userSimulatorAgent;
643
+ declare namespace agents {
644
+ export { type agents_FinishTestArgs as FinishTestArgs, type agents_JudgeAgentConfig as JudgeAgentConfig, type agents_TestingAgentConfig as TestingAgentConfig, type agents_TestingAgentInferenceConfig as TestingAgentInferenceConfig, agents_judgeAgent as judgeAgent, agents_userSimulatorAgent as userSimulatorAgent };
645
+ }
646
+
596
647
  /**
597
648
  * Verdict enum represents the possible outcomes of a test scenario
598
649
  */
@@ -1157,11 +1208,20 @@ declare class ScenarioExecutionState implements ScenarioExecutionStateLike {
1157
1208
  */
1158
1209
  addMessage(message: CoreMessage): void;
1159
1210
  lastMessage(): CoreMessage;
1160
- lastUserMessage(): CoreMessage;
1211
+ lastUserMessage(): CoreUserMessage;
1212
+ lastAgentMessage(): CoreAssistantMessage;
1161
1213
  lastToolCall(toolName: string): CoreToolMessage;
1162
1214
  hasToolCall(toolName: string): boolean;
1163
1215
  }
1164
1216
 
1217
+ type execution_ScenarioExecution = ScenarioExecution;
1218
+ declare const execution_ScenarioExecution: typeof ScenarioExecution;
1219
+ type execution_ScenarioExecutionState = ScenarioExecutionState;
1220
+ declare const execution_ScenarioExecutionState: typeof ScenarioExecutionState;
1221
+ declare namespace execution {
1222
+ export { execution_ScenarioExecution as ScenarioExecution, execution_ScenarioExecutionState as ScenarioExecutionState };
1223
+ }
1224
+
1165
1225
  /**
1166
1226
  * High-level interface for running a scenario test.
1167
1227
  *
@@ -1213,6 +1273,11 @@ declare class ScenarioExecutionState implements ScenarioExecutionStateLike {
1213
1273
  */
1214
1274
  declare function run(cfg: ScenarioConfig): Promise<ScenarioResult>;
1215
1275
 
1276
+ declare const runner_run: typeof run;
1277
+ declare namespace runner {
1278
+ export { runner_run as run };
1279
+ }
1280
+
1216
1281
  /**
1217
1282
  * Scenario script DSL (Domain Specific Language) module.
1218
1283
  *
@@ -1302,69 +1367,18 @@ declare const succeed: (reasoning?: string) => ScriptStep;
1302
1367
  */
1303
1368
  declare const fail: (reasoning?: string) => ScriptStep;
1304
1369
 
1305
- declare const scenario: {
1306
- message: (message: ai.CoreMessage) => ScriptStep;
1307
- agent: (content?: string | ai.CoreMessage) => ScriptStep;
1308
- judge: (content?: string | ai.CoreMessage) => ScriptStep;
1309
- user: (content?: string | ai.CoreMessage) => ScriptStep;
1310
- proceed: (turns?: number, onTurn?: (state: ScenarioExecutionStateLike) => void | Promise<void>, onStep?: (state: ScenarioExecutionStateLike) => void | Promise<void>) => ScriptStep;
1311
- succeed: (reasoning?: string) => ScriptStep;
1312
- fail: (reasoning?: string) => ScriptStep;
1313
- run(cfg: ScenarioConfig): Promise<ScenarioResult>;
1314
- ScenarioExecution: typeof ScenarioExecution;
1315
- ScenarioExecutionState: typeof ScenarioExecutionState;
1316
- defineConfig(config: ScenarioProjectConfig): ScenarioProjectConfig;
1317
- DEFAULT_TEMPERATURE: 0;
1318
- scenarioProjectConfigSchema: zod.ZodObject<{
1319
- defaultModel: zod.ZodOptional<zod.ZodObject<{
1320
- model: zod.ZodType<ai.LanguageModelV1, zod.ZodTypeDef, ai.LanguageModelV1>;
1321
- temperature: zod.ZodDefault<zod.ZodOptional<zod.ZodNumber>>;
1322
- maxTokens: zod.ZodOptional<zod.ZodNumber>;
1323
- }, "strip", zod.ZodTypeAny, {
1324
- model: ai.LanguageModelV1;
1325
- temperature: number;
1326
- maxTokens?: number | undefined;
1327
- }, {
1328
- model: ai.LanguageModelV1;
1329
- temperature?: number | undefined;
1330
- maxTokens?: number | undefined;
1331
- }>>;
1332
- }, "strict", zod.ZodTypeAny, {
1333
- defaultModel?: {
1334
- model: ai.LanguageModelV1;
1335
- temperature: number;
1336
- maxTokens?: number | undefined;
1337
- } | undefined;
1338
- }, {
1339
- defaultModel?: {
1340
- model: ai.LanguageModelV1;
1341
- temperature?: number | undefined;
1342
- maxTokens?: number | undefined;
1343
- } | undefined;
1344
- }>;
1345
- AgentRole: typeof AgentRole;
1346
- allAgentRoles: readonly [AgentRole.USER, AgentRole.AGENT, AgentRole.JUDGE];
1347
- AgentAdapter: typeof AgentAdapter;
1348
- UserSimulatorAgentAdapter: typeof UserSimulatorAgentAdapter;
1349
- JudgeAgentAdapter: typeof JudgeAgentAdapter;
1350
- judgeAgent: (cfg: JudgeAgentConfig) => {
1351
- role: AgentRole.JUDGE;
1352
- criteria: string[];
1353
- call: (input: AgentInput) => Promise<never[] | {
1354
- success: boolean;
1355
- messages: ai.CoreMessage[];
1356
- reasoning: string;
1357
- metCriteria: string[];
1358
- unmetCriteria: string[];
1359
- }>;
1360
- };
1361
- userSimulatorAgent: (config?: TestingAgentConfig) => {
1362
- role: AgentRole.USER;
1363
- call: (input: AgentInput) => Promise<{
1364
- role: "user";
1365
- content: string;
1366
- }>;
1367
- };
1368
- };
1370
+ declare const script_agent: typeof agent;
1371
+ declare const script_fail: typeof fail;
1372
+ declare const script_judge: typeof judge;
1373
+ declare const script_message: typeof message;
1374
+ declare const script_proceed: typeof proceed;
1375
+ declare const script_succeed: typeof succeed;
1376
+ declare const script_user: typeof user;
1377
+ declare namespace script {
1378
+ export { script_agent as agent, script_fail as fail, script_judge as judge, script_message as message, script_proceed as proceed, script_succeed as succeed, script_user as user };
1379
+ }
1380
+
1381
+ type ScenarioApi = typeof agents & typeof domain & typeof execution & typeof runner & typeof script;
1382
+ declare const scenario: ScenarioApi;
1369
1383
 
1370
- export { AgentAdapter, type AgentInput, type AgentReturnTypes, AgentRole, DEFAULT_TEMPERATURE, type FinishTestArgs, JudgeAgentAdapter, type JudgeAgentConfig, type ScenarioConfig, type ScenarioConfigFinal, ScenarioExecution, type ScenarioExecutionLike, ScenarioExecutionState, type ScenarioExecutionStateLike, type ScenarioProjectConfig, type ScenarioResult, type ScriptStep, type TestingAgentConfig, type TestingAgentInferenceConfig, UserSimulatorAgentAdapter, agent, allAgentRoles, scenario as default, defineConfig, fail, judge, judgeAgent, message, proceed, run, scenario, scenarioProjectConfigSchema, succeed, user, userSimulatorAgent };
1384
+ export { AgentAdapter, type AgentInput, type AgentReturnTypes, AgentRole, DEFAULT_MAX_TURNS, DEFAULT_TEMPERATURE, DEFAULT_VERBOSE, type FinishTestArgs, JudgeAgentAdapter, type JudgeAgentConfig, type ScenarioConfig, type ScenarioConfigFinal, ScenarioExecution, type ScenarioExecutionLike, ScenarioExecutionState, type ScenarioExecutionStateLike, type ScenarioProjectConfig, type ScenarioResult, type ScriptStep, type TestingAgentConfig, type TestingAgentInferenceConfig, UserSimulatorAgentAdapter, agent, allAgentRoles, scenario as default, defineConfig, fail, judge, judgeAgent, message, proceed, run, scenario, scenarioProjectConfigSchema, succeed, user, userSimulatorAgent };