@soat/sdk 0.62.0 → 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
@@ -4147,7 +4292,7 @@ var Tools = class {
4147
4292
  /**
4148
4293
  * Delete a tool
4149
4294
  *
4150
- * 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`.
4151
4296
  */
4152
4297
  static deleteTool(options) {
4153
4298
  return (options.client ?? client).delete({
@@ -4884,6 +5029,7 @@ var SoatClient = class {
4884
5029
  chains;
4885
5030
  chats;
4886
5031
  conversations;
5032
+ deciders;
4887
5033
  documents;
4888
5034
  embeddings;
4889
5035
  evaluations;
@@ -4933,6 +5079,7 @@ var SoatClient = class {
4933
5079
  this.chains = bindResource(Chains, httpClient);
4934
5080
  this.chats = bindResource(Chats, httpClient);
4935
5081
  this.conversations = bindResource(Conversations, httpClient);
5082
+ this.deciders = bindResource(Deciders, httpClient);
4936
5083
  this.documents = bindResource(Documents, httpClient);
4937
5084
  this.embeddings = bindResource(Embeddings, httpClient);
4938
5085
  this.evaluations = bindResource(Evaluations, httpClient);
@@ -4976,6 +5123,7 @@ exports.AuditLog = AuditLog;
4976
5123
  exports.Chains = Chains;
4977
5124
  exports.Chats = Chats;
4978
5125
  exports.Conversations = Conversations;
5126
+ exports.Deciders = Deciders;
4979
5127
  exports.Documents = Documents;
4980
5128
  exports.Embeddings = Embeddings;
4981
5129
  exports.Evaluations = Evaluations;