@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 CHANGED
@@ -1142,6 +1142,18 @@ var Admin = class {
1142
1142
  });
1143
1143
  }
1144
1144
  /**
1145
+ * Read a user's usage this billing cycle
1146
+ *
1147
+ * 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.
1148
+ *
1149
+ */
1150
+ static getUserUsage(options) {
1151
+ return (options.client ?? client).get({
1152
+ url: "/v1/admin/users/{user_id}/usage",
1153
+ ...options
1154
+ });
1155
+ }
1156
+ /**
1145
1157
  * Read the global price book
1146
1158
  *
1147
1159
  * 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.
@@ -1485,6 +1497,7 @@ var AiProviders = class {
1485
1497
  * 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.
1486
1498
  * 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`.
1487
1499
  * 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.
1500
+ * 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.
1488
1501
  *
1489
1502
  */
1490
1503
  static listAiProviderModels(options) {
@@ -1759,6 +1772,34 @@ var Assistant = class {
1759
1772
  });
1760
1773
  }
1761
1774
  /**
1775
+ * Delete a conversation
1776
+ *
1777
+ * Deletes one of your conversations and its messages. What its turns cost stays on your usage.
1778
+ *
1779
+ */
1780
+ static deleteAssistantSession(options) {
1781
+ return (options.client ?? client).delete({
1782
+ url: "/v1/assistant/sessions/{session_id}",
1783
+ ...options
1784
+ });
1785
+ }
1786
+ /**
1787
+ * Rename a conversation
1788
+ *
1789
+ * Sets the name the conversation is listed by. A name given before the first message is kept.
1790
+ *
1791
+ */
1792
+ static renameAssistantSession(options) {
1793
+ return (options.client ?? client).patch({
1794
+ url: "/v1/assistant/sessions/{session_id}",
1795
+ ...options,
1796
+ headers: {
1797
+ "Content-Type": "application/json",
1798
+ ...options.headers
1799
+ }
1800
+ });
1801
+ }
1802
+ /**
1762
1803
  * Read a conversation
1763
1804
  *
1764
1805
  * The newest 100 messages of one conversation, oldest first.
@@ -3235,6 +3276,18 @@ var Generations = class {
3235
3276
  });
3236
3277
  }
3237
3278
  /**
3279
+ * List the memory writes a generation made
3280
+ *
3281
+ * 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`).
3282
+ *
3283
+ */
3284
+ static listGenerationMemoryAssertions(options) {
3285
+ return (options.client ?? client).get({
3286
+ url: "/v1/projects/{project_id}/generations/{generation_id}/memory-assertions",
3287
+ ...options
3288
+ });
3289
+ }
3290
+ /**
3238
3291
  * Get a generation's transcript
3239
3292
  *
3240
3293
  * 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.
@@ -4183,8 +4236,8 @@ var Orchestrations = class {
4183
4236
  /**
4184
4237
  * Get orchestration queue stats
4185
4238
  *
4186
- * 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, and a per-project breakdown. Intended for admin/operator policies; guarded by `orchestrations:GetQueueStats`.
4187
- * Every figure is scoped to what the caller may see. A project-scoped caller gets `per_project` for their own projects only, `queue_depth` and `claimed_tasks` summed over those same 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.
4239
+ * 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`.
4240
+ * 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.
4188
4241
  *
4189
4242
  */
4190
4243
  static getQueueStats(options) {
@@ -4203,6 +4256,27 @@ var Orchestrations = class {
4203
4256
  });
4204
4257
  }
4205
4258
  /**
4259
+ * List the projects with queued orchestration work
4260
+ *
4261
+ * 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`.
4262
+ *
4263
+ */
4264
+ static listQueueStatsProjects(options) {
4265
+ return (options.client ?? client).get({
4266
+ security: [{
4267
+ key: "bearerAuth",
4268
+ scheme: "bearer",
4269
+ type: "http"
4270
+ }, {
4271
+ key: "oauth2",
4272
+ scheme: "bearer",
4273
+ type: "http"
4274
+ }],
4275
+ url: "/v1/projects/{project_id}/orchestrations/queue/stats/projects",
4276
+ ...options
4277
+ });
4278
+ }
4279
+ /**
4206
4280
  * Delete an orchestration
4207
4281
  *
4208
4282
  * Deletes an orchestration definition and all its runs.
@@ -4376,6 +4450,17 @@ var Orchestrations = class {
4376
4450
  ...options
4377
4451
  });
4378
4452
  }
4453
+ /**
4454
+ * List a run's node executions
4455
+ *
4456
+ * 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`).
4457
+ */
4458
+ static listOrchestrationRunNodeExecutions(options) {
4459
+ return (options.client ?? client).get({
4460
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/node-executions",
4461
+ ...options
4462
+ });
4463
+ }
4379
4464
  };
4380
4465
  var Projects = class {
4381
4466
  /**
@@ -5197,7 +5282,7 @@ var Traces = class {
5197
5282
  /**
5198
5283
  * Get trace tree
5199
5284
  *
5200
- * 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.
5285
+ * 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=`.
5201
5286
  *
5202
5287
  */
5203
5288
  static getTraceTree(options) {
@@ -5397,7 +5482,9 @@ var Users = class {
5397
5482
  });
5398
5483
  }
5399
5484
  /**
5400
- * Get the current account's runs this billing cycle
5485
+ * Get the current account's usage this billing cycle
5486
+ *
5487
+ * 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.
5401
5488
  *
5402
5489
  * 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.
5403
5490
  *
@@ -5409,7 +5496,7 @@ var Users = class {
5409
5496
  *
5410
5497
  * **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.
5411
5498
  *
5412
- * It is also more expensive than the balance read: it asks the meter once per project. Poll it on the order of minutes, not seconds.
5499
+ * 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.
5413
5500
  *
5414
5501
  */
5415
5502
  static getCurrentUserUsage(options) {
@@ -5419,6 +5506,22 @@ var Users = class {
5419
5506
  });
5420
5507
  }
5421
5508
  /**
5509
+ * List the current account's credit ledger
5510
+ *
5511
+ * 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.
5512
+ *
5513
+ * 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`.
5514
+ *
5515
+ * 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.
5516
+ *
5517
+ */
5518
+ static listCurrentUserCredits(options) {
5519
+ return (options?.client ?? client).get({
5520
+ url: "/v1/users/me/credits",
5521
+ ...options
5522
+ });
5523
+ }
5524
+ /**
5422
5525
  * List what a billing ceiling stopped
5423
5526
  *
5424
5527
  * 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.