@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.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.
@@ -1759,6 +1771,34 @@ var Assistant = class {
1759
1771
  });
1760
1772
  }
1761
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
+ /**
1762
1802
  * Read a conversation
1763
1803
  *
1764
1804
  * The newest 100 messages of one conversation, oldest first.
@@ -5397,7 +5437,9 @@ var Users = class {
5397
5437
  });
5398
5438
  }
5399
5439
  /**
5400
- * Get the current account's runs this billing cycle
5440
+ * Get the current account's usage this billing cycle
5441
+ *
5442
+ * 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
5443
  *
5402
5444
  * 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
5445
  *
@@ -5409,7 +5451,7 @@ var Users = class {
5409
5451
  *
5410
5452
  * **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
5453
  *
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.
5454
+ * 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
5455
  *
5414
5456
  */
5415
5457
  static getCurrentUserUsage(options) {
@@ -5419,6 +5461,22 @@ var Users = class {
5419
5461
  });
5420
5462
  }
5421
5463
  /**
5464
+ * List the current account's credit ledger
5465
+ *
5466
+ * 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.
5467
+ *
5468
+ * 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`.
5469
+ *
5470
+ * 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.
5471
+ *
5472
+ */
5473
+ static listCurrentUserCredits(options) {
5474
+ return (options?.client ?? client).get({
5475
+ url: "/v1/users/me/credits",
5476
+ ...options
5477
+ });
5478
+ }
5479
+ /**
5422
5480
  * List what a billing ceiling stopped
5423
5481
  *
5424
5482
  * 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.