@naturali/cli 0.178.0 → 0.179.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.mjs +176 -25
- 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.
|
|
20
|
+
var version = "0.179.0";
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region ../sdk/src/generated/core/bodySerializer.gen.ts
|
|
23
23
|
const serializeFormDataPair = (data, key, value) => {
|
|
@@ -1755,14 +1755,38 @@ var Assistant = class {
|
|
|
1755
1755
|
});
|
|
1756
1756
|
}
|
|
1757
1757
|
/**
|
|
1758
|
-
*
|
|
1758
|
+
* List your conversations
|
|
1759
1759
|
*
|
|
1760
|
-
*
|
|
1760
|
+
* Your conversations with the Assistant in the app, newest first. Each is a session of its own; a conversation on Discord or WhatsApp is not listed here.
|
|
1761
1761
|
*
|
|
1762
1762
|
*/
|
|
1763
|
-
static
|
|
1763
|
+
static listAssistantSessions(options) {
|
|
1764
1764
|
return (options?.client ?? client).get({
|
|
1765
|
-
url: "/v1/assistant/
|
|
1765
|
+
url: "/v1/assistant/sessions",
|
|
1766
|
+
...options
|
|
1767
|
+
});
|
|
1768
|
+
}
|
|
1769
|
+
/**
|
|
1770
|
+
* Start a conversation
|
|
1771
|
+
*
|
|
1772
|
+
* Opens a new, empty conversation with the Assistant. It costs nothing until a message is sent, and it does not expire.
|
|
1773
|
+
*
|
|
1774
|
+
*/
|
|
1775
|
+
static createAssistantSession(options) {
|
|
1776
|
+
return (options?.client ?? client).post({
|
|
1777
|
+
url: "/v1/assistant/sessions",
|
|
1778
|
+
...options
|
|
1779
|
+
});
|
|
1780
|
+
}
|
|
1781
|
+
/**
|
|
1782
|
+
* Read a conversation
|
|
1783
|
+
*
|
|
1784
|
+
* The newest 100 messages of one conversation, oldest first.
|
|
1785
|
+
*
|
|
1786
|
+
*/
|
|
1787
|
+
static listAssistantSessionMessages(options) {
|
|
1788
|
+
return (options.client ?? client).get({
|
|
1789
|
+
url: "/v1/assistant/sessions/{session_id}/messages",
|
|
1766
1790
|
...options
|
|
1767
1791
|
});
|
|
1768
1792
|
}
|
|
@@ -1772,9 +1796,9 @@ var Assistant = class {
|
|
|
1772
1796
|
* Runs one turn as your account and answers with the messages it added: yours, then the Assistant's reply. The turn is paid from your credit and refused before it runs when the balance is below zero.
|
|
1773
1797
|
*
|
|
1774
1798
|
*/
|
|
1775
|
-
static
|
|
1799
|
+
static sendAssistantSessionMessage(options) {
|
|
1776
1800
|
return (options.client ?? client).post({
|
|
1777
|
-
url: "/v1/assistant/messages",
|
|
1801
|
+
url: "/v1/assistant/sessions/{session_id}/messages",
|
|
1778
1802
|
...options,
|
|
1779
1803
|
headers: {
|
|
1780
1804
|
"Content-Type": "application/json",
|
|
@@ -2106,7 +2130,7 @@ var Deciders = class {
|
|
|
2106
2130
|
/**
|
|
2107
2131
|
* Create a decider
|
|
2108
2132
|
*
|
|
2109
|
-
* 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 `
|
|
2133
|
+
* 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 `input` 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`.
|
|
2110
2134
|
*/
|
|
2111
2135
|
static createDecider(options) {
|
|
2112
2136
|
return (options.client ?? client).post({
|
|
@@ -2195,11 +2219,11 @@ var Deciders = class {
|
|
|
2195
2219
|
/**
|
|
2196
2220
|
* Request a decision
|
|
2197
2221
|
*
|
|
2198
|
-
* Evaluates the decider against `
|
|
2222
|
+
* Evaluates the decider against `input` and records the decision. The questions come from the decider, never from the request, so a call site can only supply what is judged. To send the questions with the request, use `POST /v1/projects/{project_id}/decisions`.
|
|
2199
2223
|
*
|
|
2200
2224
|
* 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`).
|
|
2201
2225
|
*
|
|
2202
|
-
* A tool backend is called with `{
|
|
2226
|
+
* A tool backend is called with `{ input, questions }` and must answer `{ answers: [{ name, probability | choice | score, probabilities?, confidence? }] }`, the request and response of OpenAI's Decisions API; an answer outside that contract fails the decision with `DECISION_ANSWER_INVALID`.
|
|
2203
2227
|
*
|
|
2204
2228
|
* 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.
|
|
2205
2229
|
*/
|
|
@@ -2225,6 +2249,23 @@ var Deciders = class {
|
|
|
2225
2249
|
});
|
|
2226
2250
|
}
|
|
2227
2251
|
/**
|
|
2252
|
+
* Request a decision with inline questions
|
|
2253
|
+
*
|
|
2254
|
+
* Evaluates `questions` sent with the request against `input`, answered by the agent or tool the request names (exactly one of `agent_id` and `tool_id`, held to the same rules as a decider's backend), and records the decision with its questions. The request and answers are those of OpenAI's Decisions API, with the backend in place of `model`.
|
|
2255
|
+
*
|
|
2256
|
+
* No decider names the questions, so the decision carries them in `questions` and has no `decider_id` or `decider_version`. Admission, `wait` and the tool contract are those of `POST /v1/projects/{project_id}/deciders/{decider_id}/decisions`.
|
|
2257
|
+
*/
|
|
2258
|
+
static createInlineDecision(options) {
|
|
2259
|
+
return (options.client ?? client).post({
|
|
2260
|
+
url: "/v1/projects/{project_id}/decisions",
|
|
2261
|
+
...options,
|
|
2262
|
+
headers: {
|
|
2263
|
+
"Content-Type": "application/json",
|
|
2264
|
+
...options.headers
|
|
2265
|
+
}
|
|
2266
|
+
});
|
|
2267
|
+
}
|
|
2268
|
+
/**
|
|
2228
2269
|
* Get a decision
|
|
2229
2270
|
*
|
|
2230
2271
|
* Returns a decision. Poll it after a `wait: false` request until `status` is `completed` or `failed`.
|
|
@@ -9434,29 +9475,77 @@ const routes = {
|
|
|
9434
9475
|
"in": "body"
|
|
9435
9476
|
}]
|
|
9436
9477
|
},
|
|
9437
|
-
"list-assistant-
|
|
9478
|
+
"list-assistant-sessions": {
|
|
9438
9479
|
serviceClass: "Assistant",
|
|
9439
|
-
operationId: "
|
|
9440
|
-
description: "
|
|
9480
|
+
operationId: "listAssistantSessions",
|
|
9481
|
+
description: "Your conversations with the Assistant in the app, newest first. Each is a session of its own; a conversation on Discord or WhatsApp is not listed here.",
|
|
9441
9482
|
moduleDocsUrl: "https://naturali.ai/docs/modules/assistant",
|
|
9442
9483
|
httpMethod: "get",
|
|
9443
9484
|
pathParams: [],
|
|
9485
|
+
queryParams: ["limit", "cursor"],
|
|
9486
|
+
headerParams: [],
|
|
9487
|
+
cookieParams: [],
|
|
9488
|
+
flags: [{
|
|
9489
|
+
"name": "limit",
|
|
9490
|
+
"description": "Maximum items per page — an integer from 1 to 100 (default 20).",
|
|
9491
|
+
"required": false,
|
|
9492
|
+
"type": "integer",
|
|
9493
|
+
"in": "query"
|
|
9494
|
+
}, {
|
|
9495
|
+
"name": "cursor",
|
|
9496
|
+
"description": "Opaque pagination cursor from a previous response's next_cursor.",
|
|
9497
|
+
"required": false,
|
|
9498
|
+
"type": "string",
|
|
9499
|
+
"in": "query"
|
|
9500
|
+
}]
|
|
9501
|
+
},
|
|
9502
|
+
"create-assistant-session": {
|
|
9503
|
+
serviceClass: "Assistant",
|
|
9504
|
+
operationId: "createAssistantSession",
|
|
9505
|
+
description: "Opens a new, empty conversation with the Assistant. It costs nothing until a message is sent, and it does not expire.",
|
|
9506
|
+
moduleDocsUrl: "https://naturali.ai/docs/modules/assistant",
|
|
9507
|
+
httpMethod: "post",
|
|
9508
|
+
pathParams: [],
|
|
9444
9509
|
queryParams: [],
|
|
9445
9510
|
headerParams: [],
|
|
9446
9511
|
cookieParams: [],
|
|
9447
9512
|
flags: []
|
|
9448
9513
|
},
|
|
9449
|
-
"
|
|
9514
|
+
"list-assistant-session-messages": {
|
|
9450
9515
|
serviceClass: "Assistant",
|
|
9451
|
-
operationId: "
|
|
9516
|
+
operationId: "listAssistantSessionMessages",
|
|
9517
|
+
description: "The newest 100 messages of one conversation, oldest first.",
|
|
9518
|
+
moduleDocsUrl: "https://naturali.ai/docs/modules/assistant",
|
|
9519
|
+
httpMethod: "get",
|
|
9520
|
+
pathParams: ["session_id"],
|
|
9521
|
+
queryParams: [],
|
|
9522
|
+
headerParams: [],
|
|
9523
|
+
cookieParams: [],
|
|
9524
|
+
flags: [{
|
|
9525
|
+
"name": "session_id",
|
|
9526
|
+
"description": "Assistant session ID, as listed.",
|
|
9527
|
+
"required": true,
|
|
9528
|
+
"type": "string",
|
|
9529
|
+
"in": "path"
|
|
9530
|
+
}]
|
|
9531
|
+
},
|
|
9532
|
+
"send-assistant-session-message": {
|
|
9533
|
+
serviceClass: "Assistant",
|
|
9534
|
+
operationId: "sendAssistantSessionMessage",
|
|
9452
9535
|
description: "Runs one turn as your account and answers with the messages it added: yours, then the Assistant's reply. The turn is paid from your credit and refused before it runs when the balance is below zero.",
|
|
9453
9536
|
moduleDocsUrl: "https://naturali.ai/docs/modules/assistant",
|
|
9454
9537
|
httpMethod: "post",
|
|
9455
|
-
pathParams: [],
|
|
9538
|
+
pathParams: ["session_id"],
|
|
9456
9539
|
queryParams: [],
|
|
9457
9540
|
headerParams: [],
|
|
9458
9541
|
cookieParams: [],
|
|
9459
9542
|
flags: [{
|
|
9543
|
+
"name": "session_id",
|
|
9544
|
+
"description": "Assistant session ID, as listed.",
|
|
9545
|
+
"required": true,
|
|
9546
|
+
"type": "string",
|
|
9547
|
+
"in": "path"
|
|
9548
|
+
}, {
|
|
9460
9549
|
"name": "text",
|
|
9461
9550
|
"description": "",
|
|
9462
9551
|
"required": true,
|
|
@@ -11178,7 +11267,7 @@ const routes = {
|
|
|
11178
11267
|
"create-decider": {
|
|
11179
11268
|
serviceClass: "Deciders",
|
|
11180
11269
|
operationId: "createDecider",
|
|
11181
|
-
description: "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 `
|
|
11270
|
+
description: "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 `input` 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`.",
|
|
11182
11271
|
moduleDocsUrl: "https://naturali.ai/docs/modules/deciders",
|
|
11183
11272
|
httpMethod: "post",
|
|
11184
11273
|
pathParams: ["project_id"],
|
|
@@ -11223,9 +11312,9 @@ const routes = {
|
|
|
11223
11312
|
},
|
|
11224
11313
|
{
|
|
11225
11314
|
"name": "questions",
|
|
11226
|
-
"description": "
|
|
11315
|
+
"description": "The questions, in the order the model is shown them.",
|
|
11227
11316
|
"required": true,
|
|
11228
|
-
"type": "
|
|
11317
|
+
"type": "array",
|
|
11229
11318
|
"in": "body"
|
|
11230
11319
|
},
|
|
11231
11320
|
{
|
|
@@ -11323,9 +11412,9 @@ const routes = {
|
|
|
11323
11412
|
},
|
|
11324
11413
|
{
|
|
11325
11414
|
"name": "questions",
|
|
11326
|
-
"description": "
|
|
11415
|
+
"description": "The questions, in the order the model is shown them.",
|
|
11327
11416
|
"required": false,
|
|
11328
|
-
"type": "
|
|
11417
|
+
"type": "array",
|
|
11329
11418
|
"in": "body"
|
|
11330
11419
|
},
|
|
11331
11420
|
{
|
|
@@ -11495,7 +11584,7 @@ const routes = {
|
|
|
11495
11584
|
"create-decision": {
|
|
11496
11585
|
serviceClass: "Deciders",
|
|
11497
11586
|
operationId: "createDecision",
|
|
11498
|
-
description: "Evaluates the decider against `
|
|
11587
|
+
description: "Evaluates the decider against `input` and records the decision. The questions come from the decider, never from the request, so a call site can only supply what is judged. To send the questions with the request, use `POST /v1/projects/{project_id}/decisions`. 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`). A tool backend is called with `{ input, questions }` and must answer `{ answers: [{ name, probability | choice | score, probabilities?, confidence? }] }`, the request and response of OpenAI's Decisions API; an answer outside that contract fails the decision with `DECISION_ANSWER_INVALID`. 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.",
|
|
11499
11588
|
moduleDocsUrl: "https://naturali.ai/docs/modules/deciders",
|
|
11500
11589
|
httpMethod: "post",
|
|
11501
11590
|
pathParams: ["project_id", "decider_id"],
|
|
@@ -11518,15 +11607,15 @@ const routes = {
|
|
|
11518
11607
|
"in": "path"
|
|
11519
11608
|
},
|
|
11520
11609
|
{
|
|
11521
|
-
"name": "
|
|
11522
|
-
"description": "What is judged:
|
|
11610
|
+
"name": "input",
|
|
11611
|
+
"description": "What is judged, not stored: a string; a list of `user` messages whose `content` is a string or `input_text` and `input_image` parts (an image as a base64 data URL); or any other JSON value, which an agent is shown as indented JSON. An array of objects carrying `role` is read as messages.",
|
|
11523
11612
|
"required": true,
|
|
11524
11613
|
"type": "unknown",
|
|
11525
11614
|
"in": "body"
|
|
11526
11615
|
},
|
|
11527
11616
|
{
|
|
11528
11617
|
"name": "metadata",
|
|
11529
|
-
"description": "Caller-owned annotations stored on the decision and returned on every read — typically the id of what was judged, since the
|
|
11618
|
+
"description": "Caller-owned annotations stored on the decision and returned on every read — typically the id of what was judged, since the input itself is not stored. Written once, with the decision. A non-object is rejected with `400 VALIDATION_FAILED` and no decision is written.",
|
|
11530
11619
|
"required": false,
|
|
11531
11620
|
"type": "object",
|
|
11532
11621
|
"in": "body"
|
|
@@ -11593,6 +11682,68 @@ const routes = {
|
|
|
11593
11682
|
}
|
|
11594
11683
|
]
|
|
11595
11684
|
},
|
|
11685
|
+
"create-inline-decision": {
|
|
11686
|
+
serviceClass: "Deciders",
|
|
11687
|
+
operationId: "createInlineDecision",
|
|
11688
|
+
description: "Evaluates `questions` sent with the request against `input`, answered by the agent or tool the request names (exactly one of `agent_id` and `tool_id`, held to the same rules as a decider's backend), and records the decision with its questions. The request and answers are those of OpenAI's Decisions API, with the backend in place of `model`. No decider names the questions, so the decision carries them in `questions` and has no `decider_id` or `decider_version`. Admission, `wait` and the tool contract are those of `POST /v1/projects/{project_id}/deciders/{decider_id}/decisions`.",
|
|
11689
|
+
moduleDocsUrl: "https://naturali.ai/docs/modules/deciders",
|
|
11690
|
+
httpMethod: "post",
|
|
11691
|
+
pathParams: ["project_id"],
|
|
11692
|
+
queryParams: [],
|
|
11693
|
+
headerParams: [],
|
|
11694
|
+
cookieParams: [],
|
|
11695
|
+
flags: [
|
|
11696
|
+
{
|
|
11697
|
+
"name": "project_id",
|
|
11698
|
+
"description": "Project public ID (proj_ prefix).",
|
|
11699
|
+
"required": true,
|
|
11700
|
+
"type": "string",
|
|
11701
|
+
"in": "path"
|
|
11702
|
+
},
|
|
11703
|
+
{
|
|
11704
|
+
"name": "agent_id",
|
|
11705
|
+
"description": "A tool-less agent that answers",
|
|
11706
|
+
"required": false,
|
|
11707
|
+
"type": "string",
|
|
11708
|
+
"in": "body"
|
|
11709
|
+
},
|
|
11710
|
+
{
|
|
11711
|
+
"name": "tool_id",
|
|
11712
|
+
"description": "An http or pipeline tool that answers",
|
|
11713
|
+
"required": false,
|
|
11714
|
+
"type": "string",
|
|
11715
|
+
"in": "body"
|
|
11716
|
+
},
|
|
11717
|
+
{
|
|
11718
|
+
"name": "questions",
|
|
11719
|
+
"description": "The questions, in the order the model is shown them.",
|
|
11720
|
+
"required": true,
|
|
11721
|
+
"type": "array",
|
|
11722
|
+
"in": "body"
|
|
11723
|
+
},
|
|
11724
|
+
{
|
|
11725
|
+
"name": "input",
|
|
11726
|
+
"description": "What is judged, not stored: a string; a list of `user` messages whose `content` is a string or `input_text` and `input_image` parts (an image as a base64 data URL); or any other JSON value, which an agent is shown as indented JSON. An array of objects carrying `role` is read as messages.",
|
|
11727
|
+
"required": true,
|
|
11728
|
+
"type": "unknown",
|
|
11729
|
+
"in": "body"
|
|
11730
|
+
},
|
|
11731
|
+
{
|
|
11732
|
+
"name": "metadata",
|
|
11733
|
+
"description": "Caller-owned annotations stored on the decision. A non-object is rejected with `400 VALIDATION_FAILED`.",
|
|
11734
|
+
"required": false,
|
|
11735
|
+
"type": "object",
|
|
11736
|
+
"in": "body"
|
|
11737
|
+
},
|
|
11738
|
+
{
|
|
11739
|
+
"name": "wait",
|
|
11740
|
+
"description": "True evaluates before answering and returns the settled decision. False — the default — returns the `queued` decision at once. An MCP tool call always waits.",
|
|
11741
|
+
"required": false,
|
|
11742
|
+
"type": "boolean",
|
|
11743
|
+
"in": "body"
|
|
11744
|
+
}
|
|
11745
|
+
]
|
|
11746
|
+
},
|
|
11596
11747
|
"get-decision": {
|
|
11597
11748
|
serviceClass: "Deciders",
|
|
11598
11749
|
operationId: "getDecision",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.179.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.
|
|
34
|
+
"@naturali/sdk": "0.179.0",
|
|
35
35
|
"@ttoss/openapi-codegen": "^0.5.0",
|
|
36
36
|
"@types/node": "^26.5.1",
|
|
37
37
|
"tsdown": "^0.23.0",
|