@getmodus/sdk 0.6.0 → 0.8.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.
@@ -40,6 +40,26 @@ var OPERATIONS = {
40
40
  requestSchema: "CreateSavedQueryDto",
41
41
  responseSchema: "CreatedContextItemResponseDto"
42
42
  },
43
+ "ContextFilesController_finalize": {
44
+ method: "POST",
45
+ path: "/api/v1/context/files/{uploadId}/finalize",
46
+ service: "modus-api",
47
+ serverUrl: "https://api.getmodus.com",
48
+ pathParams: ["uploadId"],
49
+ queryParams: [],
50
+ requestSchema: "FinalizeUploadDto",
51
+ responseSchema: "FileUploadResourceDto"
52
+ },
53
+ "ContextFilesController_finalizeMany": {
54
+ method: "POST",
55
+ path: "/api/v1/context/files/finalize",
56
+ service: "modus-api",
57
+ serverUrl: "https://api.getmodus.com",
58
+ pathParams: [],
59
+ queryParams: [],
60
+ requestSchema: "BulkFinalizeDto",
61
+ responseSchema: "BulkFinalizeResponseDto"
62
+ },
43
63
  "ContextFilesController_get": {
44
64
  method: "GET",
45
65
  path: "/api/v1/context/files/{uploadId}",
@@ -126,7 +146,7 @@ var OPERATIONS = {
126
146
  service: "modus-api",
127
147
  serverUrl: "https://api.getmodus.com",
128
148
  pathParams: [],
129
- queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics"],
149
+ queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics", "connectionIds", "parentUids", "ancestorUids"],
130
150
  requestSchema: null,
131
151
  responseSchema: "ListContextItemsResponseDto"
132
152
  },
@@ -150,6 +170,16 @@ var OPERATIONS = {
150
170
  requestSchema: "LookupContextItemDto",
151
171
  responseSchema: "LookupContextItemResponseDto"
152
172
  },
173
+ "ContextItemsController_move": {
174
+ method: "POST",
175
+ path: "/api/v1/context/items/{uid}/move",
176
+ service: "modus-api",
177
+ serverUrl: "https://api.getmodus.com",
178
+ pathParams: ["uid"],
179
+ queryParams: [],
180
+ requestSchema: "MoveContextItemDto",
181
+ responseSchema: "MoveContextItemResponseDto"
182
+ },
153
183
  "ContextItemsController_update": {
154
184
  method: "PATCH",
155
185
  path: "/api/v1/context/items/{uid}",
@@ -180,6 +210,16 @@ var OPERATIONS = {
180
210
  requestSchema: "CreateCustomContextItemDto",
181
211
  responseSchema: "CreatedCustomContextItemResponseDto"
182
212
  },
213
+ "CustomContextItemsController_createRelations": {
214
+ method: "POST",
215
+ path: "/api/v1/context/custom-items/relations",
216
+ service: "modus-api",
217
+ serverUrl: "https://api.getmodus.com",
218
+ pathParams: [],
219
+ queryParams: [],
220
+ requestSchema: "BatchCreateCustomContextItemRelationsDto",
221
+ responseSchema: "BatchCreateCustomContextItemRelationsResponseDto"
222
+ },
183
223
  "CustomContextItemsController_delete": {
184
224
  method: "DELETE",
185
225
  path: "/api/v1/context/custom-items/{uid}",
@@ -220,6 +260,196 @@ var OPERATIONS = {
220
260
  requestSchema: "UpdateCustomContextItemDto",
221
261
  responseSchema: null
222
262
  },
263
+ "DashboardsController_acceptOwnership": {
264
+ method: "POST",
265
+ path: "/api/v1/context/dashboards/{dashboardId}/transfer-ownership/accept",
266
+ service: "modus-api",
267
+ serverUrl: "https://api.getmodus.com",
268
+ pathParams: ["dashboardId"],
269
+ queryParams: [],
270
+ requestSchema: null,
271
+ responseSchema: "DashboardDto"
272
+ },
273
+ "DashboardsController_cancelOwnership": {
274
+ method: "DELETE",
275
+ path: "/api/v1/context/dashboards/{dashboardId}/transfer-ownership",
276
+ service: "modus-api",
277
+ serverUrl: "https://api.getmodus.com",
278
+ pathParams: ["dashboardId"],
279
+ queryParams: [],
280
+ requestSchema: null,
281
+ responseSchema: "DashboardDto"
282
+ },
283
+ "DashboardsController_create": {
284
+ method: "POST",
285
+ path: "/api/v1/context/dashboards",
286
+ service: "modus-api",
287
+ serverUrl: "https://api.getmodus.com",
288
+ pathParams: [],
289
+ queryParams: [],
290
+ requestSchema: "CreateDashboardDto",
291
+ responseSchema: "DashboardDto"
292
+ },
293
+ "DashboardsController_createElement": {
294
+ method: "POST",
295
+ path: "/api/v1/context/dashboards/{dashboardId}/elements",
296
+ service: "modus-api",
297
+ serverUrl: "https://api.getmodus.com",
298
+ pathParams: ["dashboardId"],
299
+ queryParams: [],
300
+ requestSchema: "CreateDashboardElementDto",
301
+ responseSchema: "DashboardElementResponseDto"
302
+ },
303
+ "DashboardsController_delete": {
304
+ method: "DELETE",
305
+ path: "/api/v1/context/dashboards/{dashboardId}",
306
+ service: "modus-api",
307
+ serverUrl: "https://api.getmodus.com",
308
+ pathParams: ["dashboardId"],
309
+ queryParams: [],
310
+ requestSchema: null,
311
+ responseSchema: null
312
+ },
313
+ "DashboardsController_get": {
314
+ method: "GET",
315
+ path: "/api/v1/context/dashboards/{dashboardId}",
316
+ service: "modus-api",
317
+ serverUrl: "https://api.getmodus.com",
318
+ pathParams: ["dashboardId"],
319
+ queryParams: ["view"],
320
+ requestSchema: null,
321
+ responseSchema: "DashboardDto"
322
+ },
323
+ "DashboardsController_getElement": {
324
+ method: "GET",
325
+ path: "/api/v1/context/dashboards/{dashboardId}/elements/{elementId}",
326
+ service: "modus-api",
327
+ serverUrl: "https://api.getmodus.com",
328
+ pathParams: ["dashboardId", "elementId"],
329
+ queryParams: [],
330
+ requestSchema: null,
331
+ responseSchema: "DashboardElementResponseDto"
332
+ },
333
+ "DashboardsController_getVersion": {
334
+ method: "GET",
335
+ path: "/api/v1/context/dashboards/{dashboardId}/versions/{versionId}",
336
+ service: "modus-api",
337
+ serverUrl: "https://api.getmodus.com",
338
+ pathParams: ["dashboardId", "versionId"],
339
+ queryParams: [],
340
+ requestSchema: null,
341
+ responseSchema: "DashboardDto"
342
+ },
343
+ "DashboardsController_list": {
344
+ method: "GET",
345
+ path: "/api/v1/context/dashboards",
346
+ service: "modus-api",
347
+ serverUrl: "https://api.getmodus.com",
348
+ pathParams: [],
349
+ queryParams: ["view"],
350
+ requestSchema: null,
351
+ responseSchema: "ListDashboardsResponseDto"
352
+ },
353
+ "DashboardsController_listDraftSnapshots": {
354
+ method: "GET",
355
+ path: "/api/v1/context/dashboards/{dashboardId}/draft-snapshots",
356
+ service: "modus-api",
357
+ serverUrl: "https://api.getmodus.com",
358
+ pathParams: ["dashboardId"],
359
+ queryParams: [],
360
+ requestSchema: null,
361
+ responseSchema: "ListDashboardDraftSnapshotsResponseDto"
362
+ },
363
+ "DashboardsController_listElements": {
364
+ method: "GET",
365
+ path: "/api/v1/context/dashboards/{dashboardId}/elements",
366
+ service: "modus-api",
367
+ serverUrl: "https://api.getmodus.com",
368
+ pathParams: ["dashboardId"],
369
+ queryParams: [],
370
+ requestSchema: null,
371
+ responseSchema: "DashboardElementsListResponseDto"
372
+ },
373
+ "DashboardsController_listVersions": {
374
+ method: "GET",
375
+ path: "/api/v1/context/dashboards/{dashboardId}/versions",
376
+ service: "modus-api",
377
+ serverUrl: "https://api.getmodus.com",
378
+ pathParams: ["dashboardId"],
379
+ queryParams: [],
380
+ requestSchema: null,
381
+ responseSchema: "ListDashboardVersionsResponseDto"
382
+ },
383
+ "DashboardsController_publish": {
384
+ method: "POST",
385
+ path: "/api/v1/context/dashboards/{dashboardId}/publish",
386
+ service: "modus-api",
387
+ serverUrl: "https://api.getmodus.com",
388
+ pathParams: ["dashboardId"],
389
+ queryParams: [],
390
+ requestSchema: "PublishDashboardDto",
391
+ responseSchema: "PublishDashboardResponseDto"
392
+ },
393
+ "DashboardsController_restore": {
394
+ method: "POST",
395
+ path: "/api/v1/context/dashboards/{dashboardId}/versions/{versionId}/restore",
396
+ service: "modus-api",
397
+ serverUrl: "https://api.getmodus.com",
398
+ pathParams: ["dashboardId", "versionId"],
399
+ queryParams: [],
400
+ requestSchema: null,
401
+ responseSchema: "DashboardDto"
402
+ },
403
+ "DashboardsController_transferOwnership": {
404
+ method: "POST",
405
+ path: "/api/v1/context/dashboards/{dashboardId}/transfer-ownership",
406
+ service: "modus-api",
407
+ serverUrl: "https://api.getmodus.com",
408
+ pathParams: ["dashboardId"],
409
+ queryParams: [],
410
+ requestSchema: "TransferDashboardOwnershipDto",
411
+ responseSchema: "DashboardDto"
412
+ },
413
+ "DashboardsController_updateAccess": {
414
+ method: "PATCH",
415
+ path: "/api/v1/context/dashboards/{dashboardId}/access",
416
+ service: "modus-api",
417
+ serverUrl: "https://api.getmodus.com",
418
+ pathParams: ["dashboardId"],
419
+ queryParams: [],
420
+ requestSchema: "UpdateDashboardAccessDto",
421
+ responseSchema: "DashboardDto"
422
+ },
423
+ "DashboardsController_updateDraft": {
424
+ method: "PATCH",
425
+ path: "/api/v1/context/dashboards/{dashboardId}/draft",
426
+ service: "modus-api",
427
+ serverUrl: "https://api.getmodus.com",
428
+ pathParams: ["dashboardId"],
429
+ queryParams: [],
430
+ requestSchema: "UpdateDashboardDraftDto",
431
+ responseSchema: "DashboardDto"
432
+ },
433
+ "DashboardsController_updateElement": {
434
+ method: "PATCH",
435
+ path: "/api/v1/context/dashboards/{dashboardId}/elements/{elementId}",
436
+ service: "modus-api",
437
+ serverUrl: "https://api.getmodus.com",
438
+ pathParams: ["dashboardId", "elementId"],
439
+ queryParams: [],
440
+ requestSchema: "UpdateDashboardElementDto",
441
+ responseSchema: "DashboardDto"
442
+ },
443
+ "DashboardsController_updateLayout": {
444
+ method: "PATCH",
445
+ path: "/api/v1/context/dashboards/{dashboardId}/layout",
446
+ service: "modus-api",
447
+ serverUrl: "https://api.getmodus.com",
448
+ pathParams: ["dashboardId"],
449
+ queryParams: [],
450
+ requestSchema: "UpdateDashboardLayoutDto",
451
+ responseSchema: "DashboardDto"
452
+ },
223
453
  "EvaluationsController_getConfig": {
224
454
  method: "GET",
225
455
  path: "/api/v1/scopes/{id}/evaluations/config",
@@ -270,6 +500,16 @@ var OPERATIONS = {
270
500
  requestSchema: "UpdateEvaluationConfigDto",
271
501
  responseSchema: "EvaluationConfigDto"
272
502
  },
503
+ "IngestedDataController_upload": {
504
+ method: "POST",
505
+ path: "/api/v1/ingested-data",
506
+ service: "modus-api",
507
+ serverUrl: "https://api.getmodus.com",
508
+ pathParams: [],
509
+ queryParams: [],
510
+ requestSchema: "CreateIngestedDataDto",
511
+ responseSchema: "CreatedIngestedDataResponseDto"
512
+ },
273
513
  "MemberGroupsController_list": {
274
514
  method: "GET",
275
515
  path: "/api/v1/users/member-groups",
@@ -326,7 +566,7 @@ var OPERATIONS = {
326
566
  service: "modus-api",
327
567
  serverUrl: "https://api.getmodus.com",
328
568
  pathParams: [],
329
- queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "source", "timeframe", "includeTools", "kind"],
569
+ queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "source", "sourceRef", "timeframe", "includeTools", "kind"],
330
570
  requestSchema: null,
331
571
  responseSchema: "ListConversationsResponseDto"
332
572
  },
@@ -476,10 +716,50 @@ var OPERATIONS = {
476
716
  service: "modus-api",
477
717
  serverUrl: "https://api.getmodus.com",
478
718
  pathParams: ["id"],
479
- queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "source", "timeframe", "includeTools"],
719
+ queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "source", "sourceRef", "timeframe", "includeTools"],
480
720
  requestSchema: null,
481
721
  responseSchema: "ListConversationsResponseDto"
482
722
  },
723
+ "ScopeInterfacesController_add": {
724
+ method: "POST",
725
+ path: "/api/v1/scopes/{id}/interfaces",
726
+ service: "modus-api",
727
+ serverUrl: "https://api.getmodus.com",
728
+ pathParams: ["id"],
729
+ queryParams: [],
730
+ requestSchema: "AddScopeInterfaceDto",
731
+ responseSchema: "ScopeInterfaceDto"
732
+ },
733
+ "ScopeInterfacesController_delete": {
734
+ method: "DELETE",
735
+ path: "/api/v1/scopes/{id}/interfaces/{interfaceId}",
736
+ service: "modus-api",
737
+ serverUrl: "https://api.getmodus.com",
738
+ pathParams: ["id", "interfaceId"],
739
+ queryParams: [],
740
+ requestSchema: null,
741
+ responseSchema: null
742
+ },
743
+ "ScopeInterfacesController_list": {
744
+ method: "GET",
745
+ path: "/api/v1/scopes/{id}/interfaces",
746
+ service: "modus-api",
747
+ serverUrl: "https://api.getmodus.com",
748
+ pathParams: ["id"],
749
+ queryParams: [],
750
+ requestSchema: null,
751
+ responseSchema: "ListScopeInterfacesResponseDto"
752
+ },
753
+ "ScopeInterfacesController_update": {
754
+ method: "PATCH",
755
+ path: "/api/v1/scopes/{id}/interfaces/{interfaceId}",
756
+ service: "modus-api",
757
+ serverUrl: "https://api.getmodus.com",
758
+ pathParams: ["id", "interfaceId"],
759
+ queryParams: ["updateMask"],
760
+ requestSchema: "UpdateScopeInterfaceDto",
761
+ responseSchema: "ScopeInterfaceDto"
762
+ },
483
763
  "ScopeMemoriesController_delete": {
484
764
  method: "DELETE",
485
765
  path: "/api/v1/scopes/{id}/memories/{memoryId}",
@@ -1214,6 +1494,7 @@ function createModusConfig(options = {}) {
1214
1494
  }),
1215
1495
  timeoutMs: resolveTimeoutMs(options.timeoutMs) ?? DEFAULT_TIMEOUT_MS,
1216
1496
  maxRetries,
1497
+ defaultHeaders: Object.freeze({ ...options.defaultHeaders }),
1217
1498
  fetch: options.fetch ?? globalThis.fetch.bind(globalThis)
1218
1499
  });
1219
1500
  }
@@ -1229,7 +1510,7 @@ function formatConfigForLog(config) {
1229
1510
  }
1230
1511
 
1231
1512
  // src/_http.ts
1232
- var USER_AGENT = `modus-typescript/${"0.6.0"} (node/${process.version}; ${process.platform})`;
1513
+ var USER_AGENT = `modus-typescript/${"0.8.0"} (node/${process.version}; ${process.platform})`;
1233
1514
  function buildUrl(baseUrl, path, params) {
1234
1515
  const url = new URL(path.startsWith("/") ? path : `/${path}`, baseUrl);
1235
1516
  if (params) {
@@ -1244,6 +1525,15 @@ function buildUrl(baseUrl, path, params) {
1244
1525
  }
1245
1526
  return url.toString();
1246
1527
  }
1528
+ function mergeHeaders(...layers) {
1529
+ const merged = /* @__PURE__ */ new Map();
1530
+ for (const layer of layers) {
1531
+ for (const [name, value] of Object.entries(layer ?? {})) {
1532
+ merged.set(name.toLowerCase(), [name, value]);
1533
+ }
1534
+ }
1535
+ return Object.fromEntries(merged.values());
1536
+ }
1247
1537
  function headersToRecord(headers) {
1248
1538
  const out = {};
1249
1539
  headers.forEach((value, key) => {
@@ -1349,12 +1639,15 @@ var HttpClient = class {
1349
1639
  this.config = config;
1350
1640
  }
1351
1641
  defaultHeaders() {
1352
- return {
1353
- ...authHeaders(this.config.apiKey),
1354
- Accept: "application/json",
1355
- "Content-Type": "application/json",
1356
- "User-Agent": USER_AGENT
1357
- };
1642
+ return mergeHeaders(
1643
+ {
1644
+ Accept: "application/json",
1645
+ "Content-Type": "application/json",
1646
+ "User-Agent": USER_AGENT,
1647
+ "X-Modus-Client": "sdk"
1648
+ },
1649
+ this.config.defaultHeaders
1650
+ );
1358
1651
  }
1359
1652
  async request(method, path, options = {}) {
1360
1653
  const baseUrl = options.baseUrl ?? this.config.baseUrl;
@@ -1362,7 +1655,7 @@ var HttpClient = class {
1362
1655
  try {
1363
1656
  const response = await this.config.fetch(url, {
1364
1657
  method,
1365
- headers: { ...this.defaultHeaders(), ...options.headers },
1658
+ headers: mergeHeaders(this.defaultHeaders(), options.headers, authHeaders(this.config.apiKey)),
1366
1659
  body: options.json !== void 0 ? JSON.stringify(options.json) : void 0,
1367
1660
  signal: AbortSignal.timeout(this.config.timeoutMs)
1368
1661
  });
@@ -1401,11 +1694,12 @@ var HttpClient = class {
1401
1694
  method,
1402
1695
  // Agent-service negotiates SSE vs JSON polling on Accept; JSON-only
1403
1696
  // Accept returns {"runId","status":"pending"} instead of token SSE.
1404
- headers: {
1405
- ...this.defaultHeaders(),
1406
- ...options.headers,
1407
- Accept: "text/event-stream"
1408
- },
1697
+ headers: mergeHeaders(
1698
+ this.defaultHeaders(),
1699
+ options.headers,
1700
+ { Accept: "text/event-stream" },
1701
+ authHeaders(this.config.apiKey)
1702
+ ),
1409
1703
  body: options.json !== void 0 ? JSON.stringify(options.json) : void 0,
1410
1704
  signal: AbortSignal.timeout(this.config.timeoutMs)
1411
1705
  });
@@ -1476,16 +1770,29 @@ var WRITE_BODY_ALLOWED_KEYS = {
1476
1770
  ContextCreatorsController_createLink: ["url", "title", "isCrawl", "pageLimit"],
1477
1771
  ContextCreatorsController_createNote: ["title", "content"],
1478
1772
  ContextCreatorsController_createSavedQuery: ["name", "connectionId", "query", "description", "path"],
1479
- ContextFilesController_uploadFromUrl: ["url", "fileName"],
1773
+ ContextFilesController_finalize: ["fileName", "folderPath"],
1774
+ ContextFilesController_finalizeMany: ["uploads"],
1775
+ ContextFilesController_uploadFromUrl: ["url", "fileName", "folderPath"],
1480
1776
  ContextFilesController_uploadFromUrls: ["urls"],
1481
1777
  ContextFilesController_uploadUrl: ["fileName", "contentType", "fileSize"],
1482
1778
  ContextFilesController_uploadUrls: ["files"],
1483
1779
  ContextItemsController_lookup: ["contextType", "dataPath", "contentProjection"],
1780
+ ContextItemsController_move: ["destinationFolderUid"],
1484
1781
  ContextItemsController_update: ["contextType", "content", "description", "userFeedback", "topics"],
1485
1782
  CustomContextItemsController_batchCreate: ["items"],
1486
1783
  CustomContextItemsController_create: ["kind", "sourceId", "sourceName", "collectionId", "collectionName", "externalId", "fieldName", "name", "entityType", "description", "content", "url", "attributes", "dataType", "value", "samples", "raw", "topics", "idempotencyKey", "access"],
1784
+ CustomContextItemsController_createRelations: ["relations"],
1487
1785
  CustomContextItemsController_update: ["name", "entityType", "description", "content", "url", "attributes", "dataType", "value", "samples", "raw", "topics"],
1786
+ DashboardsController_create: ["title", "description", "definition", "access"],
1787
+ DashboardsController_createElement: ["expectedRevision", "kind", "title", "layout"],
1788
+ DashboardsController_publish: ["expectedRevision"],
1789
+ DashboardsController_transferOwnership: ["newOwnerUserId"],
1790
+ DashboardsController_updateAccess: ["visibility", "groupPermissions", "sharedWith"],
1791
+ DashboardsController_updateDraft: ["expectedRevision", "title", "description", "definition"],
1792
+ DashboardsController_updateElement: ["expectedRevision", "patch"],
1793
+ DashboardsController_updateLayout: ["expectedRevision", "elements"],
1488
1794
  EvaluationsController_updateConfig: ["enabled", "cadence", "judgeModel", "judgeGuidance", "notifications"],
1795
+ IngestedDataController_upload: ["integration_type", "request", "response"],
1489
1796
  ModusChatController_chat: ["message", "model"],
1490
1797
  ModusContextController_compose: ["message", "limit"],
1491
1798
  ModusRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId", "subordinateSkillIds"],
@@ -1496,11 +1803,13 @@ var WRITE_BODY_ALLOWED_KEYS = {
1496
1803
  RunLifecycleController_interrupt: [],
1497
1804
  ScopeChatController_chat: ["message", "model"],
1498
1805
  ScopeContextController_compose: ["message", "limit"],
1806
+ ScopeInterfacesController_add: ["type", "name", "config"],
1807
+ ScopeInterfacesController_update: ["name", "config"],
1499
1808
  ScopeMemoriesController_search: ["query", "userId", "limit"],
1500
1809
  ScopeMemoriesController_update: ["memory", "metadata"],
1501
1810
  ScopeRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId", "subordinateSkillIds"],
1502
1811
  ScopesController_acceptOwnershipTransfer: [],
1503
- ScopesController_create: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "interfaces", "accessConfig"],
1812
+ ScopesController_create: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "includeOwnLearnings", "interfaces", "accessConfig"],
1504
1813
  ScopesController_deploy: [],
1505
1814
  ScopesController_patchMcpConfig: ["config"],
1506
1815
  ScopesController_requestOwnershipTransfer: ["newOwnerUserId"],
@@ -1540,11 +1849,15 @@ function validateId(resourceId, name = "id") {
1540
1849
  }
1541
1850
  var ALLOWED_CHAT_MODELS = /* @__PURE__ */ new Set([
1542
1851
  "claude-sonnet-5",
1852
+ "claude-sonnet-5.5",
1543
1853
  "claude-sonnet-4.6",
1544
1854
  "claude-opus-4.8",
1855
+ "claude-opus-5.5",
1545
1856
  "gpt-5.2",
1546
1857
  "gpt-5.5",
1547
1858
  "gpt-5-mini",
1859
+ "gpt-5.6-luna",
1860
+ "gpt-6-luna",
1548
1861
  "gpt-oss-120b",
1549
1862
  "gpt-oss-20b",
1550
1863
  "qwen3-235b-a22b-2507",
@@ -1560,7 +1873,9 @@ var ALLOWED_CHAT_MODELS = /* @__PURE__ */ new Set([
1560
1873
  "gemini-3.1-pro-preview",
1561
1874
  "gemini-3-flash-preview",
1562
1875
  "grok-4.3-fast",
1563
- "grok-4.3"
1876
+ "grok-4.3",
1877
+ "grok-4.7",
1878
+ "kimi-k3"
1564
1879
  ]);
1565
1880
  function validateChatModel(model) {
1566
1881
  if (!ALLOWED_CHAT_MODELS.has(model)) {
@@ -1725,6 +2040,12 @@ var CustomContextItemsResource = class {
1725
2040
  * @param options.searchQuery - Free-text search filter.
1726
2041
  * @param options.topics - Filter to items tagged with any of these topics.
1727
2042
  * @returns A page of custom context items.
2043
+ * @example
2044
+ * ```ts
2045
+ * const client = new Modus()
2046
+ * const page = await client.context.customItems.list({ pageSize: 25 })
2047
+ * for (const item of page.items) console.log(item.uid, item.contextType)
2048
+ * ```
1728
2049
  */
1729
2050
  list(options = {}) {
1730
2051
  const pageSize = options.pageSize ?? 25;
@@ -1753,6 +2074,11 @@ var CustomContextItemsResource = class {
1753
2074
  * @param uid - Item uid.
1754
2075
  * @returns The custom context item.
1755
2076
  * @throws {NotFoundError} When no item matches the uid.
2077
+ * @example
2078
+ * ```ts
2079
+ * const client = new Modus()
2080
+ * const item = await client.context.customItems.get('PLACEHOLDER_UID')
2081
+ * ```
1756
2082
  */
1757
2083
  async get(uid) {
1758
2084
  return parseContextItem(
@@ -1773,6 +2099,7 @@ var CustomContextItemsResource = class {
1773
2099
  *
1774
2100
  * @example
1775
2101
  * ```ts
2102
+ * const client = new Modus()
1776
2103
  * const created = await client.context.customItems.create({
1777
2104
  * kind: 'entity',
1778
2105
  * sourceId: 'my-source',
@@ -1796,6 +2123,7 @@ var CustomContextItemsResource = class {
1796
2123
  *
1797
2124
  * @example
1798
2125
  * ```ts
2126
+ * const client = new Modus()
1799
2127
  * const created = await client.context.customItems.batchCreate([
1800
2128
  * { kind: 'field', sourceId: 'src', fieldName: 'region', dataType: 'string' },
1801
2129
  * { kind: 'field', sourceId: 'src', fieldName: 'amount', dataType: 'number' },
@@ -1813,12 +2141,45 @@ var CustomContextItemsResource = class {
1813
2141
  const items = data.contextItems;
1814
2142
  return Array.isArray(items) ? items.map(parseCreatedCustomContextItem) : [];
1815
2143
  }
2144
+ /**
2145
+ * Create or update typed relations between context items.
2146
+ *
2147
+ * @param relations - Relations with source and target item uids, a snake_case type, and optional content.
2148
+ * @returns Number of relations created or updated.
2149
+ * @example
2150
+ * ```ts
2151
+ * const client = new Modus()
2152
+ * await client.context.customItems.createRelations([{
2153
+ * fromUid: 'SOURCE_UID',
2154
+ * toUid: 'TARGET_UID',
2155
+ * relationType: 'depends_on',
2156
+ * }])
2157
+ * ```
2158
+ */
2159
+ async createRelations(relations) {
2160
+ const data = asRecord(
2161
+ await invokeWithRetry(
2162
+ this.config,
2163
+ this.http,
2164
+ "CustomContextItemsController_createRelations",
2165
+ { jsonBody: { relations } }
2166
+ )
2167
+ );
2168
+ return data.upsertedCount;
2169
+ }
1816
2170
  /**
1817
2171
  * Update a custom context item.
1818
2172
  *
1819
2173
  * @param uid - Item uid.
1820
2174
  * @param input - Fields to change (kind and hierarchy ids cannot be changed).
1821
2175
  * @returns The updated item uid.
2176
+ * @example
2177
+ * ```ts
2178
+ * const client = new Modus()
2179
+ * await client.context.customItems.update('PLACEHOLDER_UID', {
2180
+ * description: 'Updated summary',
2181
+ * })
2182
+ * ```
1822
2183
  */
1823
2184
  async update(uid, input) {
1824
2185
  return asRecord(
@@ -1833,6 +2194,11 @@ var CustomContextItemsResource = class {
1833
2194
  *
1834
2195
  * @param uid - Item uid.
1835
2196
  * @returns Deletion confirmation with uid and context type.
2197
+ * @example
2198
+ * ```ts
2199
+ * const client = new Modus()
2200
+ * const result = await client.context.customItems.delete('PLACEHOLDER_UID')
2201
+ * ```
1836
2202
  */
1837
2203
  async delete(uid) {
1838
2204
  return parseDeletion(
@@ -1861,26 +2227,44 @@ var ScopeConversationsResource = class {
1861
2227
  *
1862
2228
  * @param options.pageSize - Items per page (default 25).
1863
2229
  * @param options.pageToken - Opaque token from a previous page.
1864
- * @returns Page of conversation list items.
2230
+ * @param options.source - Restrict to conversations started from this UI surface
2231
+ * (e.g. `"context_chat"`, `"dashboard_copilot"`, `"slack"`).
2232
+ * @param options.sourceRef - Narrow `source` to one instance of that surface — for
2233
+ * `"dashboard_copilot"`, a dashboard id. Requires `source`; the API throws an
2234
+ * `UnprocessableError` (422) if sent on its own. Conversations recorded before
2235
+ * this filter shipped carry no instance key and never match it.
2236
+ * @returns Page of conversation list items (`threadId`, `firstMessage`, `messageCount`).
2237
+ *
2238
+ * @example
2239
+ * ```ts
2240
+ * for await (const row of (
2241
+ * await client.scopes.conversations(scopeId).list({ pageSize: 10 })
2242
+ * ).autoPagingIter()) {
2243
+ * console.log(row.threadId, row.firstMessage, row.messageCount)
2244
+ * }
2245
+ * ```
1865
2246
  */
1866
2247
  list(options = {}) {
1867
2248
  const pageSize = options.pageSize ?? 25;
1868
2249
  validatePageSize(pageSize);
1869
- return this.listPage(pageSize, options.pageToken);
2250
+ return this.listPage(pageSize, options.pageToken, options.source, options.sourceRef);
1870
2251
  }
1871
- async listPage(pageSize, pageToken) {
2252
+ async listPage(pageSize, pageToken, source, sourceRef) {
1872
2253
  validateId(this.scopeId, "scope_id");
2254
+ const extra = {};
2255
+ if (source !== void 0) extra.source = source;
2256
+ if (sourceRef !== void 0) extra.sourceRef = sourceRef;
1873
2257
  const data = asRecord(
1874
2258
  await invokeWithRetry(this.config, this.http, "ScopeConversationsController_list", {
1875
2259
  pathParams: { id: this.scopeId },
1876
- query: aipListParams(pageSize, pageToken)
2260
+ query: aipListParams(pageSize, pageToken, extra)
1877
2261
  })
1878
2262
  );
1879
2263
  return buildAipPage(
1880
2264
  data,
1881
2265
  "conversations",
1882
2266
  parseListItem,
1883
- (token) => this.listPage(pageSize, token)
2267
+ (token) => this.listPage(pageSize, token, source, sourceRef)
1884
2268
  );
1885
2269
  }
1886
2270
  /**
@@ -1889,7 +2273,15 @@ var ScopeConversationsResource = class {
1889
2273
  * @param threadId - Conversation thread id.
1890
2274
  * @param options.messageLimit - Maximum messages to return (1–100).
1891
2275
  * @param options.beforeMessageIndex - Return messages before this index (requires messageLimit).
1892
- * @returns Conversation with messages.
2276
+ * @returns Conversation with `messages` (`type`, `content`).
2277
+ *
2278
+ * @example
2279
+ * ```ts
2280
+ * const thread = await client.scopes.conversations(scopeId).get(row.threadId)
2281
+ * for (const msg of thread.messages) {
2282
+ * console.log(msg.type, String(msg.content).slice(0, 80))
2283
+ * }
2284
+ * ```
1893
2285
  */
1894
2286
  async get(threadId, options = {}) {
1895
2287
  validateId(this.scopeId, "scope_id");
@@ -1940,4 +2332,4 @@ export {
1940
2332
  CustomContextItemsResource,
1941
2333
  ScopeConversationsResource
1942
2334
  };
1943
- //# sourceMappingURL=chunk-HEHHN4D6.js.map
2335
+ //# sourceMappingURL=chunk-GFS7CNON.js.map