@naturali/cli 0.122.0 → 0.123.1
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 +152 -6
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region package.json
|
|
17
|
-
var version = "0.
|
|
17
|
+
var version = "0.123.1";
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region ../sdk/src/generated/core/bodySerializer.gen.ts
|
|
20
20
|
const serializeFormDataPair = (data, key, value) => {
|
|
@@ -3560,7 +3560,7 @@ var Projects = class {
|
|
|
3560
3560
|
* List project members
|
|
3561
3561
|
*
|
|
3562
3562
|
* Lists who may act in the project, and with what role. Readable by every member, including a read-only `member`: who else is in the project is not a privileged fact, and hiding it makes "why can that person see my agents?" unanswerable.
|
|
3563
|
-
*
|
|
3563
|
+
* Somebody invited who has never signed in is listed too, with status `pending` — the invitation is already a grant, so hiding it until they arrive would hide access that exists.
|
|
3564
3564
|
*
|
|
3565
3565
|
*/
|
|
3566
3566
|
static listProjectMembers(options) {
|
|
@@ -3570,6 +3570,62 @@ var Projects = class {
|
|
|
3570
3570
|
});
|
|
3571
3571
|
}
|
|
3572
3572
|
/**
|
|
3573
|
+
* Add a project member
|
|
3574
|
+
*
|
|
3575
|
+
* Adds a colleague to the project by email address. Free and uncapped on every plan: a member adds no run, no channel, no trigger and no byte, so every cost they cause is already billed through the project's owner. Members are counted nowhere.
|
|
3576
|
+
*
|
|
3577
|
+
* **The address does not need an account.** Inviting one that has none creates it unverified and records the membership beside it, so the invitee is already a member with status `pending`. Their first sign-in code — which they request themselves, from the link in the invitation — is what makes them `active`. There is no separate acceptance step and no invitation to expire: the address is the credential, and the invitation reached it.
|
|
3578
|
+
*
|
|
3579
|
+
* An `owner` may grant `admin` or `member`; an `admin` may grant `member` only, so administration cannot hand out its own authority. `role: owner` is refused — that is the billing owner, and transferring it is a different act.
|
|
3580
|
+
*
|
|
3581
|
+
* The invitation email is a courtesy, not the grant: if it cannot be sent the membership still stands, and the response still says `pending`. Requires an account-wide credential — a project-scoped key cannot grant access that would outlive its own revocation.
|
|
3582
|
+
*
|
|
3583
|
+
*/
|
|
3584
|
+
static addProjectMember(options) {
|
|
3585
|
+
return (options.client ?? client).post({
|
|
3586
|
+
url: "/v1/projects/{project_id}/members",
|
|
3587
|
+
...options,
|
|
3588
|
+
headers: {
|
|
3589
|
+
"Content-Type": "application/json",
|
|
3590
|
+
...options.headers
|
|
3591
|
+
}
|
|
3592
|
+
});
|
|
3593
|
+
}
|
|
3594
|
+
/**
|
|
3595
|
+
* Remove a project member
|
|
3596
|
+
*
|
|
3597
|
+
* Removes a member, or leaves the project yourself.
|
|
3598
|
+
*
|
|
3599
|
+
* **Anyone may remove themselves**, whatever their role: a colleague who no longer wants access should not have to ask for it, and leaving takes nothing from anybody else. Removing *somebody else* needs authority — an `owner` may remove anyone, an `admin` may remove a read-only `member` and not another `admin`.
|
|
3600
|
+
*
|
|
3601
|
+
* The owner's own row is refused: a project with no owner is unreachable, and the row names who pays.
|
|
3602
|
+
*
|
|
3603
|
+
*/
|
|
3604
|
+
static removeProjectMember(options) {
|
|
3605
|
+
return (options.client ?? client).delete({
|
|
3606
|
+
url: "/v1/projects/{project_id}/members/{member_id}",
|
|
3607
|
+
...options
|
|
3608
|
+
});
|
|
3609
|
+
}
|
|
3610
|
+
/**
|
|
3611
|
+
* Change a member's role
|
|
3612
|
+
*
|
|
3613
|
+
* Moves a member between `admin` and `member`. The project `owner` only: promoting somebody to `admin` hands them every write in the project, and an `admin` who could do that could erase the difference between the two roles for themselves.
|
|
3614
|
+
*
|
|
3615
|
+
* The owner's own row is refused in either direction — it names who pays, so changing it is a transfer rather than a role change.
|
|
3616
|
+
*
|
|
3617
|
+
*/
|
|
3618
|
+
static updateProjectMember(options) {
|
|
3619
|
+
return (options.client ?? client).patch({
|
|
3620
|
+
url: "/v1/projects/{project_id}/members/{member_id}",
|
|
3621
|
+
...options,
|
|
3622
|
+
headers: {
|
|
3623
|
+
"Content-Type": "application/json",
|
|
3624
|
+
...options.headers
|
|
3625
|
+
}
|
|
3626
|
+
});
|
|
3627
|
+
}
|
|
3628
|
+
/**
|
|
3573
3629
|
* Get per-project usage
|
|
3574
3630
|
*
|
|
3575
3631
|
* The per-project meter — the re-billing view (A11/C12/P3). Aggregates the project's usage over an optional [from, to] window, bucketed by a single dimension. Costs are the billing-grade cost_usd the runtime freezes at write time; null means nothing in the bucket was priced (never that it was free). Only managed providers are priced (on the runtime), so cost reflects managed usage; BYOK usage carries no LLM cost.
|
|
@@ -4337,9 +4393,13 @@ var Users = class {
|
|
|
4337
4393
|
*
|
|
4338
4394
|
* 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.
|
|
4339
4395
|
*
|
|
4340
|
-
* **
|
|
4396
|
+
* **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 — 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.
|
|
4341
4397
|
*
|
|
4342
|
-
*
|
|
4398
|
+
* 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.
|
|
4399
|
+
*
|
|
4400
|
+
* **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.
|
|
4401
|
+
*
|
|
4402
|
+
* 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.
|
|
4343
4403
|
*
|
|
4344
4404
|
*/
|
|
4345
4405
|
static getCurrentUserUsage(options) {
|
|
@@ -13418,7 +13478,7 @@ const routes = {
|
|
|
13418
13478
|
"list-project-members": {
|
|
13419
13479
|
serviceClass: "Projects",
|
|
13420
13480
|
operationId: "listProjectMembers",
|
|
13421
|
-
description: "Lists who may act in the project, and with what role. Readable by every member, including a read-only `member`: who else is in the project is not a privileged fact, and hiding it makes \"why can that person see my agents?\" unanswerable.
|
|
13481
|
+
description: "Lists who may act in the project, and with what role. Readable by every member, including a read-only `member`: who else is in the project is not a privileged fact, and hiding it makes \"why can that person see my agents?\" unanswerable. Somebody invited who has never signed in is listed too, with status `pending` — the invitation is already a grant, so hiding it until they arrive would hide access that exists.",
|
|
13422
13482
|
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
|
|
13423
13483
|
httpMethod: "get",
|
|
13424
13484
|
pathParams: ["project_id"],
|
|
@@ -13431,6 +13491,92 @@ const routes = {
|
|
|
13431
13491
|
"in": "path"
|
|
13432
13492
|
}]
|
|
13433
13493
|
},
|
|
13494
|
+
"add-project-member": {
|
|
13495
|
+
serviceClass: "Projects",
|
|
13496
|
+
operationId: "addProjectMember",
|
|
13497
|
+
description: "Adds a colleague to the project by email address. Free and uncapped on every plan: a member adds no run, no channel, no trigger and no byte, so every cost they cause is already billed through the project's owner. Members are counted nowhere. **The address does not need an account.** Inviting one that has none creates it unverified and records the membership beside it, so the invitee is already a member with status `pending`. Their first sign-in code — which they request themselves, from the link in the invitation — is what makes them `active`. There is no separate acceptance step and no invitation to expire: the address is the credential, and the invitation reached it. An `owner` may grant `admin` or `member`; an `admin` may grant `member` only, so administration cannot hand out its own authority. `role: owner` is refused — that is the billing owner, and transferring it is a different act. The invitation email is a courtesy, not the grant: if it cannot be sent the membership still stands, and the response still says `pending`. Requires an account-wide credential — a project-scoped key cannot grant access that would outlive its own revocation.",
|
|
13498
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
|
|
13499
|
+
httpMethod: "post",
|
|
13500
|
+
pathParams: ["project_id"],
|
|
13501
|
+
queryParams: [],
|
|
13502
|
+
flags: [
|
|
13503
|
+
{
|
|
13504
|
+
"name": "project_id",
|
|
13505
|
+
"description": "Project public ID (proj_ prefix).",
|
|
13506
|
+
"required": true,
|
|
13507
|
+
"type": "string",
|
|
13508
|
+
"in": "path"
|
|
13509
|
+
},
|
|
13510
|
+
{
|
|
13511
|
+
"name": "email",
|
|
13512
|
+
"description": "The colleague's address, lower-cased before lookup. It does not need an account yet.\n",
|
|
13513
|
+
"required": true,
|
|
13514
|
+
"type": "string",
|
|
13515
|
+
"in": "body"
|
|
13516
|
+
},
|
|
13517
|
+
{
|
|
13518
|
+
"name": "role",
|
|
13519
|
+
"description": "The roles a membership write may name. `owner` is absent by construction: it is the billing owner, so granting it would change who pays, and transferring that is a different act with its own decision.\n",
|
|
13520
|
+
"required": true,
|
|
13521
|
+
"type": "string",
|
|
13522
|
+
"in": "body"
|
|
13523
|
+
}
|
|
13524
|
+
]
|
|
13525
|
+
},
|
|
13526
|
+
"update-project-member": {
|
|
13527
|
+
serviceClass: "Projects",
|
|
13528
|
+
operationId: "updateProjectMember",
|
|
13529
|
+
description: "Moves a member between `admin` and `member`. The project `owner` only: promoting somebody to `admin` hands them every write in the project, and an `admin` who could do that could erase the difference between the two roles for themselves. The owner's own row is refused in either direction — it names who pays, so changing it is a transfer rather than a role change.",
|
|
13530
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
|
|
13531
|
+
httpMethod: "patch",
|
|
13532
|
+
pathParams: ["project_id", "member_id"],
|
|
13533
|
+
queryParams: [],
|
|
13534
|
+
flags: [
|
|
13535
|
+
{
|
|
13536
|
+
"name": "project_id",
|
|
13537
|
+
"description": "Project public ID (proj_ prefix).",
|
|
13538
|
+
"required": true,
|
|
13539
|
+
"type": "string",
|
|
13540
|
+
"in": "path"
|
|
13541
|
+
},
|
|
13542
|
+
{
|
|
13543
|
+
"name": "member_id",
|
|
13544
|
+
"description": "The membership ID (`pmem_` prefix), not the user ID.",
|
|
13545
|
+
"required": true,
|
|
13546
|
+
"type": "string",
|
|
13547
|
+
"in": "path"
|
|
13548
|
+
},
|
|
13549
|
+
{
|
|
13550
|
+
"name": "role",
|
|
13551
|
+
"description": "The roles a membership write may name. `owner` is absent by construction: it is the billing owner, so granting it would change who pays, and transferring that is a different act with its own decision.\n",
|
|
13552
|
+
"required": true,
|
|
13553
|
+
"type": "string",
|
|
13554
|
+
"in": "body"
|
|
13555
|
+
}
|
|
13556
|
+
]
|
|
13557
|
+
},
|
|
13558
|
+
"remove-project-member": {
|
|
13559
|
+
serviceClass: "Projects",
|
|
13560
|
+
operationId: "removeProjectMember",
|
|
13561
|
+
description: "Removes a member, or leaves the project yourself. **Anyone may remove themselves**, whatever their role: a colleague who no longer wants access should not have to ask for it, and leaving takes nothing from anybody else. Removing *somebody else* needs authority — an `owner` may remove anyone, an `admin` may remove a read-only `member` and not another `admin`. The owner's own row is refused: a project with no owner is unreachable, and the row names who pays.",
|
|
13562
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
|
|
13563
|
+
httpMethod: "delete",
|
|
13564
|
+
pathParams: ["project_id", "member_id"],
|
|
13565
|
+
queryParams: [],
|
|
13566
|
+
flags: [{
|
|
13567
|
+
"name": "project_id",
|
|
13568
|
+
"description": "Project public ID (proj_ prefix).",
|
|
13569
|
+
"required": true,
|
|
13570
|
+
"type": "string",
|
|
13571
|
+
"in": "path"
|
|
13572
|
+
}, {
|
|
13573
|
+
"name": "member_id",
|
|
13574
|
+
"description": "The membership ID (`pmem_` prefix), not the user ID.",
|
|
13575
|
+
"required": true,
|
|
13576
|
+
"type": "string",
|
|
13577
|
+
"in": "path"
|
|
13578
|
+
}]
|
|
13579
|
+
},
|
|
13434
13580
|
"get-project-usage": {
|
|
13435
13581
|
serviceClass: "Projects",
|
|
13436
13582
|
operationId: "getProjectUsage",
|
|
@@ -15665,7 +15811,7 @@ const routes = {
|
|
|
15665
15811
|
"get-current-user-usage": {
|
|
15666
15812
|
serviceClass: "Users",
|
|
15667
15813
|
operationId: "getCurrentUserUsage",
|
|
15668
|
-
description: "How many runs the account has made this billing cycle, and how many its plan includes. A **run is one agent generation** — the unit every rung is priced in. 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. **
|
|
15814
|
+
description: "How many runs the account has made this billing cycle, and how many its plan includes. A **run is one agent generation** — the unit every rung is priced in. 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 — 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.",
|
|
15669
15815
|
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/users",
|
|
15670
15816
|
httpMethod: "get",
|
|
15671
15817
|
pathParams: [],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.123.1",
|
|
4
4
|
"description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tsx": "^4.23.1",
|
|
31
31
|
"typescript": "~6.0.3",
|
|
32
32
|
"vitest": "^4.1.10",
|
|
33
|
-
"@naturali/sdk": "0.
|
|
33
|
+
"@naturali/sdk": "0.123.1"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"generate": "tsx scripts/generate.ts",
|