@soat/sdk 0.15.10 → 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 +98 -2
- package/dist/index.d.cts +473 -38
- package/dist/index.d.mts +473 -38
- package/dist/index.mjs +98 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1961,6 +1961,101 @@ var Generations = class {
|
|
|
1961
1961
|
});
|
|
1962
1962
|
}
|
|
1963
1963
|
};
|
|
1964
|
+
var Guardrails = class {
|
|
1965
|
+
/**
|
|
1966
|
+
* List guardrails
|
|
1967
|
+
*
|
|
1968
|
+
* Returns all guardrails in the project.
|
|
1969
|
+
*/
|
|
1970
|
+
static listGuardrails(options) {
|
|
1971
|
+
return (options?.client ?? client).get({
|
|
1972
|
+
url: "/api/v1/guardrails",
|
|
1973
|
+
...options
|
|
1974
|
+
});
|
|
1975
|
+
}
|
|
1976
|
+
/**
|
|
1977
|
+
* Create a guardrail
|
|
1978
|
+
*
|
|
1979
|
+
* 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.
|
|
1980
|
+
*
|
|
1981
|
+
*/
|
|
1982
|
+
static createGuardrail(options) {
|
|
1983
|
+
return (options.client ?? client).post({
|
|
1984
|
+
url: "/api/v1/guardrails",
|
|
1985
|
+
...options,
|
|
1986
|
+
headers: {
|
|
1987
|
+
"Content-Type": "application/json",
|
|
1988
|
+
...options.headers
|
|
1989
|
+
}
|
|
1990
|
+
});
|
|
1991
|
+
}
|
|
1992
|
+
/**
|
|
1993
|
+
* Delete a guardrail
|
|
1994
|
+
*
|
|
1995
|
+
* Deletes a guardrail and its archived versions by ID.
|
|
1996
|
+
*/
|
|
1997
|
+
static deleteGuardrail(options) {
|
|
1998
|
+
return (options.client ?? client).delete({
|
|
1999
|
+
url: "/api/v1/guardrails/{guardrail_id}",
|
|
2000
|
+
...options
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
/**
|
|
2004
|
+
* Get a guardrail
|
|
2005
|
+
*
|
|
2006
|
+
* Returns a single guardrail by ID.
|
|
2007
|
+
*/
|
|
2008
|
+
static getGuardrail(options) {
|
|
2009
|
+
return (options.client ?? client).get({
|
|
2010
|
+
url: "/api/v1/guardrails/{guardrail_id}",
|
|
2011
|
+
...options
|
|
2012
|
+
});
|
|
2013
|
+
}
|
|
2014
|
+
/**
|
|
2015
|
+
* Update a guardrail
|
|
2016
|
+
*
|
|
2017
|
+
* 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.
|
|
2018
|
+
*
|
|
2019
|
+
*/
|
|
2020
|
+
static updateGuardrail(options) {
|
|
2021
|
+
return (options.client ?? client).patch({
|
|
2022
|
+
url: "/api/v1/guardrails/{guardrail_id}",
|
|
2023
|
+
...options,
|
|
2024
|
+
headers: {
|
|
2025
|
+
"Content-Type": "application/json",
|
|
2026
|
+
...options.headers
|
|
2027
|
+
}
|
|
2028
|
+
});
|
|
2029
|
+
}
|
|
2030
|
+
/**
|
|
2031
|
+
* Fetch an archived guardrail version
|
|
2032
|
+
*
|
|
2033
|
+
* 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.
|
|
2034
|
+
*
|
|
2035
|
+
*/
|
|
2036
|
+
static getGuardrailVersion(options) {
|
|
2037
|
+
return (options.client ?? client).get({
|
|
2038
|
+
url: "/api/v1/guardrails/{guardrail_id}/versions/{version}",
|
|
2039
|
+
...options
|
|
2040
|
+
});
|
|
2041
|
+
}
|
|
2042
|
+
/**
|
|
2043
|
+
* Dry-run evaluate a guardrail
|
|
2044
|
+
*
|
|
2045
|
+
* 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.*`.
|
|
2046
|
+
*
|
|
2047
|
+
*/
|
|
2048
|
+
static evaluateGuardrail(options) {
|
|
2049
|
+
return (options.client ?? client).post({
|
|
2050
|
+
url: "/api/v1/guardrails/{guardrail_id}/evaluate",
|
|
2051
|
+
...options,
|
|
2052
|
+
headers: {
|
|
2053
|
+
"Content-Type": "application/json",
|
|
2054
|
+
...options.headers
|
|
2055
|
+
}
|
|
2056
|
+
});
|
|
2057
|
+
}
|
|
2058
|
+
};
|
|
1964
2059
|
var IngestionRules = class {
|
|
1965
2060
|
/**
|
|
1966
2061
|
* List ingestion rules
|
|
@@ -2450,9 +2545,9 @@ var Projects = class {
|
|
|
2450
2545
|
});
|
|
2451
2546
|
}
|
|
2452
2547
|
/**
|
|
2453
|
-
*
|
|
2548
|
+
* Update a project
|
|
2454
2549
|
*
|
|
2455
|
-
* Updates a project's name. Requires admin role.
|
|
2550
|
+
* 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.
|
|
2456
2551
|
*/
|
|
2457
2552
|
static updateProject(options) {
|
|
2458
2553
|
return (options.client ?? client).patch({
|
|
@@ -3549,6 +3644,7 @@ exports.Embeddings = Embeddings;
|
|
|
3549
3644
|
exports.Files = Files;
|
|
3550
3645
|
exports.Formations = Formations;
|
|
3551
3646
|
exports.Generations = Generations;
|
|
3647
|
+
exports.Guardrails = Guardrails;
|
|
3552
3648
|
exports.IngestionRules = IngestionRules;
|
|
3553
3649
|
exports.Knowledge = Knowledge;
|
|
3554
3650
|
exports.Memories = Memories;
|