@naturali/sdk 0.51.1 → 0.53.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
@@ -1593,6 +1593,163 @@ var Models = class {
1593
1593
  });
1594
1594
  }
1595
1595
  };
1596
+ var Orchestrations = class {
1597
+ /**
1598
+ * List orchestrations
1599
+ *
1600
+ * Lists the project's orchestration definitions.
1601
+ */
1602
+ static listOrchestrations(options) {
1603
+ return (options.client ?? client).get({
1604
+ url: "/v1/projects/{project_id}/orchestrations",
1605
+ ...options
1606
+ });
1607
+ }
1608
+ /**
1609
+ * Create an orchestration
1610
+ *
1611
+ * Creates a new orchestration (pipeline) definition in the project.
1612
+ */
1613
+ static createOrchestration(options) {
1614
+ return (options.client ?? client).post({
1615
+ url: "/v1/projects/{project_id}/orchestrations",
1616
+ ...options,
1617
+ headers: {
1618
+ "Content-Type": "application/json",
1619
+ ...options.headers
1620
+ }
1621
+ });
1622
+ }
1623
+ /**
1624
+ * Validate an orchestration graph
1625
+ *
1626
+ * Statically validates a graph without persisting anything — the same checks `create`/`update` enforce (unique node ids, edges reference existing nodes, the graph is acyclic unless it contains a loop node, every `input_mapping` reference resolves). Returns blocking `errors` and non-blocking `warnings`.
1627
+ *
1628
+ */
1629
+ static validateOrchestration(options) {
1630
+ return (options.client ?? client).post({
1631
+ url: "/v1/projects/{project_id}/orchestrations/validate",
1632
+ ...options,
1633
+ headers: {
1634
+ "Content-Type": "application/json",
1635
+ ...options.headers
1636
+ }
1637
+ });
1638
+ }
1639
+ /**
1640
+ * Delete an orchestration
1641
+ *
1642
+ * Deletes the orchestration definition and all of its runs.
1643
+ */
1644
+ static deleteOrchestration(options) {
1645
+ return (options.client ?? client).delete({
1646
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
1647
+ ...options
1648
+ });
1649
+ }
1650
+ /**
1651
+ * Get an orchestration
1652
+ *
1653
+ * Returns one orchestration with its nodes and edges. Belonging to another project responds `404`, not `403` — existence is not leaked.
1654
+ *
1655
+ */
1656
+ static getOrchestration(options) {
1657
+ return (options.client ?? client).get({
1658
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
1659
+ ...options
1660
+ });
1661
+ }
1662
+ /**
1663
+ * Update an orchestration
1664
+ *
1665
+ * Partially updates an orchestration's definition.
1666
+ */
1667
+ static updateOrchestration(options) {
1668
+ return (options.client ?? client).patch({
1669
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
1670
+ ...options,
1671
+ headers: {
1672
+ "Content-Type": "application/json",
1673
+ ...options.headers
1674
+ }
1675
+ });
1676
+ }
1677
+ /**
1678
+ * List orchestration runs
1679
+ *
1680
+ * Lists runs of one orchestration. `orchestration_id` is required — it is what scopes the list to this project, since a run carries no cheaper project-level filter of its own.
1681
+ *
1682
+ */
1683
+ static listOrchestrationRuns(options) {
1684
+ return (options.client ?? client).get({
1685
+ url: "/v1/projects/{project_id}/orchestration-runs",
1686
+ ...options
1687
+ });
1688
+ }
1689
+ /**
1690
+ * Start an orchestration run
1691
+ *
1692
+ * Starts a new run of the orchestration named by `orchestration_id`, which must belong to this project. By default the run executes durably in the background and this returns immediately with `status: "queued"`; pass `wait: true` to block until the run reaches a terminal or `awaiting_input` state instead.
1693
+ */
1694
+ static startOrchestrationRun(options) {
1695
+ return (options.client ?? client).post({
1696
+ url: "/v1/projects/{project_id}/orchestration-runs",
1697
+ ...options,
1698
+ headers: {
1699
+ "Content-Type": "application/json",
1700
+ ...options.headers
1701
+ }
1702
+ });
1703
+ }
1704
+ /**
1705
+ * Get an orchestration run
1706
+ *
1707
+ * Returns the status, state, and artifacts of one run.
1708
+ */
1709
+ static getOrchestrationRun(options) {
1710
+ return (options.client ?? client).get({
1711
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}",
1712
+ ...options
1713
+ });
1714
+ }
1715
+ /**
1716
+ * Cancel an orchestration run
1717
+ *
1718
+ * Cancels a run that has not yet reached a terminal state.
1719
+ */
1720
+ static cancelOrchestrationRun(options) {
1721
+ return (options.client ?? client).post({
1722
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/cancel",
1723
+ ...options
1724
+ });
1725
+ }
1726
+ /**
1727
+ * Resume an orchestration run
1728
+ *
1729
+ * Re-drives an `awaiting_input` run from its last checkpoint. This does not satisfy the pause itself — a run parked on a human or webhook node re-parks on the same node. Use `human-input` to supply the awaited payload and advance the run.
1730
+ */
1731
+ static resumeOrchestrationRun(options) {
1732
+ return (options.client ?? client).post({
1733
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/resume",
1734
+ ...options
1735
+ });
1736
+ }
1737
+ /**
1738
+ * Submit human input
1739
+ *
1740
+ * Provides human input to a run that is `awaiting_input` at a human node, and advances it.
1741
+ */
1742
+ static submitHumanInput(options) {
1743
+ return (options.client ?? client).post({
1744
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/human-input",
1745
+ ...options,
1746
+ headers: {
1747
+ "Content-Type": "application/json",
1748
+ ...options.headers
1749
+ }
1750
+ });
1751
+ }
1752
+ };
1596
1753
  var Projects = class {
1597
1754
  /**
1598
1755
  * List projects
@@ -1735,76 +1892,6 @@ var Providers = class {
1735
1892
  });
1736
1893
  }
1737
1894
  };
1738
- var Runs = class {
1739
- /**
1740
- * List runs
1741
- *
1742
- * Runs of one orchestration, most recent first. `orchestration_id` is required — a project-wide run feed is not offered, since the upstream runtime's own list has no project filter (see the file description).
1743
- *
1744
- */
1745
- static listRuns(options) {
1746
- return (options.client ?? client).get({
1747
- url: "/v1/projects/{project_id}/runs",
1748
- ...options
1749
- });
1750
- }
1751
- /**
1752
- * Start a run
1753
- *
1754
- * Creates a new run of the orchestration named by `orchestration_id`. By default the run executes durably in the background and this call returns immediately with status `queued`; poll `GET …/runs/{run_id}` to observe progress. Pass `wait: true` to block until the run reaches a terminal or `awaiting_input` state instead.
1755
- *
1756
- */
1757
- static startRun(options) {
1758
- return (options.client ?? client).post({
1759
- url: "/v1/projects/{project_id}/runs",
1760
- ...options,
1761
- headers: {
1762
- "Content-Type": "application/json",
1763
- ...options.headers
1764
- }
1765
- });
1766
- }
1767
- /**
1768
- * Get a run
1769
- *
1770
- * One run's status, accumulated state, per-node artifacts and execution trace.
1771
- *
1772
- */
1773
- static getRun(options) {
1774
- return (options.client ?? client).get({
1775
- url: "/v1/projects/{project_id}/runs/{run_id}",
1776
- ...options
1777
- });
1778
- }
1779
- /**
1780
- * Cancel a run
1781
- *
1782
- * Stops a run that has not yet reached a terminal state.
1783
- */
1784
- static cancelRun(options) {
1785
- return (options.client ?? client).post({
1786
- url: "/v1/projects/{project_id}/runs/{run_id}:cancel",
1787
- ...options
1788
- });
1789
- }
1790
- /**
1791
- * Resume a run
1792
- *
1793
- * Moves a run parked at `awaiting_input` forward — the single door for every resume, whatever the run is parked on. Send `output` to answer a human-node pause and advance past it; omit it to re-drive a run without answering anything, which re-parks a human or webhook-receive pause on the same node (useful for a delay/poll wait, or to nudge a run after an external side effect completed out of band).
1794
- * Only valid on a run whose status is `awaiting_input`; any other status answers 409.
1795
- *
1796
- */
1797
- static resumeRun(options) {
1798
- return (options.client ?? client).post({
1799
- url: "/v1/projects/{project_id}/runs/{run_id}:resume",
1800
- ...options,
1801
- headers: {
1802
- "Content-Type": "application/json",
1803
- ...options.headers
1804
- }
1805
- });
1806
- }
1807
- };
1808
1895
  var Sessions = class {
1809
1896
  /**
1810
1897
  * Open a session
@@ -2112,7 +2199,9 @@ var Triggers = class {
2112
2199
  /**
2113
2200
  * List triggers
2114
2201
  *
2115
- * The project's schedule triggers.
2202
+ * The project's schedule triggers, of either fronted target kind.
2203
+ * `total` is the runtime's count of the project's schedule triggers, so it can exceed the rows returned when a trigger was authored directly against the runtime with a target this surface doesn't front (the same bypass `getTrigger` answers `404` for). Pass `target_type` — which is filtered and counted upstream — when an exact count matters.
2204
+ *
2116
2205
  */
2117
2206
  static listTriggers(options) {
2118
2207
  return (options.client ?? client).get({
@@ -2123,7 +2212,7 @@ var Triggers = class {
2123
2212
  /**
2124
2213
  * Create a trigger
2125
2214
  *
2126
- * Schedules `target_id` (an agent in this project) to run on `cron`, a 5-field cron expression evaluated in UTC.
2215
+ * Schedules `target_id` an agent or an orchestration in this project, per `target_type` — to run on `cron`, a 5-field cron expression evaluated in UTC.
2127
2216
  *
2128
2217
  */
2129
2218
  static createTrigger(options) {
@@ -2159,7 +2248,7 @@ var Triggers = class {
2159
2248
  /**
2160
2249
  * Update a trigger
2161
2250
  *
2162
- * Retune the schedule, its target, or whether it fires at all. At least one field is required. `type` and `target_type` are immutable.
2251
+ * Retune the schedule, its target, or whether it fires at all. At least one field is required. `type` is immutable; `target_type` may be changed only together with `target_id`.
2163
2252
  *
2164
2253
  */
2165
2254
  static updateTrigger(options) {
@@ -2387,12 +2476,14 @@ var NaturaliClient = class {
2387
2476
  generations;
2388
2477
  knowledge;
2389
2478
  models;
2479
+ orchestrations;
2390
2480
  projects;
2391
2481
  providers;
2392
2482
  sessions;
2393
2483
  tasks;
2394
2484
  tools;
2395
2485
  traces;
2486
+ triggers;
2396
2487
  webhooks;
2397
2488
  /** The underlying HTTP client, for interceptors or one-off requests. */
2398
2489
  http;
@@ -2414,14 +2505,16 @@ var NaturaliClient = class {
2414
2505
  this.generations = bindResource(Generations, this.http);
2415
2506
  this.knowledge = bindResource(Knowledge, this.http);
2416
2507
  this.models = bindResource(Models, this.http);
2508
+ this.orchestrations = bindResource(Orchestrations, this.http);
2417
2509
  this.projects = bindResource(Projects, this.http);
2418
2510
  this.providers = bindResource(Providers, this.http);
2419
2511
  this.sessions = bindResource(Sessions, this.http);
2420
2512
  this.tasks = bindResource(Tasks, this.http);
2421
2513
  this.tools = bindResource(Tools, this.http);
2422
2514
  this.traces = bindResource(Traces, this.http);
2515
+ this.triggers = bindResource(Triggers, this.http);
2423
2516
  this.webhooks = bindResource(Webhooks, this.http);
2424
2517
  }
2425
2518
  };
2426
2519
  //#endregion
2427
- export { Actors, Agents, ApiKeys, Assistant, Auth, Boards, Channels, Generations, Knowledge, Models, NaturaliClient, Projects, Providers, Runs, Sessions, Tasks, Tools, Traces, Triggers, Webhooks, createClient, createConfig };
2520
+ export { Actors, Agents, ApiKeys, Assistant, Auth, Boards, Channels, Generations, Knowledge, Models, NaturaliClient, Orchestrations, Projects, Providers, Sessions, Tasks, Tools, Traces, Triggers, Webhooks, createClient, createConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/sdk",
3
- "version": "0.51.1",
3
+ "version": "0.53.0",
4
4
  "description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -37,7 +37,7 @@
37
37
  "tsx": "^4.23.1",
38
38
  "typescript": "~6.0.3",
39
39
  "vitest": "^4.1.10",
40
- "@naturali/api": "0.51.1"
40
+ "@naturali/api": "0.53.0"
41
41
  },
42
42
  "scripts": {
43
43
  "generate": "tsx scripts/generate.ts",