@roarkanalytics/sdk 3.20.0 → 4.0.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 (83) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  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/autoimprove-job.d.mts +495 -0
  12. package/resources/autoimprove-job.d.mts.map +1 -0
  13. package/resources/autoimprove-job.d.ts +495 -0
  14. package/resources/autoimprove-job.d.ts.map +1 -0
  15. package/resources/autoimprove-job.js +151 -0
  16. package/resources/autoimprove-job.js.map +1 -0
  17. package/resources/autoimprove-job.mjs +147 -0
  18. package/resources/autoimprove-job.mjs.map +1 -0
  19. package/resources/config.d.mts +12 -0
  20. package/resources/config.d.mts.map +1 -1
  21. package/resources/config.d.ts +12 -0
  22. package/resources/config.d.ts.map +1 -1
  23. package/resources/customer-flow-edge-case.d.mts +192 -36
  24. package/resources/customer-flow-edge-case.d.mts.map +1 -1
  25. package/resources/customer-flow-edge-case.d.ts +192 -36
  26. package/resources/customer-flow-edge-case.d.ts.map +1 -1
  27. package/resources/customer-flow.d.mts +872 -163
  28. package/resources/customer-flow.d.mts.map +1 -1
  29. package/resources/customer-flow.d.ts +872 -163
  30. package/resources/customer-flow.d.ts.map +1 -1
  31. package/resources/index.d.mts +1 -0
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +1 -0
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +3 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +1 -0
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/simulation-job.d.mts +34 -8
  40. package/resources/simulation-job.d.mts.map +1 -1
  41. package/resources/simulation-job.d.ts +34 -8
  42. package/resources/simulation-job.d.ts.map +1 -1
  43. package/resources/simulation-persona.d.mts +92 -18
  44. package/resources/simulation-persona.d.mts.map +1 -1
  45. package/resources/simulation-persona.d.ts +92 -18
  46. package/resources/simulation-persona.d.ts.map +1 -1
  47. package/resources/simulation-run-plan-job.d.mts +17 -4
  48. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  49. package/resources/simulation-run-plan-job.d.ts +17 -4
  50. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  51. package/resources/simulation-run-plan.d.mts +12 -12
  52. package/resources/simulation-run-plan.d.mts.map +1 -1
  53. package/resources/simulation-run-plan.d.ts +12 -12
  54. package/resources/simulation-run-plan.d.ts.map +1 -1
  55. package/resources/simulation-template.d.mts +1 -1
  56. package/resources/simulation-template.d.mts.map +1 -1
  57. package/resources/simulation-template.d.ts +1 -1
  58. package/resources/simulation-template.d.ts.map +1 -1
  59. package/resources/simulation.d.mts +3 -3
  60. package/resources/simulation.d.mts.map +1 -1
  61. package/resources/simulation.d.ts +3 -3
  62. package/resources/simulation.d.ts.map +1 -1
  63. package/src/client.ts +33 -0
  64. package/src/resources/autoimprove-job.ts +766 -0
  65. package/src/resources/config.ts +19 -0
  66. package/src/resources/customer-flow-edge-case.ts +204 -36
  67. package/src/resources/customer-flow.ts +951 -164
  68. package/src/resources/index.ts +15 -0
  69. package/src/resources/simulation-job.ts +36 -8
  70. package/src/resources/simulation-persona.ts +98 -18
  71. package/src/resources/simulation-run-plan-job.ts +18 -4
  72. package/src/resources/simulation-run-plan.ts +12 -0
  73. package/src/resources/simulation-template.ts +1 -0
  74. package/src/resources/simulation.ts +3 -0
  75. package/src/version.ts +1 -1
  76. package/version.d.mts +1 -1
  77. package/version.d.mts.map +1 -1
  78. package/version.d.ts +1 -1
  79. package/version.d.ts.map +1 -1
  80. package/version.js +1 -1
  81. package/version.js.map +1 -1
  82. package/version.mjs +1 -1
  83. package/version.mjs.map +1 -1
@@ -0,0 +1,766 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as AutoimproveJobAPI from './autoimprove-job';
5
+ import { APIPromise } from '../core/api-promise';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ export class AutoimproveJob extends APIResource {
10
+ /**
11
+ * Commission Roark on an objective. It clones the agent into a staging shadow (or
12
+ * uses your designated staging agent), authors a validation suite of simulated
13
+ * callers, measures a baseline, changes the staging configuration, and re-tests
14
+ * until the objective metric passes its target. Production is never touched by the
15
+ * loop; verified changes wait for promotion.
16
+ *
17
+ * Requires an active provider integration (Vapi or Retell) with agent config
18
+ * writes enabled. One live job per agent: starting a second returns a conflict.
19
+ *
20
+ * The job runs asynchronously; poll GET /v1/autoimprove/job/{jobId} or watch it in
21
+ * the dashboard. When its status is NEEDS_INPUT, answer via the answer endpoint;
22
+ * when AWAITING_PROMOTE, promote or dismiss.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const autoimproveJob = await client.autoimproveJob.create({
27
+ * agentId: 'b3b0c8e2-4c1d-4f6a-9e2b-1a2b3c4d5e6f',
28
+ * objectiveLabel: 'Consent collection should pass',
29
+ * objectiveMetricDefinitionId:
30
+ * 'f2f0c8e2-4c1d-4f6a-9e2b-1a2b3c4d5e6f',
31
+ * });
32
+ * ```
33
+ */
34
+ create(
35
+ body: AutoimproveJobCreateParams,
36
+ options?: RequestOptions,
37
+ ): APIPromise<AutoimproveJobCreateResponse> {
38
+ return this._client.post('/v1/autoimprove/job', { body, ...options });
39
+ }
40
+
41
+ /**
42
+ * List the Autoimprove jobs in this project, most recent first, capped at 100.
43
+ *
44
+ * A job is one autonomous engagement: Roark improving one agent toward one
45
+ * objective metric on a staging copy, with a human-gated promote to production at
46
+ * the end.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const autoimproveJobs = await client.autoimproveJob.list();
51
+ * ```
52
+ */
53
+ list(options?: RequestOptions): APIPromise<AutoimproveJobListResponse> {
54
+ return this._client.get('/v1/autoimprove/job', options);
55
+ }
56
+
57
+ /**
58
+ * Answer the question a job is blocked on. Only meaningful while the job status is
59
+ * NEEDS_INPUT (the open QUESTION entry carries the offered options; free text is
60
+ * also accepted). Otherwise returns a conflict.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const response = await client.autoimproveJob.answerQuestion(
65
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
66
+ * {
67
+ * text: 'Keep the current voice; focus on the closing confirmation.',
68
+ * },
69
+ * );
70
+ * ```
71
+ */
72
+ answerQuestion(
73
+ jobID: string,
74
+ body: AutoimproveJobAnswerQuestionParams,
75
+ options?: RequestOptions,
76
+ ): APIPromise<AutoimproveJobAnswerQuestionResponse> {
77
+ return this._client.post(path`/v1/autoimprove/job/${jobID}/answer`, { body, ...options });
78
+ }
79
+
80
+ /**
81
+ * Stop a live job. Production is never changed by a cancel; everything the job set
82
+ * up (the shadow agent, its phone number, authored test flows and run plan) is
83
+ * cleaned up automatically.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const response = await client.autoimproveJob.cancel(
88
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
89
+ * );
90
+ * ```
91
+ */
92
+ cancel(jobID: string, options?: RequestOptions): APIPromise<AutoimproveJobCancelResponse> {
93
+ return this._client.post(path`/v1/autoimprove/job/${jobID}/cancel`, options);
94
+ }
95
+
96
+ /**
97
+ * Discard a verified job without promoting: production stays untouched and the
98
+ * staging resources are cleaned up. Only a job in AWAITING_PROMOTE can be
99
+ * dismissed.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * const response = await client.autoimproveJob.dismiss(
104
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
105
+ * );
106
+ * ```
107
+ */
108
+ dismiss(jobID: string, options?: RequestOptions): APIPromise<AutoimproveJobDismissResponse> {
109
+ return this._client.post(path`/v1/autoimprove/job/${jobID}/dismiss`, options);
110
+ }
111
+
112
+ /**
113
+ * Fetch one job with its full worklog: every step Roark took, the validation
114
+ * batches with their pass-rate movement, any question it is waiting on, and its
115
+ * final report once concluded.
116
+ *
117
+ * @example
118
+ * ```ts
119
+ * const response = await client.autoimproveJob.getByID(
120
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
121
+ * );
122
+ * ```
123
+ */
124
+ getByID(jobID: string, options?: RequestOptions): APIPromise<AutoimproveJobGetByIDResponse> {
125
+ return this._client.get(path`/v1/autoimprove/job/${jobID}`, options);
126
+ }
127
+
128
+ /**
129
+ * Apply the verified staging changes to the PRODUCTION agent. Only a job in
130
+ * AWAITING_PROMOTE can be promoted.
131
+ *
132
+ * A snapshot of the production configuration is taken immediately before the
133
+ * write, so the promote is fully rollbackable. After the promote the staging
134
+ * shadow and its phone number are cleaned up.
135
+ *
136
+ * @example
137
+ * ```ts
138
+ * const response = await client.autoimproveJob.promote(
139
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
140
+ * );
141
+ * ```
142
+ */
143
+ promote(jobID: string, options?: RequestOptions): APIPromise<AutoimproveJobPromoteResponse> {
144
+ return this._client.post(path`/v1/autoimprove/job/${jobID}/promote`, options);
145
+ }
146
+
147
+ /**
148
+ * Steer Roark mid-job. The message is folded into its next decision and is
149
+ * binding. Accepted while the job is live (RUNNING, NEEDS_INPUT, or PAUSED); a
150
+ * concluded job returns a conflict.
151
+ *
152
+ * @example
153
+ * ```ts
154
+ * const response = await client.autoimproveJob.sendGuidance(
155
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
156
+ * {
157
+ * text: 'Keep the current voice; focus on the closing confirmation.',
158
+ * },
159
+ * );
160
+ * ```
161
+ */
162
+ sendGuidance(
163
+ jobID: string,
164
+ body: AutoimproveJobSendGuidanceParams,
165
+ options?: RequestOptions,
166
+ ): APIPromise<AutoimproveJobSendGuidanceResponse> {
167
+ return this._client.post(path`/v1/autoimprove/job/${jobID}/guidance`, { body, ...options });
168
+ }
169
+ }
170
+
171
+ /**
172
+ * One entry in the job's worklog: what Roark did or observed at that step.
173
+ * VALIDATION entries carry the batch's trial count and pass-rate movement;
174
+ * QUESTION entries carry the quick-reply options Roark is waiting on.
175
+ */
176
+ export interface AutoimproveLogEntry {
177
+ id: string;
178
+
179
+ configPushId: string | null;
180
+
181
+ /**
182
+ * When the entry was written (ISO 8601).
183
+ */
184
+ createdAt: string;
185
+
186
+ kind:
187
+ | 'STARTED'
188
+ | 'REASONING'
189
+ | 'CHANGE'
190
+ | 'VALIDATION'
191
+ | 'VERDICT'
192
+ | 'SLEEP'
193
+ | 'QUESTION'
194
+ | 'GUIDANCE'
195
+ | 'STATUS'
196
+ | 'SETUP'
197
+ | 'SUITE';
198
+
199
+ orderIndex: number;
200
+
201
+ passRateAfter: number | null;
202
+
203
+ passRateBefore: number | null;
204
+
205
+ questionOptions: Array<string> | null;
206
+
207
+ simulationRunPlanJobId: string | null;
208
+
209
+ text: string;
210
+
211
+ trialCount: number | null;
212
+ }
213
+
214
+ export interface AutoimproveJobCreateResponse {
215
+ /**
216
+ * One Autoimprove job: Roark autonomously improving one agent toward one objective
217
+ * metric. Roark only ever changes the staging agent (a shadow clone by default);
218
+ * production changes exactly once, when verified changes are promoted.
219
+ */
220
+ data: AutoimproveJobCreateResponse.Data;
221
+ }
222
+
223
+ export namespace AutoimproveJobCreateResponse {
224
+ /**
225
+ * One Autoimprove job: Roark autonomously improving one agent toward one objective
226
+ * metric. Roark only ever changes the staging agent (a shadow clone by default);
227
+ * production changes exactly once, when verified changes are promoted.
228
+ */
229
+ export interface Data {
230
+ id: string;
231
+
232
+ agentId: string;
233
+
234
+ baselineValue: number | null;
235
+
236
+ /**
237
+ * When the job reached a terminal status (ISO 8601).
238
+ */
239
+ concludedAt: string | null;
240
+
241
+ /**
242
+ * When the job was created (ISO 8601).
243
+ */
244
+ createdAt: string;
245
+
246
+ currentValue: number | null;
247
+
248
+ customerIntegrationId: string;
249
+
250
+ finalReport: string | null;
251
+
252
+ initiatedByUserId: string | null;
253
+
254
+ issueId: string | null;
255
+
256
+ iterationCount: number;
257
+
258
+ maxIterations: number;
259
+
260
+ maxSimCalls: number;
261
+
262
+ objectiveId: string | null;
263
+
264
+ objectiveLabel: string;
265
+
266
+ objectiveMetricDefinitionId: string;
267
+
268
+ organizationId: string;
269
+
270
+ projectId: string;
271
+
272
+ simCallsUsed: number;
273
+
274
+ stagingAgentId: string;
275
+
276
+ stagingKind: 'DESIGNATED' | 'SHADOW';
277
+
278
+ status:
279
+ | 'RUNNING'
280
+ | 'NEEDS_INPUT'
281
+ | 'PAUSED'
282
+ | 'AWAITING_PROMOTE'
283
+ | 'PROMOTED'
284
+ | 'NO_FIX'
285
+ | 'CANCELLED'
286
+ | 'FAILED';
287
+
288
+ targetValue: number;
289
+
290
+ trigger: 'ISSUE' | 'RUN_THRESHOLD_FAILED' | 'USER' | 'DEGRADATION';
291
+
292
+ /**
293
+ * When the job last changed (ISO 8601).
294
+ */
295
+ updatedAt: string;
296
+
297
+ validationRunPlanId: string | null;
298
+
299
+ workingMemory: string | null;
300
+ }
301
+ }
302
+
303
+ export interface AutoimproveJobListResponse {
304
+ data: Array<AutoimproveJobListResponse.Data>;
305
+ }
306
+
307
+ export namespace AutoimproveJobListResponse {
308
+ /**
309
+ * One Autoimprove job: Roark autonomously improving one agent toward one objective
310
+ * metric. Roark only ever changes the staging agent (a shadow clone by default);
311
+ * production changes exactly once, when verified changes are promoted.
312
+ */
313
+ export interface Data {
314
+ id: string;
315
+
316
+ agentId: string;
317
+
318
+ baselineValue: number | null;
319
+
320
+ /**
321
+ * When the job reached a terminal status (ISO 8601).
322
+ */
323
+ concludedAt: string | null;
324
+
325
+ /**
326
+ * When the job was created (ISO 8601).
327
+ */
328
+ createdAt: string;
329
+
330
+ currentValue: number | null;
331
+
332
+ customerIntegrationId: string;
333
+
334
+ finalReport: string | null;
335
+
336
+ initiatedByUserId: string | null;
337
+
338
+ issueId: string | null;
339
+
340
+ iterationCount: number;
341
+
342
+ maxIterations: number;
343
+
344
+ maxSimCalls: number;
345
+
346
+ objectiveId: string | null;
347
+
348
+ objectiveLabel: string;
349
+
350
+ objectiveMetricDefinitionId: string;
351
+
352
+ organizationId: string;
353
+
354
+ projectId: string;
355
+
356
+ simCallsUsed: number;
357
+
358
+ stagingAgentId: string;
359
+
360
+ stagingKind: 'DESIGNATED' | 'SHADOW';
361
+
362
+ status:
363
+ | 'RUNNING'
364
+ | 'NEEDS_INPUT'
365
+ | 'PAUSED'
366
+ | 'AWAITING_PROMOTE'
367
+ | 'PROMOTED'
368
+ | 'NO_FIX'
369
+ | 'CANCELLED'
370
+ | 'FAILED';
371
+
372
+ targetValue: number;
373
+
374
+ trigger: 'ISSUE' | 'RUN_THRESHOLD_FAILED' | 'USER' | 'DEGRADATION';
375
+
376
+ /**
377
+ * When the job last changed (ISO 8601).
378
+ */
379
+ updatedAt: string;
380
+
381
+ validationRunPlanId: string | null;
382
+
383
+ workingMemory: string | null;
384
+ }
385
+ }
386
+
387
+ export interface AutoimproveJobAnswerQuestionResponse {
388
+ data: AutoimproveJobAnswerQuestionResponse.Data;
389
+ }
390
+
391
+ export namespace AutoimproveJobAnswerQuestionResponse {
392
+ export interface Data {
393
+ accepted: true;
394
+ }
395
+ }
396
+
397
+ export interface AutoimproveJobCancelResponse {
398
+ data: AutoimproveJobCancelResponse.Data;
399
+ }
400
+
401
+ export namespace AutoimproveJobCancelResponse {
402
+ export interface Data {
403
+ accepted: true;
404
+ }
405
+ }
406
+
407
+ export interface AutoimproveJobDismissResponse {
408
+ /**
409
+ * One Autoimprove job: Roark autonomously improving one agent toward one objective
410
+ * metric. Roark only ever changes the staging agent (a shadow clone by default);
411
+ * production changes exactly once, when verified changes are promoted.
412
+ */
413
+ data: AutoimproveJobDismissResponse.Data;
414
+ }
415
+
416
+ export namespace AutoimproveJobDismissResponse {
417
+ /**
418
+ * One Autoimprove job: Roark autonomously improving one agent toward one objective
419
+ * metric. Roark only ever changes the staging agent (a shadow clone by default);
420
+ * production changes exactly once, when verified changes are promoted.
421
+ */
422
+ export interface Data {
423
+ id: string;
424
+
425
+ agentId: string;
426
+
427
+ baselineValue: number | null;
428
+
429
+ /**
430
+ * When the job reached a terminal status (ISO 8601).
431
+ */
432
+ concludedAt: string | null;
433
+
434
+ /**
435
+ * When the job was created (ISO 8601).
436
+ */
437
+ createdAt: string;
438
+
439
+ currentValue: number | null;
440
+
441
+ customerIntegrationId: string;
442
+
443
+ finalReport: string | null;
444
+
445
+ initiatedByUserId: string | null;
446
+
447
+ issueId: string | null;
448
+
449
+ iterationCount: number;
450
+
451
+ maxIterations: number;
452
+
453
+ maxSimCalls: number;
454
+
455
+ objectiveId: string | null;
456
+
457
+ objectiveLabel: string;
458
+
459
+ objectiveMetricDefinitionId: string;
460
+
461
+ organizationId: string;
462
+
463
+ projectId: string;
464
+
465
+ simCallsUsed: number;
466
+
467
+ stagingAgentId: string;
468
+
469
+ stagingKind: 'DESIGNATED' | 'SHADOW';
470
+
471
+ status:
472
+ | 'RUNNING'
473
+ | 'NEEDS_INPUT'
474
+ | 'PAUSED'
475
+ | 'AWAITING_PROMOTE'
476
+ | 'PROMOTED'
477
+ | 'NO_FIX'
478
+ | 'CANCELLED'
479
+ | 'FAILED';
480
+
481
+ targetValue: number;
482
+
483
+ trigger: 'ISSUE' | 'RUN_THRESHOLD_FAILED' | 'USER' | 'DEGRADATION';
484
+
485
+ /**
486
+ * When the job last changed (ISO 8601).
487
+ */
488
+ updatedAt: string;
489
+
490
+ validationRunPlanId: string | null;
491
+
492
+ workingMemory: string | null;
493
+ }
494
+ }
495
+
496
+ export interface AutoimproveJobGetByIDResponse {
497
+ data: AutoimproveJobGetByIDResponse.Data;
498
+ }
499
+
500
+ export namespace AutoimproveJobGetByIDResponse {
501
+ /**
502
+ * One Autoimprove job: Roark autonomously improving one agent toward one objective
503
+ * metric. Roark only ever changes the staging agent (a shadow clone by default);
504
+ * production changes exactly once, when verified changes are promoted.
505
+ */
506
+ export interface Data {
507
+ id: string;
508
+
509
+ agentId: string;
510
+
511
+ baselineValue: number | null;
512
+
513
+ /**
514
+ * When the job reached a terminal status (ISO 8601).
515
+ */
516
+ concludedAt: string | null;
517
+
518
+ /**
519
+ * When the job was created (ISO 8601).
520
+ */
521
+ createdAt: string;
522
+
523
+ currentValue: number | null;
524
+
525
+ customerIntegrationId: string;
526
+
527
+ finalReport: string | null;
528
+
529
+ initiatedByUserId: string | null;
530
+
531
+ issueId: string | null;
532
+
533
+ iterationCount: number;
534
+
535
+ /**
536
+ * The full worklog, oldest first.
537
+ */
538
+ logEntries: Array<AutoimproveJobAPI.AutoimproveLogEntry>;
539
+
540
+ maxIterations: number;
541
+
542
+ maxSimCalls: number;
543
+
544
+ objectiveId: string | null;
545
+
546
+ objectiveLabel: string;
547
+
548
+ objectiveMetricDefinitionId: string;
549
+
550
+ organizationId: string;
551
+
552
+ projectId: string;
553
+
554
+ simCallsUsed: number;
555
+
556
+ stagingAgentId: string;
557
+
558
+ stagingKind: 'DESIGNATED' | 'SHADOW';
559
+
560
+ status:
561
+ | 'RUNNING'
562
+ | 'NEEDS_INPUT'
563
+ | 'PAUSED'
564
+ | 'AWAITING_PROMOTE'
565
+ | 'PROMOTED'
566
+ | 'NO_FIX'
567
+ | 'CANCELLED'
568
+ | 'FAILED';
569
+
570
+ targetValue: number;
571
+
572
+ trigger: 'ISSUE' | 'RUN_THRESHOLD_FAILED' | 'USER' | 'DEGRADATION';
573
+
574
+ /**
575
+ * When the job last changed (ISO 8601).
576
+ */
577
+ updatedAt: string;
578
+
579
+ validationRunPlanId: string | null;
580
+
581
+ workingMemory: string | null;
582
+ }
583
+ }
584
+
585
+ export interface AutoimproveJobPromoteResponse {
586
+ /**
587
+ * One Autoimprove job: Roark autonomously improving one agent toward one objective
588
+ * metric. Roark only ever changes the staging agent (a shadow clone by default);
589
+ * production changes exactly once, when verified changes are promoted.
590
+ */
591
+ data: AutoimproveJobPromoteResponse.Data;
592
+ }
593
+
594
+ export namespace AutoimproveJobPromoteResponse {
595
+ /**
596
+ * One Autoimprove job: Roark autonomously improving one agent toward one objective
597
+ * metric. Roark only ever changes the staging agent (a shadow clone by default);
598
+ * production changes exactly once, when verified changes are promoted.
599
+ */
600
+ export interface Data {
601
+ id: string;
602
+
603
+ agentId: string;
604
+
605
+ baselineValue: number | null;
606
+
607
+ /**
608
+ * When the job reached a terminal status (ISO 8601).
609
+ */
610
+ concludedAt: string | null;
611
+
612
+ /**
613
+ * When the job was created (ISO 8601).
614
+ */
615
+ createdAt: string;
616
+
617
+ currentValue: number | null;
618
+
619
+ customerIntegrationId: string;
620
+
621
+ finalReport: string | null;
622
+
623
+ initiatedByUserId: string | null;
624
+
625
+ issueId: string | null;
626
+
627
+ iterationCount: number;
628
+
629
+ maxIterations: number;
630
+
631
+ maxSimCalls: number;
632
+
633
+ objectiveId: string | null;
634
+
635
+ objectiveLabel: string;
636
+
637
+ objectiveMetricDefinitionId: string;
638
+
639
+ organizationId: string;
640
+
641
+ projectId: string;
642
+
643
+ simCallsUsed: number;
644
+
645
+ stagingAgentId: string;
646
+
647
+ stagingKind: 'DESIGNATED' | 'SHADOW';
648
+
649
+ status:
650
+ | 'RUNNING'
651
+ | 'NEEDS_INPUT'
652
+ | 'PAUSED'
653
+ | 'AWAITING_PROMOTE'
654
+ | 'PROMOTED'
655
+ | 'NO_FIX'
656
+ | 'CANCELLED'
657
+ | 'FAILED';
658
+
659
+ targetValue: number;
660
+
661
+ trigger: 'ISSUE' | 'RUN_THRESHOLD_FAILED' | 'USER' | 'DEGRADATION';
662
+
663
+ /**
664
+ * When the job last changed (ISO 8601).
665
+ */
666
+ updatedAt: string;
667
+
668
+ validationRunPlanId: string | null;
669
+
670
+ workingMemory: string | null;
671
+ }
672
+ }
673
+
674
+ export interface AutoimproveJobSendGuidanceResponse {
675
+ data: AutoimproveJobSendGuidanceResponse.Data;
676
+ }
677
+
678
+ export namespace AutoimproveJobSendGuidanceResponse {
679
+ export interface Data {
680
+ accepted: true;
681
+ }
682
+ }
683
+
684
+ export interface AutoimproveJobCreateParams {
685
+ /**
686
+ * The production agent to improve. It is never modified until you promote.
687
+ */
688
+ agentId: string;
689
+
690
+ /**
691
+ * Human-readable label for the objective, shown everywhere the job appears.
692
+ */
693
+ objectiveLabel: string;
694
+
695
+ /**
696
+ * The metric that defines success: a pass/fail metric, or a threshold variant of a
697
+ * scale metric (for example "PII Handling >= 4"). Roark measures the pass rate of
698
+ * this metric across simulated calls.
699
+ */
700
+ objectiveMetricDefinitionId: string;
701
+
702
+ /**
703
+ * The provider integration whose credentials Roark uses. Omit to use the project's
704
+ * active integration for the agent's provider. The integration must have agent
705
+ * config writes enabled.
706
+ */
707
+ customerIntegrationId?: string;
708
+
709
+ /**
710
+ * Cap on decision turns. Defaults to 50.
711
+ */
712
+ maxIterations?: number;
713
+
714
+ /**
715
+ * Cap on simulated calls dialed. Defaults to 200.
716
+ */
717
+ maxSimCalls?: number;
718
+
719
+ /**
720
+ * An existing agent to stage changes on instead of the default shadow clone. Must
721
+ * be a different agent from agentId, on the same provider.
722
+ */
723
+ stagingAgentId?: string;
724
+
725
+ /**
726
+ * The pass-rate percentage that counts as fixed. Defaults to 90.
727
+ */
728
+ targetValue?: number;
729
+
730
+ /**
731
+ * An existing simulation run plan to validate with. Omit to let Roark author its
732
+ * own suite.
733
+ */
734
+ validationRunPlanId?: string;
735
+ }
736
+
737
+ export interface AutoimproveJobAnswerQuestionParams {
738
+ /**
739
+ * The message for Roark.
740
+ */
741
+ text: string;
742
+ }
743
+
744
+ export interface AutoimproveJobSendGuidanceParams {
745
+ /**
746
+ * The message for Roark.
747
+ */
748
+ text: string;
749
+ }
750
+
751
+ export declare namespace AutoimproveJob {
752
+ export {
753
+ type AutoimproveLogEntry as AutoimproveLogEntry,
754
+ type AutoimproveJobCreateResponse as AutoimproveJobCreateResponse,
755
+ type AutoimproveJobListResponse as AutoimproveJobListResponse,
756
+ type AutoimproveJobAnswerQuestionResponse as AutoimproveJobAnswerQuestionResponse,
757
+ type AutoimproveJobCancelResponse as AutoimproveJobCancelResponse,
758
+ type AutoimproveJobDismissResponse as AutoimproveJobDismissResponse,
759
+ type AutoimproveJobGetByIDResponse as AutoimproveJobGetByIDResponse,
760
+ type AutoimproveJobPromoteResponse as AutoimproveJobPromoteResponse,
761
+ type AutoimproveJobSendGuidanceResponse as AutoimproveJobSendGuidanceResponse,
762
+ type AutoimproveJobCreateParams as AutoimproveJobCreateParams,
763
+ type AutoimproveJobAnswerQuestionParams as AutoimproveJobAnswerQuestionParams,
764
+ type AutoimproveJobSendGuidanceParams as AutoimproveJobSendGuidanceParams,
765
+ };
766
+ }