@soat/sdk 0.15.9 → 0.15.11
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 +104 -5
- package/dist/index.d.cts +544 -51
- package/dist/index.d.mts +544 -51
- package/dist/index.mjs +104 -6
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -871,7 +871,10 @@ var AiProviders = class {
|
|
|
871
871
|
/**
|
|
872
872
|
* Delete an AI provider
|
|
873
873
|
*
|
|
874
|
-
* Deletes an AI provider configuration
|
|
874
|
+
* Deletes an AI provider configuration.
|
|
875
|
+
*
|
|
876
|
+
* Live references — chats, agents, and discussions that use this provider — always block deletion with `409 AI_PROVIDER_HAS_DEPENDENTS`; `force` does not override them, so delete or repoint those resources first. Soft dependents — price overrides, usage/generation records, and discussion participants — also block with `409` unless `force=true`, which deletes the provider's price overrides and unlinks (nulls) its usage and participant history, preserving those rows. The `409` body's `error.meta` reports the counts, a sample of offending IDs, and a `forcible` flag that is `true` when a `force=true` retry would succeed.
|
|
877
|
+
*
|
|
875
878
|
*/
|
|
876
879
|
static deleteAiProvider(options) {
|
|
877
880
|
return (options.client ?? client).delete({
|
|
@@ -1957,6 +1960,101 @@ var Generations = class {
|
|
|
1957
1960
|
});
|
|
1958
1961
|
}
|
|
1959
1962
|
};
|
|
1963
|
+
var Guardrails = class {
|
|
1964
|
+
/**
|
|
1965
|
+
* List guardrails
|
|
1966
|
+
*
|
|
1967
|
+
* Returns all guardrails in the project.
|
|
1968
|
+
*/
|
|
1969
|
+
static listGuardrails(options) {
|
|
1970
|
+
return (options?.client ?? client).get({
|
|
1971
|
+
url: "/api/v1/guardrails",
|
|
1972
|
+
...options
|
|
1973
|
+
});
|
|
1974
|
+
}
|
|
1975
|
+
/**
|
|
1976
|
+
* Create a guardrail
|
|
1977
|
+
*
|
|
1978
|
+
* 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.
|
|
1979
|
+
*
|
|
1980
|
+
*/
|
|
1981
|
+
static createGuardrail(options) {
|
|
1982
|
+
return (options.client ?? client).post({
|
|
1983
|
+
url: "/api/v1/guardrails",
|
|
1984
|
+
...options,
|
|
1985
|
+
headers: {
|
|
1986
|
+
"Content-Type": "application/json",
|
|
1987
|
+
...options.headers
|
|
1988
|
+
}
|
|
1989
|
+
});
|
|
1990
|
+
}
|
|
1991
|
+
/**
|
|
1992
|
+
* Delete a guardrail
|
|
1993
|
+
*
|
|
1994
|
+
* Deletes a guardrail and its archived versions by ID.
|
|
1995
|
+
*/
|
|
1996
|
+
static deleteGuardrail(options) {
|
|
1997
|
+
return (options.client ?? client).delete({
|
|
1998
|
+
url: "/api/v1/guardrails/{guardrail_id}",
|
|
1999
|
+
...options
|
|
2000
|
+
});
|
|
2001
|
+
}
|
|
2002
|
+
/**
|
|
2003
|
+
* Get a guardrail
|
|
2004
|
+
*
|
|
2005
|
+
* Returns a single guardrail by ID.
|
|
2006
|
+
*/
|
|
2007
|
+
static getGuardrail(options) {
|
|
2008
|
+
return (options.client ?? client).get({
|
|
2009
|
+
url: "/api/v1/guardrails/{guardrail_id}",
|
|
2010
|
+
...options
|
|
2011
|
+
});
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* Update a guardrail
|
|
2015
|
+
*
|
|
2016
|
+
* 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.
|
|
2017
|
+
*
|
|
2018
|
+
*/
|
|
2019
|
+
static updateGuardrail(options) {
|
|
2020
|
+
return (options.client ?? client).patch({
|
|
2021
|
+
url: "/api/v1/guardrails/{guardrail_id}",
|
|
2022
|
+
...options,
|
|
2023
|
+
headers: {
|
|
2024
|
+
"Content-Type": "application/json",
|
|
2025
|
+
...options.headers
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
}
|
|
2029
|
+
/**
|
|
2030
|
+
* Fetch an archived guardrail version
|
|
2031
|
+
*
|
|
2032
|
+
* 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.
|
|
2033
|
+
*
|
|
2034
|
+
*/
|
|
2035
|
+
static getGuardrailVersion(options) {
|
|
2036
|
+
return (options.client ?? client).get({
|
|
2037
|
+
url: "/api/v1/guardrails/{guardrail_id}/versions/{version}",
|
|
2038
|
+
...options
|
|
2039
|
+
});
|
|
2040
|
+
}
|
|
2041
|
+
/**
|
|
2042
|
+
* Dry-run evaluate a guardrail
|
|
2043
|
+
*
|
|
2044
|
+
* 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.*`.
|
|
2045
|
+
*
|
|
2046
|
+
*/
|
|
2047
|
+
static evaluateGuardrail(options) {
|
|
2048
|
+
return (options.client ?? client).post({
|
|
2049
|
+
url: "/api/v1/guardrails/{guardrail_id}/evaluate",
|
|
2050
|
+
...options,
|
|
2051
|
+
headers: {
|
|
2052
|
+
"Content-Type": "application/json",
|
|
2053
|
+
...options.headers
|
|
2054
|
+
}
|
|
2055
|
+
});
|
|
2056
|
+
}
|
|
2057
|
+
};
|
|
1960
2058
|
var IngestionRules = class {
|
|
1961
2059
|
/**
|
|
1962
2060
|
* List ingestion rules
|
|
@@ -2446,9 +2544,9 @@ var Projects = class {
|
|
|
2446
2544
|
});
|
|
2447
2545
|
}
|
|
2448
2546
|
/**
|
|
2449
|
-
*
|
|
2547
|
+
* Update a project
|
|
2450
2548
|
*
|
|
2451
|
-
* Updates a project's name. Requires admin role.
|
|
2549
|
+
* Updates a project's name and/or its attached guardrails (`guardrail_ids` — the project-scope baseline governing every tool call by every agent in the project). Requires admin role. Detaching a guardrail (removing an id) additionally requires guardrails:DetachGuardrail.
|
|
2452
2550
|
*/
|
|
2453
2551
|
static updateProject(options) {
|
|
2454
2552
|
return (options.client ?? client).patch({
|
|
@@ -2762,7 +2860,7 @@ var Tasks = class {
|
|
|
2762
2860
|
/**
|
|
2763
2861
|
* Update a task
|
|
2764
2862
|
*
|
|
2765
|
-
* Updates a task's payload, title, or assignee. `state` is never directly writable — move it with a transition. `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`.
|
|
2863
|
+
* 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`.
|
|
2766
2864
|
*/
|
|
2767
2865
|
static updateTask(options) {
|
|
2768
2866
|
return (options.client ?? client).patch({
|
|
@@ -2777,7 +2875,7 @@ var Tasks = class {
|
|
|
2777
2875
|
/**
|
|
2778
2876
|
* Transition a task
|
|
2779
2877
|
*
|
|
2780
|
-
* Fires a named transition on a task. The transition must exist in the workflow and be valid from the task's current state; its guard must pass. This is the single path every state change routes through.
|
|
2878
|
+
* Fires a named transition on a task. The transition must exist in the workflow and be valid from the task's current state; its guard must pass. This is the single path every state change routes through. A transition declaring `requires_approval` does not move the task — it parks a pending ApprovalItem and returns the task with `pending_transition` set; the move applies only when the approval is approved.
|
|
2781
2879
|
*/
|
|
2782
2880
|
static transitionTask(options) {
|
|
2783
2881
|
return (options.client ?? client).post({
|
|
@@ -3532,4 +3630,4 @@ var SoatClient = class {
|
|
|
3532
3630
|
}
|
|
3533
3631
|
};
|
|
3534
3632
|
//#endregion
|
|
3535
|
-
export { Actors, Agents, AiProviders, ApiKeys, Approvals, Chats, Conversations, Discussions, Documents, Embeddings, Files, Formations, Generations, IngestionRules, Knowledge, Memories, MemoryEntries, Orchestrations, Policies, Projects, Secrets, Sessions, SoatClient, Tasks, Tools, Traces, Triggers, Usage, Users, Webhooks, Workflows, createClient, createConfig };
|
|
3633
|
+
export { Actors, Agents, AiProviders, ApiKeys, Approvals, Chats, Conversations, Discussions, Documents, Embeddings, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryEntries, Orchestrations, Policies, Projects, Secrets, Sessions, SoatClient, Tasks, Tools, Traces, Triggers, Usage, Users, Webhooks, Workflows, createClient, createConfig };
|