@getmodus/sdk 0.7.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.
- package/CHANGELOG.md +44 -0
- package/README.md +21 -2
- package/dist/{chunk-JMFT5KO5.js → chunk-GFS7CNON.js} +90 -17
- package/dist/chunk-GFS7CNON.js.map +1 -0
- package/dist/{conversations-B0_jmEuT.d.cts → conversations-COA6NW8I.d.cts} +1318 -169
- package/dist/{conversations-B0_jmEuT.d.ts → conversations-COA6NW8I.d.ts} +1318 -169
- package/dist/index.cjs +139 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -6
- package/dist/index.d.ts +39 -6
- package/dist/index.js +51 -7
- package/dist/index.js.map +1 -1
- package/dist/management/index.cjs +279 -32
- package/dist/management/index.cjs.map +1 -1
- package/dist/management/index.d.cts +137 -11
- package/dist/management/index.d.ts +137 -11
- package/dist/management/index.js +198 -18
- package/dist/management/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-JMFT5KO5.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as HttpClient, M as ModusConfig, c as components, W as WorkflowType,
|
|
1
|
+
import { H as HttpClient, M as ModusConfig, c as components, W as WorkflowType, q as OperationId, V as VariationView, P as Page, a as Workflow, C as ContextItem, m as ContextItemDeletion, n as ContextItemMove, d as CustomContextItemsResource, D as CreatedContextItem, S as ScopeConversationsResource, h as Scope, i as ModusClientBase, j as ModusOptions } from '../conversations-COA6NW8I.cjs';
|
|
2
2
|
|
|
3
3
|
type AgentInterface = components['schemas']['AgentInterfaceDto'];
|
|
4
4
|
type AddAgentInterface = components['schemas']['AddAgentInterfaceDto'];
|
|
@@ -231,12 +231,34 @@ declare class ManagementContextItemsResource {
|
|
|
231
231
|
* @param options.pageSize - Items per page (default 25).
|
|
232
232
|
* @param options.pageToken - Token from a previous page's `nextPageToken`.
|
|
233
233
|
* @param options.contextType - Filter to one context type (for example `"note"`).
|
|
234
|
+
* @param options.parentUids - Exact ordered native ancestry chain for direct
|
|
235
|
+
* children. Omit to leave parent unrestricted; pass `[]` for the known-empty
|
|
236
|
+
* root. Native UIDs are exact tokens; for a folder's children send ancestry
|
|
237
|
+
* UIDs plus the last `dataPath` token, not the hashed context-item `uid`.
|
|
238
|
+
* @param options.ancestorUids - Ordered UID ancestry prefix for strict
|
|
239
|
+
* descendants. Omit to leave unrestricted; pass `[]` for every item with
|
|
240
|
+
* non-null ancestry.
|
|
241
|
+
* @param options.connectionIds - Restrict to these connection ids. Omit to
|
|
242
|
+
* leave unfiltered; pass `[]` to match none. The Files root is
|
|
243
|
+
* `connectionIds: ['files']` with `parentUids: []`.
|
|
234
244
|
* @returns A page of context items.
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```ts
|
|
248
|
+
* const rootFiles = await mgmt.context.items.list({
|
|
249
|
+
* connectionIds: ['files'],
|
|
250
|
+
* contextType: 'file_upload',
|
|
251
|
+
* parentUids: [],
|
|
252
|
+
* })
|
|
253
|
+
* ```
|
|
235
254
|
*/
|
|
236
255
|
list(options?: {
|
|
237
256
|
pageSize?: number;
|
|
238
257
|
pageToken?: string;
|
|
239
258
|
contextType?: string;
|
|
259
|
+
parentUids?: readonly string[];
|
|
260
|
+
ancestorUids?: readonly string[];
|
|
261
|
+
connectionIds?: readonly string[];
|
|
240
262
|
}): Promise<Page<ContextItem>>;
|
|
241
263
|
private listPage;
|
|
242
264
|
/**
|
|
@@ -270,12 +292,41 @@ declare class ManagementContextItemsResource {
|
|
|
270
292
|
updateMask?: string;
|
|
271
293
|
}): Promise<ContextItem>;
|
|
272
294
|
/**
|
|
273
|
-
* Delete a context item.
|
|
295
|
+
* Delete a context item. Deleting a Files folder also deletes all its contents.
|
|
274
296
|
*
|
|
275
297
|
* @param uid - Context item uid.
|
|
276
298
|
* @returns Deletion confirmation details.
|
|
277
299
|
*/
|
|
278
300
|
delete(uid: string): Promise<ContextItemDeletion>;
|
|
301
|
+
/**
|
|
302
|
+
* Move a live file or Files folder.
|
|
303
|
+
*
|
|
304
|
+
* Pass `destinationFolderUid: null` to move to the Files root. The
|
|
305
|
+
* destination folder must already exist. Same-parent moves succeed as a
|
|
306
|
+
* no-op. Does not rename or merge folders.
|
|
307
|
+
*
|
|
308
|
+
* @param uid - Stored context-item uid of the file or folder to move.
|
|
309
|
+
* @param options.destinationFolderUid - Stored context-item uid of the
|
|
310
|
+
* destination folder, or `null` for the Files root.
|
|
311
|
+
* @returns How many items changed parent (`0` is a successful no-op).
|
|
312
|
+
* @throws {NotFoundError} The source is missing or not visible.
|
|
313
|
+
* @throws {ModusError} The destination is missing, not a Files folder, or
|
|
314
|
+
* the move would create a cycle (HTTP 400).
|
|
315
|
+
* @throws {PermissionDeniedError} The destination exists but is not writable
|
|
316
|
+
* for this caller.
|
|
317
|
+
* @throws {ConflictError} A sibling with the same name already exists.
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* ```ts
|
|
321
|
+
* const moved = await mgmt.context.items.move('PLACEHOLDER_UID', {
|
|
322
|
+
* destinationFolderUid: 'PLACEHOLDER_FOLDER_UID',
|
|
323
|
+
* })
|
|
324
|
+
* console.log(moved.movedItems)
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
move(uid: string, options: {
|
|
328
|
+
destinationFolderUid: string | null;
|
|
329
|
+
}): Promise<ContextItemMove>;
|
|
279
330
|
}
|
|
280
331
|
|
|
281
332
|
type UserFeedback = 'positive' | 'neutral' | 'negative';
|
|
@@ -758,6 +809,12 @@ interface BulkFinalizeResult {
|
|
|
758
809
|
failed: FinalizeFailure[];
|
|
759
810
|
}
|
|
760
811
|
|
|
812
|
+
type BatchUploadOptions = {
|
|
813
|
+
concurrency?: number;
|
|
814
|
+
waitUntil?: WaitUntil;
|
|
815
|
+
onProgress?: UploadProgressCallback;
|
|
816
|
+
folderPath?: string;
|
|
817
|
+
};
|
|
761
818
|
/**
|
|
762
819
|
* Durable file uploads for `ModusManagement`.
|
|
763
820
|
*
|
|
@@ -765,6 +822,7 @@ interface BulkFinalizeResult {
|
|
|
765
822
|
*
|
|
766
823
|
* - `upload(path)` / `uploadDir(dirPath)` — presign + PUT + poll convenience helpers.
|
|
767
824
|
* - `createUploadUrl(s)`, `uploadFromUrl(s)`, `get`, `list` — raw operations.
|
|
825
|
+
* Hierarchy browsing is available through `mgmt.context.items.list`.
|
|
768
826
|
*/
|
|
769
827
|
declare class ManagementContextFilesResource {
|
|
770
828
|
private readonly http;
|
|
@@ -779,7 +837,7 @@ declare class ManagementContextFilesResource {
|
|
|
779
837
|
* Office/OpenDocument documents, audio, and video.
|
|
780
838
|
* @param input.fileSize - File size in bytes. Rejected above 50MB.
|
|
781
839
|
* @returns Presigned upload slot. PUT the raw bytes to `uploadUrl` within 15
|
|
782
|
-
* minutes, then call `finalize(slot.uploadId, slot.fileName)`. Pass the
|
|
840
|
+
* minutes, sending `headers` unchanged, then call `finalize(slot.uploadId, slot.fileName)`. Pass the
|
|
783
841
|
* slot's own `fileName` rather than your local basename — the server may
|
|
784
842
|
* sanitize the requested name when it mints the key, and finalization
|
|
785
843
|
* re-derives the key from `uploadId` and `fileName`.
|
|
@@ -799,6 +857,7 @@ declare class ManagementContextFilesResource {
|
|
|
799
857
|
* @param url - Source URL to fetch (SSRF-guarded, 50MB cap, same MIME
|
|
800
858
|
* allow-list as `createUploadUrl`).
|
|
801
859
|
* @param options.fileName - Override file name. Inferred from the URL path when omitted.
|
|
860
|
+
* @param options.folderPath - Root-relative folder to upload under.
|
|
802
861
|
* @returns File upload resource with status `processing` — parsing continues async.
|
|
803
862
|
*/
|
|
804
863
|
uploadFromUrl(url: string, options?: {
|
|
@@ -868,30 +927,44 @@ declare class ManagementContextFilesResource {
|
|
|
868
927
|
* @param options.concurrency - Max concurrent PUTs (default 10).
|
|
869
928
|
* @param options.waitUntil - `"processing"` (default) or `"ready"`.
|
|
870
929
|
* @param options.onProgress - Optional progress callback after each file.
|
|
930
|
+
* @param options.folderPath - Root-relative folder to upload under. Nested
|
|
931
|
+
* files keep their existing relative folder labels under this prefix.
|
|
932
|
+
* @example
|
|
933
|
+
* ```ts
|
|
934
|
+
* const mgmt = new ModusManagement()
|
|
935
|
+
* const result = await mgmt.context.files.uploadFiles(
|
|
936
|
+
* ['./q3.pdf', './notes.md'],
|
|
937
|
+
* { folderPath: 'reports/2026' },
|
|
938
|
+
* )
|
|
939
|
+
* ```
|
|
871
940
|
*/
|
|
872
|
-
uploadFiles(paths: readonly (string | UploadFileInput)[], options?:
|
|
873
|
-
concurrency?: number;
|
|
874
|
-
waitUntil?: WaitUntil;
|
|
875
|
-
onProgress?: UploadProgressCallback;
|
|
876
|
-
}): Promise<UploadDirResult>;
|
|
941
|
+
uploadFiles(paths: readonly (string | UploadFileInput)[], options?: BatchUploadOptions): Promise<UploadDirResult>;
|
|
877
942
|
/**
|
|
878
943
|
* Upload a local file and wait for it to reach `"processing"` or `"ready"`.
|
|
879
944
|
*
|
|
880
|
-
* Gets a presigned URL, PUTs the file bytes, then polls `get()`
|
|
881
|
-
* upload leaves `"pending"` (or reaches `"ready"`/`"failed"`).
|
|
945
|
+
* Gets a presigned URL, PUTs the file bytes, then polls `get()`
|
|
946
|
+
* until the upload leaves `"pending"` (or reaches `"ready"`/`"failed"`).
|
|
882
947
|
*
|
|
883
948
|
* @param path - Path to a local file.
|
|
884
949
|
* @param options.waitUntil - `"processing"` (parsing started, default) or
|
|
885
950
|
* `"ready"` (parsing finished).
|
|
886
951
|
* @param options.pollIntervalMs - Milliseconds between status polls.
|
|
887
952
|
* @param options.timeoutMs - Max milliseconds to wait before raising.
|
|
953
|
+
* @param options.folderPath - Root-relative folder to upload under. Example:
|
|
954
|
+
* `{ folderPath: 'reports/2026' }` places `./report.pdf` at `reports/2026`.
|
|
888
955
|
* @returns The file upload resource once it reaches `waitUntil` (or `"failed"`).
|
|
889
956
|
* @throws {ModusError} If the PUT fails, or polling times out.
|
|
957
|
+
* @example
|
|
958
|
+
* ```ts
|
|
959
|
+
* const mgmt = new ModusManagement()
|
|
960
|
+
* const file = await mgmt.context.files.upload('./report.pdf', { folderPath: 'reports/2026' })
|
|
961
|
+
* ```
|
|
890
962
|
*/
|
|
891
963
|
upload(path: string, options?: {
|
|
892
964
|
waitUntil?: WaitUntil;
|
|
893
965
|
pollIntervalMs?: number;
|
|
894
966
|
timeoutMs?: number;
|
|
967
|
+
folderPath?: string;
|
|
895
968
|
}): Promise<FileUpload>;
|
|
896
969
|
private pollUntil;
|
|
897
970
|
/**
|
|
@@ -907,14 +980,24 @@ declare class ManagementContextFilesResource {
|
|
|
907
980
|
* @param options.concurrency - Max concurrent PUT+poll operations (default 10).
|
|
908
981
|
* @param options.waitUntil - `"processing"` (default) or `"ready"` — same as `upload()`.
|
|
909
982
|
* @param options.onProgress - Optional progress callback after each file.
|
|
983
|
+
* @param options.folderPath - Root-relative folder to upload under. Nested
|
|
984
|
+
* files keep their path relative to `path` under this prefix. Example:
|
|
985
|
+
* `uploadDir('./docs', { folderPath: 'reports' })` places `./docs/a.txt` at
|
|
986
|
+
* `reports` and `./docs/nested/b.txt` at `reports/nested`.
|
|
910
987
|
* @returns `UploadDirResult` with every successful `FileUpload` and every
|
|
911
988
|
* per-file failure (slot creation or PUT/poll), each tagged with its local path.
|
|
989
|
+
* @example
|
|
990
|
+
* ```ts
|
|
991
|
+
* const mgmt = new ModusManagement()
|
|
992
|
+
* const result = await mgmt.context.files.uploadDir('./docs', { folderPath: 'reports' })
|
|
993
|
+
* ```
|
|
912
994
|
*/
|
|
913
995
|
uploadDir(path: string, options?: {
|
|
914
996
|
recursive?: boolean;
|
|
915
997
|
concurrency?: number;
|
|
916
998
|
waitUntil?: WaitUntil;
|
|
917
999
|
onProgress?: UploadProgressCallback;
|
|
1000
|
+
folderPath?: string;
|
|
918
1001
|
}): Promise<UploadDirResult>;
|
|
919
1002
|
/** Shared body of `uploadFiles` and `uploadDir`: presign in batches of 100,
|
|
920
1003
|
* PUT with bounded concurrency, then bulk-finalize the batch. */
|
|
@@ -1188,6 +1271,40 @@ declare class ScopeEvaluationsResource {
|
|
|
1188
1271
|
getRun(runId: string): Promise<EvaluationRunWithResults>;
|
|
1189
1272
|
}
|
|
1190
1273
|
|
|
1274
|
+
type ScopeInterface = components['schemas']['ScopeInterfaceDto'];
|
|
1275
|
+
type AddScopeInterface = components['schemas']['AddScopeInterfaceDto'];
|
|
1276
|
+
type UpdateScopeInterface = components['schemas']['UpdateScopeInterfaceDto'];
|
|
1277
|
+
declare class ScopeInterfacesResource {
|
|
1278
|
+
private readonly http;
|
|
1279
|
+
private readonly config;
|
|
1280
|
+
private readonly scopeId;
|
|
1281
|
+
constructor(http: HttpClient, config: ModusConfig, scopeId: number | string);
|
|
1282
|
+
/** List the Slack and Microsoft Teams interfaces on this scope. */
|
|
1283
|
+
list(): Promise<ScopeInterface[]>;
|
|
1284
|
+
/**
|
|
1285
|
+
* Add a Slack or Microsoft Teams interface to this scope.
|
|
1286
|
+
*
|
|
1287
|
+
* @param options - Interface type, optional name and config.
|
|
1288
|
+
* @returns The created interface.
|
|
1289
|
+
*/
|
|
1290
|
+
create(options: AddScopeInterface): Promise<ScopeInterface>;
|
|
1291
|
+
/**
|
|
1292
|
+
* Update an interface on this scope.
|
|
1293
|
+
*
|
|
1294
|
+
* @param interfaceId - Interface id.
|
|
1295
|
+
* @param options - Updated name and/or config.
|
|
1296
|
+
* @param updateMask - Optional comma-separated field names to update.
|
|
1297
|
+
* @returns The updated interface.
|
|
1298
|
+
*/
|
|
1299
|
+
update(interfaceId: string, options: UpdateScopeInterface, updateMask?: string): Promise<ScopeInterface>;
|
|
1300
|
+
/**
|
|
1301
|
+
* Remove an interface from this scope.
|
|
1302
|
+
*
|
|
1303
|
+
* @param interfaceId - Interface id.
|
|
1304
|
+
*/
|
|
1305
|
+
delete(interfaceId: string): Promise<void>;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1191
1308
|
type Supervision = components['schemas']['SupervisionDto'];
|
|
1192
1309
|
type SetSupervisionRequest = components['schemas']['SetSupervisionRequestDto'];
|
|
1193
1310
|
declare class ScopeSupervisionResource {
|
|
@@ -1245,6 +1362,7 @@ interface CreateScopeOptions {
|
|
|
1245
1362
|
model?: string;
|
|
1246
1363
|
connectionSet?: JsonObjectListInput;
|
|
1247
1364
|
contextSelections?: JsonObjectListInput;
|
|
1365
|
+
includeOwnLearnings?: boolean;
|
|
1248
1366
|
interfaces?: JsonObjectListInput;
|
|
1249
1367
|
guardrails?: string[];
|
|
1250
1368
|
}
|
|
@@ -1307,6 +1425,13 @@ declare class ManagementScopesResource {
|
|
|
1307
1425
|
* @returns A supervision resource scoped to the scope.
|
|
1308
1426
|
*/
|
|
1309
1427
|
supervision(scopeId: number | string): ScopeSupervisionResource;
|
|
1428
|
+
/**
|
|
1429
|
+
* Slack and Microsoft Teams interfaces for a scope.
|
|
1430
|
+
*
|
|
1431
|
+
* @param scopeId - Scope id.
|
|
1432
|
+
* @returns An interfaces resource scoped to the scope.
|
|
1433
|
+
*/
|
|
1434
|
+
interfaces(scopeId: number | string): ScopeInterfacesResource;
|
|
1310
1435
|
/**
|
|
1311
1436
|
* List scopes in the organization.
|
|
1312
1437
|
*
|
|
@@ -1356,6 +1481,7 @@ declare class ManagementScopesResource {
|
|
|
1356
1481
|
* @param options.instructions - Optional system instructions.
|
|
1357
1482
|
* @param options.model - Optional model id.
|
|
1358
1483
|
* @param options.toolset - Optional tool selection for the scope.
|
|
1484
|
+
* @param options.includeOwnLearnings - Whether the scope reads what is taught while using it. Defaults to true.
|
|
1359
1485
|
* @param options.guardrails - Runtime guardrail labels (for example `"no-pii"`). Omit to create with no guardrails.
|
|
1360
1486
|
* @returns The created scope (draft).
|
|
1361
1487
|
* @example
|
|
@@ -1544,4 +1670,4 @@ declare class ModusManagement extends ModusClientBase {
|
|
|
1544
1670
|
constructor(options?: ModusOptions);
|
|
1545
1671
|
}
|
|
1546
1672
|
|
|
1547
|
-
export { type AgentSelectionInput, type BulkUploadFromUrlsResult, type BulkUploadUrlsResult, type CreateAgentOptions, type CreateDashboardElementInput, type CreateDashboardInput, type CreateScopeOptions, type CreateSkillOptions, type CreateWorkflowOptions, type Dashboard, type DashboardDraftSnapshot, type DashboardElementKind, type DashboardElementLayout, type DashboardElementPatch, type DashboardElementResult, type DashboardElementSummary, type DashboardElementsList, type DashboardLayoutElement, type DashboardPublishResult, type DashboardVersion, type DashboardView, type FailedUploadFromUrl, type FailedUploadUrl, type FileUpload, type FileUploadStatus, type FinalizeInput, type Memory, type MemorySearchRequest, type MemorySearchResult, type MemoryUpdate, ModusManagement, ModusOptions, type PublishDashboardInput, type ToolsetInput, type TransferDashboardOwnershipInput, type TriggerInput, type UpdateAgentOptions, type UpdateDashboardAccessInput, type UpdateDashboardDraftInput, type UpdateDashboardElementInput, type UpdateDashboardLayoutInput, type UpdateScopeOptions, type UpdateSkillOptions, type UpdateWorkflowOptions, type UploadDirFailure, type UploadDirResult, type UploadFileInput, type UploadFromUrlInput, type UploadProgress, type UploadProgressCallback, type UploadUrlInput, type UploadUrlSlot, type UserFeedback, type WaitUntil, type WorkflowGraphInput };
|
|
1673
|
+
export { type AgentSelectionInput, type BulkUploadFromUrlsResult, type BulkUploadUrlsResult, ContextItemDeletion, ContextItemMove, type CreateAgentOptions, type CreateDashboardElementInput, type CreateDashboardInput, type CreateScopeOptions, type CreateSkillOptions, type CreateWorkflowOptions, type Dashboard, type DashboardDraftSnapshot, type DashboardElementKind, type DashboardElementLayout, type DashboardElementPatch, type DashboardElementResult, type DashboardElementSummary, type DashboardElementsList, type DashboardLayoutElement, type DashboardPublishResult, type DashboardVersion, type DashboardView, type FailedUploadFromUrl, type FailedUploadUrl, type FileUpload, type FileUploadStatus, type FinalizeInput, type Memory, type MemorySearchRequest, type MemorySearchResult, type MemoryUpdate, ModusManagement, ModusOptions, type PublishDashboardInput, type ToolsetInput, type TransferDashboardOwnershipInput, type TriggerInput, type UpdateAgentOptions, type UpdateDashboardAccessInput, type UpdateDashboardDraftInput, type UpdateDashboardElementInput, type UpdateDashboardLayoutInput, type UpdateScopeOptions, type UpdateSkillOptions, type UpdateWorkflowOptions, type UploadDirFailure, type UploadDirResult, type UploadFileInput, type UploadFromUrlInput, type UploadProgress, type UploadProgressCallback, type UploadUrlInput, type UploadUrlSlot, type UserFeedback, type WaitUntil, type WorkflowGraphInput };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as HttpClient, M as ModusConfig, c as components, W as WorkflowType,
|
|
1
|
+
import { H as HttpClient, M as ModusConfig, c as components, W as WorkflowType, q as OperationId, V as VariationView, P as Page, a as Workflow, C as ContextItem, m as ContextItemDeletion, n as ContextItemMove, d as CustomContextItemsResource, D as CreatedContextItem, S as ScopeConversationsResource, h as Scope, i as ModusClientBase, j as ModusOptions } from '../conversations-COA6NW8I.js';
|
|
2
2
|
|
|
3
3
|
type AgentInterface = components['schemas']['AgentInterfaceDto'];
|
|
4
4
|
type AddAgentInterface = components['schemas']['AddAgentInterfaceDto'];
|
|
@@ -231,12 +231,34 @@ declare class ManagementContextItemsResource {
|
|
|
231
231
|
* @param options.pageSize - Items per page (default 25).
|
|
232
232
|
* @param options.pageToken - Token from a previous page's `nextPageToken`.
|
|
233
233
|
* @param options.contextType - Filter to one context type (for example `"note"`).
|
|
234
|
+
* @param options.parentUids - Exact ordered native ancestry chain for direct
|
|
235
|
+
* children. Omit to leave parent unrestricted; pass `[]` for the known-empty
|
|
236
|
+
* root. Native UIDs are exact tokens; for a folder's children send ancestry
|
|
237
|
+
* UIDs plus the last `dataPath` token, not the hashed context-item `uid`.
|
|
238
|
+
* @param options.ancestorUids - Ordered UID ancestry prefix for strict
|
|
239
|
+
* descendants. Omit to leave unrestricted; pass `[]` for every item with
|
|
240
|
+
* non-null ancestry.
|
|
241
|
+
* @param options.connectionIds - Restrict to these connection ids. Omit to
|
|
242
|
+
* leave unfiltered; pass `[]` to match none. The Files root is
|
|
243
|
+
* `connectionIds: ['files']` with `parentUids: []`.
|
|
234
244
|
* @returns A page of context items.
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```ts
|
|
248
|
+
* const rootFiles = await mgmt.context.items.list({
|
|
249
|
+
* connectionIds: ['files'],
|
|
250
|
+
* contextType: 'file_upload',
|
|
251
|
+
* parentUids: [],
|
|
252
|
+
* })
|
|
253
|
+
* ```
|
|
235
254
|
*/
|
|
236
255
|
list(options?: {
|
|
237
256
|
pageSize?: number;
|
|
238
257
|
pageToken?: string;
|
|
239
258
|
contextType?: string;
|
|
259
|
+
parentUids?: readonly string[];
|
|
260
|
+
ancestorUids?: readonly string[];
|
|
261
|
+
connectionIds?: readonly string[];
|
|
240
262
|
}): Promise<Page<ContextItem>>;
|
|
241
263
|
private listPage;
|
|
242
264
|
/**
|
|
@@ -270,12 +292,41 @@ declare class ManagementContextItemsResource {
|
|
|
270
292
|
updateMask?: string;
|
|
271
293
|
}): Promise<ContextItem>;
|
|
272
294
|
/**
|
|
273
|
-
* Delete a context item.
|
|
295
|
+
* Delete a context item. Deleting a Files folder also deletes all its contents.
|
|
274
296
|
*
|
|
275
297
|
* @param uid - Context item uid.
|
|
276
298
|
* @returns Deletion confirmation details.
|
|
277
299
|
*/
|
|
278
300
|
delete(uid: string): Promise<ContextItemDeletion>;
|
|
301
|
+
/**
|
|
302
|
+
* Move a live file or Files folder.
|
|
303
|
+
*
|
|
304
|
+
* Pass `destinationFolderUid: null` to move to the Files root. The
|
|
305
|
+
* destination folder must already exist. Same-parent moves succeed as a
|
|
306
|
+
* no-op. Does not rename or merge folders.
|
|
307
|
+
*
|
|
308
|
+
* @param uid - Stored context-item uid of the file or folder to move.
|
|
309
|
+
* @param options.destinationFolderUid - Stored context-item uid of the
|
|
310
|
+
* destination folder, or `null` for the Files root.
|
|
311
|
+
* @returns How many items changed parent (`0` is a successful no-op).
|
|
312
|
+
* @throws {NotFoundError} The source is missing or not visible.
|
|
313
|
+
* @throws {ModusError} The destination is missing, not a Files folder, or
|
|
314
|
+
* the move would create a cycle (HTTP 400).
|
|
315
|
+
* @throws {PermissionDeniedError} The destination exists but is not writable
|
|
316
|
+
* for this caller.
|
|
317
|
+
* @throws {ConflictError} A sibling with the same name already exists.
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* ```ts
|
|
321
|
+
* const moved = await mgmt.context.items.move('PLACEHOLDER_UID', {
|
|
322
|
+
* destinationFolderUid: 'PLACEHOLDER_FOLDER_UID',
|
|
323
|
+
* })
|
|
324
|
+
* console.log(moved.movedItems)
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
move(uid: string, options: {
|
|
328
|
+
destinationFolderUid: string | null;
|
|
329
|
+
}): Promise<ContextItemMove>;
|
|
279
330
|
}
|
|
280
331
|
|
|
281
332
|
type UserFeedback = 'positive' | 'neutral' | 'negative';
|
|
@@ -758,6 +809,12 @@ interface BulkFinalizeResult {
|
|
|
758
809
|
failed: FinalizeFailure[];
|
|
759
810
|
}
|
|
760
811
|
|
|
812
|
+
type BatchUploadOptions = {
|
|
813
|
+
concurrency?: number;
|
|
814
|
+
waitUntil?: WaitUntil;
|
|
815
|
+
onProgress?: UploadProgressCallback;
|
|
816
|
+
folderPath?: string;
|
|
817
|
+
};
|
|
761
818
|
/**
|
|
762
819
|
* Durable file uploads for `ModusManagement`.
|
|
763
820
|
*
|
|
@@ -765,6 +822,7 @@ interface BulkFinalizeResult {
|
|
|
765
822
|
*
|
|
766
823
|
* - `upload(path)` / `uploadDir(dirPath)` — presign + PUT + poll convenience helpers.
|
|
767
824
|
* - `createUploadUrl(s)`, `uploadFromUrl(s)`, `get`, `list` — raw operations.
|
|
825
|
+
* Hierarchy browsing is available through `mgmt.context.items.list`.
|
|
768
826
|
*/
|
|
769
827
|
declare class ManagementContextFilesResource {
|
|
770
828
|
private readonly http;
|
|
@@ -779,7 +837,7 @@ declare class ManagementContextFilesResource {
|
|
|
779
837
|
* Office/OpenDocument documents, audio, and video.
|
|
780
838
|
* @param input.fileSize - File size in bytes. Rejected above 50MB.
|
|
781
839
|
* @returns Presigned upload slot. PUT the raw bytes to `uploadUrl` within 15
|
|
782
|
-
* minutes, then call `finalize(slot.uploadId, slot.fileName)`. Pass the
|
|
840
|
+
* minutes, sending `headers` unchanged, then call `finalize(slot.uploadId, slot.fileName)`. Pass the
|
|
783
841
|
* slot's own `fileName` rather than your local basename — the server may
|
|
784
842
|
* sanitize the requested name when it mints the key, and finalization
|
|
785
843
|
* re-derives the key from `uploadId` and `fileName`.
|
|
@@ -799,6 +857,7 @@ declare class ManagementContextFilesResource {
|
|
|
799
857
|
* @param url - Source URL to fetch (SSRF-guarded, 50MB cap, same MIME
|
|
800
858
|
* allow-list as `createUploadUrl`).
|
|
801
859
|
* @param options.fileName - Override file name. Inferred from the URL path when omitted.
|
|
860
|
+
* @param options.folderPath - Root-relative folder to upload under.
|
|
802
861
|
* @returns File upload resource with status `processing` — parsing continues async.
|
|
803
862
|
*/
|
|
804
863
|
uploadFromUrl(url: string, options?: {
|
|
@@ -868,30 +927,44 @@ declare class ManagementContextFilesResource {
|
|
|
868
927
|
* @param options.concurrency - Max concurrent PUTs (default 10).
|
|
869
928
|
* @param options.waitUntil - `"processing"` (default) or `"ready"`.
|
|
870
929
|
* @param options.onProgress - Optional progress callback after each file.
|
|
930
|
+
* @param options.folderPath - Root-relative folder to upload under. Nested
|
|
931
|
+
* files keep their existing relative folder labels under this prefix.
|
|
932
|
+
* @example
|
|
933
|
+
* ```ts
|
|
934
|
+
* const mgmt = new ModusManagement()
|
|
935
|
+
* const result = await mgmt.context.files.uploadFiles(
|
|
936
|
+
* ['./q3.pdf', './notes.md'],
|
|
937
|
+
* { folderPath: 'reports/2026' },
|
|
938
|
+
* )
|
|
939
|
+
* ```
|
|
871
940
|
*/
|
|
872
|
-
uploadFiles(paths: readonly (string | UploadFileInput)[], options?:
|
|
873
|
-
concurrency?: number;
|
|
874
|
-
waitUntil?: WaitUntil;
|
|
875
|
-
onProgress?: UploadProgressCallback;
|
|
876
|
-
}): Promise<UploadDirResult>;
|
|
941
|
+
uploadFiles(paths: readonly (string | UploadFileInput)[], options?: BatchUploadOptions): Promise<UploadDirResult>;
|
|
877
942
|
/**
|
|
878
943
|
* Upload a local file and wait for it to reach `"processing"` or `"ready"`.
|
|
879
944
|
*
|
|
880
|
-
* Gets a presigned URL, PUTs the file bytes, then polls `get()`
|
|
881
|
-
* upload leaves `"pending"` (or reaches `"ready"`/`"failed"`).
|
|
945
|
+
* Gets a presigned URL, PUTs the file bytes, then polls `get()`
|
|
946
|
+
* until the upload leaves `"pending"` (or reaches `"ready"`/`"failed"`).
|
|
882
947
|
*
|
|
883
948
|
* @param path - Path to a local file.
|
|
884
949
|
* @param options.waitUntil - `"processing"` (parsing started, default) or
|
|
885
950
|
* `"ready"` (parsing finished).
|
|
886
951
|
* @param options.pollIntervalMs - Milliseconds between status polls.
|
|
887
952
|
* @param options.timeoutMs - Max milliseconds to wait before raising.
|
|
953
|
+
* @param options.folderPath - Root-relative folder to upload under. Example:
|
|
954
|
+
* `{ folderPath: 'reports/2026' }` places `./report.pdf` at `reports/2026`.
|
|
888
955
|
* @returns The file upload resource once it reaches `waitUntil` (or `"failed"`).
|
|
889
956
|
* @throws {ModusError} If the PUT fails, or polling times out.
|
|
957
|
+
* @example
|
|
958
|
+
* ```ts
|
|
959
|
+
* const mgmt = new ModusManagement()
|
|
960
|
+
* const file = await mgmt.context.files.upload('./report.pdf', { folderPath: 'reports/2026' })
|
|
961
|
+
* ```
|
|
890
962
|
*/
|
|
891
963
|
upload(path: string, options?: {
|
|
892
964
|
waitUntil?: WaitUntil;
|
|
893
965
|
pollIntervalMs?: number;
|
|
894
966
|
timeoutMs?: number;
|
|
967
|
+
folderPath?: string;
|
|
895
968
|
}): Promise<FileUpload>;
|
|
896
969
|
private pollUntil;
|
|
897
970
|
/**
|
|
@@ -907,14 +980,24 @@ declare class ManagementContextFilesResource {
|
|
|
907
980
|
* @param options.concurrency - Max concurrent PUT+poll operations (default 10).
|
|
908
981
|
* @param options.waitUntil - `"processing"` (default) or `"ready"` — same as `upload()`.
|
|
909
982
|
* @param options.onProgress - Optional progress callback after each file.
|
|
983
|
+
* @param options.folderPath - Root-relative folder to upload under. Nested
|
|
984
|
+
* files keep their path relative to `path` under this prefix. Example:
|
|
985
|
+
* `uploadDir('./docs', { folderPath: 'reports' })` places `./docs/a.txt` at
|
|
986
|
+
* `reports` and `./docs/nested/b.txt` at `reports/nested`.
|
|
910
987
|
* @returns `UploadDirResult` with every successful `FileUpload` and every
|
|
911
988
|
* per-file failure (slot creation or PUT/poll), each tagged with its local path.
|
|
989
|
+
* @example
|
|
990
|
+
* ```ts
|
|
991
|
+
* const mgmt = new ModusManagement()
|
|
992
|
+
* const result = await mgmt.context.files.uploadDir('./docs', { folderPath: 'reports' })
|
|
993
|
+
* ```
|
|
912
994
|
*/
|
|
913
995
|
uploadDir(path: string, options?: {
|
|
914
996
|
recursive?: boolean;
|
|
915
997
|
concurrency?: number;
|
|
916
998
|
waitUntil?: WaitUntil;
|
|
917
999
|
onProgress?: UploadProgressCallback;
|
|
1000
|
+
folderPath?: string;
|
|
918
1001
|
}): Promise<UploadDirResult>;
|
|
919
1002
|
/** Shared body of `uploadFiles` and `uploadDir`: presign in batches of 100,
|
|
920
1003
|
* PUT with bounded concurrency, then bulk-finalize the batch. */
|
|
@@ -1188,6 +1271,40 @@ declare class ScopeEvaluationsResource {
|
|
|
1188
1271
|
getRun(runId: string): Promise<EvaluationRunWithResults>;
|
|
1189
1272
|
}
|
|
1190
1273
|
|
|
1274
|
+
type ScopeInterface = components['schemas']['ScopeInterfaceDto'];
|
|
1275
|
+
type AddScopeInterface = components['schemas']['AddScopeInterfaceDto'];
|
|
1276
|
+
type UpdateScopeInterface = components['schemas']['UpdateScopeInterfaceDto'];
|
|
1277
|
+
declare class ScopeInterfacesResource {
|
|
1278
|
+
private readonly http;
|
|
1279
|
+
private readonly config;
|
|
1280
|
+
private readonly scopeId;
|
|
1281
|
+
constructor(http: HttpClient, config: ModusConfig, scopeId: number | string);
|
|
1282
|
+
/** List the Slack and Microsoft Teams interfaces on this scope. */
|
|
1283
|
+
list(): Promise<ScopeInterface[]>;
|
|
1284
|
+
/**
|
|
1285
|
+
* Add a Slack or Microsoft Teams interface to this scope.
|
|
1286
|
+
*
|
|
1287
|
+
* @param options - Interface type, optional name and config.
|
|
1288
|
+
* @returns The created interface.
|
|
1289
|
+
*/
|
|
1290
|
+
create(options: AddScopeInterface): Promise<ScopeInterface>;
|
|
1291
|
+
/**
|
|
1292
|
+
* Update an interface on this scope.
|
|
1293
|
+
*
|
|
1294
|
+
* @param interfaceId - Interface id.
|
|
1295
|
+
* @param options - Updated name and/or config.
|
|
1296
|
+
* @param updateMask - Optional comma-separated field names to update.
|
|
1297
|
+
* @returns The updated interface.
|
|
1298
|
+
*/
|
|
1299
|
+
update(interfaceId: string, options: UpdateScopeInterface, updateMask?: string): Promise<ScopeInterface>;
|
|
1300
|
+
/**
|
|
1301
|
+
* Remove an interface from this scope.
|
|
1302
|
+
*
|
|
1303
|
+
* @param interfaceId - Interface id.
|
|
1304
|
+
*/
|
|
1305
|
+
delete(interfaceId: string): Promise<void>;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1191
1308
|
type Supervision = components['schemas']['SupervisionDto'];
|
|
1192
1309
|
type SetSupervisionRequest = components['schemas']['SetSupervisionRequestDto'];
|
|
1193
1310
|
declare class ScopeSupervisionResource {
|
|
@@ -1245,6 +1362,7 @@ interface CreateScopeOptions {
|
|
|
1245
1362
|
model?: string;
|
|
1246
1363
|
connectionSet?: JsonObjectListInput;
|
|
1247
1364
|
contextSelections?: JsonObjectListInput;
|
|
1365
|
+
includeOwnLearnings?: boolean;
|
|
1248
1366
|
interfaces?: JsonObjectListInput;
|
|
1249
1367
|
guardrails?: string[];
|
|
1250
1368
|
}
|
|
@@ -1307,6 +1425,13 @@ declare class ManagementScopesResource {
|
|
|
1307
1425
|
* @returns A supervision resource scoped to the scope.
|
|
1308
1426
|
*/
|
|
1309
1427
|
supervision(scopeId: number | string): ScopeSupervisionResource;
|
|
1428
|
+
/**
|
|
1429
|
+
* Slack and Microsoft Teams interfaces for a scope.
|
|
1430
|
+
*
|
|
1431
|
+
* @param scopeId - Scope id.
|
|
1432
|
+
* @returns An interfaces resource scoped to the scope.
|
|
1433
|
+
*/
|
|
1434
|
+
interfaces(scopeId: number | string): ScopeInterfacesResource;
|
|
1310
1435
|
/**
|
|
1311
1436
|
* List scopes in the organization.
|
|
1312
1437
|
*
|
|
@@ -1356,6 +1481,7 @@ declare class ManagementScopesResource {
|
|
|
1356
1481
|
* @param options.instructions - Optional system instructions.
|
|
1357
1482
|
* @param options.model - Optional model id.
|
|
1358
1483
|
* @param options.toolset - Optional tool selection for the scope.
|
|
1484
|
+
* @param options.includeOwnLearnings - Whether the scope reads what is taught while using it. Defaults to true.
|
|
1359
1485
|
* @param options.guardrails - Runtime guardrail labels (for example `"no-pii"`). Omit to create with no guardrails.
|
|
1360
1486
|
* @returns The created scope (draft).
|
|
1361
1487
|
* @example
|
|
@@ -1544,4 +1670,4 @@ declare class ModusManagement extends ModusClientBase {
|
|
|
1544
1670
|
constructor(options?: ModusOptions);
|
|
1545
1671
|
}
|
|
1546
1672
|
|
|
1547
|
-
export { type AgentSelectionInput, type BulkUploadFromUrlsResult, type BulkUploadUrlsResult, type CreateAgentOptions, type CreateDashboardElementInput, type CreateDashboardInput, type CreateScopeOptions, type CreateSkillOptions, type CreateWorkflowOptions, type Dashboard, type DashboardDraftSnapshot, type DashboardElementKind, type DashboardElementLayout, type DashboardElementPatch, type DashboardElementResult, type DashboardElementSummary, type DashboardElementsList, type DashboardLayoutElement, type DashboardPublishResult, type DashboardVersion, type DashboardView, type FailedUploadFromUrl, type FailedUploadUrl, type FileUpload, type FileUploadStatus, type FinalizeInput, type Memory, type MemorySearchRequest, type MemorySearchResult, type MemoryUpdate, ModusManagement, ModusOptions, type PublishDashboardInput, type ToolsetInput, type TransferDashboardOwnershipInput, type TriggerInput, type UpdateAgentOptions, type UpdateDashboardAccessInput, type UpdateDashboardDraftInput, type UpdateDashboardElementInput, type UpdateDashboardLayoutInput, type UpdateScopeOptions, type UpdateSkillOptions, type UpdateWorkflowOptions, type UploadDirFailure, type UploadDirResult, type UploadFileInput, type UploadFromUrlInput, type UploadProgress, type UploadProgressCallback, type UploadUrlInput, type UploadUrlSlot, type UserFeedback, type WaitUntil, type WorkflowGraphInput };
|
|
1673
|
+
export { type AgentSelectionInput, type BulkUploadFromUrlsResult, type BulkUploadUrlsResult, ContextItemDeletion, ContextItemMove, type CreateAgentOptions, type CreateDashboardElementInput, type CreateDashboardInput, type CreateScopeOptions, type CreateSkillOptions, type CreateWorkflowOptions, type Dashboard, type DashboardDraftSnapshot, type DashboardElementKind, type DashboardElementLayout, type DashboardElementPatch, type DashboardElementResult, type DashboardElementSummary, type DashboardElementsList, type DashboardLayoutElement, type DashboardPublishResult, type DashboardVersion, type DashboardView, type FailedUploadFromUrl, type FailedUploadUrl, type FileUpload, type FileUploadStatus, type FinalizeInput, type Memory, type MemorySearchRequest, type MemorySearchResult, type MemoryUpdate, ModusManagement, ModusOptions, type PublishDashboardInput, type ToolsetInput, type TransferDashboardOwnershipInput, type TriggerInput, type UpdateAgentOptions, type UpdateDashboardAccessInput, type UpdateDashboardDraftInput, type UpdateDashboardElementInput, type UpdateDashboardLayoutInput, type UpdateScopeOptions, type UpdateSkillOptions, type UpdateWorkflowOptions, type UploadDirFailure, type UploadDirResult, type UploadFileInput, type UploadFromUrlInput, type UploadProgress, type UploadProgressCallback, type UploadUrlInput, type UploadUrlSlot, type UserFeedback, type WaitUntil, type WorkflowGraphInput };
|