@getmodus/sdk 0.1.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.
- package/CHANGELOG.md +48 -0
- package/LICENSE +21 -0
- package/README.md +79 -0
- package/dist/chunk-VLHNZJBG.js +1681 -0
- package/dist/chunk-VLHNZJBG.js.map +1 -0
- package/dist/conversations-nx1ujbiv.d.cts +19329 -0
- package/dist/conversations-nx1ujbiv.d.ts +19329 -0
- package/dist/index.cjs +2546 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +365 -0
- package/dist/index.d.ts +365 -0
- package/dist/index.js +888 -0
- package/dist/index.js.map +1 -0
- package/dist/management/index.cjs +2514 -0
- package/dist/management/index.cjs.map +1 -0
- package/dist/management/index.d.cts +351 -0
- package/dist/management/index.d.ts +351 -0
- package/dist/management/index.js +896 -0
- package/dist/management/index.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,1681 @@
|
|
|
1
|
+
// src/_generated/operations.ts
|
|
2
|
+
var OPERATIONS = {
|
|
3
|
+
"ConnectionsController_list": {
|
|
4
|
+
method: "GET",
|
|
5
|
+
path: "/api/v1/connections",
|
|
6
|
+
service: "modus-api",
|
|
7
|
+
serverUrl: "https://api.modus.com",
|
|
8
|
+
pathParams: [],
|
|
9
|
+
queryParams: ["pageToken", "pageSize", "type"],
|
|
10
|
+
requestSchema: null,
|
|
11
|
+
responseSchema: "ListConnectionsResponseDto"
|
|
12
|
+
},
|
|
13
|
+
"ContextCreatorsController_createLink": {
|
|
14
|
+
method: "POST",
|
|
15
|
+
path: "/api/v1/context/links",
|
|
16
|
+
service: "modus-api",
|
|
17
|
+
serverUrl: "https://api.modus.com",
|
|
18
|
+
pathParams: [],
|
|
19
|
+
queryParams: [],
|
|
20
|
+
requestSchema: "CreateLinkDto",
|
|
21
|
+
responseSchema: "CreatedContextItemResponseDto"
|
|
22
|
+
},
|
|
23
|
+
"ContextCreatorsController_createNote": {
|
|
24
|
+
method: "POST",
|
|
25
|
+
path: "/api/v1/context/notes",
|
|
26
|
+
service: "modus-api",
|
|
27
|
+
serverUrl: "https://api.modus.com",
|
|
28
|
+
pathParams: [],
|
|
29
|
+
queryParams: [],
|
|
30
|
+
requestSchema: "CreateNoteDto",
|
|
31
|
+
responseSchema: "CreatedContextItemResponseDto"
|
|
32
|
+
},
|
|
33
|
+
"ContextCreatorsController_createSavedQuery": {
|
|
34
|
+
method: "POST",
|
|
35
|
+
path: "/api/v1/context/saved-queries",
|
|
36
|
+
service: "modus-api",
|
|
37
|
+
serverUrl: "https://api.modus.com",
|
|
38
|
+
pathParams: [],
|
|
39
|
+
queryParams: [],
|
|
40
|
+
requestSchema: "CreateSavedQueryDto",
|
|
41
|
+
responseSchema: "CreatedContextItemResponseDto"
|
|
42
|
+
},
|
|
43
|
+
"ContextItemsController_delete": {
|
|
44
|
+
method: "DELETE",
|
|
45
|
+
path: "/api/v1/context/items/{uid}",
|
|
46
|
+
service: "modus-api",
|
|
47
|
+
serverUrl: "https://api.modus.com",
|
|
48
|
+
pathParams: ["uid"],
|
|
49
|
+
queryParams: [],
|
|
50
|
+
requestSchema: null,
|
|
51
|
+
responseSchema: "DeleteContextItemResponseDto"
|
|
52
|
+
},
|
|
53
|
+
"ContextItemsController_get": {
|
|
54
|
+
method: "GET",
|
|
55
|
+
path: "/api/v1/context/items/{uid}",
|
|
56
|
+
service: "modus-api",
|
|
57
|
+
serverUrl: "https://api.modus.com",
|
|
58
|
+
pathParams: ["uid"],
|
|
59
|
+
queryParams: [],
|
|
60
|
+
requestSchema: null,
|
|
61
|
+
responseSchema: "ContextItemDto"
|
|
62
|
+
},
|
|
63
|
+
"ContextItemsController_list": {
|
|
64
|
+
method: "GET",
|
|
65
|
+
path: "/api/v1/context/items",
|
|
66
|
+
service: "modus-api",
|
|
67
|
+
serverUrl: "https://api.modus.com",
|
|
68
|
+
pathParams: [],
|
|
69
|
+
queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics"],
|
|
70
|
+
requestSchema: null,
|
|
71
|
+
responseSchema: "ListContextItemsResponseDto"
|
|
72
|
+
},
|
|
73
|
+
"ContextItemsController_listValues": {
|
|
74
|
+
method: "GET",
|
|
75
|
+
path: "/api/v1/context/items/{uid}/values",
|
|
76
|
+
service: "modus-api",
|
|
77
|
+
serverUrl: "https://api.modus.com",
|
|
78
|
+
pathParams: ["uid"],
|
|
79
|
+
queryParams: ["contextType", "contentKeyPath", "pageSize", "offset", "pageToken", "searchQuery", "dataPathPrefix"],
|
|
80
|
+
requestSchema: null,
|
|
81
|
+
responseSchema: "ListContextItemValuesResponseDto"
|
|
82
|
+
},
|
|
83
|
+
"ContextItemsController_lookup": {
|
|
84
|
+
method: "POST",
|
|
85
|
+
path: "/api/v1/context/items/lookup",
|
|
86
|
+
service: "modus-api",
|
|
87
|
+
serverUrl: "https://api.modus.com",
|
|
88
|
+
pathParams: [],
|
|
89
|
+
queryParams: [],
|
|
90
|
+
requestSchema: "LookupContextItemDto",
|
|
91
|
+
responseSchema: "LookupContextItemResponseDto"
|
|
92
|
+
},
|
|
93
|
+
"ContextItemsController_update": {
|
|
94
|
+
method: "PATCH",
|
|
95
|
+
path: "/api/v1/context/items/{uid}",
|
|
96
|
+
service: "modus-api",
|
|
97
|
+
serverUrl: "https://api.modus.com",
|
|
98
|
+
pathParams: ["uid"],
|
|
99
|
+
queryParams: ["updateMask"],
|
|
100
|
+
requestSchema: "UpdateContextItemDto",
|
|
101
|
+
responseSchema: null
|
|
102
|
+
},
|
|
103
|
+
"CustomContextItemsController_batchCreate": {
|
|
104
|
+
method: "POST",
|
|
105
|
+
path: "/api/v1/context/custom-items/batch",
|
|
106
|
+
service: "modus-api",
|
|
107
|
+
serverUrl: "https://api.modus.com",
|
|
108
|
+
pathParams: [],
|
|
109
|
+
queryParams: [],
|
|
110
|
+
requestSchema: "BatchCreateCustomContextItemsDto",
|
|
111
|
+
responseSchema: "BatchCreateCustomContextItemsResponseDto"
|
|
112
|
+
},
|
|
113
|
+
"CustomContextItemsController_create": {
|
|
114
|
+
method: "POST",
|
|
115
|
+
path: "/api/v1/context/custom-items",
|
|
116
|
+
service: "modus-api",
|
|
117
|
+
serverUrl: "https://api.modus.com",
|
|
118
|
+
pathParams: [],
|
|
119
|
+
queryParams: [],
|
|
120
|
+
requestSchema: "CreateCustomContextItemDto",
|
|
121
|
+
responseSchema: "CreatedCustomContextItemResponseDto"
|
|
122
|
+
},
|
|
123
|
+
"CustomContextItemsController_delete": {
|
|
124
|
+
method: "DELETE",
|
|
125
|
+
path: "/api/v1/context/custom-items/{uid}",
|
|
126
|
+
service: "modus-api",
|
|
127
|
+
serverUrl: "https://api.modus.com",
|
|
128
|
+
pathParams: ["uid"],
|
|
129
|
+
queryParams: [],
|
|
130
|
+
requestSchema: null,
|
|
131
|
+
responseSchema: "DeleteContextItemResponseDto"
|
|
132
|
+
},
|
|
133
|
+
"CustomContextItemsController_get": {
|
|
134
|
+
method: "GET",
|
|
135
|
+
path: "/api/v1/context/custom-items/{uid}",
|
|
136
|
+
service: "modus-api",
|
|
137
|
+
serverUrl: "https://api.modus.com",
|
|
138
|
+
pathParams: ["uid"],
|
|
139
|
+
queryParams: [],
|
|
140
|
+
requestSchema: null,
|
|
141
|
+
responseSchema: "ContextItemDto"
|
|
142
|
+
},
|
|
143
|
+
"CustomContextItemsController_list": {
|
|
144
|
+
method: "GET",
|
|
145
|
+
path: "/api/v1/context/custom-items",
|
|
146
|
+
service: "modus-api",
|
|
147
|
+
serverUrl: "https://api.modus.com",
|
|
148
|
+
pathParams: [],
|
|
149
|
+
queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics"],
|
|
150
|
+
requestSchema: null,
|
|
151
|
+
responseSchema: "ListCustomContextItemsResponseDto"
|
|
152
|
+
},
|
|
153
|
+
"CustomContextItemsController_update": {
|
|
154
|
+
method: "PATCH",
|
|
155
|
+
path: "/api/v1/context/custom-items/{uid}",
|
|
156
|
+
service: "modus-api",
|
|
157
|
+
serverUrl: "https://api.modus.com",
|
|
158
|
+
pathParams: ["uid"],
|
|
159
|
+
queryParams: [],
|
|
160
|
+
requestSchema: "UpdateCustomContextItemDto",
|
|
161
|
+
responseSchema: null
|
|
162
|
+
},
|
|
163
|
+
"EvaluationsController_getConfig": {
|
|
164
|
+
method: "GET",
|
|
165
|
+
path: "/api/v1/scopes/{id}/evaluations/config",
|
|
166
|
+
service: "modus-api",
|
|
167
|
+
serverUrl: "https://api.modus.com",
|
|
168
|
+
pathParams: ["id"],
|
|
169
|
+
queryParams: [],
|
|
170
|
+
requestSchema: null,
|
|
171
|
+
responseSchema: "EvaluationConfigDto"
|
|
172
|
+
},
|
|
173
|
+
"EvaluationsController_getRun": {
|
|
174
|
+
method: "GET",
|
|
175
|
+
path: "/api/v1/scopes/{id}/evaluations/runs/{runId}",
|
|
176
|
+
service: "modus-api",
|
|
177
|
+
serverUrl: "https://api.modus.com",
|
|
178
|
+
pathParams: ["id", "runId"],
|
|
179
|
+
queryParams: [],
|
|
180
|
+
requestSchema: null,
|
|
181
|
+
responseSchema: "EvaluationRunWithResultsDto"
|
|
182
|
+
},
|
|
183
|
+
"EvaluationsController_listRuns": {
|
|
184
|
+
method: "GET",
|
|
185
|
+
path: "/api/v1/scopes/{id}/evaluations/runs",
|
|
186
|
+
service: "modus-api",
|
|
187
|
+
serverUrl: "https://api.modus.com",
|
|
188
|
+
pathParams: ["id"],
|
|
189
|
+
queryParams: ["pageSize", "pageToken"],
|
|
190
|
+
requestSchema: null,
|
|
191
|
+
responseSchema: "ListEvaluationRunsResponseDto"
|
|
192
|
+
},
|
|
193
|
+
"EvaluationsController_triggerRun": {
|
|
194
|
+
method: "POST",
|
|
195
|
+
path: "/api/v1/scopes/{id}/evaluations/runs",
|
|
196
|
+
service: "modus-api",
|
|
197
|
+
serverUrl: "https://api.modus.com",
|
|
198
|
+
pathParams: ["id"],
|
|
199
|
+
queryParams: [],
|
|
200
|
+
requestSchema: null,
|
|
201
|
+
responseSchema: "TriggerEvaluationRunResponseDto"
|
|
202
|
+
},
|
|
203
|
+
"EvaluationsController_updateConfig": {
|
|
204
|
+
method: "PUT",
|
|
205
|
+
path: "/api/v1/scopes/{id}/evaluations/config",
|
|
206
|
+
service: "modus-api",
|
|
207
|
+
serverUrl: "https://api.modus.com",
|
|
208
|
+
pathParams: ["id"],
|
|
209
|
+
queryParams: [],
|
|
210
|
+
requestSchema: "UpdateEvaluationConfigDto",
|
|
211
|
+
responseSchema: "EvaluationConfigDto"
|
|
212
|
+
},
|
|
213
|
+
"MemberGroupsController_list": {
|
|
214
|
+
method: "GET",
|
|
215
|
+
path: "/api/v1/users/member-groups",
|
|
216
|
+
service: "modus-api",
|
|
217
|
+
serverUrl: "https://api.modus.com",
|
|
218
|
+
pathParams: [],
|
|
219
|
+
queryParams: ["pageSize", "pageToken"],
|
|
220
|
+
requestSchema: null,
|
|
221
|
+
responseSchema: "ListMemberGroupsResponseDto"
|
|
222
|
+
},
|
|
223
|
+
"ModusChatController_chat": {
|
|
224
|
+
method: "POST",
|
|
225
|
+
path: "/api/v1/modus/chat",
|
|
226
|
+
service: "modus-api",
|
|
227
|
+
serverUrl: "https://api.modus.com",
|
|
228
|
+
pathParams: [],
|
|
229
|
+
queryParams: [],
|
|
230
|
+
requestSchema: "ModusChatRequestDto",
|
|
231
|
+
responseSchema: "ModusChatResponseDto"
|
|
232
|
+
},
|
|
233
|
+
"ModusChatController_chatContinue": {
|
|
234
|
+
method: "POST",
|
|
235
|
+
path: "/api/v1/modus/conversations/{threadId}/chat",
|
|
236
|
+
service: "modus-api",
|
|
237
|
+
serverUrl: "https://api.modus.com",
|
|
238
|
+
pathParams: ["threadId"],
|
|
239
|
+
queryParams: [],
|
|
240
|
+
requestSchema: "ModusChatRequestDto",
|
|
241
|
+
responseSchema: "ModusChatResponseDto"
|
|
242
|
+
},
|
|
243
|
+
"ModusContextController_compose": {
|
|
244
|
+
method: "POST",
|
|
245
|
+
path: "/api/v1/modus/context",
|
|
246
|
+
service: "modus-api",
|
|
247
|
+
serverUrl: "https://api.modus.com",
|
|
248
|
+
pathParams: [],
|
|
249
|
+
queryParams: [],
|
|
250
|
+
requestSchema: "ModusContextRequestDto",
|
|
251
|
+
responseSchema: "ModusContextResponseDto"
|
|
252
|
+
},
|
|
253
|
+
"ModusConversationsController_get": {
|
|
254
|
+
method: "GET",
|
|
255
|
+
path: "/api/v1/modus/conversations/{threadId}",
|
|
256
|
+
service: "modus-api",
|
|
257
|
+
serverUrl: "https://api.modus.com",
|
|
258
|
+
pathParams: ["threadId"],
|
|
259
|
+
queryParams: [],
|
|
260
|
+
requestSchema: null,
|
|
261
|
+
responseSchema: "ConversationDto"
|
|
262
|
+
},
|
|
263
|
+
"ModusConversationsController_list": {
|
|
264
|
+
method: "GET",
|
|
265
|
+
path: "/api/v1/modus/conversations",
|
|
266
|
+
service: "modus-api",
|
|
267
|
+
serverUrl: "https://api.modus.com",
|
|
268
|
+
pathParams: [],
|
|
269
|
+
queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "timeframe", "includeTools", "kind"],
|
|
270
|
+
requestSchema: null,
|
|
271
|
+
responseSchema: "ListConversationsResponseDto"
|
|
272
|
+
},
|
|
273
|
+
"ModusRunsController_create": {
|
|
274
|
+
method: "POST",
|
|
275
|
+
path: "/agent/v1/modus/runs",
|
|
276
|
+
service: "agent-service",
|
|
277
|
+
serverUrl: "https://agent.modus.com",
|
|
278
|
+
pathParams: [],
|
|
279
|
+
queryParams: [],
|
|
280
|
+
requestSchema: "ModusRunDto",
|
|
281
|
+
responseSchema: null
|
|
282
|
+
},
|
|
283
|
+
"OrgMembersController_list": {
|
|
284
|
+
method: "GET",
|
|
285
|
+
path: "/api/v1/users/org-members",
|
|
286
|
+
service: "modus-api",
|
|
287
|
+
serverUrl: "https://api.modus.com",
|
|
288
|
+
pathParams: [],
|
|
289
|
+
queryParams: ["pageSize", "pageToken"],
|
|
290
|
+
requestSchema: null,
|
|
291
|
+
responseSchema: "ListOrgMembersResponseDto"
|
|
292
|
+
},
|
|
293
|
+
"OrganizationController_deleteOrganization": {
|
|
294
|
+
method: "DELETE",
|
|
295
|
+
path: "/api/v1/users/organization",
|
|
296
|
+
service: "modus-api",
|
|
297
|
+
serverUrl: "https://api.modus.com",
|
|
298
|
+
pathParams: [],
|
|
299
|
+
queryParams: [],
|
|
300
|
+
requestSchema: null,
|
|
301
|
+
responseSchema: null
|
|
302
|
+
},
|
|
303
|
+
"ResumeRunsController_create": {
|
|
304
|
+
method: "POST",
|
|
305
|
+
path: "/agent/v1/runs/{runId}/resume",
|
|
306
|
+
service: "agent-service",
|
|
307
|
+
serverUrl: "https://agent.modus.com",
|
|
308
|
+
pathParams: ["runId"],
|
|
309
|
+
queryParams: [],
|
|
310
|
+
requestSchema: "ResumeRunDto",
|
|
311
|
+
responseSchema: null
|
|
312
|
+
},
|
|
313
|
+
"RunLifecycleController_active": {
|
|
314
|
+
method: "GET",
|
|
315
|
+
path: "/agent/v1/runs/active",
|
|
316
|
+
service: "agent-service",
|
|
317
|
+
serverUrl: "https://agent.modus.com",
|
|
318
|
+
pathParams: [],
|
|
319
|
+
queryParams: ["pageToken", "pageSize"],
|
|
320
|
+
requestSchema: null,
|
|
321
|
+
responseSchema: "ActiveRunsResponseDto"
|
|
322
|
+
},
|
|
323
|
+
"RunLifecycleController_activeBySession": {
|
|
324
|
+
method: "POST",
|
|
325
|
+
path: "/agent/v1/runs/active-by-session",
|
|
326
|
+
service: "agent-service",
|
|
327
|
+
serverUrl: "https://agent.modus.com",
|
|
328
|
+
pathParams: [],
|
|
329
|
+
queryParams: [],
|
|
330
|
+
requestSchema: "ActiveRunsBySessionDto",
|
|
331
|
+
responseSchema: "ActiveRunsBySessionResponseDto"
|
|
332
|
+
},
|
|
333
|
+
"RunLifecycleController_cancel": {
|
|
334
|
+
method: "POST",
|
|
335
|
+
path: "/agent/v1/runs/{runId}/cancel",
|
|
336
|
+
service: "agent-service",
|
|
337
|
+
serverUrl: "https://agent.modus.com",
|
|
338
|
+
pathParams: ["runId"],
|
|
339
|
+
queryParams: [],
|
|
340
|
+
requestSchema: "CancelRunDto",
|
|
341
|
+
responseSchema: null
|
|
342
|
+
},
|
|
343
|
+
"RunLifecycleController_editQueued": {
|
|
344
|
+
method: "POST",
|
|
345
|
+
path: "/agent/v1/runs/{runId}/queue-edit",
|
|
346
|
+
service: "agent-service",
|
|
347
|
+
serverUrl: "https://agent.modus.com",
|
|
348
|
+
pathParams: ["runId"],
|
|
349
|
+
queryParams: [],
|
|
350
|
+
requestSchema: "EditQueuedRunDto",
|
|
351
|
+
responseSchema: null
|
|
352
|
+
},
|
|
353
|
+
"RunLifecycleController_events": {
|
|
354
|
+
method: "GET",
|
|
355
|
+
path: "/agent/v1/runs/{runId}/events",
|
|
356
|
+
service: "agent-service",
|
|
357
|
+
serverUrl: "https://agent.modus.com",
|
|
358
|
+
pathParams: ["runId"],
|
|
359
|
+
queryParams: [],
|
|
360
|
+
requestSchema: null,
|
|
361
|
+
responseSchema: null
|
|
362
|
+
},
|
|
363
|
+
"RunLifecycleController_interrupt": {
|
|
364
|
+
method: "POST",
|
|
365
|
+
path: "/agent/v1/runs/{runId}/interrupt",
|
|
366
|
+
service: "agent-service",
|
|
367
|
+
serverUrl: "https://agent.modus.com",
|
|
368
|
+
pathParams: ["runId"],
|
|
369
|
+
queryParams: [],
|
|
370
|
+
requestSchema: "InterruptRunDto",
|
|
371
|
+
responseSchema: null
|
|
372
|
+
},
|
|
373
|
+
"RunLifecycleController_stream": {
|
|
374
|
+
method: "GET",
|
|
375
|
+
path: "/agent/v1/runs/{runId}/stream",
|
|
376
|
+
service: "agent-service",
|
|
377
|
+
serverUrl: "https://agent.modus.com",
|
|
378
|
+
pathParams: ["runId"],
|
|
379
|
+
queryParams: [],
|
|
380
|
+
requestSchema: null,
|
|
381
|
+
responseSchema: null
|
|
382
|
+
},
|
|
383
|
+
"ScopeChatController_chat": {
|
|
384
|
+
method: "POST",
|
|
385
|
+
path: "/api/v1/scopes/{id}/chat",
|
|
386
|
+
service: "modus-api",
|
|
387
|
+
serverUrl: "https://api.modus.com",
|
|
388
|
+
pathParams: ["id"],
|
|
389
|
+
queryParams: [],
|
|
390
|
+
requestSchema: "SkillChatRequestDto",
|
|
391
|
+
responseSchema: "SkillChatResponseDto"
|
|
392
|
+
},
|
|
393
|
+
"ScopeChatController_chatContinue": {
|
|
394
|
+
method: "POST",
|
|
395
|
+
path: "/api/v1/scopes/{id}/conversations/{threadId}/chat",
|
|
396
|
+
service: "modus-api",
|
|
397
|
+
serverUrl: "https://api.modus.com",
|
|
398
|
+
pathParams: ["id", "threadId"],
|
|
399
|
+
queryParams: [],
|
|
400
|
+
requestSchema: "SkillChatRequestDto",
|
|
401
|
+
responseSchema: "SkillChatResponseDto"
|
|
402
|
+
},
|
|
403
|
+
"ScopeContextController_compose": {
|
|
404
|
+
method: "POST",
|
|
405
|
+
path: "/api/v1/scopes/{id}/context",
|
|
406
|
+
service: "modus-api",
|
|
407
|
+
serverUrl: "https://api.modus.com",
|
|
408
|
+
pathParams: ["id"],
|
|
409
|
+
queryParams: [],
|
|
410
|
+
requestSchema: "ComposeSkillContextRequestDto",
|
|
411
|
+
responseSchema: "ComposeSkillContextResponseDto"
|
|
412
|
+
},
|
|
413
|
+
"ScopeConversationsController_get": {
|
|
414
|
+
method: "GET",
|
|
415
|
+
path: "/api/v1/scopes/{id}/conversations/{threadId}",
|
|
416
|
+
service: "modus-api",
|
|
417
|
+
serverUrl: "https://api.modus.com",
|
|
418
|
+
pathParams: ["id", "threadId"],
|
|
419
|
+
queryParams: ["messageLimit", "beforeMessageIndex"],
|
|
420
|
+
requestSchema: null,
|
|
421
|
+
responseSchema: "ConversationDto"
|
|
422
|
+
},
|
|
423
|
+
"ScopeConversationsController_list": {
|
|
424
|
+
method: "GET",
|
|
425
|
+
path: "/api/v1/scopes/{id}/conversations",
|
|
426
|
+
service: "modus-api",
|
|
427
|
+
serverUrl: "https://api.modus.com",
|
|
428
|
+
pathParams: ["id"],
|
|
429
|
+
queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "timeframe", "includeTools"],
|
|
430
|
+
requestSchema: null,
|
|
431
|
+
responseSchema: "ListConversationsResponseDto"
|
|
432
|
+
},
|
|
433
|
+
"ScopeMemoriesController_delete": {
|
|
434
|
+
method: "DELETE",
|
|
435
|
+
path: "/api/v1/scopes/{id}/memories/{memoryId}",
|
|
436
|
+
service: "modus-api",
|
|
437
|
+
serverUrl: "https://api.modus.com",
|
|
438
|
+
pathParams: ["id", "memoryId"],
|
|
439
|
+
queryParams: [],
|
|
440
|
+
requestSchema: null,
|
|
441
|
+
responseSchema: null
|
|
442
|
+
},
|
|
443
|
+
"ScopeMemoriesController_list": {
|
|
444
|
+
method: "GET",
|
|
445
|
+
path: "/api/v1/scopes/{id}/memories",
|
|
446
|
+
service: "modus-api",
|
|
447
|
+
serverUrl: "https://api.modus.com",
|
|
448
|
+
pathParams: ["id"],
|
|
449
|
+
queryParams: ["pageToken", "pageSize", "userId", "limit"],
|
|
450
|
+
requestSchema: null,
|
|
451
|
+
responseSchema: "ListMemoriesResponseDto"
|
|
452
|
+
},
|
|
453
|
+
"ScopeMemoriesController_search": {
|
|
454
|
+
method: "POST",
|
|
455
|
+
path: "/api/v1/scopes/{id}/memories/search",
|
|
456
|
+
service: "modus-api",
|
|
457
|
+
serverUrl: "https://api.modus.com",
|
|
458
|
+
pathParams: ["id"],
|
|
459
|
+
queryParams: [],
|
|
460
|
+
requestSchema: "SearchMemoriesRequestDto",
|
|
461
|
+
responseSchema: "ListMemoriesResponseDto"
|
|
462
|
+
},
|
|
463
|
+
"ScopeMemoriesController_update": {
|
|
464
|
+
method: "PATCH",
|
|
465
|
+
path: "/api/v1/scopes/{id}/memories/{memoryId}",
|
|
466
|
+
service: "modus-api",
|
|
467
|
+
serverUrl: "https://api.modus.com",
|
|
468
|
+
pathParams: ["id", "memoryId"],
|
|
469
|
+
queryParams: ["updateMask"],
|
|
470
|
+
requestSchema: "UpdateMemoryRequestDto",
|
|
471
|
+
responseSchema: null
|
|
472
|
+
},
|
|
473
|
+
"ScopeRunsController_create": {
|
|
474
|
+
method: "POST",
|
|
475
|
+
path: "/agent/v1/scopes/{id}/runs",
|
|
476
|
+
service: "agent-service",
|
|
477
|
+
serverUrl: "https://agent.modus.com",
|
|
478
|
+
pathParams: ["id"],
|
|
479
|
+
queryParams: [],
|
|
480
|
+
requestSchema: "SkillRunDto",
|
|
481
|
+
responseSchema: null
|
|
482
|
+
},
|
|
483
|
+
"ScopeSupervisionController_get": {
|
|
484
|
+
method: "GET",
|
|
485
|
+
path: "/api/v1/scopes/{id}/supervision",
|
|
486
|
+
service: "modus-api",
|
|
487
|
+
serverUrl: "https://api.modus.com",
|
|
488
|
+
pathParams: ["id"],
|
|
489
|
+
queryParams: ["view"],
|
|
490
|
+
requestSchema: null,
|
|
491
|
+
responseSchema: "SupervisionDto"
|
|
492
|
+
},
|
|
493
|
+
"ScopeSupervisionController_set": {
|
|
494
|
+
method: "PUT",
|
|
495
|
+
path: "/api/v1/scopes/{id}/supervision",
|
|
496
|
+
service: "modus-api",
|
|
497
|
+
serverUrl: "https://api.modus.com",
|
|
498
|
+
pathParams: ["id"],
|
|
499
|
+
queryParams: [],
|
|
500
|
+
requestSchema: "SetSupervisionRequestDto",
|
|
501
|
+
responseSchema: "SupervisionDto"
|
|
502
|
+
},
|
|
503
|
+
"ScopeSupervisionController_setActive": {
|
|
504
|
+
method: "PUT",
|
|
505
|
+
path: "/api/v1/scopes/{id}/supervision/active",
|
|
506
|
+
service: "modus-api",
|
|
507
|
+
serverUrl: "https://api.modus.com",
|
|
508
|
+
pathParams: ["id"],
|
|
509
|
+
queryParams: [],
|
|
510
|
+
requestSchema: "SetSupervisionRequestDto",
|
|
511
|
+
responseSchema: "SupervisionDto"
|
|
512
|
+
},
|
|
513
|
+
"ScopesController_acceptOwnershipTransfer": {
|
|
514
|
+
method: "POST",
|
|
515
|
+
path: "/api/v1/scopes/{id}/transfer-ownership/accept",
|
|
516
|
+
service: "modus-api",
|
|
517
|
+
serverUrl: "https://api.modus.com",
|
|
518
|
+
pathParams: ["id"],
|
|
519
|
+
queryParams: [],
|
|
520
|
+
requestSchema: null,
|
|
521
|
+
responseSchema: "SkillDto"
|
|
522
|
+
},
|
|
523
|
+
"ScopesController_cancelOwnershipTransfer": {
|
|
524
|
+
method: "DELETE",
|
|
525
|
+
path: "/api/v1/scopes/{id}/transfer-ownership",
|
|
526
|
+
service: "modus-api",
|
|
527
|
+
serverUrl: "https://api.modus.com",
|
|
528
|
+
pathParams: ["id"],
|
|
529
|
+
queryParams: [],
|
|
530
|
+
requestSchema: null,
|
|
531
|
+
responseSchema: "SkillDto"
|
|
532
|
+
},
|
|
533
|
+
"ScopesController_create": {
|
|
534
|
+
method: "POST",
|
|
535
|
+
path: "/api/v1/scopes",
|
|
536
|
+
service: "modus-api",
|
|
537
|
+
serverUrl: "https://api.modus.com",
|
|
538
|
+
pathParams: [],
|
|
539
|
+
queryParams: [],
|
|
540
|
+
requestSchema: "CreateSkillDto",
|
|
541
|
+
responseSchema: "SkillDto"
|
|
542
|
+
},
|
|
543
|
+
"ScopesController_delete": {
|
|
544
|
+
method: "DELETE",
|
|
545
|
+
path: "/api/v1/scopes/{id}",
|
|
546
|
+
service: "modus-api",
|
|
547
|
+
serverUrl: "https://api.modus.com",
|
|
548
|
+
pathParams: ["id"],
|
|
549
|
+
queryParams: [],
|
|
550
|
+
requestSchema: null,
|
|
551
|
+
responseSchema: null
|
|
552
|
+
},
|
|
553
|
+
"ScopesController_deploy": {
|
|
554
|
+
method: "POST",
|
|
555
|
+
path: "/api/v1/scopes/{id}/deploy",
|
|
556
|
+
service: "modus-api",
|
|
557
|
+
serverUrl: "https://api.modus.com",
|
|
558
|
+
pathParams: ["id"],
|
|
559
|
+
queryParams: [],
|
|
560
|
+
requestSchema: "DeploySkillDto",
|
|
561
|
+
responseSchema: "DeployResponseDto"
|
|
562
|
+
},
|
|
563
|
+
"ScopesController_get": {
|
|
564
|
+
method: "GET",
|
|
565
|
+
path: "/api/v1/scopes/{id}",
|
|
566
|
+
service: "modus-api",
|
|
567
|
+
serverUrl: "https://api.modus.com",
|
|
568
|
+
pathParams: ["id"],
|
|
569
|
+
queryParams: ["view"],
|
|
570
|
+
requestSchema: null,
|
|
571
|
+
responseSchema: "SkillDto"
|
|
572
|
+
},
|
|
573
|
+
"ScopesController_getVariation": {
|
|
574
|
+
method: "GET",
|
|
575
|
+
path: "/api/v1/scopes/{id}/variations/{variationUid}",
|
|
576
|
+
service: "modus-api",
|
|
577
|
+
serverUrl: "https://api.modus.com",
|
|
578
|
+
pathParams: ["id", "variationUid"],
|
|
579
|
+
queryParams: [],
|
|
580
|
+
requestSchema: null,
|
|
581
|
+
responseSchema: "SkillDto"
|
|
582
|
+
},
|
|
583
|
+
"ScopesController_list": {
|
|
584
|
+
method: "GET",
|
|
585
|
+
path: "/api/v1/scopes",
|
|
586
|
+
service: "modus-api",
|
|
587
|
+
serverUrl: "https://api.modus.com",
|
|
588
|
+
pathParams: [],
|
|
589
|
+
queryParams: ["pageToken", "pageSize", "view", "search", "managerId", "includeVariation"],
|
|
590
|
+
requestSchema: null,
|
|
591
|
+
responseSchema: "ListSkillsResponseDto"
|
|
592
|
+
},
|
|
593
|
+
"ScopesController_patchMcpConfig": {
|
|
594
|
+
method: "PATCH",
|
|
595
|
+
path: "/api/v1/scopes/{id}/mcp-config",
|
|
596
|
+
service: "modus-api",
|
|
597
|
+
serverUrl: "https://api.modus.com",
|
|
598
|
+
pathParams: ["id"],
|
|
599
|
+
queryParams: [],
|
|
600
|
+
requestSchema: "PatchSkillMcpConfigDto",
|
|
601
|
+
responseSchema: "PatchSkillMcpConfigResponseDto"
|
|
602
|
+
},
|
|
603
|
+
"ScopesController_requestOwnershipTransfer": {
|
|
604
|
+
method: "POST",
|
|
605
|
+
path: "/api/v1/scopes/{id}/transfer-ownership",
|
|
606
|
+
service: "modus-api",
|
|
607
|
+
serverUrl: "https://api.modus.com",
|
|
608
|
+
pathParams: ["id"],
|
|
609
|
+
queryParams: [],
|
|
610
|
+
requestSchema: "TransferOwnershipDto",
|
|
611
|
+
responseSchema: "SkillDto"
|
|
612
|
+
},
|
|
613
|
+
"ScopesController_restore": {
|
|
614
|
+
method: "POST",
|
|
615
|
+
path: "/api/v1/scopes/{id}/restore",
|
|
616
|
+
service: "modus-api",
|
|
617
|
+
serverUrl: "https://api.modus.com",
|
|
618
|
+
pathParams: ["id"],
|
|
619
|
+
queryParams: [],
|
|
620
|
+
requestSchema: null,
|
|
621
|
+
responseSchema: "SkillDto"
|
|
622
|
+
},
|
|
623
|
+
"ScopesController_update": {
|
|
624
|
+
method: "PATCH",
|
|
625
|
+
path: "/api/v1/scopes/{id}",
|
|
626
|
+
service: "modus-api",
|
|
627
|
+
serverUrl: "https://api.modus.com",
|
|
628
|
+
pathParams: ["id"],
|
|
629
|
+
queryParams: ["updateMask"],
|
|
630
|
+
requestSchema: "UpdateSkillDto",
|
|
631
|
+
responseSchema: "SkillDto"
|
|
632
|
+
},
|
|
633
|
+
"SuggestionsController_listApproved": {
|
|
634
|
+
method: "GET",
|
|
635
|
+
path: "/api/v1/suggestions/questions",
|
|
636
|
+
service: "modus-api",
|
|
637
|
+
serverUrl: "https://api.modus.com",
|
|
638
|
+
pathParams: [],
|
|
639
|
+
queryParams: ["pageToken", "pageSize", "skill_id", "skill_ids"],
|
|
640
|
+
requestSchema: null,
|
|
641
|
+
responseSchema: "ListSuggestionQuestionsResponseDto"
|
|
642
|
+
},
|
|
643
|
+
"SuggestionsController_recordEvent": {
|
|
644
|
+
method: "POST",
|
|
645
|
+
path: "/api/v1/suggestions/questions/{id}/events",
|
|
646
|
+
service: "modus-api",
|
|
647
|
+
serverUrl: "https://api.modus.com",
|
|
648
|
+
pathParams: ["id"],
|
|
649
|
+
queryParams: [],
|
|
650
|
+
requestSchema: "RecordSuggestionEventDto",
|
|
651
|
+
responseSchema: null
|
|
652
|
+
},
|
|
653
|
+
"UsageController_list": {
|
|
654
|
+
method: "GET",
|
|
655
|
+
path: "/api/v1/usage",
|
|
656
|
+
service: "modus-api",
|
|
657
|
+
serverUrl: "https://api.modus.com",
|
|
658
|
+
pathParams: [],
|
|
659
|
+
queryParams: ["since", "until", "rollup", "model", "group_by", "skill_id", "agent_id", "user_id", "interface"],
|
|
660
|
+
requestSchema: null,
|
|
661
|
+
responseSchema: "ListUsageResponseDto"
|
|
662
|
+
},
|
|
663
|
+
"WorkflowActionsController_cancel": {
|
|
664
|
+
method: "POST",
|
|
665
|
+
path: "/agent/v1/workflow-actions/{runId}/cancel",
|
|
666
|
+
service: "agent-service",
|
|
667
|
+
serverUrl: "https://agent.modus.com",
|
|
668
|
+
pathParams: ["runId"],
|
|
669
|
+
queryParams: [],
|
|
670
|
+
requestSchema: "CancelRunDto",
|
|
671
|
+
responseSchema: null
|
|
672
|
+
},
|
|
673
|
+
"WorkflowActionsController_execute": {
|
|
674
|
+
method: "POST",
|
|
675
|
+
path: "/agent/v1/workflow-actions",
|
|
676
|
+
service: "agent-service",
|
|
677
|
+
serverUrl: "https://agent.modus.com",
|
|
678
|
+
pathParams: [],
|
|
679
|
+
queryParams: [],
|
|
680
|
+
requestSchema: "WorkflowActionDto",
|
|
681
|
+
responseSchema: null
|
|
682
|
+
},
|
|
683
|
+
"WorkflowInterfacesController_add": {
|
|
684
|
+
method: "POST",
|
|
685
|
+
path: "/api/v1/workflows/{id}/interfaces",
|
|
686
|
+
service: "modus-api",
|
|
687
|
+
serverUrl: "https://api.modus.com",
|
|
688
|
+
pathParams: ["id"],
|
|
689
|
+
queryParams: [],
|
|
690
|
+
requestSchema: "AddAgentInterfaceDto",
|
|
691
|
+
responseSchema: "AgentInterfaceDto"
|
|
692
|
+
},
|
|
693
|
+
"WorkflowInterfacesController_delete": {
|
|
694
|
+
method: "DELETE",
|
|
695
|
+
path: "/api/v1/workflows/{id}/interfaces/{interfaceId}",
|
|
696
|
+
service: "modus-api",
|
|
697
|
+
serverUrl: "https://api.modus.com",
|
|
698
|
+
pathParams: ["id", "interfaceId"],
|
|
699
|
+
queryParams: [],
|
|
700
|
+
requestSchema: null,
|
|
701
|
+
responseSchema: null
|
|
702
|
+
},
|
|
703
|
+
"WorkflowInterfacesController_deleteAll": {
|
|
704
|
+
method: "DELETE",
|
|
705
|
+
path: "/api/v1/workflows/{id}/interfaces",
|
|
706
|
+
service: "modus-api",
|
|
707
|
+
serverUrl: "https://api.modus.com",
|
|
708
|
+
pathParams: ["id"],
|
|
709
|
+
queryParams: [],
|
|
710
|
+
requestSchema: null,
|
|
711
|
+
responseSchema: null
|
|
712
|
+
},
|
|
713
|
+
"WorkflowInterfacesController_list": {
|
|
714
|
+
method: "GET",
|
|
715
|
+
path: "/api/v1/workflows/{id}/interfaces",
|
|
716
|
+
service: "modus-api",
|
|
717
|
+
serverUrl: "https://api.modus.com",
|
|
718
|
+
pathParams: ["id"],
|
|
719
|
+
queryParams: ["pageSize", "pageToken"],
|
|
720
|
+
requestSchema: null,
|
|
721
|
+
responseSchema: "ListAgentInterfacesResponseDto"
|
|
722
|
+
},
|
|
723
|
+
"WorkflowInterfacesController_update": {
|
|
724
|
+
method: "PATCH",
|
|
725
|
+
path: "/api/v1/workflows/{id}/interfaces/{interfaceId}",
|
|
726
|
+
service: "modus-api",
|
|
727
|
+
serverUrl: "https://api.modus.com",
|
|
728
|
+
pathParams: ["id", "interfaceId"],
|
|
729
|
+
queryParams: ["updateMask"],
|
|
730
|
+
requestSchema: "UpdateAgentInterfaceDto",
|
|
731
|
+
responseSchema: "AgentInterfaceDto"
|
|
732
|
+
},
|
|
733
|
+
"WorkflowRunsController_create": {
|
|
734
|
+
method: "POST",
|
|
735
|
+
path: "/agent/v1/workflows/{id}/runs",
|
|
736
|
+
service: "agent-service",
|
|
737
|
+
serverUrl: "https://agent.modus.com",
|
|
738
|
+
pathParams: ["id"],
|
|
739
|
+
queryParams: [],
|
|
740
|
+
requestSchema: "AgentRunDto",
|
|
741
|
+
responseSchema: null
|
|
742
|
+
},
|
|
743
|
+
"WorkflowRunsController_get": {
|
|
744
|
+
method: "GET",
|
|
745
|
+
path: "/api/v1/workflows/{id}/runs/{runId}",
|
|
746
|
+
service: "modus-api",
|
|
747
|
+
serverUrl: "https://api.modus.com",
|
|
748
|
+
pathParams: ["id", "runId"],
|
|
749
|
+
queryParams: ["temporalRunId"],
|
|
750
|
+
requestSchema: null,
|
|
751
|
+
responseSchema: "GetAutomationRunResponseDto"
|
|
752
|
+
},
|
|
753
|
+
"WorkflowRunsController_list": {
|
|
754
|
+
method: "GET",
|
|
755
|
+
path: "/api/v1/workflows/{id}/runs",
|
|
756
|
+
service: "modus-api",
|
|
757
|
+
serverUrl: "https://api.modus.com",
|
|
758
|
+
pathParams: ["id"],
|
|
759
|
+
queryParams: ["status", "timeframe", "approvalScope", "search", "pageSize", "pageToken"],
|
|
760
|
+
requestSchema: null,
|
|
761
|
+
responseSchema: "ListAutomationRunsResponseDto"
|
|
762
|
+
},
|
|
763
|
+
"WorkflowsController_acceptOwnershipTransfer": {
|
|
764
|
+
method: "POST",
|
|
765
|
+
path: "/api/v1/workflows/{id}/transfer-ownership/accept",
|
|
766
|
+
service: "modus-api",
|
|
767
|
+
serverUrl: "https://api.modus.com",
|
|
768
|
+
pathParams: ["id"],
|
|
769
|
+
queryParams: [],
|
|
770
|
+
requestSchema: null,
|
|
771
|
+
responseSchema: "AgentDto"
|
|
772
|
+
},
|
|
773
|
+
"WorkflowsController_cancelOwnershipTransfer": {
|
|
774
|
+
method: "DELETE",
|
|
775
|
+
path: "/api/v1/workflows/{id}/transfer-ownership",
|
|
776
|
+
service: "modus-api",
|
|
777
|
+
serverUrl: "https://api.modus.com",
|
|
778
|
+
pathParams: ["id"],
|
|
779
|
+
queryParams: [],
|
|
780
|
+
requestSchema: null,
|
|
781
|
+
responseSchema: "AgentDto"
|
|
782
|
+
},
|
|
783
|
+
"WorkflowsController_create": {
|
|
784
|
+
method: "POST",
|
|
785
|
+
path: "/api/v1/workflows",
|
|
786
|
+
service: "modus-api",
|
|
787
|
+
serverUrl: "https://api.modus.com",
|
|
788
|
+
pathParams: [],
|
|
789
|
+
queryParams: [],
|
|
790
|
+
requestSchema: "CreateAgentDto",
|
|
791
|
+
responseSchema: "AgentDto"
|
|
792
|
+
},
|
|
793
|
+
"WorkflowsController_delete": {
|
|
794
|
+
method: "DELETE",
|
|
795
|
+
path: "/api/v1/workflows/{id}",
|
|
796
|
+
service: "modus-api",
|
|
797
|
+
serverUrl: "https://api.modus.com",
|
|
798
|
+
pathParams: ["id"],
|
|
799
|
+
queryParams: [],
|
|
800
|
+
requestSchema: null,
|
|
801
|
+
responseSchema: null
|
|
802
|
+
},
|
|
803
|
+
"WorkflowsController_deploy": {
|
|
804
|
+
method: "POST",
|
|
805
|
+
path: "/api/v1/workflows/{id}/deploy",
|
|
806
|
+
service: "modus-api",
|
|
807
|
+
serverUrl: "https://api.modus.com",
|
|
808
|
+
pathParams: ["id"],
|
|
809
|
+
queryParams: [],
|
|
810
|
+
requestSchema: "DeployAgentDto",
|
|
811
|
+
responseSchema: "AgentDeployResponseDto"
|
|
812
|
+
},
|
|
813
|
+
"WorkflowsController_get": {
|
|
814
|
+
method: "GET",
|
|
815
|
+
path: "/api/v1/workflows/{id}",
|
|
816
|
+
service: "modus-api",
|
|
817
|
+
serverUrl: "https://api.modus.com",
|
|
818
|
+
pathParams: ["id"],
|
|
819
|
+
queryParams: ["view"],
|
|
820
|
+
requestSchema: null,
|
|
821
|
+
responseSchema: "AgentDto"
|
|
822
|
+
},
|
|
823
|
+
"WorkflowsController_list": {
|
|
824
|
+
method: "GET",
|
|
825
|
+
path: "/api/v1/workflows",
|
|
826
|
+
service: "modus-api",
|
|
827
|
+
serverUrl: "https://api.modus.com",
|
|
828
|
+
pathParams: [],
|
|
829
|
+
queryParams: ["pageToken", "pageSize", "view", "type", "search", "includeVariation"],
|
|
830
|
+
requestSchema: null,
|
|
831
|
+
responseSchema: "ListAgentsResponseDto"
|
|
832
|
+
},
|
|
833
|
+
"WorkflowsController_requestOwnershipTransfer": {
|
|
834
|
+
method: "POST",
|
|
835
|
+
path: "/api/v1/workflows/{id}/transfer-ownership",
|
|
836
|
+
service: "modus-api",
|
|
837
|
+
serverUrl: "https://api.modus.com",
|
|
838
|
+
pathParams: ["id"],
|
|
839
|
+
queryParams: [],
|
|
840
|
+
requestSchema: "TransferOwnershipDto",
|
|
841
|
+
responseSchema: "AgentDto"
|
|
842
|
+
},
|
|
843
|
+
"WorkflowsController_restore": {
|
|
844
|
+
method: "POST",
|
|
845
|
+
path: "/api/v1/workflows/{id}/restore",
|
|
846
|
+
service: "modus-api",
|
|
847
|
+
serverUrl: "https://api.modus.com",
|
|
848
|
+
pathParams: ["id"],
|
|
849
|
+
queryParams: [],
|
|
850
|
+
requestSchema: null,
|
|
851
|
+
responseSchema: "AgentDto"
|
|
852
|
+
},
|
|
853
|
+
"WorkflowsController_toggle": {
|
|
854
|
+
method: "POST",
|
|
855
|
+
path: "/api/v1/workflows/{id}/toggle",
|
|
856
|
+
service: "modus-api",
|
|
857
|
+
serverUrl: "https://api.modus.com",
|
|
858
|
+
pathParams: ["id"],
|
|
859
|
+
queryParams: [],
|
|
860
|
+
requestSchema: "ToggleAgentDto",
|
|
861
|
+
responseSchema: "AgentDto"
|
|
862
|
+
},
|
|
863
|
+
"WorkflowsController_update": {
|
|
864
|
+
method: "PATCH",
|
|
865
|
+
path: "/api/v1/workflows/{id}",
|
|
866
|
+
service: "modus-api",
|
|
867
|
+
serverUrl: "https://api.modus.com",
|
|
868
|
+
pathParams: ["id"],
|
|
869
|
+
queryParams: ["updateMask"],
|
|
870
|
+
requestSchema: "UpdateAgentDto",
|
|
871
|
+
responseSchema: "AgentDto"
|
|
872
|
+
}
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
// src/_exceptions.ts
|
|
876
|
+
var ModusError = class extends Error {
|
|
877
|
+
constructor(message, options = {}) {
|
|
878
|
+
super(message);
|
|
879
|
+
this.name = "ModusError";
|
|
880
|
+
this.message = message;
|
|
881
|
+
this.statusCode = options.statusCode;
|
|
882
|
+
this.requestId = options.requestId;
|
|
883
|
+
this.responseHeaders = options.responseHeaders;
|
|
884
|
+
this.body = options.body;
|
|
885
|
+
this.code = options.code;
|
|
886
|
+
}
|
|
887
|
+
};
|
|
888
|
+
var APIConnectionError = class extends ModusError {
|
|
889
|
+
constructor(message) {
|
|
890
|
+
super(message);
|
|
891
|
+
this.name = "APIConnectionError";
|
|
892
|
+
}
|
|
893
|
+
};
|
|
894
|
+
var AuthenticationError = class extends ModusError {
|
|
895
|
+
constructor(message, options = {}) {
|
|
896
|
+
super(message, { ...options, statusCode: 401 });
|
|
897
|
+
this.name = "AuthenticationError";
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
var PermissionDeniedError = class extends ModusError {
|
|
901
|
+
constructor(message, options = {}) {
|
|
902
|
+
super(message, { ...options, statusCode: 403 });
|
|
903
|
+
this.name = "PermissionDeniedError";
|
|
904
|
+
}
|
|
905
|
+
};
|
|
906
|
+
var NotFoundError = class extends ModusError {
|
|
907
|
+
constructor(message, options = {}) {
|
|
908
|
+
super(message, { ...options, statusCode: 404 });
|
|
909
|
+
this.name = "NotFoundError";
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
var ConflictError = class extends ModusError {
|
|
913
|
+
constructor(message, options = {}) {
|
|
914
|
+
super(message, { ...options, statusCode: 409 });
|
|
915
|
+
this.name = "ConflictError";
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
var UnprocessableError = class extends ModusError {
|
|
919
|
+
constructor(message, options = {}) {
|
|
920
|
+
super(message, { ...options, statusCode: 422 });
|
|
921
|
+
this.name = "UnprocessableError";
|
|
922
|
+
this.errors = options.errors;
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
var RateLimitError = class extends ModusError {
|
|
926
|
+
constructor(message, options = {}) {
|
|
927
|
+
super(message, { ...options, statusCode: 429 });
|
|
928
|
+
this.name = "RateLimitError";
|
|
929
|
+
this.retryAfter = options.retryAfter;
|
|
930
|
+
}
|
|
931
|
+
};
|
|
932
|
+
var InternalServerError = class extends ModusError {
|
|
933
|
+
constructor(message, statusCode, options = {}) {
|
|
934
|
+
super(message, { ...options, statusCode });
|
|
935
|
+
this.name = "InternalServerError";
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
var RunCancelledError = class extends ModusError {
|
|
939
|
+
constructor(message = "Run was cancelled.") {
|
|
940
|
+
super(message);
|
|
941
|
+
this.name = "RunCancelledError";
|
|
942
|
+
}
|
|
943
|
+
};
|
|
944
|
+
var StreamTimeoutError = class extends ModusError {
|
|
945
|
+
constructor(message = "Stream timed out.") {
|
|
946
|
+
super(message);
|
|
947
|
+
this.name = "StreamTimeoutError";
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
var ValidationError = class extends ModusError {
|
|
951
|
+
constructor(message) {
|
|
952
|
+
super(message);
|
|
953
|
+
this.name = "ValidationError";
|
|
954
|
+
}
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
// src/_pagination.ts
|
|
958
|
+
var Page = class {
|
|
959
|
+
constructor(items, nextPageToken, fetchPage) {
|
|
960
|
+
this.items = items;
|
|
961
|
+
this.nextPageToken = normalizePageToken(nextPageToken);
|
|
962
|
+
this.fetchPage = fetchPage;
|
|
963
|
+
}
|
|
964
|
+
hasNextPage() {
|
|
965
|
+
return this.nextPageToken !== void 0;
|
|
966
|
+
}
|
|
967
|
+
async getNextPage() {
|
|
968
|
+
if (this.nextPageToken === void 0) {
|
|
969
|
+
throw new Error(
|
|
970
|
+
"No next page available. Check hasNextPage() before calling getNextPage()."
|
|
971
|
+
);
|
|
972
|
+
}
|
|
973
|
+
return this.fetchPage(this.nextPageToken);
|
|
974
|
+
}
|
|
975
|
+
async *autoPagingIter() {
|
|
976
|
+
for (const item of this.items) yield item;
|
|
977
|
+
let nextPageToken = this.nextPageToken;
|
|
978
|
+
while (nextPageToken !== void 0) {
|
|
979
|
+
const page = await this.fetchPage(nextPageToken);
|
|
980
|
+
for (const item of page.items) yield item;
|
|
981
|
+
nextPageToken = page.nextPageToken;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
[Symbol.iterator]() {
|
|
985
|
+
return this.items[Symbol.iterator]();
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
function normalizePageToken(token) {
|
|
989
|
+
if (token === void 0 || token === null || !String(token).trim()) return void 0;
|
|
990
|
+
return token;
|
|
991
|
+
}
|
|
992
|
+
function aipListParams(pageSize, pageToken, extra = {}) {
|
|
993
|
+
const params = { pageSize, ...extra };
|
|
994
|
+
const token = normalizePageToken(pageToken);
|
|
995
|
+
if (token !== void 0) params.pageToken = token;
|
|
996
|
+
return params;
|
|
997
|
+
}
|
|
998
|
+
function nextPageTokenFromResponse(data) {
|
|
999
|
+
return normalizePageToken(
|
|
1000
|
+
typeof data.nextPageToken === "string" ? data.nextPageToken : void 0
|
|
1001
|
+
);
|
|
1002
|
+
}
|
|
1003
|
+
function requireItemsList(data, itemsKey) {
|
|
1004
|
+
const value = data[itemsKey];
|
|
1005
|
+
if (!Array.isArray(value)) {
|
|
1006
|
+
throw new ModusError(
|
|
1007
|
+
`Unexpected list response shape: ${itemsKey} must be a list, got ${typeof value}. This is likely a backend error.`
|
|
1008
|
+
);
|
|
1009
|
+
}
|
|
1010
|
+
return value;
|
|
1011
|
+
}
|
|
1012
|
+
function buildAipPage(data, itemsKey, mapItem, fetchPage) {
|
|
1013
|
+
if (typeof data !== "object" || data === null || !(itemsKey in data)) {
|
|
1014
|
+
throw new ModusError(
|
|
1015
|
+
`Unexpected list response shape: missing ${itemsKey}. Got: ${typeof data}. This is likely a backend error.`
|
|
1016
|
+
);
|
|
1017
|
+
}
|
|
1018
|
+
const items = requireItemsList(data, itemsKey).map(mapItem);
|
|
1019
|
+
return new Page(items, nextPageTokenFromResponse(data), fetchPage);
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
// src/_auth.ts
|
|
1023
|
+
var ENV_API_KEY = "MODUS_API_KEY";
|
|
1024
|
+
var ENV_BASE_URL = "MODUS_BASE_URL";
|
|
1025
|
+
var ENV_TIMEOUT = "MODUS_TIMEOUT";
|
|
1026
|
+
var ENV_MAX_RETRIES = "MODUS_MAX_RETRIES";
|
|
1027
|
+
var KEY_PREFIX = "modus_";
|
|
1028
|
+
function resolveApiKey(apiKey) {
|
|
1029
|
+
const key = apiKey ?? process.env[ENV_API_KEY];
|
|
1030
|
+
if (!key) {
|
|
1031
|
+
throw new AuthenticationError(
|
|
1032
|
+
`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.`
|
|
1033
|
+
);
|
|
1034
|
+
}
|
|
1035
|
+
if (!key.startsWith(KEY_PREFIX)) {
|
|
1036
|
+
throw new AuthenticationError(
|
|
1037
|
+
`Invalid API key format. Modus API keys start with '${KEY_PREFIX}'. Create a token at app.modus.com \u2192 Settings \u2192 API Tokens.`
|
|
1038
|
+
);
|
|
1039
|
+
}
|
|
1040
|
+
return key;
|
|
1041
|
+
}
|
|
1042
|
+
function resolveBaseUrl(baseUrl) {
|
|
1043
|
+
return baseUrl ?? process.env[ENV_BASE_URL] ?? void 0;
|
|
1044
|
+
}
|
|
1045
|
+
function resolveTimeoutMs(explicitMs) {
|
|
1046
|
+
if (explicitMs !== void 0) return explicitMs;
|
|
1047
|
+
const raw = process.env[ENV_TIMEOUT];
|
|
1048
|
+
if (raw === void 0) return void 0;
|
|
1049
|
+
const seconds = Number(raw);
|
|
1050
|
+
return Number.isFinite(seconds) ? seconds * 1e3 : void 0;
|
|
1051
|
+
}
|
|
1052
|
+
function resolveMaxRetries(explicit) {
|
|
1053
|
+
if (explicit !== void 0) {
|
|
1054
|
+
if (explicit < 0) throw new Error(`max_retries must be >= 0, got ${explicit}`);
|
|
1055
|
+
return explicit;
|
|
1056
|
+
}
|
|
1057
|
+
const raw = process.env[ENV_MAX_RETRIES];
|
|
1058
|
+
if (raw === void 0) return void 0;
|
|
1059
|
+
const value = Number.parseInt(raw, 10);
|
|
1060
|
+
return Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
1061
|
+
}
|
|
1062
|
+
function authHeaders(apiKey) {
|
|
1063
|
+
return { Authorization: `Bearer ${apiKey}` };
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
// src/_config.ts
|
|
1067
|
+
var DEFAULT_BASE_URL = "https://api.modus.com";
|
|
1068
|
+
var DEFAULT_TIMEOUT_MS = 3e5;
|
|
1069
|
+
var DEFAULT_MAX_RETRIES = 2;
|
|
1070
|
+
function normalizeBaseUrl(baseUrl) {
|
|
1071
|
+
return baseUrl.replace(/\/$/, "");
|
|
1072
|
+
}
|
|
1073
|
+
function normalizeBaseUrls(baseUrls) {
|
|
1074
|
+
return Object.fromEntries(
|
|
1075
|
+
Object.entries(baseUrls ?? {}).map(([service, baseUrl]) => [
|
|
1076
|
+
service,
|
|
1077
|
+
normalizeBaseUrl(baseUrl)
|
|
1078
|
+
])
|
|
1079
|
+
);
|
|
1080
|
+
}
|
|
1081
|
+
function createModusConfig(options = {}) {
|
|
1082
|
+
const maxRetries = resolveMaxRetries(options.maxRetries) ?? DEFAULT_MAX_RETRIES;
|
|
1083
|
+
if (!Number.isInteger(maxRetries) || maxRetries < 0) {
|
|
1084
|
+
throw new Error(`max_retries must be a non-negative int, got ${maxRetries}`);
|
|
1085
|
+
}
|
|
1086
|
+
const baseUrl = normalizeBaseUrl(resolveBaseUrl(options.baseUrl) ?? DEFAULT_BASE_URL);
|
|
1087
|
+
return Object.freeze({
|
|
1088
|
+
apiKey: resolveApiKey(options.apiKey),
|
|
1089
|
+
baseUrl,
|
|
1090
|
+
baseUrls: Object.freeze({ "modus-api": baseUrl, ...normalizeBaseUrls(options.baseUrls) }),
|
|
1091
|
+
timeoutMs: resolveTimeoutMs(options.timeoutMs) ?? DEFAULT_TIMEOUT_MS,
|
|
1092
|
+
maxRetries,
|
|
1093
|
+
fetch: options.fetch ?? globalThis.fetch.bind(globalThis)
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
function resolveServiceBaseUrl(config, service, generatedBaseUrl) {
|
|
1097
|
+
return config.baseUrls[service] ?? generatedBaseUrl ?? config.baseUrl;
|
|
1098
|
+
}
|
|
1099
|
+
function formatConfigForLog(config) {
|
|
1100
|
+
const masked = config.apiKey.length > 10 ? `${config.apiKey.slice(0, 10)}***` : "***";
|
|
1101
|
+
return `ModusConfig(apiKey=${JSON.stringify(masked)}, baseUrl=${JSON.stringify(config.baseUrl)}, timeoutMs=${config.timeoutMs}, maxRetries=${config.maxRetries})`;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
// src/_http.ts
|
|
1105
|
+
var USER_AGENT = `modus-typescript/${"0.1.0"} (node/${process.version}; ${process.platform})`;
|
|
1106
|
+
function buildUrl(baseUrl, path, params) {
|
|
1107
|
+
const url = new URL(path.startsWith("/") ? path : `/${path}`, baseUrl);
|
|
1108
|
+
if (params) {
|
|
1109
|
+
for (const [key, value] of Object.entries(params)) {
|
|
1110
|
+
if (value === void 0 || value === null) continue;
|
|
1111
|
+
if (Array.isArray(value)) {
|
|
1112
|
+
for (const item of value) url.searchParams.append(key, String(item));
|
|
1113
|
+
} else {
|
|
1114
|
+
url.searchParams.set(key, String(value));
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
return url.toString();
|
|
1119
|
+
}
|
|
1120
|
+
function headersToRecord(headers) {
|
|
1121
|
+
const out = {};
|
|
1122
|
+
headers.forEach((value, key) => {
|
|
1123
|
+
out[key] = value;
|
|
1124
|
+
});
|
|
1125
|
+
return out;
|
|
1126
|
+
}
|
|
1127
|
+
function messageFromBody(raw, statusCode) {
|
|
1128
|
+
if (!raw) return `HTTP ${statusCode}`;
|
|
1129
|
+
try {
|
|
1130
|
+
const body = JSON.parse(raw);
|
|
1131
|
+
if (body && typeof body === "object") {
|
|
1132
|
+
const record = body;
|
|
1133
|
+
const envelope = record.error;
|
|
1134
|
+
if (envelope && typeof envelope === "object") {
|
|
1135
|
+
const msg2 = envelope.message;
|
|
1136
|
+
if (typeof msg2 === "string" && msg2) return msg2;
|
|
1137
|
+
}
|
|
1138
|
+
const msg = record.message ?? record.error;
|
|
1139
|
+
if (Array.isArray(msg)) return msg.map(String).join("; ");
|
|
1140
|
+
if (typeof msg === "string" && msg) return msg;
|
|
1141
|
+
}
|
|
1142
|
+
} catch {
|
|
1143
|
+
}
|
|
1144
|
+
return raw;
|
|
1145
|
+
}
|
|
1146
|
+
function errorCodeFromBody(raw) {
|
|
1147
|
+
try {
|
|
1148
|
+
const body = JSON.parse(raw);
|
|
1149
|
+
return typeof body.error?.code === "string" ? body.error.code : void 0;
|
|
1150
|
+
} catch {
|
|
1151
|
+
return void 0;
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
function raiseForStatus(response, body) {
|
|
1155
|
+
if (response.ok) return;
|
|
1156
|
+
const message = messageFromBody(body, response.status);
|
|
1157
|
+
const requestId = response.headers.get("x-request-id") ?? response.headers.get("X-Request-ID") ?? void 0;
|
|
1158
|
+
const headers = headersToRecord(response.headers);
|
|
1159
|
+
const code = errorCodeFromBody(body);
|
|
1160
|
+
const base = { requestId, responseHeaders: headers, body, code };
|
|
1161
|
+
switch (response.status) {
|
|
1162
|
+
case 401:
|
|
1163
|
+
throw new AuthenticationError(message, base);
|
|
1164
|
+
case 403:
|
|
1165
|
+
throw new PermissionDeniedError(message, base);
|
|
1166
|
+
case 404:
|
|
1167
|
+
throw new NotFoundError(message, base);
|
|
1168
|
+
case 409:
|
|
1169
|
+
throw new ConflictError(message, base);
|
|
1170
|
+
case 422: {
|
|
1171
|
+
let errors;
|
|
1172
|
+
try {
|
|
1173
|
+
errors = JSON.parse(body);
|
|
1174
|
+
} catch {
|
|
1175
|
+
errors = void 0;
|
|
1176
|
+
}
|
|
1177
|
+
throw new UnprocessableError(message, { ...base, errors });
|
|
1178
|
+
}
|
|
1179
|
+
case 429: {
|
|
1180
|
+
const retryHeader = response.headers.get("retry-after") ?? "";
|
|
1181
|
+
const retryAfter = /^\d+$/.test(retryHeader) ? Number.parseInt(retryHeader, 10) : void 0;
|
|
1182
|
+
throw new RateLimitError(message, { ...base, retryAfter });
|
|
1183
|
+
}
|
|
1184
|
+
default:
|
|
1185
|
+
if (response.status >= 500) {
|
|
1186
|
+
throw new InternalServerError(message, response.status, base);
|
|
1187
|
+
}
|
|
1188
|
+
throw new ModusError(message, { ...base, statusCode: response.status });
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
function wrapNetworkError(error, baseUrl) {
|
|
1192
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
1193
|
+
return new APIConnectionError(
|
|
1194
|
+
`Network error communicating with Modus API at ${JSON.stringify(baseUrl)}: ${detail}. Check connectivity and that baseUrl is correct.`
|
|
1195
|
+
);
|
|
1196
|
+
}
|
|
1197
|
+
async function readBody(response) {
|
|
1198
|
+
return response.text();
|
|
1199
|
+
}
|
|
1200
|
+
var HttpClient = class {
|
|
1201
|
+
constructor(config) {
|
|
1202
|
+
this.config = config;
|
|
1203
|
+
}
|
|
1204
|
+
defaultHeaders() {
|
|
1205
|
+
return {
|
|
1206
|
+
...authHeaders(this.config.apiKey),
|
|
1207
|
+
Accept: "application/json",
|
|
1208
|
+
"Content-Type": "application/json",
|
|
1209
|
+
"User-Agent": USER_AGENT
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
async request(method, path, options = {}) {
|
|
1213
|
+
const baseUrl = options.baseUrl ?? this.config.baseUrl;
|
|
1214
|
+
const url = buildUrl(baseUrl, path, options.params);
|
|
1215
|
+
try {
|
|
1216
|
+
const response = await this.config.fetch(url, {
|
|
1217
|
+
method,
|
|
1218
|
+
headers: { ...this.defaultHeaders(), ...options.headers },
|
|
1219
|
+
body: options.json !== void 0 ? JSON.stringify(options.json) : void 0,
|
|
1220
|
+
signal: AbortSignal.timeout(this.config.timeoutMs)
|
|
1221
|
+
});
|
|
1222
|
+
const body = await readBody(response);
|
|
1223
|
+
raiseForStatus(response, body);
|
|
1224
|
+
if (response.status === 204 || !body) return null;
|
|
1225
|
+
return JSON.parse(body);
|
|
1226
|
+
} catch (error) {
|
|
1227
|
+
if (error instanceof ModusError) throw error;
|
|
1228
|
+
if (error instanceof DOMException && error.name === "AbortError") {
|
|
1229
|
+
throw wrapNetworkError(new Error("Request timed out"), baseUrl);
|
|
1230
|
+
}
|
|
1231
|
+
throw wrapNetworkError(error, baseUrl);
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
get(path, params, options = {}) {
|
|
1235
|
+
return this.request("GET", path, { params, ...options });
|
|
1236
|
+
}
|
|
1237
|
+
post(path, json, options = {}) {
|
|
1238
|
+
return this.request("POST", path, { json, ...options });
|
|
1239
|
+
}
|
|
1240
|
+
patch(path, json, params, options = {}) {
|
|
1241
|
+
return this.request("PATCH", path, { json, params, ...options });
|
|
1242
|
+
}
|
|
1243
|
+
delete(path, options = {}) {
|
|
1244
|
+
return this.request("DELETE", path, options);
|
|
1245
|
+
}
|
|
1246
|
+
async *stream(method, path, options = {}) {
|
|
1247
|
+
const baseUrl = options.baseUrl ?? this.config.baseUrl;
|
|
1248
|
+
const url = buildUrl(baseUrl, path, options.params);
|
|
1249
|
+
try {
|
|
1250
|
+
const response = await this.config.fetch(url, {
|
|
1251
|
+
method,
|
|
1252
|
+
headers: { ...this.defaultHeaders(), ...options.headers },
|
|
1253
|
+
body: options.json !== void 0 ? JSON.stringify(options.json) : void 0,
|
|
1254
|
+
signal: AbortSignal.timeout(this.config.timeoutMs)
|
|
1255
|
+
});
|
|
1256
|
+
if (!response.ok) {
|
|
1257
|
+
const body = await readBody(response);
|
|
1258
|
+
raiseForStatus(response, body);
|
|
1259
|
+
return;
|
|
1260
|
+
}
|
|
1261
|
+
if (!response.body) return;
|
|
1262
|
+
const reader = response.body.getReader();
|
|
1263
|
+
const decoder = new TextDecoder();
|
|
1264
|
+
let buffer = "";
|
|
1265
|
+
while (true) {
|
|
1266
|
+
const { done, value } = await reader.read();
|
|
1267
|
+
if (done) break;
|
|
1268
|
+
buffer += decoder.decode(value, { stream: true });
|
|
1269
|
+
const lines = buffer.split("\n");
|
|
1270
|
+
buffer = lines.pop() ?? "";
|
|
1271
|
+
for (const line of lines) {
|
|
1272
|
+
if (line.trim()) yield line;
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
if (buffer.trim()) yield buffer;
|
|
1276
|
+
} catch (error) {
|
|
1277
|
+
if (error instanceof ModusError) throw error;
|
|
1278
|
+
if (error instanceof DOMException && error.name === "AbortError") {
|
|
1279
|
+
throw wrapNetworkError(new Error("Request timed out"), baseUrl);
|
|
1280
|
+
}
|
|
1281
|
+
throw wrapNetworkError(error, baseUrl);
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
streamGet(path, params, options = {}) {
|
|
1285
|
+
return this.stream("GET", path, { params, ...options });
|
|
1286
|
+
}
|
|
1287
|
+
streamPost(path, json, options = {}) {
|
|
1288
|
+
return this.stream("POST", path, { json, ...options });
|
|
1289
|
+
}
|
|
1290
|
+
};
|
|
1291
|
+
|
|
1292
|
+
// src/_client-base.ts
|
|
1293
|
+
var ModusClientBase = class {
|
|
1294
|
+
constructor(options = {}) {
|
|
1295
|
+
this._config = createModusConfig(options);
|
|
1296
|
+
this._http = new HttpClient(this._config);
|
|
1297
|
+
}
|
|
1298
|
+
get config() {
|
|
1299
|
+
return this._config;
|
|
1300
|
+
}
|
|
1301
|
+
/** @internal */
|
|
1302
|
+
get http() {
|
|
1303
|
+
return this._http;
|
|
1304
|
+
}
|
|
1305
|
+
toString() {
|
|
1306
|
+
return formatConfigForLog(this._config);
|
|
1307
|
+
}
|
|
1308
|
+
};
|
|
1309
|
+
|
|
1310
|
+
// src/_generated/write-body-keys.ts
|
|
1311
|
+
var WRITE_BODY_ALLOWED_KEYS = {
|
|
1312
|
+
ContextCreatorsController_createLink: ["url", "title", "isCrawl", "pageLimit"],
|
|
1313
|
+
ContextCreatorsController_createNote: ["title", "content"],
|
|
1314
|
+
ContextCreatorsController_createSavedQuery: ["name", "connectionId", "query", "description", "path"],
|
|
1315
|
+
ContextItemsController_lookup: ["contextType", "dataPath", "contentProjection"],
|
|
1316
|
+
ContextItemsController_update: ["contextType", "content", "description", "userFeedback", "topics"],
|
|
1317
|
+
CustomContextItemsController_batchCreate: ["items"],
|
|
1318
|
+
CustomContextItemsController_create: ["kind", "sourceId", "sourceName", "collectionId", "collectionName", "externalId", "fieldName", "name", "entityType", "description", "content", "url", "attributes", "dataType", "value", "samples", "raw", "topics", "idempotencyKey", "access"],
|
|
1319
|
+
CustomContextItemsController_update: ["name", "entityType", "description", "content", "url", "attributes", "dataType", "value", "samples", "raw", "topics"],
|
|
1320
|
+
EvaluationsController_updateConfig: ["enabled", "cadence", "judgeModel", "judgeGuidance", "notifications"],
|
|
1321
|
+
ModusChatController_chat: ["message", "model"],
|
|
1322
|
+
ModusContextController_compose: ["message", "limit"],
|
|
1323
|
+
ModusRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId", "subordinateSkillIds"],
|
|
1324
|
+
ResumeRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId", "decision"],
|
|
1325
|
+
RunLifecycleController_activeBySession: ["sessionIds"],
|
|
1326
|
+
RunLifecycleController_cancel: [],
|
|
1327
|
+
RunLifecycleController_editQueued: [],
|
|
1328
|
+
RunLifecycleController_interrupt: [],
|
|
1329
|
+
ScopeChatController_chat: ["message", "model"],
|
|
1330
|
+
ScopeContextController_compose: ["message", "limit"],
|
|
1331
|
+
ScopeMemoriesController_search: ["query", "userId", "limit"],
|
|
1332
|
+
ScopeMemoriesController_update: ["memory", "metadata"],
|
|
1333
|
+
ScopeRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId", "subordinateSkillIds"],
|
|
1334
|
+
ScopesController_acceptOwnershipTransfer: [],
|
|
1335
|
+
ScopesController_create: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "interfaces", "accessConfig"],
|
|
1336
|
+
ScopesController_deploy: [],
|
|
1337
|
+
ScopesController_patchMcpConfig: ["config"],
|
|
1338
|
+
ScopesController_requestOwnershipTransfer: ["newOwnerUserId"],
|
|
1339
|
+
ScopesController_restore: [],
|
|
1340
|
+
ScopesController_update: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "interfaces", "accessConfig", "managerId", "evaluations", "supervisionSubordinateDescriptions"],
|
|
1341
|
+
ScopeSupervisionController_set: ["subordinateAgentIds"],
|
|
1342
|
+
ScopeSupervisionController_setActive: ["subordinateAgentIds"],
|
|
1343
|
+
SuggestionsController_recordEvent: ["event_type", "source", "skill_id", "thread_id", "metadata"],
|
|
1344
|
+
WorkflowActionsController_cancel: [],
|
|
1345
|
+
WorkflowActionsController_execute: ["organizationId", "sessionId", "fileThreadId", "workflowAction", "previousOutputs", "userTimezone", "runId", "automationId", "source"],
|
|
1346
|
+
WorkflowInterfacesController_add: ["type", "name", "config"],
|
|
1347
|
+
WorkflowInterfacesController_update: ["name", "config"],
|
|
1348
|
+
WorkflowRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId"],
|
|
1349
|
+
WorkflowsController_acceptOwnershipTransfer: [],
|
|
1350
|
+
WorkflowsController_create: ["name", "type", "description", "trigger", "agentSelection", "workflowStructure", "accessConfig"],
|
|
1351
|
+
WorkflowsController_deploy: [],
|
|
1352
|
+
WorkflowsController_requestOwnershipTransfer: ["newOwnerUserId"],
|
|
1353
|
+
WorkflowsController_restore: [],
|
|
1354
|
+
WorkflowsController_toggle: ["active"],
|
|
1355
|
+
WorkflowsController_update: ["name", "type", "description", "trigger", "agentSelection", "workflowStructure", "accessConfig"]
|
|
1356
|
+
};
|
|
1357
|
+
|
|
1358
|
+
// src/_validation.ts
|
|
1359
|
+
var DEFAULT_MAX_PAGE_SIZE = 200;
|
|
1360
|
+
function validatePageSize(pageSize, maxPageSize) {
|
|
1361
|
+
if (!Number.isInteger(pageSize) || pageSize < 1) {
|
|
1362
|
+
throw new Error(`page_size must be a positive int, got ${pageSize}`);
|
|
1363
|
+
}
|
|
1364
|
+
if (maxPageSize !== void 0 && pageSize > maxPageSize) {
|
|
1365
|
+
throw new Error(`page_size must be <= ${maxPageSize}, got ${pageSize}`);
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
function validateId(resourceId, name = "id") {
|
|
1369
|
+
if (typeof resourceId === "string" && !resourceId.trim()) {
|
|
1370
|
+
throw new Error(`${name} must be a non-empty string or int`);
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
var ALLOWED_CHAT_MODELS = /* @__PURE__ */ new Set([
|
|
1374
|
+
"claude-sonnet-5",
|
|
1375
|
+
"claude-sonnet-4.6",
|
|
1376
|
+
"claude-opus-4.8",
|
|
1377
|
+
"gpt-5.2",
|
|
1378
|
+
"gpt-5.5",
|
|
1379
|
+
"gpt-5-mini",
|
|
1380
|
+
"gpt-oss-120b",
|
|
1381
|
+
"gpt-oss-20b",
|
|
1382
|
+
"qwen3-235b-a22b-2507",
|
|
1383
|
+
"qwen3-coder",
|
|
1384
|
+
"qwen3-32b",
|
|
1385
|
+
"deepseek-chat-v3.1",
|
|
1386
|
+
"minimax-m2.7",
|
|
1387
|
+
"llama-4-maverick",
|
|
1388
|
+
"llama-4-scout",
|
|
1389
|
+
"llama-3.3-70b-instruct",
|
|
1390
|
+
"gemini-3.1-pro-preview",
|
|
1391
|
+
"gemini-3-flash-preview",
|
|
1392
|
+
"grok-4.3-fast",
|
|
1393
|
+
"grok-4.3"
|
|
1394
|
+
]);
|
|
1395
|
+
function validateChatModel(model) {
|
|
1396
|
+
if (!ALLOWED_CHAT_MODELS.has(model)) {
|
|
1397
|
+
const supported = [...ALLOWED_CHAT_MODELS].sort().join(", ");
|
|
1398
|
+
throw new Error(`Unsupported model ${JSON.stringify(model)}. Choose one of: ${supported}.`);
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
function assertWriteBodyKeys(operationId, body) {
|
|
1402
|
+
const allowed = WRITE_BODY_ALLOWED_KEYS[operationId];
|
|
1403
|
+
if (allowed === void 0) return;
|
|
1404
|
+
if (body === void 0 || body === null) return;
|
|
1405
|
+
if (typeof body !== "object" || Array.isArray(body)) {
|
|
1406
|
+
throw new ValidationError(`Request body must be a plain object for ${operationId}`);
|
|
1407
|
+
}
|
|
1408
|
+
const allowedSet = new Set(allowed);
|
|
1409
|
+
const extra = Object.keys(body).filter((k) => !allowedSet.has(k));
|
|
1410
|
+
if (extra.length > 0) {
|
|
1411
|
+
throw new ValidationError(
|
|
1412
|
+
`${operationId}: disallowed request body field(s): ${extra.sort().join(", ")}`
|
|
1413
|
+
);
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
// src/_openapi-invoke.ts
|
|
1418
|
+
function getOperation(operationId) {
|
|
1419
|
+
if (!(operationId in OPERATIONS)) {
|
|
1420
|
+
throw new Error(
|
|
1421
|
+
`Unknown API operation ${JSON.stringify(operationId)}. Upgrade @getmodus/sdk or report a version mismatch.`
|
|
1422
|
+
);
|
|
1423
|
+
}
|
|
1424
|
+
return OPERATIONS[operationId];
|
|
1425
|
+
}
|
|
1426
|
+
function formatPath(template, pathParams) {
|
|
1427
|
+
return template.split("/").map((segment) => {
|
|
1428
|
+
if (!segment.startsWith("{") || !segment.endsWith("}")) return segment;
|
|
1429
|
+
const key = segment.slice(1, -1);
|
|
1430
|
+
if (!(key in pathParams)) {
|
|
1431
|
+
throw new Error(`Missing path parameter ${JSON.stringify(key)} for ${JSON.stringify(template)}`);
|
|
1432
|
+
}
|
|
1433
|
+
return encodeURIComponent(String(pathParams[key]));
|
|
1434
|
+
}).join("/");
|
|
1435
|
+
}
|
|
1436
|
+
function operationBaseUrl(http, operation) {
|
|
1437
|
+
return resolveServiceBaseUrl(http.config, operation.service, operation.serverUrl);
|
|
1438
|
+
}
|
|
1439
|
+
function formatOperationPath(operationId, pathParams = {}) {
|
|
1440
|
+
return formatPath(getOperation(operationId).path, pathParams);
|
|
1441
|
+
}
|
|
1442
|
+
async function invokeOperation(http, operationId, options = {}) {
|
|
1443
|
+
const op = getOperation(operationId);
|
|
1444
|
+
const path = formatPath(op.path, options.pathParams ?? {});
|
|
1445
|
+
const params = options.query;
|
|
1446
|
+
const requestOptions = {
|
|
1447
|
+
baseUrl: operationBaseUrl(http, op),
|
|
1448
|
+
headers: options.headers
|
|
1449
|
+
};
|
|
1450
|
+
switch (op.method) {
|
|
1451
|
+
case "GET":
|
|
1452
|
+
return http.get(path, params, requestOptions);
|
|
1453
|
+
case "POST":
|
|
1454
|
+
return http.post(path, options.jsonBody, requestOptions);
|
|
1455
|
+
case "PATCH":
|
|
1456
|
+
return http.patch(path, options.jsonBody, params, requestOptions);
|
|
1457
|
+
case "DELETE":
|
|
1458
|
+
return http.delete(path, requestOptions);
|
|
1459
|
+
default:
|
|
1460
|
+
throw new Error(`Unsupported HTTP method ${JSON.stringify(op.method)}`);
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
// src/_retry.ts
|
|
1465
|
+
var DEPLOY_NOT_FOUND_BACKOFF_MS = 500;
|
|
1466
|
+
var MAX_DEPLOY_NOT_FOUND_RETRIES = 1;
|
|
1467
|
+
var RETRYABLE = [RateLimitError, InternalServerError, APIConnectionError];
|
|
1468
|
+
function isRetryable(error) {
|
|
1469
|
+
return RETRYABLE.some((Cls) => error instanceof Cls);
|
|
1470
|
+
}
|
|
1471
|
+
function backoffSeconds(attempt, error) {
|
|
1472
|
+
if (error instanceof RateLimitError && error.retryAfter !== void 0) {
|
|
1473
|
+
return Math.max(0, error.retryAfter);
|
|
1474
|
+
}
|
|
1475
|
+
if (attempt === 0) return 0;
|
|
1476
|
+
return Math.max(0.5, 2 ** (attempt - 1) + (Math.random() * 0.6 - 0.3));
|
|
1477
|
+
}
|
|
1478
|
+
function sleep(ms) {
|
|
1479
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1480
|
+
}
|
|
1481
|
+
async function withRetry(fn, maxRetries, options = {}) {
|
|
1482
|
+
let deployNotFoundRetries = 0;
|
|
1483
|
+
let attempt = 0;
|
|
1484
|
+
while (true) {
|
|
1485
|
+
try {
|
|
1486
|
+
return await fn();
|
|
1487
|
+
} catch (error) {
|
|
1488
|
+
if (options.retryNotFoundOnDeploy && error instanceof NotFoundError && deployNotFoundRetries < MAX_DEPLOY_NOT_FOUND_RETRIES) {
|
|
1489
|
+
deployNotFoundRetries++;
|
|
1490
|
+
await sleep(DEPLOY_NOT_FOUND_BACKOFF_MS);
|
|
1491
|
+
continue;
|
|
1492
|
+
}
|
|
1493
|
+
if (!isRetryable(error) || attempt >= maxRetries) throw error;
|
|
1494
|
+
await sleep(backoffSeconds(attempt, error) * 1e3);
|
|
1495
|
+
attempt++;
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
// src/_request.ts
|
|
1501
|
+
async function invokeWithRetry(config, http, operationId, options = {}) {
|
|
1502
|
+
if (options.jsonBody !== void 0) {
|
|
1503
|
+
assertWriteBodyKeys(operationId, options.jsonBody);
|
|
1504
|
+
}
|
|
1505
|
+
return withRetry(() => invokeOperation(http, operationId, options), config.maxRetries, {
|
|
1506
|
+
retryNotFoundOnDeploy: operationId.endsWith("_deploy")
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1509
|
+
function omitUndefined(obj) {
|
|
1510
|
+
return Object.fromEntries(
|
|
1511
|
+
Object.entries(obj).filter((entry) => entry[1] !== void 0)
|
|
1512
|
+
);
|
|
1513
|
+
}
|
|
1514
|
+
function asRecord(data) {
|
|
1515
|
+
if (typeof data === "object" && data !== null && !Array.isArray(data)) {
|
|
1516
|
+
return data;
|
|
1517
|
+
}
|
|
1518
|
+
throw new Error(`Expected object response, got ${typeof data}`);
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
// src/resources/context/custom-items.ts
|
|
1522
|
+
function parseContextItem(raw) {
|
|
1523
|
+
return raw;
|
|
1524
|
+
}
|
|
1525
|
+
function parseCreatedCustomContextItem(raw) {
|
|
1526
|
+
return raw;
|
|
1527
|
+
}
|
|
1528
|
+
function parseDeletion(raw) {
|
|
1529
|
+
return raw;
|
|
1530
|
+
}
|
|
1531
|
+
var CustomContextItemsResource = class {
|
|
1532
|
+
constructor(http, config) {
|
|
1533
|
+
this.http = http;
|
|
1534
|
+
this.config = config;
|
|
1535
|
+
}
|
|
1536
|
+
list(options = {}) {
|
|
1537
|
+
const pageSize = options.pageSize ?? 25;
|
|
1538
|
+
validatePageSize(pageSize);
|
|
1539
|
+
return this.listPage(pageSize, options.pageToken, options);
|
|
1540
|
+
}
|
|
1541
|
+
async listPage(pageSize, pageToken, options) {
|
|
1542
|
+
const data = asRecord(
|
|
1543
|
+
await invokeWithRetry(this.config, this.http, "CustomContextItemsController_list", {
|
|
1544
|
+
query: aipListParams(pageSize, pageToken, {
|
|
1545
|
+
searchQuery: options.searchQuery,
|
|
1546
|
+
topics: options.topics
|
|
1547
|
+
})
|
|
1548
|
+
})
|
|
1549
|
+
);
|
|
1550
|
+
return buildAipPage(
|
|
1551
|
+
data,
|
|
1552
|
+
"contextItems",
|
|
1553
|
+
parseContextItem,
|
|
1554
|
+
(token) => this.listPage(pageSize, token, options)
|
|
1555
|
+
);
|
|
1556
|
+
}
|
|
1557
|
+
async get(uid) {
|
|
1558
|
+
return parseContextItem(
|
|
1559
|
+
await invokeWithRetry(this.config, this.http, "CustomContextItemsController_get", {
|
|
1560
|
+
pathParams: { uid }
|
|
1561
|
+
})
|
|
1562
|
+
);
|
|
1563
|
+
}
|
|
1564
|
+
async create(input) {
|
|
1565
|
+
return parseCreatedCustomContextItem(
|
|
1566
|
+
await invokeWithRetry(this.config, this.http, "CustomContextItemsController_create", {
|
|
1567
|
+
jsonBody: omitUndefined(input)
|
|
1568
|
+
})
|
|
1569
|
+
);
|
|
1570
|
+
}
|
|
1571
|
+
async batchCreate(inputs) {
|
|
1572
|
+
const data = asRecord(
|
|
1573
|
+
await invokeWithRetry(this.config, this.http, "CustomContextItemsController_batchCreate", {
|
|
1574
|
+
jsonBody: {
|
|
1575
|
+
items: inputs.map((input) => omitUndefined(input))
|
|
1576
|
+
}
|
|
1577
|
+
})
|
|
1578
|
+
);
|
|
1579
|
+
const items = data.contextItems;
|
|
1580
|
+
return Array.isArray(items) ? items.map(parseCreatedCustomContextItem) : [];
|
|
1581
|
+
}
|
|
1582
|
+
async update(uid, input) {
|
|
1583
|
+
return asRecord(
|
|
1584
|
+
await invokeWithRetry(this.config, this.http, "CustomContextItemsController_update", {
|
|
1585
|
+
pathParams: { uid },
|
|
1586
|
+
jsonBody: omitUndefined(input)
|
|
1587
|
+
})
|
|
1588
|
+
);
|
|
1589
|
+
}
|
|
1590
|
+
async delete(uid) {
|
|
1591
|
+
return parseDeletion(
|
|
1592
|
+
await invokeWithRetry(this.config, this.http, "CustomContextItemsController_delete", {
|
|
1593
|
+
pathParams: { uid }
|
|
1594
|
+
})
|
|
1595
|
+
);
|
|
1596
|
+
}
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
// src/resources/skills/conversations.ts
|
|
1600
|
+
function parseListItem(raw) {
|
|
1601
|
+
return raw;
|
|
1602
|
+
}
|
|
1603
|
+
function parseConversation(raw) {
|
|
1604
|
+
return raw;
|
|
1605
|
+
}
|
|
1606
|
+
var ScopeConversationsResource = class {
|
|
1607
|
+
constructor(http, config, scopeId) {
|
|
1608
|
+
this.http = http;
|
|
1609
|
+
this.config = config;
|
|
1610
|
+
this.scopeId = scopeId;
|
|
1611
|
+
}
|
|
1612
|
+
list(options = {}) {
|
|
1613
|
+
const pageSize = options.pageSize ?? 25;
|
|
1614
|
+
validatePageSize(pageSize);
|
|
1615
|
+
return this.listPage(pageSize, options.pageToken);
|
|
1616
|
+
}
|
|
1617
|
+
async listPage(pageSize, pageToken) {
|
|
1618
|
+
validateId(this.scopeId, "scope_id");
|
|
1619
|
+
const data = asRecord(
|
|
1620
|
+
await invokeWithRetry(this.config, this.http, "ScopeConversationsController_list", {
|
|
1621
|
+
pathParams: { id: this.scopeId },
|
|
1622
|
+
query: aipListParams(pageSize, pageToken)
|
|
1623
|
+
})
|
|
1624
|
+
);
|
|
1625
|
+
return buildAipPage(
|
|
1626
|
+
data,
|
|
1627
|
+
"conversations",
|
|
1628
|
+
parseListItem,
|
|
1629
|
+
(token) => this.listPage(pageSize, token)
|
|
1630
|
+
);
|
|
1631
|
+
}
|
|
1632
|
+
async get(threadId, options = {}) {
|
|
1633
|
+
validateId(this.scopeId, "scope_id");
|
|
1634
|
+
validateId(threadId, "thread_id");
|
|
1635
|
+
if (options.beforeMessageIndex !== void 0 && options.messageLimit === void 0) {
|
|
1636
|
+
throw new Error("beforeMessageIndex requires messageLimit");
|
|
1637
|
+
}
|
|
1638
|
+
const data = await invokeWithRetry(this.config, this.http, "ScopeConversationsController_get", {
|
|
1639
|
+
pathParams: { id: this.scopeId, threadId },
|
|
1640
|
+
query: {
|
|
1641
|
+
messageLimit: options.messageLimit,
|
|
1642
|
+
beforeMessageIndex: options.beforeMessageIndex
|
|
1643
|
+
}
|
|
1644
|
+
});
|
|
1645
|
+
return parseConversation(data);
|
|
1646
|
+
}
|
|
1647
|
+
};
|
|
1648
|
+
|
|
1649
|
+
export {
|
|
1650
|
+
OPERATIONS,
|
|
1651
|
+
ModusError,
|
|
1652
|
+
APIConnectionError,
|
|
1653
|
+
AuthenticationError,
|
|
1654
|
+
PermissionDeniedError,
|
|
1655
|
+
NotFoundError,
|
|
1656
|
+
ConflictError,
|
|
1657
|
+
UnprocessableError,
|
|
1658
|
+
RateLimitError,
|
|
1659
|
+
InternalServerError,
|
|
1660
|
+
RunCancelledError,
|
|
1661
|
+
StreamTimeoutError,
|
|
1662
|
+
ValidationError,
|
|
1663
|
+
DEFAULT_MAX_PAGE_SIZE,
|
|
1664
|
+
validatePageSize,
|
|
1665
|
+
validateId,
|
|
1666
|
+
validateChatModel,
|
|
1667
|
+
Page,
|
|
1668
|
+
normalizePageToken,
|
|
1669
|
+
aipListParams,
|
|
1670
|
+
buildAipPage,
|
|
1671
|
+
ModusClientBase,
|
|
1672
|
+
getOperation,
|
|
1673
|
+
operationBaseUrl,
|
|
1674
|
+
formatOperationPath,
|
|
1675
|
+
invokeWithRetry,
|
|
1676
|
+
omitUndefined,
|
|
1677
|
+
asRecord,
|
|
1678
|
+
CustomContextItemsResource,
|
|
1679
|
+
ScopeConversationsResource
|
|
1680
|
+
};
|
|
1681
|
+
//# sourceMappingURL=chunk-VLHNZJBG.js.map
|