@roarkanalytics/sdk 3.20.0 → 3.21.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 (79) hide show
  1. package/CHANGELOG.md +12 -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-fix.d.mts +495 -0
  12. package/resources/autoimprove-fix.d.mts.map +1 -0
  13. package/resources/autoimprove-fix.d.ts +495 -0
  14. package/resources/autoimprove-fix.d.ts.map +1 -0
  15. package/resources/autoimprove-fix.js +151 -0
  16. package/resources/autoimprove-fix.js.map +1 -0
  17. package/resources/autoimprove-fix.mjs +147 -0
  18. package/resources/autoimprove-fix.mjs.map +1 -0
  19. package/resources/config.d.mts +3 -0
  20. package/resources/config.d.mts.map +1 -1
  21. package/resources/config.d.ts +3 -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 +768 -144
  28. package/resources/customer-flow.d.mts.map +1 -1
  29. package/resources/customer-flow.d.ts +768 -144
  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 +32 -6
  40. package/resources/simulation-job.d.mts.map +1 -1
  41. package/resources/simulation-job.d.ts +32 -6
  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 +16 -3
  48. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  49. package/resources/simulation-run-plan-job.d.ts +16 -3
  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-fix.ts +766 -0
  65. package/src/resources/config.ts +6 -0
  66. package/src/resources/customer-flow-edge-case.ts +204 -36
  67. package/src/resources/customer-flow.ts +816 -144
  68. package/src/resources/index.ts +15 -0
  69. package/src/resources/simulation-job.ts +34 -6
  70. package/src/resources/simulation-persona.ts +98 -18
  71. package/src/resources/simulation-run-plan-job.ts +17 -3
  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.ts +1 -1
  78. package/version.js +1 -1
  79. package/version.mjs +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 AutoimproveFixAPI from './autoimprove-fix';
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 AutoimproveFix 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; a verified fix waits for promotion.
16
+ *
17
+ * Requires an active provider integration (Vapi or Retell) with agent config
18
+ * writes enabled. One live fix per agent: starting a second returns a conflict.
19
+ *
20
+ * The fix runs asynchronously; poll GET /v1/autoimprove/fix/{fixId} 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 autoimproveFix = await client.autoimproveFix.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: AutoimproveFixCreateParams,
36
+ options?: RequestOptions,
37
+ ): APIPromise<AutoimproveFixCreateResponse> {
38
+ return this._client.post('/v1/autoimprove/fix', { body, ...options });
39
+ }
40
+
41
+ /**
42
+ * List the Autoimprove fixes in this project, most recent first, capped at 100.
43
+ *
44
+ * A fix 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 autoimproveFixes = await client.autoimproveFix.list();
51
+ * ```
52
+ */
53
+ list(options?: RequestOptions): APIPromise<AutoimproveFixListResponse> {
54
+ return this._client.get('/v1/autoimprove/fix', options);
55
+ }
56
+
57
+ /**
58
+ * Answer the question a fix is blocked on. Only meaningful while the fix 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.autoimproveFix.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
+ fixID: string,
74
+ body: AutoimproveFixAnswerQuestionParams,
75
+ options?: RequestOptions,
76
+ ): APIPromise<AutoimproveFixAnswerQuestionResponse> {
77
+ return this._client.post(path`/v1/autoimprove/fix/${fixID}/answer`, { body, ...options });
78
+ }
79
+
80
+ /**
81
+ * Stop a live fix. Production is never changed by a cancel; everything the fix 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.autoimproveFix.cancel(
88
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
89
+ * );
90
+ * ```
91
+ */
92
+ cancel(fixID: string, options?: RequestOptions): APIPromise<AutoimproveFixCancelResponse> {
93
+ return this._client.post(path`/v1/autoimprove/fix/${fixID}/cancel`, options);
94
+ }
95
+
96
+ /**
97
+ * Discard a verified fix without promoting: production stays untouched and the
98
+ * staging resources are cleaned up. Only a fix in AWAITING_PROMOTE can be
99
+ * dismissed.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * const response = await client.autoimproveFix.dismiss(
104
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
105
+ * );
106
+ * ```
107
+ */
108
+ dismiss(fixID: string, options?: RequestOptions): APIPromise<AutoimproveFixDismissResponse> {
109
+ return this._client.post(path`/v1/autoimprove/fix/${fixID}/dismiss`, options);
110
+ }
111
+
112
+ /**
113
+ * Fetch one fix 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.autoimproveFix.getByID(
120
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
121
+ * );
122
+ * ```
123
+ */
124
+ getByID(fixID: string, options?: RequestOptions): APIPromise<AutoimproveFixGetByIDResponse> {
125
+ return this._client.get(path`/v1/autoimprove/fix/${fixID}`, options);
126
+ }
127
+
128
+ /**
129
+ * Apply the verified staging changes to the PRODUCTION agent. Only a fix 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.autoimproveFix.promote(
139
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
140
+ * );
141
+ * ```
142
+ */
143
+ promote(fixID: string, options?: RequestOptions): APIPromise<AutoimproveFixPromoteResponse> {
144
+ return this._client.post(path`/v1/autoimprove/fix/${fixID}/promote`, options);
145
+ }
146
+
147
+ /**
148
+ * Steer Roark mid-fix. The message is folded into its next decision and is
149
+ * binding. Accepted while the fix is live (RUNNING, NEEDS_INPUT, or PAUSED); a
150
+ * concluded fix returns a conflict.
151
+ *
152
+ * @example
153
+ * ```ts
154
+ * const response = await client.autoimproveFix.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
+ fixID: string,
164
+ body: AutoimproveFixSendGuidanceParams,
165
+ options?: RequestOptions,
166
+ ): APIPromise<AutoimproveFixSendGuidanceResponse> {
167
+ return this._client.post(path`/v1/autoimprove/fix/${fixID}/guidance`, { body, ...options });
168
+ }
169
+ }
170
+
171
+ /**
172
+ * One entry in the fix'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 AutoimproveFixCreateResponse {
215
+ /**
216
+ * One Autoimprove engagement: Roark autonomously improving one agent toward one
217
+ * objective metric. Roark only ever changes the staging agent (a shadow clone by
218
+ * default); production changes exactly once, when a verified fix is promoted.
219
+ */
220
+ data: AutoimproveFixCreateResponse.Data;
221
+ }
222
+
223
+ export namespace AutoimproveFixCreateResponse {
224
+ /**
225
+ * One Autoimprove engagement: Roark autonomously improving one agent toward one
226
+ * objective metric. Roark only ever changes the staging agent (a shadow clone by
227
+ * default); production changes exactly once, when a verified fix is promoted.
228
+ */
229
+ export interface Data {
230
+ id: string;
231
+
232
+ agentId: string;
233
+
234
+ baselineValue: number | null;
235
+
236
+ /**
237
+ * When the fix reached a terminal status (ISO 8601).
238
+ */
239
+ concludedAt: string | null;
240
+
241
+ /**
242
+ * When the fix 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 fix last changed (ISO 8601).
294
+ */
295
+ updatedAt: string;
296
+
297
+ validationRunPlanId: string | null;
298
+
299
+ workingMemory: string | null;
300
+ }
301
+ }
302
+
303
+ export interface AutoimproveFixListResponse {
304
+ data: Array<AutoimproveFixListResponse.Data>;
305
+ }
306
+
307
+ export namespace AutoimproveFixListResponse {
308
+ /**
309
+ * One Autoimprove engagement: Roark autonomously improving one agent toward one
310
+ * objective metric. Roark only ever changes the staging agent (a shadow clone by
311
+ * default); production changes exactly once, when a verified fix is promoted.
312
+ */
313
+ export interface Data {
314
+ id: string;
315
+
316
+ agentId: string;
317
+
318
+ baselineValue: number | null;
319
+
320
+ /**
321
+ * When the fix reached a terminal status (ISO 8601).
322
+ */
323
+ concludedAt: string | null;
324
+
325
+ /**
326
+ * When the fix 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 fix last changed (ISO 8601).
378
+ */
379
+ updatedAt: string;
380
+
381
+ validationRunPlanId: string | null;
382
+
383
+ workingMemory: string | null;
384
+ }
385
+ }
386
+
387
+ export interface AutoimproveFixAnswerQuestionResponse {
388
+ data: AutoimproveFixAnswerQuestionResponse.Data;
389
+ }
390
+
391
+ export namespace AutoimproveFixAnswerQuestionResponse {
392
+ export interface Data {
393
+ accepted: true;
394
+ }
395
+ }
396
+
397
+ export interface AutoimproveFixCancelResponse {
398
+ data: AutoimproveFixCancelResponse.Data;
399
+ }
400
+
401
+ export namespace AutoimproveFixCancelResponse {
402
+ export interface Data {
403
+ accepted: true;
404
+ }
405
+ }
406
+
407
+ export interface AutoimproveFixDismissResponse {
408
+ /**
409
+ * One Autoimprove engagement: Roark autonomously improving one agent toward one
410
+ * objective metric. Roark only ever changes the staging agent (a shadow clone by
411
+ * default); production changes exactly once, when a verified fix is promoted.
412
+ */
413
+ data: AutoimproveFixDismissResponse.Data;
414
+ }
415
+
416
+ export namespace AutoimproveFixDismissResponse {
417
+ /**
418
+ * One Autoimprove engagement: Roark autonomously improving one agent toward one
419
+ * objective metric. Roark only ever changes the staging agent (a shadow clone by
420
+ * default); production changes exactly once, when a verified fix is promoted.
421
+ */
422
+ export interface Data {
423
+ id: string;
424
+
425
+ agentId: string;
426
+
427
+ baselineValue: number | null;
428
+
429
+ /**
430
+ * When the fix reached a terminal status (ISO 8601).
431
+ */
432
+ concludedAt: string | null;
433
+
434
+ /**
435
+ * When the fix 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 fix last changed (ISO 8601).
487
+ */
488
+ updatedAt: string;
489
+
490
+ validationRunPlanId: string | null;
491
+
492
+ workingMemory: string | null;
493
+ }
494
+ }
495
+
496
+ export interface AutoimproveFixGetByIDResponse {
497
+ data: AutoimproveFixGetByIDResponse.Data;
498
+ }
499
+
500
+ export namespace AutoimproveFixGetByIDResponse {
501
+ /**
502
+ * One Autoimprove engagement: Roark autonomously improving one agent toward one
503
+ * objective metric. Roark only ever changes the staging agent (a shadow clone by
504
+ * default); production changes exactly once, when a verified fix is promoted.
505
+ */
506
+ export interface Data {
507
+ id: string;
508
+
509
+ agentId: string;
510
+
511
+ baselineValue: number | null;
512
+
513
+ /**
514
+ * When the fix reached a terminal status (ISO 8601).
515
+ */
516
+ concludedAt: string | null;
517
+
518
+ /**
519
+ * When the fix 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<AutoimproveFixAPI.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 fix last changed (ISO 8601).
576
+ */
577
+ updatedAt: string;
578
+
579
+ validationRunPlanId: string | null;
580
+
581
+ workingMemory: string | null;
582
+ }
583
+ }
584
+
585
+ export interface AutoimproveFixPromoteResponse {
586
+ /**
587
+ * One Autoimprove engagement: Roark autonomously improving one agent toward one
588
+ * objective metric. Roark only ever changes the staging agent (a shadow clone by
589
+ * default); production changes exactly once, when a verified fix is promoted.
590
+ */
591
+ data: AutoimproveFixPromoteResponse.Data;
592
+ }
593
+
594
+ export namespace AutoimproveFixPromoteResponse {
595
+ /**
596
+ * One Autoimprove engagement: Roark autonomously improving one agent toward one
597
+ * objective metric. Roark only ever changes the staging agent (a shadow clone by
598
+ * default); production changes exactly once, when a verified fix is promoted.
599
+ */
600
+ export interface Data {
601
+ id: string;
602
+
603
+ agentId: string;
604
+
605
+ baselineValue: number | null;
606
+
607
+ /**
608
+ * When the fix reached a terminal status (ISO 8601).
609
+ */
610
+ concludedAt: string | null;
611
+
612
+ /**
613
+ * When the fix 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 fix last changed (ISO 8601).
665
+ */
666
+ updatedAt: string;
667
+
668
+ validationRunPlanId: string | null;
669
+
670
+ workingMemory: string | null;
671
+ }
672
+ }
673
+
674
+ export interface AutoimproveFixSendGuidanceResponse {
675
+ data: AutoimproveFixSendGuidanceResponse.Data;
676
+ }
677
+
678
+ export namespace AutoimproveFixSendGuidanceResponse {
679
+ export interface Data {
680
+ accepted: true;
681
+ }
682
+ }
683
+
684
+ export interface AutoimproveFixCreateParams {
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 fix 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 10.
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 AutoimproveFixAnswerQuestionParams {
738
+ /**
739
+ * The message for Roark.
740
+ */
741
+ text: string;
742
+ }
743
+
744
+ export interface AutoimproveFixSendGuidanceParams {
745
+ /**
746
+ * The message for Roark.
747
+ */
748
+ text: string;
749
+ }
750
+
751
+ export declare namespace AutoimproveFix {
752
+ export {
753
+ type AutoimproveLogEntry as AutoimproveLogEntry,
754
+ type AutoimproveFixCreateResponse as AutoimproveFixCreateResponse,
755
+ type AutoimproveFixListResponse as AutoimproveFixListResponse,
756
+ type AutoimproveFixAnswerQuestionResponse as AutoimproveFixAnswerQuestionResponse,
757
+ type AutoimproveFixCancelResponse as AutoimproveFixCancelResponse,
758
+ type AutoimproveFixDismissResponse as AutoimproveFixDismissResponse,
759
+ type AutoimproveFixGetByIDResponse as AutoimproveFixGetByIDResponse,
760
+ type AutoimproveFixPromoteResponse as AutoimproveFixPromoteResponse,
761
+ type AutoimproveFixSendGuidanceResponse as AutoimproveFixSendGuidanceResponse,
762
+ type AutoimproveFixCreateParams as AutoimproveFixCreateParams,
763
+ type AutoimproveFixAnswerQuestionParams as AutoimproveFixAnswerQuestionParams,
764
+ type AutoimproveFixSendGuidanceParams as AutoimproveFixSendGuidanceParams,
765
+ };
766
+ }