@soat/sdk 0.22.1 → 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 +108 -23
- package/dist/index.d.cts +604 -142
- package/dist/index.d.mts +604 -142
- package/dist/index.mjs +108 -23
- 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({
|
|
@@ -1276,25 +1278,15 @@ var Chats = class {
|
|
|
1276
1278
|
});
|
|
1277
1279
|
}
|
|
1278
1280
|
/**
|
|
1279
|
-
* Create a chat completion
|
|
1281
|
+
* Create a chat completion
|
|
1280
1282
|
*
|
|
1281
|
-
*
|
|
1283
|
+
* OpenAI Chat Completions-compatible endpoint. Mirrors OpenAI's `POST /v1/chat/completions` path so an OpenAI SDK can target it by base URL alone.
|
|
1282
1284
|
*
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
url: "/api/v1/chats/{chat_id}/completions",
|
|
1287
|
-
...options,
|
|
1288
|
-
headers: {
|
|
1289
|
-
"Content-Type": "application/json",
|
|
1290
|
-
...options.headers
|
|
1291
|
-
}
|
|
1292
|
-
});
|
|
1293
|
-
}
|
|
1294
|
-
/**
|
|
1295
|
-
* Create a chat completion (stateless)
|
|
1285
|
+
* Names exactly one target. With `ai_provider_id` the completion is stateless: the provider's secret is decrypted and the appropriate Vercel AI SDK provider is called, with no server-side model fallback. With `chat_id` the stored chat supplies the provider (or the project's `default_model_route_id`), model and instructions.
|
|
1286
|
+
*
|
|
1287
|
+
* System content travels only in `instructions` — a `role: "system"` entry in `messages` is refused with `400 SYSTEM_MESSAGE_NOT_ALLOWED`. With `chat_id`, a request `instructions` replaces the chat's stored one for this call only; the stored value applies when the request carries none, and the two are never merged.
|
|
1296
1288
|
*
|
|
1297
|
-
*
|
|
1289
|
+
* Messages may use `document_id` instead of `content` with either target. Chats hold no message history — send the full `messages` array every time.
|
|
1298
1290
|
*
|
|
1299
1291
|
*/
|
|
1300
1292
|
static createChatCompletion(options) {
|
|
@@ -1782,6 +1774,27 @@ var Evaluations = class {
|
|
|
1782
1774
|
});
|
|
1783
1775
|
}
|
|
1784
1776
|
/**
|
|
1777
|
+
* Curate a dataset item from a generation
|
|
1778
|
+
*
|
|
1779
|
+
* Promotes a real, completed generation into a test case: its input messages become the item's `input`, and its own answer becomes `expected_output` unless you supply one. Use it to build an evaluation set out of production traffic rather than hand-authoring fixtures.
|
|
1780
|
+
*
|
|
1781
|
+
* The item is a **copy**, not a view. It keeps working after the source generation's content is purged, and `source_generation_id` goes null if that generation is deleted — a purge can never quietly stop a suite from being runnable.
|
|
1782
|
+
*
|
|
1783
|
+
* Requires both `evaluations:CreateDataset` and `generations:GetGeneration`: the call copies content out of a generation, so a principal that may not read that generation may not curate it either.
|
|
1784
|
+
*
|
|
1785
|
+
* Only a **completed** generation can be promoted (`409 GENERATION_NOT_COMPLETED`), and only while its content is still available: an agent or project running with `trace_content_mode: none` never stored the input, and a purged or expired generation no longer has it (`409 GENERATION_CONTENT_UNAVAILABLE`). Generations that predate input recording answer the same way.
|
|
1786
|
+
*/
|
|
1787
|
+
static createDatasetItemFromGeneration(options) {
|
|
1788
|
+
return (options.client ?? client).post({
|
|
1789
|
+
url: "/api/v1/datasets/{dataset_id}/items/from-generation",
|
|
1790
|
+
...options,
|
|
1791
|
+
headers: {
|
|
1792
|
+
"Content-Type": "application/json",
|
|
1793
|
+
...options.headers
|
|
1794
|
+
}
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1797
|
+
/**
|
|
1785
1798
|
* Delete a dataset item
|
|
1786
1799
|
*
|
|
1787
1800
|
* Deletes a test case. Results of runs that already scored it stay readable; their `dataset_item_id` becomes null.
|
|
@@ -2232,6 +2245,8 @@ var Formations = class {
|
|
|
2232
2245
|
*
|
|
2233
2246
|
* Validates the template, creates the formation record, then provisions all declared resources in dependency order.
|
|
2234
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
|
+
*
|
|
2235
2250
|
*/
|
|
2236
2251
|
static createFormation(options) {
|
|
2237
2252
|
return (options.client ?? client).post({
|
|
@@ -2248,6 +2263,10 @@ var Formations = class {
|
|
|
2248
2263
|
*
|
|
2249
2264
|
* Deletes the formation stack and all its managed resources in reverse dependency order.
|
|
2250
2265
|
*
|
|
2266
|
+
* A resource the platform refuses to delete on its own — most often an agent that has generation or trace history — fails the teardown with `409 FORMATION_DELETE_FAILED`, naming every blocking resource in `error.meta.failures`. Resolve the blockers (for an agent, `DELETE /api/v1/agents/{agent_id}?force=true` also removes its generations and traces, and `deletion_policy: retain` exempts it from teardown entirely) and delete the formation again.
|
|
2267
|
+
*
|
|
2268
|
+
* A refusal the platform can foresee is found by a pre-flight, before the first delete: nothing is removed, and the formation stays `active` and intact for the retry. An unforeseeable error surfaces mid-teardown instead, where resources deleted before the blocker stay deleted and the formation is left in `delete_failed`. The error message states which happened.
|
|
2269
|
+
*
|
|
2251
2270
|
*/
|
|
2252
2271
|
static deleteFormation(options) {
|
|
2253
2272
|
return (options.client ?? client).delete({
|
|
@@ -2271,6 +2290,8 @@ var Formations = class {
|
|
|
2271
2290
|
*
|
|
2272
2291
|
* Applies a new template to the formation. Resources are created, updated, or deleted to reconcile the current state with the desired state.
|
|
2273
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
|
+
*
|
|
2274
2295
|
*/
|
|
2275
2296
|
static updateFormation(options) {
|
|
2276
2297
|
return (options.client ?? client).put({
|
|
@@ -2354,6 +2375,22 @@ var Generations = class {
|
|
|
2354
2375
|
...options
|
|
2355
2376
|
});
|
|
2356
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
|
+
}
|
|
2357
2394
|
};
|
|
2358
2395
|
var Guardrails = class {
|
|
2359
2396
|
/**
|
|
@@ -2909,7 +2946,7 @@ var Orchestrations = class {
|
|
|
2909
2946
|
/**
|
|
2910
2947
|
* Start an orchestration run
|
|
2911
2948
|
*
|
|
2912
|
-
* Creates a new run for the orchestration named by orchestration_id. By default the run executes durably in the background: the response returns immediately with status "queued" (a worker then claims it and moves it to "running") and progress is observed via get-orchestration-run or run lifecycle webhook events (orchestration_runs.started/awaiting_input/succeeded/failed). Delay and poll waits park the run as "sleeping" and are woken by a background scheduler, surviving restarts. Pass wait=true to block until the run reaches a terminal or awaiting_input state
|
|
2949
|
+
* Creates a new run for the orchestration named by orchestration_id. By default the run executes durably in the background: the response returns immediately with status "queued" (a worker then claims it and moves it to "running") and progress is observed via get-orchestration-run or run lifecycle webhook events (orchestration_runs.started/awaiting_input/succeeded/failed). Delay and poll waits park the run as "sleeping" and are woken by a background scheduler, surviving restarts. Pass wait=true to block until the run reaches a terminal or awaiting_input state.
|
|
2913
2950
|
*/
|
|
2914
2951
|
static startOrchestrationRun(options) {
|
|
2915
2952
|
return (options.client ?? client).post({
|
|
@@ -3380,6 +3417,38 @@ var Sessions = class {
|
|
|
3380
3417
|
});
|
|
3381
3418
|
}
|
|
3382
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
|
+
/**
|
|
3383
3452
|
* Get session tags
|
|
3384
3453
|
*
|
|
3385
3454
|
* Returns the session's tags object.
|
|
@@ -3775,7 +3844,7 @@ var Usage = class {
|
|
|
3775
3844
|
/**
|
|
3776
3845
|
* List usage meters
|
|
3777
3846
|
*
|
|
3778
|
-
* Returns the raw usage-meter rows the caller can access, most recent first, optionally filtered by agent, generation, trace, actor, or
|
|
3847
|
+
* Returns the raw usage-meter rows the caller can access, most recent first, optionally filtered by agent, generation, trace, actor, session, or `source`. Each row is the per-generation token usage as reported by the provider, for audit and reconciliation.
|
|
3779
3848
|
*
|
|
3780
3849
|
*/
|
|
3781
3850
|
static listUsageMeters(options) {
|
|
@@ -4070,6 +4139,22 @@ var Webhooks = class {
|
|
|
4070
4139
|
});
|
|
4071
4140
|
}
|
|
4072
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
|
+
/**
|
|
4073
4158
|
* Get webhook secret
|
|
4074
4159
|
*
|
|
4075
4160
|
* Retrieves the signing secret for the specified webhook
|