@naturali/sdk 0.57.0 → 0.58.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 +26 -0
- package/dist/index.d.mts +26 -0
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -2143,6 +2143,16 @@ type StartRunRequest = {
|
|
|
2143
2143
|
input?: {
|
|
2144
2144
|
[key: string]: unknown;
|
|
2145
2145
|
};
|
|
2146
|
+
/**
|
|
2147
|
+
* Write-only. Per-run context forwarded to the run's tool calls: every entry is sent as an `X-Naturali-Context-<key>` request header on each `http`/`mcp` tool call the run's agent nodes make, including those of a `loop` or `sub_orchestration` child run. This is how a per-user credential reaches a tool endpoint without being written into the prompt — the endpoint reads it from a header it can trust rather than from model output.
|
|
2148
|
+
*
|
|
2149
|
+
* The bag is stored on the run, so it survives an `awaiting_input` pause, a durable wait and a restart. It is never returned on a read: any principal on the project can read the project's runs.
|
|
2150
|
+
*
|
|
2151
|
+
* A key becomes an HTTP header name verbatim — no character is re-cased, so `ocaToken` and `oca_token` are two different keys — and must contain only letters, digits and `!#$%&'*+-.^_`|~`; two keys that differ only in case are rejected, since HTTP folds them into one. To land a value in a header the target already expects (usually `Authorization`), have the tool declare it with a `{{context:<key>}}` reference in its own `headers`, and set the tool's `context_keys` so the value reaches that tool alone.
|
|
2152
|
+
*/
|
|
2153
|
+
tool_context?: {
|
|
2154
|
+
[key: string]: string;
|
|
2155
|
+
};
|
|
2146
2156
|
/**
|
|
2147
2157
|
* When true, block until the run reaches a terminal or `awaiting_input` state and return the settled run. When false (default), return immediately with `status: "queued"`.
|
|
2148
2158
|
*/
|
|
@@ -2746,6 +2756,8 @@ type HttpExecute = {
|
|
|
2746
2756
|
/**
|
|
2747
2757
|
* Write-only. Auth headers sent to the target (e.g. Authorization). Accepted on write, never returned — reads report only `has_headers`.
|
|
2748
2758
|
*
|
|
2759
|
+
* A value may carry a `{{context:<key>}}` reference, resolved per call from the caller's `tool_context` (see the `tool_context` field on starting an orchestration run). That is how a per-user credential lands in the header the target already expects — `Authorization: "Bearer {{context:ocaToken}}"` — instead of only in the prefixed `X-Naturali-Context-<key>` header. A reference is legal in `headers` and nowhere else, `url` included: a context value comes from the caller, so it must not be able to steer the outbound request. A key missing from the `tool_context` at call time fails the tool call rather than sending an empty credential.
|
|
2760
|
+
*
|
|
2749
2761
|
*/
|
|
2750
2762
|
headers?: {
|
|
2751
2763
|
[key: string]: string;
|
|
@@ -2759,6 +2771,8 @@ type McpConfig = {
|
|
|
2759
2771
|
/**
|
|
2760
2772
|
* Write-only. Auth headers sent to the MCP server. Accepted on write, never returned — reads report only `has_headers`.
|
|
2761
2773
|
*
|
|
2774
|
+
* As with an http tool's headers, a value may carry a `{{context:<key>}}` reference — `Authorization: "Bearer {{context:ocaToken}}"` — resolved per call from the caller's `tool_context`, so an MCP server can read a per-user credential from the standard bearer header it already expects.
|
|
2775
|
+
*
|
|
2762
2776
|
*/
|
|
2763
2777
|
headers?: {
|
|
2764
2778
|
[key: string]: string;
|
|
@@ -2816,6 +2830,10 @@ type Tool = {
|
|
|
2816
2830
|
* mcp tools only — denylist of MCP tool names to hide.
|
|
2817
2831
|
*/
|
|
2818
2832
|
denied_actions?: Array<string> | null;
|
|
2833
|
+
/**
|
|
2834
|
+
* Which `tool_context` keys may reach this tool as `X-Naturali-Context-<key>` headers. `null` forwards every key the caller supplied; a list forwards only those, and `[]` forwards none. Key *names* are returned — the values never are.
|
|
2835
|
+
*/
|
|
2836
|
+
context_keys: Array<string> | null;
|
|
2819
2837
|
/**
|
|
2820
2838
|
* Whether auth headers are on file (their values are never returned).
|
|
2821
2839
|
*/
|
|
@@ -2863,6 +2881,10 @@ type ToolCreate = {
|
|
|
2863
2881
|
* mcp only — denylist of MCP tool names to hide.
|
|
2864
2882
|
*/
|
|
2865
2883
|
denied_actions?: Array<string>;
|
|
2884
|
+
/**
|
|
2885
|
+
* Allowlist of `tool_context` keys forwarded to this tool as `X-Naturali-Context-<key>` headers. Omit (or `null`) to forward every key the caller supplied; `[]` forwards none. Set it on the tools that need a given credential and the credential stops egressing to the rest of the agent's tool set — a key a tool consumes through a `{{context:<key>}}` reference in its own `headers` is substituted either way, since the tool declared that header itself.
|
|
2886
|
+
*/
|
|
2887
|
+
context_keys?: Array<string> | null;
|
|
2866
2888
|
};
|
|
2867
2889
|
/**
|
|
2868
2890
|
* At least one field must be present. The tool `type` is immutable.
|
|
@@ -2883,6 +2905,10 @@ type ToolUpdate = {
|
|
|
2883
2905
|
mcp?: McpConfig;
|
|
2884
2906
|
actions?: Array<string>;
|
|
2885
2907
|
denied_actions?: Array<string>;
|
|
2908
|
+
/**
|
|
2909
|
+
* Replace the allowlist of `tool_context` keys forwarded to this tool. `null` clears it (every key is forwarded again) — unlike omitting the field, which leaves the current allowlist alone.
|
|
2910
|
+
*/
|
|
2911
|
+
context_keys?: Array<string> | null;
|
|
2886
2912
|
status?: 'active' | 'disabled';
|
|
2887
2913
|
};
|
|
2888
2914
|
type ToolList = {
|
package/dist/index.d.mts
CHANGED
|
@@ -2143,6 +2143,16 @@ type StartRunRequest = {
|
|
|
2143
2143
|
input?: {
|
|
2144
2144
|
[key: string]: unknown;
|
|
2145
2145
|
};
|
|
2146
|
+
/**
|
|
2147
|
+
* Write-only. Per-run context forwarded to the run's tool calls: every entry is sent as an `X-Naturali-Context-<key>` request header on each `http`/`mcp` tool call the run's agent nodes make, including those of a `loop` or `sub_orchestration` child run. This is how a per-user credential reaches a tool endpoint without being written into the prompt — the endpoint reads it from a header it can trust rather than from model output.
|
|
2148
|
+
*
|
|
2149
|
+
* The bag is stored on the run, so it survives an `awaiting_input` pause, a durable wait and a restart. It is never returned on a read: any principal on the project can read the project's runs.
|
|
2150
|
+
*
|
|
2151
|
+
* A key becomes an HTTP header name verbatim — no character is re-cased, so `ocaToken` and `oca_token` are two different keys — and must contain only letters, digits and `!#$%&'*+-.^_`|~`; two keys that differ only in case are rejected, since HTTP folds them into one. To land a value in a header the target already expects (usually `Authorization`), have the tool declare it with a `{{context:<key>}}` reference in its own `headers`, and set the tool's `context_keys` so the value reaches that tool alone.
|
|
2152
|
+
*/
|
|
2153
|
+
tool_context?: {
|
|
2154
|
+
[key: string]: string;
|
|
2155
|
+
};
|
|
2146
2156
|
/**
|
|
2147
2157
|
* When true, block until the run reaches a terminal or `awaiting_input` state and return the settled run. When false (default), return immediately with `status: "queued"`.
|
|
2148
2158
|
*/
|
|
@@ -2746,6 +2756,8 @@ type HttpExecute = {
|
|
|
2746
2756
|
/**
|
|
2747
2757
|
* Write-only. Auth headers sent to the target (e.g. Authorization). Accepted on write, never returned — reads report only `has_headers`.
|
|
2748
2758
|
*
|
|
2759
|
+
* A value may carry a `{{context:<key>}}` reference, resolved per call from the caller's `tool_context` (see the `tool_context` field on starting an orchestration run). That is how a per-user credential lands in the header the target already expects — `Authorization: "Bearer {{context:ocaToken}}"` — instead of only in the prefixed `X-Naturali-Context-<key>` header. A reference is legal in `headers` and nowhere else, `url` included: a context value comes from the caller, so it must not be able to steer the outbound request. A key missing from the `tool_context` at call time fails the tool call rather than sending an empty credential.
|
|
2760
|
+
*
|
|
2749
2761
|
*/
|
|
2750
2762
|
headers?: {
|
|
2751
2763
|
[key: string]: string;
|
|
@@ -2759,6 +2771,8 @@ type McpConfig = {
|
|
|
2759
2771
|
/**
|
|
2760
2772
|
* Write-only. Auth headers sent to the MCP server. Accepted on write, never returned — reads report only `has_headers`.
|
|
2761
2773
|
*
|
|
2774
|
+
* As with an http tool's headers, a value may carry a `{{context:<key>}}` reference — `Authorization: "Bearer {{context:ocaToken}}"` — resolved per call from the caller's `tool_context`, so an MCP server can read a per-user credential from the standard bearer header it already expects.
|
|
2775
|
+
*
|
|
2762
2776
|
*/
|
|
2763
2777
|
headers?: {
|
|
2764
2778
|
[key: string]: string;
|
|
@@ -2816,6 +2830,10 @@ type Tool = {
|
|
|
2816
2830
|
* mcp tools only — denylist of MCP tool names to hide.
|
|
2817
2831
|
*/
|
|
2818
2832
|
denied_actions?: Array<string> | null;
|
|
2833
|
+
/**
|
|
2834
|
+
* Which `tool_context` keys may reach this tool as `X-Naturali-Context-<key>` headers. `null` forwards every key the caller supplied; a list forwards only those, and `[]` forwards none. Key *names* are returned — the values never are.
|
|
2835
|
+
*/
|
|
2836
|
+
context_keys: Array<string> | null;
|
|
2819
2837
|
/**
|
|
2820
2838
|
* Whether auth headers are on file (their values are never returned).
|
|
2821
2839
|
*/
|
|
@@ -2863,6 +2881,10 @@ type ToolCreate = {
|
|
|
2863
2881
|
* mcp only — denylist of MCP tool names to hide.
|
|
2864
2882
|
*/
|
|
2865
2883
|
denied_actions?: Array<string>;
|
|
2884
|
+
/**
|
|
2885
|
+
* Allowlist of `tool_context` keys forwarded to this tool as `X-Naturali-Context-<key>` headers. Omit (or `null`) to forward every key the caller supplied; `[]` forwards none. Set it on the tools that need a given credential and the credential stops egressing to the rest of the agent's tool set — a key a tool consumes through a `{{context:<key>}}` reference in its own `headers` is substituted either way, since the tool declared that header itself.
|
|
2886
|
+
*/
|
|
2887
|
+
context_keys?: Array<string> | null;
|
|
2866
2888
|
};
|
|
2867
2889
|
/**
|
|
2868
2890
|
* At least one field must be present. The tool `type` is immutable.
|
|
@@ -2883,6 +2905,10 @@ type ToolUpdate = {
|
|
|
2883
2905
|
mcp?: McpConfig;
|
|
2884
2906
|
actions?: Array<string>;
|
|
2885
2907
|
denied_actions?: Array<string>;
|
|
2908
|
+
/**
|
|
2909
|
+
* Replace the allowlist of `tool_context` keys forwarded to this tool. `null` clears it (every key is forwarded again) — unlike omitting the field, which leaves the current allowlist alone.
|
|
2910
|
+
*/
|
|
2911
|
+
context_keys?: Array<string> | null;
|
|
2886
2912
|
status?: 'active' | 'disabled';
|
|
2887
2913
|
};
|
|
2888
2914
|
type ToolList = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.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.58.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"generate": "tsx scripts/generate.ts",
|