@naturali/cli 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.
Files changed (2) hide show
  1. package/dist/index.mjs +172 -5
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ var __exportAll = (all, no_symbols) => {
17
17
  };
18
18
  //#endregion
19
19
  //#region package.json
20
- var version = "0.179.0";
20
+ var version = "0.181.0";
21
21
  //#endregion
22
22
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
23
23
  const serializeFormDataPair = (data, key, value) => {
@@ -1162,6 +1162,18 @@ var Admin = class {
1162
1162
  });
1163
1163
  }
1164
1164
  /**
1165
+ * Read a user's usage this billing cycle
1166
+ *
1167
+ * 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.
1168
+ *
1169
+ */
1170
+ static getUserUsage(options) {
1171
+ return (options.client ?? client).get({
1172
+ url: "/v1/admin/users/{user_id}/usage",
1173
+ ...options
1174
+ });
1175
+ }
1176
+ /**
1165
1177
  * Read the global price book
1166
1178
  *
1167
1179
  * 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.
@@ -1779,6 +1791,34 @@ var Assistant = class {
1779
1791
  });
1780
1792
  }
1781
1793
  /**
1794
+ * Delete a conversation
1795
+ *
1796
+ * Deletes one of your conversations and its messages. What its turns cost stays on your usage.
1797
+ *
1798
+ */
1799
+ static deleteAssistantSession(options) {
1800
+ return (options.client ?? client).delete({
1801
+ url: "/v1/assistant/sessions/{session_id}",
1802
+ ...options
1803
+ });
1804
+ }
1805
+ /**
1806
+ * Rename a conversation
1807
+ *
1808
+ * Sets the name the conversation is listed by. A name given before the first message is kept.
1809
+ *
1810
+ */
1811
+ static renameAssistantSession(options) {
1812
+ return (options.client ?? client).patch({
1813
+ url: "/v1/assistant/sessions/{session_id}",
1814
+ ...options,
1815
+ headers: {
1816
+ "Content-Type": "application/json",
1817
+ ...options.headers
1818
+ }
1819
+ });
1820
+ }
1821
+ /**
1782
1822
  * Read a conversation
1783
1823
  *
1784
1824
  * The newest 100 messages of one conversation, oldest first.
@@ -5417,7 +5457,9 @@ var Users = class {
5417
5457
  });
5418
5458
  }
5419
5459
  /**
5420
- * Get the current account's runs this billing cycle
5460
+ * Get the current account's usage this billing cycle
5461
+ *
5462
+ * 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.
5421
5463
  *
5422
5464
  * 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.
5423
5465
  *
@@ -5429,7 +5471,7 @@ var Users = class {
5429
5471
  *
5430
5472
  * **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.
5431
5473
  *
5432
- * 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.
5474
+ * 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.
5433
5475
  *
5434
5476
  */
5435
5477
  static getCurrentUserUsage(options) {
@@ -5439,6 +5481,22 @@ var Users = class {
5439
5481
  });
5440
5482
  }
5441
5483
  /**
5484
+ * List the current account's credit ledger
5485
+ *
5486
+ * 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.
5487
+ *
5488
+ * 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`.
5489
+ *
5490
+ * 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.
5491
+ *
5492
+ */
5493
+ static listCurrentUserCredits(options) {
5494
+ return (options?.client ?? client).get({
5495
+ url: "/v1/users/me/credits",
5496
+ ...options
5497
+ });
5498
+ }
5499
+ /**
5442
5500
  * List what a billing ceiling stopped
5443
5501
  *
5444
5502
  * 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.
@@ -7511,7 +7569,11 @@ const routes = {
7511
7569
  moduleDocsUrl: "https://naturali.ai/docs/modules/admin",
7512
7570
  httpMethod: "get",
7513
7571
  pathParams: ["user_id"],
7514
- queryParams: ["limit", "cursor"],
7572
+ queryParams: [
7573
+ "kind",
7574
+ "limit",
7575
+ "cursor"
7576
+ ],
7515
7577
  headerParams: [],
7516
7578
  cookieParams: [],
7517
7579
  flags: [
@@ -7522,6 +7584,13 @@ const routes = {
7522
7584
  "type": "string",
7523
7585
  "in": "path"
7524
7586
  },
7587
+ {
7588
+ "name": "kind",
7589
+ "description": "Only lines of this kind.",
7590
+ "required": false,
7591
+ "type": "string",
7592
+ "in": "query"
7593
+ },
7525
7594
  {
7526
7595
  "name": "limit",
7527
7596
  "description": "Maximum items per page — an integer from 1 to 100 (default 20).",
@@ -7579,6 +7648,24 @@ const routes = {
7579
7648
  }
7580
7649
  ]
7581
7650
  },
7651
+ "get-user-usage": {
7652
+ serviceClass: "Admin",
7653
+ operationId: "getUserUsage",
7654
+ description: "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.",
7655
+ moduleDocsUrl: "https://naturali.ai/docs/modules/admin",
7656
+ httpMethod: "get",
7657
+ pathParams: ["user_id"],
7658
+ queryParams: [],
7659
+ headerParams: [],
7660
+ cookieParams: [],
7661
+ flags: [{
7662
+ "name": "user_id",
7663
+ "description": "",
7664
+ "required": true,
7665
+ "type": "string",
7666
+ "in": "path"
7667
+ }]
7668
+ },
7582
7669
  "get-admin-price-book": {
7583
7670
  serviceClass: "Admin",
7584
7671
  operationId: "getAdminPriceBook",
@@ -9511,6 +9598,48 @@ const routes = {
9511
9598
  cookieParams: [],
9512
9599
  flags: []
9513
9600
  },
9601
+ "rename-assistant-session": {
9602
+ serviceClass: "Assistant",
9603
+ operationId: "renameAssistantSession",
9604
+ description: "Sets the name the conversation is listed by. A name given before the first message is kept.",
9605
+ moduleDocsUrl: "https://naturali.ai/docs/modules/assistant",
9606
+ httpMethod: "patch",
9607
+ pathParams: ["session_id"],
9608
+ queryParams: [],
9609
+ headerParams: [],
9610
+ cookieParams: [],
9611
+ flags: [{
9612
+ "name": "session_id",
9613
+ "description": "Assistant session ID, as listed.",
9614
+ "required": true,
9615
+ "type": "string",
9616
+ "in": "path"
9617
+ }, {
9618
+ "name": "name",
9619
+ "description": "Trimmed before it is stored.",
9620
+ "required": true,
9621
+ "type": "string",
9622
+ "in": "body"
9623
+ }]
9624
+ },
9625
+ "delete-assistant-session": {
9626
+ serviceClass: "Assistant",
9627
+ operationId: "deleteAssistantSession",
9628
+ description: "Deletes one of your conversations and its messages. What its turns cost stays on your usage.",
9629
+ moduleDocsUrl: "https://naturali.ai/docs/modules/assistant",
9630
+ httpMethod: "delete",
9631
+ pathParams: ["session_id"],
9632
+ queryParams: [],
9633
+ headerParams: [],
9634
+ cookieParams: [],
9635
+ flags: [{
9636
+ "name": "session_id",
9637
+ "description": "Assistant session ID, as listed.",
9638
+ "required": true,
9639
+ "type": "string",
9640
+ "in": "path"
9641
+ }]
9642
+ },
9514
9643
  "list-assistant-session-messages": {
9515
9644
  serviceClass: "Assistant",
9516
9645
  operationId: "listAssistantSessionMessages",
@@ -21206,7 +21335,7 @@ const routes = {
21206
21335
  "get-current-user-usage": {
21207
21336
  serviceClass: "Users",
21208
21337
  operationId: "getCurrentUserUsage",
21209
- description: "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. Counted across the projects this account is the billing owner of, over the current UTC calendar month, from the meter itself. Archived projects are included: the runs they already made were made. **On the `free` plan the allowance is enforced.** An account that has used it is refused `403 plan_limit_reached` with `resource: \"runs\"` on everything that starts a generation and on a direct tool call — on its own provider credential as much as on a managed model, because a run is a run — until the billing month turns or it upgrades. On `pro` and `business` nothing is refused: runs past the allowance are billed at the overage rate those plans are sold with. A contract plan is not counted. The other thing that stops a managed-model generation is a negative credit balance, which is `GET /v1/users/me/billing`, and it never applies to your own credential. **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. 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.",
21338
+ description: "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. 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. Counted across the projects this account is the billing owner of, over the current UTC calendar month, from the meter itself. Archived projects are included: the runs they already made were made. **On the `free` plan the allowance is enforced.** An account that has used it is refused `403 plan_limit_reached` with `resource: \"runs\"` on everything that starts a generation and on a direct tool call — on its own provider credential as much as on a managed model, because a run is a run — until the billing month turns or it upgrades. On `pro` and `business` nothing is refused: runs past the allowance are billed at the overage rate those plans are sold with. A contract plan is not counted. The other thing that stops a managed-model generation is a negative credit balance, which is `GET /v1/users/me/billing`, and it never applies to your own credential. **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. 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.",
21210
21339
  moduleDocsUrl: "https://naturali.ai/docs/modules/users",
21211
21340
  httpMethod: "get",
21212
21341
  pathParams: [],
@@ -21215,6 +21344,44 @@ const routes = {
21215
21344
  cookieParams: [],
21216
21345
  flags: []
21217
21346
  },
21347
+ "list-current-user-credits": {
21348
+ serviceClass: "Users",
21349
+ operationId: "listCurrentUserCredits",
21350
+ description: "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. 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`. 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.",
21351
+ moduleDocsUrl: "https://naturali.ai/docs/modules/users",
21352
+ httpMethod: "get",
21353
+ pathParams: [],
21354
+ queryParams: [
21355
+ "kind",
21356
+ "limit",
21357
+ "cursor"
21358
+ ],
21359
+ headerParams: [],
21360
+ cookieParams: [],
21361
+ flags: [
21362
+ {
21363
+ "name": "kind",
21364
+ "description": "Only lines of this kind.",
21365
+ "required": false,
21366
+ "type": "string",
21367
+ "in": "query"
21368
+ },
21369
+ {
21370
+ "name": "limit",
21371
+ "description": "Maximum items per page — an integer from 1 to 100 (default 20).",
21372
+ "required": false,
21373
+ "type": "integer",
21374
+ "in": "query"
21375
+ },
21376
+ {
21377
+ "name": "cursor",
21378
+ "description": "The `next_cursor` of the previous page.",
21379
+ "required": false,
21380
+ "type": "string",
21381
+ "in": "query"
21382
+ }
21383
+ ]
21384
+ },
21218
21385
  "list-current-user-stops": {
21219
21386
  serviceClass: "Users",
21220
21387
  operationId: "listCurrentUserStops",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.179.0",
3
+ "version": "0.181.0",
4
4
  "description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "keywords": [
6
6
  "naturali",
@@ -31,7 +31,7 @@
31
31
  "yaml": "^2.9.1"
32
32
  },
33
33
  "devDependencies": {
34
- "@naturali/sdk": "0.179.0",
34
+ "@naturali/sdk": "0.181.0",
35
35
  "@ttoss/openapi-codegen": "^0.5.0",
36
36
  "@types/node": "^26.5.1",
37
37
  "tsdown": "^0.23.0",