@seclai/sdk 1.6.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -58,10 +58,17 @@ var SeclaiApiVersion = {
58
58
  V2026_09_28: "2026-09-28",
59
59
  V2026_09_30: "2026-09-30",
60
60
  V2026_10_03: "2026-10-03",
61
+ V2026_10_05: "2026-10-05",
62
+ V2026_10_13: "2026-10-13",
63
+ V2026_10_16: "2026-10-16",
64
+ V2026_10_18: "2026-10-18",
65
+ V2026_10_19: "2026-10-19",
66
+ V2026_10_21: "2026-10-21",
67
+ V2026_10_28: "2026-10-28",
61
68
  /** Baseline applied to an unpinned, header-less caller. */
62
69
  Default: "2026-07-01",
63
70
  /** Newest version known to this SDK release. May lag the server. */
64
- Latest: "2026-10-03"
71
+ Latest: "2026-10-28"
65
72
  };
66
73
  var KNOWN_API_VERSIONS = Object.entries(SeclaiApiVersion).filter(([k]) => k.startsWith("V")).map(([, v]) => v);
67
74
 
@@ -895,6 +902,20 @@ var Seclai = class {
895
902
  query: { page: opts.page, limit: opts.limit }
896
903
  });
897
904
  }
905
+ /**
906
+ * List the agent gallery: example agents to start from.
907
+ *
908
+ * Pass an entry's `key` as `agent_template` to {@link createAgent}, with
909
+ * `resource_bindings` for the resources it needs.
910
+ *
911
+ * @param opts - Text search, use-case filter and pagination.
912
+ * @returns A page of gallery entries.
913
+ */
914
+ async listAgentExamples(opts = {}) {
915
+ return await this.request("GET", "/agents/examples", {
916
+ query: { query: opts.query, use_case: opts.useCase, page: opts.page, limit: opts.limit }
917
+ });
918
+ }
898
919
  /**
899
920
  * Create a new agent.
900
921
  *
@@ -1109,15 +1130,18 @@ var Seclai = class {
1109
1130
  * Run an agent in streaming mode (SSE) and wait for the final result.
1110
1131
  *
1111
1132
  * Consumes the entire SSE stream and returns only the terminal `done` payload.
1112
- * For real-time event access, use {@link runStreamingAgent} instead.
1133
+ * For real-time event access, use {@link runStreamingAgent} instead. The body
1134
+ * takes no `include_reasoning`, and one passed anyway is not sent: this method
1135
+ * returns no `stream_reasoning` events.
1113
1136
  *
1114
1137
  * @param agentId - Agent identifier.
1115
- * @param body - Streaming run request payload.
1138
+ * @param body - Streaming run request payload, without `include_reasoning`.
1116
1139
  * @param opts - Timeout and abort signal options.
1117
1140
  * @returns Final agent run payload from the `done` event.
1118
1141
  * @throws {@link SeclaiStreamingError} If the stream ends before a `done` event.
1119
1142
  */
1120
1143
  async runStreamingAgentAndWait(agentId, body, opts) {
1144
+ const { include_reasoning: _ignored, ...runBody } = body;
1121
1145
  const url = buildURL(this.baseUrl, `/agents/${agentId}/runs/stream`);
1122
1146
  const authHdrs = await this.authHeaders();
1123
1147
  const headers = this.requestHeaders([
@@ -1135,7 +1159,7 @@ var Seclai = class {
1135
1159
  const signal = anySignal([opts?.signal, timeoutController.signal]);
1136
1160
  let lastSeen;
1137
1161
  try {
1138
- const init = { method: "POST", headers, body: JSON.stringify(body) };
1162
+ const init = { method: "POST", headers, body: JSON.stringify(runBody) };
1139
1163
  if (signal) init.signal = signal;
1140
1164
  const response = await this.fetcher(url, init);
1141
1165
  const contentType = response.headers.get("content-type") ?? "";
@@ -1376,10 +1400,14 @@ var Seclai = class {
1376
1400
  // Agent Input Uploads
1377
1401
  // ═══════════════════════════════════════════════════════════════════════════
1378
1402
  /**
1379
- * Upload a file to use as input for a `dynamic_input` agent run.
1403
+ * Upload a file to use as input for a `dynamic_input` agent run. Any other
1404
+ * agent rejects the upload with HTTP 400. Files are limited to 200 MB.
1380
1405
  *
1381
- * After uploading, poll {@link getAgentInputUploadStatus} until `status` is `ready`,
1382
- * then pass `input_upload_id` to {@link runAgent}.
1406
+ * From API version `2026-10-16` a file of any type is accepted and is `ready`
1407
+ * at once: pass its `id` as `input_upload_id` to {@link runAgent}.
1408
+ * Earlier versions accept only a fixed list of extensions and write each
1409
+ * file's extracted text into the run's `input`, so poll
1410
+ * {@link getAgentInputUploadStatus} until `status` is `ready` before running.
1383
1411
  *
1384
1412
  * @param agentId - Agent identifier.
1385
1413
  * @param opts - File payload and optional metadata.
@@ -1421,12 +1449,16 @@ var Seclai = class {
1421
1449
  * @param runId - Run identifier.
1422
1450
  * @param attachmentId - URL-safe-base64-encoded `storage_key` of the attachment
1423
1451
  * (as surfaced in run output manifests and webhook/email payloads).
1424
- * @param opts - Optional `downloadName` filename hint for the download disposition.
1452
+ * @param opts - Optional `downloadName` filename hint for the download
1453
+ * disposition, and `signal`, which cancels the request; with a standard `fetch` this
1454
+ * includes reading the body, so `AbortSignal.timeout(ms)` bounds the whole
1455
+ * transfer.
1425
1456
  * @returns Raw response with the attachment bytes.
1426
1457
  */
1427
1458
  async downloadAgentRunAttachment(runId, attachmentId, opts = {}) {
1428
1459
  return await this.requestRaw("GET", `/v2/agent-runs/${runId}/attachments/${attachmentId}`, {
1429
- query: { download_name: opts.downloadName }
1460
+ query: { download_name: opts.downloadName },
1461
+ signal: opts.signal
1430
1462
  });
1431
1463
  }
1432
1464
  // ═══════════════════════════════════════════════════════════════════════════
@@ -1564,12 +1596,19 @@ var Seclai = class {
1564
1596
  * List evaluation results for a specific criteria.
1565
1597
  *
1566
1598
  * @param criteriaId - Criteria identifier.
1567
- * @param opts - Pagination options.
1599
+ * @param opts - Pagination, status, flag and time-range filters.
1568
1600
  */
1569
1601
  async listEvaluationResults(criteriaId, opts = {}) {
1570
1602
  return keyedList(
1571
1603
  await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/results`, {
1572
- query: { page: opts.page, limit: opts.limit }
1604
+ query: {
1605
+ page: opts.page,
1606
+ limit: opts.limit,
1607
+ status: opts.status,
1608
+ flagged_only: opts.flaggedOnly,
1609
+ time_from: opts.timeFrom,
1610
+ time_to: opts.timeTo
1611
+ }
1573
1612
  }),
1574
1613
  "data",
1575
1614
  PAGE_COUNTERS
@@ -1589,12 +1628,12 @@ var Seclai = class {
1589
1628
  * List runs compatible with a specific evaluation criteria.
1590
1629
  *
1591
1630
  * @param criteriaId - Criteria identifier.
1592
- * @param opts - Pagination options.
1631
+ * @param opts - Pagination and a `startedAfter` filter.
1593
1632
  */
1594
1633
  async listCompatibleRuns(criteriaId, opts = {}) {
1595
1634
  return keyedList(
1596
1635
  await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/compatible-runs`, {
1597
- query: { page: opts.page, limit: opts.limit }
1636
+ query: { page: opts.page, limit: opts.limit, started_after: opts.startedAfter }
1598
1637
  }),
1599
1638
  "data",
1600
1639
  PAGE_COUNTERS
@@ -1614,12 +1653,20 @@ var Seclai = class {
1614
1653
  * List all evaluation results for an agent.
1615
1654
  *
1616
1655
  * @param agentId - Agent identifier.
1617
- * @param opts - Pagination options.
1656
+ * @param opts - Pagination, status, step, flag and time-range filters.
1618
1657
  */
1619
1658
  async listAgentEvaluationResults(agentId, opts = {}) {
1620
1659
  return keyedList(
1621
1660
  await this.request("GET", `/agents/${agentId}/evaluation-results`, {
1622
- query: { page: opts.page, limit: opts.limit }
1661
+ query: {
1662
+ page: opts.page,
1663
+ limit: opts.limit,
1664
+ status: opts.status,
1665
+ step: opts.step,
1666
+ flagged_only: opts.flaggedOnly,
1667
+ time_from: opts.timeFrom,
1668
+ time_to: opts.timeTo
1669
+ }
1623
1670
  }),
1624
1671
  "data",
1625
1672
  PAGE_COUNTERS
@@ -1629,25 +1676,35 @@ var Seclai = class {
1629
1676
  * List evaluation run summaries for an agent.
1630
1677
  *
1631
1678
  * @param agentId - Agent identifier.
1632
- * @param opts - Pagination options.
1679
+ * @param opts - Pagination, status, step and time-range filters.
1633
1680
  */
1634
1681
  async listEvaluationRuns(agentId, opts = {}) {
1635
1682
  return keyedList(
1636
1683
  await this.request("GET", `/agents/${agentId}/evaluation-runs`, {
1637
- query: { page: opts.page, limit: opts.limit }
1684
+ query: {
1685
+ page: opts.page,
1686
+ limit: opts.limit,
1687
+ status: opts.status,
1688
+ step: opts.step,
1689
+ time_from: opts.timeFrom,
1690
+ time_to: opts.timeTo
1691
+ }
1638
1692
  }),
1639
1693
  "data",
1640
1694
  PAGE_COUNTERS
1641
1695
  );
1642
1696
  }
1643
1697
  /**
1644
- * Get a summary of non-manual evaluations across an agent's runs.
1698
+ * Get a summary of non-manual evaluations, for one agent or the whole account.
1645
1699
  *
1646
- * @param agentId - Agent identifier.
1700
+ * @param agentId - Agent identifier. Omit (pass `undefined`) for the account-wide summary.
1701
+ * @param opts - Date range. `startDate` and `endDate` together set the range;
1702
+ * `startDate` alone runs from it through today; otherwise the last `days`
1703
+ * days apply (server default 30), and an `endDate` without `startDate` is ignored.
1647
1704
  */
1648
- async getNonManualEvaluationSummary(agentId) {
1705
+ async getNonManualEvaluationSummary(agentId, opts = {}) {
1649
1706
  return await this.request("GET", "/agents/evaluation-results/non-manual-summary", {
1650
- query: { agent_id: agentId }
1707
+ query: { agent_id: agentId, days: opts.days, start_date: opts.startDate, end_date: opts.endDate }
1651
1708
  });
1652
1709
  }
1653
1710
  // ═══════════════════════════════════════════════════════════════════════════
@@ -1672,6 +1729,44 @@ var Seclai = class {
1672
1729
  });
1673
1730
  }
1674
1731
  // ═══════════════════════════════════════════════════════════════════════════
1732
+ // Agent Slack Triggers
1733
+ // ═══════════════════════════════════════════════════════════════════════════
1734
+ /**
1735
+ * Configure an agent's `SLACK_COMMAND` trigger, which people run from Slack
1736
+ * with `/seclai` or the message shortcut.
1737
+ *
1738
+ * Sets the Slack connection, form, channels, reply visibility and conversation
1739
+ * settings. Omitted fields are left unchanged.
1740
+ *
1741
+ * @param agentId - Agent identifier.
1742
+ * @param triggerId - Trigger identifier.
1743
+ * @param body - The fields to set.
1744
+ * @returns The trigger's full Slack config, including any `missing_scopes`.
1745
+ */
1746
+ async setSlackTriggerConfig(agentId, triggerId, body) {
1747
+ return await this.request("PUT", `/agents/${agentId}/triggers/${triggerId}/slack-config`, {
1748
+ json: body
1749
+ });
1750
+ }
1751
+ /**
1752
+ * Replace the input attachments a trigger accepts.
1753
+ *
1754
+ * A run's files are each assigned to one declared attachment before any step
1755
+ * runs, and steps reference one as `{{agent.attachments.<name>}}`. The API
1756
+ * answers 400 when the agent references an attachment the new declaration
1757
+ * leaves out.
1758
+ *
1759
+ * @param agentId - Agent identifier.
1760
+ * @param triggerId - Trigger identifier, as `getAgent()` returns it.
1761
+ * @param body - The full list of accepted attachments; a slot's `min` defaults to 0.
1762
+ * @returns The trigger's accepted attachments.
1763
+ */
1764
+ async setAcceptedAttachments(agentId, triggerId, body) {
1765
+ return await this.request("PUT", `/agents/${agentId}/triggers/${triggerId}/accepted-attachments`, {
1766
+ json: body
1767
+ });
1768
+ }
1769
+ // ═══════════════════════════════════════════════════════════════════════════
1675
1770
  // Agent Email Governance
1676
1771
  // ═══════════════════════════════════════════════════════════════════════════
1677
1772
  /**
@@ -1861,13 +1956,13 @@ var Seclai = class {
1861
1956
  /**
1862
1957
  * List memory banks.
1863
1958
  *
1864
- * @param opts - Pagination and sorting options.
1959
+ * @param opts - Pagination, sorting and a `type` filter.
1865
1960
  * @returns Paginated list of memory banks.
1866
1961
  */
1867
1962
  async listMemoryBanks(opts = {}) {
1868
1963
  return keyedList(
1869
1964
  await this.request("GET", "/memory_banks", {
1870
- query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }
1965
+ query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order, type: opts.type }
1871
1966
  }),
1872
1967
  "memory_banks",
1873
1968
  PAGE_COUNTERS
@@ -1924,9 +2019,13 @@ var Seclai = class {
1924
2019
  * Get stats for a memory bank.
1925
2020
  *
1926
2021
  * @param memoryBankId - Memory bank identifier.
2022
+ * @param opts - Date range. Only `startDate` and `endDate` together replace
2023
+ * `days`; either one alone is ignored and the last `days` days apply (server default 30).
1927
2024
  */
1928
- async getMemoryBankStats(memoryBankId) {
1929
- return await this.request("GET", `/memory_banks/${memoryBankId}/stats`);
2025
+ async getMemoryBankStats(memoryBankId, opts = {}) {
2026
+ return await this.request("GET", `/memory_banks/${memoryBankId}/stats`, {
2027
+ query: { days: opts.days, start_date: opts.startDate, end_date: opts.endDate }
2028
+ });
1930
2029
  }
1931
2030
  /**
1932
2031
  * Compact a memory bank (trigger compaction).
@@ -1979,9 +2078,13 @@ var Seclai = class {
1979
2078
  }
1980
2079
  /**
1981
2080
  * Get the last AI conversation for memory banks.
2081
+ *
2082
+ * @param opts - Turns to return (server default 5) and most-recent turns to skip (default 0).
1982
2083
  */
1983
- async getMemoryBankAiLastConversation() {
1984
- return await this.request("GET", "/memory_banks/ai-assistant/last-conversation");
2084
+ async getMemoryBankAiLastConversation(opts = {}) {
2085
+ return await this.request("GET", "/memory_banks/ai-assistant/last-conversation", {
2086
+ query: { limit: opts.limit, offset: opts.offset }
2087
+ });
1985
2088
  }
1986
2089
  /**
1987
2090
  * Accept a memory bank AI suggestion.
@@ -2120,6 +2223,24 @@ var Seclai = class {
2120
2223
  `/sources/${sourceId}/contents/${contentVersionId}`
2121
2224
  );
2122
2225
  }
2226
+ /**
2227
+ * List mail an email content source refused, newest first.
2228
+ *
2229
+ * Each entry says who sent the message and why it was refused, never its
2230
+ * subject or body. To accept a refused sender, add its `from_address` or that
2231
+ * address's domain to the source's `email_allowed_senders` — which only helps
2232
+ * when `authenticated` is true. Requires an account owner or administrator;
2233
+ * the API answers 404 for a source that is not an email source.
2234
+ *
2235
+ * @param sourceId - Source connection identifier.
2236
+ * @param opts - Pagination options (`limit` 1-100).
2237
+ * @returns The rejections under `data` with `pagination`.
2238
+ */
2239
+ async listEmailSourceRejections(sourceId, opts = {}) {
2240
+ return await this.request("GET", `/sources/${sourceId}/email-rejections`, {
2241
+ query: { page: opts.page, limit: opts.limit }
2242
+ });
2243
+ }
2123
2244
  // ─── Source Exports ────────────────────────────────────────────────────────
2124
2245
  /**
2125
2246
  * List exports for a source.
@@ -2169,10 +2290,15 @@ var Seclai = class {
2169
2290
  *
2170
2291
  * @param sourceId - Source connection identifier.
2171
2292
  * @param exportId - Export identifier.
2293
+ * @param opts - Optional `signal`, which cancels the request; with a standard `fetch` this
2294
+ * includes reading the body, so `AbortSignal.timeout(ms)` bounds the whole
2295
+ * transfer.
2172
2296
  * @returns Raw response with the export file.
2173
2297
  */
2174
- async downloadSourceExport(sourceId, exportId) {
2175
- return await this.requestRaw("GET", `/sources/${sourceId}/exports/${exportId}/download`);
2298
+ async downloadSourceExport(sourceId, exportId, opts = {}) {
2299
+ return await this.requestRaw("GET", `/sources/${sourceId}/exports/${exportId}/download`, {
2300
+ signal: opts.signal
2301
+ });
2176
2302
  }
2177
2303
  /**
2178
2304
  * Estimate a source export.
@@ -2266,6 +2392,79 @@ var Seclai = class {
2266
2392
  query: { page: opts.page ?? 1, limit: opts.limit ?? 20 }
2267
2393
  });
2268
2394
  }
2395
+ /**
2396
+ * List the files attached to a content item.
2397
+ *
2398
+ * Files arrive from an agent's `write_content_attachment` step, with an email
2399
+ * message, from an RSS feed's `feed_attachments`, from a web page's media, or
2400
+ * as the images inside a document. Each entry says whether it is indexed for
2401
+ * search and, when indexing failed, why.
2402
+ *
2403
+ * @param contentVersionId - Content version identifier.
2404
+ * @param opts - Pagination options.
2405
+ * @returns The attachments under `data` with `pagination`.
2406
+ */
2407
+ async listContentAttachments(contentVersionId, opts = {}) {
2408
+ return await this.request("GET", `/contents/${contentVersionId}/attachments`, {
2409
+ query: { page: opts.page, limit: opts.limit }
2410
+ });
2411
+ }
2412
+ /**
2413
+ * Get one file attached to a content item: its indexing status and reason,
2414
+ * its metadata, and the text it is indexed by.
2415
+ *
2416
+ * @param contentVersionId - Content version identifier.
2417
+ * @param attachmentId - The `id` of an entry from {@link listContentAttachments}.
2418
+ * @param opts - `start` and `end` character offsets for paging through long text
2419
+ * (server defaults 0 and 5000). Both are sent as given, so `end: 0` asks for
2420
+ * the metadata without any text. A file that was not indexed has no text.
2421
+ * @returns The attachment with the requested range of its text.
2422
+ * @throws {SeclaiAPIStatusError} 402 when the account has no credits left
2423
+ * (`error.code` `insufficient_credits`).
2424
+ */
2425
+ async getContentAttachment(contentVersionId, attachmentId, opts = {}) {
2426
+ return await this.request("GET", `/contents/${contentVersionId}/attachments/${attachmentId}`, {
2427
+ query: { start: opts.start, end: opts.end }
2428
+ });
2429
+ }
2430
+ /**
2431
+ * List the embeddings (chunk vectors) a content attachment is indexed by.
2432
+ * The list is empty for a file that has no completed index.
2433
+ *
2434
+ * @param contentVersionId - Content version identifier.
2435
+ * @param attachmentId - Attachment identifier.
2436
+ * @param opts - Pagination options (`limit` 1-100).
2437
+ * @returns Paginated list of embeddings.
2438
+ * @throws {SeclaiAPIStatusError} 402 when the account has no credits left
2439
+ * (`error.code` `insufficient_credits`).
2440
+ */
2441
+ async listContentAttachmentEmbeddings(contentVersionId, attachmentId, opts = {}) {
2442
+ return await this.request("GET", `/contents/${contentVersionId}/attachments/${attachmentId}/embeddings`, {
2443
+ query: { page: opts.page, limit: opts.limit }
2444
+ });
2445
+ }
2446
+ /**
2447
+ * Download a content attachment's bytes.
2448
+ *
2449
+ * Returns the raw `Response` so you can stream or save the binary data. The
2450
+ * API answers 403 when the file is withheld — blocked or redacted by a
2451
+ * governance policy, or still being indexed after arriving from outside; the
2452
+ * attachment's `file_withheld` field says which before you ask.
2453
+ *
2454
+ * @param contentVersionId - Content version identifier.
2455
+ * @param attachmentId - Attachment identifier.
2456
+ * @param opts - Optional `signal`, which cancels the request; with a standard `fetch` this
2457
+ * includes reading the body, so `AbortSignal.timeout(ms)` bounds the whole
2458
+ * transfer.
2459
+ * @returns Raw response with the attachment bytes.
2460
+ * @throws {SeclaiAPIStatusError} 403 when the file is withheld, and 402 when
2461
+ * the account has no credits left (`error.code` `insufficient_credits`).
2462
+ */
2463
+ async downloadContentAttachment(contentVersionId, attachmentId, opts = {}) {
2464
+ return await this.requestRaw("GET", `/contents/${contentVersionId}/attachments/${attachmentId}/file`, {
2465
+ signal: opts.signal
2466
+ });
2467
+ }
2269
2468
  /**
2270
2469
  * Upload a file to replace content for an existing content version.
2271
2470
  *
@@ -2282,12 +2481,12 @@ var Seclai = class {
2282
2481
  /**
2283
2482
  * List solutions.
2284
2483
  *
2285
- * @param opts - Pagination and sorting options.
2484
+ * @param opts - Pagination, sorting and a name `search`.
2286
2485
  * @returns Paginated list of solutions.
2287
2486
  */
2288
2487
  async listSolutions(opts = {}) {
2289
2488
  return await this.request("GET", "/solutions", {
2290
- query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }
2489
+ query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order, search: opts.search }
2291
2490
  });
2292
2491
  }
2293
2492
  /**
@@ -2484,10 +2683,12 @@ var Seclai = class {
2484
2683
  }
2485
2684
  /**
2486
2685
  * List governance AI conversations.
2686
+ *
2687
+ * @param opts - `limit`: how many conversations (the server defaults to 20).
2487
2688
  */
2488
- async listGovernanceAiConversations() {
2689
+ async listGovernanceAiConversations(opts = {}) {
2489
2690
  return listItems(
2490
- await this.request("GET", "/governance/ai-assistant/conversations")
2691
+ await this.request("GET", "/governance/ai-assistant/conversations", { query: { limit: opts.limit } })
2491
2692
  );
2492
2693
  }
2493
2694
  /**
@@ -2518,7 +2719,15 @@ var Seclai = class {
2518
2719
  */
2519
2720
  async listAlerts(opts = {}) {
2520
2721
  return await this.request("GET", "/alerts", {
2521
- query: { page: opts.page, limit: opts.limit, status: opts.status }
2722
+ query: {
2723
+ page: opts.page,
2724
+ limit: opts.limit,
2725
+ status: opts.status,
2726
+ agent_id: opts.agentId,
2727
+ source_connection_id: opts.sourceConnectionId,
2728
+ time_from: opts.timeFrom,
2729
+ time_to: opts.timeTo
2730
+ }
2522
2731
  });
2523
2732
  }
2524
2733
  /**
@@ -2577,7 +2786,15 @@ var Seclai = class {
2577
2786
  */
2578
2787
  async listAlertConfigs(opts = {}) {
2579
2788
  return keyedList(
2580
- await this.request("GET", "/alerts/configs", { query: { page: opts.page, limit: opts.limit } }),
2789
+ await this.request("GET", "/alerts/configs", {
2790
+ query: {
2791
+ page: opts.page,
2792
+ limit: opts.limit,
2793
+ agent_id: opts.agentId,
2794
+ source_connection_id: opts.sourceConnectionId,
2795
+ scope: opts.scope
2796
+ }
2797
+ }),
2581
2798
  "configs",
2582
2799
  ["total"]
2583
2800
  );
@@ -2621,10 +2838,14 @@ var Seclai = class {
2621
2838
  // ─── Organization Alert Preferences ────────────────────────────────────────
2622
2839
  /**
2623
2840
  * List organization alert preferences.
2841
+ *
2842
+ * @param opts - Organization filter, and whether to include default subscriptions.
2624
2843
  */
2625
- async listOrganizationAlertPreferences() {
2844
+ async listOrganizationAlertPreferences(opts = {}) {
2626
2845
  return keyedList(
2627
- await this.request("GET", "/alerts/organization-preferences/list"),
2846
+ await this.request("GET", "/alerts/organization-preferences/list", {
2847
+ query: { organization_id: opts.organizationId, include_defaults: opts.includeDefaults }
2848
+ }),
2628
2849
  "preferences",
2629
2850
  ["total"]
2630
2851
  );
@@ -2649,13 +2870,15 @@ var Seclai = class {
2649
2870
  /**
2650
2871
  * List model alerts.
2651
2872
  *
2652
- * @param opts - Pagination options.
2873
+ * @param opts - Pagination, an agent filter and `unreadOnly`.
2653
2874
  */
2654
2875
  async listModelAlerts(opts = {}) {
2655
2876
  const limit = opts.limit ?? 50;
2656
2877
  const offset = opts.page && opts.page > 1 ? (opts.page - 1) * limit : void 0;
2657
2878
  return keyedList(
2658
- await this.request("GET", "/models/alerts", { query: { offset, limit: opts.limit } }),
2879
+ await this.request("GET", "/models/alerts", {
2880
+ query: { offset, limit: opts.limit, agent_id: opts.agentId, unread_only: opts.unreadOnly }
2881
+ }),
2659
2882
  "alerts",
2660
2883
  ["total"]
2661
2884
  );
@@ -2684,9 +2907,18 @@ var Seclai = class {
2684
2907
  * Get model recommendations.
2685
2908
  *
2686
2909
  * @param modelId - Model identifier.
2910
+ * @param opts - Capabilities and limits a recommended model must have.
2687
2911
  */
2688
- async getModelRecommendations(modelId) {
2689
- return await this.request("GET", `/models/${modelId}/recommendations`);
2912
+ async getModelRecommendations(modelId, opts = {}) {
2913
+ return await this.request("GET", `/models/${modelId}/recommendations`, {
2914
+ query: {
2915
+ require_tool_use: opts.requireToolUse,
2916
+ require_structured_output: opts.requireStructuredOutput,
2917
+ require_thinking: opts.requireThinking,
2918
+ min_context_tokens: opts.minContextTokens,
2919
+ min_output_tokens: opts.minOutputTokens
2920
+ }
2921
+ });
2690
2922
  }
2691
2923
  /**
2692
2924
  * List all enabled LLM models grouped by provider.
@@ -2758,7 +2990,9 @@ var Seclai = class {
2758
2990
  /**
2759
2991
  * List model playground experiments.
2760
2992
  *
2761
- * @param opts - Optional filters and pagination.
2993
+ * @param opts - Date range and offset paging. Only `startDate` and `endDate`
2994
+ * together replace `days`; either one alone is ignored and the last `days`
2995
+ * days apply (server default 30).
2762
2996
  */
2763
2997
  async listExperiments(opts = {}) {
2764
2998
  return keyedList(
@@ -3089,9 +3323,13 @@ var Seclai = class {
3089
3323
  }
3090
3324
  /**
3091
3325
  * Get AI assistant memory bank conversation history.
3326
+ *
3327
+ * @param opts - Turns to return (server default 5) and most-recent turns to skip (default 0).
3092
3328
  */
3093
- async getAiAssistantMemoryBankHistory() {
3094
- return await this.request("GET", "/ai-assistant/memory-bank/last-conversation");
3329
+ async getAiAssistantMemoryBankHistory(opts = {}) {
3330
+ return await this.request("GET", "/ai-assistant/memory-bank/last-conversation", {
3331
+ query: { limit: opts.limit, offset: opts.offset }
3332
+ });
3095
3333
  }
3096
3334
  /**
3097
3335
  * Accept an AI assistant suggestion.