@roarkanalytics/sdk 4.23.0 → 5.1.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/package.json +1 -1
  3. package/resources/call.d.mts +3 -3
  4. package/resources/call.d.mts.map +1 -1
  5. package/resources/call.d.ts +3 -3
  6. package/resources/call.d.ts.map +1 -1
  7. package/resources/config.d.mts +588 -0
  8. package/resources/config.d.mts.map +1 -1
  9. package/resources/config.d.ts +588 -0
  10. package/resources/config.d.ts.map +1 -1
  11. package/resources/simulation-run-plan-job.d.mts +23 -1
  12. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  13. package/resources/simulation-run-plan-job.d.ts +23 -1
  14. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  15. package/resources/simulation-run-plan.d.mts +701 -308
  16. package/resources/simulation-run-plan.d.mts.map +1 -1
  17. package/resources/simulation-run-plan.d.ts +701 -308
  18. package/resources/simulation-run-plan.d.ts.map +1 -1
  19. package/resources/simulation-run-plan.js +7 -0
  20. package/resources/simulation-run-plan.js.map +1 -1
  21. package/resources/simulation-run-plan.mjs +7 -0
  22. package/resources/simulation-run-plan.mjs.map +1 -1
  23. package/resources/simulation.d.mts +128 -18
  24. package/resources/simulation.d.mts.map +1 -1
  25. package/resources/simulation.d.ts +128 -18
  26. package/resources/simulation.d.ts.map +1 -1
  27. package/src/resources/call.ts +3 -0
  28. package/src/resources/config.ts +1123 -19
  29. package/src/resources/simulation-run-plan-job.ts +26 -1
  30. package/src/resources/simulation-run-plan.ts +767 -309
  31. package/src/resources/simulation.ts +138 -18
  32. package/src/version.ts +1 -1
  33. package/version.d.mts +1 -1
  34. package/version.d.mts.map +1 -1
  35. package/version.d.ts +1 -1
  36. package/version.d.ts.map +1 -1
  37. package/version.js +1 -1
  38. package/version.js.map +1 -1
  39. package/version.mjs +1 -1
  40. package/version.mjs.map +1 -1
@@ -9,6 +9,13 @@ export declare class SimulationRunPlan extends APIResource {
9
9
  * plan or from an inline configuration, and takes runtime variables. Create a plan
10
10
  * here when you want a reusable, named one to run later.
11
11
  *
12
+ * Send `template` instead of a full configuration to save one of the built-in
13
+ * templates as a plan. It takes the same fields as the template variant of POST
14
+ * /v1/simulation/run, builds the same plan, and never starts it.
15
+ *
16
+ * To compare one property, attach the flow once and send `comparisonProperty` with
17
+ * the `comparisonValues` to run: the plan attaches the flow once per value.
18
+ *
12
19
  * @example
13
20
  * ```ts
14
21
  * const simulationRunPlan =
@@ -216,6 +223,12 @@ export declare namespace SimulationRunPlanCreateResponse {
216
223
  * Timeout in seconds for silence detection
217
224
  */
218
225
  silenceTimeoutSeconds: number;
226
+ /**
227
+ * The built-in template this plan was created from, as listed by GET
228
+ * /v1/simulation/template. `null` for a plan described field by field. Recorded
229
+ * once at creation: the plan does not follow later changes to the template.
230
+ */
231
+ template: string | null;
219
232
  /**
220
233
  * Total number of test cases generated from the plan configuration
221
234
  */
@@ -500,6 +513,12 @@ export declare namespace SimulationRunPlanUpdateResponse {
500
513
  * Timeout in seconds for silence detection
501
514
  */
502
515
  silenceTimeoutSeconds: number;
516
+ /**
517
+ * The built-in template this plan was created from, as listed by GET
518
+ * /v1/simulation/template. `null` for a plan described field by field. Recorded
519
+ * once at creation: the plan does not follow later changes to the template.
520
+ */
521
+ template: string | null;
503
522
  /**
504
523
  * Total number of test cases generated from the plan configuration
505
524
  */
@@ -763,6 +782,12 @@ export declare namespace SimulationRunPlanListResponse {
763
782
  * Timeout in seconds for silence detection
764
783
  */
765
784
  silenceTimeoutSeconds: number;
785
+ /**
786
+ * The built-in template this plan was created from, as listed by GET
787
+ * /v1/simulation/template. `null` for a plan described field by field. Recorded
788
+ * once at creation: the plan does not follow later changes to the template.
789
+ */
790
+ template: string | null;
766
791
  /**
767
792
  * Total number of test cases generated from the plan configuration
768
793
  */
@@ -1050,6 +1075,12 @@ export declare namespace SimulationRunPlanGetByIDResponse {
1050
1075
  * Timeout in seconds for silence detection
1051
1076
  */
1052
1077
  silenceTimeoutSeconds: number;
1078
+ /**
1079
+ * The built-in template this plan was created from, as listed by GET
1080
+ * /v1/simulation/template. `null` for a plan described field by field. Recorded
1081
+ * once at creation: the plan does not follow later changes to the template.
1082
+ */
1083
+ template: string | null;
1053
1084
  /**
1054
1085
  * Total number of test cases generated from the plan configuration
1055
1086
  */
@@ -1180,339 +1211,679 @@ export declare namespace SimulationRunPlanGetByIDResponse {
1180
1211
  }
1181
1212
  }
1182
1213
  }
1183
- export interface SimulationRunPlanCreateParams {
1184
- /**
1185
- * Agent endpoints to include in this run plan
1186
- */
1187
- agentEndpoints: Array<SimulationRunPlanCreateParams.AgentEndpoint>;
1188
- /**
1189
- * Direction of the simulation (INBOUND or OUTBOUND)
1190
- */
1191
- direction: 'INBOUND' | 'OUTBOUND';
1192
- /**
1193
- * Maximum duration in seconds for each simulation
1194
- */
1195
- maxSimulationDurationSeconds: number;
1196
- /**
1197
- * Name of the run plan
1198
- */
1199
- name: string;
1200
- /**
1201
- * @deprecated Deprecated: use POST /v1/simulation/run, which starts a run and
1202
- * accepts runtime `variables` as well. This flag runs the plan with only the
1203
- * values pinned on it.
1204
- */
1205
- autoRun?: boolean;
1206
- /**
1207
- * The reference value of `comparisonProperty`, for example `NONE` for
1208
- * `BACKGROUND_NOISE` or `NORMAL` for `SPEECH_PACE`: shown first in the results.
1209
- * Must be a value that property can take. Whether a value did significantly worse
1210
- * does not depend on it: that is decided against every other value combined (see
1211
- * `sweepAttribution`).
1212
- *
1213
- * Stored rather than assumed, so the report can say "compared against US accent"
1214
- * instead of implying Roark decided which value is normal. Most properties have an
1215
- * obvious baseline and the dashboard prefills it; `GENDER` has none, so choose the
1216
- * one you are testing against.
1217
- */
1218
- comparisonBaseline?: string | null;
1219
- /**
1220
- * The property this run plan investigates: the one thing its arms differ by.
1221
- *
1222
- * Set it and the run report compares the arms on that property, so a run answers
1223
- * "what did background noise cost" rather than just "what did each arm score".
1224
- * Every value is a field already recorded on each call, so the report can label an
1225
- * arm `CRYING_BABY` rather than repeating a flow variant's title.
1226
- *
1227
- * Omit it and the report still compares when it can: it detects which property
1228
- * varies across the arms. Setting it is what tells the written summary what you
1229
- * were trying to find out, which detection cannot infer.
1230
- */
1231
- comparisonProperty?: 'ACCENT' | 'AGE' | 'BACKGROUND_NOISE' | 'BACKGROUND_NOISE_VOLUME' | 'BASE_EMOTION' | 'CONFIRMATION_STYLE' | 'GENDER' | 'INTENT_CLARITY' | 'LANGUAGE' | 'INTERRUPTION' | 'MEMORY_RELIABILITY' | 'RESPONSE_TIMING' | 'SPEECH_CLARITY' | 'SPEECH_PACE' | null;
1232
- /**
1233
- * Which values of `comparisonProperty` to run. This is what the plan costs: the
1234
- * flow is attached once per value, so ten values is ten times the calls of one.
1235
- *
1236
- * Omit it to run every value the property has, which for `ACCENT` is more than
1237
- * twenty. Send a subset to narrow the sweep, for example three accents you
1238
- * actually serve. A `comparisonBaseline` outside this set is rejected, because it
1239
- * would anchor every difference to an arm the run never made.
1240
- *
1241
- * Not stored as a field: the arms are the values. Reading the plan back returns
1242
- * them as its flow attachments.
1243
- */
1244
- comparisonValues?: Array<string>;
1245
- /**
1246
- * Description of the run plan
1247
- */
1248
- description?: string;
1249
- /**
1250
- * Phrases that trigger end of call. Empty array disables the feature.
1251
- */
1252
- endCallPhrases?: Array<string>;
1253
- /**
1254
- * Semantic conditions that trigger end of call. The LLM evaluates the conversation
1255
- * against these conditions. Empty array disables the feature.
1256
- */
1257
- endCallReasons?: Array<string>;
1258
- /**
1259
- * Merge the customer's own recording of the real call into each simulation, so
1260
- * metrics can be scored against the live leg as well as the simulated one. This is
1261
- * the API equivalent of the dashboard's live-enrichment toggle.
1262
- *
1263
- * With this on, the run provisions a phone number and holds each call open for up
1264
- * to 15 minutes waiting for a matching call to be posted to POST /v1/call. A call
1265
- * matches on the provisioned number (`roarkPhoneNumber` on the job) with a start
1266
- * time inside the simulation window. If nothing arrives, the simulation still
1267
- * completes and any `LIVE`-sourced metric produces no value.
1268
- *
1269
- * Required by any metric whose `requiresLiveConversation` is true: without it that
1270
- * metric is silently skipped.
1271
- */
1272
- enrichWithLiveConversation?: boolean;
1273
- /**
1274
- * Execution mode (PARALLEL or SEQUENTIAL)
1275
- */
1276
- executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT';
1277
- /**
1278
- * Customer flows to include in this run plan. The same flow can appear more than
1279
- * once with a different persona override, different variables, or different
1280
- * `overrides`: attaching it once per value of one property is how you compare that
1281
- * property without a template.
1282
- */
1283
- flows?: Array<SimulationRunPlanCreateParams.Flow>;
1284
- /**
1285
- * Let the run add metrics by itself off the attached flows, on top of the
1286
- * `metrics` named here.
1287
- *
1288
- * Two attach this way today: Agent Expectations wherever an attached flow has
1289
- * agent expectations written on it, and Keypad Entry wherever one has steps where
1290
- * the agent is expected to press keys. Both grade something authored on the flow
1291
- * that nothing else measures, which is why it is on by default.
1292
- *
1293
- * Set false when the `metrics` list is meant to be exhaustive: a plan testing only
1294
- * whether the caller can complete the flow may not want the agent graded on its
1295
- * expectations as well. False also pins the plan against any automatic metric
1296
- * Roark adds later.
1297
- */
1298
- includeAutomaticMetrics?: boolean;
1299
- /**
1300
- * Also collect each attached flow's own metrics, on top of the `metrics` named
1301
- * here.
1302
- *
1303
- * Default true, which is what you want when you brought your own flows and their
1304
- * graders. Set false for a run whose metric list is meant to be exhaustive: a
1305
- * template like Load Testing or Voicemail deliberately grades a narrow set, and
1306
- * inheriting every flow metric on top multiplies analysis cost across the volume
1307
- * without adding signal.
1308
- *
1309
- * GET /v1/simulation/template returns the value each template expects.
1310
- */
1311
- includeFlowMetrics?: boolean;
1312
- /**
1313
- * Number of iterations to run for each test case (1-10000)
1314
- */
1315
- iterationCount?: number;
1316
- /**
1317
- * Maximum number of concurrent simulation jobs
1318
- */
1319
- maxConcurrentJobs?: number;
1320
- /**
1321
- * How many more times to run a test case when the agent under test never responds:
1322
- * it never speaks on a call or never replies in a chat (0-10). 0 turns retries
1323
- * off. Failed checks and failures on Roark’s side are never retried.
1324
- *
1325
- * Each retry is a separate attempt, billed like any other, so a plan retrying N
1326
- * times can place up to N + 1 calls per test case. Every silent attempt stays on
1327
- * the run with its own call; the run settles once each test case has a final
1328
- * attempt, and the agent never spoke verdict is judged on each test case’s last
1329
- * attempt.
1330
- */
1331
- maxNoResponseRetries?: number;
1332
- /**
1333
- * Metric definitions to include in this run plan. Reference each by `id` (UUID) or
1334
- * `slug`.
1335
- *
1336
- * Optional when the attached `flows` carry the grading: metrics a flow declares
1337
- * itself (with `includeFlowMetrics`), or the Agent Expectations and Keypad Entry
1338
- * metrics a run adds for flows with expectations or expected keypad entries (with
1339
- * `includeAutomaticMetrics`). A plan with nothing to grade is rejected with a 400.
1340
- */
1341
- metrics?: Array<SimulationRunPlanCreateParams.Metric>;
1342
- /**
1343
- * Seconds a retry waits before it dials (30-600). Only used when
1344
- * `maxNoResponseRetries` is above 0.
1345
- */
1346
- noResponseRetryBackoffSeconds?: number;
1347
- /**
1348
- * Personas to include in this run plan. Required with `scenarios`; ignored with
1349
- * `flows`, where each variant carries its own persona.
1350
- */
1351
- personas?: Array<SimulationRunPlanCreateParams.Persona>;
1352
- /**
1353
- * @deprecated Deprecated: use `flows` instead. Scenarios to include in this run
1354
- * plan. The same scenario ID can appear multiple times with different variables.
1355
- */
1356
- scenarios?: Array<SimulationRunPlanCreateParams.Scenario>;
1357
- /**
1358
- * Timeout in seconds for silence detection
1359
- */
1360
- silenceTimeoutSeconds?: number;
1361
- }
1214
+ export type SimulationRunPlanCreateParams = SimulationRunPlanCreateParams.CreateRunPlanFromConfig | SimulationRunPlanCreateParams.CreateRunPlanFromTemplate;
1362
1215
  export declare namespace SimulationRunPlanCreateParams {
1363
- interface AgentEndpoint {
1364
- id: string;
1365
- }
1366
- /**
1367
- * One customer flow attached to a run plan, and which of its ways of running you
1368
- * cover.
1369
- *
1370
- * Attaching the same flow more than once with different overrides is how you fan
1371
- * it out across personas or values.
1372
- */
1373
- interface Flow {
1216
+ interface CreateRunPlanFromConfig {
1374
1217
  /**
1375
- * The customer flow to run.
1218
+ * Agent endpoints to include in this run plan
1376
1219
  */
1377
- id?: string;
1220
+ agentEndpoints: Array<CreateRunPlanFromConfig.AgentEndpoint>;
1378
1221
  /**
1379
- * `"ALL"` runs every edge case the flow has when the run starts, so one added
1380
- * later is covered. An array runs only the ones you name, each able to carry its
1381
- * own persona override and values.
1222
+ * Direction of the simulation (INBOUND or OUTBOUND)
1382
1223
  */
1383
- edgeCases?: 'ALL' | Array<Flow.UnionMember1>;
1224
+ direction: 'INBOUND' | 'OUTBOUND';
1384
1225
  /**
1385
- * Run the flow's happy path. Resolved when the run starts, so it follows the flow.
1226
+ * Maximum duration in seconds for each simulation
1386
1227
  */
1387
- happyPath?: boolean;
1228
+ maxSimulationDurationSeconds: number;
1388
1229
  /**
1389
- * Persona and environment properties to change for this attachment only, without
1390
- * editing the persona or the environment themselves. Each entry patches the
1391
- * per-run snapshot this attachment records, so the flow runs as a caller with that
1392
- * accent, or over that background noise, and everything else stays as authored.
1230
+ * Name of the run plan
1231
+ */
1232
+ name: string;
1233
+ /**
1234
+ * @deprecated Deprecated: use POST /v1/simulation/run, which starts a run and
1235
+ * accepts runtime `variables` as well. This flag runs the plan with only the
1236
+ * values pinned on it.
1237
+ */
1238
+ autoRun?: boolean;
1239
+ /**
1240
+ * The reference value of `comparisonProperty`, for example `NONE` for
1241
+ * `BACKGROUND_NOISE` or `NORMAL` for `SPEECH_PACE`: shown first in the results.
1242
+ * Must be a value that property can take. Whether a value did significantly worse
1243
+ * does not depend on it: that is decided against every other value combined (see
1244
+ * `sweepAttribution`).
1393
1245
  *
1394
- * This is how you attach the same flow twice and vary one thing between them,
1395
- * which is what a sweep template builds for you. One value per property; a
1396
- * property named twice is rejected.
1246
+ * Stored rather than assumed, so the report can say "compared against US accent"
1247
+ * instead of implying Roark decided which value is normal. Omit it and the
1248
+ * property's own norm is used, as the dashboard prefills it, or none when your
1249
+ * `comparisonValues` leave the norm out. `GENDER` has no norm, so choose the one
1250
+ * you are testing against.
1397
1251
  */
1398
- overrides?: Array<Flow.Override>;
1252
+ comparisonBaseline?: string | null;
1399
1253
  /**
1400
- * Runs everything this attachment resolves as that persona instead of its own.
1254
+ * The property this run plan investigates: the one thing its arms differ by.
1255
+ *
1256
+ * Set it and the run report compares the arms on that property, so a run answers
1257
+ * "what did background noise cost" rather than just "what did each arm score".
1258
+ * Every value is a field already recorded on each call, so the report can label an
1259
+ * arm `CRYING_BABY` rather than repeating a flow variant's title.
1260
+ *
1261
+ * Omit it and the report still compares when it can: it detects which property
1262
+ * varies across the arms. Setting it is what tells the written summary what you
1263
+ * were trying to find out, which detection cannot infer.
1401
1264
  */
1402
- personaOverrideId?: string | null;
1265
+ comparisonProperty?: 'ACCENT' | 'AGE' | 'BACKGROUND_NOISE' | 'BACKGROUND_NOISE_VOLUME' | 'BASE_EMOTION' | 'CONFIRMATION_STYLE' | 'GENDER' | 'INTENT_CLARITY' | 'LANGUAGE' | 'INTERRUPTION' | 'MEMORY_RELIABILITY' | 'RESPONSE_TIMING' | 'SPEECH_CLARITY' | 'SPEECH_PACE' | null;
1403
1266
  /**
1404
- * The Roark-curated flow to run, by its stable slug. Use instead of `id` for a run
1405
- * you keep in version control: a curated flow’s id differs between deployments,
1406
- * its slug does not. Your own flows have no slug and are named by `id`.
1267
+ * The arms to run, for a plan that sweeps `comparisonProperty`. This is what the
1268
+ * plan costs: the flow is attached once per arm, so ten arms is ten times the
1269
+ * calls of one.
1270
+ *
1271
+ * Attach each flow once, as you would without a comparison: the plan builds the
1272
+ * arms, running the happy path or edge cases you selected under every arm. Built
1273
+ * arms need at least 5 calls per arm (`iterationCount` times the test cases per
1274
+ * arm), or the plan is refused with `400`. Flows that all carry `overrides` on
1275
+ * `comparisonProperty` already are the arms and are kept as you wrote them; a mix
1276
+ * of flows with and without one is refused.
1277
+ *
1278
+ * Each entry is one arm. A bare value runs it plain: `"CITY"`. An object runs the
1279
+ * value with something pinned on that arm only, such as a noise level per bed:
1280
+ * `{ "value": "OFFICE", "backgroundNoiseVolume": 0.6 }` plays OFFICE at 60% while
1281
+ * the other beds keep the default. List a value more than once with different pins
1282
+ * to run it as several arms: DRIVING at 0.7 and DRIVING at 1 are two arms,
1283
+ * reported as `Driving (70% noise)` and `Driving (100% noise)`, and `"DRIVING"`
1284
+ * beside them keeps the plain arm too. The sweep still varies one property; what
1285
+ * an arm pins is part of "everything else" for that arm only, so the report still
1286
+ * compares the arms on `comparisonProperty`.
1287
+ *
1288
+ * Omit it to run every value the property has, plain, which for `ACCENT` is more
1289
+ * than twenty. A `comparisonBaseline` outside the values listed is rejected,
1290
+ * because it would anchor every difference to an arm the run never made. A value
1291
+ * the property cannot take, a pin the sweep cannot account for, or the same arm
1292
+ * listed twice is rejected with `400`.
1293
+ *
1294
+ * Not stored as a field: the arms are the values. Reading the plan back returns
1295
+ * them as its flow attachments, each with its pins as `overrides`.
1407
1296
  */
1408
- slug?: string;
1297
+ comparisonValues?: Array<string | CreateRunPlanFromConfig.ComparisonArm>;
1409
1298
  /**
1410
- * Values for everything it resolves.
1299
+ * Description of the run plan
1411
1300
  */
1412
- variables?: {
1413
- [key: string]: string;
1414
- };
1415
- }
1416
- namespace Flow {
1417
- interface UnionMember1 {
1418
- /**
1419
- * The edge case to run.
1420
- */
1421
- id?: string;
1422
- /**
1423
- * Run this one as that persona instead of its own.
1424
- */
1425
- personaOverrideId?: string | null;
1426
- /**
1427
- * The edge case to run, by its stable slug, matched within this flow. Use instead
1428
- * of `id` for a run you keep in version control: a curated edge case’s id differs
1429
- * between deployments and changes outright if it is renamed. Your own edge cases
1430
- * have no slug and are named by `id`.
1431
- */
1432
- slug?: string;
1433
- /**
1434
- * Values for this one only.
1435
- */
1436
- variables?: {
1437
- [key: string]: string;
1438
- };
1439
- }
1301
+ description?: string;
1440
1302
  /**
1441
- * One persona or environment property, changed for this flow attachment only.
1303
+ * Phrases that trigger end of call. Empty array disables the feature.
1442
1304
  */
1443
- interface Override {
1444
- property: 'ACCENT' | 'AGE' | 'BACKGROUND_NOISE' | 'BACKGROUND_NOISE_VOLUME' | 'BASE_EMOTION' | 'CONFIRMATION_STYLE' | 'GENDER' | 'INTENT_CLARITY' | 'LANGUAGE' | 'INTERRUPTION' | 'MEMORY_RELIABILITY' | 'RESPONSE_TIMING' | 'SPEECH_CLARITY' | 'SPEECH_PACE';
1445
- value: string;
1446
- }
1447
- }
1448
- interface Metric {
1305
+ endCallPhrases?: Array<string>;
1449
1306
  /**
1450
- * Metric definition UUID. Provide either this or `slug`, not both.
1307
+ * Semantic conditions that trigger end of call. The LLM evaluates the conversation
1308
+ * against these conditions. Empty array disables the feature.
1451
1309
  */
1452
- id?: string;
1310
+ endCallReasons?: Array<string>;
1453
1311
  /**
1454
- * Which side of an enriched run this metric is scored on. Only meaningful with
1455
- * `enrichWithLiveConversation: true`, where a run has both a simulated
1456
- * conversation and the customer's own live recording of it.
1312
+ * Merge the customer's own recording of the real call into each simulation, so
1313
+ * metrics can be scored against the live leg as well as the simulated one. This is
1314
+ * the API equivalent of the dashboard's live-enrichment toggle.
1457
1315
  *
1458
- * Defaults to `SIMULATED`. Use `LIVE` for a metric that must be measured against
1459
- * the real recording (audio quality, provider latency) rather than the simulated
1460
- * leg. `null` means the same as omitting it, so a plan read back from GET can be
1461
- * sent straight to PUT.
1316
+ * With this on, the run provisions a phone number and holds each call open for up
1317
+ * to 15 minutes waiting for a matching call to be posted to POST /v1/call. A call
1318
+ * matches on the provisioned number (`roarkPhoneNumber` on the job) with a start
1319
+ * time inside the simulation window. If nothing arrives, the simulation still
1320
+ * completes and any `LIVE`-sourced metric produces no value.
1321
+ *
1322
+ * Required by any metric whose `requiresLiveConversation` is true: without it that
1323
+ * metric is silently skipped.
1462
1324
  */
1463
- conversationSource?: 'SIMULATED' | 'LIVE' | null;
1325
+ enrichWithLiveConversation?: boolean;
1464
1326
  /**
1465
- * Alias of `slug` accepted for backwards compatibility. Use `slug` for new
1466
- * integrations.
1327
+ * Execution mode (PARALLEL or SEQUENTIAL)
1467
1328
  */
1468
- metricId?: string;
1329
+ executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT';
1469
1330
  /**
1470
- * THE BAR, and the only thing that decides pass/fail. The share of the run's
1471
- * simulations that must pass this check, 0-100.
1331
+ * Customer flows to include in this run plan. The same flow can appear more than
1332
+ * once with a different persona override, different variables, or different
1333
+ * `overrides`: attaching it once per value of one property is how you compare that
1334
+ * property without a template.
1335
+ */
1336
+ flows?: Array<CreateRunPlanFromConfig.Flow>;
1337
+ /**
1338
+ * Let the run add metrics by itself off the attached flows, on top of the
1339
+ * `metrics` named here.
1472
1340
  *
1473
- * Applied to this check alone and never pooled: silence duration at 40 and word
1474
- * count at 80 means the run fails unless 40% of sims clear silence AND 80% clear
1475
- * word count. Omit or `null` for the 80% default.
1341
+ * Two attach this way today: Agent Expectations wherever an attached flow has
1342
+ * agent expectations written on it, and Keypad Entry wherever one has steps where
1343
+ * the agent is expected to press keys. Both grade something authored on the flow
1344
+ * that nothing else measures, which is why it is on by default.
1345
+ *
1346
+ * Set false when the `metrics` list is meant to be exhaustive: a plan testing only
1347
+ * whether the caller can complete the flow may not want the agent graded on its
1348
+ * expectations as well. False also pins the plan against any automatic metric
1349
+ * Roark adds later.
1476
1350
  */
1477
- minPassRate?: number | null;
1351
+ includeAutomaticMetrics?: boolean;
1478
1352
  /**
1479
- * Stable metric slug (e.g. `customer_satisfaction`). Provide either this or `id`,
1480
- * not both.
1353
+ * Also collect each attached flow's own metrics, on top of the `metrics` named
1354
+ * here.
1355
+ *
1356
+ * Default true, which is what you want when you brought your own flows and their
1357
+ * graders. Set false for a run whose metric list is meant to be exhaustive: a
1358
+ * template like Load Testing or Voicemail deliberately grades a narrow set, and
1359
+ * inheriting every flow metric on top multiplies analysis cost across the volume
1360
+ * without adding signal.
1361
+ *
1362
+ * GET /v1/simulation/template returns the value each template expects.
1481
1363
  */
1482
- slug?: string;
1483
- }
1484
- interface Persona {
1485
- id: string;
1486
- }
1487
- interface Scenario {
1364
+ includeFlowMetrics?: boolean;
1488
1365
  /**
1489
- * Scenario ID
1366
+ * Number of iterations to run for each test case (1-10000)
1490
1367
  */
1491
- id: string;
1368
+ iterationCount?: number;
1492
1369
  /**
1493
- * Template variables for this scenario instance. The same scenario can appear
1494
- * multiple times with different variables.
1370
+ * Maximum number of concurrent simulation jobs
1495
1371
  */
1496
- variables?: {
1497
- [key: string]: string;
1498
- };
1499
- }
1500
- }
1501
- export interface SimulationRunPlanUpdateParams {
1502
- /**
1503
- * Agent endpoints to include in this run plan
1504
- */
1505
- agentEndpoints?: Array<SimulationRunPlanUpdateParams.AgentEndpoint>;
1506
- /**
1507
- * The reference value, shown first in the results. See `POST /v1/simulation/plan`.
1508
- *
1509
- * A real value cannot be sent on its own: the property it belongs to decides which
1510
- * values are legal, and an omitted property means "leave unchanged", which this
1511
- * endpoint cannot check a baseline against. Send `comparisonProperty` with it, or
1512
- * get a `400`.
1513
- *
1514
- * `null` on its own IS allowed, and clears just the baseline while leaving the
1515
- * property set. Nothing needs validating when clearing, and a property with no
1372
+ maxConcurrentJobs?: number;
1373
+ /**
1374
+ * How many more times to run a test case when the agent under test never responds:
1375
+ * it never speaks on a call or never replies in a chat (0-10). 0 turns retries
1376
+ * off. Failed checks and failures on Roark’s side are never retried.
1377
+ *
1378
+ * Each retry is a separate attempt, billed like any other, so a plan retrying N
1379
+ * times can place up to N + 1 calls per test case. Every silent attempt stays on
1380
+ * the run with its own call; the run settles once each test case has a final
1381
+ * attempt, and the agent never spoke verdict is judged on each test case’s last
1382
+ * attempt.
1383
+ */
1384
+ maxNoResponseRetries?: number;
1385
+ /**
1386
+ * Metric definitions to include in this run plan. Reference each by `id` (UUID) or
1387
+ * `slug`.
1388
+ *
1389
+ * Optional when the attached `flows` carry the grading: metrics a flow declares
1390
+ * itself (with `includeFlowMetrics`), or the Agent Expectations and Keypad Entry
1391
+ * metrics a run adds for flows with expectations or expected keypad entries (with
1392
+ * `includeAutomaticMetrics`). A plan with nothing to grade is rejected with a 400.
1393
+ */
1394
+ metrics?: Array<CreateRunPlanFromConfig.Metric>;
1395
+ /**
1396
+ * Seconds a retry waits before it dials (30-600). Only used when
1397
+ * `maxNoResponseRetries` is above 0.
1398
+ */
1399
+ noResponseRetryBackoffSeconds?: number;
1400
+ /**
1401
+ * Personas to include in this run plan. Required with `scenarios`; ignored with
1402
+ * `flows`, where each variant carries its own persona.
1403
+ */
1404
+ personas?: Array<CreateRunPlanFromConfig.Persona>;
1405
+ /**
1406
+ * @deprecated Deprecated: use `flows` instead. Scenarios to include in this run
1407
+ * plan. The same scenario ID can appear multiple times with different variables.
1408
+ */
1409
+ scenarios?: Array<CreateRunPlanFromConfig.Scenario>;
1410
+ /**
1411
+ * Timeout in seconds for silence detection
1412
+ */
1413
+ silenceTimeoutSeconds?: number;
1414
+ }
1415
+ namespace CreateRunPlanFromConfig {
1416
+ interface AgentEndpoint {
1417
+ id: string;
1418
+ }
1419
+ /**
1420
+ * One arm of a sweep: the swept value it runs, and what it pins besides that
1421
+ * value. The OFFICE arm of a BACKGROUND_NOISE sweep playing at 60% while the other
1422
+ * beds keep their level is `{ "value": "OFFICE", "backgroundNoiseVolume": 0.6 }`.
1423
+ * The report compares the arms on the swept property only, so each sweep may pin
1424
+ * just what its experiment calls for: a BACKGROUND_NOISE sweep may pin
1425
+ * `backgroundNoiseVolume`, and no other sweep pins anything yet. A pin the sweep
1426
+ * cannot account for is rejected with `400`.
1427
+ */
1428
+ interface ComparisonArm {
1429
+ /**
1430
+ * The swept value this arm runs, a value of `comparisonProperty`.
1431
+ */
1432
+ value: string;
1433
+ /**
1434
+ * The noise level this arm plays at, 0 to 1. The environment default is 0.1. Only
1435
+ * a `BACKGROUND_NOISE` sweep may pin it.
1436
+ */
1437
+ backgroundNoiseVolume?: number;
1438
+ }
1439
+ /**
1440
+ * One customer flow attached to a run plan, and which of its ways of running you
1441
+ * cover.
1442
+ *
1443
+ * Attaching the same flow more than once with different overrides is how you fan
1444
+ * it out across personas or values.
1445
+ */
1446
+ interface Flow {
1447
+ /**
1448
+ * The customer flow to run.
1449
+ */
1450
+ id?: string;
1451
+ /**
1452
+ * `"ALL"` runs every edge case the flow has when the run starts, so one added
1453
+ * later is covered. An array runs only the ones you name, each able to carry its
1454
+ * own persona override and values.
1455
+ */
1456
+ edgeCases?: 'ALL' | Array<Flow.UnionMember1>;
1457
+ /**
1458
+ * Run the flow's happy path. Resolved when the run starts, so it follows the flow.
1459
+ */
1460
+ happyPath?: boolean;
1461
+ /**
1462
+ * Persona and environment properties to change for this attachment only, without
1463
+ * editing the persona or the environment themselves. Each entry patches the
1464
+ * per-run snapshot this attachment records, so the flow runs as a caller with that
1465
+ * accent, or over that background noise, and everything else stays as authored.
1466
+ *
1467
+ * This is how you attach the same flow twice and vary one thing between them,
1468
+ * which is what a sweep template builds for you. One value per property; a
1469
+ * property named twice is rejected.
1470
+ */
1471
+ overrides?: Array<Flow.Override>;
1472
+ /**
1473
+ * Runs everything this attachment resolves as that persona instead of its own.
1474
+ */
1475
+ personaOverrideId?: string | null;
1476
+ /**
1477
+ * The Roark-curated flow to run, by its stable slug. Use instead of `id` for a run
1478
+ * you keep in version control: a curated flow’s id differs between deployments,
1479
+ * its slug does not. Your own flows have no slug and are named by `id`.
1480
+ */
1481
+ slug?: string;
1482
+ /**
1483
+ * Values for everything it resolves.
1484
+ */
1485
+ variables?: {
1486
+ [key: string]: string;
1487
+ };
1488
+ }
1489
+ namespace Flow {
1490
+ interface UnionMember1 {
1491
+ /**
1492
+ * The edge case to run.
1493
+ */
1494
+ id?: string;
1495
+ /**
1496
+ * Run this one as that persona instead of its own.
1497
+ */
1498
+ personaOverrideId?: string | null;
1499
+ /**
1500
+ * The edge case to run, by its stable slug, matched within this flow. Use instead
1501
+ * of `id` for a run you keep in version control: a curated edge case’s id differs
1502
+ * between deployments and changes outright if it is renamed. Your own edge cases
1503
+ * have no slug and are named by `id`.
1504
+ */
1505
+ slug?: string;
1506
+ /**
1507
+ * Values for this one only.
1508
+ */
1509
+ variables?: {
1510
+ [key: string]: string;
1511
+ };
1512
+ }
1513
+ /**
1514
+ * One persona or environment property, changed for this flow attachment only.
1515
+ */
1516
+ interface Override {
1517
+ property: 'ACCENT' | 'AGE' | 'BACKGROUND_NOISE' | 'BACKGROUND_NOISE_VOLUME' | 'BASE_EMOTION' | 'CONFIRMATION_STYLE' | 'GENDER' | 'INTENT_CLARITY' | 'LANGUAGE' | 'INTERRUPTION' | 'MEMORY_RELIABILITY' | 'RESPONSE_TIMING' | 'SPEECH_CLARITY' | 'SPEECH_PACE';
1518
+ value: string;
1519
+ }
1520
+ }
1521
+ interface Metric {
1522
+ /**
1523
+ * Metric definition UUID. Provide either this or `slug`, not both.
1524
+ */
1525
+ id?: string;
1526
+ /**
1527
+ * Which side of an enriched run this metric is scored on. Only meaningful with
1528
+ * `enrichWithLiveConversation: true`, where a run has both a simulated
1529
+ * conversation and the customer's own live recording of it.
1530
+ *
1531
+ * Defaults to `SIMULATED`. Use `LIVE` for a metric that must be measured against
1532
+ * the real recording (audio quality, provider latency) rather than the simulated
1533
+ * leg. `null` means the same as omitting it, so a plan read back from GET can be
1534
+ * sent straight to PUT.
1535
+ */
1536
+ conversationSource?: 'SIMULATED' | 'LIVE' | null;
1537
+ /**
1538
+ * Alias of `slug` accepted for backwards compatibility. Use `slug` for new
1539
+ * integrations.
1540
+ */
1541
+ metricId?: string;
1542
+ /**
1543
+ * THE BAR, and the only thing that decides pass/fail. The share of the run's
1544
+ * simulations that must pass this check, 0-100.
1545
+ *
1546
+ * Applied to this check alone and never pooled: silence duration at 40 and word
1547
+ * count at 80 means the run fails unless 40% of sims clear silence AND 80% clear
1548
+ * word count. Omit or `null` for the 80% default.
1549
+ */
1550
+ minPassRate?: number | null;
1551
+ /**
1552
+ * Stable metric slug (e.g. `customer_satisfaction`). Provide either this or `id`,
1553
+ * not both.
1554
+ */
1555
+ slug?: string;
1556
+ }
1557
+ interface Persona {
1558
+ id: string;
1559
+ }
1560
+ interface Scenario {
1561
+ /**
1562
+ * Scenario ID
1563
+ */
1564
+ id: string;
1565
+ /**
1566
+ * Template variables for this scenario instance. The same scenario can appear
1567
+ * multiple times with different variables.
1568
+ */
1569
+ variables?: {
1570
+ [key: string]: string;
1571
+ };
1572
+ }
1573
+ }
1574
+ interface CreateRunPlanFromTemplate {
1575
+ /**
1576
+ * The agent endpoints to call. No template can know these.
1577
+ */
1578
+ agentEndpoints: Array<CreateRunPlanFromTemplate.AgentEndpoint>;
1579
+ /**
1580
+ * Direction of the simulation (INBOUND or OUTBOUND)
1581
+ */
1582
+ direction: 'INBOUND' | 'OUTBOUND';
1583
+ /**
1584
+ * The template to run, as listed by GET /v1/simulation/template.
1585
+ */
1586
+ template: string;
1587
+ /**
1588
+ * Metrics to collect on top of the template's own, referenced by `id` or `slug`
1589
+ * like a plan's `metrics`. The template's metrics and checks always run; naming
1590
+ * one of them here again keeps it once, with the success criteria you set on it.
1591
+ */
1592
+ additionalMetrics?: Array<CreateRunPlanFromTemplate.AdditionalMetric>;
1593
+ /**
1594
+ * The sweep's reference value, shown first in the results. Defaults to the
1595
+ * template's own baseline, as returned by GET /v1/simulation/template. Whether a
1596
+ * value did significantly worse does not depend on it: that is decided against
1597
+ * every other value combined.
1598
+ *
1599
+ * Send it with `comparisonValues` and it must be one of them, or the request is
1600
+ * rejected: anchoring every difference to an arm the run never made would measure
1601
+ * it against nothing. Leave it out and the template's own baseline is used, and
1602
+ * quietly dropped if your narrowing excluded it, since that one you did not
1603
+ * choose.
1604
+ */
1605
+ comparisonBaseline?: string | null;
1606
+ /**
1607
+ * The arms of the sweep to run, for a template that sweeps one (GET
1608
+ * /v1/simulation/template returns `sweep.property` for those that do). This is
1609
+ * what the run costs: the flow is called once per arm, so ten arms is ten times
1610
+ * the calls of one.
1611
+ *
1612
+ * Omit it to run every value the property has, plain, which for `accent-handling`
1613
+ * is more than twenty. Send a subset to narrow it, for example the three accents
1614
+ * you actually serve. An object entry pins something on that arm only, such as a
1615
+ * noise level per bed on `background-noise-robustness`:
1616
+ * `{ "value": "OFFICE", "backgroundNoiseVolume": 0.6 }` plays OFFICE at 60% while
1617
+ * the other beds keep the default. See `POST /v1/simulation/plan`.
1618
+ */
1619
+ comparisonValues?: Array<string | CreateRunPlanFromTemplate.ComparisonArm>;
1620
+ /**
1621
+ * Phrases that trigger end of call. Empty array disables the feature.
1622
+ */
1623
+ endCallPhrases?: Array<string>;
1624
+ /**
1625
+ * Semantic conditions that trigger end of call. The LLM evaluates the conversation
1626
+ * against these conditions. Defaults to the template's `defaultEndCallReasons`, as
1627
+ * returned by GET /v1/simulation/template. Pass an empty array to run with none.
1628
+ */
1629
+ endCallReasons?: Array<string>;
1630
+ /**
1631
+ * Merge the customer's own recording of the real call into each simulation, so
1632
+ * metrics can be scored against the live leg as well as the simulated one. This is
1633
+ * the API equivalent of the dashboard's live-enrichment toggle.
1634
+ *
1635
+ * With this on, the run provisions a phone number and holds each call open for up
1636
+ * to 15 minutes waiting for a matching call to be posted to POST /v1/call. A call
1637
+ * matches on the provisioned number (`roarkPhoneNumber` on the job) with a start
1638
+ * time inside the simulation window. If nothing arrives, the simulation still
1639
+ * completes and any `LIVE`-sourced metric produces no value.
1640
+ *
1641
+ * Required by any metric whose `requiresLiveConversation` is true: without it that
1642
+ * metric is silently skipped.
1643
+ */
1644
+ enrichWithLiveConversation?: boolean;
1645
+ /**
1646
+ * For `question-answer-check`: the environment the calls run in.
1647
+ */
1648
+ environmentId?: string;
1649
+ /**
1650
+ * Execution mode (PARALLEL or SEQUENTIAL)
1651
+ */
1652
+ executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT';
1653
+ /**
1654
+ * The flows to run, in the same shape a run plan takes them.
1655
+ *
1656
+ * Required when the template lists no flows of its own: it presets what to
1657
+ * measure, and this says what to measure it on. Optional when it does, where these
1658
+ * REPLACE the ones it would have run, so you can narrow a suite to the cases you
1659
+ * care about. Either way, GET /v1/simulation/template lists the flows and variant
1660
+ * ids each template covers.
1661
+ *
1662
+ * On a template that sweeps a property, every value runs exactly what you select
1663
+ * here: the happy path, the edge cases you name, or `edgeCases: "ALL"`. Each
1664
+ * selected case is a call per value per iteration, so naming three edge cases
1665
+ * triples the run.
1666
+ */
1667
+ flows?: Array<CreateRunPlanFromTemplate.Flow>;
1668
+ /**
1669
+ * Runs per test case (1-10000). Defaults to 1, or to 6 for a template that sweeps
1670
+ * a property. A sweep needs at least 5 calls per value (test cases per value times
1671
+ * iterations) to compare its values, and a lower count is refused with 400.
1672
+ */
1673
+ iterationCount?: number;
1674
+ /**
1675
+ * Maximum number of concurrent simulation jobs
1676
+ */
1677
+ maxConcurrentJobs?: number;
1678
+ /**
1679
+ * How many more times to run a test case when the agent under test never responds:
1680
+ * it never speaks on a call or never replies in a chat (0-10). 0 turns retries
1681
+ * off. Failed checks and failures on Roark’s side are never retried.
1682
+ *
1683
+ * Each retry is a separate attempt, billed like any other, so a plan retrying N
1684
+ * times can place up to N + 1 calls per test case. Every silent attempt stays on
1685
+ * the run with its own call; the run settles once each test case has a final
1686
+ * attempt, and the agent never spoke verdict is judged on each test case’s last
1687
+ * attempt.
1688
+ */
1689
+ maxNoResponseRetries?: number;
1690
+ /**
1691
+ * Defaults to the template's `defaultMaxSimulationDurationSeconds`, as returned by
1692
+ * GET /v1/simulation/template.
1693
+ */
1694
+ maxSimulationDurationSeconds?: number;
1695
+ /**
1696
+ * Name of the run plan. Defaults to the template's name and the date.
1697
+ */
1698
+ name?: string;
1699
+ /**
1700
+ * Seconds a retry waits before it dials (30-600). Only used when
1701
+ * `maxNoResponseRetries` is above 0.
1702
+ */
1703
+ noResponseRetryBackoffSeconds?: number;
1704
+ /**
1705
+ * For `question-answer-check`: the persona that asks the questions.
1706
+ */
1707
+ personaId?: string;
1708
+ /**
1709
+ * For the `question-answer-check` template: the questions to ask and the answer
1710
+ * expected for each. Every question runs as its own graded call.
1711
+ */
1712
+ questions?: Array<CreateRunPlanFromTemplate.Question>;
1713
+ /**
1714
+ * Timeout in seconds for silence detection
1715
+ */
1716
+ silenceTimeoutSeconds?: number;
1717
+ }
1718
+ namespace CreateRunPlanFromTemplate {
1719
+ interface AgentEndpoint {
1720
+ id: string;
1721
+ }
1722
+ interface AdditionalMetric {
1723
+ /**
1724
+ * Metric definition UUID. Provide either this or `slug`, not both.
1725
+ */
1726
+ id?: string;
1727
+ /**
1728
+ * Which side of an enriched run this metric is scored on. Only meaningful with
1729
+ * `enrichWithLiveConversation: true`, where a run has both a simulated
1730
+ * conversation and the customer's own live recording of it.
1731
+ *
1732
+ * Defaults to `SIMULATED`. Use `LIVE` for a metric that must be measured against
1733
+ * the real recording (audio quality, provider latency) rather than the simulated
1734
+ * leg. `null` means the same as omitting it, so a plan read back from GET can be
1735
+ * sent straight to PUT.
1736
+ */
1737
+ conversationSource?: 'SIMULATED' | 'LIVE' | null;
1738
+ /**
1739
+ * Alias of `slug` accepted for backwards compatibility. Use `slug` for new
1740
+ * integrations.
1741
+ */
1742
+ metricId?: string;
1743
+ /**
1744
+ * THE BAR, and the only thing that decides pass/fail. The share of the run's
1745
+ * simulations that must pass this check, 0-100.
1746
+ *
1747
+ * Applied to this check alone and never pooled: silence duration at 40 and word
1748
+ * count at 80 means the run fails unless 40% of sims clear silence AND 80% clear
1749
+ * word count. Omit or `null` for the 80% default.
1750
+ */
1751
+ minPassRate?: number | null;
1752
+ /**
1753
+ * Stable metric slug (e.g. `customer_satisfaction`). Provide either this or `id`,
1754
+ * not both.
1755
+ */
1756
+ slug?: string;
1757
+ }
1758
+ /**
1759
+ * One arm of a sweep: the swept value it runs, and what it pins besides that
1760
+ * value. The OFFICE arm of a BACKGROUND_NOISE sweep playing at 60% while the other
1761
+ * beds keep their level is `{ "value": "OFFICE", "backgroundNoiseVolume": 0.6 }`.
1762
+ * The report compares the arms on the swept property only, so each sweep may pin
1763
+ * just what its experiment calls for: a BACKGROUND_NOISE sweep may pin
1764
+ * `backgroundNoiseVolume`, and no other sweep pins anything yet. A pin the sweep
1765
+ * cannot account for is rejected with `400`.
1766
+ */
1767
+ interface ComparisonArm {
1768
+ /**
1769
+ * The swept value this arm runs, a value of `comparisonProperty`.
1770
+ */
1771
+ value: string;
1772
+ /**
1773
+ * The noise level this arm plays at, 0 to 1. The environment default is 0.1. Only
1774
+ * a `BACKGROUND_NOISE` sweep may pin it.
1775
+ */
1776
+ backgroundNoiseVolume?: number;
1777
+ }
1778
+ /**
1779
+ * One customer flow attached to a run plan, and which of its ways of running you
1780
+ * cover.
1781
+ *
1782
+ * Attaching the same flow more than once with different overrides is how you fan
1783
+ * it out across personas or values.
1784
+ */
1785
+ interface Flow {
1786
+ /**
1787
+ * The customer flow to run.
1788
+ */
1789
+ id?: string;
1790
+ /**
1791
+ * `"ALL"` runs every edge case the flow has when the run starts, so one added
1792
+ * later is covered. An array runs only the ones you name, each able to carry its
1793
+ * own persona override and values.
1794
+ */
1795
+ edgeCases?: 'ALL' | Array<Flow.UnionMember1>;
1796
+ /**
1797
+ * Run the flow's happy path. Resolved when the run starts, so it follows the flow.
1798
+ */
1799
+ happyPath?: boolean;
1800
+ /**
1801
+ * Persona and environment properties to change for this attachment only, without
1802
+ * editing the persona or the environment themselves. Each entry patches the
1803
+ * per-run snapshot this attachment records, so the flow runs as a caller with that
1804
+ * accent, or over that background noise, and everything else stays as authored.
1805
+ *
1806
+ * This is how you attach the same flow twice and vary one thing between them,
1807
+ * which is what a sweep template builds for you. One value per property; a
1808
+ * property named twice is rejected.
1809
+ */
1810
+ overrides?: Array<Flow.Override>;
1811
+ /**
1812
+ * Runs everything this attachment resolves as that persona instead of its own.
1813
+ */
1814
+ personaOverrideId?: string | null;
1815
+ /**
1816
+ * The Roark-curated flow to run, by its stable slug. Use instead of `id` for a run
1817
+ * you keep in version control: a curated flow’s id differs between deployments,
1818
+ * its slug does not. Your own flows have no slug and are named by `id`.
1819
+ */
1820
+ slug?: string;
1821
+ /**
1822
+ * Values for everything it resolves.
1823
+ */
1824
+ variables?: {
1825
+ [key: string]: string;
1826
+ };
1827
+ }
1828
+ namespace Flow {
1829
+ interface UnionMember1 {
1830
+ /**
1831
+ * The edge case to run.
1832
+ */
1833
+ id?: string;
1834
+ /**
1835
+ * Run this one as that persona instead of its own.
1836
+ */
1837
+ personaOverrideId?: string | null;
1838
+ /**
1839
+ * The edge case to run, by its stable slug, matched within this flow. Use instead
1840
+ * of `id` for a run you keep in version control: a curated edge case’s id differs
1841
+ * between deployments and changes outright if it is renamed. Your own edge cases
1842
+ * have no slug and are named by `id`.
1843
+ */
1844
+ slug?: string;
1845
+ /**
1846
+ * Values for this one only.
1847
+ */
1848
+ variables?: {
1849
+ [key: string]: string;
1850
+ };
1851
+ }
1852
+ /**
1853
+ * One persona or environment property, changed for this flow attachment only.
1854
+ */
1855
+ interface Override {
1856
+ property: 'ACCENT' | 'AGE' | 'BACKGROUND_NOISE' | 'BACKGROUND_NOISE_VOLUME' | 'BASE_EMOTION' | 'CONFIRMATION_STYLE' | 'GENDER' | 'INTENT_CLARITY' | 'LANGUAGE' | 'INTERRUPTION' | 'MEMORY_RELIABILITY' | 'RESPONSE_TIMING' | 'SPEECH_CLARITY' | 'SPEECH_PACE';
1857
+ value: string;
1858
+ }
1859
+ }
1860
+ interface Question {
1861
+ /**
1862
+ * The question the caller asks the agent.
1863
+ */
1864
+ ask: string;
1865
+ /**
1866
+ * The answer the agent must give, judged against the transcript.
1867
+ */
1868
+ expect: string;
1869
+ }
1870
+ }
1871
+ }
1872
+ export interface SimulationRunPlanUpdateParams {
1873
+ /**
1874
+ * Agent endpoints to include in this run plan
1875
+ */
1876
+ agentEndpoints?: Array<SimulationRunPlanUpdateParams.AgentEndpoint>;
1877
+ /**
1878
+ * The reference value, shown first in the results. See `POST /v1/simulation/plan`.
1879
+ *
1880
+ * A real value cannot be sent on its own: the property it belongs to decides which
1881
+ * values are legal, and an omitted property means "leave unchanged", which this
1882
+ * endpoint cannot check a baseline against. Send `comparisonProperty` with it, or
1883
+ * get a `400`.
1884
+ *
1885
+ * `null` on its own IS allowed, and clears just the baseline while leaving the
1886
+ * property set. Nothing needs validating when clearing, and a property with no
1516
1887
  * baseline is a real state: the report falls back to that property's own norm, and
1517
1888
  * `GENDER` has no norm to fall back to.
1518
1889
  */
@@ -1521,20 +1892,22 @@ export interface SimulationRunPlanUpdateParams {
1521
1892
  * The property this plan investigates. Send `null` to clear the comparison; omit
1522
1893
  * the field to leave it unchanged. See `POST /v1/simulation/plan`.
1523
1894
  *
1524
- * The pair moves together. Sending `comparisonProperty` also sets
1525
- * `comparisonBaseline` to whatever this request carries, or to `null` if it
1526
- * carries none, because a baseline is a value of one specific property and keeping
1527
- * the old one would store a pair that is not valid.
1895
+ * The pair moves together. Sending `comparisonProperty` without
1896
+ * `comparisonBaseline` keeps the stored baseline when the property is unchanged
1897
+ * and the baseline is still one of the values being run. Otherwise it becomes the
1898
+ * new property's norm, or `null` when that norm is not being run either, because a
1899
+ * baseline is a value of one specific property.
1528
1900
  */
1529
1901
  comparisonProperty?: 'ACCENT' | 'AGE' | 'BACKGROUND_NOISE' | 'BACKGROUND_NOISE_VOLUME' | 'BASE_EMOTION' | 'CONFIRMATION_STYLE' | 'GENDER' | 'INTENT_CLARITY' | 'LANGUAGE' | 'INTERRUPTION' | 'MEMORY_RELIABILITY' | 'RESPONSE_TIMING' | 'SPEECH_CLARITY' | 'SPEECH_PACE' | null;
1530
1902
  /**
1531
- * Which values of `comparisonProperty` to run. See `POST /v1/simulation/plan`.
1903
+ * The arms to run. See `POST /v1/simulation/plan`.
1532
1904
  *
1533
- * Omitting it keeps the arms the plan already has, so an edit that only renames
1534
- * the plan never widens a sweep you deliberately narrowed, and never multiplies
1535
- * what it costs.
1905
+ * Omitting it keeps the arms the plan already has, pins included, so an edit that
1906
+ * only renames the plan never widens a sweep you deliberately narrowed, and never
1907
+ * multiplies what it costs. Send it with `comparisonProperty` and `flows`, which
1908
+ * the arms are rebuilt from.
1536
1909
  */
1537
- comparisonValues?: Array<string>;
1910
+ comparisonValues?: Array<string | SimulationRunPlanUpdateParams.ComparisonArm>;
1538
1911
  /**
1539
1912
  * Description of the run plan
1540
1913
  */
@@ -1641,6 +2014,26 @@ export declare namespace SimulationRunPlanUpdateParams {
1641
2014
  interface AgentEndpoint {
1642
2015
  id: string;
1643
2016
  }
2017
+ /**
2018
+ * One arm of a sweep: the swept value it runs, and what it pins besides that
2019
+ * value. The OFFICE arm of a BACKGROUND_NOISE sweep playing at 60% while the other
2020
+ * beds keep their level is `{ "value": "OFFICE", "backgroundNoiseVolume": 0.6 }`.
2021
+ * The report compares the arms on the swept property only, so each sweep may pin
2022
+ * just what its experiment calls for: a BACKGROUND_NOISE sweep may pin
2023
+ * `backgroundNoiseVolume`, and no other sweep pins anything yet. A pin the sweep
2024
+ * cannot account for is rejected with `400`.
2025
+ */
2026
+ interface ComparisonArm {
2027
+ /**
2028
+ * The swept value this arm runs, a value of `comparisonProperty`.
2029
+ */
2030
+ value: string;
2031
+ /**
2032
+ * The noise level this arm plays at, 0 to 1. The environment default is 0.1. Only
2033
+ * a `BACKGROUND_NOISE` sweep may pin it.
2034
+ */
2035
+ backgroundNoiseVolume?: number;
2036
+ }
1644
2037
  /**
1645
2038
  * One customer flow attached to a run plan, and which of its ways of running you
1646
2039
  * cover.