@naturali/sdk 0.154.0 → 0.155.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 +149 -1
- package/dist/index.d.cts +885 -135
- package/dist/index.d.mts +885 -135
- package/dist/index.mjs +149 -2
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1983,6 +1983,151 @@ var Conversations = class {
|
|
|
1983
1983
|
});
|
|
1984
1984
|
}
|
|
1985
1985
|
};
|
|
1986
|
+
var Deciders = class {
|
|
1987
|
+
/**
|
|
1988
|
+
* List deciders
|
|
1989
|
+
*
|
|
1990
|
+
* Returns the deciders defined in a project, newest first.
|
|
1991
|
+
*/
|
|
1992
|
+
static listDeciders(options) {
|
|
1993
|
+
return (options.client ?? client).get({
|
|
1994
|
+
url: "/v1/projects/{project_id}/deciders",
|
|
1995
|
+
...options
|
|
1996
|
+
});
|
|
1997
|
+
}
|
|
1998
|
+
/**
|
|
1999
|
+
* Create a decider
|
|
2000
|
+
*
|
|
2001
|
+
* Creates a decider at version 1: a named question set and the backend that answers it, exactly one of `agent_id` and `tool_id`. Every question declares a finite answer space, validated here. The backend must be in the decider's project. An agent must carry no tool surface — no tool binding left active by `active_tool_ids` and no `knowledge_config.write_memory_store_id` — or the create is refused with `400 DECIDER_AGENT_NOT_TOOL_LESS`. A tool must be `http` or `pipeline` and must not pin `state` or `questions` in its `preset_parameters`, or the create is refused with `400 DECIDER_TOOL_NOT_CALLABLE`. A duplicate `name` in the project is `409 NAME_CONFLICT`.
|
|
2002
|
+
*/
|
|
2003
|
+
static createDecider(options) {
|
|
2004
|
+
return (options.client ?? client).post({
|
|
2005
|
+
url: "/v1/projects/{project_id}/deciders",
|
|
2006
|
+
...options,
|
|
2007
|
+
headers: {
|
|
2008
|
+
"Content-Type": "application/json",
|
|
2009
|
+
...options.headers
|
|
2010
|
+
}
|
|
2011
|
+
});
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* Delete a decider
|
|
2015
|
+
*
|
|
2016
|
+
* Deletes a decider and its version archive. Its decisions remain and keep naming the decider's ID.
|
|
2017
|
+
*/
|
|
2018
|
+
static deleteDecider(options) {
|
|
2019
|
+
return (options.client ?? client).delete({
|
|
2020
|
+
url: "/v1/projects/{project_id}/deciders/{decider_id}",
|
|
2021
|
+
...options
|
|
2022
|
+
});
|
|
2023
|
+
}
|
|
2024
|
+
/**
|
|
2025
|
+
* Get a decider
|
|
2026
|
+
*
|
|
2027
|
+
* Returns a decider with its current question set and version.
|
|
2028
|
+
*/
|
|
2029
|
+
static getDecider(options) {
|
|
2030
|
+
return (options.client ?? client).get({
|
|
2031
|
+
url: "/v1/projects/{project_id}/deciders/{decider_id}",
|
|
2032
|
+
...options
|
|
2033
|
+
});
|
|
2034
|
+
}
|
|
2035
|
+
/**
|
|
2036
|
+
* Update a decider
|
|
2037
|
+
*
|
|
2038
|
+
* Updates any of `name`, `description`, the backend and `questions`. Naming `agent_id` or `tool_id` replaces the current backend; naming both is `400`. Only a change to `questions` archives a new version; a rename, a new backend or a rewrite of the questions the decider already holds leaves `version` where it is. A new backend is held to the same rules as on create.
|
|
2039
|
+
*/
|
|
2040
|
+
static updateDecider(options) {
|
|
2041
|
+
return (options.client ?? client).patch({
|
|
2042
|
+
url: "/v1/projects/{project_id}/deciders/{decider_id}",
|
|
2043
|
+
...options,
|
|
2044
|
+
headers: {
|
|
2045
|
+
"Content-Type": "application/json",
|
|
2046
|
+
...options.headers
|
|
2047
|
+
}
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
/**
|
|
2051
|
+
* List a decider's versions
|
|
2052
|
+
*
|
|
2053
|
+
* Returns the decider's archived question sets, newest first. A version is written on create and on every write that changes `questions`.
|
|
2054
|
+
*/
|
|
2055
|
+
static listDeciderVersions(options) {
|
|
2056
|
+
return (options.client ?? client).get({
|
|
2057
|
+
url: "/v1/projects/{project_id}/deciders/{decider_id}/versions",
|
|
2058
|
+
...options
|
|
2059
|
+
});
|
|
2060
|
+
}
|
|
2061
|
+
/**
|
|
2062
|
+
* Fetch an archived decider version
|
|
2063
|
+
*
|
|
2064
|
+
* Returns the question set a version held. A decision names the `decider_version` it was answered under, so this is how its criteria are read after the decider has changed.
|
|
2065
|
+
*/
|
|
2066
|
+
static getDeciderVersion(options) {
|
|
2067
|
+
return (options.client ?? client).get({
|
|
2068
|
+
url: "/v1/projects/{project_id}/deciders/{decider_id}/versions/{version}",
|
|
2069
|
+
...options
|
|
2070
|
+
});
|
|
2071
|
+
}
|
|
2072
|
+
/**
|
|
2073
|
+
* Restore an archived decider version
|
|
2074
|
+
*
|
|
2075
|
+
* Writes an archived question set back as the decider's live one, which archives it again as a new version rather than rewinding the counter. Restoring the question set the decider already holds is a no-op.
|
|
2076
|
+
*/
|
|
2077
|
+
static restoreDeciderVersion(options) {
|
|
2078
|
+
return (options.client ?? client).post({
|
|
2079
|
+
url: "/v1/projects/{project_id}/deciders/{decider_id}/versions/{version}/restore",
|
|
2080
|
+
...options,
|
|
2081
|
+
headers: {
|
|
2082
|
+
"Content-Type": "application/json",
|
|
2083
|
+
...options.headers
|
|
2084
|
+
}
|
|
2085
|
+
});
|
|
2086
|
+
}
|
|
2087
|
+
/**
|
|
2088
|
+
* Request a decision
|
|
2089
|
+
*
|
|
2090
|
+
* Evaluates the decider against `state` and records the decision. The questions come from the decider, never from the request, so a call site can only supply what is judged.
|
|
2091
|
+
*
|
|
2092
|
+
* Everything that can refuse the request is checked before the decision is written, so a refusal is a `4xx` and never a polled failure: the agent's tool surface (`400 DECIDER_AGENT_NOT_TOOL_LESS`), a tool that cannot answer (`400 DECIDER_TOOL_NOT_CALLABLE`), a paused project (`409 PROJECT_PAUSED`) and, for an agent, quota admission (`429 QUOTA_EXCEEDED`).
|
|
2093
|
+
*
|
|
2094
|
+
* A tool backend is called with `{ state, questions }` and must answer `{ answers: { <question id>: { choice | score | value, probabilities? } } }`; an answer outside that contract fails the decision with `DECISION_ANSWER_INVALID`.
|
|
2095
|
+
*
|
|
2096
|
+
* With `wait: false`, the default, the answer is `201` with the decision `queued`; poll `GET /v1/projects/{project_id}/decisions/{decision_id}` or subscribe to `decisions.completed` and `decisions.failed`. With `wait: true` it is `201` with the decision settled.
|
|
2097
|
+
*/
|
|
2098
|
+
static createDecision(options) {
|
|
2099
|
+
return (options.client ?? client).post({
|
|
2100
|
+
url: "/v1/projects/{project_id}/deciders/{decider_id}/decisions",
|
|
2101
|
+
...options,
|
|
2102
|
+
headers: {
|
|
2103
|
+
"Content-Type": "application/json",
|
|
2104
|
+
...options.headers
|
|
2105
|
+
}
|
|
2106
|
+
});
|
|
2107
|
+
}
|
|
2108
|
+
/**
|
|
2109
|
+
* List decisions
|
|
2110
|
+
*
|
|
2111
|
+
* Returns the decisions in a project, newest first.
|
|
2112
|
+
*/
|
|
2113
|
+
static listDecisions(options) {
|
|
2114
|
+
return (options.client ?? client).get({
|
|
2115
|
+
url: "/v1/projects/{project_id}/decisions",
|
|
2116
|
+
...options
|
|
2117
|
+
});
|
|
2118
|
+
}
|
|
2119
|
+
/**
|
|
2120
|
+
* Get a decision
|
|
2121
|
+
*
|
|
2122
|
+
* Returns a decision. Poll it after a `wait: false` request until `status` is `completed` or `failed`.
|
|
2123
|
+
*/
|
|
2124
|
+
static getDecision(options) {
|
|
2125
|
+
return (options.client ?? client).get({
|
|
2126
|
+
url: "/v1/projects/{project_id}/decisions/{decision_id}",
|
|
2127
|
+
...options
|
|
2128
|
+
});
|
|
2129
|
+
}
|
|
2130
|
+
};
|
|
1986
2131
|
var Documents = class {
|
|
1987
2132
|
/**
|
|
1988
2133
|
* List documents
|
|
@@ -4668,7 +4813,7 @@ var Tools = class {
|
|
|
4668
4813
|
/**
|
|
4669
4814
|
* Delete a tool
|
|
4670
4815
|
*
|
|
4671
|
-
* Deletes a tool by ID.
|
|
4816
|
+
* Deletes a tool by ID. A tool that is a decider's backend is refused with `409 TOOL_HAS_DEPENDENTS`.
|
|
4672
4817
|
*/
|
|
4673
4818
|
static deleteTool(options) {
|
|
4674
4819
|
return (options.client ?? client).delete({
|
|
@@ -5303,6 +5448,7 @@ var NaturaliClient = class {
|
|
|
5303
5448
|
channels;
|
|
5304
5449
|
auth;
|
|
5305
5450
|
conversations;
|
|
5451
|
+
deciders;
|
|
5306
5452
|
documents;
|
|
5307
5453
|
embeddings;
|
|
5308
5454
|
evaluations;
|
|
@@ -5355,6 +5501,7 @@ var NaturaliClient = class {
|
|
|
5355
5501
|
this.channels = bindResource(Channels, this.http);
|
|
5356
5502
|
this.auth = bindResource(Auth, this.http);
|
|
5357
5503
|
this.conversations = bindResource(Conversations, this.http);
|
|
5504
|
+
this.deciders = bindResource(Deciders, this.http);
|
|
5358
5505
|
this.documents = bindResource(Documents, this.http);
|
|
5359
5506
|
this.embeddings = bindResource(Embeddings, this.http);
|
|
5360
5507
|
this.evaluations = bindResource(Evaluations, this.http);
|
|
@@ -5386,4 +5533,4 @@ var NaturaliClient = class {
|
|
|
5386
5533
|
}
|
|
5387
5534
|
};
|
|
5388
5535
|
//#endregion
|
|
5389
|
-
export { Activity, Actors, Admin, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, Assistant, AuditLog, Auth, Chains, Channels, Conversations, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Models, NaturaliClient, Orchestrations, Projects, Quotas, Secrets, Sessions, Tasks, Tools, Traces, Triggers, Users, Webhooks, Workflows, createClient, createConfig };
|
|
5536
|
+
export { Activity, Actors, Admin, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, Assistant, AuditLog, Auth, Chains, Channels, Conversations, Deciders, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Models, NaturaliClient, Orchestrations, Projects, Quotas, Secrets, Sessions, Tasks, Tools, Traces, Triggers, Users, Webhooks, Workflows, createClient, createConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.155.0",
|
|
4
4
|
"description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@hey-api/openapi-ts": "^0.99.0",
|
|
34
|
-
"@naturali/api": "0.
|
|
34
|
+
"@naturali/api": "0.155.0",
|
|
35
35
|
"@ttoss/openapi-codegen": "^0.3.1",
|
|
36
36
|
"@types/node": "^26.5.1",
|
|
37
37
|
"tsdown": "^0.23.0",
|