@soat/sdk 0.19.2 → 0.20.1
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 +117 -3
- package/dist/index.d.cts +562 -7
- package/dist/index.d.mts +562 -7
- package/dist/index.mjs +117 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2196,7 +2196,7 @@ var Guardrails = class {
|
|
|
2196
2196
|
/**
|
|
2197
2197
|
* Create a guardrail
|
|
2198
2198
|
*
|
|
2199
|
-
* 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.
|
|
2199
|
+
* 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.
|
|
2200
2200
|
*
|
|
2201
2201
|
*/
|
|
2202
2202
|
static createGuardrail(options) {
|
|
@@ -2234,7 +2234,7 @@ var Guardrails = class {
|
|
|
2234
2234
|
/**
|
|
2235
2235
|
* Update a guardrail
|
|
2236
2236
|
*
|
|
2237
|
-
* Updates an existing guardrail. A `document` write increments `version` and archives the
|
|
2237
|
+
* 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.
|
|
2238
2238
|
*
|
|
2239
2239
|
*/
|
|
2240
2240
|
static updateGuardrail(options) {
|
|
@@ -2248,9 +2248,21 @@ var Guardrails = class {
|
|
|
2248
2248
|
});
|
|
2249
2249
|
}
|
|
2250
2250
|
/**
|
|
2251
|
+
* List a guardrail's config versions
|
|
2252
|
+
*
|
|
2253
|
+
* 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).
|
|
2254
|
+
*
|
|
2255
|
+
*/
|
|
2256
|
+
static listGuardrailVersions(options) {
|
|
2257
|
+
return (options.client ?? client).get({
|
|
2258
|
+
url: "/api/v1/guardrails/{guardrail_id}/versions",
|
|
2259
|
+
...options
|
|
2260
|
+
});
|
|
2261
|
+
}
|
|
2262
|
+
/**
|
|
2251
2263
|
* Fetch an archived guardrail version
|
|
2252
2264
|
*
|
|
2253
|
-
* 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.
|
|
2265
|
+
* 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.
|
|
2254
2266
|
*
|
|
2255
2267
|
*/
|
|
2256
2268
|
static getGuardrailVersion(options) {
|
|
@@ -2260,6 +2272,24 @@ var Guardrails = class {
|
|
|
2260
2272
|
});
|
|
2261
2273
|
}
|
|
2262
2274
|
/**
|
|
2275
|
+
* Restore an archived guardrail config
|
|
2276
|
+
*
|
|
2277
|
+
* 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.
|
|
2278
|
+
*
|
|
2279
|
+
* 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.
|
|
2280
|
+
*
|
|
2281
|
+
*/
|
|
2282
|
+
static restoreGuardrailVersion(options) {
|
|
2283
|
+
return (options.client ?? client).post({
|
|
2284
|
+
url: "/api/v1/guardrails/{guardrail_id}/versions/{version}/restore",
|
|
2285
|
+
...options,
|
|
2286
|
+
headers: {
|
|
2287
|
+
"Content-Type": "application/json",
|
|
2288
|
+
...options.headers
|
|
2289
|
+
}
|
|
2290
|
+
});
|
|
2291
|
+
}
|
|
2292
|
+
/**
|
|
2263
2293
|
* Dry-run evaluate a guardrail
|
|
2264
2294
|
*
|
|
2265
2295
|
* 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.*`.
|
|
@@ -2650,6 +2680,48 @@ var Orchestrations = class {
|
|
|
2650
2680
|
});
|
|
2651
2681
|
}
|
|
2652
2682
|
/**
|
|
2683
|
+
* List an orchestration's graph versions
|
|
2684
|
+
*
|
|
2685
|
+
* 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).
|
|
2686
|
+
*
|
|
2687
|
+
*/
|
|
2688
|
+
static listOrchestrationVersions(options) {
|
|
2689
|
+
return (options.client ?? client).get({
|
|
2690
|
+
url: "/api/v1/orchestrations/{orchestration_id}/versions",
|
|
2691
|
+
...options
|
|
2692
|
+
});
|
|
2693
|
+
}
|
|
2694
|
+
/**
|
|
2695
|
+
* Fetch an archived orchestration version
|
|
2696
|
+
*
|
|
2697
|
+
* 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.
|
|
2698
|
+
*
|
|
2699
|
+
*/
|
|
2700
|
+
static getOrchestrationVersion(options) {
|
|
2701
|
+
return (options.client ?? client).get({
|
|
2702
|
+
url: "/api/v1/orchestrations/{orchestration_id}/versions/{version}",
|
|
2703
|
+
...options
|
|
2704
|
+
});
|
|
2705
|
+
}
|
|
2706
|
+
/**
|
|
2707
|
+
* Restore an archived orchestration graph
|
|
2708
|
+
*
|
|
2709
|
+
* 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.
|
|
2710
|
+
*
|
|
2711
|
+
* 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.
|
|
2712
|
+
*
|
|
2713
|
+
*/
|
|
2714
|
+
static restoreOrchestrationVersion(options) {
|
|
2715
|
+
return (options.client ?? client).post({
|
|
2716
|
+
url: "/api/v1/orchestrations/{orchestration_id}/versions/{version}/restore",
|
|
2717
|
+
...options,
|
|
2718
|
+
headers: {
|
|
2719
|
+
"Content-Type": "application/json",
|
|
2720
|
+
...options.headers
|
|
2721
|
+
}
|
|
2722
|
+
});
|
|
2723
|
+
}
|
|
2724
|
+
/**
|
|
2653
2725
|
* List orchestration runs
|
|
2654
2726
|
*
|
|
2655
2727
|
* Returns orchestration runs the caller can access, optionally filtered by orchestration.
|
|
@@ -3910,6 +3982,48 @@ var Workflows = class {
|
|
|
3910
3982
|
}
|
|
3911
3983
|
});
|
|
3912
3984
|
}
|
|
3985
|
+
/**
|
|
3986
|
+
* List a workflow's versions
|
|
3987
|
+
*
|
|
3988
|
+
* 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).
|
|
3989
|
+
*
|
|
3990
|
+
*/
|
|
3991
|
+
static listWorkflowVersions(options) {
|
|
3992
|
+
return (options.client ?? client).get({
|
|
3993
|
+
url: "/api/v1/workflows/{workflow_id}/versions",
|
|
3994
|
+
...options
|
|
3995
|
+
});
|
|
3996
|
+
}
|
|
3997
|
+
/**
|
|
3998
|
+
* Fetch an archived workflow version
|
|
3999
|
+
*
|
|
4000
|
+
* 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.
|
|
4001
|
+
*
|
|
4002
|
+
*/
|
|
4003
|
+
static getWorkflowVersion(options) {
|
|
4004
|
+
return (options.client ?? client).get({
|
|
4005
|
+
url: "/api/v1/workflows/{workflow_id}/versions/{version}",
|
|
4006
|
+
...options
|
|
4007
|
+
});
|
|
4008
|
+
}
|
|
4009
|
+
/**
|
|
4010
|
+
* Restore an archived workflow state machine
|
|
4011
|
+
*
|
|
4012
|
+
* 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.
|
|
4013
|
+
*
|
|
4014
|
+
* 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.
|
|
4015
|
+
*
|
|
4016
|
+
*/
|
|
4017
|
+
static restoreWorkflowVersion(options) {
|
|
4018
|
+
return (options.client ?? client).post({
|
|
4019
|
+
url: "/api/v1/workflows/{workflow_id}/versions/{version}/restore",
|
|
4020
|
+
...options,
|
|
4021
|
+
headers: {
|
|
4022
|
+
"Content-Type": "application/json",
|
|
4023
|
+
...options.headers
|
|
4024
|
+
}
|
|
4025
|
+
});
|
|
4026
|
+
}
|
|
3913
4027
|
};
|
|
3914
4028
|
//#endregion
|
|
3915
4029
|
//#region src/soatClient.ts
|