@soat/sdk 0.69.0 → 0.70.1
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 +176 -6
- package/dist/index.d.cts +920 -113
- package/dist/index.d.mts +920 -113
- package/dist/index.mjs +176 -7
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -778,7 +778,7 @@ var Agents = class {
|
|
|
778
778
|
/**
|
|
779
779
|
* Delete an agent
|
|
780
780
|
*
|
|
781
|
-
* Deletes an agent by ID. Fails with `409` if the agent has dependent generations or traces, unless `force=true` is passed, in which case those generations and traces are deleted along with the agent.
|
|
781
|
+
* Deletes an agent by ID. Fails with `409` if the agent has dependent generations or traces, or another project has accepted a share of it, unless `force=true` is passed, in which case those generations and traces are deleted along with the agent and the shares are revoked. Every share of the agent is revoked when it is deleted.
|
|
782
782
|
*
|
|
783
783
|
*/
|
|
784
784
|
static deleteAgent(options) {
|
|
@@ -790,7 +790,8 @@ var Agents = class {
|
|
|
790
790
|
/**
|
|
791
791
|
* Get an agent
|
|
792
792
|
*
|
|
793
|
-
* Returns a single agent by ID.
|
|
793
|
+
* Returns a single agent by ID. A credential scoped to a project the agent is shared with, through an accepted share, reads its `id` and `name` only.
|
|
794
|
+
*
|
|
794
795
|
*/
|
|
795
796
|
static getAgent(options) {
|
|
796
797
|
return (options.client ?? client).get({
|
|
@@ -833,6 +834,8 @@ var Agents = class {
|
|
|
833
834
|
*
|
|
834
835
|
* Sends messages to the agent, resolves its tools, and runs the AI model loop. Background by default: returns `202 Accepted` with a `generation_id` to poll via `GET /api/v1/generations/{generation_id}`. Pass `?wait=true` to block and receive the result inline, where client tools pause the generation and return `requires_action`. Streaming (`stream: true`) implies waiting. Pass `idempotency_key` to make a retry safe: a request whose key is already claimed runs nothing and answers `202` with the generation the key names.
|
|
835
836
|
*
|
|
837
|
+
* A credential scoped to a project the agent is shared with, through an accepted share, runs it in that project: on the publisher's configuration, recorded, metered and governed in the grantee project.
|
|
838
|
+
*
|
|
836
839
|
*/
|
|
837
840
|
static createAgentGeneration(options) {
|
|
838
841
|
return (options.client ?? client).post({
|
|
@@ -4140,6 +4143,167 @@ var Sessions = class {
|
|
|
4140
4143
|
});
|
|
4141
4144
|
}
|
|
4142
4145
|
};
|
|
4146
|
+
var Shares = class {
|
|
4147
|
+
/**
|
|
4148
|
+
* List shares
|
|
4149
|
+
*
|
|
4150
|
+
* With `role=publisher` (the default), the shares the project published. With `role=grantee`, the shares addressed to the project and the public shares it accepted, each with the project's own `acceptance`. A public share the project never accepted is not listed.
|
|
4151
|
+
*/
|
|
4152
|
+
static listShares(options) {
|
|
4153
|
+
return (options?.client ?? client).get({
|
|
4154
|
+
url: "/api/v1/shares",
|
|
4155
|
+
...options
|
|
4156
|
+
});
|
|
4157
|
+
}
|
|
4158
|
+
/**
|
|
4159
|
+
* Create a share
|
|
4160
|
+
*
|
|
4161
|
+
* Offers one of the project's resources to another project — or, with `grantee: "*"`, to every project — with the listed actions. The share grants nothing until the grantee accepts it. `grantee: "*"` is refused with `403 PUBLIC_SHARES_DISABLED` unless the deployment sets `SHARES_ALLOW_PUBLIC=true`.
|
|
4162
|
+
*/
|
|
4163
|
+
static createShare(options) {
|
|
4164
|
+
return (options.client ?? client).post({
|
|
4165
|
+
url: "/api/v1/shares",
|
|
4166
|
+
...options,
|
|
4167
|
+
headers: {
|
|
4168
|
+
"Content-Type": "application/json",
|
|
4169
|
+
...options.headers
|
|
4170
|
+
}
|
|
4171
|
+
});
|
|
4172
|
+
}
|
|
4173
|
+
/**
|
|
4174
|
+
* Delete a share
|
|
4175
|
+
*
|
|
4176
|
+
* Deletes a share and every acceptance of it. Each project whose acceptance was active gets a `share_revoked` activity entry.
|
|
4177
|
+
*/
|
|
4178
|
+
static deleteShare(options) {
|
|
4179
|
+
return (options.client ?? client).delete({
|
|
4180
|
+
url: "/api/v1/shares/{share_id}",
|
|
4181
|
+
...options
|
|
4182
|
+
});
|
|
4183
|
+
}
|
|
4184
|
+
/**
|
|
4185
|
+
* Get a share
|
|
4186
|
+
*
|
|
4187
|
+
* Returns a share with the grantee's view of the resource in `projection`. The publisher reads any of its shares; a grantee project, named by `project_id` or by its scoped credential, reads a share addressed to it or a public one, with its own `acceptance`.
|
|
4188
|
+
*/
|
|
4189
|
+
static getShare(options) {
|
|
4190
|
+
return (options.client ?? client).get({
|
|
4191
|
+
url: "/api/v1/shares/{share_id}",
|
|
4192
|
+
...options
|
|
4193
|
+
});
|
|
4194
|
+
}
|
|
4195
|
+
/**
|
|
4196
|
+
* Update a share
|
|
4197
|
+
*
|
|
4198
|
+
* Changes a share's `cap`, as its publisher. The next call through the share reads the new cap; a changed `window` starts a fresh count.
|
|
4199
|
+
*/
|
|
4200
|
+
static updateShare(options) {
|
|
4201
|
+
return (options.client ?? client).patch({
|
|
4202
|
+
url: "/api/v1/shares/{share_id}",
|
|
4203
|
+
...options,
|
|
4204
|
+
headers: {
|
|
4205
|
+
"Content-Type": "application/json",
|
|
4206
|
+
...options.headers
|
|
4207
|
+
}
|
|
4208
|
+
});
|
|
4209
|
+
}
|
|
4210
|
+
/**
|
|
4211
|
+
* Accept a share
|
|
4212
|
+
*
|
|
4213
|
+
* Records the grantee project's acceptance, which is what makes the share grant anything. Idempotent. A project that revoked its own acceptance may accept again; one whose acceptance the publisher revoked answers `403 SHARE_REVOKED` until the publisher deletes that acceptance. A suspended share can be accepted and grants nothing until resumed.
|
|
4214
|
+
*/
|
|
4215
|
+
static acceptShare(options) {
|
|
4216
|
+
return (options.client ?? client).post({
|
|
4217
|
+
url: "/api/v1/shares/{share_id}/accept",
|
|
4218
|
+
...options,
|
|
4219
|
+
headers: {
|
|
4220
|
+
"Content-Type": "application/json",
|
|
4221
|
+
...options.headers
|
|
4222
|
+
}
|
|
4223
|
+
});
|
|
4224
|
+
}
|
|
4225
|
+
/**
|
|
4226
|
+
* Suspend a share
|
|
4227
|
+
*
|
|
4228
|
+
* Sets `suspended_at`, which denies every acceptance without removing any. Reversible with resume; nobody re-accepts. Each project with an active acceptance gets a `share_suspended` activity entry. Idempotent.
|
|
4229
|
+
*/
|
|
4230
|
+
static suspendShare(options) {
|
|
4231
|
+
return (options.client ?? client).post({
|
|
4232
|
+
url: "/api/v1/shares/{share_id}/suspend",
|
|
4233
|
+
...options
|
|
4234
|
+
});
|
|
4235
|
+
}
|
|
4236
|
+
/**
|
|
4237
|
+
* Resume a share
|
|
4238
|
+
*
|
|
4239
|
+
* Clears `suspended_at`. Each project with an active acceptance gets a `share_resumed` activity entry. Idempotent.
|
|
4240
|
+
*/
|
|
4241
|
+
static resumeShare(options) {
|
|
4242
|
+
return (options.client ?? client).post({
|
|
4243
|
+
url: "/api/v1/shares/{share_id}/resume",
|
|
4244
|
+
...options
|
|
4245
|
+
});
|
|
4246
|
+
}
|
|
4247
|
+
/**
|
|
4248
|
+
* Revoke a share
|
|
4249
|
+
*
|
|
4250
|
+
* As the publisher, revokes the whole share and every acceptance of it; terminal. Each project whose acceptance was active gets a `share_revoked` activity entry. As a grantee (`project_id`, or a credential scoped to it), revokes that project's own acceptance, which it may accept again later; while the project's own resources still name the shared resource (see `GET /api/v1/shares/{share_id}/references`), that answers `409 SHARE_IN_USE` unless `force=true`. A publisher's revoke is never refused on that account. Idempotent.
|
|
4251
|
+
*/
|
|
4252
|
+
static revokeShare(options) {
|
|
4253
|
+
return (options.client ?? client).post({
|
|
4254
|
+
url: "/api/v1/shares/{share_id}/revoke",
|
|
4255
|
+
...options,
|
|
4256
|
+
headers: {
|
|
4257
|
+
"Content-Type": "application/json",
|
|
4258
|
+
...options.headers
|
|
4259
|
+
}
|
|
4260
|
+
});
|
|
4261
|
+
}
|
|
4262
|
+
/**
|
|
4263
|
+
* List a grantee's references to a shared resource
|
|
4264
|
+
*
|
|
4265
|
+
* The grantee project's own resources that name the resource the share grants: agents binding a shared tool, pipelines stepping through it, ingestion rules converting with it, orchestrations, triggers and formations naming it. What degrades if the project revokes its acceptance, and what `409 SHARE_IN_USE` lists. The grantee is named by `project_id` or by its scoped credential; the publisher holds none of these and is answered `400`.
|
|
4266
|
+
*/
|
|
4267
|
+
static listShareReferences(options) {
|
|
4268
|
+
return (options.client ?? client).get({
|
|
4269
|
+
url: "/api/v1/shares/{share_id}/references",
|
|
4270
|
+
...options
|
|
4271
|
+
});
|
|
4272
|
+
}
|
|
4273
|
+
/**
|
|
4274
|
+
* List a share's acceptances
|
|
4275
|
+
*
|
|
4276
|
+
* The projects that accepted the share, for its publisher.
|
|
4277
|
+
*/
|
|
4278
|
+
static listShareAcceptances(options) {
|
|
4279
|
+
return (options.client ?? client).get({
|
|
4280
|
+
url: "/api/v1/shares/{share_id}/acceptances",
|
|
4281
|
+
...options
|
|
4282
|
+
});
|
|
4283
|
+
}
|
|
4284
|
+
/**
|
|
4285
|
+
* Revoke an acceptance
|
|
4286
|
+
*
|
|
4287
|
+
* The publisher cutting one consumer. The acceptance is kept with `revoked_by: publisher`, and a new accept from that project answers `403 SHARE_REVOKED` until the publisher deletes it. The project gets a `share_revoked` activity entry if the acceptance was active.
|
|
4288
|
+
*/
|
|
4289
|
+
static revokeShareAcceptance(options) {
|
|
4290
|
+
return (options.client ?? client).post({
|
|
4291
|
+
url: "/api/v1/shares/{share_id}/acceptances/{acceptance_id}/revoke",
|
|
4292
|
+
...options
|
|
4293
|
+
});
|
|
4294
|
+
}
|
|
4295
|
+
/**
|
|
4296
|
+
* Delete an acceptance
|
|
4297
|
+
*
|
|
4298
|
+
* Removes one project's acceptance, which lets a project the publisher revoked accept again. The project gets a `share_revoked` activity entry if the acceptance was active.
|
|
4299
|
+
*/
|
|
4300
|
+
static deleteShareAcceptance(options) {
|
|
4301
|
+
return (options.client ?? client).delete({
|
|
4302
|
+
url: "/api/v1/shares/{share_id}/acceptances/{acceptance_id}",
|
|
4303
|
+
...options
|
|
4304
|
+
});
|
|
4305
|
+
}
|
|
4306
|
+
};
|
|
4143
4307
|
var Tasks = class {
|
|
4144
4308
|
/**
|
|
4145
4309
|
* List tasks
|
|
@@ -4291,7 +4455,7 @@ var Tools = class {
|
|
|
4291
4455
|
/**
|
|
4292
4456
|
* Delete a tool
|
|
4293
4457
|
*
|
|
4294
|
-
* Deletes a tool by ID. A tool that is a decider's backend is refused with `409 TOOL_HAS_DEPENDENTS`.
|
|
4458
|
+
* Deletes a tool by ID. A tool that is a decider's backend is refused with `409 TOOL_HAS_DEPENDENTS`, and so is one another project has accepted a share of, or one of its own project's ingestion rules converts with, until `force=true`. Every share of the tool is revoked when it is deleted; an ingestion rule keeps its `tool_id` and fails the documents it matches with `CONVERTER_FAILED` until repointed.
|
|
4295
4459
|
*/
|
|
4296
4460
|
static deleteTool(options) {
|
|
4297
4461
|
return (options.client ?? client).delete({
|
|
@@ -4302,7 +4466,8 @@ var Tools = class {
|
|
|
4302
4466
|
/**
|
|
4303
4467
|
* Get a tool
|
|
4304
4468
|
*
|
|
4305
|
-
* Returns a single tool by ID.
|
|
4469
|
+
* Returns a single tool by ID. A credential scoped to a project the tool is shared with, through an accepted share, reads its `id`, `name`, `description` and `parameters` only.
|
|
4470
|
+
*
|
|
4306
4471
|
*/
|
|
4307
4472
|
static getTool(options) {
|
|
4308
4473
|
return (options.client ?? client).get({
|
|
@@ -4333,6 +4498,8 @@ var Tools = class {
|
|
|
4333
4498
|
* `preset_parameters` stored on the tool are pinned over the caller-supplied `input` before execution: a key the tool presets keeps its preset value even when `input` sets it. Keys the presets do not name are taken from `input` as sent.
|
|
4334
4499
|
* Guardrails attached to the tool or to its project adjudicate the call before dispatch, composing project + tool scope. A call this route cannot await a decision on — class C (human sign-off), class D, or a class-B tripwire — is refused with `422 TOOL_DISPATCH_FAILED`, whose `meta` carries the `tool_id` and the `outcome`. A `pipeline` tool is adjudicated before its first step runs, and every step is adjudicated as the call of that tool it is.
|
|
4335
4500
|
*
|
|
4501
|
+
* A credential scoped to a project the tool is shared with, through an accepted share, calls it in that project: the calling project's guardrails adjudicate it, it is metered there with `publisher_project_id`, and the tool receives the calling project as the `calling_project_id` tool context key.
|
|
4502
|
+
*
|
|
4336
4503
|
*/
|
|
4337
4504
|
static callTool(options) {
|
|
4338
4505
|
return (options.client ?? client).post({
|
|
@@ -4540,9 +4707,9 @@ var Usage = class {
|
|
|
4540
4707
|
/**
|
|
4541
4708
|
* Get aggregated usage for a project
|
|
4542
4709
|
*
|
|
4543
|
-
* Returns a project's usage rolled up over an optional `[from, to]` time window, optionally bucketed by a single dimension and narrowed by any combination of
|
|
4710
|
+
* Returns a project's usage rolled up over an optional `[from, to]` time window, optionally bucketed by a single dimension and narrowed by any combination of sixteen filters — session, actor, agent, AI provider, orchestration run, orchestration, generation, trace, tool, publisher project, meter type, model, source, trigger, action and outcome. That is how "what did this conversation cost", "what has this end user cost" and "what did this agent cost" are answered. Each group and the grand total carry an `event_count`, summed token counts, a measured `quantity` per component (so infra meters report their real amount, not zeros), and `cost_usd` (null when no event in the bucket was priced). This is the per-project cost-by-range/by-category query — a monthly figure without scanning raw usage events client-side.
|
|
4544
4711
|
*
|
|
4545
|
-
* Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all
|
|
4712
|
+
* Narrowings intersect and apply to the whole rollup — every bucket, `totals` and `totals.distinct` alike — so each composes with any `group_by`, and all sixteen are echoed back under `filters`. The ten naming a resource are resolved against the project (a tool also through an accepted share), and one naming nothing there empties the rollup rather than being dropped: a mistyped id must never read back as the project's whole spend. The other six are matched against the value the event recorded.
|
|
4546
4713
|
*
|
|
4547
4714
|
* `groups` is paginated. Its `total` is the number of distinct buckets in the window — bucket cardinality, including a null bucket for the events the dimension does not apply to, and never a count of entities. To count entities, send `include=distinct` and read `totals.distinct`. `totals` always describes the whole window — never the page above it, and never the bucketing: omit `group_by` and `totals` is unchanged while `groups` is empty.
|
|
4548
4715
|
*
|
|
@@ -5050,6 +5217,7 @@ var SoatClient = class {
|
|
|
5050
5217
|
quotas;
|
|
5051
5218
|
secrets;
|
|
5052
5219
|
sessions;
|
|
5220
|
+
shares;
|
|
5053
5221
|
tasks;
|
|
5054
5222
|
tools;
|
|
5055
5223
|
traces;
|
|
@@ -5100,6 +5268,7 @@ var SoatClient = class {
|
|
|
5100
5268
|
this.quotas = bindResource(Quotas, httpClient);
|
|
5101
5269
|
this.secrets = bindResource(Secrets, httpClient);
|
|
5102
5270
|
this.sessions = bindResource(Sessions, httpClient);
|
|
5271
|
+
this.shares = bindResource(Shares, httpClient);
|
|
5103
5272
|
this.tasks = bindResource(Tasks, httpClient);
|
|
5104
5273
|
this.tools = bindResource(Tools, httpClient);
|
|
5105
5274
|
this.traces = bindResource(Traces, httpClient);
|
|
@@ -5111,4 +5280,4 @@ var SoatClient = class {
|
|
|
5111
5280
|
}
|
|
5112
5281
|
};
|
|
5113
5282
|
//#endregion
|
|
5114
|
-
export { Activity, Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, AuditLog, Chains, Chats, Conversations, Deciders, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Orchestrations, Policies, Projects, Quotas, Secrets, Sessions, SoatClient, Tasks, Tools, Traces, Triggers, Usage, Users, Webhooks, Workflows, createClient, createConfig };
|
|
5283
|
+
export { Activity, Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, AuditLog, Chains, Chats, Conversations, Deciders, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Orchestrations, Policies, Projects, Quotas, Secrets, Sessions, Shares, SoatClient, Tasks, Tools, Traces, Triggers, Usage, Users, Webhooks, Workflows, createClient, createConfig };
|