@naturali/sdk 0.53.0 → 0.54.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.d.cts +51 -8
- package/dist/index.d.mts +51 -8
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -811,32 +811,60 @@ type User = {
|
|
|
811
811
|
created_at: Date;
|
|
812
812
|
};
|
|
813
813
|
/**
|
|
814
|
-
* What a column runs when a card enters it
|
|
814
|
+
* What a column runs when a card enters it. A tool or poll dispatch runs **deterministically**: there is no model in the loop, which is what makes them different from an agent that happens to have one tool.
|
|
815
815
|
*
|
|
816
816
|
*/
|
|
817
817
|
type BoardDispatch = {
|
|
818
818
|
/**
|
|
819
|
-
*
|
|
819
|
+
* What the column does on entry. `agent`/`tool`/`poll` take the reference field their kind names below (`agent_id`/`tool_id`); the others are rejected. `delay` names no resource at all.
|
|
820
|
+
*
|
|
820
821
|
*/
|
|
821
|
-
kind: 'agent' | 'tool';
|
|
822
|
+
kind: 'agent' | 'tool' | 'poll' | 'delay';
|
|
822
823
|
/**
|
|
823
824
|
* Required when `kind` is `agent` — an agent in this project.
|
|
824
825
|
*/
|
|
825
826
|
agent_id?: string;
|
|
826
827
|
/**
|
|
827
|
-
* Required when `kind` is `tool` — a tool in this project. Null only on a read, and only if the board's internal bookkeeping and its stored definition have drifted: the column still dispatches a tool, but which tool can no longer be resolved. Re-send the definition to repair it.
|
|
828
|
+
* Required when `kind` is `tool` or `poll` — a tool in this project. Null only on a read, and only if the board's internal bookkeeping and its stored definition have drifted: the column still dispatches a tool, but which tool can no longer be resolved. Re-send the definition to repair it.
|
|
828
829
|
*
|
|
829
830
|
*/
|
|
830
831
|
tool_id?: string | null;
|
|
831
832
|
/**
|
|
832
|
-
* JSON Logic (https://jsonlogic.com) resolving the dispatch input from the card, evaluated against `{ task }` — so `{"var": "task.payload.theme"}` reads the card's payload. Each value is one expression; a plain string, number or boolean is passed through as a literal.
|
|
833
|
+
* JSON Logic (https://jsonlogic.com) resolving the dispatch input from the card, evaluated against `{ task }` — so `{"var": "task.payload.theme"}` reads the card's payload. Each value is one expression; a plain string, number or boolean is passed through as a literal. Not accepted on a `delay` dispatch, which names no resource to send it to.
|
|
833
834
|
*
|
|
834
835
|
*/
|
|
835
836
|
input_mapping?: {
|
|
836
837
|
[key: string]: unknown;
|
|
837
838
|
};
|
|
838
839
|
/**
|
|
839
|
-
*
|
|
840
|
+
* Required when `kind` is `poll` — JSON Logic stop condition, evaluated after every attempt against `{ response, attempt }` (`response` is the tool's latest result, `attempt` a 1-based count); a truthy result stops polling. The wait between attempts is durable and scheduler-driven — it does not hold a request open, and a card parked mid-poll survives a platform restart.
|
|
841
|
+
*
|
|
842
|
+
*/
|
|
843
|
+
exit_condition?: {
|
|
844
|
+
[key: string]: unknown;
|
|
845
|
+
};
|
|
846
|
+
/**
|
|
847
|
+
* Required when `kind` is `poll` — wait between attempts. Accepts a friendly suffix form (`5s`, `30s`, `5m`, `2h`, `500ms`) or ISO 8601 (e.g. `PT5S`).
|
|
848
|
+
*
|
|
849
|
+
*/
|
|
850
|
+
interval?: string;
|
|
851
|
+
/**
|
|
852
|
+
* Only meaningful when `kind` is `poll` — maximum attempts before `on_timeout` decides the outcome. Defaults to 10 when omitted.
|
|
853
|
+
*
|
|
854
|
+
*/
|
|
855
|
+
max_iterations?: number;
|
|
856
|
+
/**
|
|
857
|
+
* Only meaningful when `kind` is `poll` — what happens when `max_iterations` is reached without `exit_condition` becoming true. `fail` fails the dispatch (routed the same way any failed dispatch is, via `on_failure`); `continue` (the default) completes the dispatch with the condition unmet, so `on_complete` rules can branch on it.
|
|
858
|
+
*
|
|
859
|
+
*/
|
|
860
|
+
on_timeout?: 'fail' | 'continue';
|
|
861
|
+
/**
|
|
862
|
+
* Required when `kind` is `delay` — how long the column waits before completing. Accepts a friendly suffix form (`5s`, `30s`, `5m`, `2h`, `500ms`) or ISO 8601 (e.g. `PT5S`). The wait is durable and scheduler-driven, the same as a poll's `interval` — it does not hold a request open, and a card parked mid-delay survives a platform restart.
|
|
863
|
+
*
|
|
864
|
+
*/
|
|
865
|
+
duration?: string;
|
|
866
|
+
/**
|
|
867
|
+
* JSON Logic writing selected fields of the dispatch's own result into named `task.payload` keys when the dispatch completes — a deterministic, no-model channel for state that must survive more than one column. Evaluated against the same `{ task, result }` context as `on_complete` (`result` is the tool's/poll's own result for a tool/poll column, re-rooted the same way), and applied atomically alongside `last_result`. Each write is a raw overwrite of its key: a value from an earlier pass through a looping column lingers in the payload until the column runs again. Before this, carrying a value past one hop meant echoing it through an agent's `output_schema` or injecting it into an unrelated tool request purely so it would reappear in `last_result` downstream — both are unnecessary now.
|
|
840
868
|
*
|
|
841
869
|
*/
|
|
842
870
|
payload_writes?: {
|
|
@@ -1449,8 +1477,23 @@ type Generation = {
|
|
|
1449
1477
|
[key: string]: unknown;
|
|
1450
1478
|
} | null;
|
|
1451
1479
|
/**
|
|
1452
|
-
*
|
|
1453
|
-
*
|
|
1480
|
+
* The label supplied as `action_id` when the generation was run, recorded on its usage event so spend rolls up per action.
|
|
1481
|
+
*
|
|
1482
|
+
*/
|
|
1483
|
+
action_id: string | null;
|
|
1484
|
+
/**
|
|
1485
|
+
* The trigger that started this generation, when applicable.
|
|
1486
|
+
*/
|
|
1487
|
+
trigger_id: string | null;
|
|
1488
|
+
/**
|
|
1489
|
+
* Memory-extraction summary recorded for this generation — set when the agent's knowledge config produced one for this turn (`candidates`, `created`, `updated`, `skipped`).
|
|
1490
|
+
*
|
|
1491
|
+
*/
|
|
1492
|
+
extraction: {
|
|
1493
|
+
[key: string]: unknown;
|
|
1494
|
+
} | null;
|
|
1495
|
+
/**
|
|
1496
|
+
* Caller-supplied key/value metadata attached to the generation record — nothing else. Server-owned state has its own top-level fields (`action_id`, `trigger_id`, `extraction`) and is never merged into this object.
|
|
1454
1497
|
*
|
|
1455
1498
|
*/
|
|
1456
1499
|
metadata: {
|
package/dist/index.d.mts
CHANGED
|
@@ -811,32 +811,60 @@ type User = {
|
|
|
811
811
|
created_at: Date;
|
|
812
812
|
};
|
|
813
813
|
/**
|
|
814
|
-
* What a column runs when a card enters it
|
|
814
|
+
* What a column runs when a card enters it. A tool or poll dispatch runs **deterministically**: there is no model in the loop, which is what makes them different from an agent that happens to have one tool.
|
|
815
815
|
*
|
|
816
816
|
*/
|
|
817
817
|
type BoardDispatch = {
|
|
818
818
|
/**
|
|
819
|
-
*
|
|
819
|
+
* What the column does on entry. `agent`/`tool`/`poll` take the reference field their kind names below (`agent_id`/`tool_id`); the others are rejected. `delay` names no resource at all.
|
|
820
|
+
*
|
|
820
821
|
*/
|
|
821
|
-
kind: 'agent' | 'tool';
|
|
822
|
+
kind: 'agent' | 'tool' | 'poll' | 'delay';
|
|
822
823
|
/**
|
|
823
824
|
* Required when `kind` is `agent` — an agent in this project.
|
|
824
825
|
*/
|
|
825
826
|
agent_id?: string;
|
|
826
827
|
/**
|
|
827
|
-
* Required when `kind` is `tool` — a tool in this project. Null only on a read, and only if the board's internal bookkeeping and its stored definition have drifted: the column still dispatches a tool, but which tool can no longer be resolved. Re-send the definition to repair it.
|
|
828
|
+
* Required when `kind` is `tool` or `poll` — a tool in this project. Null only on a read, and only if the board's internal bookkeeping and its stored definition have drifted: the column still dispatches a tool, but which tool can no longer be resolved. Re-send the definition to repair it.
|
|
828
829
|
*
|
|
829
830
|
*/
|
|
830
831
|
tool_id?: string | null;
|
|
831
832
|
/**
|
|
832
|
-
* JSON Logic (https://jsonlogic.com) resolving the dispatch input from the card, evaluated against `{ task }` — so `{"var": "task.payload.theme"}` reads the card's payload. Each value is one expression; a plain string, number or boolean is passed through as a literal.
|
|
833
|
+
* JSON Logic (https://jsonlogic.com) resolving the dispatch input from the card, evaluated against `{ task }` — so `{"var": "task.payload.theme"}` reads the card's payload. Each value is one expression; a plain string, number or boolean is passed through as a literal. Not accepted on a `delay` dispatch, which names no resource to send it to.
|
|
833
834
|
*
|
|
834
835
|
*/
|
|
835
836
|
input_mapping?: {
|
|
836
837
|
[key: string]: unknown;
|
|
837
838
|
};
|
|
838
839
|
/**
|
|
839
|
-
*
|
|
840
|
+
* Required when `kind` is `poll` — JSON Logic stop condition, evaluated after every attempt against `{ response, attempt }` (`response` is the tool's latest result, `attempt` a 1-based count); a truthy result stops polling. The wait between attempts is durable and scheduler-driven — it does not hold a request open, and a card parked mid-poll survives a platform restart.
|
|
841
|
+
*
|
|
842
|
+
*/
|
|
843
|
+
exit_condition?: {
|
|
844
|
+
[key: string]: unknown;
|
|
845
|
+
};
|
|
846
|
+
/**
|
|
847
|
+
* Required when `kind` is `poll` — wait between attempts. Accepts a friendly suffix form (`5s`, `30s`, `5m`, `2h`, `500ms`) or ISO 8601 (e.g. `PT5S`).
|
|
848
|
+
*
|
|
849
|
+
*/
|
|
850
|
+
interval?: string;
|
|
851
|
+
/**
|
|
852
|
+
* Only meaningful when `kind` is `poll` — maximum attempts before `on_timeout` decides the outcome. Defaults to 10 when omitted.
|
|
853
|
+
*
|
|
854
|
+
*/
|
|
855
|
+
max_iterations?: number;
|
|
856
|
+
/**
|
|
857
|
+
* Only meaningful when `kind` is `poll` — what happens when `max_iterations` is reached without `exit_condition` becoming true. `fail` fails the dispatch (routed the same way any failed dispatch is, via `on_failure`); `continue` (the default) completes the dispatch with the condition unmet, so `on_complete` rules can branch on it.
|
|
858
|
+
*
|
|
859
|
+
*/
|
|
860
|
+
on_timeout?: 'fail' | 'continue';
|
|
861
|
+
/**
|
|
862
|
+
* Required when `kind` is `delay` — how long the column waits before completing. Accepts a friendly suffix form (`5s`, `30s`, `5m`, `2h`, `500ms`) or ISO 8601 (e.g. `PT5S`). The wait is durable and scheduler-driven, the same as a poll's `interval` — it does not hold a request open, and a card parked mid-delay survives a platform restart.
|
|
863
|
+
*
|
|
864
|
+
*/
|
|
865
|
+
duration?: string;
|
|
866
|
+
/**
|
|
867
|
+
* JSON Logic writing selected fields of the dispatch's own result into named `task.payload` keys when the dispatch completes — a deterministic, no-model channel for state that must survive more than one column. Evaluated against the same `{ task, result }` context as `on_complete` (`result` is the tool's/poll's own result for a tool/poll column, re-rooted the same way), and applied atomically alongside `last_result`. Each write is a raw overwrite of its key: a value from an earlier pass through a looping column lingers in the payload until the column runs again. Before this, carrying a value past one hop meant echoing it through an agent's `output_schema` or injecting it into an unrelated tool request purely so it would reappear in `last_result` downstream — both are unnecessary now.
|
|
840
868
|
*
|
|
841
869
|
*/
|
|
842
870
|
payload_writes?: {
|
|
@@ -1449,8 +1477,23 @@ type Generation = {
|
|
|
1449
1477
|
[key: string]: unknown;
|
|
1450
1478
|
} | null;
|
|
1451
1479
|
/**
|
|
1452
|
-
*
|
|
1453
|
-
*
|
|
1480
|
+
* The label supplied as `action_id` when the generation was run, recorded on its usage event so spend rolls up per action.
|
|
1481
|
+
*
|
|
1482
|
+
*/
|
|
1483
|
+
action_id: string | null;
|
|
1484
|
+
/**
|
|
1485
|
+
* The trigger that started this generation, when applicable.
|
|
1486
|
+
*/
|
|
1487
|
+
trigger_id: string | null;
|
|
1488
|
+
/**
|
|
1489
|
+
* Memory-extraction summary recorded for this generation — set when the agent's knowledge config produced one for this turn (`candidates`, `created`, `updated`, `skipped`).
|
|
1490
|
+
*
|
|
1491
|
+
*/
|
|
1492
|
+
extraction: {
|
|
1493
|
+
[key: string]: unknown;
|
|
1494
|
+
} | null;
|
|
1495
|
+
/**
|
|
1496
|
+
* Caller-supplied key/value metadata attached to the generation record — nothing else. Server-owned state has its own top-level fields (`action_id`, `trigger_id`, `extraction`) and is never merged into this object.
|
|
1454
1497
|
*
|
|
1455
1498
|
*/
|
|
1456
1499
|
metadata: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.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.54.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"generate": "tsx scripts/generate.ts",
|