@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 CHANGED
@@ -1510,6 +1510,151 @@ var Conversations = class {
1510
1510
  });
1511
1511
  }
1512
1512
  };
1513
+ var Deciders = class {
1514
+ /**
1515
+ * List deciders
1516
+ *
1517
+ * Returns the deciders defined in a project, newest first.
1518
+ */
1519
+ static listDeciders(options) {
1520
+ return (options?.client ?? client).get({
1521
+ url: "/api/v1/deciders",
1522
+ ...options
1523
+ });
1524
+ }
1525
+ /**
1526
+ * Create a decider
1527
+ *
1528
+ * 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`.
1529
+ */
1530
+ static createDecider(options) {
1531
+ return (options.client ?? client).post({
1532
+ url: "/api/v1/deciders",
1533
+ ...options,
1534
+ headers: {
1535
+ "Content-Type": "application/json",
1536
+ ...options.headers
1537
+ }
1538
+ });
1539
+ }
1540
+ /**
1541
+ * Delete a decider
1542
+ *
1543
+ * Deletes a decider and its version archive. Its decisions remain and keep naming the decider's ID.
1544
+ */
1545
+ static deleteDecider(options) {
1546
+ return (options.client ?? client).delete({
1547
+ url: "/api/v1/deciders/{decider_id}",
1548
+ ...options
1549
+ });
1550
+ }
1551
+ /**
1552
+ * Get a decider
1553
+ *
1554
+ * Returns a decider with its current question set and version.
1555
+ */
1556
+ static getDecider(options) {
1557
+ return (options.client ?? client).get({
1558
+ url: "/api/v1/deciders/{decider_id}",
1559
+ ...options
1560
+ });
1561
+ }
1562
+ /**
1563
+ * Update a decider
1564
+ *
1565
+ * 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.
1566
+ */
1567
+ static updateDecider(options) {
1568
+ return (options.client ?? client).patch({
1569
+ url: "/api/v1/deciders/{decider_id}",
1570
+ ...options,
1571
+ headers: {
1572
+ "Content-Type": "application/json",
1573
+ ...options.headers
1574
+ }
1575
+ });
1576
+ }
1577
+ /**
1578
+ * List a decider's versions
1579
+ *
1580
+ * Returns the decider's archived question sets, newest first. A version is written on create and on every write that changes `questions`.
1581
+ */
1582
+ static listDeciderVersions(options) {
1583
+ return (options.client ?? client).get({
1584
+ url: "/api/v1/deciders/{decider_id}/versions",
1585
+ ...options
1586
+ });
1587
+ }
1588
+ /**
1589
+ * Fetch an archived decider version
1590
+ *
1591
+ * 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.
1592
+ */
1593
+ static getDeciderVersion(options) {
1594
+ return (options.client ?? client).get({
1595
+ url: "/api/v1/deciders/{decider_id}/versions/{version}",
1596
+ ...options
1597
+ });
1598
+ }
1599
+ /**
1600
+ * Restore an archived decider version
1601
+ *
1602
+ * 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.
1603
+ */
1604
+ static restoreDeciderVersion(options) {
1605
+ return (options.client ?? client).post({
1606
+ url: "/api/v1/deciders/{decider_id}/versions/{version}/restore",
1607
+ ...options,
1608
+ headers: {
1609
+ "Content-Type": "application/json",
1610
+ ...options.headers
1611
+ }
1612
+ });
1613
+ }
1614
+ /**
1615
+ * Request a decision
1616
+ *
1617
+ * 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.
1618
+ *
1619
+ * 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`).
1620
+ *
1621
+ * 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`.
1622
+ *
1623
+ * 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.
1624
+ */
1625
+ static createDecision(options) {
1626
+ return (options.client ?? client).post({
1627
+ url: "/api/v1/deciders/{decider_id}/decisions",
1628
+ ...options,
1629
+ headers: {
1630
+ "Content-Type": "application/json",
1631
+ ...options.headers
1632
+ }
1633
+ });
1634
+ }
1635
+ /**
1636
+ * List decisions
1637
+ *
1638
+ * Returns the decisions in a project, newest first.
1639
+ */
1640
+ static listDecisions(options) {
1641
+ return (options?.client ?? client).get({
1642
+ url: "/api/v1/decisions",
1643
+ ...options
1644
+ });
1645
+ }
1646
+ /**
1647
+ * Get a decision
1648
+ *
1649
+ * Returns a decision. Poll it after a `wait: false` request until `status` is `completed` or `failed`.
1650
+ */
1651
+ static getDecision(options) {
1652
+ return (options.client ?? client).get({
1653
+ url: "/api/v1/decisions/{decision_id}",
1654
+ ...options
1655
+ });
1656
+ }
1657
+ };
1513
1658
  var Documents = class {
1514
1659
  /**
1515
1660
  * List documents
@@ -3620,6 +3765,34 @@ var Projects = class {
3620
3765
  });
3621
3766
  }
3622
3767
  /**
3768
+ * Pause a project
3769
+ *
3770
+ * 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.
3771
+ * 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.
3772
+ * Idempotent: pausing a paused project answers it unchanged and keeps the first `reason`. Emits `projects.paused`.
3773
+ */
3774
+ static pauseProject(options) {
3775
+ return (options.client ?? client).post({
3776
+ url: "/api/v1/projects/{project_id}/pause",
3777
+ ...options,
3778
+ headers: {
3779
+ "Content-Type": "application/json",
3780
+ ...options.headers
3781
+ }
3782
+ });
3783
+ }
3784
+ /**
3785
+ * Resume a project
3786
+ *
3787
+ * 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`.
3788
+ */
3789
+ static resumeProject(options) {
3790
+ return (options.client ?? client).post({
3791
+ url: "/api/v1/projects/{project_id}/resume",
3792
+ ...options
3793
+ });
3794
+ }
3795
+ /**
3623
3796
  * List a project's price rows
3624
3797
  *
3625
3798
  * 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.
@@ -4119,7 +4292,7 @@ var Tools = class {
4119
4292
  /**
4120
4293
  * Delete a tool
4121
4294
  *
4122
- * Deletes a tool by ID.
4295
+ * Deletes a tool by ID. A tool that is a decider's backend is refused with `409 TOOL_HAS_DEPENDENTS`.
4123
4296
  */
4124
4297
  static deleteTool(options) {
4125
4298
  return (options.client ?? client).delete({
@@ -4856,6 +5029,7 @@ var SoatClient = class {
4856
5029
  chains;
4857
5030
  chats;
4858
5031
  conversations;
5032
+ deciders;
4859
5033
  documents;
4860
5034
  embeddings;
4861
5035
  evaluations;
@@ -4905,6 +5079,7 @@ var SoatClient = class {
4905
5079
  this.chains = bindResource(Chains, httpClient);
4906
5080
  this.chats = bindResource(Chats, httpClient);
4907
5081
  this.conversations = bindResource(Conversations, httpClient);
5082
+ this.deciders = bindResource(Deciders, httpClient);
4908
5083
  this.documents = bindResource(Documents, httpClient);
4909
5084
  this.embeddings = bindResource(Embeddings, httpClient);
4910
5085
  this.evaluations = bindResource(Evaluations, httpClient);
@@ -4948,6 +5123,7 @@ exports.AuditLog = AuditLog;
4948
5123
  exports.Chains = Chains;
4949
5124
  exports.Chats = Chats;
4950
5125
  exports.Conversations = Conversations;
5126
+ exports.Deciders = Deciders;
4951
5127
  exports.Documents = Documents;
4952
5128
  exports.Embeddings = Embeddings;
4953
5129
  exports.Evaluations = Evaluations;