@naturali/sdk 0.52.0 → 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
@@ -2042,7 +2199,9 @@ var Triggers = class {
2042
2199
  /**
2043
2200
  * List triggers
2044
2201
  *
2045
- * 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
+ *
2046
2205
  */
2047
2206
  static listTriggers(options) {
2048
2207
  return (options.client ?? client).get({
@@ -2053,7 +2212,7 @@ var Triggers = class {
2053
2212
  /**
2054
2213
  * Create a trigger
2055
2214
  *
2056
- * 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.
2057
2216
  *
2058
2217
  */
2059
2218
  static createTrigger(options) {
@@ -2089,7 +2248,7 @@ var Triggers = class {
2089
2248
  /**
2090
2249
  * Update a trigger
2091
2250
  *
2092
- * 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`.
2093
2252
  *
2094
2253
  */
2095
2254
  static updateTrigger(options) {
@@ -2317,12 +2476,14 @@ var NaturaliClient = class {
2317
2476
  generations;
2318
2477
  knowledge;
2319
2478
  models;
2479
+ orchestrations;
2320
2480
  projects;
2321
2481
  providers;
2322
2482
  sessions;
2323
2483
  tasks;
2324
2484
  tools;
2325
2485
  traces;
2486
+ triggers;
2326
2487
  webhooks;
2327
2488
  /** The underlying HTTP client, for interceptors or one-off requests. */
2328
2489
  http;
@@ -2344,14 +2505,16 @@ var NaturaliClient = class {
2344
2505
  this.generations = bindResource(Generations, this.http);
2345
2506
  this.knowledge = bindResource(Knowledge, this.http);
2346
2507
  this.models = bindResource(Models, this.http);
2508
+ this.orchestrations = bindResource(Orchestrations, this.http);
2347
2509
  this.projects = bindResource(Projects, this.http);
2348
2510
  this.providers = bindResource(Providers, this.http);
2349
2511
  this.sessions = bindResource(Sessions, this.http);
2350
2512
  this.tasks = bindResource(Tasks, this.http);
2351
2513
  this.tools = bindResource(Tools, this.http);
2352
2514
  this.traces = bindResource(Traces, this.http);
2515
+ this.triggers = bindResource(Triggers, this.http);
2353
2516
  this.webhooks = bindResource(Webhooks, this.http);
2354
2517
  }
2355
2518
  };
2356
2519
  //#endregion
2357
- export { Actors, Agents, ApiKeys, Assistant, Auth, Boards, Channels, Generations, Knowledge, Models, NaturaliClient, Projects, Providers, 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.52.0",
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.52.0"
40
+ "@naturali/api": "0.53.0"
41
41
  },
42
42
  "scripts": {
43
43
  "generate": "tsx scripts/generate.ts",