@naturali/sdk 0.50.0 → 0.51.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
@@ -1735,6 +1735,76 @@ var Providers = class {
1735
1735
  });
1736
1736
  }
1737
1737
  };
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
+ };
1738
1808
  var Sessions = class {
1739
1809
  /**
1740
1810
  * Open a session
@@ -2038,6 +2108,108 @@ var Traces = class {
2038
2108
  });
2039
2109
  }
2040
2110
  };
2111
+ var Triggers = class {
2112
+ /**
2113
+ * List triggers
2114
+ *
2115
+ * The project's schedule triggers.
2116
+ */
2117
+ static listTriggers(options) {
2118
+ return (options.client ?? client).get({
2119
+ url: "/v1/projects/{project_id}/triggers",
2120
+ ...options
2121
+ });
2122
+ }
2123
+ /**
2124
+ * Create a trigger
2125
+ *
2126
+ * Schedules `target_id` (an agent in this project) to run on `cron`, a 5-field cron expression evaluated in UTC.
2127
+ *
2128
+ */
2129
+ static createTrigger(options) {
2130
+ return (options.client ?? client).post({
2131
+ url: "/v1/projects/{project_id}/triggers",
2132
+ ...options,
2133
+ headers: {
2134
+ "Content-Type": "application/json",
2135
+ ...options.headers
2136
+ }
2137
+ });
2138
+ }
2139
+ /**
2140
+ * Delete a trigger
2141
+ *
2142
+ * Removes the trigger. Its firing history is kept.
2143
+ */
2144
+ static deleteTrigger(options) {
2145
+ return (options.client ?? client).delete({
2146
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}",
2147
+ ...options
2148
+ });
2149
+ }
2150
+ /**
2151
+ * Get a trigger
2152
+ */
2153
+ static getTrigger(options) {
2154
+ return (options.client ?? client).get({
2155
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}",
2156
+ ...options
2157
+ });
2158
+ }
2159
+ /**
2160
+ * Update a trigger
2161
+ *
2162
+ * Retune the schedule, its target, or whether it fires at all. At least one field is required. `type` and `target_type` are immutable.
2163
+ *
2164
+ */
2165
+ static updateTrigger(options) {
2166
+ return (options.client ?? client).patch({
2167
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}",
2168
+ ...options,
2169
+ headers: {
2170
+ "Content-Type": "application/json",
2171
+ ...options.headers
2172
+ }
2173
+ });
2174
+ }
2175
+ /**
2176
+ * Fire a trigger manually
2177
+ *
2178
+ * Runs the trigger's target right now, outside its schedule, and waits for the run to finish. This is the `…:fire` action; the path segment is `{trigger_id}:fire`.
2179
+ * `input` is shallow-merged over the trigger's own stored `input` for this run only — the trigger's configuration is unchanged.
2180
+ *
2181
+ */
2182
+ static fireTrigger(options) {
2183
+ return (options.client ?? client).post({
2184
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}:fire",
2185
+ ...options,
2186
+ headers: {
2187
+ "Content-Type": "application/json",
2188
+ ...options.headers
2189
+ }
2190
+ });
2191
+ }
2192
+ /**
2193
+ * List a trigger's firings
2194
+ *
2195
+ * Every time this trigger ran, newest first — scheduled and manual alike.
2196
+ */
2197
+ static listTriggerFirings(options) {
2198
+ return (options.client ?? client).get({
2199
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}/firings",
2200
+ ...options
2201
+ });
2202
+ }
2203
+ /**
2204
+ * Get a trigger firing
2205
+ */
2206
+ static getTriggerFiring(options) {
2207
+ return (options.client ?? client).get({
2208
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}/firings/{firing_id}",
2209
+ ...options
2210
+ });
2211
+ }
2212
+ };
2041
2213
  var Webhooks = class {
2042
2214
  /**
2043
2215
  * List webhooks
@@ -2252,4 +2424,4 @@ var NaturaliClient = class {
2252
2424
  }
2253
2425
  };
2254
2426
  //#endregion
2255
- export { Actors, Agents, ApiKeys, Assistant, Auth, Boards, Channels, Generations, Knowledge, Models, NaturaliClient, Projects, Providers, Sessions, Tasks, Tools, Traces, Webhooks, createClient, createConfig };
2427
+ export { Actors, Agents, ApiKeys, Assistant, Auth, Boards, Channels, Generations, Knowledge, Models, NaturaliClient, Projects, Providers, Runs, 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.50.0",
3
+ "version": "0.51.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.50.0"
40
+ "@naturali/api": "0.51.0"
41
41
  },
42
42
  "scripts": {
43
43
  "generate": "tsx scripts/generate.ts",