@getmodus/sdk 0.3.0 → 0.5.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.
@@ -1,4 +1,4 @@
1
- import { H as HttpClient, M as ModusConfig, c as components, W as WorkflowType, n as OperationId, V as VariationView, P as Page, a as Workflow, C as ContextItem, y as ContextItemDeletion, d as CustomContextItemsResource, z as CreatedContextItem, S as ScopeConversationsResource, h as Scope, i as ModusClientBase, j as ModusOptions } from '../conversations-GNBMPpyr.js';
1
+ import { H as HttpClient, M as ModusConfig, c as components, W as WorkflowType, n as OperationId, V as VariationView, P as Page, a as Workflow, C as ContextItem, y as ContextItemDeletion, d as CustomContextItemsResource, z as CreatedContextItem, S as ScopeConversationsResource, h as Scope, i as ModusClientBase, j as ModusOptions } from '../conversations-Pe3kNikF.js';
2
2
 
3
3
  type AgentInterface = components['schemas']['AgentInterfaceDto'];
4
4
  type AddAgentInterface = components['schemas']['AddAgentInterfaceDto'];
@@ -8,10 +8,31 @@ declare class WorkflowInterfacesResource {
8
8
  private readonly config;
9
9
  private readonly workflowId;
10
10
  constructor(http: HttpClient, config: ModusConfig, workflowId: number | string);
11
+ /** List interfaces attached to this workflow. */
11
12
  list(): Promise<AgentInterface[]>;
13
+ /**
14
+ * Add an interface to this workflow.
15
+ *
16
+ * @param options - Interface configuration to attach.
17
+ * @returns The created interface.
18
+ */
12
19
  create(options: AddAgentInterface): Promise<AgentInterface>;
20
+ /**
21
+ * Update an interface attached to this workflow.
22
+ *
23
+ * @param interfaceId - Interface id.
24
+ * @param options - Updated interface values.
25
+ * @param updateMask - Optional comma-separated field names to update.
26
+ * @returns The updated interface.
27
+ */
13
28
  update(interfaceId: string, options: UpdateAgentInterface, updateMask?: string): Promise<AgentInterface>;
29
+ /**
30
+ * Delete an interface from this workflow.
31
+ *
32
+ * @param interfaceId - Interface id.
33
+ */
14
34
  delete(interfaceId: string): Promise<void>;
35
+ /** Delete every interface from this workflow. */
15
36
  deleteAll(): Promise<void>;
16
37
  }
17
38
 
@@ -60,6 +81,17 @@ declare class ManagementWorkflowsResource {
60
81
  private readonly config;
61
82
  protected readonly ops: ManagementWorkflowsOperations;
62
83
  constructor(http: HttpClient, config: ModusConfig);
84
+ /**
85
+ * List workflows in the organization.
86
+ *
87
+ * @param options.pageSize - Maximum items per page (default 25).
88
+ * @param options.pageToken - Token from a previous page's `nextPageToken`; omit for the first page.
89
+ * @param options.search - Case-insensitive substring filter on the workflow name.
90
+ * @param options.type - Filter by workflow type: `"task"` or `"workflow"`.
91
+ * @param options.view - Variation view: `"active"` (deployed) or `"draft"`.
92
+ * @param options.includeVariation - Include variation payload on each list row.
93
+ * @returns A page of workflows.
94
+ */
63
95
  list(options?: {
64
96
  pageSize?: number;
65
97
  pageToken?: string;
@@ -69,22 +101,98 @@ declare class ManagementWorkflowsResource {
69
101
  includeVariation?: boolean;
70
102
  }): Promise<Page<Workflow>>;
71
103
  private listPage;
104
+ /**
105
+ * Retrieve a workflow with full configuration.
106
+ *
107
+ * @param workflowId - Workflow id.
108
+ * @param options.view - Variation view: `"active"` (deployed) or `"draft"`.
109
+ * @returns The workflow.
110
+ */
72
111
  get(workflowId: number | string, options?: {
73
112
  view?: VariationView;
74
113
  }): Promise<Workflow>;
114
+ /**
115
+ * Interfaces attached to a workflow.
116
+ *
117
+ * @param workflowId - Workflow id.
118
+ * @returns An interfaces resource scoped to the workflow.
119
+ */
75
120
  interfaces(workflowId: number | string): WorkflowInterfacesResource;
121
+ /**
122
+ * Create a new workflow in the organization.
123
+ *
124
+ * @param options.name - Display name for the workflow.
125
+ * @param options.type - `"task"` for single-step orchestration, or `"workflow"` for a multi-step graph.
126
+ * @param options.trigger - Optional trigger configuration.
127
+ * @param options.guardrails - Runtime guardrail labels (for example `"no-pii"`). Omit to create with no guardrails.
128
+ * @returns The created workflow (draft).
129
+ * @example
130
+ * ```ts
131
+ * const wf = await mgmt.workflows.create({ name: 'Daily report', type: WorkflowType.Task })
132
+ * ```
133
+ */
76
134
  create(options: CreateWorkflowOptions): Promise<Workflow>;
135
+ /**
136
+ * Update a workflow's configuration.
137
+ *
138
+ * Only the fields you pass are changed. To clear a field, name it in
139
+ * `updateMask` and leave its argument unset.
140
+ *
141
+ * @param workflowId - Workflow id.
142
+ * @param options.guardrails - Guardrail labels to set. Fetches the current workflow first to merge. Pass `[]` to clear all.
143
+ * @param options.updateMask - Comma-separated field names to update or clear.
144
+ * @returns The updated workflow.
145
+ */
77
146
  update(workflowId: number | string, options?: UpdateWorkflowOptions): Promise<Workflow>;
147
+ /**
148
+ * Publish the current draft of a workflow.
149
+ *
150
+ * @param workflowId - Workflow id.
151
+ * @returns The published workflow.
152
+ * @example
153
+ * ```ts
154
+ * await mgmt.workflows.update(workflowId, { description: 'Runs every morning' })
155
+ * const published = await mgmt.workflows.deploy(workflowId)
156
+ * ```
157
+ */
78
158
  deploy(workflowId: number | string): Promise<Workflow>;
159
+ /**
160
+ * Enable or disable a workflow without deleting it.
161
+ *
162
+ * @param workflowId - Workflow id.
163
+ * @param options.active - `true` to activate, `false` to deactivate.
164
+ * @returns The updated workflow.
165
+ */
79
166
  toggle(workflowId: number | string, options: {
80
167
  active: boolean;
81
168
  }): Promise<Workflow>;
169
+ /**
170
+ * Delete a workflow.
171
+ *
172
+ * @param workflowId - Workflow id.
173
+ * @returns Resolves when the workflow is deleted.
174
+ */
82
175
  delete(workflowId: number | string): Promise<void>;
176
+ /**
177
+ * Restore a previously deleted workflow.
178
+ *
179
+ * @param workflowId - Workflow id.
180
+ * @returns The restored workflow.
181
+ */
83
182
  restore(workflowId: number | string): Promise<Workflow>;
183
+ /**
184
+ * Start transferring ownership of a workflow to another organization member.
185
+ *
186
+ * @param workflowId - Workflow id.
187
+ * @param options.newOwnerUserId - User id of the proposed new owner.
188
+ * @returns The workflow with a pending ownership transfer.
189
+ */
84
190
  requestOwnershipTransfer(workflowId: number | string, options: {
85
191
  newOwnerUserId: string;
86
192
  }): Promise<Workflow>;
193
+ /** Cancel a pending workflow ownership transfer. */
87
194
  cancelOwnershipTransfer(workflowId: number | string): Promise<Workflow>;
195
+ /** Accept a pending workflow ownership transfer. */
88
196
  acceptOwnershipTransfer(workflowId: number | string): Promise<Workflow>;
89
197
  }
90
198
 
@@ -92,13 +200,42 @@ declare class ManagementContextItemsResource {
92
200
  private readonly http;
93
201
  private readonly config;
94
202
  constructor(http: HttpClient, config: ModusConfig);
203
+ /**
204
+ * List context items in the knowledge base.
205
+ *
206
+ * @param options.pageSize - Items per page (default 25).
207
+ * @param options.pageToken - Token from a previous page's `nextPageToken`.
208
+ * @param options.contextType - Filter to one context type (for example `"note"`).
209
+ * @returns A page of context items.
210
+ */
95
211
  list(options?: {
96
212
  pageSize?: number;
97
213
  pageToken?: string;
98
214
  contextType?: string;
99
215
  }): Promise<Page<ContextItem>>;
100
216
  private listPage;
217
+ /**
218
+ * Retrieve one context item by uid.
219
+ *
220
+ * @param uid - Context item uid.
221
+ * @returns The context item.
222
+ */
101
223
  get(uid: string): Promise<ContextItem>;
224
+ /**
225
+ * Update a context item.
226
+ *
227
+ * Only the fields you pass are changed. To clear a field, name it in
228
+ * `updateMask` and leave its argument unset.
229
+ *
230
+ * @param uid - Context item uid.
231
+ * @param options.content - Replacement type-specific content.
232
+ * @param options.contextType - Item type (for example `"note"`). Required when `content` is supplied.
233
+ * @param options.description - New description.
234
+ * @param options.userFeedback - Feedback verdict: `"positive"`, `"neutral"`, or `"negative"`.
235
+ * @param options.topics - Replacement topic tags. Pass `[]` to clear all tags.
236
+ * @param options.updateMask - Comma-separated field names to update or clear.
237
+ * @returns The updated context item.
238
+ */
102
239
  update(uid: string, options?: {
103
240
  content?: unknown;
104
241
  contextType?: string;
@@ -107,19 +244,53 @@ declare class ManagementContextItemsResource {
107
244
  topics?: string[];
108
245
  updateMask?: string;
109
246
  }): Promise<ContextItem>;
247
+ /**
248
+ * Delete a context item.
249
+ *
250
+ * @param uid - Context item uid.
251
+ * @returns Deletion confirmation details.
252
+ */
110
253
  delete(uid: string): Promise<ContextItemDeletion>;
111
254
  }
112
255
 
113
256
  type UserFeedback = 'positive' | 'neutral' | 'negative';
114
257
 
258
+ /**
259
+ * Create and update context items (notes, links, saved queries).
260
+ *
261
+ * Call path: `mgmt.context` after `new ModusManagement(...)`.
262
+ */
115
263
  declare class ManagementContextResource {
116
264
  private readonly http;
117
265
  private readonly config;
118
266
  readonly items: ManagementContextItemsResource;
119
267
  readonly customItems: CustomContextItemsResource;
268
+ /** @internal */
120
269
  constructor(http: HttpClient, config: ModusConfig);
121
- private create;
270
+ /**
271
+ * Add a free-form text note to the knowledge base.
272
+ *
273
+ * @param title - Note title.
274
+ * @param content - Note body (markdown).
275
+ * @returns The created context item.
276
+ * @example
277
+ * ```ts
278
+ * const note = await mgmt.context.createNote('Runbook', '# Steps\n1. Check logs')
279
+ * ```
280
+ */
122
281
  createNote(title: string, content: string): Promise<CreatedContextItem>;
282
+ /**
283
+ * Update a note's title and markdown body.
284
+ *
285
+ * Preserves server-owned fields on the existing content blob. Pass `existing`
286
+ * to skip a fetch when you already have the item from a list call.
287
+ *
288
+ * @param uid - Context item uid.
289
+ * @param options.title - New title.
290
+ * @param options.body - New markdown body.
291
+ * @param options.existing - Optional cached item to avoid a GET.
292
+ * @returns The updated context item.
293
+ */
123
294
  updateNote(uid: string, options: {
124
295
  title: string;
125
296
  body: string;
@@ -128,12 +299,30 @@ declare class ManagementContextResource {
128
299
  userFeedback?: UserFeedback;
129
300
  topics?: string[];
130
301
  }): Promise<ContextItem>;
302
+ /**
303
+ * Save a SQL query to the knowledge base.
304
+ *
305
+ * @param name - Display name for the query.
306
+ * @param options.connectionId - Connection the query runs against.
307
+ * @param options.query - SQL text.
308
+ * @param options.path - Optional hierarchy path segments.
309
+ * @returns The created context item.
310
+ */
131
311
  createSavedQuery(name: string, options: {
132
312
  query?: string;
133
313
  connectionId: string;
134
314
  description?: string;
135
315
  path?: string[];
136
316
  }): Promise<CreatedContextItem>;
317
+ /**
318
+ * Update a saved query's name, SQL, and optional connection metadata.
319
+ *
320
+ * @param uid - Context item uid.
321
+ * @param options.name - New display name.
322
+ * @param options.query - New SQL text.
323
+ * @param options.existing - Optional cached item to avoid a GET.
324
+ * @returns The updated context item.
325
+ */
137
326
  updateSavedQuery(uid: string, options: {
138
327
  name: string;
139
328
  query: string;
@@ -144,11 +333,31 @@ declare class ManagementContextResource {
144
333
  userFeedback?: UserFeedback;
145
334
  topics?: string[];
146
335
  }): Promise<ContextItem>;
336
+ /**
337
+ * Add a URL to the knowledge base.
338
+ *
339
+ * @param url - Link URL.
340
+ * @param options.title - Optional display title.
341
+ * @param options.isCrawl - When true, crawl linked pages into context.
342
+ * @param options.pageLimit - Maximum pages to crawl when `isCrawl` is true.
343
+ * @returns The created context item.
344
+ */
147
345
  createLink(url: string, options?: {
148
346
  title?: string;
149
347
  isCrawl?: boolean;
150
348
  pageLimit?: number;
151
349
  }): Promise<CreatedContextItem>;
350
+ /**
351
+ * Update link metadata on an existing item.
352
+ *
353
+ * Merges `title` and/or `url` into the stored content blob. Does not re-fetch or re-crawl the URL.
354
+ *
355
+ * @param uid - Context item uid.
356
+ * @param options.title - New display title.
357
+ * @param options.url - New URL.
358
+ * @param options.existing - Optional cached item to avoid a GET.
359
+ * @returns The updated context item.
360
+ */
152
361
  updateLink(uid: string, options: {
153
362
  title?: string;
154
363
  url?: string;
@@ -157,6 +366,8 @@ declare class ManagementContextResource {
157
366
  userFeedback?: UserFeedback;
158
367
  topics?: string[];
159
368
  }): Promise<ContextItem>;
369
+ /** @internal */
370
+ private create;
160
371
  }
161
372
 
162
373
  type JsonObjectInput = Record<string, unknown>;
@@ -178,22 +389,45 @@ type MemorySearchRequest = components['schemas']['SearchMemoriesRequestDto'];
178
389
  type MemoryUpdate = components['schemas']['UpdateMemoryRequestDto'];
179
390
  type MemorySearchResult = components['schemas']['ListMemoriesResponseDto'];
180
391
 
181
- /** Long-term memory stored per scope (`/api/v1/scopes/{id}/memories`). */
392
+ /** Long-term memory stored per scope. */
182
393
  declare class ScopeMemoriesResource {
183
394
  private readonly http;
184
395
  private readonly config;
185
396
  private readonly scopeId;
186
397
  constructor(http: HttpClient, config: ModusConfig, scopeId: number | string);
398
+ /**
399
+ * List memories stored for this scope.
400
+ *
401
+ * @param options.pageSize - Items per page (default 25).
402
+ * @param options.pageToken - Token from a previous page's `nextPageToken`.
403
+ * @param options.userId - Optional end-user id when memories are scoped per user.
404
+ * @returns A page of memories.
405
+ */
187
406
  list(options?: {
188
407
  pageSize?: number;
189
408
  pageToken?: string;
190
409
  userId?: string;
191
410
  }): Promise<Page<Memory>>;
192
411
  private listPage;
412
+ /**
413
+ * Search this scope's memories by natural-language query.
414
+ *
415
+ * @param request - Query text and optional `userId` / `limit`.
416
+ * @returns Matching memories and relevance scores.
417
+ */
193
418
  search(request: MemorySearchRequest): Promise<MemorySearchResult>;
419
+ /**
420
+ * Update one memory. Requires manage permission on the scope.
421
+ *
422
+ * @param memoryId - Id from list or search.
423
+ * @param update - Fields to change (`memory` and/or `metadata`).
424
+ * @param options.updateMask - Optional comma-separated field names to update.
425
+ * @returns The updated memory.
426
+ */
194
427
  update(memoryId: string, update: MemoryUpdate, options?: {
195
428
  updateMask?: string;
196
429
  }): Promise<Memory>;
430
+ /** Delete one memory (idempotent). */
197
431
  delete(memoryId: string): Promise<void>;
198
432
  }
199
433
 
@@ -203,20 +437,45 @@ type EvaluationRun = components['schemas']['EvaluationRunDto'];
203
437
  type EvaluationRunWithResults = components['schemas']['EvaluationRunWithResultsDto'];
204
438
  type TriggerEvaluationRunResponse = components['schemas']['TriggerEvaluationRunResponseDto'];
205
439
 
206
- /** Scheduled and manual scope evaluations (`/api/v1/scopes/{id}/evaluations`). */
440
+ /** Scheduled and manual scope evaluations. */
207
441
  declare class ScopeEvaluationsResource {
208
442
  private readonly http;
209
443
  private readonly config;
210
444
  private readonly scopeId;
211
445
  constructor(http: HttpClient, config: ModusConfig, scopeId: number | string);
446
+ /** Get the evaluation configuration for this scope. */
212
447
  getConfig(): Promise<EvaluationConfig>;
448
+ /**
449
+ * Update the evaluation configuration for this scope.
450
+ *
451
+ * @param update - Configuration fields to change.
452
+ * @returns The updated evaluation configuration.
453
+ */
213
454
  updateConfig(update: UpdateEvaluationConfig): Promise<EvaluationConfig>;
455
+ /**
456
+ * Trigger a manual evaluation run for this scope.
457
+ *
458
+ * @returns The triggered run id and status.
459
+ */
214
460
  triggerRun(): Promise<TriggerEvaluationRunResponse>;
461
+ /**
462
+ * List evaluation runs for this scope.
463
+ *
464
+ * @param options.pageSize - Items per page (default 25).
465
+ * @param options.pageToken - Token from a previous page's `nextPageToken`.
466
+ * @returns A page of evaluation runs.
467
+ */
215
468
  listRuns(options?: {
216
469
  pageSize?: number;
217
470
  pageToken?: string;
218
471
  }): Promise<Page<EvaluationRun>>;
219
472
  private listRunsPage;
473
+ /**
474
+ * Retrieve one evaluation run with full results.
475
+ *
476
+ * @param runId - Evaluation run id.
477
+ * @returns The run and its result details.
478
+ */
220
479
  getRun(runId: string): Promise<EvaluationRunWithResults>;
221
480
  }
222
481
 
@@ -227,10 +486,28 @@ declare class ScopeSupervisionResource {
227
486
  private readonly config;
228
487
  private readonly scopeId;
229
488
  constructor(http: HttpClient, config: ModusConfig, scopeId: number | string);
489
+ /**
490
+ * Get this scope's supervision configuration.
491
+ *
492
+ * @param options.view - Optional scope variation to inspect.
493
+ * @returns The supervision configuration.
494
+ */
230
495
  get(options?: {
231
496
  view?: VariationView;
232
497
  }): Promise<Supervision>;
498
+ /**
499
+ * Replace this scope's subordinate scopes.
500
+ *
501
+ * @param request - Replacement supervision configuration.
502
+ * @returns The updated supervision configuration.
503
+ */
233
504
  set(request: SetSupervisionRequest): Promise<Supervision>;
505
+ /**
506
+ * Replace subordinate scopes on the active (deployed) scope version.
507
+ *
508
+ * @param request - Replacement supervision configuration.
509
+ * @returns The updated supervision configuration.
510
+ */
234
511
  setActive(request: SetSupervisionRequest): Promise<Supervision>;
235
512
  private write;
236
513
  }
@@ -282,16 +559,55 @@ interface UpdateScopeOptions {
282
559
  }
283
560
  /** @deprecated Use `UpdateScopeOptions` instead. */
284
561
  type UpdateSkillOptions = UpdateScopeOptions;
285
- /** Full CRUD and lifecycle for Modus scopes (`/api/v1/scopes`). */
562
+ /**
563
+ * Full CRUD and lifecycle for Modus scopes.
564
+ *
565
+ * Call path: `mgmt.scopes` after `new ModusManagement(...)`.
566
+ */
286
567
  declare class ManagementScopesResource {
287
568
  private readonly http;
288
569
  private readonly config;
289
570
  protected readonly ops: ManagementScopesOperations;
571
+ /** @internal */
290
572
  constructor(http: HttpClient, config: ModusConfig);
573
+ /**
574
+ * Conversations for a scope.
575
+ *
576
+ * @param scopeId - Scope id.
577
+ * @returns A conversations resource scoped to the scope.
578
+ */
291
579
  conversations(scopeId: number | string): ScopeConversationsResource;
580
+ /**
581
+ * Long-term memories for a scope.
582
+ *
583
+ * @param scopeId - Scope id.
584
+ * @returns A memories resource scoped to the scope.
585
+ */
292
586
  memories(scopeId: number | string): ScopeMemoriesResource;
587
+ /**
588
+ * Evaluations for a scope.
589
+ *
590
+ * @param scopeId - Scope id.
591
+ * @returns An evaluations resource scoped to the scope.
592
+ */
293
593
  evaluations(scopeId: number | string): ScopeEvaluationsResource;
594
+ /**
595
+ * Supervision (subordinate scopes) for a scope.
596
+ *
597
+ * @param scopeId - Scope id.
598
+ * @returns A supervision resource scoped to the scope.
599
+ */
294
600
  supervision(scopeId: number | string): ScopeSupervisionResource;
601
+ /**
602
+ * List scopes in the organization.
603
+ *
604
+ * @param options.pageSize - Maximum items per page (default 25).
605
+ * @param options.pageToken - Token from a previous page's `nextPageToken`; omit for the first page.
606
+ * @param options.search - Case-insensitive substring filter on the scope name.
607
+ * @param options.view - Variation view: `"active"` (deployed) or `"draft"`.
608
+ * @param options.managerId - Return only scopes supervised by this manager scope id.
609
+ * @returns A page of scopes.
610
+ */
295
611
  list(options?: {
296
612
  pageSize?: number;
297
613
  pageToken?: string;
@@ -300,22 +616,100 @@ declare class ManagementScopesResource {
300
616
  managerId?: number;
301
617
  }): Promise<Page<Scope>>;
302
618
  private listPage;
619
+ /**
620
+ * Retrieve a scope with full configuration.
621
+ *
622
+ * @param scopeId - Scope id.
623
+ * @param options.view - Variation view: `"active"` (deployed) or `"draft"`.
624
+ * @returns The scope.
625
+ */
303
626
  get(scopeId: number | string, options?: {
304
627
  view?: VariationView;
305
628
  }): Promise<Scope>;
629
+ /**
630
+ * Create a new scope in the organization.
631
+ *
632
+ * @param options.name - Display name for the scope.
633
+ * @param options.description - Optional description.
634
+ * @param options.instructions - Optional system instructions.
635
+ * @param options.model - Optional model id.
636
+ * @param options.toolset - Optional tool selection for the scope.
637
+ * @param options.guardrails - Runtime guardrail labels (for example `"no-pii"`). Omit to create with no guardrails.
638
+ * @returns The created scope (draft).
639
+ * @example
640
+ * ```ts
641
+ * const scope = await mgmt.scopes.create({ name: 'Support assistant', model: 'claude-sonnet-5' })
642
+ * ```
643
+ */
306
644
  create(options: CreateScopeOptions): Promise<Scope>;
645
+ /**
646
+ * Update a scope's configuration.
647
+ *
648
+ * Only the fields you pass are changed. To clear a field, name it in
649
+ * `updateMask` (comma-separated field names) and leave its argument unset.
650
+ *
651
+ * @param scopeId - Scope id.
652
+ * @param options.guardrails - Guardrail labels to set. Fetches the current scope first to merge. Pass `[]` to clear all.
653
+ * @param options.updateMask - Comma-separated field names to update or clear.
654
+ * @returns The updated scope.
655
+ */
307
656
  update(scopeId: number | string, options?: UpdateScopeOptions): Promise<Scope>;
657
+ /**
658
+ * Publish the current draft of a scope.
659
+ *
660
+ * @param scopeId - Scope id.
661
+ * @returns The published scope.
662
+ * @example
663
+ * ```ts
664
+ * await mgmt.scopes.update(scopeId, { instructions: ['Be concise.'] })
665
+ * const published = await mgmt.scopes.deploy(scopeId)
666
+ * ```
667
+ */
308
668
  deploy(scopeId: number | string): Promise<Scope>;
669
+ /**
670
+ * Delete a scope.
671
+ *
672
+ * @param scopeId - Scope id.
673
+ * @returns Resolves when the scope is deleted.
674
+ */
309
675
  delete(scopeId: number | string): Promise<void>;
676
+ /**
677
+ * Restore a previously deleted scope.
678
+ *
679
+ * @param scopeId - Scope id.
680
+ * @returns The restored scope.
681
+ */
310
682
  restore(scopeId: number | string): Promise<Scope>;
683
+ /**
684
+ * Start transferring ownership of a scope to another organization member.
685
+ *
686
+ * @param scopeId - Scope id.
687
+ * @param options.newOwnerUserId - User id of the proposed new owner.
688
+ * @returns The scope with a pending ownership transfer.
689
+ */
311
690
  requestOwnershipTransfer(scopeId: number | string, options: {
312
691
  newOwnerUserId: string;
313
692
  }): Promise<Scope>;
693
+ /** Cancel a pending scope ownership transfer. */
314
694
  cancelOwnershipTransfer(scopeId: number | string): Promise<Scope>;
695
+ /** Accept a pending scope ownership transfer. */
315
696
  acceptOwnershipTransfer(scopeId: number | string): Promise<Scope>;
697
+ /**
698
+ * Update MCP server configuration for a scope.
699
+ *
700
+ * @param scopeId - Scope id.
701
+ * @param options.mcpConfig - MCP configuration object.
702
+ */
316
703
  patchMcpConfig(scopeId: number | string, options: {
317
704
  mcpConfig: Record<string, unknown>;
318
705
  }): Promise<void>;
706
+ /**
707
+ * Retrieve a specific scope variation by uid.
708
+ *
709
+ * @param scopeId - Scope id.
710
+ * @param options.variationUid - Variation uid.
711
+ * @returns The scope variation.
712
+ */
319
713
  getVariation(scopeId: number | string, options: {
320
714
  variationUid: string;
321
715
  }): Promise<Scope>;
@@ -329,6 +723,18 @@ declare class ManagementUsageResource {
329
723
  private readonly http;
330
724
  private readonly config;
331
725
  constructor(http: HttpClient, config: ModusConfig);
726
+ /**
727
+ * List usage metrics for your organization over a time window.
728
+ *
729
+ * @param options.since - Start of the window (ISO 8601, inclusive).
730
+ * @param options.until - End of the window (ISO 8601, exclusive).
731
+ * @param options.rollup - Bucket size for each row: `"hour"` or `"day"`.
732
+ * @param options.model - Optional filter to a single model name.
733
+ * @param options.userEmail - Optional filter to one or more acting-user emails.
734
+ * @returns Usage report rows for the window.
735
+ * @throws {UnprocessableError} When the request is rejected by the API.
736
+ * @throws {AuthenticationError} When the API key is invalid or missing.
737
+ */
332
738
  list(options: {
333
739
  since: string;
334
740
  until: string;
@@ -336,28 +742,66 @@ declare class ManagementUsageResource {
336
742
  model?: string;
337
743
  userEmail?: readonly string[];
338
744
  }): Promise<UsageReport>;
745
+ /**
746
+ * List distinct acting-user emails observed in a time window.
747
+ *
748
+ * @param options.since - Start of the window (ISO 8601, inclusive).
749
+ * @param options.until - End of the window (ISO 8601, exclusive).
750
+ * @returns User emails seen in usage during the window.
751
+ * @throws {UnprocessableError} When the request is rejected by the API.
752
+ * @throws {AuthenticationError} When the API key is invalid or missing.
753
+ */
339
754
  listUsers(options: {
340
755
  since: string;
341
756
  until: string;
342
757
  }): Promise<UsageUsersReport>;
343
758
  }
344
759
 
760
+ type ToolCatalogEntry = components['schemas']['ToolCatalogEntryDto'];
761
+
762
+ declare class ManagementToolsResource {
763
+ private readonly http;
764
+ private readonly config;
765
+ constructor(http: HttpClient, config: ModusConfig);
766
+ /**
767
+ * List tool and integration surfaces a scope can select in its toolset.
768
+ *
769
+ * @param options.pageSize - Maximum items per page (default 25).
770
+ * @param options.pageToken - Token from a previous page's `nextPageToken`; omit for the first page.
771
+ * @returns A page of tool catalog entries.
772
+ */
773
+ list(options?: {
774
+ pageSize?: number;
775
+ pageToken?: string;
776
+ }): Promise<Page<ToolCatalogEntry>>;
777
+ private listPage;
778
+ }
779
+
345
780
  type MemberGroup = components['schemas']['MemberGroupDto'];
346
781
  type OrgMember = components['schemas']['OrgMemberDto'];
347
782
  declare class ManagementUsersResource {
348
783
  private readonly http;
349
784
  private readonly config;
350
785
  constructor(http: HttpClient, config: ModusConfig);
786
+ /** List member groups in the organization. */
351
787
  listMemberGroups(): Promise<MemberGroup[]>;
788
+ /** List organization members. */
352
789
  listOrgMembers(): Promise<OrgMember[]>;
353
790
  }
354
791
 
355
- /** Configure scopes, workflows, context, usage, and users. */
792
+ /**
793
+ * Configure scopes, workflows, context, usage, tools, and users.
794
+ *
795
+ * Call path: `const mgmt = new ModusManagement(...)` then `mgmt.scopes`, `mgmt.context`, …
796
+ *
797
+ * @param options - Client configuration (`apiKey`, `baseUrl`, `timeoutMs`, `maxRetries`).
798
+ */
356
799
  declare class ModusManagement extends ModusClientBase {
357
800
  readonly scopes: ManagementScopesResource;
358
801
  readonly workflows: ManagementWorkflowsResource;
359
802
  readonly context: ManagementContextResource;
360
803
  readonly usage: ManagementUsageResource;
804
+ readonly tools: ManagementToolsResource;
361
805
  readonly users: ManagementUsersResource;
362
806
  constructor(options?: ModusOptions);
363
807
  }