@seclai/sdk 1.6.0 → 1.6.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.6.1] - 2026-10-05
4
+
5
+ ### Changed
6
+
7
+ - Throw `SeclaiError` from the list methods of version-gated endpoints when a successful response is not a list — an error-shaped object, text, or an empty body. Most of them handed that body back as if it were the list; the cloud-drive listings returned `[]`, which reads as "no results". An explicit `data: null` is still an empty list
8
+
9
+ ### Fixed
10
+
11
+ - Return the declared type from every list method once `apiVersion` is `2026-07-27` or later. The API then answers list endpoints with `{data, pagination}`, and the methods that cast the body handed that object back as their array or keyed type: `getAgentCallers()`, `listModels()`, `listInboundEmailRejections()`, `listGovernanceAiConversations()` and `listSolutionConversations()` returned an object instead of an array, and `listAgentEmailOptOuts()`, `listBlockedEmailSenders()`, `setAutoBlockMode()`, `listAlertConfigs()`, `listOrganizationAlertPreferences()`, `listEmailDomains()`, `listKnowledgeBases()`, `listMemoryBanks()`, `getGenerationTiers()`, `listModelAlerts()` and `listExperiments()` lost their `items`, `configs`, `preferences`, `domains`, `knowledge_bases`, `memory_banks`, `tiers`, `alerts` or `experiments` key. The items are now where each type declares them on both shapes, and `data` and `pagination` stay on the object types, which declare them as optional fields ([#14](https://github.com/seclai/seclai-javascript/issues/14))
12
+ - Fill the flat `total`, `page` and `limit` from `pagination` when `apiVersion` is `2026-07-27` or later, on `listEvaluationResults()`, `listAgentEvaluationResults()`, `listRunEvaluationResults()`, `listEvaluationRuns()`, `listCompatibleRuns()`, `listKnowledgeBases()`, `listMemoryBanks()` and the `total` of the keyed listings above. They were `undefined` although several of those types declare them required ([#14](https://github.com/seclai/seclai-javascript/issues/14))
13
+ - Return an array from `listMemoryBankTemplates()` and `getAgentsUsingMemoryBank()` when `apiVersion` is `2026-07-27` or later, as they do by default. Both are typed `unknown` and returned the `{data, pagination}` object; code that worked around it by reading `.data` must now read the array itself ([#14](https://github.com/seclai/seclai-javascript/issues/14))
14
+ - Reject an unknown `Seclai-Version` passed in the per-request `headers` of `request()` or `requestRaw()` with `SeclaiConfigurationError`, in any letter case. It was sent unchecked, bypassing the guard on `apiVersion`; a caller who relied on that to send a version this release does not know must now set `allowUnknownApiVersion` ([#15](https://github.com/seclai/seclai-javascript/issues/15))
15
+ - Reject an empty `Seclai-Version` in `defaultHeaders` or per-request `headers`. It passed the guard and replaced the configured version with an empty header ([#15](https://github.com/seclai/seclai-javascript/issues/15))
16
+ - Send exactly one value per header on the plain, download, upload and streaming paths. A default or per-request header that differed only in case from another layer's was sent beside it and joined by `fetch`: a default `X-API-Key` went out as `other, real`, a default `Authorization` beside the bearer token, and a per-request `Content-Type` could not replace the JSON one. Which layer wins is unchanged ([#15](https://github.com/seclai/seclai-javascript/issues/15))
17
+ - Keep the multipart boundary on uploads when `defaultHeaders` sets a content type in any case other than `content-type` or `Content-Type` ([#15](https://github.com/seclai/seclai-javascript/issues/15))
18
+ - Correct the README's API-versioning section: `2026-08-03` also rejects a non-zero `max_age_days` on `updateMemoryBank()`; `2026-09-30` breaks code that parses a run's or step's `output` as a JSON manifest; and `SeclaiApiVersion.Latest` moves with each SDK release — `1.6.0` moved it across that `2026-09-30` change — so pin a dated constant to keep behaviour fixed
19
+
3
20
  ## [1.6.0] - 2026-10-04
4
21
 
5
22
  ### Changed
@@ -206,6 +223,7 @@ _Stable release. No functional changes since 0.0.1._
206
223
 
207
224
  _Initial release._
208
225
 
226
+ [1.6.1]: https://github.com/seclai/seclai-javascript/releases/tag/1.6.1
209
227
  [1.6.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.6.0
210
228
  [1.5.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.5.0
211
229
  [1.4.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.4.0
package/README.md CHANGED
@@ -104,7 +104,7 @@ or set environment variables:
104
104
 
105
105
  Online API documentation (latest):
106
106
 
107
- https://seclai.github.io/seclai-javascript/1.6.0/
107
+ https://seclai.github.io/seclai-javascript/1.6.1/
108
108
 
109
109
  Release history is in [`CHANGELOG.md`](CHANGELOG.md).
110
110
 
@@ -131,8 +131,10 @@ Known versions are on `SeclaiApiVersion` (`V2026_07_01` through `V2026_10_03`,
131
131
  plus `Default` and `Latest`), imported from `@seclai/sdk`. A version this release was
132
132
  **not** built against throws at construction: a newer version can reshape
133
133
  responses, and this client would decode them incorrectly rather than reject them.
134
- Upgrade the package to adopt a new version, or set `allowUnknownApiVersion` if
135
- you have to move first and accept that risk.
134
+ The same check applies to a `Seclai-Version` set through `defaultHeaders` or the
135
+ per-request `headers` of `request()` / `requestRaw()`, in any letter case, and an
136
+ empty value is rejected. Upgrade the package to adopt a new version, or set
137
+ `allowUnknownApiVersion` if you have to move first and accept that risk.
136
138
 
137
139
  The guard only covers the header. An account pinned server-side can still be
138
140
  newer than this release — `getApiVersion()` reports the `effective_version` the
@@ -140,39 +142,55 @@ request resolved to, and comparing it against `SeclaiApiVersion.Latest` is how
140
142
  you detect the gap.
141
143
 
142
144
  **What `2026-07-27` changes.** Undeclared query parameters become a 422 instead
143
- of being ignored, and list endpoints move to the canonical `{data, pagination}`
144
- envelope. The affected methods read both shapes, so they keep working either way
145
- — but the metadata moves:
145
+ of being ignored, and every list endpoint that answered with a bare array or
146
+ under a per-resource key moves to the canonical `{data, pagination}` envelope.
147
+ The methods for those endpoints return their declared type on either shape, so
148
+ code written against the default still reads the result after you opt in. Four
149
+ of them return fewer rows once you do, covered below the table:
146
150
 
147
- | Method | Before | From 2026-07-27 |
151
+ | Declared return | Methods | From 2026-07-27 |
148
152
  | --- | --- | --- |
149
- | `listEvaluationCriteriaPage()` | bare array | `data` + `pagination` |
150
- | `listRunEvaluationResults()` | bare array | `data` + `pagination` |
151
- | `listAlertConfigs()` | `configs` + `total` | `data` + `pagination` |
152
- | `listModelAlerts()` | `alerts` + `total` | `data` + `pagination` |
153
-
154
- Prefer `pagination` over the flat `total`/`page`/`limit` properties, and read the
155
- last two with `res.data ?? res.configs` / `res.data ?? res.alerts`. The legacy
156
- keys will be deprecated and then removed once the canonical envelope is the
157
- default.
158
-
159
- The cloud-drive listings (`listCloudDriveProviders()`, `listCloudDrives()`,
160
- `getAgentsUsingCloudDrive()`, `listCloudDriveRejections()`) follow the same rule
161
- and return the items as an array on either shape. `listEmbeddingModels()` and
162
- `listRerankerModels()` move their list from `models` to `data`; both methods
163
- populate `models` on either shape, with the defaults and pricing beside it.
164
-
165
- **Later versions.** Each is cumulative, and none changes a response shape this
166
- client decodes:
153
+ | An array | `listEvaluationCriteria()`, `getAgentCallers()`, `listInboundEmailRejections()`, `listGovernanceAiConversations()`, `listSolutionConversations()`, `listModels()`, `listMemoryBankTemplates()`, `getAgentsUsingMemoryBank()`, `listCloudDriveProviders()`, `listCloudDrives()`, `getAgentsUsingCloudDrive()`, `listCloudDriveRejections()` | Still the array of items; the page metadata is not returned |
154
+ | `data`, bare array by default | `listEvaluationCriteriaPage()`, `listRunEvaluationResults()` | `data`, plus `pagination` |
155
+ | `data` with flat `total`/`page`/`limit` | `listEvaluationResults()`, `listAgentEvaluationResults()`, `listEvaluationRuns()`, `listCompatibleRuns()` | Unchanged, plus `pagination` |
156
+ | A per-resource key | `listAgentEmailOptOuts()` and `listBlockedEmailSenders()` / `setAutoBlockMode()` (`items`), `listAlertConfigs()` (`configs`), `listOrganizationAlertPreferences()` (`preferences`), `listEmailDomains()` (`domains`), `listKnowledgeBases()` (`knowledge_bases`), `listMemoryBanks()` (`memory_banks`), `getGenerationTiers()` (`tiers`), `listModelAlerts()` (`alerts`), `listExperiments()` (`experiments`), `listEmbeddingModels()` and `listRerankerModels()` (`models`) | The same key and any flat `total`/`page`/`limit`, plus `data` and `pagination` |
157
+
158
+ Where a type declares flat `total`, `page` or `limit`, the client fills them
159
+ from `pagination` after you opt in. `listRunEvaluationResults()` has no counters
160
+ on its default bare array, and gains them with `pagination`. Fields that sit
161
+ beside a list, such as `auto_block_mode` or the email-domain plan capabilities,
162
+ are present on both shapes.
163
+
164
+ Opting in also turns paging on for endpoints that returned everything by
165
+ default, so the same call can return fewer rows:
166
+
167
+ - `listEvaluationCriteria()` and `listRunEvaluationResults()` return every item
168
+ by default and one page (20 unless you pass `limit`) after you opt in. The
169
+ array from `listEvaluationCriteria()` carries no sign of that; use
170
+ `listEvaluationCriteriaPage()` to see `pagination`.
171
+ - `listAlertConfigs()` ignores `page` and `limit` by default and returns every
172
+ config; after you opt in it returns one page.
173
+ - `setAutoBlockMode()` reports the account's full `total` by default, and the
174
+ number of rows it returned after you opt in.
175
+
176
+ **Later versions.** Each is cumulative. None changes a response shape this
177
+ client decodes, but `2026-09-30` changes what a string you may be parsing
178
+ contains:
167
179
 
168
180
  | Version | What it changes |
169
181
  | --- | --- |
170
- | `2026-08-03` | `createMemoryBank()` rejects `max_age_days` with a 400, and an omitted `retention_days` resolves per bank type instead of to 30 |
182
+ | `2026-08-03` | `createMemoryBank()` and `updateMemoryBank()` reject a non-zero `max_age_days` with a 400, and a memory bank's `max_age_days` reads as `null`. On create, an omitted `retention_days` resolves per bank type instead of to 30 |
171
183
  | `2026-08-21` | `createSource()` rejects an embedding dimension its embedder does not support with a 400 — `listEmbeddingModels()` reports the supported ones |
172
184
  | `2026-09-28` | Agent-definition writes use the current file-list grammar: an omitted `attachments` keeps the stored list and `[]` means no files |
173
- | `2026-09-30` | A run's and a step's `output`, and a step's `input`, are the text rather than a JSON manifest; files are in `attachments` on every version |
185
+ | `2026-09-30` | **Breaks code that parses `output`.** A run's and a step's `output`, and a step's `input`, are the plain text; below this version an output that has files is a JSON manifest string (`{schema, text, attachments}`). Read files from `attachments`, which is populated on every version |
174
186
  | `2026-10-03` | A new LLM step written without `attachments` takes its parent's files, and a new retrieval step's matched media are its files |
175
187
 
188
+ **`Latest` moves with the SDK.** `SeclaiApiVersion.Latest` is the newest version
189
+ the installed release knows, so upgrading the package can opt a client that
190
+ passes it into every version added since — `1.6.0` moved it from `2026-07-27` to
191
+ `2026-10-03`, across the `2026-09-30` output change. Pass a dated constant such
192
+ as `SeclaiApiVersion.V2026_07_27` to keep behaviour fixed across upgrades.
193
+
176
194
  ## Resources
177
195
 
178
196
  ### Identity