@roarkanalytics/sdk 3.10.0 → 3.12.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 (101) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/client.d.mts +7 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agent-prompt.d.mts +129 -0
  12. package/resources/agent-prompt.d.mts.map +1 -0
  13. package/resources/agent-prompt.d.ts +129 -0
  14. package/resources/agent-prompt.d.ts.map +1 -0
  15. package/resources/agent-prompt.js +58 -0
  16. package/resources/agent-prompt.js.map +1 -0
  17. package/resources/agent-prompt.mjs +54 -0
  18. package/resources/agent-prompt.mjs.map +1 -0
  19. package/resources/call.d.mts +1 -1
  20. package/resources/call.d.mts.map +1 -1
  21. package/resources/call.d.ts +1 -1
  22. package/resources/call.d.ts.map +1 -1
  23. package/resources/config.d.mts +166 -18
  24. package/resources/config.d.mts.map +1 -1
  25. package/resources/config.d.ts +166 -18
  26. package/resources/config.d.ts.map +1 -1
  27. package/resources/customer-flow-edge-case.d.mts +72 -9
  28. package/resources/customer-flow-edge-case.d.mts.map +1 -1
  29. package/resources/customer-flow-edge-case.d.ts +72 -9
  30. package/resources/customer-flow-edge-case.d.ts.map +1 -1
  31. package/resources/customer-flow.d.mts +2005 -78
  32. package/resources/customer-flow.d.mts.map +1 -1
  33. package/resources/customer-flow.d.ts +2005 -78
  34. package/resources/customer-flow.d.ts.map +1 -1
  35. package/resources/customer-flow.js +18 -0
  36. package/resources/customer-flow.js.map +1 -1
  37. package/resources/customer-flow.mjs +18 -0
  38. package/resources/customer-flow.mjs.map +1 -1
  39. package/resources/index.d.mts +3 -2
  40. package/resources/index.d.mts.map +1 -1
  41. package/resources/index.d.ts +3 -2
  42. package/resources/index.d.ts.map +1 -1
  43. package/resources/index.js +3 -1
  44. package/resources/index.js.map +1 -1
  45. package/resources/index.mjs +1 -0
  46. package/resources/index.mjs.map +1 -1
  47. package/resources/simulation-environment.d.mts +163 -1
  48. package/resources/simulation-environment.d.mts.map +1 -1
  49. package/resources/simulation-environment.d.ts +163 -1
  50. package/resources/simulation-environment.d.ts.map +1 -1
  51. package/resources/simulation-environment.js +51 -0
  52. package/resources/simulation-environment.js.map +1 -1
  53. package/resources/simulation-environment.mjs +51 -0
  54. package/resources/simulation-environment.mjs.map +1 -1
  55. package/resources/simulation-job.d.mts +62 -2
  56. package/resources/simulation-job.d.mts.map +1 -1
  57. package/resources/simulation-job.d.ts +62 -2
  58. package/resources/simulation-job.d.ts.map +1 -1
  59. package/resources/simulation-persona.d.mts +42 -6
  60. package/resources/simulation-persona.d.mts.map +1 -1
  61. package/resources/simulation-persona.d.ts +42 -6
  62. package/resources/simulation-persona.d.ts.map +1 -1
  63. package/resources/simulation-run-plan-job.d.mts +31 -1
  64. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  65. package/resources/simulation-run-plan-job.d.ts +31 -1
  66. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  67. package/resources/simulation-run-plan.d.mts +154 -12
  68. package/resources/simulation-run-plan.d.mts.map +1 -1
  69. package/resources/simulation-run-plan.d.ts +154 -12
  70. package/resources/simulation-run-plan.d.ts.map +1 -1
  71. package/resources/simulation-template.d.mts +10 -0
  72. package/resources/simulation-template.d.mts.map +1 -1
  73. package/resources/simulation-template.d.ts +10 -0
  74. package/resources/simulation-template.d.ts.map +1 -1
  75. package/resources/simulation.d.mts +221 -6
  76. package/resources/simulation.d.mts.map +1 -1
  77. package/resources/simulation.d.ts +221 -6
  78. package/resources/simulation.d.ts.map +1 -1
  79. package/resources/simulation.js +10 -3
  80. package/resources/simulation.js.map +1 -1
  81. package/resources/simulation.mjs +10 -3
  82. package/resources/simulation.mjs.map +1 -1
  83. package/src/client.ts +33 -0
  84. package/src/resources/agent-prompt.ts +183 -0
  85. package/src/resources/call.ts +1 -1
  86. package/src/resources/config.ts +310 -20
  87. package/src/resources/customer-flow-edge-case.ts +180 -9
  88. package/src/resources/customer-flow.ts +3091 -63
  89. package/src/resources/index.ts +15 -0
  90. package/src/resources/simulation-environment.ts +244 -0
  91. package/src/resources/simulation-job.ts +92 -2
  92. package/src/resources/simulation-persona.ts +108 -6
  93. package/src/resources/simulation-run-plan-job.ts +39 -1
  94. package/src/resources/simulation-run-plan.ts +176 -12
  95. package/src/resources/simulation-template.ts +11 -0
  96. package/src/resources/simulation.ts +247 -6
  97. package/src/version.ts +1 -1
  98. package/version.d.mts +1 -1
  99. package/version.d.ts +1 -1
  100. package/version.js +1 -1
  101. package/version.mjs +1 -1
@@ -5,9 +5,16 @@ export declare class Simulation extends APIResource {
5
5
  /**
6
6
  * Starts a simulation and returns the run.
7
7
  *
8
- * Send `plan` to describe a simulation and run it once. Add `saveAsPlan` to keep
9
- * that configuration as a reusable run plan. Send `planId` instead to run a plan
10
- * you already have.
8
+ * Send `template` to run one of the built-in templates: it supplies the metrics
9
+ * and checks, and for some templates the flows too, so the request only names the
10
+ * agent and the direction. Send `plan` to describe a simulation yourself and run
11
+ * it once. Send `planId` to run a plan you already have.
12
+ *
13
+ * `template` and `plan` both resolve to a run plan, returned as
14
+ * `simulationRunPlanId`. Add `saveAsPlan` to keep it, or read it back to see
15
+ * exactly what ran. A plan built from a template is a snapshot: retuning the
16
+ * template later never changes what that plan runs, which is what makes a saved
17
+ * one safe to pin in CI.
11
18
  *
12
19
  * @example
13
20
  * ```ts
@@ -65,7 +72,7 @@ export declare namespace SimulationRunResponse {
65
72
  status: 'PENDING' | 'QUEUED' | 'CREATING_SNAPSHOTS' | 'CREATING_SIMULATIONS' | 'PREPARING_CAPACITY' | 'RUNNING_SIMULATIONS' | 'COMPLETED' | 'FAILED' | 'TIMED_OUT' | 'CANCELLED' | 'CANCELLING' | 'ENDING_SIMULATIONS';
66
73
  }
67
74
  }
68
- export type SimulationRunParams = SimulationRunParams.RunSimulationFromConfig | SimulationRunParams.RunSimulationFromPlanID;
75
+ export type SimulationRunParams = SimulationRunParams.RunSimulationFromConfig | SimulationRunParams.RunSimulationFromPlanID | SimulationRunParams.RunSimulationFromTemplate;
69
76
  export declare namespace SimulationRunParams {
70
77
  interface RunSimulationFromConfig {
71
78
  /**
@@ -169,6 +176,21 @@ export declare namespace SimulationRunParams {
169
176
  * once with a different persona override or different variables.
170
177
  */
171
178
  flows?: Array<Plan.Flow>;
179
+ /**
180
+ * Let the run add metrics by itself off the attached flows, on top of the
181
+ * `metrics` named here.
182
+ *
183
+ * Two attach this way today: Agent Expectations wherever an attached flow has
184
+ * agent expectations written on it, and Keypad Entry wherever one has steps where
185
+ * the agent is expected to press keys. Both grade something authored on the flow
186
+ * that nothing else measures, which is why it is on by default.
187
+ *
188
+ * Set false when the `metrics` list is meant to be exhaustive: a plan testing only
189
+ * whether the caller can complete the flow may not want the agent graded on its
190
+ * expectations as well. False also pins the plan against any automatic metric
191
+ * Roark adds later.
192
+ */
193
+ includeAutomaticMetrics?: boolean;
172
194
  /**
173
195
  * Also collect each attached flow's own metrics, on top of the `metrics` named
174
196
  * here.
@@ -252,7 +274,7 @@ export declare namespace SimulationRunParams {
252
274
  /**
253
275
  * The customer flow to run.
254
276
  */
255
- id: string;
277
+ id?: string;
256
278
  /**
257
279
  * `"ALL"` runs every edge case the flow has when the run starts, so one added
258
280
  * later is covered. An array runs only the ones you name, each able to carry its
@@ -267,6 +289,12 @@ export declare namespace SimulationRunParams {
267
289
  * Runs everything this attachment resolves as that persona instead of its own.
268
290
  */
269
291
  personaOverrideId?: string | null;
292
+ /**
293
+ * The Roark-curated flow to run, by its stable slug. Use instead of `id` for a run
294
+ * you keep in version control: a curated flow’s id differs between deployments,
295
+ * its slug does not. Your own flows have no slug and are named by `id`.
296
+ */
297
+ slug?: string;
270
298
  /**
271
299
  * Values for everything it resolves.
272
300
  */
@@ -279,11 +307,18 @@ export declare namespace SimulationRunParams {
279
307
  /**
280
308
  * The edge case to run.
281
309
  */
282
- id: string;
310
+ id?: string;
283
311
  /**
284
312
  * Run this one as that persona instead of its own.
285
313
  */
286
314
  personaOverrideId?: string | null;
315
+ /**
316
+ * The edge case to run, by its stable slug, matched within this flow. Use instead
317
+ * of `id` for a run you keep in version control: a curated edge case’s id differs
318
+ * between deployments and changes outright if it is renamed. Your own edge cases
319
+ * have no slug and are named by `id`.
320
+ */
321
+ slug?: string;
287
322
  /**
288
323
  * Values for this one only.
289
324
  */
@@ -411,6 +446,186 @@ export declare namespace SimulationRunParams {
411
446
  };
412
447
  }
413
448
  }
449
+ interface RunSimulationFromTemplate {
450
+ /**
451
+ * The agent endpoints to call. No template can know these.
452
+ */
453
+ agentEndpoints: Array<RunSimulationFromTemplate.AgentEndpoint>;
454
+ /**
455
+ * Direction of the simulation (INBOUND or OUTBOUND)
456
+ */
457
+ direction: 'INBOUND' | 'OUTBOUND';
458
+ /**
459
+ * The template to run, as listed by GET /v1/simulation/template.
460
+ */
461
+ template: string;
462
+ /**
463
+ * Phrases that trigger end of call. Empty array disables the feature.
464
+ */
465
+ endCallPhrases?: Array<string>;
466
+ /**
467
+ * Semantic conditions that trigger end of call. The LLM evaluates the conversation
468
+ * against these conditions. Defaults to the template's `defaultEndCallReasons`, as
469
+ * returned by GET /v1/simulation/template. Pass an empty array to run with none.
470
+ */
471
+ endCallReasons?: Array<string>;
472
+ /**
473
+ * Merge the customer's own recording of the real call into each simulation, so
474
+ * metrics can be scored against the live leg as well as the simulated one. This is
475
+ * the API equivalent of the dashboard's live-enrichment toggle.
476
+ *
477
+ * With this on, the run provisions a phone number and holds each call open for up
478
+ * to 15 minutes waiting for a matching call to be posted to POST /v1/call. A call
479
+ * matches on the provisioned number (`roarkPhoneNumber` on the job) with a start
480
+ * time inside the simulation window. If nothing arrives, the simulation still
481
+ * completes and any `LIVE`-sourced metric produces no value.
482
+ *
483
+ * Required by any metric whose `requiresLiveConversation` is true: without it that
484
+ * metric is silently skipped.
485
+ */
486
+ enrichWithLiveConversation?: boolean;
487
+ /**
488
+ * Execution mode (PARALLEL or SEQUENTIAL)
489
+ */
490
+ executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT';
491
+ /**
492
+ * The flows to run, in the same shape a run plan takes them.
493
+ *
494
+ * Required when the template lists no flows of its own: it presets what to
495
+ * measure, and this says what to measure it on. Optional when it does, where these
496
+ * REPLACE the ones it would have run, so you can narrow a suite to the cases you
497
+ * care about. Either way, GET /v1/simulation/template lists the flows and variant
498
+ * ids each template covers.
499
+ */
500
+ flows?: Array<RunSimulationFromTemplate.Flow>;
501
+ /**
502
+ * Number of iterations to run for each test case (1-10000)
503
+ */
504
+ iterationCount?: number;
505
+ /**
506
+ * Maximum number of concurrent simulation jobs
507
+ */
508
+ maxConcurrentJobs?: number;
509
+ /**
510
+ * Defaults to the template's `defaultMaxSimulationDurationSeconds`, as returned by
511
+ * GET /v1/simulation/template.
512
+ */
513
+ maxSimulationDurationSeconds?: number;
514
+ /**
515
+ * What to call this. Defaults to the template's name and the date, and required
516
+ * with `saveAsPlan`.
517
+ */
518
+ name?: string;
519
+ /**
520
+ * Keeps the resolved configuration as a run plan, listed by GET
521
+ * /v1/simulation/plan and re-runnable with `planId`. Requires `name`.
522
+ */
523
+ saveAsPlan?: boolean;
524
+ /**
525
+ * Timeout in seconds for silence detection
526
+ */
527
+ silenceTimeoutSeconds?: number;
528
+ /**
529
+ * Values for the {{variables}} the run resolves. An object applies them
530
+ * everywhere; an array targets a flow, its happy path, or one of its edge cases
531
+ * with `flowId`.
532
+ *
533
+ * The scenario-scoped form the other variants accept is not valid here: a template
534
+ * run is always flow-based, so there would be no scenario for it to reach.
535
+ */
536
+ variables?: {
537
+ [key: string]: string;
538
+ } | Array<RunSimulationFromTemplate.UnionMember1>;
539
+ }
540
+ namespace RunSimulationFromTemplate {
541
+ interface AgentEndpoint {
542
+ id: string;
543
+ }
544
+ /**
545
+ * One customer flow attached to a run plan, and which of its ways of running you
546
+ * cover.
547
+ *
548
+ * Attaching the same flow more than once with different overrides is how you fan
549
+ * it out across personas or values.
550
+ */
551
+ interface Flow {
552
+ /**
553
+ * The customer flow to run.
554
+ */
555
+ id?: string;
556
+ /**
557
+ * `"ALL"` runs every edge case the flow has when the run starts, so one added
558
+ * later is covered. An array runs only the ones you name, each able to carry its
559
+ * own persona override and values.
560
+ */
561
+ edgeCases?: 'ALL' | Array<Flow.UnionMember1>;
562
+ /**
563
+ * Run the flow's happy path. Resolved when the run starts, so it follows the flow.
564
+ */
565
+ happyPath?: boolean;
566
+ /**
567
+ * Runs everything this attachment resolves as that persona instead of its own.
568
+ */
569
+ personaOverrideId?: string | null;
570
+ /**
571
+ * The Roark-curated flow to run, by its stable slug. Use instead of `id` for a run
572
+ * you keep in version control: a curated flow’s id differs between deployments,
573
+ * its slug does not. Your own flows have no slug and are named by `id`.
574
+ */
575
+ slug?: string;
576
+ /**
577
+ * Values for everything it resolves.
578
+ */
579
+ variables?: {
580
+ [key: string]: string;
581
+ };
582
+ }
583
+ namespace Flow {
584
+ interface UnionMember1 {
585
+ /**
586
+ * The edge case to run.
587
+ */
588
+ id?: string;
589
+ /**
590
+ * Run this one as that persona instead of its own.
591
+ */
592
+ personaOverrideId?: string | null;
593
+ /**
594
+ * The edge case to run, by its stable slug, matched within this flow. Use instead
595
+ * of `id` for a run you keep in version control: a curated edge case’s id differs
596
+ * between deployments and changes outright if it is renamed. Your own edge cases
597
+ * have no slug and are named by `id`.
598
+ */
599
+ slug?: string;
600
+ /**
601
+ * Values for this one only.
602
+ */
603
+ variables?: {
604
+ [key: string]: string;
605
+ };
606
+ }
607
+ }
608
+ interface UnionMember1 {
609
+ /**
610
+ * A customer flow this plan runs.
611
+ */
612
+ flowId: string;
613
+ /**
614
+ * The values to apply.
615
+ */
616
+ variables: {
617
+ [key: string]: string;
618
+ };
619
+ /**
620
+ * Narrow to one edge case of that flow.
621
+ */
622
+ edgeCaseId?: string;
623
+ /**
624
+ * Narrow to the flow's happy path.
625
+ */
626
+ happyPath?: true;
627
+ }
628
+ }
414
629
  }
415
630
  export declare namespace Simulation {
416
631
  export { type SimulationRunResponse as SimulationRunResponse, type SimulationRunParams as SimulationRunParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"simulation.d.mts","sourceRoot":"","sources":["../src/resources/simulation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,GAAG,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;CAG5F;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC;CAClC;AAED,yBAAiB,qBAAqB,CAAC;IACrC;;OAEG;IACH,UAAiB,IAAI;QACnB;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;;WAGG;QACH,WAAW,EAAE,OAAO,CAAC;QAErB;;WAEG;QACH,kBAAkB,EAAE,MAAM,CAAC;QAE3B;;;WAGG;QACH,mBAAmB,EAAE,MAAM,CAAC;QAE5B;;WAEG;QACH,sBAAsB,EAAE,MAAM,CAAC;QAE/B;;;WAGG;QACH,MAAM,EACF,SAAS,GACT,QAAQ,GACR,oBAAoB,GACpB,sBAAsB,GACtB,oBAAoB,GACpB,qBAAqB,GACrB,WAAW,GACX,QAAQ,GACR,WAAW,GACX,WAAW,GACX,YAAY,GACZ,oBAAoB,CAAC;KAC1B;CACF;AAED,MAAM,MAAM,mBAAmB,GAC3B,mBAAmB,CAAC,uBAAuB,GAC3C,mBAAmB,CAAC,uBAAuB,CAAC;AAEhD,MAAM,CA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U,CAAC,EAAE,MAAM,CAAC;YAEpB;;eAEG;YACH,SAAS,CAAC,EAAE,IAAI,CAAC;SAClB;QAED,UAAiB,YAAY;YAC3B;;eAEG;YACH,UAAU,EAAE,MAAM,CAAC;YAEnB;;eAEG;YACH,SAAS,EAAE;gBAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;aAAE,CAAC;SACtC;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
1
+ {"version":3,"file":"simulation.d.mts","sourceRoot":"","sources":["../src/resources/simulation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,GAAG,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;CAG5F;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC;CAClC;AAED,yBAAiB,qBAAqB,CAAC;IACrC;;OAEG;IACH,UAAiB,IAAI;QACnB;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;;WAGG;QACH,WAAW,EAAE,OAAO,CAAC;QAErB;;WAEG;QACH,kBAAkB,EAAE,MAAM,CAAC;QAE3B;;;WAGG;QACH,mBAAmB,EAAE,MAAM,CAAC;QAE5B;;WAEG;QACH,sBAAsB,EAAE,MAAM,CAAC;QAE/B;;;WAGG;QACH,MAAM,EACF,SAAS,GACT,QAAQ,GACR,oBAAoB,GACpB,sBAAsB,GACtB,oBAAoB,GACp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AAC,EAAE;oBAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;iBAAE,CAAC;aACvC;SACF;QAED,UAAiB,YAAY;YAC3B;;eAEG;YACH,MAAM,EAAE,MAAM,CAAC;YAEf;;eAEG;YACH,SAAS,EAAE;gBAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;aAAE,CAAC;YAErC;;eAEG;YACH,UAAU,CAAC,EAAE,MAAM,CAAC;YAEpB;;eAEG;YACH,SAAS,CAAC,EAAE,IAAI,CAAC;SAClB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -5,9 +5,16 @@ export declare class Simulation extends APIResource {
5
5
  /**
6
6
  * Starts a simulation and returns the run.
7
7
  *
8
- * Send `plan` to describe a simulation and run it once. Add `saveAsPlan` to keep
9
- * that configuration as a reusable run plan. Send `planId` instead to run a plan
10
- * you already have.
8
+ * Send `template` to run one of the built-in templates: it supplies the metrics
9
+ * and checks, and for some templates the flows too, so the request only names the
10
+ * agent and the direction. Send `plan` to describe a simulation yourself and run
11
+ * it once. Send `planId` to run a plan you already have.
12
+ *
13
+ * `template` and `plan` both resolve to a run plan, returned as
14
+ * `simulationRunPlanId`. Add `saveAsPlan` to keep it, or read it back to see
15
+ * exactly what ran. A plan built from a template is a snapshot: retuning the
16
+ * template later never changes what that plan runs, which is what makes a saved
17
+ * one safe to pin in CI.
11
18
  *
12
19
  * @example
13
20
  * ```ts
@@ -65,7 +72,7 @@ export declare namespace SimulationRunResponse {
65
72
  status: 'PENDING' | 'QUEUED' | 'CREATING_SNAPSHOTS' | 'CREATING_SIMULATIONS' | 'PREPARING_CAPACITY' | 'RUNNING_SIMULATIONS' | 'COMPLETED' | 'FAILED' | 'TIMED_OUT' | 'CANCELLED' | 'CANCELLING' | 'ENDING_SIMULATIONS';
66
73
  }
67
74
  }
68
- export type SimulationRunParams = SimulationRunParams.RunSimulationFromConfig | SimulationRunParams.RunSimulationFromPlanID;
75
+ export type SimulationRunParams = SimulationRunParams.RunSimulationFromConfig | SimulationRunParams.RunSimulationFromPlanID | SimulationRunParams.RunSimulationFromTemplate;
69
76
  export declare namespace SimulationRunParams {
70
77
  interface RunSimulationFromConfig {
71
78
  /**
@@ -169,6 +176,21 @@ export declare namespace SimulationRunParams {
169
176
  * once with a different persona override or different variables.
170
177
  */
171
178
  flows?: Array<Plan.Flow>;
179
+ /**
180
+ * Let the run add metrics by itself off the attached flows, on top of the
181
+ * `metrics` named here.
182
+ *
183
+ * Two attach this way today: Agent Expectations wherever an attached flow has
184
+ * agent expectations written on it, and Keypad Entry wherever one has steps where
185
+ * the agent is expected to press keys. Both grade something authored on the flow
186
+ * that nothing else measures, which is why it is on by default.
187
+ *
188
+ * Set false when the `metrics` list is meant to be exhaustive: a plan testing only
189
+ * whether the caller can complete the flow may not want the agent graded on its
190
+ * expectations as well. False also pins the plan against any automatic metric
191
+ * Roark adds later.
192
+ */
193
+ includeAutomaticMetrics?: boolean;
172
194
  /**
173
195
  * Also collect each attached flow's own metrics, on top of the `metrics` named
174
196
  * here.
@@ -252,7 +274,7 @@ export declare namespace SimulationRunParams {
252
274
  /**
253
275
  * The customer flow to run.
254
276
  */
255
- id: string;
277
+ id?: string;
256
278
  /**
257
279
  * `"ALL"` runs every edge case the flow has when the run starts, so one added
258
280
  * later is covered. An array runs only the ones you name, each able to carry its
@@ -267,6 +289,12 @@ export declare namespace SimulationRunParams {
267
289
  * Runs everything this attachment resolves as that persona instead of its own.
268
290
  */
269
291
  personaOverrideId?: string | null;
292
+ /**
293
+ * The Roark-curated flow to run, by its stable slug. Use instead of `id` for a run
294
+ * you keep in version control: a curated flow’s id differs between deployments,
295
+ * its slug does not. Your own flows have no slug and are named by `id`.
296
+ */
297
+ slug?: string;
270
298
  /**
271
299
  * Values for everything it resolves.
272
300
  */
@@ -279,11 +307,18 @@ export declare namespace SimulationRunParams {
279
307
  /**
280
308
  * The edge case to run.
281
309
  */
282
- id: string;
310
+ id?: string;
283
311
  /**
284
312
  * Run this one as that persona instead of its own.
285
313
  */
286
314
  personaOverrideId?: string | null;
315
+ /**
316
+ * The edge case to run, by its stable slug, matched within this flow. Use instead
317
+ * of `id` for a run you keep in version control: a curated edge case’s id differs
318
+ * between deployments and changes outright if it is renamed. Your own edge cases
319
+ * have no slug and are named by `id`.
320
+ */
321
+ slug?: string;
287
322
  /**
288
323
  * Values for this one only.
289
324
  */
@@ -411,6 +446,186 @@ export declare namespace SimulationRunParams {
411
446
  };
412
447
  }
413
448
  }
449
+ interface RunSimulationFromTemplate {
450
+ /**
451
+ * The agent endpoints to call. No template can know these.
452
+ */
453
+ agentEndpoints: Array<RunSimulationFromTemplate.AgentEndpoint>;
454
+ /**
455
+ * Direction of the simulation (INBOUND or OUTBOUND)
456
+ */
457
+ direction: 'INBOUND' | 'OUTBOUND';
458
+ /**
459
+ * The template to run, as listed by GET /v1/simulation/template.
460
+ */
461
+ template: string;
462
+ /**
463
+ * Phrases that trigger end of call. Empty array disables the feature.
464
+ */
465
+ endCallPhrases?: Array<string>;
466
+ /**
467
+ * Semantic conditions that trigger end of call. The LLM evaluates the conversation
468
+ * against these conditions. Defaults to the template's `defaultEndCallReasons`, as
469
+ * returned by GET /v1/simulation/template. Pass an empty array to run with none.
470
+ */
471
+ endCallReasons?: Array<string>;
472
+ /**
473
+ * Merge the customer's own recording of the real call into each simulation, so
474
+ * metrics can be scored against the live leg as well as the simulated one. This is
475
+ * the API equivalent of the dashboard's live-enrichment toggle.
476
+ *
477
+ * With this on, the run provisions a phone number and holds each call open for up
478
+ * to 15 minutes waiting for a matching call to be posted to POST /v1/call. A call
479
+ * matches on the provisioned number (`roarkPhoneNumber` on the job) with a start
480
+ * time inside the simulation window. If nothing arrives, the simulation still
481
+ * completes and any `LIVE`-sourced metric produces no value.
482
+ *
483
+ * Required by any metric whose `requiresLiveConversation` is true: without it that
484
+ * metric is silently skipped.
485
+ */
486
+ enrichWithLiveConversation?: boolean;
487
+ /**
488
+ * Execution mode (PARALLEL or SEQUENTIAL)
489
+ */
490
+ executionMode?: 'PARALLEL' | 'SEQUENTIAL_SAME_RUN_PLAN' | 'SEQUENTIAL_PROJECT';
491
+ /**
492
+ * The flows to run, in the same shape a run plan takes them.
493
+ *
494
+ * Required when the template lists no flows of its own: it presets what to
495
+ * measure, and this says what to measure it on. Optional when it does, where these
496
+ * REPLACE the ones it would have run, so you can narrow a suite to the cases you
497
+ * care about. Either way, GET /v1/simulation/template lists the flows and variant
498
+ * ids each template covers.
499
+ */
500
+ flows?: Array<RunSimulationFromTemplate.Flow>;
501
+ /**
502
+ * Number of iterations to run for each test case (1-10000)
503
+ */
504
+ iterationCount?: number;
505
+ /**
506
+ * Maximum number of concurrent simulation jobs
507
+ */
508
+ maxConcurrentJobs?: number;
509
+ /**
510
+ * Defaults to the template's `defaultMaxSimulationDurationSeconds`, as returned by
511
+ * GET /v1/simulation/template.
512
+ */
513
+ maxSimulationDurationSeconds?: number;
514
+ /**
515
+ * What to call this. Defaults to the template's name and the date, and required
516
+ * with `saveAsPlan`.
517
+ */
518
+ name?: string;
519
+ /**
520
+ * Keeps the resolved configuration as a run plan, listed by GET
521
+ * /v1/simulation/plan and re-runnable with `planId`. Requires `name`.
522
+ */
523
+ saveAsPlan?: boolean;
524
+ /**
525
+ * Timeout in seconds for silence detection
526
+ */
527
+ silenceTimeoutSeconds?: number;
528
+ /**
529
+ * Values for the {{variables}} the run resolves. An object applies them
530
+ * everywhere; an array targets a flow, its happy path, or one of its edge cases
531
+ * with `flowId`.
532
+ *
533
+ * The scenario-scoped form the other variants accept is not valid here: a template
534
+ * run is always flow-based, so there would be no scenario for it to reach.
535
+ */
536
+ variables?: {
537
+ [key: string]: string;
538
+ } | Array<RunSimulationFromTemplate.UnionMember1>;
539
+ }
540
+ namespace RunSimulationFromTemplate {
541
+ interface AgentEndpoint {
542
+ id: string;
543
+ }
544
+ /**
545
+ * One customer flow attached to a run plan, and which of its ways of running you
546
+ * cover.
547
+ *
548
+ * Attaching the same flow more than once with different overrides is how you fan
549
+ * it out across personas or values.
550
+ */
551
+ interface Flow {
552
+ /**
553
+ * The customer flow to run.
554
+ */
555
+ id?: string;
556
+ /**
557
+ * `"ALL"` runs every edge case the flow has when the run starts, so one added
558
+ * later is covered. An array runs only the ones you name, each able to carry its
559
+ * own persona override and values.
560
+ */
561
+ edgeCases?: 'ALL' | Array<Flow.UnionMember1>;
562
+ /**
563
+ * Run the flow's happy path. Resolved when the run starts, so it follows the flow.
564
+ */
565
+ happyPath?: boolean;
566
+ /**
567
+ * Runs everything this attachment resolves as that persona instead of its own.
568
+ */
569
+ personaOverrideId?: string | null;
570
+ /**
571
+ * The Roark-curated flow to run, by its stable slug. Use instead of `id` for a run
572
+ * you keep in version control: a curated flow’s id differs between deployments,
573
+ * its slug does not. Your own flows have no slug and are named by `id`.
574
+ */
575
+ slug?: string;
576
+ /**
577
+ * Values for everything it resolves.
578
+ */
579
+ variables?: {
580
+ [key: string]: string;
581
+ };
582
+ }
583
+ namespace Flow {
584
+ interface UnionMember1 {
585
+ /**
586
+ * The edge case to run.
587
+ */
588
+ id?: string;
589
+ /**
590
+ * Run this one as that persona instead of its own.
591
+ */
592
+ personaOverrideId?: string | null;
593
+ /**
594
+ * The edge case to run, by its stable slug, matched within this flow. Use instead
595
+ * of `id` for a run you keep in version control: a curated edge case’s id differs
596
+ * between deployments and changes outright if it is renamed. Your own edge cases
597
+ * have no slug and are named by `id`.
598
+ */
599
+ slug?: string;
600
+ /**
601
+ * Values for this one only.
602
+ */
603
+ variables?: {
604
+ [key: string]: string;
605
+ };
606
+ }
607
+ }
608
+ interface UnionMember1 {
609
+ /**
610
+ * A customer flow this plan runs.
611
+ */
612
+ flowId: string;
613
+ /**
614
+ * The values to apply.
615
+ */
616
+ variables: {
617
+ [key: string]: string;
618
+ };
619
+ /**
620
+ * Narrow to one edge case of that flow.
621
+ */
622
+ edgeCaseId?: string;
623
+ /**
624
+ * Narrow to the flow's happy path.
625
+ */
626
+ happyPath?: true;
627
+ }
628
+ }
414
629
  }
415
630
  export declare namespace Simulation {
416
631
  export { type SimulationRunResponse as SimulationRunResponse, type SimulationRunParams as SimulationRunParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"simulation.d.ts","sourceRoot":"","sources":["../src/resources/simulation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,GAAG,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;CAG5F;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC;CAClC;AAED,yBAAiB,qBAAqB,CAAC;IACrC;;OAEG;IACH,UAAiB,IAAI;QACnB;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;;WAGG;QACH,WAAW,EAAE,OAAO,CAAC;QAErB;;WAEG;QACH,kBAAkB,EAAE,MAAM,CAAC;QAE3B;;;WAGG;QACH,mBAAmB,EAAE,MAAM,CAAC;QAE5B;;WAEG;QACH,sBAAsB,EAAE,MAAM,CAAC;QAE/B;;;WAGG;QACH,MAAM,EACF,SAAS,GACT,QAAQ,GACR,oBAAoB,GACpB,sBAAsB,GACtB,oBAAoB,GACpB,qBAAqB,GACrB,WAAW,GACX,QAAQ,GACR,WAAW,GACX,WAAW,GACX,YAAY,GACZ,oBAAoB,CAAC;KAC1B;CACF;AAED,MAAM,MAAM,mBAAmB,GAC3B,mBAAmB,CAAC,uBAAuB,GAC3C,mBAAmB,CAAC,uBAAuB,CAAC;A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;gBACH,SAAS,CAAC,EAAE;oBAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;iBAAE,CAAC;aACvC;SACF;QAED,UAAiB,YAAY;YAC3B;;eAEG;YACH,MAAM,EAAE,MAAM,CAAC;YAEf;;eAEG;YACH,SAAS,EAAE;gBAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;aAAE,CAAC;YAErC;;eAEG;YACH,UAAU,CAAC,EAAE,MAAM,CAAC;YAEpB;;eAEG;YACH,SAAS,CAAC,EAAE,IAAI,CAAC;SAClB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -7,9 +7,16 @@ class Simulation extends resource_1.APIResource {
7
7
  /**
8
8
  * Starts a simulation and returns the run.
9
9
  *
10
- * Send `plan` to describe a simulation and run it once. Add `saveAsPlan` to keep
11
- * that configuration as a reusable run plan. Send `planId` instead to run a plan
12
- * you already have.
10
+ * Send `template` to run one of the built-in templates: it supplies the metrics
11
+ * and checks, and for some templates the flows too, so the request only names the
12
+ * agent and the direction. Send `plan` to describe a simulation yourself and run
13
+ * it once. Send `planId` to run a plan you already have.
14
+ *
15
+ * `template` and `plan` both resolve to a run plan, returned as
16
+ * `simulationRunPlanId`. Add `saveAsPlan` to keep it, or read it back to see
17
+ * exactly what ran. A plan built from a template is a snapshot: retuning the
18
+ * template later never changes what that plan runs, which is what makes a saved
19
+ * one safe to pin in CI.
13
20
  *
14
21
  * @example
15
22
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"simulation.js","sourceRoot":"","sources":["../src/resources/simulation.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,UAAW,SAAQ,sBAAW;IACzC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,GAAG,CAAC,IAAyB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF;AAzBD,gCAyBC"}
1
+ {"version":3,"file":"simulation.js","sourceRoot":"","sources":["../src/resources/simulation.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,UAAW,SAAQ,sBAAW;IACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,GAAG,CAAC,IAAyB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF;AAhCD,gCAgCC"}
@@ -4,9 +4,16 @@ export class Simulation extends APIResource {
4
4
  /**
5
5
  * Starts a simulation and returns the run.
6
6
  *
7
- * Send `plan` to describe a simulation and run it once. Add `saveAsPlan` to keep
8
- * that configuration as a reusable run plan. Send `planId` instead to run a plan
9
- * you already have.
7
+ * Send `template` to run one of the built-in templates: it supplies the metrics
8
+ * and checks, and for some templates the flows too, so the request only names the
9
+ * agent and the direction. Send `plan` to describe a simulation yourself and run
10
+ * it once. Send `planId` to run a plan you already have.
11
+ *
12
+ * `template` and `plan` both resolve to a run plan, returned as
13
+ * `simulationRunPlanId`. Add `saveAsPlan` to keep it, or read it back to see
14
+ * exactly what ran. A plan built from a template is a snapshot: retuning the
15
+ * template later never changes what that plan runs, which is what makes a saved
16
+ * one safe to pin in CI.
10
17
  *
11
18
  * @example
12
19
  * ```ts