@seclai/sdk 1.2.0 → 1.3.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/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.2.0/
107
+ https://seclai.github.io/seclai-javascript/1.3.0/
108
108
 
109
109
  ## Resources
110
110
 
@@ -202,6 +202,12 @@ const result = await client.runAgentAndPoll(
202
202
  ### Agent input uploads
203
203
 
204
204
  ```ts
205
+ // Discover which files (if any) the agent expects before staging uploads
206
+ const refs = await client.getAgentAttachmentReferences("agent_id");
207
+ if (refs.requires_uploads) {
208
+ // refs.agent lists the exact_names / indexes_max / patterns a run batch must satisfy
209
+ }
210
+
205
211
  const upload = await client.uploadAgentInput("agent_id", {
206
212
  file: new Uint8Array([...]),
207
213
  fileName: "input.pdf",
@@ -209,6 +215,15 @@ const upload = await client.uploadAgentInput("agent_id", {
209
215
  const status = await client.getAgentInputUploadStatus("agent_id", upload.upload_id);
210
216
  ```
211
217
 
218
+ ### Agent run attachments
219
+
220
+ ```ts
221
+ // Download a file emitted by a step in an agent run. The attachment_id is the
222
+ // URL-safe-base64 storage_key surfaced in run output manifests / webhooks.
223
+ const resp = await client.downloadAgentRunAttachment("run_id", "attachment_id");
224
+ const blob = await resp.blob(); // raw Response — stream or save the bytes
225
+ ```
226
+
212
227
  ### Agent AI assistant
213
228
 
214
229
  ```ts
@@ -441,6 +456,13 @@ await client.markModelAlertRead("alert_id");
441
456
  await client.markAllModelAlertsRead();
442
457
  const unread = await client.getUnreadModelAlertCount();
443
458
  const recs = await client.getModelRecommendations("model_id");
459
+
460
+ // Model playground experiments
461
+ const experiment = await client.createExperiment({ model_ids: ["model_id"], prompt: "..." });
462
+ const experiments = await client.listExperiments();
463
+ const detail = await client.getExperiment("experiment_id");
464
+ await client.cancelExperiment("experiment_id");
465
+ await client.deleteExperiment("experiment_id"); // soft-delete, preserves audit history
444
466
  ```
445
467
 
446
468
  ### Search
package/dist/index.cjs CHANGED
@@ -1211,6 +1211,37 @@ var Seclai = class {
1211
1211
  async getAgentInputUploadStatus(agentId, uploadId) {
1212
1212
  return await this.request("GET", `/agents/${agentId}/input-uploads/${uploadId}`);
1213
1213
  }
1214
+ /**
1215
+ * Get the static attachment-reference contract for an agent — what files (if
1216
+ * any) its definition expects on a run.
1217
+ *
1218
+ * Call this before staging uploads to learn whether the agent accepts files
1219
+ * at all (`requires_uploads`) and which specific filenames, indexes, or glob
1220
+ * patterns its templates reference. A run-time upload batch that doesn't
1221
+ * satisfy every declared selector is rejected with HTTP 400.
1222
+ *
1223
+ * @param agentId - Agent identifier.
1224
+ * @returns The agent's attachment-reference contract.
1225
+ */
1226
+ async getAgentAttachmentReferences(agentId) {
1227
+ return await this.request("GET", `/agents/${agentId}/attachment-references`);
1228
+ }
1229
+ /**
1230
+ * Download a file attachment emitted by a step in an agent run.
1231
+ *
1232
+ * Returns the raw `Response` so you can stream or save the binary data.
1233
+ *
1234
+ * @param runId - Run identifier.
1235
+ * @param attachmentId - URL-safe-base64-encoded `storage_key` of the attachment
1236
+ * (as surfaced in run output manifests and webhook/email payloads).
1237
+ * @param opts - Optional `downloadName` filename hint for the download disposition.
1238
+ * @returns Raw response with the attachment bytes.
1239
+ */
1240
+ async downloadAgentRunAttachment(runId, attachmentId, opts = {}) {
1241
+ return await this.requestRaw("GET", `/v2/agent-runs/${runId}/attachments/${attachmentId}`, {
1242
+ query: { download_name: opts.downloadName }
1243
+ });
1244
+ }
1214
1245
  // ═══════════════════════════════════════════════════════════════════════════
1215
1246
  // Agent AI Assistant (Steps Generation)
1216
1247
  // ═══════════════════════════════════════════════════════════════════════════
@@ -2250,6 +2281,17 @@ var Seclai = class {
2250
2281
  async cancelExperiment(experimentId) {
2251
2282
  return await this.request("POST", `/models/playground/experiments/${experimentId}/cancel`);
2252
2283
  }
2284
+ /**
2285
+ * Soft-delete a model playground experiment.
2286
+ *
2287
+ * Removes the experiment from list/detail views while preserving audit
2288
+ * history. Returns HTTP 204 with no body.
2289
+ *
2290
+ * @param experimentId - Experiment identifier.
2291
+ */
2292
+ async deleteExperiment(experimentId) {
2293
+ await this.request("DELETE", `/models/playground/experiments/${experimentId}`);
2294
+ }
2253
2295
  // ═══════════════════════════════════════════════════════════════════════════
2254
2296
  // Search
2255
2297
  // ═══════════════════════════════════════════════════════════════════════════