@seclai/sdk 1.1.5 → 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 +42 -1
- package/dist/index.cjs +64 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +567 -25
- package/dist/index.d.ts +567 -25
- package/dist/index.js +64 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -1140,6 +1161,37 @@ var Seclai = class {
|
|
|
1140
1161
|
async getAgentInputUploadStatus(agentId, uploadId) {
|
|
1141
1162
|
return await this.request("GET", `/agents/${agentId}/input-uploads/${uploadId}`);
|
|
1142
1163
|
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Get the static attachment-reference contract for an agent — what files (if
|
|
1166
|
+
* any) its definition expects on a run.
|
|
1167
|
+
*
|
|
1168
|
+
* Call this before staging uploads to learn whether the agent accepts files
|
|
1169
|
+
* at all (`requires_uploads`) and which specific filenames, indexes, or glob
|
|
1170
|
+
* patterns its templates reference. A run-time upload batch that doesn't
|
|
1171
|
+
* satisfy every declared selector is rejected with HTTP 400.
|
|
1172
|
+
*
|
|
1173
|
+
* @param agentId - Agent identifier.
|
|
1174
|
+
* @returns The agent's attachment-reference contract.
|
|
1175
|
+
*/
|
|
1176
|
+
async getAgentAttachmentReferences(agentId) {
|
|
1177
|
+
return await this.request("GET", `/agents/${agentId}/attachment-references`);
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Download a file attachment emitted by a step in an agent run.
|
|
1181
|
+
*
|
|
1182
|
+
* Returns the raw `Response` so you can stream or save the binary data.
|
|
1183
|
+
*
|
|
1184
|
+
* @param runId - Run identifier.
|
|
1185
|
+
* @param attachmentId - URL-safe-base64-encoded `storage_key` of the attachment
|
|
1186
|
+
* (as surfaced in run output manifests and webhook/email payloads).
|
|
1187
|
+
* @param opts - Optional `downloadName` filename hint for the download disposition.
|
|
1188
|
+
* @returns Raw response with the attachment bytes.
|
|
1189
|
+
*/
|
|
1190
|
+
async downloadAgentRunAttachment(runId, attachmentId, opts = {}) {
|
|
1191
|
+
return await this.requestRaw("GET", `/v2/agent-runs/${runId}/attachments/${attachmentId}`, {
|
|
1192
|
+
query: { download_name: opts.downloadName }
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1143
1195
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
1144
1196
|
// Agent AI Assistant (Steps Generation)
|
|
1145
1197
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -2179,6 +2231,17 @@ var Seclai = class {
|
|
|
2179
2231
|
async cancelExperiment(experimentId) {
|
|
2180
2232
|
return await this.request("POST", `/models/playground/experiments/${experimentId}/cancel`);
|
|
2181
2233
|
}
|
|
2234
|
+
/**
|
|
2235
|
+
* Soft-delete a model playground experiment.
|
|
2236
|
+
*
|
|
2237
|
+
* Removes the experiment from list/detail views while preserving audit
|
|
2238
|
+
* history. Returns HTTP 204 with no body.
|
|
2239
|
+
*
|
|
2240
|
+
* @param experimentId - Experiment identifier.
|
|
2241
|
+
*/
|
|
2242
|
+
async deleteExperiment(experimentId) {
|
|
2243
|
+
await this.request("DELETE", `/models/playground/experiments/${experimentId}`);
|
|
2244
|
+
}
|
|
2182
2245
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
2183
2246
|
// Search
|
|
2184
2247
|
// ═══════════════════════════════════════════════════════════════════════════
|