@naturali/sdk 0.180.0 → 0.182.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 -5
- package/dist/index.d.cts +664 -160
- package/dist/index.d.mts +664 -160
- package/dist/index.mjs +108 -5
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1141,6 +1141,18 @@ var Admin = class {
|
|
|
1141
1141
|
});
|
|
1142
1142
|
}
|
|
1143
1143
|
/**
|
|
1144
|
+
* Read a user's usage this billing cycle
|
|
1145
|
+
*
|
|
1146
|
+
* The same answer `GET /v1/users/me/usage` gives the account itself: runs, indexed storage and the plan-capped counts, per project and against the rung. Needs the `admin` role.
|
|
1147
|
+
*
|
|
1148
|
+
*/
|
|
1149
|
+
static getUserUsage(options) {
|
|
1150
|
+
return (options.client ?? client).get({
|
|
1151
|
+
url: "/v1/admin/users/{user_id}/usage",
|
|
1152
|
+
...options
|
|
1153
|
+
});
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1144
1156
|
* Read the global price book
|
|
1145
1157
|
*
|
|
1146
1158
|
* The upstream runtime's global default prices — the rows carrying neither a provider nor a project, which is all the upstream listing returns, so no tenant's own rates appear here.
|
|
@@ -1484,6 +1496,7 @@ var AiProviders = class {
|
|
|
1484
1496
|
* 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 — IAM keys or a Bedrock API key, a Google service-account key. A record with no `secret_id` would fall back to the server's own credentials (the AWS default credential chain, Google Application Default Credentials); it can list only on a deployment that allows a record to use them, and returns `400 AI_PROVIDER_MISCONFIGURED` otherwise.
|
|
1485
1497
|
* 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: the publisher-model listing rejects API keys and needs a credential that asserts a principal, so it returns `400 MODEL_LISTING_UNSUPPORTED`.
|
|
1486
1498
|
* The Vertex answer is the publisher catalogue the record's `config.location` region serves. The project behind the credential is billed and quota'd for the call but does not filter the result, so a listed model may still be unavailable to that project at generation time.
|
|
1499
|
+
* The provider answers its whole catalogue in one call; `q`, `limit` and `offset` narrow and page what it returned. A request without `limit` gets the first 50 models.
|
|
1487
1500
|
*
|
|
1488
1501
|
*/
|
|
1489
1502
|
static listAiProviderModels(options) {
|
|
@@ -1758,6 +1771,34 @@ var Assistant = class {
|
|
|
1758
1771
|
});
|
|
1759
1772
|
}
|
|
1760
1773
|
/**
|
|
1774
|
+
* Delete a conversation
|
|
1775
|
+
*
|
|
1776
|
+
* Deletes one of your conversations and its messages. What its turns cost stays on your usage.
|
|
1777
|
+
*
|
|
1778
|
+
*/
|
|
1779
|
+
static deleteAssistantSession(options) {
|
|
1780
|
+
return (options.client ?? client).delete({
|
|
1781
|
+
url: "/v1/assistant/sessions/{session_id}",
|
|
1782
|
+
...options
|
|
1783
|
+
});
|
|
1784
|
+
}
|
|
1785
|
+
/**
|
|
1786
|
+
* Rename a conversation
|
|
1787
|
+
*
|
|
1788
|
+
* Sets the name the conversation is listed by. A name given before the first message is kept.
|
|
1789
|
+
*
|
|
1790
|
+
*/
|
|
1791
|
+
static renameAssistantSession(options) {
|
|
1792
|
+
return (options.client ?? client).patch({
|
|
1793
|
+
url: "/v1/assistant/sessions/{session_id}",
|
|
1794
|
+
...options,
|
|
1795
|
+
headers: {
|
|
1796
|
+
"Content-Type": "application/json",
|
|
1797
|
+
...options.headers
|
|
1798
|
+
}
|
|
1799
|
+
});
|
|
1800
|
+
}
|
|
1801
|
+
/**
|
|
1761
1802
|
* Read a conversation
|
|
1762
1803
|
*
|
|
1763
1804
|
* The newest 100 messages of one conversation, oldest first.
|
|
@@ -3234,6 +3275,18 @@ var Generations = class {
|
|
|
3234
3275
|
});
|
|
3235
3276
|
}
|
|
3236
3277
|
/**
|
|
3278
|
+
* List the memory writes a generation made
|
|
3279
|
+
*
|
|
3280
|
+
* Every memory write this turn made, oldest first: each memory rule's firings and the agent's own `write_memory` calls alike. The rows behind the generation's per-rule `extraction` counts. Reading them is reading the generation (`generations:GetGeneration`).
|
|
3281
|
+
*
|
|
3282
|
+
*/
|
|
3283
|
+
static listGenerationMemoryAssertions(options) {
|
|
3284
|
+
return (options.client ?? client).get({
|
|
3285
|
+
url: "/v1/projects/{project_id}/generations/{generation_id}/memory-assertions",
|
|
3286
|
+
...options
|
|
3287
|
+
});
|
|
3288
|
+
}
|
|
3289
|
+
/**
|
|
3237
3290
|
* Get a generation's transcript
|
|
3238
3291
|
*
|
|
3239
3292
|
* 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.
|
|
@@ -4182,8 +4235,8 @@ var Orchestrations = class {
|
|
|
4182
4235
|
/**
|
|
4183
4236
|
* Get orchestration queue stats
|
|
4184
4237
|
*
|
|
4185
|
-
* Returns a point-in-time snapshot of the orchestration run queue: how many tasks are waiting to be claimed (`queue_depth`), how many are currently claimed with a valid lease (`claimed_tasks`), the age of the oldest waiting task, recent claim-latency percentiles over a rolling in-process window
|
|
4186
|
-
* Every figure is scoped to what the caller may see. A project-scoped caller gets `
|
|
4238
|
+
* Returns a point-in-time snapshot of the orchestration run queue: how many tasks are waiting to be claimed (`queue_depth`), how many are currently claimed with a valid lease (`claimed_tasks`), the age of the oldest waiting task, recent claim-latency percentiles over a rolling in-process window. The per-project breakdown is listed by `GET /v1/projects/{project_id}/orchestrations/queue/stats/projects`. Intended for admin/operator policies; guarded by `orchestrations:GetQueueStats`.
|
|
4239
|
+
* Every figure is scoped to what the caller may see. A project-scoped caller gets `queue_depth` and `claimed_tasks` summed over their own projects, and `null` for `oldest_queued_age_seconds` and the `claim_latency_ms` percentiles — both describe the whole deployment and cannot be narrowed, so they are withheld rather than approximated. An unrestricted caller (the action granted on every project) gets the deployment-wide figures.
|
|
4187
4240
|
*
|
|
4188
4241
|
*/
|
|
4189
4242
|
static getQueueStats(options) {
|
|
@@ -4202,6 +4255,27 @@ var Orchestrations = class {
|
|
|
4202
4255
|
});
|
|
4203
4256
|
}
|
|
4204
4257
|
/**
|
|
4258
|
+
* List the projects with queued orchestration work
|
|
4259
|
+
*
|
|
4260
|
+
* One row per project with any queued or claimed task, ordered by project ID: the per-project breakdown of `GET /v1/projects/{project_id}/orchestrations/queue/stats`. A project-scoped caller sees its own projects only. Guarded by `orchestrations:GetQueueStats`.
|
|
4261
|
+
*
|
|
4262
|
+
*/
|
|
4263
|
+
static listQueueStatsProjects(options) {
|
|
4264
|
+
return (options.client ?? client).get({
|
|
4265
|
+
security: [{
|
|
4266
|
+
key: "bearerAuth",
|
|
4267
|
+
scheme: "bearer",
|
|
4268
|
+
type: "http"
|
|
4269
|
+
}, {
|
|
4270
|
+
key: "oauth2",
|
|
4271
|
+
scheme: "bearer",
|
|
4272
|
+
type: "http"
|
|
4273
|
+
}],
|
|
4274
|
+
url: "/v1/projects/{project_id}/orchestrations/queue/stats/projects",
|
|
4275
|
+
...options
|
|
4276
|
+
});
|
|
4277
|
+
}
|
|
4278
|
+
/**
|
|
4205
4279
|
* Delete an orchestration
|
|
4206
4280
|
*
|
|
4207
4281
|
* Deletes an orchestration definition and all its runs.
|
|
@@ -4375,6 +4449,17 @@ var Orchestrations = class {
|
|
|
4375
4449
|
...options
|
|
4376
4450
|
});
|
|
4377
4451
|
}
|
|
4452
|
+
/**
|
|
4453
|
+
* List a run's node executions
|
|
4454
|
+
*
|
|
4455
|
+
* The run's per-node execution records, oldest first: one per node attempt, retries and skipped nodes included. Each captures the resolved input, output, status and error of that attempt — the orchestration analogue of an LLM trace. Reading them is reading the run (`orchestrations:GetRun`).
|
|
4456
|
+
*/
|
|
4457
|
+
static listOrchestrationRunNodeExecutions(options) {
|
|
4458
|
+
return (options.client ?? client).get({
|
|
4459
|
+
url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/node-executions",
|
|
4460
|
+
...options
|
|
4461
|
+
});
|
|
4462
|
+
}
|
|
4378
4463
|
};
|
|
4379
4464
|
var Projects = class {
|
|
4380
4465
|
/**
|
|
@@ -5196,7 +5281,7 @@ var Traces = class {
|
|
|
5196
5281
|
/**
|
|
5197
5282
|
* Get trace tree
|
|
5198
5283
|
*
|
|
5199
|
-
* Returns the full execution tree rooted at the given trace (or its root if the given trace is a child). Each node represents one agent's execution session. The `children` array contains traces triggered by sub-agent tool calls from that trace.
|
|
5284
|
+
* Returns the full execution tree rooted at the given trace (or its root if the given trace is a child). Each node represents one agent's execution session. The `children` array contains traces triggered by sub-agent tool calls from that trace. A node's generations are listed by `GET /v1/projects/{project_id}/generations?trace_id=`, and a node's direct children page by `GET /v1/projects/{project_id}/traces?parent_trace_id=`.
|
|
5200
5285
|
*
|
|
5201
5286
|
*/
|
|
5202
5287
|
static getTraceTree(options) {
|
|
@@ -5396,7 +5481,9 @@ var Users = class {
|
|
|
5396
5481
|
});
|
|
5397
5482
|
}
|
|
5398
5483
|
/**
|
|
5399
|
-
* Get the current account's
|
|
5484
|
+
* Get the current account's usage this billing cycle
|
|
5485
|
+
*
|
|
5486
|
+
* What the account uses this billing cycle, per project and against its plan: runs, indexed storage, and the counts the plan caps — projects, active channels and triggers.
|
|
5400
5487
|
*
|
|
5401
5488
|
* How many runs the account has made this billing cycle, and how many its plan includes. A **run is one agent generation or one tool call** — the unit every rung is priced in. Every tool call counts, including those an agent makes inside a generation; a `client` tool counts nothing.
|
|
5402
5489
|
*
|
|
@@ -5408,7 +5495,7 @@ var Users = class {
|
|
|
5408
5495
|
*
|
|
5409
5496
|
* **This route counts live; the refusal reads a figure counted every few minutes.** So the two can differ by a burst: this is the more current number, and a refusal quotes the one it actually enforced.
|
|
5410
5497
|
*
|
|
5411
|
-
* It is also more expensive than the balance read: it
|
|
5498
|
+
* It is also more expensive than the balance read: it reads the runtime several times per project. Poll it on the order of minutes, not seconds. A figure that could not be read is `null` rather than failing the request.
|
|
5412
5499
|
*
|
|
5413
5500
|
*/
|
|
5414
5501
|
static getCurrentUserUsage(options) {
|
|
@@ -5418,6 +5505,22 @@ var Users = class {
|
|
|
5418
5505
|
});
|
|
5419
5506
|
}
|
|
5420
5507
|
/**
|
|
5508
|
+
* List the current account's credit ledger
|
|
5509
|
+
*
|
|
5510
|
+
* A cursor page of the account's model-credit ledger, newest first, with the balance the whole ledger sums to. The ledger is append-only: a correction is a new line, never an edit.
|
|
5511
|
+
*
|
|
5512
|
+
* A `usage` line is managed model spend, written as the meter is reconciled every 15 minutes per project, so the ledger grows by a line per project per window that spent anything. Filter with `kind`.
|
|
5513
|
+
*
|
|
5514
|
+
* The other side of a marketplace line is another account's project, so a `fee` or `earned` line names the cycle it settles, not that project.
|
|
5515
|
+
*
|
|
5516
|
+
*/
|
|
5517
|
+
static listCurrentUserCredits(options) {
|
|
5518
|
+
return (options?.client ?? client).get({
|
|
5519
|
+
url: "/v1/users/me/credits",
|
|
5520
|
+
...options
|
|
5521
|
+
});
|
|
5522
|
+
}
|
|
5523
|
+
/**
|
|
5421
5524
|
* List what a billing ceiling stopped
|
|
5422
5525
|
*
|
|
5423
5526
|
* Schedule triggers, eval runs, orchestration runs and workflow tasks the platform stopped on this account's projects because the credit balance went below zero or a Free plan's runs ran out, and that have not been restored or dismissed yet. Newest first.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.182.0",
|
|
4
4
|
"description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"naturali",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@hey-api/openapi-ts": "^0.99.0",
|
|
41
|
-
"@naturali/api": "0.
|
|
41
|
+
"@naturali/api": "0.182.0",
|
|
42
42
|
"@ttoss/openapi-codegen": "^0.5.0",
|
|
43
43
|
"@types/node": "^26.5.1",
|
|
44
44
|
"tsdown": "^0.23.0",
|