@seclai/sdk 1.1.4 → 1.2.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.js CHANGED
@@ -747,7 +747,7 @@ var Seclai = class {
747
747
  await this.request("DELETE", `/agents/${agentId}`);
748
748
  }
749
749
  // ═══════════════════════════════════════════════════════════════════════════
750
- // Agent Export
750
+ // Agent Export / Import
751
751
  // ═══════════════════════════════════════════════════════════════════════════
752
752
  /**
753
753
  * Export an agent definition as a portable JSON snapshot.
@@ -761,6 +761,27 @@ var Seclai = class {
761
761
  query: { download }
762
762
  });
763
763
  }
764
+ /**
765
+ * Validate an `agent_definition` payload (same shape as {@link exportAgent})
766
+ * without creating or modifying any agent.
767
+ *
768
+ * Use this before {@link createAgent} or {@link updateAgent} with an
769
+ * `agent_definition` to surface `unresolved_refs` — workflow references to
770
+ * knowledge bases, memory banks, source connections, or sub-agents that
771
+ * don't exist in the target account. Pass the returned ids back in
772
+ * `entity_remap` on the commit call to substitute them.
773
+ *
774
+ * @param body - The preview payload (`{ agent_definition: ... }`).
775
+ * @returns Summary of the validated payload (step counts, schedules,
776
+ * alert configs, evaluation criteria, governance policies, and any
777
+ * `unresolved_refs`).
778
+ * @throws {SeclaiAPIValidationError} On HTTP 422 — the body is an
779
+ * {@link AgentDefinitionImportErrorResponse} with 1-indexed
780
+ * line/column-anchored errors against a canonical `source` echo.
781
+ */
782
+ async previewImportAgent(body) {
783
+ return await this.request("POST", "/agents/preview-import", { json: body });
784
+ }
764
785
  // ═══════════════════════════════════════════════════════════════════════════
765
786
  // Agent Definitions
766
787
  // ═══════════════════════════════════════════════════════════════════════════
@@ -2124,6 +2145,61 @@ var Seclai = class {
2124
2145
  async getModelRecommendations(modelId) {
2125
2146
  return await this.request("GET", `/models/${modelId}/recommendations`);
2126
2147
  }
2148
+ /**
2149
+ * List all enabled LLM models grouped by provider.
2150
+ *
2151
+ * @param opts - Optional filters.
2152
+ */
2153
+ async listModels(opts = {}) {
2154
+ return await this.request("GET", "/models", {
2155
+ query: { provider: opts.provider, supports_tool_use: opts.supportsToolUse, supports_thinking: opts.supportsThinking }
2156
+ });
2157
+ }
2158
+ /**
2159
+ * Get full details for a specific model.
2160
+ *
2161
+ * @param modelId - Model identifier.
2162
+ */
2163
+ async getModel(modelId) {
2164
+ return await this.request("GET", `/models/${modelId}/details`);
2165
+ }
2166
+ // ═══════════════════════════════════════════════════════════════════════════
2167
+ // Model Playground Experiments
2168
+ // ═══════════════════════════════════════════════════════════════════════════
2169
+ /**
2170
+ * List model playground experiments.
2171
+ *
2172
+ * @param opts - Optional filters and pagination.
2173
+ */
2174
+ async listExperiments(opts = {}) {
2175
+ return await this.request("GET", "/models/playground/experiments", {
2176
+ query: { days: opts.days, start_date: opts.startDate, end_date: opts.endDate, limit: opts.limit, offset: opts.offset }
2177
+ });
2178
+ }
2179
+ /**
2180
+ * Create a model playground experiment.
2181
+ *
2182
+ * @param body - Experiment configuration.
2183
+ */
2184
+ async createExperiment(body) {
2185
+ return await this.request("POST", "/models/playground/experiments", { json: body });
2186
+ }
2187
+ /**
2188
+ * Get a model playground experiment by ID.
2189
+ *
2190
+ * @param experimentId - Experiment identifier.
2191
+ */
2192
+ async getExperiment(experimentId) {
2193
+ return await this.request("GET", `/models/playground/experiments/${experimentId}`);
2194
+ }
2195
+ /**
2196
+ * Cancel a running model playground experiment.
2197
+ *
2198
+ * @param experimentId - Experiment identifier.
2199
+ */
2200
+ async cancelExperiment(experimentId) {
2201
+ return await this.request("POST", `/models/playground/experiments/${experimentId}/cancel`);
2202
+ }
2127
2203
  // ═══════════════════════════════════════════════════════════════════════════
2128
2204
  // Search
2129
2205
  // ═══════════════════════════════════════════════════════════════════════════