@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.
@@ -11,17 +11,6 @@ var OPERATIONS = {
11
11
  responseSchema: "ListConnectionsResponseDto",
12
12
  idempotent: false
13
13
  },
14
- "ConnectionsController_listSelections": {
15
- method: "GET",
16
- path: "/api/v1/connections/{connectionId}/selections",
17
- service: "modus-api",
18
- serverUrl: "https://api.getmodus.com",
19
- pathParams: ["connectionId"],
20
- queryParams: ["pageToken", "pageSize"],
21
- requestSchema: null,
22
- responseSchema: "ListConnectionSelectionsResponseDto",
23
- idempotent: false
24
- },
25
14
  "ContextCreatorsController_createLink": {
26
15
  method: "POST",
27
16
  path: "/api/v1/context/links",
@@ -253,6 +242,17 @@ var OPERATIONS = {
253
242
  responseSchema: "BatchCreateCustomContextItemsResponseDto",
254
243
  idempotent: false
255
244
  },
245
+ "CustomContextItemsController_batchDelete": {
246
+ method: "POST",
247
+ path: "/api/v1/context/custom-items/batchDelete",
248
+ service: "modus-api",
249
+ serverUrl: "https://api.getmodus.com",
250
+ pathParams: [],
251
+ queryParams: [],
252
+ requestSchema: "BatchDeleteCustomContextItemsDto",
253
+ responseSchema: "BatchDeleteCustomContextItemsResponseDto",
254
+ idempotent: false
255
+ },
256
256
  "CustomContextItemsController_create": {
257
257
  method: "POST",
258
258
  path: "/api/v1/context/custom-items",
@@ -303,7 +303,7 @@ var OPERATIONS = {
303
303
  service: "modus-api",
304
304
  serverUrl: "https://api.getmodus.com",
305
305
  pathParams: [],
306
- queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics"],
306
+ queryParams: ["pageToken", "pageSize", "contextTypes", "verificationStatuses", "searchQuery", "topics", "sourceId", "collectionId", "externalId"],
307
307
  requestSchema: null,
308
308
  responseSchema: "ListCustomContextItemsResponseDto",
309
309
  idempotent: false
@@ -1774,7 +1774,7 @@ function headerValue(headers, name) {
1774
1774
  }
1775
1775
 
1776
1776
  // src/_http.ts
1777
- var USER_AGENT = `modus-typescript/${"0.11.0"} (node/${process.version}; ${process.platform})`;
1777
+ var USER_AGENT = `modus-typescript/${"0.13.0"} (node/${process.version}; ${process.platform})`;
1778
1778
  function buildUrl(baseUrl, path, params) {
1779
1779
  const url = new URL(path.startsWith("/") ? path : `/${path}`, baseUrl);
1780
1780
  if (params) {
@@ -2099,10 +2099,11 @@ var WRITE_BODY_ALLOWED_KEYS = {
2099
2099
  ContextFilesController_uploadUrls: ["files"],
2100
2100
  ContextItemAccessController_updateAccess: ["visibility", "groupPermissions", "sharedWith"],
2101
2101
  ContextItemsController_lookup: ["contextType", "dataPath", "contentProjection"],
2102
- ContextItemsController_move: ["destinationFolderUid"],
2102
+ ContextItemsController_move: ["destinationFolderUid", "destinationFolderPath"],
2103
2103
  ContextItemsController_update: ["contextType", "content", "description", "userFeedback", "topics"],
2104
2104
  ContextItemsQueryController_query: ["sql", "maxRows"],
2105
2105
  CustomContextItemsController_batchCreate: ["items"],
2106
+ CustomContextItemsController_batchDelete: ["sourceId", "collectionId", "externalId", "kind", "cascade", "cursor"],
2106
2107
  CustomContextItemsController_create: ["kind", "sourceId", "sourceName", "collectionId", "collectionName", "externalId", "fieldName", "name", "entityType", "description", "content", "url", "attributes", "dataType", "value", "samples", "raw", "topics", "idempotencyKey", "access"],
2107
2108
  CustomContextItemsController_createRelations: ["relations"],
2108
2109
  CustomContextItemsController_update: ["name", "entityType", "description", "content", "url", "attributes", "dataType", "value", "samples", "raw", "topics"],
@@ -2134,7 +2135,7 @@ var WRITE_BODY_ALLOWED_KEYS = {
2134
2135
  ScopesController_acceptOwnershipTransfer: [],
2135
2136
  ScopesController_addEvaluationCase: ["id", "task", "expectedOutput"],
2136
2137
  ScopesController_applySelectionOps: ["ops", "toolset", "validateOnly"],
2137
- ScopesController_create: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "includeOwnLearnings", "interfaces", "accessConfig"],
2138
+ ScopesController_create: ["name", "description", "expectedOutput", "instructions", "toolset", "model", "connectionSet", "contextSelections", "includeOwnLearnings", "includeOrgLearnings", "interfaces", "accessConfig"],
2138
2139
  ScopesController_deploy: [],
2139
2140
  ScopesController_mcpExposureCatalog: ["toolset", "connectionSet", "mcpToolExposure"],
2140
2141
  ScopesController_patchMcpConfig: ["config"],
@@ -2207,6 +2208,7 @@ var CHAT_MODELS = [
2207
2208
  "gemini-3.1-pro-preview",
2208
2209
  "gemini-3-flash-preview",
2209
2210
  "gemini-3.8-flash",
2211
+ "gemini-4-neon",
2210
2212
  "grok-4.3-fast",
2211
2213
  "grok-4.3",
2212
2214
  "grok-4.7",
@@ -2214,7 +2216,7 @@ var CHAT_MODELS = [
2214
2216
  ];
2215
2217
  var ALLOWED_CHAT_MODELS = new Set(CHAT_MODELS);
2216
2218
  function validateChatModel(model) {
2217
- if (!ALLOWED_CHAT_MODELS.has(model)) {
2219
+ if (model === void 0 || !ALLOWED_CHAT_MODELS.has(model)) {
2218
2220
  const supported = [...ALLOWED_CHAT_MODELS].sort().join(", ");
2219
2221
  throw new ValidationError(`Unsupported model ${JSON.stringify(model)}. Choose one of: ${supported}.`);
2220
2222
  }
@@ -2352,11 +2354,14 @@ var CustomContextItemsResource = class {
2352
2354
  * @param options.pageToken - Opaque token from a previous page.
2353
2355
  * @param options.searchQuery - Word search: returns rows that contain every word of the query, case-insensitive.
2354
2356
  * @param options.topics - Filter to items tagged with any of these topics.
2357
+ * @param options.sourceId - Restrict to one customer-defined source and everything beneath it.
2358
+ * @param options.collectionId - Restrict to one collection inside the source. Requires `sourceId`.
2359
+ * @param options.externalId - Restrict to one entity inside the collection. Requires `sourceId` and `collectionId`.
2355
2360
  * @returns A page of custom context items.
2356
2361
  * @example
2357
2362
  * ```ts
2358
2363
  * const client = new Modus()
2359
- * const page = await client.context.customItems.list({ pageSize: 25 })
2364
+ * const page = await client.context.customItems.list({ sourceId: 'billing-db' })
2360
2365
  * for (const item of page.items) console.log(item.uid, item.contextType)
2361
2366
  * ```
2362
2367
  */
@@ -2370,7 +2375,10 @@ var CustomContextItemsResource = class {
2370
2375
  await invokeWithRetry(this.config, this.http, "CustomContextItemsController_list", {
2371
2376
  query: aipListParams(pageSize, pageToken, {
2372
2377
  searchQuery: options.searchQuery,
2373
- topics: options.topics
2378
+ topics: options.topics,
2379
+ sourceId: options.sourceId,
2380
+ collectionId: options.collectionId,
2381
+ externalId: options.externalId
2374
2382
  })
2375
2383
  })
2376
2384
  );
@@ -2474,7 +2482,7 @@ var CustomContextItemsResource = class {
2474
2482
  /**
2475
2483
  * Create or update typed relations between context items.
2476
2484
  *
2477
- * @param relations - Relations with source and target item uids, a snake_case type, and optional content.
2485
+ * @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 `{}`.
2478
2486
  * @returns Number of relations created or updated.
2479
2487
  * @example
2480
2488
  * ```ts
@@ -2483,6 +2491,7 @@ var CustomContextItemsResource = class {
2483
2491
  * fromUid: 'SOURCE_UID',
2484
2492
  * toUid: 'TARGET_UID',
2485
2493
  * relationType: 'depends_on',
2494
+ * edgeProperties: { source_file: 'go.mod' },
2486
2495
  * }])
2487
2496
  * ```
2488
2497
  */
@@ -2537,6 +2546,37 @@ var CustomContextItemsResource = class {
2537
2546
  })
2538
2547
  );
2539
2548
  }
2549
+ /**
2550
+ * Delete custom context items selected by source key.
2551
+ *
2552
+ * Only items you can manage are deleted, and integration-derived context items
2553
+ * are never affected. By default only the targeted node is removed; set
2554
+ * `cascade` to also remove everything beneath it. Processes up to 1000 items
2555
+ * per call — when `truncated` is true, call again to continue.
2556
+ *
2557
+ * @param input.sourceId - Source to delete from. Required.
2558
+ * @param input.collectionId - Narrow to one collection inside the source.
2559
+ * @param input.externalId - Narrow to one entity inside the collection.
2560
+ * @param input.cascade - Also delete everything beneath the targeted node.
2561
+ * @returns Counts of deleted and skipped items, and whether more remain.
2562
+ * @example
2563
+ * ```ts
2564
+ * const client = new Modus()
2565
+ * const result = await client.context.customItems.batchDelete({
2566
+ * sourceId: 'billing-db',
2567
+ * collectionId: 'contracts',
2568
+ * cascade: true,
2569
+ * })
2570
+ * console.log(result.deletedCount, result.truncated)
2571
+ * ```
2572
+ */
2573
+ async batchDelete(input) {
2574
+ return asRecord(
2575
+ await invokeWithRetry(this.config, this.http, "CustomContextItemsController_batchDelete", {
2576
+ jsonBody: omitUndefined(input)
2577
+ })
2578
+ );
2579
+ }
2540
2580
  };
2541
2581
 
2542
2582
  // src/_generated/resources/consumption/scopes/conversations.ts
@@ -2551,15 +2591,16 @@ var ScopesConversationsResourceBase = class {
2551
2591
  * List scope conversations.
2552
2592
  *
2553
2593
  * Returns a page of conversation summaries (most recently updated first) for a scope. Use `id=0`
2554
- * for your cross-scope recent history. Pass `nextPageToken` as `pageToken` to fetch the next
2555
- * page.
2594
+ * for your cross-scope recent history. A conversation you took no part in shows only who took
2595
+ * part and when. Pass `nextPageToken` as `pageToken` for the next page.
2556
2596
  *
2557
2597
  * **Requires:** `scopes:read`
2558
2598
  *
2559
2599
  * @param options.pageSize - Items per page. Defaults to 25.
2560
2600
  * @param options.pageToken - Opaque page token from a previous response's `nextPageToken`. Omit
2561
2601
  * for the first page.
2562
- * @param options.source - Return only conversations started from this UI surface.
2602
+ * @param options.source - Return only conversations started from this UI surface. Matches only
2603
+ * conversations you took part in.
2563
2604
  * @param options.sourceRef - Narrow `source` to one instance of that surface — for
2564
2605
  * `dashboard_copilot` or `dashboard_assistant`, a dashboard id (both scope conversation history
2565
2606
  * per dashboard). Requires `source`; sent alone it is a 422.
@@ -2675,4 +2716,4 @@ export {
2675
2716
  CustomContextItemsResource,
2676
2717
  ScopeConversationsResource
2677
2718
  };
2678
- //# sourceMappingURL=chunk-JVTQBBMZ.js.map
2719
+ //# sourceMappingURL=chunk-KX2P3TAH.js.map