@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/dist/index.js
CHANGED
|
@@ -13,10 +13,11 @@ var SeclaiApiVersion = {
|
|
|
13
13
|
V2026_10_18: "2026-10-18",
|
|
14
14
|
V2026_10_19: "2026-10-19",
|
|
15
15
|
V2026_10_21: "2026-10-21",
|
|
16
|
+
V2026_10_28: "2026-10-28",
|
|
16
17
|
/** Baseline applied to an unpinned, header-less caller. */
|
|
17
18
|
Default: "2026-07-01",
|
|
18
19
|
/** Newest version known to this SDK release. May lag the server. */
|
|
19
|
-
Latest: "2026-10-
|
|
20
|
+
Latest: "2026-10-28"
|
|
20
21
|
};
|
|
21
22
|
var KNOWN_API_VERSIONS = Object.entries(SeclaiApiVersion).filter(([k]) => k.startsWith("V")).map(([, v]) => v);
|
|
22
23
|
|
|
@@ -850,6 +851,20 @@ var Seclai = class {
|
|
|
850
851
|
query: { page: opts.page, limit: opts.limit }
|
|
851
852
|
});
|
|
852
853
|
}
|
|
854
|
+
/**
|
|
855
|
+
* List the agent gallery: example agents to start from.
|
|
856
|
+
*
|
|
857
|
+
* Pass an entry's `key` as `agent_template` to {@link createAgent}, with
|
|
858
|
+
* `resource_bindings` for the resources it needs.
|
|
859
|
+
*
|
|
860
|
+
* @param opts - Text search, use-case filter and pagination.
|
|
861
|
+
* @returns A page of gallery entries.
|
|
862
|
+
*/
|
|
863
|
+
async listAgentExamples(opts = {}) {
|
|
864
|
+
return await this.request("GET", "/agents/examples", {
|
|
865
|
+
query: { query: opts.query, use_case: opts.useCase, page: opts.page, limit: opts.limit }
|
|
866
|
+
});
|
|
867
|
+
}
|
|
853
868
|
/**
|
|
854
869
|
* Create a new agent.
|
|
855
870
|
*
|
|
@@ -1530,12 +1545,19 @@ var Seclai = class {
|
|
|
1530
1545
|
* List evaluation results for a specific criteria.
|
|
1531
1546
|
*
|
|
1532
1547
|
* @param criteriaId - Criteria identifier.
|
|
1533
|
-
* @param opts - Pagination
|
|
1548
|
+
* @param opts - Pagination, status, flag and time-range filters.
|
|
1534
1549
|
*/
|
|
1535
1550
|
async listEvaluationResults(criteriaId, opts = {}) {
|
|
1536
1551
|
return keyedList(
|
|
1537
1552
|
await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/results`, {
|
|
1538
|
-
query: {
|
|
1553
|
+
query: {
|
|
1554
|
+
page: opts.page,
|
|
1555
|
+
limit: opts.limit,
|
|
1556
|
+
status: opts.status,
|
|
1557
|
+
flagged_only: opts.flaggedOnly,
|
|
1558
|
+
time_from: opts.timeFrom,
|
|
1559
|
+
time_to: opts.timeTo
|
|
1560
|
+
}
|
|
1539
1561
|
}),
|
|
1540
1562
|
"data",
|
|
1541
1563
|
PAGE_COUNTERS
|
|
@@ -1555,12 +1577,12 @@ var Seclai = class {
|
|
|
1555
1577
|
* List runs compatible with a specific evaluation criteria.
|
|
1556
1578
|
*
|
|
1557
1579
|
* @param criteriaId - Criteria identifier.
|
|
1558
|
-
* @param opts - Pagination
|
|
1580
|
+
* @param opts - Pagination and a `startedAfter` filter.
|
|
1559
1581
|
*/
|
|
1560
1582
|
async listCompatibleRuns(criteriaId, opts = {}) {
|
|
1561
1583
|
return keyedList(
|
|
1562
1584
|
await this.request("GET", `/agents/evaluation-criteria/${criteriaId}/compatible-runs`, {
|
|
1563
|
-
query: { page: opts.page, limit: opts.limit }
|
|
1585
|
+
query: { page: opts.page, limit: opts.limit, started_after: opts.startedAfter }
|
|
1564
1586
|
}),
|
|
1565
1587
|
"data",
|
|
1566
1588
|
PAGE_COUNTERS
|
|
@@ -1580,12 +1602,20 @@ var Seclai = class {
|
|
|
1580
1602
|
* List all evaluation results for an agent.
|
|
1581
1603
|
*
|
|
1582
1604
|
* @param agentId - Agent identifier.
|
|
1583
|
-
* @param opts - Pagination
|
|
1605
|
+
* @param opts - Pagination, status, step, flag and time-range filters.
|
|
1584
1606
|
*/
|
|
1585
1607
|
async listAgentEvaluationResults(agentId, opts = {}) {
|
|
1586
1608
|
return keyedList(
|
|
1587
1609
|
await this.request("GET", `/agents/${agentId}/evaluation-results`, {
|
|
1588
|
-
query: {
|
|
1610
|
+
query: {
|
|
1611
|
+
page: opts.page,
|
|
1612
|
+
limit: opts.limit,
|
|
1613
|
+
status: opts.status,
|
|
1614
|
+
step: opts.step,
|
|
1615
|
+
flagged_only: opts.flaggedOnly,
|
|
1616
|
+
time_from: opts.timeFrom,
|
|
1617
|
+
time_to: opts.timeTo
|
|
1618
|
+
}
|
|
1589
1619
|
}),
|
|
1590
1620
|
"data",
|
|
1591
1621
|
PAGE_COUNTERS
|
|
@@ -1595,25 +1625,35 @@ var Seclai = class {
|
|
|
1595
1625
|
* List evaluation run summaries for an agent.
|
|
1596
1626
|
*
|
|
1597
1627
|
* @param agentId - Agent identifier.
|
|
1598
|
-
* @param opts - Pagination
|
|
1628
|
+
* @param opts - Pagination, status, step and time-range filters.
|
|
1599
1629
|
*/
|
|
1600
1630
|
async listEvaluationRuns(agentId, opts = {}) {
|
|
1601
1631
|
return keyedList(
|
|
1602
1632
|
await this.request("GET", `/agents/${agentId}/evaluation-runs`, {
|
|
1603
|
-
query: {
|
|
1633
|
+
query: {
|
|
1634
|
+
page: opts.page,
|
|
1635
|
+
limit: opts.limit,
|
|
1636
|
+
status: opts.status,
|
|
1637
|
+
step: opts.step,
|
|
1638
|
+
time_from: opts.timeFrom,
|
|
1639
|
+
time_to: opts.timeTo
|
|
1640
|
+
}
|
|
1604
1641
|
}),
|
|
1605
1642
|
"data",
|
|
1606
1643
|
PAGE_COUNTERS
|
|
1607
1644
|
);
|
|
1608
1645
|
}
|
|
1609
1646
|
/**
|
|
1610
|
-
* Get a summary of non-manual evaluations
|
|
1647
|
+
* Get a summary of non-manual evaluations, for one agent or the whole account.
|
|
1611
1648
|
*
|
|
1612
|
-
* @param agentId - Agent identifier.
|
|
1649
|
+
* @param agentId - Agent identifier. Omit (pass `undefined`) for the account-wide summary.
|
|
1650
|
+
* @param opts - Date range. `startDate` and `endDate` together set the range;
|
|
1651
|
+
* `startDate` alone runs from it through today; otherwise the last `days`
|
|
1652
|
+
* days apply (server default 30), and an `endDate` without `startDate` is ignored.
|
|
1613
1653
|
*/
|
|
1614
|
-
async getNonManualEvaluationSummary(agentId) {
|
|
1654
|
+
async getNonManualEvaluationSummary(agentId, opts = {}) {
|
|
1615
1655
|
return await this.request("GET", "/agents/evaluation-results/non-manual-summary", {
|
|
1616
|
-
query: { agent_id: agentId }
|
|
1656
|
+
query: { agent_id: agentId, days: opts.days, start_date: opts.startDate, end_date: opts.endDate }
|
|
1617
1657
|
});
|
|
1618
1658
|
}
|
|
1619
1659
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -1637,6 +1677,26 @@ var Seclai = class {
|
|
|
1637
1677
|
json: body
|
|
1638
1678
|
});
|
|
1639
1679
|
}
|
|
1680
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1681
|
+
// Agent Slack Triggers
|
|
1682
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1683
|
+
/**
|
|
1684
|
+
* Configure an agent's `SLACK_COMMAND` trigger, which people run from Slack
|
|
1685
|
+
* with `/seclai` or the message shortcut.
|
|
1686
|
+
*
|
|
1687
|
+
* Sets the Slack connection, form, channels, reply visibility and conversation
|
|
1688
|
+
* settings. Omitted fields are left unchanged.
|
|
1689
|
+
*
|
|
1690
|
+
* @param agentId - Agent identifier.
|
|
1691
|
+
* @param triggerId - Trigger identifier.
|
|
1692
|
+
* @param body - The fields to set.
|
|
1693
|
+
* @returns The trigger's full Slack config, including any `missing_scopes`.
|
|
1694
|
+
*/
|
|
1695
|
+
async setSlackTriggerConfig(agentId, triggerId, body) {
|
|
1696
|
+
return await this.request("PUT", `/agents/${agentId}/triggers/${triggerId}/slack-config`, {
|
|
1697
|
+
json: body
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1640
1700
|
/**
|
|
1641
1701
|
* Replace the input attachments a trigger accepts.
|
|
1642
1702
|
*
|
|
@@ -1845,13 +1905,13 @@ var Seclai = class {
|
|
|
1845
1905
|
/**
|
|
1846
1906
|
* List memory banks.
|
|
1847
1907
|
*
|
|
1848
|
-
* @param opts - Pagination and
|
|
1908
|
+
* @param opts - Pagination, sorting and a `type` filter.
|
|
1849
1909
|
* @returns Paginated list of memory banks.
|
|
1850
1910
|
*/
|
|
1851
1911
|
async listMemoryBanks(opts = {}) {
|
|
1852
1912
|
return keyedList(
|
|
1853
1913
|
await this.request("GET", "/memory_banks", {
|
|
1854
|
-
query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }
|
|
1914
|
+
query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order, type: opts.type }
|
|
1855
1915
|
}),
|
|
1856
1916
|
"memory_banks",
|
|
1857
1917
|
PAGE_COUNTERS
|
|
@@ -1908,9 +1968,13 @@ var Seclai = class {
|
|
|
1908
1968
|
* Get stats for a memory bank.
|
|
1909
1969
|
*
|
|
1910
1970
|
* @param memoryBankId - Memory bank identifier.
|
|
1971
|
+
* @param opts - Date range. Only `startDate` and `endDate` together replace
|
|
1972
|
+
* `days`; either one alone is ignored and the last `days` days apply (server default 30).
|
|
1911
1973
|
*/
|
|
1912
|
-
async getMemoryBankStats(memoryBankId) {
|
|
1913
|
-
return await this.request("GET", `/memory_banks/${memoryBankId}/stats
|
|
1974
|
+
async getMemoryBankStats(memoryBankId, opts = {}) {
|
|
1975
|
+
return await this.request("GET", `/memory_banks/${memoryBankId}/stats`, {
|
|
1976
|
+
query: { days: opts.days, start_date: opts.startDate, end_date: opts.endDate }
|
|
1977
|
+
});
|
|
1914
1978
|
}
|
|
1915
1979
|
/**
|
|
1916
1980
|
* Compact a memory bank (trigger compaction).
|
|
@@ -1963,9 +2027,13 @@ var Seclai = class {
|
|
|
1963
2027
|
}
|
|
1964
2028
|
/**
|
|
1965
2029
|
* Get the last AI conversation for memory banks.
|
|
2030
|
+
*
|
|
2031
|
+
* @param opts - Turns to return (server default 5) and most-recent turns to skip (default 0).
|
|
1966
2032
|
*/
|
|
1967
|
-
async getMemoryBankAiLastConversation() {
|
|
1968
|
-
return await this.request("GET", "/memory_banks/ai-assistant/last-conversation"
|
|
2033
|
+
async getMemoryBankAiLastConversation(opts = {}) {
|
|
2034
|
+
return await this.request("GET", "/memory_banks/ai-assistant/last-conversation", {
|
|
2035
|
+
query: { limit: opts.limit, offset: opts.offset }
|
|
2036
|
+
});
|
|
1969
2037
|
}
|
|
1970
2038
|
/**
|
|
1971
2039
|
* Accept a memory bank AI suggestion.
|
|
@@ -2362,12 +2430,12 @@ var Seclai = class {
|
|
|
2362
2430
|
/**
|
|
2363
2431
|
* List solutions.
|
|
2364
2432
|
*
|
|
2365
|
-
* @param opts - Pagination and
|
|
2433
|
+
* @param opts - Pagination, sorting and a name `search`.
|
|
2366
2434
|
* @returns Paginated list of solutions.
|
|
2367
2435
|
*/
|
|
2368
2436
|
async listSolutions(opts = {}) {
|
|
2369
2437
|
return await this.request("GET", "/solutions", {
|
|
2370
|
-
query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order }
|
|
2438
|
+
query: { page: opts.page, limit: opts.limit, sort: opts.sort, order: opts.order, search: opts.search }
|
|
2371
2439
|
});
|
|
2372
2440
|
}
|
|
2373
2441
|
/**
|
|
@@ -2564,10 +2632,12 @@ var Seclai = class {
|
|
|
2564
2632
|
}
|
|
2565
2633
|
/**
|
|
2566
2634
|
* List governance AI conversations.
|
|
2635
|
+
*
|
|
2636
|
+
* @param opts - `limit`: how many conversations (the server defaults to 20).
|
|
2567
2637
|
*/
|
|
2568
|
-
async listGovernanceAiConversations() {
|
|
2638
|
+
async listGovernanceAiConversations(opts = {}) {
|
|
2569
2639
|
return listItems(
|
|
2570
|
-
await this.request("GET", "/governance/ai-assistant/conversations")
|
|
2640
|
+
await this.request("GET", "/governance/ai-assistant/conversations", { query: { limit: opts.limit } })
|
|
2571
2641
|
);
|
|
2572
2642
|
}
|
|
2573
2643
|
/**
|
|
@@ -2598,7 +2668,15 @@ var Seclai = class {
|
|
|
2598
2668
|
*/
|
|
2599
2669
|
async listAlerts(opts = {}) {
|
|
2600
2670
|
return await this.request("GET", "/alerts", {
|
|
2601
|
-
query: {
|
|
2671
|
+
query: {
|
|
2672
|
+
page: opts.page,
|
|
2673
|
+
limit: opts.limit,
|
|
2674
|
+
status: opts.status,
|
|
2675
|
+
agent_id: opts.agentId,
|
|
2676
|
+
source_connection_id: opts.sourceConnectionId,
|
|
2677
|
+
time_from: opts.timeFrom,
|
|
2678
|
+
time_to: opts.timeTo
|
|
2679
|
+
}
|
|
2602
2680
|
});
|
|
2603
2681
|
}
|
|
2604
2682
|
/**
|
|
@@ -2657,7 +2735,15 @@ var Seclai = class {
|
|
|
2657
2735
|
*/
|
|
2658
2736
|
async listAlertConfigs(opts = {}) {
|
|
2659
2737
|
return keyedList(
|
|
2660
|
-
await this.request("GET", "/alerts/configs", {
|
|
2738
|
+
await this.request("GET", "/alerts/configs", {
|
|
2739
|
+
query: {
|
|
2740
|
+
page: opts.page,
|
|
2741
|
+
limit: opts.limit,
|
|
2742
|
+
agent_id: opts.agentId,
|
|
2743
|
+
source_connection_id: opts.sourceConnectionId,
|
|
2744
|
+
scope: opts.scope
|
|
2745
|
+
}
|
|
2746
|
+
}),
|
|
2661
2747
|
"configs",
|
|
2662
2748
|
["total"]
|
|
2663
2749
|
);
|
|
@@ -2701,10 +2787,14 @@ var Seclai = class {
|
|
|
2701
2787
|
// ─── Organization Alert Preferences ────────────────────────────────────────
|
|
2702
2788
|
/**
|
|
2703
2789
|
* List organization alert preferences.
|
|
2790
|
+
*
|
|
2791
|
+
* @param opts - Organization filter, and whether to include default subscriptions.
|
|
2704
2792
|
*/
|
|
2705
|
-
async listOrganizationAlertPreferences() {
|
|
2793
|
+
async listOrganizationAlertPreferences(opts = {}) {
|
|
2706
2794
|
return keyedList(
|
|
2707
|
-
await this.request("GET", "/alerts/organization-preferences/list"
|
|
2795
|
+
await this.request("GET", "/alerts/organization-preferences/list", {
|
|
2796
|
+
query: { organization_id: opts.organizationId, include_defaults: opts.includeDefaults }
|
|
2797
|
+
}),
|
|
2708
2798
|
"preferences",
|
|
2709
2799
|
["total"]
|
|
2710
2800
|
);
|
|
@@ -2729,13 +2819,15 @@ var Seclai = class {
|
|
|
2729
2819
|
/**
|
|
2730
2820
|
* List model alerts.
|
|
2731
2821
|
*
|
|
2732
|
-
* @param opts - Pagination
|
|
2822
|
+
* @param opts - Pagination, an agent filter and `unreadOnly`.
|
|
2733
2823
|
*/
|
|
2734
2824
|
async listModelAlerts(opts = {}) {
|
|
2735
2825
|
const limit = opts.limit ?? 50;
|
|
2736
2826
|
const offset = opts.page && opts.page > 1 ? (opts.page - 1) * limit : void 0;
|
|
2737
2827
|
return keyedList(
|
|
2738
|
-
await this.request("GET", "/models/alerts", {
|
|
2828
|
+
await this.request("GET", "/models/alerts", {
|
|
2829
|
+
query: { offset, limit: opts.limit, agent_id: opts.agentId, unread_only: opts.unreadOnly }
|
|
2830
|
+
}),
|
|
2739
2831
|
"alerts",
|
|
2740
2832
|
["total"]
|
|
2741
2833
|
);
|
|
@@ -2764,9 +2856,18 @@ var Seclai = class {
|
|
|
2764
2856
|
* Get model recommendations.
|
|
2765
2857
|
*
|
|
2766
2858
|
* @param modelId - Model identifier.
|
|
2859
|
+
* @param opts - Capabilities and limits a recommended model must have.
|
|
2767
2860
|
*/
|
|
2768
|
-
async getModelRecommendations(modelId) {
|
|
2769
|
-
return await this.request("GET", `/models/${modelId}/recommendations
|
|
2861
|
+
async getModelRecommendations(modelId, opts = {}) {
|
|
2862
|
+
return await this.request("GET", `/models/${modelId}/recommendations`, {
|
|
2863
|
+
query: {
|
|
2864
|
+
require_tool_use: opts.requireToolUse,
|
|
2865
|
+
require_structured_output: opts.requireStructuredOutput,
|
|
2866
|
+
require_thinking: opts.requireThinking,
|
|
2867
|
+
min_context_tokens: opts.minContextTokens,
|
|
2868
|
+
min_output_tokens: opts.minOutputTokens
|
|
2869
|
+
}
|
|
2870
|
+
});
|
|
2770
2871
|
}
|
|
2771
2872
|
/**
|
|
2772
2873
|
* List all enabled LLM models grouped by provider.
|
|
@@ -2838,7 +2939,9 @@ var Seclai = class {
|
|
|
2838
2939
|
/**
|
|
2839
2940
|
* List model playground experiments.
|
|
2840
2941
|
*
|
|
2841
|
-
* @param opts -
|
|
2942
|
+
* @param opts - Date range and offset paging. Only `startDate` and `endDate`
|
|
2943
|
+
* together replace `days`; either one alone is ignored and the last `days`
|
|
2944
|
+
* days apply (server default 30).
|
|
2842
2945
|
*/
|
|
2843
2946
|
async listExperiments(opts = {}) {
|
|
2844
2947
|
return keyedList(
|
|
@@ -3169,9 +3272,13 @@ var Seclai = class {
|
|
|
3169
3272
|
}
|
|
3170
3273
|
/**
|
|
3171
3274
|
* Get AI assistant memory bank conversation history.
|
|
3275
|
+
*
|
|
3276
|
+
* @param opts - Turns to return (server default 5) and most-recent turns to skip (default 0).
|
|
3172
3277
|
*/
|
|
3173
|
-
async getAiAssistantMemoryBankHistory() {
|
|
3174
|
-
return await this.request("GET", "/ai-assistant/memory-bank/last-conversation"
|
|
3278
|
+
async getAiAssistantMemoryBankHistory(opts = {}) {
|
|
3279
|
+
return await this.request("GET", "/ai-assistant/memory-bank/last-conversation", {
|
|
3280
|
+
query: { limit: opts.limit, offset: opts.offset }
|
|
3281
|
+
});
|
|
3175
3282
|
}
|
|
3176
3283
|
/**
|
|
3177
3284
|
* Accept an AI assistant suggestion.
|