@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.mjs
CHANGED
|
@@ -1960,6 +1960,101 @@ var Generations = class {
|
|
|
1960
1960
|
});
|
|
1961
1961
|
}
|
|
1962
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
|
+
};
|
|
1963
2058
|
var IngestionRules = class {
|
|
1964
2059
|
/**
|
|
1965
2060
|
* List ingestion rules
|
|
@@ -2449,9 +2544,9 @@ var Projects = class {
|
|
|
2449
2544
|
});
|
|
2450
2545
|
}
|
|
2451
2546
|
/**
|
|
2452
|
-
*
|
|
2547
|
+
* Update a project
|
|
2453
2548
|
*
|
|
2454
|
-
* 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.
|
|
2455
2550
|
*/
|
|
2456
2551
|
static updateProject(options) {
|
|
2457
2552
|
return (options.client ?? client).patch({
|
|
@@ -3535,4 +3630,4 @@ var SoatClient = class {
|
|
|
3535
3630
|
}
|
|
3536
3631
|
};
|
|
3537
3632
|
//#endregion
|
|
3538
|
-
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 };
|