@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.cjs CHANGED
@@ -1594,6 +1594,163 @@ var Models = class {
1594
1594
  });
1595
1595
  }
1596
1596
  };
1597
+ var Orchestrations = class {
1598
+ /**
1599
+ * List orchestrations
1600
+ *
1601
+ * Lists the project's orchestration definitions.
1602
+ */
1603
+ static listOrchestrations(options) {
1604
+ return (options.client ?? client).get({
1605
+ url: "/v1/projects/{project_id}/orchestrations",
1606
+ ...options
1607
+ });
1608
+ }
1609
+ /**
1610
+ * Create an orchestration
1611
+ *
1612
+ * Creates a new orchestration (pipeline) definition in the project.
1613
+ */
1614
+ static createOrchestration(options) {
1615
+ return (options.client ?? client).post({
1616
+ url: "/v1/projects/{project_id}/orchestrations",
1617
+ ...options,
1618
+ headers: {
1619
+ "Content-Type": "application/json",
1620
+ ...options.headers
1621
+ }
1622
+ });
1623
+ }
1624
+ /**
1625
+ * Validate an orchestration graph
1626
+ *
1627
+ * 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`.
1628
+ *
1629
+ */
1630
+ static validateOrchestration(options) {
1631
+ return (options.client ?? client).post({
1632
+ url: "/v1/projects/{project_id}/orchestrations/validate",
1633
+ ...options,
1634
+ headers: {
1635
+ "Content-Type": "application/json",
1636
+ ...options.headers
1637
+ }
1638
+ });
1639
+ }
1640
+ /**
1641
+ * Delete an orchestration
1642
+ *
1643
+ * Deletes the orchestration definition and all of its runs.
1644
+ */
1645
+ static deleteOrchestration(options) {
1646
+ return (options.client ?? client).delete({
1647
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
1648
+ ...options
1649
+ });
1650
+ }
1651
+ /**
1652
+ * Get an orchestration
1653
+ *
1654
+ * Returns one orchestration with its nodes and edges. Belonging to another project responds `404`, not `403` — existence is not leaked.
1655
+ *
1656
+ */
1657
+ static getOrchestration(options) {
1658
+ return (options.client ?? client).get({
1659
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
1660
+ ...options
1661
+ });
1662
+ }
1663
+ /**
1664
+ * Update an orchestration
1665
+ *
1666
+ * Partially updates an orchestration's definition.
1667
+ */
1668
+ static updateOrchestration(options) {
1669
+ return (options.client ?? client).patch({
1670
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
1671
+ ...options,
1672
+ headers: {
1673
+ "Content-Type": "application/json",
1674
+ ...options.headers
1675
+ }
1676
+ });
1677
+ }
1678
+ /**
1679
+ * List orchestration runs
1680
+ *
1681
+ * 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.
1682
+ *
1683
+ */
1684
+ static listOrchestrationRuns(options) {
1685
+ return (options.client ?? client).get({
1686
+ url: "/v1/projects/{project_id}/orchestration-runs",
1687
+ ...options
1688
+ });
1689
+ }
1690
+ /**
1691
+ * Start an orchestration run
1692
+ *
1693
+ * 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.
1694
+ */
1695
+ static startOrchestrationRun(options) {
1696
+ return (options.client ?? client).post({
1697
+ url: "/v1/projects/{project_id}/orchestration-runs",
1698
+ ...options,
1699
+ headers: {
1700
+ "Content-Type": "application/json",
1701
+ ...options.headers
1702
+ }
1703
+ });
1704
+ }
1705
+ /**
1706
+ * Get an orchestration run
1707
+ *
1708
+ * Returns the status, state, and artifacts of one run.
1709
+ */
1710
+ static getOrchestrationRun(options) {
1711
+ return (options.client ?? client).get({
1712
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}",
1713
+ ...options
1714
+ });
1715
+ }
1716
+ /**
1717
+ * Cancel an orchestration run
1718
+ *
1719
+ * Cancels a run that has not yet reached a terminal state.
1720
+ */
1721
+ static cancelOrchestrationRun(options) {
1722
+ return (options.client ?? client).post({
1723
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/cancel",
1724
+ ...options
1725
+ });
1726
+ }
1727
+ /**
1728
+ * Resume an orchestration run
1729
+ *
1730
+ * 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.
1731
+ */
1732
+ static resumeOrchestrationRun(options) {
1733
+ return (options.client ?? client).post({
1734
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/resume",
1735
+ ...options
1736
+ });
1737
+ }
1738
+ /**
1739
+ * Submit human input
1740
+ *
1741
+ * Provides human input to a run that is `awaiting_input` at a human node, and advances it.
1742
+ */
1743
+ static submitHumanInput(options) {
1744
+ return (options.client ?? client).post({
1745
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/human-input",
1746
+ ...options,
1747
+ headers: {
1748
+ "Content-Type": "application/json",
1749
+ ...options.headers
1750
+ }
1751
+ });
1752
+ }
1753
+ };
1597
1754
  var Projects = class {
1598
1755
  /**
1599
1756
  * List projects
@@ -1736,76 +1893,6 @@ var Providers = class {
1736
1893
  });
1737
1894
  }
1738
1895
  };
1739
- var Runs = class {
1740
- /**
1741
- * List runs
1742
- *
1743
- * 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).
1744
- *
1745
- */
1746
- static listRuns(options) {
1747
- return (options.client ?? client).get({
1748
- url: "/v1/projects/{project_id}/runs",
1749
- ...options
1750
- });
1751
- }
1752
- /**
1753
- * Start a run
1754
- *
1755
- * 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.
1756
- *
1757
- */
1758
- static startRun(options) {
1759
- return (options.client ?? client).post({
1760
- url: "/v1/projects/{project_id}/runs",
1761
- ...options,
1762
- headers: {
1763
- "Content-Type": "application/json",
1764
- ...options.headers
1765
- }
1766
- });
1767
- }
1768
- /**
1769
- * Get a run
1770
- *
1771
- * One run's status, accumulated state, per-node artifacts and execution trace.
1772
- *
1773
- */
1774
- static getRun(options) {
1775
- return (options.client ?? client).get({
1776
- url: "/v1/projects/{project_id}/runs/{run_id}",
1777
- ...options
1778
- });
1779
- }
1780
- /**
1781
- * Cancel a run
1782
- *
1783
- * Stops a run that has not yet reached a terminal state.
1784
- */
1785
- static cancelRun(options) {
1786
- return (options.client ?? client).post({
1787
- url: "/v1/projects/{project_id}/runs/{run_id}:cancel",
1788
- ...options
1789
- });
1790
- }
1791
- /**
1792
- * Resume a run
1793
- *
1794
- * 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).
1795
- * Only valid on a run whose status is `awaiting_input`; any other status answers 409.
1796
- *
1797
- */
1798
- static resumeRun(options) {
1799
- return (options.client ?? client).post({
1800
- url: "/v1/projects/{project_id}/runs/{run_id}:resume",
1801
- ...options,
1802
- headers: {
1803
- "Content-Type": "application/json",
1804
- ...options.headers
1805
- }
1806
- });
1807
- }
1808
- };
1809
1896
  var Sessions = class {
1810
1897
  /**
1811
1898
  * Open a session
@@ -2113,7 +2200,9 @@ var Triggers = class {
2113
2200
  /**
2114
2201
  * List triggers
2115
2202
  *
2116
- * The project's schedule triggers.
2203
+ * The project's schedule triggers, of either fronted target kind.
2204
+ * `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.
2205
+ *
2117
2206
  */
2118
2207
  static listTriggers(options) {
2119
2208
  return (options.client ?? client).get({
@@ -2124,7 +2213,7 @@ var Triggers = class {
2124
2213
  /**
2125
2214
  * Create a trigger
2126
2215
  *
2127
- * Schedules `target_id` (an agent in this project) to run on `cron`, a 5-field cron expression evaluated in UTC.
2216
+ * 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.
2128
2217
  *
2129
2218
  */
2130
2219
  static createTrigger(options) {
@@ -2160,7 +2249,7 @@ var Triggers = class {
2160
2249
  /**
2161
2250
  * Update a trigger
2162
2251
  *
2163
- * Retune the schedule, its target, or whether it fires at all. At least one field is required. `type` and `target_type` are immutable.
2252
+ * 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`.
2164
2253
  *
2165
2254
  */
2166
2255
  static updateTrigger(options) {
@@ -2388,12 +2477,14 @@ var NaturaliClient = class {
2388
2477
  generations;
2389
2478
  knowledge;
2390
2479
  models;
2480
+ orchestrations;
2391
2481
  projects;
2392
2482
  providers;
2393
2483
  sessions;
2394
2484
  tasks;
2395
2485
  tools;
2396
2486
  traces;
2487
+ triggers;
2397
2488
  webhooks;
2398
2489
  /** The underlying HTTP client, for interceptors or one-off requests. */
2399
2490
  http;
@@ -2415,12 +2506,14 @@ var NaturaliClient = class {
2415
2506
  this.generations = bindResource(Generations, this.http);
2416
2507
  this.knowledge = bindResource(Knowledge, this.http);
2417
2508
  this.models = bindResource(Models, this.http);
2509
+ this.orchestrations = bindResource(Orchestrations, this.http);
2418
2510
  this.projects = bindResource(Projects, this.http);
2419
2511
  this.providers = bindResource(Providers, this.http);
2420
2512
  this.sessions = bindResource(Sessions, this.http);
2421
2513
  this.tasks = bindResource(Tasks, this.http);
2422
2514
  this.tools = bindResource(Tools, this.http);
2423
2515
  this.traces = bindResource(Traces, this.http);
2516
+ this.triggers = bindResource(Triggers, this.http);
2424
2517
  this.webhooks = bindResource(Webhooks, this.http);
2425
2518
  }
2426
2519
  };
@@ -2436,9 +2529,9 @@ exports.Generations = Generations;
2436
2529
  exports.Knowledge = Knowledge;
2437
2530
  exports.Models = Models;
2438
2531
  exports.NaturaliClient = NaturaliClient;
2532
+ exports.Orchestrations = Orchestrations;
2439
2533
  exports.Projects = Projects;
2440
2534
  exports.Providers = Providers;
2441
- exports.Runs = Runs;
2442
2535
  exports.Sessions = Sessions;
2443
2536
  exports.Tasks = Tasks;
2444
2537
  exports.Tools = Tools;