@soat/sdk 0.62.0 → 0.64.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 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
@@ -4146,7 +4291,7 @@ var Tools = class {
4146
4291
  /**
4147
4292
  * Delete a tool
4148
4293
  *
4149
- * 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`.
4150
4295
  */
4151
4296
  static deleteTool(options) {
4152
4297
  return (options.client ?? client).delete({
@@ -4883,6 +5028,7 @@ var SoatClient = class {
4883
5028
  chains;
4884
5029
  chats;
4885
5030
  conversations;
5031
+ deciders;
4886
5032
  documents;
4887
5033
  embeddings;
4888
5034
  evaluations;
@@ -4932,6 +5078,7 @@ var SoatClient = class {
4932
5078
  this.chains = bindResource(Chains, httpClient);
4933
5079
  this.chats = bindResource(Chats, httpClient);
4934
5080
  this.conversations = bindResource(Conversations, httpClient);
5081
+ this.deciders = bindResource(Deciders, httpClient);
4935
5082
  this.documents = bindResource(Documents, httpClient);
4936
5083
  this.embeddings = bindResource(Embeddings, httpClient);
4937
5084
  this.evaluations = bindResource(Evaluations, httpClient);
@@ -4964,4 +5111,4 @@ var SoatClient = class {
4964
5111
  }
4965
5112
  };
4966
5113
  //#endregion
4967
- 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/sdk",
3
- "version": "0.62.0",
3
+ "version": "0.64.0",
4
4
  "description": "TypeScript SDK for SOAT — open-source infrastructure for production-ready AI agents.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -43,7 +43,7 @@
43
43
  "devDependencies": {
44
44
  "@hey-api/openapi-ts": "^0.99.0",
45
45
  "@ttoss/config": "^1.38.0",
46
- "@ttoss/openapi-codegen": "^0.4.0",
46
+ "@ttoss/openapi-codegen": "^0.5.0",
47
47
  "@types/node": "^26.5.1",
48
48
  "tsdown": "^0.23.0",
49
49
  "tsx": "^4.23.13",