@naturali/sdk 0.235.0 → 0.237.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 +4 -3
- package/dist/index.d.cts +70 -22
- package/dist/index.d.mts +70 -22
- package/dist/index.mjs +4 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -920,6 +920,7 @@ var Channels = class {
|
|
|
920
920
|
*
|
|
921
921
|
* Connect a channel. The required fields depend on `channel`; no credential is ever returned.
|
|
922
922
|
* **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 invalid_bot_token` when Discord rejects it, `400 application_mismatch` when it belongs to another application, `502 discord_unavailable` when Discord cannot be read. Returns `501` when this deployment does not enable Discord channels.
|
|
923
|
+
* **X** (`channel: x`) — supply the bot's `bot_token` (X developer portal, Chat bots) and the `consumer_key` and `consumer_secret` of the app that issued it. naturali then registers its own webhook on that app, subscribes it to the bot's incoming direct messages and registers the bot's chat encryption key, keeping the private key sealed: replies are end-to-end encrypted, and the project never handles keys, webhooks or ciphertext. Pass `chat_private_keys` and `chat_key_version` instead to keep a key the bot already registered. `400 invalid_bot_token` or `400 invalid_consumer_credentials` when X rejects a credential, `409 bot_in_use` when another channel holds the bot, `502 x_provisioning_failed` when X refuses the webhook or the subscription (an app holds a limited number of webhooks), `429 x_key_registration_limited` when the bot used its few daily key registrations, `502 x_unavailable` when X cannot be reached. Returns `501` when this deployment does not enable X channels.
|
|
923
924
|
* **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret:
|
|
924
925
|
* * **BYOT** (`credential_source: byot`, default) — supply
|
|
925
926
|
* `phone_number_id` and `access_token` from your own Meta app. The
|
|
@@ -1027,7 +1028,7 @@ var Channels = class {
|
|
|
1027
1028
|
* List the channel's conversations
|
|
1028
1029
|
*
|
|
1029
1030
|
* A cursor page of the channel's conversations, newest first. A conversation is one address's dialogue on the channel — the continuity anchor that resumes the same runtime session instead of starting fresh per message — so this is the read path for who has talked to the channel and which actor/session their dialogue resolved to.
|
|
1030
|
-
* Conversations are created by the inbound path (the WhatsApp
|
|
1031
|
+
* Conversations are created by the inbound path (the WhatsApp and X webhooks, the Discord gateway worker) when a real message arrives; there is no way to create one directly.
|
|
1031
1032
|
*
|
|
1032
1033
|
*/
|
|
1033
1034
|
static listChannelConversations(options) {
|
|
@@ -4952,7 +4953,7 @@ var Playbooks = class {
|
|
|
4952
4953
|
*
|
|
4953
4954
|
* Creates a playbook at version 1. The definition is refused with `400 PLAYBOOK_VALIDATION_FAILED` when it holds a duplicate node or input, an input reading a missing node or field, an `execute` node without an executor or another kind with one, transformations on a non-final node, or a cycle; `meta.problems` lists every one. A duplicate `name` in the project is `409 NAME_CONFLICT`.
|
|
4954
4955
|
*
|
|
4955
|
-
* The caller becomes the version's author, whom its executors run as, so it must be allowed to start every executor the definition names (`403
|
|
4956
|
+
* The caller becomes the version's author, whom its executors run as, so it must be allowed to start every executor the definition names (`403 ACTION_NOT_HELD`), and each must exist in the project, or be an agent or tool shared with it (`400 PLAYBOOK_VALIDATION_FAILED`, an `EXECUTOR_NOT_FOUND` problem). A `tool` executor on an `mcp` tool must name in `operation_id` an action the tool's binding allows (`EXECUTOR_ACTION_REQUIRED`, `EXECUTOR_ACTION_UNAVAILABLE`). An executor cannot be a `client` tool (`EXECUTOR_TOOL_UNSUPPORTED`), nor a transformation's tool a `client` or `mcp` tool (`TRANSFORMATION_TOOL_UNSUPPORTED`). A definition with executors written with a trigger or OAuth token is `409 PLAYBOOK_AUTHOR_UNAVAILABLE`: those carry their boundary in the token, so no run can act as them.
|
|
4956
4957
|
*/
|
|
4957
4958
|
static createPlaybook(options) {
|
|
4958
4959
|
return (options.client ?? client).post({
|
|
@@ -5008,7 +5009,7 @@ var Playbooks = class {
|
|
|
5008
5009
|
*
|
|
5009
5010
|
* Updates any of `name`, `description` and `definition`. Only a change to `definition` archives a new version; a rename or a rewrite of the definition the playbook already holds leaves `version` where it is. A case keeps the version it was created on.
|
|
5010
5011
|
*
|
|
5011
|
-
* A new version is authored by the caller, checked as on create: `403
|
|
5012
|
+
* A new version is authored by the caller, checked as on create: `403 ACTION_NOT_HELD` for an executor it may not start, an `EXECUTOR_NOT_FOUND` problem for one that does not exist, `EXECUTOR_ACTION_REQUIRED` or `EXECUTOR_ACTION_UNAVAILABLE` for an `mcp` tool action a run could not call, `EXECUTOR_TOOL_UNSUPPORTED` for a `client` tool executor, `TRANSFORMATION_TOOL_UNSUPPORTED` for a `client` or `mcp` transformation tool, `409 PLAYBOOK_AUTHOR_UNAVAILABLE` for a trigger or OAuth token.
|
|
5012
5013
|
*/
|
|
5013
5014
|
static updatePlaybook(options) {
|
|
5014
5015
|
return (options.client ?? client).patch({
|
package/dist/index.d.cts
CHANGED
|
@@ -1322,7 +1322,7 @@ type CreateAgentRequest = {
|
|
|
1322
1322
|
*/
|
|
1323
1323
|
temperature?: number;
|
|
1324
1324
|
/**
|
|
1325
|
-
* Knowledge search run before every generation; its matches are prepended as reference context. See [Knowledge Config](/docs/modules/agents#knowledge-config).
|
|
1325
|
+
* Knowledge search run before every generation; its matches are prepended as reference context. Every id it names is a resource of the agent's project, else `400`. See [Knowledge Config](/docs/modules/agents#knowledge-config).
|
|
1326
1326
|
*/
|
|
1327
1327
|
knowledge_config?: {
|
|
1328
1328
|
memory_store_ids?: Array<string>;
|
|
@@ -1470,7 +1470,7 @@ type UpdateAgentRequest = {
|
|
|
1470
1470
|
*/
|
|
1471
1471
|
temperature?: number | null;
|
|
1472
1472
|
/**
|
|
1473
|
-
* Knowledge search run before every generation; its matches are prepended as reference context. `null` turns it off. See [Knowledge Config](/docs/modules/agents#knowledge-config).
|
|
1473
|
+
* Knowledge search run before every generation; its matches are prepended as reference context. `null` turns it off. Every id it names is a resource of the agent's project, else `400`. See [Knowledge Config](/docs/modules/agents#knowledge-config).
|
|
1474
1474
|
*/
|
|
1475
1475
|
knowledge_config?: {
|
|
1476
1476
|
memory_store_ids?: Array<string>;
|
|
@@ -2480,7 +2480,7 @@ type AuditEntry = {
|
|
|
2480
2480
|
created_at?: Date;
|
|
2481
2481
|
};
|
|
2482
2482
|
/**
|
|
2483
|
-
* The tool call the write was made on behalf of, for a write a `naturali` tool made; null for any other write.
|
|
2483
|
+
* The tool call the write was made on behalf of, for a write a `naturali` tool made; null for any other write. The `created_by_principal_*` pair stays the project credential's; the request is checked against the project credential capped by the authority the tool call was sent with.
|
|
2484
2484
|
*/
|
|
2485
2485
|
type OnBehalfOf = {
|
|
2486
2486
|
tool_id?: string | null;
|
|
@@ -2603,7 +2603,7 @@ type ChannelKind = {
|
|
|
2603
2603
|
/**
|
|
2604
2604
|
* The channel kind.
|
|
2605
2605
|
*/
|
|
2606
|
-
kind: 'whatsapp' | 'discord';
|
|
2606
|
+
kind: 'whatsapp' | 'discord' | 'x';
|
|
2607
2607
|
/**
|
|
2608
2608
|
* This kind's conversational shapes.
|
|
2609
2609
|
*/
|
|
@@ -2702,7 +2702,7 @@ type Channel = {
|
|
|
2702
2702
|
/**
|
|
2703
2703
|
* The channel kind.
|
|
2704
2704
|
*/
|
|
2705
|
-
channel: 'whatsapp' | 'discord';
|
|
2705
|
+
channel: 'whatsapp' | 'discord' | 'x';
|
|
2706
2706
|
status: 'active' | 'disabled';
|
|
2707
2707
|
/**
|
|
2708
2708
|
* How the credential was obtained.
|
|
@@ -2732,6 +2732,19 @@ type Channel = {
|
|
|
2732
2732
|
*/
|
|
2733
2733
|
application_id: string | null;
|
|
2734
2734
|
modes: DiscordModes;
|
|
2735
|
+
/**
|
|
2736
|
+
* X. The bot account's user id. Absent for other kinds.
|
|
2737
|
+
*/
|
|
2738
|
+
bot_user_id?: string | null;
|
|
2739
|
+
/**
|
|
2740
|
+
* X. The bot account's handle, without `@`. Absent for other kinds.
|
|
2741
|
+
*/
|
|
2742
|
+
username?: string | null;
|
|
2743
|
+
/**
|
|
2744
|
+
* X. The version of the bot's registered chat encryption key. Absent for other kinds.
|
|
2745
|
+
*
|
|
2746
|
+
*/
|
|
2747
|
+
chat_key_version?: string | null;
|
|
2735
2748
|
default: ChannelAction;
|
|
2736
2749
|
/**
|
|
2737
2750
|
* The most recent messages each conversation's session sends the model, taking precedence over the agent's own `max_context_messages`. Null defers to the agent.
|
|
@@ -2774,6 +2787,11 @@ type Channel = {
|
|
|
2774
2787
|
* as a secret on the runtime; a deployment that does not enable Discord
|
|
2775
2788
|
* channels returns `501`.
|
|
2776
2789
|
*
|
|
2790
|
+
* * **x** — `bot_token`, `consumer_key` and `consumer_secret`
|
|
2791
|
+
* (write-only); naturali provisions the webhook, the subscription and
|
|
2792
|
+
* the bot's chat key. Optional `chat_private_keys` with
|
|
2793
|
+
* `chat_key_version` keep a key already registered.
|
|
2794
|
+
*
|
|
2777
2795
|
* No credential value is ever returned. `default` is required — connecting a channel without saying what it does when nothing else matches is the misconfiguration, so it is caught here rather than discovered as silence in production.
|
|
2778
2796
|
*
|
|
2779
2797
|
*/
|
|
@@ -2790,7 +2808,7 @@ type ChannelCreate = {
|
|
|
2790
2808
|
*
|
|
2791
2809
|
*/
|
|
2792
2810
|
max_context_messages?: number | null;
|
|
2793
|
-
channel?: 'whatsapp' | 'discord';
|
|
2811
|
+
channel?: 'whatsapp' | 'discord' | 'x';
|
|
2794
2812
|
/**
|
|
2795
2813
|
* Required for `whatsapp`.
|
|
2796
2814
|
*/
|
|
@@ -2821,11 +2839,30 @@ type ChannelCreate = {
|
|
|
2821
2839
|
*/
|
|
2822
2840
|
application_id?: string;
|
|
2823
2841
|
/**
|
|
2824
|
-
* Write-only. Required for `discord`. The bot token, sealed in naturali's encrypted store
|
|
2842
|
+
* Write-only. Required for `discord` and `x`. The bot token, sealed in naturali's encrypted store. Accepted on write, never returned.
|
|
2825
2843
|
*
|
|
2826
2844
|
*/
|
|
2827
2845
|
bot_token?: string;
|
|
2828
2846
|
modes?: DiscordModes;
|
|
2847
|
+
/**
|
|
2848
|
+
* Write-only. Required for `x`. The consumer key (API key) of the X app that issued the bot. Accepted on write, never returned.
|
|
2849
|
+
*
|
|
2850
|
+
*/
|
|
2851
|
+
consumer_key?: string;
|
|
2852
|
+
/**
|
|
2853
|
+
* Write-only. Required for `x`. The app's consumer secret; X signs webhook deliveries with it. Accepted on write, never returned.
|
|
2854
|
+
*
|
|
2855
|
+
*/
|
|
2856
|
+
consumer_secret?: string;
|
|
2857
|
+
/**
|
|
2858
|
+
* Write-only. Optional for `x`, with `chat_key_version`: the bot's exported chat private keys (base64), to keep a key already registered instead of registering a new one.
|
|
2859
|
+
*
|
|
2860
|
+
*/
|
|
2861
|
+
chat_private_keys?: string;
|
|
2862
|
+
/**
|
|
2863
|
+
* Optional for `x`, with `chat_private_keys`. The registered key's version.
|
|
2864
|
+
*/
|
|
2865
|
+
chat_key_version?: string;
|
|
2829
2866
|
};
|
|
2830
2867
|
type WhatsAppSignupLink = {
|
|
2831
2868
|
/**
|
|
@@ -2845,7 +2882,7 @@ type WhatsAppSignupComplete = {
|
|
|
2845
2882
|
phone_number_id: string;
|
|
2846
2883
|
};
|
|
2847
2884
|
/**
|
|
2848
|
-
* At least one field is required. For WhatsApp, `access_token` rotates the write-only credential; for Discord, `bot_token` rotates the sealed bot token (checked with Discord as on connect) and `modes` turns the gateway flows on or off. `default` replaces the channel's default action whole when present. The worker picks either change up on its next poll and reconnects.
|
|
2885
|
+
* At least one field is required. For WhatsApp, `access_token` rotates the write-only credential; for Discord, `bot_token` rotates the sealed bot token (checked with Discord as on connect) and `modes` turns the gateway flows on or off; for X, `bot_token` rotates the sealed token of the same bot. `default` replaces the channel's default action whole when present. The worker picks either change up on its next poll and reconnects.
|
|
2849
2886
|
*
|
|
2850
2887
|
*/
|
|
2851
2888
|
type ChannelUpdate = {
|
|
@@ -2862,7 +2899,7 @@ type ChannelUpdate = {
|
|
|
2862
2899
|
waba_id?: string;
|
|
2863
2900
|
credential_source?: 'byot' | 'embedded_signup';
|
|
2864
2901
|
/**
|
|
2865
|
-
* Discord. Write-only. Rotates the sealed bot token.
|
|
2902
|
+
* Discord or X. Write-only. Rotates the sealed bot token.
|
|
2866
2903
|
*/
|
|
2867
2904
|
bot_token?: string;
|
|
2868
2905
|
modes?: DiscordModes;
|
|
@@ -5660,6 +5697,7 @@ type ChannelResourceProperties = {
|
|
|
5660
5697
|
credential_source?: string;
|
|
5661
5698
|
pin?: string;
|
|
5662
5699
|
application_id?: string;
|
|
5700
|
+
chat_key_version?: string;
|
|
5663
5701
|
};
|
|
5664
5702
|
/**
|
|
5665
5703
|
* An MCP server serving a chosen set of the project's tools.
|
|
@@ -10641,6 +10679,10 @@ type ChannelResourcePropertiesWritable = {
|
|
|
10641
10679
|
pin?: string;
|
|
10642
10680
|
application_id?: string;
|
|
10643
10681
|
bot_token?: string;
|
|
10682
|
+
consumer_key?: string;
|
|
10683
|
+
consumer_secret?: string;
|
|
10684
|
+
chat_private_keys?: string;
|
|
10685
|
+
chat_key_version?: string;
|
|
10644
10686
|
};
|
|
10645
10687
|
/**
|
|
10646
10688
|
* An MCP server serving a chosen set of the project's tools.
|
|
@@ -10687,7 +10729,7 @@ type Cursor = string;
|
|
|
10687
10729
|
*/
|
|
10688
10730
|
type TagsQuery = Array<string>;
|
|
10689
10731
|
/**
|
|
10690
|
-
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.
|
|
10732
|
+
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `x:dm:<user_id>`), URL-encoded.
|
|
10691
10733
|
*
|
|
10692
10734
|
*/
|
|
10693
10735
|
type Identifier = string;
|
|
@@ -11590,7 +11632,7 @@ type DeleteAddressData = {
|
|
|
11590
11632
|
*/
|
|
11591
11633
|
project_id: string;
|
|
11592
11634
|
/**
|
|
11593
|
-
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.
|
|
11635
|
+
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `x:dm:<user_id>`), URL-encoded.
|
|
11594
11636
|
*
|
|
11595
11637
|
*/
|
|
11596
11638
|
identifier: string;
|
|
@@ -11628,7 +11670,7 @@ type GetAddressData = {
|
|
|
11628
11670
|
*/
|
|
11629
11671
|
project_id: string;
|
|
11630
11672
|
/**
|
|
11631
|
-
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.
|
|
11673
|
+
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `x:dm:<user_id>`), URL-encoded.
|
|
11632
11674
|
*
|
|
11633
11675
|
*/
|
|
11634
11676
|
identifier: string;
|
|
@@ -11666,7 +11708,7 @@ type SetAddressData = {
|
|
|
11666
11708
|
*/
|
|
11667
11709
|
project_id: string;
|
|
11668
11710
|
/**
|
|
11669
|
-
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.
|
|
11711
|
+
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `x:dm:<user_id>`), URL-encoded.
|
|
11670
11712
|
*
|
|
11671
11713
|
*/
|
|
11672
11714
|
identifier: string;
|
|
@@ -11717,7 +11759,7 @@ type ListAddressConversationsData = {
|
|
|
11717
11759
|
*/
|
|
11718
11760
|
project_id: string;
|
|
11719
11761
|
/**
|
|
11720
|
-
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.
|
|
11762
|
+
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `x:dm:<user_id>`), URL-encoded.
|
|
11721
11763
|
*
|
|
11722
11764
|
*/
|
|
11723
11765
|
identifier: string;
|
|
@@ -15302,7 +15344,12 @@ type CreateChannelErrors = {
|
|
|
15302
15344
|
*/
|
|
15303
15345
|
409: ErrorResponse;
|
|
15304
15346
|
/**
|
|
15305
|
-
*
|
|
15347
|
+
* `x_key_registration_limited` — the X bot used its daily chat key registrations; `details.reset_at` says when it may register again.
|
|
15348
|
+
*
|
|
15349
|
+
*/
|
|
15350
|
+
429: ErrorResponse;
|
|
15351
|
+
/**
|
|
15352
|
+
* The requested path is not enabled on this deployment (e.g. embedded signup, or a Discord or X channel, where it is not enabled).
|
|
15306
15353
|
*
|
|
15307
15354
|
*/
|
|
15308
15355
|
501: ErrorResponse;
|
|
@@ -15349,7 +15396,7 @@ type CreateWhatsappSignupLinkErrors = {
|
|
|
15349
15396
|
*/
|
|
15350
15397
|
404: ErrorResponse;
|
|
15351
15398
|
/**
|
|
15352
|
-
* The requested path is not enabled on this deployment (e.g. embedded signup or a Discord channel where
|
|
15399
|
+
* The requested path is not enabled on this deployment (e.g. embedded signup, or a Discord or X channel, where it is not enabled).
|
|
15353
15400
|
*
|
|
15354
15401
|
*/
|
|
15355
15402
|
501: ErrorResponse;
|
|
@@ -15390,7 +15437,7 @@ type CompleteWhatsappSignupErrors = {
|
|
|
15390
15437
|
*/
|
|
15391
15438
|
409: ErrorResponse;
|
|
15392
15439
|
/**
|
|
15393
|
-
* The requested path is not enabled on this deployment (e.g. embedded signup or a Discord channel where
|
|
15440
|
+
* The requested path is not enabled on this deployment (e.g. embedded signup, or a Discord or X channel, where it is not enabled).
|
|
15394
15441
|
*
|
|
15395
15442
|
*/
|
|
15396
15443
|
501: ErrorResponse;
|
|
@@ -15555,7 +15602,7 @@ type ListChannelConversationsData = {
|
|
|
15555
15602
|
*/
|
|
15556
15603
|
cursor?: string;
|
|
15557
15604
|
/**
|
|
15558
|
-
* Filter to one address by the identifier conversations carry (`discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `whatsapp:dm:<phone>`), in this channel's kind; any other form is `400`. At most one row matches.
|
|
15605
|
+
* Filter to one address by the identifier conversations carry (`discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `whatsapp:dm:<phone>`, `x:dm:<user_id>`), in this channel's kind; any other form is `400`. At most one row matches.
|
|
15559
15606
|
*
|
|
15560
15607
|
*/
|
|
15561
15608
|
identifier?: string;
|
|
@@ -15593,7 +15640,7 @@ type ListChannelConversationsResponse = ListChannelConversationsResponses[keyof
|
|
|
15593
15640
|
type OpenChannelConversationData = {
|
|
15594
15641
|
body: {
|
|
15595
15642
|
/**
|
|
15596
|
-
* The address identifier, in this channel's kind (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`); any other form is `400`.
|
|
15643
|
+
* The address identifier, in this channel's kind (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `x:dm:<user_id>`); any other form is `400`.
|
|
15597
15644
|
*/
|
|
15598
15645
|
identifier: string;
|
|
15599
15646
|
};
|
|
@@ -35665,6 +35712,7 @@ export declare class Channels {
|
|
|
35665
35712
|
*
|
|
35666
35713
|
* Connect a channel. The required fields depend on `channel`; no credential is ever returned.
|
|
35667
35714
|
* **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 invalid_bot_token` when Discord rejects it, `400 application_mismatch` when it belongs to another application, `502 discord_unavailable` when Discord cannot be read. Returns `501` when this deployment does not enable Discord channels.
|
|
35715
|
+
* **X** (`channel: x`) — supply the bot's `bot_token` (X developer portal, Chat bots) and the `consumer_key` and `consumer_secret` of the app that issued it. naturali then registers its own webhook on that app, subscribes it to the bot's incoming direct messages and registers the bot's chat encryption key, keeping the private key sealed: replies are end-to-end encrypted, and the project never handles keys, webhooks or ciphertext. Pass `chat_private_keys` and `chat_key_version` instead to keep a key the bot already registered. `400 invalid_bot_token` or `400 invalid_consumer_credentials` when X rejects a credential, `409 bot_in_use` when another channel holds the bot, `502 x_provisioning_failed` when X refuses the webhook or the subscription (an app holds a limited number of webhooks), `429 x_key_registration_limited` when the bot used its few daily key registrations, `502 x_unavailable` when X cannot be reached. Returns `501` when this deployment does not enable X channels.
|
|
35668
35716
|
* **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret:
|
|
35669
35717
|
* * **BYOT** (`credential_source: byot`, default) — supply
|
|
35670
35718
|
* `phone_number_id` and `access_token` from your own Meta app. The
|
|
@@ -35730,7 +35778,7 @@ export declare class Channels {
|
|
|
35730
35778
|
* List the channel's conversations
|
|
35731
35779
|
*
|
|
35732
35780
|
* A cursor page of the channel's conversations, newest first. A conversation is one address's dialogue on the channel — the continuity anchor that resumes the same runtime session instead of starting fresh per message — so this is the read path for who has talked to the channel and which actor/session their dialogue resolved to.
|
|
35733
|
-
* Conversations are created by the inbound path (the WhatsApp
|
|
35781
|
+
* Conversations are created by the inbound path (the WhatsApp and X webhooks, the Discord gateway worker) when a real message arrives; there is no way to create one directly.
|
|
35734
35782
|
*
|
|
35735
35783
|
*/
|
|
35736
35784
|
static listChannelConversations<ThrowOnError extends boolean = false>(options: Options<ListChannelConversationsData, ThrowOnError>): RequestResult<ListChannelConversationsResponses, ListChannelConversationsErrors, ThrowOnError>;
|
|
@@ -37764,7 +37812,7 @@ export declare class Playbooks {
|
|
|
37764
37812
|
*
|
|
37765
37813
|
* Creates a playbook at version 1. The definition is refused with `400 PLAYBOOK_VALIDATION_FAILED` when it holds a duplicate node or input, an input reading a missing node or field, an `execute` node without an executor or another kind with one, transformations on a non-final node, or a cycle; `meta.problems` lists every one. A duplicate `name` in the project is `409 NAME_CONFLICT`.
|
|
37766
37814
|
*
|
|
37767
|
-
* The caller becomes the version's author, whom its executors run as, so it must be allowed to start every executor the definition names (`403
|
|
37815
|
+
* The caller becomes the version's author, whom its executors run as, so it must be allowed to start every executor the definition names (`403 ACTION_NOT_HELD`), and each must exist in the project, or be an agent or tool shared with it (`400 PLAYBOOK_VALIDATION_FAILED`, an `EXECUTOR_NOT_FOUND` problem). A `tool` executor on an `mcp` tool must name in `operation_id` an action the tool's binding allows (`EXECUTOR_ACTION_REQUIRED`, `EXECUTOR_ACTION_UNAVAILABLE`). An executor cannot be a `client` tool (`EXECUTOR_TOOL_UNSUPPORTED`), nor a transformation's tool a `client` or `mcp` tool (`TRANSFORMATION_TOOL_UNSUPPORTED`). A definition with executors written with a trigger or OAuth token is `409 PLAYBOOK_AUTHOR_UNAVAILABLE`: those carry their boundary in the token, so no run can act as them.
|
|
37768
37816
|
*/
|
|
37769
37817
|
static createPlaybook<ThrowOnError extends boolean = false>(options: Options<CreatePlaybookData, ThrowOnError>): RequestResult<CreatePlaybookResponses, CreatePlaybookErrors, ThrowOnError>;
|
|
37770
37818
|
/**
|
|
@@ -37792,7 +37840,7 @@ export declare class Playbooks {
|
|
|
37792
37840
|
*
|
|
37793
37841
|
* Updates any of `name`, `description` and `definition`. Only a change to `definition` archives a new version; a rename or a rewrite of the definition the playbook already holds leaves `version` where it is. A case keeps the version it was created on.
|
|
37794
37842
|
*
|
|
37795
|
-
* A new version is authored by the caller, checked as on create: `403
|
|
37843
|
+
* A new version is authored by the caller, checked as on create: `403 ACTION_NOT_HELD` for an executor it may not start, an `EXECUTOR_NOT_FOUND` problem for one that does not exist, `EXECUTOR_ACTION_REQUIRED` or `EXECUTOR_ACTION_UNAVAILABLE` for an `mcp` tool action a run could not call, `EXECUTOR_TOOL_UNSUPPORTED` for a `client` tool executor, `TRANSFORMATION_TOOL_UNSUPPORTED` for a `client` or `mcp` transformation tool, `409 PLAYBOOK_AUTHOR_UNAVAILABLE` for a trigger or OAuth token.
|
|
37796
37844
|
*/
|
|
37797
37845
|
static updatePlaybook<ThrowOnError extends boolean = false>(options: Options<UpdatePlaybookData, ThrowOnError>): RequestResult<UpdatePlaybookResponses, UpdatePlaybookErrors, ThrowOnError>;
|
|
37798
37846
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1322,7 +1322,7 @@ type CreateAgentRequest = {
|
|
|
1322
1322
|
*/
|
|
1323
1323
|
temperature?: number;
|
|
1324
1324
|
/**
|
|
1325
|
-
* Knowledge search run before every generation; its matches are prepended as reference context. See [Knowledge Config](/docs/modules/agents#knowledge-config).
|
|
1325
|
+
* Knowledge search run before every generation; its matches are prepended as reference context. Every id it names is a resource of the agent's project, else `400`. See [Knowledge Config](/docs/modules/agents#knowledge-config).
|
|
1326
1326
|
*/
|
|
1327
1327
|
knowledge_config?: {
|
|
1328
1328
|
memory_store_ids?: Array<string>;
|
|
@@ -1470,7 +1470,7 @@ type UpdateAgentRequest = {
|
|
|
1470
1470
|
*/
|
|
1471
1471
|
temperature?: number | null;
|
|
1472
1472
|
/**
|
|
1473
|
-
* Knowledge search run before every generation; its matches are prepended as reference context. `null` turns it off. See [Knowledge Config](/docs/modules/agents#knowledge-config).
|
|
1473
|
+
* Knowledge search run before every generation; its matches are prepended as reference context. `null` turns it off. Every id it names is a resource of the agent's project, else `400`. See [Knowledge Config](/docs/modules/agents#knowledge-config).
|
|
1474
1474
|
*/
|
|
1475
1475
|
knowledge_config?: {
|
|
1476
1476
|
memory_store_ids?: Array<string>;
|
|
@@ -2480,7 +2480,7 @@ type AuditEntry = {
|
|
|
2480
2480
|
created_at?: Date;
|
|
2481
2481
|
};
|
|
2482
2482
|
/**
|
|
2483
|
-
* The tool call the write was made on behalf of, for a write a `naturali` tool made; null for any other write.
|
|
2483
|
+
* The tool call the write was made on behalf of, for a write a `naturali` tool made; null for any other write. The `created_by_principal_*` pair stays the project credential's; the request is checked against the project credential capped by the authority the tool call was sent with.
|
|
2484
2484
|
*/
|
|
2485
2485
|
type OnBehalfOf = {
|
|
2486
2486
|
tool_id?: string | null;
|
|
@@ -2603,7 +2603,7 @@ type ChannelKind = {
|
|
|
2603
2603
|
/**
|
|
2604
2604
|
* The channel kind.
|
|
2605
2605
|
*/
|
|
2606
|
-
kind: 'whatsapp' | 'discord';
|
|
2606
|
+
kind: 'whatsapp' | 'discord' | 'x';
|
|
2607
2607
|
/**
|
|
2608
2608
|
* This kind's conversational shapes.
|
|
2609
2609
|
*/
|
|
@@ -2702,7 +2702,7 @@ type Channel = {
|
|
|
2702
2702
|
/**
|
|
2703
2703
|
* The channel kind.
|
|
2704
2704
|
*/
|
|
2705
|
-
channel: 'whatsapp' | 'discord';
|
|
2705
|
+
channel: 'whatsapp' | 'discord' | 'x';
|
|
2706
2706
|
status: 'active' | 'disabled';
|
|
2707
2707
|
/**
|
|
2708
2708
|
* How the credential was obtained.
|
|
@@ -2732,6 +2732,19 @@ type Channel = {
|
|
|
2732
2732
|
*/
|
|
2733
2733
|
application_id: string | null;
|
|
2734
2734
|
modes: DiscordModes;
|
|
2735
|
+
/**
|
|
2736
|
+
* X. The bot account's user id. Absent for other kinds.
|
|
2737
|
+
*/
|
|
2738
|
+
bot_user_id?: string | null;
|
|
2739
|
+
/**
|
|
2740
|
+
* X. The bot account's handle, without `@`. Absent for other kinds.
|
|
2741
|
+
*/
|
|
2742
|
+
username?: string | null;
|
|
2743
|
+
/**
|
|
2744
|
+
* X. The version of the bot's registered chat encryption key. Absent for other kinds.
|
|
2745
|
+
*
|
|
2746
|
+
*/
|
|
2747
|
+
chat_key_version?: string | null;
|
|
2735
2748
|
default: ChannelAction;
|
|
2736
2749
|
/**
|
|
2737
2750
|
* The most recent messages each conversation's session sends the model, taking precedence over the agent's own `max_context_messages`. Null defers to the agent.
|
|
@@ -2774,6 +2787,11 @@ type Channel = {
|
|
|
2774
2787
|
* as a secret on the runtime; a deployment that does not enable Discord
|
|
2775
2788
|
* channels returns `501`.
|
|
2776
2789
|
*
|
|
2790
|
+
* * **x** — `bot_token`, `consumer_key` and `consumer_secret`
|
|
2791
|
+
* (write-only); naturali provisions the webhook, the subscription and
|
|
2792
|
+
* the bot's chat key. Optional `chat_private_keys` with
|
|
2793
|
+
* `chat_key_version` keep a key already registered.
|
|
2794
|
+
*
|
|
2777
2795
|
* No credential value is ever returned. `default` is required — connecting a channel without saying what it does when nothing else matches is the misconfiguration, so it is caught here rather than discovered as silence in production.
|
|
2778
2796
|
*
|
|
2779
2797
|
*/
|
|
@@ -2790,7 +2808,7 @@ type ChannelCreate = {
|
|
|
2790
2808
|
*
|
|
2791
2809
|
*/
|
|
2792
2810
|
max_context_messages?: number | null;
|
|
2793
|
-
channel?: 'whatsapp' | 'discord';
|
|
2811
|
+
channel?: 'whatsapp' | 'discord' | 'x';
|
|
2794
2812
|
/**
|
|
2795
2813
|
* Required for `whatsapp`.
|
|
2796
2814
|
*/
|
|
@@ -2821,11 +2839,30 @@ type ChannelCreate = {
|
|
|
2821
2839
|
*/
|
|
2822
2840
|
application_id?: string;
|
|
2823
2841
|
/**
|
|
2824
|
-
* Write-only. Required for `discord`. The bot token, sealed in naturali's encrypted store
|
|
2842
|
+
* Write-only. Required for `discord` and `x`. The bot token, sealed in naturali's encrypted store. Accepted on write, never returned.
|
|
2825
2843
|
*
|
|
2826
2844
|
*/
|
|
2827
2845
|
bot_token?: string;
|
|
2828
2846
|
modes?: DiscordModes;
|
|
2847
|
+
/**
|
|
2848
|
+
* Write-only. Required for `x`. The consumer key (API key) of the X app that issued the bot. Accepted on write, never returned.
|
|
2849
|
+
*
|
|
2850
|
+
*/
|
|
2851
|
+
consumer_key?: string;
|
|
2852
|
+
/**
|
|
2853
|
+
* Write-only. Required for `x`. The app's consumer secret; X signs webhook deliveries with it. Accepted on write, never returned.
|
|
2854
|
+
*
|
|
2855
|
+
*/
|
|
2856
|
+
consumer_secret?: string;
|
|
2857
|
+
/**
|
|
2858
|
+
* Write-only. Optional for `x`, with `chat_key_version`: the bot's exported chat private keys (base64), to keep a key already registered instead of registering a new one.
|
|
2859
|
+
*
|
|
2860
|
+
*/
|
|
2861
|
+
chat_private_keys?: string;
|
|
2862
|
+
/**
|
|
2863
|
+
* Optional for `x`, with `chat_private_keys`. The registered key's version.
|
|
2864
|
+
*/
|
|
2865
|
+
chat_key_version?: string;
|
|
2829
2866
|
};
|
|
2830
2867
|
type WhatsAppSignupLink = {
|
|
2831
2868
|
/**
|
|
@@ -2845,7 +2882,7 @@ type WhatsAppSignupComplete = {
|
|
|
2845
2882
|
phone_number_id: string;
|
|
2846
2883
|
};
|
|
2847
2884
|
/**
|
|
2848
|
-
* At least one field is required. For WhatsApp, `access_token` rotates the write-only credential; for Discord, `bot_token` rotates the sealed bot token (checked with Discord as on connect) and `modes` turns the gateway flows on or off. `default` replaces the channel's default action whole when present. The worker picks either change up on its next poll and reconnects.
|
|
2885
|
+
* At least one field is required. For WhatsApp, `access_token` rotates the write-only credential; for Discord, `bot_token` rotates the sealed bot token (checked with Discord as on connect) and `modes` turns the gateway flows on or off; for X, `bot_token` rotates the sealed token of the same bot. `default` replaces the channel's default action whole when present. The worker picks either change up on its next poll and reconnects.
|
|
2849
2886
|
*
|
|
2850
2887
|
*/
|
|
2851
2888
|
type ChannelUpdate = {
|
|
@@ -2862,7 +2899,7 @@ type ChannelUpdate = {
|
|
|
2862
2899
|
waba_id?: string;
|
|
2863
2900
|
credential_source?: 'byot' | 'embedded_signup';
|
|
2864
2901
|
/**
|
|
2865
|
-
* Discord. Write-only. Rotates the sealed bot token.
|
|
2902
|
+
* Discord or X. Write-only. Rotates the sealed bot token.
|
|
2866
2903
|
*/
|
|
2867
2904
|
bot_token?: string;
|
|
2868
2905
|
modes?: DiscordModes;
|
|
@@ -5660,6 +5697,7 @@ type ChannelResourceProperties = {
|
|
|
5660
5697
|
credential_source?: string;
|
|
5661
5698
|
pin?: string;
|
|
5662
5699
|
application_id?: string;
|
|
5700
|
+
chat_key_version?: string;
|
|
5663
5701
|
};
|
|
5664
5702
|
/**
|
|
5665
5703
|
* An MCP server serving a chosen set of the project's tools.
|
|
@@ -10641,6 +10679,10 @@ type ChannelResourcePropertiesWritable = {
|
|
|
10641
10679
|
pin?: string;
|
|
10642
10680
|
application_id?: string;
|
|
10643
10681
|
bot_token?: string;
|
|
10682
|
+
consumer_key?: string;
|
|
10683
|
+
consumer_secret?: string;
|
|
10684
|
+
chat_private_keys?: string;
|
|
10685
|
+
chat_key_version?: string;
|
|
10644
10686
|
};
|
|
10645
10687
|
/**
|
|
10646
10688
|
* An MCP server serving a chosen set of the project's tools.
|
|
@@ -10687,7 +10729,7 @@ type Cursor = string;
|
|
|
10687
10729
|
*/
|
|
10688
10730
|
type TagsQuery = Array<string>;
|
|
10689
10731
|
/**
|
|
10690
|
-
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.
|
|
10732
|
+
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `x:dm:<user_id>`), URL-encoded.
|
|
10691
10733
|
*
|
|
10692
10734
|
*/
|
|
10693
10735
|
type Identifier = string;
|
|
@@ -11590,7 +11632,7 @@ type DeleteAddressData = {
|
|
|
11590
11632
|
*/
|
|
11591
11633
|
project_id: string;
|
|
11592
11634
|
/**
|
|
11593
|
-
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.
|
|
11635
|
+
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `x:dm:<user_id>`), URL-encoded.
|
|
11594
11636
|
*
|
|
11595
11637
|
*/
|
|
11596
11638
|
identifier: string;
|
|
@@ -11628,7 +11670,7 @@ type GetAddressData = {
|
|
|
11628
11670
|
*/
|
|
11629
11671
|
project_id: string;
|
|
11630
11672
|
/**
|
|
11631
|
-
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.
|
|
11673
|
+
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `x:dm:<user_id>`), URL-encoded.
|
|
11632
11674
|
*
|
|
11633
11675
|
*/
|
|
11634
11676
|
identifier: string;
|
|
@@ -11666,7 +11708,7 @@ type SetAddressData = {
|
|
|
11666
11708
|
*/
|
|
11667
11709
|
project_id: string;
|
|
11668
11710
|
/**
|
|
11669
|
-
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.
|
|
11711
|
+
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `x:dm:<user_id>`), URL-encoded.
|
|
11670
11712
|
*
|
|
11671
11713
|
*/
|
|
11672
11714
|
identifier: string;
|
|
@@ -11717,7 +11759,7 @@ type ListAddressConversationsData = {
|
|
|
11717
11759
|
*/
|
|
11718
11760
|
project_id: string;
|
|
11719
11761
|
/**
|
|
11720
|
-
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`), URL-encoded.
|
|
11762
|
+
* The prefixed, self-describing channel identifier (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `x:dm:<user_id>`), URL-encoded.
|
|
11721
11763
|
*
|
|
11722
11764
|
*/
|
|
11723
11765
|
identifier: string;
|
|
@@ -15302,7 +15344,12 @@ type CreateChannelErrors = {
|
|
|
15302
15344
|
*/
|
|
15303
15345
|
409: ErrorResponse;
|
|
15304
15346
|
/**
|
|
15305
|
-
*
|
|
15347
|
+
* `x_key_registration_limited` — the X bot used its daily chat key registrations; `details.reset_at` says when it may register again.
|
|
15348
|
+
*
|
|
15349
|
+
*/
|
|
15350
|
+
429: ErrorResponse;
|
|
15351
|
+
/**
|
|
15352
|
+
* The requested path is not enabled on this deployment (e.g. embedded signup, or a Discord or X channel, where it is not enabled).
|
|
15306
15353
|
*
|
|
15307
15354
|
*/
|
|
15308
15355
|
501: ErrorResponse;
|
|
@@ -15349,7 +15396,7 @@ type CreateWhatsappSignupLinkErrors = {
|
|
|
15349
15396
|
*/
|
|
15350
15397
|
404: ErrorResponse;
|
|
15351
15398
|
/**
|
|
15352
|
-
* The requested path is not enabled on this deployment (e.g. embedded signup or a Discord channel where
|
|
15399
|
+
* The requested path is not enabled on this deployment (e.g. embedded signup, or a Discord or X channel, where it is not enabled).
|
|
15353
15400
|
*
|
|
15354
15401
|
*/
|
|
15355
15402
|
501: ErrorResponse;
|
|
@@ -15390,7 +15437,7 @@ type CompleteWhatsappSignupErrors = {
|
|
|
15390
15437
|
*/
|
|
15391
15438
|
409: ErrorResponse;
|
|
15392
15439
|
/**
|
|
15393
|
-
* The requested path is not enabled on this deployment (e.g. embedded signup or a Discord channel where
|
|
15440
|
+
* The requested path is not enabled on this deployment (e.g. embedded signup, or a Discord or X channel, where it is not enabled).
|
|
15394
15441
|
*
|
|
15395
15442
|
*/
|
|
15396
15443
|
501: ErrorResponse;
|
|
@@ -15555,7 +15602,7 @@ type ListChannelConversationsData = {
|
|
|
15555
15602
|
*/
|
|
15556
15603
|
cursor?: string;
|
|
15557
15604
|
/**
|
|
15558
|
-
* Filter to one address by the identifier conversations carry (`discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `whatsapp:dm:<phone>`), in this channel's kind; any other form is `400`. At most one row matches.
|
|
15605
|
+
* Filter to one address by the identifier conversations carry (`discord:dm:<user_id>`, `discord:thread:<guild_id>:<channel_id>`, `whatsapp:dm:<phone>`, `x:dm:<user_id>`), in this channel's kind; any other form is `400`. At most one row matches.
|
|
15559
15606
|
*
|
|
15560
15607
|
*/
|
|
15561
15608
|
identifier?: string;
|
|
@@ -15593,7 +15640,7 @@ type ListChannelConversationsResponse = ListChannelConversationsResponses[keyof
|
|
|
15593
15640
|
type OpenChannelConversationData = {
|
|
15594
15641
|
body: {
|
|
15595
15642
|
/**
|
|
15596
|
-
* The address identifier, in this channel's kind (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`); any other form is `400`.
|
|
15643
|
+
* The address identifier, in this channel's kind (`whatsapp:dm:<phone>`, `discord:dm:<user_id>`, `x:dm:<user_id>`); any other form is `400`.
|
|
15597
15644
|
*/
|
|
15598
15645
|
identifier: string;
|
|
15599
15646
|
};
|
|
@@ -35665,6 +35712,7 @@ export declare class Channels {
|
|
|
35665
35712
|
*
|
|
35666
35713
|
* Connect a channel. The required fields depend on `channel`; no credential is ever returned.
|
|
35667
35714
|
* **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 invalid_bot_token` when Discord rejects it, `400 application_mismatch` when it belongs to another application, `502 discord_unavailable` when Discord cannot be read. Returns `501` when this deployment does not enable Discord channels.
|
|
35715
|
+
* **X** (`channel: x`) — supply the bot's `bot_token` (X developer portal, Chat bots) and the `consumer_key` and `consumer_secret` of the app that issued it. naturali then registers its own webhook on that app, subscribes it to the bot's incoming direct messages and registers the bot's chat encryption key, keeping the private key sealed: replies are end-to-end encrypted, and the project never handles keys, webhooks or ciphertext. Pass `chat_private_keys` and `chat_key_version` instead to keep a key the bot already registered. `400 invalid_bot_token` or `400 invalid_consumer_credentials` when X rejects a credential, `409 bot_in_use` when another channel holds the bot, `502 x_provisioning_failed` when X refuses the webhook or the subscription (an app holds a limited number of webhooks), `429 x_key_registration_limited` when the bot used its few daily key registrations, `502 x_unavailable` when X cannot be reached. Returns `501` when this deployment does not enable X channels.
|
|
35668
35716
|
* **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret:
|
|
35669
35717
|
* * **BYOT** (`credential_source: byot`, default) — supply
|
|
35670
35718
|
* `phone_number_id` and `access_token` from your own Meta app. The
|
|
@@ -35730,7 +35778,7 @@ export declare class Channels {
|
|
|
35730
35778
|
* List the channel's conversations
|
|
35731
35779
|
*
|
|
35732
35780
|
* A cursor page of the channel's conversations, newest first. A conversation is one address's dialogue on the channel — the continuity anchor that resumes the same runtime session instead of starting fresh per message — so this is the read path for who has talked to the channel and which actor/session their dialogue resolved to.
|
|
35733
|
-
* Conversations are created by the inbound path (the WhatsApp
|
|
35781
|
+
* Conversations are created by the inbound path (the WhatsApp and X webhooks, the Discord gateway worker) when a real message arrives; there is no way to create one directly.
|
|
35734
35782
|
*
|
|
35735
35783
|
*/
|
|
35736
35784
|
static listChannelConversations<ThrowOnError extends boolean = false>(options: Options<ListChannelConversationsData, ThrowOnError>): RequestResult<ListChannelConversationsResponses, ListChannelConversationsErrors, ThrowOnError>;
|
|
@@ -37764,7 +37812,7 @@ export declare class Playbooks {
|
|
|
37764
37812
|
*
|
|
37765
37813
|
* Creates a playbook at version 1. The definition is refused with `400 PLAYBOOK_VALIDATION_FAILED` when it holds a duplicate node or input, an input reading a missing node or field, an `execute` node without an executor or another kind with one, transformations on a non-final node, or a cycle; `meta.problems` lists every one. A duplicate `name` in the project is `409 NAME_CONFLICT`.
|
|
37766
37814
|
*
|
|
37767
|
-
* The caller becomes the version's author, whom its executors run as, so it must be allowed to start every executor the definition names (`403
|
|
37815
|
+
* The caller becomes the version's author, whom its executors run as, so it must be allowed to start every executor the definition names (`403 ACTION_NOT_HELD`), and each must exist in the project, or be an agent or tool shared with it (`400 PLAYBOOK_VALIDATION_FAILED`, an `EXECUTOR_NOT_FOUND` problem). A `tool` executor on an `mcp` tool must name in `operation_id` an action the tool's binding allows (`EXECUTOR_ACTION_REQUIRED`, `EXECUTOR_ACTION_UNAVAILABLE`). An executor cannot be a `client` tool (`EXECUTOR_TOOL_UNSUPPORTED`), nor a transformation's tool a `client` or `mcp` tool (`TRANSFORMATION_TOOL_UNSUPPORTED`). A definition with executors written with a trigger or OAuth token is `409 PLAYBOOK_AUTHOR_UNAVAILABLE`: those carry their boundary in the token, so no run can act as them.
|
|
37768
37816
|
*/
|
|
37769
37817
|
static createPlaybook<ThrowOnError extends boolean = false>(options: Options<CreatePlaybookData, ThrowOnError>): RequestResult<CreatePlaybookResponses, CreatePlaybookErrors, ThrowOnError>;
|
|
37770
37818
|
/**
|
|
@@ -37792,7 +37840,7 @@ export declare class Playbooks {
|
|
|
37792
37840
|
*
|
|
37793
37841
|
* Updates any of `name`, `description` and `definition`. Only a change to `definition` archives a new version; a rename or a rewrite of the definition the playbook already holds leaves `version` where it is. A case keeps the version it was created on.
|
|
37794
37842
|
*
|
|
37795
|
-
* A new version is authored by the caller, checked as on create: `403
|
|
37843
|
+
* A new version is authored by the caller, checked as on create: `403 ACTION_NOT_HELD` for an executor it may not start, an `EXECUTOR_NOT_FOUND` problem for one that does not exist, `EXECUTOR_ACTION_REQUIRED` or `EXECUTOR_ACTION_UNAVAILABLE` for an `mcp` tool action a run could not call, `EXECUTOR_TOOL_UNSUPPORTED` for a `client` tool executor, `TRANSFORMATION_TOOL_UNSUPPORTED` for a `client` or `mcp` transformation tool, `409 PLAYBOOK_AUTHOR_UNAVAILABLE` for a trigger or OAuth token.
|
|
37796
37844
|
*/
|
|
37797
37845
|
static updatePlaybook<ThrowOnError extends boolean = false>(options: Options<UpdatePlaybookData, ThrowOnError>): RequestResult<UpdatePlaybookResponses, UpdatePlaybookErrors, ThrowOnError>;
|
|
37798
37846
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -919,6 +919,7 @@ var Channels = class {
|
|
|
919
919
|
*
|
|
920
920
|
* Connect a channel. The required fields depend on `channel`; no credential is ever returned.
|
|
921
921
|
* **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 invalid_bot_token` when Discord rejects it, `400 application_mismatch` when it belongs to another application, `502 discord_unavailable` when Discord cannot be read. Returns `501` when this deployment does not enable Discord channels.
|
|
922
|
+
* **X** (`channel: x`) — supply the bot's `bot_token` (X developer portal, Chat bots) and the `consumer_key` and `consumer_secret` of the app that issued it. naturali then registers its own webhook on that app, subscribes it to the bot's incoming direct messages and registers the bot's chat encryption key, keeping the private key sealed: replies are end-to-end encrypted, and the project never handles keys, webhooks or ciphertext. Pass `chat_private_keys` and `chat_key_version` instead to keep a key the bot already registered. `400 invalid_bot_token` or `400 invalid_consumer_credentials` when X rejects a credential, `409 bot_in_use` when another channel holds the bot, `502 x_provisioning_failed` when X refuses the webhook or the subscription (an app holds a limited number of webhooks), `429 x_key_registration_limited` when the bot used its few daily key registrations, `502 x_unavailable` when X cannot be reached. Returns `501` when this deployment does not enable X channels.
|
|
922
923
|
* **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret:
|
|
923
924
|
* * **BYOT** (`credential_source: byot`, default) — supply
|
|
924
925
|
* `phone_number_id` and `access_token` from your own Meta app. The
|
|
@@ -1026,7 +1027,7 @@ var Channels = class {
|
|
|
1026
1027
|
* List the channel's conversations
|
|
1027
1028
|
*
|
|
1028
1029
|
* A cursor page of the channel's conversations, newest first. A conversation is one address's dialogue on the channel — the continuity anchor that resumes the same runtime session instead of starting fresh per message — so this is the read path for who has talked to the channel and which actor/session their dialogue resolved to.
|
|
1029
|
-
* Conversations are created by the inbound path (the WhatsApp
|
|
1030
|
+
* Conversations are created by the inbound path (the WhatsApp and X webhooks, the Discord gateway worker) when a real message arrives; there is no way to create one directly.
|
|
1030
1031
|
*
|
|
1031
1032
|
*/
|
|
1032
1033
|
static listChannelConversations(options) {
|
|
@@ -4951,7 +4952,7 @@ var Playbooks = class {
|
|
|
4951
4952
|
*
|
|
4952
4953
|
* Creates a playbook at version 1. The definition is refused with `400 PLAYBOOK_VALIDATION_FAILED` when it holds a duplicate node or input, an input reading a missing node or field, an `execute` node without an executor or another kind with one, transformations on a non-final node, or a cycle; `meta.problems` lists every one. A duplicate `name` in the project is `409 NAME_CONFLICT`.
|
|
4953
4954
|
*
|
|
4954
|
-
* The caller becomes the version's author, whom its executors run as, so it must be allowed to start every executor the definition names (`403
|
|
4955
|
+
* The caller becomes the version's author, whom its executors run as, so it must be allowed to start every executor the definition names (`403 ACTION_NOT_HELD`), and each must exist in the project, or be an agent or tool shared with it (`400 PLAYBOOK_VALIDATION_FAILED`, an `EXECUTOR_NOT_FOUND` problem). A `tool` executor on an `mcp` tool must name in `operation_id` an action the tool's binding allows (`EXECUTOR_ACTION_REQUIRED`, `EXECUTOR_ACTION_UNAVAILABLE`). An executor cannot be a `client` tool (`EXECUTOR_TOOL_UNSUPPORTED`), nor a transformation's tool a `client` or `mcp` tool (`TRANSFORMATION_TOOL_UNSUPPORTED`). A definition with executors written with a trigger or OAuth token is `409 PLAYBOOK_AUTHOR_UNAVAILABLE`: those carry their boundary in the token, so no run can act as them.
|
|
4955
4956
|
*/
|
|
4956
4957
|
static createPlaybook(options) {
|
|
4957
4958
|
return (options.client ?? client).post({
|
|
@@ -5007,7 +5008,7 @@ var Playbooks = class {
|
|
|
5007
5008
|
*
|
|
5008
5009
|
* Updates any of `name`, `description` and `definition`. Only a change to `definition` archives a new version; a rename or a rewrite of the definition the playbook already holds leaves `version` where it is. A case keeps the version it was created on.
|
|
5009
5010
|
*
|
|
5010
|
-
* A new version is authored by the caller, checked as on create: `403
|
|
5011
|
+
* A new version is authored by the caller, checked as on create: `403 ACTION_NOT_HELD` for an executor it may not start, an `EXECUTOR_NOT_FOUND` problem for one that does not exist, `EXECUTOR_ACTION_REQUIRED` or `EXECUTOR_ACTION_UNAVAILABLE` for an `mcp` tool action a run could not call, `EXECUTOR_TOOL_UNSUPPORTED` for a `client` tool executor, `TRANSFORMATION_TOOL_UNSUPPORTED` for a `client` or `mcp` transformation tool, `409 PLAYBOOK_AUTHOR_UNAVAILABLE` for a trigger or OAuth token.
|
|
5011
5012
|
*/
|
|
5012
5013
|
static updatePlaybook(options) {
|
|
5013
5014
|
return (options.client ?? client).patch({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.237.0",
|
|
4
4
|
"description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"naturali",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@hey-api/openapi-ts": "^0.99.0",
|
|
41
|
-
"@naturali/api": "0.
|
|
41
|
+
"@naturali/api": "0.237.0",
|
|
42
42
|
"@ttoss/openapi-codegen": "^0.10.1",
|
|
43
43
|
"@types/node": "^26.5.1",
|
|
44
44
|
"tsdown": "^0.23.0",
|