@naturali/sdk 0.115.1 → 0.117.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 +52 -3
- package/dist/index.d.cts +212 -13
- package/dist/index.d.mts +212 -13
- package/dist/index.mjs +52 -3
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -3358,7 +3358,7 @@ var Orchestrations = class {
|
|
|
3358
3358
|
/**
|
|
3359
3359
|
* List orchestration runs
|
|
3360
3360
|
*
|
|
3361
|
-
* Returns orchestration runs the caller can access, optionally filtered by orchestration, by parent run, or by whether the run has a parent at all.
|
|
3361
|
+
* Returns orchestration runs the caller can access, optionally filtered by orchestration, by parent run, by status, or by whether the run has a parent at all.
|
|
3362
3362
|
*
|
|
3363
3363
|
* Note when aggregating: a run's `usage` covers its whole subtree, so summing it over a list that contains both a parent and its children counts the children more than once. Pass `nested=false` to sum over runs a caller started.
|
|
3364
3364
|
*/
|
|
@@ -3395,6 +3395,24 @@ var Orchestrations = class {
|
|
|
3395
3395
|
});
|
|
3396
3396
|
}
|
|
3397
3397
|
/**
|
|
3398
|
+
* Pause an orchestration run
|
|
3399
|
+
*
|
|
3400
|
+
* Parks a run in flight as `awaiting_input` at its next checkpoint, with a `required_action` of type `paused` naming the pause as operator-initiated rather than a node's. Unlike cancel, the run keeps its last checkpoint and resume-orchestration-run re-drives it from there — so work already done is deferred rather than discarded.
|
|
3401
|
+
* A `queued` or `sleeping` run is parked immediately (a sleeping run keeps the wake it was due, and resuming hands it back to the scheduler at that instant). A `running` run keeps running until the round in flight reaches its checkpoint, so the response may still read `running` while `pause_requested_at` is set. A run already parked on a human, webhook or approval node keeps that node's `required_action`; the pause is still recorded, which is what makes submit-human-input refuse until the run is resumed.
|
|
3402
|
+
* The pause fans out to the run's `loop` / `sub_orchestration` descendants — each parks at its own next checkpoint — because otherwise a parent's pause would bound nothing. Resuming does not fan out: each parked descendant is resumed by its own id.
|
|
3403
|
+
* Idempotent: pausing an already-paused run answers with it unchanged.
|
|
3404
|
+
*/
|
|
3405
|
+
static pauseOrchestrationRun(options) {
|
|
3406
|
+
return (options.client ?? client).post({
|
|
3407
|
+
url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/pause",
|
|
3408
|
+
...options,
|
|
3409
|
+
headers: {
|
|
3410
|
+
"Content-Type": "application/json",
|
|
3411
|
+
...options.headers
|
|
3412
|
+
}
|
|
3413
|
+
});
|
|
3414
|
+
}
|
|
3415
|
+
/**
|
|
3398
3416
|
* Submit human input
|
|
3399
3417
|
*
|
|
3400
3418
|
* Provides human input to a run that is awaiting_input at a human node.
|
|
@@ -3413,6 +3431,7 @@ var Orchestrations = class {
|
|
|
3413
3431
|
* Resume an orchestration run
|
|
3414
3432
|
*
|
|
3415
3433
|
* 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.
|
|
3434
|
+
* It is also the only thing that lifts an operator pause (pause-orchestration-run): a run parked with `required_action.type` of `paused` re-drives the frontier that had not run yet, and one paused mid-timer goes back to `sleeping` for the wake it was already due.
|
|
3416
3435
|
*/
|
|
3417
3436
|
static resumeOrchestrationRun(options) {
|
|
3418
3437
|
return (options.client ?? client).post({
|
|
@@ -3554,7 +3573,7 @@ var Quotas = class {
|
|
|
3554
3573
|
/**
|
|
3555
3574
|
* Create a quota
|
|
3556
3575
|
*
|
|
3557
|
-
* Creates a project-scoped quota. `requests` is valid for `scope: project`/`api_key`; `tokens` and `cost_usd` are valid for `scope: project`/`agent`/`actor`. Any other scope/metric pair is rejected with 400 (no attribution exists to enforce it). An `actor` quota caps one end user's spend, matched from the generation's session; a null `scope_ref` means one budget *per* actor rather than a pooled project total. A duplicate quota (same project, scope, scope_ref, metric, window) is rejected with 409.
|
|
3576
|
+
* Creates a project-scoped quota. `requests` is valid for `scope: project`/`api_key`; `tokens` and `cost_usd` are valid for `scope: project`/`agent`/`actor`. Any other scope/metric pair is rejected with 400 (no attribution exists to enforce it). An `actor` quota caps one end user's spend, matched from the generation's session; a null `scope_ref` means one budget *per* actor rather than a pooled project total. A `cost_usd` quota may name one `meter_type` to cap; omitting it caps every priced meter. A duplicate quota (same project, scope, scope_ref, metric, window, meter_type) is rejected with 409.
|
|
3558
3577
|
*/
|
|
3559
3578
|
static createQuota(options) {
|
|
3560
3579
|
return (options.client ?? client).post({
|
|
@@ -3861,7 +3880,7 @@ var Tasks = class {
|
|
|
3861
3880
|
/**
|
|
3862
3881
|
* List tasks
|
|
3863
3882
|
*
|
|
3864
|
-
* Lists tasks (the board query). Filter by workflow, state, status, or assignee — `GET /tasks?workflow_id=...&state=...` is one board column.
|
|
3883
|
+
* Lists tasks (the board query). Filter by workflow, state, status, automation status, or assignee — `GET /tasks?workflow_id=...&state=...` is one board column.
|
|
3865
3884
|
*/
|
|
3866
3885
|
static listTasks(options) {
|
|
3867
3886
|
return (options.client ?? client).get({
|
|
@@ -3937,6 +3956,36 @@ var Tasks = class {
|
|
|
3937
3956
|
});
|
|
3938
3957
|
}
|
|
3939
3958
|
/**
|
|
3959
|
+
* Pause a task
|
|
3960
|
+
*
|
|
3961
|
+
* Pauses a task's automation. While a pause is in force no state's `on_enter` dispatches and no retry chain continues — an agent generation, a tool call and a sub-orchestration alike — so the task stops spending without losing its place.
|
|
3962
|
+
* A workflow has no run object, so this is the workflow half of pause-orchestration-run: the pause lands on the instance, which is the task. Transitions are deliberately still allowed — a move costs nothing while every dispatch it would start is suppressed — so a board stays usable under a pause. Entering a state whose dispatch is suppressed records `automation_status: paused`, which resume-task reads to know that state still owes its work.
|
|
3963
|
+
* A dispatch already in flight is left to finish, and its outcome still routes; only what would start after it is suppressed.
|
|
3964
|
+
* Idempotent: pausing an already-paused task answers with it unchanged.
|
|
3965
|
+
*/
|
|
3966
|
+
static pauseTask(options) {
|
|
3967
|
+
return (options.client ?? client).post({
|
|
3968
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}/pause",
|
|
3969
|
+
...options,
|
|
3970
|
+
headers: {
|
|
3971
|
+
"Content-Type": "application/json",
|
|
3972
|
+
...options.headers
|
|
3973
|
+
}
|
|
3974
|
+
});
|
|
3975
|
+
}
|
|
3976
|
+
/**
|
|
3977
|
+
* Resume a task
|
|
3978
|
+
*
|
|
3979
|
+
* Lifts a task's pause. When the pause suppressed the current state's `on_enter` — `automation_status: paused` — that dispatch is started now, as the caller resuming rather than as whoever last moved the task. A state whose dispatch had already completed, or that declares none, is left alone, so a resume never re-spends work the pause did not stop.
|
|
3980
|
+
* This is the only way a pause is lifted; a task that is merely idle is advanced by firing a transition instead.
|
|
3981
|
+
*/
|
|
3982
|
+
static resumeTask(options) {
|
|
3983
|
+
return (options.client ?? client).post({
|
|
3984
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}/resume",
|
|
3985
|
+
...options
|
|
3986
|
+
});
|
|
3987
|
+
}
|
|
3988
|
+
/**
|
|
3940
3989
|
* Get task history
|
|
3941
3990
|
*
|
|
3942
3991
|
* Returns the append-only transition history of a task.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.117.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.
|
|
40
|
+
"@naturali/api": "0.117.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"generate": "tsx scripts/generate.ts",
|