@naturali/sdk 0.69.0 → 0.71.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
@@ -2079,7 +2079,7 @@ var Models = class {
2079
2079
  /**
2080
2080
  * List models
2081
2081
  *
2082
- * Lists catalog models, sorted by id. Filter by vendor, provider, input/output modality, status, or `managed` — the last being the axis that decides whether a model is usable without bringing your own provider credentials, so `?managed=true&status=available` is the set a project can enable today.
2082
+ * Lists catalog models, sorted by id. Filter by vendor, provider, input/output modality, status, or `managed` — the last being the axis that decides whether a model is usable without bringing your own provider credentials, so `?managed=true&status=available` is the set a project's managed provider serves today.
2083
2083
  *
2084
2084
  */
2085
2085
  static listModels(options) {
@@ -2098,14 +2098,14 @@ var Models = class {
2098
2098
  });
2099
2099
  }
2100
2100
  /**
2101
- * Enable a naturali-managed model
2101
+ * Enable naturali models
2102
2102
  *
2103
- * Provisions a managed provider running this model in the project. The provider needs no credentials of yours it runs on naturali's own model access and is priced from the catalog the moment it is created, so its usage is metered from the first generation. The created resource is an ordinary provider: read, update and delete it through [`GET /v1/projects/{project_id}/ai-providers/{ai_provider_id}`](/docs/api/ai-providers/get-ai-provider) like any other. Requires the `admin` role in the project. Only models with `managed: true` can be enabled; anything else is a 400.
2103
+ * Provisions the project's managed provider the one provider through which every model the catalog marks `managed: true` is available. It needs no credentials of yours (it runs on naturali's own model access) and is priced from the catalog for all managed models the moment it is created, so any of them is usable from an agent's `model` field — set it to the catalog's `provider_model` — and metered from the first generation. Models that join the catalog later are priced onto the provider automatically by the daily sync; enabling is a one-time act per project, not per model, and calling it again returns the existing provider as a `200` instead of creating a duplicate. The created resource is an ordinary provider: read, update and delete it through [`GET /v1/projects/{project_id}/ai-providers/{ai_provider_id}`](/docs/api/ai-providers/get-ai-provider) like any other. Requires the `admin` role in the project.
2104
2104
  *
2105
2105
  */
2106
- static enableManagedModel(options) {
2106
+ static enableManagedModels(options) {
2107
2107
  return (options.client ?? client).post({
2108
- url: "/v1/projects/{project_id}/models/{model_id}/providers",
2108
+ url: "/v1/projects/{project_id}/models/providers",
2109
2109
  ...options,
2110
2110
  headers: {
2111
2111
  "Content-Type": "application/json",
@@ -2114,6 +2114,219 @@ var Models = class {
2114
2114
  });
2115
2115
  }
2116
2116
  };
2117
+ var Orchestrations = class {
2118
+ /**
2119
+ * List orchestrations
2120
+ *
2121
+ * Returns orchestrations accessible to the caller.
2122
+ */
2123
+ static listOrchestrations(options) {
2124
+ return (options.client ?? client).get({
2125
+ url: "/v1/projects/{project_id}/orchestrations",
2126
+ ...options
2127
+ });
2128
+ }
2129
+ /**
2130
+ * Create an orchestration
2131
+ *
2132
+ * Creates a new orchestration (pipeline) definition in the project.
2133
+ */
2134
+ static createOrchestration(options) {
2135
+ return (options.client ?? client).post({
2136
+ url: "/v1/projects/{project_id}/orchestrations",
2137
+ ...options,
2138
+ headers: {
2139
+ "Content-Type": "application/json",
2140
+ ...options.headers
2141
+ }
2142
+ });
2143
+ }
2144
+ /**
2145
+ * Validate an orchestration graph
2146
+ *
2147
+ * Statically validates an orchestration graph without persisting anything. Checks that every node has its required field, node ids are unique, edges reference existing nodes, the graph is acyclic (unless it contains a loop node), and every `input_mapping` `{"var": "..."}` reference resolves to a state key written by an upstream node or seeded by `input_schema`. Returns blocking `errors` and non-blocking `warnings` (e.g. a state key only written on a conditional branch). The same `errors` checks are enforced on create and update, which fail with `400` when any error is present.
2148
+ *
2149
+ */
2150
+ static validateOrchestration(options) {
2151
+ return (options.client ?? client).post({
2152
+ url: "/v1/projects/{project_id}/orchestrations/validate",
2153
+ ...options,
2154
+ headers: {
2155
+ "Content-Type": "application/json",
2156
+ ...options.headers
2157
+ }
2158
+ });
2159
+ }
2160
+ /**
2161
+ * Get orchestration queue stats
2162
+ *
2163
+ * Returns a point-in-time snapshot of the orchestration run queue: how many tasks are waiting to be claimed (`queue_depth`), how many are currently claimed with a valid lease (`claimed_tasks`), the age of the oldest waiting task, recent claim-latency percentiles over a rolling in-process window, and a per-project breakdown. Intended for admin/operator policies; guarded by `orchestrations:GetQueueStats`. A project-scoped caller sees only their own projects under `per_project`.
2164
+ *
2165
+ */
2166
+ static getQueueStats(options) {
2167
+ return (options.client ?? client).get({
2168
+ security: [{
2169
+ scheme: "bearer",
2170
+ type: "http"
2171
+ }],
2172
+ url: "/v1/projects/{project_id}/orchestrations/queue/stats",
2173
+ ...options
2174
+ });
2175
+ }
2176
+ /**
2177
+ * Delete an orchestration
2178
+ *
2179
+ * Deletes an orchestration definition and all its runs.
2180
+ */
2181
+ static deleteOrchestration(options) {
2182
+ return (options.client ?? client).delete({
2183
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
2184
+ ...options
2185
+ });
2186
+ }
2187
+ /**
2188
+ * Get an orchestration
2189
+ *
2190
+ * Returns the orchestration with nodes and edges.
2191
+ */
2192
+ static getOrchestration(options) {
2193
+ return (options.client ?? client).get({
2194
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
2195
+ ...options
2196
+ });
2197
+ }
2198
+ /**
2199
+ * Update an orchestration
2200
+ *
2201
+ * Partially updates an orchestration definition.
2202
+ */
2203
+ static updateOrchestration(options) {
2204
+ return (options.client ?? client).patch({
2205
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
2206
+ ...options,
2207
+ headers: {
2208
+ "Content-Type": "application/json",
2209
+ ...options.headers
2210
+ }
2211
+ });
2212
+ }
2213
+ /**
2214
+ * List an orchestration's graph versions
2215
+ *
2216
+ * Returns the orchestration's archived graphs, newest first. A version is written on create and on every subsequent write that changes the graph (`nodes`, `edges`, `state_schema`, `input_schema`) — through the REST API or a formation apply alike. Metadata-only edits (name, description) do not archive a version. See [Versioning](/docs/modules/orchestrations#versioning).
2217
+ *
2218
+ */
2219
+ static listOrchestrationVersions(options) {
2220
+ return (options.client ?? client).get({
2221
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}/versions",
2222
+ ...options
2223
+ });
2224
+ }
2225
+ /**
2226
+ * Fetch an archived orchestration version
2227
+ *
2228
+ * Returns the exact graph a given version describes. Every run records the version it started on in `orchestration_version` and executes that graph for its whole life, so this is how you read the topology a run actually took — including a run whose orchestration has been rewired since.
2229
+ *
2230
+ */
2231
+ static getOrchestrationVersion(options) {
2232
+ return (options.client ?? client).get({
2233
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}/versions/{version}",
2234
+ ...options
2235
+ });
2236
+ }
2237
+ /**
2238
+ * Restore an archived orchestration graph
2239
+ *
2240
+ * Writes an archived version's graph back as the orchestration's live definition, which archives it again as a **new** version rather than rewinding the counter — so a run pinned to any version in between still resolves the graph it started on.
2241
+ *
2242
+ * The restore runs through the ordinary update path, so the archived graph goes through the same static validation as an authored one. Node resource references (`agent_id`, `tool_id`, `orchestration_id`) resolve when a run reaches the node, so a target deleted since the snapshot was taken restores cleanly and surfaces as a failed run rather than a `400`. Restoring the graph the orchestration already holds is a no-op and archives nothing. Runs already in flight are unaffected either way — a restore is an ordinary edit, and pinning is what keeps it from reaching them.
2243
+ *
2244
+ */
2245
+ static restoreOrchestrationVersion(options) {
2246
+ return (options.client ?? client).post({
2247
+ url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}/versions/{version}/restore",
2248
+ ...options,
2249
+ headers: {
2250
+ "Content-Type": "application/json",
2251
+ ...options.headers
2252
+ }
2253
+ });
2254
+ }
2255
+ /**
2256
+ * List orchestration runs
2257
+ *
2258
+ * Returns orchestration runs the caller can access, optionally filtered by orchestration.
2259
+ */
2260
+ static listOrchestrationRuns(options) {
2261
+ return (options.client ?? client).get({
2262
+ url: "/v1/projects/{project_id}/orchestration-runs",
2263
+ ...options
2264
+ });
2265
+ }
2266
+ /**
2267
+ * Start an orchestration run
2268
+ *
2269
+ * Creates a new run for the orchestration named by orchestration_id. By default the run executes durably in the background: the response returns immediately with status "queued" (a worker then claims it and moves it to "running") and progress is observed via get-orchestration-run or run lifecycle webhook events (orchestration_runs.started/awaiting_input/succeeded/failed). Delay and poll waits park the run as "sleeping" and are woken by a background scheduler, surviving restarts. Pass wait=true to block until the run reaches a terminal or awaiting_input state.
2270
+ */
2271
+ static startOrchestrationRun(options) {
2272
+ return (options.client ?? client).post({
2273
+ url: "/v1/projects/{project_id}/orchestration-runs",
2274
+ ...options,
2275
+ headers: {
2276
+ "Content-Type": "application/json",
2277
+ ...options.headers
2278
+ }
2279
+ });
2280
+ }
2281
+ /**
2282
+ * Cancel an orchestration run
2283
+ *
2284
+ * Cancels a run that has not yet reached a terminal state.
2285
+ */
2286
+ static cancelOrchestrationRun(options) {
2287
+ return (options.client ?? client).post({
2288
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/cancel",
2289
+ ...options
2290
+ });
2291
+ }
2292
+ /**
2293
+ * Submit human input
2294
+ *
2295
+ * Provides human input to a run that is awaiting_input at a human node.
2296
+ */
2297
+ static submitHumanInput(options) {
2298
+ return (options.client ?? client).post({
2299
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/human-input",
2300
+ ...options,
2301
+ headers: {
2302
+ "Content-Type": "application/json",
2303
+ ...options.headers
2304
+ }
2305
+ });
2306
+ }
2307
+ /**
2308
+ * Resume an orchestration run
2309
+ *
2310
+ * Re-drives an awaiting_input orchestration run from its last checkpoint. This does not satisfy the pause itself — it carries no node_id or payload, so a run parked on a human or webhook-receive node re-parks on the same node. Use submit-human-input to supply the awaited payload and advance the run.
2311
+ */
2312
+ static resumeOrchestrationRun(options) {
2313
+ return (options.client ?? client).post({
2314
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/resume",
2315
+ ...options
2316
+ });
2317
+ }
2318
+ /**
2319
+ * Get an orchestration run
2320
+ *
2321
+ * Returns the status, state, and artifacts of a specific run.
2322
+ */
2323
+ static getOrchestrationRun(options) {
2324
+ return (options.client ?? client).get({
2325
+ url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}",
2326
+ ...options
2327
+ });
2328
+ }
2329
+ };
2117
2330
  var Projects = class {
2118
2331
  /**
2119
2332
  * List projects
@@ -2467,6 +2680,97 @@ var Sessions = class {
2467
2680
  });
2468
2681
  }
2469
2682
  };
2683
+ var Tasks = class {
2684
+ /**
2685
+ * List tasks
2686
+ *
2687
+ * Lists tasks (the board query). Filter by workflow, state, status, or assignee — `GET /tasks?workflow_id=...&state=...` is one board column.
2688
+ */
2689
+ static listTasks(options) {
2690
+ return (options.client ?? client).get({
2691
+ url: "/v1/projects/{project_id}/tasks",
2692
+ ...options
2693
+ });
2694
+ }
2695
+ /**
2696
+ * Create a task
2697
+ *
2698
+ * Creates a task bound to a workflow. By default the task is placed in the workflow's initial state; passing `state` places it directly in that named state instead — an alternate entry point for starting a task mid-flow (e.g. "a new recorte for an existing theme by id"), rather than re-submitting from the initial state and hoping a guard or similarity gate recognizes it. Entering the resulting state, initial or named, behaves identically: that state's `on_enter` automation fires and its `stalled_after` clock arms.
2699
+ */
2700
+ static createTask(options) {
2701
+ return (options.client ?? client).post({
2702
+ url: "/v1/projects/{project_id}/tasks",
2703
+ ...options,
2704
+ headers: {
2705
+ "Content-Type": "application/json",
2706
+ ...options.headers
2707
+ }
2708
+ });
2709
+ }
2710
+ /**
2711
+ * Delete a task
2712
+ *
2713
+ * Deletes a task. Its transition history cascades.
2714
+ */
2715
+ static deleteTask(options) {
2716
+ return (options.client ?? client).delete({
2717
+ url: "/v1/projects/{project_id}/tasks/{task_id}",
2718
+ ...options
2719
+ });
2720
+ }
2721
+ /**
2722
+ * Get a task
2723
+ *
2724
+ * Retrieves a task, including its active dispatch and automation status.
2725
+ */
2726
+ static getTask(options) {
2727
+ return (options.client ?? client).get({
2728
+ url: "/v1/projects/{project_id}/tasks/{task_id}",
2729
+ ...options
2730
+ });
2731
+ }
2732
+ /**
2733
+ * Update a task
2734
+ *
2735
+ * Updates a task's payload, title, or assignee. `state` is never directly writable — move it with a transition; sending a `state` field is rejected as an unknown field (`VALIDATION_FAILED`). `payload` is shallow-merged over the existing payload (PATCH semantics): keys the request omits are preserved. The payload is caller-owned; the automation result lives in the read-only `last_result` field, which no patch can reach. The merged payload is validated against the workflow's `payload_schema`.
2736
+ */
2737
+ static updateTask(options) {
2738
+ return (options.client ?? client).patch({
2739
+ url: "/v1/projects/{project_id}/tasks/{task_id}",
2740
+ ...options,
2741
+ headers: {
2742
+ "Content-Type": "application/json",
2743
+ ...options.headers
2744
+ }
2745
+ });
2746
+ }
2747
+ /**
2748
+ * Transition a task
2749
+ *
2750
+ * Fires a named transition on a task. The transition must exist in the workflow and be valid from the task's current state; its guard must pass. This is the single path every state change routes through. A transition declaring `requires_approval` does not move the task — it parks a pending ApprovalItem and returns the task with `pending_transition` set; the move applies only when the approval is approved.
2751
+ */
2752
+ static transitionTask(options) {
2753
+ return (options.client ?? client).post({
2754
+ url: "/v1/projects/{project_id}/tasks/{task_id}/transitions",
2755
+ ...options,
2756
+ headers: {
2757
+ "Content-Type": "application/json",
2758
+ ...options.headers
2759
+ }
2760
+ });
2761
+ }
2762
+ /**
2763
+ * Get task history
2764
+ *
2765
+ * Returns the append-only transition history of a task.
2766
+ */
2767
+ static getTaskHistory(options) {
2768
+ return (options.client ?? client).get({
2769
+ url: "/v1/projects/{project_id}/tasks/{task_id}/history",
2770
+ ...options
2771
+ });
2772
+ }
2773
+ };
2470
2774
  var Tools = class {
2471
2775
  /**
2472
2776
  * List tools
@@ -2602,6 +2906,130 @@ var Traces = class {
2602
2906
  });
2603
2907
  }
2604
2908
  };
2909
+ var Triggers = class {
2910
+ /**
2911
+ * List triggers
2912
+ *
2913
+ * Lists triggers. Filter by project, starter type, or target type.
2914
+ */
2915
+ static listTriggers(options) {
2916
+ return (options.client ?? client).get({
2917
+ url: "/v1/projects/{project_id}/triggers",
2918
+ ...options
2919
+ });
2920
+ }
2921
+ /**
2922
+ * Create a trigger
2923
+ *
2924
+ * Creates a new trigger for a project
2925
+ */
2926
+ static createTrigger(options) {
2927
+ return (options.client ?? client).post({
2928
+ url: "/v1/projects/{project_id}/triggers",
2929
+ ...options,
2930
+ headers: {
2931
+ "Content-Type": "application/json",
2932
+ ...options.headers
2933
+ }
2934
+ });
2935
+ }
2936
+ /**
2937
+ * Delete a trigger
2938
+ *
2939
+ * Deletes a trigger
2940
+ */
2941
+ static deleteTrigger(options) {
2942
+ return (options.client ?? client).delete({
2943
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}",
2944
+ ...options
2945
+ });
2946
+ }
2947
+ /**
2948
+ * Get a trigger
2949
+ *
2950
+ * Retrieves the details of a specific trigger
2951
+ */
2952
+ static getTrigger(options) {
2953
+ return (options.client ?? client).get({
2954
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}",
2955
+ ...options
2956
+ });
2957
+ }
2958
+ /**
2959
+ * Update a trigger
2960
+ *
2961
+ * Updates an existing trigger's configuration. The type is immutable.
2962
+ */
2963
+ static updateTrigger(options) {
2964
+ return (options.client ?? client).patch({
2965
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}",
2966
+ ...options,
2967
+ headers: {
2968
+ "Content-Type": "application/json",
2969
+ ...options.headers
2970
+ }
2971
+ });
2972
+ }
2973
+ /**
2974
+ * Fire a trigger
2975
+ *
2976
+ * Fires a trigger synchronously and returns the terminal firing record. The firing itself always settles here; an `eval` target's run is queued rather than executed inline, so the record names a `queued` run to poll.
2977
+ */
2978
+ static fireTrigger(options) {
2979
+ return (options.client ?? client).post({
2980
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}/fire",
2981
+ ...options,
2982
+ headers: {
2983
+ "Content-Type": "application/json",
2984
+ ...options.headers
2985
+ }
2986
+ });
2987
+ }
2988
+ /**
2989
+ * Get trigger secret
2990
+ *
2991
+ * Retrieves the signing secret for a webhook trigger
2992
+ */
2993
+ static getTriggerSecret(options) {
2994
+ return (options.client ?? client).get({
2995
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}/secret",
2996
+ ...options
2997
+ });
2998
+ }
2999
+ /**
3000
+ * Rotate trigger secret
3001
+ *
3002
+ * Rotates the signing secret for a webhook trigger
3003
+ */
3004
+ static rotateTriggerSecret(options) {
3005
+ return (options.client ?? client).post({
3006
+ url: "/v1/projects/{project_id}/triggers/{trigger_id}/rotate-secret",
3007
+ ...options
3008
+ });
3009
+ }
3010
+ /**
3011
+ * List trigger firings
3012
+ *
3013
+ * Lists firings for a trigger (trigger_id is required).
3014
+ */
3015
+ static listTriggerFirings(options) {
3016
+ return (options.client ?? client).get({
3017
+ url: "/v1/projects/{project_id}/trigger-firings",
3018
+ ...options
3019
+ });
3020
+ }
3021
+ /**
3022
+ * Get a trigger firing
3023
+ *
3024
+ * Retrieves the details of a specific trigger firing
3025
+ */
3026
+ static getTriggerFiring(options) {
3027
+ return (options.client ?? client).get({
3028
+ url: "/v1/projects/{project_id}/trigger-firings/{firing_id}",
3029
+ ...options
3030
+ });
3031
+ }
3032
+ };
2605
3033
  var Users = class {
2606
3034
  /**
2607
3035
  * Get the current user
@@ -2751,6 +3179,113 @@ var Webhooks = class {
2751
3179
  });
2752
3180
  }
2753
3181
  };
3182
+ var Workflows = class {
3183
+ /**
3184
+ * List workflows
3185
+ *
3186
+ * Lists workflow definitions in a project.
3187
+ */
3188
+ static listWorkflows(options) {
3189
+ return (options.client ?? client).get({
3190
+ url: "/v1/projects/{project_id}/workflows",
3191
+ ...options
3192
+ });
3193
+ }
3194
+ /**
3195
+ * Create a workflow
3196
+ *
3197
+ * Creates a new workflow definition. The definition is statically validated.
3198
+ */
3199
+ static createWorkflow(options) {
3200
+ return (options.client ?? client).post({
3201
+ url: "/v1/projects/{project_id}/workflows",
3202
+ ...options,
3203
+ headers: {
3204
+ "Content-Type": "application/json",
3205
+ ...options.headers
3206
+ }
3207
+ });
3208
+ }
3209
+ /**
3210
+ * Delete a workflow
3211
+ *
3212
+ * Deletes a workflow. Rejected while open tasks exist.
3213
+ */
3214
+ static deleteWorkflow(options) {
3215
+ return (options.client ?? client).delete({
3216
+ url: "/v1/projects/{project_id}/workflows/{workflow_id}",
3217
+ ...options
3218
+ });
3219
+ }
3220
+ /**
3221
+ * Get a workflow
3222
+ *
3223
+ * Retrieves a workflow definition.
3224
+ */
3225
+ static getWorkflow(options) {
3226
+ return (options.client ?? client).get({
3227
+ url: "/v1/projects/{project_id}/workflows/{workflow_id}",
3228
+ ...options
3229
+ });
3230
+ }
3231
+ /**
3232
+ * Update a workflow
3233
+ *
3234
+ * Updates a workflow definition. Structural changes (states/transitions) are re-validated. Existing tasks in a removed state stay put but can only leave via transitions valid in the new definition.
3235
+ */
3236
+ static updateWorkflow(options) {
3237
+ return (options.client ?? client).patch({
3238
+ url: "/v1/projects/{project_id}/workflows/{workflow_id}",
3239
+ ...options,
3240
+ headers: {
3241
+ "Content-Type": "application/json",
3242
+ ...options.headers
3243
+ }
3244
+ });
3245
+ }
3246
+ /**
3247
+ * List a workflow's versions
3248
+ *
3249
+ * Returns the workflow's archived state machines, newest first. A version is written on create and on every subsequent write that changes the definition (`states`, `transitions`, `payload_schema`) — through the REST API or a formation apply alike. Metadata-only edits (name, description) do not archive a version. See [Versioning](/docs/modules/workflows#versioning).
3250
+ *
3251
+ */
3252
+ static listWorkflowVersions(options) {
3253
+ return (options.client ?? client).get({
3254
+ url: "/v1/projects/{project_id}/workflows/{workflow_id}/versions",
3255
+ ...options
3256
+ });
3257
+ }
3258
+ /**
3259
+ * Fetch an archived workflow version
3260
+ *
3261
+ * Returns the exact state machine a given version describes. Every task records the version it entered on in `workflow_version` and runs on that machine for its whole life, so this is how you read the definition a task is actually being validated against — including a task whose workflow has been rewired since.
3262
+ *
3263
+ */
3264
+ static getWorkflowVersion(options) {
3265
+ return (options.client ?? client).get({
3266
+ url: "/v1/projects/{project_id}/workflows/{workflow_id}/versions/{version}",
3267
+ ...options
3268
+ });
3269
+ }
3270
+ /**
3271
+ * Restore an archived workflow state machine
3272
+ *
3273
+ * Writes an archived version's state machine back as the workflow's live definition, which archives it again as a **new** version rather than rewinding the counter — so a task pinned to any version in between still runs on the machine it entered on.
3274
+ *
3275
+ * The restore runs through the ordinary update path, so the archived definition goes through the same validation as an authored one. That includes resolving every `on_enter` dispatch target, so restoring a version whose agent or orchestration has since been deleted fails with `400` rather than writing a definition that would strand a task on entry. Restoring the definition the workflow already holds is a no-op and archives nothing. Tasks already in flight are unaffected either way — a restore is an ordinary edit, and pinning is what keeps it from reaching them.
3276
+ *
3277
+ */
3278
+ static restoreWorkflowVersion(options) {
3279
+ return (options.client ?? client).post({
3280
+ url: "/v1/projects/{project_id}/workflows/{workflow_id}/versions/{version}/restore",
3281
+ ...options,
3282
+ headers: {
3283
+ "Content-Type": "application/json",
3284
+ ...options.headers
3285
+ }
3286
+ });
3287
+ }
3288
+ };
2754
3289
  //#endregion
2755
3290
  //#region src/naturaliClient.ts
2756
3291
  /**
@@ -2811,13 +3346,17 @@ var NaturaliClient = class {
2811
3346
  generations;
2812
3347
  modelRoutes;
2813
3348
  models;
3349
+ orchestrations;
2814
3350
  projects;
2815
3351
  secrets;
2816
3352
  sessions;
3353
+ tasks;
2817
3354
  tools;
2818
3355
  traces;
3356
+ triggers;
2819
3357
  users;
2820
3358
  webhooks;
3359
+ workflows;
2821
3360
  /** The underlying HTTP client, for interceptors or one-off requests. */
2822
3361
  http;
2823
3362
  constructor({ token, headers } = {}) {
@@ -2841,14 +3380,18 @@ var NaturaliClient = class {
2841
3380
  this.generations = bindResource(Generations, this.http);
2842
3381
  this.modelRoutes = bindResource(ModelRoutes, this.http);
2843
3382
  this.models = bindResource(Models, this.http);
3383
+ this.orchestrations = bindResource(Orchestrations, this.http);
2844
3384
  this.projects = bindResource(Projects, this.http);
2845
3385
  this.secrets = bindResource(Secrets, this.http);
2846
3386
  this.sessions = bindResource(Sessions, this.http);
3387
+ this.tasks = bindResource(Tasks, this.http);
2847
3388
  this.tools = bindResource(Tools, this.http);
2848
3389
  this.traces = bindResource(Traces, this.http);
3390
+ this.triggers = bindResource(Triggers, this.http);
2849
3391
  this.users = bindResource(Users, this.http);
2850
3392
  this.webhooks = bindResource(Webhooks, this.http);
3393
+ this.workflows = bindResource(Workflows, this.http);
2851
3394
  }
2852
3395
  };
2853
3396
  //#endregion
2854
- export { Actors, AgentVersions, Agents, AiProviders, ApiKeys, Assistant, Auth, Channels, Conversations, Evaluations, Generations, ModelRoutes, Models, NaturaliClient, Projects, Secrets, Sessions, Tools, Traces, Users, Webhooks, createClient, createConfig };
3397
+ export { Actors, AgentVersions, Agents, AiProviders, ApiKeys, Assistant, Auth, Channels, Conversations, Evaluations, Generations, ModelRoutes, Models, NaturaliClient, Orchestrations, Projects, Secrets, Sessions, Tasks, Tools, Traces, Triggers, Users, Webhooks, Workflows, createClient, createConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/sdk",
3
- "version": "0.69.0",
3
+ "version": "0.71.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.69.0"
40
+ "@naturali/api": "0.71.0"
41
41
  },
42
42
  "scripts": {
43
43
  "generate": "tsx scripts/generate.ts",