@naturali/cli 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.
Files changed (2) hide show
  1. package/dist/index.mjs +699 -310
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ var __exportAll = (all, no_symbols) => {
14
14
  };
15
15
  //#endregion
16
16
  //#region package.json
17
- var version = "0.51.1";
17
+ var version = "0.53.0";
18
18
  //#endregion
19
19
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
20
20
  const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
@@ -1611,6 +1611,163 @@ var Models = class {
1611
1611
  });
1612
1612
  }
1613
1613
  };
1614
+ var Orchestrations = class {
1615
+ /**
1616
+ * List orchestrations
1617
+ *
1618
+ * Lists the project's orchestration definitions.
1619
+ */
1620
+ static listOrchestrations(options) {
1621
+ return (options.client ?? client).get({
1622
+ url: "/v1/projects/{project_id}/orchestrations",
1623
+ ...options
1624
+ });
1625
+ }
1626
+ /**
1627
+ * Create an orchestration
1628
+ *
1629
+ * Creates a new orchestration (pipeline) definition in the project.
1630
+ */
1631
+ static createOrchestration(options) {
1632
+ return (options.client ?? client).post({
1633
+ url: "/v1/projects/{project_id}/orchestrations",
1634
+ ...options,
1635
+ headers: {
1636
+ "Content-Type": "application/json",
1637
+ ...options.headers
1638
+ }
1639
+ });
1640
+ }
1641
+ /**
1642
+ * Validate an orchestration graph
1643
+ *
1644
+ * 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`.
1645
+ *
1646
+ */
1647
+ static validateOrchestration(options) {
1648
+ return (options.client ?? client).post({
1649
+ url: "/v1/projects/{project_id}/orchestrations/validate",
1650
+ ...options,
1651
+ headers: {
1652
+ "Content-Type": "application/json",
1653
+ ...options.headers
1654
+ }
1655
+ });
1656
+ }
1657
+ /**
1658
+ * Delete an orchestration
1659
+ *
1660
+ * Deletes the orchestration definition and all of its runs.
1661
+ */
1662
+ static deleteOrchestration(options) {
1663
+ return (options.client ?? client).delete({
1664
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
1665
+ ...options
1666
+ });
1667
+ }
1668
+ /**
1669
+ * Get an orchestration
1670
+ *
1671
+ * Returns one orchestration with its nodes and edges. Belonging to another project responds `404`, not `403` — existence is not leaked.
1672
+ *
1673
+ */
1674
+ static getOrchestration(options) {
1675
+ return (options.client ?? client).get({
1676
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
1677
+ ...options
1678
+ });
1679
+ }
1680
+ /**
1681
+ * Update an orchestration
1682
+ *
1683
+ * Partially updates an orchestration's definition.
1684
+ */
1685
+ static updateOrchestration(options) {
1686
+ return (options.client ?? client).patch({
1687
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
1688
+ ...options,
1689
+ headers: {
1690
+ "Content-Type": "application/json",
1691
+ ...options.headers
1692
+ }
1693
+ });
1694
+ }
1695
+ /**
1696
+ * List orchestration runs
1697
+ *
1698
+ * 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.
1699
+ *
1700
+ */
1701
+ static listOrchestrationRuns(options) {
1702
+ return (options.client ?? client).get({
1703
+ url: "/v1/projects/{project_id}/orchestration-runs",
1704
+ ...options
1705
+ });
1706
+ }
1707
+ /**
1708
+ * Start an orchestration run
1709
+ *
1710
+ * 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.
1711
+ */
1712
+ static startOrchestrationRun(options) {
1713
+ return (options.client ?? client).post({
1714
+ url: "/v1/projects/{project_id}/orchestration-runs",
1715
+ ...options,
1716
+ headers: {
1717
+ "Content-Type": "application/json",
1718
+ ...options.headers
1719
+ }
1720
+ });
1721
+ }
1722
+ /**
1723
+ * Get an orchestration run
1724
+ *
1725
+ * Returns the status, state, and artifacts of one run.
1726
+ */
1727
+ static getOrchestrationRun(options) {
1728
+ return (options.client ?? client).get({
1729
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}",
1730
+ ...options
1731
+ });
1732
+ }
1733
+ /**
1734
+ * Cancel an orchestration run
1735
+ *
1736
+ * Cancels a run that has not yet reached a terminal state.
1737
+ */
1738
+ static cancelOrchestrationRun(options) {
1739
+ return (options.client ?? client).post({
1740
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/cancel",
1741
+ ...options
1742
+ });
1743
+ }
1744
+ /**
1745
+ * Resume an orchestration run
1746
+ *
1747
+ * 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.
1748
+ */
1749
+ static resumeOrchestrationRun(options) {
1750
+ return (options.client ?? client).post({
1751
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/resume",
1752
+ ...options
1753
+ });
1754
+ }
1755
+ /**
1756
+ * Submit human input
1757
+ *
1758
+ * Provides human input to a run that is `awaiting_input` at a human node, and advances it.
1759
+ */
1760
+ static submitHumanInput(options) {
1761
+ return (options.client ?? client).post({
1762
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/human-input",
1763
+ ...options,
1764
+ headers: {
1765
+ "Content-Type": "application/json",
1766
+ ...options.headers
1767
+ }
1768
+ });
1769
+ }
1770
+ };
1614
1771
  var Projects = class {
1615
1772
  /**
1616
1773
  * List projects
@@ -1753,76 +1910,6 @@ var Providers = class {
1753
1910
  });
1754
1911
  }
1755
1912
  };
1756
- var Runs = class {
1757
- /**
1758
- * List runs
1759
- *
1760
- * 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).
1761
- *
1762
- */
1763
- static listRuns(options) {
1764
- return (options.client ?? client).get({
1765
- url: "/v1/projects/{project_id}/runs",
1766
- ...options
1767
- });
1768
- }
1769
- /**
1770
- * Start a run
1771
- *
1772
- * 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.
1773
- *
1774
- */
1775
- static startRun(options) {
1776
- return (options.client ?? client).post({
1777
- url: "/v1/projects/{project_id}/runs",
1778
- ...options,
1779
- headers: {
1780
- "Content-Type": "application/json",
1781
- ...options.headers
1782
- }
1783
- });
1784
- }
1785
- /**
1786
- * Get a run
1787
- *
1788
- * One run's status, accumulated state, per-node artifacts and execution trace.
1789
- *
1790
- */
1791
- static getRun(options) {
1792
- return (options.client ?? client).get({
1793
- url: "/v1/projects/{project_id}/runs/{run_id}",
1794
- ...options
1795
- });
1796
- }
1797
- /**
1798
- * Cancel a run
1799
- *
1800
- * Stops a run that has not yet reached a terminal state.
1801
- */
1802
- static cancelRun(options) {
1803
- return (options.client ?? client).post({
1804
- url: "/v1/projects/{project_id}/runs/{run_id}:cancel",
1805
- ...options
1806
- });
1807
- }
1808
- /**
1809
- * Resume a run
1810
- *
1811
- * 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).
1812
- * Only valid on a run whose status is `awaiting_input`; any other status answers 409.
1813
- *
1814
- */
1815
- static resumeRun(options) {
1816
- return (options.client ?? client).post({
1817
- url: "/v1/projects/{project_id}/runs/{run_id}:resume",
1818
- ...options,
1819
- headers: {
1820
- "Content-Type": "application/json",
1821
- ...options.headers
1822
- }
1823
- });
1824
- }
1825
- };
1826
1913
  var Sessions = class {
1827
1914
  /**
1828
1915
  * Open a session
@@ -2130,7 +2217,9 @@ var Triggers = class {
2130
2217
  /**
2131
2218
  * List triggers
2132
2219
  *
2133
- * The project's schedule triggers.
2220
+ * The project's schedule triggers, of either fronted target kind.
2221
+ * `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.
2222
+ *
2134
2223
  */
2135
2224
  static listTriggers(options) {
2136
2225
  return (options.client ?? client).get({
@@ -2141,7 +2230,7 @@ var Triggers = class {
2141
2230
  /**
2142
2231
  * Create a trigger
2143
2232
  *
2144
- * Schedules `target_id` (an agent in this project) to run on `cron`, a 5-field cron expression evaluated in UTC.
2233
+ * 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.
2145
2234
  *
2146
2235
  */
2147
2236
  static createTrigger(options) {
@@ -2177,7 +2266,7 @@ var Triggers = class {
2177
2266
  /**
2178
2267
  * Update a trigger
2179
2268
  *
2180
- * Retune the schedule, its target, or whether it fires at all. At least one field is required. `type` and `target_type` are immutable.
2269
+ * 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`.
2181
2270
  *
2182
2271
  */
2183
2272
  static updateTrigger(options) {
@@ -2405,12 +2494,14 @@ var NaturaliClient = class {
2405
2494
  generations;
2406
2495
  knowledge;
2407
2496
  models;
2497
+ orchestrations;
2408
2498
  projects;
2409
2499
  providers;
2410
2500
  sessions;
2411
2501
  tasks;
2412
2502
  tools;
2413
2503
  traces;
2504
+ triggers;
2414
2505
  webhooks;
2415
2506
  /** The underlying HTTP client, for interceptors or one-off requests. */
2416
2507
  http;
@@ -2432,12 +2523,14 @@ var NaturaliClient = class {
2432
2523
  this.generations = bindResource(Generations, this.http);
2433
2524
  this.knowledge = bindResource(Knowledge, this.http);
2434
2525
  this.models = bindResource(Models, this.http);
2526
+ this.orchestrations = bindResource(Orchestrations, this.http);
2435
2527
  this.projects = bindResource(Projects, this.http);
2436
2528
  this.providers = bindResource(Providers, this.http);
2437
2529
  this.sessions = bindResource(Sessions, this.http);
2438
2530
  this.tasks = bindResource(Tasks, this.http);
2439
2531
  this.tools = bindResource(Tools, this.http);
2440
2532
  this.traces = bindResource(Traces, this.http);
2533
+ this.triggers = bindResource(Triggers, this.http);
2441
2534
  this.webhooks = bindResource(Webhooks, this.http);
2442
2535
  }
2443
2536
  };
@@ -2455,9 +2548,9 @@ var src_exports = /* @__PURE__ */ __exportAll({
2455
2548
  Knowledge: () => Knowledge,
2456
2549
  Models: () => Models,
2457
2550
  NaturaliClient: () => NaturaliClient,
2551
+ Orchestrations: () => Orchestrations,
2458
2552
  Projects: () => Projects,
2459
2553
  Providers: () => Providers,
2460
- Runs: () => Runs,
2461
2554
  Sessions: () => Sessions,
2462
2555
  Tasks: () => Tasks,
2463
2556
  Tools: () => Tools,
@@ -5600,66 +5693,44 @@ const routes = {
5600
5693
  "in": "path"
5601
5694
  }]
5602
5695
  },
5603
- "list-projects": {
5604
- serviceClass: "Projects",
5605
- operationId: "listProjects",
5606
- description: "Lists projects accessible to the caller.",
5607
- moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
5608
- httpMethod: "get",
5609
- pathParams: [],
5610
- queryParams: ["limit", "cursor"],
5611
- flags: [{
5612
- "name": "limit",
5613
- "description": "Maximum items per page.",
5614
- "required": false,
5615
- "type": "integer",
5616
- "in": "query"
5617
- }, {
5618
- "name": "cursor",
5619
- "description": "Opaque pagination cursor from a previous response's next_cursor.",
5620
- "required": false,
5621
- "type": "string",
5622
- "in": "query"
5623
- }]
5624
- },
5625
- "create-project": {
5626
- serviceClass: "Projects",
5627
- operationId: "createProject",
5628
- description: "Creates a project (one per client or per environment).",
5629
- moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
5630
- httpMethod: "post",
5631
- pathParams: [],
5632
- queryParams: [],
5633
- flags: [{
5634
- "name": "name",
5635
- "description": "Human-readable project name.",
5636
- "required": true,
5637
- "type": "string",
5638
- "in": "body"
5639
- }]
5640
- },
5641
- "get-project": {
5642
- serviceClass: "Projects",
5643
- operationId: "getProject",
5644
- description: "Get a project",
5645
- moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
5696
+ "list-orchestrations": {
5697
+ serviceClass: "Orchestrations",
5698
+ operationId: "listOrchestrations",
5699
+ description: "Lists the project's orchestration definitions.",
5700
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
5646
5701
  httpMethod: "get",
5647
5702
  pathParams: ["project_id"],
5648
- queryParams: [],
5649
- flags: [{
5650
- "name": "project_id",
5651
- "description": "Project public ID (proj_ prefix).",
5652
- "required": true,
5653
- "type": "string",
5654
- "in": "path"
5655
- }]
5703
+ queryParams: ["limit", "offset"],
5704
+ flags: [
5705
+ {
5706
+ "name": "project_id",
5707
+ "description": "Project public ID (proj_ prefix).",
5708
+ "required": true,
5709
+ "type": "string",
5710
+ "in": "path"
5711
+ },
5712
+ {
5713
+ "name": "limit",
5714
+ "description": "Maximum items to return (1–100).",
5715
+ "required": false,
5716
+ "type": "integer",
5717
+ "in": "query"
5718
+ },
5719
+ {
5720
+ "name": "offset",
5721
+ "description": "Items to skip. These lists page by offset rather than by naturali's usual opaque cursor because the upstream ordering is offset-based; a cursor here would only imitate a keyset.\n",
5722
+ "required": false,
5723
+ "type": "integer",
5724
+ "in": "query"
5725
+ }
5726
+ ]
5656
5727
  },
5657
- "update-project": {
5658
- serviceClass: "Projects",
5659
- operationId: "updateProject",
5660
- description: "Rename or archive a project. Archiving is reversible; resources are retained.",
5661
- moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
5662
- httpMethod: "patch",
5728
+ "create-orchestration": {
5729
+ serviceClass: "Orchestrations",
5730
+ operationId: "createOrchestration",
5731
+ description: "Creates a new orchestration (pipeline) definition in the project.",
5732
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
5733
+ httpMethod: "post",
5663
5734
  pathParams: ["project_id"],
5664
5735
  queryParams: [],
5665
5736
  flags: [
@@ -5673,29 +5744,480 @@ const routes = {
5673
5744
  {
5674
5745
  "name": "name",
5675
5746
  "description": "",
5676
- "required": false,
5747
+ "required": true,
5677
5748
  "type": "string",
5678
5749
  "in": "body"
5679
5750
  },
5680
5751
  {
5681
- "name": "status",
5752
+ "name": "description",
5682
5753
  "description": "",
5683
5754
  "required": false,
5684
5755
  "type": "string",
5685
5756
  "in": "body"
5686
- }
5687
- ]
5688
- },
5689
- "delete-project": {
5690
- serviceClass: "Projects",
5691
- operationId: "deleteProject",
5692
- description: "Permanently deletes the project and its backing runtime project. Fails with 409 if the runtime project still has dependent resources — remove them first, or pass `force=true` to delete the project and all its dependents (agents, providers, tools, sessions, generations, traces). Forcing is destructive and irreversible.",
5693
- moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
5694
- httpMethod: "delete",
5695
- pathParams: ["project_id"],
5696
- queryParams: ["force"],
5697
- flags: [{
5698
- "name": "project_id",
5757
+ },
5758
+ {
5759
+ "name": "nodes",
5760
+ "description": "",
5761
+ "required": true,
5762
+ "type": "array",
5763
+ "in": "body"
5764
+ },
5765
+ {
5766
+ "name": "edges",
5767
+ "description": "",
5768
+ "required": true,
5769
+ "type": "array",
5770
+ "in": "body"
5771
+ },
5772
+ {
5773
+ "name": "state_schema",
5774
+ "description": "",
5775
+ "required": false,
5776
+ "type": "object",
5777
+ "in": "body"
5778
+ },
5779
+ {
5780
+ "name": "input_schema",
5781
+ "description": "",
5782
+ "required": false,
5783
+ "type": "object",
5784
+ "in": "body"
5785
+ }
5786
+ ]
5787
+ },
5788
+ "validate-orchestration": {
5789
+ serviceClass: "Orchestrations",
5790
+ operationId: "validateOrchestration",
5791
+ description: "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`.",
5792
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
5793
+ httpMethod: "post",
5794
+ pathParams: ["project_id"],
5795
+ queryParams: [],
5796
+ flags: [
5797
+ {
5798
+ "name": "project_id",
5799
+ "description": "Project public ID (proj_ prefix).",
5800
+ "required": true,
5801
+ "type": "string",
5802
+ "in": "path"
5803
+ },
5804
+ {
5805
+ "name": "nodes",
5806
+ "description": "",
5807
+ "required": false,
5808
+ "type": "array",
5809
+ "in": "body"
5810
+ },
5811
+ {
5812
+ "name": "edges",
5813
+ "description": "",
5814
+ "required": false,
5815
+ "type": "array",
5816
+ "in": "body"
5817
+ },
5818
+ {
5819
+ "name": "input_schema",
5820
+ "description": "",
5821
+ "required": false,
5822
+ "type": "object",
5823
+ "in": "body"
5824
+ }
5825
+ ]
5826
+ },
5827
+ "get-orchestration": {
5828
+ serviceClass: "Orchestrations",
5829
+ operationId: "getOrchestration",
5830
+ description: "Returns one orchestration with its nodes and edges. Belonging to another project responds `404`, not `403` — existence is not leaked.",
5831
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
5832
+ httpMethod: "get",
5833
+ pathParams: ["project_id", "orchestration_id"],
5834
+ queryParams: [],
5835
+ flags: [{
5836
+ "name": "project_id",
5837
+ "description": "Project public ID (proj_ prefix).",
5838
+ "required": true,
5839
+ "type": "string",
5840
+ "in": "path"
5841
+ }, {
5842
+ "name": "orchestration_id",
5843
+ "description": "Orchestration public ID (orch_ prefix).",
5844
+ "required": true,
5845
+ "type": "string",
5846
+ "in": "path"
5847
+ }]
5848
+ },
5849
+ "update-orchestration": {
5850
+ serviceClass: "Orchestrations",
5851
+ operationId: "updateOrchestration",
5852
+ description: "Partially updates an orchestration's definition.",
5853
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
5854
+ httpMethod: "patch",
5855
+ pathParams: ["project_id", "orchestration_id"],
5856
+ queryParams: [],
5857
+ flags: [
5858
+ {
5859
+ "name": "project_id",
5860
+ "description": "Project public ID (proj_ prefix).",
5861
+ "required": true,
5862
+ "type": "string",
5863
+ "in": "path"
5864
+ },
5865
+ {
5866
+ "name": "orchestration_id",
5867
+ "description": "Orchestration public ID (orch_ prefix).",
5868
+ "required": true,
5869
+ "type": "string",
5870
+ "in": "path"
5871
+ },
5872
+ {
5873
+ "name": "name",
5874
+ "description": "",
5875
+ "required": false,
5876
+ "type": "string",
5877
+ "in": "body"
5878
+ },
5879
+ {
5880
+ "name": "description",
5881
+ "description": "",
5882
+ "required": false,
5883
+ "type": "string",
5884
+ "in": "body"
5885
+ },
5886
+ {
5887
+ "name": "nodes",
5888
+ "description": "",
5889
+ "required": false,
5890
+ "type": "array",
5891
+ "in": "body"
5892
+ },
5893
+ {
5894
+ "name": "edges",
5895
+ "description": "",
5896
+ "required": false,
5897
+ "type": "array",
5898
+ "in": "body"
5899
+ },
5900
+ {
5901
+ "name": "state_schema",
5902
+ "description": "",
5903
+ "required": false,
5904
+ "type": "object",
5905
+ "in": "body"
5906
+ },
5907
+ {
5908
+ "name": "input_schema",
5909
+ "description": "",
5910
+ "required": false,
5911
+ "type": "object",
5912
+ "in": "body"
5913
+ }
5914
+ ]
5915
+ },
5916
+ "delete-orchestration": {
5917
+ serviceClass: "Orchestrations",
5918
+ operationId: "deleteOrchestration",
5919
+ description: "Deletes the orchestration definition and all of its runs.",
5920
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
5921
+ httpMethod: "delete",
5922
+ pathParams: ["project_id", "orchestration_id"],
5923
+ queryParams: [],
5924
+ flags: [{
5925
+ "name": "project_id",
5926
+ "description": "Project public ID (proj_ prefix).",
5927
+ "required": true,
5928
+ "type": "string",
5929
+ "in": "path"
5930
+ }, {
5931
+ "name": "orchestration_id",
5932
+ "description": "Orchestration public ID (orch_ prefix).",
5933
+ "required": true,
5934
+ "type": "string",
5935
+ "in": "path"
5936
+ }]
5937
+ },
5938
+ "list-orchestration-runs": {
5939
+ serviceClass: "Orchestrations",
5940
+ operationId: "listOrchestrationRuns",
5941
+ description: "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.",
5942
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
5943
+ httpMethod: "get",
5944
+ pathParams: ["project_id"],
5945
+ queryParams: [
5946
+ "orchestration_id",
5947
+ "limit",
5948
+ "offset"
5949
+ ],
5950
+ flags: [
5951
+ {
5952
+ "name": "project_id",
5953
+ "description": "Project public ID (proj_ prefix).",
5954
+ "required": true,
5955
+ "type": "string",
5956
+ "in": "path"
5957
+ },
5958
+ {
5959
+ "name": "orchestration_id",
5960
+ "description": "Orchestration public ID to list runs of.",
5961
+ "required": true,
5962
+ "type": "string",
5963
+ "in": "query"
5964
+ },
5965
+ {
5966
+ "name": "limit",
5967
+ "description": "Maximum items to return (1–100).",
5968
+ "required": false,
5969
+ "type": "integer",
5970
+ "in": "query"
5971
+ },
5972
+ {
5973
+ "name": "offset",
5974
+ "description": "Items to skip. These lists page by offset rather than by naturali's usual opaque cursor because the upstream ordering is offset-based; a cursor here would only imitate a keyset.\n",
5975
+ "required": false,
5976
+ "type": "integer",
5977
+ "in": "query"
5978
+ }
5979
+ ]
5980
+ },
5981
+ "start-orchestration-run": {
5982
+ serviceClass: "Orchestrations",
5983
+ operationId: "startOrchestrationRun",
5984
+ description: "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.",
5985
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
5986
+ httpMethod: "post",
5987
+ pathParams: ["project_id"],
5988
+ queryParams: [],
5989
+ flags: [
5990
+ {
5991
+ "name": "project_id",
5992
+ "description": "Project public ID (proj_ prefix).",
5993
+ "required": true,
5994
+ "type": "string",
5995
+ "in": "path"
5996
+ },
5997
+ {
5998
+ "name": "orchestration_id",
5999
+ "description": "Orchestration to run.",
6000
+ "required": true,
6001
+ "type": "string",
6002
+ "in": "body"
6003
+ },
6004
+ {
6005
+ "name": "input",
6006
+ "description": "Initial state for the run, merged with orchestration defaults.",
6007
+ "required": false,
6008
+ "type": "object",
6009
+ "in": "body"
6010
+ },
6011
+ {
6012
+ "name": "wait",
6013
+ "description": "When true, block until the run reaches a terminal or `awaiting_input` state and return the settled run. When false (default), return immediately with `status: \"queued\"`.",
6014
+ "required": false,
6015
+ "type": "boolean",
6016
+ "in": "body"
6017
+ }
6018
+ ]
6019
+ },
6020
+ "get-orchestration-run": {
6021
+ serviceClass: "Orchestrations",
6022
+ operationId: "getOrchestrationRun",
6023
+ description: "Returns the status, state, and artifacts of one run.",
6024
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
6025
+ httpMethod: "get",
6026
+ pathParams: ["project_id", "orchestration_run_id"],
6027
+ queryParams: [],
6028
+ flags: [{
6029
+ "name": "project_id",
6030
+ "description": "Project public ID (proj_ prefix).",
6031
+ "required": true,
6032
+ "type": "string",
6033
+ "in": "path"
6034
+ }, {
6035
+ "name": "orchestration_run_id",
6036
+ "description": "Orchestration run public ID (orch_run_ prefix).",
6037
+ "required": true,
6038
+ "type": "string",
6039
+ "in": "path"
6040
+ }]
6041
+ },
6042
+ "cancel-orchestration-run": {
6043
+ serviceClass: "Orchestrations",
6044
+ operationId: "cancelOrchestrationRun",
6045
+ description: "Cancels a run that has not yet reached a terminal state.",
6046
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
6047
+ httpMethod: "post",
6048
+ pathParams: ["project_id", "orchestration_run_id"],
6049
+ queryParams: [],
6050
+ flags: [{
6051
+ "name": "project_id",
6052
+ "description": "Project public ID (proj_ prefix).",
6053
+ "required": true,
6054
+ "type": "string",
6055
+ "in": "path"
6056
+ }, {
6057
+ "name": "orchestration_run_id",
6058
+ "description": "Orchestration run public ID (orch_run_ prefix).",
6059
+ "required": true,
6060
+ "type": "string",
6061
+ "in": "path"
6062
+ }]
6063
+ },
6064
+ "resume-orchestration-run": {
6065
+ serviceClass: "Orchestrations",
6066
+ operationId: "resumeOrchestrationRun",
6067
+ description: "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.",
6068
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
6069
+ httpMethod: "post",
6070
+ pathParams: ["project_id", "orchestration_run_id"],
6071
+ queryParams: [],
6072
+ flags: [{
6073
+ "name": "project_id",
6074
+ "description": "Project public ID (proj_ prefix).",
6075
+ "required": true,
6076
+ "type": "string",
6077
+ "in": "path"
6078
+ }, {
6079
+ "name": "orchestration_run_id",
6080
+ "description": "Orchestration run public ID (orch_run_ prefix).",
6081
+ "required": true,
6082
+ "type": "string",
6083
+ "in": "path"
6084
+ }]
6085
+ },
6086
+ "submit-human-input": {
6087
+ serviceClass: "Orchestrations",
6088
+ operationId: "submitHumanInput",
6089
+ description: "Provides human input to a run that is `awaiting_input` at a human node, and advances it.",
6090
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
6091
+ httpMethod: "post",
6092
+ pathParams: ["project_id", "orchestration_run_id"],
6093
+ queryParams: [],
6094
+ flags: [
6095
+ {
6096
+ "name": "project_id",
6097
+ "description": "Project public ID (proj_ prefix).",
6098
+ "required": true,
6099
+ "type": "string",
6100
+ "in": "path"
6101
+ },
6102
+ {
6103
+ "name": "orchestration_run_id",
6104
+ "description": "Orchestration run public ID (orch_run_ prefix).",
6105
+ "required": true,
6106
+ "type": "string",
6107
+ "in": "path"
6108
+ },
6109
+ {
6110
+ "name": "node_id",
6111
+ "description": "ID of the human node to satisfy.",
6112
+ "required": true,
6113
+ "type": "string",
6114
+ "in": "body"
6115
+ },
6116
+ {
6117
+ "name": "output",
6118
+ "description": "Output/response provided by the human reviewer.",
6119
+ "required": false,
6120
+ "type": "object",
6121
+ "in": "body"
6122
+ }
6123
+ ]
6124
+ },
6125
+ "list-projects": {
6126
+ serviceClass: "Projects",
6127
+ operationId: "listProjects",
6128
+ description: "Lists projects accessible to the caller.",
6129
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
6130
+ httpMethod: "get",
6131
+ pathParams: [],
6132
+ queryParams: ["limit", "cursor"],
6133
+ flags: [{
6134
+ "name": "limit",
6135
+ "description": "Maximum items per page.",
6136
+ "required": false,
6137
+ "type": "integer",
6138
+ "in": "query"
6139
+ }, {
6140
+ "name": "cursor",
6141
+ "description": "Opaque pagination cursor from a previous response's next_cursor.",
6142
+ "required": false,
6143
+ "type": "string",
6144
+ "in": "query"
6145
+ }]
6146
+ },
6147
+ "create-project": {
6148
+ serviceClass: "Projects",
6149
+ operationId: "createProject",
6150
+ description: "Creates a project (one per client or per environment).",
6151
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
6152
+ httpMethod: "post",
6153
+ pathParams: [],
6154
+ queryParams: [],
6155
+ flags: [{
6156
+ "name": "name",
6157
+ "description": "Human-readable project name.",
6158
+ "required": true,
6159
+ "type": "string",
6160
+ "in": "body"
6161
+ }]
6162
+ },
6163
+ "get-project": {
6164
+ serviceClass: "Projects",
6165
+ operationId: "getProject",
6166
+ description: "Get a project",
6167
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
6168
+ httpMethod: "get",
6169
+ pathParams: ["project_id"],
6170
+ queryParams: [],
6171
+ flags: [{
6172
+ "name": "project_id",
6173
+ "description": "Project public ID (proj_ prefix).",
6174
+ "required": true,
6175
+ "type": "string",
6176
+ "in": "path"
6177
+ }]
6178
+ },
6179
+ "update-project": {
6180
+ serviceClass: "Projects",
6181
+ operationId: "updateProject",
6182
+ description: "Rename or archive a project. Archiving is reversible; resources are retained.",
6183
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
6184
+ httpMethod: "patch",
6185
+ pathParams: ["project_id"],
6186
+ queryParams: [],
6187
+ flags: [
6188
+ {
6189
+ "name": "project_id",
6190
+ "description": "Project public ID (proj_ prefix).",
6191
+ "required": true,
6192
+ "type": "string",
6193
+ "in": "path"
6194
+ },
6195
+ {
6196
+ "name": "name",
6197
+ "description": "",
6198
+ "required": false,
6199
+ "type": "string",
6200
+ "in": "body"
6201
+ },
6202
+ {
6203
+ "name": "status",
6204
+ "description": "",
6205
+ "required": false,
6206
+ "type": "string",
6207
+ "in": "body"
6208
+ }
6209
+ ]
6210
+ },
6211
+ "delete-project": {
6212
+ serviceClass: "Projects",
6213
+ operationId: "deleteProject",
6214
+ description: "Permanently deletes the project and its backing runtime project. Fails with 409 if the runtime project still has dependent resources — remove them first, or pass `force=true` to delete the project and all its dependents (agents, providers, tools, sessions, generations, traces). Forcing is destructive and irreversible.",
6215
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
6216
+ httpMethod: "delete",
6217
+ pathParams: ["project_id"],
6218
+ queryParams: ["force"],
6219
+ flags: [{
6220
+ "name": "project_id",
5699
6221
  "description": "Project public ID (proj_ prefix).",
5700
6222
  "required": true,
5701
6223
  "type": "string",
@@ -5964,164 +6486,6 @@ const routes = {
5964
6486
  }
5965
6487
  ]
5966
6488
  },
5967
- "list-runs": {
5968
- serviceClass: "Runs",
5969
- operationId: "listRuns",
5970
- description: "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).",
5971
- moduleDocsUrl: "https://docs.naturali.ai/docs/modules/runs",
5972
- httpMethod: "get",
5973
- pathParams: ["project_id"],
5974
- queryParams: [
5975
- "orchestration_id",
5976
- "limit",
5977
- "cursor"
5978
- ],
5979
- flags: [
5980
- {
5981
- "name": "project_id",
5982
- "description": "Project public ID (proj_ prefix).",
5983
- "required": true,
5984
- "type": "string",
5985
- "in": "path"
5986
- },
5987
- {
5988
- "name": "orchestration_id",
5989
- "description": "Only runs of this orchestration. Required — see the file description for why a project-wide feed is not offered. An orchestration this project does not own is a 404, not an empty page.\n",
5990
- "required": true,
5991
- "type": "string",
5992
- "in": "query"
5993
- },
5994
- {
5995
- "name": "limit",
5996
- "description": "Maximum items per page.",
5997
- "required": false,
5998
- "type": "integer",
5999
- "in": "query"
6000
- },
6001
- {
6002
- "name": "cursor",
6003
- "description": "Opaque pagination cursor from a previous response's next_cursor.",
6004
- "required": false,
6005
- "type": "string",
6006
- "in": "query"
6007
- }
6008
- ]
6009
- },
6010
- "start-run": {
6011
- serviceClass: "Runs",
6012
- operationId: "startRun",
6013
- description: "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.",
6014
- moduleDocsUrl: "https://docs.naturali.ai/docs/modules/runs",
6015
- httpMethod: "post",
6016
- pathParams: ["project_id"],
6017
- queryParams: [],
6018
- flags: [
6019
- {
6020
- "name": "project_id",
6021
- "description": "Project public ID (proj_ prefix).",
6022
- "required": true,
6023
- "type": "string",
6024
- "in": "path"
6025
- },
6026
- {
6027
- "name": "orchestration_id",
6028
- "description": "The orchestration to run.",
6029
- "required": true,
6030
- "type": "string",
6031
- "in": "body"
6032
- },
6033
- {
6034
- "name": "input",
6035
- "description": "Initial state for the run, merged with the orchestration's own defaults.",
6036
- "required": false,
6037
- "type": "object",
6038
- "in": "body"
6039
- },
6040
- {
6041
- "name": "wait",
6042
- "description": "When true, block until the run reaches a terminal or `awaiting_input` state and return the settled run. When false (default), return immediately with `status: \"queued\"`.\n",
6043
- "required": false,
6044
- "type": "boolean",
6045
- "in": "body"
6046
- }
6047
- ]
6048
- },
6049
- "get-run": {
6050
- serviceClass: "Runs",
6051
- operationId: "getRun",
6052
- description: "One run's status, accumulated state, per-node artifacts and execution trace.",
6053
- moduleDocsUrl: "https://docs.naturali.ai/docs/modules/runs",
6054
- httpMethod: "get",
6055
- pathParams: ["project_id", "run_id"],
6056
- queryParams: [],
6057
- flags: [{
6058
- "name": "project_id",
6059
- "description": "Project public ID (proj_ prefix).",
6060
- "required": true,
6061
- "type": "string",
6062
- "in": "path"
6063
- }, {
6064
- "name": "run_id",
6065
- "description": "Run public ID (orch_run_ prefix).",
6066
- "required": true,
6067
- "type": "string",
6068
- "in": "path"
6069
- }]
6070
- },
6071
- "cancel-run": {
6072
- serviceClass: "Runs",
6073
- operationId: "cancelRun",
6074
- description: "Stops a run that has not yet reached a terminal state.",
6075
- moduleDocsUrl: "https://docs.naturali.ai/docs/modules/runs",
6076
- httpMethod: "post",
6077
- pathParams: ["project_id", "run_id"],
6078
- queryParams: [],
6079
- flags: [{
6080
- "name": "project_id",
6081
- "description": "Project public ID (proj_ prefix).",
6082
- "required": true,
6083
- "type": "string",
6084
- "in": "path"
6085
- }, {
6086
- "name": "run_id",
6087
- "description": "Run public ID (orch_run_ prefix).",
6088
- "required": true,
6089
- "type": "string",
6090
- "in": "path"
6091
- }]
6092
- },
6093
- "resume-run": {
6094
- serviceClass: "Runs",
6095
- operationId: "resumeRun",
6096
- description: "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). Only valid on a run whose status is `awaiting_input`; any other status answers 409.",
6097
- moduleDocsUrl: "https://docs.naturali.ai/docs/modules/runs",
6098
- httpMethod: "post",
6099
- pathParams: ["project_id", "run_id"],
6100
- queryParams: [],
6101
- flags: [
6102
- {
6103
- "name": "project_id",
6104
- "description": "Project public ID (proj_ prefix).",
6105
- "required": true,
6106
- "type": "string",
6107
- "in": "path"
6108
- },
6109
- {
6110
- "name": "run_id",
6111
- "description": "Run public ID (orch_run_ prefix).",
6112
- "required": true,
6113
- "type": "string",
6114
- "in": "path"
6115
- },
6116
- {
6117
- "name": "output",
6118
- "description": "Answers a human-node pause and advances the run past it. Omit to re-drive the run without answering anything.\n",
6119
- "required": false,
6120
- "type": "object",
6121
- "in": "body"
6122
- }
6123
- ]
6124
- },
6125
6489
  "create-session": {
6126
6490
  serviceClass: "Sessions",
6127
6491
  operationId: "createSession",
@@ -7073,11 +7437,15 @@ const routes = {
7073
7437
  "list-triggers": {
7074
7438
  serviceClass: "Triggers",
7075
7439
  operationId: "listTriggers",
7076
- description: "The project's schedule triggers.",
7440
+ description: "The project's schedule triggers, of either fronted target kind. `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.",
7077
7441
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/triggers",
7078
7442
  httpMethod: "get",
7079
7443
  pathParams: ["project_id"],
7080
- queryParams: ["limit", "offset"],
7444
+ queryParams: [
7445
+ "target_type",
7446
+ "limit",
7447
+ "offset"
7448
+ ],
7081
7449
  flags: [
7082
7450
  {
7083
7451
  "name": "project_id",
@@ -7086,6 +7454,13 @@ const routes = {
7086
7454
  "type": "string",
7087
7455
  "in": "path"
7088
7456
  },
7457
+ {
7458
+ "name": "target_type",
7459
+ "description": "Narrow the page to one target kind. Filtered and counted upstream, so `total` is exact. Omit it to list both kinds — see the operation's note on `total`.\n",
7460
+ "required": false,
7461
+ "type": "string",
7462
+ "in": "query"
7463
+ },
7089
7464
  {
7090
7465
  "name": "limit",
7091
7466
  "description": "Maximum items to return (1–100).",
@@ -7105,7 +7480,7 @@ const routes = {
7105
7480
  "create-trigger": {
7106
7481
  serviceClass: "Triggers",
7107
7482
  operationId: "createTrigger",
7108
- description: "Schedules `target_id` (an agent in this project) to run on `cron`, a 5-field cron expression evaluated in UTC.",
7483
+ description: "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.",
7109
7484
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/triggers",
7110
7485
  httpMethod: "post",
7111
7486
  pathParams: ["project_id"],
@@ -7132,9 +7507,16 @@ const routes = {
7132
7507
  "type": "string",
7133
7508
  "in": "body"
7134
7509
  },
7510
+ {
7511
+ "name": "target_type",
7512
+ "description": "Which kind of resource `target_id` names. Defaults to `agent`, so a body written before the orchestration target existed keeps its meaning.\n",
7513
+ "required": false,
7514
+ "type": "string",
7515
+ "in": "body"
7516
+ },
7135
7517
  {
7136
7518
  "name": "target_id",
7137
- "description": "The agent this trigger runs. Must belong to this project.",
7519
+ "description": "The agent or orchestration this trigger runs, per `target_type`. Must belong to this project — an id from another project is `404`.\n",
7138
7520
  "required": true,
7139
7521
  "type": "string",
7140
7522
  "in": "body"
@@ -7187,7 +7569,7 @@ const routes = {
7187
7569
  "update-trigger": {
7188
7570
  serviceClass: "Triggers",
7189
7571
  operationId: "updateTrigger",
7190
- description: "Retune the schedule, its target, or whether it fires at all. At least one field is required. `type` and `target_type` are immutable.",
7572
+ description: "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`.",
7191
7573
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/triggers",
7192
7574
  httpMethod: "patch",
7193
7575
  pathParams: ["project_id", "trigger_id"],
@@ -7221,6 +7603,13 @@ const routes = {
7221
7603
  "type": "string",
7222
7604
  "in": "body"
7223
7605
  },
7606
+ {
7607
+ "name": "target_type",
7608
+ "description": "Change what kind of resource the trigger runs. Must be sent **together with `target_id`** — the kind and the id are one target, and accepting the kind alone would leave the trigger pointing at an id of the wrong kind (`400`). Sending `target_id` on its own is fine and keeps the trigger's current kind, which is the kind the new id is validated against.\n",
7609
+ "required": false,
7610
+ "type": "string",
7611
+ "in": "body"
7612
+ },
7224
7613
  {
7225
7614
  "name": "target_id",
7226
7615
  "description": "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.51.1",
3
+ "version": "0.53.0",
4
4
  "description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,7 +30,7 @@
30
30
  "tsx": "^4.23.1",
31
31
  "typescript": "~6.0.3",
32
32
  "vitest": "^4.1.10",
33
- "@naturali/sdk": "0.51.1"
33
+ "@naturali/sdk": "0.53.0"
34
34
  },
35
35
  "scripts": {
36
36
  "generate": "tsx scripts/generate.ts",