@getmodus/sdk 0.6.0 → 0.7.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 CHANGED
@@ -1,18 +1,98 @@
1
1
  # Changelog
2
2
 
3
- **Current npm release:** [`0.6.0`](https://www.npmjs.com/package/@getmodus/sdk/v/0.6.0).
3
+ Published versions come from the `sdk-typescript/v*` tags; the current release is
4
+ whatever [npm](https://www.npmjs.com/package/@getmodus/sdk) is serving. This file
5
+ records what changed, not which version is live.
4
6
 
5
- Pre-1.0 (`0.x`) releases are internal. Detailed release notes are not maintained
6
- until `1.0.0` — keep `[Unreleased]` empty while the package stays on `0.x`.
7
+ Record concise, customer-visible release notes under `[Unreleased]` for every SDK
8
+ release, including pre-1.0 (`0.x`) releases.
9
+
10
+ ## [Unreleased]
11
+
12
+ ## [0.7.0] — 2026-09-30
13
+
14
+ ### Added
15
+
16
+ - **`contextItemUids` on composed context.** `POST /modus/context` and
17
+ `POST /scopes/{id}/context` now return the UIDs of the context items the composer
18
+ kept, in selection order. Previously the response reported `selectedCount` with no
19
+ way to learn which items it counted — `contextItems` has been an empty array for
20
+ some time and remains deprecated.
21
+ - **`claude-opus-5.5` and `grok-4.7` models.** The chat request `model` union
22
+ accepts the two new models.
23
+
24
+ ### Removed
25
+
26
+ - **`RunConfigDto.strategies`.** The run API no longer publishes context-composer
27
+ strategy IDs, so the generated `RunConfigDto` type no longer carries
28
+ `strategies`. These IDs are the composer's internal vocabulary and get renamed,
29
+ so a pinned value could silently stop doing anything. Strategy selection is
30
+ chosen by the service.
31
+
32
+ ### Added
33
+
34
+ - **Dashboard documents.** `mgmt.context.dashboards` document operations: list, get, create,
35
+ updateDraft, publish, delete, versions, draft snapshots, access, ownership transfer
36
+ (`list()`, `get()`, `create()`, `updateDraft()`, `publish()`, `delete()`,
37
+ `listVersions()`, `getVersion()`, `restoreVersion()`, `listDraftSnapshots()`,
38
+ `updateAccess()`, `requestOwnershipTransfer()`, `acceptOwnershipTransfer()`,
39
+ `cancelOwnershipTransfer()`). New types `DashboardVersion`, `DashboardDraftSnapshot`,
40
+ `DashboardPublishResult` and `DashboardView`, and the input types `CreateDashboardInput`,
41
+ `UpdateDashboardDraftInput`, `PublishDashboardInput`, `UpdateDashboardAccessInput` and
42
+ `TransferDashboardOwnershipInput`; version definitions are returned as stored, so older versions
43
+ may lack newer fields.
44
+
45
+ - **Dashboard draft elements and layout.** `mgmt.context.dashboards.elements(dashboardId)`
46
+ lists, reads, creates and updates the tiles and filters of a dashboard draft
47
+ (`list()`, `get()`, `create()`, `update()`), and `mgmt.context.dashboards.updateLayout()`
48
+ moves or resizes several of them in one change. Every write takes the `expectedRevision`
49
+ it is based on and throws `ConflictError` when the draft changed.
50
+
51
+ - Ingested-data uploads accept an optional source HTTP `response.status` from 100 through 599.
52
+
53
+ - **File uploads: optional `folderPath`.** `uploadFromUrl`, `finalize`, and directory
54
+ uploads now accept an optional relative folder label that is stored with the file and
55
+ returned on the file resource. `uploadDir` sets it automatically from each file's path
56
+ relative to the upload root, so directory structure is preserved.
57
+
58
+ - **Conversation lists: optional `source` and `sourceRef` filters.** `client.modus.conversations.list`
59
+ and `client.scopes.conversations(scopeId).list` now accept `source` to restrict results to
60
+ one UI surface (e.g. `"context_chat"`, `"dashboard_copilot"`, `"slack"`) and `sourceRef` to
61
+ narrow `source` to one instance of that surface — for `dashboard_copilot`, a dashboard id.
62
+ `sourceRef` requires `source`; sent on its own it is rejected with a 422. Conversations
63
+ recorded before the filter shipped carry no instance key and do not match it.
64
+
65
+ ### Changed
66
+
67
+ - **Scope MCP: Get Answer works alone.** `management.scopes.patchMcpConfig` now
68
+ rejects a config that turns `coreTools.chat` (`get_answer`) on together with
69
+ `getContext`, `teachModus` or any tool exposure, with HTTP 422. The call replaces the
70
+ whole config and omitted keys take their defaults: `chat` off, `getContext` on,
71
+ `teachModus` off, every tool exposed. To turn Get Answer on, send `chat: true`,
72
+ `getContext: false` and an empty `subset` exposure in one call.
73
+
74
+ - **Breaking (pre-1.0):** Ingested-data upload results now contain only `checksum`;
75
+ object keys are internal storage details.
76
+
77
+ - **Breaking (pre-1.0):** Directory-managed member groups no longer include member IDs.
78
+ Use the member count to determine their size. Native member groups are unchanged.
7
79
 
8
80
  ## [0.6.0] — 2026-08-15
9
81
 
82
+ ### Changed
83
+
84
+ - Public OpenAPI updates from production release.
85
+
86
+ ## [0.5.0] — 2026-08-08
10
87
 
11
88
  ### Changed
12
89
 
13
90
  - Public OpenAPI updates from production release.
14
91
 
92
+ ## [0.4.0] — 2026-08-01
15
93
 
16
- ## [Unreleased]
94
+ ### Changed
95
+
96
+ - Public OpenAPI updates from production release.
17
97
 
18
98
  ## [0.3.0] — 2026-07-26
package/README.md CHANGED
@@ -165,9 +165,17 @@ await mgmt.scopes.deploy(scope.id)
165
165
  // Create returns contextItemId (also available as .uid); list/get use .uid
166
166
  const note = await mgmt.context.createNote('Title', 'Body')
167
167
  console.log(note.contextItemId, note.uid) // same UUID
168
+
169
+ // Context file upload (presign → PUT → finalize; polls until processing by default)
170
+ const upload = await mgmt.context.files.upload('report.pdf')
171
+ console.log(upload.uploadId, upload.status)
172
+
173
+ // Directory / many files — bulk uploadUrls + finalize (chunks of 100)
174
+ const batch = await mgmt.context.files.uploadDir('./reports')
175
+ console.log(batch.uploaded.length, batch.failed.length)
168
176
  ```
169
177
 
170
- Requires a token with write access to scopes and workflows (same as the Modus UI).
178
+ Requires a token with write access to scopes and workflows (same as the Modus UI). Context file upload/finalize also needs `context:write`; polling status and listing context items need `context:read`.
171
179
 
172
180
  ## Pagination
173
181
 
@@ -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}",
@@ -180,6 +200,16 @@ var OPERATIONS = {
180
200
  requestSchema: "CreateCustomContextItemDto",
181
201
  responseSchema: "CreatedCustomContextItemResponseDto"
182
202
  },
203
+ "CustomContextItemsController_createRelations": {
204
+ method: "POST",
205
+ path: "/api/v1/context/custom-items/relations",
206
+ service: "modus-api",
207
+ serverUrl: "https://api.getmodus.com",
208
+ pathParams: [],
209
+ queryParams: [],
210
+ requestSchema: "BatchCreateCustomContextItemRelationsDto",
211
+ responseSchema: "BatchCreateCustomContextItemRelationsResponseDto"
212
+ },
183
213
  "CustomContextItemsController_delete": {
184
214
  method: "DELETE",
185
215
  path: "/api/v1/context/custom-items/{uid}",
@@ -220,6 +250,196 @@ var OPERATIONS = {
220
250
  requestSchema: "UpdateCustomContextItemDto",
221
251
  responseSchema: null
222
252
  },
253
+ "DashboardsController_acceptOwnership": {
254
+ method: "POST",
255
+ path: "/api/v1/context/dashboards/{dashboardId}/transfer-ownership/accept",
256
+ service: "modus-api",
257
+ serverUrl: "https://api.getmodus.com",
258
+ pathParams: ["dashboardId"],
259
+ queryParams: [],
260
+ requestSchema: null,
261
+ responseSchema: "DashboardDto"
262
+ },
263
+ "DashboardsController_cancelOwnership": {
264
+ method: "DELETE",
265
+ path: "/api/v1/context/dashboards/{dashboardId}/transfer-ownership",
266
+ service: "modus-api",
267
+ serverUrl: "https://api.getmodus.com",
268
+ pathParams: ["dashboardId"],
269
+ queryParams: [],
270
+ requestSchema: null,
271
+ responseSchema: "DashboardDto"
272
+ },
273
+ "DashboardsController_create": {
274
+ method: "POST",
275
+ path: "/api/v1/context/dashboards",
276
+ service: "modus-api",
277
+ serverUrl: "https://api.getmodus.com",
278
+ pathParams: [],
279
+ queryParams: [],
280
+ requestSchema: "CreateDashboardDto",
281
+ responseSchema: "DashboardDto"
282
+ },
283
+ "DashboardsController_createElement": {
284
+ method: "POST",
285
+ path: "/api/v1/context/dashboards/{dashboardId}/elements",
286
+ service: "modus-api",
287
+ serverUrl: "https://api.getmodus.com",
288
+ pathParams: ["dashboardId"],
289
+ queryParams: [],
290
+ requestSchema: "CreateDashboardElementDto",
291
+ responseSchema: "DashboardElementResponseDto"
292
+ },
293
+ "DashboardsController_delete": {
294
+ method: "DELETE",
295
+ path: "/api/v1/context/dashboards/{dashboardId}",
296
+ service: "modus-api",
297
+ serverUrl: "https://api.getmodus.com",
298
+ pathParams: ["dashboardId"],
299
+ queryParams: [],
300
+ requestSchema: null,
301
+ responseSchema: null
302
+ },
303
+ "DashboardsController_get": {
304
+ method: "GET",
305
+ path: "/api/v1/context/dashboards/{dashboardId}",
306
+ service: "modus-api",
307
+ serverUrl: "https://api.getmodus.com",
308
+ pathParams: ["dashboardId"],
309
+ queryParams: ["view"],
310
+ requestSchema: null,
311
+ responseSchema: "DashboardDto"
312
+ },
313
+ "DashboardsController_getElement": {
314
+ method: "GET",
315
+ path: "/api/v1/context/dashboards/{dashboardId}/elements/{elementId}",
316
+ service: "modus-api",
317
+ serverUrl: "https://api.getmodus.com",
318
+ pathParams: ["dashboardId", "elementId"],
319
+ queryParams: [],
320
+ requestSchema: null,
321
+ responseSchema: "DashboardElementResponseDto"
322
+ },
323
+ "DashboardsController_getVersion": {
324
+ method: "GET",
325
+ path: "/api/v1/context/dashboards/{dashboardId}/versions/{versionId}",
326
+ service: "modus-api",
327
+ serverUrl: "https://api.getmodus.com",
328
+ pathParams: ["dashboardId", "versionId"],
329
+ queryParams: [],
330
+ requestSchema: null,
331
+ responseSchema: "DashboardDto"
332
+ },
333
+ "DashboardsController_list": {
334
+ method: "GET",
335
+ path: "/api/v1/context/dashboards",
336
+ service: "modus-api",
337
+ serverUrl: "https://api.getmodus.com",
338
+ pathParams: [],
339
+ queryParams: ["view"],
340
+ requestSchema: null,
341
+ responseSchema: "ListDashboardsResponseDto"
342
+ },
343
+ "DashboardsController_listDraftSnapshots": {
344
+ method: "GET",
345
+ path: "/api/v1/context/dashboards/{dashboardId}/draft-snapshots",
346
+ service: "modus-api",
347
+ serverUrl: "https://api.getmodus.com",
348
+ pathParams: ["dashboardId"],
349
+ queryParams: [],
350
+ requestSchema: null,
351
+ responseSchema: "ListDashboardDraftSnapshotsResponseDto"
352
+ },
353
+ "DashboardsController_listElements": {
354
+ method: "GET",
355
+ path: "/api/v1/context/dashboards/{dashboardId}/elements",
356
+ service: "modus-api",
357
+ serverUrl: "https://api.getmodus.com",
358
+ pathParams: ["dashboardId"],
359
+ queryParams: [],
360
+ requestSchema: null,
361
+ responseSchema: "DashboardElementsListResponseDto"
362
+ },
363
+ "DashboardsController_listVersions": {
364
+ method: "GET",
365
+ path: "/api/v1/context/dashboards/{dashboardId}/versions",
366
+ service: "modus-api",
367
+ serverUrl: "https://api.getmodus.com",
368
+ pathParams: ["dashboardId"],
369
+ queryParams: [],
370
+ requestSchema: null,
371
+ responseSchema: "ListDashboardVersionsResponseDto"
372
+ },
373
+ "DashboardsController_publish": {
374
+ method: "POST",
375
+ path: "/api/v1/context/dashboards/{dashboardId}/publish",
376
+ service: "modus-api",
377
+ serverUrl: "https://api.getmodus.com",
378
+ pathParams: ["dashboardId"],
379
+ queryParams: [],
380
+ requestSchema: "PublishDashboardDto",
381
+ responseSchema: "PublishDashboardResponseDto"
382
+ },
383
+ "DashboardsController_restore": {
384
+ method: "POST",
385
+ path: "/api/v1/context/dashboards/{dashboardId}/versions/{versionId}/restore",
386
+ service: "modus-api",
387
+ serverUrl: "https://api.getmodus.com",
388
+ pathParams: ["dashboardId", "versionId"],
389
+ queryParams: [],
390
+ requestSchema: null,
391
+ responseSchema: "DashboardDto"
392
+ },
393
+ "DashboardsController_transferOwnership": {
394
+ method: "POST",
395
+ path: "/api/v1/context/dashboards/{dashboardId}/transfer-ownership",
396
+ service: "modus-api",
397
+ serverUrl: "https://api.getmodus.com",
398
+ pathParams: ["dashboardId"],
399
+ queryParams: [],
400
+ requestSchema: "TransferDashboardOwnershipDto",
401
+ responseSchema: "DashboardDto"
402
+ },
403
+ "DashboardsController_updateAccess": {
404
+ method: "PATCH",
405
+ path: "/api/v1/context/dashboards/{dashboardId}/access",
406
+ service: "modus-api",
407
+ serverUrl: "https://api.getmodus.com",
408
+ pathParams: ["dashboardId"],
409
+ queryParams: [],
410
+ requestSchema: "UpdateDashboardAccessDto",
411
+ responseSchema: "DashboardDto"
412
+ },
413
+ "DashboardsController_updateDraft": {
414
+ method: "PATCH",
415
+ path: "/api/v1/context/dashboards/{dashboardId}/draft",
416
+ service: "modus-api",
417
+ serverUrl: "https://api.getmodus.com",
418
+ pathParams: ["dashboardId"],
419
+ queryParams: [],
420
+ requestSchema: "UpdateDashboardDraftDto",
421
+ responseSchema: "DashboardDto"
422
+ },
423
+ "DashboardsController_updateElement": {
424
+ method: "PATCH",
425
+ path: "/api/v1/context/dashboards/{dashboardId}/elements/{elementId}",
426
+ service: "modus-api",
427
+ serverUrl: "https://api.getmodus.com",
428
+ pathParams: ["dashboardId", "elementId"],
429
+ queryParams: [],
430
+ requestSchema: "UpdateDashboardElementDto",
431
+ responseSchema: "DashboardDto"
432
+ },
433
+ "DashboardsController_updateLayout": {
434
+ method: "PATCH",
435
+ path: "/api/v1/context/dashboards/{dashboardId}/layout",
436
+ service: "modus-api",
437
+ serverUrl: "https://api.getmodus.com",
438
+ pathParams: ["dashboardId"],
439
+ queryParams: [],
440
+ requestSchema: "UpdateDashboardLayoutDto",
441
+ responseSchema: "DashboardDto"
442
+ },
223
443
  "EvaluationsController_getConfig": {
224
444
  method: "GET",
225
445
  path: "/api/v1/scopes/{id}/evaluations/config",
@@ -270,6 +490,16 @@ var OPERATIONS = {
270
490
  requestSchema: "UpdateEvaluationConfigDto",
271
491
  responseSchema: "EvaluationConfigDto"
272
492
  },
493
+ "IngestedDataController_upload": {
494
+ method: "POST",
495
+ path: "/api/v1/ingested-data",
496
+ service: "modus-api",
497
+ serverUrl: "https://api.getmodus.com",
498
+ pathParams: [],
499
+ queryParams: [],
500
+ requestSchema: "CreateIngestedDataDto",
501
+ responseSchema: "CreatedIngestedDataResponseDto"
502
+ },
273
503
  "MemberGroupsController_list": {
274
504
  method: "GET",
275
505
  path: "/api/v1/users/member-groups",
@@ -326,7 +556,7 @@ var OPERATIONS = {
326
556
  service: "modus-api",
327
557
  serverUrl: "https://api.getmodus.com",
328
558
  pathParams: [],
329
- queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "source", "timeframe", "includeTools", "kind"],
559
+ queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "source", "sourceRef", "timeframe", "includeTools", "kind"],
330
560
  requestSchema: null,
331
561
  responseSchema: "ListConversationsResponseDto"
332
562
  },
@@ -476,7 +706,7 @@ var OPERATIONS = {
476
706
  service: "modus-api",
477
707
  serverUrl: "https://api.getmodus.com",
478
708
  pathParams: ["id"],
479
- queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "source", "timeframe", "includeTools"],
709
+ queryParams: ["pageToken", "page", "pageSize", "userId", "toolName", "source", "sourceRef", "timeframe", "includeTools"],
480
710
  requestSchema: null,
481
711
  responseSchema: "ListConversationsResponseDto"
482
712
  },
@@ -1229,7 +1459,7 @@ function formatConfigForLog(config) {
1229
1459
  }
1230
1460
 
1231
1461
  // src/_http.ts
1232
- var USER_AGENT = `modus-typescript/${"0.6.0"} (node/${process.version}; ${process.platform})`;
1462
+ var USER_AGENT = `modus-typescript/${"0.7.0"} (node/${process.version}; ${process.platform})`;
1233
1463
  function buildUrl(baseUrl, path, params) {
1234
1464
  const url = new URL(path.startsWith("/") ? path : `/${path}`, baseUrl);
1235
1465
  if (params) {
@@ -1476,7 +1706,9 @@ var WRITE_BODY_ALLOWED_KEYS = {
1476
1706
  ContextCreatorsController_createLink: ["url", "title", "isCrawl", "pageLimit"],
1477
1707
  ContextCreatorsController_createNote: ["title", "content"],
1478
1708
  ContextCreatorsController_createSavedQuery: ["name", "connectionId", "query", "description", "path"],
1479
- ContextFilesController_uploadFromUrl: ["url", "fileName"],
1709
+ ContextFilesController_finalize: ["fileName", "folderPath"],
1710
+ ContextFilesController_finalizeMany: ["uploads"],
1711
+ ContextFilesController_uploadFromUrl: ["url", "fileName", "folderPath"],
1480
1712
  ContextFilesController_uploadFromUrls: ["urls"],
1481
1713
  ContextFilesController_uploadUrl: ["fileName", "contentType", "fileSize"],
1482
1714
  ContextFilesController_uploadUrls: ["files"],
@@ -1484,8 +1716,18 @@ var WRITE_BODY_ALLOWED_KEYS = {
1484
1716
  ContextItemsController_update: ["contextType", "content", "description", "userFeedback", "topics"],
1485
1717
  CustomContextItemsController_batchCreate: ["items"],
1486
1718
  CustomContextItemsController_create: ["kind", "sourceId", "sourceName", "collectionId", "collectionName", "externalId", "fieldName", "name", "entityType", "description", "content", "url", "attributes", "dataType", "value", "samples", "raw", "topics", "idempotencyKey", "access"],
1719
+ CustomContextItemsController_createRelations: ["relations"],
1487
1720
  CustomContextItemsController_update: ["name", "entityType", "description", "content", "url", "attributes", "dataType", "value", "samples", "raw", "topics"],
1721
+ DashboardsController_create: ["title", "description", "definition", "access"],
1722
+ DashboardsController_createElement: ["expectedRevision", "kind", "title", "layout"],
1723
+ DashboardsController_publish: ["expectedRevision"],
1724
+ DashboardsController_transferOwnership: ["newOwnerUserId"],
1725
+ DashboardsController_updateAccess: ["visibility", "groupPermissions", "sharedWith"],
1726
+ DashboardsController_updateDraft: ["expectedRevision", "title", "description", "definition"],
1727
+ DashboardsController_updateElement: ["expectedRevision", "patch"],
1728
+ DashboardsController_updateLayout: ["expectedRevision", "elements"],
1488
1729
  EvaluationsController_updateConfig: ["enabled", "cadence", "judgeModel", "judgeGuidance", "notifications"],
1730
+ IngestedDataController_upload: ["integration_type", "request", "response"],
1489
1731
  ModusChatController_chat: ["message", "model"],
1490
1732
  ModusContextController_compose: ["message", "limit"],
1491
1733
  ModusRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId", "subordinateSkillIds"],
@@ -1725,6 +1967,12 @@ var CustomContextItemsResource = class {
1725
1967
  * @param options.searchQuery - Free-text search filter.
1726
1968
  * @param options.topics - Filter to items tagged with any of these topics.
1727
1969
  * @returns A page of custom context items.
1970
+ * @example
1971
+ * ```ts
1972
+ * const client = new Modus()
1973
+ * const page = await client.context.customItems.list({ pageSize: 25 })
1974
+ * for (const item of page.items) console.log(item.uid, item.contextType)
1975
+ * ```
1728
1976
  */
1729
1977
  list(options = {}) {
1730
1978
  const pageSize = options.pageSize ?? 25;
@@ -1753,6 +2001,11 @@ var CustomContextItemsResource = class {
1753
2001
  * @param uid - Item uid.
1754
2002
  * @returns The custom context item.
1755
2003
  * @throws {NotFoundError} When no item matches the uid.
2004
+ * @example
2005
+ * ```ts
2006
+ * const client = new Modus()
2007
+ * const item = await client.context.customItems.get('PLACEHOLDER_UID')
2008
+ * ```
1756
2009
  */
1757
2010
  async get(uid) {
1758
2011
  return parseContextItem(
@@ -1773,6 +2026,7 @@ var CustomContextItemsResource = class {
1773
2026
  *
1774
2027
  * @example
1775
2028
  * ```ts
2029
+ * const client = new Modus()
1776
2030
  * const created = await client.context.customItems.create({
1777
2031
  * kind: 'entity',
1778
2032
  * sourceId: 'my-source',
@@ -1796,6 +2050,7 @@ var CustomContextItemsResource = class {
1796
2050
  *
1797
2051
  * @example
1798
2052
  * ```ts
2053
+ * const client = new Modus()
1799
2054
  * const created = await client.context.customItems.batchCreate([
1800
2055
  * { kind: 'field', sourceId: 'src', fieldName: 'region', dataType: 'string' },
1801
2056
  * { kind: 'field', sourceId: 'src', fieldName: 'amount', dataType: 'number' },
@@ -1813,12 +2068,45 @@ var CustomContextItemsResource = class {
1813
2068
  const items = data.contextItems;
1814
2069
  return Array.isArray(items) ? items.map(parseCreatedCustomContextItem) : [];
1815
2070
  }
2071
+ /**
2072
+ * Create or update typed relations between context items.
2073
+ *
2074
+ * @param relations - Relations with source and target item uids, a snake_case type, and optional content.
2075
+ * @returns Number of relations created or updated.
2076
+ * @example
2077
+ * ```ts
2078
+ * const client = new Modus()
2079
+ * await client.context.customItems.createRelations([{
2080
+ * fromUid: 'SOURCE_UID',
2081
+ * toUid: 'TARGET_UID',
2082
+ * relationType: 'depends_on',
2083
+ * }])
2084
+ * ```
2085
+ */
2086
+ async createRelations(relations) {
2087
+ const data = asRecord(
2088
+ await invokeWithRetry(
2089
+ this.config,
2090
+ this.http,
2091
+ "CustomContextItemsController_createRelations",
2092
+ { jsonBody: { relations } }
2093
+ )
2094
+ );
2095
+ return data.upsertedCount;
2096
+ }
1816
2097
  /**
1817
2098
  * Update a custom context item.
1818
2099
  *
1819
2100
  * @param uid - Item uid.
1820
2101
  * @param input - Fields to change (kind and hierarchy ids cannot be changed).
1821
2102
  * @returns The updated item uid.
2103
+ * @example
2104
+ * ```ts
2105
+ * const client = new Modus()
2106
+ * await client.context.customItems.update('PLACEHOLDER_UID', {
2107
+ * description: 'Updated summary',
2108
+ * })
2109
+ * ```
1822
2110
  */
1823
2111
  async update(uid, input) {
1824
2112
  return asRecord(
@@ -1833,6 +2121,11 @@ var CustomContextItemsResource = class {
1833
2121
  *
1834
2122
  * @param uid - Item uid.
1835
2123
  * @returns Deletion confirmation with uid and context type.
2124
+ * @example
2125
+ * ```ts
2126
+ * const client = new Modus()
2127
+ * const result = await client.context.customItems.delete('PLACEHOLDER_UID')
2128
+ * ```
1836
2129
  */
1837
2130
  async delete(uid) {
1838
2131
  return parseDeletion(
@@ -1861,26 +2154,44 @@ var ScopeConversationsResource = class {
1861
2154
  *
1862
2155
  * @param options.pageSize - Items per page (default 25).
1863
2156
  * @param options.pageToken - Opaque token from a previous page.
1864
- * @returns Page of conversation list items.
2157
+ * @param options.source - Restrict to conversations started from this UI surface
2158
+ * (e.g. `"context_chat"`, `"dashboard_copilot"`, `"slack"`).
2159
+ * @param options.sourceRef - Narrow `source` to one instance of that surface — for
2160
+ * `"dashboard_copilot"`, a dashboard id. Requires `source`; the API throws an
2161
+ * `UnprocessableError` (422) if sent on its own. Conversations recorded before
2162
+ * this filter shipped carry no instance key and never match it.
2163
+ * @returns Page of conversation list items (`threadId`, `firstMessage`, `messageCount`).
2164
+ *
2165
+ * @example
2166
+ * ```ts
2167
+ * for await (const row of (
2168
+ * await client.scopes.conversations(scopeId).list({ pageSize: 10 })
2169
+ * ).autoPagingIter()) {
2170
+ * console.log(row.threadId, row.firstMessage, row.messageCount)
2171
+ * }
2172
+ * ```
1865
2173
  */
1866
2174
  list(options = {}) {
1867
2175
  const pageSize = options.pageSize ?? 25;
1868
2176
  validatePageSize(pageSize);
1869
- return this.listPage(pageSize, options.pageToken);
2177
+ return this.listPage(pageSize, options.pageToken, options.source, options.sourceRef);
1870
2178
  }
1871
- async listPage(pageSize, pageToken) {
2179
+ async listPage(pageSize, pageToken, source, sourceRef) {
1872
2180
  validateId(this.scopeId, "scope_id");
2181
+ const extra = {};
2182
+ if (source !== void 0) extra.source = source;
2183
+ if (sourceRef !== void 0) extra.sourceRef = sourceRef;
1873
2184
  const data = asRecord(
1874
2185
  await invokeWithRetry(this.config, this.http, "ScopeConversationsController_list", {
1875
2186
  pathParams: { id: this.scopeId },
1876
- query: aipListParams(pageSize, pageToken)
2187
+ query: aipListParams(pageSize, pageToken, extra)
1877
2188
  })
1878
2189
  );
1879
2190
  return buildAipPage(
1880
2191
  data,
1881
2192
  "conversations",
1882
2193
  parseListItem,
1883
- (token) => this.listPage(pageSize, token)
2194
+ (token) => this.listPage(pageSize, token, source, sourceRef)
1884
2195
  );
1885
2196
  }
1886
2197
  /**
@@ -1889,7 +2200,15 @@ var ScopeConversationsResource = class {
1889
2200
  * @param threadId - Conversation thread id.
1890
2201
  * @param options.messageLimit - Maximum messages to return (1–100).
1891
2202
  * @param options.beforeMessageIndex - Return messages before this index (requires messageLimit).
1892
- * @returns Conversation with messages.
2203
+ * @returns Conversation with `messages` (`type`, `content`).
2204
+ *
2205
+ * @example
2206
+ * ```ts
2207
+ * const thread = await client.scopes.conversations(scopeId).get(row.threadId)
2208
+ * for (const msg of thread.messages) {
2209
+ * console.log(msg.type, String(msg.content).slice(0, 80))
2210
+ * }
2211
+ * ```
1893
2212
  */
1894
2213
  async get(threadId, options = {}) {
1895
2214
  validateId(this.scopeId, "scope_id");
@@ -1940,4 +2259,4 @@ export {
1940
2259
  CustomContextItemsResource,
1941
2260
  ScopeConversationsResource
1942
2261
  };
1943
- //# sourceMappingURL=chunk-HEHHN4D6.js.map
2262
+ //# sourceMappingURL=chunk-JMFT5KO5.js.map