@naturali/sdk 0.255.0 → 0.257.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 +67 -4
- package/dist/index.d.cts +451 -29
- package/dist/index.d.mts +451 -29
- package/dist/index.mjs +67 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -4936,7 +4936,7 @@ var Playbooks = class {
|
|
|
4936
4936
|
/**
|
|
4937
4937
|
* Run a node of a case
|
|
4938
4938
|
*
|
|
4939
|
-
* Runs one node now. The cascade already runs every node whose inputs are set once a write, a settle or a resume makes it runnable, and never reruns a `failed` or `done` one: this is how a failed node is retried, and how a `done` node is recomputed after an upgrade changed its executor. A `collect` node takes its own input values as its output, any other node starts its executor with the node's input values mapped through the executor's `input`. The executor runs under the `policy_ids` of the case's playbook version, which must allow starting it:
|
|
4939
|
+
* Runs one node now. The cascade already runs every node whose inputs are set once a write, a settle or a resume makes it runnable, and never reruns a `failed` or `done` one: this is how a failed node is retried, and how a `done` node is recomputed after an upgrade changed its executor. A `collect` node takes its own input values as its output, any other node starts its executor with the node's input values mapped through the executor's `input`. The executor runs under the `policy_ids` of the case's playbook version, which must allow starting it: an executor it may not start fails the execution (`FORBIDDEN`). Only a `ready`, `stale`, `failed` or `done` node with every required input set runs; anything else is `409 PLAYBOOK_NODE_NOT_RUNNABLE`. A paused case is `409 PLAYBOOK_CASE_PAUSED`, and a case in a paused project `409 PROJECT_PAUSED`.
|
|
4940
4940
|
*
|
|
4941
4941
|
* An `upstream` node has no executor: running it pulls the current output of the node it names in the bound case, which must be `done`. This is the only way to refresh one that an upstream change left `stale`.
|
|
4942
4942
|
*
|
|
@@ -5815,7 +5815,7 @@ var Tasks = class {
|
|
|
5815
5815
|
/**
|
|
5816
5816
|
* List tasks
|
|
5817
5817
|
*
|
|
5818
|
-
* Lists tasks (the board query). Filter by workflow, state, status, automation status, assignee, or `metadata` — `GET /tasks?workflow_id=...&state=...` is one board column.
|
|
5818
|
+
* Lists tasks (the board query). Filter by workflow, state, status, automation status, priority, assignee, or `metadata` — `GET /tasks?workflow_id=...&state=...` is one board column.
|
|
5819
5819
|
*/
|
|
5820
5820
|
static listTasks(options) {
|
|
5821
5821
|
return (options.client ?? client).get({
|
|
@@ -5841,7 +5841,7 @@ var Tasks = class {
|
|
|
5841
5841
|
/**
|
|
5842
5842
|
* Delete a task
|
|
5843
5843
|
*
|
|
5844
|
-
* Deletes a task. Its transition history
|
|
5844
|
+
* Deletes a task. Its transition history and dependencies cascade; a dependent it was the last open dependency of is freed.
|
|
5845
5845
|
*/
|
|
5846
5846
|
static deleteTask(options) {
|
|
5847
5847
|
return (options.client ?? client).delete({
|
|
@@ -5917,6 +5917,21 @@ var Tasks = class {
|
|
|
5917
5917
|
});
|
|
5918
5918
|
}
|
|
5919
5919
|
/**
|
|
5920
|
+
* Set a task's priority
|
|
5921
|
+
*
|
|
5922
|
+
* Sets or clears a task's priority. An action of its own, `tasks:SetTaskPriority`, so a principal can update a task without reprioritising it; create-task and update-task do not accept `priority`.
|
|
5923
|
+
*/
|
|
5924
|
+
static setTaskPriority(options) {
|
|
5925
|
+
return (options.client ?? client).put({
|
|
5926
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}/priority",
|
|
5927
|
+
...options,
|
|
5928
|
+
headers: {
|
|
5929
|
+
"Content-Type": "application/json",
|
|
5930
|
+
...options.headers
|
|
5931
|
+
}
|
|
5932
|
+
});
|
|
5933
|
+
}
|
|
5934
|
+
/**
|
|
5920
5935
|
* Pause a task
|
|
5921
5936
|
*
|
|
5922
5937
|
* 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.
|
|
@@ -5947,6 +5962,54 @@ var Tasks = class {
|
|
|
5947
5962
|
});
|
|
5948
5963
|
}
|
|
5949
5964
|
/**
|
|
5965
|
+
* List a task's dependencies
|
|
5966
|
+
*
|
|
5967
|
+
* Lists the tasks this task depends on, open and closed, oldest first. Only the open ones block it.
|
|
5968
|
+
*/
|
|
5969
|
+
static listTaskDependencies(options) {
|
|
5970
|
+
return (options.client ?? client).get({
|
|
5971
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}/dependencies",
|
|
5972
|
+
...options
|
|
5973
|
+
});
|
|
5974
|
+
}
|
|
5975
|
+
/**
|
|
5976
|
+
* Add a task dependency
|
|
5977
|
+
*
|
|
5978
|
+
* Makes the task depend on `depends_on_task_id`, a task in the same project: the path's task is blocked until that one closes, in any terminal state. The pair is the dependency's identity: adding it again answers `200` with the existing one. An edge that would close a cycle is refused.
|
|
5979
|
+
*/
|
|
5980
|
+
static addTaskDependency(options) {
|
|
5981
|
+
return (options.client ?? client).post({
|
|
5982
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}/dependencies",
|
|
5983
|
+
...options,
|
|
5984
|
+
headers: {
|
|
5985
|
+
"Content-Type": "application/json",
|
|
5986
|
+
...options.headers
|
|
5987
|
+
}
|
|
5988
|
+
});
|
|
5989
|
+
}
|
|
5990
|
+
/**
|
|
5991
|
+
* List a task's dependents
|
|
5992
|
+
*
|
|
5993
|
+
* Lists the tasks that depend on this task, open and closed, oldest first.
|
|
5994
|
+
*/
|
|
5995
|
+
static listTaskDependents(options) {
|
|
5996
|
+
return (options.client ?? client).get({
|
|
5997
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}/dependents",
|
|
5998
|
+
...options
|
|
5999
|
+
});
|
|
6000
|
+
}
|
|
6001
|
+
/**
|
|
6002
|
+
* Remove a task dependency
|
|
6003
|
+
*
|
|
6004
|
+
* Removes the task's dependency on `depends_on_task_id`; answers `204` also when there is none. When it was the task's last open dependency, `tasks.unblocked` fires.
|
|
6005
|
+
*/
|
|
6006
|
+
static removeTaskDependency(options) {
|
|
6007
|
+
return (options.client ?? client).delete({
|
|
6008
|
+
url: "/v1/projects/{project_id}/tasks/{task_id}/dependencies/{depends_on_task_id}",
|
|
6009
|
+
...options
|
|
6010
|
+
});
|
|
6011
|
+
}
|
|
6012
|
+
/**
|
|
5950
6013
|
* Get task history
|
|
5951
6014
|
*
|
|
5952
6015
|
* Returns the append-only transition history of a task.
|
|
@@ -6191,7 +6254,7 @@ var Triggers = class {
|
|
|
6191
6254
|
/**
|
|
6192
6255
|
* Fire a trigger
|
|
6193
6256
|
*
|
|
6194
|
-
* Fires a trigger synchronously and returns the terminal firing record. The firing acts as the caller ∩ the trigger's `policy_ids`, which must allow starting the target, else `403`. 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.
|
|
6257
|
+
* Fires a trigger synchronously and returns the terminal firing record. The firing acts as the caller ∩ the trigger's `policy_ids`, which must allow starting the target, else the firing fails `FORBIDDEN`. A body carrying `input` or `tool_context` also needs the caller to start the target, else `403`. 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.
|
|
6195
6258
|
*/
|
|
6196
6259
|
static fireTrigger(options) {
|
|
6197
6260
|
return (options.client ?? client).post({
|