@seclai/sdk 1.7.0 → 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/CHANGELOG.md +25 -0
- package/README.md +90 -17
- package/dist/index.cjs +141 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +598 -79
- package/dist/index.d.ts +598 -79
- package/dist/index.js +141 -34
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.8.0] - 2026-10-31
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Sync the bundled OpenAPI spec and regenerate the types. Existing responses gain properties: `decision` on `AgentRunStepResponse`, `created_resources`, `solution_id` and the run and credit limits `max_runs_total`, `max_runs_per_day`, `max_runs_per_hour`, `max_credits_per_run` and `max_credits_per_period` on `AgentSummaryResponse`, `max_credits_per_period`, `spend_cap_action`, `spend_cap_delete_order` and `spend_cap_reached` on `SourceResponse`, and `release_waiting_reason` on `SourceContentStatusResponse`
|
|
8
|
+
- Move `SeclaiApiVersion.Latest` to `2026-10-28`. Nothing is sent unless `apiVersion` is set, so a client that passes `SeclaiApiVersion.Latest` now opts into `2026-10-28`: an `if_else` or `switch` step's `output` is the result of the arm it took, where it was a `{"branch": ...}` marker naming the arm. Read the arm from the step's new `decision`, which is set on every version
|
|
9
|
+
- Mark `severity` on `listAlerts()` deprecated. It has never been sent, because `GET /alerts` has no severity filter
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Add `listAgentExamples()` for the agent gallery, searchable with `query` and filterable by `useCase`, returning typed `AgentExample` entries with the `resources` each needs, and accept `agent_template` entries from it on `createAgent()` with `resource_bindings` and `create_missing_resources`
|
|
14
|
+
- Add `setSlackTriggerConfig()` to configure an agent's `SLACK_COMMAND` trigger: its Slack connection, form, channels, activation, reply visibility and conversation settings
|
|
15
|
+
- Accept the run and credit limits on `updateAgent()`: `max_runs_total`, `max_runs_per_day`, `max_runs_per_hour`, `max_credits_per_run` and `max_credits_per_period`, a `set_max_*` flag for each to remove it, and `apply_import_run_limits`
|
|
16
|
+
- Accept a spend limit on `updateSource()`: `max_credits_per_period`, `spend_cap_action` and `spend_cap_delete_order`
|
|
17
|
+
- Accept the query filters the API declares and no method sent: `status`, `flaggedOnly`, `timeFrom` and `timeTo` on `listEvaluationResults()` and `listAgentEvaluationResults()`, which also takes `step`; `status`, `step`, `timeFrom` and `timeTo` on `listEvaluationRuns()`; `startedAfter` on `listCompatibleRuns()`; `days`, `startDate` and `endDate` on `getNonManualEvaluationSummary()` and `getMemoryBankStats()` (each method documents how the dates combine with `days`); `limit` and `offset` on `getMemoryBankAiLastConversation()` and `getAiAssistantMemoryBankHistory()`; `agentId`, `sourceConnectionId`, `timeFrom` and `timeTo` on `listAlerts()`; `agentId`, `sourceConnectionId` and `scope` on `listAlertConfigs()`; `organizationId` and `includeDefaults` on `listOrganizationAlertPreferences()`; `limit` on `listGovernanceAiConversations()`; `type` on `listMemoryBanks()`; `agentId` and `unreadOnly` on `listModelAlerts()`; `requireToolUse`, `requireStructuredOutput`, `requireThinking`, `minContextTokens` and `minOutputTokens` on `getModelRecommendations()`; and `search` on `listSolutions()`
|
|
18
|
+
- Let `getNonManualEvaluationSummary()` omit `agentId` for the account-wide summary
|
|
19
|
+
- Add the `SeclaiApiVersion.V2026_10_28` constant, so that version is accepted as `apiVersion`
|
|
20
|
+
- Add the type exports `AgentExampleListResponse`, `AgentExample`, `AgentExampleResource`, `SetSlackTriggerConfigRequest`, `SlackTriggerConfigResponse`, `SlackTriggerActivation`, `SlackTriggerScope`, `SlackReplyVisibility`, `SpendCapAction` and `SpendCapDeleteOrder`, and the option types `ListAgentExamplesOptions`, `ListEvaluationResultsOptions`, `ListAgentEvaluationResultsOptions`, `ListEvaluationRunsOptions`, `ListCompatibleRunsOptions`, `DateRangeOptions`, `OffsetPageOptions`, `ListAlertsOptions`, `ListAlertConfigsOptions`, `ListOrganizationAlertPreferencesOptions`, `ListMemoryBanksOptions`, `ListModelAlertsOptions`, `ModelRecommendationsOptions` and `ListSolutionsOptions`
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Make every field of `UpdateAgentRequest` optional. `updateAgent()` required `set_default_evaluation_tier`, `set_prompt_model_auto_rollback_triggers` and `set_sampling_config`, which the server defaults to `false`, so `updateAgent(id, { name })` did not compile
|
|
25
|
+
- Make server-defaulted fields optional on the request types that required them, so a call can leave them to the server: `description` on `CreateSolutionRequest` (`createSolution({ name })` did not compile), `priority` on `AgentRunRequest`, `enabled` and `distribution_type` on `CreateAlertConfigRequest`, `mode`, `type` and `strip_quoted_reply_chains` on `CreateMemoryBankBody`, `enabled` and `pass_threshold` on `CreateEvaluationCriteriaRequest`, `flagged`, `retry_count` and `retry_triggered` on `CreateEvaluationResultRequest`, `content_type` on `InlineTextUploadRequest` and `InlineTextReplaceRequest`, `entry_count` on `TestCompactionRequest`, `entry_count` and `bank_type` on `StandaloneTestCompactionRequest`, `match_type` on `BlockEmailSenderRequest`, `delegated` on `AddEmailDomainRequest`, `mode` on `GenerateAgentStepsRequest`, `pass_threshold` on `TestDraftEvaluationRequest`, `top_n` on `AgentTraceSearchRequest`, `confirm_deletions` on `AiAssistantAcceptRequest`, and the playground settings on `PlaygroundCreateRequest`. Response types are unchanged
|
|
26
|
+
|
|
3
27
|
## [1.7.0] - 2026-10-21
|
|
4
28
|
|
|
5
29
|
### Changed
|
|
@@ -246,6 +270,7 @@ _Stable release. No functional changes since 0.0.1._
|
|
|
246
270
|
|
|
247
271
|
_Initial release._
|
|
248
272
|
|
|
273
|
+
[1.8.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.8.0
|
|
249
274
|
[1.7.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.7.0
|
|
250
275
|
[1.6.1]: https://github.com/seclai/seclai-javascript/releases/tag/1.6.1
|
|
251
276
|
[1.6.0]: https://github.com/seclai/seclai-javascript/releases/tag/1.6.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.
|
|
107
|
+
https://seclai.github.io/seclai-javascript/1.8.0/
|
|
108
108
|
|
|
109
109
|
Release history is in [`CHANGELOG.md`](CHANGELOG.md).
|
|
110
110
|
|
|
@@ -127,7 +127,7 @@ Leave `apiVersion` unset and the header is omitted, so the account's pinned
|
|
|
127
127
|
baseline applies and responses keep their current shapes. Upgrading this package
|
|
128
128
|
alone never changes the wire contract.
|
|
129
129
|
|
|
130
|
-
Known versions are on `SeclaiApiVersion` (`V2026_07_01` through `
|
|
130
|
+
Known versions are on `SeclaiApiVersion` (`V2026_07_01` through `V2026_10_28`,
|
|
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.
|
|
@@ -188,6 +188,8 @@ a request that used to succeed, or (from `2026-10-21`) which fields can be
|
|
|
188
188
|
- `2026-10-21` changes evaluation numbers you may be reading: an `error` result
|
|
189
189
|
no longer counts as `failed` or toward the rates, and `testDraftEvaluation()`
|
|
190
190
|
returns `null` `score` and `passed` for one.
|
|
191
|
+
- `2026-10-28` changes what an `if_else` or `switch` step's `output` contains.
|
|
192
|
+
Read the arm it took from the step's `decision`, which is set on every version.
|
|
191
193
|
|
|
192
194
|
| Version | What it changes |
|
|
193
195
|
| --- | --- |
|
|
@@ -202,6 +204,7 @@ a request that used to succeed, or (from `2026-10-21`) which fields can be
|
|
|
202
204
|
| `2026-10-18` | A source's `document_images` defaults to `true` on every embedder. Below it it defaults to `false` on a text-only embedder |
|
|
203
205
|
| `2026-10-19` | `createSource()` rejects `polling_max_items` on any source type but an RSS feed with a 400. Below it the value is stored |
|
|
204
206
|
| `2026-10-21` | An evaluation result whose evaluator returned no verdict (`error`) is left out of `failed` and of `pass_rate` / `failure_rate` in `getNonManualEvaluationSummary()`, and `getEvaluationCriteriaSummary()` averages `average_score` over passed and failed results only. `testDraftEvaluation()` returns `score` and `passed` as `null` for an `error` result. Below it the summary counts `error` results in `failed` and the rates, `average_score` includes their stored scores, and the test draft returns `score` 0.5 and `passed: false`. The summary's `error` count is returned on every version |
|
|
207
|
+
| `2026-10-28` | An `if_else` or `switch` step's `output` is the result of the arm it took, or its input when that arm is empty or it took none. Below it the `output` is a `{"branch": ...}` marker naming the arm, with no `attachments`. The step's `decision` names the arm on every version |
|
|
205
208
|
|
|
206
209
|
**`Latest` moves with the SDK.** `SeclaiApiVersion.Latest` is the newest version
|
|
207
210
|
the installed release knows, so upgrading the package can opt a client that
|
|
@@ -209,7 +212,8 @@ passes it into every version added since — `1.6.0` moved it from `2026-07-27`
|
|
|
209
212
|
`2026-10-03`, across the `2026-09-30` output change, and `1.7.0` moves it to
|
|
210
213
|
`2026-10-21`, across the `2026-10-05` status change, the `2026-10-13` and
|
|
211
214
|
`2026-10-19` source-setting rejections, the `2026-10-16` input change and the
|
|
212
|
-
`2026-10-21` evaluation change.
|
|
215
|
+
`2026-10-21` evaluation change, and `1.8.0` moves it to `2026-10-28`,
|
|
216
|
+
across the `if_else` / `switch` step-output change. Pass a
|
|
213
217
|
dated constant such as `SeclaiApiVersion.V2026_07_27` to keep behaviour fixed
|
|
214
218
|
across upgrades.
|
|
215
219
|
|
|
@@ -270,6 +274,10 @@ const fetched = await client.getAgent("agent_id");
|
|
|
270
274
|
const updated = await client.updateAgent("agent_id", { name: "Renamed" });
|
|
271
275
|
await client.deleteAgent("agent_id");
|
|
272
276
|
|
|
277
|
+
// Run and credit limits. To remove one, send its set_max_* flag and omit the value.
|
|
278
|
+
await client.updateAgent("agent_id", { max_runs_per_hour: 60, max_credits_per_period: 500 });
|
|
279
|
+
await client.updateAgent("agent_id", { set_max_runs_per_hour: true });
|
|
280
|
+
|
|
273
281
|
// Pause / resume — a disabled agent stops firing from every trigger path
|
|
274
282
|
const callers = await client.getAgentCallers("agent_id"); // live agents calling this one
|
|
275
283
|
await client.disableAgent("agent_id"); // 409 if any caller above is still live
|
|
@@ -299,6 +307,31 @@ const imported = await client.createAgent({
|
|
|
299
307
|
// `imported.import_warnings` lists any items that couldn't be applied.
|
|
300
308
|
```
|
|
301
309
|
|
|
310
|
+
### Agent examples
|
|
311
|
+
|
|
312
|
+
The agent gallery lists example agents to start from. Pass an entry's `key` as
|
|
313
|
+
`agent_template` to `createAgent()`. Bind each resource the template needs with
|
|
314
|
+
`resource_bindings`, or set `create_missing_resources` to have the API create the
|
|
315
|
+
ones you leave out; `created_resources` reports what it made.
|
|
316
|
+
|
|
317
|
+
<!-- sdksync:check -->
|
|
318
|
+
```ts
|
|
319
|
+
const examples = await client.listAgentExamples({ query: "support", useCase: "customer_support", limit: 10 });
|
|
320
|
+
const example = examples.data[0];
|
|
321
|
+
console.log(example.key, example.title, examples.pagination.total);
|
|
322
|
+
for (const slot of example.resources) {
|
|
323
|
+
console.log(slot.slot, slot.kind, slot.creatable); // what resource_bindings can bind
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const agent = await client.createAgent({
|
|
327
|
+
name: "Support triage",
|
|
328
|
+
agent_template: example.key,
|
|
329
|
+
resource_bindings: { [example.resources[0].slot]: "kb_id" },
|
|
330
|
+
create_missing_resources: true,
|
|
331
|
+
});
|
|
332
|
+
console.log(agent.created_resources); // { slot: resource_id } for each resource it created
|
|
333
|
+
```
|
|
334
|
+
|
|
302
335
|
### Agent runs
|
|
303
336
|
|
|
304
337
|
```ts
|
|
@@ -429,6 +462,28 @@ Set `run_on_attachment_mismatch: true` to run an email whose attachments do not
|
|
|
429
462
|
fit what the agent accepts: files it cannot take are left out and the problems
|
|
430
463
|
are listed in the run's `email_attachment_issues` metadata. By default the run fails.
|
|
431
464
|
|
|
465
|
+
### Agent Slack triggers
|
|
466
|
+
|
|
467
|
+
Configure an agent's `SLACK_COMMAND` trigger, which people run from Slack with
|
|
468
|
+
`/seclai` or the message shortcut. Omitted fields are left unchanged.
|
|
469
|
+
|
|
470
|
+
<!-- sdksync:check -->
|
|
471
|
+
```ts
|
|
472
|
+
const slack = await client.setSlackTriggerConfig("agent_id", "trigger_id", {
|
|
473
|
+
scope: "selected_channels", // or "bot_channels"
|
|
474
|
+
channel_ids: ["C0123456789"],
|
|
475
|
+
activation: "everywhere", // or "channel_opt_in"
|
|
476
|
+
visibility: "private", // or "channel"
|
|
477
|
+
allow_dms: true,
|
|
478
|
+
turns_enabled: true, // let people keep the conversation going
|
|
479
|
+
max_turns: 5,
|
|
480
|
+
form: [{ key: "ticket", label: "Ticket ID", type: "short_text", required: true }],
|
|
481
|
+
});
|
|
482
|
+
console.log(slack.missing_scopes); // Slack scopes the connection lacks for optional features
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
Each form value reaches the run as `{{metadata.<key>}}`.
|
|
486
|
+
|
|
432
487
|
### Accepted attachments
|
|
433
488
|
|
|
434
489
|
Declare the input attachments a trigger accepts. A run's files are each assigned
|
|
@@ -503,18 +558,21 @@ const draft = await client.testDraftEvaluation("agent_id", { step_output: "...",
|
|
|
503
558
|
if (draft.status !== "error") console.log(draft.score, draft.passed);
|
|
504
559
|
|
|
505
560
|
// Results by criteria
|
|
506
|
-
const results = await client.listEvaluationResults("criteria_id");
|
|
561
|
+
const results = await client.listEvaluationResults("criteria_id", { flaggedOnly: true, timeFrom: "2026-10-01T00:00:00Z" });
|
|
507
562
|
const summary = await client.getEvaluationCriteriaSummary("criteria_id");
|
|
508
563
|
await client.createEvaluationResult("criteria_id", { ... });
|
|
509
564
|
|
|
510
565
|
// Results by run
|
|
511
566
|
const runResults = await client.listRunEvaluationResults("agent_id", "run_id");
|
|
567
|
+
const agentResults = await client.listAgentEvaluationResults("agent_id", { status: "failed", step: "step_id" });
|
|
568
|
+
const evalRuns = await client.listEvaluationRuns("agent_id", { timeFrom: "2026-10-01T00:00:00Z" });
|
|
512
569
|
|
|
513
|
-
// Non-manual evaluation summary
|
|
514
|
-
const nonManual = await client.getNonManualEvaluationSummary("agent_id");
|
|
570
|
+
// Non-manual evaluation summary, for one agent or the whole account
|
|
571
|
+
const nonManual = await client.getNonManualEvaluationSummary("agent_id", { days: 7 });
|
|
572
|
+
const accountWide = await client.getNonManualEvaluationSummary(undefined, { startDate: "2026-10-01", endDate: "2026-10-31" });
|
|
515
573
|
|
|
516
574
|
// Compatible runs for a criteria
|
|
517
|
-
const compatible = await client.listCompatibleRuns("criteria_id");
|
|
575
|
+
const compatible = await client.listCompatibleRuns("criteria_id", { startedAfter: "2026-10-01T00:00:00Z" });
|
|
518
576
|
```
|
|
519
577
|
|
|
520
578
|
### Knowledge bases
|
|
@@ -530,14 +588,14 @@ await client.deleteKnowledgeBase("kb_id");
|
|
|
530
588
|
### Memory banks
|
|
531
589
|
|
|
532
590
|
```ts
|
|
533
|
-
const banks = await client.listMemoryBanks();
|
|
591
|
+
const banks = await client.listMemoryBanks({ type: "conversation" });
|
|
534
592
|
const bank = await client.createMemoryBank({ name: "Chat Memory", type: "conversation" });
|
|
535
593
|
const fetched = await client.getMemoryBank("mb_id");
|
|
536
594
|
await client.updateMemoryBank("mb_id", { name: "Renamed" });
|
|
537
595
|
await client.deleteMemoryBank("mb_id");
|
|
538
596
|
|
|
539
597
|
// Stats & compaction
|
|
540
|
-
const stats = await client.getMemoryBankStats("mb_id");
|
|
598
|
+
const stats = await client.getMemoryBankStats("mb_id", { startDate: "2026-10-01", endDate: "2026-10-31" });
|
|
541
599
|
await client.compactMemoryBank("mb_id");
|
|
542
600
|
|
|
543
601
|
// Test compaction
|
|
@@ -550,7 +608,7 @@ const agents = await client.getAgentsUsingMemoryBank("mb_id");
|
|
|
550
608
|
|
|
551
609
|
// AI assistant
|
|
552
610
|
const suggestion = await client.generateMemoryBankConfig({ user_input: "..." });
|
|
553
|
-
const history = await client.getMemoryBankAiLastConversation();
|
|
611
|
+
const history = await client.getMemoryBankAiLastConversation({ limit: 5 });
|
|
554
612
|
await client.acceptMemoryBankAiSuggestion("conv_id", { ... });
|
|
555
613
|
|
|
556
614
|
// Source management
|
|
@@ -567,6 +625,21 @@ await client.updateSource("source_id", { name: "Renamed" });
|
|
|
567
625
|
await client.deleteSource("source_id");
|
|
568
626
|
```
|
|
569
627
|
|
|
628
|
+
A spend limit caps the credits a source may commit per billing period. When it is
|
|
629
|
+
reached, `stop` refuses new uploads and email, and `delete` removes entries in
|
|
630
|
+
`spend_cap_delete_order` to make room. Send `null` to remove the limit.
|
|
631
|
+
|
|
632
|
+
<!-- sdksync:check -->
|
|
633
|
+
```ts
|
|
634
|
+
const capped = await client.updateSource("source_id", {
|
|
635
|
+
max_credits_per_period: 1000,
|
|
636
|
+
spend_cap_action: "delete",
|
|
637
|
+
spend_cap_delete_order: "oldest_published",
|
|
638
|
+
});
|
|
639
|
+
console.log(capped.spend_cap_reached);
|
|
640
|
+
await client.updateSource("source_id", { max_credits_per_period: null });
|
|
641
|
+
```
|
|
642
|
+
|
|
570
643
|
Indexing status of a source's content, keyed by the `content_version_id` the
|
|
571
644
|
upload methods return:
|
|
572
645
|
|
|
@@ -728,7 +801,7 @@ const bytes = new Uint8Array(await file.arrayBuffer());
|
|
|
728
801
|
### Solutions
|
|
729
802
|
|
|
730
803
|
```ts
|
|
731
|
-
const solutions = await client.listSolutions();
|
|
804
|
+
const solutions = await client.listSolutions({ search: "billing" });
|
|
732
805
|
const sol = await client.createSolution({ name: "My Solution" });
|
|
733
806
|
const fetched = await client.getSolution("solution_id");
|
|
734
807
|
await client.updateSolution("solution_id", { name: "Renamed" });
|
|
@@ -761,7 +834,7 @@ await client.markSolutionConversationTurn("solution_id", "conversation_id", { ..
|
|
|
761
834
|
|
|
762
835
|
```ts
|
|
763
836
|
const plan = await client.generateGovernanceAiPlan({ user_input: "Add a toxicity policy" });
|
|
764
|
-
const convs = await client.listGovernanceAiConversations();
|
|
837
|
+
const convs = await client.listGovernanceAiConversations({ limit: 10 });
|
|
765
838
|
await client.acceptGovernanceAiPlan("conversation_id");
|
|
766
839
|
await client.declineGovernanceAiPlan("conversation_id");
|
|
767
840
|
```
|
|
@@ -769,7 +842,7 @@ await client.declineGovernanceAiPlan("conversation_id");
|
|
|
769
842
|
### Alerts
|
|
770
843
|
|
|
771
844
|
```ts
|
|
772
|
-
const alerts = await client.listAlerts({ status: "active" });
|
|
845
|
+
const alerts = await client.listAlerts({ status: "active", agentId: "agent_id", timeFrom: "2026-10-01T00:00:00Z" });
|
|
773
846
|
const alert = await client.getAlert("alert_id");
|
|
774
847
|
await client.changeAlertStatus("alert_id", { status: "resolved" });
|
|
775
848
|
await client.addAlertComment("alert_id", { text: "Investigating" });
|
|
@@ -779,14 +852,14 @@ await client.subscribeToAlert("alert_id");
|
|
|
779
852
|
await client.unsubscribeFromAlert("alert_id");
|
|
780
853
|
|
|
781
854
|
// Alert configs
|
|
782
|
-
const configs = await client.listAlertConfigs();
|
|
855
|
+
const configs = await client.listAlertConfigs({ agentId: "agent_id" });
|
|
783
856
|
await client.createAlertConfig({ ... });
|
|
784
857
|
await client.getAlertConfig("config_id");
|
|
785
858
|
await client.updateAlertConfig("config_id", { ... });
|
|
786
859
|
await client.deleteAlertConfig("config_id");
|
|
787
860
|
|
|
788
861
|
// Organization preferences
|
|
789
|
-
const prefs = await client.listOrganizationAlertPreferences();
|
|
862
|
+
const prefs = await client.listOrganizationAlertPreferences({ includeDefaults: true });
|
|
790
863
|
await client.updateOrganizationAlertPreference("org_id", "alert_type", { ... });
|
|
791
864
|
```
|
|
792
865
|
|
|
@@ -807,11 +880,11 @@ const embedders = await client.listEmbeddingModels({ supportsInputMedia: "image"
|
|
|
807
880
|
const rerankers = await client.listRerankerModels();
|
|
808
881
|
console.log(embedders.models, embedders.default_model_type, rerankers.models);
|
|
809
882
|
|
|
810
|
-
const alerts = await client.listModelAlerts();
|
|
883
|
+
const alerts = await client.listModelAlerts({ unreadOnly: true });
|
|
811
884
|
await client.markModelAlertRead("alert_id");
|
|
812
885
|
await client.markAllModelAlertsRead();
|
|
813
886
|
const unread = await client.getUnreadModelAlertCount();
|
|
814
|
-
const recs = await client.getModelRecommendations("model_id");
|
|
887
|
+
const recs = await client.getModelRecommendations("model_id", { requireToolUse: true, minContextTokens: 100_000 });
|
|
815
888
|
|
|
816
889
|
// Model playground experiments
|
|
817
890
|
const experiment = await client.createExperiment({ model_ids: ["model_id"], prompt: "..." });
|
package/dist/index.cjs
CHANGED
|
@@ -64,10 +64,11 @@ var SeclaiApiVersion = {
|
|
|
64
64
|
V2026_10_18: "2026-10-18",
|
|
65
65
|
V2026_10_19: "2026-10-19",
|
|
66
66
|
V2026_10_21: "2026-10-21",
|
|
67
|
+
V2026_10_28: "2026-10-28",
|
|
67
68
|
/** Baseline applied to an unpinned, header-less caller. */
|
|
68
69
|
Default: "2026-07-01",
|
|
69
70
|
/** Newest version known to this SDK release. May lag the server. */
|
|
70
|
-
Latest: "2026-10-
|
|
71
|
+
Latest: "2026-10-28"
|
|
71
72
|
};
|
|
72
73
|
var KNOWN_API_VERSIONS = Object.entries(SeclaiApiVersion).filter(([k]) => k.startsWith("V")).map(([, v]) => v);
|
|
73
74
|
|
|
@@ -901,6 +902,20 @@ var Seclai = class {
|
|
|
901
902
|
query: { page: opts.page, limit: opts.limit }
|
|
902
903
|
});
|
|
903
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
|
+
}
|
|
904
919
|
/**
|
|
905
920
|
* Create a new agent.
|
|
906
921
|
*
|
|
@@ -1581,12 +1596,19 @@ var Seclai = class {
|
|
|
1581
1596
|
* List evaluation results for a specific criteria.
|
|
1582
1597
|
*
|
|
1583
1598
|
* @param criteriaId - Criteria identifier.
|
|
1584
|
-
* @param opts - Pagination
|
|
1599
|
+
* @param opts - Pagination, status, flag and time-range filters.
|
|
1585
1600
|
*/
|
|
1586
1601
|
async listEvaluationResults(criteriaId, opts = {}) {
|
|
1587
1602
|
return keyedList(
|
|
1588
1603
|
await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/results`, {
|
|
1589
|
-
query: {
|
|
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
|
+
}
|
|
1590
1612
|
}),
|
|
1591
1613
|
"data",
|
|
1592
1614
|
PAGE_COUNTERS
|
|
@@ -1606,12 +1628,12 @@ var Seclai = class {
|
|
|
1606
1628
|
* List runs compatible with a specific evaluation criteria.
|
|
1607
1629
|
*
|
|
1608
1630
|
* @param criteriaId - Criteria identifier.
|
|
1609
|
-
* @param opts - Pagination
|
|
1631
|
+
* @param opts - Pagination and a `startedAfter` filter.
|
|
1610
1632
|
*/
|
|
1611
1633
|
async listCompatibleRuns(criteriaId, opts = {}) {
|
|
1612
1634
|
return keyedList(
|
|
1613
1635
|
await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/compatible-runs`, {
|
|
1614
|
-
query: { page: opts.page, limit: opts.limit }
|
|
1636
|
+
query: { page: opts.page, limit: opts.limit, started_after: opts.startedAfter }
|
|
1615
1637
|
}),
|
|
1616
1638
|
"data",
|
|
1617
1639
|
PAGE_COUNTERS
|
|
@@ -1631,12 +1653,20 @@ var Seclai = class {
|
|
|
1631
1653
|
* List all evaluation results for an agent.
|
|
1632
1654
|
*
|
|
1633
1655
|
* @param agentId - Agent identifier.
|
|
1634
|
-
* @param opts - Pagination
|
|
1656
|
+
* @param opts - Pagination, status, step, flag and time-range filters.
|
|
1635
1657
|
*/
|
|
1636
1658
|
async listAgentEvaluationResults(agentId, opts = {}) {
|
|
1637
1659
|
return keyedList(
|
|
1638
1660
|
await this.request("GET", `/agents/${agentId}/evaluation-results`, {
|
|
1639
|
-
query: {
|
|
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
|
+
}
|
|
1640
1670
|
}),
|
|
1641
1671
|
"data",
|
|
1642
1672
|
PAGE_COUNTERS
|
|
@@ -1646,25 +1676,35 @@ var Seclai = class {
|
|
|
1646
1676
|
* List evaluation run summaries for an agent.
|
|
1647
1677
|
*
|
|
1648
1678
|
* @param agentId - Agent identifier.
|
|
1649
|
-
* @param opts - Pagination
|
|
1679
|
+
* @param opts - Pagination, status, step and time-range filters.
|
|
1650
1680
|
*/
|
|
1651
1681
|
async listEvaluationRuns(agentId, opts = {}) {
|
|
1652
1682
|
return keyedList(
|
|
1653
1683
|
await this.request("GET", `/agents/${agentId}/evaluation-runs`, {
|
|
1654
|
-
query: {
|
|
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
|
+
}
|
|
1655
1692
|
}),
|
|
1656
1693
|
"data",
|
|
1657
1694
|
PAGE_COUNTERS
|
|
1658
1695
|
);
|
|
1659
1696
|
}
|
|
1660
1697
|
/**
|
|
1661
|
-
* Get a summary of non-manual evaluations
|
|
1698
|
+
* Get a summary of non-manual evaluations, for one agent or the whole account.
|
|
1662
1699
|
*
|
|
1663
|
-
* @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.
|
|
1664
1704
|
*/
|
|
1665
|
-
async getNonManualEvaluationSummary(agentId) {
|
|
1705
|
+
async getNonManualEvaluationSummary(agentId, opts = {}) {
|
|
1666
1706
|
return await this.request("GET", "/agents/evaluation-results/non-manual-summary", {
|
|
1667
|
-
query: { agent_id: agentId }
|
|
1707
|
+
query: { agent_id: agentId, days: opts.days, start_date: opts.startDate, end_date: opts.endDate }
|
|
1668
1708
|
});
|
|
1669
1709
|
}
|
|
1670
1710
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -1688,6 +1728,26 @@ var Seclai = class {
|
|
|
1688
1728
|
json: body
|
|
1689
1729
|
});
|
|
1690
1730
|
}
|
|
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
|
+
}
|
|
1691
1751
|
/**
|
|
1692
1752
|
* Replace the input attachments a trigger accepts.
|
|
1693
1753
|
*
|
|
@@ -1896,13 +1956,13 @@ var Seclai = class {
|
|
|
1896
1956
|
/**
|
|
1897
1957
|
* List memory banks.
|
|
1898
1958
|
*
|
|
1899
|
-
* @param opts - Pagination and
|
|
1959
|
+
* @param opts - Pagination, sorting and a `type` filter.
|
|
1900
1960
|
* @returns Paginated list of memory banks.
|
|
1901
1961
|
*/
|
|
1902
1962
|
async listMemoryBanks(opts = {}) {
|
|
1903
1963
|
return keyedList(
|
|
1904
1964
|
await this.request("GET", "/memory_banks", {
|
|
1905
|
-
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 }
|
|
1906
1966
|
}),
|
|
1907
1967
|
"memory_banks",
|
|
1908
1968
|
PAGE_COUNTERS
|
|
@@ -1959,9 +2019,13 @@ var Seclai = class {
|
|
|
1959
2019
|
* Get stats for a memory bank.
|
|
1960
2020
|
*
|
|
1961
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).
|
|
1962
2024
|
*/
|
|
1963
|
-
async getMemoryBankStats(memoryBankId) {
|
|
1964
|
-
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
|
+
});
|
|
1965
2029
|
}
|
|
1966
2030
|
/**
|
|
1967
2031
|
* Compact a memory bank (trigger compaction).
|
|
@@ -2014,9 +2078,13 @@ var Seclai = class {
|
|
|
2014
2078
|
}
|
|
2015
2079
|
/**
|
|
2016
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).
|
|
2017
2083
|
*/
|
|
2018
|
-
async getMemoryBankAiLastConversation() {
|
|
2019
|
-
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
|
+
});
|
|
2020
2088
|
}
|
|
2021
2089
|
/**
|
|
2022
2090
|
* Accept a memory bank AI suggestion.
|
|
@@ -2413,12 +2481,12 @@ var Seclai = class {
|
|
|
2413
2481
|
/**
|
|
2414
2482
|
* List solutions.
|
|
2415
2483
|
*
|
|
2416
|
-
* @param opts - Pagination and
|
|
2484
|
+
* @param opts - Pagination, sorting and a name `search`.
|
|
2417
2485
|
* @returns Paginated list of solutions.
|
|
2418
2486
|
*/
|
|
2419
2487
|
async listSolutions(opts = {}) {
|
|
2420
2488
|
return await this.request("GET", "/solutions", {
|
|
2421
|
-
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 }
|
|
2422
2490
|
});
|
|
2423
2491
|
}
|
|
2424
2492
|
/**
|
|
@@ -2615,10 +2683,12 @@ var Seclai = class {
|
|
|
2615
2683
|
}
|
|
2616
2684
|
/**
|
|
2617
2685
|
* List governance AI conversations.
|
|
2686
|
+
*
|
|
2687
|
+
* @param opts - `limit`: how many conversations (the server defaults to 20).
|
|
2618
2688
|
*/
|
|
2619
|
-
async listGovernanceAiConversations() {
|
|
2689
|
+
async listGovernanceAiConversations(opts = {}) {
|
|
2620
2690
|
return listItems(
|
|
2621
|
-
await this.request("GET", "/governance/ai-assistant/conversations")
|
|
2691
|
+
await this.request("GET", "/governance/ai-assistant/conversations", { query: { limit: opts.limit } })
|
|
2622
2692
|
);
|
|
2623
2693
|
}
|
|
2624
2694
|
/**
|
|
@@ -2649,7 +2719,15 @@ var Seclai = class {
|
|
|
2649
2719
|
*/
|
|
2650
2720
|
async listAlerts(opts = {}) {
|
|
2651
2721
|
return await this.request("GET", "/alerts", {
|
|
2652
|
-
query: {
|
|
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
|
+
}
|
|
2653
2731
|
});
|
|
2654
2732
|
}
|
|
2655
2733
|
/**
|
|
@@ -2708,7 +2786,15 @@ var Seclai = class {
|
|
|
2708
2786
|
*/
|
|
2709
2787
|
async listAlertConfigs(opts = {}) {
|
|
2710
2788
|
return keyedList(
|
|
2711
|
-
await this.request("GET", "/alerts/configs", {
|
|
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
|
+
}),
|
|
2712
2798
|
"configs",
|
|
2713
2799
|
["total"]
|
|
2714
2800
|
);
|
|
@@ -2752,10 +2838,14 @@ var Seclai = class {
|
|
|
2752
2838
|
// ─── Organization Alert Preferences ────────────────────────────────────────
|
|
2753
2839
|
/**
|
|
2754
2840
|
* List organization alert preferences.
|
|
2841
|
+
*
|
|
2842
|
+
* @param opts - Organization filter, and whether to include default subscriptions.
|
|
2755
2843
|
*/
|
|
2756
|
-
async listOrganizationAlertPreferences() {
|
|
2844
|
+
async listOrganizationAlertPreferences(opts = {}) {
|
|
2757
2845
|
return keyedList(
|
|
2758
|
-
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
|
+
}),
|
|
2759
2849
|
"preferences",
|
|
2760
2850
|
["total"]
|
|
2761
2851
|
);
|
|
@@ -2780,13 +2870,15 @@ var Seclai = class {
|
|
|
2780
2870
|
/**
|
|
2781
2871
|
* List model alerts.
|
|
2782
2872
|
*
|
|
2783
|
-
* @param opts - Pagination
|
|
2873
|
+
* @param opts - Pagination, an agent filter and `unreadOnly`.
|
|
2784
2874
|
*/
|
|
2785
2875
|
async listModelAlerts(opts = {}) {
|
|
2786
2876
|
const limit = opts.limit ?? 50;
|
|
2787
2877
|
const offset = opts.page && opts.page > 1 ? (opts.page - 1) * limit : void 0;
|
|
2788
2878
|
return keyedList(
|
|
2789
|
-
await this.request("GET", "/models/alerts", {
|
|
2879
|
+
await this.request("GET", "/models/alerts", {
|
|
2880
|
+
query: { offset, limit: opts.limit, agent_id: opts.agentId, unread_only: opts.unreadOnly }
|
|
2881
|
+
}),
|
|
2790
2882
|
"alerts",
|
|
2791
2883
|
["total"]
|
|
2792
2884
|
);
|
|
@@ -2815,9 +2907,18 @@ var Seclai = class {
|
|
|
2815
2907
|
* Get model recommendations.
|
|
2816
2908
|
*
|
|
2817
2909
|
* @param modelId - Model identifier.
|
|
2910
|
+
* @param opts - Capabilities and limits a recommended model must have.
|
|
2818
2911
|
*/
|
|
2819
|
-
async getModelRecommendations(modelId) {
|
|
2820
|
-
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
|
+
});
|
|
2821
2922
|
}
|
|
2822
2923
|
/**
|
|
2823
2924
|
* List all enabled LLM models grouped by provider.
|
|
@@ -2889,7 +2990,9 @@ var Seclai = class {
|
|
|
2889
2990
|
/**
|
|
2890
2991
|
* List model playground experiments.
|
|
2891
2992
|
*
|
|
2892
|
-
* @param opts -
|
|
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).
|
|
2893
2996
|
*/
|
|
2894
2997
|
async listExperiments(opts = {}) {
|
|
2895
2998
|
return keyedList(
|
|
@@ -3220,9 +3323,13 @@ var Seclai = class {
|
|
|
3220
3323
|
}
|
|
3221
3324
|
/**
|
|
3222
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).
|
|
3223
3328
|
*/
|
|
3224
|
-
async getAiAssistantMemoryBankHistory() {
|
|
3225
|
-
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
|
+
});
|
|
3226
3333
|
}
|
|
3227
3334
|
/**
|
|
3228
3335
|
* Accept an AI assistant suggestion.
|