@naturali/cli 0.115.1 → 0.116.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 +137 -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.
|
|
17
|
+
var version = "0.116.0";
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region ../sdk/src/generated/core/bodySerializer.gen.ts
|
|
20
20
|
const serializeFormDataPair = (data, key, value) => {
|
|
@@ -3413,6 +3413,24 @@ var Orchestrations = class {
|
|
|
3413
3413
|
});
|
|
3414
3414
|
}
|
|
3415
3415
|
/**
|
|
3416
|
+
* Pause an orchestration run
|
|
3417
|
+
*
|
|
3418
|
+
* 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.
|
|
3419
|
+
* 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.
|
|
3420
|
+
* 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.
|
|
3421
|
+
* Idempotent: pausing an already-paused run answers with it unchanged.
|
|
3422
|
+
*/
|
|
3423
|
+
static pauseOrchestrationRun(options) {
|
|
3424
|
+
return (options.client ?? client).post({
|
|
3425
|
+
url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/pause",
|
|
3426
|
+
...options,
|
|
3427
|
+
headers: {
|
|
3428
|
+
"Content-Type": "application/json",
|
|
3429
|
+
...options.headers
|
|
3430
|
+
}
|
|
3431
|
+
});
|
|
3432
|
+
}
|
|
3433
|
+
/**
|
|
3416
3434
|
* Submit human input
|
|
3417
3435
|
*
|
|
3418
3436
|
* Provides human input to a run that is awaiting_input at a human node.
|
|
@@ -3431,6 +3449,7 @@ var Orchestrations = class {
|
|
|
3431
3449
|
* Resume an orchestration run
|
|
3432
3450
|
*
|
|
3433
3451
|
* 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.
|
|
3452
|
+
* 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.
|
|
3434
3453
|
*/
|
|
3435
3454
|
static resumeOrchestrationRun(options) {
|
|
3436
3455
|
return (options.client ?? client).post({
|
|
@@ -3955,6 +3974,36 @@ var Tasks = class {
|
|
|
3955
3974
|
});
|
|
3956
3975
|
}
|
|
3957
3976
|
/**
|
|
3977
|
+
* Pause a task
|
|
3978
|
+
*
|
|
3979
|
+
* 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.
|
|
3980
|
+
* 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.
|
|
3981
|
+
* A dispatch already in flight is left to finish, and its outcome still routes; only what would start after it is suppressed.
|
|
3982
|
+
* Idempotent: pausing an already-paused task answers with it unchanged.
|
|
3983
|
+
*/
|
|
3984
|
+
static pauseTask(options) {
|
|
3985
|
+
return (options.client ?? client).post({
|
|
3986
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}/pause",
|
|
3987
|
+
...options,
|
|
3988
|
+
headers: {
|
|
3989
|
+
"Content-Type": "application/json",
|
|
3990
|
+
...options.headers
|
|
3991
|
+
}
|
|
3992
|
+
});
|
|
3993
|
+
}
|
|
3994
|
+
/**
|
|
3995
|
+
* Resume a task
|
|
3996
|
+
*
|
|
3997
|
+
* 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.
|
|
3998
|
+
* This is the only way a pause is lifted; a task that is merely idle is advanced by firing a transition instead.
|
|
3999
|
+
*/
|
|
4000
|
+
static resumeTask(options) {
|
|
4001
|
+
return (options.client ?? client).post({
|
|
4002
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}/resume",
|
|
4003
|
+
...options
|
|
4004
|
+
});
|
|
4005
|
+
}
|
|
4006
|
+
/**
|
|
3958
4007
|
* Get task history
|
|
3959
4008
|
*
|
|
3960
4009
|
* Returns the append-only transition history of a task.
|
|
@@ -13065,6 +13114,38 @@ const routes = {
|
|
|
13065
13114
|
"in": "path"
|
|
13066
13115
|
}]
|
|
13067
13116
|
},
|
|
13117
|
+
"pause-orchestration-run": {
|
|
13118
|
+
serviceClass: "Orchestrations",
|
|
13119
|
+
operationId: "pauseOrchestrationRun",
|
|
13120
|
+
description: "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. 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. 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. Idempotent: pausing an already-paused run answers with it unchanged.",
|
|
13121
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
|
|
13122
|
+
httpMethod: "post",
|
|
13123
|
+
pathParams: ["project_id", "orchestration_run_id"],
|
|
13124
|
+
queryParams: [],
|
|
13125
|
+
flags: [
|
|
13126
|
+
{
|
|
13127
|
+
"name": "project_id",
|
|
13128
|
+
"description": "Project public ID (proj_ prefix).",
|
|
13129
|
+
"required": true,
|
|
13130
|
+
"type": "string",
|
|
13131
|
+
"in": "path"
|
|
13132
|
+
},
|
|
13133
|
+
{
|
|
13134
|
+
"name": "orchestration_run_id",
|
|
13135
|
+
"description": "Public ID of the run (run_...)",
|
|
13136
|
+
"required": true,
|
|
13137
|
+
"type": "string",
|
|
13138
|
+
"in": "path"
|
|
13139
|
+
},
|
|
13140
|
+
{
|
|
13141
|
+
"name": "reason",
|
|
13142
|
+
"description": "Why the run is being paused, surfaced on the parked run's `required_action.reason` and on `pause_reason`.",
|
|
13143
|
+
"required": false,
|
|
13144
|
+
"type": "string",
|
|
13145
|
+
"in": "body"
|
|
13146
|
+
}
|
|
13147
|
+
]
|
|
13148
|
+
},
|
|
13068
13149
|
"submit-human-input": {
|
|
13069
13150
|
serviceClass: "Orchestrations",
|
|
13070
13151
|
operationId: "submitHumanInput",
|
|
@@ -13107,7 +13188,7 @@ const routes = {
|
|
|
13107
13188
|
"resume-orchestration-run": {
|
|
13108
13189
|
serviceClass: "Orchestrations",
|
|
13109
13190
|
operationId: "resumeOrchestrationRun",
|
|
13110
|
-
description: "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.",
|
|
13191
|
+
description: "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. 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.",
|
|
13111
13192
|
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/orchestrations",
|
|
13112
13193
|
httpMethod: "post",
|
|
13113
13194
|
pathParams: ["project_id", "orchestration_run_id"],
|
|
@@ -14499,6 +14580,60 @@ const routes = {
|
|
|
14499
14580
|
}
|
|
14500
14581
|
]
|
|
14501
14582
|
},
|
|
14583
|
+
"pause-task": {
|
|
14584
|
+
serviceClass: "Tasks",
|
|
14585
|
+
operationId: "pauseTask",
|
|
14586
|
+
description: "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. 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. A dispatch already in flight is left to finish, and its outcome still routes; only what would start after it is suppressed. Idempotent: pausing an already-paused task answers with it unchanged.",
|
|
14587
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/tasks",
|
|
14588
|
+
httpMethod: "post",
|
|
14589
|
+
pathParams: ["project_id", "task_id"],
|
|
14590
|
+
queryParams: [],
|
|
14591
|
+
flags: [
|
|
14592
|
+
{
|
|
14593
|
+
"name": "project_id",
|
|
14594
|
+
"description": "Project public ID (proj_ prefix).",
|
|
14595
|
+
"required": true,
|
|
14596
|
+
"type": "string",
|
|
14597
|
+
"in": "path"
|
|
14598
|
+
},
|
|
14599
|
+
{
|
|
14600
|
+
"name": "task_id",
|
|
14601
|
+
"description": "",
|
|
14602
|
+
"required": true,
|
|
14603
|
+
"type": "string",
|
|
14604
|
+
"in": "path"
|
|
14605
|
+
},
|
|
14606
|
+
{
|
|
14607
|
+
"name": "reason",
|
|
14608
|
+
"description": "Why the task is being paused, surfaced on `pause_reason`.",
|
|
14609
|
+
"required": false,
|
|
14610
|
+
"type": "string",
|
|
14611
|
+
"in": "body"
|
|
14612
|
+
}
|
|
14613
|
+
]
|
|
14614
|
+
},
|
|
14615
|
+
"resume-task": {
|
|
14616
|
+
serviceClass: "Tasks",
|
|
14617
|
+
operationId: "resumeTask",
|
|
14618
|
+
description: "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. This is the only way a pause is lifted; a task that is merely idle is advanced by firing a transition instead.",
|
|
14619
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/tasks",
|
|
14620
|
+
httpMethod: "post",
|
|
14621
|
+
pathParams: ["project_id", "task_id"],
|
|
14622
|
+
queryParams: [],
|
|
14623
|
+
flags: [{
|
|
14624
|
+
"name": "project_id",
|
|
14625
|
+
"description": "Project public ID (proj_ prefix).",
|
|
14626
|
+
"required": true,
|
|
14627
|
+
"type": "string",
|
|
14628
|
+
"in": "path"
|
|
14629
|
+
}, {
|
|
14630
|
+
"name": "task_id",
|
|
14631
|
+
"description": "",
|
|
14632
|
+
"required": true,
|
|
14633
|
+
"type": "string",
|
|
14634
|
+
"in": "path"
|
|
14635
|
+
}]
|
|
14636
|
+
},
|
|
14502
14637
|
"get-task-history": {
|
|
14503
14638
|
serviceClass: "Tasks",
|
|
14504
14639
|
operationId: "getTaskHistory",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.116.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.
|
|
33
|
+
"@naturali/sdk": "0.116.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"generate": "tsx scripts/generate.ts",
|