@soat/sdk 0.18.5 → 0.18.6

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.cjs CHANGED
@@ -2150,7 +2150,7 @@ var Generations = class {
2150
2150
  /**
2151
2151
  * Update generation metadata
2152
2152
  *
2153
- * Attaches caller-supplied key/value metadata to a generation record for per-run audit attribution (e.g. recording which knowledge-corpus version produced an AI action). The provided keys are shallow-merged over the existing metadata, so repeated patches accumulate and system-owned keys are preserved. Reserved keys (`action_id`, `trigger_id`, `orchestration_run_id`, `node_id`, `extraction`, and internal recovery state) cannot be set and are rejected with 400.
2153
+ * Attaches caller-supplied key/value metadata to a generation record for per-run audit attribution (e.g. recording which knowledge-corpus version produced an AI action). The provided keys are shallow-merged over the existing `metadata`, so repeated patches accumulate. The bag is caller-owned and no key is reserved: server-owned state (usage attribution, the served agent version, the route's record, the extraction summary) lives in its own top-level fields and cannot be written from here.
2154
2154
  *
2155
2155
  */
2156
2156
  static updateGeneration(options) {
@@ -2163,6 +2163,24 @@ var Generations = class {
2163
2163
  }
2164
2164
  });
2165
2165
  }
2166
+ /**
2167
+ * Purge generation content
2168
+ *
2169
+ * Clears the generation's content — `metadata`, `error`, `extraction`, and the internal recovery state of a paused run — and stamps `content_redacted_at`.
2170
+ *
2171
+ * The usage and audit skeleton is preserved: ids, timestamps, status, stop reason, and the attribution fields (`action_id`, `trigger_id`, `orchestration_run_id`, `node_id`, `agent_version`, `routing`) the billing ledger reads. A purged generation reads back as that skeleton, not a 404.
2172
+ *
2173
+ * This does **not** delete the parent trace's steps object, which holds this generation's content alongside its siblings'. To erase the run's content completely, purge the trace (`DELETE /api/v1/traces/{trace_id}/content`), which cascades here.
2174
+ *
2175
+ * Idempotent — purging an already-purged generation succeeds and leaves the original `content_redacted_at` in place.
2176
+ *
2177
+ */
2178
+ static purgeGenerationContent(options) {
2179
+ return (options.client ?? client).delete({
2180
+ url: "/api/v1/generations/{generation_id}/content",
2181
+ ...options
2182
+ });
2183
+ }
2166
2184
  };
2167
2185
  var Guardrails = class {
2168
2186
  /**
@@ -3210,7 +3228,7 @@ var Tasks = class {
3210
3228
  /**
3211
3229
  * Update a task
3212
3230
  *
3213
- * Updates a task's payload, title, or assignee. `state` is never directly writable — move it with a transition; sending a `state` field is rejected as an unknown field (`VALIDATION_FAILED`). `payload` is shallow-merged over the existing payload (PATCH semantics): keys the request omits are preserved, so setting one field never discards values an on_enter automation wrote (e.g. `last_result`). The merged payload is validated against the workflow's `payload_schema`.
3231
+ * Updates a task's payload, title, or assignee. `state` is never directly writable — move it with a transition; sending a `state` field is rejected as an unknown field (`VALIDATION_FAILED`). `payload` is shallow-merged over the existing payload (PATCH semantics): keys the request omits are preserved. The payload is caller-owned; the automation result lives in the read-only `last_result` field, which no patch can reach. The merged payload is validated against the workflow's `payload_schema`.
3214
3232
  */
3215
3233
  static updateTask(options) {
3216
3234
  return (options.client ?? client).patch({
@@ -3367,6 +3385,22 @@ var Traces = class {
3367
3385
  ...options
3368
3386
  });
3369
3387
  }
3388
+ /**
3389
+ * Purge trace content
3390
+ *
3391
+ * Deletes the trace's steps object from storage and clears its content columns (`file_id`, `error`), cascading to every descendant trace and to all of their generations. A descendant holds its own steps object covering the same run, so the cascade is what makes the erasure complete rather than merely partial.
3392
+ *
3393
+ * The rows survive as auditable skeletons with `content_redacted_at` set — ids, timestamps, step counts, and the generations' usage-attribution fields are preserved, because the billing and audit ledger must outlive a tenant's erasure of the content. A purged trace therefore reads back as a skeleton, not a 404: a 404 would prove nothing.
3394
+ *
3395
+ * Idempotent — purging an already-purged trace succeeds and leaves the original `content_redacted_at` in place.
3396
+ *
3397
+ */
3398
+ static purgeTraceContent(options) {
3399
+ return (options.client ?? client).delete({
3400
+ url: "/api/v1/traces/{trace_id}/content",
3401
+ ...options
3402
+ });
3403
+ }
3370
3404
  };
3371
3405
  var Triggers = class {
3372
3406
  /**