@naturali/sdk 0.179.0 → 0.181.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.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.
@@ -1758,6 +1770,34 @@ var Assistant = class {
1758
1770
  });
1759
1771
  }
1760
1772
  /**
1773
+ * Delete a conversation
1774
+ *
1775
+ * Deletes one of your conversations and its messages. What its turns cost stays on your usage.
1776
+ *
1777
+ */
1778
+ static deleteAssistantSession(options) {
1779
+ return (options.client ?? client).delete({
1780
+ url: "/v1/assistant/sessions/{session_id}",
1781
+ ...options
1782
+ });
1783
+ }
1784
+ /**
1785
+ * Rename a conversation
1786
+ *
1787
+ * Sets the name the conversation is listed by. A name given before the first message is kept.
1788
+ *
1789
+ */
1790
+ static renameAssistantSession(options) {
1791
+ return (options.client ?? client).patch({
1792
+ url: "/v1/assistant/sessions/{session_id}",
1793
+ ...options,
1794
+ headers: {
1795
+ "Content-Type": "application/json",
1796
+ ...options.headers
1797
+ }
1798
+ });
1799
+ }
1800
+ /**
1761
1801
  * Read a conversation
1762
1802
  *
1763
1803
  * The newest 100 messages of one conversation, oldest first.
@@ -5396,7 +5436,9 @@ var Users = class {
5396
5436
  });
5397
5437
  }
5398
5438
  /**
5399
- * Get the current account's runs this billing cycle
5439
+ * Get the current account's usage this billing cycle
5440
+ *
5441
+ * 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
5442
  *
5401
5443
  * 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
5444
  *
@@ -5408,7 +5450,7 @@ var Users = class {
5408
5450
  *
5409
5451
  * **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
5452
  *
5411
- * 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.
5453
+ * 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
5454
  *
5413
5455
  */
5414
5456
  static getCurrentUserUsage(options) {
@@ -5418,6 +5460,22 @@ var Users = class {
5418
5460
  });
5419
5461
  }
5420
5462
  /**
5463
+ * List the current account's credit ledger
5464
+ *
5465
+ * 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.
5466
+ *
5467
+ * 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`.
5468
+ *
5469
+ * 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.
5470
+ *
5471
+ */
5472
+ static listCurrentUserCredits(options) {
5473
+ return (options?.client ?? client).get({
5474
+ url: "/v1/users/me/credits",
5475
+ ...options
5476
+ });
5477
+ }
5478
+ /**
5421
5479
  * List what a billing ceiling stopped
5422
5480
  *
5423
5481
  * 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.179.0",
3
+ "version": "0.181.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.179.0",
41
+ "@naturali/api": "0.181.0",
42
42
  "@ttoss/openapi-codegen": "^0.5.0",
43
43
  "@types/node": "^26.5.1",
44
44
  "tsdown": "^0.23.0",