@naturali/sdk 0.249.0 → 0.250.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.cjs +4 -222
- package/dist/index.d.cts +32 -1043
- package/dist/index.d.mts +32 -1043
- package/dist/index.mjs +5 -221
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1223,34 +1223,6 @@ var Admin = class {
|
|
|
1223
1223
|
...options
|
|
1224
1224
|
});
|
|
1225
1225
|
}
|
|
1226
|
-
/**
|
|
1227
|
-
* List listings for review
|
|
1228
|
-
*
|
|
1229
|
-
* Every listing in one state, newest first — `in_review` by default, the queue an operator works through.
|
|
1230
|
-
*
|
|
1231
|
-
*/
|
|
1232
|
-
static listAdminListings(options) {
|
|
1233
|
-
return (options?.client ?? client).get({
|
|
1234
|
-
url: "/v1/admin/listings",
|
|
1235
|
-
...options
|
|
1236
|
-
});
|
|
1237
|
-
}
|
|
1238
|
-
/**
|
|
1239
|
-
* Review a listing
|
|
1240
|
-
*
|
|
1241
|
-
* List a listing in review or one that is suspended, send one in review back to `draft`, or suspend any listing. A listing an operator suspends cannot be resumed by its publisher. An invalid move answers `409 invalid_listing_state`.
|
|
1242
|
-
*
|
|
1243
|
-
*/
|
|
1244
|
-
static setAdminListingState(options) {
|
|
1245
|
-
return (options.client ?? client).put({
|
|
1246
|
-
url: "/v1/admin/listings/{listing_id}/state",
|
|
1247
|
-
...options,
|
|
1248
|
-
headers: {
|
|
1249
|
-
"Content-Type": "application/json",
|
|
1250
|
-
...options.headers
|
|
1251
|
-
}
|
|
1252
|
-
});
|
|
1253
|
-
}
|
|
1254
1226
|
};
|
|
1255
1227
|
var Agents = class {
|
|
1256
1228
|
/**
|
|
@@ -3724,60 +3696,6 @@ var IngestionRules = class {
|
|
|
3724
3696
|
});
|
|
3725
3697
|
}
|
|
3726
3698
|
};
|
|
3727
|
-
var Installs = class {
|
|
3728
|
-
/**
|
|
3729
|
-
* List installs
|
|
3730
|
-
*
|
|
3731
|
-
* The listings the project installed, newest first.
|
|
3732
|
-
*/
|
|
3733
|
-
static listInstalls(options) {
|
|
3734
|
-
return (options.client ?? client).get({
|
|
3735
|
-
url: "/v1/projects/{project_id}/installs",
|
|
3736
|
-
...options
|
|
3737
|
-
});
|
|
3738
|
-
}
|
|
3739
|
-
/**
|
|
3740
|
-
* Install a listing
|
|
3741
|
-
*
|
|
3742
|
-
* Install a listing by its id. A listed entry, a draft and a listing in review all install; a suspended one answers `409 listing_suspended`. Installing again answers the existing install.
|
|
3743
|
-
* After the publisher removed this project's access, installing answers `403 install_blocked`.
|
|
3744
|
-
*
|
|
3745
|
-
*/
|
|
3746
|
-
static createInstall(options) {
|
|
3747
|
-
return (options.client ?? client).post({
|
|
3748
|
-
url: "/v1/projects/{project_id}/installs",
|
|
3749
|
-
...options,
|
|
3750
|
-
headers: {
|
|
3751
|
-
"Content-Type": "application/json",
|
|
3752
|
-
...options.headers
|
|
3753
|
-
}
|
|
3754
|
-
});
|
|
3755
|
-
}
|
|
3756
|
-
/**
|
|
3757
|
-
* Uninstall a listing
|
|
3758
|
-
*
|
|
3759
|
-
* Remove the install. While the project's agents, ingestion rules or other resources still name the installed resource, this answers `409 install_in_use` with them in `details.references`; `force=true` uninstalls anyway and those resources stop reaching it.
|
|
3760
|
-
* A `blocked` install, and the install managed conversion uses, answer `403`.
|
|
3761
|
-
*
|
|
3762
|
-
*/
|
|
3763
|
-
static deleteInstall(options) {
|
|
3764
|
-
return (options.client ?? client).delete({
|
|
3765
|
-
url: "/v1/projects/{project_id}/installs/{install_id}",
|
|
3766
|
-
...options
|
|
3767
|
-
});
|
|
3768
|
-
}
|
|
3769
|
-
/**
|
|
3770
|
-
* Get an install
|
|
3771
|
-
*
|
|
3772
|
-
* One of the project's installs.
|
|
3773
|
-
*/
|
|
3774
|
-
static getInstall(options) {
|
|
3775
|
-
return (options.client ?? client).get({
|
|
3776
|
-
url: "/v1/projects/{project_id}/installs/{install_id}",
|
|
3777
|
-
...options
|
|
3778
|
-
});
|
|
3779
|
-
}
|
|
3780
|
-
};
|
|
3781
3699
|
var Knowledge = class {
|
|
3782
3700
|
/**
|
|
3783
3701
|
* Search knowledge
|
|
@@ -3795,135 +3713,6 @@ var Knowledge = class {
|
|
|
3795
3713
|
});
|
|
3796
3714
|
}
|
|
3797
3715
|
};
|
|
3798
|
-
var Listings = class {
|
|
3799
|
-
/**
|
|
3800
|
-
* Browse the marketplace
|
|
3801
|
-
*
|
|
3802
|
-
* Every listed entry, newest first. `interface` is what an installing project sees of the resource, read live from the publisher.
|
|
3803
|
-
*
|
|
3804
|
-
*/
|
|
3805
|
-
static listPublicListings(options) {
|
|
3806
|
-
return (options?.client ?? client).get({
|
|
3807
|
-
url: "/v1/listings",
|
|
3808
|
-
...options
|
|
3809
|
-
});
|
|
3810
|
-
}
|
|
3811
|
-
/**
|
|
3812
|
-
* Get a public listing
|
|
3813
|
-
*
|
|
3814
|
-
* One listed entry. A listing that is not listed answers `404`.
|
|
3815
|
-
*/
|
|
3816
|
-
static getPublicListing(options) {
|
|
3817
|
-
return (options.client ?? client).get({
|
|
3818
|
-
url: "/v1/listings/{listing_id}",
|
|
3819
|
-
...options
|
|
3820
|
-
});
|
|
3821
|
-
}
|
|
3822
|
-
/**
|
|
3823
|
-
* List a project's listings
|
|
3824
|
-
*
|
|
3825
|
-
* The listings the project publishes, newest first.
|
|
3826
|
-
*/
|
|
3827
|
-
static listListings(options) {
|
|
3828
|
-
return (options.client ?? client).get({
|
|
3829
|
-
url: "/v1/projects/{project_id}/listings",
|
|
3830
|
-
...options
|
|
3831
|
-
});
|
|
3832
|
-
}
|
|
3833
|
-
/**
|
|
3834
|
-
* Create a listing
|
|
3835
|
-
*
|
|
3836
|
-
* Publish one of the project's tools or agents as a `draft`. Any project member may publish.
|
|
3837
|
-
* An agent on a naturali model whose model has no price answers `503 model_not_priced`. A resource that does not exist in the project answers `400 resource_not_found`, and one that already has a listing `409 listing_exists`.
|
|
3838
|
-
*
|
|
3839
|
-
*/
|
|
3840
|
-
static createListing(options) {
|
|
3841
|
-
return (options.client ?? client).post({
|
|
3842
|
-
url: "/v1/projects/{project_id}/listings",
|
|
3843
|
-
...options,
|
|
3844
|
-
headers: {
|
|
3845
|
-
"Content-Type": "application/json",
|
|
3846
|
-
...options.headers
|
|
3847
|
-
}
|
|
3848
|
-
});
|
|
3849
|
-
}
|
|
3850
|
-
/**
|
|
3851
|
-
* Delete a listing
|
|
3852
|
-
*
|
|
3853
|
-
* Remove a listing and stop sharing its resource. Refused with `409 listing_has_installs` while any project holds an install, in any state: remove each one first, which takes two deletes of `/installs/{install_id}` for an `active` or `suspended` install. The listing's price stops applying from the next minute, and a later listing of the same resource starts from no price. The tool or agent itself is not touched.
|
|
3854
|
-
*
|
|
3855
|
-
*/
|
|
3856
|
-
static deleteListing(options) {
|
|
3857
|
-
return (options.client ?? client).delete({
|
|
3858
|
-
url: "/v1/projects/{project_id}/listings/{listing_id}",
|
|
3859
|
-
...options
|
|
3860
|
-
});
|
|
3861
|
-
}
|
|
3862
|
-
/**
|
|
3863
|
-
* Get a listing
|
|
3864
|
-
*
|
|
3865
|
-
* One of the project's listings.
|
|
3866
|
-
*/
|
|
3867
|
-
static getListing(options) {
|
|
3868
|
-
return (options.client ?? client).get({
|
|
3869
|
-
url: "/v1/projects/{project_id}/listings/{listing_id}",
|
|
3870
|
-
...options
|
|
3871
|
-
});
|
|
3872
|
-
}
|
|
3873
|
-
/**
|
|
3874
|
-
* Update a listing
|
|
3875
|
-
*
|
|
3876
|
-
* Change the title or description, or pause and resume the listing.
|
|
3877
|
-
* `state: suspended` stops a `listed` listing for every installing project at once; their installs are kept. `state: listed` resumes a listing you suspended, provided naturali had listed it; nobody reinstalls. A listing naturali suspended cannot be resumed here, and an invalid move answers `409 invalid_listing_state`.
|
|
3878
|
-
*
|
|
3879
|
-
*/
|
|
3880
|
-
static updateListing(options) {
|
|
3881
|
-
return (options.client ?? client).patch({
|
|
3882
|
-
url: "/v1/projects/{project_id}/listings/{listing_id}",
|
|
3883
|
-
...options,
|
|
3884
|
-
headers: {
|
|
3885
|
-
"Content-Type": "application/json",
|
|
3886
|
-
...options.headers
|
|
3887
|
-
}
|
|
3888
|
-
});
|
|
3889
|
-
}
|
|
3890
|
-
/**
|
|
3891
|
-
* Submit a listing for review
|
|
3892
|
-
*
|
|
3893
|
-
* Move a `draft` listing to `in_review`. naturali lists it in the marketplace or sends it back to `draft`. Any other state answers `409 invalid_listing_state`.
|
|
3894
|
-
*
|
|
3895
|
-
*/
|
|
3896
|
-
static submitListing(options) {
|
|
3897
|
-
return (options.client ?? client).post({
|
|
3898
|
-
url: "/v1/projects/{project_id}/listings/{listing_id}:submit",
|
|
3899
|
-
...options
|
|
3900
|
-
});
|
|
3901
|
-
}
|
|
3902
|
-
/**
|
|
3903
|
-
* List a listing's installs
|
|
3904
|
-
*
|
|
3905
|
-
* Each project that installed the listing, with its usage this billing cycle as last sampled. Never the content of a call.
|
|
3906
|
-
*
|
|
3907
|
-
*/
|
|
3908
|
-
static listListingInstalls(options) {
|
|
3909
|
-
return (options.client ?? client).get({
|
|
3910
|
-
url: "/v1/projects/{project_id}/listings/{listing_id}/installs",
|
|
3911
|
-
...options
|
|
3912
|
-
});
|
|
3913
|
-
}
|
|
3914
|
-
/**
|
|
3915
|
-
* Remove a project's install
|
|
3916
|
-
*
|
|
3917
|
-
* Cut one installing project off. An `active` or `suspended` install becomes `blocked`, and that project cannot install the listing again. Deleting a `blocked` install removes it, which lets that project install again.
|
|
3918
|
-
*
|
|
3919
|
-
*/
|
|
3920
|
-
static deleteListingInstall(options) {
|
|
3921
|
-
return (options.client ?? client).delete({
|
|
3922
|
-
url: "/v1/projects/{project_id}/listings/{listing_id}/installs/{install_id}",
|
|
3923
|
-
...options
|
|
3924
|
-
});
|
|
3925
|
-
}
|
|
3926
|
-
};
|
|
3927
3716
|
var McpServers = class {
|
|
3928
3717
|
/**
|
|
3929
3718
|
* List MCP servers
|
|
@@ -3939,7 +3728,7 @@ var McpServers = class {
|
|
|
3939
3728
|
/**
|
|
3940
3729
|
* Create an MCP server
|
|
3941
3730
|
*
|
|
3942
|
-
* Each item of `tools` is checked against the tool it names: the project's
|
|
3731
|
+
* Each item of `tools` is checked against the tool it names: one of the project's, else `400`. `action` is required, and must be one of the tool's available actions, when the tool declares `actions`; otherwise it is ignored and stored as `null`. A tool whose definition reads `{{context:naturali_caller_…}}` is refused unless `auth.type` is `oauth`.
|
|
3943
3732
|
* `daily_call_limit` is required when `auth` is `none`.
|
|
3944
3733
|
*
|
|
3945
3734
|
*/
|
|
@@ -5426,10 +5215,11 @@ var Projects = class {
|
|
|
5426
5215
|
/**
|
|
5427
5216
|
* Update a project
|
|
5428
5217
|
*
|
|
5429
|
-
* Rename or archive a project, and/or change its content-retention settings (`trace_content_retention_days`, `trace_content_mode`), its execution ceilings (`max_concurrent_runs`, `max_chain_generations`, `max_orchestration_run_depth`), its priced-model gate (`require_priced_model`), its project-scope guardrails (`guardrail_ids`) and managed conversion (`managed_conversion`). Archiving is reversible; resources are retained.
|
|
5218
|
+
* Rename or archive a project, and/or change its content-retention settings (`trace_content_retention_days`, `trace_content_mode`), its execution ceilings (`max_concurrent_runs`, `max_chain_generations`, `max_orchestration_run_depth`), its priced-model gate (`require_priced_model`), its project-scope guardrails (`guardrail_ids`), the policies capping every agent turn in it (`agent_policy_ids`) and managed conversion (`managed_conversion`). Archiving is reversible; resources are retained.
|
|
5430
5219
|
* Requires the `admin` role in the project (an `owner` has it too). These are the terms every member works under, which is why setting them sits above the role that works under them.
|
|
5431
5220
|
* The ceilings and the priced-model gate are uncapped by plan: each one only ever narrows what the project may spend, so setting one takes on a restriction rather than claiming an entitlement. On the three ceilings `null` clears the project's own bound and omission leaves it alone — they are different instructions.
|
|
5432
5221
|
* `guardrail_ids` is the floor under every tool call by every agent in the project, including tools added later. The list is replaced wholesale, so send the ids you want to keep; `[]` detaches every one. An id naming no guardrail in the project responds `400` with `guardrail_not_found`, whose `details.missing` lists the ids. It is uncapped by plan, like the ceilings: a guardrail can only tighten what runs.
|
|
5222
|
+
* `agent_policy_ids` caps every turn of every agent the project owns: an action they deny is refused even where the agent's own `policy_ids` allow it, and the refusal's `meta.denied_by` is `{ type: project, id: <project_id> }`. `null` or `[]` removes the cap. The credential must hold every grant the policies carry, else `403` with `POLICY_GRANT_NOT_HELD`; an id naming no policy responds `400` with `POLICY_NOT_FOUND`, and a policy of another project `400` with `POLICY_OUTSIDE_PROJECT`.
|
|
5433
5223
|
* The two retention controls answer different questions. The window bounds how long content *stays* — a daily sweep purges anything past it, leaving auditable skeletons behind. `trace_content_mode: none` means content is never *written*, which is the stronger guarantee: it cannot be missed by a sweep or survive in a backup.
|
|
5434
5224
|
*
|
|
5435
5225
|
* Your plan sets the longest window you may keep content for. A wider one — `null` included, which keeps content indefinitely — responds `403` with `plan_limit_reached`, whose `details` carry the `plan` and the `limit` in days. Anything shorter is always allowed. Moving to a plan with a shorter window takes effect at the end of the billing cycle, and content already stored is then purged by age like everything else.
|
|
@@ -6536,8 +6326,6 @@ var Users = class {
|
|
|
6536
6326
|
*
|
|
6537
6327
|
* 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`.
|
|
6538
6328
|
*
|
|
6539
|
-
* 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.
|
|
6540
|
-
*
|
|
6541
6329
|
*/
|
|
6542
6330
|
static listCurrentUserCredits(options) {
|
|
6543
6331
|
return (options?.client ?? client).get({
|
|
@@ -6550,7 +6338,7 @@ var Users = class {
|
|
|
6550
6338
|
*
|
|
6551
6339
|
* 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.
|
|
6552
6340
|
*
|
|
6553
|
-
* `blocked_by` names the ceiling still closed: while it is set, nothing can be restored. Top up for `debt`; upgrade or wait for the month to turn for `run_allowance`. A
|
|
6341
|
+
* `blocked_by` names the ceiling still closed: while it is set, nothing can be restored. Top up for `debt`; upgrade or wait for the month to turn for `run_allowance`. A project-confined key sees its own project's stops only.
|
|
6554
6342
|
*
|
|
6555
6343
|
*/
|
|
6556
6344
|
static listCurrentUserStops(options) {
|
|
@@ -7071,9 +6859,7 @@ var NaturaliClient = class {
|
|
|
7071
6859
|
generations;
|
|
7072
6860
|
guardrails;
|
|
7073
6861
|
ingestionRules;
|
|
7074
|
-
installs;
|
|
7075
6862
|
knowledge;
|
|
7076
|
-
listings;
|
|
7077
6863
|
mcpServers;
|
|
7078
6864
|
memories;
|
|
7079
6865
|
memoryRules;
|
|
@@ -7132,9 +6918,7 @@ var NaturaliClient = class {
|
|
|
7132
6918
|
this.generations = bindResource(Generations, this.http);
|
|
7133
6919
|
this.guardrails = bindResource(Guardrails, this.http);
|
|
7134
6920
|
this.ingestionRules = bindResource(IngestionRules, this.http);
|
|
7135
|
-
this.installs = bindResource(Installs, this.http);
|
|
7136
6921
|
this.knowledge = bindResource(Knowledge, this.http);
|
|
7137
|
-
this.listings = bindResource(Listings, this.http);
|
|
7138
6922
|
this.mcpServers = bindResource(McpServers, this.http);
|
|
7139
6923
|
this.memories = bindResource(Memories, this.http);
|
|
7140
6924
|
this.memoryRules = bindResource(MemoryRules, this.http);
|
|
@@ -7186,9 +6970,7 @@ exports.Formations = Formations;
|
|
|
7186
6970
|
exports.Generations = Generations;
|
|
7187
6971
|
exports.Guardrails = Guardrails;
|
|
7188
6972
|
exports.IngestionRules = IngestionRules;
|
|
7189
|
-
exports.Installs = Installs;
|
|
7190
6973
|
exports.Knowledge = Knowledge;
|
|
7191
|
-
exports.Listings = Listings;
|
|
7192
6974
|
exports.McpServers = McpServers;
|
|
7193
6975
|
exports.Memories = Memories;
|
|
7194
6976
|
exports.MemoryRules = MemoryRules;
|