@soat/sdk 0.19.2 → 0.20.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.cjs CHANGED
@@ -2197,7 +2197,7 @@ var Guardrails = class {
2197
2197
  /**
2198
2198
  * Create a guardrail
2199
2199
  *
2200
- * Creates a new guardrail in the project. The `document` is validated on write: `class` must be a literal (A/B/C/D) or a JSON Logic expression, and every variable it (and `guard`) reference must resolve to the `args.*` / `context.*` / `soat.*` namespaces — an out-of-catalog `soat.*` key is rejected with 400.
2200
+ * Creates a new guardrail in the project, archiving its document as version 1. The `document` is validated on write: `class` must be a literal (A/B/C/D) or a JSON Logic expression, and every variable it (and `guard`) reference must resolve to the `args.*` / `context.*` / `soat.*` namespaces — an out-of-catalog `soat.*` key is rejected with 400.
2201
2201
  *
2202
2202
  */
2203
2203
  static createGuardrail(options) {
@@ -2235,7 +2235,7 @@ var Guardrails = class {
2235
2235
  /**
2236
2236
  * Update a guardrail
2237
2237
  *
2238
- * Updates an existing guardrail. A `document` write increments `version` and archives the prior document as a GuardrailVersion; metadata-only edits (name / description / context) leave the version untouched.
2238
+ * Updates an existing guardrail. A `document` write that actually changes the policy increments `version` and archives the new document as a GuardrailVersion; metadata-only edits (name / description / context), and re-writing the document the guardrail already holds, leave the version untouched.
2239
2239
  *
2240
2240
  */
2241
2241
  static updateGuardrail(options) {
@@ -2249,9 +2249,21 @@ var Guardrails = class {
2249
2249
  });
2250
2250
  }
2251
2251
  /**
2252
+ * List a guardrail's config versions
2253
+ *
2254
+ * Returns the guardrail's archived configurations, newest first. A version is written on create and on every subsequent write that changes the policy `document` — through the REST API or a formation apply alike. Metadata-only edits (name, description, context binding) do not archive a version. See [Versioning](/docs/modules/guardrails#versioning).
2255
+ *
2256
+ */
2257
+ static listGuardrailVersions(options) {
2258
+ return (options.client ?? client).get({
2259
+ url: "/api/v1/guardrails/{guardrail_id}/versions",
2260
+ ...options
2261
+ });
2262
+ }
2263
+ /**
2252
2264
  * Fetch an archived guardrail version
2253
2265
  *
2254
- * Returns the exact `document` that governed at a given version. Approval items, activity entries, and exceptions record the version that governed them, so the audit chain survives edits.
2266
+ * Returns the exact configuration — and so the exact `document` that governed at a given version. Approval items, activity entries, and exceptions record the version that governed them, so the audit chain survives edits.
2255
2267
  *
2256
2268
  */
2257
2269
  static getGuardrailVersion(options) {
@@ -2261,6 +2273,24 @@ var Guardrails = class {
2261
2273
  });
2262
2274
  }
2263
2275
  /**
2276
+ * Restore an archived guardrail config
2277
+ *
2278
+ * Writes an archived version's `document` back as the guardrail's live policy, which archives it again as a **new** version rather than rewinding the counter — so an approval item or exception citing any version in between still resolves.
2279
+ *
2280
+ * The restore runs through the ordinary update path, so the archived document is re-validated; restoring the policy the guardrail already holds is a no-op and archives nothing.
2281
+ *
2282
+ */
2283
+ static restoreGuardrailVersion(options) {
2284
+ return (options.client ?? client).post({
2285
+ url: "/api/v1/guardrails/{guardrail_id}/versions/{version}/restore",
2286
+ ...options,
2287
+ headers: {
2288
+ "Content-Type": "application/json",
2289
+ ...options.headers
2290
+ }
2291
+ });
2292
+ }
2293
+ /**
2264
2294
  * Dry-run evaluate a guardrail
2265
2295
  *
2266
2296
  * Runs the full evaluation pipeline — the `class` expression, the guard, the context tool per `context_mode`, live `soat.*` resolution — against caller-supplied `args` and `guardrail_context`, and returns the exact `guardrail_evaluation` record a real call would produce. Nothing executes, no approval item is filed, and no activity entry is written. This is the adoption path: preview a document's decisions against production-shaped calls before attaching it — or before editing a widely-attached one. Pass an optional `tool_id` to resolve `soat.tool.*`.
@@ -2651,6 +2681,48 @@ var Orchestrations = class {
2651
2681
  });
2652
2682
  }
2653
2683
  /**
2684
+ * List an orchestration's graph versions
2685
+ *
2686
+ * Returns the orchestration's archived graphs, newest first. A version is written on create and on every subsequent write that changes the graph (`nodes`, `edges`, `state_schema`, `input_schema`) — through the REST API or a formation apply alike. Metadata-only edits (name, description) do not archive a version. See [Versioning](/docs/modules/orchestrations#versioning).
2687
+ *
2688
+ */
2689
+ static listOrchestrationVersions(options) {
2690
+ return (options.client ?? client).get({
2691
+ url: "/api/v1/orchestrations/{orchestration_id}/versions",
2692
+ ...options
2693
+ });
2694
+ }
2695
+ /**
2696
+ * Fetch an archived orchestration version
2697
+ *
2698
+ * Returns the exact graph a given version describes. Every run records the version it started on in `orchestration_version` and executes that graph for its whole life, so this is how you read the topology a run actually took — including a run whose orchestration has been rewired since.
2699
+ *
2700
+ */
2701
+ static getOrchestrationVersion(options) {
2702
+ return (options.client ?? client).get({
2703
+ url: "/api/v1/orchestrations/{orchestration_id}/versions/{version}",
2704
+ ...options
2705
+ });
2706
+ }
2707
+ /**
2708
+ * Restore an archived orchestration graph
2709
+ *
2710
+ * Writes an archived version's graph back as the orchestration's live definition, which archives it again as a **new** version rather than rewinding the counter — so a run pinned to any version in between still resolves the graph it started on.
2711
+ *
2712
+ * The restore runs through the ordinary update path, so the archived graph goes through the same static validation as an authored one. Node resource references (`agent_id`, `tool_id`, `orchestration_id`) resolve when a run reaches the node, so a target deleted since the snapshot was taken restores cleanly and surfaces as a failed run rather than a `400`. Restoring the graph the orchestration already holds is a no-op and archives nothing. Runs already in flight are unaffected either way — a restore is an ordinary edit, and pinning is what keeps it from reaching them.
2713
+ *
2714
+ */
2715
+ static restoreOrchestrationVersion(options) {
2716
+ return (options.client ?? client).post({
2717
+ url: "/api/v1/orchestrations/{orchestration_id}/versions/{version}/restore",
2718
+ ...options,
2719
+ headers: {
2720
+ "Content-Type": "application/json",
2721
+ ...options.headers
2722
+ }
2723
+ });
2724
+ }
2725
+ /**
2654
2726
  * List orchestration runs
2655
2727
  *
2656
2728
  * Returns orchestration runs the caller can access, optionally filtered by orchestration.
@@ -3911,6 +3983,48 @@ var Workflows = class {
3911
3983
  }
3912
3984
  });
3913
3985
  }
3986
+ /**
3987
+ * List a workflow's versions
3988
+ *
3989
+ * Returns the workflow's archived state machines, newest first. A version is written on create and on every subsequent write that changes the definition (`states`, `transitions`, `payload_schema`) — through the REST API or a formation apply alike. Metadata-only edits (name, description) do not archive a version. See [Versioning](/docs/modules/workflows#versioning).
3990
+ *
3991
+ */
3992
+ static listWorkflowVersions(options) {
3993
+ return (options.client ?? client).get({
3994
+ url: "/api/v1/workflows/{workflow_id}/versions",
3995
+ ...options
3996
+ });
3997
+ }
3998
+ /**
3999
+ * Fetch an archived workflow version
4000
+ *
4001
+ * Returns the exact state machine a given version describes. Every task records the version it entered on in `workflow_version` and runs on that machine for its whole life, so this is how you read the definition a task is actually being validated against — including a task whose workflow has been rewired since.
4002
+ *
4003
+ */
4004
+ static getWorkflowVersion(options) {
4005
+ return (options.client ?? client).get({
4006
+ url: "/api/v1/workflows/{workflow_id}/versions/{version}",
4007
+ ...options
4008
+ });
4009
+ }
4010
+ /**
4011
+ * Restore an archived workflow state machine
4012
+ *
4013
+ * Writes an archived version's state machine back as the workflow's live definition, which archives it again as a **new** version rather than rewinding the counter — so a task pinned to any version in between still runs on the machine it entered on.
4014
+ *
4015
+ * The restore runs through the ordinary update path, so the archived definition goes through the same validation as an authored one. That includes resolving every `on_enter` dispatch target, so restoring a version whose agent or orchestration has since been deleted fails with `400` rather than writing a definition that would strand a task on entry. Restoring the definition the workflow already holds is a no-op and archives nothing. Tasks already in flight are unaffected either way — a restore is an ordinary edit, and pinning is what keeps it from reaching them.
4016
+ *
4017
+ */
4018
+ static restoreWorkflowVersion(options) {
4019
+ return (options.client ?? client).post({
4020
+ url: "/api/v1/workflows/{workflow_id}/versions/{version}/restore",
4021
+ ...options,
4022
+ headers: {
4023
+ "Content-Type": "application/json",
4024
+ ...options.headers
4025
+ }
4026
+ });
4027
+ }
3914
4028
  };
3915
4029
  //#endregion
3916
4030
  //#region src/soatClient.ts