@getmodus/sdk 0.2.3 → 0.4.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, A as AgentType, m as OperationId, V as VariationView, P as Page, a as Agent, C as ContextItem, t as ContextItemDeletion, d as CustomContextItemsResource, u as CreatedContextItem, S as ScopeConversationsResource, h as Skill, i as ModusClientBase, j as ModusOptions } from '../conversations-BP2sI3Q5.cjs';
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-Cq6OVlpQ.cjs';
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
 
@@ -32,18 +53,20 @@ interface ManagementWorkflowsOperations {
32
53
  readonly acceptOwnershipTransfer: OperationId;
33
54
  readonly toggle: OperationId;
34
55
  }
35
- interface CreateAgentOptions {
56
+ interface CreateWorkflowOptions {
36
57
  name: string;
37
- type: AgentType;
58
+ type: WorkflowType;
38
59
  description?: string;
39
60
  trigger?: TriggerInput;
40
61
  agentSelection?: AgentSelectionInput;
41
62
  workflowStructure?: WorkflowGraphInput;
42
63
  guardrails?: string[];
43
64
  }
44
- interface UpdateAgentOptions {
65
+ /** @deprecated Use `CreateWorkflowOptions` instead. */
66
+ type CreateAgentOptions = CreateWorkflowOptions;
67
+ interface UpdateWorkflowOptions {
45
68
  name?: string;
46
- type?: AgentType;
69
+ type?: WorkflowType;
47
70
  description?: string;
48
71
  trigger?: TriggerInput;
49
72
  agentSelection?: AgentSelectionInput;
@@ -51,50 +74,168 @@ interface UpdateAgentOptions {
51
74
  guardrails?: string[];
52
75
  updateMask?: string;
53
76
  }
77
+ /** @deprecated Use `UpdateWorkflowOptions` instead. */
78
+ type UpdateAgentOptions = UpdateWorkflowOptions;
54
79
  declare class ManagementWorkflowsResource {
55
80
  private readonly http;
56
81
  private readonly config;
57
82
  protected readonly ops: ManagementWorkflowsOperations;
58
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
+ */
59
95
  list(options?: {
60
96
  pageSize?: number;
61
97
  pageToken?: string;
62
98
  search?: string;
63
- type?: AgentType;
99
+ type?: WorkflowType;
64
100
  view?: VariationView;
65
101
  includeVariation?: boolean;
66
- }): Promise<Page<Agent>>;
102
+ }): Promise<Page<Workflow>>;
67
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
+ */
68
111
  get(workflowId: number | string, options?: {
69
112
  view?: VariationView;
70
- }): Promise<Agent>;
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
+ */
71
120
  interfaces(workflowId: number | string): WorkflowInterfacesResource;
72
- create(options: CreateAgentOptions): Promise<Agent>;
73
- update(workflowId: number | string, options?: UpdateAgentOptions): Promise<Agent>;
74
- deploy(workflowId: number | string): Promise<Agent>;
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
+ */
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
+ */
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
+ */
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
+ */
75
166
  toggle(workflowId: number | string, options: {
76
167
  active: boolean;
77
- }): Promise<Agent>;
168
+ }): Promise<Workflow>;
169
+ /**
170
+ * Delete a workflow.
171
+ *
172
+ * @param workflowId - Workflow id.
173
+ * @returns Resolves when the workflow is deleted.
174
+ */
78
175
  delete(workflowId: number | string): Promise<void>;
79
- restore(workflowId: number | string): Promise<Agent>;
176
+ /**
177
+ * Restore a previously deleted workflow.
178
+ *
179
+ * @param workflowId - Workflow id.
180
+ * @returns The restored workflow.
181
+ */
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
+ */
80
190
  requestOwnershipTransfer(workflowId: number | string, options: {
81
191
  newOwnerUserId: string;
82
- }): Promise<Agent>;
83
- cancelOwnershipTransfer(workflowId: number | string): Promise<Agent>;
84
- acceptOwnershipTransfer(workflowId: number | string): Promise<Agent>;
192
+ }): Promise<Workflow>;
193
+ /** Cancel a pending workflow ownership transfer. */
194
+ cancelOwnershipTransfer(workflowId: number | string): Promise<Workflow>;
195
+ /** Accept a pending workflow ownership transfer. */
196
+ acceptOwnershipTransfer(workflowId: number | string): Promise<Workflow>;
85
197
  }
86
198
 
87
199
  declare class ManagementContextItemsResource {
88
200
  private readonly http;
89
201
  private readonly config;
90
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
+ */
91
211
  list(options?: {
92
212
  pageSize?: number;
93
213
  pageToken?: string;
94
214
  contextType?: string;
95
215
  }): Promise<Page<ContextItem>>;
96
216
  private listPage;
217
+ /**
218
+ * Retrieve one context item by uid.
219
+ *
220
+ * @param uid - Context item uid.
221
+ * @returns The context item.
222
+ */
97
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
+ */
98
239
  update(uid: string, options?: {
99
240
  content?: unknown;
100
241
  contextType?: string;
@@ -103,19 +244,53 @@ declare class ManagementContextItemsResource {
103
244
  topics?: string[];
104
245
  updateMask?: string;
105
246
  }): Promise<ContextItem>;
247
+ /**
248
+ * Delete a context item.
249
+ *
250
+ * @param uid - Context item uid.
251
+ * @returns Deletion confirmation details.
252
+ */
106
253
  delete(uid: string): Promise<ContextItemDeletion>;
107
254
  }
108
255
 
109
256
  type UserFeedback = 'positive' | 'neutral' | 'negative';
110
257
 
258
+ /**
259
+ * Create and update context items (notes, links, saved queries).
260
+ *
261
+ * Call path: `mgmt.context` after `new ModusManagement(...)`.
262
+ */
111
263
  declare class ManagementContextResource {
112
264
  private readonly http;
113
265
  private readonly config;
114
266
  readonly items: ManagementContextItemsResource;
115
267
  readonly customItems: CustomContextItemsResource;
268
+ /** @internal */
116
269
  constructor(http: HttpClient, config: ModusConfig);
117
- 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
+ */
118
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
+ */
119
294
  updateNote(uid: string, options: {
120
295
  title: string;
121
296
  body: string;
@@ -124,12 +299,30 @@ declare class ManagementContextResource {
124
299
  userFeedback?: UserFeedback;
125
300
  topics?: string[];
126
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
+ */
127
311
  createSavedQuery(name: string, options: {
128
312
  query?: string;
129
313
  connectionId: string;
130
314
  description?: string;
131
315
  path?: string[];
132
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
+ */
133
326
  updateSavedQuery(uid: string, options: {
134
327
  name: string;
135
328
  query: string;
@@ -140,11 +333,31 @@ declare class ManagementContextResource {
140
333
  userFeedback?: UserFeedback;
141
334
  topics?: string[];
142
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
+ */
143
345
  createLink(url: string, options?: {
144
346
  title?: string;
145
347
  isCrawl?: boolean;
146
348
  pageLimit?: number;
147
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
+ */
148
361
  updateLink(uid: string, options: {
149
362
  title?: string;
150
363
  url?: string;
@@ -153,19 +366,22 @@ declare class ManagementContextResource {
153
366
  userFeedback?: UserFeedback;
154
367
  topics?: string[];
155
368
  }): Promise<ContextItem>;
156
- }
157
-
158
- declare class ManagementOrganizationResource {
159
- private readonly http;
160
- private readonly config;
161
- constructor(http: HttpClient, config: ModusConfig);
162
- delete(): Promise<void>;
369
+ /** @internal */
370
+ private create;
163
371
  }
164
372
 
165
373
  type JsonObjectInput = Record<string, unknown>;
166
374
  type JsonObjectListInput = JsonObjectInput[];
167
375
 
168
- /** Skill toolset wire object (integrations, sql_runner, memory, mcp, …). */
376
+ /**
377
+ * Skill toolset wire object: a map keyed by tool/integration surface
378
+ * (e.g. `slack`, `clickup`, `sql_runner`, `memory`, `pipedream`, `custom_mcps`),
379
+ * each with its own shape. Intentionally untyped: the OpenAPI `ToolsetDto`
380
+ * schema (`{ tools: [{ id, enabled, config }] }`) is Swagger-only decoration —
381
+ * the API's actual validator (`sanitizeAgentToolsetForWrite`) accepts this
382
+ * keyed-map shape instead, and rejects real payloads against `ToolsetDto`.
383
+ * Tightening this type here would misrepresent the real contract.
384
+ */
169
385
  type ToolsetInput = Record<string, unknown>;
170
386
 
171
387
  type Memory = components['schemas']['MemoryDto'];
@@ -173,22 +389,45 @@ type MemorySearchRequest = components['schemas']['SearchMemoriesRequestDto'];
173
389
  type MemoryUpdate = components['schemas']['UpdateMemoryRequestDto'];
174
390
  type MemorySearchResult = components['schemas']['ListMemoriesResponseDto'];
175
391
 
176
- /** Long-term memory stored per scope (`/api/v1/scopes/{id}/memories`). */
392
+ /** Long-term memory stored per scope. */
177
393
  declare class ScopeMemoriesResource {
178
394
  private readonly http;
179
395
  private readonly config;
180
396
  private readonly scopeId;
181
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
+ */
182
406
  list(options?: {
183
407
  pageSize?: number;
184
408
  pageToken?: string;
185
409
  userId?: string;
186
410
  }): Promise<Page<Memory>>;
187
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
+ */
188
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
+ */
189
427
  update(memoryId: string, update: MemoryUpdate, options?: {
190
428
  updateMask?: string;
191
429
  }): Promise<Memory>;
430
+ /** Delete one memory (idempotent). */
192
431
  delete(memoryId: string): Promise<void>;
193
432
  }
194
433
 
@@ -198,20 +437,45 @@ type EvaluationRun = components['schemas']['EvaluationRunDto'];
198
437
  type EvaluationRunWithResults = components['schemas']['EvaluationRunWithResultsDto'];
199
438
  type TriggerEvaluationRunResponse = components['schemas']['TriggerEvaluationRunResponseDto'];
200
439
 
201
- /** Scheduled and manual skill evaluations (`/api/v1/scopes/{id}/evaluations`). */
440
+ /** Scheduled and manual scope evaluations. */
202
441
  declare class ScopeEvaluationsResource {
203
442
  private readonly http;
204
443
  private readonly config;
205
444
  private readonly scopeId;
206
445
  constructor(http: HttpClient, config: ModusConfig, scopeId: number | string);
446
+ /** Get the evaluation configuration for this scope. */
207
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
+ */
208
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
+ */
209
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
+ */
210
468
  listRuns(options?: {
211
469
  pageSize?: number;
212
470
  pageToken?: string;
213
471
  }): Promise<Page<EvaluationRun>>;
214
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
+ */
215
479
  getRun(runId: string): Promise<EvaluationRunWithResults>;
216
480
  }
217
481
 
@@ -222,10 +486,28 @@ declare class ScopeSupervisionResource {
222
486
  private readonly config;
223
487
  private readonly scopeId;
224
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
+ */
225
495
  get(options?: {
226
496
  view?: VariationView;
227
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
+ */
228
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
+ */
229
511
  setActive(request: SetSupervisionRequest): Promise<Supervision>;
230
512
  private write;
231
513
  }
@@ -245,7 +527,7 @@ interface ManagementScopesOperations {
245
527
  readonly patchMcpConfig: OperationId;
246
528
  readonly getVariation: OperationId;
247
529
  }
248
- interface CreateSkillOptions {
530
+ interface CreateScopeOptions {
249
531
  name: string;
250
532
  description?: string;
251
533
  expectedOutput?: string;
@@ -257,7 +539,9 @@ interface CreateSkillOptions {
257
539
  interfaces?: JsonObjectListInput;
258
540
  guardrails?: string[];
259
541
  }
260
- interface UpdateSkillOptions {
542
+ /** @deprecated Use `CreateScopeOptions` instead. */
543
+ type CreateSkillOptions = CreateScopeOptions;
544
+ interface UpdateScopeOptions {
261
545
  name?: string;
262
546
  description?: string;
263
547
  expectedOutput?: string;
@@ -273,58 +557,224 @@ interface UpdateSkillOptions {
273
557
  supervisionSubordinateDescriptions?: Record<string, string>;
274
558
  updateMask?: string;
275
559
  }
276
- /** Full CRUD and lifecycle for Modus scopes (`/api/v1/scopes`). */
560
+ /** @deprecated Use `UpdateScopeOptions` instead. */
561
+ type UpdateSkillOptions = UpdateScopeOptions;
562
+ /**
563
+ * Full CRUD and lifecycle for Modus scopes.
564
+ *
565
+ * Call path: `mgmt.scopes` after `new ModusManagement(...)`.
566
+ */
277
567
  declare class ManagementScopesResource {
278
568
  private readonly http;
279
569
  private readonly config;
280
570
  protected readonly ops: ManagementScopesOperations;
571
+ /** @internal */
281
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
+ */
282
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
+ */
283
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
+ */
284
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
+ */
285
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
+ */
286
611
  list(options?: {
287
612
  pageSize?: number;
288
613
  pageToken?: string;
289
614
  search?: string;
290
615
  view?: VariationView;
291
616
  managerId?: number;
292
- }): Promise<Page<Skill>>;
617
+ }): Promise<Page<Scope>>;
293
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
+ */
294
626
  get(scopeId: number | string, options?: {
295
627
  view?: VariationView;
296
- }): Promise<Skill>;
297
- create(options: CreateSkillOptions): Promise<Skill>;
298
- update(scopeId: number | string, options?: UpdateSkillOptions): Promise<Skill>;
299
- deploy(scopeId: number | string): Promise<Skill>;
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
+ */
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
+ */
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
+ */
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
+ */
300
675
  delete(scopeId: number | string): Promise<void>;
301
- restore(scopeId: number | string): Promise<Skill>;
676
+ /**
677
+ * Restore a previously deleted scope.
678
+ *
679
+ * @param scopeId - Scope id.
680
+ * @returns The restored scope.
681
+ */
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
+ */
302
690
  requestOwnershipTransfer(scopeId: number | string, options: {
303
691
  newOwnerUserId: string;
304
- }): Promise<Skill>;
305
- cancelOwnershipTransfer(scopeId: number | string): Promise<Skill>;
306
- acceptOwnershipTransfer(scopeId: number | string): Promise<Skill>;
692
+ }): Promise<Scope>;
693
+ /** Cancel a pending scope ownership transfer. */
694
+ cancelOwnershipTransfer(scopeId: number | string): Promise<Scope>;
695
+ /** Accept a pending scope ownership transfer. */
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
+ */
307
703
  patchMcpConfig(scopeId: number | string, options: {
308
704
  mcpConfig: Record<string, unknown>;
309
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
+ */
310
713
  getVariation(scopeId: number | string, options: {
311
714
  variationUid: string;
312
- }): Promise<Skill>;
715
+ }): Promise<Scope>;
313
716
  }
314
717
 
315
718
  type UsageReport = components['schemas']['ListUsageResponseDto'];
316
719
  type UsageRollup = 'hour' | 'day';
720
+ type UsageUsersReport = components['schemas']['ListUsageUsersResponseDto'];
317
721
 
318
722
  declare class ManagementUsageResource {
319
723
  private readonly http;
320
724
  private readonly config;
321
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
+ */
322
738
  list(options: {
323
739
  since: string;
324
740
  until: string;
325
741
  rollup: UsageRollup;
326
742
  model?: string;
743
+ userEmail?: readonly string[];
327
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
+ */
754
+ listUsers(options: {
755
+ since: string;
756
+ until: string;
757
+ }): Promise<UsageUsersReport>;
758
+ }
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;
328
778
  }
329
779
 
330
780
  type MemberGroup = components['schemas']['MemberGroupDto'];
@@ -333,19 +783,27 @@ declare class ManagementUsersResource {
333
783
  private readonly http;
334
784
  private readonly config;
335
785
  constructor(http: HttpClient, config: ModusConfig);
786
+ /** List member groups in the organization. */
336
787
  listMemberGroups(): Promise<MemberGroup[]>;
788
+ /** List organization members. */
337
789
  listOrgMembers(): Promise<OrgMember[]>;
338
790
  }
339
791
 
340
- /** Configure scopes, workflows, context, usage, and organization settings. */
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
+ */
341
799
  declare class ModusManagement extends ModusClientBase {
342
800
  readonly scopes: ManagementScopesResource;
343
801
  readonly workflows: ManagementWorkflowsResource;
344
802
  readonly context: ManagementContextResource;
345
803
  readonly usage: ManagementUsageResource;
346
- readonly organization: ManagementOrganizationResource;
804
+ readonly tools: ManagementToolsResource;
347
805
  readonly users: ManagementUsersResource;
348
806
  constructor(options?: ModusOptions);
349
807
  }
350
808
 
351
- export { type AgentSelectionInput, type CreateAgentOptions, type CreateSkillOptions, type Memory, type MemorySearchRequest, type MemorySearchResult, type MemoryUpdate, ModusManagement, ModusOptions, type ToolsetInput, type TriggerInput, type UpdateAgentOptions, type UpdateSkillOptions, type UserFeedback, type WorkflowGraphInput };
809
+ export { type AgentSelectionInput, type CreateAgentOptions, type CreateScopeOptions, type CreateSkillOptions, type CreateWorkflowOptions, type Memory, type MemorySearchRequest, type MemorySearchResult, type MemoryUpdate, ModusManagement, ModusOptions, type ToolsetInput, type TriggerInput, type UpdateAgentOptions, type UpdateScopeOptions, type UpdateSkillOptions, type UpdateWorkflowOptions, type UserFeedback, type WorkflowGraphInput };