@soat/sdk 0.61.1 → 0.63.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 +177 -1
- package/dist/index.d.cts +930 -102
- package/dist/index.d.mts +930 -102
- package/dist/index.mjs +177 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1509,6 +1509,151 @@ var Conversations = class {
|
|
|
1509
1509
|
});
|
|
1510
1510
|
}
|
|
1511
1511
|
};
|
|
1512
|
+
var Deciders = class {
|
|
1513
|
+
/**
|
|
1514
|
+
* List deciders
|
|
1515
|
+
*
|
|
1516
|
+
* Returns the deciders defined in a project, newest first.
|
|
1517
|
+
*/
|
|
1518
|
+
static listDeciders(options) {
|
|
1519
|
+
return (options?.client ?? client).get({
|
|
1520
|
+
url: "/api/v1/deciders",
|
|
1521
|
+
...options
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
/**
|
|
1525
|
+
* Create a decider
|
|
1526
|
+
*
|
|
1527
|
+
* 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`.
|
|
1528
|
+
*/
|
|
1529
|
+
static createDecider(options) {
|
|
1530
|
+
return (options.client ?? client).post({
|
|
1531
|
+
url: "/api/v1/deciders",
|
|
1532
|
+
...options,
|
|
1533
|
+
headers: {
|
|
1534
|
+
"Content-Type": "application/json",
|
|
1535
|
+
...options.headers
|
|
1536
|
+
}
|
|
1537
|
+
});
|
|
1538
|
+
}
|
|
1539
|
+
/**
|
|
1540
|
+
* Delete a decider
|
|
1541
|
+
*
|
|
1542
|
+
* Deletes a decider and its version archive. Its decisions remain and keep naming the decider's ID.
|
|
1543
|
+
*/
|
|
1544
|
+
static deleteDecider(options) {
|
|
1545
|
+
return (options.client ?? client).delete({
|
|
1546
|
+
url: "/api/v1/deciders/{decider_id}",
|
|
1547
|
+
...options
|
|
1548
|
+
});
|
|
1549
|
+
}
|
|
1550
|
+
/**
|
|
1551
|
+
* Get a decider
|
|
1552
|
+
*
|
|
1553
|
+
* Returns a decider with its current question set and version.
|
|
1554
|
+
*/
|
|
1555
|
+
static getDecider(options) {
|
|
1556
|
+
return (options.client ?? client).get({
|
|
1557
|
+
url: "/api/v1/deciders/{decider_id}",
|
|
1558
|
+
...options
|
|
1559
|
+
});
|
|
1560
|
+
}
|
|
1561
|
+
/**
|
|
1562
|
+
* Update a decider
|
|
1563
|
+
*
|
|
1564
|
+
* 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.
|
|
1565
|
+
*/
|
|
1566
|
+
static updateDecider(options) {
|
|
1567
|
+
return (options.client ?? client).patch({
|
|
1568
|
+
url: "/api/v1/deciders/{decider_id}",
|
|
1569
|
+
...options,
|
|
1570
|
+
headers: {
|
|
1571
|
+
"Content-Type": "application/json",
|
|
1572
|
+
...options.headers
|
|
1573
|
+
}
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1576
|
+
/**
|
|
1577
|
+
* List a decider's versions
|
|
1578
|
+
*
|
|
1579
|
+
* Returns the decider's archived question sets, newest first. A version is written on create and on every write that changes `questions`.
|
|
1580
|
+
*/
|
|
1581
|
+
static listDeciderVersions(options) {
|
|
1582
|
+
return (options.client ?? client).get({
|
|
1583
|
+
url: "/api/v1/deciders/{decider_id}/versions",
|
|
1584
|
+
...options
|
|
1585
|
+
});
|
|
1586
|
+
}
|
|
1587
|
+
/**
|
|
1588
|
+
* Fetch an archived decider version
|
|
1589
|
+
*
|
|
1590
|
+
* 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.
|
|
1591
|
+
*/
|
|
1592
|
+
static getDeciderVersion(options) {
|
|
1593
|
+
return (options.client ?? client).get({
|
|
1594
|
+
url: "/api/v1/deciders/{decider_id}/versions/{version}",
|
|
1595
|
+
...options
|
|
1596
|
+
});
|
|
1597
|
+
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Restore an archived decider version
|
|
1600
|
+
*
|
|
1601
|
+
* 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.
|
|
1602
|
+
*/
|
|
1603
|
+
static restoreDeciderVersion(options) {
|
|
1604
|
+
return (options.client ?? client).post({
|
|
1605
|
+
url: "/api/v1/deciders/{decider_id}/versions/{version}/restore",
|
|
1606
|
+
...options,
|
|
1607
|
+
headers: {
|
|
1608
|
+
"Content-Type": "application/json",
|
|
1609
|
+
...options.headers
|
|
1610
|
+
}
|
|
1611
|
+
});
|
|
1612
|
+
}
|
|
1613
|
+
/**
|
|
1614
|
+
* Request a decision
|
|
1615
|
+
*
|
|
1616
|
+
* 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.
|
|
1617
|
+
*
|
|
1618
|
+
* 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`).
|
|
1619
|
+
*
|
|
1620
|
+
* 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`.
|
|
1621
|
+
*
|
|
1622
|
+
* With `wait: false`, the default, the answer is `201` with the decision `queued`; poll `GET /api/v1/decisions/{decision_id}` or subscribe to `decisions.completed` and `decisions.failed`. With `wait: true` it is `201` with the decision settled.
|
|
1623
|
+
*/
|
|
1624
|
+
static createDecision(options) {
|
|
1625
|
+
return (options.client ?? client).post({
|
|
1626
|
+
url: "/api/v1/deciders/{decider_id}/decisions",
|
|
1627
|
+
...options,
|
|
1628
|
+
headers: {
|
|
1629
|
+
"Content-Type": "application/json",
|
|
1630
|
+
...options.headers
|
|
1631
|
+
}
|
|
1632
|
+
});
|
|
1633
|
+
}
|
|
1634
|
+
/**
|
|
1635
|
+
* List decisions
|
|
1636
|
+
*
|
|
1637
|
+
* Returns the decisions in a project, newest first.
|
|
1638
|
+
*/
|
|
1639
|
+
static listDecisions(options) {
|
|
1640
|
+
return (options?.client ?? client).get({
|
|
1641
|
+
url: "/api/v1/decisions",
|
|
1642
|
+
...options
|
|
1643
|
+
});
|
|
1644
|
+
}
|
|
1645
|
+
/**
|
|
1646
|
+
* Get a decision
|
|
1647
|
+
*
|
|
1648
|
+
* Returns a decision. Poll it after a `wait: false` request until `status` is `completed` or `failed`.
|
|
1649
|
+
*/
|
|
1650
|
+
static getDecision(options) {
|
|
1651
|
+
return (options.client ?? client).get({
|
|
1652
|
+
url: "/api/v1/decisions/{decision_id}",
|
|
1653
|
+
...options
|
|
1654
|
+
});
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1512
1657
|
var Documents = class {
|
|
1513
1658
|
/**
|
|
1514
1659
|
* List documents
|
|
@@ -3619,6 +3764,34 @@ var Projects = class {
|
|
|
3619
3764
|
});
|
|
3620
3765
|
}
|
|
3621
3766
|
/**
|
|
3767
|
+
* Pause a project
|
|
3768
|
+
*
|
|
3769
|
+
* Stops everything the project runs, with one call. From the moment it answers, nothing new starts in the project: agent, session and conversation generations, tool-output continuations, chat completions, direct tool calls, orchestration runs, eval runs and trigger firings are refused with `409 PROJECT_PAUSED`, and so is resuming a single run or task the pause holds.
|
|
3770
|
+
* What is already in motion is parked rather than discarded: every live orchestration run is paused the way pause-orchestration-run pauses it (a running one parks at its next checkpoint), every open task's automation is paused, schedule triggers stop firing, and queued eval items wait unclaimed. A generation or node already in flight finishes. Reads and configuration writes keep working.
|
|
3771
|
+
* Idempotent: pausing a paused project answers it unchanged and keeps the first `reason`. Emits `projects.paused`.
|
|
3772
|
+
*/
|
|
3773
|
+
static pauseProject(options) {
|
|
3774
|
+
return (options.client ?? client).post({
|
|
3775
|
+
url: "/api/v1/projects/{project_id}/pause",
|
|
3776
|
+
...options,
|
|
3777
|
+
headers: {
|
|
3778
|
+
"Content-Type": "application/json",
|
|
3779
|
+
...options.headers
|
|
3780
|
+
}
|
|
3781
|
+
});
|
|
3782
|
+
}
|
|
3783
|
+
/**
|
|
3784
|
+
* Resume a project
|
|
3785
|
+
*
|
|
3786
|
+
* Lifts the project's pause and hands back exactly what it held: the runs and tasks the pause parked are resumed (a run the way resume-orchestration-run resumes it, in the background; a task's suppressed dispatch runs as the caller), and schedule triggers fire again from their next occurrence after now — an occurrence that fell due while paused is not fired late. A run or task an operator paused before the project was paused keeps its own pause. Eval runs continue from the item they stopped at. Emits `projects.resumed`.
|
|
3787
|
+
*/
|
|
3788
|
+
static resumeProject(options) {
|
|
3789
|
+
return (options.client ?? client).post({
|
|
3790
|
+
url: "/api/v1/projects/{project_id}/resume",
|
|
3791
|
+
...options
|
|
3792
|
+
});
|
|
3793
|
+
}
|
|
3794
|
+
/**
|
|
3622
3795
|
* List a project's price rows
|
|
3623
3796
|
*
|
|
3624
3797
|
* Returns the project's per-provider-slug price rows — the middle pricing tier that covers every one of the project's instances of a given provider slug. At cost time a per-provider-instance override wins over these, and these win over the global default. Authorized by the caller's access to the project.
|
|
@@ -4118,7 +4291,7 @@ var Tools = class {
|
|
|
4118
4291
|
/**
|
|
4119
4292
|
* Delete a tool
|
|
4120
4293
|
*
|
|
4121
|
-
* Deletes a tool by ID.
|
|
4294
|
+
* Deletes a tool by ID. A tool that is a decider's backend is refused with `409 TOOL_HAS_DEPENDENTS`.
|
|
4122
4295
|
*/
|
|
4123
4296
|
static deleteTool(options) {
|
|
4124
4297
|
return (options.client ?? client).delete({
|
|
@@ -4855,6 +5028,7 @@ var SoatClient = class {
|
|
|
4855
5028
|
chains;
|
|
4856
5029
|
chats;
|
|
4857
5030
|
conversations;
|
|
5031
|
+
deciders;
|
|
4858
5032
|
documents;
|
|
4859
5033
|
embeddings;
|
|
4860
5034
|
evaluations;
|
|
@@ -4904,6 +5078,7 @@ var SoatClient = class {
|
|
|
4904
5078
|
this.chains = bindResource(Chains, httpClient);
|
|
4905
5079
|
this.chats = bindResource(Chats, httpClient);
|
|
4906
5080
|
this.conversations = bindResource(Conversations, httpClient);
|
|
5081
|
+
this.deciders = bindResource(Deciders, httpClient);
|
|
4907
5082
|
this.documents = bindResource(Documents, httpClient);
|
|
4908
5083
|
this.embeddings = bindResource(Embeddings, httpClient);
|
|
4909
5084
|
this.evaluations = bindResource(Evaluations, httpClient);
|
|
@@ -4936,4 +5111,4 @@ var SoatClient = class {
|
|
|
4936
5111
|
}
|
|
4937
5112
|
};
|
|
4938
5113
|
//#endregion
|
|
4939
|
-
export { Activity, Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, AuditLog, Chains, Chats, Conversations, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Orchestrations, Policies, Projects, Quotas, Secrets, Sessions, SoatClient, Tasks, Tools, Traces, Triggers, Usage, Users, Webhooks, Workflows, createClient, createConfig };
|
|
5114
|
+
export { Activity, Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, AuditLog, Chains, Chats, Conversations, Deciders, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryRules, MemoryStores, MetadataSchemas, ModelRoutes, Orchestrations, Policies, Projects, Quotas, Secrets, Sessions, SoatClient, Tasks, Tools, Traces, Triggers, Usage, Users, Webhooks, Workflows, createClient, createConfig };
|