@getmodus/sdk 0.2.1 → 0.2.2

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.
package/dist/index.cjs CHANGED
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
23
  APIConnectionError: () => APIConnectionError,
24
+ AgentType: () => AgentType,
24
25
  AuthenticationError: () => AuthenticationError,
25
26
  ChatStream: () => ChatStream,
26
27
  ConflictError: () => ConflictError,
@@ -46,7 +47,7 @@ var OPERATIONS = {
46
47
  method: "GET",
47
48
  path: "/api/v1/connections",
48
49
  service: "modus-api",
49
- serverUrl: "https://api.modus.com",
50
+ serverUrl: "https://api.getmodus.com",
50
51
  pathParams: [],
51
52
  queryParams: ["pageToken", "pageSize", "type"],
52
53
  requestSchema: null,
@@ -56,7 +57,7 @@ var OPERATIONS = {
56
57
  method: "POST",
57
58
  path: "/api/v1/context/links",
58
59
  service: "modus-api",
59
- serverUrl: "https://api.modus.com",
60
+ serverUrl: "https://api.getmodus.com",
60
61
  pathParams: [],
61
62
  queryParams: [],
62
63
  requestSchema: "CreateLinkDto",
@@ -66,7 +67,7 @@ var OPERATIONS = {
66
67
  method: "POST",
67
68
  path: "/api/v1/context/notes",
68
69
  service: "modus-api",
69
- serverUrl: "https://api.modus.com",
70
+ serverUrl: "https://api.getmodus.com",
70
71
  pathParams: [],
71
72
  queryParams: [],
72
73
  requestSchema: "CreateNoteDto",
@@ -76,7 +77,7 @@ var OPERATIONS = {
76
77
  method: "POST",
77
78
  path: "/api/v1/context/saved-queries",
78
79
  service: "modus-api",
79
- serverUrl: "https://api.modus.com",
80
+ serverUrl: "https://api.getmodus.com",
80
81
  pathParams: [],
81
82
  queryParams: [],
82
83
  requestSchema: "CreateSavedQueryDto",
@@ -86,7 +87,7 @@ var OPERATIONS = {
86
87
  method: "DELETE",
87
88
  path: "/api/v1/context/items/{uid}",
88
89
  service: "modus-api",
89
- serverUrl: "https://api.modus.com",
90
+ serverUrl: "https://api.getmodus.com",
90
91
  pathParams: ["uid"],
91
92
  queryParams: [],
92
93
  requestSchema: null,
@@ -96,7 +97,7 @@ var OPERATIONS = {
96
97
  method: "GET",
97
98
  path: "/api/v1/context/items/{uid}",
98
99
  service: "modus-api",
99
- serverUrl: "https://api.modus.com",
100
+ serverUrl: "https://api.getmodus.com",
100
101
  pathParams: ["uid"],
101
102
  queryParams: [],
102
103
  requestSchema: null,
@@ -106,7 +107,7 @@ var OPERATIONS = {
106
107
  method: "GET",
107
108
  path: "/api/v1/context/items",
108
109
  service: "modus-api",
109
- serverUrl: "https://api.modus.com",
110
+ serverUrl: "https://api.getmodus.com",
110
111
  pathParams: [],
111
112
  queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics"],
112
113
  requestSchema: null,
@@ -116,7 +117,7 @@ var OPERATIONS = {
116
117
  method: "GET",
117
118
  path: "/api/v1/context/items/{uid}/values",
118
119
  service: "modus-api",
119
- serverUrl: "https://api.modus.com",
120
+ serverUrl: "https://api.getmodus.com",
120
121
  pathParams: ["uid"],
121
122
  queryParams: ["contextType", "contentKeyPath", "pageSize", "offset", "pageToken", "searchQuery", "dataPathPrefix"],
122
123
  requestSchema: null,
@@ -126,7 +127,7 @@ var OPERATIONS = {
126
127
  method: "POST",
127
128
  path: "/api/v1/context/items/lookup",
128
129
  service: "modus-api",
129
- serverUrl: "https://api.modus.com",
130
+ serverUrl: "https://api.getmodus.com",
130
131
  pathParams: [],
131
132
  queryParams: [],
132
133
  requestSchema: "LookupContextItemDto",
@@ -136,7 +137,7 @@ var OPERATIONS = {
136
137
  method: "PATCH",
137
138
  path: "/api/v1/context/items/{uid}",
138
139
  service: "modus-api",
139
- serverUrl: "https://api.modus.com",
140
+ serverUrl: "https://api.getmodus.com",
140
141
  pathParams: ["uid"],
141
142
  queryParams: ["updateMask"],
142
143
  requestSchema: "UpdateContextItemDto",
@@ -146,7 +147,7 @@ var OPERATIONS = {
146
147
  method: "POST",
147
148
  path: "/api/v1/context/custom-items/batch",
148
149
  service: "modus-api",
149
- serverUrl: "https://api.modus.com",
150
+ serverUrl: "https://api.getmodus.com",
150
151
  pathParams: [],
151
152
  queryParams: [],
152
153
  requestSchema: "BatchCreateCustomContextItemsDto",
@@ -156,7 +157,7 @@ var OPERATIONS = {
156
157
  method: "POST",
157
158
  path: "/api/v1/context/custom-items",
158
159
  service: "modus-api",
159
- serverUrl: "https://api.modus.com",
160
+ serverUrl: "https://api.getmodus.com",
160
161
  pathParams: [],
161
162
  queryParams: [],
162
163
  requestSchema: "CreateCustomContextItemDto",
@@ -166,7 +167,7 @@ var OPERATIONS = {
166
167
  method: "DELETE",
167
168
  path: "/api/v1/context/custom-items/{uid}",
168
169
  service: "modus-api",
169
- serverUrl: "https://api.modus.com",
170
+ serverUrl: "https://api.getmodus.com",
170
171
  pathParams: ["uid"],
171
172
  queryParams: [],
172
173
  requestSchema: null,
@@ -176,7 +177,7 @@ var OPERATIONS = {
176
177
  method: "GET",
177
178
  path: "/api/v1/context/custom-items/{uid}",
178
179
  service: "modus-api",
179
- serverUrl: "https://api.modus.com",
180
+ serverUrl: "https://api.getmodus.com",
180
181
  pathParams: ["uid"],
181
182
  queryParams: [],
182
183
  requestSchema: null,
@@ -186,7 +187,7 @@ var OPERATIONS = {
186
187
  method: "GET",
187
188
  path: "/api/v1/context/custom-items",
188
189
  service: "modus-api",
189
- serverUrl: "https://api.modus.com",
190
+ serverUrl: "https://api.getmodus.com",
190
191
  pathParams: [],
191
192
  queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics"],
192
193
  requestSchema: null,
@@ -196,7 +197,7 @@ var OPERATIONS = {
196
197
  method: "PATCH",
197
198
  path: "/api/v1/context/custom-items/{uid}",
198
199
  service: "modus-api",
199
- serverUrl: "https://api.modus.com",
200
+ serverUrl: "https://api.getmodus.com",
200
201
  pathParams: ["uid"],
201
202
  queryParams: [],
202
203
  requestSchema: "UpdateCustomContextItemDto",
@@ -206,7 +207,7 @@ var OPERATIONS = {
206
207
  method: "GET",
207
208
  path: "/api/v1/scopes/{id}/evaluations/config",
208
209
  service: "modus-api",
209
- serverUrl: "https://api.modus.com",
210
+ serverUrl: "https://api.getmodus.com",
210
211
  pathParams: ["id"],
211
212
  queryParams: [],
212
213
  requestSchema: null,
@@ -216,7 +217,7 @@ var OPERATIONS = {
216
217
  method: "GET",
217
218
  path: "/api/v1/scopes/{id}/evaluations/runs/{runId}",
218
219
  service: "modus-api",
219
- serverUrl: "https://api.modus.com",
220
+ serverUrl: "https://api.getmodus.com",
220
221
  pathParams: ["id", "runId"],
221
222
  queryParams: [],
222
223
  requestSchema: null,
@@ -226,7 +227,7 @@ var OPERATIONS = {
226
227
  method: "GET",
227
228
  path: "/api/v1/scopes/{id}/evaluations/runs",
228
229
  service: "modus-api",
229
- serverUrl: "https://api.modus.com",
230
+ serverUrl: "https://api.getmodus.com",
230
231
  pathParams: ["id"],
231
232
  queryParams: ["pageSize", "pageToken"],
232
233
  requestSchema: null,
@@ -236,7 +237,7 @@ var OPERATIONS = {
236
237
  method: "POST",
237
238
  path: "/api/v1/scopes/{id}/evaluations/runs",
238
239
  service: "modus-api",
239
- serverUrl: "https://api.modus.com",
240
+ serverUrl: "https://api.getmodus.com",
240
241
  pathParams: ["id"],
241
242
  queryParams: [],
242
243
  requestSchema: null,
@@ -246,7 +247,7 @@ var OPERATIONS = {
246
247
  method: "PUT",
247
248
  path: "/api/v1/scopes/{id}/evaluations/config",
248
249
  service: "modus-api",
249
- serverUrl: "https://api.modus.com",
250
+ serverUrl: "https://api.getmodus.com",
250
251
  pathParams: ["id"],
251
252
  queryParams: [],
252
253
  requestSchema: "UpdateEvaluationConfigDto",
@@ -256,7 +257,7 @@ var OPERATIONS = {
256
257
  method: "GET",
257
258
  path: "/api/v1/users/member-groups",
258
259
  service: "modus-api",
259
- serverUrl: "https://api.modus.com",
260
+ serverUrl: "https://api.getmodus.com",
260
261
  pathParams: [],
261
262
  queryParams: ["pageSize", "pageToken"],
262
263
  requestSchema: null,
@@ -266,7 +267,7 @@ var OPERATIONS = {
266
267
  method: "POST",
267
268
  path: "/api/v1/modus/chat",
268
269
  service: "modus-api",
269
- serverUrl: "https://api.modus.com",
270
+ serverUrl: "https://api.getmodus.com",
270
271
  pathParams: [],
271
272
  queryParams: [],
272
273
  requestSchema: "ModusChatRequestDto",
@@ -276,7 +277,7 @@ var OPERATIONS = {
276
277
  method: "POST",
277
278
  path: "/api/v1/modus/conversations/{threadId}/chat",
278
279
  service: "modus-api",
279
- serverUrl: "https://api.modus.com",
280
+ serverUrl: "https://api.getmodus.com",
280
281
  pathParams: ["threadId"],
281
282
  queryParams: [],
282
283
  requestSchema: "ModusChatRequestDto",
@@ -286,7 +287,7 @@ var OPERATIONS = {
286
287
  method: "POST",
287
288
  path: "/api/v1/modus/context",
288
289
  service: "modus-api",
289
- serverUrl: "https://api.modus.com",
290
+ serverUrl: "https://api.getmodus.com",
290
291
  pathParams: [],
291
292
  queryParams: [],
292
293
  requestSchema: "ModusContextRequestDto",
@@ -296,7 +297,7 @@ var OPERATIONS = {
296
297
  method: "GET",
297
298
  path: "/api/v1/modus/conversations/{threadId}",
298
299
  service: "modus-api",
299
- serverUrl: "https://api.modus.com",
300
+ serverUrl: "https://api.getmodus.com",
300
301
  pathParams: ["threadId"],
301
302
  queryParams: [],
302
303
  requestSchema: null,
@@ -306,7 +307,7 @@ var OPERATIONS = {
306
307
  method: "GET",
307
308
  path: "/api/v1/modus/conversations",
308
309
  service: "modus-api",
309
- serverUrl: "https://api.modus.com",
310
+ serverUrl: "https://api.getmodus.com",
310
311
  pathParams: [],
311
312
  queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "timeframe", "includeTools", "kind"],
312
313
  requestSchema: null,
@@ -316,7 +317,7 @@ var OPERATIONS = {
316
317
  method: "POST",
317
318
  path: "/agent/v1/modus/runs",
318
319
  service: "agent-service",
319
- serverUrl: "https://agent.modus.com",
320
+ serverUrl: "https://agent.getmodus.com",
320
321
  pathParams: [],
321
322
  queryParams: [],
322
323
  requestSchema: "ModusRunDto",
@@ -326,7 +327,7 @@ var OPERATIONS = {
326
327
  method: "GET",
327
328
  path: "/api/v1/users/org-members",
328
329
  service: "modus-api",
329
- serverUrl: "https://api.modus.com",
330
+ serverUrl: "https://api.getmodus.com",
330
331
  pathParams: [],
331
332
  queryParams: ["pageSize", "pageToken"],
332
333
  requestSchema: null,
@@ -336,7 +337,7 @@ var OPERATIONS = {
336
337
  method: "DELETE",
337
338
  path: "/api/v1/users/organization",
338
339
  service: "modus-api",
339
- serverUrl: "https://api.modus.com",
340
+ serverUrl: "https://api.getmodus.com",
340
341
  pathParams: [],
341
342
  queryParams: [],
342
343
  requestSchema: null,
@@ -346,7 +347,7 @@ var OPERATIONS = {
346
347
  method: "POST",
347
348
  path: "/agent/v1/runs/{runId}/resume",
348
349
  service: "agent-service",
349
- serverUrl: "https://agent.modus.com",
350
+ serverUrl: "https://agent.getmodus.com",
350
351
  pathParams: ["runId"],
351
352
  queryParams: [],
352
353
  requestSchema: "ResumeRunDto",
@@ -356,7 +357,7 @@ var OPERATIONS = {
356
357
  method: "GET",
357
358
  path: "/agent/v1/runs/active",
358
359
  service: "agent-service",
359
- serverUrl: "https://agent.modus.com",
360
+ serverUrl: "https://agent.getmodus.com",
360
361
  pathParams: [],
361
362
  queryParams: ["pageToken", "pageSize"],
362
363
  requestSchema: null,
@@ -366,7 +367,7 @@ var OPERATIONS = {
366
367
  method: "POST",
367
368
  path: "/agent/v1/runs/active-by-session",
368
369
  service: "agent-service",
369
- serverUrl: "https://agent.modus.com",
370
+ serverUrl: "https://agent.getmodus.com",
370
371
  pathParams: [],
371
372
  queryParams: [],
372
373
  requestSchema: "ActiveRunsBySessionDto",
@@ -376,7 +377,7 @@ var OPERATIONS = {
376
377
  method: "POST",
377
378
  path: "/agent/v1/runs/{runId}/cancel",
378
379
  service: "agent-service",
379
- serverUrl: "https://agent.modus.com",
380
+ serverUrl: "https://agent.getmodus.com",
380
381
  pathParams: ["runId"],
381
382
  queryParams: [],
382
383
  requestSchema: "CancelRunDto",
@@ -386,7 +387,7 @@ var OPERATIONS = {
386
387
  method: "POST",
387
388
  path: "/agent/v1/runs/{runId}/queue-edit",
388
389
  service: "agent-service",
389
- serverUrl: "https://agent.modus.com",
390
+ serverUrl: "https://agent.getmodus.com",
390
391
  pathParams: ["runId"],
391
392
  queryParams: [],
392
393
  requestSchema: "EditQueuedRunDto",
@@ -396,7 +397,7 @@ var OPERATIONS = {
396
397
  method: "GET",
397
398
  path: "/agent/v1/runs/{runId}/events",
398
399
  service: "agent-service",
399
- serverUrl: "https://agent.modus.com",
400
+ serverUrl: "https://agent.getmodus.com",
400
401
  pathParams: ["runId"],
401
402
  queryParams: [],
402
403
  requestSchema: null,
@@ -406,7 +407,7 @@ var OPERATIONS = {
406
407
  method: "POST",
407
408
  path: "/agent/v1/runs/{runId}/interrupt",
408
409
  service: "agent-service",
409
- serverUrl: "https://agent.modus.com",
410
+ serverUrl: "https://agent.getmodus.com",
410
411
  pathParams: ["runId"],
411
412
  queryParams: [],
412
413
  requestSchema: "InterruptRunDto",
@@ -416,7 +417,7 @@ var OPERATIONS = {
416
417
  method: "GET",
417
418
  path: "/agent/v1/runs/{runId}/stream",
418
419
  service: "agent-service",
419
- serverUrl: "https://agent.modus.com",
420
+ serverUrl: "https://agent.getmodus.com",
420
421
  pathParams: ["runId"],
421
422
  queryParams: [],
422
423
  requestSchema: null,
@@ -426,7 +427,7 @@ var OPERATIONS = {
426
427
  method: "POST",
427
428
  path: "/api/v1/scopes/{id}/chat",
428
429
  service: "modus-api",
429
- serverUrl: "https://api.modus.com",
430
+ serverUrl: "https://api.getmodus.com",
430
431
  pathParams: ["id"],
431
432
  queryParams: [],
432
433
  requestSchema: "SkillChatRequestDto",
@@ -436,7 +437,7 @@ var OPERATIONS = {
436
437
  method: "POST",
437
438
  path: "/api/v1/scopes/{id}/conversations/{threadId}/chat",
438
439
  service: "modus-api",
439
- serverUrl: "https://api.modus.com",
440
+ serverUrl: "https://api.getmodus.com",
440
441
  pathParams: ["id", "threadId"],
441
442
  queryParams: [],
442
443
  requestSchema: "SkillChatRequestDto",
@@ -446,7 +447,7 @@ var OPERATIONS = {
446
447
  method: "POST",
447
448
  path: "/api/v1/scopes/{id}/context",
448
449
  service: "modus-api",
449
- serverUrl: "https://api.modus.com",
450
+ serverUrl: "https://api.getmodus.com",
450
451
  pathParams: ["id"],
451
452
  queryParams: [],
452
453
  requestSchema: "ComposeSkillContextRequestDto",
@@ -456,7 +457,7 @@ var OPERATIONS = {
456
457
  method: "GET",
457
458
  path: "/api/v1/scopes/{id}/conversations/{threadId}",
458
459
  service: "modus-api",
459
- serverUrl: "https://api.modus.com",
460
+ serverUrl: "https://api.getmodus.com",
460
461
  pathParams: ["id", "threadId"],
461
462
  queryParams: ["messageLimit", "beforeMessageIndex"],
462
463
  requestSchema: null,
@@ -466,7 +467,7 @@ var OPERATIONS = {
466
467
  method: "GET",
467
468
  path: "/api/v1/scopes/{id}/conversations",
468
469
  service: "modus-api",
469
- serverUrl: "https://api.modus.com",
470
+ serverUrl: "https://api.getmodus.com",
470
471
  pathParams: ["id"],
471
472
  queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "timeframe", "includeTools"],
472
473
  requestSchema: null,
@@ -476,7 +477,7 @@ var OPERATIONS = {
476
477
  method: "DELETE",
477
478
  path: "/api/v1/scopes/{id}/memories/{memoryId}",
478
479
  service: "modus-api",
479
- serverUrl: "https://api.modus.com",
480
+ serverUrl: "https://api.getmodus.com",
480
481
  pathParams: ["id", "memoryId"],
481
482
  queryParams: [],
482
483
  requestSchema: null,
@@ -486,7 +487,7 @@ var OPERATIONS = {
486
487
  method: "GET",
487
488
  path: "/api/v1/scopes/{id}/memories",
488
489
  service: "modus-api",
489
- serverUrl: "https://api.modus.com",
490
+ serverUrl: "https://api.getmodus.com",
490
491
  pathParams: ["id"],
491
492
  queryParams: ["pageToken", "pageSize", "userId", "limit"],
492
493
  requestSchema: null,
@@ -496,7 +497,7 @@ var OPERATIONS = {
496
497
  method: "POST",
497
498
  path: "/api/v1/scopes/{id}/memories/search",
498
499
  service: "modus-api",
499
- serverUrl: "https://api.modus.com",
500
+ serverUrl: "https://api.getmodus.com",
500
501
  pathParams: ["id"],
501
502
  queryParams: [],
502
503
  requestSchema: "SearchMemoriesRequestDto",
@@ -506,7 +507,7 @@ var OPERATIONS = {
506
507
  method: "PATCH",
507
508
  path: "/api/v1/scopes/{id}/memories/{memoryId}",
508
509
  service: "modus-api",
509
- serverUrl: "https://api.modus.com",
510
+ serverUrl: "https://api.getmodus.com",
510
511
  pathParams: ["id", "memoryId"],
511
512
  queryParams: ["updateMask"],
512
513
  requestSchema: "UpdateMemoryRequestDto",
@@ -516,7 +517,7 @@ var OPERATIONS = {
516
517
  method: "POST",
517
518
  path: "/agent/v1/scopes/{id}/runs",
518
519
  service: "agent-service",
519
- serverUrl: "https://agent.modus.com",
520
+ serverUrl: "https://agent.getmodus.com",
520
521
  pathParams: ["id"],
521
522
  queryParams: [],
522
523
  requestSchema: "SkillRunDto",
@@ -526,7 +527,7 @@ var OPERATIONS = {
526
527
  method: "GET",
527
528
  path: "/api/v1/scopes/{id}/supervision",
528
529
  service: "modus-api",
529
- serverUrl: "https://api.modus.com",
530
+ serverUrl: "https://api.getmodus.com",
530
531
  pathParams: ["id"],
531
532
  queryParams: ["view"],
532
533
  requestSchema: null,
@@ -536,7 +537,7 @@ var OPERATIONS = {
536
537
  method: "PUT",
537
538
  path: "/api/v1/scopes/{id}/supervision",
538
539
  service: "modus-api",
539
- serverUrl: "https://api.modus.com",
540
+ serverUrl: "https://api.getmodus.com",
540
541
  pathParams: ["id"],
541
542
  queryParams: [],
542
543
  requestSchema: "SetSupervisionRequestDto",
@@ -546,7 +547,7 @@ var OPERATIONS = {
546
547
  method: "PUT",
547
548
  path: "/api/v1/scopes/{id}/supervision/active",
548
549
  service: "modus-api",
549
- serverUrl: "https://api.modus.com",
550
+ serverUrl: "https://api.getmodus.com",
550
551
  pathParams: ["id"],
551
552
  queryParams: [],
552
553
  requestSchema: "SetSupervisionRequestDto",
@@ -556,7 +557,7 @@ var OPERATIONS = {
556
557
  method: "POST",
557
558
  path: "/api/v1/scopes/{id}/transfer-ownership/accept",
558
559
  service: "modus-api",
559
- serverUrl: "https://api.modus.com",
560
+ serverUrl: "https://api.getmodus.com",
560
561
  pathParams: ["id"],
561
562
  queryParams: [],
562
563
  requestSchema: null,
@@ -566,7 +567,7 @@ var OPERATIONS = {
566
567
  method: "DELETE",
567
568
  path: "/api/v1/scopes/{id}/transfer-ownership",
568
569
  service: "modus-api",
569
- serverUrl: "https://api.modus.com",
570
+ serverUrl: "https://api.getmodus.com",
570
571
  pathParams: ["id"],
571
572
  queryParams: [],
572
573
  requestSchema: null,
@@ -576,7 +577,7 @@ var OPERATIONS = {
576
577
  method: "POST",
577
578
  path: "/api/v1/scopes",
578
579
  service: "modus-api",
579
- serverUrl: "https://api.modus.com",
580
+ serverUrl: "https://api.getmodus.com",
580
581
  pathParams: [],
581
582
  queryParams: [],
582
583
  requestSchema: "CreateSkillDto",
@@ -586,7 +587,7 @@ var OPERATIONS = {
586
587
  method: "DELETE",
587
588
  path: "/api/v1/scopes/{id}",
588
589
  service: "modus-api",
589
- serverUrl: "https://api.modus.com",
590
+ serverUrl: "https://api.getmodus.com",
590
591
  pathParams: ["id"],
591
592
  queryParams: [],
592
593
  requestSchema: null,
@@ -596,7 +597,7 @@ var OPERATIONS = {
596
597
  method: "POST",
597
598
  path: "/api/v1/scopes/{id}/deploy",
598
599
  service: "modus-api",
599
- serverUrl: "https://api.modus.com",
600
+ serverUrl: "https://api.getmodus.com",
600
601
  pathParams: ["id"],
601
602
  queryParams: [],
602
603
  requestSchema: "DeploySkillDto",
@@ -606,7 +607,7 @@ var OPERATIONS = {
606
607
  method: "GET",
607
608
  path: "/api/v1/scopes/{id}",
608
609
  service: "modus-api",
609
- serverUrl: "https://api.modus.com",
610
+ serverUrl: "https://api.getmodus.com",
610
611
  pathParams: ["id"],
611
612
  queryParams: ["view"],
612
613
  requestSchema: null,
@@ -616,7 +617,7 @@ var OPERATIONS = {
616
617
  method: "GET",
617
618
  path: "/api/v1/scopes/{id}/variations/{variationUid}",
618
619
  service: "modus-api",
619
- serverUrl: "https://api.modus.com",
620
+ serverUrl: "https://api.getmodus.com",
620
621
  pathParams: ["id", "variationUid"],
621
622
  queryParams: [],
622
623
  requestSchema: null,
@@ -626,7 +627,7 @@ var OPERATIONS = {
626
627
  method: "GET",
627
628
  path: "/api/v1/scopes",
628
629
  service: "modus-api",
629
- serverUrl: "https://api.modus.com",
630
+ serverUrl: "https://api.getmodus.com",
630
631
  pathParams: [],
631
632
  queryParams: ["pageToken", "pageSize", "view", "search", "managerId", "includeVariation"],
632
633
  requestSchema: null,
@@ -636,7 +637,7 @@ var OPERATIONS = {
636
637
  method: "PATCH",
637
638
  path: "/api/v1/scopes/{id}/mcp-config",
638
639
  service: "modus-api",
639
- serverUrl: "https://api.modus.com",
640
+ serverUrl: "https://api.getmodus.com",
640
641
  pathParams: ["id"],
641
642
  queryParams: [],
642
643
  requestSchema: "PatchSkillMcpConfigDto",
@@ -646,7 +647,7 @@ var OPERATIONS = {
646
647
  method: "POST",
647
648
  path: "/api/v1/scopes/{id}/transfer-ownership",
648
649
  service: "modus-api",
649
- serverUrl: "https://api.modus.com",
650
+ serverUrl: "https://api.getmodus.com",
650
651
  pathParams: ["id"],
651
652
  queryParams: [],
652
653
  requestSchema: "TransferOwnershipDto",
@@ -656,7 +657,7 @@ var OPERATIONS = {
656
657
  method: "POST",
657
658
  path: "/api/v1/scopes/{id}/restore",
658
659
  service: "modus-api",
659
- serverUrl: "https://api.modus.com",
660
+ serverUrl: "https://api.getmodus.com",
660
661
  pathParams: ["id"],
661
662
  queryParams: [],
662
663
  requestSchema: null,
@@ -666,7 +667,7 @@ var OPERATIONS = {
666
667
  method: "PATCH",
667
668
  path: "/api/v1/scopes/{id}",
668
669
  service: "modus-api",
669
- serverUrl: "https://api.modus.com",
670
+ serverUrl: "https://api.getmodus.com",
670
671
  pathParams: ["id"],
671
672
  queryParams: ["updateMask"],
672
673
  requestSchema: "UpdateSkillDto",
@@ -676,7 +677,7 @@ var OPERATIONS = {
676
677
  method: "GET",
677
678
  path: "/api/v1/suggestions/questions",
678
679
  service: "modus-api",
679
- serverUrl: "https://api.modus.com",
680
+ serverUrl: "https://api.getmodus.com",
680
681
  pathParams: [],
681
682
  queryParams: ["pageToken", "pageSize", "skill_id", "skill_ids"],
682
683
  requestSchema: null,
@@ -686,7 +687,7 @@ var OPERATIONS = {
686
687
  method: "POST",
687
688
  path: "/api/v1/suggestions/questions/{id}/events",
688
689
  service: "modus-api",
689
- serverUrl: "https://api.modus.com",
690
+ serverUrl: "https://api.getmodus.com",
690
691
  pathParams: ["id"],
691
692
  queryParams: [],
692
693
  requestSchema: "RecordSuggestionEventDto",
@@ -696,7 +697,7 @@ var OPERATIONS = {
696
697
  method: "GET",
697
698
  path: "/api/v1/usage",
698
699
  service: "modus-api",
699
- serverUrl: "https://api.modus.com",
700
+ serverUrl: "https://api.getmodus.com",
700
701
  pathParams: [],
701
702
  queryParams: ["since", "until", "rollup", "model", "group_by", "skill_id", "agent_id", "user_id", "interface"],
702
703
  requestSchema: null,
@@ -706,7 +707,7 @@ var OPERATIONS = {
706
707
  method: "POST",
707
708
  path: "/agent/v1/workflow-actions/{runId}/cancel",
708
709
  service: "agent-service",
709
- serverUrl: "https://agent.modus.com",
710
+ serverUrl: "https://agent.getmodus.com",
710
711
  pathParams: ["runId"],
711
712
  queryParams: [],
712
713
  requestSchema: "CancelRunDto",
@@ -716,7 +717,7 @@ var OPERATIONS = {
716
717
  method: "POST",
717
718
  path: "/agent/v1/workflow-actions",
718
719
  service: "agent-service",
719
- serverUrl: "https://agent.modus.com",
720
+ serverUrl: "https://agent.getmodus.com",
720
721
  pathParams: [],
721
722
  queryParams: [],
722
723
  requestSchema: "WorkflowActionDto",
@@ -726,7 +727,7 @@ var OPERATIONS = {
726
727
  method: "POST",
727
728
  path: "/api/v1/workflows/{id}/interfaces",
728
729
  service: "modus-api",
729
- serverUrl: "https://api.modus.com",
730
+ serverUrl: "https://api.getmodus.com",
730
731
  pathParams: ["id"],
731
732
  queryParams: [],
732
733
  requestSchema: "AddAgentInterfaceDto",
@@ -736,7 +737,7 @@ var OPERATIONS = {
736
737
  method: "DELETE",
737
738
  path: "/api/v1/workflows/{id}/interfaces/{interfaceId}",
738
739
  service: "modus-api",
739
- serverUrl: "https://api.modus.com",
740
+ serverUrl: "https://api.getmodus.com",
740
741
  pathParams: ["id", "interfaceId"],
741
742
  queryParams: [],
742
743
  requestSchema: null,
@@ -746,7 +747,7 @@ var OPERATIONS = {
746
747
  method: "DELETE",
747
748
  path: "/api/v1/workflows/{id}/interfaces",
748
749
  service: "modus-api",
749
- serverUrl: "https://api.modus.com",
750
+ serverUrl: "https://api.getmodus.com",
750
751
  pathParams: ["id"],
751
752
  queryParams: [],
752
753
  requestSchema: null,
@@ -756,7 +757,7 @@ var OPERATIONS = {
756
757
  method: "GET",
757
758
  path: "/api/v1/workflows/{id}/interfaces",
758
759
  service: "modus-api",
759
- serverUrl: "https://api.modus.com",
760
+ serverUrl: "https://api.getmodus.com",
760
761
  pathParams: ["id"],
761
762
  queryParams: ["pageSize", "pageToken"],
762
763
  requestSchema: null,
@@ -766,7 +767,7 @@ var OPERATIONS = {
766
767
  method: "PATCH",
767
768
  path: "/api/v1/workflows/{id}/interfaces/{interfaceId}",
768
769
  service: "modus-api",
769
- serverUrl: "https://api.modus.com",
770
+ serverUrl: "https://api.getmodus.com",
770
771
  pathParams: ["id", "interfaceId"],
771
772
  queryParams: ["updateMask"],
772
773
  requestSchema: "UpdateAgentInterfaceDto",
@@ -776,7 +777,7 @@ var OPERATIONS = {
776
777
  method: "POST",
777
778
  path: "/agent/v1/workflows/{id}/runs",
778
779
  service: "agent-service",
779
- serverUrl: "https://agent.modus.com",
780
+ serverUrl: "https://agent.getmodus.com",
780
781
  pathParams: ["id"],
781
782
  queryParams: [],
782
783
  requestSchema: "AgentRunDto",
@@ -786,7 +787,7 @@ var OPERATIONS = {
786
787
  method: "GET",
787
788
  path: "/api/v1/workflows/{id}/runs/{runId}",
788
789
  service: "modus-api",
789
- serverUrl: "https://api.modus.com",
790
+ serverUrl: "https://api.getmodus.com",
790
791
  pathParams: ["id", "runId"],
791
792
  queryParams: ["temporalRunId"],
792
793
  requestSchema: null,
@@ -796,7 +797,7 @@ var OPERATIONS = {
796
797
  method: "GET",
797
798
  path: "/api/v1/workflows/{id}/runs",
798
799
  service: "modus-api",
799
- serverUrl: "https://api.modus.com",
800
+ serverUrl: "https://api.getmodus.com",
800
801
  pathParams: ["id"],
801
802
  queryParams: ["status", "timeframe", "approvalScope", "search", "pageSize", "pageToken"],
802
803
  requestSchema: null,
@@ -806,7 +807,7 @@ var OPERATIONS = {
806
807
  method: "POST",
807
808
  path: "/api/v1/workflows/{id}/transfer-ownership/accept",
808
809
  service: "modus-api",
809
- serverUrl: "https://api.modus.com",
810
+ serverUrl: "https://api.getmodus.com",
810
811
  pathParams: ["id"],
811
812
  queryParams: [],
812
813
  requestSchema: null,
@@ -816,7 +817,7 @@ var OPERATIONS = {
816
817
  method: "DELETE",
817
818
  path: "/api/v1/workflows/{id}/transfer-ownership",
818
819
  service: "modus-api",
819
- serverUrl: "https://api.modus.com",
820
+ serverUrl: "https://api.getmodus.com",
820
821
  pathParams: ["id"],
821
822
  queryParams: [],
822
823
  requestSchema: null,
@@ -826,7 +827,7 @@ var OPERATIONS = {
826
827
  method: "POST",
827
828
  path: "/api/v1/workflows",
828
829
  service: "modus-api",
829
- serverUrl: "https://api.modus.com",
830
+ serverUrl: "https://api.getmodus.com",
830
831
  pathParams: [],
831
832
  queryParams: [],
832
833
  requestSchema: "CreateAgentDto",
@@ -836,7 +837,7 @@ var OPERATIONS = {
836
837
  method: "DELETE",
837
838
  path: "/api/v1/workflows/{id}",
838
839
  service: "modus-api",
839
- serverUrl: "https://api.modus.com",
840
+ serverUrl: "https://api.getmodus.com",
840
841
  pathParams: ["id"],
841
842
  queryParams: [],
842
843
  requestSchema: null,
@@ -846,7 +847,7 @@ var OPERATIONS = {
846
847
  method: "POST",
847
848
  path: "/api/v1/workflows/{id}/deploy",
848
849
  service: "modus-api",
849
- serverUrl: "https://api.modus.com",
850
+ serverUrl: "https://api.getmodus.com",
850
851
  pathParams: ["id"],
851
852
  queryParams: [],
852
853
  requestSchema: "DeployAgentDto",
@@ -856,7 +857,7 @@ var OPERATIONS = {
856
857
  method: "GET",
857
858
  path: "/api/v1/workflows/{id}",
858
859
  service: "modus-api",
859
- serverUrl: "https://api.modus.com",
860
+ serverUrl: "https://api.getmodus.com",
860
861
  pathParams: ["id"],
861
862
  queryParams: ["view"],
862
863
  requestSchema: null,
@@ -866,7 +867,7 @@ var OPERATIONS = {
866
867
  method: "GET",
867
868
  path: "/api/v1/workflows",
868
869
  service: "modus-api",
869
- serverUrl: "https://api.modus.com",
870
+ serverUrl: "https://api.getmodus.com",
870
871
  pathParams: [],
871
872
  queryParams: ["pageToken", "pageSize", "view", "type", "search", "includeVariation"],
872
873
  requestSchema: null,
@@ -876,7 +877,7 @@ var OPERATIONS = {
876
877
  method: "POST",
877
878
  path: "/api/v1/workflows/{id}/transfer-ownership",
878
879
  service: "modus-api",
879
- serverUrl: "https://api.modus.com",
880
+ serverUrl: "https://api.getmodus.com",
880
881
  pathParams: ["id"],
881
882
  queryParams: [],
882
883
  requestSchema: "TransferOwnershipDto",
@@ -886,7 +887,7 @@ var OPERATIONS = {
886
887
  method: "POST",
887
888
  path: "/api/v1/workflows/{id}/restore",
888
889
  service: "modus-api",
889
- serverUrl: "https://api.modus.com",
890
+ serverUrl: "https://api.getmodus.com",
890
891
  pathParams: ["id"],
891
892
  queryParams: [],
892
893
  requestSchema: null,
@@ -896,7 +897,7 @@ var OPERATIONS = {
896
897
  method: "POST",
897
898
  path: "/api/v1/workflows/{id}/toggle",
898
899
  service: "modus-api",
899
- serverUrl: "https://api.modus.com",
900
+ serverUrl: "https://api.getmodus.com",
900
901
  pathParams: ["id"],
901
902
  queryParams: [],
902
903
  requestSchema: "ToggleAgentDto",
@@ -906,7 +907,7 @@ var OPERATIONS = {
906
907
  method: "PATCH",
907
908
  path: "/api/v1/workflows/{id}",
908
909
  service: "modus-api",
909
- serverUrl: "https://api.modus.com",
910
+ serverUrl: "https://api.getmodus.com",
910
911
  pathParams: ["id"],
911
912
  queryParams: ["updateMask"],
912
913
  requestSchema: "UpdateAgentDto",
@@ -996,6 +997,9 @@ var ValidationError = class extends ModusError {
996
997
  }
997
998
  };
998
999
 
1000
+ // src/_chat.ts
1001
+ var import_node_crypto = require("crypto");
1002
+
999
1003
  // src/_streaming.ts
1000
1004
  var SILENTLY_IGNORED = /* @__PURE__ */ new Set([
1001
1005
  "heartbeat",
@@ -1193,28 +1197,48 @@ function effectiveThreadId(threadId) {
1193
1197
  if (!threadId.trim()) return void 0;
1194
1198
  return threadId;
1195
1199
  }
1200
+ function resolveSessionId(threadId) {
1201
+ return effectiveThreadId(threadId) ?? (0, import_node_crypto.randomUUID)();
1202
+ }
1196
1203
  function chatPath(resource, resourceId, options) {
1197
1204
  const safeId = encodeURIComponent(String(resourceId));
1198
- const suffix = options.stream ? "/stream" : "";
1199
1205
  const tid = effectiveThreadId(options.threadId);
1200
1206
  if (tid !== void 0) {
1201
1207
  const safeTid = encodeURIComponent(tid);
1202
- return `/api/v1/${resource}/${safeId}/conversations/${safeTid}/chat${suffix}`;
1208
+ return `/api/v1/${resource}/${safeId}/conversations/${safeTid}/chat`;
1203
1209
  }
1204
- return `/api/v1/${resource}/${safeId}/chat${suffix}`;
1210
+ return `/api/v1/${resource}/${safeId}/chat`;
1205
1211
  }
1206
1212
  function modusChatPath(options) {
1207
- const suffix = options.stream ? "/stream" : "";
1208
1213
  const tid = effectiveThreadId(options.threadId);
1209
1214
  if (tid !== void 0) {
1210
1215
  validateId(tid, "thread_id");
1211
- return `/api/v1/modus/conversations/${encodeURIComponent(tid)}/chat${suffix}`;
1216
+ return `/api/v1/modus/conversations/${encodeURIComponent(tid)}/chat`;
1212
1217
  }
1213
- return `/api/v1/modus/chat${suffix}`;
1218
+ return `/api/v1/modus/chat`;
1219
+ }
1220
+ function agentHostRunsPath(resource, resourceId) {
1221
+ if (resource === "modus") return "/agent/v1/modus/runs";
1222
+ const safeId = encodeURIComponent(String(resourceId));
1223
+ return `/agent/v1/${resource}/${safeId}/runs`;
1214
1224
  }
1215
1225
  function chatBody(message, model) {
1216
1226
  return { message, model };
1217
1227
  }
1228
+ function agentRunsBody(message, model, options) {
1229
+ const body = {
1230
+ message,
1231
+ config: { model },
1232
+ sessionId: options.sessionId
1233
+ };
1234
+ if (options.organizationId !== void 0) {
1235
+ body.organizationId = options.organizationId;
1236
+ }
1237
+ if (options.version !== void 0) {
1238
+ body.version = options.version;
1239
+ }
1240
+ return body;
1241
+ }
1218
1242
  function raiseForEvent(event) {
1219
1243
  if (event.type === "error") throw new ModusError(event.message);
1220
1244
  if (event.type === "cancelled") throw new RunCancelledError();
@@ -1222,10 +1246,11 @@ function raiseForEvent(event) {
1222
1246
  return event;
1223
1247
  }
1224
1248
  var ChatStream = class {
1225
- constructor(http, path, body) {
1249
+ constructor(http, path, body, baseUrl) {
1226
1250
  this.http = http;
1227
1251
  this.path = path;
1228
1252
  this.body = body;
1253
+ this.baseUrl = baseUrl;
1229
1254
  this.textParts = [];
1230
1255
  }
1231
1256
  async *textStream() {
@@ -1238,7 +1263,9 @@ var ChatStream = class {
1238
1263
  }
1239
1264
  async *events(supportsReset) {
1240
1265
  const body = supportsReset ? { ...this.body, streamProtocolVersion: 2 } : this.body;
1241
- for await (const line of this.http.streamPost(this.path, body)) {
1266
+ for await (const line of this.http.streamPost(this.path, body, {
1267
+ baseUrl: this.baseUrl
1268
+ })) {
1242
1269
  for (const event of parseSseStream([line])) {
1243
1270
  const normalized = raiseForEvent(event);
1244
1271
  if (normalized.type === "token") this.textParts.push(normalized.content);
@@ -1272,31 +1299,43 @@ async function chatBuffered(http, resource, resourceId, message, options) {
1272
1299
  validateId(resourceId, `${resource}_id`);
1273
1300
  validateChatModel(options.model);
1274
1301
  const path = chatPath(resource, resourceId, {
1275
- threadId: options.threadId,
1276
- stream: false
1302
+ threadId: options.threadId
1277
1303
  });
1278
1304
  const data = await http.post(path, chatBody(message, options.model));
1279
1305
  return data;
1280
1306
  }
1281
- function chatStreamSession(http, resource, resourceId, message, options) {
1307
+ function chatStreamSession(http, config, resource, resourceId, message, options) {
1282
1308
  validateId(resourceId, `${resource}_id`);
1283
1309
  validateChatModel(options.model);
1284
- const path = chatPath(resource, resourceId, {
1285
- threadId: options.threadId,
1286
- stream: true
1287
- });
1288
- return new ChatStream(http, path, chatBody(message, options.model));
1310
+ const path = agentHostRunsPath(resource, resourceId);
1311
+ return new ChatStream(
1312
+ http,
1313
+ path,
1314
+ agentRunsBody(message, options.model, {
1315
+ sessionId: resolveSessionId(options.threadId),
1316
+ organizationId: config.organizationId,
1317
+ version: options.version
1318
+ }),
1319
+ config.agentHost
1320
+ );
1289
1321
  }
1290
1322
  async function modusChatBuffered(http, message, options) {
1291
1323
  validateChatModel(options.model);
1292
- const path = modusChatPath({ threadId: options.threadId, stream: false });
1324
+ const path = modusChatPath({ threadId: options.threadId });
1293
1325
  const data = await http.post(path, chatBody(message, options.model));
1294
1326
  return data;
1295
1327
  }
1296
- function modusChatStreamSession(http, message, options) {
1328
+ function modusChatStreamSession(http, config, message, options) {
1297
1329
  validateChatModel(options.model);
1298
- const path = modusChatPath({ threadId: options.threadId, stream: true });
1299
- return new ChatStream(http, path, chatBody(message, options.model));
1330
+ return new ChatStream(
1331
+ http,
1332
+ agentHostRunsPath("modus"),
1333
+ agentRunsBody(message, options.model, {
1334
+ sessionId: resolveSessionId(options.threadId),
1335
+ organizationId: config.organizationId
1336
+ }),
1337
+ config.agentHost
1338
+ );
1300
1339
  }
1301
1340
 
1302
1341
  // src/_pagination.ts
@@ -1364,6 +1403,12 @@ function buildAipPage(data, itemsKey, mapItem, fetchPage) {
1364
1403
  return new Page(items, nextPageTokenFromResponse(data), fetchPage);
1365
1404
  }
1366
1405
 
1406
+ // src/types/agents.ts
1407
+ var AgentType = {
1408
+ task: "task",
1409
+ workflow: "workflow"
1410
+ };
1411
+
1367
1412
  // src/types/conversations.ts
1368
1413
  function conversationSkillId(item) {
1369
1414
  return item.skillId === 0 ? void 0 : item.skillId;
@@ -1372,6 +1417,8 @@ function conversationSkillId(item) {
1372
1417
  // src/_auth.ts
1373
1418
  var ENV_API_KEY = "MODUS_API_KEY";
1374
1419
  var ENV_BASE_URL = "MODUS_BASE_URL";
1420
+ var ENV_AGENT_HOST = "MODUS_AGENT_HOST";
1421
+ var ENV_ORGANIZATION_ID = "MODUS_ORGANIZATION_ID";
1375
1422
  var ENV_TIMEOUT = "MODUS_TIMEOUT";
1376
1423
  var ENV_MAX_RETRIES = "MODUS_MAX_RETRIES";
1377
1424
  var KEY_PREFIX = "modus_";
@@ -1379,12 +1426,12 @@ function resolveApiKey(apiKey) {
1379
1426
  const key = apiKey ?? process.env[ENV_API_KEY];
1380
1427
  if (!key) {
1381
1428
  throw new AuthenticationError(
1382
- `No API key provided. Pass apiKey or set the ${ENV_API_KEY} environment variable. Create a token at app.modus.com \u2192 Settings \u2192 API Tokens.`
1429
+ `No API key provided. Pass apiKey or set the ${ENV_API_KEY} environment variable. Create a token at app.getmodus.com \u2192 Settings \u2192 API Tokens.`
1383
1430
  );
1384
1431
  }
1385
1432
  if (!key.startsWith(KEY_PREFIX)) {
1386
1433
  throw new AuthenticationError(
1387
- `Invalid API key format. Modus API keys start with '${KEY_PREFIX}'. Create a token at app.modus.com \u2192 Settings \u2192 API Tokens.`
1434
+ `Invalid API key format. Modus API keys start with '${KEY_PREFIX}'. Create a token at app.getmodus.com \u2192 Settings \u2192 API Tokens.`
1388
1435
  );
1389
1436
  }
1390
1437
  return key;
@@ -1392,6 +1439,15 @@ function resolveApiKey(apiKey) {
1392
1439
  function resolveBaseUrl(baseUrl) {
1393
1440
  return baseUrl ?? process.env[ENV_BASE_URL] ?? void 0;
1394
1441
  }
1442
+ function resolveAgentHost(agentHost) {
1443
+ return agentHost ?? process.env[ENV_AGENT_HOST] ?? void 0;
1444
+ }
1445
+ function resolveOrganizationId(organizationId) {
1446
+ const raw = organizationId ?? process.env[ENV_ORGANIZATION_ID];
1447
+ if (raw === void 0) return void 0;
1448
+ const stripped = raw.trim();
1449
+ return stripped || void 0;
1450
+ }
1395
1451
  function resolveTimeoutMs(explicitMs) {
1396
1452
  if (explicitMs !== void 0) return explicitMs;
1397
1453
  const raw = process.env[ENV_TIMEOUT];
@@ -1414,7 +1470,8 @@ function authHeaders(apiKey) {
1414
1470
  }
1415
1471
 
1416
1472
  // src/_config.ts
1417
- var DEFAULT_BASE_URL = "https://api.modus.com";
1473
+ var DEFAULT_BASE_URL = "https://api.getmodus.com";
1474
+ var DEFAULT_AGENT_HOST = "https://agent.getmodus.com";
1418
1475
  var DEFAULT_TIMEOUT_MS = 3e5;
1419
1476
  var DEFAULT_MAX_RETRIES = 2;
1420
1477
  function normalizeBaseUrl(baseUrl) {
@@ -1434,16 +1491,30 @@ function createModusConfig(options = {}) {
1434
1491
  throw new Error(`max_retries must be a non-negative int, got ${maxRetries}`);
1435
1492
  }
1436
1493
  const baseUrl = normalizeBaseUrl(resolveBaseUrl(options.baseUrl) ?? DEFAULT_BASE_URL);
1494
+ const baseUrlOverrides = normalizeBaseUrls(options.baseUrls);
1495
+ const agentHost = normalizeBaseUrl(
1496
+ baseUrlOverrides["agent-service"] ?? resolveAgentHost(options.agentHost) ?? DEFAULT_AGENT_HOST
1497
+ );
1498
+ const organizationId = resolveOrganizationId(options.organizationId);
1437
1499
  return Object.freeze({
1438
1500
  apiKey: resolveApiKey(options.apiKey),
1439
1501
  baseUrl,
1440
- baseUrls: Object.freeze({ "modus-api": baseUrl, ...normalizeBaseUrls(options.baseUrls) }),
1502
+ agentHost,
1503
+ ...organizationId !== void 0 ? { organizationId } : {},
1504
+ baseUrls: Object.freeze({
1505
+ "modus-api": baseUrl,
1506
+ "agent-service": agentHost,
1507
+ ...baseUrlOverrides
1508
+ }),
1441
1509
  timeoutMs: resolveTimeoutMs(options.timeoutMs) ?? DEFAULT_TIMEOUT_MS,
1442
1510
  maxRetries,
1443
1511
  fetch: options.fetch ?? globalThis.fetch.bind(globalThis)
1444
1512
  });
1445
1513
  }
1446
1514
  function resolveServiceBaseUrl(config, service, generatedBaseUrl) {
1515
+ if (service === "agent-service") {
1516
+ return config.baseUrls["agent-service"] ?? config.agentHost ?? generatedBaseUrl ?? config.baseUrl;
1517
+ }
1447
1518
  return config.baseUrls[service] ?? generatedBaseUrl ?? config.baseUrl;
1448
1519
  }
1449
1520
  function formatConfigForLog(config) {
@@ -1452,7 +1523,7 @@ function formatConfigForLog(config) {
1452
1523
  }
1453
1524
 
1454
1525
  // src/_http.ts
1455
- var USER_AGENT = `modus-typescript/${"0.2.1"} (node/${process.version}; ${process.platform})`;
1526
+ var USER_AGENT = `modus-typescript/${"0.2.2"} (node/${process.version}; ${process.platform})`;
1456
1527
  function buildUrl(baseUrl, path, params) {
1457
1528
  const url = new URL(path.startsWith("/") ? path : `/${path}`, baseUrl);
1458
1529
  if (params) {
@@ -1587,6 +1658,9 @@ var HttpClient = class {
1587
1658
  post(path, json, options = {}) {
1588
1659
  return this.request("POST", path, { json, ...options });
1589
1660
  }
1661
+ put(path, json, options = {}) {
1662
+ return this.request("PUT", path, { json, ...options });
1663
+ }
1590
1664
  patch(path, json, params, options = {}) {
1591
1665
  return this.request("PATCH", path, { json, params, ...options });
1592
1666
  }
@@ -1695,6 +1769,8 @@ async function invokeOperation(http, operationId, options = {}) {
1695
1769
  return http.get(path, params, requestOptions);
1696
1770
  case "POST":
1697
1771
  return http.post(path, options.jsonBody, requestOptions);
1772
+ case "PUT":
1773
+ return http.put(path, options.jsonBody, requestOptions);
1698
1774
  case "PATCH":
1699
1775
  return http.patch(path, options.jsonBody, params, requestOptions);
1700
1776
  case "DELETE":
@@ -1762,6 +1838,7 @@ function asRecord(data) {
1762
1838
  }
1763
1839
 
1764
1840
  // src/resources/agents/runs.ts
1841
+ var import_node_crypto2 = require("crypto");
1765
1842
  var RUNS_MAX_PAGE_SIZE = 100;
1766
1843
  function runsListParams(pageSize, pageToken, status, timeframe, approvalScope, search) {
1767
1844
  const params = { pageSize };
@@ -1809,7 +1886,16 @@ function parseActiveRunsPage(raw, fetchPage) {
1809
1886
  );
1810
1887
  }
1811
1888
  function randomRunId() {
1812
- return crypto.randomUUID();
1889
+ return (0, import_node_crypto2.randomUUID)();
1890
+ }
1891
+ function makeAgentRunStream(runId, events) {
1892
+ return {
1893
+ runId,
1894
+ events,
1895
+ [Symbol.asyncIterator]() {
1896
+ return events[Symbol.asyncIterator]();
1897
+ }
1898
+ };
1813
1899
  }
1814
1900
  var WorkflowRunsResource = class {
1815
1901
  constructor(http, config) {
@@ -1860,18 +1946,18 @@ var WorkflowRunsResource = class {
1860
1946
  });
1861
1947
  return parseRun(data);
1862
1948
  }
1863
- async create(workflowId, body, options = {}) {
1949
+ create(workflowId, body, options = {}) {
1864
1950
  validateId(workflowId, "workflow_id");
1865
1951
  return this.createRun("WorkflowRunsController_create", body, { id: workflowId }, options);
1866
1952
  }
1867
- async createScope(scopeId, body, options = {}) {
1953
+ createScope(scopeId, body, options = {}) {
1868
1954
  validateId(scopeId, "scope_id");
1869
1955
  return this.createRun("ScopeRunsController_create", body, { id: scopeId }, options);
1870
1956
  }
1871
- async createModus(body, options = {}) {
1957
+ createModus(body, options = {}) {
1872
1958
  return this.createRun("ModusRunsController_create", body, {}, options);
1873
1959
  }
1874
- async resume(runId, body, options = {}) {
1960
+ resume(runId, body, options = {}) {
1875
1961
  validateId(runId, "run_id");
1876
1962
  return this.createRun("ResumeRunsController_create", body, { runId }, options);
1877
1963
  }
@@ -1934,7 +2020,7 @@ var WorkflowRunsResource = class {
1934
2020
  baseUrl: operationBaseUrl(this.http, op),
1935
2021
  headers: options.lastEventId ? { "Last-Event-ID": options.lastEventId } : void 0
1936
2022
  });
1937
- return { runId, events: this.parseEvents(lines) };
2023
+ return makeAgentRunStream(runId, this.parseEvents(lines));
1938
2024
  }
1939
2025
  createRun(operationId, body, pathParams, options) {
1940
2026
  const runId = options.idempotencyKey?.trim() || body.runId?.trim() || randomRunId();
@@ -1947,7 +2033,7 @@ var WorkflowRunsResource = class {
1947
2033
  baseUrl: operationBaseUrl(this.http, op),
1948
2034
  headers: { "Idempotency-Key": runId }
1949
2035
  });
1950
- return { runId, events: this.parseEvents(lines) };
2036
+ return makeAgentRunStream(runId, this.parseEvents(lines));
1951
2037
  }
1952
2038
  async *parseEvents(lines) {
1953
2039
  yield* parseSseStream(lines);
@@ -1955,15 +2041,16 @@ var WorkflowRunsResource = class {
1955
2041
  };
1956
2042
 
1957
2043
  // src/resources/agents/workflow-actions.ts
2044
+ var import_node_crypto3 = require("crypto");
1958
2045
  function randomRunId2() {
1959
- return crypto.randomUUID();
2046
+ return (0, import_node_crypto3.randomUUID)();
1960
2047
  }
1961
2048
  var AgentWorkflowActionsResource = class {
1962
2049
  constructor(http, config) {
1963
2050
  this.http = http;
1964
2051
  this.config = config;
1965
2052
  }
1966
- async execute(body, options = {}) {
2053
+ execute(body, options = {}) {
1967
2054
  const runId = options.idempotencyKey?.trim() || body.runId?.trim() || randomRunId2();
1968
2055
  const op = getOperation("WorkflowActionsController_execute");
1969
2056
  const path = formatOperationPath("WorkflowActionsController_execute");
@@ -1971,7 +2058,7 @@ var AgentWorkflowActionsResource = class {
1971
2058
  baseUrl: operationBaseUrl(this.http, op),
1972
2059
  headers: { "Idempotency-Key": runId }
1973
2060
  });
1974
- return { runId, events: this.parseEvents(lines) };
2061
+ return makeAgentRunStream(runId, this.parseEvents(lines));
1975
2062
  }
1976
2063
  async cancel(runId) {
1977
2064
  validateId(runId, "run_id");
@@ -2049,6 +2136,12 @@ var WorkflowsResource = class {
2049
2136
  });
2050
2137
  return parseWorkflow(data);
2051
2138
  }
2139
+ chat(workflowId, message, options) {
2140
+ return chatBuffered(this.http, "workflows", workflowId, message, options);
2141
+ }
2142
+ chatStream(workflowId, message, options) {
2143
+ return chatStreamSession(this.http, this.config, "workflows", workflowId, message, options);
2144
+ }
2052
2145
  };
2053
2146
 
2054
2147
  // src/resources/connections.ts
@@ -2343,7 +2436,7 @@ var ModusResource = class {
2343
2436
  return modusChatBuffered(this.http, message, options);
2344
2437
  }
2345
2438
  chatStream(message, options) {
2346
- return modusChatStreamSession(this.http, message, options);
2439
+ return modusChatStreamSession(this.http, this.config, message, options);
2347
2440
  }
2348
2441
  };
2349
2442
 
@@ -2461,10 +2554,28 @@ var ScopesResource = class {
2461
2554
  return chatBuffered(this.http, "scopes", scopeId, message, options);
2462
2555
  }
2463
2556
  chatStream(scopeId, message, options) {
2464
- return chatStreamSession(this.http, "scopes", scopeId, message, options);
2557
+ return chatStreamSession(this.http, this.config, "scopes", scopeId, message, options);
2465
2558
  }
2466
2559
  };
2467
2560
 
2561
+ // src/types/suggestions.ts
2562
+ function normalizeRecordSuggestionEvent(event) {
2563
+ const eventType = event.event_type ?? event.eventType;
2564
+ if (eventType === void 0) {
2565
+ throw new Error("recordEvent requires event_type (or eventType)");
2566
+ }
2567
+ const body = {
2568
+ event_type: eventType,
2569
+ source: event.source
2570
+ };
2571
+ const skillId = event.skill_id ?? event.skillId;
2572
+ if (skillId !== void 0) body.skill_id = skillId;
2573
+ const threadId = event.thread_id ?? event.threadId;
2574
+ if (threadId !== void 0) body.thread_id = threadId;
2575
+ if (event.metadata !== void 0) body.metadata = event.metadata;
2576
+ return body;
2577
+ }
2578
+
2468
2579
  // src/resources/suggestions.ts
2469
2580
  var DEFAULT_SUGGESTIONS_PAGE_SIZE = 5;
2470
2581
  var MAX_SUGGESTIONS_PAGE_SIZE = 12;
@@ -2506,7 +2617,7 @@ var SuggestionsResource = class {
2506
2617
  validateId(id, "id");
2507
2618
  await invokeWithRetry(this.config, this.http, "SuggestionsController_recordEvent", {
2508
2619
  pathParams: { id },
2509
- jsonBody: event
2620
+ jsonBody: normalizeRecordSuggestionEvent(event)
2510
2621
  });
2511
2622
  }
2512
2623
  };
@@ -2526,6 +2637,7 @@ var Modus = class extends ModusClientBase {
2526
2637
  // Annotate the CommonJS export names for ESM import in node:
2527
2638
  0 && (module.exports = {
2528
2639
  APIConnectionError,
2640
+ AgentType,
2529
2641
  AuthenticationError,
2530
2642
  ChatStream,
2531
2643
  ConflictError,