@soat/sdk 0.23.0 → 0.24.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 +75 -5
- package/dist/index.d.cts +475 -23
- package/dist/index.d.mts +475 -23
- package/dist/index.mjs +75 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1018,6 +1018,8 @@ var AiProviders = class {
|
|
|
1018
1018
|
* Asks the provider which models it can run, using this provider record's own credentials and configuration, and returns provider-native model ids — the same strings `default_model` and an agent's `model` carry.
|
|
1019
1019
|
* Which models are reachable is a property of the credential, not of the provider type: a Vertex provider sees only the publisher models its Google Cloud project and location serve, and a Bedrock provider only the foundation models enabled in its region. Reading the list is how a caller avoids pinning a model that fails at generation time.
|
|
1020
1020
|
* Not every provider type can answer. `azure` lists deployments an operator named rather than models, and `ollama` lists whatever was pulled onto that host, so both return `400 MODEL_LISTING_UNSUPPORTED`.
|
|
1021
|
+
* Listing resolves credentials the same way generation does, so a record that can generate can list. The API-key types (`openai`, `groq`, `xai`, `gateway`, `custom`, `anthropic`, `google`) use the record's linked secret and cannot list without one. `bedrock` and `vertex` use the linked secret when there is one — IAM keys or a Bedrock API key, a Google service-account key — and otherwise fall back to the server environment (the AWS default credential chain, Google Application Default Credentials), so a record with no `secret_id` can still list.
|
|
1022
|
+
* A Vertex record needs no `config.project` when its secret is a service-account key, since the key file names its own project. A Vertex record in express mode (API key) cannot list at all: express mode is a global, project-less endpoint and the publisher-model catalogue is per-project, so it returns `400 MODEL_LISTING_UNSUPPORTED`.
|
|
1021
1023
|
*
|
|
1022
1024
|
*/
|
|
1023
1025
|
static listAiProviderModels(options) {
|
|
@@ -1059,7 +1061,7 @@ var ApiKeys = class {
|
|
|
1059
1061
|
/**
|
|
1060
1062
|
* List API keys
|
|
1061
1063
|
*
|
|
1062
|
-
* Lists API keys accessible to the caller. - JWT admin: returns all API keys. - JWT regular user: returns only the user's own API keys. - API key: returns only API keys scoped to
|
|
1064
|
+
* Lists API keys accessible to the caller. - JWT admin: returns all API keys. - JWT regular user: returns only the user's own API keys. - Project-scoped credential (API key or OAuth token): returns only API keys scoped to that project.
|
|
1063
1065
|
*
|
|
1064
1066
|
*/
|
|
1065
1067
|
static listApiKeys(options) {
|
|
@@ -1075,7 +1077,7 @@ var ApiKeys = class {
|
|
|
1075
1077
|
/**
|
|
1076
1078
|
* Create an API key
|
|
1077
1079
|
*
|
|
1078
|
-
* Creates a new API key for the authenticated user. - `project_id` is optional. When set, the key is scoped to that single project. When omitted or null, the key is **unscoped** and spans every project its owner can reach. - If `policy_ids` is provided, the key's effective permissions are the intersection of the user's policies and the key's policies. - Otherwise the key inherits the user's permissions (confined to the key's project when scoped).
|
|
1080
|
+
* Creates a new API key for the authenticated user. - `project_id` is optional. When set, the key is scoped to that single project. When omitted or null, the key is **unscoped** and spans every project its owner can reach. - If `policy_ids` is provided, the key's effective permissions are the intersection of the user's policies and the key's policies. - Otherwise the key inherits the user's permissions (confined to the key's project when scoped). - When the request is authenticated with a **project-scoped credential**, the new key is confined to that same project: omitting `project_id` defaults to it, naming a different project returns `403 API_KEY_PROJECT_SCOPE`, and `project_id: null` (an unscoped key) is likewise refused. Minting an unscoped key requires an unscoped credential.
|
|
1079
1081
|
*
|
|
1080
1082
|
*/
|
|
1081
1083
|
static createApiKey(options) {
|
|
@@ -1091,7 +1093,7 @@ var ApiKeys = class {
|
|
|
1091
1093
|
/**
|
|
1092
1094
|
* Delete an API key
|
|
1093
1095
|
*
|
|
1094
|
-
* Deletes an API key. Only the owner or an admin can delete it.
|
|
1096
|
+
* Deletes an API key. Only the owner or an admin can delete it, and a project-scoped credential can only delete keys in its own project.
|
|
1095
1097
|
*/
|
|
1096
1098
|
static deleteApiKey(options) {
|
|
1097
1099
|
return (options.client ?? client).delete({
|
|
@@ -1102,7 +1104,7 @@ var ApiKeys = class {
|
|
|
1102
1104
|
/**
|
|
1103
1105
|
* Get an API key
|
|
1104
1106
|
*
|
|
1105
|
-
* Returns details of an API key. Only the owner or an admin can access it.
|
|
1107
|
+
* Returns details of an API key. Only the owner or an admin can access it, and a project-scoped credential can only reach keys in its own project.
|
|
1106
1108
|
*/
|
|
1107
1109
|
static getApiKey(options) {
|
|
1108
1110
|
return (options.client ?? client).get({
|
|
@@ -1113,7 +1115,7 @@ var ApiKeys = class {
|
|
|
1113
1115
|
/**
|
|
1114
1116
|
* Update an API key
|
|
1115
1117
|
*
|
|
1116
|
-
* Updates an API key's name, project scope, or policies. The project scope can be changed to another project, set (scoping a previously unscoped key), or cleared with null (unscoping the key). Only the owner or an admin can update it.
|
|
1118
|
+
* Updates an API key's name, project scope, or policies. The project scope can be changed to another project, set (scoping a previously unscoped key), or cleared with null (unscoping the key). Only the owner or an admin can update it. A project-scoped credential can only update keys in its own project, and cannot move a key to another project or unscope it.
|
|
1117
1119
|
*/
|
|
1118
1120
|
static updateApiKey(options) {
|
|
1119
1121
|
return (options.client ?? client).put({
|
|
@@ -2243,6 +2245,8 @@ var Formations = class {
|
|
|
2243
2245
|
*
|
|
2244
2246
|
* Validates the template, creates the formation record, then provisions all declared resources in dependency order.
|
|
2245
2247
|
*
|
|
2248
|
+
* A **template-shape** error is refused with `400`. A **deploy** failure is not: the operation ran, so the formation is returned with `201` and `status: "failed"`, and `error` explains why (the resources created before the failure are rolled back). Read `status` — a `2xx` here means the deploy was attempted, not that it worked. The `soat` CLI exits non-zero on that body so `create-formation && …` does not lie.
|
|
2249
|
+
*
|
|
2246
2250
|
*/
|
|
2247
2251
|
static createFormation(options) {
|
|
2248
2252
|
return (options.client ?? client).post({
|
|
@@ -2286,6 +2290,8 @@ var Formations = class {
|
|
|
2286
2290
|
*
|
|
2287
2291
|
* Applies a new template to the formation. Resources are created, updated, or deleted to reconcile the current state with the desired state.
|
|
2288
2292
|
*
|
|
2293
|
+
* A **template-shape** error is refused with `400`. A **deploy** failure is not: the operation ran, so the formation is returned with `200` and `status: "failed"`, and `error` explains why. Read `status` — a `2xx` here means the deploy was attempted, not that it worked. The `soat` CLI exits non-zero on that body so `update-formation && …` does not lie.
|
|
2294
|
+
*
|
|
2289
2295
|
*/
|
|
2290
2296
|
static updateFormation(options) {
|
|
2291
2297
|
return (options.client ?? client).put({
|
|
@@ -2369,6 +2375,22 @@ var Generations = class {
|
|
|
2369
2375
|
...options
|
|
2370
2376
|
});
|
|
2371
2377
|
}
|
|
2378
|
+
/**
|
|
2379
|
+
* Get a generation's transcript
|
|
2380
|
+
*
|
|
2381
|
+
* Returns one generation's turn read back as an ordered sequence of steps: what it was asked, each model step with its tool calls and results, and how it ended.
|
|
2382
|
+
*
|
|
2383
|
+
* The transcript is assembled at read time from the generation record and the trace's steps object; nothing is stored, so it cannot outlive the content it projects. Requires `traces:GetTrace` in addition to `generations:GetGeneration`, because the response merges content from both resources.
|
|
2384
|
+
*
|
|
2385
|
+
* A generation whose content is unavailable — never written under zero-retention, or cleared by a purge — returns `200` with the skeleton rather than an error: `input` and `output` are null, `steps` is empty, and the `content_redacted_*` fields say which happened. `content_redacted_by_principal_id` is `zero_retention` when the content was never stored, and the purging principal's ID when it was erased later. A generation that is still running returns the same shape with an empty `steps`; `status` disambiguates the two.
|
|
2386
|
+
*
|
|
2387
|
+
*/
|
|
2388
|
+
static getGenerationTranscript(options) {
|
|
2389
|
+
return (options.client ?? client).get({
|
|
2390
|
+
url: "/api/v1/generations/{generation_id}/transcript",
|
|
2391
|
+
...options
|
|
2392
|
+
});
|
|
2393
|
+
}
|
|
2372
2394
|
};
|
|
2373
2395
|
var Guardrails = class {
|
|
2374
2396
|
/**
|
|
@@ -3395,6 +3417,38 @@ var Sessions = class {
|
|
|
3395
3417
|
});
|
|
3396
3418
|
}
|
|
3397
3419
|
/**
|
|
3420
|
+
* Fork a session
|
|
3421
|
+
*
|
|
3422
|
+
* Branches a new session from a point in this session's history: same context, different continuation.
|
|
3423
|
+
*
|
|
3424
|
+
* The fork gets its own conversation whose messages **reference the same documents** as the parent rather than copying them, so there is one stored copy of the content and a retention purge erases it from both. Recorded tool results ride along on those messages and are **replayed** as model input on the fork's next turn — forking never re-invokes a tool, so exploring a "what if" cannot send an email or charge a card a second time. The consequence to accept is that a forked turn sees the tool data as it was, not as it is now.
|
|
3425
|
+
*
|
|
3426
|
+
* The fork is created **inert**: `auto_generate` is false and no generation is triggered. Drive it with the normal message and generate endpoints. The fork has no actor — attach one only if the branch is meant to be driven by the same end user, since `single_session_per_actor` agents allow one open session per actor.
|
|
3427
|
+
*
|
|
3428
|
+
*/
|
|
3429
|
+
static forkSession(options) {
|
|
3430
|
+
return (options.client ?? client).post({
|
|
3431
|
+
url: "/api/v1/sessions/{session_id}/fork",
|
|
3432
|
+
...options,
|
|
3433
|
+
headers: {
|
|
3434
|
+
"Content-Type": "application/json",
|
|
3435
|
+
...options.headers
|
|
3436
|
+
}
|
|
3437
|
+
});
|
|
3438
|
+
}
|
|
3439
|
+
/**
|
|
3440
|
+
* List a session's forks
|
|
3441
|
+
*
|
|
3442
|
+
* Returns the sessions forked directly from this one. One level of lineage: a fork of a fork is listed under its own parent.
|
|
3443
|
+
*
|
|
3444
|
+
*/
|
|
3445
|
+
static listSessionForks(options) {
|
|
3446
|
+
return (options.client ?? client).get({
|
|
3447
|
+
url: "/api/v1/sessions/{session_id}/forks",
|
|
3448
|
+
...options
|
|
3449
|
+
});
|
|
3450
|
+
}
|
|
3451
|
+
/**
|
|
3398
3452
|
* Get session tags
|
|
3399
3453
|
*
|
|
3400
3454
|
* Returns the session's tags object.
|
|
@@ -4085,6 +4139,22 @@ var Webhooks = class {
|
|
|
4085
4139
|
});
|
|
4086
4140
|
}
|
|
4087
4141
|
/**
|
|
4142
|
+
* Redeliver a webhook delivery
|
|
4143
|
+
*
|
|
4144
|
+
* Queues the stored payload of an existing delivery to be sent again.
|
|
4145
|
+
*
|
|
4146
|
+
* A new delivery record is created rather than the original being reset,
|
|
4147
|
+
* so the original attempt stays in the history. The send happens in the
|
|
4148
|
+
* background: poll the returned delivery to observe its outcome.
|
|
4149
|
+
*
|
|
4150
|
+
*/
|
|
4151
|
+
static redeliverWebhookDelivery(options) {
|
|
4152
|
+
return (options.client ?? client).post({
|
|
4153
|
+
url: "/api/v1/webhook-deliveries/{delivery_id}/redeliver",
|
|
4154
|
+
...options
|
|
4155
|
+
});
|
|
4156
|
+
}
|
|
4157
|
+
/**
|
|
4088
4158
|
* Get webhook secret
|
|
4089
4159
|
*
|
|
4090
4160
|
* Retrieves the signing secret for the specified webhook
|