@getmodus/sdk 0.7.0 → 0.9.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 +70 -0
- package/README.md +21 -2
- package/dist/{chunk-JMFT5KO5.js → chunk-SP4UYRYG.js} +146 -39
- package/dist/chunk-SP4UYRYG.js.map +1 -0
- package/dist/{conversations-B0_jmEuT.d.cts → conversations-D7ffhHIh.d.cts} +1693 -214
- package/dist/{conversations-B0_jmEuT.d.ts → conversations-D7ffhHIh.d.ts} +1693 -214
- package/dist/index.cjs +435 -222
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +219 -104
- package/dist/index.d.ts +219 -104
- package/dist/index.js +262 -156
- package/dist/index.js.map +1 -1
- package/dist/management/index.cjs +1226 -708
- package/dist/management/index.cjs.map +1 -1
- package/dist/management/index.d.cts +763 -375
- package/dist/management/index.d.ts +763 -375
- package/dist/management/index.js +1011 -594
- package/dist/management/index.js.map +1 -1
- package/package.json +8 -8
- package/dist/chunk-JMFT5KO5.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,10 +9,80 @@ release, including pre-1.0 (`0.x`) releases.
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [0.9.0] — 2026-10-24
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **List selectable units.** `client.connections.listSelections(connectionId)` and
|
|
17
|
+
`iterSelections(connectionId)` page the units a scope can select on a connection
|
|
18
|
+
(`GET /connections/{id}/selections`). `client.connections.list()` items may include
|
|
19
|
+
`selectionModel`.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **Breaking (pre-1.0): scope `interfaces` have one shape.** `scopes.create` and `scopes.update` (`POST /api/v1/scopes` and `PATCH /api/v1/scopes/{id}`) accept only MCP interface rows. `type` must be `mcp`. Each row has an optional id and name and a config of core tools and exposed integrations. A row without an id or name is assigned one. Responses return only id, type, name, and config; extra stored keys such as `enabled` are no longer returned.
|
|
24
|
+
- **Scope `connectionSet` rows must be a selectable unit.** `scopes.create` and `scopes.update` reject a new row whose path is neither the whole connection nor one selectable unit of it, with 422 `root.not_a_root`. A row already stored can stay, and removing it still succeeds.
|
|
25
|
+
- **Workflow interface config.** Slack and Teams `config` on a workflow interface is `accessMode` (`all`, `allow-list`, or `allow-org`), `allowedEmails`, and `availableChannelIds`. An MCP interface accepts no config keys. An unknown key or invalid value in a changed config returns 422 with violations; `config: null` returns 400. Unchanged stored values are accepted.
|
|
26
|
+
- **`searchQuery` documents word search.** `context.customItems.list({ searchQuery })` (`GET /context/custom-items`) describes
|
|
27
|
+
word search: it returns rows that contain every word of the query, case-insensitive.
|
|
28
|
+
|
|
29
|
+
## [0.8.0] — 2026-10-18
|
|
30
|
+
|
|
31
|
+
### Removed
|
|
32
|
+
|
|
33
|
+
- **Breaking: evaluation Slack `nangoConnectionId`.** Send `connectionId`, the
|
|
34
|
+
Slack connection's Modus UUID, in notification settings instead. The generated
|
|
35
|
+
`EvaluationSlackChannelDto` type uses `connectionId`. No deprecation window;
|
|
36
|
+
requires a major release.
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- **`includeOwnLearnings` on `scopes.create`.** A new scope reads what is taught while
|
|
41
|
+
using it by default; pass `false` to create it without its own learnings.
|
|
42
|
+
- **`defaultHeaders` client option.** `Modus` and `ModusManagement` accept headers to
|
|
43
|
+
send on every request. They override the SDK's own defaults, except `Authorization`,
|
|
44
|
+
which always comes from `apiKey`.
|
|
45
|
+
- **`X-Modus-Client: sdk` request header.** Every request names the SDK as the client.
|
|
46
|
+
- **`gpt-6-luna` model.** The chat request `model` union accepts the new
|
|
47
|
+
OpenAI model.
|
|
48
|
+
- **`gpt-5.6-luna` model.** The chat request `model` union accepts the new
|
|
49
|
+
OpenAI model.
|
|
50
|
+
- **Move Files items.** `mgmt.context.items.move(uid, { destinationFolderUid })`
|
|
51
|
+
relocates a live file or folder. Pass `null` for the Files root.
|
|
52
|
+
- **Generic context item browse.** `client.context.items.list()` and
|
|
53
|
+
`mgmt.context.items.list()` accept optional `connectionIds`, `parentUids`,
|
|
54
|
+
and `ancestorUids` arrays. Omit a filter to leave it unrestricted; pass `[]`
|
|
55
|
+
for the known-empty / match-none forms (`parentUids: []` is the Files root).
|
|
56
|
+
- **Upload destinations.** Upload helpers accept an optional `folderPath`
|
|
57
|
+
prefix for single files, batches, and directories.
|
|
58
|
+
|
|
59
|
+
### Changed
|
|
60
|
+
|
|
61
|
+
- **Scope context file handling.** `scopes.getContext()` returns bounded inline
|
|
62
|
+
previews for large bodies; full file content is not available through this REST method.
|
|
63
|
+
- **Connected-integration toolset entries bind to a connection.** A scope toolset entry
|
|
64
|
+
given as `{ actions: [...], rules }` is bound on create/update to the organization's
|
|
65
|
+
newest workspace connection of that integration and returned as
|
|
66
|
+
`{ byConnection: { <connection id>: {...} } }`. A create or update whose entry has no
|
|
67
|
+
workspace connection to bind to returns `422`; re-sending an entry already stored
|
|
68
|
+
unchanged is accepted.
|
|
69
|
+
- Deleting a Files folder through context items also deletes its contained files,
|
|
70
|
+
subfolders, and parsed file items.
|
|
71
|
+
|
|
12
72
|
## [0.7.0] — 2026-09-30
|
|
13
73
|
|
|
14
74
|
### Added
|
|
15
75
|
|
|
76
|
+
- **Scope Slack/Teams interfaces.** `scopes.interfaces(scopeId)` lists, adds, updates and
|
|
77
|
+
removes the Slack and Microsoft Teams interfaces of a scope.
|
|
78
|
+
- **`claude-sonnet-5.5` model.** The chat request `model` union accepts the new
|
|
79
|
+
Anthropic model.
|
|
80
|
+
- **`deepseek-v4-pro`, `deepseek-v4-flash-latest`, and `kimi-k3` models.** The
|
|
81
|
+
chat request `model` union accepts these models.
|
|
82
|
+
- **Optional `ancestry` on context items.** List, get, lookup, and custom-item
|
|
83
|
+
responses may include ordered ancestors (`uid`, `display_name`, `type`). The
|
|
84
|
+
field is omitted on older responses, `null` when stored ancestry is unknown,
|
|
85
|
+
and `[]` when the item has no ancestors.
|
|
16
86
|
- **`contextItemUids` on composed context.** `POST /modus/context` and
|
|
17
87
|
`POST /scopes/{id}/context` now return the UIDs of the context items the composer
|
|
18
88
|
kept, in selection order. Previously the response reported `selectedCount` with no
|
package/README.md
CHANGED
|
@@ -167,12 +167,31 @@ const note = await mgmt.context.createNote('Title', 'Body')
|
|
|
167
167
|
console.log(note.contextItemId, note.uid) // same UUID
|
|
168
168
|
|
|
169
169
|
// Context file upload (presign → PUT → finalize; polls until processing by default)
|
|
170
|
-
const upload = await mgmt.context.files.upload('report.pdf')
|
|
170
|
+
const upload = await mgmt.context.files.upload('report.pdf', { folderPath: 'reports/2026' })
|
|
171
171
|
console.log(upload.uploadId, upload.status)
|
|
172
172
|
|
|
173
173
|
// Directory / many files — bulk uploadUrls + finalize (chunks of 100)
|
|
174
|
-
const batch = await mgmt.context.files.uploadDir('./reports')
|
|
174
|
+
const batch = await mgmt.context.files.uploadDir('./reports', { folderPath: 'archive' })
|
|
175
175
|
console.log(batch.uploaded.length, batch.failed.length)
|
|
176
|
+
|
|
177
|
+
const file = await mgmt.context.files.get(upload.uploadId)
|
|
178
|
+
const files = await mgmt.context.files.list()
|
|
179
|
+
console.log(file.status, files.items.length)
|
|
180
|
+
|
|
181
|
+
const rootFolders = await mgmt.context.items.list({
|
|
182
|
+
connectionIds: ['files'],
|
|
183
|
+
contextType: 'file_folder_metadata',
|
|
184
|
+
parentUids: [],
|
|
185
|
+
})
|
|
186
|
+
console.log(rootFolders.items.length)
|
|
187
|
+
|
|
188
|
+
const destination = rootFolders.items[0]
|
|
189
|
+
if (destination) {
|
|
190
|
+
const moved = await mgmt.context.items.move(upload.uploadId, {
|
|
191
|
+
destinationFolderUid: destination.uid,
|
|
192
|
+
})
|
|
193
|
+
console.log(moved.movedItems)
|
|
194
|
+
}
|
|
176
195
|
```
|
|
177
196
|
|
|
178
197
|
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`.
|
|
@@ -10,6 +10,16 @@ var OPERATIONS = {
|
|
|
10
10
|
requestSchema: null,
|
|
11
11
|
responseSchema: "ListConnectionsResponseDto"
|
|
12
12
|
},
|
|
13
|
+
"ConnectionsController_listSelections": {
|
|
14
|
+
method: "GET",
|
|
15
|
+
path: "/api/v1/connections/{connectionId}/selections",
|
|
16
|
+
service: "modus-api",
|
|
17
|
+
serverUrl: "https://api.getmodus.com",
|
|
18
|
+
pathParams: ["connectionId"],
|
|
19
|
+
queryParams: ["pageToken", "pageSize"],
|
|
20
|
+
requestSchema: null,
|
|
21
|
+
responseSchema: "ListConnectionSelectionsResponseDto"
|
|
22
|
+
},
|
|
13
23
|
"ContextCreatorsController_createLink": {
|
|
14
24
|
method: "POST",
|
|
15
25
|
path: "/api/v1/context/links",
|
|
@@ -146,7 +156,7 @@ var OPERATIONS = {
|
|
|
146
156
|
service: "modus-api",
|
|
147
157
|
serverUrl: "https://api.getmodus.com",
|
|
148
158
|
pathParams: [],
|
|
149
|
-
queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics"],
|
|
159
|
+
queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics", "connectionIds", "parentUids", "ancestorUids"],
|
|
150
160
|
requestSchema: null,
|
|
151
161
|
responseSchema: "ListContextItemsResponseDto"
|
|
152
162
|
},
|
|
@@ -170,6 +180,16 @@ var OPERATIONS = {
|
|
|
170
180
|
requestSchema: "LookupContextItemDto",
|
|
171
181
|
responseSchema: "LookupContextItemResponseDto"
|
|
172
182
|
},
|
|
183
|
+
"ContextItemsController_move": {
|
|
184
|
+
method: "POST",
|
|
185
|
+
path: "/api/v1/context/items/{uid}/move",
|
|
186
|
+
service: "modus-api",
|
|
187
|
+
serverUrl: "https://api.getmodus.com",
|
|
188
|
+
pathParams: ["uid"],
|
|
189
|
+
queryParams: [],
|
|
190
|
+
requestSchema: "MoveContextItemDto",
|
|
191
|
+
responseSchema: "MoveContextItemResponseDto"
|
|
192
|
+
},
|
|
173
193
|
"ContextItemsController_update": {
|
|
174
194
|
method: "PATCH",
|
|
175
195
|
path: "/api/v1/context/items/{uid}",
|
|
@@ -710,6 +730,46 @@ var OPERATIONS = {
|
|
|
710
730
|
requestSchema: null,
|
|
711
731
|
responseSchema: "ListConversationsResponseDto"
|
|
712
732
|
},
|
|
733
|
+
"ScopeInterfacesController_add": {
|
|
734
|
+
method: "POST",
|
|
735
|
+
path: "/api/v1/scopes/{id}/interfaces",
|
|
736
|
+
service: "modus-api",
|
|
737
|
+
serverUrl: "https://api.getmodus.com",
|
|
738
|
+
pathParams: ["id"],
|
|
739
|
+
queryParams: [],
|
|
740
|
+
requestSchema: "AddScopeInterfaceDto",
|
|
741
|
+
responseSchema: "ScopeInterfaceDto"
|
|
742
|
+
},
|
|
743
|
+
"ScopeInterfacesController_delete": {
|
|
744
|
+
method: "DELETE",
|
|
745
|
+
path: "/api/v1/scopes/{id}/interfaces/{interfaceId}",
|
|
746
|
+
service: "modus-api",
|
|
747
|
+
serverUrl: "https://api.getmodus.com",
|
|
748
|
+
pathParams: ["id", "interfaceId"],
|
|
749
|
+
queryParams: [],
|
|
750
|
+
requestSchema: null,
|
|
751
|
+
responseSchema: null
|
|
752
|
+
},
|
|
753
|
+
"ScopeInterfacesController_list": {
|
|
754
|
+
method: "GET",
|
|
755
|
+
path: "/api/v1/scopes/{id}/interfaces",
|
|
756
|
+
service: "modus-api",
|
|
757
|
+
serverUrl: "https://api.getmodus.com",
|
|
758
|
+
pathParams: ["id"],
|
|
759
|
+
queryParams: [],
|
|
760
|
+
requestSchema: null,
|
|
761
|
+
responseSchema: "ListScopeInterfacesResponseDto"
|
|
762
|
+
},
|
|
763
|
+
"ScopeInterfacesController_update": {
|
|
764
|
+
method: "PATCH",
|
|
765
|
+
path: "/api/v1/scopes/{id}/interfaces/{interfaceId}",
|
|
766
|
+
service: "modus-api",
|
|
767
|
+
serverUrl: "https://api.getmodus.com",
|
|
768
|
+
pathParams: ["id", "interfaceId"],
|
|
769
|
+
queryParams: ["updateMask"],
|
|
770
|
+
requestSchema: "UpdateScopeInterfaceDto",
|
|
771
|
+
responseSchema: "ScopeInterfaceDto"
|
|
772
|
+
},
|
|
713
773
|
"ScopeMemoriesController_delete": {
|
|
714
774
|
method: "DELETE",
|
|
715
775
|
path: "/api/v1/scopes/{id}/memories/{memoryId}",
|
|
@@ -1444,6 +1504,7 @@ function createModusConfig(options = {}) {
|
|
|
1444
1504
|
}),
|
|
1445
1505
|
timeoutMs: resolveTimeoutMs(options.timeoutMs) ?? DEFAULT_TIMEOUT_MS,
|
|
1446
1506
|
maxRetries,
|
|
1507
|
+
defaultHeaders: Object.freeze({ ...options.defaultHeaders }),
|
|
1447
1508
|
fetch: options.fetch ?? globalThis.fetch.bind(globalThis)
|
|
1448
1509
|
});
|
|
1449
1510
|
}
|
|
@@ -1459,7 +1520,7 @@ function formatConfigForLog(config) {
|
|
|
1459
1520
|
}
|
|
1460
1521
|
|
|
1461
1522
|
// src/_http.ts
|
|
1462
|
-
var USER_AGENT = `modus-typescript/${"0.
|
|
1523
|
+
var USER_AGENT = `modus-typescript/${"0.9.0"} (node/${process.version}; ${process.platform})`;
|
|
1463
1524
|
function buildUrl(baseUrl, path, params) {
|
|
1464
1525
|
const url = new URL(path.startsWith("/") ? path : `/${path}`, baseUrl);
|
|
1465
1526
|
if (params) {
|
|
@@ -1474,6 +1535,15 @@ function buildUrl(baseUrl, path, params) {
|
|
|
1474
1535
|
}
|
|
1475
1536
|
return url.toString();
|
|
1476
1537
|
}
|
|
1538
|
+
function mergeHeaders(...layers) {
|
|
1539
|
+
const merged = /* @__PURE__ */ new Map();
|
|
1540
|
+
for (const layer of layers) {
|
|
1541
|
+
for (const [name, value] of Object.entries(layer ?? {})) {
|
|
1542
|
+
merged.set(name.toLowerCase(), [name, value]);
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
return Object.fromEntries(merged.values());
|
|
1546
|
+
}
|
|
1477
1547
|
function headersToRecord(headers) {
|
|
1478
1548
|
const out = {};
|
|
1479
1549
|
headers.forEach((value, key) => {
|
|
@@ -1579,12 +1649,15 @@ var HttpClient = class {
|
|
|
1579
1649
|
this.config = config;
|
|
1580
1650
|
}
|
|
1581
1651
|
defaultHeaders() {
|
|
1582
|
-
return
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1652
|
+
return mergeHeaders(
|
|
1653
|
+
{
|
|
1654
|
+
Accept: "application/json",
|
|
1655
|
+
"Content-Type": "application/json",
|
|
1656
|
+
"User-Agent": USER_AGENT,
|
|
1657
|
+
"X-Modus-Client": "sdk"
|
|
1658
|
+
},
|
|
1659
|
+
this.config.defaultHeaders
|
|
1660
|
+
);
|
|
1588
1661
|
}
|
|
1589
1662
|
async request(method, path, options = {}) {
|
|
1590
1663
|
const baseUrl = options.baseUrl ?? this.config.baseUrl;
|
|
@@ -1592,7 +1665,7 @@ var HttpClient = class {
|
|
|
1592
1665
|
try {
|
|
1593
1666
|
const response = await this.config.fetch(url, {
|
|
1594
1667
|
method,
|
|
1595
|
-
headers:
|
|
1668
|
+
headers: mergeHeaders(this.defaultHeaders(), options.headers, authHeaders(this.config.apiKey)),
|
|
1596
1669
|
body: options.json !== void 0 ? JSON.stringify(options.json) : void 0,
|
|
1597
1670
|
signal: AbortSignal.timeout(this.config.timeoutMs)
|
|
1598
1671
|
});
|
|
@@ -1631,11 +1704,12 @@ var HttpClient = class {
|
|
|
1631
1704
|
method,
|
|
1632
1705
|
// Agent-service negotiates SSE vs JSON polling on Accept; JSON-only
|
|
1633
1706
|
// Accept returns {"runId","status":"pending"} instead of token SSE.
|
|
1634
|
-
headers:
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
Accept: "text/event-stream"
|
|
1638
|
-
|
|
1707
|
+
headers: mergeHeaders(
|
|
1708
|
+
this.defaultHeaders(),
|
|
1709
|
+
options.headers,
|
|
1710
|
+
{ Accept: "text/event-stream" },
|
|
1711
|
+
authHeaders(this.config.apiKey)
|
|
1712
|
+
),
|
|
1639
1713
|
body: options.json !== void 0 ? JSON.stringify(options.json) : void 0,
|
|
1640
1714
|
signal: AbortSignal.timeout(this.config.timeoutMs)
|
|
1641
1715
|
});
|
|
@@ -1713,6 +1787,7 @@ var WRITE_BODY_ALLOWED_KEYS = {
|
|
|
1713
1787
|
ContextFilesController_uploadUrl: ["fileName", "contentType", "fileSize"],
|
|
1714
1788
|
ContextFilesController_uploadUrls: ["files"],
|
|
1715
1789
|
ContextItemsController_lookup: ["contextType", "dataPath", "contentProjection"],
|
|
1790
|
+
ContextItemsController_move: ["destinationFolderUid"],
|
|
1716
1791
|
ContextItemsController_update: ["contextType", "content", "description", "userFeedback", "topics"],
|
|
1717
1792
|
CustomContextItemsController_batchCreate: ["items"],
|
|
1718
1793
|
CustomContextItemsController_create: ["kind", "sourceId", "sourceName", "collectionId", "collectionName", "externalId", "fieldName", "name", "entityType", "description", "content", "url", "attributes", "dataType", "value", "samples", "raw", "topics", "idempotencyKey", "access"],
|
|
@@ -1738,11 +1813,13 @@ var WRITE_BODY_ALLOWED_KEYS = {
|
|
|
1738
1813
|
RunLifecycleController_interrupt: [],
|
|
1739
1814
|
ScopeChatController_chat: ["message", "model"],
|
|
1740
1815
|
ScopeContextController_compose: ["message", "limit"],
|
|
1816
|
+
ScopeInterfacesController_add: ["type", "name", "config"],
|
|
1817
|
+
ScopeInterfacesController_update: ["name", "config"],
|
|
1741
1818
|
ScopeMemoriesController_search: ["query", "userId", "limit"],
|
|
1742
1819
|
ScopeMemoriesController_update: ["memory", "metadata"],
|
|
1743
1820
|
ScopeRunsController_create: ["message", "sessionId", "organizationId", "version", "fileThreadId", "config", "attachments", "userContext", "source", "runId", "subordinateSkillIds"],
|
|
1744
1821
|
ScopesController_acceptOwnershipTransfer: [],
|
|
1745
|
-
ScopesController_create: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "interfaces", "accessConfig"],
|
|
1822
|
+
ScopesController_create: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "includeOwnLearnings", "interfaces", "accessConfig"],
|
|
1746
1823
|
ScopesController_deploy: [],
|
|
1747
1824
|
ScopesController_patchMcpConfig: ["config"],
|
|
1748
1825
|
ScopesController_requestOwnershipTransfer: ["newOwnerUserId"],
|
|
@@ -1782,11 +1859,15 @@ function validateId(resourceId, name = "id") {
|
|
|
1782
1859
|
}
|
|
1783
1860
|
var ALLOWED_CHAT_MODELS = /* @__PURE__ */ new Set([
|
|
1784
1861
|
"claude-sonnet-5",
|
|
1862
|
+
"claude-sonnet-5.5",
|
|
1785
1863
|
"claude-sonnet-4.6",
|
|
1786
1864
|
"claude-opus-4.8",
|
|
1865
|
+
"claude-opus-5.5",
|
|
1787
1866
|
"gpt-5.2",
|
|
1788
1867
|
"gpt-5.5",
|
|
1789
1868
|
"gpt-5-mini",
|
|
1869
|
+
"gpt-5.6-luna",
|
|
1870
|
+
"gpt-6-luna",
|
|
1790
1871
|
"gpt-oss-120b",
|
|
1791
1872
|
"gpt-oss-20b",
|
|
1792
1873
|
"qwen3-235b-a22b-2507",
|
|
@@ -1802,7 +1883,9 @@ var ALLOWED_CHAT_MODELS = /* @__PURE__ */ new Set([
|
|
|
1802
1883
|
"gemini-3.1-pro-preview",
|
|
1803
1884
|
"gemini-3-flash-preview",
|
|
1804
1885
|
"grok-4.3-fast",
|
|
1805
|
-
"grok-4.3"
|
|
1886
|
+
"grok-4.3",
|
|
1887
|
+
"grok-4.7",
|
|
1888
|
+
"kimi-k3"
|
|
1806
1889
|
]);
|
|
1807
1890
|
function validateChatModel(model) {
|
|
1808
1891
|
if (!ALLOWED_CHAT_MODELS.has(model)) {
|
|
@@ -1964,7 +2047,7 @@ var CustomContextItemsResource = class {
|
|
|
1964
2047
|
*
|
|
1965
2048
|
* @param options.pageSize - Maximum items per page (default 25).
|
|
1966
2049
|
* @param options.pageToken - Opaque token from a previous page.
|
|
1967
|
-
* @param options.searchQuery -
|
|
2050
|
+
* @param options.searchQuery - Word search: returns rows that contain every word of the query, case-insensitive.
|
|
1968
2051
|
* @param options.topics - Filter to items tagged with any of these topics.
|
|
1969
2052
|
* @returns A page of custom context items.
|
|
1970
2053
|
* @example
|
|
@@ -2027,12 +2110,16 @@ var CustomContextItemsResource = class {
|
|
|
2027
2110
|
* @example
|
|
2028
2111
|
* ```ts
|
|
2029
2112
|
* const client = new Modus()
|
|
2113
|
+
* // Create the source and collection first, or use batchCreate as shown below.
|
|
2030
2114
|
* const created = await client.context.customItems.create({
|
|
2031
2115
|
* kind: 'entity',
|
|
2032
|
-
* sourceId: '
|
|
2116
|
+
* sourceId: 'billing-db',
|
|
2117
|
+
* collectionId: 'contracts',
|
|
2118
|
+
* externalId: 'contract-123',
|
|
2033
2119
|
* name: 'Q3 churn notes',
|
|
2034
2120
|
* content: { summary: 'Key findings…' },
|
|
2035
2121
|
* })
|
|
2122
|
+
* console.log(created.uid, created.dataPath)
|
|
2036
2123
|
* ```
|
|
2037
2124
|
*/
|
|
2038
2125
|
async create(input) {
|
|
@@ -2052,9 +2139,22 @@ var CustomContextItemsResource = class {
|
|
|
2052
2139
|
* ```ts
|
|
2053
2140
|
* const client = new Modus()
|
|
2054
2141
|
* const created = await client.context.customItems.batchCreate([
|
|
2055
|
-
* { kind: '
|
|
2056
|
-
* {
|
|
2142
|
+
* { kind: 'source', sourceId: 'billing-db', name: 'Billing database' },
|
|
2143
|
+
* {
|
|
2144
|
+
* kind: 'collection',
|
|
2145
|
+
* sourceId: 'billing-db',
|
|
2146
|
+
* collectionId: 'contracts',
|
|
2147
|
+
* name: 'Contracts',
|
|
2148
|
+
* },
|
|
2149
|
+
* {
|
|
2150
|
+
* kind: 'entity',
|
|
2151
|
+
* sourceId: 'billing-db',
|
|
2152
|
+
* collectionId: 'contracts',
|
|
2153
|
+
* externalId: 'contract-123',
|
|
2154
|
+
* name: 'Acme renewal',
|
|
2155
|
+
* },
|
|
2057
2156
|
* ])
|
|
2157
|
+
* console.log(created.map((item) => item.dataPath))
|
|
2058
2158
|
* ```
|
|
2059
2159
|
*/
|
|
2060
2160
|
async batchCreate(inputs) {
|
|
@@ -2136,31 +2236,31 @@ var CustomContextItemsResource = class {
|
|
|
2136
2236
|
}
|
|
2137
2237
|
};
|
|
2138
2238
|
|
|
2139
|
-
// src/resources/scopes/conversations.ts
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
}
|
|
2143
|
-
function parseConversation(raw) {
|
|
2144
|
-
return raw;
|
|
2145
|
-
}
|
|
2146
|
-
var ScopeConversationsResource = class {
|
|
2239
|
+
// src/_generated/resources/consumption/scopes/conversations.ts
|
|
2240
|
+
var ScopesConversationsResourceBase = class {
|
|
2241
|
+
/** @internal */
|
|
2147
2242
|
constructor(http, config, scopeId) {
|
|
2148
2243
|
this.http = http;
|
|
2149
2244
|
this.config = config;
|
|
2150
2245
|
this.scopeId = scopeId;
|
|
2151
2246
|
}
|
|
2152
2247
|
/**
|
|
2153
|
-
* List
|
|
2248
|
+
* List scope conversations.
|
|
2154
2249
|
*
|
|
2155
|
-
*
|
|
2156
|
-
*
|
|
2157
|
-
*
|
|
2158
|
-
*
|
|
2250
|
+
* Returns a page of conversation summaries (most recently updated first) for a scope. Use `id=0`
|
|
2251
|
+
* for your cross-scope recent history. Pass `nextPageToken` as `pageToken` to fetch the next
|
|
2252
|
+
* page.
|
|
2253
|
+
*
|
|
2254
|
+
* **Requires:** `scopes:read`
|
|
2255
|
+
*
|
|
2256
|
+
* @param options.pageSize - Items per page. Defaults to 25.
|
|
2257
|
+
* @param options.pageToken - Opaque page token from a previous response's `nextPageToken`. Omit
|
|
2258
|
+
* for the first page.
|
|
2259
|
+
* @param options.source - Return only conversations started from this UI surface.
|
|
2159
2260
|
* @param options.sourceRef - Narrow `source` to one instance of that surface — for
|
|
2160
|
-
* `
|
|
2161
|
-
*
|
|
2162
|
-
*
|
|
2163
|
-
* @returns Page of conversation list items (`threadId`, `firstMessage`, `messageCount`).
|
|
2261
|
+
* `dashboard_copilot` or `dashboard_assistant`, a dashboard id (both scope conversation history
|
|
2262
|
+
* per dashboard). Requires `source`; sent alone it is a 422.
|
|
2263
|
+
* @returns A page of conversations.
|
|
2164
2264
|
*
|
|
2165
2265
|
* @example
|
|
2166
2266
|
* ```ts
|
|
@@ -2190,10 +2290,17 @@ var ScopeConversationsResource = class {
|
|
|
2190
2290
|
return buildAipPage(
|
|
2191
2291
|
data,
|
|
2192
2292
|
"conversations",
|
|
2193
|
-
|
|
2293
|
+
(raw) => raw,
|
|
2194
2294
|
(token) => this.listPage(pageSize, token, source, sourceRef)
|
|
2195
2295
|
);
|
|
2196
2296
|
}
|
|
2297
|
+
};
|
|
2298
|
+
|
|
2299
|
+
// src/resources/scopes/conversations.ts
|
|
2300
|
+
function parseConversation(raw) {
|
|
2301
|
+
return raw;
|
|
2302
|
+
}
|
|
2303
|
+
var ScopeConversationsResource = class extends ScopesConversationsResourceBase {
|
|
2197
2304
|
/**
|
|
2198
2305
|
* Retrieve a thread with full message history.
|
|
2199
2306
|
*
|
|
@@ -2259,4 +2366,4 @@ export {
|
|
|
2259
2366
|
CustomContextItemsResource,
|
|
2260
2367
|
ScopeConversationsResource
|
|
2261
2368
|
};
|
|
2262
|
-
//# sourceMappingURL=chunk-
|
|
2369
|
+
//# sourceMappingURL=chunk-SP4UYRYG.js.map
|