@getmodus/sdk 0.8.0 → 0.10.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.
@@ -8,7 +8,19 @@ var OPERATIONS = {
8
8
  pathParams: [],
9
9
  queryParams: ["pageToken", "pageSize", "type"],
10
10
  requestSchema: null,
11
- responseSchema: "ListConnectionsResponseDto"
11
+ responseSchema: "ListConnectionsResponseDto",
12
+ idempotent: false
13
+ },
14
+ "ConnectionsController_listSelections": {
15
+ method: "GET",
16
+ path: "/api/v1/connections/{connectionId}/selections",
17
+ service: "modus-api",
18
+ serverUrl: "https://api.getmodus.com",
19
+ pathParams: ["connectionId"],
20
+ queryParams: ["pageToken", "pageSize"],
21
+ requestSchema: null,
22
+ responseSchema: "ListConnectionSelectionsResponseDto",
23
+ idempotent: false
12
24
  },
13
25
  "ContextCreatorsController_createLink": {
14
26
  method: "POST",
@@ -18,7 +30,8 @@ var OPERATIONS = {
18
30
  pathParams: [],
19
31
  queryParams: [],
20
32
  requestSchema: "CreateLinkDto",
21
- responseSchema: "CreatedContextItemResponseDto"
33
+ responseSchema: "CreatedContextItemResponseDto",
34
+ idempotent: false
22
35
  },
23
36
  "ContextCreatorsController_createNote": {
24
37
  method: "POST",
@@ -28,7 +41,8 @@ var OPERATIONS = {
28
41
  pathParams: [],
29
42
  queryParams: [],
30
43
  requestSchema: "CreateNoteDto",
31
- responseSchema: "CreatedContextItemResponseDto"
44
+ responseSchema: "CreatedContextItemResponseDto",
45
+ idempotent: false
32
46
  },
33
47
  "ContextCreatorsController_createSavedQuery": {
34
48
  method: "POST",
@@ -38,7 +52,8 @@ var OPERATIONS = {
38
52
  pathParams: [],
39
53
  queryParams: [],
40
54
  requestSchema: "CreateSavedQueryDto",
41
- responseSchema: "CreatedContextItemResponseDto"
55
+ responseSchema: "CreatedContextItemResponseDto",
56
+ idempotent: false
42
57
  },
43
58
  "ContextFilesController_finalize": {
44
59
  method: "POST",
@@ -48,7 +63,8 @@ var OPERATIONS = {
48
63
  pathParams: ["uploadId"],
49
64
  queryParams: [],
50
65
  requestSchema: "FinalizeUploadDto",
51
- responseSchema: "FileUploadResourceDto"
66
+ responseSchema: "FileUploadResourceDto",
67
+ idempotent: false
52
68
  },
53
69
  "ContextFilesController_finalizeMany": {
54
70
  method: "POST",
@@ -58,7 +74,8 @@ var OPERATIONS = {
58
74
  pathParams: [],
59
75
  queryParams: [],
60
76
  requestSchema: "BulkFinalizeDto",
61
- responseSchema: "BulkFinalizeResponseDto"
77
+ responseSchema: "BulkFinalizeResponseDto",
78
+ idempotent: false
62
79
  },
63
80
  "ContextFilesController_get": {
64
81
  method: "GET",
@@ -68,7 +85,8 @@ var OPERATIONS = {
68
85
  pathParams: ["uploadId"],
69
86
  queryParams: [],
70
87
  requestSchema: null,
71
- responseSchema: "FileUploadResourceDto"
88
+ responseSchema: "FileUploadResourceDto",
89
+ idempotent: false
72
90
  },
73
91
  "ContextFilesController_list": {
74
92
  method: "GET",
@@ -78,7 +96,8 @@ var OPERATIONS = {
78
96
  pathParams: [],
79
97
  queryParams: ["pageToken", "pageSize"],
80
98
  requestSchema: null,
81
- responseSchema: "ListFilesResponseDto"
99
+ responseSchema: "ListFilesResponseDto",
100
+ idempotent: false
82
101
  },
83
102
  "ContextFilesController_uploadFromUrl": {
84
103
  method: "POST",
@@ -88,7 +107,8 @@ var OPERATIONS = {
88
107
  pathParams: [],
89
108
  queryParams: [],
90
109
  requestSchema: "UploadFromUrlDto",
91
- responseSchema: "FileUploadResourceDto"
110
+ responseSchema: "FileUploadResourceDto",
111
+ idempotent: false
92
112
  },
93
113
  "ContextFilesController_uploadFromUrls": {
94
114
  method: "POST",
@@ -98,7 +118,8 @@ var OPERATIONS = {
98
118
  pathParams: [],
99
119
  queryParams: [],
100
120
  requestSchema: "BulkUploadFromUrlsDto",
101
- responseSchema: "BulkUploadFromUrlsResponseDto"
121
+ responseSchema: "BulkUploadFromUrlsResponseDto",
122
+ idempotent: false
102
123
  },
103
124
  "ContextFilesController_uploadUrl": {
104
125
  method: "POST",
@@ -108,7 +129,8 @@ var OPERATIONS = {
108
129
  pathParams: [],
109
130
  queryParams: [],
110
131
  requestSchema: "UploadUrlDto",
111
- responseSchema: "UploadUrlResponseDto"
132
+ responseSchema: "UploadUrlResponseDto",
133
+ idempotent: false
112
134
  },
113
135
  "ContextFilesController_uploadUrls": {
114
136
  method: "POST",
@@ -118,7 +140,19 @@ var OPERATIONS = {
118
140
  pathParams: [],
119
141
  queryParams: [],
120
142
  requestSchema: "BulkUploadUrlsDto",
121
- responseSchema: "BulkUploadUrlsResponseDto"
143
+ responseSchema: "BulkUploadUrlsResponseDto",
144
+ idempotent: false
145
+ },
146
+ "ContextItemAccessController_updateAccess": {
147
+ method: "PATCH",
148
+ path: "/api/v1/context/items/{uid}/access",
149
+ service: "modus-api",
150
+ serverUrl: "https://api.getmodus.com",
151
+ pathParams: ["uid"],
152
+ queryParams: [],
153
+ requestSchema: "UpdateContextItemAccessDto",
154
+ responseSchema: "ContextItemAccessResponseDto",
155
+ idempotent: false
122
156
  },
123
157
  "ContextItemsController_delete": {
124
158
  method: "DELETE",
@@ -128,7 +162,8 @@ var OPERATIONS = {
128
162
  pathParams: ["uid"],
129
163
  queryParams: [],
130
164
  requestSchema: null,
131
- responseSchema: "DeleteContextItemResponseDto"
165
+ responseSchema: "DeleteContextItemResponseDto",
166
+ idempotent: false
132
167
  },
133
168
  "ContextItemsController_get": {
134
169
  method: "GET",
@@ -138,7 +173,8 @@ var OPERATIONS = {
138
173
  pathParams: ["uid"],
139
174
  queryParams: [],
140
175
  requestSchema: null,
141
- responseSchema: "ContextItemDto"
176
+ responseSchema: "ContextItemDto",
177
+ idempotent: false
142
178
  },
143
179
  "ContextItemsController_list": {
144
180
  method: "GET",
@@ -148,7 +184,8 @@ var OPERATIONS = {
148
184
  pathParams: [],
149
185
  queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics", "connectionIds", "parentUids", "ancestorUids"],
150
186
  requestSchema: null,
151
- responseSchema: "ListContextItemsResponseDto"
187
+ responseSchema: "ListContextItemsResponseDto",
188
+ idempotent: false
152
189
  },
153
190
  "ContextItemsController_listValues": {
154
191
  method: "GET",
@@ -156,9 +193,10 @@ var OPERATIONS = {
156
193
  service: "modus-api",
157
194
  serverUrl: "https://api.getmodus.com",
158
195
  pathParams: ["uid"],
159
- queryParams: ["contextType", "contentKeyPath", "pageSize", "offset", "pageToken", "searchQuery", "dataPathPrefix"],
196
+ queryParams: ["contextType", "contentKeyPath", "pageSize", "pageToken", "searchQuery"],
160
197
  requestSchema: null,
161
- responseSchema: "ListContextItemValuesResponseDto"
198
+ responseSchema: "ListContextItemValuesResponseDto",
199
+ idempotent: false
162
200
  },
163
201
  "ContextItemsController_lookup": {
164
202
  method: "POST",
@@ -168,7 +206,8 @@ var OPERATIONS = {
168
206
  pathParams: [],
169
207
  queryParams: [],
170
208
  requestSchema: "LookupContextItemDto",
171
- responseSchema: "LookupContextItemResponseDto"
209
+ responseSchema: "LookupContextItemResponseDto",
210
+ idempotent: true
172
211
  },
173
212
  "ContextItemsController_move": {
174
213
  method: "POST",
@@ -178,7 +217,8 @@ var OPERATIONS = {
178
217
  pathParams: ["uid"],
179
218
  queryParams: [],
180
219
  requestSchema: "MoveContextItemDto",
181
- responseSchema: "MoveContextItemResponseDto"
220
+ responseSchema: "MoveContextItemResponseDto",
221
+ idempotent: false
182
222
  },
183
223
  "ContextItemsController_update": {
184
224
  method: "PATCH",
@@ -188,7 +228,8 @@ var OPERATIONS = {
188
228
  pathParams: ["uid"],
189
229
  queryParams: ["updateMask"],
190
230
  requestSchema: "UpdateContextItemDto",
191
- responseSchema: null
231
+ responseSchema: null,
232
+ idempotent: false
192
233
  },
193
234
  "CustomContextItemsController_batchCreate": {
194
235
  method: "POST",
@@ -198,7 +239,8 @@ var OPERATIONS = {
198
239
  pathParams: [],
199
240
  queryParams: [],
200
241
  requestSchema: "BatchCreateCustomContextItemsDto",
201
- responseSchema: "BatchCreateCustomContextItemsResponseDto"
242
+ responseSchema: "BatchCreateCustomContextItemsResponseDto",
243
+ idempotent: false
202
244
  },
203
245
  "CustomContextItemsController_create": {
204
246
  method: "POST",
@@ -208,7 +250,8 @@ var OPERATIONS = {
208
250
  pathParams: [],
209
251
  queryParams: [],
210
252
  requestSchema: "CreateCustomContextItemDto",
211
- responseSchema: "CreatedCustomContextItemResponseDto"
253
+ responseSchema: "CreatedCustomContextItemResponseDto",
254
+ idempotent: false
212
255
  },
213
256
  "CustomContextItemsController_createRelations": {
214
257
  method: "POST",
@@ -218,7 +261,8 @@ var OPERATIONS = {
218
261
  pathParams: [],
219
262
  queryParams: [],
220
263
  requestSchema: "BatchCreateCustomContextItemRelationsDto",
221
- responseSchema: "BatchCreateCustomContextItemRelationsResponseDto"
264
+ responseSchema: "BatchCreateCustomContextItemRelationsResponseDto",
265
+ idempotent: false
222
266
  },
223
267
  "CustomContextItemsController_delete": {
224
268
  method: "DELETE",
@@ -228,7 +272,8 @@ var OPERATIONS = {
228
272
  pathParams: ["uid"],
229
273
  queryParams: [],
230
274
  requestSchema: null,
231
- responseSchema: "DeleteContextItemResponseDto"
275
+ responseSchema: "DeleteContextItemResponseDto",
276
+ idempotent: false
232
277
  },
233
278
  "CustomContextItemsController_get": {
234
279
  method: "GET",
@@ -238,7 +283,8 @@ var OPERATIONS = {
238
283
  pathParams: ["uid"],
239
284
  queryParams: [],
240
285
  requestSchema: null,
241
- responseSchema: "ContextItemDto"
286
+ responseSchema: "ContextItemDto",
287
+ idempotent: false
242
288
  },
243
289
  "CustomContextItemsController_list": {
244
290
  method: "GET",
@@ -248,7 +294,8 @@ var OPERATIONS = {
248
294
  pathParams: [],
249
295
  queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics"],
250
296
  requestSchema: null,
251
- responseSchema: "ListCustomContextItemsResponseDto"
297
+ responseSchema: "ListCustomContextItemsResponseDto",
298
+ idempotent: false
252
299
  },
253
300
  "CustomContextItemsController_update": {
254
301
  method: "PATCH",
@@ -258,7 +305,8 @@ var OPERATIONS = {
258
305
  pathParams: ["uid"],
259
306
  queryParams: [],
260
307
  requestSchema: "UpdateCustomContextItemDto",
261
- responseSchema: null
308
+ responseSchema: null,
309
+ idempotent: false
262
310
  },
263
311
  "DashboardsController_acceptOwnership": {
264
312
  method: "POST",
@@ -268,7 +316,8 @@ var OPERATIONS = {
268
316
  pathParams: ["dashboardId"],
269
317
  queryParams: [],
270
318
  requestSchema: null,
271
- responseSchema: "DashboardDto"
319
+ responseSchema: "DashboardDto",
320
+ idempotent: false
272
321
  },
273
322
  "DashboardsController_cancelOwnership": {
274
323
  method: "DELETE",
@@ -278,7 +327,8 @@ var OPERATIONS = {
278
327
  pathParams: ["dashboardId"],
279
328
  queryParams: [],
280
329
  requestSchema: null,
281
- responseSchema: "DashboardDto"
330
+ responseSchema: "DashboardDto",
331
+ idempotent: false
282
332
  },
283
333
  "DashboardsController_create": {
284
334
  method: "POST",
@@ -288,7 +338,8 @@ var OPERATIONS = {
288
338
  pathParams: [],
289
339
  queryParams: [],
290
340
  requestSchema: "CreateDashboardDto",
291
- responseSchema: "DashboardDto"
341
+ responseSchema: "DashboardDto",
342
+ idempotent: false
292
343
  },
293
344
  "DashboardsController_createElement": {
294
345
  method: "POST",
@@ -298,7 +349,8 @@ var OPERATIONS = {
298
349
  pathParams: ["dashboardId"],
299
350
  queryParams: [],
300
351
  requestSchema: "CreateDashboardElementDto",
301
- responseSchema: "DashboardElementResponseDto"
352
+ responseSchema: "DashboardElementResponseDto",
353
+ idempotent: false
302
354
  },
303
355
  "DashboardsController_delete": {
304
356
  method: "DELETE",
@@ -308,7 +360,8 @@ var OPERATIONS = {
308
360
  pathParams: ["dashboardId"],
309
361
  queryParams: [],
310
362
  requestSchema: null,
311
- responseSchema: null
363
+ responseSchema: null,
364
+ idempotent: false
312
365
  },
313
366
  "DashboardsController_get": {
314
367
  method: "GET",
@@ -318,7 +371,8 @@ var OPERATIONS = {
318
371
  pathParams: ["dashboardId"],
319
372
  queryParams: ["view"],
320
373
  requestSchema: null,
321
- responseSchema: "DashboardDto"
374
+ responseSchema: "DashboardDto",
375
+ idempotent: false
322
376
  },
323
377
  "DashboardsController_getElement": {
324
378
  method: "GET",
@@ -328,7 +382,8 @@ var OPERATIONS = {
328
382
  pathParams: ["dashboardId", "elementId"],
329
383
  queryParams: [],
330
384
  requestSchema: null,
331
- responseSchema: "DashboardElementResponseDto"
385
+ responseSchema: "DashboardElementResponseDto",
386
+ idempotent: false
332
387
  },
333
388
  "DashboardsController_getVersion": {
334
389
  method: "GET",
@@ -338,7 +393,8 @@ var OPERATIONS = {
338
393
  pathParams: ["dashboardId", "versionId"],
339
394
  queryParams: [],
340
395
  requestSchema: null,
341
- responseSchema: "DashboardDto"
396
+ responseSchema: "DashboardDto",
397
+ idempotent: false
342
398
  },
343
399
  "DashboardsController_list": {
344
400
  method: "GET",
@@ -348,7 +404,8 @@ var OPERATIONS = {
348
404
  pathParams: [],
349
405
  queryParams: ["view"],
350
406
  requestSchema: null,
351
- responseSchema: "ListDashboardsResponseDto"
407
+ responseSchema: "ListDashboardsResponseDto",
408
+ idempotent: false
352
409
  },
353
410
  "DashboardsController_listDraftSnapshots": {
354
411
  method: "GET",
@@ -358,7 +415,8 @@ var OPERATIONS = {
358
415
  pathParams: ["dashboardId"],
359
416
  queryParams: [],
360
417
  requestSchema: null,
361
- responseSchema: "ListDashboardDraftSnapshotsResponseDto"
418
+ responseSchema: "ListDashboardDraftSnapshotsResponseDto",
419
+ idempotent: false
362
420
  },
363
421
  "DashboardsController_listElements": {
364
422
  method: "GET",
@@ -368,7 +426,8 @@ var OPERATIONS = {
368
426
  pathParams: ["dashboardId"],
369
427
  queryParams: [],
370
428
  requestSchema: null,
371
- responseSchema: "DashboardElementsListResponseDto"
429
+ responseSchema: "DashboardElementsListResponseDto",
430
+ idempotent: false
372
431
  },
373
432
  "DashboardsController_listVersions": {
374
433
  method: "GET",
@@ -378,7 +437,8 @@ var OPERATIONS = {
378
437
  pathParams: ["dashboardId"],
379
438
  queryParams: [],
380
439
  requestSchema: null,
381
- responseSchema: "ListDashboardVersionsResponseDto"
440
+ responseSchema: "ListDashboardVersionsResponseDto",
441
+ idempotent: false
382
442
  },
383
443
  "DashboardsController_publish": {
384
444
  method: "POST",
@@ -388,7 +448,8 @@ var OPERATIONS = {
388
448
  pathParams: ["dashboardId"],
389
449
  queryParams: [],
390
450
  requestSchema: "PublishDashboardDto",
391
- responseSchema: "PublishDashboardResponseDto"
451
+ responseSchema: "PublishDashboardResponseDto",
452
+ idempotent: false
392
453
  },
393
454
  "DashboardsController_restore": {
394
455
  method: "POST",
@@ -398,7 +459,8 @@ var OPERATIONS = {
398
459
  pathParams: ["dashboardId", "versionId"],
399
460
  queryParams: [],
400
461
  requestSchema: null,
401
- responseSchema: "DashboardDto"
462
+ responseSchema: "DashboardDto",
463
+ idempotent: false
402
464
  },
403
465
  "DashboardsController_transferOwnership": {
404
466
  method: "POST",
@@ -408,7 +470,8 @@ var OPERATIONS = {
408
470
  pathParams: ["dashboardId"],
409
471
  queryParams: [],
410
472
  requestSchema: "TransferDashboardOwnershipDto",
411
- responseSchema: "DashboardDto"
473
+ responseSchema: "DashboardDto",
474
+ idempotent: false
412
475
  },
413
476
  "DashboardsController_updateAccess": {
414
477
  method: "PATCH",
@@ -418,7 +481,8 @@ var OPERATIONS = {
418
481
  pathParams: ["dashboardId"],
419
482
  queryParams: [],
420
483
  requestSchema: "UpdateDashboardAccessDto",
421
- responseSchema: "DashboardDto"
484
+ responseSchema: "DashboardDto",
485
+ idempotent: false
422
486
  },
423
487
  "DashboardsController_updateDraft": {
424
488
  method: "PATCH",
@@ -428,7 +492,8 @@ var OPERATIONS = {
428
492
  pathParams: ["dashboardId"],
429
493
  queryParams: [],
430
494
  requestSchema: "UpdateDashboardDraftDto",
431
- responseSchema: "DashboardDto"
495
+ responseSchema: "DashboardDto",
496
+ idempotent: false
432
497
  },
433
498
  "DashboardsController_updateElement": {
434
499
  method: "PATCH",
@@ -438,7 +503,8 @@ var OPERATIONS = {
438
503
  pathParams: ["dashboardId", "elementId"],
439
504
  queryParams: [],
440
505
  requestSchema: "UpdateDashboardElementDto",
441
- responseSchema: "DashboardDto"
506
+ responseSchema: "DashboardDto",
507
+ idempotent: false
442
508
  },
443
509
  "DashboardsController_updateLayout": {
444
510
  method: "PATCH",
@@ -448,7 +514,8 @@ var OPERATIONS = {
448
514
  pathParams: ["dashboardId"],
449
515
  queryParams: [],
450
516
  requestSchema: "UpdateDashboardLayoutDto",
451
- responseSchema: "DashboardDto"
517
+ responseSchema: "DashboardDto",
518
+ idempotent: false
452
519
  },
453
520
  "EvaluationsController_getConfig": {
454
521
  method: "GET",
@@ -458,7 +525,8 @@ var OPERATIONS = {
458
525
  pathParams: ["id"],
459
526
  queryParams: [],
460
527
  requestSchema: null,
461
- responseSchema: "EvaluationConfigDto"
528
+ responseSchema: "EvaluationConfigDto",
529
+ idempotent: false
462
530
  },
463
531
  "EvaluationsController_getRun": {
464
532
  method: "GET",
@@ -468,7 +536,8 @@ var OPERATIONS = {
468
536
  pathParams: ["id", "runId"],
469
537
  queryParams: [],
470
538
  requestSchema: null,
471
- responseSchema: "EvaluationRunWithResultsDto"
539
+ responseSchema: "EvaluationRunWithResultsDto",
540
+ idempotent: false
472
541
  },
473
542
  "EvaluationsController_listRuns": {
474
543
  method: "GET",
@@ -478,7 +547,8 @@ var OPERATIONS = {
478
547
  pathParams: ["id"],
479
548
  queryParams: ["pageSize", "pageToken"],
480
549
  requestSchema: null,
481
- responseSchema: "ListEvaluationRunsResponseDto"
550
+ responseSchema: "ListEvaluationRunsResponseDto",
551
+ idempotent: false
482
552
  },
483
553
  "EvaluationsController_triggerRun": {
484
554
  method: "POST",
@@ -488,7 +558,8 @@ var OPERATIONS = {
488
558
  pathParams: ["id"],
489
559
  queryParams: [],
490
560
  requestSchema: null,
491
- responseSchema: "TriggerEvaluationRunResponseDto"
561
+ responseSchema: "TriggerEvaluationRunResponseDto",
562
+ idempotent: false
492
563
  },
493
564
  "EvaluationsController_updateConfig": {
494
565
  method: "PUT",
@@ -498,7 +569,8 @@ var OPERATIONS = {
498
569
  pathParams: ["id"],
499
570
  queryParams: [],
500
571
  requestSchema: "UpdateEvaluationConfigDto",
501
- responseSchema: "EvaluationConfigDto"
572
+ responseSchema: "EvaluationConfigDto",
573
+ idempotent: false
502
574
  },
503
575
  "IngestedDataController_upload": {
504
576
  method: "POST",
@@ -508,7 +580,8 @@ var OPERATIONS = {
508
580
  pathParams: [],
509
581
  queryParams: [],
510
582
  requestSchema: "CreateIngestedDataDto",
511
- responseSchema: "CreatedIngestedDataResponseDto"
583
+ responseSchema: "CreatedIngestedDataResponseDto",
584
+ idempotent: true
512
585
  },
513
586
  "MemberGroupsController_list": {
514
587
  method: "GET",
@@ -518,27 +591,19 @@ var OPERATIONS = {
518
591
  pathParams: [],
519
592
  queryParams: [],
520
593
  requestSchema: null,
521
- responseSchema: "ListMemberGroupsResponseDto"
594
+ responseSchema: "ListMemberGroupsResponseDto",
595
+ idempotent: false
522
596
  },
523
- "ModusChatController_chat": {
597
+ "ModusContextComposeController_compose": {
524
598
  method: "POST",
525
- path: "/api/v1/modus/chat",
526
- service: "modus-api",
527
- serverUrl: "https://api.getmodus.com",
599
+ path: "/agent/v1/modus/context",
600
+ service: "agent-service",
601
+ serverUrl: "https://agent.getmodus.com",
528
602
  pathParams: [],
529
603
  queryParams: [],
530
- requestSchema: "ModusChatRequestDto",
531
- responseSchema: "ModusChatResponseDto"
532
- },
533
- "ModusChatController_chatContinue": {
534
- method: "POST",
535
- path: "/api/v1/modus/conversations/{threadId}/chat",
536
- service: "modus-api",
537
- serverUrl: "https://api.getmodus.com",
538
- pathParams: ["threadId"],
539
- queryParams: [],
540
- requestSchema: "ModusChatRequestDto",
541
- responseSchema: "ModusChatResponseDto"
604
+ requestSchema: "ModusContextRequestDto",
605
+ responseSchema: "ModusContextResponseDto",
606
+ idempotent: true
542
607
  },
543
608
  "ModusContextController_compose": {
544
609
  method: "POST",
@@ -548,7 +613,8 @@ var OPERATIONS = {
548
613
  pathParams: [],
549
614
  queryParams: [],
550
615
  requestSchema: "ModusContextRequestDto",
551
- responseSchema: "ModusContextResponseDto"
616
+ responseSchema: "ModusContextResponseDto",
617
+ idempotent: false
552
618
  },
553
619
  "ModusConversationsController_get": {
554
620
  method: "GET",
@@ -558,7 +624,8 @@ var OPERATIONS = {
558
624
  pathParams: ["threadId"],
559
625
  queryParams: [],
560
626
  requestSchema: null,
561
- responseSchema: "ConversationDto"
627
+ responseSchema: "ConversationDto",
628
+ idempotent: false
562
629
  },
563
630
  "ModusConversationsController_list": {
564
631
  method: "GET",
@@ -568,7 +635,8 @@ var OPERATIONS = {
568
635
  pathParams: [],
569
636
  queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "source", "sourceRef", "timeframe", "includeTools", "kind"],
570
637
  requestSchema: null,
571
- responseSchema: "ListConversationsResponseDto"
638
+ responseSchema: "ListConversationsResponseDto",
639
+ idempotent: false
572
640
  },
573
641
  "ModusRunsController_create": {
574
642
  method: "POST",
@@ -578,7 +646,8 @@ var OPERATIONS = {
578
646
  pathParams: [],
579
647
  queryParams: [],
580
648
  requestSchema: "ModusRunDto",
581
- responseSchema: null
649
+ responseSchema: null,
650
+ idempotent: false
582
651
  },
583
652
  "OrgMembersController_list": {
584
653
  method: "GET",
@@ -588,7 +657,8 @@ var OPERATIONS = {
588
657
  pathParams: [],
589
658
  queryParams: [],
590
659
  requestSchema: null,
591
- responseSchema: "ListOrgMembersResponseDto"
660
+ responseSchema: "ListOrgMembersResponseDto",
661
+ idempotent: false
592
662
  },
593
663
  "ResumeRunsController_create": {
594
664
  method: "POST",
@@ -598,7 +668,8 @@ var OPERATIONS = {
598
668
  pathParams: ["runId"],
599
669
  queryParams: [],
600
670
  requestSchema: "ResumeRunDto",
601
- responseSchema: null
671
+ responseSchema: null,
672
+ idempotent: false
602
673
  },
603
674
  "RunLifecycleController_active": {
604
675
  method: "GET",
@@ -608,7 +679,8 @@ var OPERATIONS = {
608
679
  pathParams: [],
609
680
  queryParams: ["pageToken", "pageSize"],
610
681
  requestSchema: null,
611
- responseSchema: "ActiveRunsResponseDto"
682
+ responseSchema: "ActiveRunsResponseDto",
683
+ idempotent: false
612
684
  },
613
685
  "RunLifecycleController_activeBySession": {
614
686
  method: "POST",
@@ -618,7 +690,8 @@ var OPERATIONS = {
618
690
  pathParams: [],
619
691
  queryParams: [],
620
692
  requestSchema: "ActiveRunsBySessionDto",
621
- responseSchema: "ActiveRunsBySessionResponseDto"
693
+ responseSchema: "ActiveRunsBySessionResponseDto",
694
+ idempotent: true
622
695
  },
623
696
  "RunLifecycleController_cancel": {
624
697
  method: "POST",
@@ -628,7 +701,8 @@ var OPERATIONS = {
628
701
  pathParams: ["runId"],
629
702
  queryParams: [],
630
703
  requestSchema: "CancelRunDto",
631
- responseSchema: null
704
+ responseSchema: null,
705
+ idempotent: true
632
706
  },
633
707
  "RunLifecycleController_editQueued": {
634
708
  method: "POST",
@@ -638,7 +712,8 @@ var OPERATIONS = {
638
712
  pathParams: ["runId"],
639
713
  queryParams: [],
640
714
  requestSchema: "EditQueuedRunDto",
641
- responseSchema: null
715
+ responseSchema: "RunAdmissionResponseDto",
716
+ idempotent: false
642
717
  },
643
718
  "RunLifecycleController_events": {
644
719
  method: "GET",
@@ -648,7 +723,8 @@ var OPERATIONS = {
648
723
  pathParams: ["runId"],
649
724
  queryParams: [],
650
725
  requestSchema: null,
651
- responseSchema: null
726
+ responseSchema: "RunEventsPollResponseDto",
727
+ idempotent: false
652
728
  },
653
729
  "RunLifecycleController_interrupt": {
654
730
  method: "POST",
@@ -658,7 +734,8 @@ var OPERATIONS = {
658
734
  pathParams: ["runId"],
659
735
  queryParams: [],
660
736
  requestSchema: "InterruptRunDto",
661
- responseSchema: null
737
+ responseSchema: "RunAdmissionResponseDto",
738
+ idempotent: true
662
739
  },
663
740
  "RunLifecycleController_stream": {
664
741
  method: "GET",
@@ -668,27 +745,19 @@ var OPERATIONS = {
668
745
  pathParams: ["runId"],
669
746
  queryParams: [],
670
747
  requestSchema: null,
671
- responseSchema: null
748
+ responseSchema: null,
749
+ idempotent: false
672
750
  },
673
- "ScopeChatController_chat": {
751
+ "ScopeContextComposeController_compose": {
674
752
  method: "POST",
675
- path: "/api/v1/scopes/{id}/chat",
676
- service: "modus-api",
677
- serverUrl: "https://api.getmodus.com",
753
+ path: "/agent/v1/scopes/{id}/context",
754
+ service: "agent-service",
755
+ serverUrl: "https://agent.getmodus.com",
678
756
  pathParams: ["id"],
679
757
  queryParams: [],
680
- requestSchema: "SkillChatRequestDto",
681
- responseSchema: "SkillChatResponseDto"
682
- },
683
- "ScopeChatController_chatContinue": {
684
- method: "POST",
685
- path: "/api/v1/scopes/{id}/conversations/{threadId}/chat",
686
- service: "modus-api",
687
- serverUrl: "https://api.getmodus.com",
688
- pathParams: ["id", "threadId"],
689
- queryParams: [],
690
- requestSchema: "SkillChatRequestDto",
691
- responseSchema: "SkillChatResponseDto"
758
+ requestSchema: "ComposeSkillContextRequestDto",
759
+ responseSchema: "ComposeSkillContextResponseDto",
760
+ idempotent: true
692
761
  },
693
762
  "ScopeContextController_compose": {
694
763
  method: "POST",
@@ -698,7 +767,8 @@ var OPERATIONS = {
698
767
  pathParams: ["id"],
699
768
  queryParams: [],
700
769
  requestSchema: "ComposeSkillContextRequestDto",
701
- responseSchema: "ComposeSkillContextResponseDto"
770
+ responseSchema: "ComposeSkillContextResponseDto",
771
+ idempotent: false
702
772
  },
703
773
  "ScopeConversationsController_get": {
704
774
  method: "GET",
@@ -708,7 +778,8 @@ var OPERATIONS = {
708
778
  pathParams: ["id", "threadId"],
709
779
  queryParams: ["messageLimit", "beforeMessageIndex"],
710
780
  requestSchema: null,
711
- responseSchema: "ConversationDto"
781
+ responseSchema: "ConversationDto",
782
+ idempotent: false
712
783
  },
713
784
  "ScopeConversationsController_list": {
714
785
  method: "GET",
@@ -718,7 +789,8 @@ var OPERATIONS = {
718
789
  pathParams: ["id"],
719
790
  queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "source", "sourceRef", "timeframe", "includeTools"],
720
791
  requestSchema: null,
721
- responseSchema: "ListConversationsResponseDto"
792
+ responseSchema: "ListConversationsResponseDto",
793
+ idempotent: false
722
794
  },
723
795
  "ScopeInterfacesController_add": {
724
796
  method: "POST",
@@ -728,7 +800,8 @@ var OPERATIONS = {
728
800
  pathParams: ["id"],
729
801
  queryParams: [],
730
802
  requestSchema: "AddScopeInterfaceDto",
731
- responseSchema: "ScopeInterfaceDto"
803
+ responseSchema: "ScopeInterfaceDto",
804
+ idempotent: false
732
805
  },
733
806
  "ScopeInterfacesController_delete": {
734
807
  method: "DELETE",
@@ -738,7 +811,8 @@ var OPERATIONS = {
738
811
  pathParams: ["id", "interfaceId"],
739
812
  queryParams: [],
740
813
  requestSchema: null,
741
- responseSchema: null
814
+ responseSchema: null,
815
+ idempotent: false
742
816
  },
743
817
  "ScopeInterfacesController_list": {
744
818
  method: "GET",
@@ -748,7 +822,8 @@ var OPERATIONS = {
748
822
  pathParams: ["id"],
749
823
  queryParams: [],
750
824
  requestSchema: null,
751
- responseSchema: "ListScopeInterfacesResponseDto"
825
+ responseSchema: "ListScopeInterfacesResponseDto",
826
+ idempotent: false
752
827
  },
753
828
  "ScopeInterfacesController_update": {
754
829
  method: "PATCH",
@@ -758,7 +833,8 @@ var OPERATIONS = {
758
833
  pathParams: ["id", "interfaceId"],
759
834
  queryParams: ["updateMask"],
760
835
  requestSchema: "UpdateScopeInterfaceDto",
761
- responseSchema: "ScopeInterfaceDto"
836
+ responseSchema: "ScopeInterfaceDto",
837
+ idempotent: false
762
838
  },
763
839
  "ScopeMemoriesController_delete": {
764
840
  method: "DELETE",
@@ -768,7 +844,8 @@ var OPERATIONS = {
768
844
  pathParams: ["id", "memoryId"],
769
845
  queryParams: [],
770
846
  requestSchema: null,
771
- responseSchema: null
847
+ responseSchema: null,
848
+ idempotent: false
772
849
  },
773
850
  "ScopeMemoriesController_list": {
774
851
  method: "GET",
@@ -778,7 +855,8 @@ var OPERATIONS = {
778
855
  pathParams: ["id"],
779
856
  queryParams: ["pageToken", "pageSize", "userId", "limit"],
780
857
  requestSchema: null,
781
- responseSchema: "ListMemoriesResponseDto"
858
+ responseSchema: "ListMemoriesResponseDto",
859
+ idempotent: false
782
860
  },
783
861
  "ScopeMemoriesController_search": {
784
862
  method: "POST",
@@ -788,7 +866,8 @@ var OPERATIONS = {
788
866
  pathParams: ["id"],
789
867
  queryParams: [],
790
868
  requestSchema: "SearchMemoriesRequestDto",
791
- responseSchema: "ListMemoriesResponseDto"
869
+ responseSchema: "ListMemoriesResponseDto",
870
+ idempotent: true
792
871
  },
793
872
  "ScopeMemoriesController_update": {
794
873
  method: "PATCH",
@@ -798,7 +877,8 @@ var OPERATIONS = {
798
877
  pathParams: ["id", "memoryId"],
799
878
  queryParams: ["updateMask"],
800
879
  requestSchema: "UpdateMemoryRequestDto",
801
- responseSchema: null
880
+ responseSchema: null,
881
+ idempotent: false
802
882
  },
803
883
  "ScopeRunsController_create": {
804
884
  method: "POST",
@@ -808,7 +888,8 @@ var OPERATIONS = {
808
888
  pathParams: ["id"],
809
889
  queryParams: [],
810
890
  requestSchema: "SkillRunDto",
811
- responseSchema: null
891
+ responseSchema: null,
892
+ idempotent: false
812
893
  },
813
894
  "ScopeSupervisionController_get": {
814
895
  method: "GET",
@@ -818,7 +899,8 @@ var OPERATIONS = {
818
899
  pathParams: ["id"],
819
900
  queryParams: ["view"],
820
901
  requestSchema: null,
821
- responseSchema: "SupervisionDto"
902
+ responseSchema: "SupervisionDto",
903
+ idempotent: false
822
904
  },
823
905
  "ScopeSupervisionController_set": {
824
906
  method: "PUT",
@@ -828,7 +910,8 @@ var OPERATIONS = {
828
910
  pathParams: ["id"],
829
911
  queryParams: [],
830
912
  requestSchema: "SetSupervisionRequestDto",
831
- responseSchema: "SupervisionDto"
913
+ responseSchema: "SupervisionDto",
914
+ idempotent: false
832
915
  },
833
916
  "ScopeSupervisionController_setActive": {
834
917
  method: "PUT",
@@ -838,7 +921,8 @@ var OPERATIONS = {
838
921
  pathParams: ["id"],
839
922
  queryParams: [],
840
923
  requestSchema: "SetSupervisionRequestDto",
841
- responseSchema: "SupervisionDto"
924
+ responseSchema: "SupervisionDto",
925
+ idempotent: false
842
926
  },
843
927
  "ScopesController_acceptOwnershipTransfer": {
844
928
  method: "POST",
@@ -848,7 +932,30 @@ var OPERATIONS = {
848
932
  pathParams: ["id"],
849
933
  queryParams: [],
850
934
  requestSchema: null,
851
- responseSchema: "ScopeDto"
935
+ responseSchema: "ScopeDto",
936
+ idempotent: false
937
+ },
938
+ "ScopesController_addEvaluationCase": {
939
+ method: "POST",
940
+ path: "/api/v1/scopes/{id}/evaluations/cases",
941
+ service: "modus-api",
942
+ serverUrl: "https://api.getmodus.com",
943
+ pathParams: ["id"],
944
+ queryParams: [],
945
+ requestSchema: "EvaluationCaseInputDto",
946
+ responseSchema: "EvaluationCaseDto",
947
+ idempotent: false
948
+ },
949
+ "ScopesController_applySelectionOps": {
950
+ method: "POST",
951
+ path: "/api/v1/scopes/{id}/applySelectionOps",
952
+ service: "modus-api",
953
+ serverUrl: "https://api.getmodus.com",
954
+ pathParams: ["id"],
955
+ queryParams: [],
956
+ requestSchema: "ApplySelectionOpsDto",
957
+ responseSchema: "ScopeDto",
958
+ idempotent: false
852
959
  },
853
960
  "ScopesController_cancelOwnershipTransfer": {
854
961
  method: "DELETE",
@@ -858,7 +965,8 @@ var OPERATIONS = {
858
965
  pathParams: ["id"],
859
966
  queryParams: [],
860
967
  requestSchema: null,
861
- responseSchema: "ScopeDto"
968
+ responseSchema: "ScopeDto",
969
+ idempotent: false
862
970
  },
863
971
  "ScopesController_create": {
864
972
  method: "POST",
@@ -868,7 +976,8 @@ var OPERATIONS = {
868
976
  pathParams: [],
869
977
  queryParams: [],
870
978
  requestSchema: "CreateSkillDto",
871
- responseSchema: "ScopeDto"
979
+ responseSchema: "ScopeDto",
980
+ idempotent: false
872
981
  },
873
982
  "ScopesController_delete": {
874
983
  method: "DELETE",
@@ -878,7 +987,19 @@ var OPERATIONS = {
878
987
  pathParams: ["id"],
879
988
  queryParams: [],
880
989
  requestSchema: null,
881
- responseSchema: null
990
+ responseSchema: null,
991
+ idempotent: false
992
+ },
993
+ "ScopesController_deleteEvaluationCase": {
994
+ method: "DELETE",
995
+ path: "/api/v1/scopes/{id}/evaluations/cases/{caseId}",
996
+ service: "modus-api",
997
+ serverUrl: "https://api.getmodus.com",
998
+ pathParams: ["id", "caseId"],
999
+ queryParams: [],
1000
+ requestSchema: null,
1001
+ responseSchema: null,
1002
+ idempotent: false
882
1003
  },
883
1004
  "ScopesController_deploy": {
884
1005
  method: "POST",
@@ -888,7 +1009,8 @@ var OPERATIONS = {
888
1009
  pathParams: ["id"],
889
1010
  queryParams: [],
890
1011
  requestSchema: "DeploySkillDto",
891
- responseSchema: "DeployResponseDto"
1012
+ responseSchema: "DeployResponseDto",
1013
+ idempotent: false
892
1014
  },
893
1015
  "ScopesController_get": {
894
1016
  method: "GET",
@@ -898,7 +1020,8 @@ var OPERATIONS = {
898
1020
  pathParams: ["id"],
899
1021
  queryParams: ["view"],
900
1022
  requestSchema: null,
901
- responseSchema: "ScopeDto"
1023
+ responseSchema: "ScopeDto",
1024
+ idempotent: false
902
1025
  },
903
1026
  "ScopesController_getVariation": {
904
1027
  method: "GET",
@@ -908,7 +1031,8 @@ var OPERATIONS = {
908
1031
  pathParams: ["id", "variationUid"],
909
1032
  queryParams: [],
910
1033
  requestSchema: null,
911
- responseSchema: "ScopeDto"
1034
+ responseSchema: "ScopeDto",
1035
+ idempotent: false
912
1036
  },
913
1037
  "ScopesController_list": {
914
1038
  method: "GET",
@@ -918,7 +1042,19 @@ var OPERATIONS = {
918
1042
  pathParams: [],
919
1043
  queryParams: ["pageToken", "pageSize", "view", "search", "managerId", "includeVariation"],
920
1044
  requestSchema: null,
921
- responseSchema: "ListSkillsResponseDto"
1045
+ responseSchema: "ListSkillsResponseDto",
1046
+ idempotent: false
1047
+ },
1048
+ "ScopesController_mcpExposureCatalog": {
1049
+ method: "POST",
1050
+ path: "/api/v1/scopes/{id}/mcp-exposure-catalog",
1051
+ service: "modus-api",
1052
+ serverUrl: "https://api.getmodus.com",
1053
+ pathParams: ["id"],
1054
+ queryParams: [],
1055
+ requestSchema: "McpExposureCatalogRequestDto",
1056
+ responseSchema: "McpExposureCatalogResponseDto",
1057
+ idempotent: true
922
1058
  },
923
1059
  "ScopesController_patchMcpConfig": {
924
1060
  method: "PATCH",
@@ -928,7 +1064,8 @@ var OPERATIONS = {
928
1064
  pathParams: ["id"],
929
1065
  queryParams: [],
930
1066
  requestSchema: "PatchSkillMcpConfigDto",
931
- responseSchema: "PatchSkillMcpConfigResponseDto"
1067
+ responseSchema: "PatchSkillMcpConfigResponseDto",
1068
+ idempotent: false
932
1069
  },
933
1070
  "ScopesController_requestOwnershipTransfer": {
934
1071
  method: "POST",
@@ -938,7 +1075,8 @@ var OPERATIONS = {
938
1075
  pathParams: ["id"],
939
1076
  queryParams: [],
940
1077
  requestSchema: "TransferOwnershipDto",
941
- responseSchema: "ScopeDto"
1078
+ responseSchema: "ScopeDto",
1079
+ idempotent: false
942
1080
  },
943
1081
  "ScopesController_restore": {
944
1082
  method: "POST",
@@ -948,7 +1086,8 @@ var OPERATIONS = {
948
1086
  pathParams: ["id"],
949
1087
  queryParams: [],
950
1088
  requestSchema: null,
951
- responseSchema: "ScopeDto"
1089
+ responseSchema: "ScopeDto",
1090
+ idempotent: false
952
1091
  },
953
1092
  "ScopesController_update": {
954
1093
  method: "PATCH",
@@ -958,7 +1097,19 @@ var OPERATIONS = {
958
1097
  pathParams: ["id"],
959
1098
  queryParams: ["updateMask"],
960
1099
  requestSchema: "UpdateSkillDto",
961
- responseSchema: "ScopeDto"
1100
+ responseSchema: "ScopeDto",
1101
+ idempotent: false
1102
+ },
1103
+ "ScopesController_updateEvaluationCase": {
1104
+ method: "PATCH",
1105
+ path: "/api/v1/scopes/{id}/evaluations/cases/{caseId}",
1106
+ service: "modus-api",
1107
+ serverUrl: "https://api.getmodus.com",
1108
+ pathParams: ["id", "caseId"],
1109
+ queryParams: [],
1110
+ requestSchema: "UpdateEvaluationCaseDto",
1111
+ responseSchema: "EvaluationCaseDto",
1112
+ idempotent: false
962
1113
  },
963
1114
  "SuggestionsController_listApproved": {
964
1115
  method: "GET",
@@ -968,7 +1119,8 @@ var OPERATIONS = {
968
1119
  pathParams: [],
969
1120
  queryParams: ["pageToken", "pageSize", "scopeId", "scopeIds"],
970
1121
  requestSchema: null,
971
- responseSchema: "ListSuggestionQuestionsResponseDto"
1122
+ responseSchema: "ListSuggestionQuestionsResponseDto",
1123
+ idempotent: false
972
1124
  },
973
1125
  "SuggestionsController_recordEvent": {
974
1126
  method: "POST",
@@ -978,7 +1130,8 @@ var OPERATIONS = {
978
1130
  pathParams: ["id"],
979
1131
  queryParams: [],
980
1132
  requestSchema: "RecordSuggestionEventDto",
981
- responseSchema: null
1133
+ responseSchema: null,
1134
+ idempotent: false
982
1135
  },
983
1136
  "ToolsController_list": {
984
1137
  method: "GET",
@@ -988,7 +1141,8 @@ var OPERATIONS = {
988
1141
  pathParams: [],
989
1142
  queryParams: ["pageToken", "pageSize"],
990
1143
  requestSchema: null,
991
- responseSchema: "ListToolsResponseDto"
1144
+ responseSchema: "ListToolsResponseDto",
1145
+ idempotent: false
992
1146
  },
993
1147
  "UsageController_list": {
994
1148
  method: "GET",
@@ -998,7 +1152,8 @@ var OPERATIONS = {
998
1152
  pathParams: [],
999
1153
  queryParams: ["since", "until", "rollup", "model", "group_by", "skill_id", "agent_id", "user_id", "interface", "user_email"],
1000
1154
  requestSchema: null,
1001
- responseSchema: "ListUsageResponseDto"
1155
+ responseSchema: "ListUsageResponseDto",
1156
+ idempotent: false
1002
1157
  },
1003
1158
  "UsageController_listUsers": {
1004
1159
  method: "GET",
@@ -1008,7 +1163,8 @@ var OPERATIONS = {
1008
1163
  pathParams: [],
1009
1164
  queryParams: ["since", "until"],
1010
1165
  requestSchema: null,
1011
- responseSchema: "ListUsageUsersResponseDto"
1166
+ responseSchema: "ListUsageUsersResponseDto",
1167
+ idempotent: false
1012
1168
  },
1013
1169
  "WorkflowActionsController_cancel": {
1014
1170
  method: "POST",
@@ -1018,7 +1174,8 @@ var OPERATIONS = {
1018
1174
  pathParams: ["runId"],
1019
1175
  queryParams: [],
1020
1176
  requestSchema: "CancelRunDto",
1021
- responseSchema: null
1177
+ responseSchema: null,
1178
+ idempotent: true
1022
1179
  },
1023
1180
  "WorkflowActionsController_execute": {
1024
1181
  method: "POST",
@@ -1028,7 +1185,8 @@ var OPERATIONS = {
1028
1185
  pathParams: [],
1029
1186
  queryParams: [],
1030
1187
  requestSchema: "WorkflowActionDto",
1031
- responseSchema: null
1188
+ responseSchema: null,
1189
+ idempotent: false
1032
1190
  },
1033
1191
  "WorkflowInterfacesController_add": {
1034
1192
  method: "POST",
@@ -1038,7 +1196,8 @@ var OPERATIONS = {
1038
1196
  pathParams: ["id"],
1039
1197
  queryParams: [],
1040
1198
  requestSchema: "AddAgentInterfaceDto",
1041
- responseSchema: "AgentInterfaceDto"
1199
+ responseSchema: "AgentInterfaceDto",
1200
+ idempotent: false
1042
1201
  },
1043
1202
  "WorkflowInterfacesController_delete": {
1044
1203
  method: "DELETE",
@@ -1048,7 +1207,8 @@ var OPERATIONS = {
1048
1207
  pathParams: ["id", "interfaceId"],
1049
1208
  queryParams: [],
1050
1209
  requestSchema: null,
1051
- responseSchema: null
1210
+ responseSchema: null,
1211
+ idempotent: false
1052
1212
  },
1053
1213
  "WorkflowInterfacesController_deleteAll": {
1054
1214
  method: "DELETE",
@@ -1058,7 +1218,8 @@ var OPERATIONS = {
1058
1218
  pathParams: ["id"],
1059
1219
  queryParams: [],
1060
1220
  requestSchema: null,
1061
- responseSchema: null
1221
+ responseSchema: null,
1222
+ idempotent: false
1062
1223
  },
1063
1224
  "WorkflowInterfacesController_list": {
1064
1225
  method: "GET",
@@ -1068,7 +1229,8 @@ var OPERATIONS = {
1068
1229
  pathParams: ["id"],
1069
1230
  queryParams: [],
1070
1231
  requestSchema: null,
1071
- responseSchema: "ListAgentInterfacesResponseDto"
1232
+ responseSchema: "ListAgentInterfacesResponseDto",
1233
+ idempotent: false
1072
1234
  },
1073
1235
  "WorkflowInterfacesController_update": {
1074
1236
  method: "PATCH",
@@ -1078,7 +1240,8 @@ var OPERATIONS = {
1078
1240
  pathParams: ["id", "interfaceId"],
1079
1241
  queryParams: ["updateMask"],
1080
1242
  requestSchema: "UpdateAgentInterfaceDto",
1081
- responseSchema: "AgentInterfaceDto"
1243
+ responseSchema: "AgentInterfaceDto",
1244
+ idempotent: false
1082
1245
  },
1083
1246
  "WorkflowRunsController_create": {
1084
1247
  method: "POST",
@@ -1088,7 +1251,8 @@ var OPERATIONS = {
1088
1251
  pathParams: ["id"],
1089
1252
  queryParams: [],
1090
1253
  requestSchema: "AgentRunDto",
1091
- responseSchema: null
1254
+ responseSchema: null,
1255
+ idempotent: false
1092
1256
  },
1093
1257
  "WorkflowRunsController_get": {
1094
1258
  method: "GET",
@@ -1098,7 +1262,8 @@ var OPERATIONS = {
1098
1262
  pathParams: ["id", "runId"],
1099
1263
  queryParams: ["temporalRunId"],
1100
1264
  requestSchema: null,
1101
- responseSchema: "GetAutomationRunResponseDto"
1265
+ responseSchema: "GetAutomationRunResponseDto",
1266
+ idempotent: false
1102
1267
  },
1103
1268
  "WorkflowRunsController_list": {
1104
1269
  method: "GET",
@@ -1108,7 +1273,8 @@ var OPERATIONS = {
1108
1273
  pathParams: ["id"],
1109
1274
  queryParams: ["status", "timeframe", "approvalScope", "search", "pageSize", "pageToken"],
1110
1275
  requestSchema: null,
1111
- responseSchema: "ListAutomationRunsResponseDto"
1276
+ responseSchema: "ListAutomationRunsResponseDto",
1277
+ idempotent: false
1112
1278
  },
1113
1279
  "WorkflowsController_acceptOwnershipTransfer": {
1114
1280
  method: "POST",
@@ -1118,7 +1284,8 @@ var OPERATIONS = {
1118
1284
  pathParams: ["id"],
1119
1285
  queryParams: [],
1120
1286
  requestSchema: null,
1121
- responseSchema: "WorkflowDto"
1287
+ responseSchema: "WorkflowDto",
1288
+ idempotent: false
1122
1289
  },
1123
1290
  "WorkflowsController_cancelOwnershipTransfer": {
1124
1291
  method: "DELETE",
@@ -1128,7 +1295,8 @@ var OPERATIONS = {
1128
1295
  pathParams: ["id"],
1129
1296
  queryParams: [],
1130
1297
  requestSchema: null,
1131
- responseSchema: "WorkflowDto"
1298
+ responseSchema: "WorkflowDto",
1299
+ idempotent: false
1132
1300
  },
1133
1301
  "WorkflowsController_create": {
1134
1302
  method: "POST",
@@ -1138,7 +1306,8 @@ var OPERATIONS = {
1138
1306
  pathParams: [],
1139
1307
  queryParams: [],
1140
1308
  requestSchema: "CreateAgentDto",
1141
- responseSchema: "WorkflowDto"
1309
+ responseSchema: "WorkflowDto",
1310
+ idempotent: false
1142
1311
  },
1143
1312
  "WorkflowsController_delete": {
1144
1313
  method: "DELETE",
@@ -1148,7 +1317,8 @@ var OPERATIONS = {
1148
1317
  pathParams: ["id"],
1149
1318
  queryParams: [],
1150
1319
  requestSchema: null,
1151
- responseSchema: null
1320
+ responseSchema: null,
1321
+ idempotent: false
1152
1322
  },
1153
1323
  "WorkflowsController_deploy": {
1154
1324
  method: "POST",
@@ -1158,7 +1328,8 @@ var OPERATIONS = {
1158
1328
  pathParams: ["id"],
1159
1329
  queryParams: [],
1160
1330
  requestSchema: "DeployAgentDto",
1161
- responseSchema: "AgentDeployResponseDto"
1331
+ responseSchema: "AgentDeployResponseDto",
1332
+ idempotent: false
1162
1333
  },
1163
1334
  "WorkflowsController_get": {
1164
1335
  method: "GET",
@@ -1168,7 +1339,8 @@ var OPERATIONS = {
1168
1339
  pathParams: ["id"],
1169
1340
  queryParams: ["view"],
1170
1341
  requestSchema: null,
1171
- responseSchema: "WorkflowDto"
1342
+ responseSchema: "WorkflowDto",
1343
+ idempotent: false
1172
1344
  },
1173
1345
  "WorkflowsController_list": {
1174
1346
  method: "GET",
@@ -1178,7 +1350,8 @@ var OPERATIONS = {
1178
1350
  pathParams: [],
1179
1351
  queryParams: ["pageToken", "pageSize", "view", "type", "search", "includeVariation"],
1180
1352
  requestSchema: null,
1181
- responseSchema: "ListAgentsResponseDto"
1353
+ responseSchema: "ListAgentsResponseDto",
1354
+ idempotent: false
1182
1355
  },
1183
1356
  "WorkflowsController_requestOwnershipTransfer": {
1184
1357
  method: "POST",
@@ -1188,7 +1361,8 @@ var OPERATIONS = {
1188
1361
  pathParams: ["id"],
1189
1362
  queryParams: [],
1190
1363
  requestSchema: "TransferOwnershipDto",
1191
- responseSchema: "WorkflowDto"
1364
+ responseSchema: "WorkflowDto",
1365
+ idempotent: false
1192
1366
  },
1193
1367
  "WorkflowsController_restore": {
1194
1368
  method: "POST",
@@ -1198,7 +1372,8 @@ var OPERATIONS = {
1198
1372
  pathParams: ["id"],
1199
1373
  queryParams: [],
1200
1374
  requestSchema: null,
1201
- responseSchema: "WorkflowDto"
1375
+ responseSchema: "WorkflowDto",
1376
+ idempotent: false
1202
1377
  },
1203
1378
  "WorkflowsController_toggle": {
1204
1379
  method: "POST",
@@ -1208,7 +1383,8 @@ var OPERATIONS = {
1208
1383
  pathParams: ["id"],
1209
1384
  queryParams: [],
1210
1385
  requestSchema: "ToggleAgentDto",
1211
- responseSchema: "WorkflowDto"
1386
+ responseSchema: "WorkflowDto",
1387
+ idempotent: true
1212
1388
  },
1213
1389
  "WorkflowsController_update": {
1214
1390
  method: "PATCH",
@@ -1218,7 +1394,8 @@ var OPERATIONS = {
1218
1394
  pathParams: ["id"],
1219
1395
  queryParams: ["updateMask"],
1220
1396
  requestSchema: "UpdateAgentDto",
1221
- responseSchema: "WorkflowDto"
1397
+ responseSchema: "WorkflowDto",
1398
+ idempotent: false
1222
1399
  }
1223
1400
  };
1224
1401
 
@@ -1230,17 +1407,26 @@ var ModusError = class extends Error {
1230
1407
  this.message = message;
1231
1408
  this.statusCode = options.statusCode;
1232
1409
  this.requestId = options.requestId;
1410
+ this.traceId = options.traceId;
1233
1411
  this.responseHeaders = options.responseHeaders;
1234
1412
  this.body = options.body;
1235
1413
  this.code = options.code;
1414
+ this.info = options.info;
1415
+ this.retryable = options.retryable ?? false;
1236
1416
  }
1237
1417
  };
1238
1418
  var APIConnectionError = class extends ModusError {
1239
- constructor(message) {
1240
- super(message);
1419
+ constructor(message, options = {}) {
1420
+ super(message, options);
1241
1421
  this.name = "APIConnectionError";
1242
1422
  }
1243
1423
  };
1424
+ var BadRequestError = class extends ModusError {
1425
+ constructor(message, options = {}) {
1426
+ super(message, { ...options, statusCode: 400 });
1427
+ this.name = "BadRequestError";
1428
+ }
1429
+ };
1244
1430
  var AuthenticationError = class extends ModusError {
1245
1431
  constructor(message, options = {}) {
1246
1432
  super(message, { ...options, statusCode: 401 });
@@ -1323,11 +1509,11 @@ var Page = class {
1323
1509
  * Fetch the next page using {@link Page.nextPageToken}.
1324
1510
  *
1325
1511
  * @returns The following page of results.
1326
- * @throws {Error} When there is no next page. Check {@link Page.hasNextPage} first.
1512
+ * @throws {ValidationError} When there is no next page. Check {@link Page.hasNextPage} first.
1327
1513
  */
1328
1514
  async getNextPage() {
1329
1515
  if (this.nextPageToken === void 0) {
1330
- throw new Error(
1516
+ throw new ValidationError(
1331
1517
  "No next page available. Check hasNextPage() before calling getNextPage()."
1332
1518
  );
1333
1519
  }
@@ -1413,7 +1599,10 @@ function resolveBaseUrl(baseUrl) {
1413
1599
  return baseUrl ?? process.env[ENV_BASE_URL] ?? void 0;
1414
1600
  }
1415
1601
  function resolveAgentHost(agentHost) {
1416
- return agentHost ?? process.env[ENV_AGENT_HOST] ?? void 0;
1602
+ for (const value of [agentHost, process.env[ENV_AGENT_HOST]]) {
1603
+ if (value?.trim()) return value.trim();
1604
+ }
1605
+ return void 0;
1417
1606
  }
1418
1607
  function isModusApiHostname(hostname) {
1419
1608
  return hostname === "api.getmodus.com" || /^api\.[a-z0-9-]+\.getmodus\.com$/i.test(hostname);
@@ -1457,7 +1646,6 @@ function authHeaders(apiKey) {
1457
1646
 
1458
1647
  // src/_config.ts
1459
1648
  var DEFAULT_BASE_URL = "https://api.getmodus.com";
1460
- var DEFAULT_AGENT_HOST = "https://agent.getmodus.com";
1461
1649
  var DEFAULT_TIMEOUT_MS = 3e5;
1462
1650
  var DEFAULT_MAX_RETRIES = 2;
1463
1651
  function normalizeBaseUrl(baseUrl) {
@@ -1478,9 +1666,8 @@ function createModusConfig(options = {}) {
1478
1666
  }
1479
1667
  const baseUrl = normalizeBaseUrl(resolveBaseUrl(options.baseUrl) ?? DEFAULT_BASE_URL);
1480
1668
  const baseUrlOverrides = normalizeBaseUrls(options.baseUrls);
1481
- const agentHost = normalizeBaseUrl(
1482
- baseUrlOverrides["agent-service"] ?? resolveAgentHost(options.agentHost) ?? deriveAgentHostFromBaseUrl(baseUrl) ?? DEFAULT_AGENT_HOST
1483
- );
1669
+ const explicitAgentHost = baseUrlOverrides["agent-service"] ?? resolveAgentHost(options.agentHost) ?? deriveAgentHostFromBaseUrl(baseUrl);
1670
+ const agentHost = explicitAgentHost === void 0 ? void 0 : normalizeBaseUrl(explicitAgentHost);
1484
1671
  const organizationId = resolveOrganizationId(options.organizationId);
1485
1672
  return Object.freeze({
1486
1673
  apiKey: resolveApiKey(options.apiKey),
@@ -1489,7 +1676,7 @@ function createModusConfig(options = {}) {
1489
1676
  ...organizationId !== void 0 ? { organizationId } : {},
1490
1677
  baseUrls: Object.freeze({
1491
1678
  "modus-api": baseUrl,
1492
- "agent-service": agentHost,
1679
+ ...agentHost !== void 0 ? { "agent-service": agentHost } : {},
1493
1680
  ...baseUrlOverrides
1494
1681
  }),
1495
1682
  timeoutMs: resolveTimeoutMs(options.timeoutMs) ?? DEFAULT_TIMEOUT_MS,
@@ -1499,18 +1686,84 @@ function createModusConfig(options = {}) {
1499
1686
  });
1500
1687
  }
1501
1688
  function resolveServiceBaseUrl(config, service, generatedBaseUrl) {
1502
- if (service === "agent-service") {
1503
- return config.baseUrls["agent-service"] ?? config.agentHost ?? generatedBaseUrl ?? config.baseUrl;
1504
- }
1689
+ if (service === "agent-service") return requireAgentHost(config);
1505
1690
  return config.baseUrls[service] ?? generatedBaseUrl ?? config.baseUrl;
1506
1691
  }
1507
1692
  function formatConfigForLog(config) {
1508
1693
  const masked = config.apiKey.length > 10 ? `${config.apiKey.slice(0, 10)}***` : "***";
1509
1694
  return `ModusConfig(apiKey=${JSON.stringify(masked)}, baseUrl=${JSON.stringify(config.baseUrl)}, timeoutMs=${config.timeoutMs}, maxRetries=${config.maxRetries})`;
1510
1695
  }
1696
+ function requireAgentHost(config) {
1697
+ if (config.agentHost === void 0) {
1698
+ throw new ModusError(
1699
+ `No agent host for baseUrl ${JSON.stringify(config.baseUrl)}. Pass agentHost (or set MODUS_AGENT_HOST) to chat or run with a custom baseUrl.`
1700
+ );
1701
+ }
1702
+ return config.agentHost;
1703
+ }
1704
+
1705
+ // src/_retry.ts
1706
+ var DEPLOY_NOT_FOUND_BACKOFF_MS = 500;
1707
+ var MAX_DEPLOY_NOT_FOUND_RETRIES = 1;
1708
+ var MAX_RETRY_AFTER_SECONDS = 60;
1709
+ var RETRY_STATUSES = /* @__PURE__ */ new Set([408, 429, 500, 502, 503, 504]);
1710
+ var CONNECT_PHASE_CODES = /* @__PURE__ */ new Set(["ECONNREFUSED", "ENOTFOUND", "EAI_AGAIN", "UND_ERR_CONNECT_TIMEOUT"]);
1711
+ function isRetrySafe(method, idempotent, failure) {
1712
+ if ("status" in failure) {
1713
+ if (failure.status === 429) return (failure.retryAfter ?? 0) <= MAX_RETRY_AFTER_SECONDS;
1714
+ if (!RETRY_STATUSES.has(failure.status)) return false;
1715
+ } else if (failure.causeCode !== void 0 && CONNECT_PHASE_CODES.has(failure.causeCode)) {
1716
+ return true;
1717
+ }
1718
+ return method !== "POST" || idempotent;
1719
+ }
1720
+ function backoffSeconds(attempt, error) {
1721
+ if (error instanceof RateLimitError && error.retryAfter !== void 0) return error.retryAfter;
1722
+ if (attempt === 0) return 0;
1723
+ return Math.max(0.5, 2 ** (attempt - 1) + (Math.random() * 0.6 - 0.3));
1724
+ }
1725
+ function sleep(ms) {
1726
+ return new Promise((resolve) => setTimeout(resolve, ms));
1727
+ }
1728
+ async function withRetry(fn, maxRetries, options = {}) {
1729
+ let deployNotFoundRetries = 0;
1730
+ let attempt = 0;
1731
+ let sends = 0;
1732
+ while (true) {
1733
+ try {
1734
+ return await fn(sends++);
1735
+ } catch (error) {
1736
+ if (options.retryNotFoundOnDeploy && error instanceof NotFoundError && deployNotFoundRetries < MAX_DEPLOY_NOT_FOUND_RETRIES) {
1737
+ deployNotFoundRetries++;
1738
+ await sleep(DEPLOY_NOT_FOUND_BACKOFF_MS);
1739
+ continue;
1740
+ }
1741
+ if (!(error instanceof ModusError) || !error.retryable || attempt >= maxRetries) throw error;
1742
+ await sleep(backoffSeconds(attempt, error) * 1e3);
1743
+ attempt++;
1744
+ }
1745
+ }
1746
+ }
1747
+
1748
+ // src/_trace.ts
1749
+ import { randomBytes } from "crypto";
1750
+ var TRACEPARENT = /^[0-9a-f]{2}-([0-9a-f]{32})-[0-9a-f]{16}-[0-9a-f]{2}$/;
1751
+ function newTraceId() {
1752
+ return randomBytes(16).toString("hex");
1753
+ }
1754
+ function traceparent(traceId = newTraceId()) {
1755
+ return `00-${traceId}-${randomBytes(8).toString("hex")}-00`;
1756
+ }
1757
+ function traceIdOf(value) {
1758
+ return value ? TRACEPARENT.exec(value)?.[1] : void 0;
1759
+ }
1760
+ function headerValue(headers, name) {
1761
+ const lower = name.toLowerCase();
1762
+ return Object.entries(headers ?? {}).find(([key]) => key.toLowerCase() === lower)?.[1];
1763
+ }
1511
1764
 
1512
1765
  // src/_http.ts
1513
- var USER_AGENT = `modus-typescript/${"0.8.0"} (node/${process.version}; ${process.platform})`;
1766
+ var USER_AGENT = `modus-typescript/${"0.10.0"} (node/${process.version}; ${process.platform})`;
1514
1767
  function buildUrl(baseUrl, path, params) {
1515
1768
  const url = new URL(path.startsWith("/") ? path : `/${path}`, baseUrl);
1516
1769
  if (params) {
@@ -1541,41 +1794,60 @@ function headersToRecord(headers) {
1541
1794
  });
1542
1795
  return out;
1543
1796
  }
1544
- function messageFromBody(raw, statusCode) {
1545
- if (!raw) return `HTTP ${statusCode}`;
1546
- try {
1547
- const body = JSON.parse(raw);
1548
- if (body && typeof body === "object") {
1549
- const record = body;
1550
- const envelope = record.error;
1551
- if (envelope && typeof envelope === "object") {
1552
- const msg2 = envelope.message;
1553
- if (typeof msg2 === "string" && msg2) return msg2;
1554
- }
1555
- const msg = record.message ?? record.error;
1556
- if (Array.isArray(msg)) return msg.map(String).join("; ");
1557
- if (typeof msg === "string" && msg) return msg;
1558
- }
1559
- } catch {
1560
- }
1561
- return raw;
1797
+ function isRecord(value) {
1798
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1799
+ }
1800
+ function nonEmptyString(value) {
1801
+ return typeof value === "string" && value ? value : void 0;
1562
1802
  }
1563
- function errorCodeFromBody(raw) {
1803
+ function parseErrorBody(raw, statusCode) {
1804
+ let parsed;
1564
1805
  try {
1565
- const body = JSON.parse(raw);
1566
- return typeof body.error?.code === "string" ? body.error.code : void 0;
1806
+ parsed = JSON.parse(raw);
1567
1807
  } catch {
1568
- return void 0;
1569
- }
1808
+ return { message: raw || `HTTP ${statusCode}` };
1809
+ }
1810
+ if (!isRecord(parsed)) return { message: raw, parsed };
1811
+ const envelope = parsed.error;
1812
+ if (isRecord(envelope)) {
1813
+ return {
1814
+ message: nonEmptyString(envelope.message) ?? raw,
1815
+ code: nonEmptyString(envelope.code),
1816
+ requestId: nonEmptyString(envelope.requestId),
1817
+ info: isRecord(envelope.info) ? envelope.info : void 0,
1818
+ parsed
1819
+ };
1820
+ }
1821
+ const message = parsed.message ?? parsed.error;
1822
+ if (Array.isArray(message)) return { message: message.map(String).join("; "), parsed };
1823
+ return { message: nonEmptyString(message) ?? raw, parsed };
1824
+ }
1825
+ function parseRetryAfter(headers) {
1826
+ const ms = headers.get("retry-after-ms")?.trim();
1827
+ if (ms && /^\d+(\.\d+)?$/.test(ms)) return Math.ceil(Number(ms) / 1e3);
1828
+ const value = headers.get("retry-after")?.trim();
1829
+ if (!value) return void 0;
1830
+ if (/^\d+$/.test(value)) return Number(value);
1831
+ const date = Date.parse(value);
1832
+ return Number.isNaN(date) ? void 0 : Math.max(0, Math.ceil((date - Date.now()) / 1e3));
1570
1833
  }
1571
- function raiseForStatus(response, body) {
1834
+ function raiseForStatus(response, body, method = "GET", idempotent = false, traceId) {
1572
1835
  if (response.ok) return;
1573
- const message = messageFromBody(body, response.status);
1574
- const requestId = response.headers.get("x-request-id") ?? response.headers.get("X-Request-ID") ?? void 0;
1575
- const headers = headersToRecord(response.headers);
1576
- const code = errorCodeFromBody(body);
1577
- const base = { requestId, responseHeaders: headers, body, code };
1578
- switch (response.status) {
1836
+ const status = response.status;
1837
+ const { message, code, requestId, info, parsed } = parseErrorBody(body, status);
1838
+ const retryAfter = status === 429 ? parseRetryAfter(response.headers) : void 0;
1839
+ const base = {
1840
+ requestId: requestId ?? response.headers.get("x-request-id") ?? void 0,
1841
+ traceId,
1842
+ responseHeaders: headersToRecord(response.headers),
1843
+ body,
1844
+ code,
1845
+ info,
1846
+ retryable: isRetrySafe(method, idempotent, { status, retryAfter })
1847
+ };
1848
+ switch (status) {
1849
+ case 400:
1850
+ throw new BadRequestError(message, base);
1579
1851
  case 401:
1580
1852
  throw new AuthenticationError(message, base);
1581
1853
  case 403:
@@ -1584,35 +1856,46 @@ function raiseForStatus(response, body) {
1584
1856
  throw new NotFoundError(message, base);
1585
1857
  case 409:
1586
1858
  throw new ConflictError(message, base);
1587
- case 422: {
1588
- let errors;
1589
- try {
1590
- errors = JSON.parse(body);
1591
- } catch {
1592
- errors = void 0;
1593
- }
1594
- throw new UnprocessableError(message, { ...base, errors });
1595
- }
1596
- case 429: {
1597
- const retryHeader = response.headers.get("retry-after") ?? "";
1598
- const retryAfter = /^\d+$/.test(retryHeader) ? Number.parseInt(retryHeader, 10) : void 0;
1859
+ case 422:
1860
+ throw new UnprocessableError(message, { ...base, errors: parsed });
1861
+ case 429:
1599
1862
  throw new RateLimitError(message, { ...base, retryAfter });
1600
- }
1601
1863
  default:
1602
- if (response.status >= 500) {
1603
- throw new InternalServerError(message, response.status, base);
1604
- }
1605
- throw new ModusError(message, { ...base, statusCode: response.status });
1864
+ if (status >= 500) throw new InternalServerError(message, status, base);
1865
+ throw new ModusError(message, { ...base, statusCode: status });
1606
1866
  }
1607
1867
  }
1608
- function wrapNetworkError(error, baseUrl) {
1609
- const detail = error instanceof Error ? error.message : String(error);
1868
+ function wrapNetworkError(error, baseUrl, method, idempotent, traceId) {
1869
+ const detail = error instanceof DOMException && (error.name === "AbortError" || error.name === "TimeoutError") ? "Request timed out" : error instanceof Error ? error.message : String(error);
1870
+ const cause = error instanceof Error ? error.cause : void 0;
1871
+ const causeCode = isRecord(cause) ? nonEmptyString(cause.code) : void 0;
1610
1872
  return new APIConnectionError(
1611
- `Network error communicating with Modus API at ${JSON.stringify(baseUrl)}: ${detail}. Check connectivity and that baseUrl is correct.`
1873
+ `Network error communicating with Modus API at ${JSON.stringify(baseUrl)}: ${detail}. Check connectivity and that baseUrl is correct.`,
1874
+ { retryable: isRetrySafe(method, idempotent, { causeCode }), traceId }
1612
1875
  );
1613
1876
  }
1614
- async function readBody(response) {
1615
- return response.text();
1877
+ function parseJsonBody(response, body, traceId) {
1878
+ try {
1879
+ return JSON.parse(body);
1880
+ } catch {
1881
+ const contentType = response.headers.get("content-type") ?? "";
1882
+ throw new ModusError(
1883
+ `Invalid JSON in HTTP ${response.status} response (content-type ${JSON.stringify(contentType)}): ` + body.slice(0, 200),
1884
+ {
1885
+ statusCode: response.status,
1886
+ requestId: response.headers.get("x-request-id") ?? void 0,
1887
+ traceId,
1888
+ responseHeaders: headersToRecord(response.headers),
1889
+ body
1890
+ }
1891
+ );
1892
+ }
1893
+ }
1894
+ function withTraceparent(headers) {
1895
+ const own = headerValue(headers, "traceparent");
1896
+ if (own !== void 0) return { headers, traceId: traceIdOf(own) };
1897
+ const value = traceparent();
1898
+ return { headers: { ...headers, traceparent: value }, traceId: traceIdOf(value) };
1616
1899
  }
1617
1900
  async function readBodyPreview(response, maxChars = 200) {
1618
1901
  if (!response.body) return "";
@@ -1652,24 +1935,26 @@ var HttpClient = class {
1652
1935
  async request(method, path, options = {}) {
1653
1936
  const baseUrl = options.baseUrl ?? this.config.baseUrl;
1654
1937
  const url = buildUrl(baseUrl, path, options.params);
1938
+ const idempotent = options.idempotent ?? false;
1939
+ const { headers, traceId } = withTraceparent(
1940
+ mergeHeaders(this.defaultHeaders(), options.headers, authHeaders(this.config.apiKey))
1941
+ );
1942
+ let response;
1943
+ let body;
1655
1944
  try {
1656
- const response = await this.config.fetch(url, {
1945
+ response = await this.config.fetch(url, {
1657
1946
  method,
1658
- headers: mergeHeaders(this.defaultHeaders(), options.headers, authHeaders(this.config.apiKey)),
1947
+ headers,
1659
1948
  body: options.json !== void 0 ? JSON.stringify(options.json) : void 0,
1660
1949
  signal: AbortSignal.timeout(this.config.timeoutMs)
1661
1950
  });
1662
- const body = await readBody(response);
1663
- raiseForStatus(response, body);
1664
- if (response.status === 204 || !body) return null;
1665
- return JSON.parse(body);
1951
+ body = await response.text();
1666
1952
  } catch (error) {
1667
- if (error instanceof ModusError) throw error;
1668
- if (error instanceof DOMException && error.name === "AbortError") {
1669
- throw wrapNetworkError(new Error("Request timed out"), baseUrl);
1670
- }
1671
- throw wrapNetworkError(error, baseUrl);
1953
+ throw wrapNetworkError(error, baseUrl, method, idempotent, traceId);
1672
1954
  }
1955
+ raiseForStatus(response, body, method, idempotent, traceId);
1956
+ if (response.status === 204 || !body) return null;
1957
+ return parseJsonBody(response, body, traceId);
1673
1958
  }
1674
1959
  get(path, params, options = {}) {
1675
1960
  return this.request("GET", path, { params, ...options });
@@ -1689,23 +1974,27 @@ var HttpClient = class {
1689
1974
  async *stream(method, path, options = {}) {
1690
1975
  const baseUrl = options.baseUrl ?? this.config.baseUrl;
1691
1976
  const url = buildUrl(baseUrl, path, options.params);
1977
+ const idempotent = options.idempotent ?? false;
1978
+ const idle = new IdleTimeout(this.config.timeoutMs);
1979
+ const { headers, traceId } = withTraceparent(
1980
+ mergeHeaders(
1981
+ this.defaultHeaders(),
1982
+ options.headers,
1983
+ { Accept: "text/event-stream" },
1984
+ authHeaders(this.config.apiKey)
1985
+ )
1986
+ );
1987
+ let reader;
1692
1988
  try {
1693
1989
  const response = await this.config.fetch(url, {
1694
1990
  method,
1695
- // Agent-service negotiates SSE vs JSON polling on Accept; JSON-only
1696
- // Accept returns {"runId","status":"pending"} instead of token SSE.
1697
- headers: mergeHeaders(
1698
- this.defaultHeaders(),
1699
- options.headers,
1700
- { Accept: "text/event-stream" },
1701
- authHeaders(this.config.apiKey)
1702
- ),
1991
+ headers,
1703
1992
  body: options.json !== void 0 ? JSON.stringify(options.json) : void 0,
1704
- signal: AbortSignal.timeout(this.config.timeoutMs)
1993
+ signal: idle.signal
1705
1994
  });
1995
+ idle.touch();
1706
1996
  if (!response.ok) {
1707
- const body = await readBody(response);
1708
- raiseForStatus(response, body);
1997
+ raiseForStatus(response, await response.text(), method, idempotent, traceId);
1709
1998
  return;
1710
1999
  }
1711
2000
  const contentType = response.headers.get("content-type") ?? "";
@@ -1713,16 +2002,17 @@ var HttpClient = class {
1713
2002
  const preview = await readBodyPreview(response);
1714
2003
  throw new ModusError(
1715
2004
  `Unexpected stream response: expected Content-Type text/event-stream, got ${JSON.stringify(contentType) || "(missing)"}. Body preview: ${preview}`,
1716
- { statusCode: response.status, body: preview }
2005
+ { statusCode: response.status, body: preview, traceId }
1717
2006
  );
1718
2007
  }
1719
2008
  if (!response.body) return;
1720
- const reader = response.body.getReader();
2009
+ reader = response.body.getReader();
1721
2010
  const decoder = new TextDecoder();
1722
2011
  let buffer = "";
1723
2012
  while (true) {
1724
2013
  const { done, value } = await reader.read();
1725
2014
  if (done) break;
2015
+ idle.touch();
1726
2016
  buffer += decoder.decode(value, { stream: true });
1727
2017
  const lines = buffer.split("\n");
1728
2018
  buffer = lines.pop() ?? "";
@@ -1733,10 +2023,10 @@ var HttpClient = class {
1733
2023
  if (buffer.trim()) yield buffer;
1734
2024
  } catch (error) {
1735
2025
  if (error instanceof ModusError) throw error;
1736
- if (error instanceof DOMException && error.name === "AbortError") {
1737
- throw wrapNetworkError(new Error("Request timed out"), baseUrl);
1738
- }
1739
- throw wrapNetworkError(error, baseUrl);
2026
+ throw wrapNetworkError(error, baseUrl, method, idempotent, traceId);
2027
+ } finally {
2028
+ idle.clear();
2029
+ await reader?.cancel().catch(() => void 0);
1740
2030
  }
1741
2031
  }
1742
2032
  streamGet(path, params, options = {}) {
@@ -1746,6 +2036,26 @@ var HttpClient = class {
1746
2036
  return this.stream("POST", path, { json, ...options });
1747
2037
  }
1748
2038
  };
2039
+ var IdleTimeout = class {
2040
+ constructor(ms) {
2041
+ this.ms = ms;
2042
+ this.controller = new AbortController();
2043
+ this.touch();
2044
+ }
2045
+ get signal() {
2046
+ return this.controller.signal;
2047
+ }
2048
+ touch() {
2049
+ this.clear();
2050
+ this.timer = setTimeout(
2051
+ () => this.controller.abort(new DOMException("Stream idle timeout", "TimeoutError")),
2052
+ this.ms
2053
+ );
2054
+ }
2055
+ clear() {
2056
+ if (this.timer !== void 0) clearTimeout(this.timer);
2057
+ }
2058
+ };
1749
2059
 
1750
2060
  // src/_client-base.ts
1751
2061
  var ModusClientBase = class {
@@ -1776,6 +2086,7 @@ var WRITE_BODY_ALLOWED_KEYS = {
1776
2086
  ContextFilesController_uploadFromUrls: ["urls"],
1777
2087
  ContextFilesController_uploadUrl: ["fileName", "contentType", "fileSize"],
1778
2088
  ContextFilesController_uploadUrls: ["files"],
2089
+ ContextItemAccessController_updateAccess: ["visibility", "groupPermissions", "sharedWith"],
1779
2090
  ContextItemsController_lookup: ["contextType", "dataPath", "contentProjection"],
1780
2091
  ContextItemsController_move: ["destinationFolderUid"],
1781
2092
  ContextItemsController_update: ["contextType", "content", "description", "userFeedback", "topics"],
@@ -1793,15 +2104,15 @@ var WRITE_BODY_ALLOWED_KEYS = {
1793
2104
  DashboardsController_updateLayout: ["expectedRevision", "elements"],
1794
2105
  EvaluationsController_updateConfig: ["enabled", "cadence", "judgeModel", "judgeGuidance", "notifications"],
1795
2106
  IngestedDataController_upload: ["integration_type", "request", "response"],
1796
- ModusChatController_chat: ["message", "model"],
2107
+ ModusContextComposeController_compose: ["message", "limit"],
1797
2108
  ModusContextController_compose: ["message", "limit"],
1798
2109
  ModusRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId", "subordinateSkillIds"],
1799
2110
  ResumeRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId", "decision"],
1800
2111
  RunLifecycleController_activeBySession: ["sessionIds"],
1801
2112
  RunLifecycleController_cancel: [],
1802
- RunLifecycleController_editQueued: [],
1803
- RunLifecycleController_interrupt: [],
1804
- ScopeChatController_chat: ["message", "model"],
2113
+ RunLifecycleController_editQueued: ["nextRun"],
2114
+ RunLifecycleController_interrupt: ["nextRun", "lastSeenEventId"],
2115
+ ScopeContextComposeController_compose: ["message", "limit"],
1805
2116
  ScopeContextController_compose: ["message", "limit"],
1806
2117
  ScopeInterfacesController_add: ["type", "name", "config"],
1807
2118
  ScopeInterfacesController_update: ["name", "config"],
@@ -1809,12 +2120,16 @@ var WRITE_BODY_ALLOWED_KEYS = {
1809
2120
  ScopeMemoriesController_update: ["memory", "metadata"],
1810
2121
  ScopeRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId", "subordinateSkillIds"],
1811
2122
  ScopesController_acceptOwnershipTransfer: [],
2123
+ ScopesController_addEvaluationCase: ["id", "task", "expectedOutput"],
2124
+ ScopesController_applySelectionOps: ["ops", "toolset", "validateOnly"],
1812
2125
  ScopesController_create: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "includeOwnLearnings", "interfaces", "accessConfig"],
1813
2126
  ScopesController_deploy: [],
2127
+ ScopesController_mcpExposureCatalog: ["toolset", "connectionSet", "mcpToolExposure"],
1814
2128
  ScopesController_patchMcpConfig: ["config"],
1815
2129
  ScopesController_requestOwnershipTransfer: ["newOwnerUserId"],
1816
2130
  ScopesController_restore: [],
1817
2131
  ScopesController_update: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "interfaces", "accessConfig", "managerId", "evaluations", "supervisionSubordinateDescriptions"],
2132
+ ScopesController_updateEvaluationCase: ["task", "expectedOutput"],
1818
2133
  ScopeSupervisionController_set: ["subordinateAgentIds"],
1819
2134
  ScopeSupervisionController_setActive: ["subordinateAgentIds"],
1820
2135
  SuggestionsController_recordEvent: ["eventType", "source", "skillId", "threadId", "metadata"],
@@ -1836,23 +2151,29 @@ var WRITE_BODY_ALLOWED_KEYS = {
1836
2151
  var DEFAULT_MAX_PAGE_SIZE = 200;
1837
2152
  function validatePageSize(pageSize, maxPageSize) {
1838
2153
  if (!Number.isInteger(pageSize) || pageSize < 1) {
1839
- throw new Error(`page_size must be a positive int, got ${pageSize}`);
2154
+ throw new ValidationError(`page_size must be a positive int, got ${pageSize}`);
1840
2155
  }
1841
2156
  if (maxPageSize !== void 0 && pageSize > maxPageSize) {
1842
- throw new Error(`page_size must be <= ${maxPageSize}, got ${pageSize}`);
2157
+ throw new ValidationError(`page_size must be <= ${maxPageSize}, got ${pageSize}`);
1843
2158
  }
1844
2159
  }
1845
2160
  function validateId(resourceId, name = "id") {
1846
- if (typeof resourceId === "string" && !resourceId.trim()) {
1847
- throw new Error(`${name} must be a non-empty string or int`);
2161
+ if (typeof resourceId === "number") {
2162
+ if (!Number.isInteger(resourceId)) throw new ValidationError(`${name} must be an integer, got ${resourceId}`);
2163
+ return;
2164
+ }
2165
+ if (!resourceId.trim()) throw new ValidationError(`${name} must be a non-empty string or int`);
2166
+ if (resourceId === "." || resourceId === "..") {
2167
+ throw new ValidationError(`${name} must not be ${JSON.stringify(resourceId)}`);
1848
2168
  }
1849
2169
  }
1850
- var ALLOWED_CHAT_MODELS = /* @__PURE__ */ new Set([
2170
+ var CHAT_MODELS = [
1851
2171
  "claude-sonnet-5",
1852
2172
  "claude-sonnet-5.5",
1853
2173
  "claude-sonnet-4.6",
1854
2174
  "claude-opus-4.8",
1855
2175
  "claude-opus-5.5",
2176
+ "claude-haiku-5.5",
1856
2177
  "gpt-5.2",
1857
2178
  "gpt-5.5",
1858
2179
  "gpt-5-mini",
@@ -1866,21 +2187,24 @@ var ALLOWED_CHAT_MODELS = /* @__PURE__ */ new Set([
1866
2187
  "deepseek-chat-v3.1",
1867
2188
  "deepseek-v4-pro",
1868
2189
  "deepseek-v4-flash-latest",
2190
+ "deepseek-v4.1-flash-1017",
1869
2191
  "minimax-m2.7",
1870
2192
  "llama-4-maverick",
1871
2193
  "llama-4-scout",
1872
2194
  "llama-3.3-70b-instruct",
1873
2195
  "gemini-3.1-pro-preview",
1874
2196
  "gemini-3-flash-preview",
2197
+ "gemini-3.8-flash",
1875
2198
  "grok-4.3-fast",
1876
2199
  "grok-4.3",
1877
2200
  "grok-4.7",
1878
2201
  "kimi-k3"
1879
- ]);
2202
+ ];
2203
+ var ALLOWED_CHAT_MODELS = new Set(CHAT_MODELS);
1880
2204
  function validateChatModel(model) {
1881
2205
  if (!ALLOWED_CHAT_MODELS.has(model)) {
1882
2206
  const supported = [...ALLOWED_CHAT_MODELS].sort().join(", ");
1883
- throw new Error(`Unsupported model ${JSON.stringify(model)}. Choose one of: ${supported}.`);
2207
+ throw new ValidationError(`Unsupported model ${JSON.stringify(model)}. Choose one of: ${supported}.`);
1884
2208
  }
1885
2209
  }
1886
2210
  function assertWriteBodyKeys(operationId, body) {
@@ -1913,9 +2237,11 @@ function formatPath(template, pathParams) {
1913
2237
  if (!segment.startsWith("{") || !segment.endsWith("}")) return segment;
1914
2238
  const key = segment.slice(1, -1);
1915
2239
  if (!(key in pathParams)) {
1916
- throw new Error(`Missing path parameter ${JSON.stringify(key)} for ${JSON.stringify(template)}`);
2240
+ throw new ValidationError(`Missing path parameter ${JSON.stringify(key)} for ${JSON.stringify(template)}`);
1917
2241
  }
1918
- return encodeURIComponent(String(pathParams[key]));
2242
+ const value = String(pathParams[key]);
2243
+ validateId(value, key);
2244
+ return encodeURIComponent(value);
1919
2245
  }).join("/");
1920
2246
  }
1921
2247
  function operationBaseUrl(http, operation) {
@@ -1936,7 +2262,7 @@ async function invokeOperation(http, operationId, options = {}) {
1936
2262
  case "GET":
1937
2263
  return http.get(path, params, requestOptions);
1938
2264
  case "POST":
1939
- return http.post(path, options.jsonBody, requestOptions);
2265
+ return http.post(path, options.jsonBody, { ...requestOptions, idempotent: op.idempotent });
1940
2266
  case "PUT":
1941
2267
  return http.put(path, options.jsonBody, requestOptions);
1942
2268
  case "PATCH":
@@ -1948,50 +2274,25 @@ async function invokeOperation(http, operationId, options = {}) {
1948
2274
  }
1949
2275
  }
1950
2276
 
1951
- // src/_retry.ts
1952
- var DEPLOY_NOT_FOUND_BACKOFF_MS = 500;
1953
- var MAX_DEPLOY_NOT_FOUND_RETRIES = 1;
1954
- var RETRYABLE = [RateLimitError, InternalServerError, APIConnectionError];
1955
- function isRetryable(error) {
1956
- return RETRYABLE.some((Cls) => error instanceof Cls);
1957
- }
1958
- function backoffSeconds(attempt, error) {
1959
- if (error instanceof RateLimitError && error.retryAfter !== void 0) {
1960
- return Math.max(0, error.retryAfter);
1961
- }
1962
- if (attempt === 0) return 0;
1963
- return Math.max(0.5, 2 ** (attempt - 1) + (Math.random() * 0.6 - 0.3));
1964
- }
1965
- function sleep(ms) {
1966
- return new Promise((resolve) => setTimeout(resolve, ms));
1967
- }
1968
- async function withRetry(fn, maxRetries, options = {}) {
1969
- let deployNotFoundRetries = 0;
1970
- let attempt = 0;
1971
- while (true) {
1972
- try {
1973
- return await fn();
1974
- } catch (error) {
1975
- if (options.retryNotFoundOnDeploy && error instanceof NotFoundError && deployNotFoundRetries < MAX_DEPLOY_NOT_FOUND_RETRIES) {
1976
- deployNotFoundRetries++;
1977
- await sleep(DEPLOY_NOT_FOUND_BACKOFF_MS);
1978
- continue;
1979
- }
1980
- if (!isRetryable(error) || attempt >= maxRetries) throw error;
1981
- await sleep(backoffSeconds(attempt, error) * 1e3);
1982
- attempt++;
1983
- }
1984
- }
1985
- }
1986
-
1987
2277
  // src/_request.ts
1988
2278
  async function invokeWithRetry(config, http, operationId, options = {}) {
1989
2279
  if (options.jsonBody !== void 0) {
1990
2280
  assertWriteBodyKeys(operationId, options.jsonBody);
1991
2281
  }
1992
- return withRetry(() => invokeOperation(http, operationId, options), config.maxRetries, {
1993
- retryNotFoundOnDeploy: operationId.endsWith("_deploy")
1994
- });
2282
+ const own = headerValue(config.defaultHeaders, "traceparent") ?? headerValue(options.headers, "traceparent");
2283
+ const traceId = own === void 0 ? newTraceId() : void 0;
2284
+ return withRetry(
2285
+ (resend) => invokeOperation(http, operationId, {
2286
+ ...options,
2287
+ headers: {
2288
+ ...traceId ? { traceparent: traceparent(traceId) } : {},
2289
+ ...resend > 0 ? { "X-Modus-Retry-Attempt": String(resend) } : {},
2290
+ ...options.headers
2291
+ }
2292
+ }),
2293
+ config.maxRetries,
2294
+ { retryNotFoundOnDeploy: operationId.endsWith("_deploy") }
2295
+ );
1995
2296
  }
1996
2297
  function omitUndefined(obj) {
1997
2298
  return Object.fromEntries(
@@ -2037,7 +2338,7 @@ var CustomContextItemsResource = class {
2037
2338
  *
2038
2339
  * @param options.pageSize - Maximum items per page (default 25).
2039
2340
  * @param options.pageToken - Opaque token from a previous page.
2040
- * @param options.searchQuery - Free-text search filter.
2341
+ * @param options.searchQuery - Word search: returns rows that contain every word of the query, case-insensitive.
2041
2342
  * @param options.topics - Filter to items tagged with any of these topics.
2042
2343
  * @returns A page of custom context items.
2043
2344
  * @example
@@ -2100,12 +2401,16 @@ var CustomContextItemsResource = class {
2100
2401
  * @example
2101
2402
  * ```ts
2102
2403
  * const client = new Modus()
2404
+ * // Create the source and collection first, or use batchCreate as shown below.
2103
2405
  * const created = await client.context.customItems.create({
2104
2406
  * kind: 'entity',
2105
- * sourceId: 'my-source',
2407
+ * sourceId: 'billing-db',
2408
+ * collectionId: 'contracts',
2409
+ * externalId: 'contract-123',
2106
2410
  * name: 'Q3 churn notes',
2107
2411
  * content: { summary: 'Key findings…' },
2108
2412
  * })
2413
+ * console.log(created.uid, created.dataPath)
2109
2414
  * ```
2110
2415
  */
2111
2416
  async create(input) {
@@ -2125,9 +2430,22 @@ var CustomContextItemsResource = class {
2125
2430
  * ```ts
2126
2431
  * const client = new Modus()
2127
2432
  * const created = await client.context.customItems.batchCreate([
2128
- * { kind: 'field', sourceId: 'src', fieldName: 'region', dataType: 'string' },
2129
- * { kind: 'field', sourceId: 'src', fieldName: 'amount', dataType: 'number' },
2433
+ * { kind: 'source', sourceId: 'billing-db', name: 'Billing database' },
2434
+ * {
2435
+ * kind: 'collection',
2436
+ * sourceId: 'billing-db',
2437
+ * collectionId: 'contracts',
2438
+ * name: 'Contracts',
2439
+ * },
2440
+ * {
2441
+ * kind: 'entity',
2442
+ * sourceId: 'billing-db',
2443
+ * collectionId: 'contracts',
2444
+ * externalId: 'contract-123',
2445
+ * name: 'Acme renewal',
2446
+ * },
2130
2447
  * ])
2448
+ * console.log(created.map((item) => item.dataPath))
2131
2449
  * ```
2132
2450
  */
2133
2451
  async batchCreate(inputs) {
@@ -2209,31 +2527,31 @@ var CustomContextItemsResource = class {
2209
2527
  }
2210
2528
  };
2211
2529
 
2212
- // src/resources/scopes/conversations.ts
2213
- function parseListItem(raw) {
2214
- return raw;
2215
- }
2216
- function parseConversation(raw) {
2217
- return raw;
2218
- }
2219
- var ScopeConversationsResource = class {
2530
+ // src/_generated/resources/consumption/scopes/conversations.ts
2531
+ var ScopesConversationsResourceBase = class {
2532
+ /** @internal */
2220
2533
  constructor(http, config, scopeId) {
2221
2534
  this.http = http;
2222
2535
  this.config = config;
2223
2536
  this.scopeId = scopeId;
2224
2537
  }
2225
2538
  /**
2226
- * List conversation threads for this scope, newest first.
2539
+ * List scope conversations.
2227
2540
  *
2228
- * @param options.pageSize - Items per page (default 25).
2229
- * @param options.pageToken - Opaque token from a previous page.
2230
- * @param options.source - Restrict to conversations started from this UI surface
2231
- * (e.g. `"context_chat"`, `"dashboard_copilot"`, `"slack"`).
2541
+ * Returns a page of conversation summaries (most recently updated first) for a scope. Use `id=0`
2542
+ * for your cross-scope recent history. Pass `nextPageToken` as `pageToken` to fetch the next
2543
+ * page.
2544
+ *
2545
+ * **Requires:** `scopes:read`
2546
+ *
2547
+ * @param options.pageSize - Items per page. Defaults to 25.
2548
+ * @param options.pageToken - Opaque page token from a previous response's `nextPageToken`. Omit
2549
+ * for the first page.
2550
+ * @param options.source - Return only conversations started from this UI surface.
2232
2551
  * @param options.sourceRef - Narrow `source` to one instance of that surface — for
2233
- * `"dashboard_copilot"`, a dashboard id. Requires `source`; the API throws an
2234
- * `UnprocessableError` (422) if sent on its own. Conversations recorded before
2235
- * this filter shipped carry no instance key and never match it.
2236
- * @returns Page of conversation list items (`threadId`, `firstMessage`, `messageCount`).
2552
+ * `dashboard_copilot` or `dashboard_assistant`, a dashboard id (both scope conversation history
2553
+ * per dashboard). Requires `source`; sent alone it is a 422.
2554
+ * @returns A page of conversations.
2237
2555
  *
2238
2556
  * @example
2239
2557
  * ```ts
@@ -2263,10 +2581,17 @@ var ScopeConversationsResource = class {
2263
2581
  return buildAipPage(
2264
2582
  data,
2265
2583
  "conversations",
2266
- parseListItem,
2584
+ (raw) => raw,
2267
2585
  (token) => this.listPage(pageSize, token, source, sourceRef)
2268
2586
  );
2269
2587
  }
2588
+ };
2589
+
2590
+ // src/resources/scopes/conversations.ts
2591
+ function parseConversation(raw) {
2592
+ return raw;
2593
+ }
2594
+ var ScopeConversationsResource = class extends ScopesConversationsResourceBase {
2270
2595
  /**
2271
2596
  * Retrieve a thread with full message history.
2272
2597
  *
@@ -2277,9 +2602,13 @@ var ScopeConversationsResource = class {
2277
2602
  *
2278
2603
  * @example
2279
2604
  * ```ts
2280
- * const thread = await client.scopes.conversations(scopeId).get(row.threadId)
2281
- * for (const msg of thread.messages) {
2282
- * console.log(msg.type, String(msg.content).slice(0, 80))
2605
+ * const { items } = await client.scopes.conversations(scopeId).list()
2606
+ * const [first] = items
2607
+ * if (first) {
2608
+ * const thread = await client.scopes.conversations(scopeId).get(first.threadId)
2609
+ * for (const msg of thread.messages) {
2610
+ * console.log(msg.type, String(msg.content).slice(0, 80))
2611
+ * }
2283
2612
  * }
2284
2613
  * ```
2285
2614
  */
@@ -2287,7 +2616,7 @@ var ScopeConversationsResource = class {
2287
2616
  validateId(this.scopeId, "scope_id");
2288
2617
  validateId(threadId, "thread_id");
2289
2618
  if (options.beforeMessageIndex !== void 0 && options.messageLimit === void 0) {
2290
- throw new Error("beforeMessageIndex requires messageLimit");
2619
+ throw new ValidationError("beforeMessageIndex requires messageLimit");
2291
2620
  }
2292
2621
  const data = await invokeWithRetry(this.config, this.http, "ScopeConversationsController_get", {
2293
2622
  pathParams: { id: this.scopeId, threadId },
@@ -2304,6 +2633,7 @@ export {
2304
2633
  OPERATIONS,
2305
2634
  ModusError,
2306
2635
  APIConnectionError,
2636
+ BadRequestError,
2307
2637
  AuthenticationError,
2308
2638
  PermissionDeniedError,
2309
2639
  NotFoundError,
@@ -2314,6 +2644,7 @@ export {
2314
2644
  RunCancelledError,
2315
2645
  StreamTimeoutError,
2316
2646
  ValidationError,
2647
+ requireAgentHost,
2317
2648
  DEFAULT_MAX_PAGE_SIZE,
2318
2649
  validatePageSize,
2319
2650
  validateId,
@@ -2332,4 +2663,4 @@ export {
2332
2663
  CustomContextItemsResource,
2333
2664
  ScopeConversationsResource
2334
2665
  };
2335
- //# sourceMappingURL=chunk-GFS7CNON.js.map
2666
+ //# sourceMappingURL=chunk-BMYCORZF.js.map