@getmodus/sdk 0.9.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,8 @@ var OPERATIONS = {
8
8
  pathParams: [],
9
9
  queryParams: ["pageToken", "pageSize", "type"],
10
10
  requestSchema: null,
11
- responseSchema: "ListConnectionsResponseDto"
11
+ responseSchema: "ListConnectionsResponseDto",
12
+ idempotent: false
12
13
  },
13
14
  "ConnectionsController_listSelections": {
14
15
  method: "GET",
@@ -18,7 +19,8 @@ var OPERATIONS = {
18
19
  pathParams: ["connectionId"],
19
20
  queryParams: ["pageToken", "pageSize"],
20
21
  requestSchema: null,
21
- responseSchema: "ListConnectionSelectionsResponseDto"
22
+ responseSchema: "ListConnectionSelectionsResponseDto",
23
+ idempotent: false
22
24
  },
23
25
  "ContextCreatorsController_createLink": {
24
26
  method: "POST",
@@ -28,7 +30,8 @@ var OPERATIONS = {
28
30
  pathParams: [],
29
31
  queryParams: [],
30
32
  requestSchema: "CreateLinkDto",
31
- responseSchema: "CreatedContextItemResponseDto"
33
+ responseSchema: "CreatedContextItemResponseDto",
34
+ idempotent: false
32
35
  },
33
36
  "ContextCreatorsController_createNote": {
34
37
  method: "POST",
@@ -38,7 +41,8 @@ var OPERATIONS = {
38
41
  pathParams: [],
39
42
  queryParams: [],
40
43
  requestSchema: "CreateNoteDto",
41
- responseSchema: "CreatedContextItemResponseDto"
44
+ responseSchema: "CreatedContextItemResponseDto",
45
+ idempotent: false
42
46
  },
43
47
  "ContextCreatorsController_createSavedQuery": {
44
48
  method: "POST",
@@ -48,7 +52,8 @@ var OPERATIONS = {
48
52
  pathParams: [],
49
53
  queryParams: [],
50
54
  requestSchema: "CreateSavedQueryDto",
51
- responseSchema: "CreatedContextItemResponseDto"
55
+ responseSchema: "CreatedContextItemResponseDto",
56
+ idempotent: false
52
57
  },
53
58
  "ContextFilesController_finalize": {
54
59
  method: "POST",
@@ -58,7 +63,8 @@ var OPERATIONS = {
58
63
  pathParams: ["uploadId"],
59
64
  queryParams: [],
60
65
  requestSchema: "FinalizeUploadDto",
61
- responseSchema: "FileUploadResourceDto"
66
+ responseSchema: "FileUploadResourceDto",
67
+ idempotent: false
62
68
  },
63
69
  "ContextFilesController_finalizeMany": {
64
70
  method: "POST",
@@ -68,7 +74,8 @@ var OPERATIONS = {
68
74
  pathParams: [],
69
75
  queryParams: [],
70
76
  requestSchema: "BulkFinalizeDto",
71
- responseSchema: "BulkFinalizeResponseDto"
77
+ responseSchema: "BulkFinalizeResponseDto",
78
+ idempotent: false
72
79
  },
73
80
  "ContextFilesController_get": {
74
81
  method: "GET",
@@ -78,7 +85,8 @@ var OPERATIONS = {
78
85
  pathParams: ["uploadId"],
79
86
  queryParams: [],
80
87
  requestSchema: null,
81
- responseSchema: "FileUploadResourceDto"
88
+ responseSchema: "FileUploadResourceDto",
89
+ idempotent: false
82
90
  },
83
91
  "ContextFilesController_list": {
84
92
  method: "GET",
@@ -88,7 +96,8 @@ var OPERATIONS = {
88
96
  pathParams: [],
89
97
  queryParams: ["pageToken", "pageSize"],
90
98
  requestSchema: null,
91
- responseSchema: "ListFilesResponseDto"
99
+ responseSchema: "ListFilesResponseDto",
100
+ idempotent: false
92
101
  },
93
102
  "ContextFilesController_uploadFromUrl": {
94
103
  method: "POST",
@@ -98,7 +107,8 @@ var OPERATIONS = {
98
107
  pathParams: [],
99
108
  queryParams: [],
100
109
  requestSchema: "UploadFromUrlDto",
101
- responseSchema: "FileUploadResourceDto"
110
+ responseSchema: "FileUploadResourceDto",
111
+ idempotent: false
102
112
  },
103
113
  "ContextFilesController_uploadFromUrls": {
104
114
  method: "POST",
@@ -108,7 +118,8 @@ var OPERATIONS = {
108
118
  pathParams: [],
109
119
  queryParams: [],
110
120
  requestSchema: "BulkUploadFromUrlsDto",
111
- responseSchema: "BulkUploadFromUrlsResponseDto"
121
+ responseSchema: "BulkUploadFromUrlsResponseDto",
122
+ idempotent: false
112
123
  },
113
124
  "ContextFilesController_uploadUrl": {
114
125
  method: "POST",
@@ -118,7 +129,8 @@ var OPERATIONS = {
118
129
  pathParams: [],
119
130
  queryParams: [],
120
131
  requestSchema: "UploadUrlDto",
121
- responseSchema: "UploadUrlResponseDto"
132
+ responseSchema: "UploadUrlResponseDto",
133
+ idempotent: false
122
134
  },
123
135
  "ContextFilesController_uploadUrls": {
124
136
  method: "POST",
@@ -128,7 +140,19 @@ var OPERATIONS = {
128
140
  pathParams: [],
129
141
  queryParams: [],
130
142
  requestSchema: "BulkUploadUrlsDto",
131
- 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
132
156
  },
133
157
  "ContextItemsController_delete": {
134
158
  method: "DELETE",
@@ -138,7 +162,8 @@ var OPERATIONS = {
138
162
  pathParams: ["uid"],
139
163
  queryParams: [],
140
164
  requestSchema: null,
141
- responseSchema: "DeleteContextItemResponseDto"
165
+ responseSchema: "DeleteContextItemResponseDto",
166
+ idempotent: false
142
167
  },
143
168
  "ContextItemsController_get": {
144
169
  method: "GET",
@@ -148,7 +173,8 @@ var OPERATIONS = {
148
173
  pathParams: ["uid"],
149
174
  queryParams: [],
150
175
  requestSchema: null,
151
- responseSchema: "ContextItemDto"
176
+ responseSchema: "ContextItemDto",
177
+ idempotent: false
152
178
  },
153
179
  "ContextItemsController_list": {
154
180
  method: "GET",
@@ -158,7 +184,8 @@ var OPERATIONS = {
158
184
  pathParams: [],
159
185
  queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics", "connectionIds", "parentUids", "ancestorUids"],
160
186
  requestSchema: null,
161
- responseSchema: "ListContextItemsResponseDto"
187
+ responseSchema: "ListContextItemsResponseDto",
188
+ idempotent: false
162
189
  },
163
190
  "ContextItemsController_listValues": {
164
191
  method: "GET",
@@ -166,9 +193,10 @@ var OPERATIONS = {
166
193
  service: "modus-api",
167
194
  serverUrl: "https://api.getmodus.com",
168
195
  pathParams: ["uid"],
169
- queryParams: ["contextType", "contentKeyPath", "pageSize", "offset", "pageToken", "searchQuery", "dataPathPrefix"],
196
+ queryParams: ["contextType", "contentKeyPath", "pageSize", "pageToken", "searchQuery"],
170
197
  requestSchema: null,
171
- responseSchema: "ListContextItemValuesResponseDto"
198
+ responseSchema: "ListContextItemValuesResponseDto",
199
+ idempotent: false
172
200
  },
173
201
  "ContextItemsController_lookup": {
174
202
  method: "POST",
@@ -178,7 +206,8 @@ var OPERATIONS = {
178
206
  pathParams: [],
179
207
  queryParams: [],
180
208
  requestSchema: "LookupContextItemDto",
181
- responseSchema: "LookupContextItemResponseDto"
209
+ responseSchema: "LookupContextItemResponseDto",
210
+ idempotent: true
182
211
  },
183
212
  "ContextItemsController_move": {
184
213
  method: "POST",
@@ -188,7 +217,8 @@ var OPERATIONS = {
188
217
  pathParams: ["uid"],
189
218
  queryParams: [],
190
219
  requestSchema: "MoveContextItemDto",
191
- responseSchema: "MoveContextItemResponseDto"
220
+ responseSchema: "MoveContextItemResponseDto",
221
+ idempotent: false
192
222
  },
193
223
  "ContextItemsController_update": {
194
224
  method: "PATCH",
@@ -198,7 +228,8 @@ var OPERATIONS = {
198
228
  pathParams: ["uid"],
199
229
  queryParams: ["updateMask"],
200
230
  requestSchema: "UpdateContextItemDto",
201
- responseSchema: null
231
+ responseSchema: null,
232
+ idempotent: false
202
233
  },
203
234
  "CustomContextItemsController_batchCreate": {
204
235
  method: "POST",
@@ -208,7 +239,8 @@ var OPERATIONS = {
208
239
  pathParams: [],
209
240
  queryParams: [],
210
241
  requestSchema: "BatchCreateCustomContextItemsDto",
211
- responseSchema: "BatchCreateCustomContextItemsResponseDto"
242
+ responseSchema: "BatchCreateCustomContextItemsResponseDto",
243
+ idempotent: false
212
244
  },
213
245
  "CustomContextItemsController_create": {
214
246
  method: "POST",
@@ -218,7 +250,8 @@ var OPERATIONS = {
218
250
  pathParams: [],
219
251
  queryParams: [],
220
252
  requestSchema: "CreateCustomContextItemDto",
221
- responseSchema: "CreatedCustomContextItemResponseDto"
253
+ responseSchema: "CreatedCustomContextItemResponseDto",
254
+ idempotent: false
222
255
  },
223
256
  "CustomContextItemsController_createRelations": {
224
257
  method: "POST",
@@ -228,7 +261,8 @@ var OPERATIONS = {
228
261
  pathParams: [],
229
262
  queryParams: [],
230
263
  requestSchema: "BatchCreateCustomContextItemRelationsDto",
231
- responseSchema: "BatchCreateCustomContextItemRelationsResponseDto"
264
+ responseSchema: "BatchCreateCustomContextItemRelationsResponseDto",
265
+ idempotent: false
232
266
  },
233
267
  "CustomContextItemsController_delete": {
234
268
  method: "DELETE",
@@ -238,7 +272,8 @@ var OPERATIONS = {
238
272
  pathParams: ["uid"],
239
273
  queryParams: [],
240
274
  requestSchema: null,
241
- responseSchema: "DeleteContextItemResponseDto"
275
+ responseSchema: "DeleteContextItemResponseDto",
276
+ idempotent: false
242
277
  },
243
278
  "CustomContextItemsController_get": {
244
279
  method: "GET",
@@ -248,7 +283,8 @@ var OPERATIONS = {
248
283
  pathParams: ["uid"],
249
284
  queryParams: [],
250
285
  requestSchema: null,
251
- responseSchema: "ContextItemDto"
286
+ responseSchema: "ContextItemDto",
287
+ idempotent: false
252
288
  },
253
289
  "CustomContextItemsController_list": {
254
290
  method: "GET",
@@ -258,7 +294,8 @@ var OPERATIONS = {
258
294
  pathParams: [],
259
295
  queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics"],
260
296
  requestSchema: null,
261
- responseSchema: "ListCustomContextItemsResponseDto"
297
+ responseSchema: "ListCustomContextItemsResponseDto",
298
+ idempotent: false
262
299
  },
263
300
  "CustomContextItemsController_update": {
264
301
  method: "PATCH",
@@ -268,7 +305,8 @@ var OPERATIONS = {
268
305
  pathParams: ["uid"],
269
306
  queryParams: [],
270
307
  requestSchema: "UpdateCustomContextItemDto",
271
- responseSchema: null
308
+ responseSchema: null,
309
+ idempotent: false
272
310
  },
273
311
  "DashboardsController_acceptOwnership": {
274
312
  method: "POST",
@@ -278,7 +316,8 @@ var OPERATIONS = {
278
316
  pathParams: ["dashboardId"],
279
317
  queryParams: [],
280
318
  requestSchema: null,
281
- responseSchema: "DashboardDto"
319
+ responseSchema: "DashboardDto",
320
+ idempotent: false
282
321
  },
283
322
  "DashboardsController_cancelOwnership": {
284
323
  method: "DELETE",
@@ -288,7 +327,8 @@ var OPERATIONS = {
288
327
  pathParams: ["dashboardId"],
289
328
  queryParams: [],
290
329
  requestSchema: null,
291
- responseSchema: "DashboardDto"
330
+ responseSchema: "DashboardDto",
331
+ idempotent: false
292
332
  },
293
333
  "DashboardsController_create": {
294
334
  method: "POST",
@@ -298,7 +338,8 @@ var OPERATIONS = {
298
338
  pathParams: [],
299
339
  queryParams: [],
300
340
  requestSchema: "CreateDashboardDto",
301
- responseSchema: "DashboardDto"
341
+ responseSchema: "DashboardDto",
342
+ idempotent: false
302
343
  },
303
344
  "DashboardsController_createElement": {
304
345
  method: "POST",
@@ -308,7 +349,8 @@ var OPERATIONS = {
308
349
  pathParams: ["dashboardId"],
309
350
  queryParams: [],
310
351
  requestSchema: "CreateDashboardElementDto",
311
- responseSchema: "DashboardElementResponseDto"
352
+ responseSchema: "DashboardElementResponseDto",
353
+ idempotent: false
312
354
  },
313
355
  "DashboardsController_delete": {
314
356
  method: "DELETE",
@@ -318,7 +360,8 @@ var OPERATIONS = {
318
360
  pathParams: ["dashboardId"],
319
361
  queryParams: [],
320
362
  requestSchema: null,
321
- responseSchema: null
363
+ responseSchema: null,
364
+ idempotent: false
322
365
  },
323
366
  "DashboardsController_get": {
324
367
  method: "GET",
@@ -328,7 +371,8 @@ var OPERATIONS = {
328
371
  pathParams: ["dashboardId"],
329
372
  queryParams: ["view"],
330
373
  requestSchema: null,
331
- responseSchema: "DashboardDto"
374
+ responseSchema: "DashboardDto",
375
+ idempotent: false
332
376
  },
333
377
  "DashboardsController_getElement": {
334
378
  method: "GET",
@@ -338,7 +382,8 @@ var OPERATIONS = {
338
382
  pathParams: ["dashboardId", "elementId"],
339
383
  queryParams: [],
340
384
  requestSchema: null,
341
- responseSchema: "DashboardElementResponseDto"
385
+ responseSchema: "DashboardElementResponseDto",
386
+ idempotent: false
342
387
  },
343
388
  "DashboardsController_getVersion": {
344
389
  method: "GET",
@@ -348,7 +393,8 @@ var OPERATIONS = {
348
393
  pathParams: ["dashboardId", "versionId"],
349
394
  queryParams: [],
350
395
  requestSchema: null,
351
- responseSchema: "DashboardDto"
396
+ responseSchema: "DashboardDto",
397
+ idempotent: false
352
398
  },
353
399
  "DashboardsController_list": {
354
400
  method: "GET",
@@ -358,7 +404,8 @@ var OPERATIONS = {
358
404
  pathParams: [],
359
405
  queryParams: ["view"],
360
406
  requestSchema: null,
361
- responseSchema: "ListDashboardsResponseDto"
407
+ responseSchema: "ListDashboardsResponseDto",
408
+ idempotent: false
362
409
  },
363
410
  "DashboardsController_listDraftSnapshots": {
364
411
  method: "GET",
@@ -368,7 +415,8 @@ var OPERATIONS = {
368
415
  pathParams: ["dashboardId"],
369
416
  queryParams: [],
370
417
  requestSchema: null,
371
- responseSchema: "ListDashboardDraftSnapshotsResponseDto"
418
+ responseSchema: "ListDashboardDraftSnapshotsResponseDto",
419
+ idempotent: false
372
420
  },
373
421
  "DashboardsController_listElements": {
374
422
  method: "GET",
@@ -378,7 +426,8 @@ var OPERATIONS = {
378
426
  pathParams: ["dashboardId"],
379
427
  queryParams: [],
380
428
  requestSchema: null,
381
- responseSchema: "DashboardElementsListResponseDto"
429
+ responseSchema: "DashboardElementsListResponseDto",
430
+ idempotent: false
382
431
  },
383
432
  "DashboardsController_listVersions": {
384
433
  method: "GET",
@@ -388,7 +437,8 @@ var OPERATIONS = {
388
437
  pathParams: ["dashboardId"],
389
438
  queryParams: [],
390
439
  requestSchema: null,
391
- responseSchema: "ListDashboardVersionsResponseDto"
440
+ responseSchema: "ListDashboardVersionsResponseDto",
441
+ idempotent: false
392
442
  },
393
443
  "DashboardsController_publish": {
394
444
  method: "POST",
@@ -398,7 +448,8 @@ var OPERATIONS = {
398
448
  pathParams: ["dashboardId"],
399
449
  queryParams: [],
400
450
  requestSchema: "PublishDashboardDto",
401
- responseSchema: "PublishDashboardResponseDto"
451
+ responseSchema: "PublishDashboardResponseDto",
452
+ idempotent: false
402
453
  },
403
454
  "DashboardsController_restore": {
404
455
  method: "POST",
@@ -408,7 +459,8 @@ var OPERATIONS = {
408
459
  pathParams: ["dashboardId", "versionId"],
409
460
  queryParams: [],
410
461
  requestSchema: null,
411
- responseSchema: "DashboardDto"
462
+ responseSchema: "DashboardDto",
463
+ idempotent: false
412
464
  },
413
465
  "DashboardsController_transferOwnership": {
414
466
  method: "POST",
@@ -418,7 +470,8 @@ var OPERATIONS = {
418
470
  pathParams: ["dashboardId"],
419
471
  queryParams: [],
420
472
  requestSchema: "TransferDashboardOwnershipDto",
421
- responseSchema: "DashboardDto"
473
+ responseSchema: "DashboardDto",
474
+ idempotent: false
422
475
  },
423
476
  "DashboardsController_updateAccess": {
424
477
  method: "PATCH",
@@ -428,7 +481,8 @@ var OPERATIONS = {
428
481
  pathParams: ["dashboardId"],
429
482
  queryParams: [],
430
483
  requestSchema: "UpdateDashboardAccessDto",
431
- responseSchema: "DashboardDto"
484
+ responseSchema: "DashboardDto",
485
+ idempotent: false
432
486
  },
433
487
  "DashboardsController_updateDraft": {
434
488
  method: "PATCH",
@@ -438,7 +492,8 @@ var OPERATIONS = {
438
492
  pathParams: ["dashboardId"],
439
493
  queryParams: [],
440
494
  requestSchema: "UpdateDashboardDraftDto",
441
- responseSchema: "DashboardDto"
495
+ responseSchema: "DashboardDto",
496
+ idempotent: false
442
497
  },
443
498
  "DashboardsController_updateElement": {
444
499
  method: "PATCH",
@@ -448,7 +503,8 @@ var OPERATIONS = {
448
503
  pathParams: ["dashboardId", "elementId"],
449
504
  queryParams: [],
450
505
  requestSchema: "UpdateDashboardElementDto",
451
- responseSchema: "DashboardDto"
506
+ responseSchema: "DashboardDto",
507
+ idempotent: false
452
508
  },
453
509
  "DashboardsController_updateLayout": {
454
510
  method: "PATCH",
@@ -458,7 +514,8 @@ var OPERATIONS = {
458
514
  pathParams: ["dashboardId"],
459
515
  queryParams: [],
460
516
  requestSchema: "UpdateDashboardLayoutDto",
461
- responseSchema: "DashboardDto"
517
+ responseSchema: "DashboardDto",
518
+ idempotent: false
462
519
  },
463
520
  "EvaluationsController_getConfig": {
464
521
  method: "GET",
@@ -468,7 +525,8 @@ var OPERATIONS = {
468
525
  pathParams: ["id"],
469
526
  queryParams: [],
470
527
  requestSchema: null,
471
- responseSchema: "EvaluationConfigDto"
528
+ responseSchema: "EvaluationConfigDto",
529
+ idempotent: false
472
530
  },
473
531
  "EvaluationsController_getRun": {
474
532
  method: "GET",
@@ -478,7 +536,8 @@ var OPERATIONS = {
478
536
  pathParams: ["id", "runId"],
479
537
  queryParams: [],
480
538
  requestSchema: null,
481
- responseSchema: "EvaluationRunWithResultsDto"
539
+ responseSchema: "EvaluationRunWithResultsDto",
540
+ idempotent: false
482
541
  },
483
542
  "EvaluationsController_listRuns": {
484
543
  method: "GET",
@@ -488,7 +547,8 @@ var OPERATIONS = {
488
547
  pathParams: ["id"],
489
548
  queryParams: ["pageSize", "pageToken"],
490
549
  requestSchema: null,
491
- responseSchema: "ListEvaluationRunsResponseDto"
550
+ responseSchema: "ListEvaluationRunsResponseDto",
551
+ idempotent: false
492
552
  },
493
553
  "EvaluationsController_triggerRun": {
494
554
  method: "POST",
@@ -498,7 +558,8 @@ var OPERATIONS = {
498
558
  pathParams: ["id"],
499
559
  queryParams: [],
500
560
  requestSchema: null,
501
- responseSchema: "TriggerEvaluationRunResponseDto"
561
+ responseSchema: "TriggerEvaluationRunResponseDto",
562
+ idempotent: false
502
563
  },
503
564
  "EvaluationsController_updateConfig": {
504
565
  method: "PUT",
@@ -508,7 +569,8 @@ var OPERATIONS = {
508
569
  pathParams: ["id"],
509
570
  queryParams: [],
510
571
  requestSchema: "UpdateEvaluationConfigDto",
511
- responseSchema: "EvaluationConfigDto"
572
+ responseSchema: "EvaluationConfigDto",
573
+ idempotent: false
512
574
  },
513
575
  "IngestedDataController_upload": {
514
576
  method: "POST",
@@ -518,7 +580,8 @@ var OPERATIONS = {
518
580
  pathParams: [],
519
581
  queryParams: [],
520
582
  requestSchema: "CreateIngestedDataDto",
521
- responseSchema: "CreatedIngestedDataResponseDto"
583
+ responseSchema: "CreatedIngestedDataResponseDto",
584
+ idempotent: true
522
585
  },
523
586
  "MemberGroupsController_list": {
524
587
  method: "GET",
@@ -528,27 +591,19 @@ var OPERATIONS = {
528
591
  pathParams: [],
529
592
  queryParams: [],
530
593
  requestSchema: null,
531
- responseSchema: "ListMemberGroupsResponseDto"
594
+ responseSchema: "ListMemberGroupsResponseDto",
595
+ idempotent: false
532
596
  },
533
- "ModusChatController_chat": {
597
+ "ModusContextComposeController_compose": {
534
598
  method: "POST",
535
- path: "/api/v1/modus/chat",
536
- service: "modus-api",
537
- serverUrl: "https://api.getmodus.com",
599
+ path: "/agent/v1/modus/context",
600
+ service: "agent-service",
601
+ serverUrl: "https://agent.getmodus.com",
538
602
  pathParams: [],
539
603
  queryParams: [],
540
- requestSchema: "ModusChatRequestDto",
541
- responseSchema: "ModusChatResponseDto"
542
- },
543
- "ModusChatController_chatContinue": {
544
- method: "POST",
545
- path: "/api/v1/modus/conversations/{threadId}/chat",
546
- service: "modus-api",
547
- serverUrl: "https://api.getmodus.com",
548
- pathParams: ["threadId"],
549
- queryParams: [],
550
- requestSchema: "ModusChatRequestDto",
551
- responseSchema: "ModusChatResponseDto"
604
+ requestSchema: "ModusContextRequestDto",
605
+ responseSchema: "ModusContextResponseDto",
606
+ idempotent: true
552
607
  },
553
608
  "ModusContextController_compose": {
554
609
  method: "POST",
@@ -558,7 +613,8 @@ var OPERATIONS = {
558
613
  pathParams: [],
559
614
  queryParams: [],
560
615
  requestSchema: "ModusContextRequestDto",
561
- responseSchema: "ModusContextResponseDto"
616
+ responseSchema: "ModusContextResponseDto",
617
+ idempotent: false
562
618
  },
563
619
  "ModusConversationsController_get": {
564
620
  method: "GET",
@@ -568,7 +624,8 @@ var OPERATIONS = {
568
624
  pathParams: ["threadId"],
569
625
  queryParams: [],
570
626
  requestSchema: null,
571
- responseSchema: "ConversationDto"
627
+ responseSchema: "ConversationDto",
628
+ idempotent: false
572
629
  },
573
630
  "ModusConversationsController_list": {
574
631
  method: "GET",
@@ -578,7 +635,8 @@ var OPERATIONS = {
578
635
  pathParams: [],
579
636
  queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "source", "sourceRef", "timeframe", "includeTools", "kind"],
580
637
  requestSchema: null,
581
- responseSchema: "ListConversationsResponseDto"
638
+ responseSchema: "ListConversationsResponseDto",
639
+ idempotent: false
582
640
  },
583
641
  "ModusRunsController_create": {
584
642
  method: "POST",
@@ -588,7 +646,8 @@ var OPERATIONS = {
588
646
  pathParams: [],
589
647
  queryParams: [],
590
648
  requestSchema: "ModusRunDto",
591
- responseSchema: null
649
+ responseSchema: null,
650
+ idempotent: false
592
651
  },
593
652
  "OrgMembersController_list": {
594
653
  method: "GET",
@@ -598,7 +657,8 @@ var OPERATIONS = {
598
657
  pathParams: [],
599
658
  queryParams: [],
600
659
  requestSchema: null,
601
- responseSchema: "ListOrgMembersResponseDto"
660
+ responseSchema: "ListOrgMembersResponseDto",
661
+ idempotent: false
602
662
  },
603
663
  "ResumeRunsController_create": {
604
664
  method: "POST",
@@ -608,7 +668,8 @@ var OPERATIONS = {
608
668
  pathParams: ["runId"],
609
669
  queryParams: [],
610
670
  requestSchema: "ResumeRunDto",
611
- responseSchema: null
671
+ responseSchema: null,
672
+ idempotent: false
612
673
  },
613
674
  "RunLifecycleController_active": {
614
675
  method: "GET",
@@ -618,7 +679,8 @@ var OPERATIONS = {
618
679
  pathParams: [],
619
680
  queryParams: ["pageToken", "pageSize"],
620
681
  requestSchema: null,
621
- responseSchema: "ActiveRunsResponseDto"
682
+ responseSchema: "ActiveRunsResponseDto",
683
+ idempotent: false
622
684
  },
623
685
  "RunLifecycleController_activeBySession": {
624
686
  method: "POST",
@@ -628,7 +690,8 @@ var OPERATIONS = {
628
690
  pathParams: [],
629
691
  queryParams: [],
630
692
  requestSchema: "ActiveRunsBySessionDto",
631
- responseSchema: "ActiveRunsBySessionResponseDto"
693
+ responseSchema: "ActiveRunsBySessionResponseDto",
694
+ idempotent: true
632
695
  },
633
696
  "RunLifecycleController_cancel": {
634
697
  method: "POST",
@@ -638,7 +701,8 @@ var OPERATIONS = {
638
701
  pathParams: ["runId"],
639
702
  queryParams: [],
640
703
  requestSchema: "CancelRunDto",
641
- responseSchema: null
704
+ responseSchema: null,
705
+ idempotent: true
642
706
  },
643
707
  "RunLifecycleController_editQueued": {
644
708
  method: "POST",
@@ -648,7 +712,8 @@ var OPERATIONS = {
648
712
  pathParams: ["runId"],
649
713
  queryParams: [],
650
714
  requestSchema: "EditQueuedRunDto",
651
- responseSchema: null
715
+ responseSchema: "RunAdmissionResponseDto",
716
+ idempotent: false
652
717
  },
653
718
  "RunLifecycleController_events": {
654
719
  method: "GET",
@@ -658,7 +723,8 @@ var OPERATIONS = {
658
723
  pathParams: ["runId"],
659
724
  queryParams: [],
660
725
  requestSchema: null,
661
- responseSchema: null
726
+ responseSchema: "RunEventsPollResponseDto",
727
+ idempotent: false
662
728
  },
663
729
  "RunLifecycleController_interrupt": {
664
730
  method: "POST",
@@ -668,7 +734,8 @@ var OPERATIONS = {
668
734
  pathParams: ["runId"],
669
735
  queryParams: [],
670
736
  requestSchema: "InterruptRunDto",
671
- responseSchema: null
737
+ responseSchema: "RunAdmissionResponseDto",
738
+ idempotent: true
672
739
  },
673
740
  "RunLifecycleController_stream": {
674
741
  method: "GET",
@@ -678,27 +745,19 @@ var OPERATIONS = {
678
745
  pathParams: ["runId"],
679
746
  queryParams: [],
680
747
  requestSchema: null,
681
- responseSchema: null
748
+ responseSchema: null,
749
+ idempotent: false
682
750
  },
683
- "ScopeChatController_chat": {
751
+ "ScopeContextComposeController_compose": {
684
752
  method: "POST",
685
- path: "/api/v1/scopes/{id}/chat",
686
- service: "modus-api",
687
- serverUrl: "https://api.getmodus.com",
753
+ path: "/agent/v1/scopes/{id}/context",
754
+ service: "agent-service",
755
+ serverUrl: "https://agent.getmodus.com",
688
756
  pathParams: ["id"],
689
757
  queryParams: [],
690
- requestSchema: "SkillChatRequestDto",
691
- responseSchema: "SkillChatResponseDto"
692
- },
693
- "ScopeChatController_chatContinue": {
694
- method: "POST",
695
- path: "/api/v1/scopes/{id}/conversations/{threadId}/chat",
696
- service: "modus-api",
697
- serverUrl: "https://api.getmodus.com",
698
- pathParams: ["id", "threadId"],
699
- queryParams: [],
700
- requestSchema: "SkillChatRequestDto",
701
- responseSchema: "SkillChatResponseDto"
758
+ requestSchema: "ComposeSkillContextRequestDto",
759
+ responseSchema: "ComposeSkillContextResponseDto",
760
+ idempotent: true
702
761
  },
703
762
  "ScopeContextController_compose": {
704
763
  method: "POST",
@@ -708,7 +767,8 @@ var OPERATIONS = {
708
767
  pathParams: ["id"],
709
768
  queryParams: [],
710
769
  requestSchema: "ComposeSkillContextRequestDto",
711
- responseSchema: "ComposeSkillContextResponseDto"
770
+ responseSchema: "ComposeSkillContextResponseDto",
771
+ idempotent: false
712
772
  },
713
773
  "ScopeConversationsController_get": {
714
774
  method: "GET",
@@ -718,7 +778,8 @@ var OPERATIONS = {
718
778
  pathParams: ["id", "threadId"],
719
779
  queryParams: ["messageLimit", "beforeMessageIndex"],
720
780
  requestSchema: null,
721
- responseSchema: "ConversationDto"
781
+ responseSchema: "ConversationDto",
782
+ idempotent: false
722
783
  },
723
784
  "ScopeConversationsController_list": {
724
785
  method: "GET",
@@ -728,7 +789,8 @@ var OPERATIONS = {
728
789
  pathParams: ["id"],
729
790
  queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "source", "sourceRef", "timeframe", "includeTools"],
730
791
  requestSchema: null,
731
- responseSchema: "ListConversationsResponseDto"
792
+ responseSchema: "ListConversationsResponseDto",
793
+ idempotent: false
732
794
  },
733
795
  "ScopeInterfacesController_add": {
734
796
  method: "POST",
@@ -738,7 +800,8 @@ var OPERATIONS = {
738
800
  pathParams: ["id"],
739
801
  queryParams: [],
740
802
  requestSchema: "AddScopeInterfaceDto",
741
- responseSchema: "ScopeInterfaceDto"
803
+ responseSchema: "ScopeInterfaceDto",
804
+ idempotent: false
742
805
  },
743
806
  "ScopeInterfacesController_delete": {
744
807
  method: "DELETE",
@@ -748,7 +811,8 @@ var OPERATIONS = {
748
811
  pathParams: ["id", "interfaceId"],
749
812
  queryParams: [],
750
813
  requestSchema: null,
751
- responseSchema: null
814
+ responseSchema: null,
815
+ idempotent: false
752
816
  },
753
817
  "ScopeInterfacesController_list": {
754
818
  method: "GET",
@@ -758,7 +822,8 @@ var OPERATIONS = {
758
822
  pathParams: ["id"],
759
823
  queryParams: [],
760
824
  requestSchema: null,
761
- responseSchema: "ListScopeInterfacesResponseDto"
825
+ responseSchema: "ListScopeInterfacesResponseDto",
826
+ idempotent: false
762
827
  },
763
828
  "ScopeInterfacesController_update": {
764
829
  method: "PATCH",
@@ -768,7 +833,8 @@ var OPERATIONS = {
768
833
  pathParams: ["id", "interfaceId"],
769
834
  queryParams: ["updateMask"],
770
835
  requestSchema: "UpdateScopeInterfaceDto",
771
- responseSchema: "ScopeInterfaceDto"
836
+ responseSchema: "ScopeInterfaceDto",
837
+ idempotent: false
772
838
  },
773
839
  "ScopeMemoriesController_delete": {
774
840
  method: "DELETE",
@@ -778,7 +844,8 @@ var OPERATIONS = {
778
844
  pathParams: ["id", "memoryId"],
779
845
  queryParams: [],
780
846
  requestSchema: null,
781
- responseSchema: null
847
+ responseSchema: null,
848
+ idempotent: false
782
849
  },
783
850
  "ScopeMemoriesController_list": {
784
851
  method: "GET",
@@ -788,7 +855,8 @@ var OPERATIONS = {
788
855
  pathParams: ["id"],
789
856
  queryParams: ["pageToken", "pageSize", "userId", "limit"],
790
857
  requestSchema: null,
791
- responseSchema: "ListMemoriesResponseDto"
858
+ responseSchema: "ListMemoriesResponseDto",
859
+ idempotent: false
792
860
  },
793
861
  "ScopeMemoriesController_search": {
794
862
  method: "POST",
@@ -798,7 +866,8 @@ var OPERATIONS = {
798
866
  pathParams: ["id"],
799
867
  queryParams: [],
800
868
  requestSchema: "SearchMemoriesRequestDto",
801
- responseSchema: "ListMemoriesResponseDto"
869
+ responseSchema: "ListMemoriesResponseDto",
870
+ idempotent: true
802
871
  },
803
872
  "ScopeMemoriesController_update": {
804
873
  method: "PATCH",
@@ -808,7 +877,8 @@ var OPERATIONS = {
808
877
  pathParams: ["id", "memoryId"],
809
878
  queryParams: ["updateMask"],
810
879
  requestSchema: "UpdateMemoryRequestDto",
811
- responseSchema: null
880
+ responseSchema: null,
881
+ idempotent: false
812
882
  },
813
883
  "ScopeRunsController_create": {
814
884
  method: "POST",
@@ -818,7 +888,8 @@ var OPERATIONS = {
818
888
  pathParams: ["id"],
819
889
  queryParams: [],
820
890
  requestSchema: "SkillRunDto",
821
- responseSchema: null
891
+ responseSchema: null,
892
+ idempotent: false
822
893
  },
823
894
  "ScopeSupervisionController_get": {
824
895
  method: "GET",
@@ -828,7 +899,8 @@ var OPERATIONS = {
828
899
  pathParams: ["id"],
829
900
  queryParams: ["view"],
830
901
  requestSchema: null,
831
- responseSchema: "SupervisionDto"
902
+ responseSchema: "SupervisionDto",
903
+ idempotent: false
832
904
  },
833
905
  "ScopeSupervisionController_set": {
834
906
  method: "PUT",
@@ -838,7 +910,8 @@ var OPERATIONS = {
838
910
  pathParams: ["id"],
839
911
  queryParams: [],
840
912
  requestSchema: "SetSupervisionRequestDto",
841
- responseSchema: "SupervisionDto"
913
+ responseSchema: "SupervisionDto",
914
+ idempotent: false
842
915
  },
843
916
  "ScopeSupervisionController_setActive": {
844
917
  method: "PUT",
@@ -848,7 +921,8 @@ var OPERATIONS = {
848
921
  pathParams: ["id"],
849
922
  queryParams: [],
850
923
  requestSchema: "SetSupervisionRequestDto",
851
- responseSchema: "SupervisionDto"
924
+ responseSchema: "SupervisionDto",
925
+ idempotent: false
852
926
  },
853
927
  "ScopesController_acceptOwnershipTransfer": {
854
928
  method: "POST",
@@ -858,7 +932,30 @@ var OPERATIONS = {
858
932
  pathParams: ["id"],
859
933
  queryParams: [],
860
934
  requestSchema: null,
861
- 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
862
959
  },
863
960
  "ScopesController_cancelOwnershipTransfer": {
864
961
  method: "DELETE",
@@ -868,7 +965,8 @@ var OPERATIONS = {
868
965
  pathParams: ["id"],
869
966
  queryParams: [],
870
967
  requestSchema: null,
871
- responseSchema: "ScopeDto"
968
+ responseSchema: "ScopeDto",
969
+ idempotent: false
872
970
  },
873
971
  "ScopesController_create": {
874
972
  method: "POST",
@@ -878,7 +976,8 @@ var OPERATIONS = {
878
976
  pathParams: [],
879
977
  queryParams: [],
880
978
  requestSchema: "CreateSkillDto",
881
- responseSchema: "ScopeDto"
979
+ responseSchema: "ScopeDto",
980
+ idempotent: false
882
981
  },
883
982
  "ScopesController_delete": {
884
983
  method: "DELETE",
@@ -888,7 +987,19 @@ var OPERATIONS = {
888
987
  pathParams: ["id"],
889
988
  queryParams: [],
890
989
  requestSchema: null,
891
- 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
892
1003
  },
893
1004
  "ScopesController_deploy": {
894
1005
  method: "POST",
@@ -898,7 +1009,8 @@ var OPERATIONS = {
898
1009
  pathParams: ["id"],
899
1010
  queryParams: [],
900
1011
  requestSchema: "DeploySkillDto",
901
- responseSchema: "DeployResponseDto"
1012
+ responseSchema: "DeployResponseDto",
1013
+ idempotent: false
902
1014
  },
903
1015
  "ScopesController_get": {
904
1016
  method: "GET",
@@ -908,7 +1020,8 @@ var OPERATIONS = {
908
1020
  pathParams: ["id"],
909
1021
  queryParams: ["view"],
910
1022
  requestSchema: null,
911
- responseSchema: "ScopeDto"
1023
+ responseSchema: "ScopeDto",
1024
+ idempotent: false
912
1025
  },
913
1026
  "ScopesController_getVariation": {
914
1027
  method: "GET",
@@ -918,7 +1031,8 @@ var OPERATIONS = {
918
1031
  pathParams: ["id", "variationUid"],
919
1032
  queryParams: [],
920
1033
  requestSchema: null,
921
- responseSchema: "ScopeDto"
1034
+ responseSchema: "ScopeDto",
1035
+ idempotent: false
922
1036
  },
923
1037
  "ScopesController_list": {
924
1038
  method: "GET",
@@ -928,7 +1042,19 @@ var OPERATIONS = {
928
1042
  pathParams: [],
929
1043
  queryParams: ["pageToken", "pageSize", "view", "search", "managerId", "includeVariation"],
930
1044
  requestSchema: null,
931
- 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
932
1058
  },
933
1059
  "ScopesController_patchMcpConfig": {
934
1060
  method: "PATCH",
@@ -938,7 +1064,8 @@ var OPERATIONS = {
938
1064
  pathParams: ["id"],
939
1065
  queryParams: [],
940
1066
  requestSchema: "PatchSkillMcpConfigDto",
941
- responseSchema: "PatchSkillMcpConfigResponseDto"
1067
+ responseSchema: "PatchSkillMcpConfigResponseDto",
1068
+ idempotent: false
942
1069
  },
943
1070
  "ScopesController_requestOwnershipTransfer": {
944
1071
  method: "POST",
@@ -948,7 +1075,8 @@ var OPERATIONS = {
948
1075
  pathParams: ["id"],
949
1076
  queryParams: [],
950
1077
  requestSchema: "TransferOwnershipDto",
951
- responseSchema: "ScopeDto"
1078
+ responseSchema: "ScopeDto",
1079
+ idempotent: false
952
1080
  },
953
1081
  "ScopesController_restore": {
954
1082
  method: "POST",
@@ -958,7 +1086,8 @@ var OPERATIONS = {
958
1086
  pathParams: ["id"],
959
1087
  queryParams: [],
960
1088
  requestSchema: null,
961
- responseSchema: "ScopeDto"
1089
+ responseSchema: "ScopeDto",
1090
+ idempotent: false
962
1091
  },
963
1092
  "ScopesController_update": {
964
1093
  method: "PATCH",
@@ -968,7 +1097,19 @@ var OPERATIONS = {
968
1097
  pathParams: ["id"],
969
1098
  queryParams: ["updateMask"],
970
1099
  requestSchema: "UpdateSkillDto",
971
- 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
972
1113
  },
973
1114
  "SuggestionsController_listApproved": {
974
1115
  method: "GET",
@@ -978,7 +1119,8 @@ var OPERATIONS = {
978
1119
  pathParams: [],
979
1120
  queryParams: ["pageToken", "pageSize", "scopeId", "scopeIds"],
980
1121
  requestSchema: null,
981
- responseSchema: "ListSuggestionQuestionsResponseDto"
1122
+ responseSchema: "ListSuggestionQuestionsResponseDto",
1123
+ idempotent: false
982
1124
  },
983
1125
  "SuggestionsController_recordEvent": {
984
1126
  method: "POST",
@@ -988,7 +1130,8 @@ var OPERATIONS = {
988
1130
  pathParams: ["id"],
989
1131
  queryParams: [],
990
1132
  requestSchema: "RecordSuggestionEventDto",
991
- responseSchema: null
1133
+ responseSchema: null,
1134
+ idempotent: false
992
1135
  },
993
1136
  "ToolsController_list": {
994
1137
  method: "GET",
@@ -998,7 +1141,8 @@ var OPERATIONS = {
998
1141
  pathParams: [],
999
1142
  queryParams: ["pageToken", "pageSize"],
1000
1143
  requestSchema: null,
1001
- responseSchema: "ListToolsResponseDto"
1144
+ responseSchema: "ListToolsResponseDto",
1145
+ idempotent: false
1002
1146
  },
1003
1147
  "UsageController_list": {
1004
1148
  method: "GET",
@@ -1008,7 +1152,8 @@ var OPERATIONS = {
1008
1152
  pathParams: [],
1009
1153
  queryParams: ["since", "until", "rollup", "model", "group_by", "skill_id", "agent_id", "user_id", "interface", "user_email"],
1010
1154
  requestSchema: null,
1011
- responseSchema: "ListUsageResponseDto"
1155
+ responseSchema: "ListUsageResponseDto",
1156
+ idempotent: false
1012
1157
  },
1013
1158
  "UsageController_listUsers": {
1014
1159
  method: "GET",
@@ -1018,7 +1163,8 @@ var OPERATIONS = {
1018
1163
  pathParams: [],
1019
1164
  queryParams: ["since", "until"],
1020
1165
  requestSchema: null,
1021
- responseSchema: "ListUsageUsersResponseDto"
1166
+ responseSchema: "ListUsageUsersResponseDto",
1167
+ idempotent: false
1022
1168
  },
1023
1169
  "WorkflowActionsController_cancel": {
1024
1170
  method: "POST",
@@ -1028,7 +1174,8 @@ var OPERATIONS = {
1028
1174
  pathParams: ["runId"],
1029
1175
  queryParams: [],
1030
1176
  requestSchema: "CancelRunDto",
1031
- responseSchema: null
1177
+ responseSchema: null,
1178
+ idempotent: true
1032
1179
  },
1033
1180
  "WorkflowActionsController_execute": {
1034
1181
  method: "POST",
@@ -1038,7 +1185,8 @@ var OPERATIONS = {
1038
1185
  pathParams: [],
1039
1186
  queryParams: [],
1040
1187
  requestSchema: "WorkflowActionDto",
1041
- responseSchema: null
1188
+ responseSchema: null,
1189
+ idempotent: false
1042
1190
  },
1043
1191
  "WorkflowInterfacesController_add": {
1044
1192
  method: "POST",
@@ -1048,7 +1196,8 @@ var OPERATIONS = {
1048
1196
  pathParams: ["id"],
1049
1197
  queryParams: [],
1050
1198
  requestSchema: "AddAgentInterfaceDto",
1051
- responseSchema: "AgentInterfaceDto"
1199
+ responseSchema: "AgentInterfaceDto",
1200
+ idempotent: false
1052
1201
  },
1053
1202
  "WorkflowInterfacesController_delete": {
1054
1203
  method: "DELETE",
@@ -1058,7 +1207,8 @@ var OPERATIONS = {
1058
1207
  pathParams: ["id", "interfaceId"],
1059
1208
  queryParams: [],
1060
1209
  requestSchema: null,
1061
- responseSchema: null
1210
+ responseSchema: null,
1211
+ idempotent: false
1062
1212
  },
1063
1213
  "WorkflowInterfacesController_deleteAll": {
1064
1214
  method: "DELETE",
@@ -1068,7 +1218,8 @@ var OPERATIONS = {
1068
1218
  pathParams: ["id"],
1069
1219
  queryParams: [],
1070
1220
  requestSchema: null,
1071
- responseSchema: null
1221
+ responseSchema: null,
1222
+ idempotent: false
1072
1223
  },
1073
1224
  "WorkflowInterfacesController_list": {
1074
1225
  method: "GET",
@@ -1078,7 +1229,8 @@ var OPERATIONS = {
1078
1229
  pathParams: ["id"],
1079
1230
  queryParams: [],
1080
1231
  requestSchema: null,
1081
- responseSchema: "ListAgentInterfacesResponseDto"
1232
+ responseSchema: "ListAgentInterfacesResponseDto",
1233
+ idempotent: false
1082
1234
  },
1083
1235
  "WorkflowInterfacesController_update": {
1084
1236
  method: "PATCH",
@@ -1088,7 +1240,8 @@ var OPERATIONS = {
1088
1240
  pathParams: ["id", "interfaceId"],
1089
1241
  queryParams: ["updateMask"],
1090
1242
  requestSchema: "UpdateAgentInterfaceDto",
1091
- responseSchema: "AgentInterfaceDto"
1243
+ responseSchema: "AgentInterfaceDto",
1244
+ idempotent: false
1092
1245
  },
1093
1246
  "WorkflowRunsController_create": {
1094
1247
  method: "POST",
@@ -1098,7 +1251,8 @@ var OPERATIONS = {
1098
1251
  pathParams: ["id"],
1099
1252
  queryParams: [],
1100
1253
  requestSchema: "AgentRunDto",
1101
- responseSchema: null
1254
+ responseSchema: null,
1255
+ idempotent: false
1102
1256
  },
1103
1257
  "WorkflowRunsController_get": {
1104
1258
  method: "GET",
@@ -1108,7 +1262,8 @@ var OPERATIONS = {
1108
1262
  pathParams: ["id", "runId"],
1109
1263
  queryParams: ["temporalRunId"],
1110
1264
  requestSchema: null,
1111
- responseSchema: "GetAutomationRunResponseDto"
1265
+ responseSchema: "GetAutomationRunResponseDto",
1266
+ idempotent: false
1112
1267
  },
1113
1268
  "WorkflowRunsController_list": {
1114
1269
  method: "GET",
@@ -1118,7 +1273,8 @@ var OPERATIONS = {
1118
1273
  pathParams: ["id"],
1119
1274
  queryParams: ["status", "timeframe", "approvalScope", "search", "pageSize", "pageToken"],
1120
1275
  requestSchema: null,
1121
- responseSchema: "ListAutomationRunsResponseDto"
1276
+ responseSchema: "ListAutomationRunsResponseDto",
1277
+ idempotent: false
1122
1278
  },
1123
1279
  "WorkflowsController_acceptOwnershipTransfer": {
1124
1280
  method: "POST",
@@ -1128,7 +1284,8 @@ var OPERATIONS = {
1128
1284
  pathParams: ["id"],
1129
1285
  queryParams: [],
1130
1286
  requestSchema: null,
1131
- responseSchema: "WorkflowDto"
1287
+ responseSchema: "WorkflowDto",
1288
+ idempotent: false
1132
1289
  },
1133
1290
  "WorkflowsController_cancelOwnershipTransfer": {
1134
1291
  method: "DELETE",
@@ -1138,7 +1295,8 @@ var OPERATIONS = {
1138
1295
  pathParams: ["id"],
1139
1296
  queryParams: [],
1140
1297
  requestSchema: null,
1141
- responseSchema: "WorkflowDto"
1298
+ responseSchema: "WorkflowDto",
1299
+ idempotent: false
1142
1300
  },
1143
1301
  "WorkflowsController_create": {
1144
1302
  method: "POST",
@@ -1148,7 +1306,8 @@ var OPERATIONS = {
1148
1306
  pathParams: [],
1149
1307
  queryParams: [],
1150
1308
  requestSchema: "CreateAgentDto",
1151
- responseSchema: "WorkflowDto"
1309
+ responseSchema: "WorkflowDto",
1310
+ idempotent: false
1152
1311
  },
1153
1312
  "WorkflowsController_delete": {
1154
1313
  method: "DELETE",
@@ -1158,7 +1317,8 @@ var OPERATIONS = {
1158
1317
  pathParams: ["id"],
1159
1318
  queryParams: [],
1160
1319
  requestSchema: null,
1161
- responseSchema: null
1320
+ responseSchema: null,
1321
+ idempotent: false
1162
1322
  },
1163
1323
  "WorkflowsController_deploy": {
1164
1324
  method: "POST",
@@ -1168,7 +1328,8 @@ var OPERATIONS = {
1168
1328
  pathParams: ["id"],
1169
1329
  queryParams: [],
1170
1330
  requestSchema: "DeployAgentDto",
1171
- responseSchema: "AgentDeployResponseDto"
1331
+ responseSchema: "AgentDeployResponseDto",
1332
+ idempotent: false
1172
1333
  },
1173
1334
  "WorkflowsController_get": {
1174
1335
  method: "GET",
@@ -1178,7 +1339,8 @@ var OPERATIONS = {
1178
1339
  pathParams: ["id"],
1179
1340
  queryParams: ["view"],
1180
1341
  requestSchema: null,
1181
- responseSchema: "WorkflowDto"
1342
+ responseSchema: "WorkflowDto",
1343
+ idempotent: false
1182
1344
  },
1183
1345
  "WorkflowsController_list": {
1184
1346
  method: "GET",
@@ -1188,7 +1350,8 @@ var OPERATIONS = {
1188
1350
  pathParams: [],
1189
1351
  queryParams: ["pageToken", "pageSize", "view", "type", "search", "includeVariation"],
1190
1352
  requestSchema: null,
1191
- responseSchema: "ListAgentsResponseDto"
1353
+ responseSchema: "ListAgentsResponseDto",
1354
+ idempotent: false
1192
1355
  },
1193
1356
  "WorkflowsController_requestOwnershipTransfer": {
1194
1357
  method: "POST",
@@ -1198,7 +1361,8 @@ var OPERATIONS = {
1198
1361
  pathParams: ["id"],
1199
1362
  queryParams: [],
1200
1363
  requestSchema: "TransferOwnershipDto",
1201
- responseSchema: "WorkflowDto"
1364
+ responseSchema: "WorkflowDto",
1365
+ idempotent: false
1202
1366
  },
1203
1367
  "WorkflowsController_restore": {
1204
1368
  method: "POST",
@@ -1208,7 +1372,8 @@ var OPERATIONS = {
1208
1372
  pathParams: ["id"],
1209
1373
  queryParams: [],
1210
1374
  requestSchema: null,
1211
- responseSchema: "WorkflowDto"
1375
+ responseSchema: "WorkflowDto",
1376
+ idempotent: false
1212
1377
  },
1213
1378
  "WorkflowsController_toggle": {
1214
1379
  method: "POST",
@@ -1218,7 +1383,8 @@ var OPERATIONS = {
1218
1383
  pathParams: ["id"],
1219
1384
  queryParams: [],
1220
1385
  requestSchema: "ToggleAgentDto",
1221
- responseSchema: "WorkflowDto"
1386
+ responseSchema: "WorkflowDto",
1387
+ idempotent: true
1222
1388
  },
1223
1389
  "WorkflowsController_update": {
1224
1390
  method: "PATCH",
@@ -1228,7 +1394,8 @@ var OPERATIONS = {
1228
1394
  pathParams: ["id"],
1229
1395
  queryParams: ["updateMask"],
1230
1396
  requestSchema: "UpdateAgentDto",
1231
- responseSchema: "WorkflowDto"
1397
+ responseSchema: "WorkflowDto",
1398
+ idempotent: false
1232
1399
  }
1233
1400
  };
1234
1401
 
@@ -1240,17 +1407,26 @@ var ModusError = class extends Error {
1240
1407
  this.message = message;
1241
1408
  this.statusCode = options.statusCode;
1242
1409
  this.requestId = options.requestId;
1410
+ this.traceId = options.traceId;
1243
1411
  this.responseHeaders = options.responseHeaders;
1244
1412
  this.body = options.body;
1245
1413
  this.code = options.code;
1414
+ this.info = options.info;
1415
+ this.retryable = options.retryable ?? false;
1246
1416
  }
1247
1417
  };
1248
1418
  var APIConnectionError = class extends ModusError {
1249
- constructor(message) {
1250
- super(message);
1419
+ constructor(message, options = {}) {
1420
+ super(message, options);
1251
1421
  this.name = "APIConnectionError";
1252
1422
  }
1253
1423
  };
1424
+ var BadRequestError = class extends ModusError {
1425
+ constructor(message, options = {}) {
1426
+ super(message, { ...options, statusCode: 400 });
1427
+ this.name = "BadRequestError";
1428
+ }
1429
+ };
1254
1430
  var AuthenticationError = class extends ModusError {
1255
1431
  constructor(message, options = {}) {
1256
1432
  super(message, { ...options, statusCode: 401 });
@@ -1333,11 +1509,11 @@ var Page = class {
1333
1509
  * Fetch the next page using {@link Page.nextPageToken}.
1334
1510
  *
1335
1511
  * @returns The following page of results.
1336
- * @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.
1337
1513
  */
1338
1514
  async getNextPage() {
1339
1515
  if (this.nextPageToken === void 0) {
1340
- throw new Error(
1516
+ throw new ValidationError(
1341
1517
  "No next page available. Check hasNextPage() before calling getNextPage()."
1342
1518
  );
1343
1519
  }
@@ -1423,7 +1599,10 @@ function resolveBaseUrl(baseUrl) {
1423
1599
  return baseUrl ?? process.env[ENV_BASE_URL] ?? void 0;
1424
1600
  }
1425
1601
  function resolveAgentHost(agentHost) {
1426
- 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;
1427
1606
  }
1428
1607
  function isModusApiHostname(hostname) {
1429
1608
  return hostname === "api.getmodus.com" || /^api\.[a-z0-9-]+\.getmodus\.com$/i.test(hostname);
@@ -1467,7 +1646,6 @@ function authHeaders(apiKey) {
1467
1646
 
1468
1647
  // src/_config.ts
1469
1648
  var DEFAULT_BASE_URL = "https://api.getmodus.com";
1470
- var DEFAULT_AGENT_HOST = "https://agent.getmodus.com";
1471
1649
  var DEFAULT_TIMEOUT_MS = 3e5;
1472
1650
  var DEFAULT_MAX_RETRIES = 2;
1473
1651
  function normalizeBaseUrl(baseUrl) {
@@ -1488,9 +1666,8 @@ function createModusConfig(options = {}) {
1488
1666
  }
1489
1667
  const baseUrl = normalizeBaseUrl(resolveBaseUrl(options.baseUrl) ?? DEFAULT_BASE_URL);
1490
1668
  const baseUrlOverrides = normalizeBaseUrls(options.baseUrls);
1491
- const agentHost = normalizeBaseUrl(
1492
- baseUrlOverrides["agent-service"] ?? resolveAgentHost(options.agentHost) ?? deriveAgentHostFromBaseUrl(baseUrl) ?? DEFAULT_AGENT_HOST
1493
- );
1669
+ const explicitAgentHost = baseUrlOverrides["agent-service"] ?? resolveAgentHost(options.agentHost) ?? deriveAgentHostFromBaseUrl(baseUrl);
1670
+ const agentHost = explicitAgentHost === void 0 ? void 0 : normalizeBaseUrl(explicitAgentHost);
1494
1671
  const organizationId = resolveOrganizationId(options.organizationId);
1495
1672
  return Object.freeze({
1496
1673
  apiKey: resolveApiKey(options.apiKey),
@@ -1499,7 +1676,7 @@ function createModusConfig(options = {}) {
1499
1676
  ...organizationId !== void 0 ? { organizationId } : {},
1500
1677
  baseUrls: Object.freeze({
1501
1678
  "modus-api": baseUrl,
1502
- "agent-service": agentHost,
1679
+ ...agentHost !== void 0 ? { "agent-service": agentHost } : {},
1503
1680
  ...baseUrlOverrides
1504
1681
  }),
1505
1682
  timeoutMs: resolveTimeoutMs(options.timeoutMs) ?? DEFAULT_TIMEOUT_MS,
@@ -1509,18 +1686,84 @@ function createModusConfig(options = {}) {
1509
1686
  });
1510
1687
  }
1511
1688
  function resolveServiceBaseUrl(config, service, generatedBaseUrl) {
1512
- if (service === "agent-service") {
1513
- return config.baseUrls["agent-service"] ?? config.agentHost ?? generatedBaseUrl ?? config.baseUrl;
1514
- }
1689
+ if (service === "agent-service") return requireAgentHost(config);
1515
1690
  return config.baseUrls[service] ?? generatedBaseUrl ?? config.baseUrl;
1516
1691
  }
1517
1692
  function formatConfigForLog(config) {
1518
1693
  const masked = config.apiKey.length > 10 ? `${config.apiKey.slice(0, 10)}***` : "***";
1519
1694
  return `ModusConfig(apiKey=${JSON.stringify(masked)}, baseUrl=${JSON.stringify(config.baseUrl)}, timeoutMs=${config.timeoutMs}, maxRetries=${config.maxRetries})`;
1520
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
+ }
1521
1764
 
1522
1765
  // src/_http.ts
1523
- var USER_AGENT = `modus-typescript/${"0.9.0"} (node/${process.version}; ${process.platform})`;
1766
+ var USER_AGENT = `modus-typescript/${"0.10.0"} (node/${process.version}; ${process.platform})`;
1524
1767
  function buildUrl(baseUrl, path, params) {
1525
1768
  const url = new URL(path.startsWith("/") ? path : `/${path}`, baseUrl);
1526
1769
  if (params) {
@@ -1551,41 +1794,60 @@ function headersToRecord(headers) {
1551
1794
  });
1552
1795
  return out;
1553
1796
  }
1554
- function messageFromBody(raw, statusCode) {
1555
- if (!raw) return `HTTP ${statusCode}`;
1556
- try {
1557
- const body = JSON.parse(raw);
1558
- if (body && typeof body === "object") {
1559
- const record = body;
1560
- const envelope = record.error;
1561
- if (envelope && typeof envelope === "object") {
1562
- const msg2 = envelope.message;
1563
- if (typeof msg2 === "string" && msg2) return msg2;
1564
- }
1565
- const msg = record.message ?? record.error;
1566
- if (Array.isArray(msg)) return msg.map(String).join("; ");
1567
- if (typeof msg === "string" && msg) return msg;
1568
- }
1569
- } catch {
1570
- }
1571
- 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;
1572
1802
  }
1573
- function errorCodeFromBody(raw) {
1803
+ function parseErrorBody(raw, statusCode) {
1804
+ let parsed;
1574
1805
  try {
1575
- const body = JSON.parse(raw);
1576
- return typeof body.error?.code === "string" ? body.error.code : void 0;
1806
+ parsed = JSON.parse(raw);
1577
1807
  } catch {
1578
- return void 0;
1579
- }
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));
1580
1833
  }
1581
- function raiseForStatus(response, body) {
1834
+ function raiseForStatus(response, body, method = "GET", idempotent = false, traceId) {
1582
1835
  if (response.ok) return;
1583
- const message = messageFromBody(body, response.status);
1584
- const requestId = response.headers.get("x-request-id") ?? response.headers.get("X-Request-ID") ?? void 0;
1585
- const headers = headersToRecord(response.headers);
1586
- const code = errorCodeFromBody(body);
1587
- const base = { requestId, responseHeaders: headers, body, code };
1588
- 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);
1589
1851
  case 401:
1590
1852
  throw new AuthenticationError(message, base);
1591
1853
  case 403:
@@ -1594,35 +1856,46 @@ function raiseForStatus(response, body) {
1594
1856
  throw new NotFoundError(message, base);
1595
1857
  case 409:
1596
1858
  throw new ConflictError(message, base);
1597
- case 422: {
1598
- let errors;
1599
- try {
1600
- errors = JSON.parse(body);
1601
- } catch {
1602
- errors = void 0;
1603
- }
1604
- throw new UnprocessableError(message, { ...base, errors });
1605
- }
1606
- case 429: {
1607
- const retryHeader = response.headers.get("retry-after") ?? "";
1608
- 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:
1609
1862
  throw new RateLimitError(message, { ...base, retryAfter });
1610
- }
1611
1863
  default:
1612
- if (response.status >= 500) {
1613
- throw new InternalServerError(message, response.status, base);
1614
- }
1615
- 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 });
1616
1866
  }
1617
1867
  }
1618
- function wrapNetworkError(error, baseUrl) {
1619
- 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;
1620
1872
  return new APIConnectionError(
1621
- `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 }
1622
1875
  );
1623
1876
  }
1624
- async function readBody(response) {
1625
- 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) };
1626
1899
  }
1627
1900
  async function readBodyPreview(response, maxChars = 200) {
1628
1901
  if (!response.body) return "";
@@ -1662,24 +1935,26 @@ var HttpClient = class {
1662
1935
  async request(method, path, options = {}) {
1663
1936
  const baseUrl = options.baseUrl ?? this.config.baseUrl;
1664
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;
1665
1944
  try {
1666
- const response = await this.config.fetch(url, {
1945
+ response = await this.config.fetch(url, {
1667
1946
  method,
1668
- headers: mergeHeaders(this.defaultHeaders(), options.headers, authHeaders(this.config.apiKey)),
1947
+ headers,
1669
1948
  body: options.json !== void 0 ? JSON.stringify(options.json) : void 0,
1670
1949
  signal: AbortSignal.timeout(this.config.timeoutMs)
1671
1950
  });
1672
- const body = await readBody(response);
1673
- raiseForStatus(response, body);
1674
- if (response.status === 204 || !body) return null;
1675
- return JSON.parse(body);
1951
+ body = await response.text();
1676
1952
  } catch (error) {
1677
- if (error instanceof ModusError) throw error;
1678
- if (error instanceof DOMException && error.name === "AbortError") {
1679
- throw wrapNetworkError(new Error("Request timed out"), baseUrl);
1680
- }
1681
- throw wrapNetworkError(error, baseUrl);
1953
+ throw wrapNetworkError(error, baseUrl, method, idempotent, traceId);
1682
1954
  }
1955
+ raiseForStatus(response, body, method, idempotent, traceId);
1956
+ if (response.status === 204 || !body) return null;
1957
+ return parseJsonBody(response, body, traceId);
1683
1958
  }
1684
1959
  get(path, params, options = {}) {
1685
1960
  return this.request("GET", path, { params, ...options });
@@ -1699,23 +1974,27 @@ var HttpClient = class {
1699
1974
  async *stream(method, path, options = {}) {
1700
1975
  const baseUrl = options.baseUrl ?? this.config.baseUrl;
1701
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;
1702
1988
  try {
1703
1989
  const response = await this.config.fetch(url, {
1704
1990
  method,
1705
- // Agent-service negotiates SSE vs JSON polling on Accept; JSON-only
1706
- // Accept returns {"runId","status":"pending"} instead of token SSE.
1707
- headers: mergeHeaders(
1708
- this.defaultHeaders(),
1709
- options.headers,
1710
- { Accept: "text/event-stream" },
1711
- authHeaders(this.config.apiKey)
1712
- ),
1991
+ headers,
1713
1992
  body: options.json !== void 0 ? JSON.stringify(options.json) : void 0,
1714
- signal: AbortSignal.timeout(this.config.timeoutMs)
1993
+ signal: idle.signal
1715
1994
  });
1995
+ idle.touch();
1716
1996
  if (!response.ok) {
1717
- const body = await readBody(response);
1718
- raiseForStatus(response, body);
1997
+ raiseForStatus(response, await response.text(), method, idempotent, traceId);
1719
1998
  return;
1720
1999
  }
1721
2000
  const contentType = response.headers.get("content-type") ?? "";
@@ -1723,16 +2002,17 @@ var HttpClient = class {
1723
2002
  const preview = await readBodyPreview(response);
1724
2003
  throw new ModusError(
1725
2004
  `Unexpected stream response: expected Content-Type text/event-stream, got ${JSON.stringify(contentType) || "(missing)"}. Body preview: ${preview}`,
1726
- { statusCode: response.status, body: preview }
2005
+ { statusCode: response.status, body: preview, traceId }
1727
2006
  );
1728
2007
  }
1729
2008
  if (!response.body) return;
1730
- const reader = response.body.getReader();
2009
+ reader = response.body.getReader();
1731
2010
  const decoder = new TextDecoder();
1732
2011
  let buffer = "";
1733
2012
  while (true) {
1734
2013
  const { done, value } = await reader.read();
1735
2014
  if (done) break;
2015
+ idle.touch();
1736
2016
  buffer += decoder.decode(value, { stream: true });
1737
2017
  const lines = buffer.split("\n");
1738
2018
  buffer = lines.pop() ?? "";
@@ -1743,10 +2023,10 @@ var HttpClient = class {
1743
2023
  if (buffer.trim()) yield buffer;
1744
2024
  } catch (error) {
1745
2025
  if (error instanceof ModusError) throw error;
1746
- if (error instanceof DOMException && error.name === "AbortError") {
1747
- throw wrapNetworkError(new Error("Request timed out"), baseUrl);
1748
- }
1749
- throw wrapNetworkError(error, baseUrl);
2026
+ throw wrapNetworkError(error, baseUrl, method, idempotent, traceId);
2027
+ } finally {
2028
+ idle.clear();
2029
+ await reader?.cancel().catch(() => void 0);
1750
2030
  }
1751
2031
  }
1752
2032
  streamGet(path, params, options = {}) {
@@ -1756,6 +2036,26 @@ var HttpClient = class {
1756
2036
  return this.stream("POST", path, { json, ...options });
1757
2037
  }
1758
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
+ };
1759
2059
 
1760
2060
  // src/_client-base.ts
1761
2061
  var ModusClientBase = class {
@@ -1786,6 +2086,7 @@ var WRITE_BODY_ALLOWED_KEYS = {
1786
2086
  ContextFilesController_uploadFromUrls: ["urls"],
1787
2087
  ContextFilesController_uploadUrl: ["fileName", "contentType", "fileSize"],
1788
2088
  ContextFilesController_uploadUrls: ["files"],
2089
+ ContextItemAccessController_updateAccess: ["visibility", "groupPermissions", "sharedWith"],
1789
2090
  ContextItemsController_lookup: ["contextType", "dataPath", "contentProjection"],
1790
2091
  ContextItemsController_move: ["destinationFolderUid"],
1791
2092
  ContextItemsController_update: ["contextType", "content", "description", "userFeedback", "topics"],
@@ -1803,15 +2104,15 @@ var WRITE_BODY_ALLOWED_KEYS = {
1803
2104
  DashboardsController_updateLayout: ["expectedRevision", "elements"],
1804
2105
  EvaluationsController_updateConfig: ["enabled", "cadence", "judgeModel", "judgeGuidance", "notifications"],
1805
2106
  IngestedDataController_upload: ["integration_type", "request", "response"],
1806
- ModusChatController_chat: ["message", "model"],
2107
+ ModusContextComposeController_compose: ["message", "limit"],
1807
2108
  ModusContextController_compose: ["message", "limit"],
1808
2109
  ModusRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId", "subordinateSkillIds"],
1809
2110
  ResumeRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId", "decision"],
1810
2111
  RunLifecycleController_activeBySession: ["sessionIds"],
1811
2112
  RunLifecycleController_cancel: [],
1812
- RunLifecycleController_editQueued: [],
1813
- RunLifecycleController_interrupt: [],
1814
- ScopeChatController_chat: ["message", "model"],
2113
+ RunLifecycleController_editQueued: ["nextRun"],
2114
+ RunLifecycleController_interrupt: ["nextRun", "lastSeenEventId"],
2115
+ ScopeContextComposeController_compose: ["message", "limit"],
1815
2116
  ScopeContextController_compose: ["message", "limit"],
1816
2117
  ScopeInterfacesController_add: ["type", "name", "config"],
1817
2118
  ScopeInterfacesController_update: ["name", "config"],
@@ -1819,12 +2120,16 @@ var WRITE_BODY_ALLOWED_KEYS = {
1819
2120
  ScopeMemoriesController_update: ["memory", "metadata"],
1820
2121
  ScopeRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId", "subordinateSkillIds"],
1821
2122
  ScopesController_acceptOwnershipTransfer: [],
2123
+ ScopesController_addEvaluationCase: ["id", "task", "expectedOutput"],
2124
+ ScopesController_applySelectionOps: ["ops", "toolset", "validateOnly"],
1822
2125
  ScopesController_create: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "includeOwnLearnings", "interfaces", "accessConfig"],
1823
2126
  ScopesController_deploy: [],
2127
+ ScopesController_mcpExposureCatalog: ["toolset", "connectionSet", "mcpToolExposure"],
1824
2128
  ScopesController_patchMcpConfig: ["config"],
1825
2129
  ScopesController_requestOwnershipTransfer: ["newOwnerUserId"],
1826
2130
  ScopesController_restore: [],
1827
2131
  ScopesController_update: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "interfaces", "accessConfig", "managerId", "evaluations", "supervisionSubordinateDescriptions"],
2132
+ ScopesController_updateEvaluationCase: ["task", "expectedOutput"],
1828
2133
  ScopeSupervisionController_set: ["subordinateAgentIds"],
1829
2134
  ScopeSupervisionController_setActive: ["subordinateAgentIds"],
1830
2135
  SuggestionsController_recordEvent: ["eventType", "source", "skillId", "threadId", "metadata"],
@@ -1846,23 +2151,29 @@ var WRITE_BODY_ALLOWED_KEYS = {
1846
2151
  var DEFAULT_MAX_PAGE_SIZE = 200;
1847
2152
  function validatePageSize(pageSize, maxPageSize) {
1848
2153
  if (!Number.isInteger(pageSize) || pageSize < 1) {
1849
- 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}`);
1850
2155
  }
1851
2156
  if (maxPageSize !== void 0 && pageSize > maxPageSize) {
1852
- throw new Error(`page_size must be <= ${maxPageSize}, got ${pageSize}`);
2157
+ throw new ValidationError(`page_size must be <= ${maxPageSize}, got ${pageSize}`);
1853
2158
  }
1854
2159
  }
1855
2160
  function validateId(resourceId, name = "id") {
1856
- if (typeof resourceId === "string" && !resourceId.trim()) {
1857
- 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)}`);
1858
2168
  }
1859
2169
  }
1860
- var ALLOWED_CHAT_MODELS = /* @__PURE__ */ new Set([
2170
+ var CHAT_MODELS = [
1861
2171
  "claude-sonnet-5",
1862
2172
  "claude-sonnet-5.5",
1863
2173
  "claude-sonnet-4.6",
1864
2174
  "claude-opus-4.8",
1865
2175
  "claude-opus-5.5",
2176
+ "claude-haiku-5.5",
1866
2177
  "gpt-5.2",
1867
2178
  "gpt-5.5",
1868
2179
  "gpt-5-mini",
@@ -1876,21 +2187,24 @@ var ALLOWED_CHAT_MODELS = /* @__PURE__ */ new Set([
1876
2187
  "deepseek-chat-v3.1",
1877
2188
  "deepseek-v4-pro",
1878
2189
  "deepseek-v4-flash-latest",
2190
+ "deepseek-v4.1-flash-1017",
1879
2191
  "minimax-m2.7",
1880
2192
  "llama-4-maverick",
1881
2193
  "llama-4-scout",
1882
2194
  "llama-3.3-70b-instruct",
1883
2195
  "gemini-3.1-pro-preview",
1884
2196
  "gemini-3-flash-preview",
2197
+ "gemini-3.8-flash",
1885
2198
  "grok-4.3-fast",
1886
2199
  "grok-4.3",
1887
2200
  "grok-4.7",
1888
2201
  "kimi-k3"
1889
- ]);
2202
+ ];
2203
+ var ALLOWED_CHAT_MODELS = new Set(CHAT_MODELS);
1890
2204
  function validateChatModel(model) {
1891
2205
  if (!ALLOWED_CHAT_MODELS.has(model)) {
1892
2206
  const supported = [...ALLOWED_CHAT_MODELS].sort().join(", ");
1893
- 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}.`);
1894
2208
  }
1895
2209
  }
1896
2210
  function assertWriteBodyKeys(operationId, body) {
@@ -1923,9 +2237,11 @@ function formatPath(template, pathParams) {
1923
2237
  if (!segment.startsWith("{") || !segment.endsWith("}")) return segment;
1924
2238
  const key = segment.slice(1, -1);
1925
2239
  if (!(key in pathParams)) {
1926
- 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)}`);
1927
2241
  }
1928
- return encodeURIComponent(String(pathParams[key]));
2242
+ const value = String(pathParams[key]);
2243
+ validateId(value, key);
2244
+ return encodeURIComponent(value);
1929
2245
  }).join("/");
1930
2246
  }
1931
2247
  function operationBaseUrl(http, operation) {
@@ -1946,7 +2262,7 @@ async function invokeOperation(http, operationId, options = {}) {
1946
2262
  case "GET":
1947
2263
  return http.get(path, params, requestOptions);
1948
2264
  case "POST":
1949
- return http.post(path, options.jsonBody, requestOptions);
2265
+ return http.post(path, options.jsonBody, { ...requestOptions, idempotent: op.idempotent });
1950
2266
  case "PUT":
1951
2267
  return http.put(path, options.jsonBody, requestOptions);
1952
2268
  case "PATCH":
@@ -1958,50 +2274,25 @@ async function invokeOperation(http, operationId, options = {}) {
1958
2274
  }
1959
2275
  }
1960
2276
 
1961
- // src/_retry.ts
1962
- var DEPLOY_NOT_FOUND_BACKOFF_MS = 500;
1963
- var MAX_DEPLOY_NOT_FOUND_RETRIES = 1;
1964
- var RETRYABLE = [RateLimitError, InternalServerError, APIConnectionError];
1965
- function isRetryable(error) {
1966
- return RETRYABLE.some((Cls) => error instanceof Cls);
1967
- }
1968
- function backoffSeconds(attempt, error) {
1969
- if (error instanceof RateLimitError && error.retryAfter !== void 0) {
1970
- return Math.max(0, error.retryAfter);
1971
- }
1972
- if (attempt === 0) return 0;
1973
- return Math.max(0.5, 2 ** (attempt - 1) + (Math.random() * 0.6 - 0.3));
1974
- }
1975
- function sleep(ms) {
1976
- return new Promise((resolve) => setTimeout(resolve, ms));
1977
- }
1978
- async function withRetry(fn, maxRetries, options = {}) {
1979
- let deployNotFoundRetries = 0;
1980
- let attempt = 0;
1981
- while (true) {
1982
- try {
1983
- return await fn();
1984
- } catch (error) {
1985
- if (options.retryNotFoundOnDeploy && error instanceof NotFoundError && deployNotFoundRetries < MAX_DEPLOY_NOT_FOUND_RETRIES) {
1986
- deployNotFoundRetries++;
1987
- await sleep(DEPLOY_NOT_FOUND_BACKOFF_MS);
1988
- continue;
1989
- }
1990
- if (!isRetryable(error) || attempt >= maxRetries) throw error;
1991
- await sleep(backoffSeconds(attempt, error) * 1e3);
1992
- attempt++;
1993
- }
1994
- }
1995
- }
1996
-
1997
2277
  // src/_request.ts
1998
2278
  async function invokeWithRetry(config, http, operationId, options = {}) {
1999
2279
  if (options.jsonBody !== void 0) {
2000
2280
  assertWriteBodyKeys(operationId, options.jsonBody);
2001
2281
  }
2002
- return withRetry(() => invokeOperation(http, operationId, options), config.maxRetries, {
2003
- retryNotFoundOnDeploy: operationId.endsWith("_deploy")
2004
- });
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
+ );
2005
2296
  }
2006
2297
  function omitUndefined(obj) {
2007
2298
  return Object.fromEntries(
@@ -2311,9 +2602,13 @@ var ScopeConversationsResource = class extends ScopesConversationsResourceBase {
2311
2602
  *
2312
2603
  * @example
2313
2604
  * ```ts
2314
- * const thread = await client.scopes.conversations(scopeId).get(row.threadId)
2315
- * for (const msg of thread.messages) {
2316
- * 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
+ * }
2317
2612
  * }
2318
2613
  * ```
2319
2614
  */
@@ -2321,7 +2616,7 @@ var ScopeConversationsResource = class extends ScopesConversationsResourceBase {
2321
2616
  validateId(this.scopeId, "scope_id");
2322
2617
  validateId(threadId, "thread_id");
2323
2618
  if (options.beforeMessageIndex !== void 0 && options.messageLimit === void 0) {
2324
- throw new Error("beforeMessageIndex requires messageLimit");
2619
+ throw new ValidationError("beforeMessageIndex requires messageLimit");
2325
2620
  }
2326
2621
  const data = await invokeWithRetry(this.config, this.http, "ScopeConversationsController_get", {
2327
2622
  pathParams: { id: this.scopeId, threadId },
@@ -2338,6 +2633,7 @@ export {
2338
2633
  OPERATIONS,
2339
2634
  ModusError,
2340
2635
  APIConnectionError,
2636
+ BadRequestError,
2341
2637
  AuthenticationError,
2342
2638
  PermissionDeniedError,
2343
2639
  NotFoundError,
@@ -2348,6 +2644,7 @@ export {
2348
2644
  RunCancelledError,
2349
2645
  StreamTimeoutError,
2350
2646
  ValidationError,
2647
+ requireAgentHost,
2351
2648
  DEFAULT_MAX_PAGE_SIZE,
2352
2649
  validatePageSize,
2353
2650
  validateId,
@@ -2366,4 +2663,4 @@ export {
2366
2663
  CustomContextItemsResource,
2367
2664
  ScopeConversationsResource
2368
2665
  };
2369
- //# sourceMappingURL=chunk-SP4UYRYG.js.map
2666
+ //# sourceMappingURL=chunk-BMYCORZF.js.map