@soat/sdk 0.23.0 → 0.25.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/LICENSE +201 -21
- package/dist/index.cjs +76 -6
- package/dist/index.d.cts +516 -58
- package/dist/index.d.mts +516 -58
- package/dist/index.mjs +76 -6
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1017,6 +1017,8 @@ var AiProviders = class {
|
|
|
1017
1017
|
* 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.
|
|
1018
1018
|
* 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.
|
|
1019
1019
|
* 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`.
|
|
1020
|
+
* 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.
|
|
1021
|
+
* 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`.
|
|
1020
1022
|
*
|
|
1021
1023
|
*/
|
|
1022
1024
|
static listAiProviderModels(options) {
|
|
@@ -1058,7 +1060,7 @@ var ApiKeys = class {
|
|
|
1058
1060
|
/**
|
|
1059
1061
|
* List API keys
|
|
1060
1062
|
*
|
|
1061
|
-
* 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
|
|
1063
|
+
* 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.
|
|
1062
1064
|
*
|
|
1063
1065
|
*/
|
|
1064
1066
|
static listApiKeys(options) {
|
|
@@ -1074,7 +1076,7 @@ var ApiKeys = class {
|
|
|
1074
1076
|
/**
|
|
1075
1077
|
* Create an API key
|
|
1076
1078
|
*
|
|
1077
|
-
* 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).
|
|
1079
|
+
* 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.
|
|
1078
1080
|
*
|
|
1079
1081
|
*/
|
|
1080
1082
|
static createApiKey(options) {
|
|
@@ -1090,7 +1092,7 @@ var ApiKeys = class {
|
|
|
1090
1092
|
/**
|
|
1091
1093
|
* Delete an API key
|
|
1092
1094
|
*
|
|
1093
|
-
* Deletes an API key. Only the owner or an admin can delete it.
|
|
1095
|
+
* 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.
|
|
1094
1096
|
*/
|
|
1095
1097
|
static deleteApiKey(options) {
|
|
1096
1098
|
return (options.client ?? client).delete({
|
|
@@ -1101,7 +1103,7 @@ var ApiKeys = class {
|
|
|
1101
1103
|
/**
|
|
1102
1104
|
* Get an API key
|
|
1103
1105
|
*
|
|
1104
|
-
* Returns details of an API key. Only the owner or an admin can access it.
|
|
1106
|
+
* 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.
|
|
1105
1107
|
*/
|
|
1106
1108
|
static getApiKey(options) {
|
|
1107
1109
|
return (options.client ?? client).get({
|
|
@@ -1112,7 +1114,7 @@ var ApiKeys = class {
|
|
|
1112
1114
|
/**
|
|
1113
1115
|
* Update an API key
|
|
1114
1116
|
*
|
|
1115
|
-
* 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.
|
|
1117
|
+
* 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.
|
|
1116
1118
|
*/
|
|
1117
1119
|
static updateApiKey(options) {
|
|
1118
1120
|
return (options.client ?? client).put({
|
|
@@ -2242,6 +2244,8 @@ var Formations = class {
|
|
|
2242
2244
|
*
|
|
2243
2245
|
* Validates the template, creates the formation record, then provisions all declared resources in dependency order.
|
|
2244
2246
|
*
|
|
2247
|
+
* 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.
|
|
2248
|
+
*
|
|
2245
2249
|
*/
|
|
2246
2250
|
static createFormation(options) {
|
|
2247
2251
|
return (options.client ?? client).post({
|
|
@@ -2285,6 +2289,8 @@ var Formations = class {
|
|
|
2285
2289
|
*
|
|
2286
2290
|
* Applies a new template to the formation. Resources are created, updated, or deleted to reconcile the current state with the desired state.
|
|
2287
2291
|
*
|
|
2292
|
+
* 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.
|
|
2293
|
+
*
|
|
2288
2294
|
*/
|
|
2289
2295
|
static updateFormation(options) {
|
|
2290
2296
|
return (options.client ?? client).put({
|
|
@@ -2368,6 +2374,22 @@ var Generations = class {
|
|
|
2368
2374
|
...options
|
|
2369
2375
|
});
|
|
2370
2376
|
}
|
|
2377
|
+
/**
|
|
2378
|
+
* Get a generation's transcript
|
|
2379
|
+
*
|
|
2380
|
+
* 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.
|
|
2381
|
+
*
|
|
2382
|
+
* 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.
|
|
2383
|
+
*
|
|
2384
|
+
* 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.
|
|
2385
|
+
*
|
|
2386
|
+
*/
|
|
2387
|
+
static getGenerationTranscript(options) {
|
|
2388
|
+
return (options.client ?? client).get({
|
|
2389
|
+
url: "/api/v1/generations/{generation_id}/transcript",
|
|
2390
|
+
...options
|
|
2391
|
+
});
|
|
2392
|
+
}
|
|
2371
2393
|
};
|
|
2372
2394
|
var Guardrails = class {
|
|
2373
2395
|
/**
|
|
@@ -2656,7 +2678,7 @@ var MemoryEntries = class {
|
|
|
2656
2678
|
/**
|
|
2657
2679
|
* Create a memory entry
|
|
2658
2680
|
*
|
|
2659
|
-
* Creates a new entry in the specified memory container. Automatically generates an embedding for semantic search.
|
|
2681
|
+
* Creates a new entry in the specified memory container. Automatically generates an embedding for semantic search, and skips the write when an existing entry is a near-duplicate (see `duplicate_threshold`). A merely similar fact is stored as its own entry: this path has no agent context and therefore no model to consolidate two facts into one.
|
|
2660
2682
|
*/
|
|
2661
2683
|
static createMemoryEntry(options) {
|
|
2662
2684
|
return (options.client ?? client).post({
|
|
@@ -3394,6 +3416,38 @@ var Sessions = class {
|
|
|
3394
3416
|
});
|
|
3395
3417
|
}
|
|
3396
3418
|
/**
|
|
3419
|
+
* Fork a session
|
|
3420
|
+
*
|
|
3421
|
+
* Branches a new session from a point in this session's history: same context, different continuation.
|
|
3422
|
+
*
|
|
3423
|
+
* 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.
|
|
3424
|
+
*
|
|
3425
|
+
* 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.
|
|
3426
|
+
*
|
|
3427
|
+
*/
|
|
3428
|
+
static forkSession(options) {
|
|
3429
|
+
return (options.client ?? client).post({
|
|
3430
|
+
url: "/api/v1/sessions/{session_id}/fork",
|
|
3431
|
+
...options,
|
|
3432
|
+
headers: {
|
|
3433
|
+
"Content-Type": "application/json",
|
|
3434
|
+
...options.headers
|
|
3435
|
+
}
|
|
3436
|
+
});
|
|
3437
|
+
}
|
|
3438
|
+
/**
|
|
3439
|
+
* List a session's forks
|
|
3440
|
+
*
|
|
3441
|
+
* Returns the sessions forked directly from this one. One level of lineage: a fork of a fork is listed under its own parent.
|
|
3442
|
+
*
|
|
3443
|
+
*/
|
|
3444
|
+
static listSessionForks(options) {
|
|
3445
|
+
return (options.client ?? client).get({
|
|
3446
|
+
url: "/api/v1/sessions/{session_id}/forks",
|
|
3447
|
+
...options
|
|
3448
|
+
});
|
|
3449
|
+
}
|
|
3450
|
+
/**
|
|
3397
3451
|
* Get session tags
|
|
3398
3452
|
*
|
|
3399
3453
|
* Returns the session's tags object.
|
|
@@ -4084,6 +4138,22 @@ var Webhooks = class {
|
|
|
4084
4138
|
});
|
|
4085
4139
|
}
|
|
4086
4140
|
/**
|
|
4141
|
+
* Redeliver a webhook delivery
|
|
4142
|
+
*
|
|
4143
|
+
* Queues the stored payload of an existing delivery to be sent again.
|
|
4144
|
+
*
|
|
4145
|
+
* A new delivery record is created rather than the original being reset,
|
|
4146
|
+
* so the original attempt stays in the history. The send happens in the
|
|
4147
|
+
* background: poll the returned delivery to observe its outcome.
|
|
4148
|
+
*
|
|
4149
|
+
*/
|
|
4150
|
+
static redeliverWebhookDelivery(options) {
|
|
4151
|
+
return (options.client ?? client).post({
|
|
4152
|
+
url: "/api/v1/webhook-deliveries/{delivery_id}/redeliver",
|
|
4153
|
+
...options
|
|
4154
|
+
});
|
|
4155
|
+
}
|
|
4156
|
+
/**
|
|
4087
4157
|
* Get webhook secret
|
|
4088
4158
|
*
|
|
4089
4159
|
* Retrieves the signing secret for the specified webhook
|