@getmodus/sdk 0.11.0 → 0.13.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.
@@ -75,7 +75,7 @@ interface paths {
75
75
  patch?: never;
76
76
  trace?: never;
77
77
  };
78
- "/api/v1/connections/{connectionId}/selections": {
78
+ "/api/v1/context/custom-items": {
79
79
  parameters: {
80
80
  query?: never;
81
81
  header?: never;
@@ -83,49 +83,49 @@ interface paths {
83
83
  cookie?: never;
84
84
  };
85
85
  /**
86
- * List selectable units of a connection
87
- * @description Returns a page of selectable units on a connection you can use. An unknown or inaccessible connection returns 404. Pass `nextPageToken` as `pageToken` for the next page.
86
+ * List custom context items
87
+ * @description Returns a page of customer-created custom context items. Pass `nextPageToken` as `pageToken` to fetch the next page.
88
88
  *
89
89
  * **Requires:** `context:read`
90
90
  */
91
- get: operations["ConnectionsController_listSelections"];
91
+ get: operations["CustomContextItemsController_list"];
92
92
  put?: never;
93
- post?: never;
93
+ /**
94
+ * Create a custom context item
95
+ * @description Creates a customer-owned context item for internal or custom systems; delete and re-create an item to change its `access`. With an `idempotencyKey`, a repeat updates the item only when you can read it and the requested `access` matches, otherwise it returns `409 CONFLICT` and writes nothing.
96
+ *
97
+ * **Requires:** `context:write`
98
+ */
99
+ post: operations["CustomContextItemsController_create"];
94
100
  delete?: never;
95
101
  options?: never;
96
102
  head?: never;
97
103
  patch?: never;
98
104
  trace?: never;
99
105
  };
100
- "/api/v1/context/custom-items": {
106
+ "/api/v1/context/custom-items/batch": {
101
107
  parameters: {
102
108
  query?: never;
103
109
  header?: never;
104
110
  path?: never;
105
111
  cookie?: never;
106
112
  };
107
- /**
108
- * List custom context items
109
- * @description Returns a page of customer-created custom context items. Pass `nextPageToken` as `pageToken` to fetch the next page.
110
- *
111
- * **Requires:** `context:read`
112
- */
113
- get: operations["CustomContextItemsController_list"];
113
+ get?: never;
114
114
  put?: never;
115
115
  /**
116
- * Create a custom context item
117
- * @description Creates a customer-owned context item for internal or custom systems; delete and re-create an item to change its `access`. With an `idempotencyKey`, a repeat updates the item only when you can read it and the requested `access` matches, otherwise it returns `409 CONFLICT` and writes nothing.
116
+ * Create custom context items
117
+ * @description Creates or updates custom context items, idempotent by source, collection, entity and field identifiers. A match you cannot read, or whose requested `access` differs, returns `409 CONFLICT`; items are written in order and not in one transaction, so earlier items stay written.
118
118
  *
119
119
  * **Requires:** `context:write`
120
120
  */
121
- post: operations["CustomContextItemsController_create"];
121
+ post: operations["CustomContextItemsController_batchCreate"];
122
122
  delete?: never;
123
123
  options?: never;
124
124
  head?: never;
125
125
  patch?: never;
126
126
  trace?: never;
127
127
  };
128
- "/api/v1/context/custom-items/batch": {
128
+ "/api/v1/context/custom-items/batchDelete": {
129
129
  parameters: {
130
130
  query?: never;
131
131
  header?: never;
@@ -135,12 +135,12 @@ interface paths {
135
135
  get?: never;
136
136
  put?: never;
137
137
  /**
138
- * Create custom context items
139
- * @description Creates or updates custom context items, idempotent by source, collection, entity and field identifiers. A match you cannot read, or whose requested `access` differs, returns `409 CONFLICT`; items are written in order and not in one transaction, so earlier items stay written.
138
+ * Delete custom context items by source key
139
+ * @description Soft-deletes custom context items under `sourceId`, optionally narrowed by `collectionId` / `externalId`; integration items are never touched. Deletes only the targeted node unless `cascade`; `kind` picks entity or `entity_samples`. Up to 1000 items per call: when `truncated`, call again with `nextCursor`.
140
140
  *
141
141
  * **Requires:** `context:write`
142
142
  */
143
- post: operations["CustomContextItemsController_batchCreate"];
143
+ post: operations["CustomContextItemsController_batchDelete"];
144
144
  delete?: never;
145
145
  options?: never;
146
146
  head?: never;
@@ -832,7 +832,7 @@ interface paths {
832
832
  head?: never;
833
833
  /**
834
834
  * Update context item access
835
- * @description Replaces who can view and manage a note, saved query, link or uploaded file. With visibility shared, sharedWith is ignored; with private, groupPermissions is ignored. You cannot remove your own manage access. An item with no owner becomes yours. Other item types return 422.
835
+ * @description Replaces who can view and manage a note, saved query, link, uploaded file or organization learning. With visibility shared, sharedWith is ignored; with private, groupPermissions is ignored. You cannot remove your own manage access. An item with no owner becomes yours. Other item types return 422.
836
836
  *
837
837
  * **Requires:** `context:write`
838
838
  */
@@ -850,7 +850,7 @@ interface paths {
850
850
  put?: never;
851
851
  /**
852
852
  * Move a Files item
853
- * @description Moves a live file or Files folder to an existing folder, or to the Files root when destinationFolderUid is null. Same-parent moves succeed as a no-op. Does not rename or merge folders.
853
+ * @description Moves a live file or Files folder to an existing folder by destinationFolderUid (null is the Files root), or to destinationFolderPath, creating missing folders. Same-parent moves are a no-op. Does not rename or merge folders.
854
854
  *
855
855
  * **Requires:** `context:write`
856
856
  */
@@ -1055,7 +1055,7 @@ interface paths {
1055
1055
  put?: never;
1056
1056
  /**
1057
1057
  * Create a scope
1058
- * @description Creates a draft scope you own. Defaults to org-shared use and manage. Reads its own learnings unless `includeOwnLearnings` is false. Publish with POST /scopes/{id}/deploy. `connectionSet` entries name a connection and what the scope reads in it (`preferences`).
1058
+ * @description Creates a draft scope you own (org-shared use/manage), with own and org-wide learnings unless `includeOwnLearnings`/`includeOrgLearnings` is false or the selections name learnings or are context filters without a rule-based query. `connectionSet` entries name a connection and what the scope reads in it (`preferences`).
1059
1059
  *
1060
1060
  * **Requires:** `scopes:write`
1061
1061
  */
@@ -1154,7 +1154,7 @@ interface paths {
1154
1154
  };
1155
1155
  /**
1156
1156
  * List scope conversations
1157
- * @description Returns a page of conversation summaries (most recently updated first) for a scope. Use `id=0` for your cross-scope recent history. Optional `userId`, `toolName`, and `timeframe` filters apply. Pass `nextPageToken` as `pageToken` to fetch the next page.
1157
+ * @description Returns a page of conversation summaries (most recently updated first) for a scope. Use `id=0` for your cross-scope recent history. Optional `userId`, `toolName`, and `timeframe` filters apply. A conversation you took no part in shows only who took part and when. Pass `nextPageToken` as `pageToken` for the next page.
1158
1158
  *
1159
1159
  * **Requires:** `scopes:read`
1160
1160
  */
@@ -1176,7 +1176,7 @@ interface paths {
1176
1176
  };
1177
1177
  /**
1178
1178
  * Get a conversation
1179
- * @description Returns conversation messages in chronological order. Pass `messageLimit` to request a bounded message window. Use `id=0` for your cross-scope view.
1179
+ * @description Returns conversation messages in chronological order. Only a participant can read a conversation; anyone else gets 404. Pass `messageLimit` to request a bounded message window. Use `id=0` for your cross-scope view.
1180
1180
  *
1181
1181
  * **Requires:** `scopes:read`
1182
1182
  */
@@ -1730,7 +1730,7 @@ interface paths {
1730
1730
  };
1731
1731
  /**
1732
1732
  * List LLM usage
1733
- * @description Returns time-bucketed LLM call counts and input/output tokens by model over the `[since, until)` window. `rollup` selects hour or day buckets. Scoped to your organization.
1733
+ * @description Returns time-bucketed LLM call counts and input/output tokens by model over the `[since, until)` window. `rollup` selects hour or day buckets. When grouping by scope or workflow, `entities` says whether you can access each one. Scoped to your organization.
1734
1734
  *
1735
1735
  * **Requires:** `usage:read`
1736
1736
  */
@@ -2413,8 +2413,8 @@ interface paths {
2413
2413
  get?: never;
2414
2414
  put?: never;
2415
2415
  /**
2416
- * Chat with a workflow
2417
- * @description Sends a message to a published workflow and streams its node output as Server-Sent Events. The run ends with `workflow_done`, whose `finalOutput` is the answer. Reuse `sessionId` to continue. Send Accept: application/json to poll instead of streaming.
2416
+ * Run a workflow
2417
+ * @description Triggers a run of the published workflow and streams its node output as Server-Sent Events. An empty body runs it with no input; send `message` to give it one. The run ends with `workflow_done`, whose `finalOutput` is the result. To continue a conversation, send your own `sessionId` and reuse it. Send Accept: application/json to poll instead of streaming.
2418
2418
  *
2419
2419
  * **Requires:** `workflows:invoke`
2420
2420
  */
@@ -2696,7 +2696,7 @@ interface components {
2696
2696
  */
2697
2697
  AgentType: "task" | "workflow";
2698
2698
  AgentVariationDto: {
2699
- /** @description `trigger_type` is `schedule`, `webhook`, `api`, `slack`, or `manual`. `schedule` is present only for a schedule trigger. Null until a trigger is saved. */
2699
+ /** @description `trigger_type` is `schedule`, `webhook`, `api`, `slack`, `email`, or `manual`. `schedule` is present only for a schedule trigger. Null until a trigger is saved. */
2700
2700
  trigger?: components["schemas"]["WorkflowTriggerResponseDto"] | null;
2701
2701
  /** @description Workflow graph (`nodes` and `edges`) when `type` is `workflow`. Null when `type` is `task`. */
2702
2702
  workflowStructure?: components["schemas"]["WorkflowStructureResponseDto"] | null;
@@ -2762,7 +2762,7 @@ interface components {
2762
2762
  * @enum {string}
2763
2763
  */
2764
2764
  statusReason?: "approval_timeout" | "agent_reported_issue";
2765
- /** @description Trigger type for the run (schedule / webhook / api / slack / manual). */
2765
+ /** @description What started this run: `schedule`, `email`, `api`, `manual`, or the chat channel it came from. A run that did not record it shows the Workflow's current trigger type. */
2766
2766
  triggerType?: string;
2767
2767
  /** @description ISO-8601 start timestamp. */
2768
2768
  startedAt?: string;
@@ -2783,7 +2783,7 @@ interface components {
2783
2783
  */
2784
2784
  AutomationRunSource: "live-query" | "history";
2785
2785
  BatchCreateCustomContextItemRelationsDto: {
2786
- /** @description Relations to upsert. Idempotent by (fromUid, toUid, relationType); re-sending updates content. */
2786
+ /** @description Relations to upsert. Idempotent by (fromUid, toUid, relationType); re-sending replaces edgeProperties. */
2787
2787
  relations: components["schemas"]["CreateCustomContextItemRelationDto"][];
2788
2788
  };
2789
2789
  BatchCreateCustomContextItemRelationsResponseDto: {
@@ -2801,6 +2801,52 @@ interface components {
2801
2801
  /** @description Custom context items created or updated by the batch. */
2802
2802
  contextItems: components["schemas"]["CreatedCustomContextItemResponseDto"][];
2803
2803
  };
2804
+ BatchDeleteCustomContextItemsDto: {
2805
+ /**
2806
+ * @description Customer-defined source to delete from. Required — a batch delete is always scoped to one source.
2807
+ * @example billing-db
2808
+ */
2809
+ sourceId: string;
2810
+ /**
2811
+ * @description Narrow to one collection inside the source. Omit to target the whole source.
2812
+ * @example contracts
2813
+ */
2814
+ collectionId?: string;
2815
+ /**
2816
+ * @description Narrow to one entity inside the collection. Requires `collectionId`.
2817
+ * @example contract-123
2818
+ */
2819
+ externalId?: string;
2820
+ /**
2821
+ * @description Which kind of item to delete at the selected path, for a non-cascade delete. An entity and its `entity_samples` share a path, so this disambiguates them. Defaults to the metadata item at the selected level (`source`/`collection`/`entity`). Must match the selector depth. Ignored when `cascade` is true.
2822
+ * @example entity
2823
+ */
2824
+ kind?: components["schemas"]["CustomContextItemKind"];
2825
+ /**
2826
+ * @description When `true`, also delete everything beneath the targeted node (its descendants). When `false` (default), delete only the targeted node itself, leaving descendants in place.
2827
+ * @default false
2828
+ */
2829
+ cascade: boolean;
2830
+ /** @description Continuation cursor from a previous response `nextCursor`. Pass it to delete the next batch when a prior call was truncated. */
2831
+ cursor?: string;
2832
+ };
2833
+ BatchDeleteCustomContextItemsResponseDto: {
2834
+ /**
2835
+ * @description Number of custom context items soft-deleted by this request.
2836
+ * @example 8
2837
+ */
2838
+ deletedCount: number;
2839
+ /**
2840
+ * @description True when more matching items were ahead of this batch; call again with `nextCursor` to continue the sweep.
2841
+ * @example false
2842
+ */
2843
+ truncated: boolean;
2844
+ /**
2845
+ * @description Continuation cursor; pass as `cursor` to delete the next batch. `null` means no more matching items were ahead of the cursor at scan time. This is a forward pass, not a snapshot: items added, or recreated with a lower id, during the sweep are not guaranteed to be included — run a fresh pass (no cursor) to catch them.
2846
+ * @example null
2847
+ */
2848
+ nextCursor: string | null;
2849
+ };
2804
2850
  BulkFinalizeDto: {
2805
2851
  /** @description Uploads to finalize. Max 100 per request. */
2806
2852
  uploads: components["schemas"]["BulkFinalizeItemDto"][];
@@ -2988,25 +3034,6 @@ interface components {
2988
3034
  /** @description How a scope selects units on this connection. Omitted when the connection has none. */
2989
3035
  selectionModel?: components["schemas"]["SelectionModelDto"];
2990
3036
  };
2991
- ConnectionSelectionDto: {
2992
- /**
2993
- * @description Path of the unit, from the connection down to the unit itself.
2994
- * @example [
2995
- * "acme/widgets"
2996
- * ]
2997
- */
2998
- path: string[];
2999
- /**
3000
- * @description Kind of unit, such as repository or schema.
3001
- * @example repository
3002
- */
3003
- objectType: string;
3004
- /**
3005
- * @description Human-readable name, when the connection has one.
3006
- * @example widgets
3007
- */
3008
- displayName: string | null;
3009
- };
3010
3037
  ConnectionSetItemDto: {
3011
3038
  /**
3012
3039
  * @description Id of the connection.
@@ -3049,11 +3076,6 @@ interface components {
3049
3076
  preferences: {
3050
3077
  [key: string]: unknown;
3051
3078
  };
3052
- /**
3053
- * @deprecated
3054
- * @description Deprecated. Use `preferences` alone: the scope always reads context from its connections. Omit it; `false` is accepted only when the connection is already stored with `false`.
3055
- */
3056
- context_enabled?: boolean;
3057
3079
  };
3058
3080
  ConnectionSetItemReadDto: {
3059
3081
  /**
@@ -3062,13 +3084,7 @@ interface components {
3062
3084
  */
3063
3085
  connection_id: string;
3064
3086
  /**
3065
- * @deprecated
3066
- * @description Deprecated. Use `preferences`. One stored row per included path, derived from `preferences`; an empty array is the whole connection.
3067
- * @example []
3068
- */
3069
- path: string[];
3070
- /**
3071
- * @description What the scope reads under this connection. `mode` `all` reads the whole connection; `manual` reads only the units its `include` rules select. `exclude` rules remove units in either mode. Each rule's `path` lists id steps `{type, by: "id", id}` from the connection down. Present on the connection's first row. Absent on every row of a connection last saved without `preferences`, until the server converts it.
3087
+ * @description What the scope reads under this connection. `mode` `all` reads the whole connection; `manual` reads only the units its `include` rules select. `exclude` rules remove units in either mode. Each rule's `path` lists id steps `{type, by: "id", id}` from the connection down. Absent only on the entry of a deleted connection, whose `connection_id` is a placeholder (`00000000-0000-0000-0000-…`) and which grants nothing.
3072
3088
  * @example {
3073
3089
  * "mode": "manual",
3074
3090
  * "include": [
@@ -3103,11 +3119,6 @@ interface components {
3103
3119
  preferences?: {
3104
3120
  [key: string]: unknown;
3105
3121
  };
3106
- /**
3107
- * @deprecated
3108
- * @description Deprecated. Use `preferences`. Whether the scope reads context from this connection: true, except on a few older entries kept for their tools only.
3109
- */
3110
- context_enabled?: boolean;
3111
3122
  };
3112
3123
  ContentProjectionDto: {
3113
3124
  /**
@@ -3249,6 +3260,11 @@ interface components {
3249
3260
  lastUpdateMetadata?: {
3250
3261
  [key: string]: unknown;
3251
3262
  } | null;
3263
+ /**
3264
+ * @description How far answers may rely on the item, from 0 to 1. `0` means the item is not used to answer questions unless `userFeedback` is `positive`; `null` means it has no score and is used.
3265
+ * @example null
3266
+ */
3267
+ qualityScore?: number | null;
3252
3268
  /** @description Present for notes, saved queries, links and uploaded files. */
3253
3269
  access?: components["schemas"]["ContextItemAccessDto"];
3254
3270
  /** @description Present for notes, saved queries, links and uploaded files. */
@@ -3320,22 +3336,22 @@ interface components {
3320
3336
  */
3321
3337
  scopeId: number;
3322
3338
  /**
3323
- * @description Preview of the first user turn, used as a list-row caption. Falls back to a stable placeholder when the thread has no human turn yet.
3339
+ * @description Preview of the first user turn, used as a list-row caption. Falls back to a stable placeholder when the thread has no human turn yet. Empty when the caller did not take part in the conversation.
3324
3340
  * @example Run the churn analysis for last 30 days.
3325
3341
  */
3326
3342
  firstMessage: string;
3327
3343
  /**
3328
- * @description User-managed display title. Null until the user renames the conversation.
3344
+ * @description User-managed display title. Null until the user renames the conversation, and null when the caller did not take part in it.
3329
3345
  * @example Q3 Revenue Analysis
3330
3346
  */
3331
3347
  title: string | null;
3332
3348
  /**
3333
- * @description UI surface the conversation was started from (e.g. `context_chat`, `home`). Not constrained to the `RunSource` enum: historical rows carry legacy values. Null when unknown, absent on responses that predate the field.
3349
+ * @description UI surface the conversation was started from (e.g. `context_chat`, `home`). Not constrained to the `RunSource` enum: historical rows carry legacy values. Null when unknown or when the caller did not take part in the conversation, absent on responses that predate the field.
3334
3350
  * @example context_chat
3335
3351
  */
3336
3352
  source?: string | null;
3337
3353
  /**
3338
- * @description Total number of message turns in the (post-collapse) conversation.
3354
+ * @description Total number of message turns in the (post-collapse) conversation. 0 when the caller did not take part in it.
3339
3355
  * @example 12
3340
3356
  */
3341
3357
  messageCount: number;
@@ -3350,7 +3366,7 @@ interface components {
3350
3366
  */
3351
3367
  updatedAt: string;
3352
3368
  /**
3353
- * @description Distinct tool names invoked across this conversation. Present only when `includeTools=true` is requested.
3369
+ * @description Distinct tool names invoked across this conversation. Present only when `includeTools=true` is requested and the caller took part in the conversation.
3354
3370
  * @example [
3355
3371
  * "sql_runner"
3356
3372
  * ]
@@ -3363,6 +3379,11 @@ interface components {
3363
3379
  * ]
3364
3380
  */
3365
3381
  userIds: string[];
3382
+ /**
3383
+ * @description Whether the caller took part in this conversation. Only a participant can open, rename or download files from a conversation; for any other row the list carries only who took part and when.
3384
+ * @example true
3385
+ */
3386
+ ownedByCaller?: boolean;
3366
3387
  };
3367
3388
  ConversationMessageDto: {
3368
3389
  /**
@@ -3439,7 +3460,7 @@ interface components {
3439
3460
  agentSelection?: components["schemas"]["AgentSelectionDto"];
3440
3461
  /** @description Workflow graph (nodes + edges) when `type` is `workflow`. Unknown node/edge keys and out-of-enum node types are rejected with a 422. */
3441
3462
  workflowStructure?: components["schemas"]["WorkflowStructureDto"];
3442
- /** @description Access configuration. Omit to use the default (full-org shared with use + manage). */
3463
+ /** @description Access configuration. Omit to create the workflow private, with no group grants and no invitees; its creator can share it later. A service account token that omits it creates the workflow shared with the whole organization (use + manage), since it has no owner. */
3443
3464
  accessConfig?: components["schemas"]["AgentAccessConfigDto"];
3444
3465
  };
3445
3466
  CreateCustomContextItemDto: {
@@ -3489,7 +3510,7 @@ interface components {
3489
3510
  */
3490
3511
  entityType?: string;
3491
3512
  /**
3492
- * @description Human-readable description.
3513
+ * @description Human-readable description. A non-blank description is kept, trimmed of surrounding whitespace; omit it or send a blank one and Modus generates one.
3493
3514
  * @example Enterprise contract renewal metadata from the internal billing system.
3494
3515
  */
3495
3516
  description?: string;
@@ -3548,13 +3569,19 @@ interface components {
3548
3569
  */
3549
3570
  toUid: string;
3550
3571
  /**
3551
- * @description Snake_case relation type describing how the source relates to the target.
3572
+ * @description Snake_case relation type describing how the source relates to the target. Reserved system types cannot be used: contains, reads, joins_with, has_context, has_feedback, filters_by, context_relation, mentions, defines. Dotted names are also reserved.
3552
3573
  * @example depends_on
3553
3574
  */
3554
3575
  relationType: string;
3555
- /** @description Optional structured payload stored on the relation edge. */
3556
- content?: {
3557
- [key: string]: unknown;
3576
+ /**
3577
+ * @description Edge properties, replacing the previous map. Up to 100 keys matching ^[A-Za-z_][A-Za-z0-9_]{0,63}$ and 65536 UTF-8 JSON bytes; fromContextItemUid, toContextItemUid, relationType, createdAt and updatedAt are reserved. Values are strings, finite numbers, booleans, or arrays of those. Omission writes an empty map.
3578
+ * @example {
3579
+ * "version": "v1.1.8",
3580
+ * "source": "go.mod"
3581
+ * }
3582
+ */
3583
+ edgeProperties?: {
3584
+ [key: string]: string | number | boolean | (string | number | boolean)[];
3558
3585
  };
3559
3586
  };
3560
3587
  CreateDashboardDto: {
@@ -3683,7 +3710,7 @@ interface components {
3683
3710
  */
3684
3711
  instructions?: string[];
3685
3712
  /**
3686
- * @description Map of tool key to configuration; unknown keys are rejected. Integrations require `<platform>.byConnection[connectionUuid] = { actions, rules? }`; actions are catalog action names and SQL platforms grant `query`. Flat entries, action-string arrays and retired keys are rejected with HTTP 422.
3713
+ * @description Map of tool key to configuration; unknown keys are rejected. Integrations require `<platform>.byConnection[connectionUuid] = { actions, rules? }`; actions are catalog action names and SQL platforms grant `query`. A platform people connect personally also takes `<platform>.personal = { actions, rules? }`, which runs on each runner’s own personal connection; a save that newly adds a personal connection's UUID to `byConnection` (or grants it new actions there) is rejected with HTTP 422. Flat entries, action-string arrays and retired keys are rejected with HTTP 422.
3687
3714
  * @example {
3688
3715
  * "slack": {
3689
3716
  * "byConnection": {
@@ -3736,7 +3763,7 @@ interface components {
3736
3763
  */
3737
3764
  connectionSet?: components["schemas"]["ConnectionSetItemDto"][];
3738
3765
  /**
3739
- * @description Selected context items (sources / docs) the scope may read. The scope's own learnings are added unless `includeOwnLearnings` is false or these selections already mention learnings.
3766
+ * @description Selected context items (sources / docs) the scope may read. The scope's own learnings and the org-wide learnings are added, each unless its include flag is false, when these selections neither mention learnings already nor are context filters without a rule-based query.
3740
3767
  * @example []
3741
3768
  */
3742
3769
  contextSelections?: {
@@ -3747,6 +3774,11 @@ interface components {
3747
3774
  * @default true
3748
3775
  */
3749
3776
  includeOwnLearnings: boolean;
3777
+ /**
3778
+ * @description Whether create adds the org-wide learnings path (`auto_generated:org`, what the organization taught Modus) to the scope's selections. Defaults to true, skipped when `contextSelections` already mention learnings or are context filters without a rule-based query; false only skips the addition, so selections naming the path still read it.
3779
+ * @default true
3780
+ */
3781
+ includeOrgLearnings: boolean;
3750
3782
  /** @description MCP interface rows for this scope. Each row has type mcp, an optional id and name, and a config of core tools and exposed integrations. Omitted id and name are assigned. */
3751
3783
  interfaces?: components["schemas"]["ScopeMcpInterfaceInputDto"][];
3752
3784
  /** @description Access configuration. Omit to use the default (full-org shared with use + manage). */
@@ -4522,7 +4554,7 @@ interface components {
4522
4554
  * @enum {string}
4523
4555
  */
4524
4556
  statusReason?: "approval_timeout" | "agent_reported_issue";
4525
- /** @description Trigger type for the run (schedule / webhook / api / slack / manual). */
4557
+ /** @description What started this run: `schedule`, `email`, `api`, `manual`, or the chat channel it came from. */
4526
4558
  triggerType?: string;
4527
4559
  /** @description ISO-8601 start timestamp. */
4528
4560
  startedAt?: string;
@@ -4550,6 +4582,10 @@ interface components {
4550
4582
  }[];
4551
4583
  /** @description Set when history was unavailable; `source` will be `live-query` in that case. */
4552
4584
  historyUnavailableReason?: string;
4585
+ /** @description Files the run was started with, and files its trigger left out. Empty when there were none. */
4586
+ attachments?: components["schemas"]["WorkflowRunAttachmentDto"][];
4587
+ /** @description Where the run came from. */
4588
+ origin?: components["schemas"]["WorkflowRunOriginDto"];
4553
4589
  };
4554
4590
  GroupPermissionDto: {
4555
4591
  /**
@@ -4632,12 +4668,6 @@ interface components {
4632
4668
  [key: string]: number;
4633
4669
  };
4634
4670
  };
4635
- ListConnectionSelectionsResponseDto: {
4636
- /** @description Page of selectable units on this connection. */
4637
- selections: components["schemas"]["ConnectionSelectionDto"][];
4638
- /** @description Opaque token for the next page; `null` when this was the last page. Pass as `pageToken` on the next request. */
4639
- nextPageToken: string | null;
4640
- };
4641
4671
  ListConnectionsResponseDto: {
4642
4672
  /** @description Page of integration connections the caller can `use`. Connections the caller cannot access are filtered out (not enumerated). */
4643
4673
  connections: components["schemas"]["ConnectionDto"][];
@@ -4778,6 +4808,8 @@ interface components {
4778
4808
  group_by: "all" | "skill" | "agent" | "interface" | "model" | "attribution";
4779
4809
  buckets: components["schemas"]["UsageBucketDto"][];
4780
4810
  totals: components["schemas"]["UsageTotalsDto"];
4811
+ /** @description Present when grouping by scope or workflow. One entry per scope or workflow id in `buckets`, saying whether you can access it. Unattributed usage (`group_value` `""`) and the Super scope (`0`) are not scopes or workflows and have no entry. A restricted or deleted entry exposes only its id and owner. */
4812
+ entities?: components["schemas"]["UsageEntityDto"][];
4781
4813
  };
4782
4814
  ListUsageUsersResponseDto: {
4783
4815
  /** @description Distinct acting-user emails in the window. */
@@ -4931,7 +4963,7 @@ interface components {
4931
4963
  * @description Kind of tool this row exposes.
4932
4964
  * @enum {string}
4933
4965
  */
4934
- McpExposureFamily: "integration_actions" | "custom_mcp" | "mcp_server" | "tool";
4966
+ McpExposureFamily: "integration_actions" | "custom_mcp" | "mcp_server" | "tool" | "personal";
4935
4967
  McpToolExposureConfigDto: {
4936
4968
  /**
4937
4969
  * @description Exposure format. Always 1.
@@ -5057,10 +5089,15 @@ interface components {
5057
5089
  };
5058
5090
  MoveContextItemDto: {
5059
5091
  /**
5060
- * @description Stored context-item uid of an existing Files folder, or null to move to the Files root. The destination must already exist. Move does not rename or merge folders.
5092
+ * @description Stored context-item uid of an existing Files folder, or null to move to the Files root. Send this or destinationFolderPath, not both.
5061
5093
  * @example null
5062
5094
  */
5063
- destinationFolderUid: string | null;
5095
+ destinationFolderUid?: string | null;
5096
+ /**
5097
+ * @description Root-relative destination folder path (for example `reports/2026`). Folders missing on the path are created; existing ones are reused. Send this or destinationFolderUid, not both.
5098
+ * @example reports/2026
5099
+ */
5100
+ destinationFolderPath?: string;
5064
5101
  };
5065
5102
  MoveContextItemResponseDto: {
5066
5103
  /**
@@ -5411,7 +5448,7 @@ interface components {
5411
5448
  };
5412
5449
  SelectionOpDto: {
5413
5450
  /**
5414
- * @description Which selection edit this op makes. setConnectionPreferences sets a connection's whole data selection; removeConnection removes the connection from the scope.
5451
+ * @description Which selection edit this op makes. setConnectionPreferences sets a connection's whole data selection; removeConnection removes the connection from the scope with every tool granted on it; when the same request sends a toolset, that toolset is stored instead.
5415
5452
  * @enum {string}
5416
5453
  */
5417
5454
  op: "setConnectionPreferences" | "removeConnection" | "pinItem" | "unpinItem" | "clearPinnedItems" | "setAdditionalContextRules";
@@ -5421,8 +5458,6 @@ interface components {
5421
5458
  preferences?: {
5422
5459
  [key: string]: unknown;
5423
5460
  };
5424
- /** @description Deprecated. Use `preferences` alone: the scope always reads context from its connections. Omit it; `false` is accepted only when the connection is already stored with `false`. */
5425
- contextEnabled?: boolean;
5426
5461
  /** @description The pinned context item. */
5427
5462
  item?: components["schemas"]["SelectedContextItemDto"];
5428
5463
  /** @description Uid of the pinned item to remove. */
@@ -5513,7 +5548,7 @@ interface components {
5513
5548
  /** @description Model-specific runtime controls such as reasoning effort and context window. */
5514
5549
  modelSettings?: components["schemas"]["ModelSettingsDto"];
5515
5550
  /**
5516
- * @description Map of tool key to configuration. Integrations use `<platform>.byConnection[connectionUuid] = { actions, rules? }`; SQL platforms grant `query`. General tools and MCP configurations keep their own formats.
5551
+ * @description Map of tool key to configuration. Integrations use `<platform>.byConnection[connectionUuid] = { actions, rules? }`, plus `<platform>.personal = { actions, rules? }` for actions run on each runner’s own personal connection; SQL platforms grant `query`. General tools and MCP configurations keep their own formats.
5517
5552
  * @example {
5518
5553
  * "postgresql": {
5519
5554
  * "byConnection": {
@@ -5532,7 +5567,7 @@ interface components {
5532
5567
  toolset: {
5533
5568
  [key: string]: unknown;
5534
5569
  };
5535
- /** @description Connections attached to this variation. A connection's `preferences` say what the scope reads under it; its rows list the derived paths. */
5570
+ /** @description Connections attached to this variation, one entry per connection. Its `preferences` say what the scope reads under it; an entry with `preferences` can be sent back as it is on update. Drop an entry without them (a deleted connection) first. */
5536
5571
  connectionSet: components["schemas"]["ConnectionSetItemReadDto"][];
5537
5572
  /** @description Context selections attached to the variation. Free-form builder objects. */
5538
5573
  contextSelections: {
@@ -5682,13 +5717,31 @@ interface components {
5682
5717
  };
5683
5718
  TriggerDto: {
5684
5719
  /**
5685
- * @description Trigger kind. Only `schedule` validates its nested payload here; the rest are opaque.
5720
+ * @description Trigger kind. `schedule` and `email` carry a nested payload; the rest are opaque.
5686
5721
  * @example schedule
5687
5722
  * @enum {string}
5688
5723
  */
5689
- trigger_type: "schedule" | "webhook" | "api" | "slack" | "manual";
5724
+ trigger_type: "schedule" | "webhook" | "api" | "slack" | "manual" | "email";
5690
5725
  /** @description Schedule details. Required when trigger_type=schedule. Null for every other trigger. */
5691
5726
  schedule?: components["schemas"]["TriggerScheduleDto"] | null;
5727
+ /** @description Sender policy. Required when trigger_type=email. Null for every other trigger. */
5728
+ email?: components["schemas"]["TriggerEmailDto"] | null;
5729
+ };
5730
+ TriggerEmailDto: {
5731
+ /**
5732
+ * @description `allowlist` starts runs only for email from `allowed_senders` (an empty list rejects every email); `any` accepts every authenticated sender.
5733
+ * @example allowlist
5734
+ * @enum {string}
5735
+ */
5736
+ sender_policy: "allowlist" | "any";
5737
+ /**
5738
+ * @description Exact addresses or `@domain` entries (that domain only). Stored lowercase; at most 100. Kept when `sender_policy` is `any`.
5739
+ * @example [
5740
+ * "@acme.com",
5741
+ * "billing@supplier.com"
5742
+ * ]
5743
+ */
5744
+ allowed_senders: string[];
5692
5745
  };
5693
5746
  TriggerEvaluationRunResponseDto: {
5694
5747
  /** @description The created run ID */
@@ -5977,7 +6030,7 @@ interface components {
5977
6030
  */
5978
6031
  instructions?: string[] | null;
5979
6032
  /**
5980
- * @description Map of tool key to configuration; unknown keys are rejected. Integrations require `<platform>.byConnection[connectionUuid] = { actions, rules? }`; actions are catalog action names and SQL platforms grant `query`. Flat entries, action-string arrays and retired keys are rejected with HTTP 422.
6033
+ * @description Map of tool key to configuration; unknown keys are rejected. Integrations require `<platform>.byConnection[connectionUuid] = { actions, rules? }`; actions are catalog action names and SQL platforms grant `query`. A platform people connect personally also takes `<platform>.personal = { actions, rules? }`, which runs on each runner’s own personal connection; a save that newly adds a personal connection's UUID to `byConnection` (or grants it new actions there) is rejected with HTTP 422. Flat entries, action-string arrays and retired keys are rejected with HTTP 422.
5981
6034
  * @example {
5982
6035
  * "slack": {
5983
6036
  * "byConnection": {
@@ -6153,6 +6206,21 @@ interface components {
6153
6206
  /** @description Credits consumed in this bucket. */
6154
6207
  credits: number;
6155
6208
  };
6209
+ UsageEntityDto: {
6210
+ /** @description Scope or workflow id, as it appears in `group_value`. */
6211
+ id: string;
6212
+ /** @description `accessible`: you can use it. `restricted`: it exists but you are not allowed to use it. `deleted`: it was deleted or no longer exists. */
6213
+ status: components["schemas"]["UsageEntityStatus"];
6214
+ /** @description User id of the owner of the scope or workflow, when it has one. */
6215
+ owner_user_id: string | null;
6216
+ /** @description Email of the owner of the scope or workflow, when it has one. */
6217
+ owner_email: string | null;
6218
+ };
6219
+ /**
6220
+ * @description `accessible`: you can use it. `restricted`: it exists but you are not allowed to use it. `deleted`: it was deleted or no longer exists.
6221
+ * @enum {string}
6222
+ */
6223
+ UsageEntityStatus: "accessible" | "restricted" | "deleted";
6156
6224
  UsageTotalsDto: {
6157
6225
  call_count: number;
6158
6226
  input_tokens: number;
@@ -6318,6 +6386,57 @@ interface components {
6318
6386
  * @enum {string}
6319
6387
  */
6320
6388
  WorkflowNodeType: "start" | "action" | "condition" | "agent" | "humanApproval";
6389
+ WorkflowRunAttachmentDto: {
6390
+ /**
6391
+ * @description File name as it was sent.
6392
+ * @example invoice-4471.pdf
6393
+ */
6394
+ fileName: string;
6395
+ /**
6396
+ * @description MIME type, when known.
6397
+ * @example application/pdf
6398
+ */
6399
+ mimeType?: string;
6400
+ /**
6401
+ * Format: int64
6402
+ * @description Size in bytes, when known.
6403
+ * @example 182000
6404
+ */
6405
+ sizeBytes?: number;
6406
+ /** @description Set when the trigger received the file but did not give it to the run. */
6407
+ skipped?: components["schemas"]["WorkflowRunSkippedAttachmentDto"];
6408
+ };
6409
+ WorkflowRunOriginDto: {
6410
+ /**
6411
+ * @description Where the run came from, for example `api`, `schedule` or `email`. `unknown` for a run that did not record it. New values may be added.
6412
+ * @example schedule
6413
+ */
6414
+ source: string;
6415
+ /**
6416
+ * @description Email runs: the sender address.
6417
+ * @example dana@acme.com
6418
+ */
6419
+ from?: string;
6420
+ /**
6421
+ * @description Email runs: the sender display name, when the email has one.
6422
+ * @example Dana Cohen
6423
+ */
6424
+ fromName?: string;
6425
+ /**
6426
+ * @description Email runs: the subject line.
6427
+ * @example Invoice 4471 for October
6428
+ */
6429
+ subject?: string;
6430
+ };
6431
+ WorkflowRunSkippedAttachmentDto: {
6432
+ /** @description Why the file was left out: `too_large` = over the per-file size limit; `too_many` = over the file count limit. */
6433
+ reason: components["schemas"]["WorkflowRunSkippedAttachmentReason"];
6434
+ };
6435
+ /**
6436
+ * @description Why the file was left out: `too_large` = over the per-file size limit; `too_many` = over the file count limit.
6437
+ * @enum {string}
6438
+ */
6439
+ WorkflowRunSkippedAttachmentReason: "too_large" | "too_many";
6321
6440
  WorkflowStructureDto: {
6322
6441
  /** @description Workflow nodes. Defaults to `[]`. */
6323
6442
  nodes?: components["schemas"]["WorkflowNodeDto"][];
@@ -6332,13 +6451,15 @@ interface components {
6332
6451
  } | null;
6333
6452
  WorkflowTriggerResponseDto: {
6334
6453
  /**
6335
- * @description Trigger kind. Only `schedule` validates its nested payload here; the rest are opaque.
6454
+ * @description Trigger kind. `schedule` and `email` carry a nested payload; the rest are opaque.
6336
6455
  * @example schedule
6337
6456
  * @enum {string}
6338
6457
  */
6339
- trigger_type: "schedule" | "webhook" | "api" | "slack" | "manual";
6458
+ trigger_type: "schedule" | "webhook" | "api" | "slack" | "manual" | "email";
6340
6459
  /** @description Schedule details. Required when trigger_type=schedule. Null for every other trigger. */
6341
6460
  schedule?: components["schemas"]["WorkflowTriggerScheduleResponseDto"] | null;
6461
+ /** @description Sender policy. Present when trigger_type=email. Null for every other trigger. */
6462
+ email?: components["schemas"]["TriggerEmailDto"] | null;
6342
6463
  } | null;
6343
6464
  WorkflowTriggerScheduleResponseDto: {
6344
6465
  /**
@@ -6424,10 +6545,6 @@ interface components {
6424
6545
  nextPageToken: string | null;
6425
6546
  };
6426
6547
  AgentRunDto: {
6427
- /** @description The user message to send. API tokens are held to the 32,000-character limit; a longer message is refused before the run starts. */
6428
- message: string;
6429
- /** @description Opaque client-generated conversation token for continuity. The server NEVER derives the run target identity (scope/workflow/modus) from this string — target identity comes only from the request path and DTO (see RunTarget). It is used solely to thread successive turns of the same conversation together. */
6430
- sessionId: string;
6431
6548
  /** @description Organization id. Ignored for authenticated callers — the server uses the principal's org. */
6432
6549
  organizationId?: string;
6433
6550
  /**
@@ -6435,9 +6552,6 @@ interface components {
6435
6552
  * @enum {string}
6436
6553
  */
6437
6554
  version?: "published" | "draft";
6438
- /** @description Document-scoped conversation thread id. */
6439
- fileThreadId?: string;
6440
- config?: components["schemas"]["RunConfigDto"];
6441
6555
  attachments?: components["schemas"]["AttachmentsDto"];
6442
6556
  userContext?: components["schemas"]["UserContextDto"];
6443
6557
  supplementalContext?: components["schemas"]["SupplementalContextDto"];
@@ -6445,12 +6559,35 @@ interface components {
6445
6559
  source?: components["schemas"]["RunSource"];
6446
6560
  /** @description Client-supplied run id (Idempotency-Key header wins). */
6447
6561
  runId?: string;
6562
+ /** @description The run's input, which the workflow's first step receives. Omit it, or send an empty string, to trigger a run with no input. API tokens are held to the 32,000-character limit. */
6563
+ message?: string;
6564
+ /** @description A token you choose that threads runs into one conversation: send the same value on each run. Omit it for a one-off run; the server then assigns an id it does not return, so that run cannot be continued. */
6565
+ sessionId?: string;
6448
6566
  /**
6449
- * @description Streaming protocol version. Version 2 supports assistant-content replacement events.
6567
+ * @deprecated
6568
+ * @description Deprecated: ignored for workflow runs, whose steps use the model and tools set in the workflow. Omit it.
6569
+ */
6570
+ config?: components["schemas"]["RunConfigDto"];
6571
+ /**
6572
+ * @deprecated
6573
+ * @description Deprecated and ignored: a workflow run takes its settings from the workflow. Omit it; see `message` and `sessionId` for what a run accepts.
6574
+ */
6575
+ fileThreadId?: string;
6576
+ /**
6577
+ * @deprecated
6578
+ * @description Deprecated and ignored: a workflow run takes its settings from the workflow. Omit it; see `message` and `sessionId` for what a run accepts.
6450
6579
  * @enum {integer}
6451
6580
  */
6452
6581
  streamProtocolVersion?: 2;
6582
+ /**
6583
+ * @deprecated
6584
+ * @description Deprecated and ignored: a workflow run takes its settings from the workflow. Omit it; see `message` and `sessionId` for what a run accepts.
6585
+ */
6453
6586
  experimentalFeatures?: boolean;
6587
+ /**
6588
+ * @deprecated
6589
+ * @description Deprecated and ignored: a workflow run takes its settings from the workflow. Omit it; see `message` and `sessionId` for what a run accepts.
6590
+ */
6454
6591
  debug?: boolean;
6455
6592
  };
6456
6593
  ApprovalTargetDto: {
@@ -6636,7 +6773,7 @@ interface components {
6636
6773
  status: string;
6637
6774
  };
6638
6775
  RunConfigDto: {
6639
- /** @description Model id, e.g. claude-sonnet-4.6. API tokens must send one of: default, claude-sonnet-5, claude-sonnet-5.5, claude-sonnet-4.6, claude-opus-4.8, claude-opus-5.5, claude-haiku-5.5, gpt-5.2, gpt-5.5, gpt-5-mini, gpt-5.6-luna, gpt-6-luna, gpt-oss-120b, gpt-oss-20b, qwen3-235b-a22b-2507, qwen3-coder, qwen3-32b, deepseek-chat-v3.1, deepseek-v4-pro, deepseek-v4-flash-latest, deepseek-v4.1-flash-1017, minimax-m2.7, llama-4-maverick, llama-4-scout, llama-3.3-70b-instruct, gemini-3.1-pro-preview, gemini-3-flash-preview, gemini-3.8-flash, grok-4.3-fast, grok-4.3, grok-4.7, kimi-k3. */
6776
+ /** @description Model id, e.g. claude-sonnet-4.6. API tokens must send one of: default, claude-sonnet-5, claude-sonnet-5.5, claude-sonnet-4.6, claude-opus-4.8, claude-opus-5.5, claude-haiku-5.5, gpt-5.2, gpt-5.5, gpt-5-mini, gpt-5.6-luna, gpt-6-luna, gpt-oss-120b, gpt-oss-20b, qwen3-235b-a22b-2507, qwen3-coder, qwen3-32b, deepseek-chat-v3.1, deepseek-v4-pro, deepseek-v4-flash-latest, deepseek-v4.1-flash-1017, minimax-m2.7, llama-4-maverick, llama-4-scout, llama-3.3-70b-instruct, gemini-3.1-pro-preview, gemini-3-flash-preview, gemini-3.8-flash, gemini-4-neon, grok-4.3-fast, grok-4.3, grok-4.7, kimi-k3. */
6640
6777
  model?: string;
6641
6778
  /** @description Model-specific runtime controls. */
6642
6779
  modelSettings?: components["schemas"]["RunModelSettingsDto"];
@@ -6648,7 +6785,7 @@ interface components {
6648
6785
  connectionSelections?: {
6649
6786
  [key: string]: unknown;
6650
6787
  }[];
6651
- /** @description Connection-set entries (runtime-owned shape): `connection_id`, and optionally `preferences` (the connection's workspace-access preferences), `context_enabled` and `path` (a row the preferences compile to). */
6788
+ /** @description Connection-set entries (runtime-owned shape): `connection_id`, and optionally `preferences` (the connection's workspace-access preferences) and `path` (a row the preferences compile to). */
6652
6789
  connectionSet?: {
6653
6790
  [key: string]: unknown;
6654
6791
  }[];
@@ -6698,7 +6835,7 @@ interface components {
6698
6835
  * @description Origin of the run. Set by the server for API tokens.
6699
6836
  * @enum {string}
6700
6837
  */
6701
- RunSource: "home" | "agent_settings" | "agent" | "api" | "modus_api" | "mcp" | "slack" | "slack_dm" | "teams" | "context_chat" | "context_suggestions" | "dashboard_copilot" | "dashboard_assistant" | "other";
6838
+ RunSource: "home" | "agent_settings" | "agent" | "api" | "modus_api" | "mcp" | "slack" | "slack_dm" | "teams" | "context_chat" | "context_suggestions" | "dashboard_copilot" | "dashboard_assistant" | "email" | "other";
6702
6839
  SkillRunDto: {
6703
6840
  /** @description The user message to send. API tokens are held to the 32,000-character limit; a longer message is refused before the run starts. */
6704
6841
  message: string;
@@ -6743,7 +6880,7 @@ interface components {
6743
6880
  * @description Producer that supplied the supplemental context.
6744
6881
  * @enum {string}
6745
6882
  */
6746
- SupplementalContextSource: "slack" | "teams" | "mcp";
6883
+ SupplementalContextSource: "slack" | "teams" | "mcp" | "email";
6747
6884
  UserContextDto: {
6748
6885
  /** @description End-user email for personalization; also used for usage attribution. */
6749
6886
  email?: string;
@@ -6917,19 +7054,30 @@ interface operations {
6917
7054
  };
6918
7055
  };
6919
7056
  };
6920
- ConnectionsController_listSelections: {
7057
+ CustomContextItemsController_list: {
6921
7058
  parameters: {
6922
7059
  query?: {
6923
7060
  /** @description Opaque page token from a previous response's `nextPageToken`. Omit for the first page. */
6924
7061
  pageToken?: string;
6925
- /** @description Max items per page. Defaults to 25. Values outside 1..100 are clamped to that range. */
7062
+ /** @description Max items per page. Defaults to 25. Must be between 1 and 200. */
6926
7063
  pageSize?: number;
7064
+ /** @description Filter by one or more context types (repeat the query param). Example: `?contextTypes=note&contextTypes=saved_query`. */
7065
+ contextTypes?: string[];
7066
+ /** @description Filter by verification status (`negative` / `neutral` / `positive`). */
7067
+ verificationStatuses?: string[];
7068
+ /** @description Word search: returns rows that contain every word of the query, case-insensitive. */
7069
+ searchQuery?: string;
7070
+ /** @description Filter by topic tag. */
7071
+ topics?: string[];
7072
+ /** @description Restrict to a single customer-defined source. Returns the source and everything beneath it. */
7073
+ sourceId?: string;
7074
+ /** @description Restrict to a collection inside the source. Requires `sourceId`. Returns the collection and everything beneath it. */
7075
+ collectionId?: string;
7076
+ /** @description Restrict to a single entity inside the collection. Requires `sourceId` and `collectionId`. Returns the entity and its fields. */
7077
+ externalId?: string;
6927
7078
  };
6928
7079
  header?: never;
6929
- path: {
6930
- /** @description Integration connection UUID. */
6931
- connectionId: string;
6932
- };
7080
+ path?: never;
6933
7081
  cookie?: never;
6934
7082
  };
6935
7083
  requestBody?: never;
@@ -6939,7 +7087,7 @@ interface operations {
6939
7087
  [name: string]: unknown;
6940
7088
  };
6941
7089
  content: {
6942
- "application/json": components["schemas"]["ListConnectionSelectionsResponseDto"];
7090
+ "application/json": components["schemas"]["ListCustomContextItemsResponseDto"];
6943
7091
  };
6944
7092
  };
6945
7093
  /** @description Malformed request — invalid query parameters or request body (`code: BAD_REQUEST`). */
@@ -7004,8 +7152,8 @@ interface operations {
7004
7152
  "application/json": components["schemas"]["ErrorResponseDto"];
7005
7153
  };
7006
7154
  };
7007
- /** @description The resource does not exist, or you do not have access to it (`code: NOT_FOUND`). */
7008
- 404: {
7155
+ /** @description The request was well-formed but failed a business rule (`code: VALIDATION`). */
7156
+ 422: {
7009
7157
  headers: {
7010
7158
  [name: string]: unknown;
7011
7159
  };
@@ -7013,9 +7161,9 @@ interface operations {
7013
7161
  /**
7014
7162
  * @example {
7015
7163
  * "error": {
7016
- * "code": "NOT_FOUND",
7017
- * "status": "NOT_FOUND",
7018
- * "message": "Resource not found.",
7164
+ * "code": "VALIDATION",
7165
+ * "status": "INVALID_ARGUMENT",
7166
+ * "message": "collectionId must not be blank.",
7019
7167
  * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
7020
7168
  * }
7021
7169
  * }
@@ -7063,34 +7211,25 @@ interface operations {
7063
7211
  };
7064
7212
  };
7065
7213
  };
7066
- CustomContextItemsController_list: {
7214
+ CustomContextItemsController_create: {
7067
7215
  parameters: {
7068
- query?: {
7069
- /** @description Opaque page token from a previous response's `nextPageToken`. Omit for the first page. */
7070
- pageToken?: string;
7071
- /** @description Max items per page. Defaults to 25. Must be between 1 and 200. */
7072
- pageSize?: number;
7073
- /** @description Filter by one or more context types (repeat the query param). Example: `?contextTypes=note&contextTypes=saved_query`. */
7074
- contextTypes?: string[];
7075
- /** @description Filter by verification status (`negative` / `neutral` / `positive`). */
7076
- verificationStatuses?: string[];
7077
- /** @description Word search: returns rows that contain every word of the query, case-insensitive. */
7078
- searchQuery?: string;
7079
- /** @description Filter by topic tag. */
7080
- topics?: string[];
7081
- };
7216
+ query?: never;
7082
7217
  header?: never;
7083
7218
  path?: never;
7084
7219
  cookie?: never;
7085
7220
  };
7086
- requestBody?: never;
7221
+ requestBody: {
7222
+ content: {
7223
+ "application/json": components["schemas"]["CreateCustomContextItemDto"];
7224
+ };
7225
+ };
7087
7226
  responses: {
7088
- 200: {
7227
+ 201: {
7089
7228
  headers: {
7090
7229
  [name: string]: unknown;
7091
7230
  };
7092
7231
  content: {
7093
- "application/json": components["schemas"]["ListCustomContextItemsResponseDto"];
7232
+ "application/json": components["schemas"]["CreatedCustomContextItemResponseDto"];
7094
7233
  };
7095
7234
  };
7096
7235
  /** @description Malformed request — invalid query parameters or request body (`code: BAD_REQUEST`). */
@@ -7155,6 +7294,82 @@ interface operations {
7155
7294
  "application/json": components["schemas"]["ErrorResponseDto"];
7156
7295
  };
7157
7296
  };
7297
+ /** @description The resource does not exist, or you do not have access to it (`code: NOT_FOUND`). */
7298
+ 404: {
7299
+ headers: {
7300
+ [name: string]: unknown;
7301
+ };
7302
+ content: {
7303
+ /**
7304
+ * @example {
7305
+ * "error": {
7306
+ * "code": "NOT_FOUND",
7307
+ * "status": "NOT_FOUND",
7308
+ * "message": "Resource not found.",
7309
+ * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
7310
+ * }
7311
+ * }
7312
+ */
7313
+ "application/json": components["schemas"]["ErrorResponseDto"];
7314
+ };
7315
+ };
7316
+ /** @description The request conflicts with the current state of the resource, e.g. a duplicate (`code: CONFLICT`). */
7317
+ 409: {
7318
+ headers: {
7319
+ [name: string]: unknown;
7320
+ };
7321
+ content: {
7322
+ /**
7323
+ * @example {
7324
+ * "error": {
7325
+ * "code": "CONFLICT",
7326
+ * "status": "ALREADY_EXISTS",
7327
+ * "message": "A resource with that identifier already exists.",
7328
+ * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
7329
+ * }
7330
+ * }
7331
+ */
7332
+ "application/json": components["schemas"]["ErrorResponseDto"];
7333
+ };
7334
+ };
7335
+ /** @description The request body is larger than this operation accepts (`code: PAYLOAD_TOO_LARGE`). The limit is 100 KiB unless the operation raises it; the message names the limit that applied. */
7336
+ 413: {
7337
+ headers: {
7338
+ [name: string]: unknown;
7339
+ };
7340
+ content: {
7341
+ /**
7342
+ * @example {
7343
+ * "error": {
7344
+ * "code": "PAYLOAD_TOO_LARGE",
7345
+ * "status": "INVALID_ARGUMENT",
7346
+ * "message": "Request body exceeds the 1 MiB limit.",
7347
+ * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
7348
+ * }
7349
+ * }
7350
+ */
7351
+ "application/json": components["schemas"]["ErrorResponseDto"];
7352
+ };
7353
+ };
7354
+ /** @description The request was well-formed but failed a business rule (`code: VALIDATION`). */
7355
+ 422: {
7356
+ headers: {
7357
+ [name: string]: unknown;
7358
+ };
7359
+ content: {
7360
+ /**
7361
+ * @example {
7362
+ * "error": {
7363
+ * "code": "VALIDATION",
7364
+ * "status": "INVALID_ARGUMENT",
7365
+ * "message": "Updates that would revoke your own access are not allowed.",
7366
+ * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
7367
+ * }
7368
+ * }
7369
+ */
7370
+ "application/json": components["schemas"]["ErrorResponseDto"];
7371
+ };
7372
+ };
7158
7373
  /** @description Too many requests. Wait and retry later (`code: RATE_LIMITED`). */
7159
7374
  429: {
7160
7375
  headers: {
@@ -7195,7 +7410,7 @@ interface operations {
7195
7410
  };
7196
7411
  };
7197
7412
  };
7198
- CustomContextItemsController_create: {
7413
+ CustomContextItemsController_batchCreate: {
7199
7414
  parameters: {
7200
7415
  query?: never;
7201
7416
  header?: never;
@@ -7204,7 +7419,7 @@ interface operations {
7204
7419
  };
7205
7420
  requestBody: {
7206
7421
  content: {
7207
- "application/json": components["schemas"]["CreateCustomContextItemDto"];
7422
+ "application/json": components["schemas"]["BatchCreateCustomContextItemsDto"];
7208
7423
  };
7209
7424
  };
7210
7425
  responses: {
@@ -7213,7 +7428,7 @@ interface operations {
7213
7428
  [name: string]: unknown;
7214
7429
  };
7215
7430
  content: {
7216
- "application/json": components["schemas"]["CreatedCustomContextItemResponseDto"];
7431
+ "application/json": components["schemas"]["BatchCreateCustomContextItemsResponseDto"];
7217
7432
  };
7218
7433
  };
7219
7434
  /** @description Malformed request — invalid query parameters or request body (`code: BAD_REQUEST`). */
@@ -7254,11 +7469,7 @@ interface operations {
7254
7469
  "application/json": components["schemas"]["ErrorResponseDto"];
7255
7470
  };
7256
7471
  };
7257
- /**
7258
- * @description Authenticated, but the token lacks a required scope (`code: FORBIDDEN`). The missing scopes are listed in `info`.
7259
- *
7260
- * Also returned, with the message `Custom context item writes are not enabled`, when custom context item writes are not enabled for your organization. They are off by default; ask Modus to enable them.
7261
- */
7472
+ /** @description Authenticated, but the token lacks a required scope (`code: FORBIDDEN`). The missing scopes are listed in `info`. */
7262
7473
  403: {
7263
7474
  headers: {
7264
7475
  [name: string]: unknown;
@@ -7269,8 +7480,13 @@ interface operations {
7269
7480
  * "error": {
7270
7481
  * "code": "FORBIDDEN",
7271
7482
  * "status": "PERMISSION_DENIED",
7272
- * "message": "Custom context item writes are not enabled",
7273
- * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
7483
+ * "message": "Missing required scope(s) for this operation.",
7484
+ * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS",
7485
+ * "info": {
7486
+ * "missing": [
7487
+ * "<required-scope>"
7488
+ * ]
7489
+ * }
7274
7490
  * }
7275
7491
  * }
7276
7492
  */
@@ -7393,7 +7609,7 @@ interface operations {
7393
7609
  };
7394
7610
  };
7395
7611
  };
7396
- CustomContextItemsController_batchCreate: {
7612
+ CustomContextItemsController_batchDelete: {
7397
7613
  parameters: {
7398
7614
  query?: never;
7399
7615
  header?: never;
@@ -7402,16 +7618,16 @@ interface operations {
7402
7618
  };
7403
7619
  requestBody: {
7404
7620
  content: {
7405
- "application/json": components["schemas"]["BatchCreateCustomContextItemsDto"];
7621
+ "application/json": components["schemas"]["BatchDeleteCustomContextItemsDto"];
7406
7622
  };
7407
7623
  };
7408
7624
  responses: {
7409
- 201: {
7625
+ 200: {
7410
7626
  headers: {
7411
7627
  [name: string]: unknown;
7412
7628
  };
7413
7629
  content: {
7414
- "application/json": components["schemas"]["BatchCreateCustomContextItemsResponseDto"];
7630
+ "application/json": components["schemas"]["BatchDeleteCustomContextItemsResponseDto"];
7415
7631
  };
7416
7632
  };
7417
7633
  /** @description Malformed request — invalid query parameters or request body (`code: BAD_REQUEST`). */
@@ -7452,11 +7668,7 @@ interface operations {
7452
7668
  "application/json": components["schemas"]["ErrorResponseDto"];
7453
7669
  };
7454
7670
  };
7455
- /**
7456
- * @description Authenticated, but the token lacks a required scope (`code: FORBIDDEN`). The missing scopes are listed in `info`.
7457
- *
7458
- * Also returned, with the message `Custom context item writes are not enabled`, when custom context item writes are not enabled for your organization. They are off by default; ask Modus to enable them.
7459
- */
7671
+ /** @description Authenticated, but the token lacks a required scope (`code: FORBIDDEN`). The missing scopes are listed in `info`. */
7460
7672
  403: {
7461
7673
  headers: {
7462
7674
  [name: string]: unknown;
@@ -7467,8 +7679,13 @@ interface operations {
7467
7679
  * "error": {
7468
7680
  * "code": "FORBIDDEN",
7469
7681
  * "status": "PERMISSION_DENIED",
7470
- * "message": "Custom context item writes are not enabled",
7471
- * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
7682
+ * "message": "Missing required scope(s) for this operation.",
7683
+ * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS",
7684
+ * "info": {
7685
+ * "missing": [
7686
+ * "<required-scope>"
7687
+ * ]
7688
+ * }
7472
7689
  * }
7473
7690
  * }
7474
7691
  */
@@ -7650,11 +7867,7 @@ interface operations {
7650
7867
  "application/json": components["schemas"]["ErrorResponseDto"];
7651
7868
  };
7652
7869
  };
7653
- /**
7654
- * @description Authenticated, but the token lacks a required scope (`code: FORBIDDEN`). The missing scopes are listed in `info`.
7655
- *
7656
- * Also returned, with the message `Custom context item writes are not enabled`, when custom context item writes are not enabled for your organization. They are off by default; ask Modus to enable them.
7657
- */
7870
+ /** @description Authenticated, but the token lacks a required scope (`code: FORBIDDEN`). The missing scopes are listed in `info`. */
7658
7871
  403: {
7659
7872
  headers: {
7660
7873
  [name: string]: unknown;
@@ -7665,8 +7878,13 @@ interface operations {
7665
7878
  * "error": {
7666
7879
  * "code": "FORBIDDEN",
7667
7880
  * "status": "PERMISSION_DENIED",
7668
- * "message": "Custom context item writes are not enabled",
7669
- * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
7881
+ * "message": "Missing required scope(s) for this operation.",
7882
+ * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS",
7883
+ * "info": {
7884
+ * "missing": [
7885
+ * "<required-scope>"
7886
+ * ]
7887
+ * }
7670
7888
  * }
7671
7889
  * }
7672
7890
  */
@@ -7988,11 +8206,7 @@ interface operations {
7988
8206
  "application/json": components["schemas"]["ErrorResponseDto"];
7989
8207
  };
7990
8208
  };
7991
- /**
7992
- * @description Authenticated, but the token lacks a required scope (`code: FORBIDDEN`). The missing scopes are listed in `info`.
7993
- *
7994
- * Also returned, with the message `Custom context item writes are not enabled`, when custom context item writes are not enabled for your organization. They are off by default; ask Modus to enable them.
7995
- */
8209
+ /** @description Authenticated, but the token lacks a required scope (`code: FORBIDDEN`). The missing scopes are listed in `info`. */
7996
8210
  403: {
7997
8211
  headers: {
7998
8212
  [name: string]: unknown;
@@ -8003,8 +8217,13 @@ interface operations {
8003
8217
  * "error": {
8004
8218
  * "code": "FORBIDDEN",
8005
8219
  * "status": "PERMISSION_DENIED",
8006
- * "message": "Custom context item writes are not enabled",
8007
- * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
8220
+ * "message": "Missing required scope(s) for this operation.",
8221
+ * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS",
8222
+ * "info": {
8223
+ * "missing": [
8224
+ * "<required-scope>"
8225
+ * ]
8226
+ * }
8008
8227
  * }
8009
8228
  * }
8010
8229
  */
@@ -8173,11 +8392,7 @@ interface operations {
8173
8392
  "application/json": components["schemas"]["ErrorResponseDto"];
8174
8393
  };
8175
8394
  };
8176
- /**
8177
- * @description Authenticated, but the token lacks a required scope (`code: FORBIDDEN`). The missing scopes are listed in `info`.
8178
- *
8179
- * Also returned, with the message `Custom context item writes are not enabled`, when custom context item writes are not enabled for your organization. They are off by default; ask Modus to enable them.
8180
- */
8395
+ /** @description Authenticated, but the token lacks a required scope (`code: FORBIDDEN`). The missing scopes are listed in `info`. */
8181
8396
  403: {
8182
8397
  headers: {
8183
8398
  [name: string]: unknown;
@@ -8188,8 +8403,13 @@ interface operations {
8188
8403
  * "error": {
8189
8404
  * "code": "FORBIDDEN",
8190
8405
  * "status": "PERMISSION_DENIED",
8191
- * "message": "Custom context item writes are not enabled",
8192
- * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS"
8406
+ * "message": "Missing required scope(s) for this operation.",
8407
+ * "requestId": "req_01HQ7K8ABCDEFGHIJKLMNOPQRS",
8408
+ * "info": {
8409
+ * "missing": [
8410
+ * "<required-scope>"
8411
+ * ]
8412
+ * }
8193
8413
  * }
8194
8414
  * }
8195
8415
  */
@@ -16004,10 +16224,10 @@ interface operations {
16004
16224
  pageSize?: number;
16005
16225
  /** @description Filter by user id who participated in the conversation. Exact match against the `conversation_interactions.user_id` column. */
16006
16226
  userId?: string;
16007
- /** @description Filter by tool name invoked in the conversation. Applied post-fetch (requires reading message blobs); use `includeTools=true` to also see the matched tools. */
16227
+ /** @description Filter by tool name invoked in the conversation. Applied post-fetch (requires reading message blobs); use `includeTools=true` to also see the matched tools. Matches only conversations you took part in. With the `userId` of another member it is a 400 on a scope, and a 404 with `id=0`, as for any id but your own there. */
16008
16228
  toolName?: string;
16009
- /** @description Return only conversations started from this UI surface. Cannot be combined with `toolName`, `includeTools=true`, or `kind` other than `all`. */
16010
- source?: "home" | "agent_settings" | "agent" | "api" | "modus_api" | "mcp" | "slack" | "slack_dm" | "teams" | "context_chat" | "context_suggestions" | "dashboard_copilot" | "dashboard_assistant" | "other";
16229
+ /** @description Return only conversations started from this UI surface. Cannot be combined with `toolName`, `includeTools=true`, or `kind` other than `all`. Matches only conversations you took part in. With the `userId` of another member it is a 400 on a scope, and a 404 with `id=0`, as for any id but your own there. */
16230
+ source?: "home" | "agent_settings" | "agent" | "api" | "modus_api" | "mcp" | "slack" | "slack_dm" | "teams" | "context_chat" | "context_suggestions" | "dashboard_copilot" | "dashboard_assistant" | "email" | "other";
16011
16231
  /** @description Narrow `source` to one instance of that surface — for `dashboard_copilot` or `dashboard_assistant`, a dashboard id (both scope conversation history per dashboard). Requires `source`; sent alone it is a 422. */
16012
16232
  sourceRef?: string;
16013
16233
  /** @description Filter by activity recency. Coarse server-side buckets. */
@@ -17546,10 +17766,10 @@ interface operations {
17546
17766
  pageSize?: number;
17547
17767
  /** @description Filter by user id who participated in the conversation. Exact match against the `conversation_interactions.user_id` column. */
17548
17768
  userId?: string;
17549
- /** @description Filter by tool name invoked in the conversation. Applied post-fetch (requires reading message blobs); use `includeTools=true` to also see the matched tools. */
17769
+ /** @description Filter by tool name invoked in the conversation. Applied post-fetch (requires reading message blobs); use `includeTools=true` to also see the matched tools. Matches only conversations you took part in. With the `userId` of another member it is a 400 on a scope, and a 404 with `id=0`, as for any id but your own there. */
17550
17770
  toolName?: string;
17551
- /** @description Return only conversations started from this UI surface. Cannot be combined with `toolName`, `includeTools=true`, or `kind` other than `all`. */
17552
- source?: "home" | "agent_settings" | "agent" | "api" | "modus_api" | "mcp" | "slack" | "slack_dm" | "teams" | "context_chat" | "context_suggestions" | "dashboard_copilot" | "dashboard_assistant" | "other";
17771
+ /** @description Return only conversations started from this UI surface. Cannot be combined with `toolName`, `includeTools=true`, or `kind` other than `all`. Matches only conversations you took part in. With the `userId` of another member it is a 400 on a scope, and a 404 with `id=0`, as for any id but your own there. */
17772
+ source?: "home" | "agent_settings" | "agent" | "api" | "modus_api" | "mcp" | "slack" | "slack_dm" | "teams" | "context_chat" | "context_suggestions" | "dashboard_copilot" | "dashboard_assistant" | "email" | "other";
17553
17773
  /** @description Narrow `source` to one instance of that surface — for `dashboard_copilot` or `dashboard_assistant`, a dashboard id (both scope conversation history per dashboard). Requires `source`; sent alone it is a 422. */
17554
17774
  sourceRef?: string;
17555
17775
  /** @description Filter by activity recency. Coarse server-side buckets. */
@@ -28008,17 +28228,6 @@ declare const OPERATIONS: {
28008
28228
  readonly responseSchema: "ListConnectionsResponseDto";
28009
28229
  readonly idempotent: false;
28010
28230
  };
28011
- readonly ConnectionsController_listSelections: {
28012
- readonly method: "GET";
28013
- readonly path: "/api/v1/connections/{connectionId}/selections";
28014
- readonly service: "modus-api";
28015
- readonly serverUrl: "https://api.getmodus.com";
28016
- readonly pathParams: readonly ["connectionId"];
28017
- readonly queryParams: readonly ["pageToken", "pageSize"];
28018
- readonly requestSchema: null;
28019
- readonly responseSchema: "ListConnectionSelectionsResponseDto";
28020
- readonly idempotent: false;
28021
- };
28022
28231
  readonly ContextCreatorsController_createLink: {
28023
28232
  readonly method: "POST";
28024
28233
  readonly path: "/api/v1/context/links";
@@ -28250,6 +28459,17 @@ declare const OPERATIONS: {
28250
28459
  readonly responseSchema: "BatchCreateCustomContextItemsResponseDto";
28251
28460
  readonly idempotent: false;
28252
28461
  };
28462
+ readonly CustomContextItemsController_batchDelete: {
28463
+ readonly method: "POST";
28464
+ readonly path: "/api/v1/context/custom-items/batchDelete";
28465
+ readonly service: "modus-api";
28466
+ readonly serverUrl: "https://api.getmodus.com";
28467
+ readonly pathParams: readonly [];
28468
+ readonly queryParams: readonly [];
28469
+ readonly requestSchema: "BatchDeleteCustomContextItemsDto";
28470
+ readonly responseSchema: "BatchDeleteCustomContextItemsResponseDto";
28471
+ readonly idempotent: false;
28472
+ };
28253
28473
  readonly CustomContextItemsController_create: {
28254
28474
  readonly method: "POST";
28255
28475
  readonly path: "/api/v1/context/custom-items";
@@ -28300,7 +28520,7 @@ declare const OPERATIONS: {
28300
28520
  readonly service: "modus-api";
28301
28521
  readonly serverUrl: "https://api.getmodus.com";
28302
28522
  readonly pathParams: readonly [];
28303
- readonly queryParams: readonly ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics"];
28523
+ readonly queryParams: readonly ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics", "sourceId", "collectionId", "externalId"];
28304
28524
  readonly requestSchema: null;
28305
28525
  readonly responseSchema: "ListCustomContextItemsResponseDto";
28306
28526
  readonly idempotent: false;
@@ -29567,7 +29787,7 @@ interface CustomContextItemRelationInput {
29567
29787
  fromUid: string;
29568
29788
  toUid: string;
29569
29789
  relationType: string;
29570
- content?: Record<string, unknown>;
29790
+ edgeProperties?: Record<string, string | number | boolean | Array<string | number | boolean>>;
29571
29791
  }
29572
29792
  interface CreatedCustomContextItem {
29573
29793
  contextItemId: string;
@@ -29586,6 +29806,36 @@ interface CustomContextItemDeletion {
29586
29806
  uid: string;
29587
29807
  contextType: string;
29588
29808
  }
29809
+ interface BatchDeleteCustomContextItemsInput {
29810
+ /** Customer-defined source to delete from. Required. */
29811
+ sourceId: string;
29812
+ /** Narrow to one collection inside the source. */
29813
+ collectionId?: string;
29814
+ /** Narrow to one entity inside the collection. Requires `collectionId`. */
29815
+ externalId?: string;
29816
+ /**
29817
+ * Which kind to delete at the selected path, for a non-cascade delete — an
29818
+ * entity and its `entity_samples` share a path, so this disambiguates them.
29819
+ * Defaults to the metadata item at the selected level. Ignored when `cascade`.
29820
+ */
29821
+ kind?: CustomContextItemKind;
29822
+ /** When true, also delete everything beneath the targeted node; default deletes only the targeted node. */
29823
+ cascade?: boolean;
29824
+ /** Continuation cursor from a previous response `nextCursor`. */
29825
+ cursor?: string;
29826
+ }
29827
+ interface BatchDeleteCustomContextItemsResult {
29828
+ /** Number of custom context items soft-deleted by this request. */
29829
+ deletedCount: number;
29830
+ /** True when more matching items were ahead of this batch; call again with `nextCursor`. */
29831
+ truncated: boolean;
29832
+ /**
29833
+ * Continuation cursor; pass as `cursor` to delete the next batch. `null` means no more matching
29834
+ * items were ahead at scan time — this is a forward pass, not a snapshot, so items added (or
29835
+ * recreated with a lower id) during the sweep may be missed; run a fresh pass (no cursor) to catch them.
29836
+ */
29837
+ nextCursor: string | null;
29838
+ }
29589
29839
  /**
29590
29840
  * Create, update, and delete custom context items.
29591
29841
  *
@@ -29610,11 +29860,6 @@ interface CustomContextItemDeletion {
29610
29860
  * traversable, create the `source`, then the `collection`, then the `entity`, and
29611
29861
  * finally any `field` or `entity_samples` rows, repeating the same parent IDs at
29612
29862
  * every level.
29613
- *
29614
- * Writes (`create`, `batchCreate`, `createRelations`, `update`, `delete`) are off
29615
- * by default for each organization: until Modus enables them, they reject with a
29616
- * `PermissionDeniedError` whose message is `Custom context item writes are not
29617
- * enabled`. Reads (`list`, `get`) always work.
29618
29863
  */
29619
29864
  declare class CustomContextItemsResource {
29620
29865
  private readonly http;
@@ -29628,11 +29873,14 @@ declare class CustomContextItemsResource {
29628
29873
  * @param options.pageToken - Opaque token from a previous page.
29629
29874
  * @param options.searchQuery - Word search: returns rows that contain every word of the query, case-insensitive.
29630
29875
  * @param options.topics - Filter to items tagged with any of these topics.
29876
+ * @param options.sourceId - Restrict to one customer-defined source and everything beneath it.
29877
+ * @param options.collectionId - Restrict to one collection inside the source. Requires `sourceId`.
29878
+ * @param options.externalId - Restrict to one entity inside the collection. Requires `sourceId` and `collectionId`.
29631
29879
  * @returns A page of custom context items.
29632
29880
  * @example
29633
29881
  * ```ts
29634
29882
  * const client = new Modus()
29635
- * const page = await client.context.customItems.list({ pageSize: 25 })
29883
+ * const page = await client.context.customItems.list({ sourceId: 'billing-db' })
29636
29884
  * for (const item of page.items) console.log(item.uid, item.contextType)
29637
29885
  * ```
29638
29886
  */
@@ -29641,6 +29889,9 @@ declare class CustomContextItemsResource {
29641
29889
  pageToken?: string;
29642
29890
  searchQuery?: string;
29643
29891
  topics?: string[];
29892
+ sourceId?: string;
29893
+ collectionId?: string;
29894
+ externalId?: string;
29644
29895
  }): Promise<Page<ContextItem>>;
29645
29896
  private listPage;
29646
29897
  /**
@@ -29714,7 +29965,7 @@ declare class CustomContextItemsResource {
29714
29965
  /**
29715
29966
  * Create or update typed relations between context items.
29716
29967
  *
29717
- * @param relations - Relations with source and target item uids, a snake_case type, and optional content.
29968
+ * @param relations - Relations with source and target item uids, a snake_case type, and optional flat edgeProperties. Omitting edgeProperties on an existing relation replaces its stored properties with `{}`.
29718
29969
  * @returns Number of relations created or updated.
29719
29970
  * @example
29720
29971
  * ```ts
@@ -29723,6 +29974,7 @@ declare class CustomContextItemsResource {
29723
29974
  * fromUid: 'SOURCE_UID',
29724
29975
  * toUid: 'TARGET_UID',
29725
29976
  * relationType: 'depends_on',
29977
+ * edgeProperties: { source_file: 'go.mod' },
29726
29978
  * }])
29727
29979
  * ```
29728
29980
  */
@@ -29756,6 +30008,31 @@ declare class CustomContextItemsResource {
29756
30008
  * ```
29757
30009
  */
29758
30010
  delete(uid: string): Promise<CustomContextItemDeletion>;
30011
+ /**
30012
+ * Delete custom context items selected by source key.
30013
+ *
30014
+ * Only items you can manage are deleted, and integration-derived context items
30015
+ * are never affected. By default only the targeted node is removed; set
30016
+ * `cascade` to also remove everything beneath it. Processes up to 1000 items
30017
+ * per call — when `truncated` is true, call again to continue.
30018
+ *
30019
+ * @param input.sourceId - Source to delete from. Required.
30020
+ * @param input.collectionId - Narrow to one collection inside the source.
30021
+ * @param input.externalId - Narrow to one entity inside the collection.
30022
+ * @param input.cascade - Also delete everything beneath the targeted node.
30023
+ * @returns Counts of deleted and skipped items, and whether more remain.
30024
+ * @example
30025
+ * ```ts
30026
+ * const client = new Modus()
30027
+ * const result = await client.context.customItems.batchDelete({
30028
+ * sourceId: 'billing-db',
30029
+ * collectionId: 'contracts',
30030
+ * cascade: true,
30031
+ * })
30032
+ * console.log(result.deletedCount, result.truncated)
30033
+ * ```
30034
+ */
30035
+ batchDelete(input: BatchDeleteCustomContextItemsInput): Promise<BatchDeleteCustomContextItemsResult>;
29759
30036
  }
29760
30037
 
29761
30038
  /** Generated base for the consumption `scopes.conversations` resource. */
@@ -29769,15 +30046,16 @@ declare class ScopesConversationsResourceBase {
29769
30046
  * List scope conversations.
29770
30047
  *
29771
30048
  * Returns a page of conversation summaries (most recently updated first) for a scope. Use `id=0`
29772
- * for your cross-scope recent history. Pass `nextPageToken` as `pageToken` to fetch the next
29773
- * page.
30049
+ * for your cross-scope recent history. A conversation you took no part in shows only who took
30050
+ * part and when. Pass `nextPageToken` as `pageToken` for the next page.
29774
30051
  *
29775
30052
  * **Requires:** `scopes:read`
29776
30053
  *
29777
30054
  * @param options.pageSize - Items per page. Defaults to 25.
29778
30055
  * @param options.pageToken - Opaque page token from a previous response's `nextPageToken`. Omit
29779
30056
  * for the first page.
29780
- * @param options.source - Return only conversations started from this UI surface.
30057
+ * @param options.source - Return only conversations started from this UI surface. Matches only
30058
+ * conversations you took part in.
29781
30059
  * @param options.sourceRef - Narrow `source` to one instance of that surface — for
29782
30060
  * `dashboard_copilot` or `dashboard_assistant`, a dashboard id (both scope conversation history
29783
30061
  * per dashboard). Requires `source`; sent alone it is a 422.
@@ -29843,4 +30121,4 @@ declare abstract class ModusClientBase {
29843
30121
  toString(): string;
29844
30122
  }
29845
30123
 
29846
- export { type Agent as A, type OperationSpec as B, type Conversation as C, type ScopeStatus as D, type ScopeVariation as E, type Skill as F, type SkillStatus as G, HttpClient as H, type SkillVariation as I, type SupervisionView as J, type UpdateCustomContextItemInput as K, conversationScopeId as L, type ModusConfig as M, conversationSkillId as N, OPERATIONS as O, Page as P, type operations as Q, type paths as R, type Scope as S, type CreatedContextItem as T, type UpdateContextItemAccessInput as U, type VariationView as V, WorkflowType as W, ScopeConversationsResource as a, type ConversationKind as b, type components as c, type ConversationListItem as d, type Workflow as e, type ContextItemsQuery as f, type ContextItemsQueryResult as g, type ContextItem as h, type ContextItemLookupRow as i, CustomContextItemsResource as j, ModusClientBase as k, type ModusOptions as l, AgentType as m, type ContextItemAccessUpdate as n, type ContextItemAncestor as o, type ContextItemDeletion as p, type ContextItemMove as q, type ContextType as r, type CreateCustomContextItemInput as s, type CreatedCustomContextItem as t, type CustomAttributeInput as u, type CustomContextItemDeletion as v, type CustomContextItemKind as w, type CustomContextItemRelationInput as x, type Message as y, type OperationId as z };
30124
+ export { type Agent as A, type BatchDeleteCustomContextItemsInput as B, type Conversation as C, type OperationId as D, type OperationSpec as E, type ScopeStatus as F, type ScopeVariation as G, HttpClient as H, type Skill as I, type SkillStatus as J, type SkillVariation as K, type SupervisionView as L, type ModusConfig as M, type UpdateCustomContextItemInput as N, OPERATIONS as O, Page as P, conversationScopeId as Q, conversationSkillId as R, type Scope as S, type operations as T, type UpdateContextItemAccessInput as U, type VariationView as V, WorkflowType as W, type paths as X, type CreatedContextItem as Y, ScopeConversationsResource as a, type ConversationKind as b, type components as c, type ConversationListItem as d, type Workflow as e, type ContextItemsQuery as f, type ContextItemsQueryResult as g, type ContextItem as h, type ContextItemLookupRow as i, CustomContextItemsResource as j, ModusClientBase as k, type ModusOptions as l, AgentType as m, type BatchDeleteCustomContextItemsResult as n, type ContextItemAccessUpdate as o, type ContextItemAncestor as p, type ContextItemDeletion as q, type ContextItemMove as r, type ContextType as s, type CreateCustomContextItemInput as t, type CreatedCustomContextItem as u, type CustomAttributeInput as v, type CustomContextItemDeletion as w, type CustomContextItemKind as x, type CustomContextItemRelationInput as y, type Message as z };